@shopify/app-bridge-react 3.7.11-snapshot-20240220213625 → 4.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.
Files changed (121) hide show
  1. package/LICENSE.md +7 -0
  2. package/README.md +98 -128
  3. package/dist/index.cjs +28 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.ts +88 -0
  6. package/dist/index.js +700 -0
  7. package/dist/index.js.map +1 -0
  8. package/package.json +45 -42
  9. package/components/ClientRouter/ClientRouter.d.ts +0 -23
  10. package/components/ClientRouter/ClientRouter.js +0 -52
  11. package/components/ClientRouter/hook.d.ts +0 -10
  12. package/components/ClientRouter/hook.js +0 -20
  13. package/components/ClientRouter/index.d.ts +0 -3
  14. package/components/ClientRouter/index.js +0 -10
  15. package/components/ClientRouter/router.d.ts +0 -5
  16. package/components/ClientRouter/router.js +0 -11
  17. package/components/ContextualSaveBar/ContextualSaveBar.d.ts +0 -9
  18. package/components/ContextualSaveBar/ContextualSaveBar.js +0 -24
  19. package/components/ContextualSaveBar/index.d.ts +0 -3
  20. package/components/ContextualSaveBar/index.js +0 -7
  21. package/components/Loading/Loading.d.ts +0 -19
  22. package/components/Loading/Loading.js +0 -55
  23. package/components/Loading/index.d.ts +0 -2
  24. package/components/Loading/index.js +0 -7
  25. package/components/Modal/Modal.d.ts +0 -32
  26. package/components/Modal/Modal.js +0 -140
  27. package/components/Modal/ModalContent/ModalContent.d.ts +0 -24
  28. package/components/Modal/ModalContent/ModalContent.js +0 -61
  29. package/components/Modal/ModalContent/index.d.ts +0 -2
  30. package/components/Modal/ModalContent/index.js +0 -7
  31. package/components/Modal/index.d.ts +0 -4
  32. package/components/Modal/index.js +0 -10
  33. package/components/NavigationMenu/NavigationMenu.d.ts +0 -18
  34. package/components/NavigationMenu/NavigationMenu.js +0 -44
  35. package/components/NavigationMenu/index.d.ts +0 -3
  36. package/components/NavigationMenu/index.js +0 -7
  37. package/components/Provider/Provider.d.ts +0 -87
  38. package/components/Provider/Provider.js +0 -81
  39. package/components/Provider/index.d.ts +0 -3
  40. package/components/Provider/index.js +0 -7
  41. package/components/ResourcePicker/ResourcePicker.d.ts +0 -36
  42. package/components/ResourcePicker/ResourcePicker.js +0 -120
  43. package/components/ResourcePicker/index.d.ts +0 -3
  44. package/components/ResourcePicker/index.js +0 -7
  45. package/components/RoutePropagator/RoutePropagator.d.ts +0 -22
  46. package/components/RoutePropagator/RoutePropagator.js +0 -54
  47. package/components/RoutePropagator/globals.d.ts +0 -3
  48. package/components/RoutePropagator/globals.js +0 -15
  49. package/components/RoutePropagator/hook.d.ts +0 -10
  50. package/components/RoutePropagator/hook.js +0 -20
  51. package/components/RoutePropagator/index.d.ts +0 -3
  52. package/components/RoutePropagator/index.js +0 -10
  53. package/components/RoutePropagator/route-propagator.d.ts +0 -7
  54. package/components/RoutePropagator/route-propagator.js +0 -91
  55. package/components/TitleBar/TitleBar.d.ts +0 -27
  56. package/components/TitleBar/TitleBar.js +0 -107
  57. package/components/TitleBar/index.d.ts +0 -3
  58. package/components/TitleBar/index.js +0 -7
  59. package/components/Toast/Toast.d.ts +0 -38
  60. package/components/Toast/Toast.js +0 -67
  61. package/components/Toast/index.d.ts +0 -3
  62. package/components/Toast/index.js +0 -7
  63. package/components/index.d.ts +0 -11
  64. package/components/index.js +0 -37
  65. package/components/unstable_Picker/index.d.ts +0 -3
  66. package/components/unstable_Picker/index.js +0 -7
  67. package/components/unstable_Picker/unstable_Picker.d.ts +0 -13
  68. package/components/unstable_Picker/unstable_Picker.js +0 -85
  69. package/context.d.ts +0 -14
  70. package/context.js +0 -10
  71. package/hooks/index.d.ts +0 -10
  72. package/hooks/index.js +0 -21
  73. package/hooks/useAppBridgeState/index.d.ts +0 -1
  74. package/hooks/useAppBridgeState/index.js +0 -13
  75. package/hooks/useAppBridgeState/useAppBridgeState.d.ts +0 -10
  76. package/hooks/useAppBridgeState/useAppBridgeState.js +0 -89
  77. package/hooks/useAuthenticatedFetch/index.d.ts +0 -1
  78. package/hooks/useAuthenticatedFetch/index.js +0 -13
  79. package/hooks/useAuthenticatedFetch/useAuthenticatedFetch.d.ts +0 -11
  80. package/hooks/useAuthenticatedFetch/useAuthenticatedFetch.js +0 -22
  81. package/hooks/useContextualSaveBar/index.d.ts +0 -1
  82. package/hooks/useContextualSaveBar/index.js +0 -5
  83. package/hooks/useContextualSaveBar/useContextualSaveBar.d.ts +0 -10
  84. package/hooks/useContextualSaveBar/useContextualSaveBar.js +0 -85
  85. package/hooks/useFeatureRequest/index.d.ts +0 -1
  86. package/hooks/useFeatureRequest/index.js +0 -13
  87. package/hooks/useFeatureRequest/useFeatureRequest.d.ts +0 -13
  88. package/hooks/useFeatureRequest/useFeatureRequest.js +0 -49
  89. package/hooks/useFeaturesAvailable/index.d.ts +0 -2
  90. package/hooks/useFeaturesAvailable/index.js +0 -5
  91. package/hooks/useFeaturesAvailable/useFeaturesAvailable.d.ts +0 -12
  92. package/hooks/useFeaturesAvailable/useFeaturesAvailable.js +0 -101
  93. package/hooks/useLocale/index.d.ts +0 -1
  94. package/hooks/useLocale/index.js +0 -5
  95. package/hooks/useLocale/useLocale.d.ts +0 -1
  96. package/hooks/useLocale/useLocale.js +0 -8
  97. package/hooks/useNavigate/index.d.ts +0 -1
  98. package/hooks/useNavigate/index.js +0 -5
  99. package/hooks/useNavigate/useNavigate.d.ts +0 -3
  100. package/hooks/useNavigate/useNavigate.js +0 -63
  101. package/hooks/useNavigationHistory/index.d.ts +0 -1
  102. package/hooks/useNavigationHistory/index.js +0 -5
  103. package/hooks/useNavigationHistory/useNavigationHistory.d.ts +0 -16
  104. package/hooks/useNavigationHistory/useNavigationHistory.js +0 -28
  105. package/hooks/useOnceEffect/index.d.ts +0 -1
  106. package/hooks/useOnceEffect/index.js +0 -13
  107. package/hooks/useOnceEffect/useOnceEffect.d.ts +0 -5
  108. package/hooks/useOnceEffect/useOnceEffect.js +0 -11
  109. package/hooks/useToast/index.d.ts +0 -1
  110. package/hooks/useToast/index.js +0 -5
  111. package/hooks/useToast/useToast.d.ts +0 -20
  112. package/hooks/useToast/useToast.js +0 -46
  113. package/index.d.ts +0 -4
  114. package/index.js +0 -19
  115. package/types.d.ts +0 -35
  116. package/types.js +0 -5
  117. package/umd/index.js +0 -10
  118. package/useAppBridge.d.ts +0 -1
  119. package/useAppBridge.js +0 -13
  120. package/utilities/transformers.d.ts +0 -20
  121. package/utilities/transformers.js +0 -105
package/dist/index.js ADDED
@@ -0,0 +1,700 @@
1
+ import Pe, { forwardRef as sr, useState as lr, Children as fr, useEffect as B } from "react";
2
+ import cr from "react-dom";
3
+ var H = { exports: {} }, $ = {};
4
+ /**
5
+ * @license React
6
+ * react-jsx-runtime.production.min.js
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var we;
14
+ function dr() {
15
+ if (we)
16
+ return $;
17
+ we = 1;
18
+ var A = Pe, E = Symbol.for("react.element"), w = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, P = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, S = { key: !0, ref: !0, __self: !0, __source: !0 };
19
+ function b(s, c, C) {
20
+ var d, g = {}, v = null, _ = null;
21
+ C !== void 0 && (v = "" + C), c.key !== void 0 && (v = "" + c.key), c.ref !== void 0 && (_ = c.ref);
22
+ for (d in c)
23
+ m.call(c, d) && !S.hasOwnProperty(d) && (g[d] = c[d]);
24
+ if (s && s.defaultProps)
25
+ for (d in c = s.defaultProps, c)
26
+ g[d] === void 0 && (g[d] = c[d]);
27
+ return { $$typeof: E, type: s, key: v, ref: _, props: g, _owner: P.current };
28
+ }
29
+ return $.Fragment = w, $.jsx = b, $.jsxs = b, $;
30
+ }
31
+ var W = {};
32
+ /**
33
+ * @license React
34
+ * react-jsx-runtime.development.js
35
+ *
36
+ * Copyright (c) Facebook, Inc. and its affiliates.
37
+ *
38
+ * This source code is licensed under the MIT license found in the
39
+ * LICENSE file in the root directory of this source tree.
40
+ */
41
+ var Ce;
42
+ function vr() {
43
+ return Ce || (Ce = 1, process.env.NODE_ENV !== "production" && function() {
44
+ var A = Pe, E = Symbol.for("react.element"), w = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), S = Symbol.for("react.profiler"), b = Symbol.for("react.provider"), s = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), d = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), _ = Symbol.for("react.offscreen"), x = Symbol.iterator, Q = "@@iterator";
45
+ function Se(e) {
46
+ if (e === null || typeof e != "object")
47
+ return null;
48
+ var r = x && e[x] || e[Q];
49
+ return typeof r == "function" ? r : null;
50
+ }
51
+ var j = A.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
+ function p(e) {
53
+ {
54
+ for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
55
+ t[n - 1] = arguments[n];
56
+ xe("error", e, t);
57
+ }
58
+ }
59
+ function xe(e, r, t) {
60
+ {
61
+ var n = j.ReactDebugCurrentFrame, o = n.getStackAddendum();
62
+ o !== "" && (r += "%s", t = t.concat([o]));
63
+ var u = t.map(function(i) {
64
+ return String(i);
65
+ });
66
+ u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
67
+ }
68
+ }
69
+ var je = !1, ke = !1, De = !1, Ae = !1, Fe = !1, ee;
70
+ ee = Symbol.for("react.module.reference");
71
+ function Ie(e) {
72
+ return !!(typeof e == "string" || typeof e == "function" || e === m || e === S || Fe || e === P || e === C || e === d || Ae || e === _ || je || ke || De || typeof e == "object" && e !== null && (e.$$typeof === v || e.$$typeof === g || e.$$typeof === b || e.$$typeof === s || e.$$typeof === c || // This needs to include all possible module reference object
73
+ // types supported by any Flight configuration anywhere since
74
+ // we don't know which Flight build this will end up being used
75
+ // with.
76
+ e.$$typeof === ee || e.getModuleId !== void 0));
77
+ }
78
+ function $e(e, r, t) {
79
+ var n = e.displayName;
80
+ if (n)
81
+ return n;
82
+ var o = r.displayName || r.name || "";
83
+ return o !== "" ? t + "(" + o + ")" : t;
84
+ }
85
+ function re(e) {
86
+ return e.displayName || "Context";
87
+ }
88
+ function R(e) {
89
+ if (e == null)
90
+ return null;
91
+ if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
92
+ return e.displayName || e.name || null;
93
+ if (typeof e == "string")
94
+ return e;
95
+ switch (e) {
96
+ case m:
97
+ return "Fragment";
98
+ case w:
99
+ return "Portal";
100
+ case S:
101
+ return "Profiler";
102
+ case P:
103
+ return "StrictMode";
104
+ case C:
105
+ return "Suspense";
106
+ case d:
107
+ return "SuspenseList";
108
+ }
109
+ if (typeof e == "object")
110
+ switch (e.$$typeof) {
111
+ case s:
112
+ var r = e;
113
+ return re(r) + ".Consumer";
114
+ case b:
115
+ var t = e;
116
+ return re(t._context) + ".Provider";
117
+ case c:
118
+ return $e(e, e.render, "ForwardRef");
119
+ case g:
120
+ var n = e.displayName || null;
121
+ return n !== null ? n : R(e.type) || "Memo";
122
+ case v: {
123
+ var o = e, u = o._payload, i = o._init;
124
+ try {
125
+ return R(i(u));
126
+ } catch {
127
+ return null;
128
+ }
129
+ }
130
+ }
131
+ return null;
132
+ }
133
+ var O = Object.assign, F = 0, te, ne, ae, ie, oe, ue, se;
134
+ function le() {
135
+ }
136
+ le.__reactDisabledLog = !0;
137
+ function We() {
138
+ {
139
+ if (F === 0) {
140
+ te = console.log, ne = console.info, ae = console.warn, ie = console.error, oe = console.group, ue = console.groupCollapsed, se = console.groupEnd;
141
+ var e = {
142
+ configurable: !0,
143
+ enumerable: !0,
144
+ value: le,
145
+ writable: !0
146
+ };
147
+ Object.defineProperties(console, {
148
+ info: e,
149
+ log: e,
150
+ warn: e,
151
+ error: e,
152
+ group: e,
153
+ groupCollapsed: e,
154
+ groupEnd: e
155
+ });
156
+ }
157
+ F++;
158
+ }
159
+ }
160
+ function Ye() {
161
+ {
162
+ if (F--, F === 0) {
163
+ var e = {
164
+ configurable: !0,
165
+ enumerable: !0,
166
+ writable: !0
167
+ };
168
+ Object.defineProperties(console, {
169
+ log: O({}, e, {
170
+ value: te
171
+ }),
172
+ info: O({}, e, {
173
+ value: ne
174
+ }),
175
+ warn: O({}, e, {
176
+ value: ae
177
+ }),
178
+ error: O({}, e, {
179
+ value: ie
180
+ }),
181
+ group: O({}, e, {
182
+ value: oe
183
+ }),
184
+ groupCollapsed: O({}, e, {
185
+ value: ue
186
+ }),
187
+ groupEnd: O({}, e, {
188
+ value: se
189
+ })
190
+ });
191
+ }
192
+ F < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
193
+ }
194
+ }
195
+ var U = j.ReactCurrentDispatcher, q;
196
+ function Y(e, r, t) {
197
+ {
198
+ if (q === void 0)
199
+ try {
200
+ throw Error();
201
+ } catch (o) {
202
+ var n = o.stack.trim().match(/\n( *(at )?)/);
203
+ q = n && n[1] || "";
204
+ }
205
+ return `
206
+ ` + q + e;
207
+ }
208
+ }
209
+ var J = !1, L;
210
+ {
211
+ var Le = typeof WeakMap == "function" ? WeakMap : Map;
212
+ L = new Le();
213
+ }
214
+ function fe(e, r) {
215
+ if (!e || J)
216
+ return "";
217
+ {
218
+ var t = L.get(e);
219
+ if (t !== void 0)
220
+ return t;
221
+ }
222
+ var n;
223
+ J = !0;
224
+ var o = Error.prepareStackTrace;
225
+ Error.prepareStackTrace = void 0;
226
+ var u;
227
+ u = U.current, U.current = null, We();
228
+ try {
229
+ if (r) {
230
+ var i = function() {
231
+ throw Error();
232
+ };
233
+ if (Object.defineProperty(i.prototype, "props", {
234
+ set: function() {
235
+ throw Error();
236
+ }
237
+ }), typeof Reflect == "object" && Reflect.construct) {
238
+ try {
239
+ Reflect.construct(i, []);
240
+ } catch (T) {
241
+ n = T;
242
+ }
243
+ Reflect.construct(e, [], i);
244
+ } else {
245
+ try {
246
+ i.call();
247
+ } catch (T) {
248
+ n = T;
249
+ }
250
+ e.call(i.prototype);
251
+ }
252
+ } else {
253
+ try {
254
+ throw Error();
255
+ } catch (T) {
256
+ n = T;
257
+ }
258
+ e();
259
+ }
260
+ } catch (T) {
261
+ if (T && n && typeof T.stack == "string") {
262
+ for (var a = T.stack.split(`
263
+ `), h = n.stack.split(`
264
+ `), l = a.length - 1, f = h.length - 1; l >= 1 && f >= 0 && a[l] !== h[f]; )
265
+ f--;
266
+ for (; l >= 1 && f >= 0; l--, f--)
267
+ if (a[l] !== h[f]) {
268
+ if (l !== 1 || f !== 1)
269
+ do
270
+ if (l--, f--, f < 0 || a[l] !== h[f]) {
271
+ var y = `
272
+ ` + a[l].replace(" at new ", " at ");
273
+ return e.displayName && y.includes("<anonymous>") && (y = y.replace("<anonymous>", e.displayName)), typeof e == "function" && L.set(e, y), y;
274
+ }
275
+ while (l >= 1 && f >= 0);
276
+ break;
277
+ }
278
+ }
279
+ } finally {
280
+ J = !1, U.current = u, Ye(), Error.prepareStackTrace = o;
281
+ }
282
+ var D = e ? e.displayName || e.name : "", Te = D ? Y(D) : "";
283
+ return typeof e == "function" && L.set(e, Te), Te;
284
+ }
285
+ function Me(e, r, t) {
286
+ return fe(e, !1);
287
+ }
288
+ function Ne(e) {
289
+ var r = e.prototype;
290
+ return !!(r && r.isReactComponent);
291
+ }
292
+ function M(e, r, t) {
293
+ if (e == null)
294
+ return "";
295
+ if (typeof e == "function")
296
+ return fe(e, Ne(e));
297
+ if (typeof e == "string")
298
+ return Y(e);
299
+ switch (e) {
300
+ case C:
301
+ return Y("Suspense");
302
+ case d:
303
+ return Y("SuspenseList");
304
+ }
305
+ if (typeof e == "object")
306
+ switch (e.$$typeof) {
307
+ case c:
308
+ return Me(e.render);
309
+ case g:
310
+ return M(e.type, r, t);
311
+ case v: {
312
+ var n = e, o = n._payload, u = n._init;
313
+ try {
314
+ return M(u(o), r, t);
315
+ } catch {
316
+ }
317
+ }
318
+ }
319
+ return "";
320
+ }
321
+ var N = Object.prototype.hasOwnProperty, ce = {}, de = j.ReactDebugCurrentFrame;
322
+ function V(e) {
323
+ if (e) {
324
+ var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
325
+ de.setExtraStackFrame(t);
326
+ } else
327
+ de.setExtraStackFrame(null);
328
+ }
329
+ function Ve(e, r, t, n, o) {
330
+ {
331
+ var u = Function.call.bind(N);
332
+ for (var i in e)
333
+ if (u(e, i)) {
334
+ var a = void 0;
335
+ try {
336
+ if (typeof e[i] != "function") {
337
+ var h = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
338
+ throw h.name = "Invariant Violation", h;
339
+ }
340
+ a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
341
+ } catch (l) {
342
+ a = l;
343
+ }
344
+ a && !(a instanceof Error) && (V(o), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), V(null)), a instanceof Error && !(a.message in ce) && (ce[a.message] = !0, V(o), p("Failed %s type: %s", t, a.message), V(null));
345
+ }
346
+ }
347
+ }
348
+ var Be = Array.isArray;
349
+ function G(e) {
350
+ return Be(e);
351
+ }
352
+ function Ue(e) {
353
+ {
354
+ var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
355
+ return t;
356
+ }
357
+ }
358
+ function qe(e) {
359
+ try {
360
+ return ve(e), !1;
361
+ } catch {
362
+ return !0;
363
+ }
364
+ }
365
+ function ve(e) {
366
+ return "" + e;
367
+ }
368
+ function pe(e) {
369
+ if (qe(e))
370
+ return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ue(e)), ve(e);
371
+ }
372
+ var I = j.ReactCurrentOwner, Je = {
373
+ key: !0,
374
+ ref: !0,
375
+ __self: !0,
376
+ __source: !0
377
+ }, he, ye, z;
378
+ z = {};
379
+ function Ge(e) {
380
+ if (N.call(e, "ref")) {
381
+ var r = Object.getOwnPropertyDescriptor(e, "ref").get;
382
+ if (r && r.isReactWarning)
383
+ return !1;
384
+ }
385
+ return e.ref !== void 0;
386
+ }
387
+ function ze(e) {
388
+ if (N.call(e, "key")) {
389
+ var r = Object.getOwnPropertyDescriptor(e, "key").get;
390
+ if (r && r.isReactWarning)
391
+ return !1;
392
+ }
393
+ return e.key !== void 0;
394
+ }
395
+ function Ke(e, r) {
396
+ if (typeof e.ref == "string" && I.current && r && I.current.stateNode !== r) {
397
+ var t = R(I.current.type);
398
+ z[t] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', R(I.current.type), e.ref), z[t] = !0);
399
+ }
400
+ }
401
+ function Xe(e, r) {
402
+ {
403
+ var t = function() {
404
+ he || (he = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
405
+ };
406
+ t.isReactWarning = !0, Object.defineProperty(e, "key", {
407
+ get: t,
408
+ configurable: !0
409
+ });
410
+ }
411
+ }
412
+ function Ze(e, r) {
413
+ {
414
+ var t = function() {
415
+ ye || (ye = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
416
+ };
417
+ t.isReactWarning = !0, Object.defineProperty(e, "ref", {
418
+ get: t,
419
+ configurable: !0
420
+ });
421
+ }
422
+ }
423
+ var He = function(e, r, t, n, o, u, i) {
424
+ var a = {
425
+ // This tag allows us to uniquely identify this as a React Element
426
+ $$typeof: E,
427
+ // Built-in properties that belong on the element
428
+ type: e,
429
+ key: r,
430
+ ref: t,
431
+ props: i,
432
+ // Record the component responsible for creating this element.
433
+ _owner: u
434
+ };
435
+ return a._store = {}, Object.defineProperty(a._store, "validated", {
436
+ configurable: !1,
437
+ enumerable: !1,
438
+ writable: !0,
439
+ value: !1
440
+ }), Object.defineProperty(a, "_self", {
441
+ configurable: !1,
442
+ enumerable: !1,
443
+ writable: !1,
444
+ value: n
445
+ }), Object.defineProperty(a, "_source", {
446
+ configurable: !1,
447
+ enumerable: !1,
448
+ writable: !1,
449
+ value: o
450
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
451
+ };
452
+ function Qe(e, r, t, n, o) {
453
+ {
454
+ var u, i = {}, a = null, h = null;
455
+ t !== void 0 && (pe(t), a = "" + t), ze(r) && (pe(r.key), a = "" + r.key), Ge(r) && (h = r.ref, Ke(r, o));
456
+ for (u in r)
457
+ N.call(r, u) && !Je.hasOwnProperty(u) && (i[u] = r[u]);
458
+ if (e && e.defaultProps) {
459
+ var l = e.defaultProps;
460
+ for (u in l)
461
+ i[u] === void 0 && (i[u] = l[u]);
462
+ }
463
+ if (a || h) {
464
+ var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
465
+ a && Xe(i, f), h && Ze(i, f);
466
+ }
467
+ return He(e, a, h, o, n, I.current, i);
468
+ }
469
+ }
470
+ var K = j.ReactCurrentOwner, me = j.ReactDebugCurrentFrame;
471
+ function k(e) {
472
+ if (e) {
473
+ var r = e._owner, t = M(e.type, e._source, r ? r.type : null);
474
+ me.setExtraStackFrame(t);
475
+ } else
476
+ me.setExtraStackFrame(null);
477
+ }
478
+ var X;
479
+ X = !1;
480
+ function Z(e) {
481
+ return typeof e == "object" && e !== null && e.$$typeof === E;
482
+ }
483
+ function ge() {
484
+ {
485
+ if (K.current) {
486
+ var e = R(K.current.type);
487
+ if (e)
488
+ return `
489
+
490
+ Check the render method of \`` + e + "`.";
491
+ }
492
+ return "";
493
+ }
494
+ }
495
+ function er(e) {
496
+ {
497
+ if (e !== void 0) {
498
+ var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
499
+ return `
500
+
501
+ Check your code at ` + r + ":" + t + ".";
502
+ }
503
+ return "";
504
+ }
505
+ }
506
+ var Ee = {};
507
+ function rr(e) {
508
+ {
509
+ var r = ge();
510
+ if (!r) {
511
+ var t = typeof e == "string" ? e : e.displayName || e.name;
512
+ t && (r = `
513
+
514
+ Check the top-level render call using <` + t + ">.");
515
+ }
516
+ return r;
517
+ }
518
+ }
519
+ function be(e, r) {
520
+ {
521
+ if (!e._store || e._store.validated || e.key != null)
522
+ return;
523
+ e._store.validated = !0;
524
+ var t = rr(r);
525
+ if (Ee[t])
526
+ return;
527
+ Ee[t] = !0;
528
+ var n = "";
529
+ e && e._owner && e._owner !== K.current && (n = " It was passed a child from " + R(e._owner.type) + "."), k(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), k(null);
530
+ }
531
+ }
532
+ function _e(e, r) {
533
+ {
534
+ if (typeof e != "object")
535
+ return;
536
+ if (G(e))
537
+ for (var t = 0; t < e.length; t++) {
538
+ var n = e[t];
539
+ Z(n) && be(n, r);
540
+ }
541
+ else if (Z(e))
542
+ e._store && (e._store.validated = !0);
543
+ else if (e) {
544
+ var o = Se(e);
545
+ if (typeof o == "function" && o !== e.entries)
546
+ for (var u = o.call(e), i; !(i = u.next()).done; )
547
+ Z(i.value) && be(i.value, r);
548
+ }
549
+ }
550
+ }
551
+ function tr(e) {
552
+ {
553
+ var r = e.type;
554
+ if (r == null || typeof r == "string")
555
+ return;
556
+ var t;
557
+ if (typeof r == "function")
558
+ t = r.propTypes;
559
+ else if (typeof r == "object" && (r.$$typeof === c || // Note: Memo only checks outer props here.
560
+ // Inner props are checked in the reconciler.
561
+ r.$$typeof === g))
562
+ t = r.propTypes;
563
+ else
564
+ return;
565
+ if (t) {
566
+ var n = R(r);
567
+ Ve(t, e.props, "prop", n, e);
568
+ } else if (r.PropTypes !== void 0 && !X) {
569
+ X = !0;
570
+ var o = R(r);
571
+ p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
572
+ }
573
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
574
+ }
575
+ }
576
+ function nr(e) {
577
+ {
578
+ for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
579
+ var n = r[t];
580
+ if (n !== "children" && n !== "key") {
581
+ k(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
582
+ break;
583
+ }
584
+ }
585
+ e.ref !== null && (k(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
586
+ }
587
+ }
588
+ function Re(e, r, t, n, o, u) {
589
+ {
590
+ var i = Ie(e);
591
+ if (!i) {
592
+ var a = "";
593
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
+ var h = er(o);
595
+ h ? a += h : a += ge();
596
+ var l;
597
+ e === null ? l = "null" : G(e) ? l = "array" : e !== void 0 && e.$$typeof === E ? (l = "<" + (R(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : l = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", l, a);
598
+ }
599
+ var f = Qe(e, r, t, o, u);
600
+ if (f == null)
601
+ return f;
602
+ if (i) {
603
+ var y = r.children;
604
+ if (y !== void 0)
605
+ if (n)
606
+ if (G(y)) {
607
+ for (var D = 0; D < y.length; D++)
608
+ _e(y[D], e);
609
+ Object.freeze && Object.freeze(y);
610
+ } else
611
+ p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
612
+ else
613
+ _e(y, e);
614
+ }
615
+ return e === m ? nr(f) : tr(f), f;
616
+ }
617
+ }
618
+ function ar(e, r, t) {
619
+ return Re(e, r, t, !0);
620
+ }
621
+ function ir(e, r, t) {
622
+ return Re(e, r, t, !1);
623
+ }
624
+ var or = ir, ur = ar;
625
+ W.Fragment = m, W.jsx = or, W.jsxs = ur;
626
+ }()), W;
627
+ }
628
+ process.env.NODE_ENV === "production" ? H.exports = dr() : H.exports = vr();
629
+ var Oe = H.exports;
630
+ const pr = sr(function({ open: E, onShow: w, onHide: m, children: P, ...S }, b) {
631
+ const [s, c] = lr(), { titleBar: C, modalContent: d } = fr.toArray(P).reduce(
632
+ (v, _) => {
633
+ const x = typeof _ == "object" && "type" in _ ? _.type : void 0;
634
+ return x === "ui-title-bar" || typeof x == "object" && x.displayName === "ui-title-bar" ? {
635
+ ...v,
636
+ titleBar: _
637
+ } : (v.modalContent.push(_), v);
638
+ },
639
+ { modalContent: [] }
640
+ ), g = s ? cr.createPortal(d, s.content) : null;
641
+ return B(() => {
642
+ s && (E ? s.show() : s.hide());
643
+ }, [s, E]), B(() => {
644
+ if (!(!s || !w))
645
+ return s.addEventListener("show", w), () => {
646
+ s.removeEventListener("show", w);
647
+ };
648
+ }, [s, w]), B(() => {
649
+ if (!(!s || !m))
650
+ return s.addEventListener("hide", m), () => {
651
+ s.removeEventListener("hide", m);
652
+ };
653
+ }, [s, m]), B(() => {
654
+ if (s)
655
+ return () => {
656
+ s.hide();
657
+ };
658
+ }, [s]), /* @__PURE__ */ Oe.jsxs(
659
+ "ui-modal",
660
+ {
661
+ ...S,
662
+ ref: (v) => {
663
+ c(v), b && (typeof b == "function" ? b(v) : b.current = v);
664
+ },
665
+ children: [
666
+ C,
667
+ /* @__PURE__ */ Oe.jsx("div", { children: g })
668
+ ]
669
+ }
670
+ );
671
+ });
672
+ pr.displayName = "ui-modal";
673
+ const gr = "ui-nav-menu", Er = "ui-title-bar", hr = new Proxy(
674
+ {},
675
+ {
676
+ get(A, E) {
677
+ throw Error(
678
+ `shopify.${String(
679
+ E
680
+ )} can't be used in a server environment. You likely need to move this code into an Effect.`
681
+ );
682
+ }
683
+ }
684
+ );
685
+ function br() {
686
+ if (typeof window > "u")
687
+ return hr;
688
+ if (!window.shopify)
689
+ throw Error(
690
+ "The shopify global is not defined. This likely means the App Bridge script tag was not added correctly to this page"
691
+ );
692
+ return window.shopify;
693
+ }
694
+ export {
695
+ pr as Modal,
696
+ gr as NavMenu,
697
+ Er as TitleBar,
698
+ br as useAppBridge
699
+ };
700
+ //# sourceMappingURL=index.js.map