styllar-react-plugin 1.0.0 → 1.0.1

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.
@@ -1,5 +1,5 @@
1
- import $e, { useState as F } from "react";
2
- var ue = { exports: {} }, B = {};
1
+ import ze, { useState as F, useEffect as fr } from "react";
2
+ var fe = { exports: {} }, J = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.min.js
@@ -10,20 +10,20 @@ var ue = { exports: {} }, B = {};
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
12
  var Ae;
13
- function fr() {
14
- if (Ae) return B;
13
+ function dr() {
14
+ if (Ae) return J;
15
15
  Ae = 1;
16
- var $ = $e, O = Symbol.for("react.element"), k = Symbol.for("react.fragment"), y = Object.prototype.hasOwnProperty, W = $.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, L = { key: !0, ref: !0, __self: !0, __source: !0 };
17
- function S(w, d, P) {
18
- var v, E = {}, j = null, Y = null;
19
- P !== void 0 && (j = "" + P), d.key !== void 0 && (j = "" + d.key), d.ref !== void 0 && (Y = d.ref);
20
- for (v in d) y.call(d, v) && !L.hasOwnProperty(v) && (E[v] = d[v]);
21
- if (w && w.defaultProps) for (v in d = w.defaultProps, d) E[v] === void 0 && (E[v] = d[v]);
22
- return { $$typeof: O, type: w, key: j, ref: Y, props: E, _owner: W.current };
16
+ var z = ze, k = Symbol.for("react.element"), P = Symbol.for("react.fragment"), R = Object.prototype.hasOwnProperty, $ = z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, W = { key: !0, ref: !0, __self: !0, __source: !0 };
17
+ function C(j, v, N) {
18
+ var p, S = {}, T = null, L = null;
19
+ N !== void 0 && (T = "" + N), v.key !== void 0 && (T = "" + v.key), v.ref !== void 0 && (L = v.ref);
20
+ for (p in v) R.call(v, p) && !W.hasOwnProperty(p) && (S[p] = v[p]);
21
+ if (j && j.defaultProps) for (p in v = j.defaultProps, v) S[p] === void 0 && (S[p] = v[p]);
22
+ return { $$typeof: k, type: j, key: T, ref: L, props: S, _owner: $.current };
23
23
  }
24
- return B.Fragment = k, B.jsx = S, B.jsxs = S, B;
24
+ return J.Fragment = P, J.jsx = C, J.jsxs = C, J;
25
25
  }
26
- var J = {};
26
+ var K = {};
27
27
  /**
28
28
  * @license React
29
29
  * react-jsx-runtime.development.js
@@ -34,17 +34,17 @@ var J = {};
34
34
  * LICENSE file in the root directory of this source tree.
35
35
  */
36
36
  var Ie;
37
- function dr() {
37
+ function vr() {
38
38
  return Ie || (Ie = 1, process.env.NODE_ENV !== "production" && function() {
39
- var $ = $e, O = Symbol.for("react.element"), k = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), S = Symbol.for("react.provider"), w = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), E = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), Y = Symbol.for("react.offscreen"), U = Symbol.iterator, Q = "@@iterator";
39
+ var z = ze, k = Symbol.for("react.element"), P = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), $ = Symbol.for("react.strict_mode"), W = Symbol.for("react.profiler"), C = Symbol.for("react.provider"), j = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), p = Symbol.for("react.suspense_list"), S = Symbol.for("react.memo"), T = Symbol.for("react.lazy"), L = Symbol.for("react.offscreen"), U = Symbol.iterator, Q = "@@iterator";
40
40
  function ee(e) {
41
41
  if (e === null || typeof e != "object")
42
42
  return null;
43
43
  var r = U && e[U] || e[Q];
44
44
  return typeof r == "function" ? r : null;
45
45
  }
46
- var N = $.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
- function p(e) {
46
+ var O = z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
47
+ function m(e) {
48
48
  {
49
49
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
50
50
  t[n - 1] = arguments[n];
@@ -53,71 +53,71 @@ function dr() {
53
53
  }
54
54
  function re(e, r, t) {
55
55
  {
56
- var n = N.ReactDebugCurrentFrame, i = n.getStackAddendum();
57
- i !== "" && (r += "%s", t = t.concat([i]));
58
- var c = t.map(function(o) {
59
- return String(o);
56
+ var n = O.ReactDebugCurrentFrame, s = n.getStackAddendum();
57
+ s !== "" && (r += "%s", t = t.concat([s]));
58
+ var c = t.map(function(i) {
59
+ return String(i);
60
60
  });
61
61
  c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
62
62
  }
63
63
  }
64
- var l = !1, x = !1, g = !1, T = !1, C = !1, R;
65
- R = Symbol.for("react.module.reference");
66
- function b(e) {
67
- return !!(typeof e == "string" || typeof e == "function" || e === y || e === L || C || e === W || e === P || e === v || T || e === Y || l || x || g || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === E || e.$$typeof === S || e.$$typeof === w || e.$$typeof === d || // This needs to include all possible module reference object
64
+ var te = !1, o = !1, h = !1, f = !1, y = !1, g;
65
+ g = Symbol.for("react.module.reference");
66
+ function _(e) {
67
+ return !!(typeof e == "string" || typeof e == "function" || e === R || e === W || y || e === $ || e === N || e === p || f || e === L || te || o || h || typeof e == "object" && e !== null && (e.$$typeof === T || e.$$typeof === S || e.$$typeof === C || e.$$typeof === j || e.$$typeof === v || // This needs to include all possible module reference object
68
68
  // types supported by any Flight configuration anywhere since
69
69
  // we don't know which Flight build this will end up being used
70
70
  // with.
71
- e.$$typeof === R || e.getModuleId !== void 0));
71
+ e.$$typeof === g || e.getModuleId !== void 0));
72
72
  }
73
- function K(e, r, t) {
73
+ function E(e, r, t) {
74
74
  var n = e.displayName;
75
75
  if (n)
76
76
  return n;
77
- var i = r.displayName || r.name || "";
78
- return i !== "" ? t + "(" + i + ")" : t;
77
+ var s = r.displayName || r.name || "";
78
+ return s !== "" ? t + "(" + s + ")" : t;
79
79
  }
80
- function fe(e) {
80
+ function V(e) {
81
81
  return e.displayName || "Context";
82
82
  }
83
83
  function D(e) {
84
84
  if (e == null)
85
85
  return null;
86
- 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")
86
+ if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
87
87
  return e.displayName || e.name || null;
88
88
  if (typeof e == "string")
89
89
  return e;
90
90
  switch (e) {
91
- case y:
91
+ case R:
92
92
  return "Fragment";
93
- case k:
93
+ case P:
94
94
  return "Portal";
95
- case L:
96
- return "Profiler";
97
95
  case W:
96
+ return "Profiler";
97
+ case $:
98
98
  return "StrictMode";
99
- case P:
99
+ case N:
100
100
  return "Suspense";
101
- case v:
101
+ case p:
102
102
  return "SuspenseList";
103
103
  }
104
104
  if (typeof e == "object")
105
105
  switch (e.$$typeof) {
106
- case w:
106
+ case j:
107
107
  var r = e;
108
- return fe(r) + ".Consumer";
109
- case S:
108
+ return V(r) + ".Consumer";
109
+ case C:
110
110
  var t = e;
111
- return fe(t._context) + ".Provider";
112
- case d:
113
- return K(e, e.render, "ForwardRef");
114
- case E:
111
+ return V(t._context) + ".Provider";
112
+ case v:
113
+ return E(e, e.render, "ForwardRef");
114
+ case S:
115
115
  var n = e.displayName || null;
116
116
  return n !== null ? n : D(e.type) || "Memo";
117
- case j: {
118
- var i = e, c = i._payload, o = i._init;
117
+ case T: {
118
+ var s = e, c = s._payload, i = s._init;
119
119
  try {
120
- return D(o(c));
120
+ return D(i(c));
121
121
  } catch {
122
122
  return null;
123
123
  }
@@ -125,14 +125,14 @@ function dr() {
125
125
  }
126
126
  return null;
127
127
  }
128
- var A = Object.assign, V = 0, de, ve, pe, ge, he, me, be;
128
+ var A = Object.assign, q = 0, de, ve, pe, me, ge, he, be;
129
129
  function ye() {
130
130
  }
131
131
  ye.__reactDisabledLog = !0;
132
- function We() {
132
+ function $e() {
133
133
  {
134
- if (V === 0) {
135
- de = console.log, ve = console.info, pe = console.warn, ge = console.error, he = console.group, me = console.groupCollapsed, be = console.groupEnd;
134
+ if (q === 0) {
135
+ de = console.log, ve = console.info, pe = console.warn, me = console.error, ge = console.group, he = console.groupCollapsed, be = console.groupEnd;
136
136
  var e = {
137
137
  configurable: !0,
138
138
  enumerable: !0,
@@ -149,12 +149,12 @@ function dr() {
149
149
  groupEnd: e
150
150
  });
151
151
  }
152
- V++;
152
+ q++;
153
153
  }
154
154
  }
155
- function Le() {
155
+ function We() {
156
156
  {
157
- if (V--, V === 0) {
157
+ if (q--, q === 0) {
158
158
  var e = {
159
159
  configurable: !0,
160
160
  enumerable: !0,
@@ -171,43 +171,43 @@ function dr() {
171
171
  value: pe
172
172
  }),
173
173
  error: A({}, e, {
174
- value: ge
174
+ value: me
175
175
  }),
176
176
  group: A({}, e, {
177
- value: he
177
+ value: ge
178
178
  }),
179
179
  groupCollapsed: A({}, e, {
180
- value: me
180
+ value: he
181
181
  }),
182
182
  groupEnd: A({}, e, {
183
183
  value: be
184
184
  })
185
185
  });
186
186
  }
187
- V < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
187
+ q < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
188
188
  }
189
189
  }
190
- var te = N.ReactCurrentDispatcher, ne;
190
+ var ne = O.ReactCurrentDispatcher, ae;
191
191
  function X(e, r, t) {
192
192
  {
193
- if (ne === void 0)
193
+ if (ae === void 0)
194
194
  try {
195
195
  throw Error();
196
- } catch (i) {
197
- var n = i.stack.trim().match(/\n( *(at )?)/);
198
- ne = n && n[1] || "";
196
+ } catch (s) {
197
+ var n = s.stack.trim().match(/\n( *(at )?)/);
198
+ ae = n && n[1] || "";
199
199
  }
200
200
  return `
201
- ` + ne + e;
201
+ ` + ae + e;
202
202
  }
203
203
  }
204
- var ae = !1, G;
204
+ var oe = !1, G;
205
205
  {
206
- var Ye = typeof WeakMap == "function" ? WeakMap : Map;
207
- G = new Ye();
206
+ var Le = typeof WeakMap == "function" ? WeakMap : Map;
207
+ G = new Le();
208
208
  }
209
209
  function xe(e, r) {
210
- if (!e || ae)
210
+ if (!e || oe)
211
211
  return "";
212
212
  {
213
213
  var t = G.get(e);
@@ -215,69 +215,69 @@ function dr() {
215
215
  return t;
216
216
  }
217
217
  var n;
218
- ae = !0;
219
- var i = Error.prepareStackTrace;
218
+ oe = !0;
219
+ var s = Error.prepareStackTrace;
220
220
  Error.prepareStackTrace = void 0;
221
221
  var c;
222
- c = te.current, te.current = null, We();
222
+ c = ne.current, ne.current = null, $e();
223
223
  try {
224
224
  if (r) {
225
- var o = function() {
225
+ var i = function() {
226
226
  throw Error();
227
227
  };
228
- if (Object.defineProperty(o.prototype, "props", {
228
+ if (Object.defineProperty(i.prototype, "props", {
229
229
  set: function() {
230
230
  throw Error();
231
231
  }
232
232
  }), typeof Reflect == "object" && Reflect.construct) {
233
233
  try {
234
- Reflect.construct(o, []);
235
- } catch (m) {
236
- n = m;
234
+ Reflect.construct(i, []);
235
+ } catch (x) {
236
+ n = x;
237
237
  }
238
- Reflect.construct(e, [], o);
238
+ Reflect.construct(e, [], i);
239
239
  } else {
240
240
  try {
241
- o.call();
242
- } catch (m) {
243
- n = m;
241
+ i.call();
242
+ } catch (x) {
243
+ n = x;
244
244
  }
245
- e.call(o.prototype);
245
+ e.call(i.prototype);
246
246
  }
247
247
  } else {
248
248
  try {
249
249
  throw Error();
250
- } catch (m) {
251
- n = m;
250
+ } catch (x) {
251
+ n = x;
252
252
  }
253
253
  e();
254
254
  }
255
- } catch (m) {
256
- if (m && n && typeof m.stack == "string") {
257
- for (var a = m.stack.split(`
258
- `), h = n.stack.split(`
259
- `), u = a.length - 1, f = h.length - 1; u >= 1 && f >= 0 && a[u] !== h[f]; )
260
- f--;
261
- for (; u >= 1 && f >= 0; u--, f--)
262
- if (a[u] !== h[f]) {
263
- if (u !== 1 || f !== 1)
255
+ } catch (x) {
256
+ if (x && n && typeof x.stack == "string") {
257
+ for (var a = x.stack.split(`
258
+ `), b = n.stack.split(`
259
+ `), u = a.length - 1, d = b.length - 1; u >= 1 && d >= 0 && a[u] !== b[d]; )
260
+ d--;
261
+ for (; u >= 1 && d >= 0; u--, d--)
262
+ if (a[u] !== b[d]) {
263
+ if (u !== 1 || d !== 1)
264
264
  do
265
- if (u--, f--, f < 0 || a[u] !== h[f]) {
266
- var _ = `
265
+ if (u--, d--, d < 0 || a[u] !== b[d]) {
266
+ var w = `
267
267
  ` + a[u].replace(" at new ", " at ");
268
- return e.displayName && _.includes("<anonymous>") && (_ = _.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, _), _;
268
+ return e.displayName && w.includes("<anonymous>") && (w = w.replace("<anonymous>", e.displayName)), typeof e == "function" && G.set(e, w), w;
269
269
  }
270
- while (u >= 1 && f >= 0);
270
+ while (u >= 1 && d >= 0);
271
271
  break;
272
272
  }
273
273
  }
274
274
  } finally {
275
- ae = !1, te.current = c, Le(), Error.prepareStackTrace = i;
275
+ oe = !1, ne.current = c, We(), Error.prepareStackTrace = s;
276
276
  }
277
277
  var M = e ? e.displayName || e.name : "", I = M ? X(M) : "";
278
278
  return typeof e == "function" && G.set(e, I), I;
279
279
  }
280
- function ze(e, r, t) {
280
+ function Ye(e, r, t) {
281
281
  return xe(e, !1);
282
282
  }
283
283
  function Me(e) {
@@ -292,28 +292,28 @@ function dr() {
292
292
  if (typeof e == "string")
293
293
  return X(e);
294
294
  switch (e) {
295
- case P:
295
+ case N:
296
296
  return X("Suspense");
297
- case v:
297
+ case p:
298
298
  return X("SuspenseList");
299
299
  }
300
300
  if (typeof e == "object")
301
301
  switch (e.$$typeof) {
302
- case d:
303
- return ze(e.render);
304
- case E:
302
+ case v:
303
+ return Ye(e.render);
304
+ case S:
305
305
  return H(e.type, r, t);
306
- case j: {
307
- var n = e, i = n._payload, c = n._init;
306
+ case T: {
307
+ var n = e, s = n._payload, c = n._init;
308
308
  try {
309
- return H(c(i), r, t);
309
+ return H(c(s), r, t);
310
310
  } catch {
311
311
  }
312
312
  }
313
313
  }
314
314
  return "";
315
315
  }
316
- var q = Object.prototype.hasOwnProperty, _e = {}, Ee = N.ReactDebugCurrentFrame;
316
+ var B = Object.prototype.hasOwnProperty, _e = {}, Ee = O.ReactDebugCurrentFrame;
317
317
  function Z(e) {
318
318
  if (e) {
319
319
  var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
@@ -321,27 +321,27 @@ function dr() {
321
321
  } else
322
322
  Ee.setExtraStackFrame(null);
323
323
  }
324
- function Ue(e, r, t, n, i) {
324
+ function Ue(e, r, t, n, s) {
325
325
  {
326
- var c = Function.call.bind(q);
327
- for (var o in e)
328
- if (c(e, o)) {
326
+ var c = Function.call.bind(B);
327
+ for (var i in e)
328
+ if (c(e, i)) {
329
329
  var a = void 0;
330
330
  try {
331
- if (typeof e[o] != "function") {
332
- var h = 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`.");
333
- throw h.name = "Invariant Violation", h;
331
+ if (typeof e[i] != "function") {
332
+ var b = 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`.");
333
+ throw b.name = "Invariant Violation", b;
334
334
  }
335
- a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
335
+ a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
336
336
  } catch (u) {
337
337
  a = u;
338
338
  }
339
- a && !(a instanceof Error) && (Z(i), 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 a), Z(null)), a instanceof Error && !(a.message in _e) && (_e[a.message] = !0, Z(i), p("Failed %s type: %s", t, a.message), Z(null));
339
+ a && !(a instanceof Error) && (Z(s), m("%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), Z(null)), a instanceof Error && !(a.message in _e) && (_e[a.message] = !0, Z(s), m("Failed %s type: %s", t, a.message), Z(null));
340
340
  }
341
341
  }
342
342
  }
343
343
  var Ve = Array.isArray;
344
- function oe(e) {
344
+ function ie(e) {
345
345
  return Ve(e);
346
346
  }
347
347
  function qe(e) {
@@ -362,16 +362,16 @@ function dr() {
362
362
  }
363
363
  function we(e) {
364
364
  if (Be(e))
365
- return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), Re(e);
365
+ return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", qe(e)), Re(e);
366
366
  }
367
- var je = N.ReactCurrentOwner, Je = {
367
+ var Se = O.ReactCurrentOwner, Je = {
368
368
  key: !0,
369
369
  ref: !0,
370
370
  __self: !0,
371
371
  __source: !0
372
- }, Se, Te;
372
+ }, je, Te;
373
373
  function Ke(e) {
374
- if (q.call(e, "ref")) {
374
+ if (B.call(e, "ref")) {
375
375
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
376
376
  if (r && r.isReactWarning)
377
377
  return !1;
@@ -379,7 +379,7 @@ function dr() {
379
379
  return e.ref !== void 0;
380
380
  }
381
381
  function Xe(e) {
382
- if (q.call(e, "key")) {
382
+ if (B.call(e, "key")) {
383
383
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
384
384
  if (r && r.isReactWarning)
385
385
  return !1;
@@ -387,12 +387,12 @@ function dr() {
387
387
  return e.key !== void 0;
388
388
  }
389
389
  function Ge(e, r) {
390
- typeof e.ref == "string" && je.current;
390
+ typeof e.ref == "string" && Se.current;
391
391
  }
392
392
  function He(e, r) {
393
393
  {
394
394
  var t = function() {
395
- Se || (Se = !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));
395
+ je || (je = !0, m("%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));
396
396
  };
397
397
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
398
398
  get: t,
@@ -403,7 +403,7 @@ function dr() {
403
403
  function Ze(e, r) {
404
404
  {
405
405
  var t = function() {
406
- Te || (Te = !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));
406
+ Te || (Te = !0, m("%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));
407
407
  };
408
408
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
409
409
  get: t,
@@ -411,15 +411,15 @@ function dr() {
411
411
  });
412
412
  }
413
413
  }
414
- var Qe = function(e, r, t, n, i, c, o) {
414
+ var Qe = function(e, r, t, n, s, c, i) {
415
415
  var a = {
416
416
  // This tag allows us to uniquely identify this as a React Element
417
- $$typeof: O,
417
+ $$typeof: k,
418
418
  // Built-in properties that belong on the element
419
419
  type: e,
420
420
  key: r,
421
421
  ref: t,
422
- props: o,
422
+ props: i,
423
423
  // Record the component responsible for creating this element.
424
424
  _owner: c
425
425
  };
@@ -437,44 +437,44 @@ function dr() {
437
437
  configurable: !1,
438
438
  enumerable: !1,
439
439
  writable: !1,
440
- value: i
440
+ value: s
441
441
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
442
442
  };
443
- function er(e, r, t, n, i) {
443
+ function er(e, r, t, n, s) {
444
444
  {
445
- var c, o = {}, a = null, h = null;
446
- t !== void 0 && (we(t), a = "" + t), Xe(r) && (we(r.key), a = "" + r.key), Ke(r) && (h = r.ref, Ge(r, i));
445
+ var c, i = {}, a = null, b = null;
446
+ t !== void 0 && (we(t), a = "" + t), Xe(r) && (we(r.key), a = "" + r.key), Ke(r) && (b = r.ref, Ge(r, s));
447
447
  for (c in r)
448
- q.call(r, c) && !Je.hasOwnProperty(c) && (o[c] = r[c]);
448
+ B.call(r, c) && !Je.hasOwnProperty(c) && (i[c] = r[c]);
449
449
  if (e && e.defaultProps) {
450
450
  var u = e.defaultProps;
451
451
  for (c in u)
452
- o[c] === void 0 && (o[c] = u[c]);
452
+ i[c] === void 0 && (i[c] = u[c]);
453
453
  }
454
- if (a || h) {
455
- var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
456
- a && He(o, f), h && Ze(o, f);
454
+ if (a || b) {
455
+ var d = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
456
+ a && He(i, d), b && Ze(i, d);
457
457
  }
458
- return Qe(e, a, h, i, n, je.current, o);
458
+ return Qe(e, a, b, s, n, Se.current, i);
459
459
  }
460
460
  }
461
- var ie = N.ReactCurrentOwner, Ce = N.ReactDebugCurrentFrame;
462
- function z(e) {
461
+ var se = O.ReactCurrentOwner, Ce = O.ReactDebugCurrentFrame;
462
+ function Y(e) {
463
463
  if (e) {
464
464
  var r = e._owner, t = H(e.type, e._source, r ? r.type : null);
465
465
  Ce.setExtraStackFrame(t);
466
466
  } else
467
467
  Ce.setExtraStackFrame(null);
468
468
  }
469
- var se;
470
- se = !1;
471
- function le(e) {
472
- return typeof e == "object" && e !== null && e.$$typeof === O;
469
+ var le;
470
+ le = !1;
471
+ function ce(e) {
472
+ return typeof e == "object" && e !== null && e.$$typeof === k;
473
473
  }
474
474
  function Oe() {
475
475
  {
476
- if (ie.current) {
477
- var e = D(ie.current.type);
476
+ if (se.current) {
477
+ var e = D(se.current.type);
478
478
  if (e)
479
479
  return `
480
480
 
@@ -509,25 +509,25 @@ Check the top-level render call using <` + t + ">.");
509
509
  return;
510
510
  ke[t] = !0;
511
511
  var n = "";
512
- e && e._owner && e._owner !== ie.current && (n = " It was passed a child from " + D(e._owner.type) + "."), z(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), z(null);
512
+ e && e._owner && e._owner !== se.current && (n = " It was passed a child from " + D(e._owner.type) + "."), Y(e), m('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), Y(null);
513
513
  }
514
514
  }
515
515
  function Ne(e, r) {
516
516
  {
517
517
  if (typeof e != "object")
518
518
  return;
519
- if (oe(e))
519
+ if (ie(e))
520
520
  for (var t = 0; t < e.length; t++) {
521
521
  var n = e[t];
522
- le(n) && Pe(n, r);
522
+ ce(n) && Pe(n, r);
523
523
  }
524
- else if (le(e))
524
+ else if (ce(e))
525
525
  e._store && (e._store.validated = !0);
526
526
  else if (e) {
527
- var i = ee(e);
528
- if (typeof i == "function" && i !== e.entries)
529
- for (var c = i.call(e), o; !(o = c.next()).done; )
530
- le(o.value) && Pe(o.value, r);
527
+ var s = ee(e);
528
+ if (typeof s == "function" && s !== e.entries)
529
+ for (var c = s.call(e), i; !(i = c.next()).done; )
530
+ ce(i.value) && Pe(i.value, r);
531
531
  }
532
532
  }
533
533
  }
@@ -539,21 +539,21 @@ Check the top-level render call using <` + t + ">.");
539
539
  var t;
540
540
  if (typeof r == "function")
541
541
  t = r.propTypes;
542
- else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
542
+ else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
543
543
  // Inner props are checked in the reconciler.
544
- r.$$typeof === E))
544
+ r.$$typeof === S))
545
545
  t = r.propTypes;
546
546
  else
547
547
  return;
548
548
  if (t) {
549
549
  var n = D(r);
550
550
  Ue(t, e.props, "prop", n, e);
551
- } else if (r.PropTypes !== void 0 && !se) {
552
- se = !0;
553
- var i = D(r);
554
- p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
551
+ } else if (r.PropTypes !== void 0 && !le) {
552
+ le = !0;
553
+ var s = D(r);
554
+ m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
555
555
  }
556
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
556
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
557
557
  }
558
558
  }
559
559
  function ar(e) {
@@ -561,56 +561,56 @@ Check the top-level render call using <` + t + ">.");
561
561
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
562
562
  var n = r[t];
563
563
  if (n !== "children" && n !== "key") {
564
- z(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), z(null);
564
+ Y(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), Y(null);
565
565
  break;
566
566
  }
567
567
  }
568
- e.ref !== null && (z(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
568
+ e.ref !== null && (Y(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), Y(null));
569
569
  }
570
570
  }
571
571
  var De = {};
572
- function Fe(e, r, t, n, i, c) {
572
+ function Fe(e, r, t, n, s, c) {
573
573
  {
574
- var o = b(e);
575
- if (!o) {
574
+ var i = _(e);
575
+ if (!i) {
576
576
  var a = "";
577
577
  (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.");
578
- var h = rr();
579
- h ? a += h : a += Oe();
578
+ var b = rr();
579
+ b ? a += b : a += Oe();
580
580
  var u;
581
- e === null ? u = "null" : oe(e) ? u = "array" : e !== void 0 && e.$$typeof === O ? (u = "<" + (D(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : u = 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", u, a);
581
+ e === null ? u = "null" : ie(e) ? u = "array" : e !== void 0 && e.$$typeof === k ? (u = "<" + (D(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : u = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", u, a);
582
582
  }
583
- var f = er(e, r, t, i, c);
584
- if (f == null)
585
- return f;
586
- if (o) {
587
- var _ = r.children;
588
- if (_ !== void 0)
583
+ var d = er(e, r, t, s, c);
584
+ if (d == null)
585
+ return d;
586
+ if (i) {
587
+ var w = r.children;
588
+ if (w !== void 0)
589
589
  if (n)
590
- if (oe(_)) {
591
- for (var M = 0; M < _.length; M++)
592
- Ne(_[M], e);
593
- Object.freeze && Object.freeze(_);
590
+ if (ie(w)) {
591
+ for (var M = 0; M < w.length; M++)
592
+ Ne(w[M], e);
593
+ Object.freeze && Object.freeze(w);
594
594
  } else
595
- 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.");
595
+ m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
596
596
  else
597
- Ne(_, e);
597
+ Ne(w, e);
598
598
  }
599
- if (q.call(r, "key")) {
600
- var I = D(e), m = Object.keys(r).filter(function(ur) {
599
+ if (B.call(r, "key")) {
600
+ var I = D(e), x = Object.keys(r).filter(function(ur) {
601
601
  return ur !== "key";
602
- }), ce = m.length > 0 ? "{key: someKey, " + m.join(": ..., ") + ": ...}" : "{key: someKey}";
603
- if (!De[I + ce]) {
604
- var cr = m.length > 0 ? "{" + m.join(": ..., ") + ": ...}" : "{}";
605
- p(`A props object containing a "key" prop is being spread into JSX:
602
+ }), ue = x.length > 0 ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}";
603
+ if (!De[I + ue]) {
604
+ var cr = x.length > 0 ? "{" + x.join(": ..., ") + ": ...}" : "{}";
605
+ m(`A props object containing a "key" prop is being spread into JSX:
606
606
  let props = %s;
607
607
  <%s {...props} />
608
608
  React keys must be passed directly to JSX without using spread:
609
609
  let props = %s;
610
- <%s key={someKey} {...props} />`, ce, I, cr, I), De[I + ce] = !0;
610
+ <%s key={someKey} {...props} />`, ue, I, cr, I), De[I + ue] = !0;
611
611
  }
612
612
  }
613
- return e === y ? ar(f) : nr(f), f;
613
+ return e === R ? ar(d) : nr(d), d;
614
614
  }
615
615
  }
616
616
  function or(e, r, t) {
@@ -620,157 +620,179 @@ React keys must be passed directly to JSX without using spread:
620
620
  return Fe(e, r, t, !1);
621
621
  }
622
622
  var sr = ir, lr = or;
623
- J.Fragment = y, J.jsx = sr, J.jsxs = lr;
624
- }()), J;
623
+ K.Fragment = R, K.jsx = sr, K.jsxs = lr;
624
+ }()), K;
625
625
  }
626
- process.env.NODE_ENV === "production" ? ue.exports = fr() : ue.exports = dr();
627
- var s = ue.exports;
628
- const pr = () => {
629
- const [$, O] = F(!1), [k, y] = F("idle"), [W, L] = F(""), [S, w] = F(null), [d, P] = F(""), [v, E] = F(""), [j, Y] = F(null), [U, Q] = F(null), ee = "http://136.113.197.77:5000/predict/size-from-chart";
630
- function N() {
631
- var R;
632
- let l = 0, x = 0;
633
- const g = ["pant", "jeans", "trouser", "skirt", "short", "legging", "jogger", "bottom", "denim", "cargo"], T = ["shirt", "top", "tee", "blouse", "jacket", "coat", "hoodie", "sweater", "vest", "cardigan", "dress", "t-shirt"], C = (document.title + " " + (((R = document.querySelector("h1")) == null ? void 0 : R.innerText) || "")).toLowerCase();
634
- return g.forEach((b) => {
635
- C.includes(b) && (x += 2);
636
- }), T.forEach((b) => {
637
- C.includes(b) && (l += 2);
638
- }), x > l ? "bottom" : "top";
626
+ process.env.NODE_ENV === "production" ? fe.exports = dr() : fe.exports = vr();
627
+ var l = fe.exports;
628
+ const mr = () => {
629
+ const [z, k] = F(!1), [P, R] = F("idle"), [$, W] = F(""), [C, j] = F(null), [v, N] = F(""), [p, S] = F(""), [T, L] = F(null), [U, Q] = F(null), ee = "http://136.113.197.77:5000/predict/size-from-chart", O = (o) => {
630
+ if (!o) return;
631
+ const h = () => {
632
+ const f = document.querySelectorAll('button, .size-swatch, .size-option, li[role="radio"], div[data-value]');
633
+ for (let y of f) {
634
+ const g = y.innerText.trim().toUpperCase(), _ = String(o).trim().toUpperCase();
635
+ if (g === _ || g === `SIZE ${_}`)
636
+ return y.click(), console.log(`Styllar: Successfully auto-selected size ${o}`), !0;
637
+ }
638
+ return !1;
639
+ };
640
+ if (!h()) {
641
+ let f = 0;
642
+ const y = setInterval(() => {
643
+ f++, (h() || f > 10) && clearInterval(y);
644
+ }, 500);
645
+ }
646
+ };
647
+ fr(() => {
648
+ typeof chrome < "u" && chrome.storage && chrome.storage.local.get(["styllar_last_size"], (o) => {
649
+ o.styllar_last_size && (console.log("Styllar: Found saved size:", o.styllar_last_size), setTimeout(() => O(o.styllar_last_size), 1e3));
650
+ });
651
+ }, []);
652
+ function m() {
653
+ var _;
654
+ let o = 0, h = 0;
655
+ const f = ["pant", "jeans", "trouser", "skirt", "short", "legging", "jogger", "bottom", "denim", "cargo"], y = ["shirt", "top", "tee", "blouse", "jacket", "coat", "hoodie", "sweater", "vest", "cardigan", "dress", "t-shirt"], g = (document.title + " " + (((_ = document.querySelector("h1")) == null ? void 0 : _.innerText) || "")).toLowerCase();
656
+ return f.forEach((E) => {
657
+ g.includes(E) && (h += 2);
658
+ }), y.forEach((E) => {
659
+ g.includes(E) && (o += 2);
660
+ }), h > o ? "bottom" : "top";
639
661
  }
640
- function p() {
641
- const l = { chart_type: "none", chart_content: null, available_sizes: [] }, x = document.querySelector("table");
642
- if (x && /chest|waist|bust|hip|size/i.test(x.innerText))
643
- return l.chart_type = "html_table", l.chart_content = x.outerHTML, l;
644
- const g = document.querySelectorAll("img");
645
- for (let R of g) {
646
- const b = R.src.toLowerCase(), K = (R.alt || "").toLowerCase();
647
- if (b.includes("size") && b.includes("chart") || K.includes("size") && K.includes("guide"))
648
- return l.chart_type = "image_url", l.chart_content = R.src, l;
649
- }
650
- const T = document.querySelector('.size-guide, #size-chart, .measurement-guide, [class*="SizeGuide"]');
651
- return T ? (l.chart_type = "raw_text", l.chart_content = T.innerText, l) : (document.querySelectorAll("button, span, li").forEach((R) => {
652
- const b = R.innerText.trim();
653
- /^(XS|S|M|L|XL|XXL|[0-9]{2})$/i.test(b) && b.length < 4 && (l.available_sizes.includes(b) || l.available_sizes.push(b));
654
- }), l);
662
+ function re() {
663
+ const o = { chart_type: "none", chart_content: null, available_sizes: [] }, h = document.querySelector("table");
664
+ if (h && /chest|waist|bust|hip|size/i.test(h.innerText))
665
+ return o.chart_type = "html_table", o.chart_content = h.outerHTML, o;
666
+ const f = document.querySelectorAll("img");
667
+ for (let _ of f) {
668
+ const E = _.src.toLowerCase(), V = (_.alt || "").toLowerCase();
669
+ if (E.includes("size") && E.includes("chart") || V.includes("size") && V.includes("guide"))
670
+ return o.chart_type = "image_url", o.chart_content = _.src, o;
671
+ }
672
+ const y = document.querySelector('.size-guide, #size-chart, .measurement-guide, [class*="SizeGuide"]');
673
+ return y ? (o.chart_type = "raw_text", o.chart_content = y.innerText, o) : (document.querySelectorAll("button, span, li").forEach((_) => {
674
+ const E = _.innerText.trim();
675
+ /^(XS|S|M|L|XL|XXL|[0-9]{2})$/i.test(E) && E.length < 4 && (o.available_sizes.includes(E) || o.available_sizes.push(E));
676
+ }), o);
655
677
  }
656
- const re = async () => {
657
- if (!j || !U || !d || !v) {
678
+ const te = async () => {
679
+ if (!T || !U || !v || !p) {
658
680
  alert("Please fill all fields.");
659
681
  return;
660
682
  }
661
- y("loading");
662
- const l = N(), x = p(), g = new FormData();
663
- g.append("front_image", j), g.append("side_image", U), g.append("height", d), g.append("weight", v), g.append("product_type", l), g.append("chart_type", x.chart_type), g.append("chart_content", x.chart_content), g.append("available_sizes", JSON.stringify(x.available_sizes));
683
+ R("loading");
684
+ const o = m(), h = re(), f = new FormData();
685
+ f.append("front_image", T), f.append("side_image", U), f.append("height", v), f.append("weight", p), f.append("product_type", o), f.append("chart_type", h.chart_type), f.append("chart_content", h.chart_content), f.append("available_sizes", JSON.stringify(h.available_sizes));
664
686
  try {
665
- const C = await (await fetch(ee, { method: "POST", body: g })).json();
666
- if (C.error) throw new Error(C.error);
667
- w(C), y("success");
668
- } catch (T) {
669
- L(T.message), y("error");
687
+ const g = await (await fetch(ee, { method: "POST", body: f })).json();
688
+ if (g.error) throw new Error(g.error);
689
+ j(g), R("success"), g.recommended_size && (O(g.recommended_size), typeof chrome < "u" && chrome.storage && chrome.storage.local.set({ styllar_last_size: g.recommended_size }));
690
+ } catch (y) {
691
+ W(y.message), R("error");
670
692
  }
671
693
  };
672
- return /* @__PURE__ */ s.jsxs("div", { className: "fixed bottom-6 right-6 z-[999999]", children: [
673
- /* @__PURE__ */ s.jsx(
694
+ return /* @__PURE__ */ l.jsxs("div", { className: "fixed bottom-6 right-6 z-[999999]", children: [
695
+ /* @__PURE__ */ l.jsx(
674
696
  "button",
675
697
  {
676
- onClick: () => O(!$),
698
+ onClick: () => k(!z),
677
699
  className: "bg-black text-white px-7 py-3.5 rounded-full shadow-xl font-bold text-sm hover:opacity-80 transition-opacity",
678
700
  children: "Styllar"
679
701
  }
680
702
  ),
681
- $ && /* @__PURE__ */ s.jsxs("div", { className: "absolute bottom-20 right-0 w-[330px] bg-white rounded-2xl p-6 shadow-2xl border border-gray-100 text-black", children: [
682
- /* @__PURE__ */ s.jsxs("div", { className: "flex justify-between items-center mb-4", children: [
683
- /* @__PURE__ */ s.jsx("h3", { className: "m-0 text-lg font-bold", children: "Smart Fit Assistant" }),
684
- /* @__PURE__ */ s.jsx("button", { onClick: () => O(!1), className: "text-gray-400 hover:text-black text-2xl leading-none", children: "×" })
703
+ z && /* @__PURE__ */ l.jsxs("div", { className: "absolute bottom-20 right-0 w-[330px] bg-white rounded-2xl p-6 shadow-2xl border border-gray-100 text-black", children: [
704
+ /* @__PURE__ */ l.jsxs("div", { className: "flex justify-between items-center mb-4", children: [
705
+ /* @__PURE__ */ l.jsx("h3", { className: "m-0 text-lg font-bold", children: "Smart Fit Assistant" }),
706
+ /* @__PURE__ */ l.jsx("button", { onClick: () => k(!1), className: "text-gray-400 hover:text-black text-2xl leading-none", children: "×" })
685
707
  ] }),
686
- k === "loading" && /* @__PURE__ */ s.jsxs("div", { className: "flex flex-col items-center justify-center py-8", children: [
687
- /* @__PURE__ */ s.jsx("div", { className: "w-8 h-8 border-4 border-gray-200 border-t-black rounded-full animate-spin mb-4" }),
688
- /* @__PURE__ */ s.jsx("p", { className: "text-sm text-gray-600", children: "Analyzing body & page data..." })
708
+ P === "loading" && /* @__PURE__ */ l.jsxs("div", { className: "flex flex-col items-center justify-center py-8", children: [
709
+ /* @__PURE__ */ l.jsx("div", { className: "w-8 h-8 border-4 border-gray-200 border-t-black rounded-full animate-spin mb-4" }),
710
+ /* @__PURE__ */ l.jsx("p", { className: "text-sm text-gray-600", children: "Analyzing body & page data..." })
689
711
  ] }),
690
- k === "success" && S && /* @__PURE__ */ s.jsxs("div", { className: "text-center py-6", children: [
691
- /* @__PURE__ */ s.jsx("div", { className: "text-sm text-green-600 font-bold tracking-wider", children: "MATCH FOUND" }),
692
- /* @__PURE__ */ s.jsx("div", { className: "text-5xl font-black my-4 text-black", children: S.recommended_size }),
693
- /* @__PURE__ */ s.jsxs("div", { className: "text-xs text-gray-500 mb-6", children: [
712
+ P === "success" && C && /* @__PURE__ */ l.jsxs("div", { className: "text-center py-6", children: [
713
+ /* @__PURE__ */ l.jsx("div", { className: "text-sm text-green-600 font-bold tracking-wider", children: "MATCH FOUND" }),
714
+ /* @__PURE__ */ l.jsx("div", { className: "text-5xl font-black my-4 text-black", children: C.recommended_size }),
715
+ /* @__PURE__ */ l.jsxs("div", { className: "text-xs text-gray-500 mb-6", children: [
694
716
  "Confidence: ",
695
- S.confidence
717
+ C.confidence
696
718
  ] }),
697
- /* @__PURE__ */ s.jsx(
719
+ /* @__PURE__ */ l.jsx(
698
720
  "button",
699
721
  {
700
722
  onClick: () => {
701
- y("idle"), w(null);
723
+ R("idle"), j(null);
702
724
  },
703
725
  className: "text-blue-600 text-sm underline hover:text-blue-800",
704
726
  children: "Run New Scan"
705
727
  }
706
728
  )
707
729
  ] }),
708
- k === "error" && /* @__PURE__ */ s.jsxs("div", { className: "py-4", children: [
709
- /* @__PURE__ */ s.jsxs("p", { className: "text-red-500 text-sm mb-4", children: [
730
+ P === "error" && /* @__PURE__ */ l.jsxs("div", { className: "py-4", children: [
731
+ /* @__PURE__ */ l.jsxs("p", { className: "text-red-500 text-sm mb-4", children: [
710
732
  "Error: ",
711
- W
733
+ $
712
734
  ] }),
713
- /* @__PURE__ */ s.jsx(
735
+ /* @__PURE__ */ l.jsx(
714
736
  "button",
715
737
  {
716
- onClick: () => y("idle"),
738
+ onClick: () => R("idle"),
717
739
  className: "w-full bg-black text-white py-3 rounded-xl font-bold text-sm",
718
740
  children: "Try Again"
719
741
  }
720
742
  )
721
743
  ] }),
722
- k === "idle" && /* @__PURE__ */ s.jsxs("div", { children: [
723
- /* @__PURE__ */ s.jsx("p", { className: "text-sm text-gray-600 mb-5 leading-relaxed", children: "Upload photos for a precision body scan." }),
724
- /* @__PURE__ */ s.jsxs("div", { className: "flex gap-3 mb-4", children: [
725
- /* @__PURE__ */ s.jsx(
744
+ P === "idle" && /* @__PURE__ */ l.jsxs("div", { children: [
745
+ /* @__PURE__ */ l.jsx("p", { className: "text-sm text-gray-600 mb-5 leading-relaxed", children: "Upload photos for a precision body scan." }),
746
+ /* @__PURE__ */ l.jsxs("div", { className: "flex gap-3 mb-4", children: [
747
+ /* @__PURE__ */ l.jsx(
726
748
  "input",
727
749
  {
728
750
  type: "number",
729
751
  placeholder: "Height (cm)",
730
- value: d,
731
- onChange: (l) => P(l.target.value),
752
+ value: v,
753
+ onChange: (o) => N(o.target.value),
732
754
  className: "w-1/2 p-2.5 border border-gray-300 rounded-lg outline-none focus:border-black text-sm"
733
755
  }
734
756
  ),
735
- /* @__PURE__ */ s.jsx(
757
+ /* @__PURE__ */ l.jsx(
736
758
  "input",
737
759
  {
738
760
  type: "number",
739
761
  placeholder: "Weight (kg)",
740
- value: v,
741
- onChange: (l) => E(l.target.value),
762
+ value: p,
763
+ onChange: (o) => S(o.target.value),
742
764
  className: "w-1/2 p-2.5 border border-gray-300 rounded-lg outline-none focus:border-black text-sm"
743
765
  }
744
766
  )
745
767
  ] }),
746
- /* @__PURE__ */ s.jsxs("div", { className: "mb-3", children: [
747
- /* @__PURE__ */ s.jsx("label", { className: "text-[11px] font-bold text-gray-400 uppercase block mb-1", children: "Front Image" }),
748
- /* @__PURE__ */ s.jsx(
768
+ /* @__PURE__ */ l.jsxs("div", { className: "mb-3", children: [
769
+ /* @__PURE__ */ l.jsx("label", { className: "text-[11px] font-bold text-gray-400 uppercase block mb-1", children: "Front Image" }),
770
+ /* @__PURE__ */ l.jsx(
749
771
  "input",
750
772
  {
751
773
  type: "file",
752
774
  accept: "image/*",
753
- onChange: (l) => Y(l.target.files[0]),
775
+ onChange: (o) => L(o.target.files[0]),
754
776
  className: "w-full text-xs file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-xs file:bg-gray-100 file:text-black hover:file:bg-gray-200"
755
777
  }
756
778
  )
757
779
  ] }),
758
- /* @__PURE__ */ s.jsxs("div", { className: "mb-5", children: [
759
- /* @__PURE__ */ s.jsx("label", { className: "text-[11px] font-bold text-gray-400 uppercase block mb-1", children: "Side Image" }),
760
- /* @__PURE__ */ s.jsx(
780
+ /* @__PURE__ */ l.jsxs("div", { className: "mb-5", children: [
781
+ /* @__PURE__ */ l.jsx("label", { className: "text-[11px] font-bold text-gray-400 uppercase block mb-1", children: "Side Image" }),
782
+ /* @__PURE__ */ l.jsx(
761
783
  "input",
762
784
  {
763
785
  type: "file",
764
786
  accept: "image/*",
765
- onChange: (l) => Q(l.target.files[0]),
787
+ onChange: (o) => Q(o.target.files[0]),
766
788
  className: "w-full text-xs file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-xs file:bg-gray-100 file:text-black hover:file:bg-gray-200"
767
789
  }
768
790
  )
769
791
  ] }),
770
- /* @__PURE__ */ s.jsx(
792
+ /* @__PURE__ */ l.jsx(
771
793
  "button",
772
794
  {
773
- onClick: re,
795
+ onClick: te,
774
796
  className: "w-full bg-black text-white py-3.5 rounded-xl font-bold text-sm hover:opacity-80 transition-opacity",
775
797
  children: "Run Body Scan"
776
798
  }
@@ -780,5 +802,5 @@ const pr = () => {
780
802
  ] });
781
803
  };
782
804
  export {
783
- pr as StyllarPlugin
805
+ mr as StyllarPlugin
784
806
  };
@@ -1,4 +1,4 @@
1
- (function(A,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(A=typeof globalThis<"u"?globalThis:A||self,b(A.StyllarReactPlugin={},A.React))})(this,function(A,b){"use strict";var ee={exports:{}},B={};/**
1
+ (function(A,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(A=typeof globalThis<"u"?globalThis:A||self,h(A.StyllarReactPlugin={},A.React))})(this,function(A,h){"use strict";var ee={exports:{}},B={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var de;function Le(){if(de)return B;de=1;var L=b,P=Symbol.for("react.element"),k=Symbol.for("react.fragment"),x=Object.prototype.hasOwnProperty,Y=L.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,z={key:!0,ref:!0,__self:!0,__source:!0};function T(w,d,N){var p,R={},j=null,M=null;N!==void 0&&(j=""+N),d.key!==void 0&&(j=""+d.key),d.ref!==void 0&&(M=d.ref);for(p in d)x.call(d,p)&&!z.hasOwnProperty(p)&&(R[p]=d[p]);if(w&&w.defaultProps)for(p in d=w.defaultProps,d)R[p]===void 0&&(R[p]=d[p]);return{$$typeof:P,type:w,key:j,ref:M,props:R,_owner:Y.current}}return B.Fragment=k,B.jsx=T,B.jsxs=T,B}var J={};/**
9
+ */var pe;function We(){if(pe)return B;pe=1;var W=h,k=Symbol.for("react.element"),N=Symbol.for("react.fragment"),S=Object.prototype.hasOwnProperty,L=W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Y={key:!0,ref:!0,__self:!0,__source:!0};function O(T,p,D){var v,j={},C=null,M=null;D!==void 0&&(C=""+D),p.key!==void 0&&(C=""+p.key),p.ref!==void 0&&(M=p.ref);for(v in p)S.call(p,v)&&!Y.hasOwnProperty(v)&&(j[v]=p[v]);if(T&&T.defaultProps)for(v in p=T.defaultProps,p)j[v]===void 0&&(j[v]=p[v]);return{$$typeof:k,type:T,key:C,ref:M,props:j,_owner:L.current}}return B.Fragment=N,B.jsx=O,B.jsxs=O,B}var J={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,17 +14,17 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var pe;function Ye(){return pe||(pe=1,process.env.NODE_ENV!=="production"&&function(){var L=b,P=Symbol.for("react.element"),k=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),T=Symbol.for("react.provider"),w=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),p=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),K=Symbol.iterator,re="@@iterator";function te(e){if(e===null||typeof e!="object")return null;var r=K&&e[K]||e[re];return typeof r=="function"?r:null}var D=L.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ne("error",e,t)}}function ne(e,r,t){{var n=D.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var c=t.map(function(o){return String(o)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var l=!1,_=!1,g=!1,C=!1,O=!1,S;S=Symbol.for("react.module.reference");function y(e){return!!(typeof e=="string"||typeof e=="function"||e===x||e===z||O||e===Y||e===N||e===p||C||e===M||l||_||g||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===R||e.$$typeof===T||e.$$typeof===w||e.$$typeof===d||e.$$typeof===S||e.getModuleId!==void 0))}function H(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function ve(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case k:return"Portal";case z:return"Profiler";case Y:return"StrictMode";case N:return"Suspense";case p:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case w:var r=e;return ve(r)+".Consumer";case T:var t=e;return ve(t._context)+".Provider";case d:return H(e,e.render,"ForwardRef");case R:var n=e.displayName||null;return n!==null?n:F(e.type)||"Memo";case j:{var i=e,c=i._payload,o=i._init;try{return F(o(c))}catch{return null}}}return null}var I=Object.assign,X=0,ge,he,be,me,ye,xe,_e;function Ee(){}Ee.__reactDisabledLog=!0;function Me(){{if(X===0){ge=console.log,he=console.info,be=console.warn,me=console.error,ye=console.group,xe=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ee,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}X++}}function Ue(){{if(X--,X===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:ge}),info:I({},e,{value:he}),warn:I({},e,{value:be}),error:I({},e,{value:me}),group:I({},e,{value:ye}),groupCollapsed:I({},e,{value:xe}),groupEnd:I({},e,{value:_e})})}X<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=D.ReactCurrentDispatcher,oe;function $(e,r,t){{if(oe===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);oe=n&&n[1]||""}return`
18
- `+oe+e}}var ie=!1,q;{var Ve=typeof WeakMap=="function"?WeakMap:Map;q=new Ve}function Re(e,r){if(!e||ie)return"";{var t=q.get(e);if(t!==void 0)return t}var n;ie=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=ae.current,ae.current=null,Me();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(m){n=m}Reflect.construct(e,[],o)}else{try{o.call()}catch(m){n=m}e.call(o.prototype)}}else{try{throw Error()}catch(m){n=m}e()}}catch(m){if(m&&n&&typeof m.stack=="string"){for(var a=m.stack.split(`
19
- `),h=n.stack.split(`
20
- `),u=a.length-1,f=h.length-1;u>=1&&f>=0&&a[u]!==h[f];)f--;for(;u>=1&&f>=0;u--,f--)if(a[u]!==h[f]){if(u!==1||f!==1)do if(u--,f--,f<0||a[u]!==h[f]){var E=`
21
- `+a[u].replace(" at new "," at ");return e.displayName&&E.includes("<anonymous>")&&(E=E.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,E),E}while(u>=1&&f>=0);break}}}finally{ie=!1,ae.current=c,Ue(),Error.prepareStackTrace=i}var V=e?e.displayName||e.name:"",W=V?$(V):"";return typeof e=="function"&&q.set(e,W),W}function Be(e,r,t){return Re(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,Je(e));if(typeof e=="string")return $(e);switch(e){case N:return $("Suspense");case p:return $("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return Be(e.render);case R:return Z(e.type,r,t);case j:{var n=e,i=n._payload,c=n._init;try{return Z(c(i),r,t)}catch{}}}return""}var G=Object.prototype.hasOwnProperty,Se={},we=D.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=Z(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function Ke(e,r,t,n,i){{var c=Function.call.bind(G);for(var o in e)if(c(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var h=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`.");throw h.name="Invariant Violation",h}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){a=u}a&&!(a instanceof Error)&&(Q(i),v("%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 a),Q(null)),a instanceof Error&&!(a.message in Se)&&(Se[a.message]=!0,Q(i),v("Failed %s type: %s",t,a.message),Q(null))}}}var Xe=Array.isArray;function se(e){return Xe(e)}function Ge(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function Te(e){if(He(e))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ge(e)),je(e)}var Ce=D.ReactCurrentOwner,$e={key:!0,ref:!0,__self:!0,__source:!0},Oe,Pe;function qe(e){if(G.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(G.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){typeof e.ref=="string"&&Ce.current}function er(e,r){{var t=function(){Oe||(Oe=!0,v("%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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){Pe||(Pe=!0,v("%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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,i,c,o){var a={$$typeof:P,type:e,key:r,ref:t,props:o,_owner:c};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,i){{var c,o={},a=null,h=null;t!==void 0&&(Te(t),a=""+t),Ze(r)&&(Te(r.key),a=""+r.key),qe(r)&&(h=r.ref,Qe(r,i));for(c in r)G.call(r,c)&&!$e.hasOwnProperty(c)&&(o[c]=r[c]);if(e&&e.defaultProps){var u=e.defaultProps;for(c in u)o[c]===void 0&&(o[c]=u[c])}if(a||h){var f=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(o,f),h&&rr(o,f)}return tr(e,a,h,i,n,Ce.current,o)}}var le=D.ReactCurrentOwner,ke=D.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,t=Z(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(t)}else ke.setExtraStackFrame(null)}var ce;ce=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===P}function Ne(){{if(le.current){var e=F(le.current.type);if(e)return`
17
+ */var ve;function Le(){return ve||(ve=1,process.env.NODE_ENV!=="production"&&function(){var W=h,k=Symbol.for("react.element"),N=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),L=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),T=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),K=Symbol.iterator,re="@@iterator";function te(e){if(e===null||typeof e!="object")return null;var r=K&&e[K]||e[re];return typeof r=="function"?r:null}var P=W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function m(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];ne("error",e,t)}}function ne(e,r,t){{var n=P.ReactDebugCurrentFrame,s=n.getStackAddendum();s!==""&&(r+="%s",t=t.concat([s]));var c=t.map(function(i){return String(i)});c.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,c)}}var ae=!1,o=!1,b=!1,f=!1,x=!1,g;g=Symbol.for("react.module.reference");function E(e){return!!(typeof e=="string"||typeof e=="function"||e===S||e===Y||x||e===L||e===D||e===v||f||e===M||ae||o||b||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===j||e.$$typeof===O||e.$$typeof===T||e.$$typeof===p||e.$$typeof===g||e.getModuleId!==void 0))}function R(e,r,t){var n=e.displayName;if(n)return n;var s=r.displayName||r.name||"";return s!==""?t+"("+s+")":t}function X(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case N:return"Portal";case Y:return"Profiler";case L:return"StrictMode";case D:return"Suspense";case v:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case T:var r=e;return X(r)+".Consumer";case O:var t=e;return X(t._context)+".Provider";case p:return R(e,e.render,"ForwardRef");case j:var n=e.displayName||null;return n!==null?n:F(e.type)||"Memo";case C:{var s=e,c=s._payload,i=s._init;try{return F(i(c))}catch{return null}}}return null}var I=Object.assign,G=0,me,ge,he,be,ye,xe,_e;function Ee(){}Ee.__reactDisabledLog=!0;function Me(){{if(G===0){me=console.log,ge=console.info,he=console.warn,be=console.error,ye=console.group,xe=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ee,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}G++}}function Ue(){{if(G--,G===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:I({},e,{value:me}),info:I({},e,{value:ge}),warn:I({},e,{value:he}),error:I({},e,{value:be}),group:I({},e,{value:ye}),groupCollapsed:I({},e,{value:xe}),groupEnd:I({},e,{value:_e})})}G<0&&m("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var oe=P.ReactCurrentDispatcher,ie;function $(e,r,t){{if(ie===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);ie=n&&n[1]||""}return`
18
+ `+ie+e}}var se=!1,q;{var Ve=typeof WeakMap=="function"?WeakMap:Map;q=new Ve}function Re(e,r){if(!e||se)return"";{var t=q.get(e);if(t!==void 0)return t}var n;se=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var c;c=oe.current,oe.current=null,Me();try{if(r){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(_){n=_}Reflect.construct(e,[],i)}else{try{i.call()}catch(_){n=_}e.call(i.prototype)}}else{try{throw Error()}catch(_){n=_}e()}}catch(_){if(_&&n&&typeof _.stack=="string"){for(var a=_.stack.split(`
19
+ `),y=n.stack.split(`
20
+ `),u=a.length-1,d=y.length-1;u>=1&&d>=0&&a[u]!==y[d];)d--;for(;u>=1&&d>=0;u--,d--)if(a[u]!==y[d]){if(u!==1||d!==1)do if(u--,d--,d<0||a[u]!==y[d]){var w=`
21
+ `+a[u].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),typeof e=="function"&&q.set(e,w),w}while(u>=1&&d>=0);break}}}finally{se=!1,oe.current=c,Ue(),Error.prepareStackTrace=s}var V=e?e.displayName||e.name:"",z=V?$(V):"";return typeof e=="function"&&q.set(e,z),z}function Be(e,r,t){return Re(e,!1)}function Je(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,Je(e));if(typeof e=="string")return $(e);switch(e){case D:return $("Suspense");case v:return $("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return Be(e.render);case j:return Z(e.type,r,t);case C:{var n=e,s=n._payload,c=n._init;try{return Z(c(s),r,t)}catch{}}}return""}var H=Object.prototype.hasOwnProperty,Se={},we=P.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=Z(e.type,e._source,r?r.type:null);we.setExtraStackFrame(t)}else we.setExtraStackFrame(null)}function Ke(e,r,t,n,s){{var c=Function.call.bind(H);for(var i in e)if(c(e,i)){var a=void 0;try{if(typeof e[i]!="function"){var y=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`.");throw y.name="Invariant Violation",y}a=e[i](r,i,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){a=u}a&&!(a instanceof Error)&&(Q(s),m("%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),Q(null)),a instanceof Error&&!(a.message in Se)&&(Se[a.message]=!0,Q(s),m("Failed %s type: %s",t,a.message),Q(null))}}}var Xe=Array.isArray;function le(e){return Xe(e)}function Ge(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function He(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function Te(e){if(He(e))return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ge(e)),je(e)}var Ce=P.ReactCurrentOwner,$e={key:!0,ref:!0,__self:!0,__source:!0},Oe,Pe;function qe(e){if(H.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ze(e){if(H.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Qe(e,r){typeof e.ref=="string"&&Ce.current}function er(e,r){{var t=function(){Oe||(Oe=!0,m("%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))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function rr(e,r){{var t=function(){Pe||(Pe=!0,m("%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))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var tr=function(e,r,t,n,s,c,i){var a={$$typeof:k,type:e,key:r,ref:t,props:i,_owner:c};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function nr(e,r,t,n,s){{var c,i={},a=null,y=null;t!==void 0&&(Te(t),a=""+t),Ze(r)&&(Te(r.key),a=""+r.key),qe(r)&&(y=r.ref,Qe(r,s));for(c in r)H.call(r,c)&&!$e.hasOwnProperty(c)&&(i[c]=r[c]);if(e&&e.defaultProps){var u=e.defaultProps;for(c in u)i[c]===void 0&&(i[c]=u[c])}if(a||y){var d=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&er(i,d),y&&rr(i,d)}return tr(e,a,y,s,n,Ce.current,i)}}var ce=P.ReactCurrentOwner,ke=P.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,t=Z(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(t)}else ke.setExtraStackFrame(null)}var ue;ue=!1;function fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===k}function Ne(){{if(ce.current){var e=F(ce.current.type);if(e)return`
22
22
 
23
23
  Check the render method of \``+e+"`."}return""}}function ar(e){return""}var De={};function or(e){{var r=Ne();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
24
24
 
25
- Check the top-level render call using <`+t+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=or(r);if(De[t])return;De[t]=!0;var n="";e&&e._owner&&e._owner!==le.current&&(n=" It was passed a child from "+F(e._owner.type)+"."),U(e),v('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),U(null)}}function Ae(e,r){{if(typeof e!="object")return;if(se(e))for(var t=0;t<e.length;t++){var n=e[t];ue(n)&&Fe(n,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var i=te(e);if(typeof i=="function"&&i!==e.entries)for(var c=i.call(e),o;!(o=c.next()).done;)ue(o.value)&&Fe(o.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===d||r.$$typeof===R))t=r.propTypes;else return;if(t){var n=F(r);Ke(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ce){ce=!0;var i=F(r);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){U(e),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),U(null);break}}e.ref!==null&&(U(e),v("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}var Ie={};function We(e,r,t,n,i,c){{var o=y(e);if(!o){var a="";(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.");var h=ar();h?a+=h:a+=Ne();var u;e===null?u="null":se(e)?u="array":e!==void 0&&e.$$typeof===P?(u="<"+(F(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var f=nr(e,r,t,i,c);if(f==null)return f;if(o){var E=r.children;if(E!==void 0)if(n)if(se(E)){for(var V=0;V<E.length;V++)Ae(E[V],e);Object.freeze&&Object.freeze(E)}else v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ae(E,e)}if(G.call(r,"key")){var W=F(e),m=Object.keys(r).filter(function(pr){return pr!=="key"}),fe=m.length>0?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}";if(!Ie[W+fe]){var dr=m.length>0?"{"+m.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+t+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=or(r);if(De[t])return;De[t]=!0;var n="";e&&e._owner&&e._owner!==ce.current&&(n=" It was passed a child from "+F(e._owner.type)+"."),U(e),m('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),U(null)}}function Ae(e,r){{if(typeof e!="object")return;if(le(e))for(var t=0;t<e.length;t++){var n=e[t];fe(n)&&Fe(n,r)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var s=te(e);if(typeof s=="function"&&s!==e.entries)for(var c=s.call(e),i;!(i=c.next()).done;)fe(i.value)&&Fe(i.value,r)}}}function ir(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===p||r.$$typeof===j))t=r.propTypes;else return;if(t){var n=F(r);Ke(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var s=F(r);m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",s||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function sr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){U(e),m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),U(null);break}}e.ref!==null&&(U(e),m("Invalid attribute `ref` supplied to `React.Fragment`."),U(null))}}var Ie={};function ze(e,r,t,n,s,c){{var i=E(e);if(!i){var a="";(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.");var y=ar();y?a+=y:a+=Ne();var u;e===null?u="null":le(e)?u="array":e!==void 0&&e.$$typeof===k?(u="<"+(F(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var d=nr(e,r,t,s,c);if(d==null)return d;if(i){var w=r.children;if(w!==void 0)if(n)if(le(w)){for(var V=0;V<w.length;V++)Ae(w[V],e);Object.freeze&&Object.freeze(w)}else m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Ae(w,e)}if(H.call(r,"key")){var z=F(e),_=Object.keys(r).filter(function(pr){return pr!=="key"}),de=_.length>0?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}";if(!Ie[z+de]){var dr=_.length>0?"{"+_.join(": ..., ")+": ...}":"{}";m(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,fe,W,dr,W),Ie[W+fe]=!0}}return e===x?sr(f):ir(f),f}}function lr(e,r,t){return We(e,r,t,!0)}function cr(e,r,t){return We(e,r,t,!1)}var ur=cr,fr=lr;J.Fragment=x,J.jsx=ur,J.jsxs=fr}()),J}process.env.NODE_ENV==="production"?ee.exports=Le():ee.exports=Ye();var s=ee.exports;const ze=()=>{const[L,P]=b.useState(!1),[k,x]=b.useState("idle"),[Y,z]=b.useState(""),[T,w]=b.useState(null),[d,N]=b.useState(""),[p,R]=b.useState(""),[j,M]=b.useState(null),[K,re]=b.useState(null),te="http://136.113.197.77:5000/predict/size-from-chart";function D(){var S;let l=0,_=0;const g=["pant","jeans","trouser","skirt","short","legging","jogger","bottom","denim","cargo"],C=["shirt","top","tee","blouse","jacket","coat","hoodie","sweater","vest","cardigan","dress","t-shirt"],O=(document.title+" "+(((S=document.querySelector("h1"))==null?void 0:S.innerText)||"")).toLowerCase();return g.forEach(y=>{O.includes(y)&&(_+=2)}),C.forEach(y=>{O.includes(y)&&(l+=2)}),_>l?"bottom":"top"}function v(){const l={chart_type:"none",chart_content:null,available_sizes:[]},_=document.querySelector("table");if(_&&/chest|waist|bust|hip|size/i.test(_.innerText))return l.chart_type="html_table",l.chart_content=_.outerHTML,l;const g=document.querySelectorAll("img");for(let S of g){const y=S.src.toLowerCase(),H=(S.alt||"").toLowerCase();if(y.includes("size")&&y.includes("chart")||H.includes("size")&&H.includes("guide"))return l.chart_type="image_url",l.chart_content=S.src,l}const C=document.querySelector('.size-guide, #size-chart, .measurement-guide, [class*="SizeGuide"]');return C?(l.chart_type="raw_text",l.chart_content=C.innerText,l):(document.querySelectorAll("button, span, li").forEach(S=>{const y=S.innerText.trim();/^(XS|S|M|L|XL|XXL|[0-9]{2})$/i.test(y)&&y.length<4&&(l.available_sizes.includes(y)||l.available_sizes.push(y))}),l)}const ne=async()=>{if(!j||!K||!d||!p){alert("Please fill all fields.");return}x("loading");const l=D(),_=v(),g=new FormData;g.append("front_image",j),g.append("side_image",K),g.append("height",d),g.append("weight",p),g.append("product_type",l),g.append("chart_type",_.chart_type),g.append("chart_content",_.chart_content),g.append("available_sizes",JSON.stringify(_.available_sizes));try{const O=await(await fetch(te,{method:"POST",body:g})).json();if(O.error)throw new Error(O.error);w(O),x("success")}catch(C){z(C.message),x("error")}};return s.jsxs("div",{className:"fixed bottom-6 right-6 z-[999999]",children:[s.jsx("button",{onClick:()=>P(!L),className:"bg-black text-white px-7 py-3.5 rounded-full shadow-xl font-bold text-sm hover:opacity-80 transition-opacity",children:"Styllar"}),L&&s.jsxs("div",{className:"absolute bottom-20 right-0 w-[330px] bg-white rounded-2xl p-6 shadow-2xl border border-gray-100 text-black",children:[s.jsxs("div",{className:"flex justify-between items-center mb-4",children:[s.jsx("h3",{className:"m-0 text-lg font-bold",children:"Smart Fit Assistant"}),s.jsx("button",{onClick:()=>P(!1),className:"text-gray-400 hover:text-black text-2xl leading-none",children:"×"})]}),k==="loading"&&s.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[s.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-black rounded-full animate-spin mb-4"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Analyzing body & page data..."})]}),k==="success"&&T&&s.jsxs("div",{className:"text-center py-6",children:[s.jsx("div",{className:"text-sm text-green-600 font-bold tracking-wider",children:"MATCH FOUND"}),s.jsx("div",{className:"text-5xl font-black my-4 text-black",children:T.recommended_size}),s.jsxs("div",{className:"text-xs text-gray-500 mb-6",children:["Confidence: ",T.confidence]}),s.jsx("button",{onClick:()=>{x("idle"),w(null)},className:"text-blue-600 text-sm underline hover:text-blue-800",children:"Run New Scan"})]}),k==="error"&&s.jsxs("div",{className:"py-4",children:[s.jsxs("p",{className:"text-red-500 text-sm mb-4",children:["Error: ",Y]}),s.jsx("button",{onClick:()=>x("idle"),className:"w-full bg-black text-white py-3 rounded-xl font-bold text-sm",children:"Try Again"})]}),k==="idle"&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-600 mb-5 leading-relaxed",children:"Upload photos for a precision body scan."}),s.jsxs("div",{className:"flex gap-3 mb-4",children:[s.jsx("input",{type:"number",placeholder:"Height (cm)",value:d,onChange:l=>N(l.target.value),className:"w-1/2 p-2.5 border border-gray-300 rounded-lg outline-none focus:border-black text-sm"}),s.jsx("input",{type:"number",placeholder:"Weight (kg)",value:p,onChange:l=>R(l.target.value),className:"w-1/2 p-2.5 border border-gray-300 rounded-lg outline-none focus:border-black text-sm"})]}),s.jsxs("div",{className:"mb-3",children:[s.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase block mb-1",children:"Front Image"}),s.jsx("input",{type:"file",accept:"image/*",onChange:l=>M(l.target.files[0]),className:"w-full text-xs file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-xs file:bg-gray-100 file:text-black hover:file:bg-gray-200"})]}),s.jsxs("div",{className:"mb-5",children:[s.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase block mb-1",children:"Side Image"}),s.jsx("input",{type:"file",accept:"image/*",onChange:l=>re(l.target.files[0]),className:"w-full text-xs file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-xs file:bg-gray-100 file:text-black hover:file:bg-gray-200"})]}),s.jsx("button",{onClick:ne,className:"w-full bg-black text-white py-3.5 rounded-xl font-bold text-sm hover:opacity-80 transition-opacity",children:"Run Body Scan"})]})]})]})};A.StyllarPlugin=ze,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
30
+ <%s key={someKey} {...props} />`,de,z,dr,z),Ie[z+de]=!0}}return e===S?sr(d):ir(d),d}}function lr(e,r,t){return ze(e,r,t,!0)}function cr(e,r,t){return ze(e,r,t,!1)}var ur=cr,fr=lr;J.Fragment=S,J.jsx=ur,J.jsxs=fr}()),J}process.env.NODE_ENV==="production"?ee.exports=We():ee.exports=Le();var l=ee.exports;const Ye=()=>{const[W,k]=h.useState(!1),[N,S]=h.useState("idle"),[L,Y]=h.useState(""),[O,T]=h.useState(null),[p,D]=h.useState(""),[v,j]=h.useState(""),[C,M]=h.useState(null),[K,re]=h.useState(null),te="http://136.113.197.77:5000/predict/size-from-chart",P=o=>{if(!o)return;const b=()=>{const f=document.querySelectorAll('button, .size-swatch, .size-option, li[role="radio"], div[data-value]');for(let x of f){const g=x.innerText.trim().toUpperCase(),E=String(o).trim().toUpperCase();if(g===E||g===`SIZE ${E}`)return x.click(),console.log(`Styllar: Successfully auto-selected size ${o}`),!0}return!1};if(!b()){let f=0;const x=setInterval(()=>{f++,(b()||f>10)&&clearInterval(x)},500)}};h.useEffect(()=>{typeof chrome<"u"&&chrome.storage&&chrome.storage.local.get(["styllar_last_size"],o=>{o.styllar_last_size&&(console.log("Styllar: Found saved size:",o.styllar_last_size),setTimeout(()=>P(o.styllar_last_size),1e3))})},[]);function m(){var E;let o=0,b=0;const f=["pant","jeans","trouser","skirt","short","legging","jogger","bottom","denim","cargo"],x=["shirt","top","tee","blouse","jacket","coat","hoodie","sweater","vest","cardigan","dress","t-shirt"],g=(document.title+" "+(((E=document.querySelector("h1"))==null?void 0:E.innerText)||"")).toLowerCase();return f.forEach(R=>{g.includes(R)&&(b+=2)}),x.forEach(R=>{g.includes(R)&&(o+=2)}),b>o?"bottom":"top"}function ne(){const o={chart_type:"none",chart_content:null,available_sizes:[]},b=document.querySelector("table");if(b&&/chest|waist|bust|hip|size/i.test(b.innerText))return o.chart_type="html_table",o.chart_content=b.outerHTML,o;const f=document.querySelectorAll("img");for(let E of f){const R=E.src.toLowerCase(),X=(E.alt||"").toLowerCase();if(R.includes("size")&&R.includes("chart")||X.includes("size")&&X.includes("guide"))return o.chart_type="image_url",o.chart_content=E.src,o}const x=document.querySelector('.size-guide, #size-chart, .measurement-guide, [class*="SizeGuide"]');return x?(o.chart_type="raw_text",o.chart_content=x.innerText,o):(document.querySelectorAll("button, span, li").forEach(E=>{const R=E.innerText.trim();/^(XS|S|M|L|XL|XXL|[0-9]{2})$/i.test(R)&&R.length<4&&(o.available_sizes.includes(R)||o.available_sizes.push(R))}),o)}const ae=async()=>{if(!C||!K||!p||!v){alert("Please fill all fields.");return}S("loading");const o=m(),b=ne(),f=new FormData;f.append("front_image",C),f.append("side_image",K),f.append("height",p),f.append("weight",v),f.append("product_type",o),f.append("chart_type",b.chart_type),f.append("chart_content",b.chart_content),f.append("available_sizes",JSON.stringify(b.available_sizes));try{const g=await(await fetch(te,{method:"POST",body:f})).json();if(g.error)throw new Error(g.error);T(g),S("success"),g.recommended_size&&(P(g.recommended_size),typeof chrome<"u"&&chrome.storage&&chrome.storage.local.set({styllar_last_size:g.recommended_size}))}catch(x){Y(x.message),S("error")}};return l.jsxs("div",{className:"fixed bottom-6 right-6 z-[999999]",children:[l.jsx("button",{onClick:()=>k(!W),className:"bg-black text-white px-7 py-3.5 rounded-full shadow-xl font-bold text-sm hover:opacity-80 transition-opacity",children:"Styllar"}),W&&l.jsxs("div",{className:"absolute bottom-20 right-0 w-[330px] bg-white rounded-2xl p-6 shadow-2xl border border-gray-100 text-black",children:[l.jsxs("div",{className:"flex justify-between items-center mb-4",children:[l.jsx("h3",{className:"m-0 text-lg font-bold",children:"Smart Fit Assistant"}),l.jsx("button",{onClick:()=>k(!1),className:"text-gray-400 hover:text-black text-2xl leading-none",children:"×"})]}),N==="loading"&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-8",children:[l.jsx("div",{className:"w-8 h-8 border-4 border-gray-200 border-t-black rounded-full animate-spin mb-4"}),l.jsx("p",{className:"text-sm text-gray-600",children:"Analyzing body & page data..."})]}),N==="success"&&O&&l.jsxs("div",{className:"text-center py-6",children:[l.jsx("div",{className:"text-sm text-green-600 font-bold tracking-wider",children:"MATCH FOUND"}),l.jsx("div",{className:"text-5xl font-black my-4 text-black",children:O.recommended_size}),l.jsxs("div",{className:"text-xs text-gray-500 mb-6",children:["Confidence: ",O.confidence]}),l.jsx("button",{onClick:()=>{S("idle"),T(null)},className:"text-blue-600 text-sm underline hover:text-blue-800",children:"Run New Scan"})]}),N==="error"&&l.jsxs("div",{className:"py-4",children:[l.jsxs("p",{className:"text-red-500 text-sm mb-4",children:["Error: ",L]}),l.jsx("button",{onClick:()=>S("idle"),className:"w-full bg-black text-white py-3 rounded-xl font-bold text-sm",children:"Try Again"})]}),N==="idle"&&l.jsxs("div",{children:[l.jsx("p",{className:"text-sm text-gray-600 mb-5 leading-relaxed",children:"Upload photos for a precision body scan."}),l.jsxs("div",{className:"flex gap-3 mb-4",children:[l.jsx("input",{type:"number",placeholder:"Height (cm)",value:p,onChange:o=>D(o.target.value),className:"w-1/2 p-2.5 border border-gray-300 rounded-lg outline-none focus:border-black text-sm"}),l.jsx("input",{type:"number",placeholder:"Weight (kg)",value:v,onChange:o=>j(o.target.value),className:"w-1/2 p-2.5 border border-gray-300 rounded-lg outline-none focus:border-black text-sm"})]}),l.jsxs("div",{className:"mb-3",children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase block mb-1",children:"Front Image"}),l.jsx("input",{type:"file",accept:"image/*",onChange:o=>M(o.target.files[0]),className:"w-full text-xs file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-xs file:bg-gray-100 file:text-black hover:file:bg-gray-200"})]}),l.jsxs("div",{className:"mb-5",children:[l.jsx("label",{className:"text-[11px] font-bold text-gray-400 uppercase block mb-1",children:"Side Image"}),l.jsx("input",{type:"file",accept:"image/*",onChange:o=>re(o.target.files[0]),className:"w-full text-xs file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-xs file:bg-gray-100 file:text-black hover:file:bg-gray-200"})]}),l.jsx("button",{onClick:ae,className:"w-full bg-black text-white py-3.5 rounded-xl font-bold text-sm hover:opacity-80 transition-opacity",children:"Run Body Scan"})]})]})]})};A.StyllarPlugin=Ye,Object.defineProperty(A,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styllar-react-plugin",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "main": "dist/styllar-react-plugin.umd.cjs",
6
6
  "module": "dist/styllar-react-plugin.js",
@@ -35,4 +35,4 @@
35
35
  "tailwindcss": "^4.2.0",
36
36
  "vite": "^5.4.10"
37
37
  }
38
- }
38
+ }
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
 
3
3
  const StyllarPlugin = () => {
4
4
  // --- 1. REACT STATE MANAGEMENT ---
@@ -15,6 +15,53 @@ const StyllarPlugin = () => {
15
15
 
16
16
  const API_ENDPOINT = "http://136.113.197.77:5000/predict/size-from-chart";
17
17
 
18
+ // --- NEW: AUTO-SELECT FUNCTION (WITH POLLING) ---
19
+ const autoSelectSize = (targetSize) => {
20
+ if (!targetSize) return;
21
+
22
+ const trySelect = () => {
23
+ // Look for common size elements on e-commerce sites
24
+ const sizeElements = document.querySelectorAll('button, .size-swatch, .size-option, li[role="radio"], div[data-value]');
25
+
26
+ for (let el of sizeElements) {
27
+ const text = el.innerText.trim().toUpperCase();
28
+ const recommended = String(targetSize).trim().toUpperCase();
29
+
30
+ // Check for exact match or formats like "SIZE L"
31
+ if (text === recommended || text === `SIZE ${recommended}`) {
32
+ el.click();
33
+ console.log(`Styllar: Successfully auto-selected size ${targetSize}`);
34
+ return true; // Found and clicked
35
+ }
36
+ }
37
+ return false; // Not found yet
38
+ };
39
+
40
+ // Try immediately. If it fails (DOM loading dynamically), poll for up to 5 seconds.
41
+ if (!trySelect()) {
42
+ let attempts = 0;
43
+ const interval = setInterval(() => {
44
+ attempts++;
45
+ if (trySelect() || attempts > 10) {
46
+ clearInterval(interval);
47
+ }
48
+ }, 500);
49
+ }
50
+ };
51
+
52
+ // --- NEW: CHECK STORAGE ON PAGE LOAD ---
53
+ useEffect(() => {
54
+ if (typeof chrome !== "undefined" && chrome.storage) {
55
+ chrome.storage.local.get(["styllar_last_size"], (data) => {
56
+ if (data.styllar_last_size) {
57
+ console.log("Styllar: Found saved size:", data.styllar_last_size);
58
+ // Wait a brief moment for the host site to render its UI
59
+ setTimeout(() => autoSelectSize(data.styllar_last_size), 1000);
60
+ }
61
+ });
62
+ }
63
+ }, []);
64
+
18
65
  // --- 2. INTELLIGENCE & SCRAPING (Unchanged logic) ---
19
66
  function detectProductCategory() {
20
67
  let scoreTop = 0; let scoreBottom = 0;
@@ -90,6 +137,16 @@ const StyllarPlugin = () => {
90
137
 
91
138
  setResult(data);
92
139
  setStatus('success');
140
+
141
+ // --- NEW: Trigger Auto-Select & Save to Storage ---
142
+ if (data.recommended_size) {
143
+ autoSelectSize(data.recommended_size);
144
+
145
+ if (typeof chrome !== "undefined" && chrome.storage) {
146
+ chrome.storage.local.set({ styllar_last_size: data.recommended_size });
147
+ }
148
+ }
149
+
93
150
  } catch (e) {
94
151
  setErrorMsg(e.message);
95
152
  setStatus('error');