@deck.gl/widgets 9.0.0-beta.9 → 9.0.0

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.
package/dist/dist.dev.js CHANGED
@@ -44,11 +44,13 @@ var __exports__ = (() => {
44
44
  // bundle.ts
45
45
  var bundle_exports = {};
46
46
  __export(bundle_exports, {
47
+ CompassWidget: () => CompassWidget,
47
48
  DarkGlassTheme: () => DarkGlassTheme,
48
49
  DarkTheme: () => DarkTheme,
49
50
  FullscreenWidget: () => FullscreenWidget,
50
51
  LightGlassTheme: () => LightGlassTheme,
51
- LightTheme: () => LightTheme
52
+ LightTheme: () => LightTheme,
53
+ ZoomWidget: () => ZoomWidget
52
54
  });
53
55
 
54
56
  // ../core/bundle/peer-dependency.ts
@@ -80,301 +82,335 @@ var __exports__ = (() => {
80
82
  var a = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;
81
83
  var h = Array.isArray;
82
84
  function v(n2, l2) {
83
- for (var u2 in l2)
84
- n2[u2] = l2[u2];
85
+ for (var u3 in l2)
86
+ n2[u3] = l2[u3];
85
87
  return n2;
86
88
  }
87
89
  function p(n2) {
88
90
  var l2 = n2.parentNode;
89
91
  l2 && l2.removeChild(n2);
90
92
  }
91
- function y(l2, u2, t2) {
92
- var i2, o3, r2, f2 = {};
93
- for (r2 in u2)
94
- "key" == r2 ? i2 = u2[r2] : "ref" == r2 ? o3 = u2[r2] : f2[r2] = u2[r2];
95
- if (arguments.length > 2 && (f2.children = arguments.length > 3 ? n.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps)
93
+ function y(l2, u3, t2) {
94
+ var i3, o2, r2, f3 = {};
95
+ for (r2 in u3)
96
+ "key" == r2 ? i3 = u3[r2] : "ref" == r2 ? o2 = u3[r2] : f3[r2] = u3[r2];
97
+ if (arguments.length > 2 && (f3.children = arguments.length > 3 ? n.call(arguments, 2) : t2), "function" == typeof l2 && null != l2.defaultProps)
96
98
  for (r2 in l2.defaultProps)
97
- void 0 === f2[r2] && (f2[r2] = l2.defaultProps[r2]);
98
- return d(l2, f2, i2, o3, null);
99
+ void 0 === f3[r2] && (f3[r2] = l2.defaultProps[r2]);
100
+ return d(l2, f3, i3, o2, null);
99
101
  }
100
- function d(n2, t2, i2, o3, r2) {
101
- var f2 = { type: n2, props: t2, key: i2, ref: o3, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: null == r2 ? ++u : r2 };
102
- return null == r2 && null != l.vnode && l.vnode(f2), f2;
102
+ function d(n2, t2, i3, o2, r2) {
103
+ var f3 = { type: n2, props: t2, key: i3, ref: o2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: null == r2 ? ++u : r2, __i: -1, __u: 0 };
104
+ return null == r2 && null != l.vnode && l.vnode(f3), f3;
103
105
  }
104
- function k(n2) {
106
+ function g(n2) {
105
107
  return n2.children;
106
108
  }
107
109
  function b(n2, l2) {
108
110
  this.props = n2, this.context = l2;
109
111
  }
110
- function g(n2, l2) {
112
+ function m(n2, l2) {
111
113
  if (null == l2)
112
- return n2.__ ? g(n2.__, n2.__.__k.indexOf(n2) + 1) : null;
113
- for (var u2; l2 < n2.__k.length; l2++)
114
- if (null != (u2 = n2.__k[l2]) && null != u2.__e)
115
- return u2.__e;
116
- return "function" == typeof n2.type ? g(n2) : null;
114
+ return n2.__ ? m(n2.__, n2.__i + 1) : null;
115
+ for (var u3; l2 < n2.__k.length; l2++)
116
+ if (null != (u3 = n2.__k[l2]) && null != u3.__e)
117
+ return u3.__e;
118
+ return "function" == typeof n2.type ? m(n2) : null;
117
119
  }
118
- function m(n2) {
119
- var l2, u2;
120
+ function w(n2) {
121
+ var l2, u3;
120
122
  if (null != (n2 = n2.__) && null != n2.__c) {
121
123
  for (n2.__e = n2.__c.base = null, l2 = 0; l2 < n2.__k.length; l2++)
122
- if (null != (u2 = n2.__k[l2]) && null != u2.__e) {
123
- n2.__e = n2.__c.base = u2.__e;
124
+ if (null != (u3 = n2.__k[l2]) && null != u3.__e) {
125
+ n2.__e = n2.__c.base = u3.__e;
124
126
  break;
125
127
  }
126
- return m(n2);
128
+ return w(n2);
127
129
  }
128
130
  }
129
- function w(n2) {
131
+ function k(n2) {
130
132
  (!n2.__d && (n2.__d = true) && i.push(n2) && !x.__r++ || o !== l.debounceRendering) && ((o = l.debounceRendering) || r)(x);
131
133
  }
132
134
  function x() {
133
- var n2, l2, u2, t2, o3, r2, e2, c2, s2;
135
+ var n2, u3, t2, o2, r2, e2, c2, s2, a2;
134
136
  for (i.sort(f); n2 = i.shift(); )
135
- n2.__d && (l2 = i.length, t2 = void 0, o3 = void 0, r2 = void 0, c2 = (e2 = (u2 = n2).__v).__e, (s2 = u2.__P) && (t2 = [], o3 = [], (r2 = v({}, e2)).__v = e2.__v + 1, L(s2, e2, r2, u2.__n, void 0 !== s2.ownerSVGElement, null != e2.__h ? [c2] : null, t2, null == c2 ? g(e2) : c2, e2.__h, o3), M(t2, e2, o3), e2.__e != c2 && m(e2)), i.length > l2 && i.sort(f));
137
+ n2.__d && (u3 = i.length, o2 = void 0, e2 = (r2 = (t2 = n2).__v).__e, s2 = [], a2 = [], (c2 = t2.__P) && ((o2 = v({}, r2)).__v = r2.__v + 1, l.vnode && l.vnode(o2), L(c2, o2, r2, t2.__n, void 0 !== c2.ownerSVGElement, 32 & r2.__u ? [e2] : null, s2, null == e2 ? m(r2) : e2, !!(32 & r2.__u), a2), o2.__v = r2.__v, o2.__.__k[o2.__i] = o2, M(s2, o2, a2), o2.__e != e2 && w(o2)), i.length > u3 && i.sort(f));
136
138
  x.__r = 0;
137
139
  }
138
- function P(n2, l2, u2, t2, i2, o3, r2, f2, e2, a2, v2) {
139
- var p2, y2, _2, b2, m2, w2, x2, P2, S, H2 = 0, I2 = t2 && t2.__k || s, T2 = I2.length, j2 = T2, z2 = l2.length;
140
- for (u2.__k = [], p2 = 0; p2 < z2; p2++)
141
- null != (b2 = u2.__k[p2] = null == (b2 = l2[p2]) || "boolean" == typeof b2 || "function" == typeof b2 ? null : "string" == typeof b2 || "number" == typeof b2 || "bigint" == typeof b2 ? d(null, b2, null, null, b2) : h(b2) ? d(k, { children: b2 }, null, null, null) : b2.__b > 0 ? d(b2.type, b2.props, b2.key, b2.ref ? b2.ref : null, b2.__v) : b2) ? (b2.__ = u2, b2.__b = u2.__b + 1, -1 === (P2 = A(b2, I2, x2 = p2 + H2, j2)) ? _2 = c : (_2 = I2[P2] || c, I2[P2] = void 0, j2--), L(n2, b2, _2, i2, o3, r2, f2, e2, a2, v2), m2 = b2.__e, (y2 = b2.ref) && _2.ref != y2 && (_2.ref && O(_2.ref, null, b2), v2.push(y2, b2.__c || m2, b2)), null != m2 && (null == w2 && (w2 = m2), (S = _2 === c || null === _2.__v) ? -1 == P2 && H2-- : P2 !== x2 && (P2 === x2 + 1 ? H2++ : P2 > x2 ? j2 > z2 - x2 ? H2 += P2 - x2 : H2-- : H2 = P2 < x2 && P2 == x2 - 1 ? P2 - x2 : 0), x2 = p2 + H2, "function" != typeof b2.type || P2 === x2 && _2.__k !== b2.__k ? "function" == typeof b2.type || P2 === x2 && !S ? void 0 !== b2.__d ? (e2 = b2.__d, b2.__d = void 0) : e2 = m2.nextSibling : e2 = $(n2, m2, e2) : e2 = C(b2, e2, n2), "function" == typeof u2.type && (u2.__d = e2))) : (_2 = I2[p2]) && null == _2.key && _2.__e && (_2.__e == e2 && (e2 = g(_2)), q(_2, _2, false));
142
- for (u2.__e = w2, p2 = T2; p2--; )
143
- null != I2[p2] && ("function" == typeof u2.type && null != I2[p2].__e && I2[p2].__e == u2.__d && (u2.__d = I2[p2].__e.nextSibling), q(I2[p2], I2[p2]));
140
+ function C(n2, l2, u3, t2, i3, o2, r2, f3, e2, a2, h2) {
141
+ var v2, p2, y2, d2, _, g2 = t2 && t2.__k || s, b2 = l2.length;
142
+ for (u3.__d = e2, P(u3, l2, g2), e2 = u3.__d, v2 = 0; v2 < b2; v2++)
143
+ null != (y2 = u3.__k[v2]) && "boolean" != typeof y2 && "function" != typeof y2 && (p2 = -1 === y2.__i ? c : g2[y2.__i] || c, y2.__i = v2, L(n2, y2, p2, i3, o2, r2, f3, e2, a2, h2), d2 = y2.__e, y2.ref && p2.ref != y2.ref && (p2.ref && z(p2.ref, null, y2), h2.push(y2.ref, y2.__c || d2, y2)), null == _ && null != d2 && (_ = d2), 65536 & y2.__u || p2.__k === y2.__k ? (d2 || p2.__e != e2 || (e2 = m(p2)), e2 = S(y2, e2, n2)) : "function" == typeof y2.type && void 0 !== y2.__d ? e2 = y2.__d : d2 && (e2 = d2.nextSibling), y2.__d = void 0, y2.__u &= -196609);
144
+ u3.__d = e2, u3.__e = _;
144
145
  }
145
- function C(n2, l2, u2) {
146
- for (var t2, i2 = n2.__k, o3 = 0; i2 && o3 < i2.length; o3++)
147
- (t2 = i2[o3]) && (t2.__ = n2, l2 = "function" == typeof t2.type ? C(t2, l2, u2) : $(u2, t2.__e, l2));
148
- return l2;
146
+ function P(n2, l2, u3) {
147
+ var t2, i3, o2, r2, f3, e2 = l2.length, c2 = u3.length, s2 = c2, a2 = 0;
148
+ for (n2.__k = [], t2 = 0; t2 < e2; t2++)
149
+ r2 = t2 + a2, null != (i3 = n2.__k[t2] = null == (i3 = l2[t2]) || "boolean" == typeof i3 || "function" == typeof i3 ? null : "string" == typeof i3 || "number" == typeof i3 || "bigint" == typeof i3 || i3.constructor == String ? d(null, i3, null, null, null) : h(i3) ? d(g, { children: i3 }, null, null, null) : void 0 === i3.constructor && i3.__b > 0 ? d(i3.type, i3.props, i3.key, i3.ref ? i3.ref : null, i3.__v) : i3) ? (i3.__ = n2, i3.__b = n2.__b + 1, f3 = H(i3, u3, r2, s2), i3.__i = f3, o2 = null, -1 !== f3 && (s2--, (o2 = u3[f3]) && (o2.__u |= 131072)), null == o2 || null === o2.__v ? (-1 == f3 && a2--, "function" != typeof i3.type && (i3.__u |= 65536)) : f3 !== r2 && (f3 === r2 + 1 ? a2++ : f3 > r2 ? s2 > e2 - r2 ? a2 += f3 - r2 : a2-- : f3 < r2 ? f3 == r2 - 1 && (a2 = f3 - r2) : a2 = 0, f3 !== t2 + a2 && (i3.__u |= 65536))) : (o2 = u3[r2]) && null == o2.key && o2.__e && 0 == (131072 & o2.__u) && (o2.__e == n2.__d && (n2.__d = m(o2)), N(o2, o2, false), u3[r2] = null, s2--);
150
+ if (s2)
151
+ for (t2 = 0; t2 < c2; t2++)
152
+ null != (o2 = u3[t2]) && 0 == (131072 & o2.__u) && (o2.__e == n2.__d && (n2.__d = m(o2)), N(o2, o2));
149
153
  }
150
- function $(n2, l2, u2) {
151
- return null == u2 || u2.parentNode !== n2 ? n2.insertBefore(l2, null) : l2 == u2 && null != l2.parentNode || n2.insertBefore(l2, u2), l2.nextSibling;
154
+ function S(n2, l2, u3) {
155
+ var t2, i3;
156
+ if ("function" == typeof n2.type) {
157
+ for (t2 = n2.__k, i3 = 0; t2 && i3 < t2.length; i3++)
158
+ t2[i3] && (t2[i3].__ = n2, l2 = S(t2[i3], l2, u3));
159
+ return l2;
160
+ }
161
+ n2.__e != l2 && (u3.insertBefore(n2.__e, l2 || null), l2 = n2.__e);
162
+ do {
163
+ l2 = l2 && l2.nextSibling;
164
+ } while (null != l2 && 8 === l2.nodeType);
165
+ return l2;
152
166
  }
153
- function A(n2, l2, u2, t2) {
154
- var i2 = n2.key, o3 = n2.type, r2 = u2 - 1, f2 = u2 + 1, e2 = l2[u2];
155
- if (null === e2 || e2 && i2 == e2.key && o3 === e2.type)
156
- return u2;
157
- if (t2 > (null != e2 ? 1 : 0))
158
- for (; r2 >= 0 || f2 < l2.length; ) {
167
+ function H(n2, l2, u3, t2) {
168
+ var i3 = n2.key, o2 = n2.type, r2 = u3 - 1, f3 = u3 + 1, e2 = l2[u3];
169
+ if (null === e2 || e2 && i3 == e2.key && o2 === e2.type && 0 == (131072 & e2.__u))
170
+ return u3;
171
+ if (t2 > (null != e2 && 0 == (131072 & e2.__u) ? 1 : 0))
172
+ for (; r2 >= 0 || f3 < l2.length; ) {
159
173
  if (r2 >= 0) {
160
- if ((e2 = l2[r2]) && i2 == e2.key && o3 === e2.type)
174
+ if ((e2 = l2[r2]) && 0 == (131072 & e2.__u) && i3 == e2.key && o2 === e2.type)
161
175
  return r2;
162
176
  r2--;
163
177
  }
164
- if (f2 < l2.length) {
165
- if ((e2 = l2[f2]) && i2 == e2.key && o3 === e2.type)
166
- return f2;
167
- f2++;
178
+ if (f3 < l2.length) {
179
+ if ((e2 = l2[f3]) && 0 == (131072 & e2.__u) && i3 == e2.key && o2 === e2.type)
180
+ return f3;
181
+ f3++;
168
182
  }
169
183
  }
170
184
  return -1;
171
185
  }
172
- function H(n2, l2, u2, t2, i2) {
173
- var o3;
174
- for (o3 in u2)
175
- "children" === o3 || "key" === o3 || o3 in l2 || T(n2, o3, null, u2[o3], t2);
176
- for (o3 in l2)
177
- i2 && "function" != typeof l2[o3] || "children" === o3 || "key" === o3 || "value" === o3 || "checked" === o3 || u2[o3] === l2[o3] || T(n2, o3, l2[o3], u2[o3], t2);
178
- }
179
- function I(n2, l2, u2) {
180
- "-" === l2[0] ? n2.setProperty(l2, null == u2 ? "" : u2) : n2[l2] = null == u2 ? "" : "number" != typeof u2 || a.test(l2) ? u2 : u2 + "px";
186
+ function I(n2, l2, u3) {
187
+ "-" === l2[0] ? n2.setProperty(l2, null == u3 ? "" : u3) : n2[l2] = null == u3 ? "" : "number" != typeof u3 || a.test(l2) ? u3 : u3 + "px";
181
188
  }
182
- function T(n2, l2, u2, t2, i2) {
183
- var o3;
189
+ function T(n2, l2, u3, t2, i3) {
190
+ var o2;
184
191
  n:
185
192
  if ("style" === l2)
186
- if ("string" == typeof u2)
187
- n2.style.cssText = u2;
193
+ if ("string" == typeof u3)
194
+ n2.style.cssText = u3;
188
195
  else {
189
196
  if ("string" == typeof t2 && (n2.style.cssText = t2 = ""), t2)
190
197
  for (l2 in t2)
191
- u2 && l2 in u2 || I(n2.style, l2, "");
192
- if (u2)
193
- for (l2 in u2)
194
- t2 && u2[l2] === t2[l2] || I(n2.style, l2, u2[l2]);
198
+ u3 && l2 in u3 || I(n2.style, l2, "");
199
+ if (u3)
200
+ for (l2 in u3)
201
+ t2 && u3[l2] === t2[l2] || I(n2.style, l2, u3[l2]);
195
202
  }
196
203
  else if ("o" === l2[0] && "n" === l2[1])
197
- o3 = l2 !== (l2 = l2.replace(/Capture$/, "")), l2 = l2.toLowerCase() in n2 ? l2.toLowerCase().slice(2) : l2.slice(2), n2.l || (n2.l = {}), n2.l[l2 + o3] = u2, u2 ? t2 || n2.addEventListener(l2, o3 ? z : j, o3) : n2.removeEventListener(l2, o3 ? z : j, o3);
198
- else if ("dangerouslySetInnerHTML" !== l2) {
199
- if (i2)
204
+ o2 = l2 !== (l2 = l2.replace(/(PointerCapture)$|Capture$/i, "$1")), l2 = l2.toLowerCase() in n2 ? l2.toLowerCase().slice(2) : l2.slice(2), n2.l || (n2.l = {}), n2.l[l2 + o2] = u3, u3 ? t2 ? u3.u = t2.u : (u3.u = Date.now(), n2.addEventListener(l2, o2 ? D : A, o2)) : n2.removeEventListener(l2, o2 ? D : A, o2);
205
+ else {
206
+ if (i3)
200
207
  l2 = l2.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
201
- else if ("width" !== l2 && "height" !== l2 && "href" !== l2 && "list" !== l2 && "form" !== l2 && "tabIndex" !== l2 && "download" !== l2 && "rowSpan" !== l2 && "colSpan" !== l2 && l2 in n2)
208
+ else if ("width" !== l2 && "height" !== l2 && "href" !== l2 && "list" !== l2 && "form" !== l2 && "tabIndex" !== l2 && "download" !== l2 && "rowSpan" !== l2 && "colSpan" !== l2 && "role" !== l2 && l2 in n2)
202
209
  try {
203
- n2[l2] = null == u2 ? "" : u2;
210
+ n2[l2] = null == u3 ? "" : u3;
204
211
  break n;
205
212
  } catch (n3) {
206
213
  }
207
- "function" == typeof u2 || (null == u2 || false === u2 && "-" !== l2[4] ? n2.removeAttribute(l2) : n2.setAttribute(l2, u2));
214
+ "function" == typeof u3 || (null == u3 || false === u3 && "-" !== l2[4] ? n2.removeAttribute(l2) : n2.setAttribute(l2, u3));
208
215
  }
209
216
  }
210
- function j(n2) {
211
- return this.l[n2.type + false](l.event ? l.event(n2) : n2);
217
+ function A(n2) {
218
+ if (this.l) {
219
+ var u3 = this.l[n2.type + false];
220
+ if (n2.t) {
221
+ if (n2.t <= u3.u)
222
+ return;
223
+ } else
224
+ n2.t = Date.now();
225
+ return u3(l.event ? l.event(n2) : n2);
226
+ }
212
227
  }
213
- function z(n2) {
214
- return this.l[n2.type + true](l.event ? l.event(n2) : n2);
228
+ function D(n2) {
229
+ if (this.l)
230
+ return this.l[n2.type + true](l.event ? l.event(n2) : n2);
215
231
  }
216
- function L(n2, u2, t2, i2, o3, r2, f2, e2, c2, s2) {
217
- var a2, p2, y2, d2, _2, g2, m2, w2, x2, C2, S, $2, A2, H2, I2, T2 = u2.type;
218
- if (void 0 !== u2.constructor)
232
+ function L(n2, u3, t2, i3, o2, r2, f3, e2, c2, s2) {
233
+ var a2, p2, y2, d2, _, m2, w2, k2, x2, P2, S2, $, H2, I2, T2, A2 = u3.type;
234
+ if (void 0 !== u3.constructor)
219
235
  return null;
220
- null != t2.__h && (c2 = t2.__h, e2 = u2.__e = t2.__e, u2.__h = null, r2 = [e2]), (a2 = l.__b) && a2(u2);
236
+ 128 & t2.__u && (c2 = !!(32 & t2.__u), r2 = [e2 = u3.__e = t2.__e]), (a2 = l.__b) && a2(u3);
221
237
  n:
222
- if ("function" == typeof T2)
238
+ if ("function" == typeof A2)
223
239
  try {
224
- if (w2 = u2.props, x2 = (a2 = T2.contextType) && i2[a2.__c], C2 = a2 ? x2 ? x2.props.value : a2.__ : i2, t2.__c ? m2 = (p2 = u2.__c = t2.__c).__ = p2.__E : ("prototype" in T2 && T2.prototype.render ? u2.__c = p2 = new T2(w2, C2) : (u2.__c = p2 = new b(w2, C2), p2.constructor = T2, p2.render = B), x2 && x2.sub(p2), p2.props = w2, p2.state || (p2.state = {}), p2.context = C2, p2.__n = i2, y2 = p2.__d = true, p2.__h = [], p2._sb = []), null == p2.__s && (p2.__s = p2.state), null != T2.getDerivedStateFromProps && (p2.__s == p2.state && (p2.__s = v({}, p2.__s)), v(p2.__s, T2.getDerivedStateFromProps(w2, p2.__s))), d2 = p2.props, _2 = p2.state, p2.__v = u2, y2)
225
- null == T2.getDerivedStateFromProps && null != p2.componentWillMount && p2.componentWillMount(), null != p2.componentDidMount && p2.__h.push(p2.componentDidMount);
240
+ if (k2 = u3.props, x2 = (a2 = A2.contextType) && i3[a2.__c], P2 = a2 ? x2 ? x2.props.value : a2.__ : i3, t2.__c ? w2 = (p2 = u3.__c = t2.__c).__ = p2.__E : ("prototype" in A2 && A2.prototype.render ? u3.__c = p2 = new A2(k2, P2) : (u3.__c = p2 = new b(k2, P2), p2.constructor = A2, p2.render = O), x2 && x2.sub(p2), p2.props = k2, p2.state || (p2.state = {}), p2.context = P2, p2.__n = i3, y2 = p2.__d = true, p2.__h = [], p2._sb = []), null == p2.__s && (p2.__s = p2.state), null != A2.getDerivedStateFromProps && (p2.__s == p2.state && (p2.__s = v({}, p2.__s)), v(p2.__s, A2.getDerivedStateFromProps(k2, p2.__s))), d2 = p2.props, _ = p2.state, p2.__v = u3, y2)
241
+ null == A2.getDerivedStateFromProps && null != p2.componentWillMount && p2.componentWillMount(), null != p2.componentDidMount && p2.__h.push(p2.componentDidMount);
226
242
  else {
227
- if (null == T2.getDerivedStateFromProps && w2 !== d2 && null != p2.componentWillReceiveProps && p2.componentWillReceiveProps(w2, C2), !p2.__e && (null != p2.shouldComponentUpdate && false === p2.shouldComponentUpdate(w2, p2.__s, C2) || u2.__v === t2.__v)) {
228
- for (u2.__v !== t2.__v && (p2.props = w2, p2.state = p2.__s, p2.__d = false), u2.__e = t2.__e, u2.__k = t2.__k, u2.__k.forEach(function(n3) {
229
- n3 && (n3.__ = u2);
230
- }), S = 0; S < p2._sb.length; S++)
231
- p2.__h.push(p2._sb[S]);
232
- p2._sb = [], p2.__h.length && f2.push(p2);
243
+ if (null == A2.getDerivedStateFromProps && k2 !== d2 && null != p2.componentWillReceiveProps && p2.componentWillReceiveProps(k2, P2), !p2.__e && (null != p2.shouldComponentUpdate && false === p2.shouldComponentUpdate(k2, p2.__s, P2) || u3.__v === t2.__v)) {
244
+ for (u3.__v !== t2.__v && (p2.props = k2, p2.state = p2.__s, p2.__d = false), u3.__e = t2.__e, u3.__k = t2.__k, u3.__k.forEach(function(n3) {
245
+ n3 && (n3.__ = u3);
246
+ }), S2 = 0; S2 < p2._sb.length; S2++)
247
+ p2.__h.push(p2._sb[S2]);
248
+ p2._sb = [], p2.__h.length && f3.push(p2);
233
249
  break n;
234
250
  }
235
- null != p2.componentWillUpdate && p2.componentWillUpdate(w2, p2.__s, C2), null != p2.componentDidUpdate && p2.__h.push(function() {
236
- p2.componentDidUpdate(d2, _2, g2);
251
+ null != p2.componentWillUpdate && p2.componentWillUpdate(k2, p2.__s, P2), null != p2.componentDidUpdate && p2.__h.push(function() {
252
+ p2.componentDidUpdate(d2, _, m2);
237
253
  });
238
254
  }
239
- if (p2.context = C2, p2.props = w2, p2.__P = n2, p2.__e = false, $2 = l.__r, A2 = 0, "prototype" in T2 && T2.prototype.render) {
240
- for (p2.state = p2.__s, p2.__d = false, $2 && $2(u2), a2 = p2.render(p2.props, p2.state, p2.context), H2 = 0; H2 < p2._sb.length; H2++)
241
- p2.__h.push(p2._sb[H2]);
255
+ if (p2.context = P2, p2.props = k2, p2.__P = n2, p2.__e = false, $ = l.__r, H2 = 0, "prototype" in A2 && A2.prototype.render) {
256
+ for (p2.state = p2.__s, p2.__d = false, $ && $(u3), a2 = p2.render(p2.props, p2.state, p2.context), I2 = 0; I2 < p2._sb.length; I2++)
257
+ p2.__h.push(p2._sb[I2]);
242
258
  p2._sb = [];
243
259
  } else
244
260
  do {
245
- p2.__d = false, $2 && $2(u2), a2 = p2.render(p2.props, p2.state, p2.context), p2.state = p2.__s;
246
- } while (p2.__d && ++A2 < 25);
247
- p2.state = p2.__s, null != p2.getChildContext && (i2 = v(v({}, i2), p2.getChildContext())), y2 || null == p2.getSnapshotBeforeUpdate || (g2 = p2.getSnapshotBeforeUpdate(d2, _2)), P(n2, h(I2 = null != a2 && a2.type === k && null == a2.key ? a2.props.children : a2) ? I2 : [I2], u2, t2, i2, o3, r2, f2, e2, c2, s2), p2.base = u2.__e, u2.__h = null, p2.__h.length && f2.push(p2), m2 && (p2.__E = p2.__ = null);
261
+ p2.__d = false, $ && $(u3), a2 = p2.render(p2.props, p2.state, p2.context), p2.state = p2.__s;
262
+ } while (p2.__d && ++H2 < 25);
263
+ p2.state = p2.__s, null != p2.getChildContext && (i3 = v(v({}, i3), p2.getChildContext())), y2 || null == p2.getSnapshotBeforeUpdate || (m2 = p2.getSnapshotBeforeUpdate(d2, _)), C(n2, h(T2 = null != a2 && a2.type === g && null == a2.key ? a2.props.children : a2) ? T2 : [T2], u3, t2, i3, o2, r2, f3, e2, c2, s2), p2.base = u3.__e, u3.__u &= -161, p2.__h.length && f3.push(p2), w2 && (p2.__E = p2.__ = null);
248
264
  } catch (n3) {
249
- u2.__v = null, (c2 || null != r2) && (u2.__e = e2, u2.__h = !!c2, r2[r2.indexOf(e2)] = null), l.__e(n3, u2, t2);
265
+ u3.__v = null, c2 || null != r2 ? (u3.__e = e2, u3.__u |= c2 ? 160 : 32, r2[r2.indexOf(e2)] = null) : (u3.__e = t2.__e, u3.__k = t2.__k), l.__e(n3, u3, t2);
250
266
  }
251
267
  else
252
- null == r2 && u2.__v === t2.__v ? (u2.__k = t2.__k, u2.__e = t2.__e) : u2.__e = N(t2.__e, u2, t2, i2, o3, r2, f2, c2, s2);
253
- (a2 = l.diffed) && a2(u2);
268
+ null == r2 && u3.__v === t2.__v ? (u3.__k = t2.__k, u3.__e = t2.__e) : u3.__e = j(t2.__e, u3, t2, i3, o2, r2, f3, c2, s2);
269
+ (a2 = l.diffed) && a2(u3);
254
270
  }
255
- function M(n2, u2, t2) {
256
- for (var i2 = 0; i2 < t2.length; i2++)
257
- O(t2[i2], t2[++i2], t2[++i2]);
258
- l.__c && l.__c(u2, n2), n2.some(function(u3) {
271
+ function M(n2, u3, t2) {
272
+ u3.__d = void 0;
273
+ for (var i3 = 0; i3 < t2.length; i3++)
274
+ z(t2[i3], t2[++i3], t2[++i3]);
275
+ l.__c && l.__c(u3, n2), n2.some(function(u4) {
259
276
  try {
260
- n2 = u3.__h, u3.__h = [], n2.some(function(n3) {
261
- n3.call(u3);
277
+ n2 = u4.__h, u4.__h = [], n2.some(function(n3) {
278
+ n3.call(u4);
262
279
  });
263
280
  } catch (n3) {
264
- l.__e(n3, u3.__v);
281
+ l.__e(n3, u4.__v);
265
282
  }
266
283
  });
267
284
  }
268
- function N(l2, u2, t2, i2, o3, r2, f2, e2, s2) {
269
- var a2, v2, y2, d2 = t2.props, _2 = u2.props, k2 = u2.type, b2 = 0;
270
- if ("svg" === k2 && (o3 = true), null != r2) {
271
- for (; b2 < r2.length; b2++)
272
- if ((a2 = r2[b2]) && "setAttribute" in a2 == !!k2 && (k2 ? a2.localName === k2 : 3 === a2.nodeType)) {
273
- l2 = a2, r2[b2] = null;
285
+ function j(l2, u3, t2, i3, o2, r2, f3, e2, s2) {
286
+ var a2, v2, y2, d2, _, g2, b2, w2 = t2.props, k2 = u3.props, x2 = u3.type;
287
+ if ("svg" === x2 && (o2 = true), null != r2) {
288
+ for (a2 = 0; a2 < r2.length; a2++)
289
+ if ((_ = r2[a2]) && "setAttribute" in _ == !!x2 && (x2 ? _.localName === x2 : 3 === _.nodeType)) {
290
+ l2 = _, r2[a2] = null;
274
291
  break;
275
292
  }
276
293
  }
277
294
  if (null == l2) {
278
- if (null === k2)
279
- return document.createTextNode(_2);
280
- l2 = o3 ? document.createElementNS("http://www.w3.org/2000/svg", k2) : document.createElement(k2, _2.is && _2), r2 = null, e2 = false;
295
+ if (null === x2)
296
+ return document.createTextNode(k2);
297
+ l2 = o2 ? document.createElementNS("http://www.w3.org/2000/svg", x2) : document.createElement(x2, k2.is && k2), r2 = null, e2 = false;
281
298
  }
282
- if (null === k2)
283
- d2 === _2 || e2 && l2.data === _2 || (l2.data = _2);
299
+ if (null === x2)
300
+ w2 === k2 || e2 && l2.data === k2 || (l2.data = k2);
284
301
  else {
285
- if (r2 = r2 && n.call(l2.childNodes), v2 = (d2 = t2.props || c).dangerouslySetInnerHTML, y2 = _2.dangerouslySetInnerHTML, !e2) {
286
- if (null != r2)
287
- for (d2 = {}, b2 = 0; b2 < l2.attributes.length; b2++)
288
- d2[l2.attributes[b2].name] = l2.attributes[b2].value;
289
- (y2 || v2) && (y2 && (v2 && y2.__html == v2.__html || y2.__html === l2.innerHTML) || (l2.innerHTML = y2 && y2.__html || ""));
290
- }
291
- if (H(l2, _2, d2, o3, e2), y2)
292
- u2.__k = [];
293
- else if (P(l2, h(b2 = u2.props.children) ? b2 : [b2], u2, t2, i2, o3 && "foreignObject" !== k2, r2, f2, r2 ? r2[0] : t2.__k && g(t2, 0), e2, s2), null != r2)
294
- for (b2 = r2.length; b2--; )
295
- null != r2[b2] && p(r2[b2]);
296
- e2 || ("value" in _2 && void 0 !== (b2 = _2.value) && (b2 !== l2.value || "progress" === k2 && !b2 || "option" === k2 && b2 !== d2.value) && T(l2, "value", b2, d2.value, false), "checked" in _2 && void 0 !== (b2 = _2.checked) && b2 !== l2.checked && T(l2, "checked", b2, d2.checked, false));
302
+ if (r2 = r2 && n.call(l2.childNodes), w2 = t2.props || c, !e2 && null != r2)
303
+ for (w2 = {}, a2 = 0; a2 < l2.attributes.length; a2++)
304
+ w2[(_ = l2.attributes[a2]).name] = _.value;
305
+ for (a2 in w2)
306
+ _ = w2[a2], "children" == a2 || ("dangerouslySetInnerHTML" == a2 ? y2 = _ : "key" === a2 || a2 in k2 || T(l2, a2, null, _, o2));
307
+ for (a2 in k2)
308
+ _ = k2[a2], "children" == a2 ? d2 = _ : "dangerouslySetInnerHTML" == a2 ? v2 = _ : "value" == a2 ? g2 = _ : "checked" == a2 ? b2 = _ : "key" === a2 || e2 && "function" != typeof _ || w2[a2] === _ || T(l2, a2, _, w2[a2], o2);
309
+ if (v2)
310
+ e2 || y2 && (v2.__html === y2.__html || v2.__html === l2.innerHTML) || (l2.innerHTML = v2.__html), u3.__k = [];
311
+ else if (y2 && (l2.innerHTML = ""), C(l2, h(d2) ? d2 : [d2], u3, t2, i3, o2 && "foreignObject" !== x2, r2, f3, r2 ? r2[0] : t2.__k && m(t2, 0), e2, s2), null != r2)
312
+ for (a2 = r2.length; a2--; )
313
+ null != r2[a2] && p(r2[a2]);
314
+ e2 || (a2 = "value", void 0 !== g2 && (g2 !== l2[a2] || "progress" === x2 && !g2 || "option" === x2 && g2 !== w2[a2]) && T(l2, a2, g2, w2[a2], false), a2 = "checked", void 0 !== b2 && b2 !== l2[a2] && T(l2, a2, b2, w2[a2], false));
297
315
  }
298
316
  return l2;
299
317
  }
300
- function O(n2, u2, t2) {
318
+ function z(n2, u3, t2) {
301
319
  try {
302
- "function" == typeof n2 ? n2(u2) : n2.current = u2;
320
+ "function" == typeof n2 ? n2(u3) : n2.current = u3;
303
321
  } catch (n3) {
304
322
  l.__e(n3, t2);
305
323
  }
306
324
  }
307
- function q(n2, u2, t2) {
308
- var i2, o3;
309
- if (l.unmount && l.unmount(n2), (i2 = n2.ref) && (i2.current && i2.current !== n2.__e || O(i2, null, u2)), null != (i2 = n2.__c)) {
310
- if (i2.componentWillUnmount)
325
+ function N(n2, u3, t2) {
326
+ var i3, o2;
327
+ if (l.unmount && l.unmount(n2), (i3 = n2.ref) && (i3.current && i3.current !== n2.__e || z(i3, null, u3)), null != (i3 = n2.__c)) {
328
+ if (i3.componentWillUnmount)
311
329
  try {
312
- i2.componentWillUnmount();
330
+ i3.componentWillUnmount();
313
331
  } catch (n3) {
314
- l.__e(n3, u2);
332
+ l.__e(n3, u3);
315
333
  }
316
- i2.base = i2.__P = null, n2.__c = void 0;
334
+ i3.base = i3.__P = null, n2.__c = void 0;
317
335
  }
318
- if (i2 = n2.__k)
319
- for (o3 = 0; o3 < i2.length; o3++)
320
- i2[o3] && q(i2[o3], u2, t2 || "function" != typeof n2.type);
336
+ if (i3 = n2.__k)
337
+ for (o2 = 0; o2 < i3.length; o2++)
338
+ i3[o2] && N(i3[o2], u3, t2 || "function" != typeof n2.type);
321
339
  t2 || null == n2.__e || p(n2.__e), n2.__ = n2.__e = n2.__d = void 0;
322
340
  }
323
- function B(n2, l2, u2) {
324
- return this.constructor(n2, u2);
341
+ function O(n2, l2, u3) {
342
+ return this.constructor(n2, u3);
325
343
  }
326
- function D(u2, t2, i2) {
327
- var o3, r2, f2, e2;
328
- l.__ && l.__(u2, t2), r2 = (o3 = "function" == typeof i2) ? null : i2 && i2.__k || t2.__k, f2 = [], e2 = [], L(t2, u2 = (!o3 && i2 || t2).__k = y(k, null, [u2]), r2 || c, c, void 0 !== t2.ownerSVGElement, !o3 && i2 ? [i2] : r2 ? null : t2.firstChild ? n.call(t2.childNodes) : null, f2, !o3 && i2 ? i2 : r2 ? r2.__e : t2.firstChild, o3, e2), M(f2, u2, e2);
344
+ function q(u3, t2, i3) {
345
+ var o2, r2, f3, e2;
346
+ l.__ && l.__(u3, t2), r2 = (o2 = "function" == typeof i3) ? null : i3 && i3.__k || t2.__k, f3 = [], e2 = [], L(t2, u3 = (!o2 && i3 || t2).__k = y(g, null, [u3]), r2 || c, c, void 0 !== t2.ownerSVGElement, !o2 && i3 ? [i3] : r2 ? null : t2.firstChild ? n.call(t2.childNodes) : null, f3, !o2 && i3 ? i3 : r2 ? r2.__e : t2.firstChild, o2, e2), M(f3, u3, e2);
329
347
  }
330
- n = s.slice, l = { __e: function(n2, l2, u2, t2) {
331
- for (var i2, o3, r2; l2 = l2.__; )
332
- if ((i2 = l2.__c) && !i2.__)
348
+ n = s.slice, l = { __e: function(n2, l2, u3, t2) {
349
+ for (var i3, o2, r2; l2 = l2.__; )
350
+ if ((i3 = l2.__c) && !i3.__)
333
351
  try {
334
- if ((o3 = i2.constructor) && null != o3.getDerivedStateFromError && (i2.setState(o3.getDerivedStateFromError(n2)), r2 = i2.__d), null != i2.componentDidCatch && (i2.componentDidCatch(n2, t2 || {}), r2 = i2.__d), r2)
335
- return i2.__E = i2;
352
+ if ((o2 = i3.constructor) && null != o2.getDerivedStateFromError && (i3.setState(o2.getDerivedStateFromError(n2)), r2 = i3.__d), null != i3.componentDidCatch && (i3.componentDidCatch(n2, t2 || {}), r2 = i3.__d), r2)
353
+ return i3.__E = i3;
336
354
  } catch (l3) {
337
355
  n2 = l3;
338
356
  }
339
357
  throw n2;
340
358
  } }, u = 0, t = function(n2) {
341
- return null != n2 && void 0 === n2.constructor;
359
+ return null != n2 && null == n2.constructor;
342
360
  }, b.prototype.setState = function(n2, l2) {
343
- var u2;
344
- u2 = null != this.__s && this.__s !== this.state ? this.__s : this.__s = v({}, this.state), "function" == typeof n2 && (n2 = n2(v({}, u2), this.props)), n2 && v(u2, n2), null != n2 && this.__v && (l2 && this._sb.push(l2), w(this));
361
+ var u3;
362
+ u3 = null != this.__s && this.__s !== this.state ? this.__s : this.__s = v({}, this.state), "function" == typeof n2 && (n2 = n2(v({}, u3), this.props)), n2 && v(u3, n2), null != n2 && this.__v && (l2 && this._sb.push(l2), k(this));
345
363
  }, b.prototype.forceUpdate = function(n2) {
346
- this.__v && (this.__e = true, n2 && this.__h.push(n2), w(this));
347
- }, b.prototype.render = k, i = [], r = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, f = function(n2, l2) {
364
+ this.__v && (this.__e = true, n2 && this.__h.push(n2), k(this));
365
+ }, b.prototype.render = g, i = [], r = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, f = function(n2, l2) {
348
366
  return n2.__v.__b - l2.__v.__b;
349
367
  }, x.__r = 0, e = 0;
350
368
 
351
369
  // ../../node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js
352
- var _ = 0;
353
- function o2(o3, e2, n2, t2, f2, l2) {
354
- var s2, u2, a2 = {};
355
- for (u2 in e2)
356
- "ref" == u2 ? s2 = e2[u2] : a2[u2] = e2[u2];
357
- var i2 = { type: o3, props: a2, key: n2, ref: s2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, __h: null, constructor: void 0, __v: --_, __source: f2, __self: l2 };
358
- if ("function" == typeof o3 && (s2 = o3.defaultProps))
359
- for (u2 in s2)
360
- void 0 === a2[u2] && (a2[u2] = s2[u2]);
361
- return l.vnode && l.vnode(i2), i2;
370
+ var f2 = 0;
371
+ var i2 = Array.isArray;
372
+ function u2(e2, t2, n2, o2, i3, u3) {
373
+ var a2, c2, p2 = {};
374
+ for (c2 in t2)
375
+ "ref" == c2 ? a2 = t2[c2] : p2[c2] = t2[c2];
376
+ var l2 = { type: e2, props: p2, key: n2, ref: a2, __k: null, __: null, __b: 0, __e: null, __d: void 0, __c: null, constructor: void 0, __v: --f2, __i: -1, __u: 0, __source: i3, __self: u3 };
377
+ if ("function" == typeof e2 && (a2 = e2.defaultProps))
378
+ for (c2 in a2)
379
+ void 0 === p2[c2] && (p2[c2] = a2[c2]);
380
+ return l.vnode && l.vnode(l2), l2;
362
381
  }
363
382
 
364
383
  // src/components.tsx
365
384
  var IconButton = (props) => {
366
385
  const { className, label, onClick } = props;
367
- return /* @__PURE__ */ o2("div", { className: "deck-widget-button-border", children: /* @__PURE__ */ o2(
386
+ return /* @__PURE__ */ u2("div", { className: "deck-widget-button", children: /* @__PURE__ */ u2(
368
387
  "button",
369
388
  {
370
- className: `deck-widget-button ${className}`,
389
+ className: `deck-widget-icon-button ${className}`,
371
390
  type: "button",
372
391
  onClick,
373
392
  title: label,
374
- children: /* @__PURE__ */ o2("div", { className: "deck-widget-icon" })
393
+ children: /* @__PURE__ */ u2("div", { className: "deck-widget-icon" })
375
394
  }
376
395
  ) });
377
396
  };
397
+ var ButtonGroup = (props) => {
398
+ const { children, orientation } = props;
399
+ return /* @__PURE__ */ u2("div", { className: `deck-widget-button-group ${orientation}`, children });
400
+ };
401
+ var GroupedIconButton = (props) => {
402
+ const { className, label, onClick } = props;
403
+ return /* @__PURE__ */ u2(
404
+ "button",
405
+ {
406
+ className: `deck-widget-icon-button ${className}`,
407
+ type: "button",
408
+ onClick,
409
+ title: label,
410
+ children: /* @__PURE__ */ u2("div", { className: "deck-widget-icon" })
411
+ }
412
+ );
413
+ };
378
414
 
379
415
  // src/fullscreen-widget.tsx
380
416
  var FullscreenWidget = class {
@@ -415,7 +451,7 @@ var __exports__ = (() => {
415
451
  if (!el) {
416
452
  return;
417
453
  }
418
- const ui = /* @__PURE__ */ o2(
454
+ const ui = /* @__PURE__ */ u2(
419
455
  IconButton,
420
456
  {
421
457
  onClick: this.handleClick.bind(this),
@@ -423,7 +459,7 @@ var __exports__ = (() => {
423
459
  className: this.fullscreen ? "deck-widget-fullscreen-exit" : "deck-widget-fullscreen-enter"
424
460
  }
425
461
  );
426
- D(ui, el);
462
+ q(ui, el);
427
463
  }
428
464
  setProps(props) {
429
465
  const oldProps = this.props;
@@ -487,6 +523,184 @@ var __exports__ = (() => {
487
523
  }
488
524
  };
489
525
 
526
+ // src/compass-widget.tsx
527
+ var import_core3 = __toESM(require_core(), 1);
528
+ var CompassWidget = class {
529
+ constructor(props) {
530
+ this.id = "compass";
531
+ this.placement = "top-left";
532
+ this.viewId = null;
533
+ this.id = props.id || "compass";
534
+ this.viewId = props.viewId || null;
535
+ this.placement = props.placement || "top-left";
536
+ props.transitionDuration = props.transitionDuration || 200;
537
+ props.label = props.label || "Compass";
538
+ props.style = props.style || {};
539
+ this.props = props;
540
+ }
541
+ setProps(props) {
542
+ Object.assign(this.props, props);
543
+ }
544
+ onViewportChange(viewport) {
545
+ this.viewport = viewport;
546
+ this.update();
547
+ }
548
+ onAdd({ deck }) {
549
+ const { style, className } = this.props;
550
+ const element = document.createElement("div");
551
+ element.classList.add("deck-widget", "deck-widget-compass");
552
+ if (className)
553
+ element.classList.add(className);
554
+ if (style) {
555
+ Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));
556
+ }
557
+ this.deck = deck;
558
+ this.element = element;
559
+ this.update();
560
+ return element;
561
+ }
562
+ getRotation() {
563
+ if (this.viewport instanceof import_core3.WebMercatorViewport) {
564
+ return [-this.viewport.bearing, this.viewport.pitch];
565
+ } else if (this.viewport instanceof import_core3._GlobeViewport) {
566
+ return [0, Math.max(-80, Math.min(80, this.viewport.latitude))];
567
+ }
568
+ return [0, 0];
569
+ }
570
+ update() {
571
+ const [rz, rx] = this.getRotation();
572
+ const element = this.element;
573
+ if (!element) {
574
+ return;
575
+ }
576
+ const ui = /* @__PURE__ */ u2("div", { className: "deck-widget-button", style: { perspective: 100 }, children: /* @__PURE__ */ u2(
577
+ "button",
578
+ {
579
+ type: "button",
580
+ onClick: () => this.handleCompassReset(),
581
+ label: this.props.label,
582
+ style: { transform: `rotateX(${rx}deg)` },
583
+ children: /* @__PURE__ */ u2("svg", { fill: "none", width: "100%", height: "100%", viewBox: "0 0 26 26", children: /* @__PURE__ */ u2("g", { transform: `rotate(${rz},13,13)`, children: [
584
+ /* @__PURE__ */ u2(
585
+ "path",
586
+ {
587
+ d: "M10 13.0001L12.9999 5L15.9997 13.0001H10Z",
588
+ fill: "var(--icon-compass-north-color, #F05C44)"
589
+ }
590
+ ),
591
+ /* @__PURE__ */ u2(
592
+ "path",
593
+ {
594
+ d: "M16.0002 12.9999L13.0004 21L10.0005 12.9999H16.0002Z",
595
+ fill: "var(--icon-compass-south-color, #C2C2CC)"
596
+ }
597
+ )
598
+ ] }) })
599
+ }
600
+ ) });
601
+ q(ui, element);
602
+ }
603
+ onRemove() {
604
+ this.deck = void 0;
605
+ this.element = void 0;
606
+ }
607
+ handleCompassReset() {
608
+ const viewId = this.viewId || "default-view";
609
+ if (this.viewport instanceof import_core3.WebMercatorViewport) {
610
+ const nextViewState = {
611
+ ...this.viewport,
612
+ bearing: 0,
613
+ ...this.getRotation()[0] === 0 ? { pitch: 0 } : {},
614
+ transitionDuration: this.props.transitionDuration,
615
+ transitionInterpolator: new import_core3.FlyToInterpolator()
616
+ };
617
+ this.deck._onViewStateChange({ viewId, viewState: nextViewState, interactionState: {} });
618
+ }
619
+ }
620
+ };
621
+
622
+ // src/zoom-widget.tsx
623
+ var import_core4 = __toESM(require_core(), 1);
624
+ var ZoomWidget = class {
625
+ constructor(props) {
626
+ this.id = "zoom";
627
+ this.placement = "top-left";
628
+ this.orientation = "vertical";
629
+ this.viewId = null;
630
+ this.id = props.id || "zoom";
631
+ this.viewId = props.viewId || null;
632
+ this.placement = props.placement || "top-left";
633
+ this.orientation = props.orientation || "vertical";
634
+ props.transitionDuration = props.transitionDuration || 200;
635
+ props.zoomInLabel = props.zoomInLabel || "Zoom In";
636
+ props.zoomOutLabel = props.zoomOutLabel || "Zoom Out";
637
+ props.style = props.style || {};
638
+ this.props = props;
639
+ }
640
+ onAdd({ deck }) {
641
+ const { style, className } = this.props;
642
+ const element = document.createElement("div");
643
+ element.classList.add("deck-widget", "deck-widget-zoom");
644
+ if (className)
645
+ element.classList.add(className);
646
+ if (style) {
647
+ Object.entries(style).map(([key, value]) => element.style.setProperty(key, value));
648
+ }
649
+ const ui = /* @__PURE__ */ u2(ButtonGroup, { orientation: this.orientation, children: [
650
+ /* @__PURE__ */ u2(
651
+ GroupedIconButton,
652
+ {
653
+ onClick: () => this.handleZoomIn(),
654
+ label: this.props.zoomInLabel,
655
+ className: "deck-widget-zoom-in"
656
+ }
657
+ ),
658
+ /* @__PURE__ */ u2(
659
+ GroupedIconButton,
660
+ {
661
+ onClick: () => this.handleZoomOut(),
662
+ label: this.props.zoomOutLabel,
663
+ className: "deck-widget-zoom-out"
664
+ }
665
+ )
666
+ ] });
667
+ q(ui, element);
668
+ this.deck = deck;
669
+ this.element = element;
670
+ return element;
671
+ }
672
+ onRemove() {
673
+ this.deck = void 0;
674
+ this.element = void 0;
675
+ }
676
+ setProps(props) {
677
+ Object.assign(this.props, props);
678
+ }
679
+ onViewportChange(viewport) {
680
+ this.viewport = viewport;
681
+ }
682
+ handleZoom(nextZoom) {
683
+ const viewId = this.viewId || "default-view";
684
+ const nextViewState = {
685
+ ...this.viewport,
686
+ zoom: nextZoom,
687
+ transitionDuration: this.props.transitionDuration,
688
+ transitionInterpolator: new import_core4.FlyToInterpolator()
689
+ };
690
+ this.deck._onViewStateChange({ viewId, viewState: nextViewState, interactionState: {} });
691
+ }
692
+ handleZoomIn() {
693
+ if (this.viewport) {
694
+ this.handleZoom(this.viewport.zoom + 1);
695
+ }
696
+ }
697
+ handleZoomOut() {
698
+ if (this.viewport) {
699
+ this.handleZoom(this.viewport.zoom - 1);
700
+ }
701
+ }
702
+ };
703
+
490
704
  // src/themes.ts
491
705
  var LightTheme = {
492
706
  "--button-background": "#fff",
@@ -495,7 +709,9 @@ var __exports__ = (() => {
495
709
  "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25)",
496
710
  "--button-backdrop-filter": "unset",
497
711
  "--button-icon-idle": "rgba(97, 97, 102, 1)",
498
- "--button-icon-hover": "rgba(24, 24, 26, 1)"
712
+ "--button-icon-hover": "rgba(24, 24, 26, 1)",
713
+ "--icon-compass-north-color": "#F05C44",
714
+ "--icon-compass-south-color": "#C2C2CC"
499
715
  };
500
716
  var DarkTheme = {
501
717
  "--button-background": "rgba(18, 18, 20, 1)",
@@ -504,7 +720,9 @@ var __exports__ = (() => {
504
720
  "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25)",
505
721
  "--button-backdrop-filter": "unset",
506
722
  "--button-icon-idle": "rgba(158, 157, 168, 1)",
507
- "--button-icon-hover": "rgba(215, 214, 229, 1)"
723
+ "--button-icon-hover": "rgba(215, 214, 229, 1)",
724
+ "--icon-compass-north-color": "#F05C44",
725
+ "--icon-compass-south-color": "#C2C2CC"
508
726
  };
509
727
  var LightGlassTheme = {
510
728
  "--button-background": "rgba(255, 255, 255, 0.6)",
@@ -513,7 +731,9 @@ var __exports__ = (() => {
513
731
  "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset",
514
732
  "--button-backdrop-filter": "blur(4px)",
515
733
  "--button-icon-idle": "rgba(97, 97, 102, 1)",
516
- "--button-icon-hover": "rgba(24, 24, 26, 1)"
734
+ "--button-icon-hover": "rgba(24, 24, 26, 1)",
735
+ "--icon-compass-north-color": "#F05C44",
736
+ "--icon-compass-south-color": "#C2C2CC"
517
737
  };
518
738
  var DarkGlassTheme = {
519
739
  "--button-background": "rgba(18, 18, 20, 0.75)",
@@ -522,7 +742,9 @@ var __exports__ = (() => {
522
742
  "--button-shadow": "0px 0px 8px 0px rgba(0, 0, 0, 0.25), 0px 0px 8px 0px rgba(0, 0, 0, 0.1) inset",
523
743
  "--button-backdrop-filter": "blur(4px)",
524
744
  "--button-icon-idle": "rgba(158, 157, 168, 1)",
525
- "--button-icon-hover": "rgba(215, 214, 229, 1)"
745
+ "--button-icon-hover": "rgba(215, 214, 229, 1)",
746
+ "--icon-compass-north-color": "#F05C44",
747
+ "--icon-compass-south-color": "#C2C2CC"
526
748
  };
527
749
  return __toCommonJS(bundle_exports);
528
750
  })();