mirror of
https://github.com/maputnik/editor.git
synced 2026-12-01 14:24:20 +00:00
deploy: 95bf5f2c55
This commit is contained in:
1 parent
418c853615
commit
26aabaee74
8 files changed
+986
-973
No files matched your search
@@ -0,0 +1,971 @@
|
||||
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(i(n)),l(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{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 ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(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===`pending`&&(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),te(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+ee(a,u),c+=te(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+ee(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid 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 ne(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(Line truncated
|
||||
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
||||
`+ve+e+ye}var xe=!1;function Se(e,t){if(!e||xe)return``;xe=!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(`
|
||||
`),l=s.split(`
|
||||
`);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=`
|
||||
`+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{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function we(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
||||
Error generating stack: `+e.message+`
|
||||
`+e.stack}}var Te=Object.prototype.hasOwnProperty,Ee=t.unstable_scheduleCallback,De=t.unstable_cancelCallback,Oe=t.unstable_shouldYield,ke=t.unstable_requestPaint,Ae=t.unstable_now,je=t.unstable_getCurrentPriorityLevel,Me=t.unstable_ImmediatePriority,Ne=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Fe=t.unstable_LowPriority,Ie=t.unstable_IdlePriority,Le=t.log,Re=t.unstable_setDisableYieldValue,ze=null,Be=null;function Ve(e){if(typeof Le==`function`&&Re(e),Be&&typeof Be.setStrictMode==`function`)try{Be.setStrictMode(ze,e)}catch{}}var He=Math.clz32?Math.clz32:Ge,Ue=Math.log,We=Math.LN2;function Ge(e){return e>>>=0,e===0?32:31-(Ue(e)/We|0)|0}var Ke=256,qe=262144,Je=4194304;function Ye(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 Xe(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=Ye(n))):i=Ye(o):i=Ye(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ye(n))):i=Ye(o)):i=Ye(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 Ze(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qe(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 $e(){var e=Je;return Je<<=1,!(Je&62914560)&&(Je=4194304),e}function et(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nt(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-He(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&&rt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function rt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-He(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function it(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-He(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function at(e,t){var n=t&-t;return n=n&42?1:ot(n),(n&(e.suspendedLanes|t))===0?n:0}function ot(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 st(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ct(){var e=N.p;return e===0?(e=window.event,e===void 0?32:Ap(e.type)):e}function lt(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var ut=Math.random().toString(36).slice(2),dt=`__reactFiber$`+ut,ft=`__reactProps$`+ut,pt=`__reactContainer$`+ut,mt=`__reactEvents$`+ut,ht=`__reactListeners$`+ut,gt=`__reactHandles$`+ut,_t=`__reactResources$`+ut,vt=`__reactMarker$`+ut;function yt(e){delete e[dt],delete e[ft],delete e[mt],delete e[ht],delete e[gt]}function bt(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pt]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Df(e);e!==null;){if(n=e[dt])return n;e=Df(e)}return t}e=n,n=e.parentNode}return null}function xt(e){if(e=e[dt]||e[pt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function St(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ct(e){var t=e[_t];return t||=e[_t]={hoistableStyles:new Map,hoistableScripts:new Map},t}function wt(e){e[vt]=!0}var Tt=new Set,Et={};function Dt(e,t){Ot(e,t),Ot(e+`Capture`,t)}function Ot(e,t){for(Et[e]=t,e=0;e<t.length;e++)Tt.add(t[e])}var kt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001Line truncated
|
||||
`).replace(Kd,``)}function Jd(e,t){return t=qd(t),qd(e)===t}function Yd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Xt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Xt(e,``+r);break;case`className`:Pt(e,`class`,r);break;case`tabIndex`:Pt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Pt(e,n,r);break;case`style`:$t(e,r,o);break;case`data`:if(t!==`object`){Pt(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=rn(``+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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Yd(e,t,`name`,a.name,a,null),Yd(e,t,`formEncType`,a.formEncType,a,null),Yd(e,t,`formMethod`,a.formMethod,a,null),Yd(e,t,`formTarget`,a.formTarget,a,null)):(Yd(e,t,`encType`,a.encType,a,null),Yd(e,t,`method`,a.method,a,null),Yd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=rn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=an);break;case`onScroll`:r!=null&&Fd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Fd(`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=rn(``+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`:Fd(`beforetoggle`,e),Fd(`toggle`,e),Nt(e,`popover`,r);break;case`xlinkActuate`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ft(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ft(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ft(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ft(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Nt(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=tn.get(n)||n,Nt(e,n,r))}}function Xd(e,t,n,r,a,o){switch(n){case`style`:$t(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`?Xt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Xt(e,``+r);break;case`onScroll`:r!=null&&Fd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Fd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=an);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML
Line truncated
|
||||
/* [wrapped with `+t+`] */
|
||||
`)}function as(e){return cu(e)||su(e)||!!(Ot&&e&&e[Ot])}function os(e,t){var n=typeof e;return t??=g,!!t&&(n==`number`||n!=`symbol`&&Ze.test(e))&&e>-1&&e%1==0&&e<t}function ss(e,t,n){if(!wu(n))return!1;var r=typeof t;return(r==`number`?uu(n)&&os(t,n.length):r==`string`&&t in n)?iu(n[t],e):!1}function cs(e,t){if(cu(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||zu(e)?!0:Ne.test(e)||!Me.test(e)||t!=null&&e in it(t)}function ls(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function us(e){var t=Ho(e),n=P[t];if(typeof n!=`function`||!(t in Or.prototype))return!1;if(e===n)return!0;var r=Vo(n);return!!r&&e===r[0]}function ds(e){return!!ht&&ht in e}var fs=dt?xu:qf;function ps(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||ut)}function ms(e){return e===e&&!wu(e)}function hs(e,t){return function(r){return r!=null&&r[e]===t&&(t!==n||e in it(r))}}function gs(e){var t=Bl(e,function(e){return n.size===500&&n.clear(),e}),n=t.cache;return t}function _s(e,t){var n=e[1],r=t[1],i=n|r,l=i<(o|s|f),u=r==f&&n==c||r==f&&n==p&&e[7].length<=t[8]||r==(f|p)&&t[7].length<=t[8]&&n==c;if(!(l||u))return e;r&o&&(e[2]=t[2],i|=n&o?0:4);var d=t[3];if(d){var m=e[3];e[3]=m?to(m,d,t[4]):d,e[4]=m?sr(e[3],a):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?no(m,d,t[6]):d,e[6]=m?sr(e[5],a):t[6]),d=t[7],d&&(e[7]=d),r&f&&(e[8]=e[8]==null?t[8]:Yt(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i,e}function vs(e){var t=[];if(e!=null)for(var n in it(e))t.push(n);return t}function ys(e){return gt.call(e)}function bs(e,t,r){return t=Wt(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Wt(n.length-t,0),o=Re(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=Re(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),gn(e,this,s)}}function xs(e,t){return t.length<2?e:Pi(e,Da(t,0,-1))}function Ss(e,t){for(var r=e.length,i=Yt(t.length,r),a=ro(e);i--;){var o=t[i];e[i]=os(o,r)?a[o]:n}return e}function Cs(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}var ws=Os(wa),Ts=Pt||function(e,t){return rn.setTimeout(e,t)},Es=Os(Ta);function Ds(e,t,n){var r=t+``;return Es(e,is(r,Ns($o(r),n)))}function Os(e){var t=0,r=0;return function(){var i=Xt(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function ks(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=_a(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var As=gs(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Pe,function(e,n,r,i){t.push(r?i.replace(We,`$1`):n||e)}),t});function js(e){if(typeof e==`string`||zu(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Ms(e){if(e!=null){try{return ft.call(e)}catch{}try{return e+``}catch{}}return``}function Ns(e,t){return vn(S,function(n){var r=`_.`+n[0];t&n[1]&&!Sn(e,r)&&e.push(r)}),e.sort()}function Ps(e){if(e instanceof Or)return e.clone();var t=new Dr(e.__wrapped__,e.__chain__);return t.__actions__=ro(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Fs(e,t,r){t=(r?ss(e,t,r):t===n)?1:Wt(Ju(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=Re(Ft(i/t));a<i;)s[o++]=Da(e,a,a+=t);return s}function Is(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function Ls(){var e=arguments.length;if(!e)return[];for(var t=Re(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return Tn(cu(n)?ro(n):[n],F(t,1))}var Rs=ba(function(e,t){return du(e)?Si(e,F(t,1,du,!0)):[]}),zs=ba(function(e,t){var r=ac(t);return du(r)&&(r=n),du(e)?Si(e,F(t,1,du,!0),Wo(r,2)):[]}),Bs=ba(function(e,t){var r=ac(t);return du(r)&&(r=n),du(e)?Si(e,F(t,1,du,!0),n,r):[]});function Vs(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:Ju(t),Da(e,t<0?0:t,i)):[]}function Hs(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:Ju(t),t=i-t,Da(e,0,t<0?0:t)):[]}function Us(e,t){return e&&e.length?La(e,Wo(t,3),!0,!0):[]}function Ws(e,t){return e&&e.length?La(e,Wo(t,3),!0):[]}function Gs(e,t,n,r){var i=e==null?0:e.length;return i?(n&&typeof n!=`number`&&ss(e,t,n)&&(n=0,r=i),Di(e,t,n,r)):[]}function Ks(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ju(n);return i<0&&(i=Wt(r+i,0)),Nn(e,Wo(t,3),i)}function qs(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=Ju(r),a=r<0?Wt(i+a,0):Yt(a,i-1)),Nn(e,Wo(t,3),a,!0)}function Js(e){return e!=null&&e.length?F(e,1):[]}function Ys(e){return e!=null&&e.length?F(e,h):[]}function Xs(e,t){return e!=null&&e.length?(t=t===n?1:Ju(t),F(e,t)):[]}function Zs(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];hi(r,i[0],i[1])}return r}function Qs(e){return e&&e.length?e[0]:n}function $s(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Ju(n);return i<0&&(i=Wt(r+i,0)),Pn(e,t,i)}function ec(e){return e!=null&&e.length?Da(e,0,-1):[]}var tc=ba(function(e){var t=wn(e,Va);return t.length&&t[0]===e[0]?Vi(t):[]}),nc=ba(function(e){var t=ac(e),r=wn(e,Va);return t===ac(r)?
Line truncated
|
||||
`;e.replace(p,function(t,n,r,i,a,o){return r||=i,f+=e.slice(u,o).replace(et,er),n&&(c=!0,f+=`' +
|
||||
__e(`+n+`) +
|
||||
'`),a&&(l=!0,f+=`';
|
||||
`+a+`;
|
||||
__p += '`),r&&(f+=`' +
|
||||
((__t = (`+r+`)) == null ? '' : __t) +
|
||||
'`),u=o+t.length,t}),f+=`';
|
||||
`;var h=pt.call(t,`variable`)&&t.variable;if(!h)f=`with (obj) {
|
||||
`+f+`
|
||||
}
|
||||
`;else if(Ue.test(h))throw new tt("Invalid `variable` option passed into `_.template`");f=(l?f.replace(Se,``):f).replace(Ce,`$1`).replace(we,`$1;`),f=`function(`+(h||`obj`)+`) {
|
||||
`+(h?``:`obj || (obj = {});
|
||||
`)+`var __t, __p = ''`+(c?`, __e = _.escape`:``)+(l?`, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
`:`;
|
||||
`)+f+`return __p
|
||||
}`;var g=Sf(function(){return nt(o,m+`return `+f).apply(n,s)});if(g.source=f,yu(g))throw g;return g}function ff(e){return $u(e).toLowerCase()}function pf(e){return $u(e).toUpperCase()}function mf(e,t,r){if(e=$u(e),e&&(r||t===n))return Gn(e);if(!e||!(t=Na(t)))return e;var i=pr(e),a=pr(t);return Ga(i,Yn(i,a),Xn(i,a)+1).join(``)}function hf(e,t,r){if(e=$u(e),e&&(r||t===n))return e.slice(0,mr(e)+1);if(!e||!(t=Na(t)))return e;var i=pr(e);return Ga(i,0,Xn(i,pr(t))+1).join(``)}function gf(e,t,r){if(e=$u(e),e&&(r||t===n))return e.replace(Le,``);if(!e||!(t=Na(t)))return e;var i=pr(e);return Ga(i,Yn(i,pr(t))).join(``)}function _f(e,t){var r=30,i=`...`;if(wu(t)){var a=`separator`in t?t.separator:a;r=`length`in t?Ju(t.length):r,i=`omission`in t?Na(t.omission):i}e=$u(e);var o=e.length;if(nr(e)){var s=pr(e);o=s.length}if(r>=o)return e;var c=r-fr(i);if(c<1)return i;var l=s?Ga(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),Fu(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=at(a.source,$u(Ke.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(Na(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i}function vf(e){return e=$u(e),e&&De.test(e)?e.replace(Te,hr):e}var yf=mo(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),bf=po(`toUpperCase`);function xf(e,t,r){return e=$u(e),t=r?n:t,t===n?rr(e)?vr(e):jn(e):e.match(t)||[]}var Sf=ba(function(e,t){try{return gn(e,n,t)}catch(e){return yu(e)?e:new tt(e)}}),Cf=Ro(function(e,t){return vn(t,function(t){t=js(t),hi(e,t,Ml(e[t],e))}),e});function wf(e){var t=e==null?0:e.length,n=Wo();return e=t?wn(e,function(e){if(typeof e[1]!=`function`)throw new st(r);return[n(e[0]),e[1]]}):[],ba(function(n){for(var r=-1;++r<t;){var i=e[r];if(gn(i[0],this,n))return gn(i[1],this,n)}})}function R(e){return yi(vi(e,1))}function Tf(e){return function(){return e}}function Ef(e,t){return e==null||e!==e?t:e}var Df=vo(),Of=vo(!0);function kf(e){return e}function Af(e){return ta(typeof e==`function`?e:vi(e,1))}function jf(e){return oa(vi(e,1))}function Mf(e,t){return sa(e,vi(t,1))}var Nf=ba(function(e,t){return function(n){return Ui(n,e,t)}}),Pf=ba(function(e,t){return function(n){return Ui(e,n,t)}});function Ff(e,t,n){var r=xd(t),i=Ni(t,r);n==null&&!(wu(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=Ni(t,xd(t)));var a=!(wu(n)&&`chain`in n)||!!n.chain,o=xu(e);return vn(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=ro(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,Tn([this.value()],arguments))})}),e}function If(){return rn._===this&&(rn._=vt),this}function Lf(){}function Rf(e){return e=Ju(e),ba(function(t){return ua(t,e)})}var zf=So(wn),Bf=So(bn),Vf=So(On);function Hf(e){return cs(e)?Rn(js(e)):ma(e)}function Uf(e){return function(t){return e==null?n:Pi(e,t)}}var Wf=To(),Gf=To(!0);function Kf(){return[]}function qf(){return!1}function Jf(){return{}}function Yf(){return``}function Xf(){return!0}function Zf(e,t){if(e=Ju(e),e<1||e>g)return[];var n=y,r=Yt(e,y);t=Wo(t),e-=y;for(var i=Un(r,t);++n<e;)t(n);return i}function Qf(e){return cu(e)?wn(e,js):zu(e)?[e]:ro(As($u(e)))}function $f(e){var t=++mt;return $u(e)+t}var ep=xo(function(e,t){return e+t},0),tp=Oo(`ceil`),np=xo(function(e,t){return e/t},1),rp=Oo(`floor`);function ip(e){return e&&e.length?Ei(e,kf,Li):n}function ap(e,t){return e&&e.length?Ei(e,Wo(t,2),Li):n}function op(e){return Ln(e,kf)}function sp(e,t){return Ln(e,Wo(t,2))}function cp(e){return e&&e.length?Ei(e,kf,ia):n}function lp(e,t){return e&&e.length?Ei(e,Wo(t,2),ia):n}var up=xo(function(e,t){return e*t},1),dp=Oo(`round`),fp=xo(function(e,t){return e-t},0);function pp(e){return e&&e.length?Hn(e,kf):0}function mp(e,t){return e&&e.length?Hn(e,Wo(t,2)):0}return P.after=kl,P.ary=Al,P.assign=ed,P.assignIn=td,P.assignInWith=nd,P.assignWith=rd,P.at=id,P.before=jl,P.bind=Ml,P.bindAll=Cf,P.bindKey=Nl,P.castArray=Ql,P.chain=Gc,P.chunk=Fs,P.compact=Is,P.concat=Ls,P.cond=wf,P.conforms=R,P.constant=Tf,P.countBy=nl,P.create=I,P.curry=Pl,P.curryRight=Fl,P.debounce=Il,P.defaults=ad,P.defaultsDeep=od,P.defer=Ll,P.delay=Rl,P.difference=Rs,P.differenceBy=zs,P.differenceWith=Bs,P.drop=Vs,P.dropRight=Hs,P.dropRightWhile=Us,P.dropWhile=Ws,P.fill=Gs,P.filter=il,P.flatMap=sl,P.flatMapDeep=cl,P.flatMapDepth=ll,P.flatten=Js,P.flattenDeep=Ys,P.flattenDepth=Xs,P.flip=zl,P.flow=Df,P.flowRight=Of,P.fromPairs=Zs,P.functions=pd,P.functionsIn=md,P.groupBy=fl,P.initial=ec,P.intersection=tc,P.intersectionBy=nc,P.intersectionWith=rc,P.invert=vd,P.invertBy=yd,P.invokeMap=ml,P.iteratee=Af,P.keyBy=hl,P.keys=xd,P.keysIn=Sd,P.map=gl,P.mapKeys=Cd,P.mapValues=wd,P.matches=jf,P.matchesProperty=Mf,P.memoize=Bl,P.merge=Td,P.mergeWith=Ed,P.method=Nf,P.methodOf=Pf,P.mixin=Ff,P.negate=Vl,P.nthArg=Rf,P.omit=Dd,P.omitBy=Od,P.once=Hl,P.orderBy=_l,P.over=zf,P.overArgs=Ul,P.overEvery=Bf,P.overSome=Vf,P.partial=Wl,P.partialRight
Line truncated
|
||||
|
||||
* In categorical functions, when the feature value does not match any of the stop domain values.
|
||||
|
||||
* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.
|
||||
|
||||
* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a \`circle-color\` property but the feature property value is not a string or not a valid color).
|
||||
|
||||
* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.
|
||||
|
||||
If no default is provided, the style property's default is used in these circumstances.`}},function_stop:{type:`array`,minimum:0,maximum:24,value:[`number`,`color`],length:2,doc:`Zoom level and value pair.`},expression:{type:`array`,value:`expression_name`,minimum:1,doc:'An expression defines a function that can be used for data-driven style properties or feature filters. The first element of an expression array is a string naming the expression operator, e.g. `"*"` or `"case"`. Elements that follow (if any) are the _arguments_ to the expression. Each argument is either a literal value (a string, number, boolean, or `null`), or another expression array.'},expression_name:JSON.parse('{"doc":"First element in an expression array. May be followed by a number of arguments.","type":"enum","values":{"let":{"doc":"Binds expressions to named variables, which can then be referenced in the result expression using `[\\"var\\", \\"variable_name\\"]`.\\n\\n - [Visualize population density](https://maplibre.org/maplibre-gl-js/docs/examples/visualize-population-density/)","syntax":{"overloads":[{"parameters":["var_name_1","var_value_1","...","var_name_n","var_value_n","expression"],"output-type":"any"}],"parameters":[{"name":"var_name_i","type":"string literal","doc":"The name of the i-th variable."},{"name":"var_value_i","type":"any","doc":"The value of the i-th variable."},{"name":"expression","type":"any","doc":"The expression within which the named variables can be referenced."}]},"example":["let","someNumber",500,["interpolate",["linear"],["var","someNumber"],274,"#edf8e9",1551,"#006d2c"]],"group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"var":{"doc":"References variable bound using `let`.\\n\\n - [Visualize population density](https://maplibre.org/maplibre-gl-js/docs/examples/visualize-population-density/)","syntax":{"overloads":[{"parameters":["var_name"],"output-type":"any"}],"parameters":[{"name":"var_name","type":"string literal","doc":"The name of the variable bound using `let`."}]},"example":["var","density"],"group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"literal":{"doc":"Provides a literal array or object value, treating nested values as literals themselves.\\n\\n - [Display and style rich text labels](https://maplibre.org/maplibre-gl-js/docs/examples/display-and-style-rich-text-labels/)","syntax":{"overloads":[{"parameters":["json_object"],"output-type":"object"},{"parameters":["json_array"],"output-type":"array"}],"parameters":[{"name":"json_object","type":"JSON object"},{"name":"json_array","type":"JSON array"}]},"example":["literal",["DIN Offc Pro Italic","Arial Unicode MS Regular"]],"group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"semiliteral":{"doc":"Provides an array value, evaluating expressions in the elements of the array.","syntax":{"overloads":[{"parameters":["json_array"],"output-type":"array"}],"parameters":[{"name":"json_array","type":"JSON array"}]},"example":["semiliteral",[["get","label_x"],["get","label_y"]]],"group":"Types","sdk-support":{"basic functionality":{"js":"https://github.com/maplibre/maplibre-gl-js/issues/7933","android":"https://github.com/maplibre/maplibre-native/issues/4401","ios":"https://github.com/maplibre/maplibre-native/issues/4401"}}},"array":{"doc":"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type or length, then this assertion will cause the whole expression to be aborted.","syntax":{"overloads":[{"parameters":["value"],"output-type":"array"},{"parameters":["type","value"],"output-type":"array<type>"},{"parameters":["type","length","value"],"output-type":"array<type, length>"}],"parameters":[{"name":"value","type":"any"},{"name":"type","type":["string","number","boolean"],"doc":"The asserted type of the input array."},{"name":"length","type":"number literal","doc":"The asserted length of the input array."}]},"example":["array","string",3,["literal",["a","b","c"]]],"group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"at":{"doc":"Retrieves an item from an array.","syntax":{"overloads":[{"parameters":["index","array"],"output-type":"T"}],"parameters":[{"name":"index","type":"number","doc":"The index into `array`."},{"name":"array","type":"array<T>","doc":"The array of items to retrieve the specified item from."}]},"example":["at",1,["literal",["a","b","c"]]],"group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"in":{"doc":"Determines whether an item exists in an array or a substring exists in a string.\\n\\n - [Measure distances](https://maplibre.org/maplibre-gl-js/docs/examples/measure-distances/)","syntax":{"overloads":[{"parameters":["item","array"],"output-type":"boolean"Line truncated
|
||||
|
||||
The unit is in pixels only for SDF sprites that were created with a blur radius of 8, multiplied by the display density. I.e., the radius needs to be 16 for \`@2x\` sprites, etc.`,requires:[`icon-image`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},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`,doc:`Fade out the halo towards the outside.`,requires:[`icon-image`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},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`,doc:`Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.`,requires:[`icon-image`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-translate-anchor":{type:`enum`,values:{map:{doc:`Icons are translated relative to the map.`},viewport:{doc:`Icons are translated relative to the viewport.`}},doc:"Controls the frame of reference for `icon-translate`.",default:`map`,requires:[`icon-image`,`icon-translate`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-opacity":{type:`number`,doc:`The opacity at which the text will be drawn.`,default:1,minimum:0,maximum:1,transition:!0,requires:[`text-field`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-color":{type:`color`,doc:`The color with which the text will be drawn.`,default:`#000000`,transition:!0,overridable:!0,requires:[`text-field`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},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,doc:`The color of the text's halo, which helps it stand out from backgrounds.`,requires:[`text-field`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},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`,doc:`Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.`,requires:[`text-field`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https:Line truncated
|
||||
`,values:{linear:{doc:`(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled`},nearest:{doc:`Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled`}},default:`linear`,"sdk-support":{"basic functionality":{js:`5.20.0`,android:`https://github.com/maplibre/maplibre-native/issues/4117`,ios:`https://github.com/maplibre/maplibre-native/issues/4117`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-resampling":{type:`enum`,doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter. It is advised to use the generic `resampling` paint property instead.",values:{linear:{doc:`(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled`},nearest:{doc:`Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled`}},default:`linear`,"sdk-support":{"basic functionality":{js:`0.47.0`,android:`6.3.0`,ios:`4.2.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-fade-duration":{type:`number`,default:300,minimum:0,transition:!1,units:`milliseconds`,doc:`Fade duration when a new tile is added, or when a video is started or its coordinates are updated.`,"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_hillshade:{"hillshade-illumination-direction":{type:`numberArray`,default:335,minimum:0,maximum:359,doc:"The direction of the light source(s) used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`. Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.",transition:!1,"sdk-support":{"basic functionality":{js:`0.43.0`,android:`6.0.0`,ios:`4.0.0`},multidirectional:{js:`5.5.0`,android:`13.0.0`,ios:`6.24.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-altitude":{type:`numberArray`,default:45,minimum:0,maximum:90,doc:"The altitude of the light source(s) used to generate the hillshading with 0 as sunset and 90 as noon. Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.",transition:!1,"sdk-support":{"basic functionality":{js:`5.5.0`,android:`13.0.0`,ios:`6.24.0`},multidirectional:{js:`5.5.0`,android:`13.0.0`,ios:`6.24.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-anchor":{type:`enum`,values:{map:{doc:`The hillshade illumination is relative to the north direction.`},viewport:{doc:`The hillshade illumination is relative to the top of the viewport.`}},default:`viewport`,doc:`Direction of light source when map is rotated.`,"sdk-support":{"basic functionality":{js:`0.43.0`,android:`6.0.0`,ios:`4.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-exaggeration":{type:`number`,doc:`Intensity of the hillshade`,default:.5,min
Line truncated
|
||||
`,values:{linear:{doc:`(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled`},nearest:{doc:`Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled`}},default:`linear`,"sdk-support":{"basic functionality":{js:`5.20.0`,android:`https://github.com/maplibre/maplibre-native/issues/4117`,ios:`https://github.com/maplibre/maplibre-native/issues/4117`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},"paint_color-relief":{"color-relief-opacity":{type:`number`,default:1,minimum:0,maximum:1,doc:`The opacity at which the color-relief will be drawn.`,transition:!0,"sdk-support":{"basic functionality":{js:`5.6.0`,android:`13.0.0`,ios:`6.24.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"color-relief-color":{type:`color`,doc:'Defines the color of each pixel based on its elevation. Should be an expression that uses `["elevation"]` as input.',example:[`interpolate`,[`linear`],[`elevation`],0,`black`,8849,`white`],transition:!1,"sdk-support":{"basic functionality":{js:`5.6.0`,android:`13.0.0`,ios:`6.24.0`},"data-driven styling":{},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`elevation`]},"property-type":`color-ramp`},resampling:{type:`enum`,doc:`The resampling/interpolation method to use for overscaling, also known as texture magnification filter.
|
||||
`,values:{linear:{doc:`(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled`},nearest:{doc:`Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled`}},default:`linear`,"sdk-support":{"basic functionality":{js:`5.20.0`,android:`https://github.com/maplibre/maplibre-native/issues/4117`,ios:`https://github.com/maplibre/maplibre-native/issues/4117`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_background:{"background-color":{type:`color`,default:`#000000`,doc:`The color with which the background will be drawn.`,transition:!0,requires:[{"!":`background-pattern`}],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"background-pattern":{type:`resolvedImage`,transition:!0,doc:`Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.`,"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`cross-faded`},"background-opacity":{type:`number`,default:1,minimum:0,maximum:1,doc:`The opacity at which the background will be drawn.`,transition:!0,"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},transition:{duration:{type:`number`,default:300,minimum:0,units:`milliseconds`,doc:`Time allotted for transitions to complete.`},delay:{type:`number`,default:0,minimum:0,units:`milliseconds`,doc:`Length of time before a transition begins.`}},"property-type":{"data-driven":{type:`property-type`,doc:`Property is interpolable and can be represented using a property expression.`},"cross-faded":{type:`property-type`,doc:`Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms.`},"cross-faded-data-driven":{type:`property-type`,doc:`Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression.`},"color-ramp":{type:`property-type`,doc:`Property should be specified using a color ramp from which the output color can be sampled based on a property calculation.`},"data-constant":{type:`property-type`,doc:`Property is interpolable but cannot be represented using a property expression.`},constant:{type:`property-type`,doc:`Property is constant across all zoom levels and property values.`}},promoteId:{"*":{type:`string`,doc:`A name of a feature property to use as ID for feature state.`}},interpolation:{type:`array`,value:`interpolation_name`,minimum:1,doc:'An interpolation defines how to transition between items. The first element of an interpolation array is a string naming the interpolation operator, e.g. `"linear"` or `"exponential"`. Elements that follow (if any) are the _arguments_ to the interpolation.'},interpolation_name:{doc:`First element in an interpolation array. May be followed by a number of arguments.`,type:`enum`,values:{linear:{doc:`Interpolates linearly between the pair of stops just less than and just greater than the input`,syntax:{overloads:[{parameters:[],"output-type":`interpolation`}],parameters:[]},example:[`linear`],"sdk-support":{interpolate:{js:`0.42.0`,android:`6.0.0`,ios:`4.0.0`},"interpolate-hcl":{js:`0.49.0`,ios:`https://github.com/maplibre/maplibre-native/issues/2784`,android:`https://github.com/maplibre/maplibre-native/issues/2784`},"interpolate-lab":{js:`0.49.0`,ios:`https://
Line truncated
|
||||
precision mediump float;
|
||||
#else
|
||||
#if !defined(lowp)
|
||||
#define lowp
|
||||
#endif
|
||||
#if !defined(mediump)
|
||||
#define mediump
|
||||
#endif
|
||||
#if !defined(highp)
|
||||
#define highp
|
||||
#endif
|
||||
#endif
|
||||
out highp vec4 fragColor;layout(std140) uniform ProjectionUBO {highp mat4 u_projection_matrix;highp mat4 u_projection_fallback_matrix;highp vec4 u_projection_tile_mercator_coords;highp vec4 u_projection_clipping_plane;highp float u_projection_transition;highp int u_projection_clip_antimeridian;};layout(std140) uniform FrameUBO {highp vec2 u_units_to_pixels;highp vec2 u_world_size;highp float u_camera_to_center_distance;highp float u_symbol_fade_change;highp float u_aspect_ratio;highp float u_device_pixel_ratio;highp vec2 u_viewport_size;highp vec2 u_pixel_extrude_scale;highp float u_pitch;};`,Ufe=`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#else
|
||||
#if !defined(lowp)
|
||||
#define lowp
|
||||
#endif
|
||||
#if !defined(mediump)
|
||||
#define mediump
|
||||
#endif
|
||||
#if !defined(highp)
|
||||
#define highp
|
||||
#endif
|
||||
#endif
|
||||
vec2 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
|
||||
);}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
|
||||
);}
|
||||
#ifdef TERRAIN3D
|
||||
uniform sampler2D u_terrain;uniform highp sampler2D u_depth;layout(std140) uniform TerrainUBO {highp mat4 u_terrain_matrix;highp vec4 u_terrain_unpack;highp float u_terrain_dim;highp float u_terrain_exaggeration;};
|
||||
#endif
|
||||
const 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);}highp float depthOpacity(vec3 frag) {
|
||||
#ifdef TERRAIN3D
|
||||
highp 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));
|
||||
#else
|
||||
return 1.0;
|
||||
#endif
|
||||
}float calculate_visibility(vec4 pos) {
|
||||
#ifdef TERRAIN3D
|
||||
vec3 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;
|
||||
#else
|
||||
return 1.0;
|
||||
#endif
|
||||
}float ele(ivec2 pos) {
|
||||
#ifdef TERRAIN3D
|
||||
vec4 rgb=(texelFetch(u_terrain,pos,0)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
|
||||
#else
|
||||
return 0.0;
|
||||
#endif
|
||||
}float get_elevation(vec2 pos) {
|
||||
#ifdef TERRAIN3D
|
||||
#ifdef GLOBE
|
||||
if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
|
||||
#endif
|
||||
vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+2.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;
|
||||
#else
|
||||
return 0.0;
|
||||
#endif
|
||||
}const float PI=3.141592653589793;
|
||||
#define PROJECTION_UBO
|
||||
layout(std140) uniform ProjectionUBO {highp mat4 u_projection_matrix;highp mat4 u_projection_fallback_matrix;highp vec4 u_projection_tile_mercator_coords;highp vec4 u_projection_clipping_plane;highp float u_projection_transition;highp int u_projection_clip_antimeridian;};layout(std140) uniform FrameUBO {highp vec2 u_units_to_pixels;highp vec2 u_world_size;highp float u_camera_to_center_distance;highp float u_symbol_fade_change;highp float u_aspect_ratio;highp float u_device_pixel_ratio;highp vec2 u_viewport_size;highp vec2 u_pixel_extrude_scale;highp float u_pitch;};`,Wfe=`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,Gfe=`layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}`,Kfe=`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;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,qfe=`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);}`,Jfe=`in vec3 v_data;flat in float v_visibility;
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define mediump float radius
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define highp vec4 stroke_color
|
||||
#pragma maplibre: define mediump float stroke_width
|
||||
#pragma maplibre: define lowp float stroke_opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize mediump float radius
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize highp vec4 stroke_color
|
||||
#pragma maplibre: initialize mediump float stroke_width
|
||||
#pragma maplibre: initialize lowp float stroke_opacity
|
||||
vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));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;}
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,Yfe=`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 vec2 u_translate;layout(location=0) in ivec2 a_pos;out vec3 v_data;flat out float v_visibility;
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define mediump float radius
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define highp vec4 stroke_color
|
||||
#pragma maplibre: define mediump float stroke_width
|
||||
#pragma maplibre: define lowp float stroke_opacity
|
||||
void main(void) {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize mediump float radius
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize highp vec4 stroke_color
|
||||
#pragma maplibre: initialize mediump float stroke_width
|
||||
#pragma maplibre: initialize lowp float stroke_opacity
|
||||
ivec2 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) {
|
||||
#ifdef GLOBE
|
||||
vec3 center_vector=projectToSphere(circle_center);
|
||||
#endif
|
||||
float 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 {
|
||||
#ifdef GLOBE
|
||||
vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
|
||||
#else
|
||||
vec4 projected_center=projectTileWithElevation(circle_center,ele);
|
||||
#endif
|
||||
corner_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);}
|
||||
#ifdef GLOBE
|
||||
vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
|
||||
#else
|
||||
gl_Position=projectTileWithElevation(corner_position,ele);
|
||||
#endif
|
||||
} 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);}`,XT=`void main() {fragColor=vec4(1.0);}`,ZT={prelude:QT(Hfe,Ufe),projectionMercator:QT(`
|
||||
void 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:QT(`in highp float v_projection_tile_x;void clipAntimeridian() {if (u_projection_clip_antimeridian !=0 && (v_projection_tile_x < 0.0 || v_projection_tile_x >=8192.0)) {discard;}}`,`#define GLOBE_RADIUS 6371008.8
|
||||
#ifndef PROJECTION_UBO
|
||||
uniform 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;
|
||||
#endif
|
||||
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
|
||||
);}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));float 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
|
||||
);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:QT(Wfe,Gfe),backgroundPattern:QT(Kfe,qfe),circle:QT(Jfe,Yfe),clippingMask:QT(XT,`layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}`),heatmap:QT(`uniform highp float u_intensity;in vec2 v_extrude;
|
||||
#pragma maplibre: define highp float weight
|
||||
#define GAUSS_COEF 0.3989422804014327
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp float weight
|
||||
float 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);
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#pragma maplibre: define highp float weight
|
||||
#pragma maplibre: define mediump float radius
|
||||
const highp float ZERO=1.0/255.0/16.0;
|
||||
#define GAUSS_COEF 0.3989422804014327
|
||||
void main(void) {
|
||||
#pragma maplibre: initialize highp float weight
|
||||
#pragma maplibre: initialize mediump float radius
|
||||
ivec2 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);
|
||||
#ifdef GLOBE
|
||||
vec2 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);
|
||||
#else
|
||||
gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
|
||||
#endif
|
||||
}`),heatmapTexture:QT(`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;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(0.0);
|
||||
#endif
|
||||
}`,`uniform mat4 u_matrix;layout(location=0) in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world_size,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}`),collisionBox:QT(`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;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:QT(`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;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:QT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
uniform 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
|
||||
{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));
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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=2.0/u_dimension;float scale=(u_dimension.x-4.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:QT(`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:QT(XT,`layout(location=0) in vec2 a_pos;void main() {
|
||||
#ifdef GLOBE
|
||||
gl_Position=projectTileFor3D(a_pos,0.0);
|
||||
#else
|
||||
gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
|
||||
#endif
|
||||
}`),fill:QT(`#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
fragColor=color*opacity;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
if (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:QT(`in vec2 v_pos;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 outline_color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 outline_color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 outline_color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 outline_color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
if (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_size;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
}`),fillOutlinePattern:QT(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;uniform bool u_sdf_pattern;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;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);if (u_sdf_pattern) {highp float sdf_edge=(256.0-64.0)/256.0;highp float sdf_gamma_a=max(fwidth(color1.a)*0.5,1.0/255.0/16.0);highp float sdf_gamma_b=max(fwidth(color2.a)*0.5,1.0/255.0/16.0);float sdf_alpha_a=smoothstep(sdf_edge-sdf_gamma_a,sdf_edge+sdf_gamma_a,color1.a);float sdf_alpha_b=smoothstep(sdf_edge-sdf_gamma_b,sdf_edge+sdf_gamma_b,color2.a);fragColor=mix(color*sdf_alpha_a,color*sdf_alpha_b,u_fade)*alpha*opacity;} else {fragColor=mix(color1,color2,u_fade)*alpha*opacity;}
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
if (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_size;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
}`),fillPattern:QT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
uniform vec2 u_texsize;uniform float u_fade;uniform bool u_sdf_pattern;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;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);if (u_sdf_pattern) {highp float sdf_edge=(256.0-64.0)/256.0;highp float sdf_gamma_a=max(fwidth(color1.a)*0.5,1.0/255.0/16.0);highp float sdf_gamma_b=max(fwidth(color2.a)*0.5,1.0/255.0/16.0);float sdf_alpha_a=smoothstep(sdf_edge-sdf_gamma_a,sdf_edge+sdf_gamma_a,color1.a);float sdf_alpha_b=smoothstep(sdf_edge-sdf_gamma_b,sdf_edge+sdf_gamma_b,color2.a);fragColor=mix(color*sdf_alpha_a,color*sdf_alpha_b,u_fade)*opacity;} else {fragColor=mix(color1,color2,u_fade)*opacity;}
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
if (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:QT(`in vec4 v_color;void main() {fragColor=v_color;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#ifdef TERRAIN3D
|
||||
layout(location=2) in vec2 a_centroid;
|
||||
#endif
|
||||
out vec4 v_color;
|
||||
#pragma maplibre: define highp float base
|
||||
#pragma maplibre: define highp float height
|
||||
#pragma maplibre: define highp vec4 color
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp float base
|
||||
#pragma maplibre: initialize highp float height
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
vec3 normal=vec3(a_normal_ed.xyz);
|
||||
#ifdef TERRAIN3D
|
||||
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
||||
#else
|
||||
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
||||
#endif
|
||||
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
|
||||
#ifdef GLOBE
|
||||
vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
|
||||
#else
|
||||
gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
|
||||
#endif
|
||||
float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);
|
||||
#ifdef GLOBE
|
||||
mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
|
||||
#endif
|
||||
directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:QT(`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;
|
||||
#pragma maplibre: define lowp float base
|
||||
#pragma maplibre: define lowp float height
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float base
|
||||
#pragma maplibre: initialize lowp float height
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;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;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#ifdef TERRAIN3D
|
||||
layout(location=2) in vec2 a_centroid;
|
||||
#endif
|
||||
#ifdef GLOBE
|
||||
out vec3 v_sphere_pos;
|
||||
#endif
|
||||
out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
|
||||
#pragma maplibre: define lowp float base
|
||||
#pragma maplibre: define lowp float height
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float base
|
||||
#pragma maplibre: initialize lowp float height
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;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;
|
||||
#ifdef TERRAIN3D
|
||||
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
||||
#else
|
||||
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
||||
#endif
|
||||
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
|
||||
#ifdef GLOBE
|
||||
vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
|
||||
#else
|
||||
gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
|
||||
#endif
|
||||
vec2 pos=a_normal_ed.x==1 && a_normal_ed.y==0 && a_normal_ed.z==16384
|
||||
? a_pos
|
||||
: 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:QT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
uniform 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-4.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/pow(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);
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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:QT(`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];
|
||||
#define PI 3.141592653589793
|
||||
#define STANDARD 0
|
||||
#define COMBINED 1
|
||||
#define IGOR 2
|
||||
#define MULTIDIRECTIONAL 3
|
||||
#define BASIC 4
|
||||
float 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
|
||||
{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
|
||||
{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() {vec2 size=vec2(textureSize(u_image,0));vec2 texturePos=(v_pos*(size-2.0)+1.0)/size;vec4 pixel=texture(u_image,texturePos);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);}
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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:QT(`flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
clipAntimeridian();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);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float width
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float width
|
||||
if (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);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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
v_width2=vec2(outset,inset);}`),lineGradient:QT(`uniform sampler2D u_image;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
clipAntimeridian();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);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
layout(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 float u_image_height;out vec2 v_normal;flat out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float width
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float width
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
v_width2=vec2(outset,inset);}`),linePattern:QT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
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;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
clipAntimeridian();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;
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
#define LINE_DISTANCE_SCALE 2.0
|
||||
layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;out vec2 v_normal;flat out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;flat out float v_width;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:QT(`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;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define mediump vec4 dasharray_from
|
||||
#pragma maplibre: define mediump vec4 dasharray_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_from
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_to
|
||||
clipAntimeridian();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);float 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);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
#define LINE_DISTANCE_SCALE 2.0
|
||||
layout(location=0) in ivec2 a_pos_normal;layout(location=1) in uvec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;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;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define mediump vec4 dasharray_from
|
||||
#pragma maplibre: define mediump vec4 dasharray_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_from
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_to
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
float 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:QT(`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;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define mediump vec4 dasharray_from
|
||||
#pragma maplibre: define mediump vec4 dasharray_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_from
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_to
|
||||
clipAntimeridian();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);float 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);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
#define LINE_DISTANCE_SCALE 2.0
|
||||
layout(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 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;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define mediump vec4 dasharray_from
|
||||
#pragma maplibre: define mediump vec4 dasharray_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_from
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_to
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
float 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:QT(`uniform sampler2D u_image;uniform float u_opacity;in vec2 v_pos;void main() {fragColor=texture(u_image,v_pos)*u_opacity;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(0.0);
|
||||
#endif
|
||||
}`,`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:QT(`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);
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;vec2 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;
|
||||
#ifdef GLOBE
|
||||
if (a_pos.y <-32767.5) {texturePos.y=0.0;}if (a_pos.y > 32766.5) {texturePos.y=1.0;}
|
||||
#endif
|
||||
float 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:QT(`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;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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 bool u_rotate_symbol;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;
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
vec2 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_symbol_fade_change :-u_symbol_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 ?
|
||||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);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;
|
||||
#ifdef GLOBE
|
||||
if(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);}
|
||||
#endif
|
||||
vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}`),symbolSDF:QT(`#define SDF_PX 8.0
|
||||
uniform bool u_is_halo;uniform bool u_is_plain;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;
|
||||
#pragma maplibre: define highp vec4 fill_color
|
||||
#pragma maplibre: define highp vec4 halo_color
|
||||
#pragma maplibre: define lowp float halo_width
|
||||
#pragma maplibre: define lowp float halo_blur
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 fill_color
|
||||
#pragma maplibre: initialize highp vec4 halo_color
|
||||
#pragma maplibre: initialize lowp float halo_width
|
||||
#pragma maplibre: initialize lowp float halo_blur
|
||||
float 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;}
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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 bool u_rotate_symbol;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;
|
||||
#pragma maplibre: define highp vec4 fill_color
|
||||
#pragma maplibre: define highp vec4 halo_color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp float halo_width
|
||||
#pragma maplibre: define lowp float halo_blur
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 fill_color
|
||||
#pragma maplibre: initialize highp vec4 halo_color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize lowp float halo_width
|
||||
#pragma maplibre: initialize lowp float halo_blur
|
||||
vec2 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_symbol_fade_change :-u_symbol_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 ?
|
||||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);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;
|
||||
#ifdef GLOBE
|
||||
if(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);}
|
||||
#endif
|
||||
vec4 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:QT(`#define SDF_PX 8.0
|
||||
#define SDF 1.0
|
||||
#define ICON 0.0
|
||||
uniform bool u_is_halo;uniform bool u_is_text;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;in vec4 v_data0;in vec3 v_data1;flat in float v_is_sdf;
|
||||
#pragma maplibre: define highp vec4 fill_color
|
||||
#pragma maplibre: define highp vec4 halo_color
|
||||
#pragma maplibre: define lowp float halo_width
|
||||
#pragma maplibre: define lowp float halo_blur
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 fill_color
|
||||
#pragma maplibre: initialize highp vec4 halo_color
|
||||
#pragma maplibre: initialize lowp float halo_width
|
||||
#pragma maplibre: initialize lowp float halo_blur
|
||||
float total_opacity=v_data1[2];if (v_is_sdf==ICON) {vec2 tex_icon=v_data0.zw;fragColor=texture(u_texture_icon,tex_icon)*total_opacity;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
return;}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;}
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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 bool u_rotate_symbol;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;
|
||||
#pragma maplibre: define highp vec4 fill_color
|
||||
#pragma maplibre: define highp vec4 halo_color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp float halo_width
|
||||
#pragma maplibre: define lowp float halo_blur
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 fill_color
|
||||
#pragma maplibre: initialize highp vec4 halo_color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize lowp float halo_width
|
||||
#pragma maplibre: initialize lowp float halo_blur
|
||||
vec2 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_symbol_fade_change :-u_symbol_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 ?
|
||||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);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;
|
||||
#ifdef GLOBE
|
||||
if(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);}
|
||||
#endif
|
||||
vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;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:QT(`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);float 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:QT(`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:QT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
in 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
|
||||
);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:QT(`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;uniform vec3 u_globe_position;uniform float u_globe_radius;in vec3 v_view_direction;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 (u_sky_blend > 0.0) {vec3 ray=normalize(v_view_direction);float globe_distance=length(u_globe_position);float angle_to_globe_center=acos(clamp(dot(ray,u_globe_position)/globe_distance,-1.0,1.0));float horizon_angle=asin(min(u_globe_radius/globe_distance,1.0));blend=mix(blend,(angle_to_globe_center-horizon_angle)*u_camera_to_center_distance*u_device_pixel_ratio,u_sky_blend);}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;uniform mat4 u_inv_proj_matrix;out vec3 v_view_direction;void main() {v_view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,1.0,1.0);}`)};function QT(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`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
in ${n} ${r} ${i};
|
||||
#else
|
||||
uniform ${n} ${r} u_${i};
|
||||
#endif
|
||||
`:`
|
||||
#ifdef HAS_UNIFORM_u_${i}
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`)),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`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
uniform lowp float u_${i}_t;
|
||||
layout(location = ${s++}) in ${n} ${a} a_${i};
|
||||
out ${n} ${r} ${i};
|
||||
#else
|
||||
uniform ${n} ${r} u_${i};
|
||||
#endif
|
||||
`:o===`vec4`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
${i} = a_${i};
|
||||
#else
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`:`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
${i} = unpack_mix_${o}(a_${i}, u_${i}_t);
|
||||
#else
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`:t===`define`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
uniform lowp float u_${i}_t;
|
||||
layout(location = ${s++}) in ${n} ${a} a_${i};
|
||||
#else
|
||||
uniform ${n} ${r} u_${i};
|
||||
#endif
|
||||
`:o===`vec4`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
${n} ${r} ${i} = a_${i};
|
||||
#else
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`:`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
${n} ${r} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);
|
||||
#else
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`}),{fragmentSource:e,vertexSource:t,staticAttributes:r,staticUniforms:o}}var $T=`#define PROJECTION_MERCATOR`,eE=`mercator`,tE=class{constructor(){this._cachedMesh=null}get name(){return`mercator`}get useSubdivision(){return!1}get shaderVariantName(){return eE}get shaderDefine(){return $T}get shaderPreludeCode(){return ZT.projectionMercator}get vertexShaderPreludeCode(){return ZT.projectionMercator.vertexSource}get subdivisionGranularity(){return Eb.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 Rv;a.emplaceBack(0,0),a.emplaceBack(R,0),a.emplaceBack(0,R),a.emplaceBack(R,R);let o=e.createVertexBuffer(a,Hw.members),s=Gv.simpleSegment(0,0,4,2),c=new Hv;c.emplaceBack(1,0,2),c.emplaceBack(1,2,3);let l=e.createIndexBuffer(c);return this._cachedMesh=new Vw(o,l,s),this._cachedMesh}recalculate(){}hasTransition(){return!1}},nE=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=sh.number(e.top,t.top,n)),t.bottom!=null&&e.bottom!=null&&(this.bottom=sh.number(e.bottom,t.bottom,n)),t.left!=null&&e.left!=null&&(this.left=sh.number(e.left,t.left,n)),t.right!=null&&e.right!=null&&(this.right=sh.number(e.right,t.right,n)),this}getCenter(e,t){return new I(qf((this.left+e-this.right)/2,0,e),qf((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 rE(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 iE(e){return Math.max(0,Math.floor(e))}var aE=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 Pb(0,0),this._elevation=0,this._zoom=0,this._tileZoom=iE(this._zoom),this._scale=tp(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new nE,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=iE(this._zoom),this._scale=tp(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 nE(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;
Line truncated
|
||||
`),b=v.concat(ZT.prelude.vertexSource,o.vertexSource,t.vertexSource).join(`
|
||||
`),x=l.createShader(l.FRAGMENT_SHADER);if(l.isContextLost()){this.failedToCreate=!0;return}l.shaderSource(x,y),l.compileShader(x),l.attachShader(this.program,x);let S=l.createShader(l.VERTEX_SHADER);if(l.isContextLost()){this.failedToCreate=!0;return}l.shaderSource(S,b),l.compileShader(S),l.attachShader(this.program,S),this.attributes={};let C={};if(this.numAttributes=f.length,l.linkProgram(this.program),!l.getProgramParameter(this.program,l.LINK_STATUS)){if(l.isContextLost()){this.failedToCreate=!0;return}throw l.getShaderParameter(x,l.COMPILE_STATUS)?l.getShaderParameter(S,l.COMPILE_STATUS)?Error(`Program failed to link: ${l.getProgramInfoLog(this.program)}`):Error(`Could not compile vertex shader: ${l.getShaderInfoLog(S)}`):Error(`Could not compile fragment shader: ${l.getShaderInfoLog(x)}`)}wpe(l,this.program);let w=Ape(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:w.has(e)})}l.deleteShader(S),l.deleteShader(x);for(let e of _)if(e&&!C[e]){let t=l.getUniformLocation(this.program,e);t&&(C[e]=t)}this.fixedUniforms=r(e,C),this.terrainUniforms=ype(e,C),this.binderUniforms=n?n.getUniforms(e,C):[]}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]);kpe(e.terrainUniformBuffer,s)}if(c&&Dpe(e.projectionUniformBuffer,c),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 vpe,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 eD(e,t,n){let r=1/Tf(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 Mpe(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/Tf(r,1,n.transform.tileZoom),u_pixel_coord_upper:[u>>16,d>>16],u_pixel_coord_lower:[u&65535,d&65535]}}var Npe=(e,t)=>({u_lightpos:new ny(e,t.u_lightpos),u_lightpos_globe:new ny(e,t.u_lightpos_globe),u_lightintensity:new ey(e,t.u_lightintensity),u_lightcolor:new ny(e,t.u_lightcolor),u_vertical_gradient:new ey(e,t.u_vertical_gradient),u_opacity:new ey(e,t.u_opacity),u_fill_translate:new ty(e,t.u_fill_translate)}),Ppe=(e,t)=>({u_lightpos:new ny(e,t.u_lightpos),u_lightpos_globe:new ny(e,t.u_lightpos_globe),u_lightintensity:new ey(e,t.u_lightintensity),u_lightcolor:new ny(e,t.u_lightcolor),u_vertical_gradient:new ey(e,t.u_vertical_gradient),u_height_factor:new ey(e,t.u_height_factor),u_opacity:new ey(e,t.u_opacity),u_fill_translate:new ty(e,t.u_fill_translate),u_image:new $v(e,t.u_image),u_texsize:new ty(e,t.u_texsize),u_pixel_coord_upper:new ty(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new ty(e,t.u_pixel_coord_lower),u_scale:new ny(e,t.u_scale),u_fade:new ey(e,t.u_fade)}),tD=(e,t,n,r)=>{let i=e.style.light,a=i.getCartesianPosition(),o=dd();i.properties.get(`anchor`)===`viewport`&&pd(o,e.transform.bearingInRadians),qd(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}},Fpe=(e,t,n,r,i,a,o)=>Yf(tD(e,t,n,r),eD(a,e,o),{u_height_factor:-(2**i.overscaledZ)/o.tileSize/8}),Ipe=(e,t)=>({u_fill_translate:new ty(e,t.u_fill_translate)}),Lpe=(e,t)=>({u_image:new $v(e,t.u_image),u_texsize:new ty(e,t.u_texsize),u_pixel_coord_upper:new ty(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new ty(e,t.u_pixel_coord_lower),u_scale:new ny(e,t.u_scale),u_fade:new ey(e,t.u_fade),u_sdf_pattern:new $v(e,t.u_sdf_pattern),u_fill_translate:new ty(e,t.u_fill_translate)}),Rpe=(e,t)=>({u_fill_translate:new ty(e,t.u_fill_translate)}),zpe=(e,t)=>({u_image:new $v(e,t.u_image),u_texsize:new ty(e,t.u_texsize
Line truncated
|
||||
${e} <span></span>
|
||||
`,Yk().s[12]++,this._textEl=this._container.querySelector(`span`),Yk().s[13]++,this.updateZoomLevel()}addEventListeners(){Yk().f[4]++,Yk().s[14]++,this._map.on(`render`,()=>(Yk().f[5]++,Yk().s[15]++,this.updateZoomLevel()))}onRemove(){Yk().f[6]++,Yk().s[16]++,this._container.parentNode.removeChild(this._container),Yk().s[17]++,this._map=void 0}};function Xk(e,t,n){let r={id:[t,n,`circle`].join(`_`),source:t,type:`circle`,paint:{"circle-color":e,"circle-radius":2},filter:[`==`,`$type`,`Point`]};return n&&(r[`source-layer`]=n),r}function Zk(e,t,n,r){let i={id:[n,r,`polygon`].join(`_`),source:n,type:`fill`,paint:{"fill-color":e,"fill-antialias":!0,"fill-outline-color":e},filter:[`==`,`$type`,`Polygon`]};return r&&(i[`source-layer`]=r),i}function Qk(e,t,n){let r={id:[t,n,`line`].join(`_`),source:t,layout:{"line-join":`round`,"line-cap":`round`},type:`line`,paint:{"line-color":e},filter:[`==`,`$type`,`LineString`]};return n&&(r[`source-layer`]=n),r}function $k(e,t){return{circle:t(e,.8),line:t(e,.6),polygon:t(e,.3),polygonOutline:t(e,.6),default:t(e,1)}}function kve(e,t){let n=[],r=[],i=[];for(let a of Object.keys(e)){let o=e[a];if(!o||o.length===0){let e=$k(a,t);r.push(Xk(e.circle,a)),i.push(Qk(e.line,a)),n.push(Zk(e.polygon,e.polygonOutline,a))}else for(let e of o){let o=$k(e,t);r.push(Xk(o.circle,a,e)),i.push(Qk(o.line,a,e)),n.push(Zk(o.polygon,o.polygonOutline,a,e))}}return n.concat(i).concat(r)}function Ave(e,t,n){n=Object.assign({backgroundColor:`#fff`},n);let r={id:`background`,type:`background`,paint:{"background-color":n.backgroundColor}},i={};for(let t of Object.keys(e.sources)){let n=e.sources[t];(n.type===`vector`||n.type===`geojson`)&&(i[t]=n)}return Object.assign(e,{layers:[r].concat(t),sources:i})}var eA={polygonLayer:Zk,lineLayer:Qk,circleLayer:Xk,generateInspectStyle:Ave,generateColoredLayers:kve};function tA(){var e=`/home/runner/work/maputnik/maputnik/src/libs/highlight.ts`,t=`7421726a7afec07b60dcbf24ab0d23889ebbf613`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/libs/highlight.ts`,statementMap:{0:{start:{line:4,column:1},end:{line:8,column:2}},1:{start:{line:5,column:2},end:{line:5,column:31}},2:{start:{line:6,column:8},end:{line:8,column:2}},3:{start:{line:7,column:2},end:{line:7,column:28}},4:{start:{line:9,column:1},end:{line:13,column:2}},5:{start:{line:10,column:2},end:{line:10,column:26}},6:{start:{line:12,column:2},end:{line:12,column:21}},7:{start:{line:14,column:1},end:{line:14,column:28}},8:{start:{line:15,column:1},end:{line:15,column:10}},9:{start:{line:18,column:1},end:{line:18,column:83}},10:{start:{line:18,column:71},end:{line:18,column:83}},11:{start:{line:19,column:23},end:{line:19,column:50}},12:{start:{line:20,column:15},end:{line:20,column:51}},13:{start:{line:21,column:1},end:{line:23,column:2}},14:{start:{line:22,column:2},end:{line:22,column:102}},15:{start:{line:24,column:1},end:{line:26,column:2}},16:{start:{line:25,column:2},end:{line:25,column:94}},17:{start:{line:27,column:1},end:{line:29,column:2}},18:{start:{line:28,column:2},end:{line:28,column:92}},19:{start:{line:30,column:1},end:{line:30,column:13}}},fnMap:{0:{name:`changeLayer`,decl:{start:{line:3,column:9},end:{line:3,column:20}},loc:{start:{line:3,column:31},end:{line:16,column:1}},line:3},1:{name:`colorHighlightedLayer`,decl:{start:{line:17,column:16},end:{line:17,column:37}},loc:{start:{line:17,column:45},end:{line:31,column:1}},line:17}},branchMap:{0:{loc:{start:{line:4,column:1},end:{line:8,column:2}},type:`if`,locations:[{start:{line:4,column:1},end:{line:8,column:2}},{start:{line:6,column:8},end:{line:8,column:2}}],line:4},1:{loc:{start:{line:6,column:8},end:{line:8,column:2}},type:`if`,locations:[{start:{line:6,column:8},end:{line:8,column:2}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:6},2:{loc:{start:{line:9,column:1},end:{line:13,column:2}},type:`if`,locations:[{start:{line:9,column:1},end:{line:13,column:2}},{start:{line:11,column:8},end:{line:13,column:2}}],line:9},3:{loc:{start:{line:18,column:1},end:{line:18,column:83}},type:`if`,locations:[{start:{line:18,column:1},end:{line:18,column:83}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:18},4:{loc:{start:{line:18,column:5},end:{line:18,column:69}},type:`binary-expr`,locations:[{start:{line:18,column:5},end:{line:18,column:11}},{start:{line:18,column:15},end:{line:18,column:42}},{start:{line:18,column:46},end:{line:18,column:69}}],line:18},5:{loc:{start:{line:19,column:23},end:{line:19,column:50}},type:`binary-expr`,locations:[{start:{line:19,column:23},end:{line:19,column:44}},{start:{line:19,column:48},end:{line:19,column:50}}],line:19},6:{loc:{start:{line:21,column:1},end:{line:23,column:2}},type:`if`,locations:[{start:{line:21,column:1},end:{line:23,column:2}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:21},7:{loc:{start:{line:21,column:5},end:{line:21,column:61}},type:`binary-expr`,locations:[{start:{line:21,column
Line truncated
|
||||
${this._localize(`errorNoResults`)}</div>`;this._renderMessage(e)}_renderMessage(e){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(e)}_localize(e){let t=Bve.language(this.options.language.split(`,`)[0]);return this.options.language&&EA?.[e][t]?EA[e][t]:EA[e].en}_fitBoundsForMarkers(){if(this._typeahead.data.length<1)return;let e=this._typeahead.data.filter(e=>typeof e!=`string`).slice(0,this.options.limit);if(this._clearEl.style.display=`none`,this.options.flyTo&&this._maplibregl&&this._map){let t=SA({},{padding:100},this.options.flyTo),n=new this._maplibregl.LngLatBounds;for(let t of e)`geometry`in t&&t.geometry?.type===`Point`&&n.extend(t.geometry.coordinates);this._map.fitBounds(n,t)}return e.length>0&&this._maplibregl&&this._handleResultMarkers(e),this}setInput(e){return this._inputEl.value=e,this._typeahead.selected=null,this._typeahead.clear(),e.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(e),this}setProximity(e){return this.options.proximity=e,this}getProximity(){return this.options.proximity}setRenderFunction(e){return e&&typeof e==`function`&&(this._typeahead.render=e),this}getRenderFunction(){return this._typeahead.render}setLanguage(e){return this.options.language=e||this.options.language||navigator.language,this}getLanguage(){return this.options.language}getZoom(){return this.options.zoom}setZoom(e){return this.options.zoom=e,this}getFlyTo(){return this.options.flyTo}setFlyTo(e){return this.options.flyTo=e,this}getPlaceholder(){return this.options.placeholder}setPlaceholder(e){return this.options.placeholder=e||this.options.placeholder||this._localize(`placeholder`),this._inputEl.placeholder=this.options.placeholder,this._inputEl.setAttribute(`aria-label`,this.options.placeholder),this}getBbox(){return this.options.bbox}setBbox(e){return this.options.bbox=e,this}getCountries(){return this.options.countries}setCountries(e){return this.options.countries=e,this}getTypes(){return this.options.types}setTypes(e){return this.options.types=e,this}getMinLength(){return this.options.minLength}setMinLength(e){return this.options.minLength=e,this._typeahead&&(this._typeahead.options.minLength=e),this}getLimit(){return this.options.limit}setLimit(e){return this.options.limit=e,this._typeahead&&(this._typeahead.options.limit=e),this}getFilter(){return this.options.filter}setFilter(e){return this.options.filter=e,this}setGeocoderApi(e){return this.geocoderApi=e,this}getGeocoderApi(){return this.geocoderApi}_handleMarker(e){if(!this._map)return;this._removeMarker();let t=SA({},{color:`#4668F2`},this.options.marker);this.mapMarker=new this._maplibregl.Marker(t);let n=null;if(this.options.popup){let t=SA({},{},this.options.popup);n=new this._maplibregl.Popup(t).setHTML(this.options.popupRender(e))}return e.center?(this.mapMarker.setLngLat(e.center).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(n)):e.geometry?.type===`Point`&&e.geometry.coordinates&&(this.mapMarker.setLngLat(e.geometry.coordinates).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(n)),this}_removeMarker(){this.mapMarker&&=(this.mapMarker.remove(),null)}_handleResultMarkers(e){if(!this._map)return;this._removeResultMarkers();let t=SA({},{color:`#4668F2`},this.options.showResultMarkers);for(let n of e){let e;if(this.options.showResultMarkers){this.options.showResultMarkers&&this.options.showResultMarkers.element&&(e=this.options.showResultMarkers.element.cloneNode(!0),t=SA(t,{element:e}));let r=new this._maplibregl.Marker(SA({},t,{element:e})),i;if(this.options.popup){let e=SA({},{},this.options.popup);i=new this._maplibregl.Popup(e).setHTML(this.options.popupRender(n))}n.center?(r.setLngLat(n.center).addTo(this._map),this.options.popup&&r.setPopup(i)):n.geometry&&n.geometry.type&&n.geometry.type===`Point`&&n.geometry.coordinates&&(r.setLngLat(n.geometry.coordinates).addTo(this._map),this.options.popup&&r.setPopup(i)),this.resultMarkers.push(r)}}return this}_removeResultMarkers(){this.resultMarkers&&this.resultMarkers.length>0&&(this.resultMarkers.forEach(function(e){e.remove()}),this.resultMarkers=[])}on(e,t){return this._eventEmitter.on(e,t),this}once(e){return new Promise(t=>{this._eventEmitter.once(e,t)})}off(e,t){return this._eventEmitter.removeListener(e,t),this}};function V(){var e=`/home/runner/work/maputnik/maputnik/src/components/MapMaplibreGl.tsx`,t=`de08aa65bb219afae881e9eea5c66dd282c5367d`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/components/MapMaplibreGl.tsx`,statementMap:{0:{start:{line:21,column:25},end:{line:25,column:2}},1:{start:{line:26,column:15},end:{line:26,column:54}},2:{start:{line:27,column:1},end:{line:29,column:2}},3:{start:{line:28,column:2},end:{line:28,column:28}},4:{start:{line:30,column:17},end:{line:30,column:19}},5:{start:{line:31,column:1},end:{line:36,column:4}},6:{start:{line:32,column:17},end:{line:32,column:51}},7:{start:{line:33,column:2},eLine truncated
|
||||
`).reduce((t,n)=>Math.max(t,oI(e,n)),0);return n[t]=r,r}function LSe(e,t){let n=[],r=[],i=[],a=0,o=0,s=0,c=0;for(let l=0,u=t.length;l<=u;l+=2){let d=t[l];if(d===`
|
||||
`||l===u){a=Math.max(a,o),i.push(o),o=0,s+=c,c=0;continue}let f=t[l+1]||e.font,p=oI(f,d);n.push(p),o+=p;let m=ISe(f);r.push(m),c=Math.max(c,m)}return{width:a,height:s,widths:n,heights:r,lineWidths:i}}function RSe(e,t,n,r,i,a,o,s,c,l,u){e.save(),n!==1&&(e.globalAlpha===void 0?e.globalAlpha=e=>e.globalAlpha*=n:e.globalAlpha*=n),t&&e.transform.apply(e,t),r.contextInstructions?(e.translate(c,l),e.scale(u[0],u[1]),zSe(r,e)):u[0]<0||u[1]<0?(e.translate(c,l),e.scale(u[0],u[1]),e.drawImage(r,i,a,o,s,0,0,o,s)):e.drawImage(r,i,a,o,s,c,l,o*u[0],s*u[1]),e.restore()}function zSe(e,t){let n=e.contextInstructions;for(let e=0,r=n.length;e<r;e+=2)Array.isArray(n[e+1])?t[n[e]].apply(t,n[e+1]):t[n[e]]=n[e+1]}var cI=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=cF(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return qA()}getImage(e){return qA()}getHitDetectionImage(){return qA()}getPixelRatio(e){return 1}getImageState(){return qA()}getImageSize(){return qA()}getOrigin(){return qA()}getSize(){return qA()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=cF(e)}listenImageChange(e){qA()}load(){qA()}unlistenImageChange(e){qA()}ready(){return Promise.resolve()}},lI=class e extends cI{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0&&e.rotateWithView,rotation:e.rotation===void 0?0:e.rotation,scale:e.scale===void 0?1:e.scale,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill===void 0?null:e.fill,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle===void 0?0:e.angle,this.stroke_=e.stroke===void 0?null:e.stroke,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?BF.LOADING:BF.LOADED,this.imageState_===BF.LOADING&&this.ready().then(()=>this.imageState_=BF.LOADED),this.render()}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){let e=this.size_,t=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-t[0]/n[0],e[1]/2+t[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||=this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.fill_?.getKey(),n=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(`,`),r=UF.get(n,null)?.getImage(1);if(!r){let t=this.renderOptions_,i=Math.ceil(t.size*e),a=nP(i,i);this.draw_(t,a,e),r=a.canvas;let o=new GF(r,void 0,null,BF.LOADED,null);UF.set(n,null,o),createImageBitmap(r).then(e=>{o.setImage(e)})}return r}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}setRadius(e){this.radius!==e&&(this.radius=e,this.render())}getRadius2(){return this.radius2_}setRadius2(e){this.radius2_!==e&&(this.radius2_=e,this.render())}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,n){if(t===0||this.points_===1/0||e!==`bevel`&&e!==`miter`)return t;let r=this.radius,i=this.radius2_===void 0?r:this.radius2_;if(r<i){let e=r;r=i,i=e}let a=this.radius2_===void 0?this.points_:this.points_*2,o=2*Math.PI/a,s=i*Math.sin(o),c=Math.sqrt(i*i-s*s),l=r-c,u=Math.sqrt(s*s+l*l),d=u/s;if(e===`miter`&&d<=n)return d*t;let f=t/2/d,p=t/2*(l/u),m=Math.sqrt((r+f)*(r+f)+p*p)-r;if(this.radius2_===void 0||e===`bevel`)return m*2;let h=r*Math.sin(o),g=Math.sqrt(r*r-h*h),_=i-g,v=Math.sqrt(h*h+_*_)/h;if(v<=n){let e=v*t/2-i-r;return 2*Math.max(m,e)}return m
Line truncated
|
||||
`,``),e.push(t,``),e}function mwe(e,t,n){return n%2==0&&(e+=t),e}var hwe=class{constructor(e,t,n,r,i){this.overlaps=n,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=UM(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=i?new IL:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,n,r){let i=e+t+n+r;if(this.labels_[i])return this.labels_[i];let a=r?this.strokeStates[r]:null,o=n?this.fillStates[n]:null,s=this.textStates[t],c=this.pixelRatio,l=[s.scale[0]*c,s.scale[1]*c],u=s.justify?tR[s.justify]:pR(Array.isArray(e)?e[0]:e,s.textAlign||`center`),d=r&&a.lineWidth?a.lineWidth:0,f=Array.isArray(e)?e:String(e).split(`
|
||||
`).reduce(pwe,[]),{width:p,height:m,widths:h,heights:g,lineWidths:_}=LSe(s,f),v=p+d,y=[],b=(v+2)*l[0],x=(m+d)*l[1],S={width:b<0?Math.floor(b):Math.ceil(b),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:y};(l[0]!=1||l[1]!=1)&&y.push(`scale`,l),r&&(y.push(`strokeStyle`,a.strokeStyle),y.push(`lineWidth`,d),y.push(`lineCap`,a.lineCap),y.push(`lineJoin`,a.lineJoin),y.push(`miterLimit`,a.miterLimit),y.push(`setLineDash`,[a.lineDash]),y.push(`lineDashOffset`,a.lineDashOffset)),n&&y.push(`fillStyle`,o.fillStyle),y.push(`textBaseline`,`middle`),y.push(`textAlign`,`center`);let C=.5-u,w=u*v+C*d,T=[],E=[],D=0,O=0,k=0,A=0,ee;for(let e=0,t=f.length;e<t;e+=2){let t=f[e];if(t===`
|
||||
`){O+=D,D=0,w=u*v+C*d,++A;continue}let i=f[e+1]||s.font;i!==ee&&(r&&T.push(`font`,i),n&&E.push(`font`,i),ee=i),D=Math.max(D,g[k]);let a=[t,w+C*h[k]+u*(h[k]-_[A]),.5*(d+D)+O];w+=h[k],r&&T.push(`strokeText`,a),n&&E.push(`fillText`,a),++k}return Array.prototype.push.apply(y,T),Array.prototype.push.apply(y,E),this.labels_[i]=S,S}replayTextBackground_(e,t,n,r,i,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,t),a&&(this.alignAndScaleFill_=a[2],e.fillStyle=a[1],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())}calculateImageOrLabelDimensions_(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){o*=d[0],s*=d[1];let g=n-o,_=r-s,v=i+c>e?e-c:i,y=a+l>t?t-l:a,b=p[3]+v*d[0]+p[1],x=p[0]+y*d[1]+p[2],S=g-p[3],C=_-p[0];(m||u!==0)&&(sR[0]=S,uR[0]=S,sR[1]=C,cR[1]=C,cR[0]=S+b,lR[0]=cR[0],lR[1]=C+x,uR[1]=lR[1]);let w;return u===0?Oj(Math.min(S,S+b),Math.min(C,C+x),Math.max(S,S+b),Math.max(C,C+x),oR):(w=YM(UM(),n,r,1,1,u,-n,-r),qM(w,sR),qM(w,cR),qM(w,lR),qM(w,uR),Oj(Math.min(sR[0],cR[0],lR[0],uR[0]),Math.min(sR[1],cR[1],lR[1],uR[1]),Math.max(sR[0],cR[0],lR[0],uR[0]),Math.max(sR[1],cR[1],lR[1],uR[1]),oR)),f&&(g=Math.round(g),_=Math.round(_)),{drawImageX:g,drawImageY:_,drawImageW:v,drawImageH:y,originX:c,originY:l,declutterBox:{minX:oR[0],minY:oR[1],maxX:oR[2],maxY:oR[3],value:h},canvasTransform:w,scale:d}}replayImageOrLabel_(e,t,n,r,i,a,o){let s=!!(a||o),c=r.declutterBox,l=o?o[2]*r.scale[0]/2:0;return c.minX-l<=t[0]&&c.maxX+l>=0&&c.minY-l<=t[1]&&c.maxY+l>=0&&(s&&this.replayTextBackground_(e,sR,cR,lR,uR,a,o),RSe(e,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){let t=this.alignAndScaleFill_;if(t){let n=qM(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),t!==1&&e.scale(t,t)}e.fill(),t&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],t[1]&&(e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.lineDashOffset=t[7],e.setLineDash(t[6]))}drawLabelWithPointPlacement_(e,t,n,r){let i=this.textStates[t],a=this.createLabel(e,t,r,n),o=this.strokeStates[n],s=this.pixelRatio,c=pR(Array.isArray(e)?e[0]:e,i.textAlign||`center`),l=tR[i.textBaseline||`middle`],u=o&&o.lineWidth?o.lineWidth:0;return{label:a,anchorX:c*(a.width/s-2*i.scale[0])+2*(.5-c)*u,anchorY:l*a.height/s+2*(.5-l)*u}}execute_(e,t,n,r,i,a,o,s){let c=this.zIndexContext_,l;this.pixelCoordinates_&&zA(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||=[],l=QM(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Nbe(this.renderedTransform_,n));let u=0,d=r.length,f=0,p,m=[],h,g,_,v,y,b,x,S,C,w,T,E,D,O=0,k=0,A=this.coordinateCache_,ee=this.viewRotation_,j=Math.round(Math.atan2(-n[1],n[0])*0xe8d4a51000)/0xe8d4a51000,te={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:ee},ne=this.instructions!=r||this.overlaps?0:200,re,M,N,ie;for(;u<d;){let n=r[u];switch(n[0]){case KL.BEGIN_GEOMETRY:re=n[1],ie=n[3],re.getGeometry()?o!==void 0&&!Uj(o,ie.getExtent())?u=n[2]+1:++u:u=n[2],c&&(c.zIndex=n[4]);break;case KL.BEGIN_PATH:O>ne&&(this.fill_(e),O=0),k>ne&&(e.stroke(),k=0),!O&&!k&&(e.beginPath(),y=NaN,b=NaN),++u;break;case KL.CIRCLE:f=n[1],_=n[2]??0;let r=l[f],d=l[f+1],ae=l[f+2]-_,oe=l[f+3]-_,se=ae-r,ce=oe-d,le=Math.sqrt(se*se+ce*ce);e.moveTo(r+le,d),e.arc(r,d,le,0,2*Math.PI,!0),++u;break;case KL.CLOSE_PATH:e.closePath(),++u;break;case KL.CUSTOM:f=n[1],p=n[2];let ue=n[3],de=n[4],fe=n[5];te.geometry=ue,te.feature=re,u in A||(A[u]=[]);let pe=A[u];fe?fe(l,f,p,2,pe):(pe[0]=l[f],pe[1]=l[f+1],pe.length=2),c&&(c.zIndex=n[6]),de(pe,te),++u;break;case KL.DRAW_IMAGE:f=n[1],p=n[2],C=n[3],h=n[4],g=n[5];let me=n[6],he=n[7],ge=n[8],_e=n[9],ve=n[10],ye=n[11],be=n[12],xe=n[13];v=n[14]||`declutter`;let Se=n[15];if(!C&&n.length>=20){w=n[19],T=n[20],E=n[21],D=n[22];let e=this.drawLabelWithPointPlacement_(w,T,E,D);C=e.label,n[3]=C;let t=n[23];h=(e.anchorX-t)*this.pixelRatio,n[4]=h;let r=n[24];g=(e.anchorY-r)*this.pixelRatio,n[5]=g,me=C.height,n[6]=me,xe=C.width,n[13]=xe}let Ce;n.length>25&&(Ce=n[25]);let we,Te,Ee;n.length>17?(we=n[16],Te=n[17],Ee=n[18]):(we=eI,Te=null,Ee=null),ve&&j?ye+=ee:!ve&&!j&&(ye-=ee);let De=0;for(;f<p;f+=2){if(Ce&&Ce[De++]<xe/this.pixelRatio)continue;let n=this.calculateImageOrLabelDimensions_(C.width,C.height,l[f],l[f+1],xe,me,h,g,ge,_e,ye,be,i,we,!!Te||!!Ee,re),r=[e,t,C,n,he,Te,Ee];if(s){let e,t,i;if(Se){let n=p-f;if(!Se[n]){Se[n]={args:r,declutterMode:v};continue}let a=Se[n];e=a.args,t=a.declutterMode,delete Se[n],i=dR(e)}let a,o;if(e&&(t!==`declutter`||!s.collides(i))&&(a=!0),(v!==`declutter`||!s.collides(n.declutterBox))&&(o=!0),t===`declutter`&&v===`declutter`){let e=a&&o;a=e,o=e}a&&(t!==`none`&&s.insert(i),this.replayImageOrLabel_.apply(this,e)),o&&(v!==`none`&&s.insert(n.declutterBox),this.replayImageOrLabel_.apply(this,r))}else this.replayImageOrLabel_.apply(this,r)}++u;break;case KL.DRAW_CHARS:let Oe=n[1],ke=n[2],Ae=n[3],je=n[4];D=n[5];let Me=n[
Line truncated
|
||||
`);this.generateTileUrlFunction_?this.setTileUrlFunction(BR(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}},Ywe=class extends UR{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Xwe,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate===void 0||e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass===void 0?bL:e.tileClass,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!AM(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||AM(t,e)))return this.tileGrid;let n=JA(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=IR(e)),this.tileGridForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,l=new this.tileClass(o,c===void 0?oj.EMPTY:oj.IDLE,c===void 0?``:c,{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return l.key=a,l.addEventListener(PA.CHANGE,this.handleTileChange.bind(this)),l}getTile(e,t,n,r,i,a){let o=this.getProjection();if(!o||!i||AM(o,i))return this.getTileInternal(e,t,n,r,o||i);let s=[e,t,n],c=this.getKey(),l=new ML(o,this.getTileGridForProjection(o),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i),this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return l.key=c,l}getTileInternal(e,t,n,r,i,a){let o=this.getKey(),s=FL(this,o,e,t,n);if(a&&a.containsKey(s))return a.get(s);let c=this.createTile_(e,t,n,r,i,o);return a?.set(s,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=wM(e);if(n){let e=JA(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function Xwe(e,t){if(nj){let n=e.getCrossOrigin(),r=`same-origin`,i=`same-origin`;n===`anonymous`||n===``?(r=`cors`,i=`omit`):n===`use-credentials`&&(r=`cors`,i=`include`);let a={mode:r,credentials:i,referrerPolicy:e.getReferrerPolicy()};fetch(t,a).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()}).then(e=>createImageBitmap(e)).then(t=>{let n=e.getImage();n.width=t.width,n.height=t.height,n.getContext(`2d`).drawImage(t,0,0),t.close?.(),n.dispatchEvent(new Event(`load`))}).catch(()=>{e.getImage().dispatchEvent(new Event(`error`))});return}e.getImage().src=t}var WR=class extends Ywe{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:wM(`EPSG:3857`),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:`loading`,tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX===void 0||e.wrapX,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url){if(e.jsonp)Iwe(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{let t=new XMLHttpRequest;t.addEventListener(`load`,this.onXHRLoad_.bind(this)),t.addEventListener(`error`,this.onXHRError_.bind(this)),t.open(`GET`,e.url),t.send()}}else if(e.tileJSON)this.handleTileJSONResponse(e.tileJSON);else throw Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(e){let t=e.target;if(!t.status||t.status>=200&&t.status<300){let e;try{e=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(e)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){let t=wM(`EPSG:4326`),n=this.getProjection(),r;if(e.bounds!==void 0){let i=jM(t,n);r=Nye(e.bounds,i)}let i=zR(n),a=e.minzoom||0,o=LR({extent:i,maxZoom:e.maxzoom||22,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=o,this.tileUrlFunction=BR(e.tiles,o),e.attribution&&!this.getAttributions()){let t=r===void 0?i:r;this.setAttributions(function(n){return Uj(t,n.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState(`ready`)}handleTileJSONError(){this.setState(`error`)}},Zwe=!1;function GR(e,t,n,r,i,a,o){let s=new XMLHttpRequest;s.open(`GET`,typeof e==`function`?e(n,r,i):e,!0),t.getType()==`arraybuffer`&&(s.responseType=`arraybuffer`),s.withCredentials=Zwe,s.onload=function(e){if(!s.status||s.status>=200&&s.status<300){let e=t.
Line truncated
|
||||
`),`binary`).toString(`base64`):URL.createObjectURL(new Blob(n,{type:`text/javascript`})));return r.addEventListener(`message`,t),r}function lTe(e,t){let n=mz(e.operation),r=!1;return{postMessage:function(e){setTimeout(function(){r||t({data:{buffer:n(e),meta:e.meta}})},0)},terminate:function(){r=!0}}}var uTe=class extends FA{constructor(e){super(),this.imageOps_=!!e.imageOps;let t;t=e.threads===0?0:this.imageOps_?1:e.threads||1;let n=Array(t);if(t)for(let r=0;r<t;++r)n[r]=cTe(e,this.onWorkerMessage_.bind(this,r));else n[0]=lTe(e,this.onWorkerMessage_.bind(this,0));this.workers_=n,this.queue_=[],this.maxQueueLength_=e.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(e,t,n){this.enqueue_({inputs:e,meta:t,callback:n}),this.dispatch_()}enqueue_(e){for(this.queue_.push(e);this.queue_.length>this.maxQueueLength_;)this.queue_.shift().callback(null,null)}dispatch_(){if(this.running_||this.queue_.length===0)return;let e=this.queue_.shift();this.job_=e;let t=e.inputs[0].width,n=e.inputs[0].height,r=e.inputs.map(function(e){return e.data.buffer}),i=this.workers_.length;if(this.running_=i,i===1){this.workers_[0].postMessage({buffers:r,meta:e.meta,imageOps:this.imageOps_,width:t,height:n},r);return}let a=e.inputs[0].data.length,o=4*Math.ceil(a/4/i);for(let a=0;a<i;++a){let i=a*o,s=[];for(let e=0,t=r.length;e<t;++e)s.push(r[e].slice(i,i+o));this.workers_[a].postMessage({buffers:s,meta:e.meta,imageOps:this.imageOps_,width:t,height:n},s)}}onWorkerMessage_(e,t){this.disposed||(this.dataLookup_[e]=t.data,--this.running_,this.running_===0&&this.resolveJob_())}resolveJob_(){let e=this.job_,t=this.workers_.length,n,r;if(t===1)n=new Uint8ClampedArray(this.dataLookup_[0].buffer),r=this.dataLookup_[0].meta;else{let i=e.inputs[0].data.length;n=new Uint8ClampedArray(i),r=Array(t);let a=4*Math.ceil(i/4/t);for(let e=0;e<t;++e){let t=this.dataLookup_[e].buffer,i=e*a;n.set(new Uint8ClampedArray(t),i),r[e]=this.dataLookup_[e].meta}}this.job_=null,this.dataLookup_={},e.callback(null,new ImageData(n,e.inputs[0].width,e.inputs[0].height),r),this.dispatch_()}disposeInternal(){for(let e=0;e<this.workers_.length;++e)this.workers_[e].terminate();this.workers_.length=0}},hz={BEFOREOPERATIONS:`beforeoperations`,AFTEROPERATIONS:`afteroperations`},gz=class extends WA{constructor(e,t,n){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=n}},_z=class extends pz{constructor(e){super({interpolate:e.interpolate,projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType===void 0?`pixel`:e.operationType,this.threads_=e.threads===void 0?1:e.threads,this.layers_=pTe(e.sources);let t=this.changed.bind(this);for(let e=0,n=this.layers_.length;e<n;++e)this.layers_[e].addEventListener(PA.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new mye(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:UM(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:fTe(this.layers_),pixelRatio:1,pixelToCoordinateTransform:UM(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:JA(this),renderTargets:{}},this.setAttributions(function(t){let n=[];for(let r=0,i=e.sources.length;r<i;++r){let i=e.sources[r],a=i instanceof jR?i:i.getSource();if(!a)continue;let o=a.getAttributions()?.(t);typeof o==`string`?n.push(o):o!==void 0&&n.push(...o)}return n}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new uTe({operation:e,imageOps:this.operationType_===`image`,queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,n){let r=Object.assign({},this.frameState_);r.viewState=Object.assign({},r.viewState);let i=Ij(e);r.size[0]=Math.ceil(Hj(e)/t),r.size[1]=Math.ceil(Rj(e)/t),r.extent=[i[0]-r.size[0]*t/2,i[1]-r.size[1]*t/2,i[0]+r.size[0]*t/2,i[1]+r.size[1]*t/2],r.time=Date.now();let a=r.viewState;return a.center=i,a.projection=n,a.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let n=0,r=this.layers_.length;n<r;++n)if(t=this.layers_[n].getSource(),!t||t.getState()!==`ready`){e=!1;break}return e}getImage(e,t,n,r){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),t=this.findNearestResolution(t);let i=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=i,this.renderedImageCanvas_){let e=this.renderedImageCanvas_.getResolution(),n=this.renderedImageCanvas_.getExtent();(t!==e||!jj(i.extent,n))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),i.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){let e=this.requestedFrameState_,t=this.layers_.length,n=Array(t),r=Ar
Line truncated
|
||||
`),i=STe.slice(0,Math.round(t/.1));for(let e=0,t=r.length;e<t;++e)e>0&&(n+=`
|
||||
`),n+=r[e].split(``).join(i);return n}return e}var Uz;function Wz(){return Uz||=Mz(1,1).getContext(`2d`),Uz}function CTe(e,t){if(/\d+ \d+/.test(e)){let[n,r]=e.split(` `).map(Number);return n<=t&&t<=r}return e==t}function Gz(e,t){return Wz().measureText(e).width+(e.length-1)*t}var Kz={};tI.on(`propertychange`,()=>{for(let e in Kz)delete Kz[e]});function qz(e,t,n,r){if(e.indexOf(`
|
||||
`)!==-1){let i=e.split(`
|
||||
`),a=[];for(let e=0,o=i.length;e<o;++e)a.push(qz(i[e],t,n,r));return a.join(`
|
||||
`)}let i=n+`,`+t+`,`+e+`,`+r,a=Kz[i];if(!a){let o=e.split(` `);if(o.length>1){let e=Wz();e.font=t;let i=e.measureText(`M`).width*n,s=``,c=[];for(let e=0,t=o.length;e<t;++e){let t=o[e],n=s+(s?` `:``)+t;Gz(n,r)<=i?s=n:(s&&c.push(s),s=t)}s&&c.push(s);for(let e=0,t=c.length;e<t&&t>1;++e){let n=c[e];if(Gz(n,r)<i*.35){let i=e>0?Gz(c[e-1],r):1/0,a=e<t-1?Gz(c[e+1],r):1/0;c.splice(e,1),--t,i<a?(c[e-1]+=` `+n,--e):c[e]=n+` `+c[e]}}for(let e=0,t=c.length-1;e<t;++e){let n=c[e],a=c[e+1];if(Gz(n,r)>i*.7&&Gz(a,r)<i*.6){let o=n.split(` `),s=o.pop();Gz(s,r)<i*.2&&(c[e]=o.join(` `),c[e+1]=s+` `+a),--t}}a=c.join(`
|
||||
`)}else a=e;a=Hz(a,r),Kz[i]=a}return a}var wTe=[`Arial`,`Courier New`,`Times New Roman`,`Verdana`,`sans-serif`,`serif`,`monospace`,`cursive`,`fantasy`],Jz={};function TTe(e,t=`https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css`){if(nj)return e;let n;for(let t=0,r=e.length;t<r;++t){let r=e[t];if(r in Jz)continue;Jz[r]=!0;let i=Cz(r,16).split(` `);n||=[],n.push([i.slice(3).join(` `).replace(/"/g,``),i[1],i[0]])}return n&&(async()=>{await document.fonts.ready;for(let e=0,r=n.length;e<r;++e){let r=n[e],i=r[0];if(wTe.includes(i))continue;let a=r[1],o=r[2];if(!(await document.fonts.load(`${o} ${a} 16px "${i}"`)).some(e=>e.family.replace(/^['"]|['"]$/g,``).toLowerCase()===i.toLowerCase()&&CTe(e.weight,a)&&e.style===o)){let e=t.replace(`{font-family}`,i.replace(/ /g,`-`).toLowerCase()).replace(`{Font+Family}`,i.replace(/ /g,`+`)).replace(`{fontweight}`,a).replace(`{-fontstyle}`,o.replace(`normal`,``).replace(/(.+)/,`-$1`)).replace(`{fontstyle}`,o);if(!document.querySelector(`link[href="`+e+`"]`)){let t=document.createElement(`link`);t.href=e,t.rel=`stylesheet`,document.head.appendChild(t)}}}})(),e}var ETe={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},DTe={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},Yz=function(e,t,n){let r=Vc(e,t,n);if(r.result===`error`){let i=nz(e);i!==e&&(r=Vc(i,t,n))}if(r.result===`error`){let t=r.value[0];return console.error(`Error parsing expression:`,e,t.key,t.message),{evaluate:()=>n.default}}return r.value},Xz,Zz;function Qz(e,t,n,r,i,a){let o=e.id;i||(i={},console.warn(`No functionCache provided to getValue()`)),i[o]||(i[o]={});let s=i[o];if(!s[n]){let r=(e[t]||Tz)[n],i=`layers[${o}].${t}.${n}`,a=pi[`${t}_${e.type}`]&&pi[`${t}_${e.type}`][n];r===void 0&&a&&(r=a.default);let c=Ic(r);if(!c&&bc(r)&&(r=bl(r,a),c=!0),c){let e=Yz(r,i,a);s[n]=e.evaluate.bind(e)}else{let e=a?a.type:typeof r;(e===`color`||e===`colorArray`)&&(r=Oa.parse(r));let t=!1;if(e===`array`)for(let e=0;e<r.length;++e){let n=r[e];if(Ic(n)||bc(n)){t=!0;break}}if(t){let e=Object.assign({},a,{type:a.value}),t=[];for(let n=0;n<r.length;++n){let a=r[n];if(!Ic(a)&&bc(a)&&(a=bl(a,e)),Ic(a)){let r=Yz(a,`${i}[${n}]`,e);t.push(r.evaluate.bind(r))}else t.push(function(){return a})}s[n]=function(e,n,r){let i=[];for(let a=0;a<t.length;++a)i[a]=t[a](e,n,r);return i}}else s[n]=function(){return r}}}return s[n](iz,r,a)}function $z(e,t,n,r){return Qz(e,`layout`,`${n}-allow-overlap`,t,r)?Qz(e,`layout`,`${n}-ignore-placement`,t,r)?`none`:`obstacle`:`declutter`}function OTe(e,t,n,r){if(r||console.warn(`No filterCache provided to evaluateFilter()`),!(e in r))try{r[e]=al(t,`layers[${e}].filter`).filter}catch(t){console.warn(`Filter will evaluate to false: `+t.message),r[e]=function(){return!1}}return r[e](iz,n)}function eB(e,t){if(e){if(e.a===0||t===0)return;let n=e.a;return t=t===void 0?1:t,n===0?`transparent`:`rgba(`+Math.round(e.r*255/n)+`,`+Math.round(e.g*255/n)+`,`+Math.round(e.b*255/n)+`,`+n*t+`)`}return e}var kTe=/\{[^{}}]*\}/g;function tB(e,t){return e.replace(kTe,function(e){return t[e.slice(1,-1)]||``})}function nB(e,t){let n=e.split(`:`)[0];return n===e&&(n=`default`),t[n]}var ATe={};function jTe(e,t,n,r=jz,i=void 0,a=void 0,o=void 0,s=void 0){if(typeof t==`string`&&(t=JSON.parse(t)),t.schema)for(let e in t.schema){let n=t.schema[e];`default`in n&&(rz[e]=n.default)}if(t.version!=8)throw Error(`glStyle version 8 required.`);ATe[yTe(t,e)]=Array.from(arguments);let c={};(typeof a==`string`||a instanceof Request||a instanceof Response||a instanceof Promise)&&(a={default:a});for(let t in a){let n=a[t];UA(()=>n).then(async n=>{let r;if(typeof Image<`u`){let i=new Image;if(typeof n==`string`)i.crossOrigin=`anonymous`,i.src=n;else{let e;n instanceof Request?e=await fetch(n):n instanceof Response&&(e=n);let t=await e.blob();r=URL.createObjectURL(t),i.src=r}i.addEventListener(`load`,function n(){i.removeEventListener(`load`,n),c[t]={image:i,size:[i.width,i.height]},e.changed(),r&&URL.revokeObjectURL(r)}),i.addEventListener(`error`,function e(){URL.revokeObjectURL(r),i.removeEventListener(`error`,e)})}else if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope){let e=self;e.postMessage({action:`loadImage`,src:n}),e.addEventListener(`message`,function(e){e.data.action===`imageLoaded`&&e.data.src===n&&(c[t]={image:e.data.image,size:[e.data.image.width,e.data.image.height]})})}})}let l=gi(t.layers),u={},d=[],f={},p={},m=kz(t),h=bTe(t),g;for(let e=0,r=l.length;e<r;++e){let r=l[e],i=r.id;if(typeof n==`string`&&r.source==n||Array.isArray(n)&&n.indexOf(i)!==-1){let n=r[`source-layer`];if(!g){g=r.source;let e=t.sources[g];if(!e)throw Error(`Source "${g}" is not defined`);let n=e.type;if(n!==`vector`&&n!==`geojson`)throw Error(`Source "${g}" is not of type "vector" or "geojson", but "${n}"`)}else if(r.source!==g)throw Error(`Layer "${i}" does not use source "${g}`);let a=u[n];a||(a
Line truncated
|
||||
`)return t.push(`
|
||||
`,``),t;if(x==2)return t.push(Hz(s,ie),a),t;s=qz(s,a,ae,ie).split(`
|
||||
`);for(let e=0,n=s.length;e<n;++e)e>0&&t.push(`
|
||||
`,``),t.push(s[e],a);return t},[]):tB(n,g).trim(),l=Qz(d,`paint`,`text-opacity`,C,m,w)}if(ne&&l&&!te){O||(++T,b=_[T],(!b||!b.getText()||b.getFill()||b.getStroke())&&(b=new hI,_[T]=b),b.setImage(void 0),b.setGeometry(void 0));let e=$z(d,C,`text`,m);b.getText()||b.setText(k),k=b.getText(),(!k||`getDeclutterMode`in k&&k.getDeclutterMode()!==e)&&(k=new yI({padding:[2,2,2,2],declutterMode:e}),b.setText(k));let t=Qz(d,`layout`,`text-transform`,C,m,w);t==`uppercase`?ne=Array.isArray(ne)?ne.map((e,t)=>t%2?e:e.toUpperCase()):ne.toUpperCase():t==`lowercase`&&(ne=Array.isArray(ne)?ne.map((e,t)=>t%2?e:e.toLowerCase()):ne.toLowerCase());let n=Array.isArray(ne)?ne:x==2?Hz(ne,ie):qz(ne,re,ae,ie);if(k.setText(n),k.setFont(re),k.setRotation(Az(Qz(d,`layout`,`text-rotate`,C,m,w))),typeof k.setKeepUpright==`function`){let e=Qz(d,`layout`,`text-keep-upright`,C,m,w);k.setKeepUpright(e)}let r=Qz(d,`layout`,`text-anchor`,C,m,w),i=O||x==1?`point`:Qz(d,`layout`,`symbol-placement`,C,m,w),a;if(i===`line-center`?(k.setPlacement(`line`),a=`center`):k.setPlacement(i),i===`line`&&typeof k.setRepeat==`function`){let e=Qz(d,`layout`,`symbol-spacing`,C,m,w);k.setRepeat(e*2)}k.setOverflow(i===`point`);let o=Qz(d,`paint`,`text-halo-width`,C,m,w),s=Qz(d,`layout`,`text-offset`,C,m,w),c=Qz(d,`paint`,`text-translate`,C,m,w),u=0,f=0;if(i==`point`){a=`center`,r.indexOf(`left`)===-1?r.indexOf(`right`)!==-1&&(a=`right`,f=-o):(a=`left`,f=o);let e=Qz(d,`layout`,`text-rotation-alignment`,C,m,w);k.setRotateWithView(e==`map`)}else k.setMaxAngle(Az(Qz(d,`layout`,`text-max-angle`,C,m,w))*ne.length/n.length),k.setRotateWithView(!1);k.setTextAlign(a);let p=`middle`;r.indexOf(`bottom`)==0?(p=`bottom`,u=-o-.5*(M-1)*N):r.indexOf(`top`)==0&&(p=`top`,u=o+.5*(M-1)*N),k.setTextBaseline(p);let h=Qz(d,`layout`,`text-justify`,C,m,w);k.setJustify(h===`auto`?void 0:h),k.setOffsetX(s[0]*N+f+c[0]),k.setOffsetY(s[1]*N+u+c[1]);let g=k.getFill()||new dI;g.setColor(eB(Qz(d,`paint`,`text-color`,C,m,w),l)),k.setFill(g);let v=eB(Qz(d,`paint`,`text-halo-color`,C,m,w),l);if(v&&o>0){let e=k.getStroke()||new mI;e.setColor(v),o*=2;let t=.5*N;e.setWidth(o<=t?o:t),k.setStroke(e)}else k.setStroke(void 0);let y=Qz(d,`layout`,`text-padding`,C,m,w),S=k.getPadding();y!==S[0]&&(S[0]=y,S[1]=y,S[2]=y,S[3]=y),b.setZIndex(D)}}}if(T>-1)return _.length=T+1,_};return e.setStyle(v),e.set(`mapbox-layers`,d),e.set(`mapbox-source`,g),e.set(`mapbox-featurestate`,e.get(`mapbox-featurestate`)||{}),v}var MTe=Oa.parse(`#000000`),NTe=Oa.parse(`#FFFFFF`),PTe=Oa.parse(`#000000`);function FTe(e){return new uz({source:new _z({operationType:`image`,operation:gTe,sources:[e]})})}function ITe(e){return new uz({source:new _z({operationType:`image`,operation:hTe,sources:[e]})})}function LTe(e,t,n,r){e.getSource().on(`beforeoperations`,function(e){iz.zoom=Nz(e.resolution,n.resolutions||jz),iz.distanceFromCenter=0;let i=e.data;i.saturation=Qz(t,`paint`,`raster-saturation`,Tz,r),i.contrast=Qz(t,`paint`,`raster-contrast`,Tz,r),i.brightnessHigh=Qz(t,`paint`,`raster-brightness-max`,Tz,r),i.brightnessLow=Qz(t,`paint`,`raster-brightness-min`,Tz,r),i.hueRotate=Qz(t,`paint`,`raster-hue-rotate`,Tz,r)})}function RTe(e,t,n,r,i){e.getSource().on(`beforeoperations`,function(e){let a=e.data;a.resolution=TM(r.projection||`EPSG:3857`,e.resolution,Ij(e.extent),`m`);let o=Nz(e.resolution,r.resolutions||jz);iz.zoom=o,iz.distanceFromCenter=0,a.zoom=o,a.encoding=t.encoding,a.method=Qz(n,`paint`,`hillshade-method`,Tz,i)||`standard`,a.exaggeration=Qz(n,`paint`,`hillshade-exaggeration`,Tz,i);let s=Qz(n,`paint`,`hillshade-illumination-direction`,Tz,i);s??=335,a.azimuths=Array.isArray(s)?s:[s],a.sunAz=a.azimuths[0];let c=Qz(n,`paint`,`hillshade-illumination-altitude`,Tz,i);c??=45,a.altitudes=Array.isArray(c)?c:[c];function l(e){return e&&e.values?e.values[0]:e}function u(e){let t=n.paint?.[e];if(Array.isArray(t)&&t.length>0&&typeof t[0]==`string`&&Oa.parse(t[0])!==void 0)return t.map(e=>Oa.parse(e));let r=Qz(n,`paint`,e,Tz,i);return r=l(r),r?[r]:void 0}a.highlightColors=u(`hillshade-highlight-color`),a.highlightColor=a.highlightColors?.[0]||NTe,a.highlightColors||=[a.highlightColor],a.shadowColors=u(`hillshade-shadow-color`),a.shadowColor=a.shadowColors?.[0]||MTe,a.shadowColors||=[a.shadowColor],a.accentColor=l(Qz(n,`paint`,`hillshade-accent-color`,Tz,i))||PTe})}var zTe=[`raster-saturation`,`raster-contrast`,`raster-brightness-max`,`raster-brightness-min`,`raster-hue-rotate`];function BTe(e,t,n){let r=null;return function(i){e.paint&&`raster-opacity`in e.paint&&i.frameState.viewState.zoom!==r&&(r=i.frameState.viewState.zoom,delete n[e.id],VTe(e,t,r,n))}}function VTe(e,t,n,r){iz.zoom=n,iz.distanceFromCenter=0;let i=Qz(e,`paint`,`raster-opacity`,Tz,r);t.setOpacity(i)}var HTe=[`background`,`circle`,`fill`,`fill-extrusion`,`line`,`symbol`,`raster`,`hillshade`];function UTe(e,t=512){return e.getExtent()?LR({extent:e.getExtent(),tileSize:t,maxZoom:22}).getResolutions():jz}function rB(e,t){return t.accessToken||(t=Object.assign({},t),new URL(e).search
Line truncated
|
||||
`){[e,t]=MB(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}},EB=class e extends wB{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]=MB(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=`
|
||||
`){[e,t]=MB(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 TB(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 TB&&c&&(n=u[u.length-1])instanceof TB&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new TB(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)}};wB.empty=new TB([``],0);function cEe(e){let t=-1;for(let n of e)t+=n.length+1;return t}function DB(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 OB(e,t,n){return DB(e,[``],t,n)}var kB=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 TB?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 TB?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=`
|
||||
`,this;e--}else if(r instanceof TB){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 TB?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)}},AB=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new kB(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!=``}},jB=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`&&(wB.prototype[Symbol.iterator]=function(){return this.iter()},kB.prototype[Symbol.iterator]=AB.prototype[Symbol.iterator]=jB.prototype[Symbol.iterator]=function(){return this});var lEe=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 MB(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function NB(e,t,n=!0,r=!0){return oEe(e,t,n,r)}function uEe(e){return e>=56320&&e<57344}function dEe(e){return e>=55296&&e<56320}function PB(e,t){let n=e.charCodeAt(t);if(!dEe(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return uEe(r)?(n-55296<<10)+(r-56320)+65536:n}function FB(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function IB(e){return e<65536?1:2}var LB=/\r\n?|\n/,RB=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(RB||={}),zB=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){UB(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:GB(this,e)}mapDesc(e,t=!1){return e.empty?this:WB(this,e,t)}mapPos(e,t=-1,n=RB.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!=RB.Simple&&c>=e&&(n==RB.TrackDel&&r<e&&c>e||n==RB.TrackBefore&&r<e||n==RB.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)}},BB=class e extends zB{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 UB(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return WB(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(wB.empty);r.push(a?t.slice(i,i+a):wB.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:GB(this,e,!0)}map(e,t=!1){return e.empty?this:WB(this,e,t,!0)}iterChanges(e,t=!1){UB(this,e,t)}get desc(){return zB.create
Line truncated
|
||||
`}get readOnly(){return this.facet(yV)}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(pV))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 SEe(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=NB(t,a,!1);if(i(t.slice(e,a))!=DV.Word)break;a=e}for(;o<r;){let e=NB(t,o);if(i(t.slice(o,e))!=DV.Word)break;o=e}return a==o?null:JB.range(a+n,o+n)}};kV.allowMultipleSelections=mV,kV.tabSize=ZB.define({combine:e=>e.length?e[0]:4}),kV.lineSeparator=hV,kV.readOnly=yV,kV.phrases=ZB.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])}}),kV.languageData=pV,kV.changeFilter=gV,kV.transactionFilter=_V,kV.transactionExtender=vV,cV.reconfigure=xV.define();function AV(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 jV=class{eq(e){return this==e}range(e,t=e){return NV.create(e,t,this)}};jV.prototype.startSide=jV.prototype.endSide=0,jV.prototype.point=!1,jV.prototype.mapMode=RB.TrackDel;function MV(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var NV=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 PV(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var CEe=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return IV(this.to)}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,r,i,a){let o=[],s=[],c=[],l=-1,u=-1;iter:for(let e=0;e<this.value.length;e++){let d=this.value[e],f=this.from[e]+t,p=this.to[e]+t,m,h;if(f==p){let e=n.mapPos(f,d.startSide,d.mapMode);if(e==null||(m=h=e,d.startSide!=d.endSide&&(h=n.mapPos(f,d.endSide),h<m)))continue}else if(m=n.mapPos(f,d.startSide),h=n.mapPos(p,d.endSide),m>h||m==h&&d.startSide>0&&d.endSide<=0)continue;if(!((h-m||d.endSide-d.startSide)<0)){if(l<0&&(l=m),d.point&&(u=Math.max(u,h-m)),(m-r||d.startSide-i)>=0)o.push(d),s.push(m-l),c.push(h-l),r=h,i=d.endSide;else{if(m==h)for(let e=o.length;e>0;e--){if((m-(c[e-1]+l)||d.startSide-o[e-1].endSide)>=0){o.splice(e,0,d),s.splice(e,0,m-l),c.splice(e,0,h-l);continue iter}if((m-(s[e-1]+l)||d.endSide-o[e-1].startSide)>0)break}a(m,h,d)}}}return{mapped:o.length?new e(s,c,o,u):null,pos:l}}},FV=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(PV)),this.isEmpty)return n.length?e.of(n):this;let s=new EEe(this,null,-1).goto(0),c=0,l=[],u=new LV;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,!1)||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,!1)||l.push(NV.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,a,o=(e,t,n)=>{a||=new LV,a.addRange(e,t,n,!1)};for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],s=this.chunk[e],c=t.touchesRange(a,a+s.length);if(c===!1)i=Math.max(i,s.maxPoint),n.push(s),r.push(t.mapPos(a));else if(c===!0){let[e,c]=n.length?[IV(r)+IV(n).length,IV(IV(n).value).endSide]:[-1,-1],{mapped:l,pos:u}=s.map(a,t,e,c,o);l&&(i=Math.max(i,l.maxPoint),n.push(l),r.push(u))}}let s=this.nextLayer.map(t);return a&&(s=a.finishInner(s)),n.length==0?s:n
Line truncated
|
||||
`)}static newName(){let e=jEe[AEe]||1;return jEe[AEe]=e+1,kEe+e.toString(36)}static mount(e,t,n){let r=e[KV],i=n&&n.nonce;r?i&&r.setNonce(i):r=new NEe(e,i),r.mount(Array.isArray(t)?t:[t],e)}},MEe=new Map,NEe=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=MEe.get(n);if(t)return e[KV]=t;this.sheet=new r.CSSStyleSheet,MEe.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[KV]=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()+`
|
||||
`;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)}},JV={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:`'`},YV={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},PEe=typeof navigator<`u`&&/Mac/.test(navigator.platform),FEe=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),XV=0;XV<10;XV++)JV[48+XV]=JV[96+XV]=String(XV);for(var XV=1;XV<=24;XV++)JV[XV+111]=`F`+XV;for(var XV=65;XV<=90;XV++)JV[XV]=String.fromCharCode(XV+32),YV[XV]=String.fromCharCode(XV);for(var ZV in JV)YV.hasOwnProperty(ZV)||(YV[ZV]=JV[ZV]);function IEe(e){var t=!(PEe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||FEe&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?YV:JV)[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 QV(){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++)LEe(e,arguments[t]);return e}function LEe(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++)LEe(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}}var $V=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},eH=typeof document<`u`?document:{documentElement:{style:{}}},tH=/Edge\/(\d+)/.exec($V.userAgent),REe=/MSIE \d/.test($V.userAgent),nH=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec($V.userAgent),rH=!!(REe||nH||tH),zEe=!rH&&/gecko\/(\d+)/i.test($V.userAgent),iH=!rH&&/Chrome\/(\d+)/.exec($V.userAgent),BEe=`webkitFontSmoothing`in eH.documentElement.style,aH=!rH&&/Apple Computer/.test($V.vendor),VEe=aH&&(/Mobile\/\w+/.test($V.userAgent)||$V.maxTouchPoints>2),oH={mac:VEe||/Mac/.test($V.platform),windows:/Win/.test($V.platform),linux:/Linux|X11/.test($V.platform),ie:rH,ie_version:REe?eH.documentMode||6:nH?+nH[1]:tH?+tH[1]:0,gecko:zEe,gecko_version:zEe?+(/Firefox\/(\d+)/.exec($V.userAgent)||[0,0])[1]:0,chrome:!!iH,chrome_version:iH?+iH[1]:0,ios:VEe,android:/Android\b/.test($V.userAgent),webkit:BEe,webkit_version:BEe?+(/\bAppleWebKit\/(\d+)/.exec($V.userAgent)||[0,0])[1]:0,safari:aH,safari_version:aH?+(/\bVersion\/(\d+(\.\d+)?)/.exec($V.userAgent)||[0,0])[1]:0,tabSize:eH.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function sH(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 cH=Object.create(null);function lH(e,t,n){if(e==t)return!0;e||=cH,t||=cH;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 HEe(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 UEe(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 WEe(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 uH=class{eq(e){return!1}updateDOM(e,t,n){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){}},dH=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(dH||={}),fH=class extends jV{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){re
Line truncated
|
||||
`,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 gOe(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==DV.Space&&(i=t),i==t}}function _Oe(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return JB.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-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=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=xU(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return JB.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return JB.cursor(i.pos,i.assoc,void 0,o)}}function vU(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 vOe(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=vU(e,i.from,0);t!=i.from&&(a=JB.cursor(t,-1))}else{let t=vU(e,i.from,-1),n=vU(e,i.to,1);(t!=i.from||n!=i.to)&&(a=i.undirectional?JB.undirectionalRange(i.from,i.to):JB.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?JB.create(n,t.mainIndex):t}function yU(e,t,n){let r=vU(e.state.facet(QH).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:JB.cursor(r,r<n.from?1:-1)}var bU=class{constructor(e,t){this.pos=e,this.assoc=t}};function xU(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 bU(0,1);if(c>e.viewState.docHeight)return new bU(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==dH.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);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==dH.Text){let t=pOe(e,i,l,o,s);return new bU(t,t==l.from?1:-1)}}if(l.type!=dH.Text)return c<(l.top+l.bottom)/2?new bU(l.from,1):new bU(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new yOe(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var yOe=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[FH.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[FH.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){for(let e=1;e<n;e++){let t=f+e;if(t>=i&&(t-=n),!a.has(t)){f=t;break adjust}}break search}a.add(f);let p=t(f),m=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(t.width==0&&p.length>1)){if(t.bottom<this.y)(!s||s.bottom<t.bottom)&&(s=t),m=1;else if(t.top>this.y)(!c||c.top>t.top)&&(c=t),m=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<u&&(l=f,u=n,d=t),e&&(m=e<0==(this.baseDir==AH.LTR)?-1:1)}}}m==-1&&(!o||this.baseDirAt(e[f],1))?i=f:m==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}if(!d){if(!c&&!s)return{i:0,after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==AH.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=NB(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return DH(e.dom,i,a).getClientRects()});return r.after?new bU(n[r.i+1],-1):new bU(n[r.i],1)}scanTile(e,t){if(!e.length)return new bU(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:DH(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new bU(n[r.i+1],-1):new bU(a,1)}},SU=``,bOe=clas
Line truncated
|
||||
`&&e.lineWrapping&&(r&&=JB.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:wB.of([` `])}),n)return CU(e,n,r,o);if(r&&!wU(r,a)){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=vOe(i.facet(QH).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function CU(e,t,n,r=-1){if(oH.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(oH.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&&OH(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)&&OH(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&OH(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=DOe(e,t,n);return e.state.facet(DDe).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function DOe(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=vU(i.facet(QH).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:JB.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&&rOe(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?JB.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 OOe(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 kOe(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 COe(n,r)),(i!=n||a!=r)&&t.push(new COe(i,a))),t}function AOe(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?JB.single(n+t,r+t):null}function wU(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var jOe=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=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,oH.safari&&e.contentDOM.addEventListener(`input`,()=>null),oH.gecko&&cke(e.contentDOM.ownerDocument)}handleEvent(e){!UOe(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.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}}}}ensur
Line truncated
|
||||
`))};if((oH.mac||oH.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:wB.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);CU(e,u,JB.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(fH.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:MDe.of(fH.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=>{let t=_H(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}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>3e4)}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])}},eW=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
Line truncated
|
||||
--\u2028\u2029-]`,SW),nAe={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},CW=null;function rAe(){if(CW==null&&typeof document<`u`&&document.body){let e=document.body.style;CW=(e.tabSize??e.MozTabSize)!=null}return CW||!1}var wW=ZB.define({combine(e){let t=AV(e,{render:null,specialChars:tAe,addSpecialChars:null});return(t.replaceTabs=!rAe())&&(t.specialChars=RegExp(` |`+t.specialChars.source,SW)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,SW)),t}});function iAe(e={}){return[wW.of(e),oAe()]}var aAe=null;function oAe(){return aAe||=qH.fromClass(class{constructor(e){this.view=e,this.decorations=fH.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(wW)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new eAe({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=PB(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=WV(e.text,t,r-e.from);return fH.replace({widget:new uAe((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=fH.replace({widget:new lAe(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(wW);e.startState.facet(wW)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}var sAe=`•`;function cAe(e){return e>=32?sAe:e==10?``:String.fromCharCode(9216+e)}var lAe=class extends uH{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=cAe(this.code),n=e.state.phrase(`Control character`)+` `+(nAe[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},uAe=class extends uH{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}};function dAe(){return pAe}var fAe=fH.line({class:`cm-activeLine`}),pAe=qH.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(fAe.range(i.from)),t=i.from)}return fH.set(n)}},{decorations:e=>e.decorations}),TW=2e3;function mAe(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>TW||n.off>TW||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(JB.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=GV(n.text,o,e.tabSize,!0);if(r<0)a.push(JB.cursor(n.to));else{let t=GV(n.text,s,e.tabSize);a.push(JB.range(n.from+r,n.from+t))}}}return a}function hAe(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function EW(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>TW?-1:i==r.length?hAe(e,t.clientX):WV(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function gAe(e,t){let n=EW(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=EW(e,t);if(!o)return r;let s=mAe(e.state,n,o);return s.length?a?JB.create(s.concat(r.ranges)):JB.create(s):r}}:null}function _Ae(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return eW.mouseSelectionStyle.of((e,n)=>t(n)?gAe(e,n):null)}var vAe={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},yAe={style:`cursor: crosshair`};function bAe(e={}){let[t,n]=vAe[e.key||`Alt`],r=qH.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){(e.keyCode==t||!n(e))&&this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,eW.contentAttributes.of(e=>e.plugin(r)?.isDown?yAe:null)]}var DW=`-100Line truncated
|
||||
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new ONe(this):new ENe(this)}getCursor(e,t=0,n){let r=e.doc?e:kV.create({doc:e});return n??=r.doc.length,this.regexp?bJ(this,r,t,n):yJ(this,r,t,n)}},vJ=class{constructor(e){this.spec=e}};function yJ(e,t,n,r){return new rJ(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?TNe(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function TNe(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(xJ(i,n-a))!=DV.Word||t(SJ(i,n-a))!=DV.Word)&&(t(SJ(i,r-a))!=DV.Word||t(xJ(i,r-a))!=DV.Word))}var ENe=class extends vJ{constructor(e){super(e)}nextMatch(e,t,n){let r=yJ(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=yJ(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=yJ(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=yJ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=yJ(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function bJ(e,t,n,r){return new oJ(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?DNe(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function xJ(e,t){return e.slice(NB(e,t,!1),t)}function SJ(e,t){return e.slice(t,NB(e,t))}function DNe(e){return(t,n,r)=>!r[0].length||(e(xJ(r.input,r.index))!=DV.Word||e(SJ(r.input,r.index))!=DV.Word)&&(e(SJ(r.input,r.index+r[0].length))!=DV.Word||e(xJ(r.input,r.index+r[0].length))!=DV.Word)}var ONe=class extends vJ{nextMatch(e,t,n){let r=bJ(this.spec,e,n,e.doc.length).next();return r.done&&(r=bJ(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=bJ(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=bJ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=bJ(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},CJ=xV.define(),wJ=xV.define(),TJ=rV.define({create(e){return new EJ(MJ(e).create(),null)},update(e,t){for(let n of t.effects)n.is(CJ)?e=new EJ(n.value.create(),e.panel):n.is(wJ)&&(e=new EJ(e.query,n.value?jJ:null));return e},provide:e=>WW.from(e,e=>e.panel)}),EJ=class{constructor(e,t){this.query=e,this.panel=t}},kNe=fH.mark({class:`cm-searchMatch`}),ANe=fH.mark({class:`cm-searchMatch cm-searchMatch-selected`}),jNe=qH.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(TJ))}update(e){let t=e.state.field(TJ);(t!=e.startState.field(TJ)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return fH.none;let{view:n}=this,r=new LV;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?ANe:kNe)})}return r.finish()}},{decorations:e=>e.decorations});function DJ(e){return t=>{let n=t.state.field(TJ,!1);return n&&n.query.spec.valid?e(t,n):FJ(t)}}var OJ=DJ((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=JB.single(r.from,r.to),a=e.state.facet(gJ);return e.dispatch({selection:i,effects:[BJ(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),PJ(e),!0}),kJ=DJ((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=JB.single(i.from,i.to),o=e.state.facet(gJ);return e.dispatch({selection:a,effects:[BJ(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),PJ(e),!0}),MNe=DJ((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:JB.create(n.map(e=>JB.rang
Line truncated
|
||||
`)}var c={extraLines:2,tabSize:4};return function(e,t,r,i){i=a({},c,i);var l=e.split(/\r\n?|\n|\f/),u=Math.max(1,t-i.extraLines)-1,d=Math.min(t+i.extraLines,l.length),f=String(d).length;return[s(l,u,t,f,i),n(` `,o(l[t-1].substring(0,r-1),t,f,i).length)+`^`,s(l,t,d,f,i)].filter(Boolean).join(`
|
||||
`)}})}),o=Error().stack,s=(function(e){var t=Object.create(SyntaxError.prototype);return Object.assign(t,e,{name:`SyntaxError`}),Object.defineProperty(t,"stack",{get:function(){return o?o.replace(/^(.+\n){1,3}/,String(t)+`
|
||||
`):``}}),t}),c=(function(e,t,n,r,i){throw s({message:r?e+`
|
||||
`+a(t,r,i):e,rawMessage:e,source:n,line:r,column:i})}),l={unexpectedEnd:function(){return`Unexpected end of input`},unexpectedToken:function(e){var t=[...arguments].slice(1);return`Unexpected token <`+e+`> at `+t.filter(Boolean).join(`:`)}},u={unexpectedSymbol:function(e){var t=[...arguments].slice(1);return`Unexpected symbol <`+e+`> at `+t.filter(Boolean).join(`:`)}},d={LEFT_BRACE:0,RIGHT_BRACE:1,LEFT_BRACKET:2,RIGHT_BRACKET:3,COLON:4,COMMA:5,STRING:6,NUMBER:7,TRUE:8,FALSE:9,NULL:10},f={"{":d.LEFT_BRACE,"}":d.RIGHT_BRACE,"[":d.LEFT_BRACKET,"]":d.RIGHT_BRACKET,":":d.COLON,",":d.COMMA},p={true:d.TRUE,false:d.FALSE,null:d.NULL},m={_START_:0,START_QUOTE_OR_CHAR:1,ESCAPE:2},h={'"':0,"\\":1,"/":2,b:3,f:4,n:5,r:6,t:7,u:8},g={_START_:0,MINUS:1,ZERO:2,DIGIT:3,POINT:4,DIGIT_FRACTION:5,EXP:6,EXP_DIGIT_OR_SIGN:7};function _(e){return e>=`1`&&e<=`9`}function v(e){return e>=`0`&&e<=`9`}function y(e){return v(e)||e>=`a`&&e<=`f`||e>=`A`&&e<=`F`}function b(e){return e===`e`||e===`E`}function x(e,t,n,r){var i=e.charAt(t);if(i===`\r`)t++,n++,r=1,e.charAt(t)===`
|
||||
`&&t++;else if(i===`
|
||||
`)t++,n++,r=1;else if(i===` `||i===` `)t++,r++;else return null;return{index:t,line:n,column:r}}function S(e,t,n,r){var i=e.charAt(t);return i in f?{type:f[i],line:n,column:r+1,index:t+1,value:null}:null}function C(e,t,n,r){for(var i in p)if(p.hasOwnProperty(i)&&e.substr(t,i.length)===i)return{type:p[i],line:n,column:r+i.length,index:t+i.length,value:i};return null}function w(e,t,n,r){for(var i=t,a=m._START_;t<e.length;){var o=e.charAt(t);switch(a){case m._START_:if(o===`"`)t++,a=m.START_QUOTE_OR_CHAR;else return null;break;case m.START_QUOTE_OR_CHAR:if(o===`\\`)t++,a=m.ESCAPE;else if(o===`"`)return t++,{type:d.STRING,line:n,column:r+t-i,index:t,value:e.slice(i,t)};else t++;break;case m.ESCAPE:if(o in h){if(t++,o===`u`)for(var s=0;s<4;s++){var c=e.charAt(t);if(c&&y(c))t++;else return null}a=m.START_QUOTE_OR_CHAR}else return null}}}function T(e,t,n,r){var i=t,a=t,o=g._START_;iterator:for(;t<e.length;){var s=e.charAt(t);switch(o){case g._START_:if(s===`-`)o=g.MINUS;else if(s===`0`)a=t+1,o=g.ZERO;else if(_(s))a=t+1,o=g.DIGIT;else return null;break;case g.MINUS:if(s===`0`)a=t+1,o=g.ZERO;else if(_(s))a=t+1,o=g.DIGIT;else return null;break;case g.ZERO:if(s===`.`)o=g.POINT;else if(b(s))o=g.EXP;else break iterator;break;case g.DIGIT:if(v(s))a=t+1;else if(s===`.`)o=g.POINT;else if(b(s))o=g.EXP;else break iterator;break;case g.POINT:if(v(s))a=t+1,o=g.DIGIT_FRACTION;else break iterator;break;case g.DIGIT_FRACTION:if(v(s))a=t+1;else if(b(s))o=g.EXP;else break iterator;break;case g.EXP:if(s===`+`||s===`-`)o=g.EXP_DIGIT_OR_SIGN;else if(v(s))a=t+1,o=g.EXP_DIGIT_OR_SIGN;else break iterator;break;case g.EXP_DIGIT_OR_SIGN:if(v(s))a=t+1;else break iterator}t++}return a>0?{type:d.NUMBER,line:n,column:r+a-i,index:a,value:e.slice(i,a)}:null}var E=function(e,t){for(var n=1,a=1,o=0,s=[];o<e.length;){var l=[e,o,n,a],d=x.apply(void 0,l);if(d){o=d.index,n=d.line,a=d.column;continue}var f=S.apply(void 0,l)||C.apply(void 0,l)||w.apply(void 0,l)||T.apply(void 0,l);if(f){var p={type:f.type,value:f.value,loc:i(n,a,o,f.line,f.column,f.index,t.source)};s.push(p),o=f.index,n=f.line,a=f.column}else c(u.unexpectedSymbol(r(e,o,o+1),t.source,n,a),e,t.source,n,a)}return s},D={_START_:0,OPEN_OBJECT:1,PROPERTY:2,COMMA:3},O={_START_:0,KEY:1,COLON:2},k={_START_:0,OPEN_ARRAY:1,VALUE:2,COMMA:3},A={loc:!0,source:null};function ee(e,t,n){var r=t.length>0?t[t.length-1].loc.end:{line:1,column:1};c(l.unexpectedEnd(),e,n.source,r.line,r.column)}function j(e){for(var t=0,n=0;n<4;n++)t=t*16+parseInt(e[n],16);return String.fromCharCode(t)}var te={b:`\b`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `},ne=[`"`,`\\`,`/`];function re(e){for(var t=``,n=0;n<e.length;n++){var r=e.charAt(n);if(r===`\\`){n++;var i=e.charAt(n);if(i===`u`)t+=j(e.substr(n+1,4)),n+=4;else if(ne.indexOf(i)!==-1)t+=i;else if(i in te)t+=te[i];else break}else t+=r}return t}function M(e,t,n,a){for(var o=void 0,s={type:`Object`,children:[]},u=D._START_;n<t.length;){var f=t[n];switch(u){case D._START_:if(f.type===d.LEFT_BRACE)o=f,u=D.OPEN_OBJECT,n++;else return null;break;case D.OPEN_OBJECT:if(f.type===d.RIGHT_BRACE)return a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,f.loc.end.line,f.loc.end.column,f.loc.end.offset,a.source)),{value:s,index:n+1};var p=N(e,t,n,a);s.children.push(p.value),u=D.PROPERTY,n=p.index;break;case D.PROPERTY:if(f.type===d.RIGHT_BRACE)return a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,f.loc.end.line,f.loc.end.column,f.loc.end.offset,a.source)),{value:s,index:n+1};f.type===d.COMMA?(u=D.COMMA,n++):c(l.unexpectedToken(r(e,f.loc.start.offset,f.loc.end.offset),a.source,f.loc.start.line,f.loc.start.column),e,a.source,f.loc.start.line,f.loc.start.column);break;case D.COMMA:var m=N(e,t,n,a);m?(n=m.index,s.children.push(m.value),u=D.PROPERTY):c(l.unexpectedToken(r(e,f.loc.start.offset,f.loc.end.offset),a.source,f.loc.start.line,f.loc.start.column),e,a.source,f.loc.start.line,f.loc.start.column)}}ee(e,t,a)}function N(e,t,n,a){for(var o=void 0,s={type:`Property`,key:null,value:null},u=O._START_;n<t.length;){var f=t[n];switch(u){case O._START_:if(f.type===d.STRING){var p={type:`Identifier`,value:re(e.slice(f.loc.start.offset+1,f.loc.end.offset-1)),raw:f.value};a.loc&&(p.loc=f.loc),o=f,s.key=p,u=O.KEY,n++}else return null;break;case O.KEY:f.type===d.COLON?(u=O.COLON,n++):c(l.unexpectedToken(r(e,f.loc.start.offset,f.loc.end.offset),a.source,f.loc.start.line,f.loc.start.column),e,a.source,f.loc.start.line,f.loc.start.column);break;case O.COLON:var m=oe(e,t,n,a);return s.value=m.value,a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,m.value.loc.end.line,m.value.loc.end.column,m.value.loc.end.offset,a.source)),{value:s,index:m.index}}}}function ie(e,t,n,a){for(var o=void 0,s={type:`Array`,children:[]},u=k._START_,f=void 0;n<t.length;)switch(f=t[n],u){case k._START_:if(f.type===d.LEFT_BRACKET)o=f,u=k.OPEN_ARRAY,n++;else return null;break;case k.OPEN_ARRAY:if(f.type===d.RIGHT_BRACKET)return a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,f.loc.end.line,f.loc.end.column,f.loc.end.offset,a.source)),{value:s,index:n+1};var p=oe(e,t,n,a);n=p.index,s.children.push(p.value),u=k.VALUE;break;case k.VALUE:if(f.type===d.RIGHT_BRACKET)return a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,f.loc.end.line,f.loc.end.column,f.loc.end.offset,a.source)),{value:s,index:n+1};f.type===d.COMMA?(u=k.COMMA,n++):c(l.unexpectedToken(r(e,f.loc.start.offset,f.loc.end.offset),a.source,f.loc.start.line,f.loc.start.column),e,a.source,f.loc.start.line,f.loc.start.column);break;case k.COMMA:var m=oe(e,t,n,a);n=m.index,s.children.push(m.value),u=k.VALUE}ee(e,t,a)}function ae(e,t,n,r){var i=t[n],a=null;switch(i.type){case d.STRING:a=re(e.slice(i.loc.start.offset+1,i.loc.end.offset-1));break;case d.NUMBER:a=Number(i.value);break;case d.TRUE:a=!0;break;case d.FALSE:a=!1;break;case d.NULL:a=null;break;default:return null}var o={type:`Literal`,value:a,raw:i.value};return r.loc&&(o.loc=i.loc),{value:o,index:n+1}}function oe(e,t,n,i){var a=t[n],o=ae.apply(void 0,arguments)||M.apply(void 0,arguments)||ie.apply(void 0,arguments);if(o)return o;c(l.unexpectedToken(r(e,a.loc.start.offset,a.loc.end.offset),i.source,a.loc.start.line,a.loc.start.column),e,i.source,a.loc.start.line,a.loc.start.column)}return(function(e,t){t=Object.assign({},A,t);var n=E(e,t);n.length===0&&ee(e,n,t);var i=oe(e,n,0,t);if(i.index===n.length)return i.value;var a=n[i.index];c(l.unexpectedToken(r(e,a.loc.start.offset,a.loc.end.offset),t.source,a.loc.start.line,a.loc.start.column),e,t.source,a.loc.start.line,a.loc.start.column)})}))}))(),1);function _X(){var e=`/home/runner/work/maputnik/maputnik/src/libs/json-path-to-position.ts`,t=`ea54e84c59655b08b790cad163b45126d1fe9ab0`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/libs/json-path-to-position.ts`,statementMap:{0:{start:{line:2,column:1},end:{line:4,column:2}},1:{start:{line:3,column:2},end:{line:3,column:19}},2:{start:{line:5,column:1},end:{line:7,column:2}},3:{start:{line:6,column:2},end:{line:6,column:14}},4:{start:{line:8,column:1},end:{line:10,column:2}},5:{start:{line:9,column:2},end:{line:9,column:19}},6:{start:{line:11,column:13},end:{line:11,column:20}},7:{start:{line:12,column:1},end:{line:14,column:2}},8:{start:{line:13,column:2},end:{line:13,column:68}},9:{start:{line:15,column:17},end:{line:17,column:3}},10:{start:{line:16,column:2},end:{line:16,column:98}},11:{start:{line:18,column:1},end:{line:18,column:58}}},fnMap:{0:{name:`jsonPathToPosition`,decl:{start:{line:1,column:1
Line truncated
|
||||
To pick up a draggable item, press the space bar.
|
||||
While dragging, use the arrow keys to move the item.
|
||||
Press space again to drop the item in its new position, or press escape to cancel.
|
||||
`},FFe={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 IFe(e){let{announcements:t=FFe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=PFe}=e,{announce:a,announcement:o}=jFe(),s=BX(`DndLiveRegion`),[c,l]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{l(!0)},[]),MFe((0,m.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=m.createElement(m.Fragment,null,m.createElement(kFe,{id:r,value:i.draggable}),m.createElement(AFe,{id:s,announcement:o}));return n?(0,wX.createPortal)(u,n):u}var YX;(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`})(YX||={});function XX(){}function LFe(e,t){return(0,m.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function RFe(){var e=[...arguments];return(0,m.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var ZX=Object.freeze({x:0,y:0});function zFe(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function BFe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function VFe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function HFe(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function QX(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 UFe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=QX(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=zFe(QX(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(BFe)};function WFe(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 GFe=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=WFe(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(VFe)};function KFe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function $X(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ZX}function qFe(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 JFe=qFe(1);function YFe(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]}}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 XFe(e,t,n){let r=YFe(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 ZFe={ignoreTransform:!1};function eZ(e,t){t===void 0&&(t=ZFe);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=OX(e).getComputedStyle(e);t&&(n=XFe(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 tZ(e){return eZ(e,{ignoreTransform:!0})}function QFe(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function $Fe(e,t){return t===void 0&&(t=OX(e).getComputedStyle(e)),t.position===`fixed`}function eIe(e,t){t===void 0&&(t=OX(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)})}function nZ(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(kX(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!AX(i)||jX(i)||n.includes(i))return n;let a=OX(e).getComputedStyle(i);return i!==e&&eIe(i,a)&&n.push(i),$Fe(i,a)?n:r(i.parentNode)}return e?r(e):n}function rZ(e){let[t]=nZ(e,1);return t??null}function iZ(e){return!TX||!e?null:EX(e)?e:DX(e)?kX(e)||e===MX(e).scrollingElement?win
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function VQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?BQ(Object(n),!0).forEach(function(t){yLe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function SLe(e){return vLe(e)||bLe(e)||TLe(e)||xLe()}function CLe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wLe(e){var t=CLe(e,`string`);return typeof t==`symbol`?t:t+``}function TLe(e,t){if(e){if(typeof e==`string`)return zQ(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zQ(e,t):void 0}}var HQ,UQ,WQ,GQ,KQ,qQ,JQ,YQ,XQ,ZQ,QQ,ELe=o((()=>{RQ(),HQ={activateTrap:function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n._setPausedState(!0)}var r=e.indexOf(t);r===-1||e.splice(r,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}},UQ=function(e){return e.tagName&&e.tagName.toLowerCase()===`input`&&typeof e.select==`function`},WQ=function(e){return e?.key===`Escape`||e?.key===`Esc`||e?.keyCode===27},GQ=function(e){return e?.key===`Tab`||e?.keyCode===9},KQ=function(e){return GQ(e)&&!e.shiftKey},qQ=function(e){return GQ(e)&&e.shiftKey},JQ=function(e){return setTimeout(e,0)},YQ=function(e){var t=[...arguments].slice(1);return typeof e==`function`?e.apply(void 0,t):e},XQ=function(e){return e.target.shadowRoot&&typeof e.composedPath==`function`?e.composedPath()[0]:e.target},ZQ=[],QQ=function(e,t){var n=t?.document||document,r=t?.trapStack||ZQ,i=VQ({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:KQ,isKeyBackward:qQ},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(e,t,n){return e&&e[t]!==void 0?e[t]:i[n||t]},c=function(e,t){var n=typeof t?.composedPath==`function`?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,i=t.tabbableNodes;return r.contains(e)||n?.includes(r)||i.find(function(t){return t===e})})},l=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.hasFallback,a=r!==void 0&&r,o=t.params,s=o===void 0?[]:o,c=i[e];if(typeof c==`function`&&(c=c.apply(void 0,SLe(s))),c===!0&&(c=void 0),!c){if(c===void 0||c===!1)return c;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}var l=c;if(typeof c==`string`){try{l=n.querySelector(c)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!l&&!a)throw Error(`\`${e}\` as selector refers to no known node`)}return l},u=function(){var e=l(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!LQ(e,i.tabbableOptions)){if(c(n.activeElement)>=0)e=n.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l(`fallbackFocus`)}}else e===null&&(e=l(`fallbackFocus`));if(!e)throw Error(`Your focus-trap needs to have at least one focusable element`);return e},d=function(){if(a.containerGroups=a.containers.map(function(e){var t=NQ(e,i.tabbableOptions),n=PQ(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find(function(e){return FQ(e)}),s=n.slice().reverse().find(function(e){return FQ(e)});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:!!t.find(function(e){return hQ(e)>0}),firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=t.indexOf(e);return i<0?r?n.slice(n.indexOf(e)+1).find(function(e){return FQ(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return FQ(e)}):t[i+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!l(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw Error(`At least one node with a positive tabindex was found in one of your focus-trap's multiple con
Line truncated
|
||||
`);d=~n?e.length-n:d+e.length}function p(){var e={line:l,column:d};return function(t){return t.position=new m(e),v(),t}}function m(e){this.start=e,this.end={line:l,column:d},this.source=t.source}m.prototype.content=e;var h=[];function g(n){var r=Error(t.source+`:`+l+`:`+d+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=d,r.source=e,t.silent)h.push(r);else throw r}function _(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function v(){_(i)}function y(e){var t;for(e||=[];t=b();)t!==!1&&e.push(t);return e}function b(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return g(`End of comment missing`);var r=e.slice(2,n-2);return d+=2,f(r),e=e.slice(n),d+=2,t({type:`comment`,comment:r})}}function x(){var e=p(),t=_(a);if(t){if(b(),!_(o))return g(`property missing ':'`);var r=_(s),i=e({type:`declaration`,property:u(t[0].replace(n,``)),value:r?u(r[0].replace(n,``)):``});return _(c),i}}function S(){var e=[];y(e);for(var t;t=x();)t!==!1&&(e.push(t),y(e));return e}return v(),S()};function u(e){return e?e.replace(l,``):``}})),YLe=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(JLe());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),XLe=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),ZLe=s(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(YLe()),r=XLe();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),A$=M$(`end`),j$=M$(`start`);function M$(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function QLe(e){let t=j$(e),n=A$(e);if(t&&n)return{start:t,end:n}}function N$(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?F$(e.position):`start`in e||`end`in e?F$(e):`line`in e||`column`in e?P$(e):``}function P$(e){return I$(e&&e.line)+`:`+I$(e&&e.column)}function F$(e){return P$(e&&e.start)+`-`+P$(e&&e.end)}function I$(e){return e&&typeof e==`number`?e:1}var L$=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=N$(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};L$.prototype.file=``,L$.prototype.name=``,L$.prototype.reason=``,L$.prototype.message=``,L$.prototype.stack=``,L$.prototype.column=void 0,L$.prototype.line=void 0,L$.prototype.ancestors=void 0,L$.prototype.cause=void 0,L$.prototype.fatal=void 0,L$.prototype.place=void 0,L$.prototype.ruleId=void 0,L$.prototype.source=void 0;var $Le=u(ZLe(),1),R$={}.hasOwnProperty,eRe=new Map,tRe=/[A-Z]/g,nRe=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),rRe=new Set([`td`,`th`]);function iRe(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=fRe(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=dRe(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,
Line truncated
|
||||
`;break;case-3:o=`\r
|
||||
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function gBe(e){let t={constructs:CRe([rBe,...(e||{}).extensions||[]]),content:n(jRe),defined:[],document:n(NRe),flow:n(Zze),lazy:{},string:n(eBe),text:n(tBe)};return t;function n(e){return n;function n(n){return pBe(t,e,n)}}}function _Be(e){for(;!w1(e););return e}var L1=/[\0\t\n\r]/g;function vBe(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(L1.lastIndex=u,c=L1.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var yBe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function bBe(e){return e.replace(yBe,xBe)}function xBe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return $$(n.slice(t?2:1),t?16:10)}return Y$(n)||e}var R1={}.hasOwnProperty;function SBe(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),CBe(n)(_Be(gBe(n).document().write(vBe()(e,t,!0))))}function CBe(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(xe),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(_e),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(he),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(ge),hardBreakEscape:a(ve),hardBreakTrailing:a(ve),htmlFlow:a(ye,o),htmlFlowData:T,htmlText:a(ye,o),htmlTextData:T,image:a(be),label:o,link:a(xe),listItem:a(Ce),listItemValue:f,listOrdered:a(Se,d),listUnordered:a(Se),paragraph:a(we),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(_e),strong:a(Te),thematicBreak:a(De)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(te),label:re,labelText:ne,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:M,resourceTitleString:N,resource:ie,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};B1(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];R1.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||V1).call(a,void 0,e[0])}for(r.position={start:z1(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:z1(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(Line truncated
|
||||
`}]}function OBe(e,t){let n=t.value?t.value+`
|
||||
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function kBe(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ABe(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jBe(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=l1(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function MBe(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NBe(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function H1(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function PBe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return H1(e,t);let i={src:l1(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function FBe(e,t){let n={src:l1(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function IBe(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function LBe(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return H1(e,t);let i={href:l1(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function RBe(e,t){let n={href:l1(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zBe(e,t,n){let r=e.all(t),i=n?BBe(n):U1(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
||||
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
||||
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function BBe(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=U1(n[r])}return t}function U1(e){return e.spread??e.children.length>1}function VBe(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function HBe(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UBe(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function WBe(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function GBe(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=j$(t.children[1]),o=A$(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function KBe(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function qBe(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var W1=9,G1=32;function JBe(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(K1(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(K1(t.slice(i),i>0,!1)),a.join(``)}function K1(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===W1||t===G1;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===W1||t===G1;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function YBe(e,t){let n={type:`text`,value:JBe(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function XBe(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var ZBe={blockquote:EBe,break:DBe,code:OBe,delete:kBe,emphasis:ABe,footnoteReference:jBe,heading:MBe,html:NBe,imageReference:PBe,image:FBe,inlineCode:IBe,linkReference:LBe,link:RBe,listItem:zBe,list:VBe,paragraph:HBe,root:UBe,strong:WBe,table:GBe,tableCell:qBe,tableRow:KBe,text:YBe,thematicBreak:XBe,toml:q1,yaml:q1,definition:q1,footnoteDefinition:q1};function q1(){}var J1=typeof self==`object`?self:globalThis,QBe=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new J1[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new J1[a](o),i)};return r},Y1=e=>QBe(new Map,e)(0),X1=``,{toString:$Be}={},{keys:eVe}=Object,Z1=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=$Be.call(e).slice(8,-1);switch(n){case`Array`:return[1,X1];case`Object`:return[2,X1];case`Date`:return[3,X1];case`RegExp`:return[4,X1];case`Map`:return[5,X1];case`Set`:return[6,X1];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},Q1=([e,t])=>e===0&&(t===`function`||t===`symbol`),tVe=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=Z1(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`BooleLine truncated
|
||||
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
||||
`}]}}var t0=(function(e){if(e==null)return cVe;if(typeof e==`function`)return n0(e);if(typeof e==`object`)return Array.isArray(e)?aVe(e):oVe(e);if(typeof e==`string`)return sVe(e);throw Error(`Expected function, string, or object as test`)});function aVe(e){let t=[],n=-1;for(;++n<e.length;)t[n]=t0(e[n]);return n0(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function oVe(e){let t=e;return n0(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function sVe(e){return n0(t);function t(t){return t&&t.type===e}}function n0(e){return t;function t(t,n,r){return!!(lVe(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function cVe(){return!0}function lVe(e){return typeof e==`object`&&!!e&&`type`in e}function uVe(e){return e}var r0=[];function dVe(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=t0(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+uVe(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=r0,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=fVe(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function fVe(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?r0:[e]}function i0(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),dVe(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var a0={}.hasOwnProperty,pVe={};function mVe(e,t){let n=t||pVe,r=new Map,i=new Map,a={all:s,applyData:gVe,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ZBe,...n.handlers},one:o,options:n,patch:hVe,wrap:vVe};return i0(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(a0.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=e0(n);return r.children=a.all(e),r}return e0(e)}return(a.options.unknownHandler||_Ve)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=o0(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=o0(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function hVe(e,t){e.position&&(t.position=QLe(e))}function gVe(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,e0(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function _Ve(e,t){let n=t.data||{},r=`value`in t&&!(a0.call(n,`hProperties`)||a0.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vVe(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
||||
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
||||
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
||||
`}),n}function o0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function s0(e,t){let n=mVe(e,t),r=n.one(e,void 0),i=iVe(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
||||
`},i)),a}function yVe(e,t){return e&&`run`in e?async function(n,r){let i=s0(n,{file:r,...t});await e.run(i,r)}:function(n,r){return s0(n,{file:r,...e||t})}}function c0(e){if(e)throw e}var bVe=s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function l0(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function xVe(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?SVe(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function SVe(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var u0={basename:CVe,dirname:wVe,extname:TVe,join:EVe,sep:`/`};function CVe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);d0(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function wVe(e){if(d0(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function TVe(e){d0(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function EVe(...e){let t=-1,n;for(;++t<e.length;)d0(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:DVe(n)}function DVe(e){d0(e);let t=e.codePointAt(0)===47,n=OVe(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function OVe(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function d0(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var kVe={cwd:AVe};function AVe(){return`/`}function f0(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function jVe(e){if(typeof e==`string`)e=new URL(e);else if(!f0(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return MVe(e)}function MVe(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.p
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PUe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var FUe=T3(function e(t){var n=this,r=t.expanded,i=r===void 0?[]:r,a=t.allowMultipleExpanded,o=a!==void 0&&a,s=t.allowZeroExpanded,c=s!==void 0&&s;C3(this,e),E3(this,`expanded`,void 0),E3(this,`allowMultipleExpanded`,void 0),E3(this,`allowZeroExpanded`,void 0),E3(this,`toggleExpanded`,function(e){return n.isItemDisabled(e)?n:n.isItemExpanded(e)?n.augment({expanded:n.expanded.filter(function(t){return t!==e})}):n.augment({expanded:n.allowMultipleExpanded?[].concat(OUe(n.expanded),[e]):[e]})}),E3(this,`isItemDisabled`,function(e){var t=n.isItemExpanded(e),r=n.expanded.length===1;return!!(t&&!n.allowZeroExpanded&&r)}),E3(this,`isItemExpanded`,function(e){return n.expanded.indexOf(e)!==-1}),E3(this,`getPanelAttributes`,function(e,t){var r=t??n.isItemExpanded(e);return{role:n.allowMultipleExpanded?void 0:`region`,"aria-hidden":n.allowMultipleExpanded?!r:void 0,"aria-labelledby":n.getButtonId(e),id:n.getPanelId(e),hidden:!r||void 0}}),E3(this,`getHeadingAttributes`,function(){return{role:`heading`}}),E3(this,`getButtonAttributes`,function(e,t){var r=t??n.isItemExpanded(e),i=n.isItemDisabled(e);return{id:n.getButtonId(e),"aria-disabled":i,"aria-expanded":r,"aria-controls":n.getPanelId(e),role:`button`,tabIndex:0}}),E3(this,`getPanelId`,function(e){return`accordion__panel-${e}`}),E3(this,`getButtonId`,function(e){return`accordion__heading-${e}`}),E3(this,`augment`,function(t){return new e(S3({expanded:n.expanded,allowMultipleExpanded:n.allowMultipleExpanded,allowZeroExpanded:n.allowZeroExpanded},t))}),this.expanded=i,this.allowMultipleExpanded=o,this.allowZeroExpanded=c}),I3=(0,m.createContext)(null),L3=function(e){O3(n,e);var t=N3(n);function n(){var e;C3(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),E3(M3(e),`state`,new FUe({expanded:e.props.preExpanded,allowMultipleExpanded:e.props.allowMultipleExpanded,allowZeroExpanded:e.props.allowZeroExpanded})),E3(M3(e),`toggleExpanded`,function(t){e.setState(function(e){return e.toggleExpanded(t)},function(){e.props.onChange&&e.props.onChange(e.state.expanded)})}),E3(M3(e),`isItemDisabled`,function(t){return e.state.isItemDisabled(t)}),E3(M3(e),`isItemExpanded`,function(t){return e.state.isItemExpanded(t)}),E3(M3(e),`getPanelAttributes`,function(t,n){return e.state.getPanelAttributes(t,n)}),E3(M3(e),`getHeadingAttributes`,function(){return e.state.getHeadingAttributes()}),E3(M3(e),`getButtonAttributes`,function(t,n){return e.state.getButtonAttributes(t,n)}),e}return T3(n,[{key:`render`,value:function(){var e=this.state,t=e.allowZeroExpanded,n=e.allowMultipleExpanded;return(0,m.createElement)(I3.Provider,{value:{allowMultipleExpanded:n,allowZeroExpanded:t,toggleExpanded:this.toggleExpanded,isItemDisabled:this.isItemDisabled,isItemExpanded:this.isItemExpanded,getPanelAttributes:this.getPanelAttributes,getHeadingAttributes:this.getHeadingAttributes,getButtonAttributes:this.getButtonAttributes}},this.props.children||null)}}]),n}(m.PureComponent);E3(L3,`defaultProps`,{allowMultipleExpanded:!1,allowZeroExpanded:!1});var R3=function(e){O3(n,e);var t=N3(n);function n(){var e;C3(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),E3(M3(e),`renderChildren`,function(t){return t?e.props.children(t):null}),e}return T3(n,[{key:`render`,value:function(){return(0,m.createElement)(I3.Consumer,null,this.renderChildren)}}]),n}(m.PureComponent),IUe=[`className`,`allowMultipleExpanded`,`allowZeroExpanded`,`onChange`,`preExpanded`],LUe=function(e){var t=e.className,n=t===void 0?`accordion`:t,r=e.allowMultipleExpanded,i=e.allowZeroExpanded,a=e.onChange,o=e.preExpanded,s=j3(e,IUe);return(0,m.createElement)(L3,{preExpanded:o,allowMultipleExpanded:r,allowZeroExpanded:i,onChange:a},(0,m.createElement)(`div`,D3({"data-accordion-component":`Accordion`,className:n},s)))},z3;(function(e){e.Accordion=`Accordion`,e.AccordionItem=`AccordionItem`,e.AccordionItemButton=`AccordionItemButton`,e.AccordionItemHeading=`AccordionItemHeading`,e.AccordionItemPanel=`AccordionItemPanel`})(z3||={});var B3=z3,V3=0;function RUe(){var e=V3;return V3+=1,`raa-${e}`}var zUe=m.useId||RUe,BUe=/[\u0009\u000a\u000c\u000d\u0020]/g;function H3(e){return e===``||BUe.test(e)?(console.error(`uuid must be a valid HTML5 id but was given "${e}", ASCII whitespaces are forbidden`),!1):!0}var U3=(0,m.createContext)(null),VUe=function(e){var t=e.children,n=e.uuid,r=e.accordionContext,i=e.dangerouslySetExpanded,a=function(){r.toggleExpanded(n)};return(0,m.createElement)(R3,null,function(e){var r=i??e.isItemExpanded(n),o=e.isItemDisabled(n),s=e.getPanelAttributes(n,i),c=e.getHeadingAttributes(n),l=e.getButtonAttributes(n,i);return(0,m.createElement)(U3.Provider,{value:{uuid:n,expanded:r,disabled:o,toggleExpanded:a,panelAttributes:s,headingAttributes:c,buttonAttributes:l}},t)})},HUe=function(e){return(0,m.createElement)(R3,null,function(t){return(0,m.createElement)(VUe,D3({},e,{accordionContext:t}))})},W3=function(e
Line truncated
|
||||
|
||||
From the WAI-ARIA spec (https://www.w3.org/TR/wai-aria-practices-1.1/#accordion):
|
||||
|
||||
“The button element is the only element inside the heading element. That is, if there are other visually persistent elements, they are not included inside the heading element.”
|
||||
|
||||
`,Y3=function(e){O3(n,e);var t=N3(n);function n(){var e;C3(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),E3(M3(e),`ref`,void 0),E3(M3(e),`setRef`,function(t){e.ref=t}),e}return T3(n,[{key:`componentDidUpdate`,value:function(){n.VALIDATE(this.ref)}},{key:`componentDidMount`,value:function(){n.VALIDATE(this.ref)}},{key:`render`,value:function(){return(0,m.createElement)(`div`,D3({"data-accordion-component":`AccordionItemHeading`},this.props,{ref:this.setRef}))}}],[{key:`VALIDATE`,value:function(e){if(e===void 0)throw Error(`ref is undefined`);if(!(e.childElementCount===1&&e.firstElementChild&&e.firstElementChild.getAttribute(`data-accordion-component`)===`AccordionItemButton`))throw Error(QUe)}}]),n}(m.PureComponent);E3(Y3,`defaultProps`,ZUe);var X3=function(e){return(0,m.createElement)(W3,null,function(t){var n=t.headingAttributes;return e.id&&H3(e.id),(0,m.createElement)(Y3,D3({},e,n))})};X3.displayName=B3.AccordionItemHeading;var $Ue=[`className`,`region`,`id`],eWe=function(e){var t=e.className,n=t===void 0?`accordion__panel`:t,r=e.region,i=e.id,a=j3(e,$Ue);return(0,m.createElement)(W3,null,function(e){var t=e.panelAttributes;i&&H3(i);var o=S3(S3({},t),{},{"aria-labelledby":r?t[`aria-labelledby`]:void 0});return(0,m.createElement)(`div`,D3({"data-accordion-component":`AccordionItemPanel`,className:n},a,o,{role:r?`region`:void 0}))})};function Z3(){var e=`/home/runner/work/maputnik/maputnik/src/components/FieldJson.tsx`,t=`9520c084d5753d03b2f885ad8d41cc433bbd21b7`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/components/FieldJson.tsx`,statementMap:{0:{start:{line:3,column:25},end:{line:5,column:1}},1:{start:{line:4,column:1},end:{line:4,column:54}}},fnMap:{0:{name:`(anonymous_0)`,decl:{start:{line:3,column:25},end:{line:3,column:26}},loc:{start:{line:3,column:36},end:{line:5,column:1}},line:3}},branchMap:{},s:{0:0,1:0},f:{0:0},b:{},inputSourceMap:{version:3,names:[],sources:[`/home/runner/work/maputnik/maputnik/src/components/FieldJson.tsx`],mappings:`AAAA,SAAS,iBAAsC;;AAM/C,OAAO,MAAM,aAAuC,UAAU;CAC5D,OAAO,qBAAC,WAAD,EAAW,GAAI,MAAQ;AAChC`},_coverageSchema:`1a1c01bbd47fc00a2c39e90264f33305004495a9`,hash:`9520c084d5753d03b2f885ad8d41cc433bbd21b7`},a=n[r]||(n[r]={});(!a[e]||a[e].hash!==t)&&(a[e]=i);var o=a[e];return Z3=function(){return o},o}Z3(),Z3().s[0]++;var Q3=e=>(Z3().f[0]++,Z3().s[1]++,(0,B.jsx)(SX,{...e}));function $3(e){return D({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M3 19a2 2 0 0 0 2 2c2 0 2 -4 3 -9s1 -9 3 -9a2 2 0 0 1 2 2`},child:[]},{tag:`path`,attr:{d:`M5 12h6`},child:[]},{tag:`path`,attr:{d:`M15 12l6 6`},child:[]},{tag:`path`,attr:{d:`M15 18l6 -6`},child:[]}]})(e)}function e6(e){return D({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76H216a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm104,40H40a12,12,0,0,0,0,24H144a12,12,0,0,0,0-24Zm88,0H220V168a12,12,0,0,0-24,0v12H184a12,12,0,0,0,0,24h12v12a12,12,0,0,0,24,0V204h12a12,12,0,0,0,0-24Z`},child:[]}]})(e)}function t6(){var e=`/home/runner/work/maputnik/maputnik/src/libs/filterops.ts`,t=`c4e03b67a8467b62eedab8255a87090dbcdba4b4`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/libs/filterops.ts`,statementMap:{0:{start:{line:2,column:34},end:{line:6,column:1}},1:{start:{line:7,column:28},end:{line:7,column:41}},2:{start:{line:8,column:30},end:{line:8,column:123}},3:{start:{line:8,column:88},end:{line:8,column:122}}},fnMap:{0:{name:`(anonymous_0)`,decl:{start:{line:8,column:80},end:{line:8,column:81}},loc:{start:{line:8,column:88},end:{line:8,column:122}},line:8}},branchMap:{},s:{0:0,1:0,2:0,3:0},f:{0:0},b:{},inputSourceMap:{version:3,names:[],sources:[`/home/runner/work/maputnik/maputnik/src/libs/filterops.ts`],mappings:`AAAA,OAAO,YAAY;AAEnB,OAAO,MAAM,qBAAqB;CAAC;CAAO;CAAO;AAAM;AACvD,OAAO,MAAM,eAAe,CAAC,MAAM,KAAK;AACxC,OAAO,MAAM,iBAAiB,OAC3B,KAAK,OAAO,gBAAgB,MAAM,CAAC,CACnC,QAAO,OAAM,mBAAmB,QAAQ,EAAE,IAAI,CAAC`},_coverageSchema:`1a1c01bbd47fc00a2c39e90264f33305004495a9`,hash:`c4e03b67a8467b62eedab8255a87090dbcdba4b4`},a=n[r]||(n[r]={});(!a[e]||a[e].hash!==t)&&(a[e]=i);var o=a[e];return t6=function(){return o},o}t6();var n6=(t6().s[0]++,[`all`,`any`,`none`]);t6().s[1]++;var tWe=(t6().s[2]++,Object.keys(Yu.filter_operator.values).filter(e=>(t6().f[0]++,t6().s[3]++,n6.indexOf(e)<0)));function r6(){var e=`/home/runner/work/maputnik/maputnik/src/components/SingleFilterEditor.tsx`,t=`23f646748e4094cbb94c13fb75ac4c9dc0c41bd5`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/components/SingleFilterEditor.tsx`,statementMap:{0:{start:{line:8,column:1},end:{line:8,column:24}},1:{start:{line:8,column:15},end:{line:8,column:24}},2:{start:{line:9,column:1},end:{line:9,column:24}},3:{start:{line:9,column:15},end:{line:9,column:2
Line truncated
|
||||
rgba(`+t.r+`,`+t.g+`,`+t.b+`, 1) 100%)`,boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:`relative`,height:`100%`,margin:`0 3px`},pointer:{position:`absolute`,left:t.a*100+`%`},slider:{width:`4px`,borderRadius:`1px`,height:`8px`,boxShadow:`0 0 2px rgba(0, 0, 0, .6)`,background:`#fff`,marginTop:`1px`,transform:`translateX(-2px)`}},vertical:{gradient:{background:`linear-gradient(to bottom, rgba(`+t.r+`,`+t.g+`,`+t.b+`, 0) 0%,
|
||||
rgba(`+t.r+`,`+t.g+`,`+t.b+`, 1) 100%)`},pointer:{left:0,top:t.a*100+`%`}},overwrite:gKe({},this.props.style)},{vertical:this.props.direction===`vertical`,overwrite:!0});return m.createElement(`div`,{style:n.alpha},m.createElement(`div`,{style:n.checkboard},m.createElement(y8,{renderers:this.props.renderers})),m.createElement(`div`,{style:n.gradient}),m.createElement(`div`,{style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},m.createElement(`div`,{style:n.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement(`div`,{style:n.slider}))))}}]),t}(m.PureComponent||m.Component),bKe=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function xKe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SKe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function CKe(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function wKe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var TKe=1,S8=38,EKe=[S8,40],DKe=function(e){return EKe.indexOf(e)>-1},OKe=function(e){return Number(String(e).replace(/%/g,``))},kKe=1,C8=function(e){wKe(t,e);function t(e){SKe(this,t);var n=CKe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(e){n.setUpdatedValue(e.target.value,e)},n.handleKeyDown=function(e){var t=OKe(e.target.value);if(!isNaN(t)&&DKe(e.keyCode)){var r=n.getArrowOffset(),i=e.keyCode===S8?t+r:t-r;n.setUpdatedValue(i,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener(`mousemove`,n.handleDrag),window.addEventListener(`mouseup`,n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener(`mousemove`,n.handleDrag),window.removeEventListener(`mouseup`,n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId=`rc-editable-input-`+kKe++,n}return bKe(t,[{key:`componentDidUpdate`,value:function(e,t){this.props.value!==this.state.value&&(e.value!==this.props.value||t.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:`componentWillUnmount`,value:function(){this.unbindEventListeners()}},{key:`getValueObjectWithLabel`,value:function(e){return xKe({},this.props.label,e)}},{key:`getArrowOffset`,value:function(){return this.props.arrowOffset||TKe}},{key:`setUpdatedValue`,value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:`render`,value:function(){var e=this,t=(0,g8.default)({default:{wrap:{position:`relative`}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:`ew-resize`}}},{"user-override":!0},this.props);return m.createElement(`div`,{style:t.wrap},m.createElement(`input`,{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:`false`}),this.props.label&&!this.props.hideLabel?m.createElement(`label`,{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(m.PureComponent||m.Component),AKe=function(e,t,n,r){var i=r.clientWidth,a=r.clientHeight,o=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,s=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,c=o-(r.getBoundingClientRect().left+window.pageXOffset),l=s-(r.getBoundingClientRect().top+window.pageYOffset);if(t===`vertical`){var u=void 0;if(u=l<0?359:l>a?0:360*(-(l*100/a)+100)/100,n.h!==u)r
Line truncated
|
||||
.hue-horizontal {
|
||||
background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
|
||||
33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
||||
background: -webkit-linear-gradient(to right, #f00 0%, #ff0
|
||||
17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
||||
}
|
||||
|
||||
.hue-vertical {
|
||||
background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,
|
||||
#0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
||||
background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,
|
||||
#0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
||||
}
|
||||
`),m.createElement(`div`,{style:r.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement(`div`,{style:r.slider}))))}}]),t}(m.PureComponent||m.Component);function PKe(){this.__data__=[],this.size=0}function E8(e,t){return e===t||e!==e&&t!==t}function D8(e,t){for(var n=e.length;n--;)if(E8(e[n][0],t))return n;return-1}var FKe=Array.prototype.splice;function IKe(e){var t=this.__data__,n=D8(t,e);return n<0?!1:(n==t.length-1?t.pop():FKe.call(t,n,1),--this.size,!0)}function LKe(e){var t=this.__data__,n=D8(t,e);return n<0?void 0:t[n][1]}function RKe(e){return D8(this.__data__,e)>-1}function zKe(e,t){var n=this.__data__,r=D8(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function O8(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])}}O8.prototype.clear=PKe,O8.prototype.delete=IKe,O8.prototype.get=LKe,O8.prototype.has=RKe,O8.prototype.set=zKe;function BKe(){this.__data__=new O8,this.size=0}function VKe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function HKe(e){return this.__data__.get(e)}function UKe(e){return this.__data__.has(e)}var WKe=typeof globalThis==`object`&&globalThis&&globalThis.Object===Object&&globalThis,GKe=typeof self==`object`&&self&&self.Object===Object&&self,k8=WKe||GKe||Function(`return this`)(),A8=k8.Symbol,KKe=Object.prototype,qKe=KKe.hasOwnProperty,JKe=KKe.toString,j8=A8?A8.toStringTag:void 0;function YKe(e){var t=qKe.call(e,j8),n=e[j8];try{e[j8]=void 0;var r=!0}catch{}var i=JKe.call(e);return r&&(t?e[j8]=n:delete e[j8]),i}var XKe=Object.prototype.toString;function ZKe(e){return XKe.call(e)}var QKe=`[object Null]`,$Ke=`[object Undefined]`,eqe=A8?A8.toStringTag:void 0;function M8(e){return e==null?e===void 0?$Ke:QKe:eqe&&eqe in Object(e)?YKe(e):ZKe(e)}function N8(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var tqe=`[object AsyncFunction]`,nqe=`[object Function]`,rqe=`[object GeneratorFunction]`,iqe=`[object Proxy]`;function P8(e){if(!N8(e))return!1;var t=M8(e);return t==nqe||t==rqe||t==tqe||t==iqe}var F8=k8[`__core-js_shared__`],aqe=function(){var e=/[^.]+$/.exec(F8&&F8.keys&&F8.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function oqe(e){return!!aqe&&aqe in e}var sqe=Function.prototype.toString;function I8(e){if(e!=null){try{return sqe.call(e)}catch{}try{return e+``}catch{}}return``}var cqe=/[\\^$.*+?()[\]{}|]/g,lqe=/^\[object .+?Constructor\]$/,uqe=Function.prototype,dqe=Object.prototype,fqe=uqe.toString,pqe=dqe.hasOwnProperty,mqe=RegExp(`^`+fqe.call(pqe).replace(cqe,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function hqe(e){return!N8(e)||oqe(e)?!1:(P8(e)?mqe:lqe).test(I8(e))}function gqe(e,t){return e?.[t]}function L8(e,t){var n=gqe(e,t);return hqe(n)?n:void 0}var R8=L8(k8,`Map`),z8=L8(Object,`create`);function _qe(){this.__data__=z8?z8(null):{},this.size=0}function vqe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var yqe=`__lodash_hash_undefined__`,bqe=Object.prototype.hasOwnProperty;function xqe(e){var t=this.__data__;if(z8){var n=t[e];return n===yqe?void 0:n}return bqe.call(t,e)?t[e]:void 0}var Sqe=Object.prototype.hasOwnProperty;function Cqe(e){var t=this.__data__;return z8?t[e]!==void 0:Sqe.call(t,e)}var wqe=`__lodash_hash_undefined__`;function Tqe(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=z8&&t===void 0?wqe:t,this}function B8(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])}}B8.prototype.clear=_qe,B8.prototype.delete=vqe,B8.prototype.get=xqe,B8.prototype.has=Cqe,B8.prototype.set=Tqe;function Eqe(){this.size=0,this.__data__={hash:new B8,map:new(R8||O8),string:new B8}}function Dqe(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function V8(e,t){var n=e.__data__;return Dqe(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Oqe(e){var t=V8(this,e).delete(e);return this.size-=+!!t,t}function kqe(e){return V8(this,e).get(e)}function Aqe(e){return V8(this,e).has(e)}function jqe(e,t){var n=V8(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function H8(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])}}H8.prototype.clear=Eqe,H8.prototype.delete=Oqe,H8.prototype.get=kqe,H8.prototype.has=Aqe,H8.prototype.set=jqe;var Mqe=200;function Nqe(e,t){var n=this.__data__;if(n instanceof O8){var r=n.__data__;if(!R8||r.length<Mqe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new H8(r)}return n.set(e,t),this.size=n.size,this}function U8(e){var t=this.__data__=new O8(e);this.size=t.size}U8.prototype.clear=BKe,U8.prototype.delete=VKe,U8.prototype.get=HKe,U8.prototype.has=UKe,U8.prototype.set=Nqe;var W8=function(){try{var e=L8(Object,`defineProperty`);return e({},``,{}),e}catch{}}();function G8(e,t,n){t==`__proto__`&&W8?W8(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function K8(e,t,n){(n!==void 0
Line truncated
|
||||
0 0 1px 2px rgba(0,0,0,.4)`,borderRadius:`50%`,cursor:`hand`,transform:`translate(-2px, -2px)`}},custom:{color:n,white:r,black:i,pointer:a,circle:o}},{custom:!!this.props.style});return m.createElement(`div`,{style:s.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},m.createElement(`style`,null,`
|
||||
.saturation-white {
|
||||
background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
|
||||
background: linear-gradient(to right, #fff, rgba(255,255,255,0));
|
||||
}
|
||||
.saturation-black {
|
||||
background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
|
||||
background: linear-gradient(to top, #000, rgba(0,0,0,0));
|
||||
}
|
||||
`),m.createElement(`div`,{style:s.white,className:`saturation-white`},m.createElement(`div`,{style:s.black,className:`saturation-black`}),m.createElement(`div`,{style:s.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement(`div`,{style:s.circle}))))}}]),t}(m.PureComponent||m.Component);function zYe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var BYe=Kqe(Object.keys,Object),VYe=Object.prototype.hasOwnProperty;function HYe(e){if(!J8(e))return BYe(e);var t=[];for(var n in Object(e))VYe.call(e,n)&&n!=`constructor`&&t.push(n);return t}function p5(e){return $8(e)?XJe(e):HYe(e)}function UYe(e,t){return e&&Fqe(e,t,p5)}function WYe(e,t){return function(n,r){if(n==null)return n;if(!$8(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var GYe=WYe(UYe);function KYe(e){return typeof e==`function`?e:s5}function qYe(e,t){return(Z8(e)?zYe:GYe)(e,KYe(t))}function m5(e){"@babel/helpers - typeof";return m5=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},m5(e)}var JYe=/^\s+/,YYe=/\s+$/;function h5(e,t){if(e||=``,t||={},e instanceof h5)return e;if(!(this instanceof h5))return new h5(e,t);var n=XYe(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}h5.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=t<=.03928?t/12.92:((t+.055)/1.055)**2.4,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4;return .2126*i+.7152*a+.0722*o},setAlpha:function(e){return this._a=yXe(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=eXe(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=eXe(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this._a==1?`hsv(`+t+`, `+n+`%, `+r+`%)`:`hsva(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHsl:function(){var e=QYe(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=QYe(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this._a==1?`hsl(`+t+`, `+n+`%, `+r+`%)`:`hsla(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHex:function(e){return nXe(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return rXe(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`)`:`rgba(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:Math.round(_5(this._r,255)*100)+`%`,g:Math.round(_5(this._g,255)*100)+`%`,b:Math.round(_5(this._b,255)*100)+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+Math.round(_5(this._r,255)*100)+`%, `+Math.round(_5(this._g,255)*100)+`%, `+Math.round(_5(this._b,255)*100)+`%)`:`rgba(`+Math.round(_5(this._r,255)*100)+`%, `+Math.round(_5(this._g,255)*100)+`%, `+Math.round(_5(this._b,255)*100)+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:this._a<1?!1:_Xe[nXe(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t=`#`+iXe(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?`GradientType = 1, `:``;if(e){var i=h5(e);n=`#`+iXe(i._r,i._g,i._b,i._a)}return`progid:DXImageTransform.Microsoft.gradient(`+r+`startColorstr=`+t+`,endColorstr=`+n+`)`},toString:function(e){var t=!!e;e||=this._format;var n=!1,r=this._a<1&&this._a>=0;return!t&&r&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return h5(this.t
Line truncated
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>${t}</title>
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
|
||||
<link href="https://unpkg.com/maplibre-gl@${Z1e}/dist/maplibre-gl.css" rel="stylesheet" />
|
||||
<style>
|
||||
body { margin: 0; padding: 0; }
|
||||
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script type="module">
|
||||
import {Map} from 'https://unpkg.com/maplibre-gl@${Z1e}/dist/maplibre-gl.mjs';
|
||||
const map = new Map({
|
||||
container: 'map',
|
||||
style: ${e},
|
||||
});
|
||||
map.addControl(new maplibregl.NavigationControl());
|
||||
<\/script>
|
||||
</body>
|
||||
</html>
|
||||
`),r=(j9().s[9]++,new Blob([n],{type:`text/html;charset=utf-8`})),i=(j9().s[10]++,this.exportName());j9().s[11]++,(0,Y1e.saveAs)(r,i+`.html`)}async saveStyle(){j9().f[3]++;let e=(j9().s[12]++,this.tokenizedStyle());if(j9().s[13]++,Q1e)j9().b[2][1]++;else{j9().b[2][0]++;let t=(j9().s[14]++,new Blob([e],{type:`application/json;charset=utf-8`})),n=(j9().s[15]++,this.exportName());j9().s[16]++,(0,Y1e.saveAs)(t,n+`.json`),j9().s[17]++;return}let t=(j9().s[18]++,this.props.fileHandle);if(j9().s[19]++,t==null){if(j9().b[3][0]++,j9().s[20]++,t=await this.createFileHandle(),j9().s[21]++,this.props.onSetFileHandle(t),j9().s[22]++,t==null){j9().b[4][0]++,j9().s[23]++;return}j9().b[4][1]++}else j9().b[3][1]++;let n=(j9().s[24]++,await t.createWritable());j9().s[25]++,await n.write(e),j9().s[26]++,await n.close(),j9().s[27]++,this.props.onOpenToggle()}async saveStyleAs(){j9().f[4]++;let e=(j9().s[28]++,this.tokenizedStyle()),t=(j9().s[29]++,await this.createFileHandle());if(j9().s[30]++,this.props.onSetFileHandle(t),j9().s[31]++,t==null){j9().b[5][0]++,j9().s[32]++;return}j9().b[5][1]++;let n=(j9().s[33]++,await t.createWritable());j9().s[34]++,await n.write(e),j9().s[35]++,await n.close(),j9().s[36]++,this.props.onOpenToggle()}async createFileHandle(){j9().f[5]++;let e=(j9().s[37]++,{types:[{description:`json`,accept:{"application/json":[`.json`]}}],suggestedName:this.exportName()}),t=(j9().s[38]++,await window.showSaveFilePicker(e));return j9().s[39]++,this.props.onSetFileHandle(t),j9().s[40]++,t}changeMetadataProperty(e,t){j9().f[6]++;let n=(j9().s[41]++,{...this.props.mapStyle,metadata:{...this.props.mapStyle.metadata,[e]:t}});j9().s[42]++,this.props.onStyleChanged(n)}render(){j9().f[7]++;let e=(j9().s[43]++,this.props.t),t=(j9().s[44]++,U1e(e));return j9().s[45]++,(0,B.jsx)(e$,{"data-wd-key":`modal:export`,isOpen:this.props.isOpen,onOpenToggle:this.props.onOpenToggle,title:e(`Save Style`),className:`maputnik-export-modal`,children:(0,B.jsxs)(`section`,{className:`maputnik-modal-section`,children:[(0,B.jsx)(`h1`,{children:e(`Save Style`)}),(0,B.jsx)(`p`,{children:e(`Save the JSON style to your computer.`)}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(S9,{label:t.maputnik.maptiler_access_token.label,fieldSpec:t.maputnik.maptiler_access_token,value:(j9().b[6][0]++,this.props.mapStyle.metadata||(j9().b[6][1]++,{}))[`maputnik:openmaptiles_access_token`],onChange:this.changeMetadataProperty.bind(this,`maputnik:openmaptiles_access_token`)}),(0,B.jsx)(S9,{label:t.maputnik.thunderforest_access_token.label,fieldSpec:t.maputnik.thunderforest_access_token,value:(j9().b[7][0]++,this.props.mapStyle.metadata||(j9().b[7][1]++,{}))[`maputnik:thunderforest_access_token`],onChange:this.changeMetadataProperty.bind(this,`maputnik:thunderforest_access_token`)}),(0,B.jsx)(S9,{label:t.maputnik.stadia_access_token.label,fieldSpec:t.maputnik.stadia_access_token,value:(j9().b[8][0]++,this.props.mapStyle.metadata||(j9().b[8][1]++,{}))[`maputnik:stadia_access_token`],onChange:this.changeMetadataProperty.bind(this,`maputnik:stadia_access_token`)}),(0,B.jsx)(S9,{label:t.maputnik.locationiq_access_token.label,fieldSpec:t.maputnik.locationiq_access_token,value:(j9().b[9][0]++,this.props.mapStyle.metadata||(j9().b[9][1]++,{}))[`maputnik:locationiq_access_token`],onChange:this.changeMetadataProperty.bind(this,`maputnik:locationiq_access_token`)})]}),(0,B.jsxs)(`div`,{className:`maputnik-modal-export-buttons`,children:[(0,B.jsxs)(rQ,{onClick:this.saveStyle.bind(this),children:[(0,B.jsx)(vk,{}),e(`Save`)]}),(j9().b[10][0]++,Q1e&&(j9().b[10][1]++,(0,B.jsxs)(rQ,{onClick:this.saveStyleAs.bind(this),children:[(0,B.jsx)(vk,{}),e(`Save as`)]}))),(0,B.jsxs)(rQ,{onClick:this.createHtml.bind(this),children:[(0,B.jsx)(H_e,{}),e(`Create HTML`)]})]})]})})}},e0e=(j9().s[46]++,An()($1e));function M9(){var e=`/home/runner/work/maputnik/maputnik/src/components/FieldDynamicArray.tsx`,t=`615893f63b00bf2bdf08d7f34d665947b5e31694`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/components/FieldDynamicArray.tsx`,statementMap:{0:{start:{line:4,column:33},end:{line:9,column:1}},1:{start:{line:5,column:1},end:{line:8,column:4}}},fnMap:{0:{name:`(anonymous_0)`,decl:{start:{line:4,column:33},end:{line:4,column:34}},loc:{start:{line:4,column:44},end:{line:9,column:1}},line:4}},branchMap:{},s:{0:0,1:0},f:{0:0},b:{},inputSourceMap:{version:3,names:[],sources:[`/home/runner/work/maputnik/maputnik/src/components/FieldDynamicArray.tsx`],mappings:`AAAA,SAAS,yBAAsD;AAC/D,SAAS,gBAAgB;;AASzB,OAAO,MAAM,qBAAuD,UAAU;CAC5E,OACE,qBAAC,UAAD;EAAU,OAAO,MAAM;YACrB,qBAAC,mBAAD,EAAmB,GAAI,MAAQ;CACvB;AAEd`},_coverageSchema:`1a1c01bbd47fc00a2c39e90264f33305004495a9`,hash:`615893f63b00bf2bdf08d7f34d665947b5e31694`},a=n[r]||(n[r]={});(!a[e]||a[e].hash!==t)&&(a[e]=i);var o=a[e];return M9=function(){return o},o}M9(),M9().s[0]++;var t0e=e=>(M9().f[0]++,M9().s[1]++,(0,B.jsx)(J7,{label:e.label,children:(0,B.jsx)(U7,{...e})}));function N9(){var e=`/home/runner/work/maputnik/maputniLine truncated
|
||||
//# sourceMappingURL=index-BIXdegYu.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"mappings":"qgDAWA,IAAI,EAAqB,OAAO,IAAI,4BAA4B,EAC9D,EAAoB,OAAO,IAAI,cAAc,EAC7C,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAyB,OAAO,IAAI,mBAAmB,EACvD,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAqB,OAAO,IAAI,eAAe,EAC/C,EAAyB,OAAO,IAAI,mBAAmB,EACvD,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAkB,OAAO,IAAI,YAAY,EACzC,EAAkB,OAAO,IAAI,YAAY,EACzC,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAwB,OAAO,SACjC,SAAS,EAAc,EAAe,CAKpC,OAJ2C,OAAO,GAApB,WAAjB,EAA2D,MACxE,EACG,GAAyB,EAAc,IACxC,EAAc,cACM,OAAO,GAAtB,WAAsC,EAAgB,KAC/D,CACA,IAAI,EAAuB,CACvB,UAAW,UAAY,CACrB,MAAO,CAAC,CACV,EACA,mBAAoB,UAAY,CAAC,EACjC,oBAAqB,UAAY,CAAC,EAClC,gBAAiB,UAAY,CAAC,CAChC,EACA,EAAS,OAAO,OAChB,EAAc,CAAC,EACjB,SAAS,EAAU,EAAO,EAAS,EAAS,CAC1C,KAAK,MAAQ,EACb,KAAK,QAAU,EACf,KAAK,KAAO,EACZ,KAAK,QAAU,GAAW,CAC5B,CACA,EAAU,UAAU,iBAAmB,CAAC,EACxC,EAAU,UAAU,SAAW,SAAU,EAAc,EAAU,CAC/D,GACe,OAAO,GAApB,UACe,OAAO,GAAtB,YACQ,GAAR,KAEA,MAAM,MACJ,wGACF,EACF,KAAK,QAAQ,gBAAgB,KAAM,EAAc,EAAU,UAAU,CACvE,EACA,EAAU,UAAU,YAAc,SAAU,EAAU,CACpD,KAAK,QAAQ,mBAAmB,KAAM,EAAU,aAAa,CAC/D,EACA,SAAS,GAAiB,CAAC,CAC3B,EAAe,UAAY,EAAU,UACrC,SAAS,EAAc,EAAO,EAAS,EAAS,CAC9C,KAAK,MAAQ,EACb,KAAK,QAAU,EACf,KAAK,KAAO,EACZ,KAAK,QAAU,GAAW,CAC5B,CACA,IAAI,EAA0B,EAAc,UAAY,IAAI,EAC5D,EAAuB,YAAc,EACrC,EAAO,EAAwB,EAAU,SAAS,EAClD,EAAuB,qBAAuB,CAAC,EAC/C,IAAI,EAAc,MAAM,QACxB,SAAS,GAAO,CAAC,CACjB,IAAI,EAAuB,CAAE,EAAG,KAAM,EAAG,KAAM,EAAG,KAAM,EAAG,IAAK,EAC9D,EAAiB,OAAO,UAAU,eACpC,SAAS,EAAa,EAAM,EAAK,EAAO,CACtC,IAAI,EAAU,EAAM,IACpB,MAAO,CACL,SAAU,EACJ,OACD,MACL,IAAgB,IAAX,IAAK,GAA0B,KAAV,EACnB,OACT,CACF,CACA,SAAS,EAAmB,EAAY,EAAQ,CAC9C,OAAO,EAAa,EAAW,KAAM,EAAQ,EAAW,KAAK,CAC/D,CACA,SAAS,EAAe,EAAQ,CAC9B,OACe,OAAO,GAApB,YACS,GACT,EAAO,WAAa,CAExB,CACA,SAAS,EAAO,EAAK,CACnB,IAAI,EAAgB,CAAE,IAAK,KAAM,IAAK,IAAK,EAC3C,MACE,IACA,EAAI,QAAQ,QAAS,SAAU,EAAO,CACpC,OAAO,EAAc,EACvB,CAAC,CAEL,CACA,IAAI,EAA6B,OACjC,SAAS,GAAc,EAAS,EAAO,CACrC,OAAoB,OAAO,GAApB,UAAwC,GAAmB,EAAQ,KAAhB,KACtD,EAAO,GAAK,EAAQ,GAAG,EACvB,EAAM,SAAS,EAAE,CACvB,CACA,SAAS,EAAgB,EAAU,CACjC,OAAQ,EAAS,OAAjB,CACE,IAAK,YACH,OAAO,EAAS,MAClB,IAAK,WACH,MAAM,EAAS,OACjB,QACE,OACgB,OAAO,EAAS,QAA7B,SACG,EAAS,KAAK,EAAM,CAAI,GACtB,EAAS,OAAS,UACpB,EAAS,KACP,SAAU,EAAgB,CACV,EAAS,SAAvB,YACI,EAAS,OAAS,YACnB,EAAS,MAAQ,EACtB,EACA,SAAU,EAAO,CACD,EAAS,SAAvB,YACI,EAAS,OAAS,WAAc,EAAS,OAAS,EACxD,CACF,GACJ,EAAS,OAfX,CAiBE,IAAK,YACH,OAAO,EAAS,MAClB,IAAK,WACH,MAAM,EAAS,MACnB,CACJ,CACA,MAAM,CACR,CACA,SAAS,GAAa,EAAU,EAAO,EAAe,EAAW,EAAU,CACzE,IAAI,EAAO,OAAO,GACE,IAAhB,aAAsC,IAAd,aAAoB,EAAW,MAC3D,IAAI,EAAiB,CAAC,EACtB,GAAa,IAAT,KAAmB,EAAiB,CAAC,OAEvC,OAAQ,EAAR,CACE,IAAK,SACL,IAAK,SACL,IAAK,SACH,EAAiB,CAAC,EAClB,MACF,IAAK,SACH,OAAQ,EAAS,SAAjB,CACE,KAAK,EACL,KAAK,EACH,EAAiB,CAAC,EAClB,MACF,KAAK,EACH,MACG,GAAiB,EAAS,MAC3B,GACE,EAAe,EAAS,QAAQ,EAChC,EACA,EACA,EACA,CACF,CAEN,CACJ,CACF,GAAI,EACF,MACG,GAAW,EAAS,CAAQ,EAC5B,EACQ,IAAP,GAAmB,IAAM,GAAc,EAAU,CAAC,EAAI,EACxD,EAAY,CAAQ,GACd,EAAgB,GACV,GAAR,OACG,EACC,EAAe,QAAQ,EAA4B,KAAK,EAAI,KAChE,GAAa,EAAU,EAAO,EAAe,GAAI,SAAU,EAAG,CAC5D,OAAO,CACT,CAAC,GACO,GAAR,OACC,EAAe,CAAQ,IACrB,EAAW,EACV,EACA,GACW,EAAS,KAAjB,MACA,GAAY,EAAS,MAAQ,EAAS,IACnC,IACC,GAAK,EAAS,KAAK,QAClB,EACA,KACF,EAAI,KACR,CACJ,GACF,EAAM,KAAK,CAAQ,GACvB,EAEJ,EAAiB,EACjB,IAAI,EAAwB,IAAP,GAAmB,IAAM,EAAY,IAC1D,GAAI,EAAY,CAAQ,EACtB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAS,OAAQ,IACnC,EAAa,EAAS,GACnB,EAAO,EAAiB,GAAc,EAAW,CAAC,EAClD,GAAkB,GACjB,EACA,EACA,EACA,EACA,CACF,OACD,GAAM,EAAI,EAAc,CAAQ,EAAmB,OAAO,GAAtB,WACvC,IACE,EAAW,EAAE,KAAK,CAAQ,EAAG,EAAI,EACjC,EAAE,EAAY,EAAS,KAAK,GAAG,MAG/B,EAAa,EAAU,MACpB,EAAO,EAAiB,GAAc,EAAW,GAAG,EACpD,GAAkB,GACjB,EACA,EACA,EACA,EACA,CACF,OACD,GAAiB,IAAb,SAAmB,CAC1B,GAAmB,OAAO,EAAS,MAA/B,WACF,OAAO,GACL,EAAgB,CAAQ,EACxB,EACA,EACA,EACA,CACF,EAEF,KADA,GAAQ,OAAO,CAAQ,EACjB,MACJ,mDACyB,IAAtB,kBACG,qBAAuB,OAAO,KAAK,CAAQ,CAAC,CAAC,KAAK,IAAI,EAAI,IAC1D,GACJ,2EACJ,CACF,CACA,OAAO,CACT,CACA,SAAS,GAAY,EAAU,EAAM,EAAS,CAC5C,GAAY,GAAR,KAAkB,OAAO,EAC7B,IAAI,EAAS,CAAC,EACZ,EAAQ,EAIV,OAHA,GAAa,EAAU,EAAQ,GAAI,GAAI,SAAU,EAAO,CACtD,OAAO,EAAK,KAAK,EAAS,EAAO,GAAO,CAC1C,CAAC,EACM,CACT,CACA,SAAS,GAAgB,EAAS,CAChC,GAAW,EAAQ,UAAf,GAAwB,CAC1B,IAAI,EAAO,EAAQ,QACnB,EAAO,EAAK,EACZ,EAAK,KACH,SAAU,EAAc,EACZ,EAAQ,UAAd,GAAgC,EAAQ,UAAf,MAC3B,EAAS,QAAU,EAAK,EAAQ,QAAU,EAC9C,EACA,SAAU,EAAO,EACL,EAAQ,UAAd,GAAgC,EAAQ,UAAf,MAC3B,EAAS,QAAU,EAAK,EAAQ,QAAU,EAC9C,CACF,EACO,EAAQ,UAAf,KAA4B,EAAQ,QAAU,EAAK,EAAQ,QAAU,EACvE,CACA,GAAU,EAAQ,UAAd,EAAuB,OAAO,EAAQ,QAAQ,QAClD,MAAM,EAAQ,OAChB,CACA,IAAI,EACe,OAAO,aAAtB,WACI,YACA,SAAU,EAAO,CACf,GACe,OAAO,QAApB,UACe,OAAO,OAAO,YAA7B,WACA,CACA,IAAI,EAAQ,IAAI,OAAO,WAAW,QAAS,CACzC,QAAS,CAAC,EACV,WAAY,CAAC,EACb,QACe,OAAO,GAApB,UACS,GACI,OAAO,EAAM,SAA1B,SACI,OAAO,EAAM,OAAO,EACpB,OAAO,CAAK,EACX,OACT,CAAC,EACD,GAAI,CAAC,OAAO,cAAc,CAAK,EAAG,MACpC,MAAO,GACQ,OAAO,SAApB,UACe,OAAO,QAAQ,MAA9B,WACA,CACA,QAAQ,KAAK,oBAAqB,CAAK,EACvC,MACF,CACA,QAAQ,MAAM,CAAK,CACrB,EACN,GAAW,CACT,IAAK,GACL,QAAS,SAAU,EAAU,EAAa,EAAgB,CACxD,GACE,EACA,UAAY,CACV,EAAY,MAAM,KAAM,SAAS,CACnC,EACA,CACF,CACF,EACA,MAAO,SAAU,EAAU,CACzB,IAAI,EAAI,EAIR,OAHA,GAAY,EAAU,UAAY,CAChC,GACF,CAAC,EACM,CACT,EACA,QAAS,SAAU,EAAU,CAC3B,OACE,GAAY,EAALine truncated
|
||||
{"version":3,"mappings":"qgDAWA,IAAI,EAAqB,OAAO,IAAI,4BAA4B,EAC9D,EAAoB,OAAO,IAAI,cAAc,EAC7C,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAyB,OAAO,IAAI,mBAAmB,EACvD,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAqB,OAAO,IAAI,eAAe,EAC/C,EAAyB,OAAO,IAAI,mBAAmB,EACvD,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAkB,OAAO,IAAI,YAAY,EACzC,EAAkB,OAAO,IAAI,YAAY,EACzC,EAAsB,OAAO,IAAI,gBAAgB,EACjD,EAAwB,OAAO,SACjC,SAAS,EAAc,EAAe,CAKpC,OAJ2C,OAAO,GAApB,WAAjB,EAA2D,MACxE,EACG,GAAyB,EAAc,IACxC,EAAc,cACM,OAAO,GAAtB,WAAsC,EAAgB,KAC/D,CACA,IAAI,EAAuB,CACvB,UAAW,UAAY,CACrB,MAAO,CAAC,CACV,EACA,mBAAoB,UAAY,CAAC,EACjC,oBAAqB,UAAY,CAAC,EAClC,gBAAiB,UAAY,CAAC,CAChC,EACA,EAAS,OAAO,OAChB,EAAc,CAAC,EACjB,SAAS,EAAU,EAAO,EAAS,EAAS,CAC1C,KAAK,MAAQ,EACb,KAAK,QAAU,EACf,KAAK,KAAO,EACZ,KAAK,QAAU,GAAW,CAC5B,CACA,EAAU,UAAU,iBAAmB,CAAC,EACxC,EAAU,UAAU,SAAW,SAAU,EAAc,EAAU,CAC/D,GACe,OAAO,GAApB,UACe,OAAO,GAAtB,YACQ,GAAR,KAEA,MAAM,MACJ,wGACF,EACF,KAAK,QAAQ,gBAAgB,KAAM,EAAc,EAAU,UAAU,CACvE,EACA,EAAU,UAAU,YAAc,SAAU,EAAU,CACpD,KAAK,QAAQ,mBAAmB,KAAM,EAAU,aAAa,CAC/D,EACA,SAAS,GAAiB,CAAC,CAC3B,EAAe,UAAY,EAAU,UACrC,SAAS,EAAc,EAAO,EAAS,EAAS,CAC9C,KAAK,MAAQ,EACb,KAAK,QAAU,EACf,KAAK,KAAO,EACZ,KAAK,QAAU,GAAW,CAC5B,CACA,IAAI,EAA0B,EAAc,UAAY,IAAI,EAC5D,EAAuB,YAAc,EACrC,EAAO,EAAwB,EAAU,SAAS,EAClD,EAAuB,qBAAuB,CAAC,EAC/C,IAAI,EAAc,MAAM,QACxB,SAAS,GAAO,CAAC,CACjB,IAAI,EAAuB,CAAE,EAAG,KAAM,EAAG,KAAM,EAAG,KAAM,EAAG,IAAK,EAC9D,EAAiB,OAAO,UAAU,eACpC,SAAS,EAAa,EAAM,EAAK,EAAO,CACtC,IAAI,EAAU,EAAM,IACpB,MAAO,CACL,SAAU,EACJ,OACD,MACL,IAAgB,IAAX,IAAK,GAA0B,KAAV,EACnB,OACT,CACF,CACA,SAAS,EAAmB,EAAY,EAAQ,CAC9C,OAAO,EAAa,EAAW,KAAM,EAAQ,EAAW,KAAK,CAC/D,CACA,SAAS,EAAe,EAAQ,CAC9B,OACe,OAAO,GAApB,YACS,GACT,EAAO,WAAa,CAExB,CACA,SAAS,EAAO,EAAK,CACnB,IAAI,EAAgB,CAAE,IAAK,KAAM,IAAK,IAAK,EAC3C,MACE,IACA,EAAI,QAAQ,QAAS,SAAU,EAAO,CACpC,OAAO,EAAc,EACvB,CAAC,CAEL,CACA,IAAI,EAA6B,OACjC,SAAS,GAAc,EAAS,EAAO,CACrC,OAAoB,OAAO,GAApB,UAAwC,GAAmB,EAAQ,KAAhB,KACtD,EAAO,GAAK,EAAQ,GAAG,EACvB,EAAM,SAAS,EAAE,CACvB,CACA,SAAS,EAAgB,EAAU,CACjC,OAAQ,EAAS,OAAjB,CACE,IAAK,YACH,OAAO,EAAS,MAClB,IAAK,WACH,MAAM,EAAS,OACjB,QACE,OACgB,OAAO,EAAS,QAA7B,SACG,EAAS,KAAK,EAAM,CAAI,GACtB,EAAS,OAAS,UACpB,EAAS,KACP,SAAU,EAAgB,CACV,EAAS,SAAvB,YACI,EAAS,OAAS,YACnB,EAAS,MAAQ,EACtB,EACA,SAAU,EAAO,CACD,EAAS,SAAvB,YACI,EAAS,OAAS,WAAc,EAAS,OAAS,EACxD,CACF,GACJ,EAAS,OAfX,CAiBE,IAAK,YACH,OAAO,EAAS,MAClB,IAAK,WACH,MAAM,EAAS,MACnB,CACJ,CACA,MAAM,CACR,CACA,SAAS,GAAa,EAAU,EAAO,EAAe,EAAW,EAAU,CACzE,IAAI,EAAO,OAAO,GACE,IAAhB,aAAsC,IAAd,aAAoB,EAAW,MAC3D,IAAI,EAAiB,CAAC,EACtB,GAAa,IAAT,KAAmB,EAAiB,CAAC,OAEvC,OAAQ,EAAR,CACE,IAAK,SACL,IAAK,SACL,IAAK,SACH,EAAiB,CAAC,EAClB,MACF,IAAK,SACH,OAAQ,EAAS,SAAjB,CACE,KAAK,EACL,KAAK,EACH,EAAiB,CAAC,EAClB,MACF,KAAK,EACH,MACG,GAAiB,EAAS,MAC3B,GACE,EAAe,EAAS,QAAQ,EAChC,EACA,EACA,EACA,CACF,CAEN,CACJ,CACF,GAAI,EACF,MACG,GAAW,EAAS,CAAQ,EAC5B,EACQ,IAAP,GAAmB,IAAM,GAAc,EAAU,CAAC,EAAI,EACxD,EAAY,CAAQ,GACd,EAAgB,GACV,GAAR,OACG,EACC,EAAe,QAAQ,EAA4B,KAAK,EAAI,KAChE,GAAa,EAAU,EAAO,EAAe,GAAI,SAAU,EAAG,CAC5D,OAAO,CACT,CAAC,GACO,GAAR,OACC,EAAe,CAAQ,IACrB,EAAW,EACV,EACA,GACW,EAAS,KAAjB,MACA,GAAY,EAAS,MAAQ,EAAS,IACnC,IACC,GAAK,EAAS,KAAK,QAClB,EACA,KACF,EAAI,KACR,CACJ,GACF,EAAM,KAAK,CAAQ,GACvB,EAEJ,EAAiB,EACjB,IAAI,EAAwB,IAAP,GAAmB,IAAM,EAAY,IAC1D,GAAI,EAAY,CAAQ,EACtB,IAAK,IAAI,EAAI,EAAG,EAAI,EAAS,OAAQ,IACnC,EAAa,EAAS,GACnB,EAAO,EAAiB,GAAc,EAAW,CAAC,EAClD,GAAkB,GACjB,EACA,EACA,EACA,EACA,CACF,OACD,GAAM,EAAI,EAAc,CAAQ,EAAmB,OAAO,GAAtB,WACvC,IACE,EAAW,EAAE,KAAK,CAAQ,EAAG,EAAI,EACjC,EAAE,EAAY,EAAS,KAAK,GAAG,MAG/B,EAAa,EAAU,MACpB,EAAO,EAAiB,GAAc,EAAW,GAAG,EACpD,GAAkB,GACjB,EACA,EACA,EACA,EACA,CACF,OACD,GAAiB,IAAb,SAAmB,CAC1B,GAAmB,OAAO,EAAS,MAA/B,WACF,OAAO,GACL,EAAgB,CAAQ,EACxB,EACA,EACA,EACA,CACF,EAEF,KADA,GAAQ,OAAO,CAAQ,EACjB,MACJ,mDACyB,IAAtB,kBACG,qBAAuB,OAAO,KAAK,CAAQ,CAAC,CAAC,KAAK,IAAI,EAAI,IAC1D,GACJ,2EACJ,CACF,CACA,OAAO,CACT,CACA,SAAS,GAAY,EAAU,EAAM,EAAS,CAC5C,GAAY,GAAR,KAAkB,OAAO,EAC7B,IAAI,EAAS,CAAC,EACZ,EAAQ,EAIV,OAHA,GAAa,EAAU,EAAQ,GAAI,GAAI,SAAU,EAAO,CACtD,OAAO,EAAK,KAAK,EAAS,EAAO,GAAO,CAC1C,CAAC,EACM,CACT,CACA,SAAS,GAAgB,EAAS,CAChC,GAAW,EAAQ,UAAf,GAAwB,CAC1B,IAAI,EAAO,EAAQ,QACnB,EAAO,EAAK,EACZ,EAAK,KACH,SAAU,EAAc,EACZ,EAAQ,UAAd,GAAgC,EAAQ,UAAf,MAC3B,EAAS,QAAU,EAAK,EAAQ,QAAU,EAC9C,EACA,SAAU,EAAO,EACL,EAAQ,UAAd,GAAgC,EAAQ,UAAf,MAC3B,EAAS,QAAU,EAAK,EAAQ,QAAU,EAC9C,CACF,EACO,EAAQ,UAAf,KAA4B,EAAQ,QAAU,EAAK,EAAQ,QAAU,EACvE,CACA,GAAU,EAAQ,UAAd,EAAuB,OAAO,EAAQ,QAAQ,QAClD,MAAM,EAAQ,OAChB,CACA,IAAI,EACe,OAAO,aAAtB,WACI,YACA,SAAU,EAAO,CACf,GACe,OAAO,QAApB,UACe,OAAO,OAAO,YAA7B,WACA,CACA,IAAI,EAAQ,IAAI,OAAO,WAAW,QAAS,CACzC,QAAS,CAAC,EACV,WAAY,CAAC,EACb,QACe,OAAO,GAApB,UACS,GACI,OAAO,EAAM,SAA1B,SACI,OAAO,EAAM,OAAO,EACpB,OAAO,CAAK,EACX,OACT,CAAC,EACD,GAAI,CAAC,OAAO,cAAc,CAAK,EAAG,MACpC,MAAO,GACQ,OAAO,SAApB,UACe,OAAO,QAAQ,MAA9B,WACA,CACA,QAAQ,KAAK,oBAAqB,CAAK,EACvC,MACF,CACA,QAAQ,MAAM,CAAK,CACrB,EACN,EAAW,CACT,IAAK,GACL,QAAS,SAAU,EAAU,EAAa,EAAgB,CACxD,GACE,EACA,UAAY,CACV,EAAY,MAAM,KAAM,SAAS,CACnC,EACA,CACF,CACF,EACA,MAAO,SAAU,EAAU,CACzB,IAAI,EAAI,EAIR,OAHA,GAAY,EAAU,UAAY,CAChC,GACF,CAAC,EACM,CACT,EACA,QAAS,SAAU,EAAU,CAC3B,OACE,GAAY,EAALine truncated
|
||||
@@ -1,958 +0,0 @@
|
||||
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(i(n)),l(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),d=e=>a.call(e,`module.exports`)?e[`module.exports`]:l(t({},`__esModule`,{value:!0}),e);(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),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var f=s((e=>{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 ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(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===`pending`&&(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 te(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,te(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),te(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+ee(a,u),c+=te(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+ee(a,u++),c+=te(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return te(j(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid 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 ne(e,t,n){if(e==null)return e;var r=[],i=0;return te(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function re(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(Line truncated
|
||||
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
||||
`+ye+e+be}var Se=!1;function Ce(e,t){if(!e||Se)return``;Se=!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(`
|
||||
`),l=s.split(`
|
||||
`);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=`
|
||||
`+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{Se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?xe(n):``}function we(e,t){switch(e.tag){case 26:case 27:case 5:return xe(e.type);case 16:return xe(`Lazy`);case 13:return e.child!==t&&t!==null?xe(`Suspense Fallback`):xe(`Suspense`);case 19:return xe(`SuspenseList`);case 0:case 15:return Ce(e.type,!1);case 11:return Ce(e.type.render,!1);case 1:return Ce(e.type,!0);case 31:return xe(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=we(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
||||
Error generating stack: `+e.message+`
|
||||
`+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(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 Ze(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=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(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 Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(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 et(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function tt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function nt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function rt(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-Ue(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&&it(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function it(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function at(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function ot(e,t){var n=t&-t;return n=n&42?1:st(n),(n&(e.suspendedLanes|t))===0?n:0}function st(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 ct(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function lt(){var e=ie.p;return e===0?(e=window.event,e===void 0?32:Ap(e.type)):e}function ut(e,t){var n=ie.p;try{return ie.p=e,t()}finally{ie.p=n}}var dt=Math.random().toString(36).slice(2),ft=`__reactFiber$`+dt,pt=`__reactProps$`+dt,mt=`__reactContainer$`+dt,ht=`__reactEvents$`+dt,gt=`__reactListeners$`+dt,_t=`__reactHandles$`+dt,vt=`__reactResources$`+dt,yt=`__reactMarker$`+dt;function bt(e){delete e[ft],delete e[pt],delete e[ht],delete e[gt],delete e[_t]}function xt(e){var t=e[ft];if(t)return t;for(var n=e.parentNode;n;){if(t=n[mt]||n[ft]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Of(e);e!==null;){if(n=e[ft])return n;e=Of(e)}return t}e=n,n=e.parentNode}return null}function St(e){if(e=e[ft]||e[mt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ct(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function wt(e){var t=e[vt];return t||=e[vt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Tt(e){e[yt]=!0}var Et=new Set,Dt={};function Ot(e,t){kt(e,t),kt(e+`Capture`,t)}function kt(e,t){for(Dt[e]=t,e=0;e<t.length;e++)Et.add(t[e])}var At=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\uLine truncated
|
||||
`).replace(qd,``)}function Yd(e,t){return t=Jd(t),Jd(e)===t}function Xd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Zt(e,``+r);break;case`className`:Ft(e,`class`,r);break;case`tabIndex`:Ft(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Ft(e,n,r);break;case`style`:en(e,r,o);break;case`data`:if(t!==`object`){Ft(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=an(``+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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Xd(e,t,`name`,a.name,a,null),Xd(e,t,`formEncType`,a.formEncType,a,null),Xd(e,t,`formMethod`,a.formMethod,a,null),Xd(e,t,`formTarget`,a.formTarget,a,null)):(Xd(e,t,`encType`,a.encType,a,null),Xd(e,t,`method`,a.method,a,null),Xd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=an(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=on);break;case`onScroll`:r!=null&&Id(`scroll`,e);break;case`onScrollEnd`:r!=null&&Id(`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=an(``+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`:Id(`beforetoggle`,e),Id(`toggle`,e),Pt(e,`popover`,r);break;case`xlinkActuate`:It(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:It(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:It(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:It(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:It(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:It(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Pt(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=nn.get(n)||n,Pt(e,n,r))}}function Zd(e,t,n,r,a,o){switch(n){case`style`:en(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`?Zt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Zt(e,``+r);break;case`onScroll`:r!=null&&Id(`scroll`,e);break;case`onScrollEnd`:r!=null&&Id(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=on);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML
Line truncated
|
||||
/* [wrapped with `+t+`] */
|
||||
`)}function os(e){return lu(e)||cu(e)||!!(kt&&e&&e[kt])}function ss(e,t){var n=typeof e;return t??=g,!!t&&(n==`number`||n!=`symbol`&&Qe.test(e))&&e>-1&&e%1==0&&e<t}function cs(e,t,n){if(!Tu(n))return!1;var r=typeof t;return(r==`number`?du(n)&&ss(t,n.length):r==`string`&&t in n)?au(n[t],e):!1}function ls(e,t){if(lu(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Bu(e)?!0:Pe.test(e)||!Ne.test(e)||t!=null&&e in at(t)}function us(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function ds(e){var t=Uo(e),n=N[t];if(typeof n!=`function`||!(t in kr.prototype))return!1;if(e===n)return!0;var r=Ho(n);return!!r&&e===r[0]}function fs(e){return!!gt&> in e}var ps=ft?Su:Jf;function ms(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||dt)}function hs(e){return e===e&&!Tu(e)}function gs(e,t){return function(r){return r!=null&&r[e]===t&&(t!==n||e in at(r))}}function _s(e){var t=Vl(e,function(e){return n.size===500&&n.clear(),e}),n=t.cache;return t}function vs(e,t){var n=e[1],r=t[1],i=n|r,l=i<(o|s|f),u=r==f&&n==c||r==f&&n==p&&e[7].length<=t[8]||r==(f|p)&&t[7].length<=t[8]&&n==c;if(!(l||u))return e;r&o&&(e[2]=t[2],i|=n&o?0:4);var d=t[3];if(d){var m=e[3];e[3]=m?no(m,d,t[4]):d,e[4]=m?cr(e[3],a):t[4]}return d=t[5],d&&(m=e[5],e[5]=m?ro(m,d,t[6]):d,e[6]=m?cr(e[5],a):t[6]),d=t[7],d&&(e[7]=d),r&f&&(e[8]=e[8]==null?t[8]:Xt(e[8],t[8])),e[9]??=t[9],e[0]=t[0],e[1]=i,e}function ys(e){var t=[];if(e!=null)for(var n in at(e))t.push(n);return t}function bs(e){return _t.call(e)}function xs(e,t,r){return t=Gt(t===n?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=Gt(n.length-t,0),o=ze(a);++i<a;)o[i]=n[t+i];i=-1;for(var s=ze(t+1);++i<t;)s[i]=n[i];return s[t]=r(o),_n(e,this,s)}}function Ss(e,t){return t.length<2?e:Fi(e,Oa(t,0,-1))}function Cs(e,t){for(var r=e.length,i=Xt(t.length,r),a=io(e);i--;){var o=t[i];e[i]=ss(o,r)?a[o]:n}return e}function ws(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}var Ts=ks(Ta),Es=Ft||function(e,t){return an.setTimeout(e,t)},Ds=ks(Ea);function Os(e,t,n){var r=t+``;return Ds(e,as(r,Ps(es(r),n)))}function ks(e){var t=0,r=0;return function(){var i=Zt(),a=16-(i-r);if(r=i,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function As(e,t){var r=-1,i=e.length,a=i-1;for(t=t===n?i:t;++r<t;){var o=va(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var js=_s(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(Fe,function(e,n,r,i){t.push(r?i.replace(Ge,`$1`):n||e)}),t});function Ms(e){if(typeof e==`string`||Bu(e))return e;var t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Ns(e){if(e!=null){try{return pt.call(e)}catch{}try{return e+``}catch{}}return``}function Ps(e,t){return yn(S,function(n){var r=`_.`+n[0];t&n[1]&&!Cn(e,r)&&e.push(r)}),e.sort()}function Fs(e){if(e instanceof kr)return e.clone();var t=new Or(e.__wrapped__,e.__chain__);return t.__actions__=io(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Is(e,t,r){t=(r?cs(e,t,r):t===n)?1:Gt(Yu(t),0);var i=e==null?0:e.length;if(!i||t<1)return[];for(var a=0,o=0,s=ze(It(i/t));a<i;)s[o++]=Oa(e,a,a+=t);return s}function Ls(e){for(var t=-1,n=e==null?0:e.length,r=0,i=[];++t<n;){var a=e[t];a&&(i[r++]=a)}return i}function Rs(){var e=arguments.length;if(!e)return[];for(var t=ze(e-1),n=arguments[0],r=e;r--;)t[r-1]=arguments[r];return En(lu(n)?io(n):[n],P(t,1))}var zs=xa(function(e,t){return fu(e)?Ci(e,P(t,1,fu,!0)):[]}),Bs=xa(function(e,t){var r=oc(t);return fu(r)&&(r=n),fu(e)?Ci(e,P(t,1,fu,!0),Go(r,2)):[]}),Vs=xa(function(e,t){var r=oc(t);return fu(r)&&(r=n),fu(e)?Ci(e,P(t,1,fu,!0),n,r):[]});function Hs(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:Yu(t),Oa(e,t<0?0:t,i)):[]}function Us(e,t,r){var i=e==null?0:e.length;return i?(t=r||t===n?1:Yu(t),t=i-t,Oa(e,0,t<0?0:t)):[]}function Ws(e,t){return e&&e.length?Ra(e,Go(t,3),!0,!0):[]}function Gs(e,t){return e&&e.length?Ra(e,Go(t,3),!0):[]}function Ks(e,t,n,r){var i=e==null?0:e.length;return i?(n&&typeof n!=`number`&&cs(e,t,n)&&(n=0,r=i),Oi(e,t,n,r)):[]}function qs(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Yu(n);return i<0&&(i=Gt(r+i,0)),Pn(e,Go(t,3),i)}function Js(e,t,r){var i=e==null?0:e.length;if(!i)return-1;var a=i-1;return r!==n&&(a=Yu(r),a=r<0?Gt(i+a,0):Xt(a,i-1)),Pn(e,Go(t,3),a,!0)}function Ys(e){return e!=null&&e.length?P(e,1):[]}function Xs(e){return e!=null&&e.length?P(e,h):[]}function Zs(e,t){return e!=null&&e.length?(t=t===n?1:Yu(t),P(e,t)):[]}function Qs(e){for(var t=-1,n=e==null?0:e.length,r={};++t<n;){var i=e[t];gi(r,i[0],i[1])}return r}function $s(e){return e&&e.length?e[0]:n}function ec(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var i=n==null?0:Yu(n);return i<0&&(i=Gt(r+i,0)),Fn(e,t,i)}function tc(e){return e!=null&&e.length?Oa(e,0,-1):[]}var nc=xa(function(e){var t=Tn(e,Ha);return t.length&&t[0]===e[0]?Hi(t):[]}),rc=xa(function(e){var t=oc(e),r=Tn(e,Ha);return t===oc(r)?
Line truncated
|
||||
`;e.replace(p,function(t,n,r,i,a,o){return r||=i,f+=e.slice(u,o).replace(tt,tr),n&&(c=!0,f+=`' +
|
||||
__e(`+n+`) +
|
||||
'`),a&&(l=!0,f+=`';
|
||||
`+a+`;
|
||||
__p += '`),r&&(f+=`' +
|
||||
((__t = (`+r+`)) == null ? '' : __t) +
|
||||
'`),u=o+t.length,t}),f+=`';
|
||||
`;var h=mt.call(t,`variable`)&&t.variable;if(!h)f=`with (obj) {
|
||||
`+f+`
|
||||
}
|
||||
`;else if(We.test(h))throw new nt("Invalid `variable` option passed into `_.template`");f=(l?f.replace(Ce,``):f).replace(we,`$1`).replace(Te,`$1;`),f=`function(`+(h||`obj`)+`) {
|
||||
`+(h?``:`obj || (obj = {});
|
||||
`)+`var __t, __p = ''`+(c?`, __e = _.escape`:``)+(l?`, __j = Array.prototype.join;
|
||||
function print() { __p += __j.call(arguments, '') }
|
||||
`:`;
|
||||
`)+f+`return __p
|
||||
}`;var g=Cf(function(){return rt(o,m+`return `+f).apply(n,s)});if(g.source=f,bu(g))throw g;return g}function pf(e){return ed(e).toLowerCase()}function mf(e){return ed(e).toUpperCase()}function hf(e,t,r){if(e=ed(e),e&&(r||t===n))return Kn(e);if(!e||!(t=Pa(t)))return e;var i=mr(e),a=mr(t);return Ka(i,Xn(i,a),Zn(i,a)+1).join(``)}function gf(e,t,r){if(e=ed(e),e&&(r||t===n))return e.slice(0,hr(e)+1);if(!e||!(t=Pa(t)))return e;var i=mr(e);return Ka(i,0,Zn(i,mr(t))+1).join(``)}function _f(e,t,r){if(e=ed(e),e&&(r||t===n))return e.replace(Re,``);if(!e||!(t=Pa(t)))return e;var i=mr(e);return Ka(i,Xn(i,mr(t))).join(``)}function vf(e,t){var r=30,i=`...`;if(Tu(t)){var a=`separator`in t?t.separator:a;r=`length`in t?Yu(t.length):r,i=`omission`in t?Pa(t.omission):i}e=ed(e);var o=e.length;if(rr(e)){var s=mr(e);o=s.length}if(r>=o)return e;var c=r-pr(i);if(c<1)return i;var l=s?Ka(s,0,c).join(``):e.slice(0,c);if(a===n)return l+i;if(s&&(c+=l.length-c),Iu(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=ot(a.source,ed(qe.exec(a))+`g`)),a.lastIndex=0;u=a.exec(d);)var f=u.index;l=l.slice(0,f===n?c:f)}}else if(e.indexOf(Pa(a),c)!=c){var p=l.lastIndexOf(a);p>-1&&(l=l.slice(0,p))}return l+i}function yf(e){return e=ed(e),e&&Oe.test(e)?e.replace(Ee,gr):e}var bf=ho(function(e,t,n){return e+(n?` `:``)+t.toUpperCase()}),xf=mo(`toUpperCase`);function Sf(e,t,r){return e=ed(e),t=r?n:t,t===n?ir(e)?yr(e):Mn(e):e.match(t)||[]}var Cf=xa(function(e,t){try{return _n(e,n,t)}catch(e){return bu(e)?e:new nt(e)}}),wf=zo(function(e,t){return yn(t,function(t){t=Ms(t),gi(e,t,Nl(e[t],e))}),e});function I(e){var t=e==null?0:e.length,n=Go();return e=t?Tn(e,function(e){if(typeof e[1]!=`function`)throw new ct(r);return[n(e[0]),e[1]]}):[],xa(function(n){for(var r=-1;++r<t;){var i=e[r];if(_n(i[0],this,n))return _n(i[1],this,n)}})}function Tf(e){return bi(yi(e,1))}function Ef(e){return function(){return e}}function Df(e,t){return e==null||e!==e?t:e}var Of=yo(),kf=yo(!0);function Af(e){return e}function jf(e){return na(typeof e==`function`?e:yi(e,1))}function Mf(e){return sa(yi(e,1))}function Nf(e,t){return ca(e,yi(t,1))}var Pf=xa(function(e,t){return function(n){return Wi(n,e,t)}}),Ff=xa(function(e,t){return function(n){return Wi(e,n,t)}});function If(e,t,n){var r=Sd(t),i=Pi(t,r);n==null&&!(Tu(t)&&(i.length||!r.length))&&(n=t,t=e,e=this,i=Pi(t,Sd(t)));var a=!(Tu(n)&&`chain`in n)||!!n.chain,o=Su(e);return yn(i,function(n){var r=t[n];e[n]=r,o&&(e.prototype[n]=function(){var t=this.__chain__;if(a||t){var n=e(this.__wrapped__);return(n.__actions__=io(this.__actions__)).push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,En([this.value()],arguments))})}),e}function Lf(){return an._===this&&(an._=yt),this}function Rf(){}function zf(e){return e=Yu(e),xa(function(t){return da(t,e)})}var Bf=Co(Tn),Vf=Co(xn),Hf=Co(kn);function Uf(e){return ls(e)?zn(Ms(e)):ha(e)}function Wf(e){return function(t){return e==null?n:Fi(e,t)}}var Gf=Eo(),Kf=Eo(!0);function qf(){return[]}function Jf(){return!1}function Yf(){return{}}function Xf(){return``}function Zf(){return!0}function Qf(e,t){if(e=Yu(e),e<1||e>g)return[];var n=y,r=Xt(e,y);t=Go(t),e-=y;for(var i=Wn(r,t);++n<e;)t(n);return i}function $f(e){return lu(e)?Tn(e,Ms):Bu(e)?[e]:io(js(ed(e)))}function ep(e){var t=++ht;return ed(e)+t}var tp=So(function(e,t){return e+t},0),np=ko(`ceil`),rp=So(function(e,t){return e/t},1),ip=ko(`floor`);function ap(e){return e&&e.length?Di(e,Af,Ri):n}function op(e,t){return e&&e.length?Di(e,Go(t,2),Ri):n}function sp(e){return Rn(e,Af)}function cp(e,t){return Rn(e,Go(t,2))}function lp(e){return e&&e.length?Di(e,Af,aa):n}function up(e,t){return e&&e.length?Di(e,Go(t,2),aa):n}var dp=So(function(e,t){return e*t},1),fp=ko(`round`),pp=So(function(e,t){return e-t},0);function mp(e){return e&&e.length?Un(e,Af):0}function hp(e,t){return e&&e.length?Un(e,Go(t,2)):0}return N.after=Al,N.ary=jl,N.assign=td,N.assignIn=nd,N.assignInWith=rd,N.assignWith=id,N.at=ad,N.before=Ml,N.bind=Nl,N.bindAll=wf,N.bindKey=Pl,N.castArray=$l,N.chain=Kc,N.chunk=Is,N.compact=Ls,N.concat=Rs,N.cond=I,N.conforms=Tf,N.constant=Ef,N.countBy=rl,N.create=F,N.curry=Fl,N.curryRight=Il,N.debounce=Ll,N.defaults=od,N.defaultsDeep=sd,N.defer=Rl,N.delay=zl,N.difference=zs,N.differenceBy=Bs,N.differenceWith=Vs,N.drop=Hs,N.dropRight=Us,N.dropRightWhile=Ws,N.dropWhile=Gs,N.fill=Ks,N.filter=al,N.flatMap=cl,N.flatMapDeep=ll,N.flatMapDepth=ul,N.flatten=Ys,N.flattenDeep=Xs,N.flattenDepth=Zs,N.flip=Bl,N.flow=Of,N.flowRight=kf,N.fromPairs=Qs,N.functions=md,N.functionsIn=hd,N.groupBy=pl,N.initial=tc,N.intersection=nc,N.intersectionBy=rc,N.intersectionWith=ic,N.invert=yd,N.invertBy=bd,N.invokeMap=hl,N.iteratee=jf,N.keyBy=gl,N.keys=Sd,N.keysIn=Cd,N.map=_l,N.mapKeys=wd,N.mapValues=Td,N.matches=Mf,N.matchesProperty=Nf,N.memoize=Vl,N.merge=Ed,N.mergeWith=Dd,N.method=Pf,N.methodOf=Ff,N.mixin=If,N.negate=Hl,N.nthArg=zf,N.omit=Od,N.omitBy=kd,N.once=Ul,N.orderBy=vl,N.over=Bf,N.overArgs=Wl,N.overEvery=Vf,N.overSome=Hf,N.partial=Gl,N.partialRight
Line truncated
|
||||
|
||||
* In categorical functions, when the feature value does not match any of the stop domain values.
|
||||
|
||||
* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.
|
||||
|
||||
* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a \`circle-color\` property but the feature property value is not a string or not a valid color).
|
||||
|
||||
* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.
|
||||
|
||||
If no default is provided, the style property's default is used in these circumstances.`}},function_stop:{type:`array`,minimum:0,maximum:24,value:[`number`,`color`],length:2,doc:`Zoom level and value pair.`},expression:{type:`array`,value:`expression_name`,minimum:1,doc:'An expression defines a function that can be used for data-driven style properties or feature filters. The first element of an expression array is a string naming the expression operator, e.g. `"*"` or `"case"`. Elements that follow (if any) are the _arguments_ to the expression. Each argument is either a literal value (a string, number, boolean, or `null`), or another expression array.'},expression_name:JSON.parse('{"doc":"First element in an expression array. May be followed by a number of arguments.","type":"enum","values":{"let":{"doc":"Binds expressions to named variables, which can then be referenced in the result expression using `[\\"var\\", \\"variable_name\\"]`.\\n\\n - [Visualize population density](https://maplibre.org/maplibre-gl-js/docs/examples/visualize-population-density/)","syntax":{"overloads":[{"parameters":["var_name_1","var_value_1","...","var_name_n","var_value_n","expression"],"output-type":"any"}],"parameters":[{"name":"var_name_i","type":"string literal","doc":"The name of the i-th variable."},{"name":"var_value_i","type":"any","doc":"The value of the i-th variable."},{"name":"expression","type":"any","doc":"The expression within which the named variables can be referenced."}]},"example":["let","someNumber",500,["interpolate",["linear"],["var","someNumber"],274,"#edf8e9",1551,"#006d2c"]],"group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"var":{"doc":"References variable bound using `let`.\\n\\n - [Visualize population density](https://maplibre.org/maplibre-gl-js/docs/examples/visualize-population-density/)","syntax":{"overloads":[{"parameters":["var_name"],"output-type":"any"}],"parameters":[{"name":"var_name","type":"string literal","doc":"The name of the variable bound using `let`."}]},"example":["var","density"],"group":"Variable binding","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"literal":{"doc":"Provides a literal array or object value, treating nested values as literals themselves.\\n\\n - [Display and style rich text labels](https://maplibre.org/maplibre-gl-js/docs/examples/display-and-style-rich-text-labels/)","syntax":{"overloads":[{"parameters":["json_object"],"output-type":"object"},{"parameters":["json_array"],"output-type":"array"}],"parameters":[{"name":"json_object","type":"JSON object"},{"name":"json_array","type":"JSON array"}]},"example":["literal",["DIN Offc Pro Italic","Arial Unicode MS Regular"]],"group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"semiliteral":{"doc":"Provides an array value, evaluating expressions in the elements of the array.","syntax":{"overloads":[{"parameters":["json_array"],"output-type":"array"}],"parameters":[{"name":"json_array","type":"JSON array"}]},"example":["semiliteral",[["get","label_x"],["get","label_y"]]],"group":"Types","sdk-support":{"basic functionality":{"js":"https://github.com/maplibre/maplibre-gl-js/issues/7933","android":"https://github.com/maplibre/maplibre-native/issues/4401","ios":"https://github.com/maplibre/maplibre-native/issues/4401"}}},"array":{"doc":"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type or length, then this assertion will cause the whole expression to be aborted.","syntax":{"overloads":[{"parameters":["value"],"output-type":"array"},{"parameters":["type","value"],"output-type":"array<type>"},{"parameters":["type","length","value"],"output-type":"array<type, length>"}],"parameters":[{"name":"value","type":"any"},{"name":"type","type":["string","number","boolean"],"doc":"The asserted type of the input array."},{"name":"length","type":"number literal","doc":"The asserted length of the input array."}]},"example":["array","string",3,["literal",["a","b","c"]]],"group":"Types","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"at":{"doc":"Retrieves an item from an array.","syntax":{"overloads":[{"parameters":["index","array"],"output-type":"T"}],"parameters":[{"name":"index","type":"number","doc":"The index into `array`."},{"name":"array","type":"array<T>","doc":"The array of items to retrieve the specified item from."}]},"example":["at",1,["literal",["a","b","c"]]],"group":"Lookup","sdk-support":{"basic functionality":{"js":"0.41.0","android":"6.0.0","ios":"4.0.0"}}},"in":{"doc":"Determines whether an item exists in an array or a substring exists in a string.\\n\\n - [Measure distances](https://maplibre.org/maplibre-gl-js/docs/examples/measure-distances/)","syntax":{"overloads":[{"parameters":["item","array"],"output-type":"boolean"Line truncated
|
||||
|
||||
The unit is in pixels only for SDF sprites that were created with a blur radius of 8, multiplied by the display density. I.e., the radius needs to be 16 for \`@2x\` sprites, etc.`,requires:[`icon-image`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},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`,doc:`Fade out the halo towards the outside.`,requires:[`icon-image`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},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`,doc:`Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.`,requires:[`icon-image`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"icon-translate-anchor":{type:`enum`,values:{map:{doc:`Icons are translated relative to the map.`},viewport:{doc:`Icons are translated relative to the viewport.`}},doc:"Controls the frame of reference for `icon-translate`.",default:`map`,requires:[`icon-image`,`icon-translate`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"text-opacity":{type:`number`,doc:`The opacity at which the text will be drawn.`,default:1,minimum:0,maximum:1,transition:!0,requires:[`text-field`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`,`feature`,`feature-state`]},"property-type":`data-driven`},"text-color":{type:`color`,doc:`The color with which the text will be drawn.`,default:`#000000`,transition:!0,overridable:!0,requires:[`text-field`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},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,doc:`The color of the text's halo, which helps it stand out from backgrounds.`,requires:[`text-field`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},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`,doc:`Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.`,requires:[`text-field`],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{js:`0.33.0`,android:`5.0.0`,ios:`3.5.0`},"[`global-state`](https:Line truncated
|
||||
`,values:{linear:{doc:`(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled`},nearest:{doc:`Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled`}},default:`linear`,"sdk-support":{"basic functionality":{js:`5.20.0`,android:`https://github.com/maplibre/maplibre-native/issues/4117`,ios:`https://github.com/maplibre/maplibre-native/issues/4117`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-resampling":{type:`enum`,doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter. It is advised to use the generic `resampling` paint property instead.",values:{linear:{doc:`(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled`},nearest:{doc:`Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled`}},default:`linear`,"sdk-support":{"basic functionality":{js:`0.47.0`,android:`6.3.0`,ios:`4.2.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"raster-fade-duration":{type:`number`,default:300,minimum:0,transition:!1,units:`milliseconds`,doc:`Fade duration when a new tile is added, or when a video is started or its coordinates are updated.`,"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},paint_hillshade:{"hillshade-illumination-direction":{type:`numberArray`,default:335,minimum:0,maximum:359,doc:"The direction of the light source(s) used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`. Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.",transition:!1,"sdk-support":{"basic functionality":{js:`0.43.0`,android:`6.0.0`,ios:`4.0.0`},multidirectional:{js:`5.5.0`,android:`13.0.0`,ios:`6.24.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-altitude":{type:`numberArray`,default:45,minimum:0,maximum:90,doc:"The altitude of the light source(s) used to generate the hillshading with 0 as sunset and 90 as noon. Only when `hillshade-method` is set to `multidirectional` can you specify multiple light sources.",transition:!1,"sdk-support":{"basic functionality":{js:`5.5.0`,android:`13.0.0`,ios:`6.24.0`},multidirectional:{js:`5.5.0`,android:`13.0.0`,ios:`6.24.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-illumination-anchor":{type:`enum`,values:{map:{doc:`The hillshade illumination is relative to the north direction.`},viewport:{doc:`The hillshade illumination is relative to the top of the viewport.`}},default:`viewport`,doc:`Direction of light source when map is rotated.`,"sdk-support":{"basic functionality":{js:`0.43.0`,android:`6.0.0`,ios:`4.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`},"hillshade-exaggeration":{type:`number`,doc:`Intensity of the hillshade`,default:.5,min
Line truncated
|
||||
`,values:{linear:{doc:`(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled`},nearest:{doc:`Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled`}},default:`linear`,"sdk-support":{"basic functionality":{js:`5.20.0`,android:`https://github.com/maplibre/maplibre-native/issues/4117`,ios:`https://github.com/maplibre/maplibre-native/issues/4117`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},"paint_color-relief":{"color-relief-opacity":{type:`number`,default:1,minimum:0,maximum:1,doc:`The opacity at which the color-relief will be drawn.`,transition:!0,"sdk-support":{"basic functionality":{js:`5.6.0`,android:`13.0.0`,ios:`6.24.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"color-relief-color":{type:`color`,doc:'Defines the color of each pixel based on its elevation. Should be an expression that uses `["elevation"]` as input.',example:[`interpolate`,[`linear`],[`elevation`],0,`black`,8849,`white`],transition:!1,"sdk-support":{"basic functionality":{js:`5.6.0`,android:`13.0.0`,ios:`6.24.0`},"data-driven styling":{},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`elevation`]},"property-type":`color-ramp`},resampling:{type:`enum`,doc:`The resampling/interpolation method to use for overscaling, also known as texture magnification filter.
|
||||
`,values:{linear:{doc:`(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled`},nearest:{doc:`Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled`}},default:`linear`,"sdk-support":{"basic functionality":{js:`5.20.0`,android:`https://github.com/maplibre/maplibre-native/issues/4117`,ios:`https://github.com/maplibre/maplibre-native/issues/4117`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`data-constant`}},paint_background:{"background-color":{type:`color`,default:`#000000`,doc:`The color with which the background will be drawn.`,transition:!0,requires:[{"!":`background-pattern`}],"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`},"background-pattern":{type:`resolvedImage`,transition:!0,doc:`Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.`,"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"data-driven styling":{},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!1,parameters:[`zoom`]},"property-type":`cross-faded`},"background-opacity":{type:`number`,default:1,minimum:0,maximum:1,doc:`The opacity at which the background will be drawn.`,transition:!0,"sdk-support":{"basic functionality":{js:`0.10.0`,android:`2.0.1`,ios:`2.0.0`},"[`global-state`](https://maplibre.org/maplibre-style-spec/expressions/#global-state) expression":{js:`5.6.0`,android:`https://github.com/maplibre/maplibre-native/issues/3302`,ios:`https://github.com/maplibre/maplibre-native/issues/3302`}},expression:{interpolated:!0,parameters:[`zoom`]},"property-type":`data-constant`}},transition:{duration:{type:`number`,default:300,minimum:0,units:`milliseconds`,doc:`Time allotted for transitions to complete.`},delay:{type:`number`,default:0,minimum:0,units:`milliseconds`,doc:`Length of time before a transition begins.`}},"property-type":{"data-driven":{type:`property-type`,doc:`Property is interpolable and can be represented using a property expression.`},"cross-faded":{type:`property-type`,doc:`Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms.`},"cross-faded-data-driven":{type:`property-type`,doc:`Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression.`},"color-ramp":{type:`property-type`,doc:`Property should be specified using a color ramp from which the output color can be sampled based on a property calculation.`},"data-constant":{type:`property-type`,doc:`Property is interpolable but cannot be represented using a property expression.`},constant:{type:`property-type`,doc:`Property is constant across all zoom levels and property values.`}},promoteId:{"*":{type:`string`,doc:`A name of a feature property to use as ID for feature state.`}},interpolation:{type:`array`,value:`interpolation_name`,minimum:1,doc:'An interpolation defines how to transition between items. The first element of an interpolation array is a string naming the interpolation operator, e.g. `"linear"` or `"exponential"`. Elements that follow (if any) are the _arguments_ to the interpolation.'},interpolation_name:{doc:`First element in an interpolation array. May be followed by a number of arguments.`,type:`enum`,values:{linear:{doc:`Interpolates linearly between the pair of stops just less than and just greater than the input`,syntax:{overloads:[{parameters:[],"output-type":`interpolation`}],parameters:[]},example:[`linear`],"sdk-support":{interpolate:{js:`0.42.0`,android:`6.0.0`,ios:`4.0.0`},"interpolate-hcl":{js:`0.49.0`,ios:`https://github.com/maplibre/maplibre-native/issues/2784`,android:`https://github.com/maplibre/maplibre-native/issues/2784`},"interpolate-lab":{js:`0.49.0`,ios:`https://
Line truncated
|
||||
precision mediump float;
|
||||
#else
|
||||
#if !defined(lowp)
|
||||
#define lowp
|
||||
#endif
|
||||
#if !defined(mediump)
|
||||
#define mediump
|
||||
#endif
|
||||
#if !defined(highp)
|
||||
#define highp
|
||||
#endif
|
||||
#endif
|
||||
out highp vec4 fragColor;`,zde=`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#else
|
||||
#if !defined(lowp)
|
||||
#define lowp
|
||||
#endif
|
||||
#if !defined(mediump)
|
||||
#define mediump
|
||||
#endif
|
||||
#if !defined(highp)
|
||||
#define highp
|
||||
#endif
|
||||
#endif
|
||||
vec2 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
|
||||
);}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
|
||||
);}
|
||||
#ifdef TERRAIN3D
|
||||
uniform 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;
|
||||
#endif
|
||||
const 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);}highp float depthOpacity(vec3 frag) {
|
||||
#ifdef TERRAIN3D
|
||||
highp 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));
|
||||
#else
|
||||
return 1.0;
|
||||
#endif
|
||||
}float calculate_visibility(vec4 pos) {
|
||||
#ifdef TERRAIN3D
|
||||
vec3 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;
|
||||
#else
|
||||
return 1.0;
|
||||
#endif
|
||||
}float ele(ivec2 pos) {
|
||||
#ifdef TERRAIN3D
|
||||
vec4 rgb=(texelFetch(u_terrain,pos,0)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
|
||||
#else
|
||||
return 0.0;
|
||||
#endif
|
||||
}float get_elevation(vec2 pos) {
|
||||
#ifdef TERRAIN3D
|
||||
#ifdef GLOBE
|
||||
if ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}
|
||||
#endif
|
||||
vec2 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;
|
||||
#else
|
||||
return 0.0;
|
||||
#endif
|
||||
}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;`,Bde=`uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,Vde=`layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}`,Hde=`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;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,Ude=`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);}`,Wde=`in vec3 v_data;flat in float v_visibility;
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define mediump float radius
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define highp vec4 stroke_color
|
||||
#pragma maplibre: define mediump float stroke_width
|
||||
#pragma maplibre: define lowp float stroke_opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize mediump float radius
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize highp vec4 stroke_color
|
||||
#pragma maplibre: initialize mediump float stroke_width
|
||||
#pragma maplibre: initialize lowp float stroke_opacity
|
||||
vec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));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;}
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,Gde=`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;
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define mediump float radius
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define highp vec4 stroke_color
|
||||
#pragma maplibre: define mediump float stroke_width
|
||||
#pragma maplibre: define lowp float stroke_opacity
|
||||
void main(void) {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize mediump float radius
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize highp vec4 stroke_color
|
||||
#pragma maplibre: initialize mediump float stroke_width
|
||||
#pragma maplibre: initialize lowp float stroke_opacity
|
||||
ivec2 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) {
|
||||
#ifdef GLOBE
|
||||
vec3 center_vector=projectToSphere(circle_center);
|
||||
#endif
|
||||
float 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 {
|
||||
#ifdef GLOBE
|
||||
vec4 projected_center=interpolateProjection(circle_center,center_vector,ele);
|
||||
#else
|
||||
vec4 projected_center=projectTileWithElevation(circle_center,ele);
|
||||
#endif
|
||||
corner_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);}
|
||||
#ifdef GLOBE
|
||||
vec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);
|
||||
#else
|
||||
gl_Position=projectTileWithElevation(corner_position,ele);
|
||||
#endif
|
||||
} 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);}`,BT=`void main() {fragColor=vec4(1.0);}`,VT={prelude:HT(Rde,zde),projectionMercator:HT(`
|
||||
void 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:HT(`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
|
||||
uniform 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
|
||||
);}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));float 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
|
||||
);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:HT(Bde,Vde),backgroundPattern:HT(Hde,Ude),circle:HT(Wde,Gde),clippingMask:HT(BT,`layout(location=0) in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}`),heatmap:HT(`uniform highp float u_intensity;in vec2 v_extrude;
|
||||
#pragma maplibre: define highp float weight
|
||||
#define GAUSS_COEF 0.3989422804014327
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp float weight
|
||||
float 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);
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#pragma maplibre: define highp float weight
|
||||
#pragma maplibre: define mediump float radius
|
||||
const highp float ZERO=1.0/255.0/16.0;
|
||||
#define GAUSS_COEF 0.3989422804014327
|
||||
void main(void) {
|
||||
#pragma maplibre: initialize highp float weight
|
||||
#pragma maplibre: initialize mediump float radius
|
||||
ivec2 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);
|
||||
#ifdef GLOBE
|
||||
vec2 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);
|
||||
#else
|
||||
gl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));
|
||||
#endif
|
||||
}`),heatmapTexture:HT(`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;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(0.0);
|
||||
#endif
|
||||
}`,`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:HT(`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:HT(`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:HT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
uniform 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
|
||||
{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));
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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:HT(`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:HT(BT,`layout(location=0) in vec2 a_pos;void main() {
|
||||
#ifdef GLOBE
|
||||
gl_Position=projectTileFor3D(a_pos,0.0);
|
||||
#else
|
||||
gl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);
|
||||
#endif
|
||||
}`),fill:HT(`#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
fragColor=color*opacity;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
if (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:HT(`in vec2 v_pos;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 outline_color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 outline_color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`uniform vec2 u_world;uniform vec2 u_fill_translate;layout(location=0) in vec2 a_pos;out vec2 v_pos;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 outline_color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 outline_color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
}`),fillOutlinePattern:HT(`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;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;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;
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
}`),fillPattern:HT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;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;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
if (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:HT(`in vec4 v_color;void main() {fragColor=v_color;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#ifdef TERRAIN3D
|
||||
layout(location=2) in vec2 a_centroid;
|
||||
#endif
|
||||
out vec4 v_color;
|
||||
#pragma maplibre: define highp float base
|
||||
#pragma maplibre: define highp float height
|
||||
#pragma maplibre: define highp vec4 color
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp float base
|
||||
#pragma maplibre: initialize highp float height
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
vec3 normal=vec3(a_normal_ed.xyz);
|
||||
#ifdef TERRAIN3D
|
||||
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
||||
#else
|
||||
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
||||
#endif
|
||||
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
|
||||
#ifdef GLOBE
|
||||
vec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
|
||||
#else
|
||||
gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
|
||||
#endif
|
||||
float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);
|
||||
#ifdef GLOBE
|
||||
mat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);
|
||||
#endif
|
||||
directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:HT(`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;
|
||||
#pragma maplibre: define lowp float base
|
||||
#pragma maplibre: define lowp float height
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float base
|
||||
#pragma maplibre: initialize lowp float height
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;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;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#ifdef TERRAIN3D
|
||||
layout(location=2) in vec2 a_centroid;
|
||||
#endif
|
||||
#ifdef GLOBE
|
||||
out vec3 v_sphere_pos;
|
||||
#endif
|
||||
out vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;
|
||||
#pragma maplibre: define lowp float base
|
||||
#pragma maplibre: define lowp float height
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float base
|
||||
#pragma maplibre: initialize lowp float height
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;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;
|
||||
#ifdef TERRAIN3D
|
||||
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
|
||||
#else
|
||||
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
|
||||
#endif
|
||||
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=float(a_normal_ed.x & 1);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;
|
||||
#ifdef GLOBE
|
||||
vec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);
|
||||
#else
|
||||
gl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);
|
||||
#endif
|
||||
vec2 pos=a_normal_ed.x==1 && a_normal_ed.y==0 && a_normal_ed.z==16384
|
||||
? a_pos
|
||||
: 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:HT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
uniform 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/pow(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);
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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:HT(`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];
|
||||
#define PI 3.141592653589793
|
||||
#define STANDARD 0
|
||||
#define COMBINED 1
|
||||
#define IGOR 2
|
||||
#define MULTIDIRECTIONAL 3
|
||||
#define BASIC 4
|
||||
float 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
|
||||
{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
|
||||
{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);}
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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:HT(`uniform lowp float u_device_pixel_ratio;flat in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
clipAntimeridian();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);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
layout(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;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float width
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float width
|
||||
if (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);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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
v_width2=vec2(outset,inset);}`),lineGradient:HT(`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;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
clipAntimeridian();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);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
layout(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;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float width
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float width
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
v_width2=vec2(outset,inset);}`),linePattern:HT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;flat in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;flat in float v_width;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
clipAntimeridian();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;
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
#define LINE_DISTANCE_SCALE 2.0
|
||||
layout(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;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define lowp vec4 pattern_from
|
||||
#pragma maplibre: define lowp vec4 pattern_to
|
||||
#pragma maplibre: define lowp float pixel_ratio_from
|
||||
#pragma maplibre: define lowp float pixel_ratio_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 pattern_from
|
||||
#pragma maplibre: initialize mediump vec4 pattern_to
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_from
|
||||
#pragma maplibre: initialize lowp float pixel_ratio_to
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:HT(`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;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define mediump vec4 dasharray_from
|
||||
#pragma maplibre: define mediump vec4 dasharray_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_from
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_to
|
||||
clipAntimeridian();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);float 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);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
#define LINE_DISTANCE_SCALE 2.0
|
||||
layout(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;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define highp vec4 color
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define mediump vec4 dasharray_from
|
||||
#pragma maplibre: define mediump vec4 dasharray_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 color
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_from
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_to
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
float 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:HT(`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;
|
||||
#ifdef GLOBE
|
||||
in float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define mediump vec4 dasharray_from
|
||||
#pragma maplibre: define mediump vec4 dasharray_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_from
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_to
|
||||
clipAntimeridian();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);float 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);
|
||||
#ifdef GLOBE
|
||||
if (v_depth > 1.0) {discard;}
|
||||
#endif
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`
|
||||
#define scale 0.015873016
|
||||
#define LINE_DISTANCE_SCALE 2.0
|
||||
layout(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;
|
||||
#ifdef GLOBE
|
||||
out float v_depth;
|
||||
#endif
|
||||
#pragma maplibre: define lowp float blur
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define mediump float gapwidth
|
||||
#pragma maplibre: define lowp float offset
|
||||
#pragma maplibre: define mediump float width
|
||||
#pragma maplibre: define lowp float floorwidth
|
||||
#pragma maplibre: define mediump vec4 dasharray_from
|
||||
#pragma maplibre: define mediump vec4 dasharray_to
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float blur
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize mediump float gapwidth
|
||||
#pragma maplibre: initialize lowp float offset
|
||||
#pragma maplibre: initialize mediump float width
|
||||
#pragma maplibre: initialize lowp float floorwidth
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_from
|
||||
#pragma maplibre: initialize mediump vec4 dasharray_to
|
||||
if (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;
|
||||
#ifdef GLOBE
|
||||
v_depth=gl_Position.z/gl_Position.w;
|
||||
#endif
|
||||
#ifdef TERRAIN3D
|
||||
v_gamma_scale=1.0;
|
||||
#else
|
||||
float 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;
|
||||
#endif
|
||||
float 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:HT(`uniform sampler2D u_image;uniform float u_opacity;in vec2 v_pos;void main() {fragColor=texture(u_image,v_pos)*u_opacity;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(0.0);
|
||||
#endif
|
||||
}`,`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:HT(`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);
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;vec2 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;
|
||||
#ifdef GLOBE
|
||||
if (a_pos.y <-32767.5) {texturePos.y=0.0;}if (a_pos.y > 32766.5) {texturePos.y=1.0;}
|
||||
#endif
|
||||
float 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:HT(`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;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#pragma maplibre: define lowp float opacity
|
||||
void main() {
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
vec2 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 ?
|
||||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);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;
|
||||
#ifdef GLOBE
|
||||
if(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);}
|
||||
#endif
|
||||
vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;}`),symbolSDF:HT(`#define SDF_PX 8.0
|
||||
uniform 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;
|
||||
#pragma maplibre: define highp vec4 fill_color
|
||||
#pragma maplibre: define highp vec4 halo_color
|
||||
#pragma maplibre: define lowp float halo_width
|
||||
#pragma maplibre: define lowp float halo_blur
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 fill_color
|
||||
#pragma maplibre: initialize highp vec4 halo_color
|
||||
#pragma maplibre: initialize lowp float halo_width
|
||||
#pragma maplibre: initialize lowp float halo_blur
|
||||
float 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;}
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#pragma maplibre: define highp vec4 fill_color
|
||||
#pragma maplibre: define highp vec4 halo_color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp float halo_width
|
||||
#pragma maplibre: define lowp float halo_blur
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 fill_color
|
||||
#pragma maplibre: initialize highp vec4 halo_color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize lowp float halo_width
|
||||
#pragma maplibre: initialize lowp float halo_blur
|
||||
vec2 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 ?
|
||||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);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;
|
||||
#ifdef GLOBE
|
||||
if(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);}
|
||||
#endif
|
||||
vec4 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:HT(`#define SDF_PX 8.0
|
||||
#define SDF 1.0
|
||||
#define ICON 0.0
|
||||
uniform 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;
|
||||
#pragma maplibre: define highp vec4 fill_color
|
||||
#pragma maplibre: define highp vec4 halo_color
|
||||
#pragma maplibre: define lowp float halo_width
|
||||
#pragma maplibre: define lowp float halo_blur
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 fill_color
|
||||
#pragma maplibre: initialize highp vec4 halo_color
|
||||
#pragma maplibre: initialize lowp float halo_width
|
||||
#pragma maplibre: initialize lowp float halo_blur
|
||||
float total_opacity=v_data1[2];if (v_is_sdf==ICON) {vec2 tex_icon=v_data0.zw;fragColor=texture(u_texture_icon,tex_icon)*total_opacity;
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
return;}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;}
|
||||
#ifdef OVERDRAW_INSPECTOR
|
||||
fragColor=vec4(1.0);
|
||||
#endif
|
||||
}`,`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;
|
||||
#pragma maplibre: define highp vec4 fill_color
|
||||
#pragma maplibre: define highp vec4 halo_color
|
||||
#pragma maplibre: define lowp float opacity
|
||||
#pragma maplibre: define lowp float halo_width
|
||||
#pragma maplibre: define lowp float halo_blur
|
||||
void main() {
|
||||
#pragma maplibre: initialize highp vec4 fill_color
|
||||
#pragma maplibre: initialize highp vec4 halo_color
|
||||
#pragma maplibre: initialize lowp float opacity
|
||||
#pragma maplibre: initialize lowp float halo_width
|
||||
#pragma maplibre: initialize lowp float halo_blur
|
||||
vec2 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 ?
|
||||
camera_to_anchor_distance/u_camera_to_center_distance :
|
||||
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);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;
|
||||
#ifdef GLOBE
|
||||
if(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);}
|
||||
#endif
|
||||
vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;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:HT(`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);float 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:HT(`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:HT(`#ifdef GL_ES
|
||||
precision highp float;
|
||||
#endif
|
||||
in 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
|
||||
);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:HT(`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 HT(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`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
in ${n} ${r} ${i};
|
||||
#else
|
||||
uniform ${n} ${r} u_${i};
|
||||
#endif
|
||||
`:`
|
||||
#ifdef HAS_UNIFORM_u_${i}
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`)),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`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
uniform lowp float u_${i}_t;
|
||||
layout(location = ${s++}) in ${n} ${a} a_${i};
|
||||
out ${n} ${r} ${i};
|
||||
#else
|
||||
uniform ${n} ${r} u_${i};
|
||||
#endif
|
||||
`:o===`vec4`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
${i} = a_${i};
|
||||
#else
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`:`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
${i} = unpack_mix_${o}(a_${i}, u_${i}_t);
|
||||
#else
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`:t===`define`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
uniform lowp float u_${i}_t;
|
||||
layout(location = ${s++}) in ${n} ${a} a_${i};
|
||||
#else
|
||||
uniform ${n} ${r} u_${i};
|
||||
#endif
|
||||
`:o===`vec4`?`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
${n} ${r} ${i} = a_${i};
|
||||
#else
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`:`
|
||||
#ifndef HAS_UNIFORM_u_${i}
|
||||
${n} ${r} ${i} = unpack_mix_${o}(a_${i}, u_${i}_t);
|
||||
#else
|
||||
${n} ${r} ${i} = u_${i};
|
||||
#endif
|
||||
`}),{fragmentSource:e,vertexSource:t,staticAttributes:r,staticUniforms:o}}var UT=`#define PROJECTION_MERCATOR`,WT=`mercator`,GT=class{constructor(){this._cachedMesh=null}get name(){return`mercator`}get useSubdivision(){return!1}get shaderVariantName(){return WT}get shaderDefine(){return UT}get shaderPreludeCode(){return VT.projectionMercator}get vertexShaderPreludeCode(){return VT.projectionMercator.vertexSource}get subdivisionGranularity(){return Db.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 Uv;a.emplaceBack(0,0),a.emplaceBack(I,0),a.emplaceBack(0,I),a.emplaceBack(I,I);let o=e.createVertexBuffer(a,eT.members),s=Xv.simpleSegment(0,0,4,2),c=new qv;c.emplaceBack(1,0,2),c.emplaceBack(1,2,3);let l=e.createIndexBuffer(c);return this._cachedMesh=new $w(o,l,s),this._cachedMesh}recalculate(){}hasTransition(){return!1}},KT=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=ch.number(e.top,t.top,n)),t.bottom!=null&&e.bottom!=null&&(this.bottom=ch.number(e.bottom,t.bottom,n)),t.left!=null&&e.left!=null&&(this.left=ch.number(e.left,t.left,n)),t.right!=null&&e.right!=null&&(this.right=ch.number(e.right,t.right,n)),this}getCenter(e,t){return new F(qf((this.left+e-this.right)/2,0,e),qf((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 qT(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 JT(e){return Math.max(0,Math.floor(e))}var YT=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 Fb(0,0),this._elevation=0,this._zoom=0,this._tileZoom=JT(this._zoom),this._scale=tp(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new KT,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=JT(this._zoom),this._scale=tp(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 KT(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;
Line truncated
|
||||
`),x=y.concat(VT.prelude.vertexSource,o.vertexSource,t.vertexSource).join(`
|
||||
`),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=Efe(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=yfe(e,w),this.projectionUniforms=wfe(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=Tfe(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 vfe,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 LE(e,t,n){let r=1/Tf(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 Ofe(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/Tf(r,1,n.transform.tileZoom),u_pixel_coord_upper:[u>>16,d>>16],u_pixel_coord_lower:[u&65535,d&65535]}}var kfe=(e,t)=>({u_lightpos:new oy(e,t.u_lightpos),u_lightpos_globe:new oy(e,t.u_lightpos_globe),u_lightintensity:new iy(e,t.u_lightintensity),u_lightcolor:new oy(e,t.u_lightcolor),u_vertical_gradient:new iy(e,t.u_vertical_gradient),u_opacity:new iy(e,t.u_opacity),u_fill_translate:new ay(e,t.u_fill_translate)}),Afe=(e,t)=>({u_lightpos:new oy(e,t.u_lightpos),u_lightpos_globe:new oy(e,t.u_lightpos_globe),u_lightintensity:new iy(e,t.u_lightintensity),u_lightcolor:new oy(e,t.u_lightcolor),u_vertical_gradient:new iy(e,t.u_vertical_gradient),u_height_factor:new iy(e,t.u_height_factor),u_opacity:new iy(e,t.u_opacity),u_fill_translate:new ay(e,t.u_fill_translate),u_image:new ry(e,t.u_image),u_texsize:new ay(e,t.u_texsize),u_pixel_coord_upper:new ay(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new ay(e,t.u_pixel_coord_lower),u_scale:new oy(e,t.u_scale),u_fade:new iy(e,t.u_fade)}),RE=(e,t,n,r)=>{let i=e.style.light,a=i.getCartesianPosition(),o=fd();i.properties.get(`anchor`)===`viewport`&&md(o,e.transform.bearingInRadians),qd(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}},jfe=(e,t,n,r,i,a,o)=>Yf(RE(e,t,n,r),LE(a,e,o),{u_height_factor:-(2**i.overscaledZ)/o.tileSize/8}),Mfe=(e,t)=>({u_fill_translate:new ay(e,t.u_fill_translate)}),Nfe=(e,t)=>({u_image:new ry(e,t.u_image),u_texsize:new ay(e,t.u_texsize),u_pixel_coord_upper:new ay(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new ay(e,t.u_pixel_coord_lower),u_scale:new oy(e,t.u_scale),u_fade:new iy(e,t.u_fade),u_fill_translate:new ay(e,t.u_fill_translate)}),Pfe=(e,t)=>({u_world:new ay(e,t.u_world),u_fill_translate:new ay(e,t.u_fill_translate)}),Ffe=(e,t)=>({u_world:new ay(e,t.u_world),u_image:new ry(e,t.u_image),u_texsi
Line truncated
|
||||
${e} <span></span>
|
||||
`,Dk().s[12]++,this._textEl=this._container.querySelector(`span`),Dk().s[13]++,this.updateZoomLevel()}addEventListeners(){Dk().f[4]++,Dk().s[14]++,this._map.on(`render`,()=>(Dk().f[5]++,Dk().s[15]++,this.updateZoomLevel()))}onRemove(){Dk().f[6]++,Dk().s[16]++,this._container.parentNode.removeChild(this._container),Dk().s[17]++,this._map=void 0}};function Ok(e,t,n){let r={id:[t,n,`circle`].join(`_`),source:t,type:`circle`,paint:{"circle-color":e,"circle-radius":2},filter:[`==`,`$type`,`Point`]};return n&&(r[`source-layer`]=n),r}function kk(e,t,n,r){let i={id:[n,r,`polygon`].join(`_`),source:n,type:`fill`,paint:{"fill-color":e,"fill-antialias":!0,"fill-outline-color":e},filter:[`==`,`$type`,`Polygon`]};return r&&(i[`source-layer`]=r),i}function Ak(e,t,n){let r={id:[t,n,`line`].join(`_`),source:t,layout:{"line-join":`round`,"line-cap":`round`},type:`line`,paint:{"line-color":e},filter:[`==`,`$type`,`LineString`]};return n&&(r[`source-layer`]=n),r}function jk(e,t){return{circle:t(e,.8),line:t(e,.6),polygon:t(e,.3),polygonOutline:t(e,.6),default:t(e,1)}}function C_e(e,t){let n=[],r=[],i=[];for(let a of Object.keys(e)){let o=e[a];if(!o||o.length===0){let e=jk(a,t);r.push(Ok(e.circle,a)),i.push(Ak(e.line,a)),n.push(kk(e.polygon,e.polygonOutline,a))}else for(let e of o){let o=jk(e,t);r.push(Ok(o.circle,a,e)),i.push(Ak(o.line,a,e)),n.push(kk(o.polygon,o.polygonOutline,a,e))}}return n.concat(i).concat(r)}function w_e(e,t,n){n=Object.assign({backgroundColor:`#fff`},n);let r={id:`background`,type:`background`,paint:{"background-color":n.backgroundColor}},i={};for(let t of Object.keys(e.sources)){let n=e.sources[t];(n.type===`vector`||n.type===`geojson`)&&(i[t]=n)}return Object.assign(e,{layers:[r].concat(t),sources:i})}var Mk={polygonLayer:kk,lineLayer:Ak,circleLayer:Ok,generateInspectStyle:w_e,generateColoredLayers:C_e};function Nk(){var e=`/home/runner/work/maputnik/maputnik/src/libs/highlight.ts`,t=`7421726a7afec07b60dcbf24ab0d23889ebbf613`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/libs/highlight.ts`,statementMap:{0:{start:{line:4,column:1},end:{line:8,column:2}},1:{start:{line:5,column:2},end:{line:5,column:31}},2:{start:{line:6,column:8},end:{line:8,column:2}},3:{start:{line:7,column:2},end:{line:7,column:28}},4:{start:{line:9,column:1},end:{line:13,column:2}},5:{start:{line:10,column:2},end:{line:10,column:26}},6:{start:{line:12,column:2},end:{line:12,column:21}},7:{start:{line:14,column:1},end:{line:14,column:28}},8:{start:{line:15,column:1},end:{line:15,column:10}},9:{start:{line:18,column:1},end:{line:18,column:83}},10:{start:{line:18,column:71},end:{line:18,column:83}},11:{start:{line:19,column:23},end:{line:19,column:50}},12:{start:{line:20,column:15},end:{line:20,column:51}},13:{start:{line:21,column:1},end:{line:23,column:2}},14:{start:{line:22,column:2},end:{line:22,column:102}},15:{start:{line:24,column:1},end:{line:26,column:2}},16:{start:{line:25,column:2},end:{line:25,column:94}},17:{start:{line:27,column:1},end:{line:29,column:2}},18:{start:{line:28,column:2},end:{line:28,column:92}},19:{start:{line:30,column:1},end:{line:30,column:13}}},fnMap:{0:{name:`changeLayer`,decl:{start:{line:3,column:9},end:{line:3,column:20}},loc:{start:{line:3,column:31},end:{line:16,column:1}},line:3},1:{name:`colorHighlightedLayer`,decl:{start:{line:17,column:16},end:{line:17,column:37}},loc:{start:{line:17,column:45},end:{line:31,column:1}},line:17}},branchMap:{0:{loc:{start:{line:4,column:1},end:{line:8,column:2}},type:`if`,locations:[{start:{line:4,column:1},end:{line:8,column:2}},{start:{line:6,column:8},end:{line:8,column:2}}],line:4},1:{loc:{start:{line:6,column:8},end:{line:8,column:2}},type:`if`,locations:[{start:{line:6,column:8},end:{line:8,column:2}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:6},2:{loc:{start:{line:9,column:1},end:{line:13,column:2}},type:`if`,locations:[{start:{line:9,column:1},end:{line:13,column:2}},{start:{line:11,column:8},end:{line:13,column:2}}],line:9},3:{loc:{start:{line:18,column:1},end:{line:18,column:83}},type:`if`,locations:[{start:{line:18,column:1},end:{line:18,column:83}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:18},4:{loc:{start:{line:18,column:5},end:{line:18,column:69}},type:`binary-expr`,locations:[{start:{line:18,column:5},end:{line:18,column:11}},{start:{line:18,column:15},end:{line:18,column:42}},{start:{line:18,column:46},end:{line:18,column:69}}],line:18},5:{loc:{start:{line:19,column:23},end:{line:19,column:50}},type:`binary-expr`,locations:[{start:{line:19,column:23},end:{line:19,column:44}},{start:{line:19,column:48},end:{line:19,column:50}}],line:19},6:{loc:{start:{line:21,column:1},end:{line:23,column:2}},type:`if`,locations:[{start:{line:21,column:1},end:{line:23,column:2}},{start:{line:void 0,column:void 0},end:{line:void 0,column:void 0}}],line:21},7:{loc:{start:{line:21,column:5},end:{line:21,column:61}},type:`binary-expr`,locations:[{start:{line:21,column
Line truncated
|
||||
${this._localize(`errorNoResults`)}</div>`;this._renderMessage(e)}_renderMessage(e){this._typeahead.update([]),this._typeahead.selected=null,this._typeahead.clear(),this._typeahead.renderError(e)}_localize(e){let t=F_e.language(this.options.language.split(`,`)[0]);return this.options.language&&rA?.[e][t]?rA[e][t]:rA[e].en}_fitBoundsForMarkers(){if(this._typeahead.data.length<1)return;let e=this._typeahead.data.filter(e=>typeof e!=`string`).slice(0,this.options.limit);if(this._clearEl.style.display=`none`,this.options.flyTo&&this._maplibregl&&this._map){let t=$k({},{padding:100},this.options.flyTo),n=new this._maplibregl.LngLatBounds;for(let t of e)`geometry`in t&&t.geometry?.type===`Point`&&n.extend(t.geometry.coordinates);this._map.fitBounds(n,t)}return e.length>0&&this._maplibregl&&this._handleResultMarkers(e),this}setInput(e){return this._inputEl.value=e,this._typeahead.selected=null,this._typeahead.clear(),e.length>=this.options.minLength&&this.options.showResultsWhileTyping&&this._geocode(e),this}setProximity(e){return this.options.proximity=e,this}getProximity(){return this.options.proximity}setRenderFunction(e){return e&&typeof e==`function`&&(this._typeahead.render=e),this}getRenderFunction(){return this._typeahead.render}setLanguage(e){return this.options.language=e||this.options.language||navigator.language,this}getLanguage(){return this.options.language}getZoom(){return this.options.zoom}setZoom(e){return this.options.zoom=e,this}getFlyTo(){return this.options.flyTo}setFlyTo(e){return this.options.flyTo=e,this}getPlaceholder(){return this.options.placeholder}setPlaceholder(e){return this.options.placeholder=e||this.options.placeholder||this._localize(`placeholder`),this._inputEl.placeholder=this.options.placeholder,this._inputEl.setAttribute(`aria-label`,this.options.placeholder),this}getBbox(){return this.options.bbox}setBbox(e){return this.options.bbox=e,this}getCountries(){return this.options.countries}setCountries(e){return this.options.countries=e,this}getTypes(){return this.options.types}setTypes(e){return this.options.types=e,this}getMinLength(){return this.options.minLength}setMinLength(e){return this.options.minLength=e,this._typeahead&&(this._typeahead.options.minLength=e),this}getLimit(){return this.options.limit}setLimit(e){return this.options.limit=e,this._typeahead&&(this._typeahead.options.limit=e),this}getFilter(){return this.options.filter}setFilter(e){return this.options.filter=e,this}setGeocoderApi(e){return this.geocoderApi=e,this}getGeocoderApi(){return this.geocoderApi}_handleMarker(e){if(!this._map)return;this._removeMarker();let t=$k({},{color:`#4668F2`},this.options.marker);this.mapMarker=new this._maplibregl.Marker(t);let n=null;if(this.options.popup){let t=$k({},{},this.options.popup);n=new this._maplibregl.Popup(t).setHTML(this.options.popupRender(e))}return e.center?(this.mapMarker.setLngLat(e.center).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(n)):e.geometry?.type===`Point`&&e.geometry.coordinates&&(this.mapMarker.setLngLat(e.geometry.coordinates).addTo(this._map),this.options.popup&&this.mapMarker.setPopup(n)),this}_removeMarker(){this.mapMarker&&=(this.mapMarker.remove(),null)}_handleResultMarkers(e){if(!this._map)return;this._removeResultMarkers();let t=$k({},{color:`#4668F2`},this.options.showResultMarkers);for(let n of e){let e;if(this.options.showResultMarkers){this.options.showResultMarkers&&this.options.showResultMarkers.element&&(e=this.options.showResultMarkers.element.cloneNode(!0),t=$k(t,{element:e}));let r=new this._maplibregl.Marker($k({},t,{element:e})),i;if(this.options.popup){let e=$k({},{},this.options.popup);i=new this._maplibregl.Popup(e).setHTML(this.options.popupRender(n))}n.center?(r.setLngLat(n.center).addTo(this._map),this.options.popup&&r.setPopup(i)):n.geometry&&n.geometry.type&&n.geometry.type===`Point`&&n.geometry.coordinates&&(r.setLngLat(n.geometry.coordinates).addTo(this._map),this.options.popup&&r.setPopup(i)),this.resultMarkers.push(r)}}return this}_removeResultMarkers(){this.resultMarkers&&this.resultMarkers.length>0&&(this.resultMarkers.forEach(function(e){e.remove()}),this.resultMarkers=[])}on(e,t){return this._eventEmitter.on(e,t),this}once(e){return new Promise(t=>{this._eventEmitter.once(e,t)})}off(e,t){return this._eventEmitter.removeListener(e,t),this}};function B(){var e=`/home/runner/work/maputnik/maputnik/src/components/MapMaplibreGl.tsx`,t=`de08aa65bb219afae881e9eea5c66dd282c5367d`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/components/MapMaplibreGl.tsx`,statementMap:{0:{start:{line:21,column:25},end:{line:25,column:2}},1:{start:{line:26,column:15},end:{line:26,column:54}},2:{start:{line:27,column:1},end:{line:29,column:2}},3:{start:{line:28,column:2},end:{line:28,column:28}},4:{start:{line:30,column:17},end:{line:30,column:19}},5:{start:{line:31,column:1},end:{line:36,column:4}},6:{start:{line:32,column:17},end:{line:32,column:51}},7:{start:{line:33,column:2},eLine truncated
|
||||
`).reduce((t,n)=>Math.max(t,xF(e,n)),0);return n[t]=r,r}function Jxe(e,t){let n=[],r=[],i=[],a=0,o=0,s=0,c=0;for(let l=0,u=t.length;l<=u;l+=2){let d=t[l];if(d===`
|
||||
`||l===u){a=Math.max(a,o),i.push(o),o=0,s+=c,c=0;continue}let f=t[l+1]||e.font,p=xF(f,d);n.push(p),o+=p;let m=qxe(f);r.push(m),c=Math.max(c,m)}return{width:a,height:s,widths:n,heights:r,lineWidths:i}}function Yxe(e,t,n,r,i,a,o,s,c,l,u){e.save(),n!==1&&(e.globalAlpha===void 0?e.globalAlpha=e=>e.globalAlpha*=n:e.globalAlpha*=n),t&&e.transform.apply(e,t),r.contextInstructions?(e.translate(c,l),e.scale(u[0],u[1]),Xxe(r,e)):u[0]<0||u[1]<0?(e.translate(c,l),e.scale(u[0],u[1]),e.drawImage(r,i,a,o,s,0,0,o,s)):e.drawImage(r,i,a,o,s,c,l,o*u[0],s*u[1]),e.restore()}function Xxe(e,t){let n=e.contextInstructions;for(let e=0,r=n.length;e<r;e+=2)Array.isArray(n[e+1])?t[n[e]].apply(t,n[e+1]):t[n[e]]=n[e+1]}var CF=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=CP(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return TA()}getImage(e){return TA()}getHitDetectionImage(){return TA()}getPixelRatio(e){return 1}getImageState(){return TA()}getImageSize(){return TA()}getOrigin(){return TA()}getSize(){return TA()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=CP(e)}listenImageChange(e){TA()}load(){TA()}unlistenImageChange(e){TA()}ready(){return Promise.resolve()}},wF=class e extends CF{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0&&e.rotateWithView,rotation:e.rotation===void 0?0:e.rotation,scale:e.scale===void 0?1:e.scale,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill===void 0?null:e.fill,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle===void 0?0:e.angle,this.stroke_=e.stroke===void 0?null:e.stroke,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?tF.LOADING:tF.LOADED,this.imageState_===tF.LOADING&&this.ready().then(()=>this.imageState_=tF.LOADED),this.render()}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){let e=this.size_,t=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-t[0]/n[0],e[1]/2+t[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||=this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.fill_?.getKey(),n=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(`,`),r=iF.get(n,null)?.getImage(1);if(!r){let t=this.renderOptions_,i=Math.ceil(t.size*e),a=xN(i,i);this.draw_(t,a,e),r=a.canvas;let o=new oF(r,void 0,null,tF.LOADED,null);iF.set(n,null,o),createImageBitmap(r).then(e=>{o.setImage(e)})}return r}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}setRadius(e){this.radius!==e&&(this.radius=e,this.render())}getRadius2(){return this.radius2_}setRadius2(e){this.radius2_!==e&&(this.radius2_=e,this.render())}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,n){if(t===0||this.points_===1/0||e!==`bevel`&&e!==`miter`)return t;let r=this.radius,i=this.radius2_===void 0?r:this.radius2_;if(r<i){let e=r;r=i,i=e}let a=this.radius2_===void 0?this.points_:this.points_*2,o=2*Math.PI/a,s=i*Math.sin(o),c=Math.sqrt(i*i-s*s),l=r-c,u=Math.sqrt(s*s+l*l),d=u/s;if(e===`miter`&&d<=n)return d*t;let f=t/2/d,p=t/2*(l/u),m=Math.sqrt((r+f)*(r+f)+p*p)-r;if(this.radius2_===void 0||e===`bevel`)return m*2;let h=r*Math.sin(o),g=Math.sqrt(r*r-h*h),_=i-g,v=Math.sqrt(h*h+_*_)/h;if(v<=n){let e=v*t/2-i-r;return 2*Math.max(m,e)}return m
Line truncated
|
||||
`,``),e.push(t,``),e}function RCe(e,t,n){return n%2==0&&(e+=t),e}var zCe=class{constructor(e,t,n,r,i){this.overlaps=n,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=yM(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=i?new zI:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,n,r){let i=e+t+n+r;if(this.labels_[i])return this.labels_[i];let a=r?this.strokeStates[r]:null,o=n?this.fillStates[n]:null,s=this.textStates[t],c=this.pixelRatio,l=[s.scale[0]*c,s.scale[1]*c],u=s.justify?rL[s.justify]:hL(Array.isArray(e)?e[0]:e,s.textAlign||`center`),d=r&&a.lineWidth?a.lineWidth:0,f=Array.isArray(e)?e:String(e).split(`
|
||||
`).reduce(LCe,[]),{width:p,height:m,widths:h,heights:g,lineWidths:_}=Jxe(s,f),v=p+d,y=[],b=(v+2)*l[0],x=(m+d)*l[1],S={width:b<0?Math.floor(b):Math.ceil(b),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:y};(l[0]!=1||l[1]!=1)&&y.push(`scale`,l),r&&(y.push(`strokeStyle`,a.strokeStyle),y.push(`lineWidth`,d),y.push(`lineCap`,a.lineCap),y.push(`lineJoin`,a.lineJoin),y.push(`miterLimit`,a.miterLimit),y.push(`setLineDash`,[a.lineDash]),y.push(`lineDashOffset`,a.lineDashOffset)),n&&y.push(`fillStyle`,o.fillStyle),y.push(`textBaseline`,`middle`),y.push(`textAlign`,`center`);let C=.5-u,w=u*v+C*d,T=[],E=[],D=0,O=0,k=0,A=0,ee;for(let e=0,t=f.length;e<t;e+=2){let t=f[e];if(t===`
|
||||
`){O+=D,D=0,w=u*v+C*d,++A;continue}let i=f[e+1]||s.font;i!==ee&&(r&&T.push(`font`,i),n&&E.push(`font`,i),ee=i),D=Math.max(D,g[k]);let a=[t,w+C*h[k]+u*(h[k]-_[A]),.5*(d+D)+O];w+=h[k],r&&T.push(`strokeText`,a),n&&E.push(`fillText`,a),++k}return Array.prototype.push.apply(y,T),Array.prototype.push.apply(y,E),this.labels_[i]=S,S}replayTextBackground_(e,t,n,r,i,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,t),a&&(this.alignAndScaleFill_=a[2],e.fillStyle=a[1],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())}calculateImageOrLabelDimensions_(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){o*=d[0],s*=d[1];let g=n-o,_=r-s,v=i+c>e?e-c:i,y=a+l>t?t-l:a,b=p[3]+v*d[0]+p[1],x=p[0]+y*d[1]+p[2],S=g-p[3],C=_-p[0];(m||u!==0)&&(lL[0]=S,fL[0]=S,lL[1]=C,uL[1]=C,uL[0]=S+b,dL[0]=uL[0],dL[1]=C+x,fL[1]=dL[1]);let w;return u===0?hj(Math.min(S,S+b),Math.min(C,C+x),Math.max(S,S+b),Math.max(C,C+x),cL):(w=wM(yM(),n,r,1,1,u,-n,-r),SM(w,lL),SM(w,uL),SM(w,dL),SM(w,fL),hj(Math.min(lL[0],uL[0],dL[0],fL[0]),Math.min(lL[1],uL[1],dL[1],fL[1]),Math.max(lL[0],uL[0],dL[0],fL[0]),Math.max(lL[1],uL[1],dL[1],fL[1]),cL)),f&&(g=Math.round(g),_=Math.round(_)),{drawImageX:g,drawImageY:_,drawImageW:v,drawImageH:y,originX:c,originY:l,declutterBox:{minX:cL[0],minY:cL[1],maxX:cL[2],maxY:cL[3],value:h},canvasTransform:w,scale:d}}replayImageOrLabel_(e,t,n,r,i,a,o){let s=!!(a||o),c=r.declutterBox,l=o?o[2]*r.scale[0]/2:0;return c.minX-l<=t[0]&&c.maxX+l>=0&&c.minY-l<=t[1]&&c.maxY+l>=0&&(s&&this.replayTextBackground_(e,lL,uL,dL,fL,a,o),Yxe(e,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){let t=this.alignAndScaleFill_;if(t){let n=SM(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),t!==1&&e.scale(t,t)}e.fill(),t&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],t[1]&&(e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.lineDashOffset=t[7],e.setLineDash(t[6]))}drawLabelWithPointPlacement_(e,t,n,r){let i=this.textStates[t],a=this.createLabel(e,t,r,n),o=this.strokeStates[n],s=this.pixelRatio,c=hL(Array.isArray(e)?e[0]:e,i.textAlign||`center`),l=rL[i.textBaseline||`middle`],u=o&&o.lineWidth?o.lineWidth:0;return{label:a,anchorX:c*(a.width/s-2*i.scale[0])+2*(.5-c)*u,anchorY:l*a.height/s+2*(.5-l)*u}}execute_(e,t,n,r,i,a,o,s){let c=this.zIndexContext_,l;this.pixelCoordinates_&&gA(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||=[],l=EM(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Aye(this.renderedTransform_,n));let u=0,d=r.length,f=0,p,m=[],h,g,_,v,y,b,x,S,C,w,T,E,D,O=0,k=0,A=this.coordinateCache_,ee=this.viewRotation_,j=Math.round(Math.atan2(-n[1],n[0])*0xe8d4a51000)/0xe8d4a51000,te={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:ee},ne=this.instructions!=r||this.overlaps?0:200,re,M,ie,ae;for(;u<d;){let n=r[u];switch(n[0]){case JI.BEGIN_GEOMETRY:re=n[1],ae=n[3],re.getGeometry()?o!==void 0&&!Aj(o,ae.getExtent())?u=n[2]+1:++u:u=n[2],c&&(c.zIndex=n[4]);break;case JI.BEGIN_PATH:O>ne&&(this.fill_(e),O=0),k>ne&&(e.stroke(),k=0),!O&&!k&&(e.beginPath(),y=NaN,b=NaN),++u;break;case JI.CIRCLE:f=n[1],_=n[2]??0;let r=l[f],d=l[f+1],oe=l[f+2]-_,se=l[f+3]-_,ce=oe-r,le=se-d,ue=Math.sqrt(ce*ce+le*le);e.moveTo(r+ue,d),e.arc(r,d,ue,0,2*Math.PI,!0),++u;break;case JI.CLOSE_PATH:e.closePath(),++u;break;case JI.CUSTOM:f=n[1],p=n[2];let de=n[3],fe=n[4],pe=n[5];te.geometry=de,te.feature=re,u in A||(A[u]=[]);let me=A[u];pe?pe(l,f,p,2,me):(me[0]=l[f],me[1]=l[f+1],me.length=2),c&&(c.zIndex=n[6]),fe(me,te),++u;break;case JI.DRAW_IMAGE:f=n[1],p=n[2],C=n[3],h=n[4],g=n[5];let he=n[6],ge=n[7],_e=n[8],ve=n[9],ye=n[10],be=n[11],xe=n[12],Se=n[13];v=n[14]||`declutter`;let Ce=n[15];if(!C&&n.length>=20){w=n[19],T=n[20],E=n[21],D=n[22];let e=this.drawLabelWithPointPlacement_(w,T,E,D);C=e.label,n[3]=C;let t=n[23];h=(e.anchorX-t)*this.pixelRatio,n[4]=h;let r=n[24];g=(e.anchorY-r)*this.pixelRatio,n[5]=g,he=C.height,n[6]=he,Se=C.width,n[13]=Se}let we;n.length>25&&(we=n[25]);let Te,Ee,De;n.length>17?(Te=n[16],Ee=n[17],De=n[18]):(Te=hF,Ee=null,De=null),ye&&j?be+=ee:!ye&&!j&&(be-=ee);let Oe=0;for(;f<p;f+=2){if(we&&we[Oe++]<Se/this.pixelRatio)continue;let n=this.calculateImageOrLabelDimensions_(C.width,C.height,l[f],l[f+1],Se,he,h,g,_e,ve,be,xe,i,Te,!!Ee||!!De,re),r=[e,t,C,n,ge,Ee,De];if(s){let e,t,i;if(Ce){let n=p-f;if(!Ce[n]){Ce[n]={args:r,declutterMode:v};continue}let a=Ce[n];e=a.args,t=a.declutterMode,delete Ce[n],i=pL(e)}let a,o;if(e&&(t!==`declutter`||!s.collides(i))&&(a=!0),(v!==`declutter`||!s.collides(n.declutterBox))&&(o=!0),t===`declutter`&&v===`declutter`){let e=a&&o;a=e,o=e}a&&(t!==`none`&&s.insert(i),this.replayImageOrLabel_.apply(this,e)),o&&(v!==`none`&&s.insert(n.declutterBox),this.replayImageOrLabel_.apply(this,r))}else this.replayImageOrLabel_.apply(this,r)}++u;break;case JI.DRAW_CHARS:let ke=n[1],Ae=n[2],je=n[3],Me=n[4];D=n[5];let Ne=n
Line truncated
|
||||
`);this.generateTileUrlFunction_?this.setTileUrlFunction(HL(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}},ywe=class extends GL{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:bwe,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate===void 0||e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass===void 0?aCe:e.tileClass,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!cM(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||cM(t,e)))return this.tileGrid;let n=EA(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=RL(e)),this.tileGridForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,l=new this.tileClass(o,c===void 0?UA.EMPTY:UA.IDLE,c===void 0?``:c,{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return l.key=a,l.addEventListener(dA.CHANGE,this.handleTileChange.bind(this)),l}getTile(e,t,n,r,i,a){let o=this.getProjection();if(!o||!i||cM(o,i))return this.getTileInternal(e,t,n,r,o||i);let s=[e,t,n],c=this.getKey(),l=new hCe(o,this.getTileGridForProjection(o),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i),this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return l.key=c,l}getTileInternal(e,t,n,r,i,a){let o=this.getKey(),s=RI(this,o,e,t,n);if(a&&a.containsKey(s))return a.get(s);let c=this.createTile_(e,t,n,r,i,o);return a?.set(s,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=rM(e);if(n){let e=EA(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function bwe(e,t){if(LA){let n=e.getCrossOrigin(),r=`same-origin`,i=`same-origin`;n===`anonymous`||n===``?(r=`cors`,i=`omit`):n===`use-credentials`&&(r=`cors`,i=`include`);let a={mode:r,credentials:i,referrerPolicy:e.getReferrerPolicy()};fetch(t,a).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()}).then(e=>createImageBitmap(e)).then(t=>{let n=e.getImage();n.width=t.width,n.height=t.height,n.getContext(`2d`).drawImage(t,0,0),t.close?.(),n.dispatchEvent(new Event(`load`))}).catch(()=>{e.getImage().dispatchEvent(new Event(`error`))});return}e.getImage().src=t}var KL=class extends ywe{constructor(e){if(super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:rM(`EPSG:3857`),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:`loading`,tileLoadFunction:e.tileLoadFunction,wrapX:e.wrapX===void 0||e.wrapX,transition:e.transition,zDirection:e.zDirection}),this.tileJSON_=null,this.tileSize_=e.tileSize,e.url){if(e.jsonp)owe(e.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{let t=new XMLHttpRequest;t.addEventListener(`load`,this.onXHRLoad_.bind(this)),t.addEventListener(`error`,this.onXHRError_.bind(this)),t.open(`GET`,e.url),t.send()}}else if(e.tileJSON)this.handleTileJSONResponse(e.tileJSON);else throw Error("Either `url` or `tileJSON` options must be provided")}onXHRLoad_(e){let t=e.target;if(!t.status||t.status>=200&&t.status<300){let e;try{e=JSON.parse(t.responseText)}catch{this.handleTileJSONError();return}this.handleTileJSONResponse(e)}else this.handleTileJSONError()}onXHRError_(e){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(e){let t=rM(`EPSG:4326`),n=this.getProjection(),r;if(e.bounds!==void 0){let i=lM(t,n);r=vve(e.bounds,i)}let i=VL(n),a=e.minzoom||0,o=zL({extent:i,maxZoom:e.maxzoom||22,minZoom:a,tileSize:this.tileSize_});if(this.tileGrid=o,this.tileUrlFunction=HL(e.tiles,o),e.attribution&&!this.getAttributions()){let t=r===void 0?i:r;this.setAttributions(function(n){return Aj(t,n.extent)?[e.attribution]:null})}this.tileJSON_=e,this.setState(`ready`)}handleTileJSONError(){this.setState(`error`)}},xwe=!1;function qL(e,t,n,r,i,a,o){let s=new XMLHttpRequest;s.open(`GET`,typeof e==`function`?e(n,r,i):e,!0),t.getType()==`arraybuffer`&&(s.responseType=`arraybuffer`),s.withCredentials=xwe,s.onload=function(e){if(!s.status||s.status>=200&&s.status<300){let e=
Line truncated
|
||||
`),`binary`).toString(`base64`):URL.createObjectURL(new Blob(n,{type:`text/javascript`})));return r.addEventListener(`message`,t),r}function Nwe(e,t){let n=gR(e.operation),r=!1;return{postMessage:function(e){setTimeout(function(){r||t({data:{buffer:n(e),meta:e.meta}})},0)},terminate:function(){r=!0}}}var Pwe=class extends fA{constructor(e){super(),this.imageOps_=!!e.imageOps;let t;t=e.threads===0?0:this.imageOps_?1:e.threads||1;let n=Array(t);if(t)for(let r=0;r<t;++r)n[r]=Mwe(e,this.onWorkerMessage_.bind(this,r));else n[0]=Nwe(e,this.onWorkerMessage_.bind(this,0));this.workers_=n,this.queue_=[],this.maxQueueLength_=e.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(e,t,n){this.enqueue_({inputs:e,meta:t,callback:n}),this.dispatch_()}enqueue_(e){for(this.queue_.push(e);this.queue_.length>this.maxQueueLength_;)this.queue_.shift().callback(null,null)}dispatch_(){if(this.running_||this.queue_.length===0)return;let e=this.queue_.shift();this.job_=e;let t=e.inputs[0].width,n=e.inputs[0].height,r=e.inputs.map(function(e){return e.data.buffer}),i=this.workers_.length;if(this.running_=i,i===1){this.workers_[0].postMessage({buffers:r,meta:e.meta,imageOps:this.imageOps_,width:t,height:n},r);return}let a=e.inputs[0].data.length,o=4*Math.ceil(a/4/i);for(let a=0;a<i;++a){let i=a*o,s=[];for(let e=0,t=r.length;e<t;++e)s.push(r[e].slice(i,i+o));this.workers_[a].postMessage({buffers:s,meta:e.meta,imageOps:this.imageOps_,width:t,height:n},s)}}onWorkerMessage_(e,t){this.disposed||(this.dataLookup_[e]=t.data,--this.running_,this.running_===0&&this.resolveJob_())}resolveJob_(){let e=this.job_,t=this.workers_.length,n,r;if(t===1)n=new Uint8ClampedArray(this.dataLookup_[0].buffer),r=this.dataLookup_[0].meta;else{let i=e.inputs[0].data.length;n=new Uint8ClampedArray(i),r=Array(t);let a=4*Math.ceil(i/4/t);for(let e=0;e<t;++e){let t=this.dataLookup_[e].buffer,i=e*a;n.set(new Uint8ClampedArray(t),i),r[e]=this.dataLookup_[e].meta}}this.job_=null,this.dataLookup_={},e.callback(null,new ImageData(n,e.inputs[0].width,e.inputs[0].height),r),this.dispatch_()}disposeInternal(){for(let e=0;e<this.workers_.length;++e)this.workers_[e].terminate();this.workers_.length=0}},_R={BEFOREOPERATIONS:`beforeoperations`,AFTEROPERATIONS:`afteroperations`},vR=class extends SA{constructor(e,t,n){super(e),this.extent=t.extent,this.resolution=t.viewState.resolution/t.pixelRatio,this.data=n}},yR=class extends hR{constructor(e){super({interpolate:e.interpolate,projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=e.operationType===void 0?`pixel`:e.operationType,this.threads_=e.threads===void 0?1:e.threads,this.layers_=Lwe(e.sources);let t=this.changed.bind(this);for(let e=0,n=this.layers_.length;e<n;++e)this.layers_[e].addEventListener(dA.CHANGE,t);this.useResolutions_=e.resolutions!==null,this.tileQueue_=new GA(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:yM(),declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:Iwe(this.layers_),pixelRatio:1,pixelToCoordinateTransform:yM(),postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:EA(this),renderTargets:{}},this.setAttributions(function(t){let n=[];for(let r=0,i=e.sources.length;r<i;++r){let i=e.sources[r],a=i instanceof NL?i:i.getSource();if(!a)continue;let o=a.getAttributions()?.(t);typeof o==`string`?n.push(o):o!==void 0&&n.push(...o)}return n}),e.operation!==void 0&&this.setOperation(e.operation,e.lib)}setOperation(e,t){this.processor_&&this.processor_.dispose(),this.processor_=new Pwe({operation:e,imageOps:this.operationType_===`image`,queue:1,lib:t,threads:this.threads_}),this.changed()}updateFrameState_(e,t,n){let r=Object.assign({},this.frameState_);r.viewState=Object.assign({},r.viewState);let i=Cj(e);r.size[0]=Math.ceil(kj(e)/t),r.size[1]=Math.ceil(Tj(e)/t),r.extent=[i[0]-r.size[0]*t/2,i[1]-r.size[1]*t/2,i[0]+r.size[0]*t/2,i[1]+r.size[1]*t/2],r.time=Date.now();let a=r.viewState;return a.center=i,a.projection=n,a.resolution=t,r}allSourcesReady_(){let e=!0,t;for(let n=0,r=this.layers_.length;n<r;++n)if(t=this.layers_[n].getSource(),!t||t.getState()!==`ready`){e=!1;break}return e}getImage(e,t,n,r){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),t=this.findNearestResolution(t);let i=this.updateFrameState_(e,t,r);if(this.requestedFrameState_=i,this.renderedImageCanvas_){let e=this.renderedImageCanvas_.getResolution(),n=this.renderedImageCanvas_.getExtent();(t!==e||!vj(i.extent,n))&&(this.renderedImageCanvas_=null)}return(!this.renderedImageCanvas_||this.getRevision()!==this.renderedRevision_)&&this.processSources_(),i.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){let e=this.requestedFrameState_,t=this.layers_.length,n=Array(t),r=Arr
Line truncated
|
||||
`),i=Kwe.slice(0,Math.round(t/.1));for(let e=0,t=r.length;e<t;++e)e>0&&(n+=`
|
||||
`),n+=r[e].split(``).join(i);return n}return e}var GR;function KR(){return GR||=PR(1,1).getContext(`2d`),GR}function qwe(e,t){if(/\d+ \d+/.test(e)){let[n,r]=e.split(` `).map(Number);return n<=t&&t<=r}return e==t}function qR(e,t){return KR().measureText(e).width+(e.length-1)*t}var JR={};gF.on(`propertychange`,()=>{for(let e in JR)delete JR[e]});function YR(e,t,n,r){if(e.indexOf(`
|
||||
`)!==-1){let i=e.split(`
|
||||
`),a=[];for(let e=0,o=i.length;e<o;++e)a.push(YR(i[e],t,n,r));return a.join(`
|
||||
`)}let i=n+`,`+t+`,`+e+`,`+r,a=JR[i];if(!a){let o=e.split(` `);if(o.length>1){let e=KR();e.font=t;let i=e.measureText(`M`).width*n,s=``,c=[];for(let e=0,t=o.length;e<t;++e){let t=o[e],n=s+(s?` `:``)+t;qR(n,r)<=i?s=n:(s&&c.push(s),s=t)}s&&c.push(s);for(let e=0,t=c.length;e<t&&t>1;++e){let n=c[e];if(qR(n,r)<i*.35){let i=e>0?qR(c[e-1],r):1/0,a=e<t-1?qR(c[e+1],r):1/0;c.splice(e,1),--t,i<a?(c[e-1]+=` `+n,--e):c[e]=n+` `+c[e]}}for(let e=0,t=c.length-1;e<t;++e){let n=c[e],a=c[e+1];if(qR(n,r)>i*.7&&qR(a,r)<i*.6){let o=n.split(` `),s=o.pop();qR(s,r)<i*.2&&(c[e]=o.join(` `),c[e+1]=s+` `+a),--t}}a=c.join(`
|
||||
`)}else a=e;a=WR(a,r),JR[i]=a}return a}var Jwe=[`Arial`,`Courier New`,`Times New Roman`,`Verdana`,`sans-serif`,`serif`,`monospace`,`cursive`,`fantasy`],XR={};function Ywe(e,t=`https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css`){if(LA)return e;let n;for(let t=0,r=e.length;t<r;++t){let r=e[t];if(r in XR)continue;XR[r]=!0;let i=TR(r,16).split(` `);n||=[],n.push([i.slice(3).join(` `).replace(/"/g,``),i[1],i[0]])}return n&&(async()=>{await document.fonts.ready;for(let e=0,r=n.length;e<r;++e){let r=n[e],i=r[0];if(Jwe.includes(i))continue;let a=r[1],o=r[2];if(!(await document.fonts.load(`${o} ${a} 16px "${i}"`)).some(e=>e.family.replace(/^['"]|['"]$/g,``).toLowerCase()===i.toLowerCase()&&qwe(e.weight,a)&&e.style===o)){let e=t.replace(`{font-family}`,i.replace(/ /g,`-`).toLowerCase()).replace(`{Font+Family}`,i.replace(/ /g,`+`)).replace(`{fontweight}`,a).replace(`{-fontstyle}`,o.replace(`normal`,``).replace(/(.+)/,`-$1`)).replace(`{fontstyle}`,o);if(!document.querySelector(`link[href="`+e+`"]`)){let t=document.createElement(`link`);t.href=e,t.rel=`stylesheet`,document.head.appendChild(t)}}}})(),e}var Xwe={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},Zwe={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},ZR=function(e,t,n){let r=Hc(e,t,n);if(r.result===`error`){let i=iR(e);i!==e&&(r=Hc(i,t,n))}if(r.result===`error`){let t=r.value[0];return console.error(`Error parsing expression:`,e,t.key,t.message),{evaluate:()=>n.default}}return r.value},QR,$R;function ez(e,t,n,r,i,a){let o=e.id;i||(i={},console.warn(`No functionCache provided to getValue()`)),i[o]||(i[o]={});let s=i[o];if(!s[n]){let r=(e[t]||DR)[n],i=`layers[${o}].${t}.${n}`,a=mi[`${t}_${e.type}`]&&mi[`${t}_${e.type}`][n];r===void 0&&a&&(r=a.default);let c=Lc(r);if(!c&&xc(r)&&(r=xl(r,a),c=!0),c){let e=ZR(r,i,a);s[n]=e.evaluate.bind(e)}else{let e=a?a.type:typeof r;(e===`color`||e===`colorArray`)&&(r=ka.parse(r));let t=!1;if(e===`array`)for(let e=0;e<r.length;++e){let n=r[e];if(Lc(n)||xc(n)){t=!0;break}}if(t){let e=Object.assign({},a,{type:a.value}),t=[];for(let n=0;n<r.length;++n){let a=r[n];if(!Lc(a)&&xc(a)&&(a=xl(a,e)),Lc(a)){let r=ZR(a,`${i}[${n}]`,e);t.push(r.evaluate.bind(r))}else t.push(function(){return a})}s[n]=function(e,n,r){let i=[];for(let a=0;a<t.length;++a)i[a]=t[a](e,n,r);return i}}else s[n]=function(){return r}}}return s[n](oR,r,a)}function tz(e,t,n,r){return ez(e,`layout`,`${n}-allow-overlap`,t,r)?ez(e,`layout`,`${n}-ignore-placement`,t,r)?`none`:`obstacle`:`declutter`}function Qwe(e,t,n,r){if(r||console.warn(`No filterCache provided to evaluateFilter()`),!(e in r))try{r[e]=ol(t,`layers[${e}].filter`).filter}catch(t){console.warn(`Filter will evaluate to false: `+t.message),r[e]=function(){return!1}}return r[e](oR,n)}function nz(e,t){if(e){if(e.a===0||t===0)return;let n=e.a;return t=t===void 0?1:t,n===0?`transparent`:`rgba(`+Math.round(e.r*255/n)+`,`+Math.round(e.g*255/n)+`,`+Math.round(e.b*255/n)+`,`+n*t+`)`}return e}var $we=/\{[^{}}]*\}/g;function rz(e,t){return e.replace($we,function(e){return t[e.slice(1,-1)]||``})}function iz(e,t){let n=e.split(`:`)[0];return n===e&&(n=`default`),t[n]}var eTe={};function tTe(e,t,n,r=NR,i=void 0,a=void 0,o=void 0,s=void 0){if(typeof t==`string`&&(t=JSON.parse(t)),t.schema)for(let e in t.schema){let n=t.schema[e];`default`in n&&(aR[e]=n.default)}if(t.version!=8)throw Error(`glStyle version 8 required.`);eTe[Uwe(t,e)]=Array.from(arguments);let c={};(typeof a==`string`||a instanceof Request||a instanceof Response||a instanceof Promise)&&(a={default:a});for(let t in a){let n=a[t];xA(()=>n).then(async n=>{let r;if(typeof Image<`u`){let i=new Image;if(typeof n==`string`)i.crossOrigin=`anonymous`,i.src=n;else{let e;n instanceof Request?e=await fetch(n):n instanceof Response&&(e=n);let t=await e.blob();r=URL.createObjectURL(t),i.src=r}i.addEventListener(`load`,function n(){i.removeEventListener(`load`,n),c[t]={image:i,size:[i.width,i.height]},e.changed(),r&&URL.revokeObjectURL(r)}),i.addEventListener(`error`,function e(){URL.revokeObjectURL(r),i.removeEventListener(`error`,e)})}else if(typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope){let e=self;e.postMessage({action:`loadImage`,src:n}),e.addEventListener(`message`,function(e){e.data.action===`imageLoaded`&&e.data.src===n&&(c[t]={image:e.data.image,size:[e.data.image.width,e.data.image.height]})})}})}let l=_i(t.layers),u={},d=[],f={},p={},m=jR(t),h=Wwe(t),g;for(let e=0,r=l.length;e<r;++e){let r=l[e],i=r.id;if(typeof n==`string`&&r.source==n||Array.isArray(n)&&n.indexOf(i)!==-1){let n=r[`source-layer`];if(!g){g=r.source;let e=t.sources[g];if(!e)throw Error(`Source "${g}" is not defined`);let n=e.type;if(n!==`vector`&&n!==`geojson`)throw Error(`Source "${g}" is not of type "vector" or "geojson", but "${n}"`)}else if(r.source!==g)throw Error(`Layer "${i}" does not use source "${g}`);let a=u[n];a||(a
Line truncated
|
||||
`)return t.push(`
|
||||
`,``),t;if(x==2)return t.push(WR(s,ae),a),t;s=YR(s,a,oe,ae).split(`
|
||||
`);for(let e=0,n=s.length;e<n;++e)e>0&&t.push(`
|
||||
`,``),t.push(s[e],a);return t},[]):rz(n,g).trim(),l=ez(d,`paint`,`text-opacity`,C,m,w)}if(ne&&l&&!te){O||(++T,b=_[T],(!b||!b.getText()||b.getFill()||b.getStroke())&&(b=new AF,_[T]=b),b.setImage(void 0),b.setGeometry(void 0));let e=tz(d,C,`text`,m);b.getText()||b.setText(k),k=b.getText(),(!k||`getDeclutterMode`in k&&k.getDeclutterMode()!==e)&&(k=new PF({padding:[2,2,2,2],declutterMode:e}),b.setText(k));let t=ez(d,`layout`,`text-transform`,C,m,w);t==`uppercase`?ne=Array.isArray(ne)?ne.map((e,t)=>t%2?e:e.toUpperCase()):ne.toUpperCase():t==`lowercase`&&(ne=Array.isArray(ne)?ne.map((e,t)=>t%2?e:e.toLowerCase()):ne.toLowerCase());let n=Array.isArray(ne)?ne:x==2?WR(ne,ae):YR(ne,re,oe,ae);if(k.setText(n),k.setFont(re),k.setRotation(MR(ez(d,`layout`,`text-rotate`,C,m,w))),typeof k.setKeepUpright==`function`){let e=ez(d,`layout`,`text-keep-upright`,C,m,w);k.setKeepUpright(e)}let r=ez(d,`layout`,`text-anchor`,C,m,w),i=O||x==1?`point`:ez(d,`layout`,`symbol-placement`,C,m,w),a;if(i===`line-center`?(k.setPlacement(`line`),a=`center`):k.setPlacement(i),i===`line`&&typeof k.setRepeat==`function`){let e=ez(d,`layout`,`symbol-spacing`,C,m,w);k.setRepeat(e*2)}k.setOverflow(i===`point`);let o=ez(d,`paint`,`text-halo-width`,C,m,w),s=ez(d,`layout`,`text-offset`,C,m,w),c=ez(d,`paint`,`text-translate`,C,m,w),u=0,f=0;if(i==`point`){a=`center`,r.indexOf(`left`)===-1?r.indexOf(`right`)!==-1&&(a=`right`,f=-o):(a=`left`,f=o);let e=ez(d,`layout`,`text-rotation-alignment`,C,m,w);k.setRotateWithView(e==`map`)}else k.setMaxAngle(MR(ez(d,`layout`,`text-max-angle`,C,m,w))*ne.length/n.length),k.setRotateWithView(!1);k.setTextAlign(a);let p=`middle`;r.indexOf(`bottom`)==0?(p=`bottom`,u=-o-.5*(M-1)*ie):r.indexOf(`top`)==0&&(p=`top`,u=o+.5*(M-1)*ie),k.setTextBaseline(p);let h=ez(d,`layout`,`text-justify`,C,m,w);k.setJustify(h===`auto`?void 0:h),k.setOffsetX(s[0]*ie+f+c[0]),k.setOffsetY(s[1]*ie+u+c[1]);let g=k.getFill()||new EF;g.setColor(nz(ez(d,`paint`,`text-color`,C,m,w),l)),k.setFill(g);let v=nz(ez(d,`paint`,`text-halo-color`,C,m,w),l);if(v&&o>0){let e=k.getStroke()||new kF;e.setColor(v),o*=2;let t=.5*ie;e.setWidth(o<=t?o:t),k.setStroke(e)}else k.setStroke(void 0);let y=ez(d,`layout`,`text-padding`,C,m,w),S=k.getPadding();y!==S[0]&&(S[0]=y,S[1]=y,S[2]=y,S[3]=y),b.setZIndex(D)}}}if(T>-1)return _.length=T+1,_};return e.setStyle(v),e.set(`mapbox-layers`,d),e.set(`mapbox-source`,g),e.set(`mapbox-featurestate`,e.get(`mapbox-featurestate`)||{}),v}var nTe=ka.parse(`#000000`),rTe=ka.parse(`#FFFFFF`),iTe=ka.parse(`#000000`);function aTe(e){return new fR({source:new yR({operationType:`image`,operation:Bwe,sources:[e]})})}function oTe(e){return new fR({source:new yR({operationType:`image`,operation:zwe,sources:[e]})})}function sTe(e,t,n,r){e.getSource().on(`beforeoperations`,function(e){oR.zoom=FR(e.resolution,n.resolutions||NR),oR.distanceFromCenter=0;let i=e.data;i.saturation=ez(t,`paint`,`raster-saturation`,DR,r),i.contrast=ez(t,`paint`,`raster-contrast`,DR,r),i.brightnessHigh=ez(t,`paint`,`raster-brightness-max`,DR,r),i.brightnessLow=ez(t,`paint`,`raster-brightness-min`,DR,r),i.hueRotate=ez(t,`paint`,`raster-hue-rotate`,DR,r)})}function cTe(e,t,n,r,i){e.getSource().on(`beforeoperations`,function(e){let a=e.data;a.resolution=iM(r.projection||`EPSG:3857`,e.resolution,Cj(e.extent),`m`);let o=FR(e.resolution,r.resolutions||NR);oR.zoom=o,oR.distanceFromCenter=0,a.zoom=o,a.encoding=t.encoding,a.method=ez(n,`paint`,`hillshade-method`,DR,i)||`standard`,a.exaggeration=ez(n,`paint`,`hillshade-exaggeration`,DR,i);let s=ez(n,`paint`,`hillshade-illumination-direction`,DR,i);s??=335,a.azimuths=Array.isArray(s)?s:[s],a.sunAz=a.azimuths[0];let c=ez(n,`paint`,`hillshade-illumination-altitude`,DR,i);c??=45,a.altitudes=Array.isArray(c)?c:[c];function l(e){return e&&e.values?e.values[0]:e}function u(e){let t=n.paint?.[e];if(Array.isArray(t)&&t.length>0&&typeof t[0]==`string`&&ka.parse(t[0])!==void 0)return t.map(e=>ka.parse(e));let r=ez(n,`paint`,e,DR,i);return r=l(r),r?[r]:void 0}a.highlightColors=u(`hillshade-highlight-color`),a.highlightColor=a.highlightColors?.[0]||rTe,a.highlightColors||=[a.highlightColor],a.shadowColors=u(`hillshade-shadow-color`),a.shadowColor=a.shadowColors?.[0]||nTe,a.shadowColors||=[a.shadowColor],a.accentColor=l(ez(n,`paint`,`hillshade-accent-color`,DR,i))||iTe})}var lTe=[`raster-saturation`,`raster-contrast`,`raster-brightness-max`,`raster-brightness-min`,`raster-hue-rotate`];function uTe(e,t,n){let r=null;return function(i){e.paint&&`raster-opacity`in e.paint&&i.frameState.viewState.zoom!==r&&(r=i.frameState.viewState.zoom,delete n[e.id],dTe(e,t,r,n))}}function dTe(e,t,n,r){oR.zoom=n,oR.distanceFromCenter=0;let i=ez(e,`paint`,`raster-opacity`,DR,r);t.setOpacity(i)}var fTe=[`background`,`circle`,`fill`,`fill-extrusion`,`line`,`symbol`,`raster`,`hillshade`];function pTe(e,t=512){return e.getExtent()?zL({extent:e.getExtent(),tileSize:t,maxZoom:22}).getResolutions():NR}function az(e,t){return t.accessToken||(t=Object.assign({},t),new URL(e).s
Line truncated
|
||||
`){[e,t]=Pz(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}},Oz=class e extends Ez{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]=Pz(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=`
|
||||
`){[e,t]=Pz(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 Dz(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 Dz&&c&&(n=u[u.length-1])instanceof Dz&&t.lines+n.lines<=32?(c+=t.lines,l+=t.length+1,u[u.length-1]=new Dz(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)}};Ez.empty=new Dz([``],0);function MTe(e){let t=-1;for(let n of e)t+=n.length+1;return t}function kz(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 Az(e,t,n){return kz(e,[``],t,n)}var jz=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 Dz?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 Dz?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=`
|
||||
`,this;e--}else if(r instanceof Dz){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 Dz?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)}},Mz=class{constructor(e,t,n){this.value=``,this.done=!1,this.cursor=new jz(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!=``}},Nz=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`&&(Ez.prototype[Symbol.iterator]=function(){return this.iter()},jz.prototype[Symbol.iterator]=Mz.prototype[Symbol.iterator]=Nz.prototype[Symbol.iterator]=function(){return this});var NTe=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 Pz(e,t,n){return t=Math.max(0,Math.min(e.length,t)),[t,Math.max(t,Math.min(e.length,n))]}function Fz(e,t,n=!0,r=!0){return ATe(e,t,n,r)}function PTe(e){return e>=56320&&e<57344}function FTe(e){return e>=55296&&e<56320}function Iz(e,t){let n=e.charCodeAt(t);if(!FTe(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return PTe(r)?(n-55296<<10)+(r-56320)+65536:n}function Lz(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}function Rz(e){return e<65536?1:2}var zz=/\r\n?|\n/,Bz=(function(e){return e[e.Simple=0]=`Simple`,e[e.TrackDel=1]=`TrackDel`,e[e.TrackBefore=2]=`TrackBefore`,e[e.TrackAfter=3]=`TrackAfter`,e})(Bz||={}),Vz=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){Gz(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:qz(this,e)}mapDesc(e,t=!1){return e.empty?this:Kz(this,e,t)}mapPos(e,t=-1,n=Bz.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!=Bz.Simple&&c>=e&&(n==Bz.TrackDel&&r<e&&c>e||n==Bz.TrackBefore&&r<e||n==Bz.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)}},Hz=class e extends Vz{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 Gz(this,(t,n,r,i,a)=>e=e.replace(r,r+(n-t),a),!1),e}mapDesc(e,t=!1){return Kz(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(Ez.empty);r.push(a?t.slice(i,i+a):Ez.empty)}i+=a}return new e(n,r)}compose(e){return this.empty?e:e.empty?this:qz(this,e,!0)}map(e,t=!1){return e.empty?this:Kz(this,e,t,!0)}iterChanges(e,t=!1){Gz(this,e,t)}get desc(){return Vz.create
Line truncated
|
||||
`}get readOnly(){return this.facet(xB)}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(hB))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 KTe(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=Fz(t,a,!1);if(i(t.slice(e,a))!=kB.Word)break;a=e}for(;o<r;){let e=Fz(t,o);if(i(t.slice(o,e))!=kB.Word)break;o=e}return a==o?null:Xz.range(a+n,o+n)}};jB.allowMultipleSelections=gB,jB.tabSize=$z.define({combine:e=>e.length?e[0]:4}),jB.lineSeparator=_B,jB.readOnly=xB,jB.phrases=$z.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])}}),jB.languageData=hB,jB.changeFilter=vB,jB.transactionFilter=yB,jB.transactionExtender=bB,uB.reconfigure=CB.define();function MB(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 NB=class{eq(e){return this==e}range(e,t=e){return FB.create(e,t,this)}};NB.prototype.startSide=NB.prototype.endSide=0,NB.prototype.point=!1,NB.prototype.mapMode=Bz.TrackDel;function PB(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}var FB=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 IB(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}var qTe=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return RB(this.to)}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,r,i,a){let o=[],s=[],c=[],l=-1,u=-1;iter:for(let e=0;e<this.value.length;e++){let d=this.value[e],f=this.from[e]+t,p=this.to[e]+t,m,h;if(f==p){let e=n.mapPos(f,d.startSide,d.mapMode);if(e==null||(m=h=e,d.startSide!=d.endSide&&(h=n.mapPos(f,d.endSide),h<m)))continue}else if(m=n.mapPos(f,d.startSide),h=n.mapPos(p,d.endSide),m>h||m==h&&d.startSide>0&&d.endSide<=0)continue;if(!((h-m||d.endSide-d.startSide)<0)){if(l<0&&(l=m),d.point&&(u=Math.max(u,h-m)),(m-r||d.startSide-i)>=0)o.push(d),s.push(m-l),c.push(h-l),r=h,i=d.endSide;else{if(m==h)for(let e=o.length;e>0;e--){if((m-(c[e-1]+l)||d.startSide-o[e-1].endSide)>=0){o.splice(e,0,d),s.splice(e,0,m-l),c.splice(e,0,h-l);continue iter}if((m-(s[e-1]+l)||d.endSide-o[e-1].startSide)>0)break}a(m,h,d)}}}return{mapped:o.length?new e(s,c,o,u):null,pos:l}}},LB=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(IB)),this.isEmpty)return n.length?e.of(n):this;let s=new VB(this,null,-1).goto(0),c=0,l=[],u=new zB;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,!1)||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,!1)||l.push(FB.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,a,o=(e,t,n)=>{a||=new zB,a.addRange(e,t,n,!1)};for(let e=0;e<this.chunk.length;e++){let a=this.chunkPos[e],s=this.chunk[e],c=t.touchesRange(a,a+s.length);if(c===!1)i=Math.max(i,s.maxPoint),n.push(s),r.push(t.mapPos(a));else if(c===!0){let[e,c]=n.length?[RB(r)+RB(n).length,RB(RB(n).value).endSide]:[-1,-1],{mapped:l,pos:u}=s.map(a,t,e,c,o);l&&(i=Math.max(i,l.maxPoint),n.push(l),r.push(u))}}let s=this.nextLayer.map(t);return a&&(s=a.finishInner(s)),n.length==0?s:ne
Line truncated
|
||||
`)}static newName(){let e=tV[$B]||1;return tV[$B]=e+1,QB+e.toString(36)}static mount(e,t,n){let r=e[eV],i=n&&n.nonce;r?i&&r.setNonce(i):r=new YTe(e,i),r.mount(Array.isArray(t)?t:[t],e)}},rV=new Map,YTe=class{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=rV.get(n);if(t)return e[eV]=t;this.sheet=new r.CSSStyleSheet,rV.set(n,this)}else this.styleTag=n.createElement(`style`),t&&this.styleTag.setAttribute(`nonce`,t);this.modules=[],e[eV]=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()+`
|
||||
`;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)}},iV={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:`'`},aV={48:`)`,49:`!`,50:`@`,51:`#`,52:`$`,53:`%`,54:`^`,55:`&`,56:`*`,57:`(`,59:`:`,61:`+`,173:`_`,186:`:`,187:`+`,188:`<`,189:`_`,190:`>`,191:`?`,192:`~`,219:`{`,220:`|`,221:`}`,222:`"`},XTe=typeof navigator<`u`&&/Mac/.test(navigator.platform),ZTe=typeof navigator<`u`&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),oV=0;oV<10;oV++)iV[48+oV]=iV[96+oV]=String(oV);for(var oV=1;oV<=24;oV++)iV[oV+111]=`F`+oV;for(var oV=65;oV<=90;oV++)iV[oV]=String.fromCharCode(oV+32),aV[oV]=String.fromCharCode(oV);for(var sV in iV)aV.hasOwnProperty(sV)||(aV[sV]=iV[sV]);function QTe(e){var t=!(XTe&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||ZTe&&e.shiftKey&&e.key&&e.key.length==1||e.key==`Unidentified`)&&e.key||(e.shiftKey?aV:iV)[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 cV(){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++)lV(e,arguments[t]);return e}function lV(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++)lV(e,t[n]);else throw RangeError(`Unsupported child node: `+t)}}var uV=typeof navigator<`u`?navigator:{userAgent:``,vendor:``,platform:``},dV=typeof document<`u`?document:{documentElement:{style:{}}},fV=/Edge\/(\d+)/.exec(uV.userAgent),pV=/MSIE \d/.test(uV.userAgent),mV=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(uV.userAgent),hV=!!(pV||mV||fV),gV=!hV&&/gecko\/(\d+)/i.test(uV.userAgent),_V=!hV&&/Chrome\/(\d+)/.exec(uV.userAgent),vV=`webkitFontSmoothing`in dV.documentElement.style,yV=!hV&&/Apple Computer/.test(uV.vendor),bV=yV&&(/Mobile\/\w+/.test(uV.userAgent)||uV.maxTouchPoints>2),xV={mac:bV||/Mac/.test(uV.platform),windows:/Win/.test(uV.platform),linux:/Linux|X11/.test(uV.platform),ie:hV,ie_version:pV?dV.documentMode||6:mV?+mV[1]:fV?+fV[1]:0,gecko:gV,gecko_version:gV?+(/Firefox\/(\d+)/.exec(uV.userAgent)||[0,0])[1]:0,chrome:!!_V,chrome_version:_V?+_V[1]:0,ios:bV,android:/Android\b/.test(uV.userAgent),webkit:vV,webkit_version:vV?+(/\bAppleWebKit\/(\d+)/.exec(uV.userAgent)||[0,0])[1]:0,safari:yV,safari_version:yV?+(/\bVersion\/(\d+(\.\d+)?)/.exec(uV.userAgent)||[0,0])[1]:0,tabSize:dV.documentElement.style.tabSize==null?`-moz-tab-size`:`tab-size`};function SV(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 CV=Object.create(null);function wV(e,t,n){if(e==t)return!0;e||=CV,t||=CV;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 $Te(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 TV(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 eEe(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 EV=class{eq(e){return!1}updateDOM(e,t,n){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){}},DV=(function(e){return e[e.Text=0]=`Text`,e[e.WidgetBefore=1]=`WidgetBefore`,e[e.WidgetAfter=2]=`WidgetAfter`,e[e.WidgetRange=3]=`WidgetRange`,e})(DV||={}),OV=class extends NB{constructor(e,t,n,r){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=r}get heightRelevant(){return!1}static ma
Line truncated
|
||||
`,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 JEe(e,t,n){let r=e.state.charCategorizer(t),i=r(n);return e=>{let t=r(e);return i==kB.Space&&(i=t),i==t}}function YEe(e,t,n,r){let i=t.head,a=n?1:-1;if(i==(n?e.state.doc.length:0))return Xz.cursor(i,t.assoc);let o=t.goalColumn,s,c=e.contentDOM.getBoundingClientRect(),l=e.coordsAtPos(i,t.assoc||((t.empty?n:t.head==t.from)?1:-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=e.viewState.heightOracle.textHeight>>1,p=r??f;for(let t=0;;t+=f){let r=s+(p+t)*a,i=hU(e,{x:d,y:r},!1,a);if(n?r>c.bottom:r<c.top)return Xz.cursor(i.pos,i.assoc);let l=e.coordsAtPos(i.pos,i.assoc),u=l?(l.top+l.bottom)/2:0;if(!l||(n?u>s:u<s))return Xz.cursor(i.pos,i.assoc,void 0,o)}}function fU(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 XEe(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=fU(e,i.from,0);t!=i.from&&(a=Xz.cursor(t,-1))}else{let t=fU(e,i.from,-1),n=fU(e,i.to,1);(t!=i.from||n!=i.to)&&(a=i.undirectional?Xz.undirectionalRange(i.from,i.to):Xz.range(i.from==i.anchor?t:n,i.from==i.head?t:n))}a&&(n||=t.ranges.slice(),n[r]=a)}return n?Xz.create(n,t.mainIndex):t}function pU(e,t,n){let r=fU(e.state.facet(HH).map(t=>t(e)),n.from,t.head>n.from?-1:1);return r==n.from?n:Xz.cursor(r,r<n.from?1:-1)}var mU=class{constructor(e,t){this.pos=e,this.assoc=t}};function hU(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 mU(0,1);if(c>e.viewState.docHeight)return new mU(e.state.doc.length,-1);if(l=e.elementAtHeight(c),r==null)break;if(l.type==DV.Text){if(r<0?l.to<e.viewport.from:l.from>e.viewport.to)break;let t=e.docView.coordsAt(r<0?l.from:l.to,r>0?-1:1);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==DV.Text){let t=GEe(e,i,l,o,s);return new mU(t,t==l.from?1:-1)}}if(l.type!=DV.Text)return c<(l.top+l.bottom)/2?new mU(l.from,1):new mU(l.to,-1);let u=e.docView.lineAt(l.from,2);return(!u||u.length!=l.length)&&(u=e.docView.lineAt(l.from,-2)),new ZEe(e,o,s,e.textDirectionAt(l.from)).scanTile(u,l.from)}var ZEe=class{constructor(e,t,n,r){this.view=e,this.x=t,this.y=n,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[uH.find(r,e-n.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:n,spans:r}=this.bidiSpansAt(e);return r[uH.find(r,e-n.from,-1,t)].dir}bidiIn(e,t){let{spans:n,line:r}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+r.from<t)}scan(e,t,n=!1){let r=0,i=e.length-1,a=new Set,o=this.bidiIn(e[0],e[i]),s,c,l=-1,u=1e9,d;search:for(;r<i;){let n=i-r,f=r+i>>1;adjust:if(a.has(f)){for(let e=1;e<n;e++){let t=f+e;if(t>=i&&(t-=n),!a.has(t)){f=t;break adjust}}break search}a.add(f);let p=t(f),m=0;if(p)for(let e=0;e<p.length;e++){let t=p[e];if(!(t.width==0&&p.length>1)){if(t.bottom<this.y)(!s||s.bottom<t.bottom)&&(s=t),m=1;else if(t.top>this.y)(!c||c.top>t.top)&&(c=t),m=-1;else{let e=t.left>this.x?this.x-t.left:t.right<this.x?this.x-t.right:0,n=Math.abs(e);n<u&&(l=f,u=n,d=t),e&&(m=e<0==(this.baseDir==rH.LTR)?-1:1)}}}m==-1&&(!o||this.baseDirAt(e[f],1))?i=f:m==1&&(!o||this.baseDirAt(e[f+1],-1))&&(r=f+1)}if(!d){if(!c&&!s)return{i:0,after:!1};let n=s&&(!c||this.y-s.bottom<c.top-this.y)?s:c;return this.y=(n.top+n.bottom)/2,this.scan(e,t,!0)}if(u&&!n){let{top:n,bottom:r}=d;if(s&&s.bottom>(n+n+r)/3)return this.y=s.bottom-1,this.scan(e,t,!0);if(c&&c.top<(n+r+r)/3)return this.y=c.top+1,this.scan(e,t,!0)}let f=(o?this.dirAt(e[l],1):this.baseDir)==rH.LTR;return{i:l,after:this.x>(d.left+d.right)/2==f}}scanText(e,t){let n=[];for(let r=0;r<e.length;r=Fz(e.text,r))n.push(t+r);n.push(t+e.length);let r=this.scan(n,r=>{let i=n[r]-t,a=n[r+1]-t;return ZV(e.dom,i,a).getClientRects()});return r.after?new mU(n[r.i+1],-1):new mU(n[r.i],1)}scanTile(e,t){if(!e.length)return new mU(t,1);if(e.children.length==1){let n=e.children[0];if(n.isText())return this.scanText(n,t);if(n.isComposite())return this.scanTile(n,t)}let n=[t];for(let r=0,i=t;r<e.children.length;r++)n.push(i+=e.children[r].length);let r=this.scan(n,t=>{let n=e.children[t];return n.flags&48?null:(n.dom.nodeType==1?n.dom:ZV(n.dom,0,n.length)).getClientRects()}),i=e.children[r.i],a=n[r.i];return i.isText()?this.scanText(i,a):i.isComposite()?this.scanTile(i,a):r.after?new mU(n[r.i+1],-1):new mU(a,1)}},gU=``,QEe=clas
Line truncated
|
||||
`&&e.lineWrapping&&(r&&=Xz.single(r.main.anchor-1,r.main.head-1),n={from:a.from,to:a.to,insert:Ez.of([` `])}),n)return _U(e,n,r,o);if(r&&!vU(r,a)){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=XEe(i.facet(HH).map(t=>t(e)),r))),e.dispatch({selection:r,scrollIntoView:t,userEvent:n}),!0}return!1}function _U(e,t,n,r=-1){if(xV.ios&&e.inputState.flushIOSKey(t))return!0;let i=e.state.selection.main;if(xV.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&&QV(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)&&QV(e.contentDOM,`Backspace`,8)||t.from==i.from&&t.to==i.to+1&&t.insert.length==0&&QV(e.contentDOM,`Delete`,46)))return!0;let a=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let o,s=()=>o||=aDe(e,t,n);return e.state.facet(SH).some(n=>n(e,t.from,t.to,a,s))||e.dispatch(s()),!0}function aDe(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=fU(i.facet(HH).map(t=>t(e)),r,n);t.from==s&&(o=s)}if(o>-1)r={changes:t,selection:Xz.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&&FEe(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?Xz.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 oDe(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 sDe(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 tDe(n,r)),(i!=n||a!=r)&&t.push(new tDe(i,a))),t}function cDe(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?Xz.single(n+t,r+t):null}function vU(e,t){return t.head==e.main.head&&t.anchor==e.main.anchor}var lDe=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=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,xV.safari&&e.contentDOM.addEventListener(`input`,()=>null),xV.gecko&&BDe(e.contentDOM.ownerDocument)}handleEvent(e){!xDe(this.view,e)||this.ignoreDuringComposition(e)||e.type==`keydown`&&this.keydown(e)||(this.view.updateState==0?this.runHandlers(e.type,e):Promise.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}}}}ensure
Line truncated
|
||||
`))};if((xV.mac||xV.android)&&u.from==a-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute(`autocorrect`)==`off`&&(u={from:o,to:s,insert:Ez.of([n.text.replace(`.`,` `)])}),this.pendingContextChange=u,!e.state.readOnly){let t=this.to-this.from+(u.to-u.from+u.insert.length);_U(e,u,Xz.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(OV.mark({attributes:{style:e}}).range(i,a))}}}e.dispatch({effects:jH.of(OV.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=>{let t=FV(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}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>3e4)}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])}},UU=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.
Line truncated
|
||||
--\u2028\u2029-]`,oW),WOe={0:`null`,7:`bell`,8:`backspace`,10:`newline`,11:`vertical tab`,13:`carriage return`,27:`escape`,8203:`zero width space`,8204:`zero width non-joiner`,8205:`zero width joiner`,8206:`left-to-right mark`,8207:`right-to-left mark`,8232:`line separator`,8237:`left-to-right override`,8238:`right-to-left override`,8294:`left-to-right isolate`,8295:`right-to-left isolate`,8297:`pop directional isolate`,8233:`paragraph separator`,65279:`zero width no-break space`,65532:`object replacement`},sW=null;function GOe(){if(sW==null&&typeof document<`u`&&document.body){let e=document.body.style;sW=(e.tabSize??e.MozTabSize)!=null}return sW||!1}var cW=$z.define({combine(e){let t=MB(e,{render:null,specialChars:UOe,addSpecialChars:null});return(t.replaceTabs=!GOe())&&(t.specialChars=RegExp(` |`+t.specialChars.source,oW)),t.addSpecialChars&&(t.specialChars=RegExp(t.specialChars.source+`|`+t.addSpecialChars.source,oW)),t}});function KOe(e={}){return[cW.of(e),JOe()]}var qOe=null;function JOe(){return qOe||=FH.fromClass(class{constructor(e){this.view=e,this.decorations=OV.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(cW)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new HOe({regexp:e.specialChars,decoration:(t,n,r)=>{let{doc:i}=n.state,a=Iz(t[0],0);if(a==9){let e=i.lineAt(r),t=n.state.tabSize,a=XB(e.text,t,r-e.from);return OV.replace({widget:new QOe((t-a%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[a]||(this.decorationCache[a]=OV.replace({widget:new ZOe(e,a)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(cW);e.startState.facet(cW)==t?this.decorations=this.decorator.updateDeco(e,this.decorations):(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view))}},{decorations:e=>e.decorations})}var YOe=`•`;function XOe(e){return e>=32?YOe:e==10?``:String.fromCharCode(9216+e)}var ZOe=class extends EV{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=XOe(this.code),n=e.state.phrase(`Control character`)+` `+(WOe[this.code]||`0x`+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,n,t);if(r)return r;let i=document.createElement(`span`);return i.textContent=t,i.title=n,i.setAttribute(`aria-label`,n),i.className=`cm-specialChar`,i}ignoreEvent(){return!1}},QOe=class extends EV{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement(`span`);return e.textContent=` `,e.className=`cm-tab`,e.style.width=this.width+`px`,e}ignoreEvent(){return!1}};function $Oe(){return tke}var eke=OV.line({class:`cm-activeLine`}),tke=FH.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let r of e.state.selection.ranges){let i=e.lineBlockAt(r.head);i.from>t&&(n.push(eke.range(i.from)),t=i.from)}return OV.set(n)}},{decorations:e=>e.decorations}),lW=2e3;function nke(e,t,n){let r=Math.min(t.line,n.line),i=Math.max(t.line,n.line),a=[];if(t.off>lW||n.off>lW||t.col<0||n.col<0){let o=Math.min(t.off,n.off),s=Math.max(t.off,n.off);for(let t=r;t<=i;t++){let n=e.doc.line(t);n.length<=s&&a.push(Xz.range(n.from+o,n.to+s))}}else{let o=Math.min(t.col,n.col),s=Math.max(t.col,n.col);for(let t=r;t<=i;t++){let n=e.doc.line(t),r=ZB(n.text,o,e.tabSize,!0);if(r<0)a.push(Xz.cursor(n.to));else{let t=ZB(n.text,s,e.tabSize);a.push(Xz.range(n.from+r,n.from+t))}}}return a}function rke(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}function uW(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),r=e.state.doc.lineAt(n),i=n-r.from,a=i>lW?-1:i==r.length?rke(e,t.clientX):XB(r.text,e.state.tabSize,n-r.from);return{line:r.number,col:a,off:i}}function ike(e,t){let n=uW(e,t),r=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),i=e.state.doc.lineAt(t);n={line:i.number,col:n.col,off:Math.min(n.off,i.length)},r=r.map(e.changes)}},get(t,i,a){let o=uW(e,t);if(!o)return r;let s=nke(e.state,n,o);return s.length?a?Xz.create(s.concat(r.ranges)):Xz.create(s):r}}:null}function ake(e){let t=e?.eventFilter||(e=>e.altKey&&e.button==0);return UU.mouseSelectionStyle.of((e,n)=>t(n)?ike(e,n):null)}var oke={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},ske={style:`cursor: crosshair`};function cke(e={}){let[t,n]=oke[e.key||`Alt`],r=FH.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){(e.keyCode==t||!n(e))&&this.set(!1)},mousemove(e){this.set(n(e))}}});return[r,UU.contentAttributes.of(e=>e.plugin(r)?.isDown?ske:null)]}var dW=`-100Line truncated
|
||||
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new gMe(this):new mMe(this)}getCursor(e,t=0,n){let r=e.doc?e:jB.create({doc:e});return n??=r.doc.length,this.regexp?iJ(this,r,t,n):rJ(this,r,t,n)}},nJ=class{constructor(e){this.spec=e}};function rJ(e,t,n,r){return new Vq(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?pMe(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function pMe(e,t){return(n,r,i,a)=>((a>n||a+i.length<r)&&(a=Math.max(0,n-2),i=e.sliceString(a,Math.min(e.length,r+2))),(t(aJ(i,n-a))!=kB.Word||t(oJ(i,n-a))!=kB.Word)&&(t(oJ(i,r-a))!=kB.Word||t(aJ(i,r-a))!=kB.Word))}var mMe=class extends nJ{constructor(e){super(e)}nextMatch(e,t,n){let r=rJ(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=rJ(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=rJ(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=rJ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=rJ(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function iJ(e,t,n,r){return new Wq(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?hMe(t.charCategorizer(t.selection.main.head)):void 0},n,r)}function aJ(e,t){return e.slice(Fz(e,t,!1),t)}function oJ(e,t){return e.slice(t,Fz(e,t))}function hMe(e){return(t,n,r)=>!r[0].length||(e(aJ(r.input,r.index))!=kB.Word||e(oJ(r.input,r.index))!=kB.Word)&&(e(oJ(r.input,r.index+r[0].length))!=kB.Word||e(aJ(r.input,r.index+r[0].length))!=kB.Word)}var gMe=class extends nJ{nextMatch(e,t,n){let r=iJ(this.spec,e,n,e.doc.length).next();return r.done&&(r=iJ(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=iJ(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=iJ(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=iJ(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},sJ=CB.define(),cJ=CB.define(),lJ=aB.define({create(e){return new uJ(gJ(e).create(),null)},update(e,t){for(let n of t.effects)n.is(sJ)?e=new uJ(n.value.create(),e.panel):n.is(cJ)&&(e=new uJ(e.query,n.value?hJ:null));return e},provide:e=>OW.from(e,e=>e.panel)}),uJ=class{constructor(e,t){this.query=e,this.panel=t}},_Me=OV.mark({class:`cm-searchMatch`}),vMe=OV.mark({class:`cm-searchMatch cm-searchMatch-selected`}),yMe=FH.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(lJ))}update(e){let t=e.state.field(lJ);(t!=e.startState.field(lJ)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return OV.none;let{view:n}=this,r=new zB;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?vMe:_Me)})}return r.finish()}},{decorations:e=>e.decorations});function dJ(e){return t=>{let n=t.state.field(lJ,!1);return n&&n.query.spec.valid?e(t,n):yJ(t)}}var fJ=dJ((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=Xz.single(r.from,r.to),a=e.state.facet(eJ);return e.dispatch({selection:i,effects:[wJ(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),vJ(e),!0}),pJ=dJ((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=Xz.single(i.from,i.to),o=e.state.facet(eJ);return e.dispatch({selection:a,effects:[wJ(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),vJ(e),!0}),bMe=dJ((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:Xz.create(n.map(e=>Xz.rang
Line truncated
|
||||
`)}var c={extraLines:2,tabSize:4};return function(e,t,r,i){i=a({},c,i);var l=e.split(/\r\n?|\n|\f/),u=Math.max(1,t-i.extraLines)-1,d=Math.min(t+i.extraLines,l.length),f=String(d).length;return[s(l,u,t,f,i),n(` `,o(l[t-1].substring(0,r-1),t,f,i).length)+`^`,s(l,t,d,f,i)].filter(Boolean).join(`
|
||||
`)}})}),o=Error().stack,s=(function(e){var t=Object.create(SyntaxError.prototype);return Object.assign(t,e,{name:`SyntaxError`}),Object.defineProperty(t,"stack",{get:function(){return o?o.replace(/^(.+\n){1,3}/,String(t)+`
|
||||
`):``}}),t}),c=(function(e,t,n,r,i){throw s({message:r?e+`
|
||||
`+a(t,r,i):e,rawMessage:e,source:n,line:r,column:i})}),l={unexpectedEnd:function(){return`Unexpected end of input`},unexpectedToken:function(e){var t=[...arguments].slice(1);return`Unexpected token <`+e+`> at `+t.filter(Boolean).join(`:`)}},u={unexpectedSymbol:function(e){var t=[...arguments].slice(1);return`Unexpected symbol <`+e+`> at `+t.filter(Boolean).join(`:`)}},d={LEFT_BRACE:0,RIGHT_BRACE:1,LEFT_BRACKET:2,RIGHT_BRACKET:3,COLON:4,COMMA:5,STRING:6,NUMBER:7,TRUE:8,FALSE:9,NULL:10},f={"{":d.LEFT_BRACE,"}":d.RIGHT_BRACE,"[":d.LEFT_BRACKET,"]":d.RIGHT_BRACKET,":":d.COLON,",":d.COMMA},p={true:d.TRUE,false:d.FALSE,null:d.NULL},m={_START_:0,START_QUOTE_OR_CHAR:1,ESCAPE:2},h={'"':0,"\\":1,"/":2,b:3,f:4,n:5,r:6,t:7,u:8},g={_START_:0,MINUS:1,ZERO:2,DIGIT:3,POINT:4,DIGIT_FRACTION:5,EXP:6,EXP_DIGIT_OR_SIGN:7};function _(e){return e>=`1`&&e<=`9`}function v(e){return e>=`0`&&e<=`9`}function y(e){return v(e)||e>=`a`&&e<=`f`||e>=`A`&&e<=`F`}function b(e){return e===`e`||e===`E`}function x(e,t,n,r){var i=e.charAt(t);if(i===`\r`)t++,n++,r=1,e.charAt(t)===`
|
||||
`&&t++;else if(i===`
|
||||
`)t++,n++,r=1;else if(i===` `||i===` `)t++,r++;else return null;return{index:t,line:n,column:r}}function S(e,t,n,r){var i=e.charAt(t);return i in f?{type:f[i],line:n,column:r+1,index:t+1,value:null}:null}function C(e,t,n,r){for(var i in p)if(p.hasOwnProperty(i)&&e.substr(t,i.length)===i)return{type:p[i],line:n,column:r+i.length,index:t+i.length,value:i};return null}function w(e,t,n,r){for(var i=t,a=m._START_;t<e.length;){var o=e.charAt(t);switch(a){case m._START_:if(o===`"`)t++,a=m.START_QUOTE_OR_CHAR;else return null;break;case m.START_QUOTE_OR_CHAR:if(o===`\\`)t++,a=m.ESCAPE;else if(o===`"`)return t++,{type:d.STRING,line:n,column:r+t-i,index:t,value:e.slice(i,t)};else t++;break;case m.ESCAPE:if(o in h){if(t++,o===`u`)for(var s=0;s<4;s++){var c=e.charAt(t);if(c&&y(c))t++;else return null}a=m.START_QUOTE_OR_CHAR}else return null}}}function T(e,t,n,r){var i=t,a=t,o=g._START_;iterator:for(;t<e.length;){var s=e.charAt(t);switch(o){case g._START_:if(s===`-`)o=g.MINUS;else if(s===`0`)a=t+1,o=g.ZERO;else if(_(s))a=t+1,o=g.DIGIT;else return null;break;case g.MINUS:if(s===`0`)a=t+1,o=g.ZERO;else if(_(s))a=t+1,o=g.DIGIT;else return null;break;case g.ZERO:if(s===`.`)o=g.POINT;else if(b(s))o=g.EXP;else break iterator;break;case g.DIGIT:if(v(s))a=t+1;else if(s===`.`)o=g.POINT;else if(b(s))o=g.EXP;else break iterator;break;case g.POINT:if(v(s))a=t+1,o=g.DIGIT_FRACTION;else break iterator;break;case g.DIGIT_FRACTION:if(v(s))a=t+1;else if(b(s))o=g.EXP;else break iterator;break;case g.EXP:if(s===`+`||s===`-`)o=g.EXP_DIGIT_OR_SIGN;else if(v(s))a=t+1,o=g.EXP_DIGIT_OR_SIGN;else break iterator;break;case g.EXP_DIGIT_OR_SIGN:if(v(s))a=t+1;else break iterator}t++}return a>0?{type:d.NUMBER,line:n,column:r+a-i,index:a,value:e.slice(i,a)}:null}var E=function(e,t){for(var n=1,a=1,o=0,s=[];o<e.length;){var l=[e,o,n,a],d=x.apply(void 0,l);if(d){o=d.index,n=d.line,a=d.column;continue}var f=S.apply(void 0,l)||C.apply(void 0,l)||w.apply(void 0,l)||T.apply(void 0,l);if(f){var p={type:f.type,value:f.value,loc:i(n,a,o,f.line,f.column,f.index,t.source)};s.push(p),o=f.index,n=f.line,a=f.column}else c(u.unexpectedSymbol(r(e,o,o+1),t.source,n,a),e,t.source,n,a)}return s},D={_START_:0,OPEN_OBJECT:1,PROPERTY:2,COMMA:3},O={_START_:0,KEY:1,COLON:2},k={_START_:0,OPEN_ARRAY:1,VALUE:2,COMMA:3},A={loc:!0,source:null};function ee(e,t,n){var r=t.length>0?t[t.length-1].loc.end:{line:1,column:1};c(l.unexpectedEnd(),e,n.source,r.line,r.column)}function j(e){for(var t=0,n=0;n<4;n++)t=t*16+parseInt(e[n],16);return String.fromCharCode(t)}var te={b:`\b`,f:`\f`,n:`
|
||||
`,r:`\r`,t:` `},ne=[`"`,`\\`,`/`];function re(e){for(var t=``,n=0;n<e.length;n++){var r=e.charAt(n);if(r===`\\`){n++;var i=e.charAt(n);if(i===`u`)t+=j(e.substr(n+1,4)),n+=4;else if(ne.indexOf(i)!==-1)t+=i;else if(i in te)t+=te[i];else break}else t+=r}return t}function M(e,t,n,a){for(var o=void 0,s={type:`Object`,children:[]},u=D._START_;n<t.length;){var f=t[n];switch(u){case D._START_:if(f.type===d.LEFT_BRACE)o=f,u=D.OPEN_OBJECT,n++;else return null;break;case D.OPEN_OBJECT:if(f.type===d.RIGHT_BRACE)return a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,f.loc.end.line,f.loc.end.column,f.loc.end.offset,a.source)),{value:s,index:n+1};var p=ie(e,t,n,a);s.children.push(p.value),u=D.PROPERTY,n=p.index;break;case D.PROPERTY:if(f.type===d.RIGHT_BRACE)return a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,f.loc.end.line,f.loc.end.column,f.loc.end.offset,a.source)),{value:s,index:n+1};f.type===d.COMMA?(u=D.COMMA,n++):c(l.unexpectedToken(r(e,f.loc.start.offset,f.loc.end.offset),a.source,f.loc.start.line,f.loc.start.column),e,a.source,f.loc.start.line,f.loc.start.column);break;case D.COMMA:var m=ie(e,t,n,a);m?(n=m.index,s.children.push(m.value),u=D.PROPERTY):c(l.unexpectedToken(r(e,f.loc.start.offset,f.loc.end.offset),a.source,f.loc.start.line,f.loc.start.column),e,a.source,f.loc.start.line,f.loc.start.column)}}ee(e,t,a)}function ie(e,t,n,a){for(var o=void 0,s={type:`Property`,key:null,value:null},u=O._START_;n<t.length;){var f=t[n];switch(u){case O._START_:if(f.type===d.STRING){var p={type:`Identifier`,value:re(e.slice(f.loc.start.offset+1,f.loc.end.offset-1)),raw:f.value};a.loc&&(p.loc=f.loc),o=f,s.key=p,u=O.KEY,n++}else return null;break;case O.KEY:f.type===d.COLON?(u=O.COLON,n++):c(l.unexpectedToken(r(e,f.loc.start.offset,f.loc.end.offset),a.source,f.loc.start.line,f.loc.start.column),e,a.source,f.loc.start.line,f.loc.start.column);break;case O.COLON:var m=se(e,t,n,a);return s.value=m.value,a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,m.value.loc.end.line,m.value.loc.end.column,m.value.loc.end.offset,a.source)),{value:s,index:m.index}}}}function ae(e,t,n,a){for(var o=void 0,s={type:`Array`,children:[]},u=k._START_,f=void 0;n<t.length;)switch(f=t[n],u){case k._START_:if(f.type===d.LEFT_BRACKET)o=f,u=k.OPEN_ARRAY,n++;else return null;break;case k.OPEN_ARRAY:if(f.type===d.RIGHT_BRACKET)return a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,f.loc.end.line,f.loc.end.column,f.loc.end.offset,a.source)),{value:s,index:n+1};var p=se(e,t,n,a);n=p.index,s.children.push(p.value),u=k.VALUE;break;case k.VALUE:if(f.type===d.RIGHT_BRACKET)return a.loc&&(s.loc=i(o.loc.start.line,o.loc.start.column,o.loc.start.offset,f.loc.end.line,f.loc.end.column,f.loc.end.offset,a.source)),{value:s,index:n+1};f.type===d.COMMA?(u=k.COMMA,n++):c(l.unexpectedToken(r(e,f.loc.start.offset,f.loc.end.offset),a.source,f.loc.start.line,f.loc.start.column),e,a.source,f.loc.start.line,f.loc.start.column);break;case k.COMMA:var m=se(e,t,n,a);n=m.index,s.children.push(m.value),u=k.VALUE}ee(e,t,a)}function oe(e,t,n,r){var i=t[n],a=null;switch(i.type){case d.STRING:a=re(e.slice(i.loc.start.offset+1,i.loc.end.offset-1));break;case d.NUMBER:a=Number(i.value);break;case d.TRUE:a=!0;break;case d.FALSE:a=!1;break;case d.NULL:a=null;break;default:return null}var o={type:`Literal`,value:a,raw:i.value};return r.loc&&(o.loc=i.loc),{value:o,index:n+1}}function se(e,t,n,i){var a=t[n],o=oe.apply(void 0,arguments)||M.apply(void 0,arguments)||ae.apply(void 0,arguments);if(o)return o;c(l.unexpectedToken(r(e,a.loc.start.offset,a.loc.end.offset),i.source,a.loc.start.line,a.loc.start.column),e,i.source,a.loc.start.line,a.loc.start.column)}return(function(e,t){t=Object.assign({},A,t);var n=E(e,t);n.length===0&&ee(e,n,t);var i=se(e,n,0,t);if(i.index===n.length)return i.value;var a=n[i.index];c(l.unexpectedToken(r(e,a.loc.start.offset,a.loc.end.offset),t.source,a.loc.start.line,a.loc.start.column),e,t.source,a.loc.start.line,a.loc.start.column)})}))}))(),1);function tX(){var e=`/home/runner/work/maputnik/maputnik/src/libs/json-path-to-position.ts`,t=`ea54e84c59655b08b790cad163b45126d1fe9ab0`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/libs/json-path-to-position.ts`,statementMap:{0:{start:{line:2,column:1},end:{line:4,column:2}},1:{start:{line:3,column:2},end:{line:3,column:19}},2:{start:{line:5,column:1},end:{line:7,column:2}},3:{start:{line:6,column:2},end:{line:6,column:14}},4:{start:{line:8,column:1},end:{line:10,column:2}},5:{start:{line:9,column:2},end:{line:9,column:19}},6:{start:{line:11,column:13},end:{line:11,column:20}},7:{start:{line:12,column:1},end:{line:14,column:2}},8:{start:{line:13,column:2},end:{line:13,column:68}},9:{start:{line:15,column:17},end:{line:17,column:3}},10:{start:{line:16,column:2},end:{line:16,column:98}},11:{start:{line:18,column:1},end:{line:18,column:58}}},fnMap:{0:{name:`jsonPathToPosition`,decl:{start:{line:1,colum
Line truncated
|
||||
To pick up a draggable item, press the space bar.
|
||||
While dragging, use the arrow keys to move the item.
|
||||
Press space again to drop the item in its new position, or press escape to cancel.
|
||||
`},CPe={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 wPe(e){let{announcements:t=CPe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=SPe}=e,{announce:a,announcement:o}=yPe(),s=wX(`DndLiveRegion`),[c,l]=(0,m.useState)(!1);if((0,m.useEffect)(()=>{l(!0)},[]),bPe((0,m.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=m.createElement(m.Fragment,null,m.createElement(_Pe,{id:r,value:i.draggable}),m.createElement(vPe,{id:s,announcement:o}));return n?(0,cX.createPortal)(u,n):u}var NX;(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`})(NX||={});function PX(){}function TPe(e,t){return(0,m.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function EPe(){var e=[...arguments];return(0,m.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var FX=Object.freeze({x:0,y:0});function DPe(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function OPe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function kPe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function APe(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function IX(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 jPe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=IX(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=DPe(IX(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(OPe)};function MPe(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 NPe=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=MPe(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(kPe)};function PPe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function LX(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:FX}function FPe(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 IPe=FPe(1);function LPe(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]}}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 RPe(e,t,n){let r=LPe(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 zPe={ignoreTransform:!1};function RX(e,t){t===void 0&&(t=zPe);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=fX(e).getComputedStyle(e);t&&(n=RPe(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 zX(e){return RX(e,{ignoreTransform:!0})}function BPe(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function VPe(e,t){return t===void 0&&(t=fX(e).getComputedStyle(e)),t.position===`fixed`}function HPe(e,t){t===void 0&&(t=fX(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)})}function BX(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(pX(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!mX(i)||hX(i)||n.includes(i))return n;let a=fX(e).getComputedStyle(i);return i!==e&&HPe(i,a)&&n.push(i),VPe(i,a)?n:r(i.parentNode)}return e?r(e):n}function VX(e){let[t]=BX(e,1);return t??null}function HX(e){return!lX||!e?null:uX(e)?e:dX(e)?pX(e)||e===gX(e).scrollingElement?win
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TQ(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wQ(Object(n),!0).forEach(function(t){sIe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wQ(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uIe(e){return oIe(e)||cIe(e)||pIe(e)||lIe()}function dIe(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function fIe(e){var t=dIe(e,`string`);return typeof t==`symbol`?t:t+``}function pIe(e,t){if(e){if(typeof e==`string`)return CQ(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?CQ(e,t):void 0}}var EQ,DQ,OQ,kQ,AQ,jQ,MQ,NQ,PQ,FQ,IQ,mIe=o((()=>{SQ(),EQ={activateTrap:function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n._setPausedState(!0)}var r=e.indexOf(t);r===-1||e.splice(r,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}},DQ=function(e){return e.tagName&&e.tagName.toLowerCase()===`input`&&typeof e.select==`function`},OQ=function(e){return e?.key===`Escape`||e?.key===`Esc`||e?.keyCode===27},kQ=function(e){return e?.key===`Tab`||e?.keyCode===9},AQ=function(e){return kQ(e)&&!e.shiftKey},jQ=function(e){return kQ(e)&&e.shiftKey},MQ=function(e){return setTimeout(e,0)},NQ=function(e){var t=[...arguments].slice(1);return typeof e==`function`?e.apply(void 0,t):e},PQ=function(e){return e.target.shadowRoot&&typeof e.composedPath==`function`?e.composedPath()[0]:e.target},FQ=[],IQ=function(e,t){var n=t?.document||document,r=t?.trapStack||FQ,i=TQ({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:AQ,isKeyBackward:jQ},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(e,t,n){return e&&e[t]!==void 0?e[t]:i[n||t]},c=function(e,t){var n=typeof t?.composedPath==`function`?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,i=t.tabbableNodes;return r.contains(e)||n?.includes(r)||i.find(function(t){return t===e})})},l=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.hasFallback,a=r!==void 0&&r,o=t.params,s=o===void 0?[]:o,c=i[e];if(typeof c==`function`&&(c=c.apply(void 0,uIe(s))),c===!0&&(c=void 0),!c){if(c===void 0||c===!1)return c;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}var l=c;if(typeof c==`string`){try{l=n.querySelector(c)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!l&&!a)throw Error(`\`${e}\` as selector refers to no known node`)}return l},u=function(){var e=l(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!xQ(e,i.tabbableOptions)){if(c(n.activeElement)>=0)e=n.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l(`fallbackFocus`)}}else e===null&&(e=l(`fallbackFocus`));if(!e)throw Error(`Your focus-trap needs to have at least one focusable element`);return e},d=function(){if(a.containerGroups=a.containers.map(function(e){var t=_Q(e,i.tabbableOptions),n=vQ(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find(function(e){return yQ(e)}),s=n.slice().reverse().find(function(e){return yQ(e)});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:!!t.find(function(e){return $Z(e)>0}),firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=t.indexOf(e);return i<0?r?n.slice(n.indexOf(e)+1).find(function(e){return yQ(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return yQ(e)}):t[i+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!l(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw Error(`At least one node with a positive tabindex was found in one of your focus-trap's multiple con
Line truncated
|
||||
`);d=~n?e.length-n:d+e.length}function p(){var e={line:l,column:d};return function(t){return t.position=new m(e),v(),t}}function m(e){this.start=e,this.end={line:l,column:d},this.source=t.source}m.prototype.content=e;var h=[];function g(n){var r=Error(t.source+`:`+l+`:`+d+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=d,r.source=e,t.silent)h.push(r);else throw r}function _(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function v(){_(i)}function y(e){var t;for(e||=[];t=b();)t!==!1&&e.push(t);return e}function b(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return g(`End of comment missing`);var r=e.slice(2,n-2);return d+=2,f(r),e=e.slice(n),d+=2,t({type:`comment`,comment:r})}}function x(){var e=p(),t=_(a);if(t){if(b(),!_(o))return g(`property missing ':'`);var r=_(s),i=e({type:`declaration`,property:u(t[0].replace(n,``)),value:r?u(r[0].replace(n,``)):``});return _(c),i}}function S(){var e=[];y(e);for(var t;t=x();)t!==!1&&(e.push(t),y(e));return e}return v(),S()};function u(e){return e?e.replace(l,``):``}})),LIe=s((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(IIe());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),RIe=s((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),zIe=s(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(LIe()),r=RIe();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),m$=g$(`end`),h$=g$(`start`);function g$(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function BIe(e){let t=h$(e),n=m$(e);if(t&&n)return{start:t,end:n}}function _$(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?y$(e.position):`start`in e||`end`in e?y$(e):`line`in e||`column`in e?v$(e):``}function v$(e){return b$(e&&e.line)+`:`+b$(e&&e.column)}function y$(e){return v$(e&&e.start)+`-`+v$(e&&e.end)}function b$(e){return e&&typeof e==`number`?e:1}var x$=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=_$(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};x$.prototype.file=``,x$.prototype.name=``,x$.prototype.reason=``,x$.prototype.message=``,x$.prototype.stack=``,x$.prototype.column=void 0,x$.prototype.line=void 0,x$.prototype.ancestors=void 0,x$.prototype.cause=void 0,x$.prototype.fatal=void 0,x$.prototype.place=void 0,x$.prototype.ruleId=void 0,x$.prototype.source=void 0;var VIe=u(zIe(),1),S$={}.hasOwnProperty,HIe=new Map,UIe=/[A-Z]/g,WIe=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),GIe=new Set([`td`,`th`]);function KIe(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=eLe(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=$Ie(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,
Line truncated
|
||||
`;break;case-3:o=`\r
|
||||
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function ize(e){let t={constructs:dLe([GRe,...(e||{}).extensions||[]]),content:n(yLe),defined:[],document:n(xLe),flow:n(zRe),lazy:{},string:n(HRe),text:n(URe)};return t;function n(e){return n;function n(n){return tze(t,e,n)}}}function aze(e){for(;!c1(e););return e}var x1=/[\0\t\n\r]/g;function oze(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(x1.lastIndex=u,c=x1.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var sze=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function cze(e){return e.replace(sze,lze)}function lze(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return L$(n.slice(t?2:1),t?16:10)}return N$(n)||e}var S1={}.hasOwnProperty;function uze(e,t,n){return typeof t!=`string`&&(n=t,t=void 0),dze(n)(aze(ize(n).document().write(oze()(e,t,!0))))}function dze(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Se),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ve),blockQuote:a(pe),characterEscape:T,characterReference:T,codeFenced:a(me),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(me,o),codeText:a(he,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(_e),hardBreakEscape:a(ye),hardBreakTrailing:a(ye),htmlFlow:a(be,o),htmlFlowData:T,htmlText:a(be,o),htmlTextData:T,image:a(xe),label:o,link:a(Se),listItem:a(we),listItemValue:f,listOrdered:a(Ce,d),listUnordered:a(Ce),paragraph:a(Te),reference:oe,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ve),strong:a(Ee),thematicBreak:a(Oe)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:fe,autolinkProtocol:de,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:le,characterReference:ue,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(te),label:re,labelText:ne,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:se,resourceDestinationString:M,resourceTitleString:ie,resource:ae,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};w1(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];S1.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||T1).call(a,void 0,e[0])}for(r.position={start:C1(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:C1(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.spliceLine truncated
|
||||
`}]}function gze(e,t){let n=t.value?t.value+`
|
||||
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function _ze(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function vze(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yze(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=q$(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function bze(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function xze(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function E1(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function Sze(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return E1(e,t);let i={src:q$(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function Cze(e,t){let n={src:q$(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function wze(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Tze(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return E1(e,t);let i={href:q$(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Eze(e,t){let n={href:q$(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Dze(e,t,n){let r=e.all(t),i=n?Oze(n):D1(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
||||
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
||||
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function Oze(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=D1(n[r])}return t}function D1(e){return e.spread??e.children.length>1}function kze(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function Aze(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jze(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Mze(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Nze(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=h$(t.children[1]),o=m$(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Pze(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function Fze(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var O1=9,k1=32;function Ize(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(A1(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(A1(t.slice(i),i>0,!1)),a.join(``)}function A1(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===O1||t===k1;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===O1||t===k1;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Lze(e,t){let n={type:`text`,value:Ize(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Rze(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var zze={blockquote:mze,break:hze,code:gze,delete:_ze,emphasis:vze,footnoteReference:yze,heading:bze,html:xze,imageReference:Sze,image:Cze,inlineCode:wze,linkReference:Tze,link:Eze,listItem:Dze,list:kze,paragraph:Aze,root:jze,strong:Mze,table:Nze,tableCell:Fze,tableRow:Pze,text:Lze,thematicBreak:Rze,toml:j1,yaml:j1,definition:j1,footnoteDefinition:j1};function j1(){}var M1=typeof self==`object`?self:globalThis,Bze=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new M1[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new M1[a](o),i)};return r},N1=e=>Bze(new Map,e)(0),P1=``,{toString:Vze}={},{keys:Hze}=Object,F1=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=Vze.call(e).slice(8,-1);switch(n){case`Array`:return[1,P1];case`Object`:return[2,P1];case`Date`:return[3,P1];case`RegExp`:return[4,P1];case`Map`:return[5,P1];case`Set`:return[6,P1];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},I1=([e,t])=>e===0&&(t===`function`||t===`symbol`),Uze=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=F1(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`BooleLine truncated
|
||||
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
||||
`}]}}var z1=(function(e){if(e==null)return Xze;if(typeof e==`function`)return B1(e);if(typeof e==`object`)return Array.isArray(e)?qze(e):Jze(e);if(typeof e==`string`)return Yze(e);throw Error(`Expected function, string, or object as test`)});function qze(e){let t=[],n=-1;for(;++n<e.length;)t[n]=z1(e[n]);return B1(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Jze(e){let t=e;return B1(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Yze(e){return B1(t);function t(t){return t&&t.type===e}}function B1(e){return t;function t(t,n,r){return!!(Zze(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Xze(){return!0}function Zze(e){return typeof e==`object`&&!!e&&`type`in e}function Qze(e){return e}var V1=[];function $ze(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=z1(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Qze(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=V1,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=eBe(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function eBe(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?V1:[e]}function H1(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),$ze(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var U1={}.hasOwnProperty,tBe={};function nBe(e,t){let n=t||tBe,r=new Map,i=new Map,a={all:s,applyData:iBe,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...zze,...n.handlers},one:o,options:n,patch:rBe,wrap:oBe};return H1(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(U1.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=R1(n);return r.children=a.all(e),r}return R1(e)}return(a.options.unknownHandler||aBe)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=W1(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=W1(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function rBe(e,t){e.position&&(t.position=BIe(e))}function iBe(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,R1(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function aBe(e,t){let n=t.data||{},r=`value`in t&&!(U1.call(n,`hProperties`)||U1.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function oBe(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
||||
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
||||
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
||||
`}),n}function W1(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function G1(e,t){let n=nBe(e,t),r=n.one(e,void 0),i=Kze(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
||||
`},i)),a}function sBe(e,t){return e&&`run`in e?async function(n,r){let i=G1(n,{file:r,...t});await e.run(i,r)}:function(n,r){return G1(n,{file:r,...e||t})}}function K1(e){if(e)throw e}var cBe=s(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function q1(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function lBe(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?uBe(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function uBe(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var J1={basename:dBe,dirname:fBe,extname:pBe,join:mBe,sep:`/`};function dBe(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Y1(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function fBe(e){if(Y1(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function pBe(e){Y1(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function mBe(...e){let t=-1,n;for(;++t<e.length;)Y1(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:hBe(n)}function hBe(e){Y1(e);let t=e.codePointAt(0)===47,n=gBe(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function gBe(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Y1(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var _Be={cwd:vBe};function vBe(){return`/`}function X1(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function yBe(e){if(typeof e==`string`)e=new URL(e);else if(!X1(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return bBe(e)}function bBe(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.p
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SHe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var CHe=c3(function e(t){var n=this,r=t.expanded,i=r===void 0?[]:r,a=t.allowMultipleExpanded,o=a!==void 0&&a,s=t.allowZeroExpanded,c=s!==void 0&&s;o3(this,e),l3(this,`expanded`,void 0),l3(this,`allowMultipleExpanded`,void 0),l3(this,`allowZeroExpanded`,void 0),l3(this,`toggleExpanded`,function(e){return n.isItemDisabled(e)?n:n.isItemExpanded(e)?n.augment({expanded:n.expanded.filter(function(t){return t!==e})}):n.augment({expanded:n.allowMultipleExpanded?[].concat(gHe(n.expanded),[e]):[e]})}),l3(this,`isItemDisabled`,function(e){var t=n.isItemExpanded(e),r=n.expanded.length===1;return!!(t&&!n.allowZeroExpanded&&r)}),l3(this,`isItemExpanded`,function(e){return n.expanded.indexOf(e)!==-1}),l3(this,`getPanelAttributes`,function(e,t){var r=t??n.isItemExpanded(e);return{role:n.allowMultipleExpanded?void 0:`region`,"aria-hidden":n.allowMultipleExpanded?!r:void 0,"aria-labelledby":n.getButtonId(e),id:n.getPanelId(e),hidden:!r||void 0}}),l3(this,`getHeadingAttributes`,function(){return{role:`heading`}}),l3(this,`getButtonAttributes`,function(e,t){var r=t??n.isItemExpanded(e),i=n.isItemDisabled(e);return{id:n.getButtonId(e),"aria-disabled":i,"aria-expanded":r,"aria-controls":n.getPanelId(e),role:`button`,tabIndex:0}}),l3(this,`getPanelId`,function(e){return`accordion__panel-${e}`}),l3(this,`getButtonId`,function(e){return`accordion__heading-${e}`}),l3(this,`augment`,function(t){return new e(a3({expanded:n.expanded,allowMultipleExpanded:n.allowMultipleExpanded,allowZeroExpanded:n.allowZeroExpanded},t))}),this.expanded=i,this.allowMultipleExpanded=o,this.allowZeroExpanded=c}),y3=(0,m.createContext)(null),b3=function(e){d3(n,e);var t=g3(n);function n(){var e;o3(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),l3(h3(e),`state`,new CHe({expanded:e.props.preExpanded,allowMultipleExpanded:e.props.allowMultipleExpanded,allowZeroExpanded:e.props.allowZeroExpanded})),l3(h3(e),`toggleExpanded`,function(t){e.setState(function(e){return e.toggleExpanded(t)},function(){e.props.onChange&&e.props.onChange(e.state.expanded)})}),l3(h3(e),`isItemDisabled`,function(t){return e.state.isItemDisabled(t)}),l3(h3(e),`isItemExpanded`,function(t){return e.state.isItemExpanded(t)}),l3(h3(e),`getPanelAttributes`,function(t,n){return e.state.getPanelAttributes(t,n)}),l3(h3(e),`getHeadingAttributes`,function(){return e.state.getHeadingAttributes()}),l3(h3(e),`getButtonAttributes`,function(t,n){return e.state.getButtonAttributes(t,n)}),e}return c3(n,[{key:`render`,value:function(){var e=this.state,t=e.allowZeroExpanded,n=e.allowMultipleExpanded;return(0,m.createElement)(y3.Provider,{value:{allowMultipleExpanded:n,allowZeroExpanded:t,toggleExpanded:this.toggleExpanded,isItemDisabled:this.isItemDisabled,isItemExpanded:this.isItemExpanded,getPanelAttributes:this.getPanelAttributes,getHeadingAttributes:this.getHeadingAttributes,getButtonAttributes:this.getButtonAttributes}},this.props.children||null)}}]),n}(m.PureComponent);l3(b3,`defaultProps`,{allowMultipleExpanded:!1,allowZeroExpanded:!1});var x3=function(e){d3(n,e);var t=g3(n);function n(){var e;o3(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),l3(h3(e),`renderChildren`,function(t){return t?e.props.children(t):null}),e}return c3(n,[{key:`render`,value:function(){return(0,m.createElement)(y3.Consumer,null,this.renderChildren)}}]),n}(m.PureComponent),wHe=[`className`,`allowMultipleExpanded`,`allowZeroExpanded`,`onChange`,`preExpanded`],THe=function(e){var t=e.className,n=t===void 0?`accordion`:t,r=e.allowMultipleExpanded,i=e.allowZeroExpanded,a=e.onChange,o=e.preExpanded,s=m3(e,wHe);return(0,m.createElement)(b3,{preExpanded:o,allowMultipleExpanded:r,allowZeroExpanded:i,onChange:a},(0,m.createElement)(`div`,u3({"data-accordion-component":`Accordion`,className:n},s)))},S3;(function(e){e.Accordion=`Accordion`,e.AccordionItem=`AccordionItem`,e.AccordionItemButton=`AccordionItemButton`,e.AccordionItemHeading=`AccordionItemHeading`,e.AccordionItemPanel=`AccordionItemPanel`})(S3||={});var C3=S3,w3=0;function EHe(){var e=w3;return w3+=1,`raa-${e}`}var DHe=m.useId||EHe,OHe=/[\u0009\u000a\u000c\u000d\u0020]/g;function T3(e){return e===``||OHe.test(e)?(console.error(`uuid must be a valid HTML5 id but was given "${e}", ASCII whitespaces are forbidden`),!1):!0}var E3=(0,m.createContext)(null),kHe=function(e){var t=e.children,n=e.uuid,r=e.accordionContext,i=e.dangerouslySetExpanded,a=function(){r.toggleExpanded(n)};return(0,m.createElement)(x3,null,function(e){var r=i??e.isItemExpanded(n),o=e.isItemDisabled(n),s=e.getPanelAttributes(n,i),c=e.getHeadingAttributes(n),l=e.getButtonAttributes(n,i);return(0,m.createElement)(E3.Provider,{value:{uuid:n,expanded:r,disabled:o,toggleExpanded:a,panelAttributes:s,headingAttributes:c,buttonAttributes:l}},t)})},AHe=function(e){return(0,m.createElement)(x3,null,function(t){return(0,m.createElement)(kHe,u3({},e,{accordionContext:t}))})},D3=function(e
Line truncated
|
||||
|
||||
From the WAI-ARIA spec (https://www.w3.org/TR/wai-aria-practices-1.1/#accordion):
|
||||
|
||||
“The button element is the only element inside the heading element. That is, if there are other visually persistent elements, they are not included inside the heading element.”
|
||||
|
||||
`,M3=function(e){d3(n,e);var t=g3(n);function n(){var e;o3(this,n);var r=[...arguments];return e=t.call.apply(t,[this].concat(r)),l3(h3(e),`ref`,void 0),l3(h3(e),`setRef`,function(t){e.ref=t}),e}return c3(n,[{key:`componentDidUpdate`,value:function(){n.VALIDATE(this.ref)}},{key:`componentDidMount`,value:function(){n.VALIDATE(this.ref)}},{key:`render`,value:function(){return(0,m.createElement)(`div`,u3({"data-accordion-component":`AccordionItemHeading`},this.props,{ref:this.setRef}))}}],[{key:`VALIDATE`,value:function(e){if(e===void 0)throw Error(`ref is undefined`);if(!(e.childElementCount===1&&e.firstElementChild&&e.firstElementChild.getAttribute(`data-accordion-component`)===`AccordionItemButton`))throw Error(BHe)}}]),n}(m.PureComponent);l3(M3,`defaultProps`,zHe);var N3=function(e){return(0,m.createElement)(D3,null,function(t){var n=t.headingAttributes;return e.id&&T3(e.id),(0,m.createElement)(M3,u3({},e,n))})};N3.displayName=C3.AccordionItemHeading;var VHe=[`className`,`region`,`id`],HHe=function(e){var t=e.className,n=t===void 0?`accordion__panel`:t,r=e.region,i=e.id,a=m3(e,VHe);return(0,m.createElement)(D3,null,function(e){var t=e.panelAttributes;i&&T3(i);var o=a3(a3({},t),{},{"aria-labelledby":r?t[`aria-labelledby`]:void 0});return(0,m.createElement)(`div`,u3({"data-accordion-component":`AccordionItemPanel`,className:n},a,o,{role:r?`region`:void 0}))})};function P3(){var e=`/home/runner/work/maputnik/maputnik/src/components/FieldJson.tsx`,t=`9520c084d5753d03b2f885ad8d41cc433bbd21b7`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/components/FieldJson.tsx`,statementMap:{0:{start:{line:3,column:25},end:{line:5,column:1}},1:{start:{line:4,column:1},end:{line:4,column:54}}},fnMap:{0:{name:`(anonymous_0)`,decl:{start:{line:3,column:25},end:{line:3,column:26}},loc:{start:{line:3,column:36},end:{line:5,column:1}},line:3}},branchMap:{},s:{0:0,1:0},f:{0:0},b:{},inputSourceMap:{version:3,names:[],sources:[`/home/runner/work/maputnik/maputnik/src/components/FieldJson.tsx`],mappings:`AAAA,SAAS,iBAAsC;;AAM/C,OAAO,MAAM,aAAuC,UAAU;CAC5D,OAAO,qBAAC,WAAD,EAAW,GAAI,MAAQ;AAChC`},_coverageSchema:`1a1c01bbd47fc00a2c39e90264f33305004495a9`,hash:`9520c084d5753d03b2f885ad8d41cc433bbd21b7`},a=n[r]||(n[r]={});(!a[e]||a[e].hash!==t)&&(a[e]=i);var o=a[e];return P3=function(){return o},o}P3(),P3().s[0]++;var F3=e=>(P3().f[0]++,P3().s[1]++,(0,z.jsx)(oX,{...e}));function I3(e){return D({tag:`svg`,attr:{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`},child:[{tag:`path`,attr:{d:`M3 19a2 2 0 0 0 2 2c2 0 2 -4 3 -9s1 -9 3 -9a2 2 0 0 1 2 2`},child:[]},{tag:`path`,attr:{d:`M5 12h6`},child:[]},{tag:`path`,attr:{d:`M15 12l6 6`},child:[]},{tag:`path`,attr:{d:`M15 18l6 -6`},child:[]}]})(e)}function L3(e){return D({tag:`svg`,attr:{viewBox:`0 0 256 256`,fill:`currentColor`},child:[{tag:`path`,attr:{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76H216a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm104,40H40a12,12,0,0,0,0,24H144a12,12,0,0,0,0-24Zm88,0H220V168a12,12,0,0,0-24,0v12H184a12,12,0,0,0,0,24h12v12a12,12,0,0,0,24,0V204h12a12,12,0,0,0,0-24Z`},child:[]}]})(e)}function R3(){var e=`/home/runner/work/maputnik/maputnik/src/libs/filterops.ts`,t=`c4e03b67a8467b62eedab8255a87090dbcdba4b4`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/libs/filterops.ts`,statementMap:{0:{start:{line:2,column:34},end:{line:6,column:1}},1:{start:{line:7,column:28},end:{line:7,column:41}},2:{start:{line:8,column:30},end:{line:8,column:123}},3:{start:{line:8,column:88},end:{line:8,column:122}}},fnMap:{0:{name:`(anonymous_0)`,decl:{start:{line:8,column:80},end:{line:8,column:81}},loc:{start:{line:8,column:88},end:{line:8,column:122}},line:8}},branchMap:{},s:{0:0,1:0,2:0,3:0},f:{0:0},b:{},inputSourceMap:{version:3,names:[],sources:[`/home/runner/work/maputnik/maputnik/src/libs/filterops.ts`],mappings:`AAAA,OAAO,YAAY;AAEnB,OAAO,MAAM,qBAAqB;CAAC;CAAO;CAAO;AAAM;AACvD,OAAO,MAAM,eAAe,CAAC,MAAM,KAAK;AACxC,OAAO,MAAM,iBAAiB,OAC3B,KAAK,OAAO,gBAAgB,MAAM,CAAC,CACnC,QAAO,OAAM,mBAAmB,QAAQ,EAAE,IAAI,CAAC`},_coverageSchema:`1a1c01bbd47fc00a2c39e90264f33305004495a9`,hash:`c4e03b67a8467b62eedab8255a87090dbcdba4b4`},a=n[r]||(n[r]={});(!a[e]||a[e].hash!==t)&&(a[e]=i);var o=a[e];return R3=function(){return o},o}R3();var z3=(R3().s[0]++,[`all`,`any`,`none`]);R3().s[1]++;var UHe=(R3().s[2]++,Object.keys(Xu.filter_operator.values).filter(e=>(R3().f[0]++,R3().s[3]++,z3.indexOf(e)<0)));function B3(){var e=`/home/runner/work/maputnik/maputnik/src/components/SingleFilterEditor.tsx`,t=`23f646748e4094cbb94c13fb75ac4c9dc0c41bd5`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/components/SingleFilterEditor.tsx`,statementMap:{0:{start:{line:8,column:1},end:{line:8,column:24}},1:{start:{line:8,column:15},end:{line:8,column:24}},2:{start:{line:9,column:1},end:{line:9,column:24}},3:{start:{line:9,column:15},end:{line:9,column:2
Line truncated
|
||||
rgba(`+t.r+`,`+t.g+`,`+t.b+`, 1) 100%)`,boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:`relative`,height:`100%`,margin:`0 3px`},pointer:{position:`absolute`,left:t.a*100+`%`},slider:{width:`4px`,borderRadius:`1px`,height:`8px`,boxShadow:`0 0 2px rgba(0, 0, 0, .6)`,background:`#fff`,marginTop:`1px`,transform:`translateX(-2px)`}},vertical:{gradient:{background:`linear-gradient(to bottom, rgba(`+t.r+`,`+t.g+`,`+t.b+`, 0) 0%,
|
||||
rgba(`+t.r+`,`+t.g+`,`+t.b+`, 1) 100%)`},pointer:{left:0,top:t.a*100+`%`}},overwrite:iGe({},this.props.style)},{vertical:this.props.direction===`vertical`,overwrite:!0});return m.createElement(`div`,{style:n.alpha},m.createElement(`div`,{style:n.checkboard},m.createElement(n8,{renderers:this.props.renderers})),m.createElement(`div`,{style:n.gradient}),m.createElement(`div`,{style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},m.createElement(`div`,{style:n.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement(`div`,{style:n.slider}))))}}]),t}(m.PureComponent||m.Component),cGe=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function lGe(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uGe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function dGe(e,t){if(!e)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return t&&(typeof t==`object`||typeof t==`function`)?t:e}function fGe(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function, not `+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var pGe=1,a8=38,mGe=[a8,40],hGe=function(e){return mGe.indexOf(e)>-1},gGe=function(e){return Number(String(e).replace(/%/g,``))},_Ge=1,o8=function(e){fGe(t,e);function t(e){uGe(this,t);var n=dGe(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(e){n.setUpdatedValue(e.target.value,e)},n.handleKeyDown=function(e){var t=gGe(e.target.value);if(!isNaN(t)&&hGe(e.keyCode)){var r=n.getArrowOffset(),i=e.keyCode===a8?t+r:t-r;n.setUpdatedValue(i,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener(`mousemove`,n.handleDrag),window.addEventListener(`mouseup`,n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener(`mousemove`,n.handleDrag),window.removeEventListener(`mouseup`,n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId=`rc-editable-input-`+_Ge++,n}return cGe(t,[{key:`componentDidUpdate`,value:function(e,t){this.props.value!==this.state.value&&(e.value!==this.props.value||t.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:`componentWillUnmount`,value:function(){this.unbindEventListeners()}},{key:`getValueObjectWithLabel`,value:function(e){return lGe({},this.props.label,e)}},{key:`getArrowOffset`,value:function(){return this.props.arrowOffset||pGe}},{key:`setUpdatedValue`,value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:`render`,value:function(){var e=this,t=(0,$6.default)({default:{wrap:{position:`relative`}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:`ew-resize`}}},{"user-override":!0},this.props);return m.createElement(`div`,{style:t.wrap},m.createElement(`input`,{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:`false`}),this.props.label&&!this.props.hideLabel?m.createElement(`label`,{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(m.PureComponent||m.Component),vGe=function(e,t,n,r){var i=r.clientWidth,a=r.clientHeight,o=typeof e.pageX==`number`?e.pageX:e.touches[0].pageX,s=typeof e.pageY==`number`?e.pageY:e.touches[0].pageY,c=o-(r.getBoundingClientRect().left+window.pageXOffset),l=s-(r.getBoundingClientRect().top+window.pageYOffset);if(t===`vertical`){var u=void 0;if(u=l<0?359:l>a?0:360*(-(l*100/a)+100)/100,n.h!==u)r
Line truncated
|
||||
.hue-horizontal {
|
||||
background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0
|
||||
33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
||||
background: -webkit-linear-gradient(to right, #f00 0%, #ff0
|
||||
17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
||||
}
|
||||
|
||||
.hue-vertical {
|
||||
background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,
|
||||
#0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
||||
background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,
|
||||
#0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
|
||||
}
|
||||
`),m.createElement(`div`,{style:r.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement(`div`,{style:r.slider}))))}}]),t}(m.PureComponent||m.Component);function SGe(){this.__data__=[],this.size=0}function l8(e,t){return e===t||e!==e&&t!==t}function u8(e,t){for(var n=e.length;n--;)if(l8(e[n][0],t))return n;return-1}var CGe=Array.prototype.splice;function wGe(e){var t=this.__data__,n=u8(t,e);return n<0?!1:(n==t.length-1?t.pop():CGe.call(t,n,1),--this.size,!0)}function TGe(e){var t=this.__data__,n=u8(t,e);return n<0?void 0:t[n][1]}function EGe(e){return u8(this.__data__,e)>-1}function DGe(e,t){var n=this.__data__,r=u8(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function d8(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])}}d8.prototype.clear=SGe,d8.prototype.delete=wGe,d8.prototype.get=TGe,d8.prototype.has=EGe,d8.prototype.set=DGe;function OGe(){this.__data__=new d8,this.size=0}function kGe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function AGe(e){return this.__data__.get(e)}function jGe(e){return this.__data__.has(e)}var f8=typeof globalThis==`object`&&globalThis&&globalThis.Object===Object&&globalThis,MGe=typeof self==`object`&&self&&self.Object===Object&&self,p8=f8||MGe||Function(`return this`)(),m8=p8.Symbol,h8=Object.prototype,NGe=h8.hasOwnProperty,PGe=h8.toString,g8=m8?m8.toStringTag:void 0;function FGe(e){var t=NGe.call(e,g8),n=e[g8];try{e[g8]=void 0;var r=!0}catch{}var i=PGe.call(e);return r&&(t?e[g8]=n:delete e[g8]),i}var IGe=Object.prototype.toString;function LGe(e){return IGe.call(e)}var RGe=`[object Null]`,zGe=`[object Undefined]`,_8=m8?m8.toStringTag:void 0;function v8(e){return e==null?e===void 0?zGe:RGe:_8&&_8 in Object(e)?FGe(e):LGe(e)}function y8(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var BGe=`[object AsyncFunction]`,VGe=`[object Function]`,HGe=`[object GeneratorFunction]`,UGe=`[object Proxy]`;function b8(e){if(!y8(e))return!1;var t=v8(e);return t==VGe||t==HGe||t==BGe||t==UGe}var x8=p8[`__core-js_shared__`],S8=function(){var e=/[^.]+$/.exec(x8&&x8.keys&&x8.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function WGe(e){return!!S8&&S8 in e}var GGe=Function.prototype.toString;function C8(e){if(e!=null){try{return GGe.call(e)}catch{}try{return e+``}catch{}}return``}var KGe=/[\\^$.*+?()[\]{}|]/g,qGe=/^\[object .+?Constructor\]$/,JGe=Function.prototype,YGe=Object.prototype,XGe=JGe.toString,ZGe=YGe.hasOwnProperty,QGe=RegExp(`^`+XGe.call(ZGe).replace(KGe,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function $Ge(e){return!y8(e)||WGe(e)?!1:(b8(e)?QGe:qGe).test(C8(e))}function eKe(e,t){return e?.[t]}function w8(e,t){var n=eKe(e,t);return $Ge(n)?n:void 0}var T8=w8(p8,`Map`),E8=w8(Object,`create`);function tKe(){this.__data__=E8?E8(null):{},this.size=0}function nKe(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var rKe=`__lodash_hash_undefined__`,iKe=Object.prototype.hasOwnProperty;function aKe(e){var t=this.__data__;if(E8){var n=t[e];return n===rKe?void 0:n}return iKe.call(t,e)?t[e]:void 0}var oKe=Object.prototype.hasOwnProperty;function sKe(e){var t=this.__data__;return E8?t[e]!==void 0:oKe.call(t,e)}var cKe=`__lodash_hash_undefined__`;function lKe(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=E8&&t===void 0?cKe:t,this}function D8(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])}}D8.prototype.clear=tKe,D8.prototype.delete=nKe,D8.prototype.get=aKe,D8.prototype.has=sKe,D8.prototype.set=lKe;function uKe(){this.size=0,this.__data__={hash:new D8,map:new(T8||d8),string:new D8}}function dKe(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function O8(e,t){var n=e.__data__;return dKe(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function fKe(e){var t=O8(this,e).delete(e);return this.size-=+!!t,t}function pKe(e){return O8(this,e).get(e)}function mKe(e){return O8(this,e).has(e)}function hKe(e,t){var n=O8(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function k8(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])}}k8.prototype.clear=uKe,k8.prototype.delete=fKe,k8.prototype.get=pKe,k8.prototype.has=mKe,k8.prototype.set=hKe;var gKe=200;function _Ke(e,t){var n=this.__data__;if(n instanceof d8){var r=n.__data__;if(!T8||r.length<gKe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new k8(r)}return n.set(e,t),this.size=n.size,this}function A8(e){var t=this.__data__=new d8(e);this.size=t.size}A8.prototype.clear=OGe,A8.prototype.delete=kGe,A8.prototype.get=AGe,A8.prototype.has=jGe,A8.prototype.set=_Ke;var j8=function(){try{var e=w8(Object,`defineProperty`);return e({},``,{}),e}catch{}}();function M8(e,t,n){t==`__proto__`&&j8?j8(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function N8(e,t,n){(n!==void 0&&!l8(e[t],
Line truncated
|
||||
0 0 1px 2px rgba(0,0,0,.4)`,borderRadius:`50%`,cursor:`hand`,transform:`translate(-2px, -2px)`}},custom:{color:n,white:r,black:i,pointer:a,circle:o}},{custom:!!this.props.style});return m.createElement(`div`,{style:s.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},m.createElement(`style`,null,`
|
||||
.saturation-white {
|
||||
background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));
|
||||
background: linear-gradient(to right, #fff, rgba(255,255,255,0));
|
||||
}
|
||||
.saturation-black {
|
||||
background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));
|
||||
background: linear-gradient(to top, #000, rgba(0,0,0,0));
|
||||
}
|
||||
`),m.createElement(`div`,{style:s.white,className:`saturation-white`},m.createElement(`div`,{style:s.black,className:`saturation-black`}),m.createElement(`div`,{style:s.pointer},this.props.pointer?m.createElement(this.props.pointer,this.props):m.createElement(`div`,{style:s.circle}))))}}]),t}(m.PureComponent||m.Component);function lJe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var uJe=V8(Object.keys,Object),dJe=Object.prototype.hasOwnProperty;function fJe(e){if(!U8(e))return uJe(e);var t=[];for(var n in Object(e))dJe.call(e,n)&&n!=`constructor`&&t.push(n);return t}function m5(e){return X8(e)?bqe(e):fJe(e)}function pJe(e,t){return e&&P8(e,t,m5)}function mJe(e,t){return function(n,r){if(n==null)return n;if(!X8(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var hJe=mJe(pJe);function gJe(e){return typeof e==`function`?e:c5}function _Je(e,t){return(J8(e)?lJe:hJe)(e,gJe(t))}function h5(e){"@babel/helpers - typeof";return h5=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},h5(e)}var vJe=/^\s+/,yJe=/\s+$/;function g5(e,t){if(e||=``,t||={},e instanceof g5)return e;if(!(this instanceof g5))return new g5(e,t);var n=bJe(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=n.ok}g5.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255,i=t<=.03928?t/12.92:((t+.055)/1.055)**2.4,a=n<=.03928?n/12.92:((n+.055)/1.055)**2.4,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4;return .2126*i+.7152*a+.0722*o},setAlpha:function(e){return this._a=UJe(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=wJe(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=wJe(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this._a==1?`hsv(`+t+`, `+n+`%, `+r+`%)`:`hsva(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHsl:function(){var e=SJe(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=SJe(this._r,this._g,this._b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this._a==1?`hsl(`+t+`, `+n+`%, `+r+`%)`:`hsla(`+t+`, `+n+`%, `+r+`%, `+this._roundA+`)`},toHex:function(e){return EJe(this._r,this._g,this._b,e)},toHexString:function(e){return`#`+this.toHex(e)},toHex8:function(e){return DJe(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return`#`+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?`rgb(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`)`:`rgba(`+Math.round(this._r)+`, `+Math.round(this._g)+`, `+Math.round(this._b)+`, `+this._roundA+`)`},toPercentageRgb:function(){return{r:Math.round(v5(this._r,255)*100)+`%`,g:Math.round(v5(this._g,255)*100)+`%`,b:Math.round(v5(this._b,255)*100)+`%`,a:this._a}},toPercentageRgbString:function(){return this._a==1?`rgb(`+Math.round(v5(this._r,255)*100)+`%, `+Math.round(v5(this._g,255)*100)+`%, `+Math.round(v5(this._b,255)*100)+`%)`:`rgba(`+Math.round(v5(this._r,255)*100)+`%, `+Math.round(v5(this._g,255)*100)+`%, `+Math.round(v5(this._b,255)*100)+`%, `+this._roundA+`)`},toName:function(){return this._a===0?`transparent`:this._a<1?!1:VJe[EJe(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var t=`#`+OJe(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?`GradientType = 1, `:``;if(e){var i=g5(e);n=`#`+OJe(i._r,i._g,i._b,i._a)}return`progid:DXImageTransform.Microsoft.gradient(`+r+`startColorstr=`+t+`,endColorstr=`+n+`)`},toString:function(e){var t=!!e;e||=this._format;var n=!1,r=this._a<1&&this._a>=0;return!t&&r&&(e===`hex`||e===`hex6`||e===`hex3`||e===`hex4`||e===`hex8`||e===`name`)?e===`name`&&this._a===0?this.toName():this.toRgbString():(e===`rgb`&&(n=this.toRgbString()),e===`prgb`&&(n=this.toPercentageRgbString()),(e===`hex`||e===`hex6`)&&(n=this.toHexString()),e===`hex3`&&(n=this.toHexString(!0)),e===`hex4`&&(n=this.toHex8String(!0)),e===`hex8`&&(n=this.toHex8String()),e===`name`&&(n=this.toName()),e===`hsl`&&(n=this.toHslString()),e===`hsv`&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return g5(this.toS
Line truncated
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>${t}</title>
|
||||
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
|
||||
<link href="https://unpkg.com/maplibre-gl@${x$e}/dist/maplibre-gl.css" rel="stylesheet" />
|
||||
<style>
|
||||
body { margin: 0; padding: 0; }
|
||||
#map { position: absolute; top: 0; bottom: 0; width: 100%; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="map"></div>
|
||||
<script type="module">
|
||||
import {Map} from 'https://unpkg.com/maplibre-gl@${x$e}/dist/maplibre-gl.mjs';
|
||||
const map = new Map({
|
||||
container: 'map',
|
||||
style: ${e},
|
||||
});
|
||||
map.addControl(new maplibregl.NavigationControl());
|
||||
<\/script>
|
||||
</body>
|
||||
</html>
|
||||
`),r=(M9().s[9]++,new Blob([n],{type:`text/html;charset=utf-8`})),i=(M9().s[10]++,this.exportName());M9().s[11]++,(0,y$e.saveAs)(r,i+`.html`)}async saveStyle(){M9().f[3]++;let e=(M9().s[12]++,this.tokenizedStyle());if(M9().s[13]++,S$e)M9().b[2][1]++;else{M9().b[2][0]++;let t=(M9().s[14]++,new Blob([e],{type:`application/json;charset=utf-8`})),n=(M9().s[15]++,this.exportName());M9().s[16]++,(0,y$e.saveAs)(t,n+`.json`),M9().s[17]++;return}let t=(M9().s[18]++,this.props.fileHandle);if(M9().s[19]++,t==null){if(M9().b[3][0]++,M9().s[20]++,t=await this.createFileHandle(),M9().s[21]++,this.props.onSetFileHandle(t),M9().s[22]++,t==null){M9().b[4][0]++,M9().s[23]++;return}M9().b[4][1]++}else M9().b[3][1]++;let n=(M9().s[24]++,await t.createWritable());M9().s[25]++,await n.write(e),M9().s[26]++,await n.close(),M9().s[27]++,this.props.onOpenToggle()}async saveStyleAs(){M9().f[4]++;let e=(M9().s[28]++,this.tokenizedStyle()),t=(M9().s[29]++,await this.createFileHandle());if(M9().s[30]++,this.props.onSetFileHandle(t),M9().s[31]++,t==null){M9().b[5][0]++,M9().s[32]++;return}M9().b[5][1]++;let n=(M9().s[33]++,await t.createWritable());M9().s[34]++,await n.write(e),M9().s[35]++,await n.close(),M9().s[36]++,this.props.onOpenToggle()}async createFileHandle(){M9().f[5]++;let e=(M9().s[37]++,{types:[{description:`json`,accept:{"application/json":[`.json`]}}],suggestedName:this.exportName()}),t=(M9().s[38]++,await window.showSaveFilePicker(e));return M9().s[39]++,this.props.onSetFileHandle(t),M9().s[40]++,t}changeMetadataProperty(e,t){M9().f[6]++;let n=(M9().s[41]++,{...this.props.mapStyle,metadata:{...this.props.mapStyle.metadata,[e]:t}});M9().s[42]++,this.props.onStyleChanged(n)}render(){M9().f[7]++;let e=(M9().s[43]++,this.props.t),t=(M9().s[44]++,p$e(e));return M9().s[45]++,(0,z.jsx)(RQ,{"data-wd-key":`modal:export`,isOpen:this.props.isOpen,onOpenToggle:this.props.onOpenToggle,title:e(`Save Style`),className:`maputnik-export-modal`,children:(0,z.jsxs)(`section`,{className:`maputnik-modal-section`,children:[(0,z.jsx)(`h1`,{children:e(`Save Style`)}),(0,z.jsx)(`p`,{children:e(`Save the JSON style to your computer.`)}),(0,z.jsxs)(`div`,{children:[(0,z.jsx)(C9,{label:t.maputnik.maptiler_access_token.label,fieldSpec:t.maputnik.maptiler_access_token,value:(M9().b[6][0]++,this.props.mapStyle.metadata||(M9().b[6][1]++,{}))[`maputnik:openmaptiles_access_token`],onChange:this.changeMetadataProperty.bind(this,`maputnik:openmaptiles_access_token`)}),(0,z.jsx)(C9,{label:t.maputnik.thunderforest_access_token.label,fieldSpec:t.maputnik.thunderforest_access_token,value:(M9().b[7][0]++,this.props.mapStyle.metadata||(M9().b[7][1]++,{}))[`maputnik:thunderforest_access_token`],onChange:this.changeMetadataProperty.bind(this,`maputnik:thunderforest_access_token`)}),(0,z.jsx)(C9,{label:t.maputnik.stadia_access_token.label,fieldSpec:t.maputnik.stadia_access_token,value:(M9().b[8][0]++,this.props.mapStyle.metadata||(M9().b[8][1]++,{}))[`maputnik:stadia_access_token`],onChange:this.changeMetadataProperty.bind(this,`maputnik:stadia_access_token`)}),(0,z.jsx)(C9,{label:t.maputnik.locationiq_access_token.label,fieldSpec:t.maputnik.locationiq_access_token,value:(M9().b[9][0]++,this.props.mapStyle.metadata||(M9().b[9][1]++,{}))[`maputnik:locationiq_access_token`],onChange:this.changeMetadataProperty.bind(this,`maputnik:locationiq_access_token`)})]}),(0,z.jsxs)(`div`,{className:`maputnik-modal-export-buttons`,children:[(0,z.jsxs)(VZ,{onClick:this.saveStyle.bind(this),children:[(0,z.jsx)(XO,{}),e(`Save`)]}),(M9().b[10][0]++,S$e&&(M9().b[10][1]++,(0,z.jsxs)(VZ,{onClick:this.saveStyleAs.bind(this),children:[(0,z.jsx)(XO,{}),e(`Save as`)]}))),(0,z.jsxs)(VZ,{onClick:this.createHtml.bind(this),children:[(0,z.jsx)(Ige,{}),e(`Create HTML`)]})]})]})})}},w$e=(M9().s[46]++,jn()(C$e));function N9(){var e=`/home/runner/work/maputnik/maputnik/src/components/FieldDynamicArray.tsx`,t=`615893f63b00bf2bdf08d7f34d665947b5e31694`,n=globalThis,r=`__coverage__`,i={path:`/home/runner/work/maputnik/maputnik/src/components/FieldDynamicArray.tsx`,statementMap:{0:{start:{line:4,column:33},end:{line:9,column:1}},1:{start:{line:5,column:1},end:{line:8,column:4}}},fnMap:{0:{name:`(anonymous_0)`,decl:{start:{line:4,column:33},end:{line:4,column:34}},loc:{start:{line:4,column:44},end:{line:9,column:1}},line:4}},branchMap:{},s:{0:0,1:0},f:{0:0},b:{},inputSourceMap:{version:3,names:[],sources:[`/home/runner/work/maputnik/maputnik/src/components/FieldDynamicArray.tsx`],mappings:`AAAA,SAAS,yBAAsD;AAC/D,SAAS,gBAAgB;;AASzB,OAAO,MAAM,qBAAuD,UAAU;CAC5E,OACE,qBAAC,UAAD;EAAU,OAAO,MAAM;YACrB,qBAAC,mBAAD,EAAmB,GAAI,MAAQ;CACvB;AAEd`},_coverageSchema:`1a1c01bbd47fc00a2c39e90264f33305004495a9`,hash:`615893f63b00bf2bdf08d7f34d665947b5e31694`},a=n[r]||(n[r]={});(!a[e]||a[e].hash!==t)&&(a[e]=i);var o=a[e];return N9=function(){return o},o}N9(),N9().s[0]++;var T$e=e=>(N9().f[0]++,N9().s[1]++,(0,z.jsx)(Y7,{label:e.label,children:(0,z.jsx)(W7,{...e})}));function P9(){var e=`/home/runner/work/maputnik/maputniLine truncated
|
||||
//# sourceMappingURL=index-BbkOUc3K.js.map
|
||||
@@ -1,12 +0,0 @@
|
||||
(function(){
|
||||
/**
|
||||
* MapLibre GL JS
|
||||
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.7.0/LICENSE.txt
|
||||
*/
|
||||
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function l(e,t){this.x=e,this.y=t}l.prototype={clone(){return new l(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:l},l.convert=function(e){if(e instanceof l)return e;if(Array.isArray(e))return new l(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new l(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};function u(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}}let d;function f(){return d??=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)&&typeof createImageBitmap==`function`,d}let p;function m(){if(p==null&&(p=!1,f())){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){p=!0;break}}}return p||!1}var h=typeof Float32Array<`u`?Float32Array:Array;Math.PI/180,180/Math.PI;function g(){var e=new h(9);return h!=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 _(){var e=new h(3);return h!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function v(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}function y(e,t,n){var r=new h(3);return r[0]=e,r[1]=t,r[2]=n,r}function b(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 x(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function S(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}var C=v;(function(){var e=_();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 w(){var e=new h(4);return h!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function T(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 E(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}(function(){var e=w();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,Line truncated
|
||||
/**
|
||||
* MapLibre GL JS
|
||||
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.7.0/LICENSE.txt
|
||||
*/
|
||||
function Hx(e){let t=typeof e;if(t===`number`||t===`boolean`||t===`string`||e==null)return JSON.stringify(e);if(Array.isArray(e)){let t=`[`;for(let n of e)t+=`${Hx(n)},`;return`${t}]`}let n=Object.keys(e).sort(),r=`{`;for(let t=0;t<n.length;t++)r+=`${JSON.stringify(n[t])}:${Hx(e[n[t]])},`;return`${r}}`}function Ux(e){let t=``;for(let n of Ze)t+=`/${Hx(e[n])}`;return t}function Wx(e,t){let n={};for(let r=0;r<e.length;r++){let i=t&&t[e[r].id]||Ux(e[r]);t&&(t[e[r].id]=i);let a=n[i];a||=n[i]=[],a.push(e[r])}let r=[];for(let e in n)r.push(n[e]);return r}var Gx=class{constructor(e,t){this.keyCache={},e&&this.replace(e,t)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(e,t,n){for(let t of e){this._layerConfigs[t.id]=t;let e=this._layers[t.id]=$h(t,n);e._featureFilter=fa(e.filter,`layers[${t.id}].filter`,n),this.keyCache[t.id]&&delete this.keyCache[t.id]}for(let e of t)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let r=Wx(Object.values(this._layerConfigs),this.keyCache);for(let e of r){let t=e.map(e=>this._layers[e.id]),n=t[0];if(n.isHidden())continue;let r=n.source||``,i=this.familiesBySource[r];i||=this.familiesBySource[r]={};let a=n.sourceLayer||`_geojsonTileLayer`,o=i[a];o||=i[a]=[],o.push(t)}}},Kx=class{constructor(e){let t={},n=[];for(let r in e){let i=e[r],a=t[r]={};for(let e in i){let t=i[e];if(!t||t.bitmap.width===0||t.bitmap.height===0)continue;let r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};n.push(r),a[e]={rect:r,metrics:t.metrics}}}let{w:r,h:i}=Xm(n),a=new Wl({width:r||1,height:i||1});for(let n in e){let r=e[n];for(let e in r){let i=r[e];if(!i||i.bitmap.width===0||i.bitmap.height===0)continue;let o=t[n][e].rect;Wl.copy(i.bitmap,a,{x:0,y:0},{x:o.x+1,y:o.y+1},i.bitmap)}}this.image=a,this.positions=t}};V(`GlyphAtlas`,Kx);var qx=class{constructor(e){this.tileID=new og(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}async parse(e,t,n,r,i){this.data=e,this.collisionBoxArray=new Zs;let a=new wg(Object.keys(e.layers).sort()),o=new Xb(this.tileID,this.promoteId);o.bucketLayerIDs=[];let s={},c={featureIndex:o,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:n,subdivisionGranularity:i},l=t.familiesBySource[this.source];for(let t in l){let r=e.layers[t];if(!r)continue;r.version===1&&ge(`Vector tile source "${this.source}" layer "${t}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let i=a.encode(t),u=[];for(let e=0;e<r.length;e++){let n=r.feature(e),a=o.getId(n,t);u.push({feature:n,id:a,index:e,sourceLayerIndex:i})}for(let e of l[t]){let t=e[0];t.source!==this.source&&ge(`layer.source = ${t.source} does not equal this.source = ${this.source}`),!t.isHidden(this.zoom,!0)&&(Jx(e,this.zoom,n),(s[t.id]=t.createBucket({index:o.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:i,sourceID:this.source})).populate(u,c,this.tileID.canonical),o.bucketLayerIDs.push(e.map(e=>e.id)))}}let u=fe(c.glyphDependencies,e=>Object.keys(e));for(let e of this.inFlightDependencies)e?.abort();this.inFlightDependencies=[];let d=Promise.resolve({});if(Object.keys(u).length){let e=new AbortController;this.inFlightDependencies.push(e),d=r.sendAsync({type:`GG`,data:{stacks:u,source:this.source,tileID:this.tileID,type:`glyphs`}},e)}let f=Object.keys(c.iconDependencies),p=Promise.resolve({});if(f.length){let e=new AbortController;this.inFlightDependencies.push(e),p=r.sendAsync({type:`GI`,data:{icons:f,source:this.source,tileID:this.tileID,type:`icons`}},e)}let m=Object.keys(c.patternDependencies),h=Promise.resolve({});if(m.length){let e=new AbortController;this.inFlightDependencies.push(e),h=r.sendAsync({type:`GI`,data:{icons:m,source:this.source,tileID:this.tileID,type:`patterns`}},e)}let g=c.dashDependencies,_=Promise.resolve({});if(Object.keys(g).length){let e=new AbortController;this.inFlightDependencies.push(e),_=r.sendAsync({type:`GDA`,data:{dashes:g}},e)}let[v,y,b,x]=await Promise.all([d,p,h,_]),S=new Kx(v),C=new Qm(y,b);for(let e in s){let t=s[e];t instanceof Rh?(Jx(t.layers,this.zoom,n),Px({bucket:t,glyphMap:v,glyphPositions:S.positions,imageMap:y,imagePositions:C.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:c.subdivisionGranularity})):t.hasDependencies&&(t instanceof _d||t instanceof rf||t instanceof qp)&&(Jx(t.layers,this.zoom,n),t.addFeatures(c,this.tileID.canonical,C.patternPositions,x))}Line truncated
|
||||
//# sourceMappingURL=maplibre-gl-worker-CL9gHS1m.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"maplibre-gl-worker-CL9gHS1m.js","names":["se","le","ue","V","H","U","W","G","K","q","J","Y","X","Z","Q","$","z","h","ie","c","d","T","_","S","x","m","b","f","r","te","ee","N","v","P","n","E","ne","k","w","t","F","a","y","A","M","O","C","g","re","s","B","l","i","j","o","R","u","p","e","D"],"sources":["../../node_modules/maplibre-gl/dist/maplibre-gl-shared.mjs","../../node_modules/maplibre-gl/dist/maplibre-gl-worker.mjs"],"sourcesContent":["/**\n* MapLibre GL JS\n* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.7.0/LICENSE.txt\n*/\nvar e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function l(e,t){this.x=e,this.y=t}l.prototype={clone(){return new l(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:l},l.convert=function(e){if(e instanceof l)return e;if(Array.isArray(e))return new l(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new l(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};function u(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}}let d;function f(){return d??=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)&&typeof createImageBitmap==`function`,d}let p;function m(){if(p==null&&(p=!1,f())){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){p=!0;break}}}return p||!1}var h=typeof Float32Array<`u`?Float32Array:Array;Math.PI/180,180/Math.PI;function g(){var e=new h(9);return h!=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 _(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 v(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 y(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 b(){var e=new h(16);return h!=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 x(e){var t=new h(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=Line truncated
|
||||
@@ -0,0 +1,12 @@
|
||||
(function(){
|
||||
/**
|
||||
* MapLibre GL JS
|
||||
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.8.0/LICENSE.txt
|
||||
*/
|
||||
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function l(e,t){this.x=e,this.y=t}l.prototype={clone(){return new l(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:l},l.convert=function(e){if(e instanceof l)return e;if(Array.isArray(e))return new l(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new l(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};function u(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}}let d;function f(){return d??=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)&&typeof createImageBitmap==`function`,d}let p;function m(){if(p==null&&(p=!1,f())){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){p=!0;break}}}return p||!1}var h=typeof Float32Array<`u`?Float32Array:Array;Math.PI/180,180/Math.PI;function g(){var e=new h(9);return h!=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 _(){var e=new h(3);return h!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function v(e){var t=e[0],n=e[1],r=e[2];return Math.sqrt(t*t+n*n+r*r)}function y(e,t,n){var r=new h(3);return r[0]=e,r[1]=t,r[2]=n,r}function b(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 x(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function S(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}var C=v;(function(){var e=_();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 w(){var e=new h(4);return h!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function T(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 E(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}(function(){var e=w();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,Line truncated
|
||||
/**
|
||||
* MapLibre GL JS
|
||||
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.8.0/LICENSE.txt
|
||||
*/
|
||||
function Hx(e){let t=typeof e;if(t===`number`||t===`boolean`||t===`string`||e==null)return JSON.stringify(e);if(Array.isArray(e)){let t=`[`;for(let n of e)t+=`${Hx(n)},`;return`${t}]`}let n=Object.keys(e).sort(),r=`{`;for(let t=0;t<n.length;t++)r+=`${JSON.stringify(n[t])}:${Hx(e[n[t]])},`;return`${r}}`}function Ux(e){let t=``;for(let n of Ze)t+=`/${Hx(e[n])}`;return t}function Wx(e,t){let n={};for(let r=0;r<e.length;r++){let i=t&&t[e[r].id]||Ux(e[r]);t&&(t[e[r].id]=i);let a=n[i];a||=n[i]=[],a.push(e[r])}let r=[];for(let e in n)r.push(n[e]);return r}var Gx=class{constructor(e,t){this.keyCache={},e&&this.replace(e,t)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(e,t,n){for(let t of e){this._layerConfigs[t.id]=t;let e=this._layers[t.id]=Bg(t,n);e._featureFilter=fa(e.filter,`layers[${t.id}].filter`,n),this.keyCache[t.id]&&delete this.keyCache[t.id]}for(let e of t)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let r=Wx(Object.values(this._layerConfigs),this.keyCache);for(let e of r){let t=e.map(e=>this._layers[e.id]),n=t[0];if(n.isHidden())continue;let r=n.source||``,i=this.familiesBySource[r];i||=this.familiesBySource[r]={};let a=n.sourceLayer||`_geojsonTileLayer`,o=i[a];o||=i[a]=[],o.push(t)}}},Kx=class{constructor(e){let t={},n=[];for(let r in e){let i=e[r],a=t[r]={};for(let e in i){let t=i[e];if(!t||t.bitmap.width===0||t.bitmap.height===0)continue;let r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};n.push(r),a[e]={rect:r,metrics:t.metrics}}}let{w:r,h:i}=Xm(n),a=new Wl({width:r||1,height:i||1});for(let n in e){let r=e[n];for(let e in r){let i=r[e];if(!i||i.bitmap.width===0||i.bitmap.height===0)continue;let o=t[n][e].rect;Wl.copy(i.bitmap,a,{x:0,y:0},{x:o.x+1,y:o.y+1},i.bitmap)}}this.image=a,this.positions=t}};V(`GlyphAtlas`,Kx);var qx=class{constructor(e){this.tileID=new qg(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}async parse(e,t,n,r,i){this.data=e,this.collisionBoxArray=new Zs;let a=new d_(Object.keys(e.layers).sort()),o=new Lx(this.tileID,this.promoteId);o.bucketLayerIDs=[];let s={},c={featureIndex:o,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:n,subdivisionGranularity:i},l=t.familiesBySource[this.source];for(let t in l){let r=e.layers[t];if(!r)continue;r.version===1&&ge(`Vector tile source "${this.source}" layer "${t}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let i=a.encode(t),u=[];for(let e=0;e<r.length;e++){let n=r.feature(e),a=o.getId(n,t);u.push({feature:n,id:a,index:e,sourceLayerIndex:i})}for(let e of l[t]){let t=e[0];t.source!==this.source&&ge(`layer.source = ${t.source} does not equal this.source = ${this.source}`),!t.isHidden(this.zoom,!0)&&(Jx(e,this.zoom,n),(s[t.id]=t.createBucket({index:o.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:i,sourceID:this.source})).populate(u,c,this.tileID.canonical),o.bucketLayerIDs.push(e.map(e=>e.id)))}}let u=fe(c.glyphDependencies,e=>Object.keys(e));for(let e of this.inFlightDependencies)e?.abort();this.inFlightDependencies=[];let d=Promise.resolve({});if(Object.keys(u).length){let e=new AbortController;this.inFlightDependencies.push(e),d=r.sendAsync({type:`GG`,data:{stacks:u,source:this.source,tileID:this.tileID,type:`glyphs`}},e)}let f=Object.keys(c.iconDependencies),p=Promise.resolve({});if(f.length){let e=new AbortController;this.inFlightDependencies.push(e),p=r.sendAsync({type:`GI`,data:{icons:f,source:this.source,tileID:this.tileID,type:`icons`}},e)}let m=Object.keys(c.patternDependencies),h=Promise.resolve({});if(m.length){let e=new AbortController;this.inFlightDependencies.push(e),h=r.sendAsync({type:`GI`,data:{icons:m,source:this.source,tileID:this.tileID,type:`patterns`}},e)}let g=c.dashDependencies,_=Promise.resolve({});if(Object.keys(g).length){let e=new AbortController;this.inFlightDependencies.push(e),_=r.sendAsync({type:`GDA`,data:{dashes:g}},e)}let[v,y,b,x]=await Promise.all([d,p,h,_]),S=new Kx(v),C=new Qm(y,b);for(let e in s){let t=s[e];t.hasDependencies&&(Jx(t.layers,this.zoom,n),t.addFeatures({options:c,canonical:this.tileID.canonical,glyphMap:v,glyphPositions:S.positions,iconMap:y,iconPositions:C.iconPositions,patternMap:b,patternPositions:C.patternPositions,dashPositions:x,showCollisionBoxes:this.showCollisionBoxes}))}return{buckets:Object.values(s).filter(e=>!e.isEmpty()),featureIndex:o,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:SLine truncated
|
||||
//# sourceMappingURL=maplibre-gl-worker-CobTyBCT.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"maplibre-gl-worker-CobTyBCT.js","names":["V","H","U","W","G","K","q","J","Y","X","Z","Q","$","C","_","E","o","R","y","B","A","j","d","S","c","t","f","i","P","w","O","z","e","m","F","T","D","h","N","L","v","p","s","l","r","I","g","x","u","n","a","b"],"sources":["../../node_modules/maplibre-gl/dist/maplibre-gl-shared.mjs","../../node_modules/maplibre-gl/dist/maplibre-gl-worker.mjs"],"sourcesContent":["/**\n* MapLibre GL JS\n* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v6.8.0/LICENSE.txt\n*/\nvar e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));function l(e,t){this.x=e,this.y=t}l.prototype={clone(){return new l(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:l},l.convert=function(e){if(e instanceof l)return e;if(Array.isArray(e))return new l(+e[0],+e[1]);if(e.x!==void 0&&e.y!==void 0)return new l(+e.x,+e.y);throw Error(`Expected [x, y] or {x, y} point format`)};function u(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}}let d;function f(){return d??=typeof OffscreenCanvas<`u`&&new OffscreenCanvas(1,1).getContext(`2d`)&&typeof createImageBitmap==`function`,d}let p;function m(){if(p==null&&(p=!1,f())){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){p=!0;break}}}return p||!1}var h=typeof Float32Array<`u`?Float32Array:Array;Math.PI/180,180/Math.PI;function g(){var e=new h(9);return h!=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 _(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 v(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 y(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 b(){var e=new h(16);return h!=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 x(e){var t=new h(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]=Line truncated
|
||||
Reference in new issue
Block a user