react-three-map 0.0.0 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +17 -7
  2. package/dist/cjs/main.js.js +1 -0
  3. package/dist/es/main.js.mjs +5 -0
  4. package/dist/es/main.js.mjs.map +1 -0
  5. package/dist/es/main.js10.mjs +40 -0
  6. package/dist/es/main.js10.mjs.map +1 -0
  7. package/dist/es/main.js11.mjs +13 -0
  8. package/dist/es/main.js11.mjs.map +1 -0
  9. package/dist/es/main.js12.mjs +13 -0
  10. package/dist/es/main.js12.mjs.map +1 -0
  11. package/dist/es/main.js13.mjs +31 -0
  12. package/dist/es/main.js13.mjs.map +1 -0
  13. package/dist/es/main.js14.mjs +13 -0
  14. package/dist/es/main.js14.mjs.map +1 -0
  15. package/dist/es/main.js15.mjs +15 -0
  16. package/dist/es/main.js15.mjs.map +1 -0
  17. package/dist/es/main.js16.mjs +14 -0
  18. package/dist/es/main.js16.mjs.map +1 -0
  19. package/dist/es/main.js17.mjs +56 -0
  20. package/dist/es/main.js17.mjs.map +1 -0
  21. package/dist/es/main.js18.mjs +9 -0
  22. package/dist/es/main.js18.mjs.map +1 -0
  23. package/dist/es/main.js19.mjs +320 -0
  24. package/dist/es/main.js19.mjs.map +1 -0
  25. package/dist/es/main.js2.mjs +40 -0
  26. package/dist/es/main.js2.mjs.map +1 -0
  27. package/dist/es/main.js20.mjs +72 -0
  28. package/dist/es/main.js20.mjs.map +1 -0
  29. package/dist/es/main.js21.mjs +6 -0
  30. package/dist/es/main.js21.mjs.map +1 -0
  31. package/dist/es/main.js22.mjs +19 -0
  32. package/dist/es/main.js22.mjs.map +1 -0
  33. package/dist/es/main.js23.mjs +14 -0
  34. package/dist/es/main.js23.mjs.map +1 -0
  35. package/dist/es/main.js24.mjs +34 -0
  36. package/dist/es/main.js24.mjs.map +1 -0
  37. package/dist/es/main.js25.mjs +15 -0
  38. package/dist/es/main.js25.mjs.map +1 -0
  39. package/dist/es/main.js26.mjs +8 -0
  40. package/dist/es/main.js26.mjs.map +1 -0
  41. package/dist/es/main.js27.mjs +41 -0
  42. package/dist/es/main.js27.mjs.map +1 -0
  43. package/dist/es/main.js28.mjs +26 -0
  44. package/dist/es/main.js28.mjs.map +1 -0
  45. package/dist/es/main.js3.mjs +21 -0
  46. package/dist/es/main.js3.mjs.map +1 -0
  47. package/dist/es/main.js4.mjs +11 -0
  48. package/dist/es/main.js4.mjs.map +1 -0
  49. package/dist/es/main.js5.mjs +53 -0
  50. package/dist/es/main.js5.mjs.map +1 -0
  51. package/dist/es/main.js6.mjs +16 -0
  52. package/dist/es/main.js6.mjs.map +1 -0
  53. package/dist/es/main.js7.mjs +62 -0
  54. package/dist/es/main.js7.mjs.map +1 -0
  55. package/dist/es/main.js8.mjs +58 -0
  56. package/dist/es/main.js8.mjs.map +1 -0
  57. package/dist/es/main.js9.mjs +49 -0
  58. package/dist/es/main.js9.mjs.map +1 -0
  59. package/dist/es/vite.svg +1 -0
  60. package/index.html +13 -0
  61. package/package.json +16 -15
  62. package/src/canvas/canvas.tsx +49 -0
  63. package/src/canvas/coords-to-matrix.ts +19 -0
  64. package/src/canvas/create-events.ts +73 -0
  65. package/src/canvas/state-ref.ts +9 -0
  66. package/src/canvas/use-function.ts +10 -0
  67. package/src/canvas/use-on-add.ts +67 -0
  68. package/src/canvas/use-render.ts +27 -0
  69. package/src/main.ts +1 -0
  70. package/src/stories/canvas.stories.tsx +28 -0
  71. package/src/stories/my-scene.tsx +83 -0
  72. package/src/stories/no-map.stories.tsx +12 -0
  73. package/src/vite-env.d.ts +1 -0
  74. package/tsconfig.json +25 -0
  75. package/tsconfig.node.json +10 -0
  76. package/dist/my-lib.es.js +0 -1538
  77. package/dist/my-lib.umd.js +0 -27
  78. /package/dist/{vite.svg → cjs/vite.svg} +0 -0
@@ -1,27 +0,0 @@
1
- (function(P,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react"),require("@react-three/fiber"),require("react-dom"),require("three"),require("maplibre-gl")):typeof define=="function"&&define.amd?define(["exports","react","@react-three/fiber","react-dom","three","maplibre-gl"],m):(P=typeof globalThis<"u"?globalThis:P||self,m(P.MyLib={},P.React,P.fiber,P.reactDom,P.THREE,P.maplibreGl))})(this,function(P,m,ne,ge,W,rt){"use strict";function ye(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return n.default=e,Object.freeze(n)}const z=ye(m),ot=ye(W);var re={exports:{}},q={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var _e;function it(){if(_e)return q;_e=1;var e=m,n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function s(f,c,d){var v,p={},S=null,x=null;d!==void 0&&(S=""+d),c.key!==void 0&&(S=""+c.key),c.ref!==void 0&&(x=c.ref);for(v in c)r.call(c,v)&&!a.hasOwnProperty(v)&&(p[v]=c[v]);if(f&&f.defaultProps)for(v in c=f.defaultProps,c)p[v]===void 0&&(p[v]=c[v]);return{$$typeof:n,type:f,key:S,ref:x,props:p,_owner:i.current}}return q.Fragment=o,q.jsx=s,q.jsxs=s,q}var B={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Ee;function at(){return Ee||(Ee=1,process.env.NODE_ENV!=="production"&&function(){var e=m,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),f=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),M=Symbol.iterator,J="@@iterator";function ue(t){if(t===null||typeof t!="object")return null;var u=M&&t[M]||t[J];return typeof u=="function"?u:null}var L=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(t){{for(var u=arguments.length,l=new Array(u>1?u-1:0),h=1;h<u;h++)l[h-1]=arguments[h];O("error",t,l)}}function O(t,u,l){{var h=L.ReactDebugCurrentFrame,_=h.getStackAddendum();_!==""&&(u+="%s",l=l.concat([_]));var E=l.map(function(y){return String(y)});E.unshift("Warning: "+u),Function.prototype.apply.call(console[t],console,E)}}var T=!1,A=!1,Vt=!1,$t=!1,Yt=!1,je;je=Symbol.for("react.module.reference");function qt(t){return!!(typeof t=="string"||typeof t=="function"||t===r||t===a||Yt||t===i||t===d||t===v||$t||t===x||T||A||Vt||typeof t=="object"&&t!==null&&(t.$$typeof===S||t.$$typeof===p||t.$$typeof===s||t.$$typeof===f||t.$$typeof===c||t.$$typeof===je||t.getModuleId!==void 0))}function Bt(t,u,l){var h=t.displayName;if(h)return h;var _=u.displayName||u.name||"";return _!==""?l+"("+_+")":l}function Ae(t){return t.displayName||"Context"}function F(t){if(t==null)return null;if(typeof t.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case r:return"Fragment";case o:return"Portal";case a:return"Profiler";case i:return"StrictMode";case d:return"Suspense";case v:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case f:var u=t;return Ae(u)+".Consumer";case s:var l=t;return Ae(l._context)+".Provider";case c:return Bt(t,t.render,"ForwardRef");case p:var h=t.displayName||null;return h!==null?h:F(t.type)||"Memo";case S:{var _=t,E=_._payload,y=_._init;try{return F(y(E))}catch{return null}}}return null}var N=Object.assign,Z=0,Fe,De,ze,Ie,Ne,We,Ue;function Ve(){}Ve.__reactDisabledLog=!0;function Ht(){{if(Z===0){Fe=console.log,De=console.info,ze=console.warn,Ie=console.error,Ne=console.group,We=console.groupCollapsed,Ue=console.groupEnd;var t={configurable:!0,enumerable:!0,value:Ve,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}Z++}}function Zt(){{if(Z--,Z===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},t,{value:Fe}),info:N({},t,{value:De}),warn:N({},t,{value:ze}),error:N({},t,{value:Ie}),group:N({},t,{value:Ne}),groupCollapsed:N({},t,{value:We}),groupEnd:N({},t,{value:Ue})})}Z<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ce=L.ReactCurrentDispatcher,le;function K(t,u,l){{if(le===void 0)try{throw Error()}catch(_){var h=_.stack.trim().match(/\n( *(at )?)/);le=h&&h[1]||""}return`
18
- `+le+t}}var fe=!1,Q;{var Gt=typeof WeakMap=="function"?WeakMap:Map;Q=new Gt}function $e(t,u){if(!t||fe)return"";{var l=Q.get(t);if(l!==void 0)return l}var h;fe=!0;var _=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var E;E=ce.current,ce.current=null,Ht();try{if(u){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(D){h=D}Reflect.construct(t,[],y)}else{try{y.call()}catch(D){h=D}t.call(y.prototype)}}else{try{throw Error()}catch(D){h=D}t()}}catch(D){if(D&&h&&typeof D.stack=="string"){for(var g=D.stack.split(`
19
- `),R=h.stack.split(`
20
- `),C=g.length-1,w=R.length-1;C>=1&&w>=0&&g[C]!==R[w];)w--;for(;C>=1&&w>=0;C--,w--)if(g[C]!==R[w]){if(C!==1||w!==1)do if(C--,w--,w<0||g[C]!==R[w]){var k=`
21
- `+g[C].replace(" at new "," at ");return t.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",t.displayName)),typeof t=="function"&&Q.set(t,k),k}while(C>=1&&w>=0);break}}}finally{fe=!1,ce.current=E,Zt(),Error.prepareStackTrace=_}var Y=t?t.displayName||t.name:"",nt=Y?K(Y):"";return typeof t=="function"&&Q.set(t,nt),nt}function Jt(t,u,l){return $e(t,!1)}function Kt(t){var u=t.prototype;return!!(u&&u.isReactComponent)}function X(t,u,l){if(t==null)return"";if(typeof t=="function")return $e(t,Kt(t));if(typeof t=="string")return K(t);switch(t){case d:return K("Suspense");case v:return K("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case c:return Jt(t.render);case p:return X(t.type,u,l);case S:{var h=t,_=h._payload,E=h._init;try{return X(E(_),u,l)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,Ye={},qe=L.ReactDebugCurrentFrame;function te(t){if(t){var u=t._owner,l=X(t.type,t._source,u?u.type:null);qe.setExtraStackFrame(l)}else qe.setExtraStackFrame(null)}function Qt(t,u,l,h,_){{var E=Function.call.bind(ee);for(var y in t)if(E(t,y)){var g=void 0;try{if(typeof t[y]!="function"){var R=Error((h||"React class")+": "+l+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}g=t[y](u,y,h,l,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(C){g=C}g&&!(g instanceof Error)&&(te(_),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",h||"React class",l,y,typeof g),te(null)),g instanceof Error&&!(g.message in Ye)&&(Ye[g.message]=!0,te(_),b("Failed %s type: %s",l,g.message),te(null))}}}var Xt=Array.isArray;function de(t){return Xt(t)}function en(t){{var u=typeof Symbol=="function"&&Symbol.toStringTag,l=u&&t[Symbol.toStringTag]||t.constructor.name||"Object";return l}}function tn(t){try{return Be(t),!1}catch{return!0}}function Be(t){return""+t}function He(t){if(tn(t))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",en(t)),Be(t)}var G=L.ReactCurrentOwner,nn={key:!0,ref:!0,__self:!0,__source:!0},Ze,Ge,me;me={};function rn(t){if(ee.call(t,"ref")){var u=Object.getOwnPropertyDescriptor(t,"ref").get;if(u&&u.isReactWarning)return!1}return t.ref!==void 0}function on(t){if(ee.call(t,"key")){var u=Object.getOwnPropertyDescriptor(t,"key").get;if(u&&u.isReactWarning)return!1}return t.key!==void 0}function an(t,u){if(typeof t.ref=="string"&&G.current&&u&&G.current.stateNode!==u){var l=F(G.current.type);me[l]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',F(G.current.type),t.ref),me[l]=!0)}}function sn(t,u){{var l=function(){Ze||(Ze=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};l.isReactWarning=!0,Object.defineProperty(t,"key",{get:l,configurable:!0})}}function un(t,u){{var l=function(){Ge||(Ge=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",u))};l.isReactWarning=!0,Object.defineProperty(t,"ref",{get:l,configurable:!0})}}var cn=function(t,u,l,h,_,E,y){var g={$$typeof:n,type:t,key:u,ref:l,props:y,_owner:E};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function ln(t,u,l,h,_){{var E,y={},g=null,R=null;l!==void 0&&(He(l),g=""+l),on(u)&&(He(u.key),g=""+u.key),rn(u)&&(R=u.ref,an(u,_));for(E in u)ee.call(u,E)&&!nn.hasOwnProperty(E)&&(y[E]=u[E]);if(t&&t.defaultProps){var C=t.defaultProps;for(E in C)y[E]===void 0&&(y[E]=C[E])}if(g||R){var w=typeof t=="function"?t.displayName||t.name||"Unknown":t;g&&sn(y,w),R&&un(y,w)}return cn(t,g,R,_,h,G.current,y)}}var ve=L.ReactCurrentOwner,Je=L.ReactDebugCurrentFrame;function $(t){if(t){var u=t._owner,l=X(t.type,t._source,u?u.type:null);Je.setExtraStackFrame(l)}else Je.setExtraStackFrame(null)}var he;he=!1;function pe(t){return typeof t=="object"&&t!==null&&t.$$typeof===n}function Ke(){{if(ve.current){var t=F(ve.current.type);if(t)return`
22
-
23
- Check the render method of \``+t+"`."}return""}}function fn(t){{if(t!==void 0){var u=t.fileName.replace(/^.*[\\\/]/,""),l=t.lineNumber;return`
24
-
25
- Check your code at `+u+":"+l+"."}return""}}var Qe={};function dn(t){{var u=Ke();if(!u){var l=typeof t=="string"?t:t.displayName||t.name;l&&(u=`
26
-
27
- Check the top-level render call using <`+l+">.")}return u}}function Xe(t,u){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var l=dn(u);if(Qe[l])return;Qe[l]=!0;var h="";t&&t._owner&&t._owner!==ve.current&&(h=" It was passed a child from "+F(t._owner.type)+"."),$(t),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',l,h),$(null)}}function et(t,u){{if(typeof t!="object")return;if(de(t))for(var l=0;l<t.length;l++){var h=t[l];pe(h)&&Xe(h,u)}else if(pe(t))t._store&&(t._store.validated=!0);else if(t){var _=ue(t);if(typeof _=="function"&&_!==t.entries)for(var E=_.call(t),y;!(y=E.next()).done;)pe(y.value)&&Xe(y.value,u)}}}function mn(t){{var u=t.type;if(u==null||typeof u=="string")return;var l;if(typeof u=="function")l=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===c||u.$$typeof===p))l=u.propTypes;else return;if(l){var h=F(u);Qt(l,t.props,"prop",h,t)}else if(u.PropTypes!==void 0&&!he){he=!0;var _=F(u);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",_||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function vn(t){{for(var u=Object.keys(t.props),l=0;l<u.length;l++){var h=u[l];if(h!=="children"&&h!=="key"){$(t),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",h),$(null);break}}t.ref!==null&&($(t),b("Invalid attribute `ref` supplied to `React.Fragment`."),$(null))}}function tt(t,u,l,h,_,E){{var y=qt(t);if(!y){var g="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(g+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R=fn(_);R?g+=R:g+=Ke();var C;t===null?C="null":de(t)?C="array":t!==void 0&&t.$$typeof===n?(C="<"+(F(t.type)||"Unknown")+" />",g=" Did you accidentally export a JSX literal instead of a component?"):C=typeof t,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",C,g)}var w=ln(t,u,l,_,E);if(w==null)return w;if(y){var k=u.children;if(k!==void 0)if(h)if(de(k)){for(var Y=0;Y<k.length;Y++)et(k[Y],t);Object.freeze&&Object.freeze(k)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else et(k,t)}return t===r?vn(w):mn(w),w}}function hn(t,u,l){return tt(t,u,l,!0)}function pn(t,u,l){return tt(t,u,l,!1)}var gn=pn,yn=hn;B.Fragment=r,B.jsx=gn,B.jsxs=yn}()),B}process.env.NODE_ENV==="production"?re.exports=it():re.exports=at();var oe=re.exports;const be=z.createContext(null);function st(){var e;const n=(e=m.useContext(be))===null||e===void 0?void 0:e.maps,o=m.useContext(V);return m.useMemo(()=>({...n,current:o==null?void 0:o.map}),[n,o])}function ut(e){const n=e.clone();return n.pixelsToGLUnits=e.pixelsToGLUnits,n}function Ce(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function we(e,n){const o=n.viewState||n;let r=!1;if("longitude"in o&&"latitude"in o){const i=e.center;e.center=new i.constructor(o.longitude,o.latitude),r=r||i!==e.center}if("zoom"in o){const i=e.zoom;e.zoom=o.zoom,r=r||i!==e.zoom}if("bearing"in o){const i=e.bearing;e.bearing=o.bearing,r=r||i!==e.bearing}if("pitch"in o){const i=e.pitch;e.pitch=o.pitch,r=r||i!==e.pitch}return o.padding&&!e.isPaddingEqual(o.padding)&&(r=!0,e.padding=o.padding),r}const ct=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Se(e){if(!e)return null;if(typeof e=="string"||("toJS"in e&&(e=e.toJS()),!e.layers))return e;const n={};for(const r of e.layers)n[r.id]=r;const o=e.layers.map(r=>{let i=null;"interactive"in r&&(i=Object.assign({},r),delete i.interactive);const a=n[r.ref];if(a){i=i||Object.assign({},r),delete i.ref;for(const s of ct)s in a&&(i[s]=a[s])}return i||r});return{...e,layers:o}}function lt(e,n){const o=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(n)?n[0]:n?n.x:0,a=Array.isArray(n)?n[1]:n?n.y:0;return o===i&&r===a}function j(e,n){if(e===n)return!0;if(!e||!n)return!1;if(Array.isArray(e)){if(!Array.isArray(n)||e.length!==n.length)return!1;for(let o=0;o<e.length;o++)if(!j(e[o],n[o]))return!1;return!0}else if(Array.isArray(n))return!1;if(typeof e=="object"&&typeof n=="object"){const o=Object.keys(e),r=Object.keys(n);if(o.length!==r.length)return!1;for(const i of o)if(!n.hasOwnProperty(i)||!j(e[i],n[i]))return!1;return!0}return!1}const Te={version:8,sources:{},layers:[]},xe={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},ie={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},Me={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},ft=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],dt=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class U{constructor(n,o,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=i=>{const a=this.props[Me[i.type]];a?a(i):i.type==="error"&&console.error(i.error)},this._onPointerEvent=i=>{(i.type==="mousemove"||i.type==="mouseout")&&this._updateHover(i);const a=this.props[xe[i.type]];a&&(this.props.interactiveLayerIds&&i.type!=="mouseover"&&i.type!=="mouseout"&&(i.features=this._hoveredFeatures||this._queryRenderedFeatures(i.point)),a(i),delete i.features)},this._onCameraEvent=i=>{if(!this._internalUpdate){const a=this.props[ie[i.type]];a&&a(i)}i.type in this._deferredEvents&&(this._deferredEvents[i.type]=!1)},this._MapClass=n,this.props=o,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(n){const o=this.props;this.props=n;const r=this._updateSettings(n,o);r&&this._createShadowTransform(this._map);const i=this._updateSize(n),a=this._updateViewState(n,!0);this._updateStyle(n,o),this._updateStyleComponents(n,o),this._updateHandlers(n,o),(r||i||a&&!this._map.isMoving())&&this.redraw()}static reuse(n,o){const r=U.savedMaps.pop();if(!r)return null;const i=r.map,a=i.getContainer();for(o.className=a.className;a.childNodes.length>0;)o.appendChild(a.childNodes[0]);i._container=o;const s=i._resizeObserver;s&&(s.disconnect(),s.observe(o)),r.setProps({...n,styleDiffing:!1}),i.resize();const{initialViewState:f}=n;return f&&(f.bounds?i.fitBounds(f.bounds,{...f.fitBoundsOptions,duration:0}):r._updateViewState(f,!1)),i.isStyleLoaded()?i.fire("load"):i.once("styledata",()=>i.fire("load")),i._update(),r}_initialize(n){const{props:o}=this,{mapStyle:r=Te}=o,i={...o,...o.initialViewState,accessToken:o.mapboxAccessToken||mt()||null,container:n,style:Se(r)},a=i.initialViewState||i.viewState||i;if(Object.assign(i,{center:[a.longitude||0,a.latitude||0],zoom:a.zoom||0,pitch:a.pitch||0,bearing:a.bearing||0}),o.gl){const v=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=v,o.gl)}const s=new this._MapClass(i);a.padding&&s.setPadding(a.padding),o.cursor&&(s.getCanvas().style.cursor=o.cursor),this._createShadowTransform(s);const f=s._render;s._render=v=>{this._inRender=!0,f.call(s,v),this._inRender=!1};const c=s._renderTaskQueue.run;s._renderTaskQueue.run=v=>{c.call(s._renderTaskQueue,v),this._onBeforeRepaint()},s.on("render",()=>this._onAfterRepaint());const d=s.fire;s.fire=this._fireEvent.bind(this,d),s.on("resize",()=>{this._renderTransform.resize(s.transform.width,s.transform.height)}),s.on("styledata",()=>this._updateStyleComponents(this.props,{})),s.on("sourcedata",()=>this._updateStyleComponents(this.props,{}));for(const v in xe)s.on(v,this._onPointerEvent);for(const v in ie)s.on(v,this._onCameraEvent);for(const v in Me)s.on(v,this._onEvent);this._map=s}recycle(){const o=this.map.getContainer().querySelector("[mapboxgl-children]");o==null||o.remove(),U.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){const n=this._map;!this._inRender&&n.style&&(n._frame&&(n._frame.cancel(),n._frame=null),n._render())}_createShadowTransform(n){const o=ut(n.transform);n.painter.transform=o,this._renderTransform=o}_updateSize(n){const{viewState:o}=n;if(o){const r=this._map;if(o.width!==r.transform.width||o.height!==r.transform.height)return r.resize(),!0}return!1}_updateViewState(n,o){if(this._internalUpdate)return!1;const r=this._map,i=this._renderTransform,{zoom:a,pitch:s,bearing:f}=i,c=r.isMoving();c&&(i.cameraElevationReference="sea");const d=we(i,{...Ce(r.transform),...n});if(c&&(i.cameraElevationReference="ground"),d&&o){const v=this._deferredEvents;v.move=!0,v.zoom||(v.zoom=a!==i.zoom),v.rotate||(v.rotate=f!==i.bearing),v.pitch||(v.pitch=s!==i.pitch)}return c||we(r.transform,n),d}_updateSettings(n,o){const r=this._map;let i=!1;for(const a of ft)if(a in n&&!j(n[a],o[a])){i=!0;const s=r[`set${a[0].toUpperCase()}${a.slice(1)}`];s==null||s(n[a])}return i}_updateStyle(n,o){if(n.cursor!==o.cursor&&(this._map.getCanvas().style.cursor=n.cursor),n.mapStyle!==o.mapStyle){const{mapStyle:r=Te,styleDiffing:i=!0}=n,a={diff:i};return"localIdeographFontFamily"in n&&(a.localIdeographFontFamily=n.localIdeographFontFamily),this._map.setStyle(Se(r),a),!0}return!1}_updateStyleComponents(n,o){const r=this._map;let i=!1;return r.isStyleLoaded()&&("light"in n&&r.setLight&&!j(n.light,o.light)&&(i=!0,r.setLight(n.light)),"fog"in n&&r.setFog&&!j(n.fog,o.fog)&&(i=!0,r.setFog(n.fog)),"terrain"in n&&r.setTerrain&&!j(n.terrain,o.terrain)&&(!n.terrain||r.getSource(n.terrain.source))&&(i=!0,r.setTerrain(n.terrain))),i}_updateHandlers(n,o){var r,i;const a=this._map;let s=!1;for(const f of dt){const c=(r=n[f])!==null&&r!==void 0?r:!0,d=(i=o[f])!==null&&i!==void 0?i:!0;j(c,d)||(s=!0,c?a[f].enable(c):a[f].disable())}return s}_queryRenderedFeatures(n){const o=this._map,{interactiveLayerIds:r=[]}=this.props;try{return o.queryRenderedFeatures(n,{layers:r.filter(o.getLayer.bind(o))})}catch{return[]}}_updateHover(n){var o;const{props:r}=this;if(r.interactiveLayerIds&&(r.onMouseMove||r.onMouseEnter||r.onMouseLeave)){const a=n.type,s=((o=this._hoveredFeatures)===null||o===void 0?void 0:o.length)>0,f=this._queryRenderedFeatures(n.point),c=f.length>0;!c&&s&&(n.type="mouseleave",this._onPointerEvent(n)),this._hoveredFeatures=f,c&&!s&&(n.type="mouseenter",this._onPointerEvent(n)),n.type=a}else this._hoveredFeatures=null}_fireEvent(n,o,r){const i=this._map,a=i.transform,s=typeof o=="string"?o:o.type;return s==="move"&&this._updateViewState(this.props,!1),s in ie&&(typeof o=="object"&&(o.viewState=Ce(a)),this._map.isMoving())?(i.transform=this._renderTransform,n.call(i,o,r),i.transform=a,i):(n.call(i,o,r),i)}_onBeforeRepaint(){const n=this._map;this._internalUpdate=!0;for(const r in this._deferredEvents)this._deferredEvents[r]&&n.fire(r);this._internalUpdate=!1;const o=this._map.transform;this._map.transform=this._renderTransform,this._onAfterRepaint=()=>{this._map.transform=o}}}U.savedMaps=[];function mt(){let e=null;if(typeof location<"u"){const n=/access_token=([^&\/]*)/.exec(location.search);e=n&&n[1]}try{e=e||process.env.MapboxAccessToken}catch{}try{e=e||process.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}const vt=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"];function ht(e){if(!e)return null;const n=e.map,o={getMap:()=>n,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{const i=n.transform;n.transform=e.transform;const a=n.project(r);return n.transform=i,a},unproject:r=>{const i=n.transform;n.transform=e.transform;const a=n.unproject(r);return n.transform=i,a},queryTerrainElevation:(r,i)=>{const a=n.transform;n.transform=e.transform;const s=n.queryTerrainElevation(r,i);return n.transform=a,s}};for(const r of pt(n))!(r in o)&&!vt.includes(r)&&(o[r]=n[r].bind(n));return o}function pt(e){const n=new Set;let o=e;for(;o;){for(const r of Object.getOwnPropertyNames(o))r[0]!=="_"&&typeof e[r]=="function"&&r!=="fire"&&r!=="setEventedParent"&&n.add(r);o=Object.getPrototypeOf(o)}return Array.from(n)}const gt=typeof document<"u"?m.useLayoutEffect:m.useEffect,yt=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"];function _t(e,n){for(const r of yt)r in n&&(e[r]=n[r]);const{RTLTextPlugin:o="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=n;o&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()==="unavailable"&&e.setRTLTextPlugin(o,r=>{r&&console.error(r)},!1)}const V=z.createContext(null);function Et(e,n,o){const r=m.useContext(be),[i,a]=m.useState(null),s=m.useRef(),{current:f}=m.useRef({mapLib:null,map:null});m.useEffect(()=>{const v=e.mapLib;let p=!0,S;return Promise.resolve(v||o).then(x=>{if(!p)return;if(!x)throw new Error("Invalid mapLib");const M="Map"in x?x:x.default;if(!M.Map)throw new Error("Invalid mapLib");if(_t(M,e),!M.supported||M.supported(e))e.reuseMaps&&(S=U.reuse(e,s.current)),S||(S=new U(M.Map,e,s.current)),f.map=ht(S),f.mapLib=M,a(S),r==null||r.onMapMount(f.map,e.id);else throw new Error("Map is not supported by this browser")}).catch(x=>{const{onError:M}=e;M?M({type:"error",target:null,originalEvent:null,error:x}):console.error(x)}),()=>{p=!1,S&&(r==null||r.onMapUnmount(e.id),e.reuseMaps?S.recycle():S.destroy())}},[]),gt(()=>{i&&i.setProps(e)}),m.useImperativeHandle(n,()=>f.map,[i]);const c=m.useMemo(()=>({position:"relative",width:"100%",height:"100%",...e.style}),[e.style]),d={height:"100%"};return z.createElement("div",{id:e.id,ref:s,style:c},i&&z.createElement(V.Provider,{value:f},z.createElement("div",{"mapboxgl-children":"",style:d},e.children)))}const bt=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function I(e,n){if(!e||!n)return;const o=e.style;for(const r in n){const i=n[r];Number.isFinite(i)&&!bt.test(r)?o[r]=`${i}px`:o[r]=i}}function Ct(e,n){const{map:o,mapLib:r}=m.useContext(V),i=m.useRef({props:e});i.current.props=e;const a=m.useMemo(()=>{let J=!1;z.Children.forEach(e.children,b=>{b&&(J=!0)});const ue={...e,element:J?document.createElement("div"):null},L=new r.Marker(ue);return L.setLngLat([e.longitude,e.latitude]),L.getElement().addEventListener("click",b=>{var O,T;(T=(O=i.current.props).onClick)===null||T===void 0||T.call(O,{type:"click",target:L,originalEvent:b})}),L.on("dragstart",b=>{var O,T;const A=b;A.lngLat=a.getLngLat(),(T=(O=i.current.props).onDragStart)===null||T===void 0||T.call(O,A)}),L.on("drag",b=>{var O,T;const A=b;A.lngLat=a.getLngLat(),(T=(O=i.current.props).onDrag)===null||T===void 0||T.call(O,A)}),L.on("dragend",b=>{var O,T;const A=b;A.lngLat=a.getLngLat(),(T=(O=i.current.props).onDragEnd)===null||T===void 0||T.call(O,A)}),L},[]);m.useEffect(()=>(a.addTo(o.getMap()),()=>{a.remove()}),[]);const{longitude:s,latitude:f,offset:c,style:d,draggable:v=!1,popup:p=null,rotation:S=0,rotationAlignment:x="auto",pitchAlignment:M="auto"}=e;return m.useEffect(()=>{I(a.getElement(),d)},[d]),m.useImperativeHandle(n,()=>a,[]),(a.getLngLat().lng!==s||a.getLngLat().lat!==f)&&a.setLngLat([s,f]),c&&!lt(a.getOffset(),c)&&a.setOffset(c),a.isDraggable()!==v&&a.setDraggable(v),a.getRotation()!==S&&a.setRotation(S),a.getRotationAlignment()!==x&&a.setRotationAlignment(x),a.getPitchAlignment()!==M&&a.setPitchAlignment(M),a.getPopup()!==p&&a.setPopup(p),ge.createPortal(e.children,a.getElement())}m.memo(m.forwardRef(Ct));function Re(e){return new Set(e?e.trim().split(/\s+/):[])}function wt(e,n){const{map:o,mapLib:r}=m.useContext(V),i=m.useMemo(()=>document.createElement("div"),[]),a=m.useRef({props:e});a.current.props=e;const s=m.useMemo(()=>{const f={...e},c=new r.Popup(f);return c.setLngLat([e.longitude,e.latitude]),c.once("open",d=>{var v,p;(p=(v=a.current.props).onOpen)===null||p===void 0||p.call(v,d)}),c},[]);if(m.useEffect(()=>{const f=c=>{var d,v;(v=(d=a.current.props).onClose)===null||v===void 0||v.call(d,c)};return s.on("close",f),s.setDOMContent(i).addTo(o.getMap()),()=>{s.off("close",f),s.isOpen()&&s.remove()}},[]),m.useEffect(()=>{I(s.getElement(),e.style)},[e.style]),m.useImperativeHandle(n,()=>s,[]),s.isOpen()&&((s.getLngLat().lng!==e.longitude||s.getLngLat().lat!==e.latitude)&&s.setLngLat([e.longitude,e.latitude]),e.offset&&!j(s.options.offset,e.offset)&&s.setOffset(e.offset),(s.options.anchor!==e.anchor||s.options.maxWidth!==e.maxWidth)&&(s.options.anchor=e.anchor,s.setMaxWidth(e.maxWidth)),s.options.className!==e.className)){const f=Re(s.options.className),c=Re(e.className);for(const d of f)c.has(d)||s.removeClassName(d);for(const d of c)f.has(d)||s.addClassName(d);s.options.className=e.className}return ge.createPortal(e.children,i)}m.memo(m.forwardRef(wt));function H(e,n,o,r){const i=m.useContext(V),a=m.useMemo(()=>e(i),[]);return m.useEffect(()=>{const s=r||o||n,f=typeof n=="function"&&typeof o=="function"?n:null,c=typeof o=="function"?o:typeof n=="function"?n:null,{map:d}=i;return d.hasControl(a)||(d.addControl(a,s==null?void 0:s.position),f&&f(i)),()=>{c&&c(i),d.hasControl(a)&&d.removeControl(a)}},[]),a}function St(e){const n=H(({mapLib:o})=>new o.AttributionControl(e),{position:e.position});return m.useEffect(()=>{I(n._container,e.style)},[e.style]),null}m.memo(St);function Tt(e){const n=H(({mapLib:o})=>new o.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return m.useEffect(()=>{I(n._controlContainer,e.style)},[e.style]),null}m.memo(Tt);function xt(e,n){const o=m.useRef({props:e}),r=H(({mapLib:i})=>{const a=new i.GeolocateControl(e),s=a._setupUI;return a._setupUI=f=>{a._container.hasChildNodes()||s(f)},a.on("geolocate",f=>{var c,d;(d=(c=o.current.props).onGeolocate)===null||d===void 0||d.call(c,f)}),a.on("error",f=>{var c,d;(d=(c=o.current.props).onError)===null||d===void 0||d.call(c,f)}),a.on("outofmaxbounds",f=>{var c,d;(d=(c=o.current.props).onOutOfMaxBounds)===null||d===void 0||d.call(c,f)}),a.on("trackuserlocationstart",f=>{var c,d;(d=(c=o.current.props).onTrackUserLocationStart)===null||d===void 0||d.call(c,f)}),a.on("trackuserlocationend",f=>{var c,d;(d=(c=o.current.props).onTrackUserLocationEnd)===null||d===void 0||d.call(c,f)}),a},{position:e.position});return o.current.props=e,m.useImperativeHandle(n,()=>r,[]),m.useEffect(()=>{I(r._container,e.style)},[e.style]),null}m.memo(m.forwardRef(xt));function Mt(e){const n=H(({mapLib:o})=>new o.NavigationControl(e),{position:e.position});return m.useEffect(()=>{I(n._container,e.style)},[e.style]),null}m.memo(Mt);function Rt(e){const n=H(({mapLib:a})=>new a.ScaleControl(e),{position:e.position}),o=m.useRef(e),r=o.current;o.current=e;const{style:i}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(n.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&n.setUnit(e.unit),m.useEffect(()=>{I(n._container,i)},[i]),null}m.memo(Rt);function Le(e,n){if(!e)throw new Error(n)}function Lt(e,n,o,r){if(Le(o.id===r.id,"layer id changed"),Le(o.type===r.type,"layer type changed"),o.type==="custom"||r.type==="custom")return;const{layout:i={},paint:a={},filter:s,minzoom:f,maxzoom:c,beforeId:d}=o;if(d!==r.beforeId&&e.moveLayer(n,d),i!==r.layout){const v=r.layout||{};for(const p in i)j(i[p],v[p])||e.setLayoutProperty(n,p,i[p]);for(const p in v)i.hasOwnProperty(p)||e.setLayoutProperty(n,p,void 0)}if(a!==r.paint){const v=r.paint||{};for(const p in a)j(a[p],v[p])||e.setPaintProperty(n,p,a[p]);for(const p in v)a.hasOwnProperty(p)||e.setPaintProperty(n,p,void 0)}j(s,r.filter)||e.setFilter(n,s),(f!==r.minzoom||c!==r.maxzoom)&&e.setLayerZoomRange(n,f,c)}function Ot(e,n,o){if(e.style&&e.style._loaded&&(!("source"in o)||e.getSource(o.source))){const r={...o,id:n};delete r.beforeId,e.addLayer(r,o.beforeId)}}let kt=0;function Pt(e){const n=m.useContext(V).map.getMap(),o=m.useRef(e),[,r]=m.useState(0),i=m.useMemo(()=>e.id||`jsx-layer-${kt++}`,[]);if(m.useEffect(()=>{if(n){const s=()=>r(f=>f+1);return n.on("styledata",s),s(),()=>{n.off("styledata",s),n.style&&n.style._loaded&&n.getLayer(i)&&n.removeLayer(i)}}},[n]),n&&n.style&&n.getLayer(i))try{Lt(n,i,e,o.current)}catch(s){console.warn(s)}else Ot(n,i,e);return o.current=e,null}function jt(){return st()}const At=import("maplibre-gl");z.forwardRef(function(n,o){return Et(n,o,At)});const Oe=new W.Quaternion,Ft=new W.Euler,ke=new W.Vector3,Pe=new W.Vector3,Dt=new W.Matrix4;function zt({longitude:e,latitude:n,altitude:o}){const r=rt.MercatorCoordinate.fromLngLat([e,n],o),i=r.meterInMercatorCoordinateUnits();return ke.set(r.x,r.y,r.z||0),Pe.set(i,-i,i),Oe.setFromEuler(Ft.set(-Math.PI*.5,0,0)),Dt.compose(ke,Oe,Pe)}const ae={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function It(){return e=>{const{handlePointer:n}=ne.createEvents(e);return{priority:1,enabled:!0,compute(o,r){r.size.width=r.gl.domElement.width,r.size.height=r.gl.domElement.height,r.pointer.x=o.offsetX/(r.size.width/window.devicePixelRatio)*2-1,r.pointer.y=1-o.offsetY/(r.size.height/window.devicePixelRatio)*2,r.raycaster.camera=r.camera,r.raycaster.ray.origin.setScalar(0).applyMatrix4(r.camera.projectionMatrixInverse),r.raycaster.ray.direction.set(r.pointer.x,r.pointer.y,1).applyMatrix4(r.camera.projectionMatrixInverse).sub(r.raycaster.ray.origin).normalize()},connected:void 0,handlers:Object.keys(ae).reduce((o,r)=>({...o,[r]:n(r)}),{}),update:()=>{var i;const{events:o,internal:r}=e.getState();(i=r.lastEvent)!=null&&i.current&&o.handlers&&o.handlers.onPointerMove(r.lastEvent.current)},connect:o=>{var a;const{set:r,events:i}=e.getState();(a=i.disconnect)==null||a.call(i),r(s=>({events:{...s.events,connected:o}})),Object.entries(i.handlers??[]).forEach(([s,f])=>{const[c,d]=ae[s];o.addEventListener(c,f,{passive:d})})},disconnect:()=>{const{set:o,events:r}=e.getState();r.connected&&(Object.entries(r.handlers??[]).forEach(([i,a])=>{if(r&&r.connected instanceof HTMLElement){const[s]=ae[i];r.connected.removeEventListener(s,a)}}),o(i=>({events:{...i.events,connected:void 0}})))}}}}const se=e=>{const n=m.useRef(e);return n.current=e,m.useCallback((...o)=>n.current(...o),[])};function Nt(e,n){const[o,r]=m.useState(!1),i=se((s,f)=>{const c=s.getCanvas(),d=ne.createRoot(c);d.configure({frameloop:"never",dpr:window.devicePixelRatio,shadows:!0,events:It(),...n,gl:{context:f,depth:!0,autoClear:!1,antialias:!0,...n==null?void 0:n.gl},onCreated:v=>{e.current={state:v,map:s,root:d},v.gl.forceContextLoss=()=>{}},camera:{matrixAutoUpdate:!1},size:{width:c.clientWidth,height:c.clientHeight,top:0,left:0,...n==null?void 0:n.size}}),e.current={map:s,root:d},setTimeout(()=>r(!0))}),a=se(()=>{setTimeout(()=>{e.current&&e.current.root.unmount()})});return{onAdd:i,onRemove:a,mounted:o}}function Wt(e,n){const o=jt();return se((i,a)=>{var d;if(!o.current||!((d=n.current)!=null&&d.state))return;const s=n.current.state.camera,f=n.current.state.gl,c=n.current.state.advance;s.projectionMatrix.fromArray(a).multiply(e),s.projectionMatrixInverse.copy(s.projectionMatrix).invert(),f.resetState(),c(Date.now(),!0),o.current.triggerRepaint()})}ne.extend(ot);const Ut=m.memo(({longitude:e,latitude:n,altitude:o=0,children:r,...i})=>{const a=m.useId(),s=m.useRef(),f=m.useMemo(()=>zt({latitude:n,longitude:e,altitude:o}),[n,e,o]),{onAdd:c,onRemove:d,mounted:v}=Nt(s,i),p=Wt(f,s);return m.useEffect(()=>{v&&s.current&&s.current.root.render(oe.jsx(oe.Fragment,{children:r}))},[s,v,r]),oe.jsx(Pt,{id:a,type:"custom",renderingMode:"3d",onAdd:c,onRemove:d,render:p})});P.Canvas=Ut,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})});
File without changes