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