@deck.gl/widgets 9.3.0-alpha.1 → 9.3.0-alpha.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 (89) hide show
  1. package/dist/context-menu-widget.d.ts +7 -5
  2. package/dist/context-menu-widget.d.ts.map +1 -1
  3. package/dist/context-menu-widget.js +2 -1
  4. package/dist/context-menu-widget.js.map +1 -1
  5. package/dist/dist.dev.js +687 -555
  6. package/dist/icon-widget.d.ts +28 -0
  7. package/dist/icon-widget.d.ts.map +1 -0
  8. package/dist/icon-widget.js +35 -0
  9. package/dist/icon-widget.js.map +1 -0
  10. package/dist/index.cjs +468 -309
  11. package/dist/index.cjs.map +4 -4
  12. package/dist/index.d.ts +11 -9
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +7 -7
  15. package/dist/index.js.map +1 -1
  16. package/dist/info-widget.d.ts +1 -0
  17. package/dist/info-widget.d.ts.map +1 -1
  18. package/dist/info-widget.js +6 -0
  19. package/dist/info-widget.js.map +1 -1
  20. package/dist/lib/components/dropdown-menu.d.ts +3 -2
  21. package/dist/lib/components/dropdown-menu.d.ts.map +1 -1
  22. package/dist/lib/components/dropdown-menu.js +12 -8
  23. package/dist/lib/components/dropdown-menu.js.map +1 -1
  24. package/dist/lib/components/icon-button.d.ts +3 -0
  25. package/dist/lib/components/icon-button.d.ts.map +1 -1
  26. package/dist/lib/components/icon-button.js +10 -2
  27. package/dist/lib/components/icon-button.js.map +1 -1
  28. package/dist/lib/components/popover.js +1 -1
  29. package/dist/lib/components/popover.js.map +1 -1
  30. package/dist/lib/data-url.d.ts +5 -0
  31. package/dist/lib/data-url.d.ts.map +1 -0
  32. package/dist/lib/data-url.js +7 -0
  33. package/dist/lib/data-url.js.map +1 -0
  34. package/dist/popup-widget.d.ts +1 -0
  35. package/dist/popup-widget.d.ts.map +1 -1
  36. package/dist/popup-widget.js +6 -0
  37. package/dist/popup-widget.js.map +1 -1
  38. package/dist/selector-widget.d.ts +44 -0
  39. package/dist/selector-widget.d.ts.map +1 -0
  40. package/dist/selector-widget.js +64 -0
  41. package/dist/selector-widget.js.map +1 -0
  42. package/dist/splitter-widget.d.ts +52 -11
  43. package/dist/splitter-widget.d.ts.map +1 -1
  44. package/dist/splitter-widget.js +177 -76
  45. package/dist/splitter-widget.js.map +1 -1
  46. package/dist/stats-widget.d.ts +2 -1
  47. package/dist/stats-widget.d.ts.map +1 -1
  48. package/dist/stats-widget.js +37 -8
  49. package/dist/stats-widget.js.map +1 -1
  50. package/dist/stylesheet.css +50 -13
  51. package/dist/timeline-widget.d.ts.map +1 -1
  52. package/dist/timeline-widget.js +6 -1
  53. package/dist/timeline-widget.js.map +1 -1
  54. package/dist/toggle-widget.d.ts +38 -0
  55. package/dist/toggle-widget.d.ts.map +1 -0
  56. package/dist/toggle-widget.js +47 -0
  57. package/dist/toggle-widget.js.map +1 -0
  58. package/dist.min.js +2 -2
  59. package/package.json +3 -3
  60. package/src/context-menu-widget.tsx +9 -9
  61. package/src/icon-widget.tsx +69 -0
  62. package/src/index.ts +11 -9
  63. package/src/info-widget.tsx +7 -0
  64. package/src/lib/components/dropdown-menu.tsx +22 -15
  65. package/src/lib/components/icon-button.tsx +15 -3
  66. package/src/lib/components/popover.tsx +1 -1
  67. package/src/lib/data-url.ts +5 -0
  68. package/src/popup-widget.tsx +7 -0
  69. package/src/selector-widget.tsx +111 -0
  70. package/src/splitter-widget.tsx +281 -96
  71. package/src/stats-widget.tsx +50 -9
  72. package/src/stylesheet.css +50 -13
  73. package/src/timeline-widget.tsx +8 -1
  74. package/src/toggle-widget.tsx +101 -0
  75. package/dist/fps-widget.d.ts +0 -28
  76. package/dist/fps-widget.d.ts.map +0 -1
  77. package/dist/fps-widget.js +0 -51
  78. package/dist/fps-widget.js.map +0 -1
  79. package/dist/lib/components/icon-menu.d.ts +0 -16
  80. package/dist/lib/components/icon-menu.d.ts.map +0 -1
  81. package/dist/lib/components/icon-menu.js +0 -33
  82. package/dist/lib/components/icon-menu.js.map +0 -1
  83. package/dist/view-selector-widget.d.ts +0 -35
  84. package/dist/view-selector-widget.d.ts.map +0 -1
  85. package/dist/view-selector-widget.js +0 -63
  86. package/dist/view-selector-widget.js.map +0 -1
  87. package/src/fps-widget.tsx +0 -77
  88. package/src/lib/components/icon-menu.tsx +0 -70
  89. package/src/view-selector-widget.tsx +0 -151
@@ -0,0 +1,38 @@
1
+ import type { WidgetPlacement, WidgetProps } from '@deck.gl/core';
2
+ import { Widget } from '@deck.gl/core';
3
+ export type ToggleWidgetProps = WidgetProps & {
4
+ /** Widget positioning within the view. Default 'bottom-left'. */
5
+ placement?: WidgetPlacement;
6
+ /** View to attach to and interact with. Required when using multiple views. */
7
+ viewId?: string | null;
8
+ /** If the toggle is checked when first added */
9
+ initialChecked?: boolean;
10
+ /** Data url to display as icon */
11
+ icon: string;
12
+ /** Data url to display as icon when it is checked */
13
+ onIcon?: string;
14
+ /** Tooltip label */
15
+ label?: string;
16
+ /** Tooltip label when it is checked */
17
+ onLabel?: string;
18
+ /** Icon color, a CSS Color string */
19
+ color?: string;
20
+ /** Icon color when it is checked, a CSS Color string */
21
+ onColor?: string;
22
+ /** Callback when the widget is clicked */
23
+ onChange?: (checked: boolean) => void;
24
+ };
25
+ /**
26
+ * A generic widget that displays a button with icon or text content.
27
+ */
28
+ export declare class ToggleWidget extends Widget<ToggleWidgetProps> {
29
+ static defaultProps: Required<ToggleWidgetProps>;
30
+ className: string;
31
+ placement: WidgetPlacement;
32
+ checked: boolean;
33
+ constructor(props: ToggleWidgetProps);
34
+ setProps(props: Partial<ToggleWidgetProps>): void;
35
+ onRenderHTML(rootElement: HTMLElement): void;
36
+ private _toggle;
37
+ }
38
+ //# sourceMappingURL=toggle-widget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle-widget.d.ts","sourceRoot":"","sources":["../src/toggle-widget.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAE,WAAW,EAAC,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AAGrC,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG;IAC5C,iEAAiE;IACjE,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,gDAAgD;IAChD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;CACvC,CAAC;AAEF;;GAEG;AACH,qBAAa,YAAa,SAAQ,MAAM,CAAC,iBAAiB,CAAC;IACzD,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAa9C;IAEF,SAAS,SAAwB;IACjC,SAAS,EAAE,eAAe,CAAc;IACxC,OAAO,EAAE,OAAO,CAAC;gBAEL,KAAK,EAAE,iBAAiB;IAMpC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,iBAAiB,CAAC;IAM1C,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI;IA4B5C,OAAO,CAAC,OAAO,CAIb;CACH"}
@@ -0,0 +1,47 @@
1
+ import { jsx as _jsx } from "preact/jsx-runtime";
2
+ import { render } from 'preact';
3
+ import { Widget } from '@deck.gl/core';
4
+ import { IconButton } from "./lib/components/icon-button.js";
5
+ /**
6
+ * A generic widget that displays a button with icon or text content.
7
+ */
8
+ export class ToggleWidget extends Widget {
9
+ constructor(props) {
10
+ super(props);
11
+ this.className = 'deck-widget-toggle';
12
+ this.placement = 'top-left';
13
+ this._toggle = () => {
14
+ this.checked = !this.checked;
15
+ this.props.onChange?.(this.checked);
16
+ this.updateHTML();
17
+ };
18
+ this.checked = this.props.initialChecked;
19
+ this.setProps(this.props);
20
+ }
21
+ setProps(props) {
22
+ this.placement = props.placement ?? this.placement;
23
+ this.viewId = props.viewId;
24
+ super.setProps(props);
25
+ }
26
+ onRenderHTML(rootElement) {
27
+ const { className, style, icon, label, color, onIcon = icon, onLabel = label, onColor = color } = this.props;
28
+ const on = this.checked;
29
+ rootElement.dataset.checked = String(on);
30
+ render(_jsx(IconButton, { className: className, style: style, icon: on ? onIcon : icon, label: on ? onLabel : label, color: on ? onColor : color, onClick: this._toggle }), rootElement);
31
+ }
32
+ }
33
+ ToggleWidget.defaultProps = {
34
+ ...Widget.defaultProps,
35
+ id: 'icon',
36
+ placement: 'top-left',
37
+ viewId: null,
38
+ initialChecked: false,
39
+ icon: '',
40
+ onIcon: undefined,
41
+ label: '',
42
+ onLabel: undefined,
43
+ color: '',
44
+ onColor: undefined,
45
+ onChange: undefined
46
+ };
47
+ //# sourceMappingURL=toggle-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toggle-widget.js","sourceRoot":"","sources":["../src/toggle-widget.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAC,MAAM,EAAW,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,UAAU,EAAC,wCAAqC;AAyBxD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAyB;IAoBzD,YAAY,KAAwB;QAClC,KAAK,CAAC,KAAK,CAAC,CAAC;QALf,cAAS,GAAG,oBAAoB,CAAC;QACjC,cAAS,GAAoB,UAAU,CAAC;QA2ChC,YAAO,GAAG,GAAG,EAAE;YACrB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC;YAC7B,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACpC,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC,CAAC;QA1CA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC;QACzC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,QAAQ,CAAC,KAAiC;QACxC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC;QACnD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC3B,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,WAAwB;QACnC,MAAM,EACJ,SAAS,EACT,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,MAAM,GAAG,IAAI,EACb,OAAO,GAAG,KAAK,EACf,OAAO,GAAG,KAAK,EAChB,GAAG,IAAI,CAAC,KAAK,CAAC;QACf,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QAExB,WAAW,CAAC,OAAO,CAAC,OAAO,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;QAEzC,MAAM,CACJ,KAAC,UAAU,IACT,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAA0B,EACjC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,EACxB,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAC3B,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,EAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,GACrB,EACF,WAAW,CACZ,CAAC;IACJ,CAAC;;AAzDM,yBAAY,GAAgC;IACjD,GAAG,MAAM,CAAC,YAAY;IACtB,EAAE,EAAE,MAAM;IACV,SAAS,EAAE,UAAU;IACrB,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,KAAK;IACrB,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,SAAU;IAClB,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,SAAU;IACnB,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,SAAU;IACnB,QAAQ,EAAE,SAAU;CACrB,AAbkB,CAajB"}
package/dist.min.js CHANGED
@@ -4,7 +4,7 @@
4
4
  else if (typeof define === 'function' && define.amd) define([], factory);
5
5
  else if (typeof exports === 'object') exports['deck'] = factory();
6
6
  else root['deck'] = factory();})(globalThis, function () {
7
- "use strict";var __exports__=(()=>{var Xn=Object.create;var ht=Object.defineProperty;var Jn=Object.getOwnPropertyDescriptor;var Kn=Object.getOwnPropertyNames;var Yn=Object.getPrototypeOf,jn=Object.prototype.hasOwnProperty;var No=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports),Zn=(t,o)=>{for(var e in o)ht(t,e,{get:o[e],enumerable:!0})},gt=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Kn(o))!jn.call(t,i)&&i!==e&&ht(t,i,{get:()=>o[i],enumerable:!(n=Jn(o,i))||n.enumerable});return t},re=(t,o,e)=>(gt(t,o,"default"),e&&gt(e,o,"default")),E=(t,o,e)=>(e=t!=null?Xn(Yn(t)):{},gt(o||!t||!t.__esModule?ht(e,"default",{value:t,enumerable:!0}):e,t)),Qn=t=>gt(ht({},"__esModule",{value:!0}),t);var R=No((Yi,Ho)=>{Ho.exports=globalThis.deck});var Fn=No((ya,Bn)=>{Bn.exports=globalThis.luma});var ft={};Zn(ft,{CompassWidget:()=>Be,DarkGlassTheme:()=>Gt,DarkTheme:()=>$n,FullscreenWidget:()=>qe,GimbalWidget:()=>Ve,LightGlassTheme:()=>zt,LightTheme:()=>Vn,PopupWidget:()=>nt,ResetViewWidget:()=>He,ScreenshotWidget:()=>ct,ScrollbarWidget:()=>at,ZoomWidget:()=>Ne,_ButtonGroup:()=>Se,_ContextMenuWidget:()=>it,_CoordinatesGeocoder:()=>Ce,_CurrentLocationGeocoder:()=>It,_DropdownMenu:()=>kt,_FpsWidget:()=>ut,_GeocoderWidget:()=>Ue,_GoogleGeocoder:()=>Tt,_IconButton:()=>L,_IconMenu:()=>Lt,_InfoWidget:()=>ot,_LoadingWidget:()=>pt,_MapboxGeocoder:()=>Ct,_OpenCageGeocoder:()=>Mt,_RangeInput:()=>Oe,_ScaleWidget:()=>Fe,_SimpleMenu:()=>Ge,_SplitterWidget:()=>Je,_StatsWidget:()=>mt,_ThemeWidget:()=>dt,_TimelineWidget:()=>lt,_ViewSelectorWidget:()=>Ke});var Y={},Vo=E(R(),1);re(Y,E(R(),1));if(!Vo.Layer)throw new Error("@deck.gl/core is not found");re(ft,Y);var ue=E(R(),1);var xt,W,Go,ei,de,$o,Uo,qt,Yt,Xt,Jt,ti,De={},qo=[],oi=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,jt=Array.isArray;function se(t,o){for(var e in o)t[e]=o[e];return t}function Xo(t){var o=t.parentNode;o&&o.removeChild(t)}function ni(t,o,e){var n,i,r,s={};for(r in o)r=="key"?n=o[r]:r=="ref"?i=o[r]:s[r]=o[r];if(arguments.length>2&&(s.children=arguments.length>3?xt.call(arguments,2):e),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)s[r]===void 0&&(s[r]=t.defaultProps[r]);return vt(t,s,n,i,null)}function vt(t,o,e,n,i){var r={type:t,props:o,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Go,__i:-1,__u:0};return i==null&&W.vnode!=null&&W.vnode(r),r}function ke(t){return t.children}function bt(t,o){this.props=t,this.context=o}function pe(t,o){if(o==null)return t.__?pe(t.__,t.__i+1):null;for(var e;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null)return e.__e;return typeof t.type=="function"?pe(t):null}function Jo(t){var o,e;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,o=0;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null){t.__e=t.__c.base=e.__e;break}return Jo(t)}}function Bo(t){(!t.__d&&(t.__d=!0)&&de.push(t)&&!wt.__r++||$o!==W.debounceRendering)&&(($o=W.debounceRendering)||Uo)(wt)}function wt(){var t,o,e,n,i,r,s,a;for(de.sort(qt);t=de.shift();)t.__d&&(o=de.length,n=void 0,r=(i=(e=t).__v).__e,s=[],a=[],e.__P&&((n=se({},i)).__v=i.__v+1,W.vnode&&W.vnode(n),Zt(e.__P,n,i,e.__n,e.__P.namespaceURI,32&i.__u?[r]:null,s,r??pe(i),!!(32&i.__u),a),n.__v=i.__v,n.__.__k[n.__i]=n,jo(s,n,a),n.__e!=r&&Jo(n)),de.length>o&&de.sort(qt));wt.__r=0}function Ko(t,o,e,n,i,r,s,a,c,d,m){var l,f,u,g,b,h=n&&n.__k||qo,_=o.length;for(e.__d=c,ii(e,o,h),c=e.__d,l=0;l<_;l++)(u=e.__k[l])!=null&&typeof u!="boolean"&&typeof u!="function"&&(f=u.__i===-1?De:h[u.__i]||De,u.__i=l,Zt(t,u,f,i,r,s,a,c,d,m),g=u.__e,u.ref&&f.ref!=u.ref&&(f.ref&&Qt(f.ref,null,u),m.push(u.ref,u.__c||g,u)),b==null&&g!=null&&(b=g),65536&u.__u||f.__k===u.__k?c=Yo(u,c,t):typeof u.type=="function"&&u.__d!==void 0?c=u.__d:g&&(c=g.nextSibling),u.__d=void 0,u.__u&=-196609);e.__d=c,e.__e=b}function ii(t,o,e){var n,i,r,s,a,c=o.length,d=e.length,m=d,l=0;for(t.__k=[],n=0;n<c;n++)s=n+l,(i=t.__k[n]=(i=o[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?vt(null,i,null,null,null):jt(i)?vt(ke,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?vt(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,a=ri(i,e,s,m),i.__i=a,r=null,a!==-1&&(m--,(r=e[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&l--,typeof i.type!="function"&&(i.__u|=65536)):a!==s&&(a==s-1?l--:a==s+1?l++:a>s?m>c-s?l+=a-s:l--:a<s&&(a==s-l?l-=a-s:l++),a!==n+l&&(i.__u|=65536))):(r=e[s])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=pe(r)),Kt(r,r,!1),e[s]=null,m--);if(m)for(n=0;n<d;n++)(r=e[n])!=null&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=pe(r)),Kt(r,r))}function Yo(t,o,e){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,o=Yo(n[i],o,e));return o}t.__e!=o&&(o&&t.type&&!e.contains(o)&&(o=pe(t)),e.insertBefore(t.__e,o||null),o=t.__e);do o=o&&o.nextSibling;while(o!=null&&o.nodeType===8);return o}function ri(t,o,e,n){var i=t.key,r=t.type,s=e-1,a=e+1,c=o[e];if(c===null||c&&i==c.key&&r===c.type&&!(131072&c.__u))return e;if(n>(c!=null&&!(131072&c.__u)?1:0))for(;s>=0||a<o.length;){if(s>=0){if((c=o[s])&&!(131072&c.__u)&&i==c.key&&r===c.type)return s;s--}if(a<o.length){if((c=o[a])&&!(131072&c.__u)&&i==c.key&&r===c.type)return a;a++}}return-1}function Fo(t,o,e){o[0]==="-"?t.setProperty(o,e??""):t[o]=e==null?"":typeof e!="number"||oi.test(o)?e:e+"px"}function _t(t,o,e,n,i){var r;e:if(o==="style")if(typeof e=="string")t.style.cssText=e;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(o in n)e&&o in e||Fo(t.style,o,"");if(e)for(o in e)n&&e[o]===n[o]||Fo(t.style,o,e[o])}else if(o[0]==="o"&&o[1]==="n")r=o!==(o=o.replace(/(PointerCapture)$|Capture$/i,"$1")),o=o.toLowerCase()in t||o==="onFocusOut"||o==="onFocusIn"?o.toLowerCase().slice(2):o.slice(2),t.l||(t.l={}),t.l[o+r]=e,e?n?e.u=n.u:(e.u=Yt,t.addEventListener(o,r?Jt:Xt,r)):t.removeEventListener(o,r?Jt:Xt,r);else{if(i=="http://www.w3.org/2000/svg")o=o.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(o!="width"&&o!="height"&&o!="href"&&o!="list"&&o!="form"&&o!="tabIndex"&&o!="download"&&o!="rowSpan"&&o!="colSpan"&&o!="role"&&o!="popover"&&o in t)try{t[o]=e??"";break e}catch{}typeof e=="function"||(e==null||e===!1&&o[4]!=="-"?t.removeAttribute(o):t.setAttribute(o,o=="popover"&&e==1?"":e))}}function zo(t){return function(o){if(this.l){var e=this.l[o.type+t];if(o.t==null)o.t=Yt++;else if(o.t<e.u)return;return e(W.event?W.event(o):o)}}}function Zt(t,o,e,n,i,r,s,a,c,d){var m,l,f,u,g,b,h,_,w,P,S,x,T,M,I,H,O=o.type;if(o.constructor!==void 0)return null;128&e.__u&&(c=!!(32&e.__u),r=[a=o.__e=e.__e]),(m=W.__b)&&m(o);e:if(typeof O=="function")try{if(_=o.props,w="prototype"in O&&O.prototype.render,P=(m=O.contextType)&&n[m.__c],S=m?P?P.props.value:m.__:n,e.__c?h=(l=o.__c=e.__c).__=l.__E:(w?o.__c=l=new O(_,S):(o.__c=l=new bt(_,S),l.constructor=O,l.render=ai),P&&P.sub(l),l.props=_,l.state||(l.state={}),l.context=S,l.__n=n,f=l.__d=!0,l.__h=[],l._sb=[]),w&&l.__s==null&&(l.__s=l.state),w&&O.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=se({},l.__s)),se(l.__s,O.getDerivedStateFromProps(_,l.__s))),u=l.props,g=l.state,l.__v=o,f)w&&O.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),w&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(w&&O.getDerivedStateFromProps==null&&_!==u&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(_,S),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(_,l.__s,S)===!1||o.__v===e.__v)){for(o.__v!==e.__v&&(l.props=_,l.state=l.__s,l.__d=!1),o.__e=e.__e,o.__k=e.__k,o.__k.forEach(function(C){C&&(C.__=o)}),x=0;x<l._sb.length;x++)l.__h.push(l._sb[x]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(_,l.__s,S),w&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(u,g,b)})}if(l.context=S,l.props=_,l.__P=t,l.__e=!1,T=W.__r,M=0,w){for(l.state=l.__s,l.__d=!1,T&&T(o),m=l.render(l.props,l.state,l.context),I=0;I<l._sb.length;I++)l.__h.push(l._sb[I]);l._sb=[]}else do l.__d=!1,T&&T(o),m=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++M<25);l.state=l.__s,l.getChildContext!=null&&(n=se(se({},n),l.getChildContext())),w&&!f&&l.getSnapshotBeforeUpdate!=null&&(b=l.getSnapshotBeforeUpdate(u,g)),Ko(t,jt(H=m!=null&&m.type===ke&&m.key==null?m.props.children:m)?H:[H],o,e,n,i,r,s,a,c,d),l.base=o.__e,o.__u&=-161,l.__h.length&&s.push(l),h&&(l.__E=l.__=null)}catch(C){if(o.__v=null,c||r!=null){for(o.__u|=c?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,o.__e=a}else o.__e=e.__e,o.__k=e.__k;W.__e(C,o,e)}else r==null&&o.__v===e.__v?(o.__k=e.__k,o.__e=e.__e):o.__e=si(e.__e,o,e,n,i,r,s,c,d);(m=W.diffed)&&m(o)}function jo(t,o,e){o.__d=void 0;for(var n=0;n<e.length;n++)Qt(e[n],e[++n],e[++n]);W.__c&&W.__c(o,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(r){r.call(i)})}catch(r){W.__e(r,i.__v)}})}function si(t,o,e,n,i,r,s,a,c){var d,m,l,f,u,g,b,h=e.props,_=o.props,w=o.type;if(w==="svg"?i="http://www.w3.org/2000/svg":w==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(d=0;d<r.length;d++)if((u=r[d])&&"setAttribute"in u==!!w&&(w?u.localName===w:u.nodeType===3)){t=u,r[d]=null;break}}if(t==null){if(w===null)return document.createTextNode(_);t=document.createElementNS(i,w,_.is&&_),r=null,a=!1}if(w===null)h===_||a&&t.data===_||(t.data=_);else{if(r=r&&xt.call(t.childNodes),h=e.props||De,!a&&r!=null)for(h={},d=0;d<t.attributes.length;d++)h[(u=t.attributes[d]).name]=u.value;for(d in h)if(u=h[d],d!="children"){if(d=="dangerouslySetInnerHTML")l=u;else if(d!=="key"&&!(d in _)){if(d=="value"&&"defaultValue"in _||d=="checked"&&"defaultChecked"in _)continue;_t(t,d,null,u,i)}}for(d in _)u=_[d],d=="children"?f=u:d=="dangerouslySetInnerHTML"?m=u:d=="value"?g=u:d=="checked"?b=u:d==="key"||a&&typeof u!="function"||h[d]===u||_t(t,d,u,h[d],i);if(m)a||l&&(m.__html===l.__html||m.__html===t.innerHTML)||(t.innerHTML=m.__html),o.__k=[];else if(l&&(t.innerHTML=""),Ko(t,jt(f)?f:[f],o,e,n,w==="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,s,r?r[0]:e.__k&&pe(e,0),a,c),r!=null)for(d=r.length;d--;)r[d]!=null&&Xo(r[d]);a||(d="value",g!==void 0&&(g!==t[d]||w==="progress"&&!g||w==="option"&&g!==h[d])&&_t(t,d,g,h[d],i),d="checked",b!==void 0&&b!==t[d]&&_t(t,d,b,h[d],i))}return t}function Qt(t,o,e){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&o==null||(t.__u=t(o))}else t.current=o}catch(i){W.__e(i,e)}}function Kt(t,o,e){var n,i;if(W.unmount&&W.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Qt(n,null,o)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){W.__e(r,o)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&Kt(n[i],o,e||typeof t.type!="function");e||t.__e==null||Xo(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function ai(t,o,e){return this.constructor(t,e)}function y(t,o,e){var n,i,r,s;W.__&&W.__(t,o),i=(n=typeof e=="function")?null:e&&e.__k||o.__k,r=[],s=[],Zt(o,t=(!n&&e||o).__k=ni(ke,null,[t]),i||De,De,o.namespaceURI,!n&&e?[e]:i?null:o.firstChild?xt.call(o.childNodes):null,r,!n&&e?e:i?i.__e:o.firstChild,n,s),jo(r,t,s)}xt=qo.slice,W={__e:function(t,o,e,n){for(var i,r,s;o=o.__;)if((i=o.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},Go=0,ei=function(t){return t!=null&&t.constructor==null},bt.prototype.setState=function(t,o){var e;e=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=se({},this.state),typeof t=="function"&&(t=t(se({},e),this.props)),t&&se(e,t),t!=null&&this.__v&&(o&&this._sb.push(o),Bo(this))},bt.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Bo(this))},bt.prototype.render=ke,de=[],Uo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,qt=function(t,o){return t.__v.__b-o.__v.__b},wt.__r=0,Yt=0,Xt=zo(!1),Jt=zo(!0),ti=0;var li=0,er=Array.isArray;function p(t,o,e,n,i,r){o||(o={});var s,a,c=o;if("ref"in c)for(a in c={},o)a=="ref"?s=o[a]:c[a]=o[a];var d={type:t,props:c,key:e,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--li,__i:-1,__u:0,__source:i,__self:r};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return W.vnode&&W.vnode(d),d}var Se=t=>{let{children:o,orientation:e="horizontal"}=t;return p("div",{className:`deck-widget-button-group ${e}`,children:o})};var L=t=>{let{className:o="",label:e,onClick:n,children:i}=t;return p("div",{className:"deck-widget-button",children:p("button",{className:`deck-widget-icon-button ${o}`,type:"button",onClick:n,title:e,children:i||p("div",{className:"deck-widget-icon"})})})};var Ne=class extends ue.Widget{constructor(e={}){super(e);this.className="deck-widget-zoom";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=p(Se,{orientation:this.props.orientation,children:[p(L,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),p(L,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});y(n,e)}handleZoom(e,n){let i=this.getViewState(e);if(i){let{minZoom:s,maxZoom:a}=i;Number.isFinite(s)&&(n=Math.max(s,n)),Number.isFinite(a)&&(n=Math.min(a,n))}let r={...i,zoom:n};this.props.transitionDuration>0&&(r.transitionDuration=this.props.transitionDuration,r.transitionInterpolator="latitude"in r?new ue.FlyToInterpolator:new ue.LinearInterpolator({transitionProps:["zoom"]})),this.setViewState(e,r)}handleZoomIn(){let e=this.viewId?[this.viewId]:this.deck?.getViews().map(n=>n.id)??[];for(let n of e){let i=this.getViewState(n);this.handleZoom(n,i.zoom+1)}}handleZoomOut(){let e=this.viewId?[this.viewId]:this.deck?.getViews().map(n=>n.id)??[];for(let n of e){let i=this.getViewState(n);this.handleZoom(n,i.zoom-1)}}};Ne.defaultProps={...ue.Widget.defaultProps,id:"zoom",placement:"top-left",orientation:"vertical",transitionDuration:200,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",viewId:null};var eo=E(R(),1);var He=class extends eo.Widget{constructor(e={}){super(e);this.className="deck-widget-reset-view";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){y(p(L,{className:"deck-widget-reset-focus",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}handleClick(){let e=this.props.initialViewState||this.deck?.props.initialViewState;this.resetViewState(e)}resetViewState(e){let n=this.viewId?[this.viewId]:this.deck?.getViews().map(i=>i.id)??[];for(let i of n){let r={...e?.[i]??e};this.setViewState(i,r)}}};He.defaultProps={...eo.Widget.defaultProps,id:"reset-view",placement:"top-left",label:"Reset View",initialViewState:void 0,viewId:null};var $e=E(R(),1);var Ve=class extends $e.Widget{constructor(e={}){super(e);this.className="deck-widget-gimbal";this.placement="top-left";this.viewports={};this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",i=this.viewports[n],{rotationOrbit:r,rotationX:s}=this.getNormalizedRotation(i),a=p("div",{className:"deck-widget-button",style:{perspective:100,pointerEvents:"auto"},children:p("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.resetOrbitView(c)},title:this.props.label,style:{position:"relative",width:26,height:26},children:[p("svg",{className:"gimbal-outer-ring",width:"100%",height:"100%",viewBox:"0 0 26 26",style:{position:"absolute",top:0,left:0,transform:`rotateY(${r}deg)`},children:p("circle",{cx:"13",cy:"13",r:"10",stroke:"var(--icon-gimbal-outer-color, rgb(68, 92, 204))",strokeWidth:this.props.strokeWidth,fill:"none"})}),p("svg",{className:"gimbal-inner-ring",width:"100%",height:"100%",viewBox:"0 0 26 26",style:{position:"absolute",top:0,left:0,transform:`rotateX(${s}deg)`},children:p("circle",{cx:"13",cy:"13",r:"7",stroke:"var(--icon-gimbal-inner-color, rgb(240, 92, 68))",strokeWidth:this.props.strokeWidth,fill:"none"})})]})});y(a,e)}onViewportChange(e){this.viewports[e.id]=e,this.updateHTML()}resetOrbitView(e){let n=this.viewId||e?.id||"OrbitView",i=this.getViewState(n);if("rotationOrbit"in i||"rotationX"in i){let r={...i,rotationOrbit:0,rotationX:0,transitionDuration:this.props.transitionDuration,transitionInterpolator:new $e.LinearInterpolator({transitionProps:["rotationOrbit","rotationX"]})};this.setViewState(n,r)}}getNormalizedRotation(e){let n=this.viewId||e?.id||"OrbitView",i=this.getViewState(n),[r,s]=this.getRotation(i),a=Zo(r),c=Zo(s);return{rotationOrbit:a,rotationX:c}}getRotation(e){return e&&("rotationOrbit"in e||"rotationX"in e)?[-(e.rotationOrbit||0),e.rotationX||0]:[0,0]}};Ve.defaultProps={...$e.Widget.defaultProps,id:"gimbal",placement:"top-left",viewId:null,label:"Gimbal",strokeWidth:1.5,transitionDuration:200};function Zo(t){let o=((t+180)%360+360)%360-180,e=10,n=o-90;return Math.abs(n)<e&&(n<e?o=90+e:n>-e&&(o=90-e)),o}var j=E(R(),1);var Be=class extends j.Widget{constructor(e={}){super(e);this.className="deck-widget-compass";this.placement="top-left";this.viewports={};this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.viewId||Object.values(this.viewports)[0]?.id,i=this.viewports[n],[r,s]=this.getRotation(i),a=p("div",{className:"deck-widget-button",style:{perspective:100},children:p("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.handleCompassReset(c)},title:this.props.label,style:{transform:`rotateX(${s}deg)`},children:p("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:p("g",{transform:`rotate(${r},13,13)`,children:[p("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, rgb(240, 92, 68))"}),p("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, rgb(204, 204, 204))"})]})})})});y(a,e)}onViewportChange(e){e.equals(this.viewports[e.id])||(this.viewports[e.id]=e,this.updateHTML())}getRotation(e){return e instanceof j.WebMercatorViewport?[-e.bearing,e.pitch]:e instanceof j._GlobeViewport?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}handleCompassReset(e){let n=this.viewId||e.id;if(e instanceof j.WebMercatorViewport){let r={...this.getViewState(n),bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new j.FlyToInterpolator};this.setViewState(n,r)}}};Be.defaultProps={...j.Widget.defaultProps,id:"compass",placement:"top-left",viewId:null,label:"Reset Compass",transitionDuration:200};var to=E(R(),1);var Fe=class extends to.Widget{constructor(e={}){super(e);this.className="deck-widget-scale";this.placement="bottom-left";this.scaleWidth=10;this.scaleValue=0;this.scaleText="";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let i=50+this.scaleWidth,r=10;y(p("svg",{className:"deck-widget-scale",width:i,height:30,style:{overflow:"visible",background:"transparent"},onClick:this.handleClick.bind(this),children:[p("text",{x:50+5,y:"10",textAnchor:"end",alignmentBaseline:"middle",style:{fontSize:"16px",fill:"black",fontWeight:"bold",fontFamily:"sans-serif"},children:this.scaleText}),p("line",{x1:50,y1:"15",x2:50+this.scaleWidth,y2:"15",stroke:"black",strokeWidth:"6"}),p("line",{x1:50,y1:"15",x2:50,y2:15-r,stroke:"black",strokeWidth:"6"}),p("line",{x1:50+this.scaleWidth,y1:"15",x2:50+this.scaleWidth,y2:15-r,stroke:"black",strokeWidth:"6"})]}),e)}onViewportChange(e){if(!("latitude"in e))return;let{latitude:n,zoom:i}=e,r=ci(n,i),{candidate:s,candidatePixels:a}=di(r);this.scaleValue=s,this.scaleWidth=a,s>=1e3?this.scaleText=`${(s/1e3).toFixed(1)} km`:this.scaleText=`${s} m`,this.updateHTML()}handleClick(){}};Fe.defaultProps={...to.Widget.defaultProps,id:"scale",placement:"bottom-left",label:"Scale",viewId:null};function ci(t,o){return 40075016686e-3*Math.cos(t*Math.PI/180)/Math.pow(2,o+8)}function di(t){let i=150*t,r=Math.floor(Math.log10(i)),s=Math.pow(10,r),a=[1,2,5],c=a[0]*s,d=c/t;for(let m=0;m<a.length;m++){let l=a[m]*s,f=l/t;if(f>=100&&f<=200){c=l,d=f;break}if(f>200){c=m>0?a[m-1]*s:l,d=c/t;break}m===a.length-1&&f<100&&(c=a[0]*s*10,d=c/t)}return{candidate:c,candidatePixels:d}}var ao=E(R(),1),Wt=E(R(),1);var Te,A,oo,Qo,ze=0,ln=[],D=W,en=D.__b,tn=D.__r,on=D.diffed,nn=D.__c,rn=D.unmount,sn=D.__;function Pt(t,o){D.__h&&D.__h(A,t,ze||o),ze=0;var e=A.__H||(A.__H={__:[],__h:[]});return t>=e.__.length&&e.__.push({}),e.__[t]}function ee(t){return ze=1,pi(cn,t)}function pi(t,o,e){var n=Pt(Te++,2);if(n.t=t,!n.__c&&(n.__=[e?e(o):cn(void 0,o),function(a){var c=n.__N?n.__N[0]:n.__[0],d=n.t(c,a);c!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=A,!A.u)){var i=function(a,c,d){if(!n.__c.__H)return!0;var m=n.__c.__H.__.filter(function(f){return!!f.__c});if(m.every(function(f){return!f.__N}))return!r||r.call(this,a,c,d);var l=!1;return m.forEach(function(f){if(f.__N){var u=f.__[0];f.__=f.__N,f.__N=void 0,u!==f.__[0]&&(l=!0)}}),!(!l&&n.__c.props===a)&&(!r||r.call(this,a,c,d))};A.u=!0;var r=A.shouldComponentUpdate,s=A.componentWillUpdate;A.componentWillUpdate=function(a,c,d){if(this.__e){var m=r;r=void 0,i(a,c,d),r=m}s&&s.call(this,a,c,d)},A.shouldComponentUpdate=i}return n.__N||n.__}function Z(t,o){var e=Pt(Te++,3);!D.__s&&ro(e.__H,o)&&(e.__=t,e.i=o,A.__H.__h.push(e))}function io(t,o){var e=Pt(Te++,4);!D.__s&&ro(e.__H,o)&&(e.__=t,e.i=o,A.__h.push(e))}function N(t){return ze=5,me(function(){return{current:t}},[])}function me(t,o){var e=Pt(Te++,7);return ro(e.__H,o)&&(e.__=t(),e.__H=o,e.__h=t),e.__}function te(t,o){return ze=8,me(function(){return t},o)}function ui(){for(var t;t=ln.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(yt),t.__H.__h.forEach(no),t.__H.__h=[]}catch(o){t.__H.__h=[],D.__e(o,t.__v)}}D.__b=function(t){A=null,en&&en(t)},D.__=function(t,o){t&&o.__k&&o.__k.__m&&(t.__m=o.__k.__m),sn&&sn(t,o)},D.__r=function(t){tn&&tn(t),Te=0;var o=(A=t.__c).__H;o&&(oo===A?(o.__h=[],A.__h=[],o.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(o.__h.forEach(yt),o.__h.forEach(no),o.__h=[],Te=0)),oo=A},D.diffed=function(t){on&&on(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(ln.push(o)!==1&&Qo===D.requestAnimationFrame||((Qo=D.requestAnimationFrame)||mi)(ui)),o.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),oo=A=null},D.__c=function(t,o){o.some(function(e){try{e.__h.forEach(yt),e.__h=e.__h.filter(function(n){return!n.__||no(n)})}catch(n){o.some(function(i){i.__h&&(i.__h=[])}),o=[],D.__e(n,e.__v)}}),nn&&nn(t,o)},D.unmount=function(t){rn&&rn(t);var o,e=t.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{yt(n)}catch(i){o=i}}),e.__H=void 0,o&&D.__e(o,e.__v))};var an=typeof requestAnimationFrame=="function";function mi(t){var o,e=function(){clearTimeout(n),an&&cancelAnimationFrame(o),setTimeout(t)},n=setTimeout(e,100);an&&(o=requestAnimationFrame(e))}function yt(t){var o=A,e=t.__c;typeof e=="function"&&(t.__c=void 0,e()),A=o}function no(t){var o=A;t.__c=t.__(),A=o}function ro(t,o){return!t||t.length!==o.length||o.some(function(e,n){return e!==t[n]})}function cn(t,o){return typeof o=="function"?o(t):o}function fi(t){return typeof t=="string"?t:t.value}function gi(t){return typeof t=="string"?t:t.label}function hi(t){return typeof t=="string"?void 0:t.icon}var kt=t=>{let[o,e]=ee(!1);return p(Ge,{...t,style:{...t.style,position:"absolute"},isOpen:o,onClose:()=>e(!1),trigger:p("button",{className:"deck-widget-dropdown-button",onClick:()=>e(!o),children:p("span",{className:`deck-widget-dropdown-icon ${o?"open":""}`})})})},Ge=t=>{let o=N(null),e=i=>{o.current&&!o.current.contains(i.target)&&t.onClose()};Z(()=>(document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}),[]);let n=i=>{i&&(t.onSelect(i),t.onClose())};return t.menuItems.length===0?null:p("div",{className:"deck-widget-dropdown-container",ref:o,children:[t.trigger,t.isOpen&&p("ul",{className:"deck-widget-dropdown-menu",style:t.style,children:t.menuItems.map((i,r)=>{let s=fi(i),a=hi(i);return p("li",{className:`deck-widget-dropdown-item ${s?"":"disabled"}`,onClick:()=>n(s),children:[a&&p("span",{className:"deck-widget-dropdown-item-icon",style:{maskImage:`url("${a}")`,WebkitMaskImage:`url("${a}")`}}),gi(i)]},r)})})]})};var _i="current",dn="deck-geocoder-history",St=class{constructor(o){this.addressText="";this.errorText="";this.addressHistory=[];this.props={maxEntries:5,...o},this.addressHistory=this.loadPreviousAddresses()}async geocode(o,e,n){this.errorText="",this.addressText=e;try{let i=await o.geocode(e,n);if(i)return this.storeAddress(this.addressText),i;this.errorText="Invalid address"}catch(i){this.errorText=`${i.message}`}return null}loadPreviousAddresses(){try{let o=window.localStorage.getItem(dn),e=o&&JSON.parse(o);return Array.isArray(e)?e.filter(i=>typeof i=="string"):[]}catch{}return[]}storeAddress(o){let e=o.trim();if(!e||e===_i)return;let n=[e,...this.addressHistory.filter(i=>i!==e)];this.addressHistory=n.slice(0,this.props.maxEntries);try{window.localStorage.setItem(dn,JSON.stringify(this.addressHistory))}catch{}}};var vi="https://maps.googleapis.com/maps/api/geocode/json",bi="https://api.mapbox.com/geocoding/v5/mapbox.places",wi="https://api.opencagedata.com/geocode/v1/json",Tt={name:"google",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await so(`${vi}?address=${e}&key=${o}`);switch(n.status){case"OK":let i=n.results.length>0&&n.results[0].geometry.location;return i?{longitude:i.lng,latitude:i.lat}:null;default:throw new Error(`Google Geocoder failed: ${n.status}`)}}},Ct={name:"google",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await so(`${bi}/${e}.json?access_token=${o}`);if(Array.isArray(n.features)&&n.features.length>0){let i=n.features[0].center;if(Array.isArray(i)&&i.length>=2)return{longitude:i[0],latitude:i[1]}}return null}},Mt={name:"opencage",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await so(`${wi}?q=${e}&key=${o}`);if(Array.isArray(n.results)&&n.results.length>0){let i=n.results[0].geometry;return{longitude:i.lng,latitude:i.lat}}return null}},It={name:"current",requiresApiKey:!1,async geocode(){if(!navigator.geolocation)throw new Error("Geolocation not supported");return new Promise((t,o)=>{navigator.geolocation.getCurrentPosition(e=>{let{longitude:n,latitude:i}=e.coords;t({longitude:n,latitude:i})},e=>o(new Error(e.message)))})}};async function so(t){let o;try{o=await fetch(t)}catch(n){throw new Error(`CORS error? ${n}. ${t}: `)}if(!o.ok)throw new Error(`${o.statusText}. ${t}: `);let e=await o.json();if(!e)throw new Error(`No data returned. ${t}`);return e}var Ce={name:"coordinates",requiresApiKey:!1,placeholderLocation:"-122.45, 37.8 or 37\xB048'N, 122\xB027'W",async geocode(t){return xi(t)||null}};function xi(t){t=t.trim();let o=t.split(/[,;]/).map(i=>i.trim());if(o.length<2)return null;let e=pn(o[0]),n=pn(o[1]);return e===null||n===null?null:Math.abs(e)>90&&Math.abs(n)<=90?{longitude:e,latitude:n}:Math.abs(n)>90&&Math.abs(e)<=90?{longitude:n,latitude:e}:{latitude:e,longitude:n}}function pn(t){if(t=t.trim(),t.includes("\xB0")||t.includes("'")||t.includes('"')){let n=yi(t);return isNaN(n)?null:n}let o=1;/[SW]/i.test(t)&&(o=-1),t=t.replace(/[NSEW]/gi,"");let e=parseFloat(t);return isNaN(e)?null:o*e}function yi(t){let o=/(\d+)[°d]\s*(\d+)?['′m]?\s*(\d+(?:\.\d+)?)?[\"″s]?\s*([NSEW])?/i,e=t.match(o);if(!e)return NaN;let n=parseFloat(e[1])||0,i=parseFloat(e[2])||0,r=parseFloat(e[3])||0,s=e[4]||"",a=n+i/60+r/3600;return/[SW]/i.test(s)&&(a=-a),a}var un="current",Pi="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-480q33 0 56.5-23.5T560-560q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 33 23.5 56.5T480-480Zm0 294q122-112 181-203.5T720-552q0-109-69.5-178.5T480-800q-101 0-170.5 69.5T240-552q0 71 59 162.5T480-186Zm0 106Q319-217 239.5-334.5T160-552q0-150 96.5-239T480-880q127 0 223.5 89T800-552q0 100-79.5 217.5T480-80Z'/%3E%3C/svg%3E",ki={label:"Current location",value:un,icon:Pi},Ue=class extends ao.Widget{constructor(e={}){super(e);this.className="deck-widget-geocoder";this.placement="top-left";this.geocodeHistory=new St({});this.addressText="";this.geocoder=Ce;this.isGettingLocation=!1;this.setInput=e=>{this.addressText=e};this.handleKeyPress=e=>{e.key==="Enter"&&this.handleSubmit()};this.handleSelect=e=>{e===un?this.getCurrentLocation():(this.setInput(e),this.handleSubmit())};this.handleSubmit=()=>{this.geocode(this.addressText)};this.getCurrentLocation=async()=>{this.isGettingLocation=!0,this.rootElement&&this.updateHTML();try{let e=await It.geocode();e&&this.flyTo(e)}catch(e){this.geocodeHistory.errorText=e instanceof Error?e.message:"Location error"}finally{this.isGettingLocation=!1,this.rootElement&&this.updateHTML()}};this.geocode=async e=>{let n=await this.geocodeHistory.geocode(this.geocoder,this.addressText,this.props.apiKey);this.rootElement&&this.updateHTML(),n&&this.flyTo(n)};this.setProps(this.props)}setProps(e){if(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,this.geocoder=Si(this.props),this.geocoder.requiresApiKey&&!this.props.apiKey)throw new Error(`API key is required for the ${this.geocoder.name} geocoder`);super.setProps(e)}onRenderHTML(e){let n=this.props._geolocation?[ki,...this.geocodeHistory.addressHistory]:[...this.geocodeHistory.addressHistory];y(p("div",{className:"deck-widget-geocoder",children:[p("input",{className:"deck-widget-geocoder-input",type:"text",placeholder:this.isGettingLocation?"Finding your location...":this.geocoder.placeholderLocation??"Enter address or location",value:this.geocodeHistory.addressText,onInput:i=>this.setInput(i.target?.value||""),onKeyPress:this.handleKeyPress}),p(kt,{menuItems:n,onSelect:this.handleSelect}),this.geocodeHistory.errorText&&p("div",{className:"deck-widget-geocoder-error",children:this.geocodeHistory.errorText})]}),e)}flyTo(e){let n=this.viewId?[this.viewId]:this.deck?.getViews().map(i=>i.id)??[];for(let i of n){let s={...this.getViewState(i),...e};this.props.transitionDuration>0&&(s.transitionDuration=this.props.transitionDuration,s.transitionInterpolator="latitude"in s?new Wt.FlyToInterpolator:new Wt.LinearInterpolator),this.setViewState(i,s)}}};Ue.defaultProps={...ao.Widget.defaultProps,id:"geocoder",viewId:null,placement:"top-left",label:"Geocoder",transitionDuration:200,geocoder:"coordinates",customGeocoder:Ce,apiKey:"",_geolocation:!1};function Si(t){switch(t.geocoder){case"google":return Tt;case"mapbox":return Ct;case"opencage":return Mt;case"coordinates":return Ce;case"custom":if(!t.customGeocoder)throw new Error("Custom geocoder is not defined");return t.customGeocoder;default:throw new Error(`Unknown geocoder: ${t.geocoder}`)}}var Xe=E(R(),1);var qe=class extends Xe.Widget{constructor(e={}){super(e);this.className="deck-widget-fullscreen";this.placement="top-left";this.fullscreen=!1;this.setProps(this.props)}onAdd(){document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}onRemove(){document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}onRenderHTML(e){y(p(L,{onClick:()=>{this.handleClick().catch(n=>Xe.log.error(n)())},label:this.fullscreen?this.props.exitLabel:this.props.enterLabel,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"}),e)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}getContainer(){return this.props.container||this.deck?.props.parent||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,n=document.fullscreenElement===this.getContainer();e!==n&&(this.fullscreen=!this.fullscreen),this.updateHTML()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.updateHTML()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};qe.defaultProps={...Xe.Widget.defaultProps,id:"fullscreen",placement:"top-left",viewId:null,enterLabel:"Enter Fullscreen",exitLabel:"Exit Fullscreen",container:void 0};var lo=E(R(),1);var Je=class extends lo.Widget{constructor(e){super(e);this.className="deck-widget-splitter";this.placement="fill"}setProps(e){super.setProps(e)}onRenderHTML(e){e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.margin="0px",y(p(Ti,{orientation:this.props.orientation,initialSplit:this.props.initialSplit,onChange:this.props.onChange,onDragStart:this.props.onDragStart,onDragEnd:this.props.onDragEnd}),e)}};Je.defaultProps={...lo.Widget.defaultProps,id:"splitter-widget",viewId1:"",viewId2:"",orientation:"vertical",initialSplit:.5,onChange:()=>{},onDragStart:()=>{},onDragEnd:()=>{}};function Ti({orientation:t,initialSplit:o,onChange:e,onDragStart:n,onDragEnd:i}){let[r,s]=ee(o),a=N(!1),c=N(null),d=g=>{a.current=!0,n?.(),document.addEventListener("mousemove",m),document.addEventListener("mouseup",l),g.preventDefault()},m=g=>{if(!a.current||!c.current)return;let b=c.current.getBoundingClientRect(),h;t==="vertical"?h=(g.clientX-b.left)/b.width:h=(g.clientY-b.top)/b.height,h=Math.min(Math.max(h,.05),.95),s(h),e?.(h)},l=g=>{a.current&&(a.current=!1,i?.(),document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",l))},f=t==="vertical"?{position:"absolute",top:0,bottom:0,left:`${r*100}%`,width:"4px",cursor:"col-resize",background:"#ccc",zIndex:10,pointerEvents:"auto",boxShadow:"inset -1px 0 0 white, inset 1px 0 0 white"}:{position:"absolute",left:0,right:0,top:`${r*100}%`,height:"4px",cursor:"row-resize",background:"#ccc",zIndex:10,pointerEvents:"auto",boxShadow:"inset -1px 0 0 white, inset 1px 0 0 white"};return p("div",{ref:c,style:{position:"absolute",top:0,left:0,right:0,bottom:0},children:p("div",{style:f,onMouseDown:d})})}var uo=E(R(),1);function Lt(t){let[o,e]=ee(!1),n=N(null),i=f=>{n.current&&!n.current.contains(f.target)&&e(!1)};Z(()=>(document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}),[n]);let[r,s]=ee(t.initialItem),a=f=>{s(f),e(!1),t.onItemSelected(f)},c=()=>e(!o),d=t.menuItems.find(f=>f.value===r),m=t.label||d?.label||"",l=t.icon||d?.icon;return p("div",{style:{position:"relative",display:"inline-block"},ref:n,children:[p(L,{className:t.className,label:m,onClick:c,children:l}),o&&p("div",{className:"deck-widget-icon-menu",children:p(Se,{orientation:"vertical",children:t.menuItems.map(f=>p(L,{label:f.label,onClick:()=>a(f.value),children:f.icon},f.value))})})]})}var Ke=class extends uo.Widget{constructor(e={}){super(e);this.className="deck-widget-view-selector";this.placement="top-left";this.handleSelectMode=e=>{this.viewMode=e,this.updateHTML(),this.props.onViewModeChange(e)};this.viewMode=this.props.initialViewMode,this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){y(p(Lt,{className:"deck-widget-view-selector",menuItems:Ci.map(n=>({...n,icon:n.icon()})),initialItem:this.props.initialViewMode,onItemSelected:this.handleSelectMode}),e)}};Ke.defaultProps={...uo.Widget.defaultProps,id:"view-selector",placement:"top-left",viewId:null,label:"Split View",initialViewMode:"single",onViewModeChange:()=>{}};var co={width:"24px",height:"24px"},po={single:()=>p("svg",{width:"24",height:"24",style:co,children:p("rect",{x:"4",y:"4",width:"16",height:"16",stroke:"var(--button-icon-hover, rgb(24, 24, 26))",fill:"none",strokeWidth:"2"})}),"split-horizontal":()=>p("svg",{width:"24",height:"24",style:co,children:[p("rect",{x:"4",y:"4",width:"16",height:"7",stroke:"var(--button-icon-hover, rgb(24, 24, 26))",fill:"none",strokeWidth:"2"}),p("rect",{x:"4",y:"13",width:"16",height:"7",stroke:"var(--button-icon-hover, rgb(24, 24, 26))",fill:"none",strokeWidth:"2"})]}),"split-vertical":()=>p("svg",{width:"24",height:"24",style:co,children:[p("rect",{x:"4",y:"4",width:"7",height:"16",stroke:"var(--button-icon-hover, rgb(24, 24, 26))",fill:"none",strokeWidth:"2"}),p("rect",{x:"13",y:"4",width:"7",height:"16",stroke:"var(--button-icon-hover, rgb(24, 24, 26))",fill:"none",strokeWidth:"2"})]})},Ci=[{value:"single",icon:po.single,label:"Single View"},{value:"split-horizontal",icon:po["split-horizontal"],label:"Split Horizontal"},{value:"split-vertical",icon:po["split-vertical"],label:"Split Vertical"}];var yo=E(R(),1);var Rt=Math.min,mn=Math.max;var Mi={left:"right",right:"left",bottom:"top",top:"bottom"},Ii={start:"end",end:"start"};function Ot(t,o,e){return mn(t,Rt(o,e))}function Me(t,o){return typeof t=="function"?t(o):t}function ae(t){return t.split("-")[0]}function Ie(t){return t.split("-")[1]}function mo(t){return t==="x"?"y":"x"}function At(t){return t==="y"?"height":"width"}function fe(t){return["top","bottom"].includes(ae(t))?"y":"x"}function Dt(t){return mo(fe(t))}function fn(t,o,e){e===void 0&&(e=!1);let n=Ie(t),i=Dt(t),r=At(i),s=i==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return o.reference[r]>o.floating[r]&&(s=Ye(s)),[s,Ye(s)]}function gn(t){let o=Ye(t);return[Et(t),o,Et(o)]}function Et(t){return t.replace(/start|end/g,o=>Ii[o])}function Wi(t,o,e){let n=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return e?o?i:n:o?n:i;case"left":case"right":return o?r:s;default:return[]}}function hn(t,o,e,n){let i=Ie(t),r=Wi(ae(t),e==="start",n);return i&&(r=r.map(s=>s+"-"+i),o&&(r=r.concat(r.map(Et)))),r}function Ye(t){return t.replace(/left|right|bottom|top/g,o=>Mi[o])}function Li(t){return{top:0,right:0,bottom:0,left:0,...t}}function fo(t){return typeof t!="number"?Li(t):{top:t,right:t,bottom:t,left:t}}function ge(t){let{x:o,y:e,width:n,height:i}=t;return{width:n,height:i,top:e,left:o,right:o+n,bottom:e+i,x:o,y:e}}function _n(t,o,e){let{reference:n,floating:i}=t,r=fe(o),s=Dt(o),a=At(s),c=ae(o),d=r==="y",m=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2,f=n[a]/2-i[a]/2,u;switch(c){case"top":u={x:m,y:n.y-i.height};break;case"bottom":u={x:m,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:l};break;case"left":u={x:n.x-i.width,y:l};break;default:u={x:n.x,y:n.y}}switch(Ie(o)){case"start":u[s]-=f*(e&&d?-1:1);break;case"end":u[s]+=f*(e&&d?-1:1);break}return u}var vn=async(t,o,e)=>{let{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=e,a=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(o)),d=await s.getElementRects({reference:t,floating:o,strategy:i}),{x:m,y:l}=_n(d,n,c),f=n,u={},g=0;for(let b=0;b<a.length;b++){let{name:h,fn:_}=a[b],{x:w,y:P,data:S,reset:x}=await _({x:m,y:l,initialPlacement:n,placement:f,strategy:i,middlewareData:u,rects:d,platform:s,elements:{reference:t,floating:o}});m=w??m,l=P??l,u={...u,[h]:{...u[h],...S}},x&&g<=50&&(g++,typeof x=="object"&&(x.placement&&(f=x.placement),x.rects&&(d=x.rects===!0?await s.getElementRects({reference:t,floating:o,strategy:i}):x.rects),{x:m,y:l}=_n(d,f,c)),b=-1)}return{x:m,y:l,placement:f,strategy:i,middlewareData:u}};async function go(t,o){var e;o===void 0&&(o={});let{x:n,y:i,platform:r,rects:s,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:l="floating",altBoundary:f=!1,padding:u=0}=Me(o,t),g=fo(u),h=a[f?l==="floating"?"reference":"floating":l],_=ge(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(h)))==null||e?h:h.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:d,rootBoundary:m,strategy:c})),w=l==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),S=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},x=ge(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:P,strategy:c}):w);return{top:(_.top-x.top+g.top)/S.y,bottom:(x.bottom-_.bottom+g.bottom)/S.y,left:(_.left-x.left+g.left)/S.x,right:(x.right-_.right+g.right)/S.x}}var bn=t=>({name:"arrow",options:t,async fn(o){let{x:e,y:n,placement:i,rects:r,platform:s,elements:a,middlewareData:c}=o,{element:d,padding:m=0}=Me(t,o)||{};if(d==null)return{};let l=fo(m),f={x:e,y:n},u=Dt(i),g=At(u),b=await s.getDimensions(d),h=u==="y",_=h?"top":"left",w=h?"bottom":"right",P=h?"clientHeight":"clientWidth",S=r.reference[g]+r.reference[u]-f[u]-r.floating[g],x=f[u]-r.reference[u],T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d)),M=T?T[P]:0;(!M||!await(s.isElement==null?void 0:s.isElement(T)))&&(M=a.floating[P]||r.floating[g]);let I=S/2-x/2,H=M/2-b[g]/2-1,O=Rt(l[_],H),C=Rt(l[w],H),Q=O,ce=M-b[g]-C,V=M/2-b[g]/2+I,ie=Ot(Q,V,ce),q=!c.arrow&&Ie(i)!=null&&V!==ie&&r.reference[g]/2-(V<Q?O:C)-b[g]/2<0,B=q?V<Q?V-Q:V-ce:0;return{[u]:f[u]+B,data:{[u]:ie,centerOffset:V-ie-B,...q&&{alignmentOffset:B}},reset:q}}});var wn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var e,n;let{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:c,elements:d}=o,{mainAxis:m=!0,crossAxis:l=!0,fallbackPlacements:f,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...h}=Me(t,o);if((e=r.arrow)!=null&&e.alignmentOffset)return{};let _=ae(i),w=fe(a),P=ae(a)===a,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),x=f||(P||!b?[Ye(a)]:gn(a)),T=g!=="none";!f&&T&&x.push(...hn(a,b,g,S));let M=[a,...x],I=await go(o,h),H=[],O=((n=r.flip)==null?void 0:n.overflows)||[];if(m&&H.push(I[_]),l){let V=fn(i,s,S);H.push(I[V[0]],I[V[1]])}if(O=[...O,{placement:i,overflows:H}],!H.every(V=>V<=0)){var C,Q;let V=(((C=r.flip)==null?void 0:C.index)||0)+1,ie=M[V];if(ie)return{data:{index:V,overflows:O},reset:{placement:ie}};let q=(Q=O.filter(B=>B.overflows[0]<=0).sort((B,F)=>B.overflows[1]-F.overflows[1])[0])==null?void 0:Q.placement;if(!q)switch(u){case"bestFit":{var ce;let B=(ce=O.filter(F=>{if(T){let z=fe(F.placement);return z===w||z==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(z=>z>0).reduce((z,Ut)=>z+Ut,0)]).sort((F,z)=>F[1]-z[1])[0])==null?void 0:ce[0];B&&(q=B);break}case"initialPlacement":q=a;break}if(i!==q)return{reset:{placement:q}}}return{}}}};async function Ei(t,o){let{placement:e,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=ae(e),a=Ie(e),c=fe(e)==="y",d=["left","top"].includes(s)?-1:1,m=r&&c?-1:1,l=Me(o,t),{mainAxis:f,crossAxis:u,alignmentAxis:g}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return a&&typeof g=="number"&&(u=a==="end"?g*-1:g),c?{x:u*m,y:f*d}:{x:f*d,y:u*m}}var xn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var e,n;let{x:i,y:r,placement:s,middlewareData:a}=o,c=await Ei(o,t);return s===((e=a.offset)==null?void 0:e.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},yn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){let{x:e,y:n,placement:i}=o,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:h=>{let{x:_,y:w}=h;return{x:_,y:w}}},...c}=Me(t,o),d={x:e,y:n},m=await go(o,c),l=fe(ae(i)),f=mo(l),u=d[f],g=d[l];if(r){let h=f==="y"?"top":"left",_=f==="y"?"bottom":"right",w=u+m[h],P=u-m[_];u=Ot(w,u,P)}if(s){let h=l==="y"?"top":"left",_=l==="y"?"bottom":"right",w=g+m[h],P=g-m[_];g=Ot(w,g,P)}let b=a.fn({...o,[f]:u,[l]:g});return{...b,data:{x:b.x-e,y:b.y-n}}}}};var Nt=Math.min,he=Math.max,je=Math.round,Ze=Math.floor,oe=t=>({x:t,y:t});function Ht(){return typeof window<"u"}function _e(t){return kn(t)?(t.nodeName||"").toLowerCase():"#document"}function $(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function X(t){var o;return(o=(kn(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function kn(t){return Ht()?t instanceof Node||t instanceof $(t).Node:!1}function G(t){return Ht()?t instanceof Element||t instanceof $(t).Element:!1}function J(t){return Ht()?t instanceof HTMLElement||t instanceof $(t).HTMLElement:!1}function Pn(t){return!Ht()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof $(t).ShadowRoot}function Le(t){let{overflow:o,overflowX:e,overflowY:n,display:i}=U(t);return/auto|scroll|overlay|hidden|clip/.test(o+n+e)&&!["inline","contents"].includes(i)}function Sn(t){return["table","td","th"].includes(_e(t))}function Qe(t){return[":popover-open",":modal"].some(o=>{try{return t.matches(o)}catch{return!1}})}function Vt(t){let o=$t(),e=G(t)?U(t):t;return["transform","translate","scale","rotate","perspective"].some(n=>e[n]?e[n]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!o&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!o&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(e.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(e.contain||"").includes(n))}function Tn(t){let o=ne(t);for(;J(o)&&!ve(o);){if(Vt(o))return o;if(Qe(o))return null;o=ne(o)}return null}function $t(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ve(t){return["html","body","#document"].includes(_e(t))}function U(t){return $(t).getComputedStyle(t)}function et(t){return G(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ne(t){if(_e(t)==="html")return t;let o=t.assignedSlot||t.parentNode||Pn(t)&&t.host||X(t);return Pn(o)?o.host:o}function Cn(t){let o=ne(t);return ve(o)?t.ownerDocument?t.ownerDocument.body:t.body:J(o)&&Le(o)?o:Cn(o)}function We(t,o,e){var n;o===void 0&&(o=[]),e===void 0&&(e=!0);let i=Cn(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=$(i);if(r){let a=Bt(s);return o.concat(s,s.visualViewport||[],Le(i)?i:[],a&&e?We(a):[])}return o.concat(i,We(i,[],e))}function Bt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Wn(t){let o=U(t),e=parseFloat(o.width)||0,n=parseFloat(o.height)||0,i=J(t),r=i?t.offsetWidth:e,s=i?t.offsetHeight:n,a=je(e)!==r||je(n)!==s;return a&&(e=r,n=s),{width:e,height:n,$:a}}function vo(t){return G(t)?t:t.contextElement}function Ee(t){let o=vo(t);if(!J(o))return oe(1);let e=o.getBoundingClientRect(),{width:n,height:i,$:r}=Wn(o),s=(r?je(e.width):e.width)/n,a=(r?je(e.height):e.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var Ri=oe(0);function Ln(t){let o=$(t);return!$t()||!o.visualViewport?Ri:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function Oi(t,o,e){return o===void 0&&(o=!1),!e||o&&e!==$(t)?!1:o}function be(t,o,e,n){o===void 0&&(o=!1),e===void 0&&(e=!1);let i=t.getBoundingClientRect(),r=vo(t),s=oe(1);o&&(n?G(n)&&(s=Ee(n)):s=Ee(t));let a=Oi(r,e,n)?Ln(r):oe(0),c=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,m=i.width/s.x,l=i.height/s.y;if(r){let f=$(r),u=n&&G(n)?$(n):n,g=f,b=Bt(g);for(;b&&n&&u!==g;){let h=Ee(b),_=b.getBoundingClientRect(),w=U(b),P=_.left+(b.clientLeft+parseFloat(w.paddingLeft))*h.x,S=_.top+(b.clientTop+parseFloat(w.paddingTop))*h.y;c*=h.x,d*=h.y,m*=h.x,l*=h.y,c+=P,d+=S,g=$(b),b=Bt(g)}}return ge({width:m,height:l,x:c,y:d})}function Ai(t){let{elements:o,rect:e,offsetParent:n,strategy:i}=t,r=i==="fixed",s=X(n),a=o?Qe(o.floating):!1;if(n===s||a&&r)return e;let c={scrollLeft:0,scrollTop:0},d=oe(1),m=oe(0),l=J(n);if((l||!l&&!r)&&((_e(n)!=="body"||Le(s))&&(c=et(n)),J(n))){let f=be(n);d=Ee(n),m.x=f.x+n.clientLeft,m.y=f.y+n.clientTop}return{width:e.width*d.x,height:e.height*d.y,x:e.x*d.x-c.scrollLeft*d.x+m.x,y:e.y*d.y-c.scrollTop*d.y+m.y}}function Di(t){return Array.from(t.getClientRects())}function _o(t,o){let e=et(t).scrollLeft;return o?o.left+e:be(X(t)).left+e}function Ni(t){let o=X(t),e=et(t),n=t.ownerDocument.body,i=he(o.scrollWidth,o.clientWidth,n.scrollWidth,n.clientWidth),r=he(o.scrollHeight,o.clientHeight,n.scrollHeight,n.clientHeight),s=-e.scrollLeft+_o(t),a=-e.scrollTop;return U(n).direction==="rtl"&&(s+=he(o.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}function Hi(t,o){let e=$(t),n=X(t),i=e.visualViewport,r=n.clientWidth,s=n.clientHeight,a=0,c=0;if(i){r=i.width,s=i.height;let d=$t();(!d||d&&o==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:r,height:s,x:a,y:c}}function Vi(t,o){let e=be(t,!0,o==="fixed"),n=e.top+t.clientTop,i=e.left+t.clientLeft,r=J(t)?Ee(t):oe(1),s=t.clientWidth*r.x,a=t.clientHeight*r.y,c=i*r.x,d=n*r.y;return{width:s,height:a,x:c,y:d}}function Mn(t,o,e){let n;if(o==="viewport")n=Hi(t,e);else if(o==="document")n=Ni(X(t));else if(G(o))n=Vi(o,e);else{let i=Ln(t);n={...o,x:o.x-i.x,y:o.y-i.y}}return ge(n)}function En(t,o){let e=ne(t);return e===o||!G(e)||ve(e)?!1:U(e).position==="fixed"||En(e,o)}function $i(t,o){let e=o.get(t);if(e)return e;let n=We(t,[],!1).filter(a=>G(a)&&_e(a)!=="body"),i=null,r=U(t).position==="fixed",s=r?ne(t):t;for(;G(s)&&!ve(s);){let a=U(s),c=Vt(s);!c&&a.position==="fixed"&&(i=null),(r?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Le(s)&&!c&&En(t,s))?n=n.filter(m=>m!==s):i=a,s=ne(s)}return o.set(t,n),n}function Bi(t){let{element:o,boundary:e,rootBoundary:n,strategy:i}=t,s=[...e==="clippingAncestors"?Qe(o)?[]:$i(o,this._c):[].concat(e),n],a=s[0],c=s.reduce((d,m)=>{let l=Mn(o,m,i);return d.top=he(l.top,d.top),d.right=Nt(l.right,d.right),d.bottom=Nt(l.bottom,d.bottom),d.left=he(l.left,d.left),d},Mn(o,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Fi(t){let{width:o,height:e}=Wn(t);return{width:o,height:e}}function zi(t,o,e){let n=J(o),i=X(o),r=e==="fixed",s=be(t,!0,r,o),a={scrollLeft:0,scrollTop:0},c=oe(0);if(n||!n&&!r)if((_e(o)!=="body"||Le(i))&&(a=et(o)),n){let u=be(o,!0,r,o);c.x=u.x+o.clientLeft,c.y=u.y+o.clientTop}else i&&(c.x=_o(i));let d=0,m=0;if(i&&!n&&!r){let u=i.getBoundingClientRect();m=u.top+a.scrollTop,d=u.left+a.scrollLeft-_o(i,u)}let l=s.left+a.scrollLeft-c.x-d,f=s.top+a.scrollTop-c.y-m;return{x:l,y:f,width:s.width,height:s.height}}function ho(t){return U(t).position==="static"}function In(t,o){if(!J(t)||U(t).position==="fixed")return null;if(o)return o(t);let e=t.offsetParent;return X(t)===e&&(e=e.ownerDocument.body),e}function Rn(t,o){let e=$(t);if(Qe(t))return e;if(!J(t)){let i=ne(t);for(;i&&!ve(i);){if(G(i)&&!ho(i))return i;i=ne(i)}return e}let n=In(t,o);for(;n&&Sn(n)&&ho(n);)n=In(n,o);return n&&ve(n)&&ho(n)&&!Vt(n)?e:n||Tn(t)||e}var Gi=async function(t){let o=this.getOffsetParent||Rn,e=this.getDimensions,n=await e(t.floating);return{reference:zi(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Ui(t){return U(t).direction==="rtl"}var qi={convertOffsetParentRelativeRectToViewportRelativeRect:Ai,getDocumentElement:X,getClippingRect:Bi,getOffsetParent:Rn,getElementRects:Gi,getClientRects:Di,getDimensions:Fi,getScale:Ee,isElement:G,isRTL:Ui};function Xi(t,o){let e=null,n,i=X(t);function r(){var a;clearTimeout(n),(a=e)==null||a.disconnect(),e=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),r();let{left:d,top:m,width:l,height:f}=t.getBoundingClientRect();if(a||o(),!l||!f)return;let u=Ze(m),g=Ze(i.clientWidth-(d+l)),b=Ze(i.clientHeight-(m+f)),h=Ze(d),w={rootMargin:-u+"px "+-g+"px "+-b+"px "+-h+"px",threshold:he(0,Nt(1,c))||1},P=!0;function S(x){let T=x[0].intersectionRatio;if(T!==c){if(!P)return s();T?s(!1,T):n=setTimeout(()=>{s(!1,1e-7)},1e3)}P=!1}try{e=new IntersectionObserver(S,{...w,root:i.ownerDocument})}catch{e=new IntersectionObserver(S,w)}e.observe(t)}return s(!0),r}function On(t,o,e,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=vo(t),m=i||r?[...d?We(d):[],...We(o)]:[];m.forEach(_=>{i&&_.addEventListener("scroll",e,{passive:!0}),r&&_.addEventListener("resize",e)});let l=d&&a?Xi(d,e):null,f=-1,u=null;s&&(u=new ResizeObserver(_=>{let[w]=_;w&&w.target===d&&u&&(u.unobserve(o),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(o)})),e()}),d&&!c&&u.observe(d),u.observe(o));let g,b=c?be(t):null;c&&h();function h(){let _=be(t);b&&(_.x!==b.x||_.y!==b.y||_.width!==b.width||_.height!==b.height)&&e(),b=_,g=requestAnimationFrame(h)}return e(),()=>{var _;m.forEach(w=>{i&&w.removeEventListener("scroll",e),r&&w.removeEventListener("resize",e)}),l?.(),(_=u)==null||_.disconnect(),u=null,c&&cancelAnimationFrame(g)}}var bo=xn;var wo=yn,xo=wn;var An=bn;var Dn=(t,o,e)=>{let n=new Map,i={platform:qi,...e},r={...i.platform,_c:n};return vn(t,o,{...i,platform:r})};var Re=({x:t,y:o,placement:e="right",offset:n=0,arrow:i=!1,arrowColor:r="white",children:s})=>{let a=N(null),c=N(null),d=N(null),m=N();return m.current=()=>{if(!a.current||!c.current)return;let l=Array.isArray(i)?i[0]:i||0,f=Array.isArray(i)?i[1]:i||0,u=n+Math.max(f,l),g=e.includes("-")?[bo(u),xo(),wo()]:[bo(u),wo(),xo()];d.current&&g.push(An({element:d.current})),Dn(a.current,c.current,{placement:e,strategy:"fixed",middleware:g}).then(b=>{c.current&&Object.assign(c.current.style,{left:`${b.x}px`,top:`${b.y}px`});let h=b.middlewareData.arrow;if(h&&d.current){let _=Ji(l,f,r,b.placement);_.transform=`translate(${h.x||0}px, ${h.y||0}px)`,Object.assign(d.current.style,_)}})},me(()=>{m.current?.()},[e,i,n]),Z(()=>{c.current&&(c.current.style.visibility="visible");let l=On(a.current,c.current,()=>m.current?.());return()=>{l()}},[]),p("div",{style:{position:"absolute",left:t,top:o},ref:a,children:p("div",{className:"deck-widget deck-widget-popover",style:{position:"fixed",visibility:"hidden",pointerEvents:"none"},ref:c,children:[Boolean(i)&&p("div",{className:"deck-widget-popover-arrow",style:{position:"absolute"},ref:d}),s]})})};function Ji(t,o,e,n){let i={width:0,height:0,top:"",bottom:"",left:"",right:""};return n.startsWith("bottom")?(i.borderLeft=`${t/2}px solid transparent`,i.borderRight=`${t/2}px solid transparent`,i.borderBottom=`${o}px solid ${e}`,i.borderTop="",i.top=`${-o}px`):n.startsWith("top")?(i.borderLeft=`${t/2}px solid transparent`,i.borderRight=`${t/2}px solid transparent`,i.borderTop=`${o}px solid ${e}`,i.borderBottom="",i.bottom=`${-o}px`):n.startsWith("right")?(i.borderTop=`${t/2}px solid transparent`,i.borderBottom=`${t/2}px solid transparent`,i.borderRight=`${o}px solid ${e}`,i.borderLeft="",i.left=`${-o}px`):n.startsWith("left")&&(i.borderTop=`${t/2}px solid transparent`,i.borderBottom=`${t/2}px solid transparent`,i.borderLeft=`${o}px solid ${e}`,i.borderRight="",i.right=`${-o}px`),i}var tt=({text:t,html:o,element:e,...n})=>{let i=N(null);return Z(()=>(i.current&&e&&i.current.append(e),()=>{e?.remove()}),[e]),p("div",{ref:i,...n,dangerouslySetInnerHTML:o?{__html:o}:void 0,children:t})};var ot=class extends yo.Widget{constructor(e){super(e);this.className="deck-widget-info";this.placement="fill";this.tooltip=null;this.setProps(this.props)}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd({deck:e}){this.deck=e}onViewportChange(e){this.viewport=e,this.updateHTML()}onHover(e){this.props.mode==="hover"&&(this.tooltip=this._getTooltip(e))}onClick(e){this.props.mode==="click"&&(this.tooltip=this._getTooltip(e))}_getTooltip(e){if(!this.props.getTooltip)return null;let n=this.props.getTooltip(e,this)??null;if(n===null)return null;let i=typeof n=="string"?{text:n}:n,r=i.position||e.coordinate;return r?{position:r,text:"",html:"",element:null,className:"",style:{},...i}:null}onRenderHTML(e){if(!this.viewport||this.tooltip===null){y(null,e);return}let n={...this.props.style,...this.tooltip.style},[i,r]=this.viewport.project(this.tooltip.position),s=p(Re,{x:i,y:r,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p(tt,{className:`deck-widget-popup-content ${this.tooltip.className} ${this.props.className}`,style:n,html:this.tooltip.html,text:this.tooltip.text,element:this.tooltip.element})});y(s,e)}};ot.defaultProps={...yo.Widget.defaultProps,id:"info",viewId:null,mode:"hover",getTooltip:void 0,placement:"right",offset:10,arrow:10};var Po=E(R(),1);var nt=class extends Po.Widget{constructor(e){super(e);this.className="deck-widget-popup";this.placement="fill";this.setProps(this.props),this.isOpen=this.props.defaultIsOpen}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd({deck:e}){this.deck=e}onViewportChange(e){this.viewport=e,this.updateHTML()}onClick(){this.props.closeOnClickOutside&&this._setIsOpen(!1)}_setIsOpen(e){this.isOpen!==e&&(this.isOpen=e,this.props.onOpenChange?.(e),this.updateHTML())}onRenderHTML(e){if(!this.viewport){y(null,e);return}let{marker:n,content:i,style:r}=this.props,[s,a]=this.viewport.project(this.props.position),c=p("div",{children:[n&&p("div",{style:{position:"absolute",left:s,top:a,pointerEvents:"all",cursor:"pointer"},children:p(tt,{...n,onClick:()=>this._setIsOpen(!0)})}),this.isOpen&&p(Re,{x:s,y:a,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p("div",{className:`deck-widget-popup-content ${this.props.className}`,style:r,children:[this.props.closeButton&&p("div",{className:"deck-widget-popup-controls",style:{width:"100%",display:"flex",justifyContent:"end"},children:p(L,{className:"deck-widget-popup-close-button",onClick:()=>this._setIsOpen(!1)})}),p(tt,{...typeof i=="string"?{text:i}:i})]})})]});y(c,e)}};nt.defaultProps={...Po.Widget.defaultProps,id:"info",viewId:null,position:[0,0],marker:null,defaultIsOpen:!0,content:"",placement:"right",offset:10,arrow:10,closeButton:!0,closeOnClickOutside:!1,onOpenChange:()=>{}};var ko=E(R(),1);var it=class extends ko.Widget{constructor(e){super(e);this.className="deck-widget-context-menu";this.placement="fill";this.menu=null;this.setProps(this.props)}onAdd({deck:e}){e.getCanvas()?.addEventListener("contextmenu",n=>this.handleContextMenu(n))}handleContextMenu(e){let n=e.target.getBoundingClientRect(),i=e.clientX-n.x,r=e.clientY-n.y,s=this.deck?.pickObject({x:i,y:r})||{x:i,y:r,picked:!1,layer:null,color:null,index:-1,pixelRatio:1},a=this.props.getMenuItems(s,this)||[];this.menu=a.length>0?{items:a,pickInfo:s}:null,e.preventDefault(),this.updateHTML()}onRenderHTML(e){if(!this.menu){y(null,e);return}let{items:n,pickInfo:i}=this.menu,r={pointerEvents:"auto",position:"static",...this.props.style},s=p(Re,{x:i.x,y:i.y,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p(Ge,{menuItems:n,onSelect:a=>this.props.onMenuItemSelected(a,i),style:r,isOpen:!0,onClose:()=>this.hide()})});y(s,e)}hide(){this.menu=null,this.updateHTML()}};it.defaultProps={...ko.Widget.defaultProps,id:"context",viewId:null,getMenuItems:void 0,onMenuItemSelected:()=>{},placement:"bottom-start",offset:10,arrow:!1};var Co=E(R(),1);var Nn={passive:!1},rt=(t,o,e)=>t<o?o:t>e?e:t,Ft=(t,o)=>{if(!t||!t.firstElementChild)return[0,0];let e=t.firstElementChild.getBoundingClientRect();return o?[e.top,e.height]:o?[e.top,e.height]:[e.left,e.width]},st=(t,o)=>typeof t=="number"&&!Number.isNaN(t)&&t>0?t:Math.max(1,o/10||1),So=(t,o)=>typeof t=="number"&&!Number.isNaN(t)&&t>0?t:Math.max(1,o||1);function Oe(t){let{className:o="",min:e,max:n,step:i,value:r,orientation:s,pageSize:a,stepButtons:c=!1,startButtonAriaLabel:d,endButtonAriaLabel:m,eventTarget:l,decorations:f=[],onChange:u}=t,g=s!=="horizontal",b=N(null),h=N(null),_=N(null),w=N(null),[P,S]=ee(0),x=n-e,T=Math.max(0,r[1]-r[0]),M=Math.max(0,x-T),I=rt(r[0],e,e+M),{thumbLength:H,thumbOffset:O}=me(()=>{if(P<=0||x<=0)return{thumbLength:0,thumbOffset:0};if(x<=T)return{thumbLength:1,thumbOffset:0};let v=T/x,k=Math.max(0,1-v),K=M<=0?0:rt((I-e)/M,0,1);return{thumbLength:Math.max(0,Math.min(v,1)),thumbOffset:k*K}},[P,x,T,M,I,e]),C=te(v=>{if(!u)return;let k=rt(v,e,e+M);u([k,k+T])},[u,e,M,T]),Q=te(v=>{v.stopPropagation(),C(I-st(i,x))},[C,I,i,x]),ce=te(v=>{v.stopPropagation(),C(I+st(i,x))},[C,I,i,x]),V=te(v=>{if(v.button!==0||v.target?.dataset.scrollbarThumb==="true")return;let K=h.current;if(!K)return;v.preventDefault(),v.stopPropagation();let[we]=Ft(K,g),Ae=g?v.clientY-we:v.clientX-we,xe=Math.max(1,1-H)*P,ye=H/2*P,Pe=xe<=0?0:rt((Ae-ye)/xe,0,1);C(e+Pe*M)},[g,P,H,C,e,M]),ie=v=>{v.button!==0||!h.current||(w.current={pointerId:v.pointerId,startCoord:g?v.clientY:v.clientX,startRatio:O,min:e,max:n,maxStart:M},v.currentTarget.setPointerCapture(v.pointerId),v.preventDefault(),v.stopPropagation())},q=te(v=>{let k=w.current;if(!k||k.pointerId!==v.pointerId)return;let[K,we]=Ft(h.current,g),xe=(g?v.clientY:v.clientX)-k.startCoord,ye=k.startRatio+xe/we,Pe=rt(ye*(k.max-k.min),0,k.maxStart)+k.min;C(Pe),v.preventDefault()},[C,g]),B=te(v=>{let k=w.current;k&&k.pointerId===v.pointerId&&(w.current=null,_.current?.releasePointerCapture(v.pointerId),v.preventDefault())},[]),F=te(v=>{switch(v.key){case"ArrowUp":case"ArrowLeft":(g&&v.key==="ArrowUp"||!g&&v.key==="ArrowLeft")&&(C(I-st(i,x)),v.preventDefault());break;case"ArrowDown":case"ArrowRight":(g&&v.key==="ArrowDown"||!g&&v.key==="ArrowRight")&&(C(I+st(i,x)),v.preventDefault());break;case"PageUp":C(I-So(a,T)),v.preventDefault();break;case"PageDown":C(I+So(a,T)),v.preventDefault();break;case"Home":C(e),v.preventDefault();break;case"End":C(e+M),v.preventDefault();break;default:break}},[g,C,I,i,x,a,T,e,M]),z=te(v=>{if(v.preventDefault(),v.stopPropagation(),M===0)return;let k=g?v.deltaY:v.deltaX;!g&&k===0&&(k=v.deltaY),v.deltaMode===WheelEvent.DOM_DELTA_LINE?k*=st(i,x):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(k*=So(a,T)),k!==0&&C(I+k)},[C,I,M,g,i,x,a,T]);io(()=>{S(Ft(h.current,g)[1])},[g]),io(()=>{let v=h.current;if(!v)return;let k=()=>{S(Ft(v,g)[1])};if(k(),typeof ResizeObserver<"u"){let K=new ResizeObserver(k);return K.observe(v),()=>K.disconnect()}if(typeof window<"u")return window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[g]),Z(()=>{let v=l??b.current;if(v)return v.addEventListener("keydown",F),v.addEventListener("wheel",z,Nn),()=>{v.removeEventListener("keydown",F),v.removeEventListener("wheel",z,Nn)}},[l,F,z]);let Ut=me(()=>!f.length||x<=0?[]:f.map((v,k)=>{let[K,we]=v.position,Ae=(K-e)/x,xe=(we-e)/x,ye=Math.round(Ae*1e3)/10,Pe=Math.max(0,Math.round((xe-Ae)*1e3)/10),qn=g?{left:"0",width:"100%",top:`${ye}%`,height:`${Pe}%`}:{top:"0",height:"100%",left:`${ye}%`,width:`${Pe}%`};return p("div",{className:"deck-widget-range__decoration",style:qn,children:v.element},`decoration-${k}`)}),[f,x,e,g]);return p("div",{ref:b,tabIndex:0,role:"scrollbar","aria-valuemin":e,"aria-valuemax":e+M,"aria-valuenow":I,"aria-orientation":s,className:`${o} deck-widget-range deck-widget-range--${s} ${M===0?"deck-widget-range--disabled":""}`,children:[c&&p("button",{type:"button",className:"deck-widget-range__button deck-widget-range__button--start","aria-label":d,disabled:I<=e,onClick:Q,children:p("span",{className:"deck-widget-icon"})}),p("div",{className:"deck-widget-range__track",ref:h,onClick:V,children:[p("div",{className:"deck-widget-range__decorations",children:Ut}),p("div",{className:"deck-widget-range__thumb","data-scrollbar-thumb":"true",ref:_,style:g?{height:`${H*100}%`,top:`${O*100}%`}:{width:`${H*100}%`,left:`${O*100}%`},onPointerDown:ie,onPointerMove:q,onPointerUp:B,onPointerCancel:B})]}),c&&p("button",{type:"button",className:"deck-widget-range__button deck-widget-range__button--end","aria-label":m,disabled:I>=e+M,onClick:ce,children:p("span",{className:"deck-widget-icon"})})]})}var Hn=(t,o,e)=>t<o?o:t>e?e:t,Mo=class extends Co.Widget{constructor(e){let n={...Mo.defaultProps,...e};super(n);this.className="deck-widget-scrollbar";this.placement="fill";this.contentSize=0;this.viewportSize=0;this.scrollOffset=0;this.handleRangeChange=e=>{this.emitScroll(e[0])};this.viewId=n.viewId??null}onViewportChange(e){this.viewport=e,this.onRenderHTML()}onRenderHTML(){let e=this.rootElement;if(!e)return;e.dataset.placement=this.props.placement;let n=this.viewport;this.updateViewport(n);let i=this.getClampedOffset(),r=this.getWheelEventTarget(this.props.captureWheel?"global":"local"),s=this.getDecorations(n),a=this.isVertical(),c=this.props.startButtonAriaLabel??(a?"Scroll up":"Scroll left"),d=this.props.endButtonAriaLabel??(a?"Scroll down":"Scroll right"),m=p(Oe,{min:0,max:Math.max(0,this.contentSize),step:this.getEffectiveStep(),pageSize:this.getEffectivePage(),value:[i,i+this.viewportSize],orientation:this.props.orientation,stepButtons:!0,startButtonAriaLabel:c,endButtonAriaLabel:d,eventTarget:r,decorations:s,onChange:this.handleRangeChange});y(m,e)}onRemove(){this.rootElement&&y(null,this.rootElement),super.onRemove()}updateViewport(e){if(!e){this.contentSize=0,this.scrollOffset=0,this.viewportSize=0;return}let{contentBounds:n}=this.props,i=this.isVertical(),r=n?To(n,e,i):[0,0];this.contentSize=r[1]-r[0],this.scrollOffset=-r[0],this.viewportSize=i?e.height:e.width}getDecorations(e){let{decorations:n=[],contentBounds:i}=this.props;if(!e||!i||n.length===0)return[];let r=this.isVertical(),[s]=To(i,e,r);return n.map(a=>{let[c,d]=To(a.contentBounds,e,r),m=a.onClick?l=>{a.onClick?.(l)&&(l.stopPropagation(),l.preventDefault())}:void 0;return{position:[c-s,d-s],element:p("div",{style:{pointerEvents:m?"all":"none",width:"100%",height:"100%",backgroundColor:a.color},title:a.title,onClick:m})}})}getWheelEventTarget(e){return e===null?null:e==="local"?this.rootElement:this.deck?.props.parent||this.deck?.getCanvas()?.parentElement||this.rootElement}getMaxScroll(){return Math.max(0,this.contentSize-this.viewportSize)}getClampedOffset(){let e=this.getMaxScroll();return Hn(this.scrollOffset,0,e)}isVertical(){return this.props.orientation!=="horizontal"}getEffectiveStep(){return typeof this.props.stepSize=="number"&&!Number.isNaN(this.props.stepSize)?this.props.stepSize:Math.max(1,this.viewportSize/10||1)}getEffectivePage(){return typeof this.props.pageSize=="number"&&!Number.isNaN(this.props.pageSize)?this.props.pageSize:this.viewportSize}emitScroll(e){let n=this.getMaxScroll(),i=Hn(Math.round(e),0,n),r=this.viewport;if(r&&i!==this.getClampedOffset()){let s=r.project(r.position);this.isVertical()?s[1]-=i-this.scrollOffset:s[0]-=i-this.scrollOffset;let{target:a}=r.panByPosition(r.position,s);this.deck._onViewStateChange({viewId:r.id,viewState:{...this.getViewState(r.id),target:a},interactionState:{}})}}},at=Mo;at.defaultProps={...Co.Widget.defaultProps,contentBounds:null,placement:"top-right",viewId:null,orientation:"vertical",stepSize:null,pageSize:null,startButtonAriaLabel:"",endButtonAriaLabel:"",captureWheel:!1,decorations:[]};function To(t,o,e){return t.map(([n,i])=>o.project([n,i,0])).reduce((n,[i,r])=>{let s=e?r:i;return n[0]=Math.min(n[0],s),n[1]=Math.max(n[1],s),n},[1/0,-1/0])}var Io=E(R(),1);var lt=class extends Io.Widget{constructor(e={}){super(e);this.id="timeline";this.className="deck-widget-timeline";this.placement="fill";this.playing=!1;this.timerId=null;this.handlePlayPause=()=>{this.playing?this.stop():this.play()};this.handleTimeChange=([e])=>{this.currentTime=e,this.props.timeline?.setTime(e),this.props.onTimeChange(e),this.updateHTML()};this.tick=()=>{let{timeRange:[e,n],step:i,loop:r}=this.props;if(i>0){let s=Math.floor(this.currentTime/i)*i+i;s>n&&(this.currentTime<n?s=n:r?s=e:(s=n,this.playing=!1)),this.currentTime=s,this.props.onTimeChange(s),this.updateHTML()}this.playing?this.timerId=window.setTimeout(this.tick,this.props.playInterval):this.timerId=null};this.currentTime=this.props.initialTime??this.props.timeRange[0],this.props.timeline?.setTime(this.currentTime),this.setProps(this.props)}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd(){this.playing=!1,this.timerId=null,this.props.autoPlay&&this.play()}onRemove(){this.stop()}onRenderHTML(e){let{timeRange:n,step:i,formatLabel:r}=this.props,s=this.currentTime;e.dataset.placement=this.props.placement,y(p("div",{className:"deck-widget-button-group",children:[this.playing?p(L,{label:"Pause",className:"deck-widget-timeline-pause",onClick:this.handlePlayPause}):p(L,{label:"Play",className:"deck-widget-timeline-play",onClick:this.handlePlayPause}),p(Oe,{min:n[0],max:n[1],orientation:"horizontal",step:i,value:[s,s],onChange:this.handleTimeChange,decorations:[{position:[s,s+i],element:p("div",{className:"deck-widget-timeline-label deck-widget-timeline-label--current",children:r(s)})}]})]}),e)}play(){this.playing=!0,this.updateHTML(),this.tick()}stop(){this.playing=!1,this.timerId!==null&&(window.clearTimeout(this.timerId),this.timerId=null),this.updateHTML()}};lt.defaultProps={...Io.Widget.defaultProps,id:"timeline",placement:"bottom-left",viewId:null,timeline:null,timeRange:[0,100],step:1,initialTime:void 0,onTimeChange:()=>{},autoPlay:!1,loop:!1,playInterval:1e3,formatLabel:String};var Wo=E(R(),1);var ct=class extends Wo.Widget{constructor(e={}){super(e);this.className="deck-widget-screenshot";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){y(p(L,{className:"deck-widget-camera",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}handleClick(){if(this.props.onCapture){this.props.onCapture(this);return}let e=this.captureScreenToDataURL(this.props.imageFormat);e&&this.downloadDataURL(e,this.props.filename)}captureScreenToDataURL(e){return this.deck?.getCanvas()?.toDataURL(e)}downloadDataURL(e,n){let i=document.createElement("a");i.href=e,i.download=n,i.click()}};ct.defaultProps={...Wo.Widget.defaultProps,id:"screenshot",placement:"top-left",viewId:null,label:"Screenshot",filename:"screenshot.png",imageFormat:"image/png",onCapture:void 0};var le=E(R(),1),Lo=E(R(),1);var Vn={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--button-text":"rgb(24, 24, 26, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(204, 204, 204)","--menu-gap":"4px","--menu-background":"#fff","--menu-backdrop-filter":"unset","--menu-border":"unset","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--menu-text":"rgb(24, 24, 26, 1)","--menu-item-hover":"rgba(0, 0, 0, 0.08)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"#d8d8e5","--range-thumb-color":"#616166","--range-decoration-active-color":"#f8dd50"},$n={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--button-text":"rgb(215, 214, 229, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(200, 199, 209)","--menu-gap":"4px","--menu-background":"rgba(18, 18, 20, 1)","--menu-backdrop-filter":"unset","--menu-border":"unset","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--menu-text":"rgb(215, 214, 229, 1)","--menu-item-hover":"rgba(255, 255, 255, 0.1)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"#2c2c30","--range-thumb-color":"#9e9da8","--range-decoration-active-color":"#dd7d2c"},zt={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--button-text":"rgb(24, 24, 26, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(204, 204, 204)","--menu-gap":"4px","--menu-background":"rgba(255, 255, 255, 0.6)","--menu-backdrop-filter":"blur(4px)","--menu-border":"1px solid rgba(255, 255, 255, 0.6)","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--menu-text":"rgb(24, 24, 26, 1)","--menu-item-hover":"rgba(0, 0, 0, 0.08)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"rgba(215, 214, 229, 0.3)","--range-thumb-color":"rgba(97, 97, 102, 1)","--range-decoration-active-color":"rgba(255, 215, 0, 0.6)"},Gt={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--button-text":"rgb(215, 214, 229, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(200, 199, 209)","--menu-gap":"4px","--menu-background":"rgba(18, 18, 20, 0.75)","--menu-backdrop-filter":"blur(4px)","--menu-border":"1px solid rgba(18, 18, 20, 0.75)","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--menu-text":"rgb(215, 214, 229, 1)","--menu-item-hover":"rgba(255, 255, 255, 0.1)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"rgba(24, 24, 26, 0.3)","--range-thumb-color":"rgba(158, 157, 168, 1)","--range-decoration-active-color":"rgba(255, 145, 0, 0.6)"};var dt=class extends Lo.Widget{constructor(e={}){super(e);this.className="deck-widget-theme";this.placement="top-left";this.themeMode="dark";this.themeMode=this._getInitialThemeMode(),this.setProps(this.props)}setProps(e){let{lightModeTheme:n,darkModeTheme:i}=this.props;switch(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e),this.themeMode){case"light":e.lightModeTheme&&!(0,le._deepEqual)(e.lightModeTheme,n,1)&&this._setThemeMode("light");break;case"dark":e.darkModeTheme&&!(0,le._deepEqual)(e.darkModeTheme,i,1)&&this._setThemeMode("dark");break;default:le.log.warn(`Invalid theme mode ${this.themeMode}`)()}}onRenderHTML(e){let{lightModeLabel:n,darkModeLabel:i}=this.props;y(p(L,{onClick:this._handleClick.bind(this),label:this.themeMode==="dark"?i:n,className:this.themeMode==="dark"?"deck-widget-moon":"deck-widget-sun"}),e)}onAdd(){this._setThemeMode(this.themeMode)}_handleClick(){let e=this.themeMode==="dark"?"light":"dark";this._setThemeMode(e)}_setThemeMode(e){this.themeMode=e;let n=this.rootElement?.closest(".deck-widget-container");if(n){let i=e==="dark"?this.props.darkModeTheme:this.props.lightModeTheme;(0,le._applyStyles)(n,i);let r=this.themeMode==="dark"?this.props.darkModeLabel:this.props.lightModeLabel;le.log.log(1,`Switched theme to ${r}`,i)(),this.updateHTML()}}_getInitialThemeMode(){let{initialThemeMode:e}=this.props;return e!=="auto"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}};dt.defaultProps={...Lo.Widget.defaultProps,id:"theme",placement:"top-left",viewId:null,lightModeLabel:"Light Mode",lightModeTheme:zt,darkModeLabel:"Dark Mode",darkModeTheme:Gt,initialThemeMode:"auto"};var Eo=E(R(),1);var pt=class extends Eo.Widget{constructor(e={}){super(e);this.className="deck-widget-loading";this.placement="top-left";this.loading=!0;this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){y(this.loading&&p(L,{className:"deck-widget-spinner",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}onRedraw({layers:e}){let n=e.some(i=>!i.isLoaded);n!==this.loading&&(this.loading=n,this.updateHTML())}handleClick(){}};pt.defaultProps={...Eo.Widget.defaultProps,id:"loading",placement:"top-left",viewId:null,label:"Loading layer data"};var Ro=E(R(),1);var ut=class extends Ro.Widget{constructor(e={}){super(e);this.className="deck-widget-fps";this.placement="top-left";this._lastFps=-1;this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd({}){this._lastFps=this._getFps(),requestAnimationFrame(()=>this._animate())}onRenderHTML(e){let n=this._getFps();y(p(L,{children:p("div",{className:"text",children:["FPS",p("br",{}),n]})}),e)}_animate(){let e=this._getFps();this._lastFps!==e&&(this._lastFps=e,this.updateHTML()),requestAnimationFrame(()=>this._animate())}_getFps(){return Math.round(this.deck?.metrics.fps??0)}};ut.defaultProps={...Ro.Widget.defaultProps,id:"fps",placement:"top-left",viewId:null};var Oo=E(R(),1),Gn=E(Fn(),1);var Ao=t=>`${t.name}: ${t.count}`;function Do(t){return t<1e3?`${t.toFixed(2)}ms`:`${(t/1e3).toFixed(2)}s`}function Un(t){return`${(t/1e6).toFixed(1)} MB`}var zn={count:Ao,averageTime:t=>`${t.name}: ${Do(t.getAverageTime())}`,totalTime:t=>`${t.name}: ${Do(t.time)}`,fps:t=>`${t.name}: ${Math.round(t.getHz())}fps`,memory:t=>`${t.name}: ${Un(t.count)}`},mt=class extends Oo.Widget{constructor(e={}){super(e);this.className="deck-widget-stats";this.placement="top-left";this._counter=0;this.collapsed=!0;this._toggleCollapsed=()=>{this.collapsed=!this.collapsed,this.updateHTML()};this._formatters={...zn},this._resetOnUpdate={...this.props.resetOnUpdate},this.collapsed=!e.defaultIsExpanded,this.setProps(e)}setProps(e){if(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,e.formatters)for(let n in e.formatters){let i=e.formatters[n];this._formatters[n]=typeof i=="string"?zn[i]||Ao:i}e.resetOnUpdate&&(this._resetOnUpdate={...e.resetOnUpdate}),super.setProps(e)}onAdd(){this.updateHTML()}onRenderHTML(e){let n=this._getStats(),i=this.collapsed,r=this.props.title||("id"in n?n.id:null)||"Stats",s=[];!i&&n&&n.forEach(a=>{let c=this._getLines(a).split(`
8
- `);this._resetOnUpdate&&this._resetOnUpdate[a.name]&&a.reset(),c.forEach((d,m)=>{s.push(p("div",{style:{whiteSpace:"pre"},children:d},`${a.name}-${m}`))})}),y(p("div",{className:"deck-widget-stats-container",style:{cursor:"default"},children:[p("div",{className:"deck-widget-stats-header",style:{cursor:"pointer",pointerEvents:"auto"},onClick:this._toggleCollapsed,children:[p("b",{children:r}),p("button",{className:"deck-widget-dropdown-button",children:p("span",{className:`deck-widget-dropdown-icon ${i?"":"open"}`})})]}),!i&&p("div",{className:"deck-widget-stats-content",children:s})]}),e)}onRedraw(){let e=Math.max(1,this.props.framesPerUpdate||1);this._counter++%e===0&&this.updateHTML()}_getStats(){switch(this.props.type){case"deck":let e=this.deck?.metrics??{};return Object.entries(e);case"luma":return Array.from(Gn.luma.stats.stats.values())[0];case"device":let i=this.deck?.device?.statsManager.stats.values();return i?Array.from(i)[0]:[];case"custom":return this.props.stats;default:throw new Error(`Unknown stats type: ${this.props.type}`)}}_getLines(e){if("count"in e)return(this._formatters[e.name]||this._formatters[e.type||""]||Ao)(e);let[n,i]=e,r=n.endsWith("Memory")?Un(i):n.includes("Time")?Do(i):`${i.toFixed(2)}`;return`${n}: ${r}`}};mt.defaultProps={...Oo.Widget.defaultProps,type:"deck",placement:"top-left",viewId:null,defaultIsExpanded:!1,stats:void 0,title:"Stats",framesPerUpdate:1,formatters:{},resetOnUpdate:{},id:"stats"};return Qn(ft);})();
7
+ "use strict";var __exports__=(()=>{var Yn=Object.create;var vt=Object.defineProperty;var jn=Object.getOwnPropertyDescriptor;var Kn=Object.getOwnPropertyNames;var Zn=Object.getPrototypeOf,Qn=Object.prototype.hasOwnProperty;var Do=(t,o)=>()=>(o||t((o={exports:{}}).exports,o),o.exports),ei=(t,o)=>{for(var e in o)vt(t,e,{get:o[e],enumerable:!0})},ht=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Kn(o))!Qn.call(t,i)&&i!==e&&vt(t,i,{get:()=>o[i],enumerable:!(n=jn(o,i))||n.enumerable});return t},re=(t,o,e)=>(ht(t,o,"default"),e&&ht(e,o,"default")),E=(t,o,e)=>(e=t!=null?Yn(Zn(t)):{},ht(o||!t||!t.__esModule?vt(e,"default",{value:t,enumerable:!0}):e,t)),ti=t=>ht(vt({},"__esModule",{value:!0}),t);var R=Do((Zi,Ho)=>{Ho.exports=globalThis.deck});var Gn=Do((Ca,zn)=>{zn.exports=globalThis.luma});var gt={};ei(gt,{CompassWidget:()=>Fe,ContextMenuWidget:()=>nt,DarkGlassTheme:()=>qt,DarkTheme:()=>Fn,FullscreenWidget:()=>Ue,GimbalWidget:()=>$e,IconWidget:()=>at,InfoWidget:()=>tt,LightGlassTheme:()=>Ut,LightTheme:()=>Bn,LoadingWidget:()=>mt,PopupWidget:()=>ot,ResetViewWidget:()=>Ne,ScreenshotWidget:()=>pt,ScrollbarWidget:()=>st,SelectorWidget:()=>ct,ThemeWidget:()=>ut,ToggleWidget:()=>lt,ZoomWidget:()=>He,_ButtonGroup:()=>Pt,_CoordinatesGeocoder:()=>Me,_CurrentLocationGeocoder:()=>Et,_DropdownMenu:()=>Ct,_GeocoderWidget:()=>Ge,_GoogleGeocoder:()=>Lt,_IconButton:()=>M,_MapboxGeocoder:()=>It,_OpenCageGeocoder:()=>Wt,_RangeInput:()=>Oe,_ScaleWidget:()=>ze,_SimpleMenu:()=>he,_SplitterWidget:()=>Xe,_StatsWidget:()=>ft,_TimelineWidget:()=>dt});var K={},No=E(R(),1);re(K,E(R(),1));if(!No.Layer)throw new Error("@deck.gl/core is not found");re(gt,K);var ge=E(R(),1);var xt,W,Go,oi,me,$o,Uo,Jt,Zt,Yt,jt,ni,Ve={},qo=[],ii=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qt=Array.isArray;function se(t,o){for(var e in o)t[e]=o[e];return t}function Xo(t){var o=t.parentNode;o&&o.removeChild(t)}function ri(t,o,e){var n,i,r,s={};for(r in o)r=="key"?n=o[r]:r=="ref"?i=o[r]:s[r]=o[r];if(arguments.length>2&&(s.children=arguments.length>3?xt.call(arguments,2):e),typeof t=="function"&&t.defaultProps!=null)for(r in t.defaultProps)s[r]===void 0&&(s[r]=t.defaultProps[r]);return _t(t,s,n,i,null)}function _t(t,o,e,n,i){var r={type:t,props:o,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++Go,__i:-1,__u:0};return i==null&&W.vnode!=null&&W.vnode(r),r}function ae(t){return t.children}function bt(t,o){this.props=t,this.context=o}function fe(t,o){if(o==null)return t.__?fe(t.__,t.__i+1):null;for(var e;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null)return e.__e;return typeof t.type=="function"?fe(t):null}function Jo(t){var o,e;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,o=0;o<t.__k.length;o++)if((e=t.__k[o])!=null&&e.__e!=null){t.__e=t.__c.base=e.__e;break}return Jo(t)}}function Bo(t){(!t.__d&&(t.__d=!0)&&me.push(t)&&!yt.__r++||$o!==W.debounceRendering)&&(($o=W.debounceRendering)||Uo)(yt)}function yt(){var t,o,e,n,i,r,s,a;for(me.sort(Jt);t=me.shift();)t.__d&&(o=me.length,n=void 0,r=(i=(e=t).__v).__e,s=[],a=[],e.__P&&((n=se({},i)).__v=i.__v+1,W.vnode&&W.vnode(n),eo(e.__P,n,i,e.__n,e.__P.namespaceURI,32&i.__u?[r]:null,s,r??fe(i),!!(32&i.__u),a),n.__v=i.__v,n.__.__k[n.__i]=n,Ko(s,n,a),n.__e!=r&&Jo(n)),me.length>o&&me.sort(Jt));yt.__r=0}function Yo(t,o,e,n,i,r,s,a,c,d,m){var l,g,u,f,_,w=n&&n.__k||qo,h=o.length;for(e.__d=c,si(e,o,w),c=e.__d,l=0;l<h;l++)(u=e.__k[l])!=null&&typeof u!="boolean"&&typeof u!="function"&&(g=u.__i===-1?Ve:w[u.__i]||Ve,u.__i=l,eo(t,u,g,i,r,s,a,c,d,m),f=u.__e,u.ref&&g.ref!=u.ref&&(g.ref&&to(g.ref,null,u),m.push(u.ref,u.__c||f,u)),_==null&&f!=null&&(_=f),65536&u.__u||g.__k===u.__k?c=jo(u,c,t):typeof u.type=="function"&&u.__d!==void 0?c=u.__d:f&&(c=f.nextSibling),u.__d=void 0,u.__u&=-196609);e.__d=c,e.__e=_}function si(t,o,e){var n,i,r,s,a,c=o.length,d=e.length,m=d,l=0;for(t.__k=[],n=0;n<c;n++)s=n+l,(i=t.__k[n]=(i=o[n])==null||typeof i=="boolean"||typeof i=="function"?null:typeof i=="string"||typeof i=="number"||typeof i=="bigint"||i.constructor==String?_t(null,i,null,null,null):Qt(i)?_t(ae,{children:i},null,null,null):i.constructor===void 0&&i.__b>0?_t(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=t,i.__b=t.__b+1,a=ai(i,e,s,m),i.__i=a,r=null,a!==-1&&(m--,(r=e[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&l--,typeof i.type!="function"&&(i.__u|=65536)):a!==s&&(a==s-1?l--:a==s+1?l++:a>s?m>c-s?l+=a-s:l--:a<s&&(a==s-l?l-=a-s:l++),a!==n+l&&(i.__u|=65536))):(r=e[s])&&r.key==null&&r.__e&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=fe(r)),Kt(r,r,!1),e[s]=null,m--);if(m)for(n=0;n<d;n++)(r=e[n])!=null&&!(131072&r.__u)&&(r.__e==t.__d&&(t.__d=fe(r)),Kt(r,r))}function jo(t,o,e){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,o=jo(n[i],o,e));return o}t.__e!=o&&(o&&t.type&&!e.contains(o)&&(o=fe(t)),e.insertBefore(t.__e,o||null),o=t.__e);do o=o&&o.nextSibling;while(o!=null&&o.nodeType===8);return o}function ai(t,o,e,n){var i=t.key,r=t.type,s=e-1,a=e+1,c=o[e];if(c===null||c&&i==c.key&&r===c.type&&!(131072&c.__u))return e;if(n>(c!=null&&!(131072&c.__u)?1:0))for(;s>=0||a<o.length;){if(s>=0){if((c=o[s])&&!(131072&c.__u)&&i==c.key&&r===c.type)return s;s--}if(a<o.length){if((c=o[a])&&!(131072&c.__u)&&i==c.key&&r===c.type)return a;a++}}return-1}function Fo(t,o,e){o[0]==="-"?t.setProperty(o,e??""):t[o]=e==null?"":typeof e!="number"||ii.test(o)?e:e+"px"}function wt(t,o,e,n,i){var r;e:if(o==="style")if(typeof e=="string")t.style.cssText=e;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(o in n)e&&o in e||Fo(t.style,o,"");if(e)for(o in e)n&&e[o]===n[o]||Fo(t.style,o,e[o])}else if(o[0]==="o"&&o[1]==="n")r=o!==(o=o.replace(/(PointerCapture)$|Capture$/i,"$1")),o=o.toLowerCase()in t||o==="onFocusOut"||o==="onFocusIn"?o.toLowerCase().slice(2):o.slice(2),t.l||(t.l={}),t.l[o+r]=e,e?n?e.u=n.u:(e.u=Zt,t.addEventListener(o,r?jt:Yt,r)):t.removeEventListener(o,r?jt:Yt,r);else{if(i=="http://www.w3.org/2000/svg")o=o.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(o!="width"&&o!="height"&&o!="href"&&o!="list"&&o!="form"&&o!="tabIndex"&&o!="download"&&o!="rowSpan"&&o!="colSpan"&&o!="role"&&o!="popover"&&o in t)try{t[o]=e??"";break e}catch{}typeof e=="function"||(e==null||e===!1&&o[4]!=="-"?t.removeAttribute(o):t.setAttribute(o,o=="popover"&&e==1?"":e))}}function zo(t){return function(o){if(this.l){var e=this.l[o.type+t];if(o.t==null)o.t=Zt++;else if(o.t<e.u)return;return e(W.event?W.event(o):o)}}}function eo(t,o,e,n,i,r,s,a,c,d){var m,l,g,u,f,_,w,h,b,P,k,y,S,L,I,D,O=o.type;if(o.constructor!==void 0)return null;128&e.__u&&(c=!!(32&e.__u),r=[a=o.__e=e.__e]),(m=W.__b)&&m(o);e:if(typeof O=="function")try{if(h=o.props,b="prototype"in O&&O.prototype.render,P=(m=O.contextType)&&n[m.__c],k=m?P?P.props.value:m.__:n,e.__c?w=(l=o.__c=e.__c).__=l.__E:(b?o.__c=l=new O(h,k):(o.__c=l=new bt(h,k),l.constructor=O,l.render=ci),P&&P.sub(l),l.props=h,l.state||(l.state={}),l.context=k,l.__n=n,g=l.__d=!0,l.__h=[],l._sb=[]),b&&l.__s==null&&(l.__s=l.state),b&&O.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=se({},l.__s)),se(l.__s,O.getDerivedStateFromProps(h,l.__s))),u=l.props,f=l.state,l.__v=o,g)b&&O.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),b&&l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(b&&O.getDerivedStateFromProps==null&&h!==u&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(h,k),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(h,l.__s,k)===!1||o.__v===e.__v)){for(o.__v!==e.__v&&(l.props=h,l.state=l.__s,l.__d=!1),o.__e=e.__e,o.__k=e.__k,o.__k.forEach(function(C){C&&(C.__=o)}),y=0;y<l._sb.length;y++)l.__h.push(l._sb[y]);l._sb=[],l.__h.length&&s.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(h,l.__s,k),b&&l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(u,f,_)})}if(l.context=k,l.props=h,l.__P=t,l.__e=!1,S=W.__r,L=0,b){for(l.state=l.__s,l.__d=!1,S&&S(o),m=l.render(l.props,l.state,l.context),I=0;I<l._sb.length;I++)l.__h.push(l._sb[I]);l._sb=[]}else do l.__d=!1,S&&S(o),m=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++L<25);l.state=l.__s,l.getChildContext!=null&&(n=se(se({},n),l.getChildContext())),b&&!g&&l.getSnapshotBeforeUpdate!=null&&(_=l.getSnapshotBeforeUpdate(u,f)),Yo(t,Qt(D=m!=null&&m.type===ae&&m.key==null?m.props.children:m)?D:[D],o,e,n,i,r,s,a,c,d),l.base=o.__e,o.__u&=-161,l.__h.length&&s.push(l),w&&(l.__E=l.__=null)}catch(C){if(o.__v=null,c||r!=null){for(o.__u|=c?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,o.__e=a}else o.__e=e.__e,o.__k=e.__k;W.__e(C,o,e)}else r==null&&o.__v===e.__v?(o.__k=e.__k,o.__e=e.__e):o.__e=li(e.__e,o,e,n,i,r,s,c,d);(m=W.diffed)&&m(o)}function Ko(t,o,e){o.__d=void 0;for(var n=0;n<e.length;n++)to(e[n],e[++n],e[++n]);W.__c&&W.__c(o,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(r){r.call(i)})}catch(r){W.__e(r,i.__v)}})}function li(t,o,e,n,i,r,s,a,c){var d,m,l,g,u,f,_,w=e.props,h=o.props,b=o.type;if(b==="svg"?i="http://www.w3.org/2000/svg":b==="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(d=0;d<r.length;d++)if((u=r[d])&&"setAttribute"in u==!!b&&(b?u.localName===b:u.nodeType===3)){t=u,r[d]=null;break}}if(t==null){if(b===null)return document.createTextNode(h);t=document.createElementNS(i,b,h.is&&h),r=null,a=!1}if(b===null)w===h||a&&t.data===h||(t.data=h);else{if(r=r&&xt.call(t.childNodes),w=e.props||Ve,!a&&r!=null)for(w={},d=0;d<t.attributes.length;d++)w[(u=t.attributes[d]).name]=u.value;for(d in w)if(u=w[d],d!="children"){if(d=="dangerouslySetInnerHTML")l=u;else if(d!=="key"&&!(d in h)){if(d=="value"&&"defaultValue"in h||d=="checked"&&"defaultChecked"in h)continue;wt(t,d,null,u,i)}}for(d in h)u=h[d],d=="children"?g=u:d=="dangerouslySetInnerHTML"?m=u:d=="value"?f=u:d=="checked"?_=u:d==="key"||a&&typeof u!="function"||w[d]===u||wt(t,d,u,w[d],i);if(m)a||l&&(m.__html===l.__html||m.__html===t.innerHTML)||(t.innerHTML=m.__html),o.__k=[];else if(l&&(t.innerHTML=""),Yo(t,Qt(g)?g:[g],o,e,n,b==="foreignObject"?"http://www.w3.org/1999/xhtml":i,r,s,r?r[0]:e.__k&&fe(e,0),a,c),r!=null)for(d=r.length;d--;)r[d]!=null&&Xo(r[d]);a||(d="value",f!==void 0&&(f!==t[d]||b==="progress"&&!f||b==="option"&&f!==w[d])&&wt(t,d,f,w[d],i),d="checked",_!==void 0&&_!==t[d]&&wt(t,d,_,w[d],i))}return t}function to(t,o,e){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&o==null||(t.__u=t(o))}else t.current=o}catch(i){W.__e(i,e)}}function Kt(t,o,e){var n,i;if(W.unmount&&W.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||to(n,null,o)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){W.__e(r,o)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&Kt(n[i],o,e||typeof t.type!="function");e||t.__e==null||Xo(t.__e),t.__c=t.__=t.__e=t.__d=void 0}function ci(t,o,e){return this.constructor(t,e)}function x(t,o,e){var n,i,r,s;W.__&&W.__(t,o),i=(n=typeof e=="function")?null:e&&e.__k||o.__k,r=[],s=[],eo(o,t=(!n&&e||o).__k=ri(ae,null,[t]),i||Ve,Ve,o.namespaceURI,!n&&e?[e]:i?null:o.firstChild?xt.call(o.childNodes):null,r,!n&&e?e:i?i.__e:o.firstChild,n,s),Ko(r,t,s)}xt=qo.slice,W={__e:function(t,o,e,n){for(var i,r,s;o=o.__;)if((i=o.__c)&&!i.__)try{if((r=i.constructor)&&r.getDerivedStateFromError!=null&&(i.setState(r.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(a){t=a}throw t}},Go=0,oi=function(t){return t!=null&&t.constructor==null},bt.prototype.setState=function(t,o){var e;e=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=se({},this.state),typeof t=="function"&&(t=t(se({},e),this.props)),t&&se(e,t),t!=null&&this.__v&&(o&&this._sb.push(o),Bo(this))},bt.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Bo(this))},bt.prototype.render=ae,me=[],Uo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Jt=function(t,o){return t.__v.__b-o.__v.__b},yt.__r=0,Zt=0,Yt=zo(!1),jt=zo(!0),ni=0;var di=0,or=Array.isArray;function p(t,o,e,n,i,r){o||(o={});var s,a,c=o;if("ref"in c)for(a in c={},o)a=="ref"?s=o[a]:c[a]=o[a];var d={type:t,props:c,key:e,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--di,__i:-1,__u:0,__source:i,__self:r};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)c[a]===void 0&&(c[a]=s[a]);return W.vnode&&W.vnode(d),d}var Pt=t=>{let{children:o,orientation:e="horizontal"}=t;return p("div",{className:`deck-widget-button-group ${e}`,children:o})};var Ce,A,oo,Zo,De=0,an=[],V=W,Qo=V.__b,en=V.__r,tn=V.diffed,on=V.__c,nn=V.unmount,rn=V.__;function Tt(t,o){V.__h&&V.__h(A,t,De||o),De=0;var e=A.__H||(A.__H={__:[],__h:[]});return t>=e.__.length&&e.__.push({}),e.__[t]}function le(t){return De=1,pi(ln,t)}function pi(t,o,e){var n=Tt(Ce++,2);if(n.t=t,!n.__c&&(n.__=[e?e(o):ln(void 0,o),function(a){var c=n.__N?n.__N[0]:n.__[0],d=n.t(c,a);c!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=A,!A.u)){var i=function(a,c,d){if(!n.__c.__H)return!0;var m=n.__c.__H.__.filter(function(g){return!!g.__c});if(m.every(function(g){return!g.__N}))return!r||r.call(this,a,c,d);var l=!1;return m.forEach(function(g){if(g.__N){var u=g.__[0];g.__=g.__N,g.__N=void 0,u!==g.__[0]&&(l=!0)}}),!(!l&&n.__c.props===a)&&(!r||r.call(this,a,c,d))};A.u=!0;var r=A.shouldComponentUpdate,s=A.componentWillUpdate;A.componentWillUpdate=function(a,c,d){if(this.__e){var m=r;r=void 0,i(a,c,d),r=m}s&&s.call(this,a,c,d)},A.shouldComponentUpdate=i}return n.__N||n.__}function G(t,o){var e=Tt(Ce++,3);!V.__s&&ro(e.__H,o)&&(e.__=t,e.i=o,A.__H.__h.push(e))}function io(t,o){var e=Tt(Ce++,4);!V.__s&&ro(e.__H,o)&&(e.__=t,e.i=o,A.__h.push(e))}function N(t){return De=5,ee(function(){return{current:t}},[])}function ee(t,o){var e=Tt(Ce++,7);return ro(e.__H,o)&&(e.__=t(),e.__H=o,e.__h=t),e.__}function te(t,o){return De=8,ee(function(){return t},o)}function ui(){for(var t;t=an.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(kt),t.__H.__h.forEach(no),t.__H.__h=[]}catch(o){t.__H.__h=[],V.__e(o,t.__v)}}V.__b=function(t){A=null,Qo&&Qo(t)},V.__=function(t,o){t&&o.__k&&o.__k.__m&&(t.__m=o.__k.__m),rn&&rn(t,o)},V.__r=function(t){en&&en(t),Ce=0;var o=(A=t.__c).__H;o&&(oo===A?(o.__h=[],A.__h=[],o.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(o.__h.forEach(kt),o.__h.forEach(no),o.__h=[],Ce=0)),oo=A},V.diffed=function(t){tn&&tn(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(an.push(o)!==1&&Zo===V.requestAnimationFrame||((Zo=V.requestAnimationFrame)||mi)(ui)),o.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),oo=A=null},V.__c=function(t,o){o.some(function(e){try{e.__h.forEach(kt),e.__h=e.__h.filter(function(n){return!n.__||no(n)})}catch(n){o.some(function(i){i.__h&&(i.__h=[])}),o=[],V.__e(n,e.__v)}}),on&&on(t,o)},V.unmount=function(t){nn&&nn(t);var o,e=t.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{kt(n)}catch(i){o=i}}),e.__H=void 0,o&&V.__e(o,e.__v))};var sn=typeof requestAnimationFrame=="function";function mi(t){var o,e=function(){clearTimeout(n),sn&&cancelAnimationFrame(o),setTimeout(t)},n=setTimeout(e,100);sn&&(o=requestAnimationFrame(e))}function kt(t){var o=A,e=t.__c;typeof e=="function"&&(t.__c=void 0,e()),A=o}function no(t){var o=A;t.__c=t.__(),A=o}function ro(t,o){return!t||t.length!==o.length||o.some(function(e,n){return e!==t[n]})}function ln(t,o){return typeof o=="function"?o(t):o}function St(t){if(!t)return;let o=`url("${t.replace(/"/g,"'")}")`;return{maskImage:o,WebkitMaskImage:o}}var M=t=>{let{className:o="",style:e,color:n,icon:i,label:r,onClick:s,children:a}=t,c=ee(()=>{let d=St(i);return n?{...d,backgroundColor:n}:d},[n,i]);return p("div",{className:"deck-widget-button",style:e,children:p("button",{className:`deck-widget-icon-button ${o}`,type:"button",onClick:s,title:r,children:a||p("div",{className:"deck-widget-icon",style:c})})})};var He=class extends ge.Widget{constructor(e={}){super(e);this.className="deck-widget-zoom";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=p(Pt,{orientation:this.props.orientation,children:[p(M,{onClick:()=>this.handleZoomIn(),label:this.props.zoomInLabel,className:"deck-widget-zoom-in"}),p(M,{onClick:()=>this.handleZoomOut(),label:this.props.zoomOutLabel,className:"deck-widget-zoom-out"})]});x(n,e)}handleZoom(e,n){let i=this.getViewState(e);if(i){let{minZoom:s,maxZoom:a}=i;Number.isFinite(s)&&(n=Math.max(s,n)),Number.isFinite(a)&&(n=Math.min(a,n))}let r={...i,zoom:n};this.props.transitionDuration>0&&(r.transitionDuration=this.props.transitionDuration,r.transitionInterpolator="latitude"in r?new ge.FlyToInterpolator:new ge.LinearInterpolator({transitionProps:["zoom"]})),this.setViewState(e,r)}handleZoomIn(){let e=this.viewId?[this.viewId]:this.deck?.getViews().map(n=>n.id)??[];for(let n of e){let i=this.getViewState(n);this.handleZoom(n,i.zoom+1)}}handleZoomOut(){let e=this.viewId?[this.viewId]:this.deck?.getViews().map(n=>n.id)??[];for(let n of e){let i=this.getViewState(n);this.handleZoom(n,i.zoom-1)}}};He.defaultProps={...ge.Widget.defaultProps,id:"zoom",placement:"top-left",orientation:"vertical",transitionDuration:200,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",viewId:null};var so=E(R(),1);var Ne=class extends so.Widget{constructor(e={}){super(e);this.className="deck-widget-reset-view";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){x(p(M,{className:"deck-widget-reset-focus",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}handleClick(){let e=this.props.initialViewState||this.deck?.props.initialViewState;this.resetViewState(e)}resetViewState(e){let n=this.viewId?[this.viewId]:this.deck?.getViews().map(i=>i.id)??[];for(let i of n){let r={...e?.[i]??e};this.setViewState(i,r)}}};Ne.defaultProps={...so.Widget.defaultProps,id:"reset-view",placement:"top-left",label:"Reset View",initialViewState:void 0,viewId:null};var Be=E(R(),1);var $e=class extends Be.Widget{constructor(e={}){super(e);this.className="deck-widget-gimbal";this.placement="top-left";this.viewports={};this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.viewId||Object.values(this.viewports)[0]?.id||"default-view",i=this.viewports[n],{rotationOrbit:r,rotationX:s}=this.getNormalizedRotation(i),a=p("div",{className:"deck-widget-button",style:{perspective:100,pointerEvents:"auto"},children:p("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.resetOrbitView(c)},title:this.props.label,style:{position:"relative",width:26,height:26},children:[p("svg",{className:"gimbal-outer-ring",width:"100%",height:"100%",viewBox:"0 0 26 26",style:{position:"absolute",top:0,left:0,transform:`rotateY(${r}deg)`},children:p("circle",{cx:"13",cy:"13",r:"10",stroke:"var(--icon-gimbal-outer-color, rgb(68, 92, 204))",strokeWidth:this.props.strokeWidth,fill:"none"})}),p("svg",{className:"gimbal-inner-ring",width:"100%",height:"100%",viewBox:"0 0 26 26",style:{position:"absolute",top:0,left:0,transform:`rotateX(${s}deg)`},children:p("circle",{cx:"13",cy:"13",r:"7",stroke:"var(--icon-gimbal-inner-color, rgb(240, 92, 68))",strokeWidth:this.props.strokeWidth,fill:"none"})})]})});x(a,e)}onViewportChange(e){this.viewports[e.id]=e,this.updateHTML()}resetOrbitView(e){let n=this.viewId||e?.id||"OrbitView",i=this.getViewState(n);if("rotationOrbit"in i||"rotationX"in i){let r={...i,rotationOrbit:0,rotationX:0,transitionDuration:this.props.transitionDuration,transitionInterpolator:new Be.LinearInterpolator({transitionProps:["rotationOrbit","rotationX"]})};this.setViewState(n,r)}}getNormalizedRotation(e){let n=this.viewId||e?.id||"OrbitView",i=this.getViewState(n),[r,s]=this.getRotation(i),a=cn(r),c=cn(s);return{rotationOrbit:a,rotationX:c}}getRotation(e){return e&&("rotationOrbit"in e||"rotationX"in e)?[-(e.rotationOrbit||0),e.rotationX||0]:[0,0]}};$e.defaultProps={...Be.Widget.defaultProps,id:"gimbal",placement:"top-left",viewId:null,label:"Gimbal",strokeWidth:1.5,transitionDuration:200};function cn(t){let o=((t+180)%360+360)%360-180,e=10,n=o-90;return Math.abs(n)<e&&(n<e?o=90+e:n>-e&&(o=90-e)),o}var Z=E(R(),1);var Fe=class extends Z.Widget{constructor(e={}){super(e);this.className="deck-widget-compass";this.placement="top-left";this.viewports={};this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.viewId||Object.values(this.viewports)[0]?.id,i=this.viewports[n],[r,s]=this.getRotation(i),a=p("div",{className:"deck-widget-button",style:{perspective:100},children:p("button",{type:"button",onClick:()=>{for(let c of Object.values(this.viewports))this.handleCompassReset(c)},title:this.props.label,style:{transform:`rotateX(${s}deg)`},children:p("svg",{fill:"none",width:"100%",height:"100%",viewBox:"0 0 26 26",children:p("g",{transform:`rotate(${r},13,13)`,children:[p("path",{d:"M10 13.0001L12.9999 5L15.9997 13.0001H10Z",fill:"var(--icon-compass-north-color, rgb(240, 92, 68))"}),p("path",{d:"M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",fill:"var(--icon-compass-south-color, rgb(204, 204, 204))"})]})})})});x(a,e)}onViewportChange(e){e.equals(this.viewports[e.id])||(this.viewports[e.id]=e,this.updateHTML())}getRotation(e){return e instanceof Z.WebMercatorViewport?[-e.bearing,e.pitch]:e instanceof Z._GlobeViewport?[0,Math.max(-80,Math.min(80,e.latitude))]:[0,0]}handleCompassReset(e){let n=this.viewId||e.id;if(e instanceof Z.WebMercatorViewport){let r={...this.getViewState(n),bearing:0,...this.getRotation(e)[0]===0?{pitch:0}:{},transitionDuration:this.props.transitionDuration,transitionInterpolator:new Z.FlyToInterpolator};this.setViewState(n,r)}}};Fe.defaultProps={...Z.Widget.defaultProps,id:"compass",placement:"top-left",viewId:null,label:"Reset Compass",transitionDuration:200};var ao=E(R(),1);var ze=class extends ao.Widget{constructor(e={}){super(e);this.className="deck-widget-scale";this.placement="bottom-left";this.scaleWidth=10;this.scaleValue=0;this.scaleText="";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let i=50+this.scaleWidth,r=10;x(p("svg",{className:"deck-widget-scale",width:i,height:30,style:{overflow:"visible",background:"transparent"},onClick:this.handleClick.bind(this),children:[p("text",{x:50+5,y:"10",textAnchor:"end",alignmentBaseline:"middle",style:{fontSize:"16px",fill:"black",fontWeight:"bold",fontFamily:"sans-serif"},children:this.scaleText}),p("line",{x1:50,y1:"15",x2:50+this.scaleWidth,y2:"15",stroke:"black",strokeWidth:"6"}),p("line",{x1:50,y1:"15",x2:50,y2:15-r,stroke:"black",strokeWidth:"6"}),p("line",{x1:50+this.scaleWidth,y1:"15",x2:50+this.scaleWidth,y2:15-r,stroke:"black",strokeWidth:"6"})]}),e)}onViewportChange(e){if(!("latitude"in e))return;let{latitude:n,zoom:i}=e,r=fi(n,i),{candidate:s,candidatePixels:a}=gi(r);this.scaleValue=s,this.scaleWidth=a,s>=1e3?this.scaleText=`${(s/1e3).toFixed(1)} km`:this.scaleText=`${s} m`,this.updateHTML()}handleClick(){}};ze.defaultProps={...ao.Widget.defaultProps,id:"scale",placement:"bottom-left",label:"Scale",viewId:null};function fi(t,o){return 40075016686e-3*Math.cos(t*Math.PI/180)/Math.pow(2,o+8)}function gi(t){let i=150*t,r=Math.floor(Math.log10(i)),s=Math.pow(10,r),a=[1,2,5],c=a[0]*s,d=c/t;for(let m=0;m<a.length;m++){let l=a[m]*s,g=l/t;if(g>=100&&g<=200){c=l,d=g;break}if(g>200){c=m>0?a[m-1]*s:l,d=c/t;break}m===a.length-1&&g<100&&(c=a[0]*s*10,d=c/t)}return{candidate:c,candidatePixels:d}}var co=E(R(),1),Rt=E(R(),1);function hi(t){return typeof t=="string"?t:t.value}function vi(t){return typeof t=="string"?t:t.label}function wi(t){return typeof t=="string"?void 0:t.icon}var Ct=t=>{let[o,e]=le(!1);return p(he,{...t,style:{...t.style,position:"absolute"},isOpen:o,onClose:()=>e(!1),trigger:p("button",{className:"deck-widget-dropdown-button",onClick:()=>e(!o),children:p("span",{className:`deck-widget-dropdown-icon ${o?"open":""}`})})})},he=t=>{let o=N(null);G(()=>{let n=i=>{o.current&&!o.current.contains(i.target)&&t.onClose()};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n)}},[]);let e=(n,i)=>{n&&(typeof i=="object"&&i.onSelect?.(),t.onSelect?.(n),t.onClose())};return t.menuItems.length===0?null:p("div",{className:"deck-widget-dropdown-container",ref:o,children:[t.trigger,t.isOpen&&p("ul",{className:"deck-widget-dropdown-menu",style:t.style,children:t.menuItems.map((n,i)=>{let r=hi(n),s=wi(n);return p("li",{className:`deck-widget-dropdown-item ${r?"":"disabled"}`,onClick:()=>e(r,n),children:[s&&p("span",{className:"deck-widget-dropdown-item-icon",style:St(s)}),vi(n)]},i)})})]})};var _i="current",dn="deck-geocoder-history",Mt=class{constructor(o){this.addressText="";this.errorText="";this.addressHistory=[];this.props={maxEntries:5,...o},this.addressHistory=this.loadPreviousAddresses()}async geocode(o,e,n){this.errorText="",this.addressText=e;try{let i=await o.geocode(e,n);if(i)return this.storeAddress(this.addressText),i;this.errorText="Invalid address"}catch(i){this.errorText=`${i.message}`}return null}loadPreviousAddresses(){try{let o=window.localStorage.getItem(dn),e=o&&JSON.parse(o);return Array.isArray(e)?e.filter(i=>typeof i=="string"):[]}catch{}return[]}storeAddress(o){let e=o.trim();if(!e||e===_i)return;let n=[e,...this.addressHistory.filter(i=>i!==e)];this.addressHistory=n.slice(0,this.props.maxEntries);try{window.localStorage.setItem(dn,JSON.stringify(this.addressHistory))}catch{}}};var bi="https://maps.googleapis.com/maps/api/geocode/json",yi="https://api.mapbox.com/geocoding/v5/mapbox.places",xi="https://api.opencagedata.com/geocode/v1/json",Lt={name:"google",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await lo(`${bi}?address=${e}&key=${o}`);switch(n.status){case"OK":let i=n.results.length>0&&n.results[0].geometry.location;return i?{longitude:i.lng,latitude:i.lat}:null;default:throw new Error(`Google Geocoder failed: ${n.status}`)}}},It={name:"google",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await lo(`${yi}/${e}.json?access_token=${o}`);if(Array.isArray(n.features)&&n.features.length>0){let i=n.features[0].center;if(Array.isArray(i)&&i.length>=2)return{longitude:i[0],latitude:i[1]}}return null}},Wt={name:"opencage",requiresApiKey:!0,async geocode(t,o){let e=encodeURIComponent(t),n=await lo(`${xi}?q=${e}&key=${o}`);if(Array.isArray(n.results)&&n.results.length>0){let i=n.results[0].geometry;return{longitude:i.lng,latitude:i.lat}}return null}},Et={name:"current",requiresApiKey:!1,async geocode(){if(!navigator.geolocation)throw new Error("Geolocation not supported");return new Promise((t,o)=>{navigator.geolocation.getCurrentPosition(e=>{let{longitude:n,latitude:i}=e.coords;t({longitude:n,latitude:i})},e=>o(new Error(e.message)))})}};async function lo(t){let o;try{o=await fetch(t)}catch(n){throw new Error(`CORS error? ${n}. ${t}: `)}if(!o.ok)throw new Error(`${o.statusText}. ${t}: `);let e=await o.json();if(!e)throw new Error(`No data returned. ${t}`);return e}var Me={name:"coordinates",requiresApiKey:!1,placeholderLocation:"-122.45, 37.8 or 37\xB048'N, 122\xB027'W",async geocode(t){return Pi(t)||null}};function Pi(t){t=t.trim();let o=t.split(/[,;]/).map(i=>i.trim());if(o.length<2)return null;let e=pn(o[0]),n=pn(o[1]);return e===null||n===null?null:Math.abs(e)>90&&Math.abs(n)<=90?{longitude:e,latitude:n}:Math.abs(n)>90&&Math.abs(e)<=90?{longitude:n,latitude:e}:{latitude:e,longitude:n}}function pn(t){if(t=t.trim(),t.includes("\xB0")||t.includes("'")||t.includes('"')){let n=ki(t);return isNaN(n)?null:n}let o=1;/[SW]/i.test(t)&&(o=-1),t=t.replace(/[NSEW]/gi,"");let e=parseFloat(t);return isNaN(e)?null:o*e}function ki(t){let o=/(\d+)[°d]\s*(\d+)?['′m]?\s*(\d+(?:\.\d+)?)?[\"″s]?\s*([NSEW])?/i,e=t.match(o);if(!e)return NaN;let n=parseFloat(e[1])||0,i=parseFloat(e[2])||0,r=parseFloat(e[3])||0,s=e[4]||"",a=n+i/60+r/3600;return/[SW]/i.test(s)&&(a=-a),a}var un="current",Ti="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-480q33 0 56.5-23.5T560-560q0-33-23.5-56.5T480-640q-33 0-56.5 23.5T400-560q0 33 23.5 56.5T480-480Zm0 294q122-112 181-203.5T720-552q0-109-69.5-178.5T480-800q-101 0-170.5 69.5T240-552q0 71 59 162.5T480-186Zm0 106Q319-217 239.5-334.5T160-552q0-150 96.5-239T480-880q127 0 223.5 89T800-552q0 100-79.5 217.5T480-80Z'/%3E%3C/svg%3E",Si={label:"Current location",value:un,icon:Ti},Ge=class extends co.Widget{constructor(e={}){super(e);this.className="deck-widget-geocoder";this.placement="top-left";this.geocodeHistory=new Mt({});this.addressText="";this.geocoder=Me;this.isGettingLocation=!1;this.setInput=e=>{this.addressText=e};this.handleKeyPress=e=>{e.key==="Enter"&&this.handleSubmit()};this.handleSelect=e=>{e===un?this.getCurrentLocation():(this.setInput(e),this.handleSubmit())};this.handleSubmit=()=>{this.geocode(this.addressText)};this.getCurrentLocation=async()=>{this.isGettingLocation=!0,this.rootElement&&this.updateHTML();try{let e=await Et.geocode();e&&this.flyTo(e)}catch(e){this.geocodeHistory.errorText=e instanceof Error?e.message:"Location error"}finally{this.isGettingLocation=!1,this.rootElement&&this.updateHTML()}};this.geocode=async e=>{let n=await this.geocodeHistory.geocode(this.geocoder,this.addressText,this.props.apiKey);this.rootElement&&this.updateHTML(),n&&this.flyTo(n)};this.setProps(this.props)}setProps(e){if(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,this.geocoder=Ci(this.props),this.geocoder.requiresApiKey&&!this.props.apiKey)throw new Error(`API key is required for the ${this.geocoder.name} geocoder`);super.setProps(e)}onRenderHTML(e){let n=this.props._geolocation?[Si,...this.geocodeHistory.addressHistory]:[...this.geocodeHistory.addressHistory];x(p("div",{className:"deck-widget-geocoder",children:[p("input",{className:"deck-widget-geocoder-input",type:"text",placeholder:this.isGettingLocation?"Finding your location...":this.geocoder.placeholderLocation??"Enter address or location",value:this.geocodeHistory.addressText,onInput:i=>this.setInput(i.target?.value||""),onKeyPress:this.handleKeyPress}),p(Ct,{menuItems:n,onSelect:this.handleSelect}),this.geocodeHistory.errorText&&p("div",{className:"deck-widget-geocoder-error",children:this.geocodeHistory.errorText})]}),e)}flyTo(e){let n=this.viewId?[this.viewId]:this.deck?.getViews().map(i=>i.id)??[];for(let i of n){let s={...this.getViewState(i),...e};this.props.transitionDuration>0&&(s.transitionDuration=this.props.transitionDuration,s.transitionInterpolator="latitude"in s?new Rt.FlyToInterpolator:new Rt.LinearInterpolator),this.setViewState(i,s)}}};Ge.defaultProps={...co.Widget.defaultProps,id:"geocoder",viewId:null,placement:"top-left",label:"Geocoder",transitionDuration:200,geocoder:"coordinates",customGeocoder:Me,apiKey:"",_geolocation:!1};function Ci(t){switch(t.geocoder){case"google":return Lt;case"mapbox":return It;case"opencage":return Wt;case"coordinates":return Me;case"custom":if(!t.customGeocoder)throw new Error("Custom geocoder is not defined");return t.customGeocoder;default:throw new Error(`Unknown geocoder: ${t.geocoder}`)}}var qe=E(R(),1);var Ue=class extends qe.Widget{constructor(e={}){super(e);this.className="deck-widget-fullscreen";this.placement="top-left";this.fullscreen=!1;this.setProps(this.props)}onAdd(){document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}onRemove(){document.removeEventListener("fullscreenchange",this.onFullscreenChange.bind(this))}onRenderHTML(e){x(p(M,{onClick:()=>{this.handleClick().catch(n=>qe.log.error(n)())},label:this.fullscreen?this.props.exitLabel:this.props.enterLabel,className:this.fullscreen?"deck-widget-fullscreen-exit":"deck-widget-fullscreen-enter"}),e)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}getContainer(){return this.props.container||this.deck?.props.parent||this.deck?.getCanvas()?.parentElement}onFullscreenChange(){let e=this.fullscreen,n=document.fullscreenElement===this.getContainer();e!==n&&(this.fullscreen=!this.fullscreen),this.updateHTML()}async handleClick(){this.fullscreen?await this.exitFullscreen():await this.requestFullscreen(),this.updateHTML()}async requestFullscreen(){let e=this.getContainer();e?.requestFullscreen?await e.requestFullscreen({navigationUI:"hide"}):this.togglePseudoFullscreen()}async exitFullscreen(){document.exitFullscreen?await document.exitFullscreen():this.togglePseudoFullscreen()}togglePseudoFullscreen(){this.getContainer()?.classList.toggle("deck-pseudo-fullscreen")}};Ue.defaultProps={...qe.Widget.defaultProps,id:"fullscreen",placement:"top-left",viewId:null,enterLabel:"Enter Fullscreen",exitLabel:"Exit Fullscreen",container:void 0};var Je=E(R(),1);function mn(t){let o=[],e=i=>"views"in i;function n(i){let r=o.length,s=i.minSplit??.05,a=i.maxSplit??.95,c=Math.min(Math.max(i.initialSplit??.5,s),a),d={id:r,orientation:i.orientation,views:i.views,split:c,editable:i.editable??!0,minSplit:s,maxSplit:a,x:0,y:0,width:0,height:0};return o.push(d),d.views=[e(i.views[0])?n(i.views[0]):i.views[0],e(i.views[1])?n(i.views[1]):i.views[1]],d}return n(t),o}function fn(t){let o=[];function e(n,i,r,s,a){n.x=i,n.y=r,n.width=s,n.height=a;let c=i,d=r,m=s,l=a,g=i,u=r,f=s,_=a;n.orientation==="horizontal"?(m=s*n.split,g=i+m,f=s-m):(l=a*n.split,u=r+l,_=a-l);let[w,h]=n.views;"views"in w?e(w,c,d,m,l):o.push(w.clone({x:`${c}%`,y:`${d}%`,width:`${m}%`,height:`${l}%`})),"views"in h?e(h,g,u,f,_):o.push(h.clone({x:`${g}%`,y:`${u}%`,width:`${f}%`,height:`${_}%`}))}return e(t,0,0,100,100),o}var Xe=class extends Je.Widget{constructor(e){super(e);this.className="deck-widget-splitter";this.placement="fill";this.needsUpdate=!0;this.viewLayouts=mn(this.props.viewLayout)}setProps(e){e.viewLayout&&!(0,Je._deepEqual)(e.viewLayout,this.props.viewLayout,-1)&&(this.viewLayouts=mn(e.viewLayout),this.views=void 0),super.setProps(e)}onRedraw(){super.updateHTML()}updateHTML(){this.views||(this.views=fn(this.viewLayouts[0]),this.props.onChange(this.views.slice())),requestAnimationFrame(()=>{this.doUpdate()})}doUpdate(){if(this.deck){let e=this.deck.props.views;!(e&&e!==this.lastViews)&&this.lastViews!==this.views&&(this.lastViews=this.views,this.deck.setProps({views:this.views}))}}onChange(e,n){n.split=e,this.views=fn(this.viewLayouts[0]),this.props.onChange(this.views.slice()),this.doUpdate()}onRenderHTML(e){x(p(ae,{children:this.viewLayouts.map(n=>n.editable&&p(Mi,{...n,onChange:i=>this.onChange(i,n),onDragStart:()=>this.props.onDragStart(),onDragEnd:()=>this.props.onDragStart()}))}),e)}};Xe.defaultProps={...Je.Widget.defaultProps,id:"splitter-widget",viewLayout:void 0,onChange:()=>{},onDragStart:()=>{},onDragEnd:()=>{}};function Mi({orientation:t,x:o,y:e,width:n,height:i,split:r,minSplit:s,maxSplit:a,onChange:c,onDragStart:d,onDragEnd:m}){let[l,g]=le(!1),u=N(null);G(()=>{if(!l)return;let h=P=>{if(!u.current)return;let k=u.current.getBoundingClientRect(),y;t==="horizontal"?y=(P.clientX-k.left)/k.width:y=(P.clientY-k.top)/k.height,y=Math.min(Math.max(y,s),a),c?.(y)},b=()=>{m?.(),g(!1)};return document.addEventListener("pointermove",h),document.addEventListener("pointerup",b),document.addEventListener("pointerleave",b),()=>{document.removeEventListener("pointermove",h),document.removeEventListener("pointerup",b),document.removeEventListener("pointerleave",b)}},[l]);let f=h=>{g(!0),d?.(),h.preventDefault()},_=t==="horizontal"?{left:`${r*100}%`}:{top:`${r*100}%`},w={position:"absolute",top:`${e}%`,left:`${o}%`,width:`${n}%`,height:`${i}%`};return p("div",{ref:u,style:w,children:p("div",{className:`deck-widget-splitter-handle deck-widget-splitter-handle--${t} ${l?"active":""}`,style:_,onPointerDown:f})})}var bo=E(R(),1);var At=Math.min,gn=Math.max;var Li={left:"right",right:"left",bottom:"top",top:"bottom"},Ii={start:"end",end:"start"};function Vt(t,o,e){return gn(t,At(o,e))}function Le(t,o){return typeof t=="function"?t(o):t}function ce(t){return t.split("-")[0]}function Ie(t){return t.split("-")[1]}function po(t){return t==="x"?"y":"x"}function Dt(t){return t==="y"?"height":"width"}function ve(t){return["top","bottom"].includes(ce(t))?"y":"x"}function Ht(t){return po(ve(t))}function hn(t,o,e){e===void 0&&(e=!1);let n=Ie(t),i=Ht(t),r=Dt(i),s=i==="x"?n===(e?"end":"start")?"right":"left":n==="start"?"bottom":"top";return o.reference[r]>o.floating[r]&&(s=Ye(s)),[s,Ye(s)]}function vn(t){let o=Ye(t);return[Ot(t),o,Ot(o)]}function Ot(t){return t.replace(/start|end/g,o=>Ii[o])}function Wi(t,o,e){let n=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(t){case"top":case"bottom":return e?o?i:n:o?n:i;case"left":case"right":return o?r:s;default:return[]}}function wn(t,o,e,n){let i=Ie(t),r=Wi(ce(t),e==="start",n);return i&&(r=r.map(s=>s+"-"+i),o&&(r=r.concat(r.map(Ot)))),r}function Ye(t){return t.replace(/left|right|bottom|top/g,o=>Li[o])}function Ei(t){return{top:0,right:0,bottom:0,left:0,...t}}function uo(t){return typeof t!="number"?Ei(t):{top:t,right:t,bottom:t,left:t}}function we(t){let{x:o,y:e,width:n,height:i}=t;return{width:n,height:i,top:e,left:o,right:o+n,bottom:e+i,x:o,y:e}}function _n(t,o,e){let{reference:n,floating:i}=t,r=ve(o),s=Ht(o),a=Dt(s),c=ce(o),d=r==="y",m=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2,g=n[a]/2-i[a]/2,u;switch(c){case"top":u={x:m,y:n.y-i.height};break;case"bottom":u={x:m,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:l};break;case"left":u={x:n.x-i.width,y:l};break;default:u={x:n.x,y:n.y}}switch(Ie(o)){case"start":u[s]-=g*(e&&d?-1:1);break;case"end":u[s]+=g*(e&&d?-1:1);break}return u}var bn=async(t,o,e)=>{let{placement:n="bottom",strategy:i="absolute",middleware:r=[],platform:s}=e,a=r.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(o)),d=await s.getElementRects({reference:t,floating:o,strategy:i}),{x:m,y:l}=_n(d,n,c),g=n,u={},f=0;for(let _=0;_<a.length;_++){let{name:w,fn:h}=a[_],{x:b,y:P,data:k,reset:y}=await h({x:m,y:l,initialPlacement:n,placement:g,strategy:i,middlewareData:u,rects:d,platform:s,elements:{reference:t,floating:o}});m=b??m,l=P??l,u={...u,[w]:{...u[w],...k}},y&&f<=50&&(f++,typeof y=="object"&&(y.placement&&(g=y.placement),y.rects&&(d=y.rects===!0?await s.getElementRects({reference:t,floating:o,strategy:i}):y.rects),{x:m,y:l}=_n(d,g,c)),_=-1)}return{x:m,y:l,placement:g,strategy:i,middlewareData:u}};async function mo(t,o){var e;o===void 0&&(o={});let{x:n,y:i,platform:r,rects:s,elements:a,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:l="floating",altBoundary:g=!1,padding:u=0}=Le(o,t),f=uo(u),w=a[g?l==="floating"?"reference":"floating":l],h=we(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(w)))==null||e?w:w.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:d,rootBoundary:m,strategy:c})),b=l==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),k=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},y=we(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:P,strategy:c}):b);return{top:(h.top-y.top+f.top)/k.y,bottom:(y.bottom-h.bottom+f.bottom)/k.y,left:(h.left-y.left+f.left)/k.x,right:(y.right-h.right+f.right)/k.x}}var yn=t=>({name:"arrow",options:t,async fn(o){let{x:e,y:n,placement:i,rects:r,platform:s,elements:a,middlewareData:c}=o,{element:d,padding:m=0}=Le(t,o)||{};if(d==null)return{};let l=uo(m),g={x:e,y:n},u=Ht(i),f=Dt(u),_=await s.getDimensions(d),w=u==="y",h=w?"top":"left",b=w?"bottom":"right",P=w?"clientHeight":"clientWidth",k=r.reference[f]+r.reference[u]-g[u]-r.floating[f],y=g[u]-r.reference[u],S=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d)),L=S?S[P]:0;(!L||!await(s.isElement==null?void 0:s.isElement(S)))&&(L=a.floating[P]||r.floating[f]);let I=k/2-y/2,D=L/2-_[f]/2-1,O=At(l[h],D),C=At(l[b],D),Q=O,ue=L-_[f]-C,H=L/2-_[f]/2+I,ie=Vt(Q,H,ue),X=!c.arrow&&Ie(i)!=null&&H!==ie&&r.reference[f]/2-(H<Q?O:C)-_[f]/2<0,B=X?H<Q?H-Q:H-ue:0;return{[u]:g[u]+B,data:{[u]:ie,centerOffset:H-ie-B,...X&&{alignmentOffset:B}},reset:X}}});var xn=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(o){var e,n;let{placement:i,middlewareData:r,rects:s,initialPlacement:a,platform:c,elements:d}=o,{mainAxis:m=!0,crossAxis:l=!0,fallbackPlacements:g,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:_=!0,...w}=Le(t,o);if((e=r.arrow)!=null&&e.alignmentOffset)return{};let h=ce(i),b=ve(a),P=ce(a)===a,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),y=g||(P||!_?[Ye(a)]:vn(a)),S=f!=="none";!g&&S&&y.push(...wn(a,_,f,k));let L=[a,...y],I=await mo(o,w),D=[],O=((n=r.flip)==null?void 0:n.overflows)||[];if(m&&D.push(I[h]),l){let H=hn(i,s,k);D.push(I[H[0]],I[H[1]])}if(O=[...O,{placement:i,overflows:D}],!D.every(H=>H<=0)){var C,Q;let H=(((C=r.flip)==null?void 0:C.index)||0)+1,ie=L[H];if(ie)return{data:{index:H,overflows:O},reset:{placement:ie}};let X=(Q=O.filter(B=>B.overflows[0]<=0).sort((B,F)=>B.overflows[1]-F.overflows[1])[0])==null?void 0:Q.placement;if(!X)switch(u){case"bestFit":{var ue;let B=(ue=O.filter(F=>{if(S){let z=ve(F.placement);return z===b||z==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(z=>z>0).reduce((z,Xt)=>z+Xt,0)]).sort((F,z)=>F[1]-z[1])[0])==null?void 0:ue[0];B&&(X=B);break}case"initialPlacement":X=a;break}if(i!==X)return{reset:{placement:X}}}return{}}}};async function Ri(t,o){let{placement:e,platform:n,elements:i}=t,r=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=ce(e),a=Ie(e),c=ve(e)==="y",d=["left","top"].includes(s)?-1:1,m=r&&c?-1:1,l=Le(o,t),{mainAxis:g,crossAxis:u,alignmentAxis:f}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return a&&typeof f=="number"&&(u=a==="end"?f*-1:f),c?{x:u*m,y:g*d}:{x:g*d,y:u*m}}var Pn=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(o){var e,n;let{x:i,y:r,placement:s,middlewareData:a}=o,c=await Ri(o,t);return s===((e=a.offset)==null?void 0:e.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:s}}}}},kn=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(o){let{x:e,y:n,placement:i}=o,{mainAxis:r=!0,crossAxis:s=!1,limiter:a={fn:w=>{let{x:h,y:b}=w;return{x:h,y:b}}},...c}=Le(t,o),d={x:e,y:n},m=await mo(o,c),l=ve(ce(i)),g=po(l),u=d[g],f=d[l];if(r){let w=g==="y"?"top":"left",h=g==="y"?"bottom":"right",b=u+m[w],P=u-m[h];u=Vt(b,u,P)}if(s){let w=l==="y"?"top":"left",h=l==="y"?"bottom":"right",b=f+m[w],P=f-m[h];f=Vt(b,f,P)}let _=a.fn({...o,[g]:u,[l]:f});return{..._,data:{x:_.x-e,y:_.y-n}}}}};var Nt=Math.min,_e=Math.max,je=Math.round,Ke=Math.floor,oe=t=>({x:t,y:t});function $t(){return typeof window<"u"}function be(t){return Sn(t)?(t.nodeName||"").toLowerCase():"#document"}function $(t){var o;return(t==null||(o=t.ownerDocument)==null?void 0:o.defaultView)||window}function J(t){var o;return(o=(Sn(t)?t.ownerDocument:t.document)||window.document)==null?void 0:o.documentElement}function Sn(t){return $t()?t instanceof Node||t instanceof $(t).Node:!1}function U(t){return $t()?t instanceof Element||t instanceof $(t).Element:!1}function Y(t){return $t()?t instanceof HTMLElement||t instanceof $(t).HTMLElement:!1}function Tn(t){return!$t()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof $(t).ShadowRoot}function Ee(t){let{overflow:o,overflowX:e,overflowY:n,display:i}=q(t);return/auto|scroll|overlay|hidden|clip/.test(o+n+e)&&!["inline","contents"].includes(i)}function Cn(t){return["table","td","th"].includes(be(t))}function Ze(t){return[":popover-open",":modal"].some(o=>{try{return t.matches(o)}catch{return!1}})}function Bt(t){let o=Ft(),e=U(t)?q(t):t;return["transform","translate","scale","rotate","perspective"].some(n=>e[n]?e[n]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!o&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!o&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(n=>(e.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(e.contain||"").includes(n))}function Mn(t){let o=ne(t);for(;Y(o)&&!ye(o);){if(Bt(o))return o;if(Ze(o))return null;o=ne(o)}return null}function Ft(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ye(t){return["html","body","#document"].includes(be(t))}function q(t){return $(t).getComputedStyle(t)}function Qe(t){return U(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ne(t){if(be(t)==="html")return t;let o=t.assignedSlot||t.parentNode||Tn(t)&&t.host||J(t);return Tn(o)?o.host:o}function Ln(t){let o=ne(t);return ye(o)?t.ownerDocument?t.ownerDocument.body:t.body:Y(o)&&Ee(o)?o:Ln(o)}function We(t,o,e){var n;o===void 0&&(o=[]),e===void 0&&(e=!0);let i=Ln(t),r=i===((n=t.ownerDocument)==null?void 0:n.body),s=$(i);if(r){let a=zt(s);return o.concat(s,s.visualViewport||[],Ee(i)?i:[],a&&e?We(a):[])}return o.concat(i,We(i,[],e))}function zt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function En(t){let o=q(t),e=parseFloat(o.width)||0,n=parseFloat(o.height)||0,i=Y(t),r=i?t.offsetWidth:e,s=i?t.offsetHeight:n,a=je(e)!==r||je(n)!==s;return a&&(e=r,n=s),{width:e,height:n,$:a}}function ho(t){return U(t)?t:t.contextElement}function Re(t){let o=ho(t);if(!Y(o))return oe(1);let e=o.getBoundingClientRect(),{width:n,height:i,$:r}=En(o),s=(r?je(e.width):e.width)/n,a=(r?je(e.height):e.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var Oi=oe(0);function Rn(t){let o=$(t);return!Ft()||!o.visualViewport?Oi:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function Ai(t,o,e){return o===void 0&&(o=!1),!e||o&&e!==$(t)?!1:o}function xe(t,o,e,n){o===void 0&&(o=!1),e===void 0&&(e=!1);let i=t.getBoundingClientRect(),r=ho(t),s=oe(1);o&&(n?U(n)&&(s=Re(n)):s=Re(t));let a=Ai(r,e,n)?Rn(r):oe(0),c=(i.left+a.x)/s.x,d=(i.top+a.y)/s.y,m=i.width/s.x,l=i.height/s.y;if(r){let g=$(r),u=n&&U(n)?$(n):n,f=g,_=zt(f);for(;_&&n&&u!==f;){let w=Re(_),h=_.getBoundingClientRect(),b=q(_),P=h.left+(_.clientLeft+parseFloat(b.paddingLeft))*w.x,k=h.top+(_.clientTop+parseFloat(b.paddingTop))*w.y;c*=w.x,d*=w.y,m*=w.x,l*=w.y,c+=P,d+=k,f=$(_),_=zt(f)}}return we({width:m,height:l,x:c,y:d})}function Vi(t){let{elements:o,rect:e,offsetParent:n,strategy:i}=t,r=i==="fixed",s=J(n),a=o?Ze(o.floating):!1;if(n===s||a&&r)return e;let c={scrollLeft:0,scrollTop:0},d=oe(1),m=oe(0),l=Y(n);if((l||!l&&!r)&&((be(n)!=="body"||Ee(s))&&(c=Qe(n)),Y(n))){let g=xe(n);d=Re(n),m.x=g.x+n.clientLeft,m.y=g.y+n.clientTop}return{width:e.width*d.x,height:e.height*d.y,x:e.x*d.x-c.scrollLeft*d.x+m.x,y:e.y*d.y-c.scrollTop*d.y+m.y}}function Di(t){return Array.from(t.getClientRects())}function go(t,o){let e=Qe(t).scrollLeft;return o?o.left+e:xe(J(t)).left+e}function Hi(t){let o=J(t),e=Qe(t),n=t.ownerDocument.body,i=_e(o.scrollWidth,o.clientWidth,n.scrollWidth,n.clientWidth),r=_e(o.scrollHeight,o.clientHeight,n.scrollHeight,n.clientHeight),s=-e.scrollLeft+go(t),a=-e.scrollTop;return q(n).direction==="rtl"&&(s+=_e(o.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:a}}function Ni(t,o){let e=$(t),n=J(t),i=e.visualViewport,r=n.clientWidth,s=n.clientHeight,a=0,c=0;if(i){r=i.width,s=i.height;let d=Ft();(!d||d&&o==="fixed")&&(a=i.offsetLeft,c=i.offsetTop)}return{width:r,height:s,x:a,y:c}}function $i(t,o){let e=xe(t,!0,o==="fixed"),n=e.top+t.clientTop,i=e.left+t.clientLeft,r=Y(t)?Re(t):oe(1),s=t.clientWidth*r.x,a=t.clientHeight*r.y,c=i*r.x,d=n*r.y;return{width:s,height:a,x:c,y:d}}function In(t,o,e){let n;if(o==="viewport")n=Ni(t,e);else if(o==="document")n=Hi(J(t));else if(U(o))n=$i(o,e);else{let i=Rn(t);n={...o,x:o.x-i.x,y:o.y-i.y}}return we(n)}function On(t,o){let e=ne(t);return e===o||!U(e)||ye(e)?!1:q(e).position==="fixed"||On(e,o)}function Bi(t,o){let e=o.get(t);if(e)return e;let n=We(t,[],!1).filter(a=>U(a)&&be(a)!=="body"),i=null,r=q(t).position==="fixed",s=r?ne(t):t;for(;U(s)&&!ye(s);){let a=q(s),c=Bt(s);!c&&a.position==="fixed"&&(i=null),(r?!c&&!i:!c&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Ee(s)&&!c&&On(t,s))?n=n.filter(m=>m!==s):i=a,s=ne(s)}return o.set(t,n),n}function Fi(t){let{element:o,boundary:e,rootBoundary:n,strategy:i}=t,s=[...e==="clippingAncestors"?Ze(o)?[]:Bi(o,this._c):[].concat(e),n],a=s[0],c=s.reduce((d,m)=>{let l=In(o,m,i);return d.top=_e(l.top,d.top),d.right=Nt(l.right,d.right),d.bottom=Nt(l.bottom,d.bottom),d.left=_e(l.left,d.left),d},In(o,a,i));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function zi(t){let{width:o,height:e}=En(t);return{width:o,height:e}}function Gi(t,o,e){let n=Y(o),i=J(o),r=e==="fixed",s=xe(t,!0,r,o),a={scrollLeft:0,scrollTop:0},c=oe(0);if(n||!n&&!r)if((be(o)!=="body"||Ee(i))&&(a=Qe(o)),n){let u=xe(o,!0,r,o);c.x=u.x+o.clientLeft,c.y=u.y+o.clientTop}else i&&(c.x=go(i));let d=0,m=0;if(i&&!n&&!r){let u=i.getBoundingClientRect();m=u.top+a.scrollTop,d=u.left+a.scrollLeft-go(i,u)}let l=s.left+a.scrollLeft-c.x-d,g=s.top+a.scrollTop-c.y-m;return{x:l,y:g,width:s.width,height:s.height}}function fo(t){return q(t).position==="static"}function Wn(t,o){if(!Y(t)||q(t).position==="fixed")return null;if(o)return o(t);let e=t.offsetParent;return J(t)===e&&(e=e.ownerDocument.body),e}function An(t,o){let e=$(t);if(Ze(t))return e;if(!Y(t)){let i=ne(t);for(;i&&!ye(i);){if(U(i)&&!fo(i))return i;i=ne(i)}return e}let n=Wn(t,o);for(;n&&Cn(n)&&fo(n);)n=Wn(n,o);return n&&ye(n)&&fo(n)&&!Bt(n)?e:n||Mn(t)||e}var Ui=async function(t){let o=this.getOffsetParent||An,e=this.getDimensions,n=await e(t.floating);return{reference:Gi(t.reference,await o(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function qi(t){return q(t).direction==="rtl"}var Xi={convertOffsetParentRelativeRectToViewportRelativeRect:Vi,getDocumentElement:J,getClippingRect:Fi,getOffsetParent:An,getElementRects:Ui,getClientRects:Di,getDimensions:zi,getScale:Re,isElement:U,isRTL:qi};function Ji(t,o){let e=null,n,i=J(t);function r(){var a;clearTimeout(n),(a=e)==null||a.disconnect(),e=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),r();let{left:d,top:m,width:l,height:g}=t.getBoundingClientRect();if(a||o(),!l||!g)return;let u=Ke(m),f=Ke(i.clientWidth-(d+l)),_=Ke(i.clientHeight-(m+g)),w=Ke(d),b={rootMargin:-u+"px "+-f+"px "+-_+"px "+-w+"px",threshold:_e(0,Nt(1,c))||1},P=!0;function k(y){let S=y[0].intersectionRatio;if(S!==c){if(!P)return s();S?s(!1,S):n=setTimeout(()=>{s(!1,1e-7)},1e3)}P=!1}try{e=new IntersectionObserver(k,{...b,root:i.ownerDocument})}catch{e=new IntersectionObserver(k,b)}e.observe(t)}return s(!0),r}function Vn(t,o,e,n){n===void 0&&(n={});let{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=ho(t),m=i||r?[...d?We(d):[],...We(o)]:[];m.forEach(h=>{i&&h.addEventListener("scroll",e,{passive:!0}),r&&h.addEventListener("resize",e)});let l=d&&a?Ji(d,e):null,g=-1,u=null;s&&(u=new ResizeObserver(h=>{let[b]=h;b&&b.target===d&&u&&(u.unobserve(o),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(o)})),e()}),d&&!c&&u.observe(d),u.observe(o));let f,_=c?xe(t):null;c&&w();function w(){let h=xe(t);_&&(h.x!==_.x||h.y!==_.y||h.width!==_.width||h.height!==_.height)&&e(),_=h,f=requestAnimationFrame(w)}return e(),()=>{var h;m.forEach(b=>{i&&b.removeEventListener("scroll",e),r&&b.removeEventListener("resize",e)}),l?.(),(h=u)==null||h.disconnect(),u=null,c&&cancelAnimationFrame(f)}}var vo=Pn;var wo=kn,_o=xn;var Dn=yn;var Hn=(t,o,e)=>{let n=new Map,i={platform:Xi,...e},r={...i.platform,_c:n};return bn(t,o,{...i,platform:r})};var de=({x:t,y:o,placement:e="right",offset:n=0,arrow:i=!1,arrowColor:r="white",children:s})=>{let a=N(null),c=N(null),d=N(null),m=N();return m.current=()=>{if(!a.current||!c.current)return;let l=Array.isArray(i)?i[0]:i||0,g=Array.isArray(i)?i[1]:i||0,u=n+Math.max(g,l),f=e.includes("-")?[vo(u),_o(),wo()]:[vo(u),wo(),_o()];d.current&&f.push(Dn({element:d.current})),Hn(a.current,c.current,{placement:e,strategy:"fixed",middleware:f}).then(_=>{c.current&&Object.assign(c.current.style,{left:`${_.x}px`,top:`${_.y}px`});let w=_.middlewareData.arrow;if(w&&d.current){let h=Yi(l,g,r,_.placement);h.transform=`translate(${w.x||0}px, ${w.y||0}px)`,Object.assign(d.current.style,h)}})},ee(()=>{m.current?.()},[t,o,e,i,n]),G(()=>{c.current&&(c.current.style.visibility="visible");let l=Vn(a.current,c.current,()=>m.current?.());return()=>{l()}},[]),p("div",{style:{position:"absolute",left:t,top:o},ref:a,children:p("div",{className:"deck-widget deck-widget-popover",style:{position:"fixed",visibility:"hidden",pointerEvents:"none"},ref:c,children:[Boolean(i)&&p("div",{className:"deck-widget-popover-arrow",style:{position:"absolute"},ref:d}),s]})})};function Yi(t,o,e,n){let i={width:0,height:0,top:"",bottom:"",left:"",right:""};return n.startsWith("bottom")?(i.borderLeft=`${t/2}px solid transparent`,i.borderRight=`${t/2}px solid transparent`,i.borderBottom=`${o}px solid ${e}`,i.borderTop="",i.top=`${-o}px`):n.startsWith("top")?(i.borderLeft=`${t/2}px solid transparent`,i.borderRight=`${t/2}px solid transparent`,i.borderTop=`${o}px solid ${e}`,i.borderBottom="",i.bottom=`${-o}px`):n.startsWith("right")?(i.borderTop=`${t/2}px solid transparent`,i.borderBottom=`${t/2}px solid transparent`,i.borderRight=`${o}px solid ${e}`,i.borderLeft="",i.left=`${-o}px`):n.startsWith("left")&&(i.borderTop=`${t/2}px solid transparent`,i.borderBottom=`${t/2}px solid transparent`,i.borderLeft=`${o}px solid ${e}`,i.borderRight="",i.right=`${-o}px`),i}var et=({text:t,html:o,element:e,...n})=>{let i=N(null);return G(()=>(i.current&&e&&i.current.append(e),()=>{e?.remove()}),[e]),p("div",{ref:i,...n,dangerouslySetInnerHTML:o?{__html:o}:void 0,children:t})};var tt=class extends bo.Widget{constructor(e){super(e);this.className="deck-widget-info";this.placement="fill";this.tooltip=null;this.setProps(this.props)}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd({deck:e}){this.deck=e}onRemove(){this.rootElement&&x(null,this.rootElement)}onViewportChange(e){this.viewport=e,this.updateHTML()}onHover(e){this.props.mode==="hover"&&(this.tooltip=this._getTooltip(e))}onClick(e){this.props.mode==="click"&&(this.tooltip=this._getTooltip(e))}_getTooltip(e){if(!this.props.getTooltip)return null;let n=this.props.getTooltip(e,this)??null;if(n===null)return null;let i=typeof n=="string"?{text:n}:n,r=i.position||e.coordinate;return r?{position:r,text:"",html:"",element:null,className:"",style:{},...i}:null}onRenderHTML(e){if(!this.viewport||this.tooltip===null){x(null,e);return}let n={...this.props.style,...this.tooltip.style},[i,r]=this.viewport.project(this.tooltip.position),s=p(de,{x:i,y:r,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p(et,{className:`deck-widget-popup-content ${this.tooltip.className} ${this.props.className}`,style:n,html:this.tooltip.html,text:this.tooltip.text,element:this.tooltip.element})});x(s,e)}};tt.defaultProps={...bo.Widget.defaultProps,id:"info",viewId:null,mode:"hover",getTooltip:void 0,placement:"right",offset:10,arrow:10};var yo=E(R(),1);var ot=class extends yo.Widget{constructor(e){super(e);this.className="deck-widget-popup";this.placement="fill";this.setProps(this.props),this.isOpen=this.props.defaultIsOpen}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd({deck:e}){this.deck=e}onRemove(){this.rootElement&&x(null,this.rootElement)}onViewportChange(e){this.viewport=e,this.updateHTML()}onClick(){this.props.closeOnClickOutside&&this._setIsOpen(!1)}_setIsOpen(e){this.isOpen!==e&&(this.isOpen=e,this.props.onOpenChange?.(e),this.updateHTML())}onRenderHTML(e){if(!this.viewport){x(null,e);return}let{marker:n,content:i,style:r}=this.props,[s,a]=this.viewport.project(this.props.position),c=p("div",{children:[n&&p("div",{style:{position:"absolute",left:s,top:a,pointerEvents:"all",cursor:"pointer"},children:p(et,{...n,onClick:()=>this._setIsOpen(!0)})}),this.isOpen&&p(de,{x:s,y:a,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p("div",{className:`deck-widget-popup-content ${this.props.className}`,style:r,children:[this.props.closeButton&&p("div",{className:"deck-widget-popup-controls",style:{width:"100%",display:"flex",justifyContent:"end"},children:p(M,{className:"deck-widget-popup-close-button",onClick:()=>this._setIsOpen(!1)})}),p(et,{...typeof i=="string"?{text:i}:i})]})})]});x(c,e)}};ot.defaultProps={...yo.Widget.defaultProps,id:"info",viewId:null,position:[0,0],marker:null,defaultIsOpen:!0,content:"",placement:"right",offset:10,arrow:10,closeButton:!0,closeOnClickOutside:!1,onOpenChange:()=>{}};var xo=E(R(),1);var nt=class extends xo.Widget{constructor(e){super(e);this.className="deck-widget-context-menu";this.placement="fill";this.menu=null;this.setProps(this.props)}onAdd({deck:e}){e.getCanvas()?.addEventListener("contextmenu",n=>this.handleContextMenu(n))}handleContextMenu(e){let n=e.target.getBoundingClientRect(),i=e.clientX-n.x,r=e.clientY-n.y,s=this.deck?.pickObject({x:i,y:r})||{x:i,y:r,picked:!1,layer:null,color:null,index:-1,pixelRatio:1},a=this.props.getMenuItems?.(s,this)||this.props.menuItems;this.menu=a.length>0?{items:a,pickInfo:s}:null,e.preventDefault(),this.updateHTML()}onRenderHTML(e){if(!this.menu){x(null,e);return}let{items:n,pickInfo:i}=this.menu,r={pointerEvents:"auto",position:"static",...this.props.style},s=p(de,{x:i.x,y:i.y,placement:this.props.placement,arrow:this.props.arrow,arrowColor:"var(--menu-background, #fff)",offset:this.props.offset,children:p(he,{menuItems:n,onSelect:a=>this.props.onMenuItemSelected(a,i),style:r,isOpen:!0,onClose:()=>this.hide()})});x(s,e)}hide(){this.menu=null,this.updateHTML()}};nt.defaultProps={...xo.Widget.defaultProps,id:"context",viewId:null,menuItems:[],getMenuItems:void 0,onMenuItemSelected:()=>{},placement:"bottom-start",offset:10,arrow:!1};var To=E(R(),1);var Nn={passive:!1},it=(t,o,e)=>t<o?o:t>e?e:t,Gt=(t,o)=>{if(!t||!t.firstElementChild)return[0,0];let e=t.firstElementChild.getBoundingClientRect();return o?[e.top,e.height]:o?[e.top,e.height]:[e.left,e.width]},rt=(t,o)=>typeof t=="number"&&!Number.isNaN(t)&&t>0?t:Math.max(1,o/10||1),Po=(t,o)=>typeof t=="number"&&!Number.isNaN(t)&&t>0?t:Math.max(1,o||1);function Oe(t){let{className:o="",min:e,max:n,step:i,value:r,orientation:s,pageSize:a,stepButtons:c=!1,startButtonAriaLabel:d,endButtonAriaLabel:m,eventTarget:l,decorations:g=[],onChange:u}=t,f=s!=="horizontal",_=N(null),w=N(null),h=N(null),b=N(null),[P,k]=le(0),y=n-e,S=Math.max(0,r[1]-r[0]),L=Math.max(0,y-S),I=it(r[0],e,e+L),{thumbLength:D,thumbOffset:O}=ee(()=>{if(P<=0||y<=0)return{thumbLength:0,thumbOffset:0};if(y<=S)return{thumbLength:1,thumbOffset:0};let v=S/y,T=Math.max(0,1-v),j=L<=0?0:it((I-e)/L,0,1);return{thumbLength:Math.max(0,Math.min(v,1)),thumbOffset:T*j}},[P,y,S,L,I,e]),C=te(v=>{if(!u)return;let T=it(v,e,e+L);u([T,T+S])},[u,e,L,S]),Q=te(v=>{v.stopPropagation(),C(I-rt(i,y))},[C,I,i,y]),ue=te(v=>{v.stopPropagation(),C(I+rt(i,y))},[C,I,i,y]),H=te(v=>{if(v.button!==0||v.target?.dataset.scrollbarThumb==="true")return;let j=w.current;if(!j)return;v.preventDefault(),v.stopPropagation();let[Pe]=Gt(j,f),Ae=f?v.clientY-Pe:v.clientX-Pe,ke=Math.max(1,1-D)*P,Te=D/2*P,Se=ke<=0?0:it((Ae-Te)/ke,0,1);C(e+Se*L)},[f,P,D,C,e,L]),ie=v=>{v.button!==0||!w.current||(b.current={pointerId:v.pointerId,startCoord:f?v.clientY:v.clientX,startRatio:O,min:e,max:n,maxStart:L},v.currentTarget.setPointerCapture(v.pointerId),v.preventDefault(),v.stopPropagation())},X=te(v=>{let T=b.current;if(!T||T.pointerId!==v.pointerId)return;let[j,Pe]=Gt(w.current,f),ke=(f?v.clientY:v.clientX)-T.startCoord,Te=T.startRatio+ke/Pe,Se=it(Te*(T.max-T.min),0,T.maxStart)+T.min;C(Se),v.preventDefault()},[C,f]),B=te(v=>{let T=b.current;T&&T.pointerId===v.pointerId&&(b.current=null,h.current?.releasePointerCapture(v.pointerId),v.preventDefault())},[]),F=te(v=>{switch(v.key){case"ArrowUp":case"ArrowLeft":(f&&v.key==="ArrowUp"||!f&&v.key==="ArrowLeft")&&(C(I-rt(i,y)),v.preventDefault());break;case"ArrowDown":case"ArrowRight":(f&&v.key==="ArrowDown"||!f&&v.key==="ArrowRight")&&(C(I+rt(i,y)),v.preventDefault());break;case"PageUp":C(I-Po(a,S)),v.preventDefault();break;case"PageDown":C(I+Po(a,S)),v.preventDefault();break;case"Home":C(e),v.preventDefault();break;case"End":C(e+L),v.preventDefault();break;default:break}},[f,C,I,i,y,a,S,e,L]),z=te(v=>{if(v.preventDefault(),v.stopPropagation(),L===0)return;let T=f?v.deltaY:v.deltaX;!f&&T===0&&(T=v.deltaY),v.deltaMode===WheelEvent.DOM_DELTA_LINE?T*=rt(i,y):v.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(T*=Po(a,S)),T!==0&&C(I+T)},[C,I,L,f,i,y,a,S]);io(()=>{k(Gt(w.current,f)[1])},[f]),io(()=>{let v=w.current;if(!v)return;let T=()=>{k(Gt(v,f)[1])};if(T(),typeof ResizeObserver<"u"){let j=new ResizeObserver(T);return j.observe(v),()=>j.disconnect()}if(typeof window<"u")return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[f]),G(()=>{let v=l??_.current;if(v)return v.addEventListener("keydown",F),v.addEventListener("wheel",z,Nn),()=>{v.removeEventListener("keydown",F),v.removeEventListener("wheel",z,Nn)}},[l,F,z]);let Xt=ee(()=>!g.length||y<=0?[]:g.map((v,T)=>{let[j,Pe]=v.position,Ae=(j-e)/y,ke=(Pe-e)/y,Te=Math.round(Ae*1e3)/10,Se=Math.max(0,Math.round((ke-Ae)*1e3)/10),Jn=f?{left:"0",width:"100%",top:`${Te}%`,height:`${Se}%`}:{top:"0",height:"100%",left:`${Te}%`,width:`${Se}%`};return p("div",{className:"deck-widget-range__decoration",style:Jn,children:v.element},`decoration-${T}`)}),[g,y,e,f]);return p("div",{ref:_,tabIndex:0,role:"scrollbar","aria-valuemin":e,"aria-valuemax":e+L,"aria-valuenow":I,"aria-orientation":s,className:`${o} deck-widget-range deck-widget-range--${s} ${L===0?"deck-widget-range--disabled":""}`,children:[c&&p("button",{type:"button",className:"deck-widget-range__button deck-widget-range__button--start","aria-label":d,disabled:I<=e,onClick:Q,children:p("span",{className:"deck-widget-icon"})}),p("div",{className:"deck-widget-range__track",ref:w,onClick:H,children:[p("div",{className:"deck-widget-range__decorations",children:Xt}),p("div",{className:"deck-widget-range__thumb","data-scrollbar-thumb":"true",ref:h,style:f?{height:`${D*100}%`,top:`${O*100}%`}:{width:`${D*100}%`,left:`${O*100}%`},onPointerDown:ie,onPointerMove:X,onPointerUp:B,onPointerCancel:B})]}),c&&p("button",{type:"button",className:"deck-widget-range__button deck-widget-range__button--end","aria-label":m,disabled:I>=e+L,onClick:ue,children:p("span",{className:"deck-widget-icon"})})]})}var $n=(t,o,e)=>t<o?o:t>e?e:t,So=class extends To.Widget{constructor(e){let n={...So.defaultProps,...e};super(n);this.className="deck-widget-scrollbar";this.placement="fill";this.contentSize=0;this.viewportSize=0;this.scrollOffset=0;this.handleRangeChange=e=>{this.emitScroll(e[0])};this.viewId=n.viewId??null}onViewportChange(e){this.viewport=e,this.onRenderHTML()}onRenderHTML(){let e=this.rootElement;if(!e)return;e.dataset.placement=this.props.placement;let n=this.viewport;this.updateViewport(n);let i=this.getClampedOffset(),r=this.getWheelEventTarget(this.props.captureWheel?"global":"local"),s=this.getDecorations(n),a=this.isVertical(),c=this.props.startButtonAriaLabel??(a?"Scroll up":"Scroll left"),d=this.props.endButtonAriaLabel??(a?"Scroll down":"Scroll right"),m=p(Oe,{min:0,max:Math.max(0,this.contentSize),step:this.getEffectiveStep(),pageSize:this.getEffectivePage(),value:[i,i+this.viewportSize],orientation:this.props.orientation,stepButtons:!0,startButtonAriaLabel:c,endButtonAriaLabel:d,eventTarget:r,decorations:s,onChange:this.handleRangeChange});x(m,e)}onRemove(){this.rootElement&&x(null,this.rootElement),super.onRemove()}updateViewport(e){if(!e){this.contentSize=0,this.scrollOffset=0,this.viewportSize=0;return}let{contentBounds:n}=this.props,i=this.isVertical(),r=n?ko(n,e,i):[0,0];this.contentSize=r[1]-r[0],this.scrollOffset=-r[0],this.viewportSize=i?e.height:e.width}getDecorations(e){let{decorations:n=[],contentBounds:i}=this.props;if(!e||!i||n.length===0)return[];let r=this.isVertical(),[s]=ko(i,e,r);return n.map(a=>{let[c,d]=ko(a.contentBounds,e,r),m=a.onClick?l=>{a.onClick?.(l)&&(l.stopPropagation(),l.preventDefault())}:void 0;return{position:[c-s,d-s],element:p("div",{style:{pointerEvents:m?"all":"none",width:"100%",height:"100%",backgroundColor:a.color},title:a.title,onClick:m})}})}getWheelEventTarget(e){return e===null?null:e==="local"?this.rootElement:this.deck?.props.parent||this.deck?.getCanvas()?.parentElement||this.rootElement}getMaxScroll(){return Math.max(0,this.contentSize-this.viewportSize)}getClampedOffset(){let e=this.getMaxScroll();return $n(this.scrollOffset,0,e)}isVertical(){return this.props.orientation!=="horizontal"}getEffectiveStep(){return typeof this.props.stepSize=="number"&&!Number.isNaN(this.props.stepSize)?this.props.stepSize:Math.max(1,this.viewportSize/10||1)}getEffectivePage(){return typeof this.props.pageSize=="number"&&!Number.isNaN(this.props.pageSize)?this.props.pageSize:this.viewportSize}emitScroll(e){let n=this.getMaxScroll(),i=$n(Math.round(e),0,n),r=this.viewport;if(r&&i!==this.getClampedOffset()){let s=r.project(r.position);this.isVertical()?s[1]-=i-this.scrollOffset:s[0]-=i-this.scrollOffset;let{target:a}=r.panByPosition(r.position,s);this.deck._onViewStateChange({viewId:r.id,viewState:{...this.getViewState(r.id),target:a},interactionState:{}})}}},st=So;st.defaultProps={...To.Widget.defaultProps,contentBounds:null,placement:"top-right",viewId:null,orientation:"vertical",stepSize:null,pageSize:null,startButtonAriaLabel:"",endButtonAriaLabel:"",captureWheel:!1,decorations:[]};function ko(t,o,e){return t.map(([n,i])=>o.project([n,i,0])).reduce((n,[i,r])=>{let s=e?r:i;return n[0]=Math.min(n[0],s),n[1]=Math.max(n[1],s),n},[1/0,-1/0])}var Co=E(R(),1);var at=class extends Co.Widget{constructor(e){super(e);this.className="";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId,super.setProps(e)}onRenderHTML(e){let{className:n,style:i,icon:r,color:s,label:a,onClick:c}=this.props;x(p(M,{className:n,style:i,color:s,icon:r,label:a,onClick:c}),e)}};at.defaultProps={...Co.Widget.defaultProps,id:"icon",placement:"top-left",viewId:null,icon:"",label:"",color:"",onClick:void 0};var Mo=E(R(),1);var lt=class extends Mo.Widget{constructor(e){super(e);this.className="deck-widget-toggle";this.placement="top-left";this._toggle=()=>{this.checked=!this.checked,this.props.onChange?.(this.checked),this.updateHTML()};this.checked=this.props.initialChecked,this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId,super.setProps(e)}onRenderHTML(e){let{className:n,style:i,icon:r,label:s,color:a,onIcon:c=r,onLabel:d=s,onColor:m=a}=this.props,l=this.checked;e.dataset.checked=String(l),x(p(M,{className:n,style:i,icon:l?c:r,label:l?d:s,color:l?m:a,onClick:this._toggle}),e)}};lt.defaultProps={...Mo.Widget.defaultProps,id:"icon",placement:"top-left",viewId:null,initialChecked:!1,icon:"",onIcon:void 0,label:"",onLabel:void 0,color:"",onColor:void 0,onChange:void 0};var Lo=E(R(),1);var ct=class extends Lo.Widget{constructor(e){super(e);this.className="deck-widget-selector";this.placement="top-left";this.isOpen=!1;this._toggleMenu=()=>{this.isOpen?this.isOpen=!1:this.rootElement&&(this.isOpen={x:this.rootElement.offsetLeft,y:this.rootElement.offsetTop,placement:this.props.placement.includes("right")?"left-start":"right-start"}),this.updateHTML()};this._handleSelectMode=e=>{this.value=e,this.props.onChange(e),this.updateHTML()};this.value=this.props.initialValue,this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){let n=this.props.options.find(i=>i.value===this.value)??this.props.options[0];x(p("div",{children:[p(M,{icon:n.icon,label:n.label,onClick:this._toggleMenu}),this.isOpen&&p(de,{...this.isOpen,children:p(he,{isOpen:!0,style:{pointerEvents:"auto",position:"static"},menuItems:this.props.options,onSelect:this._handleSelectMode,onClose:this._toggleMenu})})]}),e)}};ct.defaultProps={...Lo.Widget.defaultProps,id:"view-selector",placement:"top-left",viewId:null,initialValue:"",options:[],onChange:()=>{}};var Io=E(R(),1);var dt=class extends Io.Widget{constructor(e={}){super(e);this.id="timeline";this.className="deck-widget-timeline";this.placement="fill";this.playing=!1;this.timerId=null;this.handlePlayPause=()=>{this.playing?this.stop():this.play()};this.handleTimeChange=([e])=>{this.currentTime=e,this.props.timeline?.setTime(e),this.props.onTimeChange(e),this.updateHTML()};this.tick=()=>{let{timeRange:[e,n],step:i,loop:r}=this.props;if(i>0){let s=Math.round(this.currentTime/i)*i+i;s>n&&(this.currentTime<n?s=n:r?s=e:(s=n,this.playing=!1)),this.currentTime=s,this.props.onTimeChange(s),this.updateHTML()}this.playing?this.timerId=window.setTimeout(this.tick,this.props.playInterval):this.timerId=null};this.currentTime=this.props.initialTime??this.props.timeRange[0],this.props.timeline?.setTime(this.currentTime),this.setProps(this.props)}setProps(e){this.viewId=e.viewId??this.viewId,super.setProps(e)}onAdd(){this.playing=!1,this.timerId=null,this.props.autoPlay&&this.play()}onRemove(){this.stop()}onRenderHTML(e){let{timeRange:n,step:i,formatLabel:r}=this.props,s=this.currentTime;e.dataset.placement=this.props.placement,x(p("div",{className:"deck-widget-button-group",children:[this.playing?p(M,{label:"Pause",className:"deck-widget-timeline-pause",onClick:this.handlePlayPause}):p(M,{label:"Play",className:"deck-widget-timeline-play",onClick:this.handlePlayPause}),p(Oe,{min:n[0],max:n[1],orientation:"horizontal",step:i,value:[s,s],onChange:this.handleTimeChange,decorations:[{position:[s,s+i],element:p("div",{className:"deck-widget-timeline-label deck-widget-timeline-label--current",children:r(s)})}]})]}),e)}play(){this.playing=!0;let{timeRange:[e,n]}=this.props;this.currentTime>=n&&(this.currentTime=e,this.props.onTimeChange(e)),this.updateHTML(),this.tick()}stop(){this.playing=!1,this.timerId!==null&&(window.clearTimeout(this.timerId),this.timerId=null),this.updateHTML()}};dt.defaultProps={...Io.Widget.defaultProps,id:"timeline",placement:"bottom-left",viewId:null,timeline:null,timeRange:[0,100],step:1,initialTime:void 0,onTimeChange:()=>{},autoPlay:!1,loop:!1,playInterval:1e3,formatLabel:String};var Wo=E(R(),1);var pt=class extends Wo.Widget{constructor(e={}){super(e);this.className="deck-widget-screenshot";this.placement="top-left";this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){x(p(M,{className:"deck-widget-camera",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}handleClick(){if(this.props.onCapture){this.props.onCapture(this);return}let e=this.captureScreenToDataURL(this.props.imageFormat);e&&this.downloadDataURL(e,this.props.filename)}captureScreenToDataURL(e){return this.deck?.getCanvas()?.toDataURL(e)}downloadDataURL(e,n){let i=document.createElement("a");i.href=e,i.download=n,i.click()}};pt.defaultProps={...Wo.Widget.defaultProps,id:"screenshot",placement:"top-left",viewId:null,label:"Screenshot",filename:"screenshot.png",imageFormat:"image/png",onCapture:void 0};var pe=E(R(),1),Eo=E(R(),1);var Bn={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"#fff","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--button-text":"rgb(24, 24, 26, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(204, 204, 204)","--menu-gap":"4px","--menu-background":"#fff","--menu-backdrop-filter":"unset","--menu-border":"unset","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--menu-text":"rgb(24, 24, 26, 1)","--menu-item-hover":"rgba(0, 0, 0, 0.08)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"#d8d8e5","--range-thumb-color":"#616166","--range-decoration-active-color":"#f8dd50"},Fn={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(18, 18, 20, 1)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"unset","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--button-backdrop-filter":"unset","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--button-text":"rgb(215, 214, 229, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(200, 199, 209)","--menu-gap":"4px","--menu-background":"rgba(18, 18, 20, 1)","--menu-backdrop-filter":"unset","--menu-border":"unset","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25)","--menu-text":"rgb(215, 214, 229, 1)","--menu-item-hover":"rgba(255, 255, 255, 0.1)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"#2c2c30","--range-thumb-color":"#9e9da8","--range-decoration-active-color":"#dd7d2c"},Ut={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(255, 255, 255, 0.6)","--button-stroke":"rgba(255, 255, 255, 0.3)","--button-inner-stroke":"1px solid rgba(255, 255, 255, 0.6)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(97, 97, 102, 1)","--button-icon-hover":"rgba(24, 24, 26, 1)","--button-text":"rgb(24, 24, 26, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(204, 204, 204)","--menu-gap":"4px","--menu-background":"rgba(255, 255, 255, 0.6)","--menu-backdrop-filter":"blur(4px)","--menu-border":"1px solid rgba(255, 255, 255, 0.6)","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--menu-text":"rgb(24, 24, 26, 1)","--menu-item-hover":"rgba(0, 0, 0, 0.08)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"rgba(215, 214, 229, 0.3)","--range-thumb-color":"rgba(97, 97, 102, 1)","--range-decoration-active-color":"rgba(255, 215, 0, 0.6)"},qt={"--widget-margin":"12px","--button-size":"28px","--button-corner-radius":"8px","--button-background":"rgba(18, 18, 20, 0.75)","--button-stroke":"rgba(18, 18, 20, 0.30)","--button-inner-stroke":"1px solid rgba(18, 18, 20, 0.75)","--button-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--button-backdrop-filter":"blur(4px)","--button-icon-idle":"rgba(158, 157, 168, 1)","--button-icon-hover":"rgba(215, 214, 229, 1)","--button-text":"rgb(215, 214, 229, 1)","--icon-compass-north-color":"rgb(240, 92, 68)","--icon-compass-south-color":"rgb(200, 199, 209)","--menu-gap":"4px","--menu-background":"rgba(18, 18, 20, 0.75)","--menu-backdrop-filter":"blur(4px)","--menu-border":"1px solid rgba(18, 18, 20, 0.75)","--menu-shadow":"0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset","--menu-text":"rgb(215, 214, 229, 1)","--menu-item-hover":"rgba(255, 255, 255, 0.1)","--range-step-button-size":"24px","--range-track-size":"16px","--range-thumb-size":"10px","--range-track-color":"rgba(24, 24, 26, 0.3)","--range-thumb-color":"rgba(158, 157, 168, 1)","--range-decoration-active-color":"rgba(255, 145, 0, 0.6)"};var ut=class extends Eo.Widget{constructor(e={}){super(e);this.className="deck-widget-theme";this.placement="top-left";this.themeMode="dark";this.themeMode=this._getInitialThemeMode(),this.setProps(this.props)}setProps(e){let{lightModeTheme:n,darkModeTheme:i}=this.props;switch(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e),this.themeMode){case"light":e.lightModeTheme&&!(0,pe._deepEqual)(e.lightModeTheme,n,1)&&this._setThemeMode("light");break;case"dark":e.darkModeTheme&&!(0,pe._deepEqual)(e.darkModeTheme,i,1)&&this._setThemeMode("dark");break;default:pe.log.warn(`Invalid theme mode ${this.themeMode}`)()}}onRenderHTML(e){let{lightModeLabel:n,darkModeLabel:i}=this.props;x(p(M,{onClick:this._handleClick.bind(this),label:this.themeMode==="dark"?i:n,className:this.themeMode==="dark"?"deck-widget-moon":"deck-widget-sun"}),e)}onAdd(){this._setThemeMode(this.themeMode)}_handleClick(){let e=this.themeMode==="dark"?"light":"dark";this._setThemeMode(e)}_setThemeMode(e){this.themeMode=e;let n=this.rootElement?.closest(".deck-widget-container");if(n){let i=e==="dark"?this.props.darkModeTheme:this.props.lightModeTheme;(0,pe._applyStyles)(n,i);let r=this.themeMode==="dark"?this.props.darkModeLabel:this.props.lightModeLabel;pe.log.log(1,`Switched theme to ${r}`,i)(),this.updateHTML()}}_getInitialThemeMode(){let{initialThemeMode:e}=this.props;return e!=="auto"?e:typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}};ut.defaultProps={...Eo.Widget.defaultProps,id:"theme",placement:"top-left",viewId:null,lightModeLabel:"Light Mode",lightModeTheme:Ut,darkModeLabel:"Dark Mode",darkModeTheme:qt,initialThemeMode:"auto"};var Ro=E(R(),1);var mt=class extends Ro.Widget{constructor(e={}){super(e);this.className="deck-widget-loading";this.placement="top-left";this.loading=!0;this.setProps(this.props)}setProps(e){this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,super.setProps(e)}onRenderHTML(e){x(this.loading&&p(M,{className:"deck-widget-spinner",label:this.props.label,onClick:this.handleClick.bind(this)}),e)}onRedraw({layers:e}){let n=e.some(i=>!i.isLoaded);n!==this.loading&&(this.loading=n,this.updateHTML())}handleClick(){}};mt.defaultProps={...Ro.Widget.defaultProps,id:"loading",placement:"top-left",viewId:null,label:"Loading layer data"};var Oo=E(R(),1),qn=E(Gn(),1);var Ao=t=>`${t.name}: ${t.count}`;function Vo(t){return t<1e3?`${t.toFixed(2)}ms`:`${(t/1e3).toFixed(2)}s`}function Xn(t){return`${(t/1e6).toFixed(1)} MB`}var Un={count:Ao,averageTime:t=>`${t.name}: ${Vo(t.getAverageTime())}`,totalTime:t=>`${t.name}: ${Vo(t.time)}`,fps:t=>`${t.name}: ${Math.round(t.getHz())}fps`,memory:t=>`${t.name}: ${Xn(t.count)}`},ft=class extends Oo.Widget{constructor(e={}){super(e);this.className="deck-widget-stats";this.placement="top-left";this._counter=0;this.collapsed=!0;this._toggleCollapsed=()=>{this.collapsed=!this.collapsed,this.updateHTML()};this._getFps=()=>Math.round(this.deck?.metrics.fps??0);this._formatters={...Un},this._resetOnUpdate={...this.props.resetOnUpdate},this.collapsed=!e.defaultIsExpanded,this.setProps(e)}setProps(e){if(this.placement=e.placement??this.placement,this.viewId=e.viewId??this.viewId,e.formatters)for(let n in e.formatters){let i=e.formatters[n];this._formatters[n]=typeof i=="string"?Un[i]||Ao:i}e.resetOnUpdate&&(this._resetOnUpdate={...e.resetOnUpdate}),super.setProps(e)}onRemove(){this.rootElement&&x(null,this.rootElement)}onRenderHTML(e){if(this.collapsed){x(p(ji,{getFps:this._getFps,onClick:this._toggleCollapsed}),e);return}let i=this._getStats(),r=this.props.title||("id"in i?i.id:null)||"Stats",s=[];i&&i.forEach(a=>{let c=this._getLines(a).split(`
8
+ `);this._resetOnUpdate&&this._resetOnUpdate[a.name]&&a.reset(),c.forEach((d,m)=>{s.push(p("div",{style:{whiteSpace:"pre"},children:d},`${a.name}-${m}`))})}),x(p("div",{className:"deck-widget-stats-container",style:{cursor:"default"},children:[p("div",{className:"deck-widget-stats-header",style:{cursor:"pointer",pointerEvents:"auto"},onClick:this._toggleCollapsed,children:[p("b",{children:r}),p("button",{className:"deck-widget-dropdown-button",children:p("span",{className:"deck-widget-dropdown-icon open"})})]}),p("div",{className:"deck-widget-stats-content",children:s})]}),e)}onRedraw(){if(!this.collapsed){let e=Math.max(1,this.props.framesPerUpdate||1);this._counter++%e===0&&this.updateHTML()}}_getStats(){switch(this.props.type){case"deck":let e=this.deck?.metrics??{};return Object.entries(e);case"luma":return Array.from(qn.luma.stats.stats.values())[0];case"device":let i=this.deck?.device?.statsManager.stats.values();return i?Array.from(i)[0]:[];case"custom":return this.props.stats;default:throw new Error(`Unknown stats type: ${this.props.type}`)}}_getLines(e){if("count"in e)return(this._formatters[e.name]||this._formatters[e.type||""]||Ao)(e);let[n,i]=e,r=n.endsWith("Memory")?Xn(i):n.includes("Time")?Vo(i):`${i.toFixed(2)}`;return`${n}: ${r}`}};ft.defaultProps={...Oo.Widget.defaultProps,type:"deck",placement:"top-left",viewId:null,defaultIsExpanded:!1,stats:void 0,title:"Stats",framesPerUpdate:1,formatters:{},resetOnUpdate:{},id:"stats"};function ji({getFps:t,onClick:o}){let[e,n]=le(t());return G(()=>{let i=()=>{n(t()),r=requestAnimationFrame(i)},r=requestAnimationFrame(i);return()=>{cancelAnimationFrame(r)}},[t]),p(M,{onClick:o,children:p("div",{className:"text",children:["FPS",p("br",{}),e]})})}return ti(gt);})();
9
9
  return __exports__;
10
10
  });
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "UI widgets for deck.gl",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
- "version": "9.3.0-alpha.1",
6
+ "version": "9.3.0-alpha.2",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -47,7 +47,7 @@
47
47
  "peerDependencies": {
48
48
  "@deck.gl/core": "~9.2.0",
49
49
  "@floating-ui/dom": "^1.7.5",
50
- "@luma.gl/core": "~9.3.0-alpha.2"
50
+ "@luma.gl/core": "~9.3.0-alpha.6"
51
51
  },
52
- "gitHead": "eb5dc776addbcd766f6ffcb1eb2179eee0664d97"
52
+ "gitHead": "135d329f4a4b596ae2c16e4eb801eda30252f3bc"
53
53
  }