tamagui 1.129.12 → 1.129.14

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.
@@ -2795,39 +2795,39 @@ var require_pseudoDescriptors_native = __commonJS({
2795
2795
  // order of keys here important! in priority order
2796
2796
  hoverStyle: {
2797
2797
  name: "hover",
2798
- priority: 1
2798
+ priority: 2
2799
2799
  },
2800
2800
  pressStyle: {
2801
2801
  name: "active",
2802
2802
  stateKey: "press",
2803
- priority: 2
2803
+ priority: 3
2804
2804
  },
2805
2805
  focusVisibleStyle: {
2806
2806
  name: "focus-visible",
2807
- priority: 3,
2807
+ priority: 4,
2808
2808
  stateKey: "focusVisible"
2809
2809
  },
2810
2810
  focusStyle: {
2811
2811
  name: "focus",
2812
- priority: 3
2812
+ priority: 4
2813
2813
  },
2814
2814
  focusWithinStyle: {
2815
2815
  name: "focus-within",
2816
- priority: 3,
2816
+ priority: 4,
2817
2817
  stateKey: "focusWithin"
2818
2818
  },
2819
2819
  disabledStyle: {
2820
2820
  name: "disabled",
2821
- priority: 4,
2821
+ priority: 5,
2822
2822
  stateKey: "disabled"
2823
2823
  }
2824
2824
  }, pseudoPriorities = {
2825
- hover: 1,
2826
- press: 2,
2827
- focus: 3,
2828
- focusVisible: 3,
2829
- focusWithin: 3,
2830
- disabled: 4
2825
+ hover: pseudoDescriptorsBase.hoverStyle.priority,
2826
+ press: pseudoDescriptorsBase.pressStyle.priority,
2827
+ focus: pseudoDescriptorsBase.focusStyle.priority,
2828
+ focusVisible: pseudoDescriptorsBase.focusVisibleStyle.priority,
2829
+ focusWithin: pseudoDescriptorsBase.focusWithinStyle.priority,
2830
+ disabled: pseudoDescriptorsBase.disabledStyle.priority
2831
2831
  }, pseudoDescriptors = {
2832
2832
  ...pseudoDescriptorsBase,
2833
2833
  enterStyle: {
@@ -3062,9 +3062,9 @@ var require_useMedia_native = __commonJS({
3062
3062
  }
3063
3063
  return res;
3064
3064
  }
3065
- var getMediaImportanceIfMoreImportant = function(mediaKey, key, importancesUsed, isSizeMedia) {
3066
- var importance = isSizeMedia && !(0, import_config.getSetting)("mediaPropOrder") ? getMediaKeyImportance(mediaKey) : defaultMediaImportance;
3067
- return !importancesUsed[key] || importance > importancesUsed[key] ? importance : null;
3065
+ var getMediaImportanceIfMoreImportant = function(mediaKey, key, styleState, isSizeMedia) {
3066
+ var importance = isSizeMedia && !(0, import_config.getSetting)("mediaPropOrder") ? getMediaKeyImportance(mediaKey) : defaultMediaImportance, usedKeys = styleState.usedKeys;
3067
+ return !usedKeys[key] || importance > usedKeys[key] ? importance : null;
3068
3068
  };
3069
3069
  function camelToHyphen(str) {
3070
3070
  return str.replace(/[A-Z]/g, function(m) {
@@ -3285,6 +3285,80 @@ var require_index_native11 = __commonJS({
3285
3285
  }
3286
3286
  });
3287
3287
 
3288
+ // ../../packages/is-equal-shallow/dist/cjs/index.native.js
3289
+ var require_index_native12 = __commonJS({
3290
+ "../../packages/is-equal-shallow/dist/cjs/index.native.js"(exports2, module2) {
3291
+ "use strict";
3292
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3293
+ for (var name in all) __defProp2(target, name, {
3294
+ get: all[name],
3295
+ enumerable: !0
3296
+ });
3297
+ }, __copyProps2 = function(to, from, except, desc) {
3298
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3299
+ if (from && typeof from == "object" || typeof from == "function") try {
3300
+ for (var _loop = function() {
3301
+ var key = _step.value;
3302
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3303
+ get: function() {
3304
+ return from[key];
3305
+ },
3306
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3307
+ });
3308
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3309
+ } catch (err) {
3310
+ _didIteratorError = !0, _iteratorError = err;
3311
+ } finally {
3312
+ try {
3313
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3314
+ } finally {
3315
+ if (_didIteratorError)
3316
+ throw _iteratorError;
3317
+ }
3318
+ }
3319
+ return to;
3320
+ }, __toCommonJS2 = function(mod) {
3321
+ return __copyProps2(__defProp2({}, "__esModule", {
3322
+ value: !0
3323
+ }), mod);
3324
+ }, index_exports2 = {};
3325
+ __export2(index_exports2, {
3326
+ isEqualShallow: function() {
3327
+ return isEqualShallow;
3328
+ },
3329
+ mergeIfNotShallowEqual: function() {
3330
+ return mergeIfNotShallowEqual;
3331
+ },
3332
+ useCreateShallowSetState: function() {
3333
+ return useCreateShallowSetState;
3334
+ }
3335
+ });
3336
+ module2.exports = __toCommonJS2(index_exports2);
3337
+ var import_react3 = require("react");
3338
+ function useCreateShallowSetState(setter, debug) {
3339
+ return (0, import_react3.useCallback)(function(stateOrGetState) {
3340
+ setter(function(prev) {
3341
+ var next = typeof stateOrGetState == "function" ? stateOrGetState(prev) : stateOrGetState, update = mergeIfNotShallowEqual(prev, next);
3342
+ return update;
3343
+ });
3344
+ }, [
3345
+ setter,
3346
+ debug
3347
+ ]);
3348
+ }
3349
+ function mergeIfNotShallowEqual(prev, next) {
3350
+ return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
3351
+ ...prev,
3352
+ ...next
3353
+ };
3354
+ }
3355
+ function isEqualShallow(prev, next) {
3356
+ for (var key in next) if (prev[key] !== next[key]) return !1;
3357
+ return !0;
3358
+ }
3359
+ }
3360
+ });
3361
+
3288
3362
  // ../../core/web/dist/cjs/constants/isDevTools.native.js
3289
3363
  var require_isDevTools_native = __commonJS({
3290
3364
  "../../core/web/dist/cjs/constants/isDevTools.native.js"(exports2, module2) {
@@ -3528,13 +3602,55 @@ var require_ComponentContext_native = __commonJS({
3528
3602
  inText: !1,
3529
3603
  language: null,
3530
3604
  animationDriver: null,
3531
- setParentFocusState: null,
3532
- groups: {
3533
- emit: null,
3534
- subscribe: null,
3535
- state: {}
3605
+ setParentFocusState: null
3606
+ });
3607
+ }
3608
+ });
3609
+
3610
+ // ../../core/web/dist/cjs/contexts/GroupContext.native.js
3611
+ var require_GroupContext_native = __commonJS({
3612
+ "../../core/web/dist/cjs/contexts/GroupContext.native.js"(exports2, module2) {
3613
+ "use strict";
3614
+ var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
3615
+ for (var name in all) __defProp2(target, name, {
3616
+ get: all[name],
3617
+ enumerable: !0
3618
+ });
3619
+ }, __copyProps2 = function(to, from, except, desc) {
3620
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
3621
+ if (from && typeof from == "object" || typeof from == "function") try {
3622
+ for (var _loop = function() {
3623
+ var key = _step.value;
3624
+ !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
3625
+ get: function() {
3626
+ return from[key];
3627
+ },
3628
+ enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
3629
+ });
3630
+ }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
3631
+ } catch (err) {
3632
+ _didIteratorError = !0, _iteratorError = err;
3633
+ } finally {
3634
+ try {
3635
+ !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
3636
+ } finally {
3637
+ if (_didIteratorError)
3638
+ throw _iteratorError;
3639
+ }
3640
+ }
3641
+ return to;
3642
+ }, __toCommonJS2 = function(mod) {
3643
+ return __copyProps2(__defProp2({}, "__esModule", {
3644
+ value: !0
3645
+ }), mod);
3646
+ }, GroupContext_exports = {};
3647
+ __export2(GroupContext_exports, {
3648
+ GroupContext: function() {
3649
+ return GroupContext2;
3536
3650
  }
3537
3651
  });
3652
+ module2.exports = __toCommonJS2(GroupContext_exports);
3653
+ var import_react3 = require("react"), GroupContext2 = /* @__PURE__ */ (0, import_react3.createContext)(null);
3538
3654
  }
3539
3655
  });
3540
3656
 
@@ -4443,7 +4559,7 @@ var require_normalize_color = __commonJS({
4443
4559
  });
4444
4560
 
4445
4561
  // ../../core/normalize-css-color/dist/cjs/index.native.js
4446
- var require_index_native12 = __commonJS({
4562
+ var require_index_native13 = __commonJS({
4447
4563
  "../../core/normalize-css-color/dist/cjs/index.native.js"(exports2, module2) {
4448
4564
  "use strict";
4449
4565
  var __create2 = Object.create, __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __getProtoOf2 = Object.getPrototypeOf, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
@@ -4566,7 +4682,7 @@ var require_normalizeColor_native = __commonJS({
4566
4682
  }
4567
4683
  });
4568
4684
  module2.exports = __toCommonJS2(normalizeColor_exports);
4569
- var import_normalize_css_color = require_index_native12(), import_normalize_css_color2 = require_index_native12(), normalizeColor = function(color, opacity) {
4685
+ var import_normalize_css_color = require_index_native13(), import_normalize_css_color2 = require_index_native13(), normalizeColor = function(color, opacity) {
4570
4686
  if (color) {
4571
4687
  if (color[0] === "$") return color;
4572
4688
  if (color.startsWith("var(")) {
@@ -6127,7 +6243,7 @@ var require_getSplitStyles_native = __commonJS({
6127
6243
  function isValidStyleKey(key, validStyles, accept) {
6128
6244
  return key in validStyles ? !0 : accept && key in accept;
6129
6245
  }
6130
- var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, elementType, startedUnhydrated, debug) {
6246
+ var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug) {
6131
6247
  var _loop = function(keyOg2) {
6132
6248
  var keyInit = keyOg2, valInit = props[keyInit];
6133
6249
  if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
@@ -6136,12 +6252,12 @@ var require_getSplitStyles_native = __commonJS({
6136
6252
  var accepted = accept[keyInit];
6137
6253
  if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") return viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass), "continue";
6138
6254
  }
6139
- if (disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className" || keyInit in usedKeys) return "continue";
6255
+ if (disableExpandShorthands || keyInit in shorthands && (keyInit = shorthands[keyInit]), keyInit === "className") return "continue";
6140
6256
  if (keyInit in import_skipProps.skipProps && !noSkip && !isHOC) {
6141
6257
  if (keyInit === "group" && !1) var identifier2, containerType, containerCSS;
6142
6258
  return "continue";
6143
6259
  }
6144
- var valInitType = typeof valInit, isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept);
6260
+ var isValidStyleKeyInit = isValidStyleKey(keyInit, validStyles, accept);
6145
6261
  if (0) var _viewProps2, _dataSet;
6146
6262
  if (!isValidStyleKeyInit) {
6147
6263
  if (!import_constants4.isAndroid && keyInit === "elevationAndroid") return "continue";
@@ -6155,13 +6271,13 @@ var require_getSplitStyles_native = __commonJS({
6155
6271
  if (0) var didUseKeyInit;
6156
6272
  var isVariant = !isValidStyleKeyInit && variants && keyInit in variants, isStyleLikeKey = isValidStyleKeyInit || isVariant, isPseudo = keyInit in import_helpers.validPseudoKeys, isMedia = !isStyleLikeKey && !isPseudo && (0, import_useMedia.isMediaKey)(keyInit), isMediaOrPseudo = !!(isMedia || isPseudo);
6157
6273
  if (isMediaOrPseudo && keyInit.startsWith("$group-")) {
6158
- var parts = keyInit.split("-");
6274
+ var parts = keyInit.split("-"), plen = parts.length;
6159
6275
  if (
6160
6276
  // check if its actually a simple group selector to avoid breaking selectors
6161
- parts.length === 2 || parts.length === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
6277
+ plen === 2 || plen === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
6162
6278
  ) {
6163
6279
  var name2 = parts[1];
6164
- componentContext != null && componentContext.groups.subscribe && !(componentContext != null && componentContext.groups.state[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
6280
+ groupContext && !(groupContext != null && groupContext[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
6165
6281
  }
6166
6282
  }
6167
6283
  var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand;
@@ -6177,13 +6293,13 @@ var require_getSplitStyles_native = __commonJS({
6177
6293
  viewProps[key4] = val2;
6178
6294
  return;
6179
6295
  }
6180
- if (val2 != null && !(key4 in usedKeys)) {
6296
+ if (val2 != null) {
6181
6297
  if (key4 === "pointerEvents") {
6182
6298
  viewProps[key4] = val2;
6183
6299
  return;
6184
6300
  }
6185
6301
  if (!isHOC && isValidStyleKey(key4, validStyles, accept) || import_constants4.isAndroid && key4 === "elevation") {
6186
- mergeStyle(styleState, key4, val2);
6302
+ mergeStyle(styleState, key4, val2, 1);
6187
6303
  return;
6188
6304
  }
6189
6305
  if (isPseudo = key4 in import_helpers.validPseudoKeys, isMedia = !isPseudo && (0, import_useMedia.isMediaKey)(key4), isMediaOrPseudo = !!(isMedia || isPseudo), isVariant = variants && key4 in variants, inlineProps != null && inlineProps.has(key4) || process.env.IS_STATIC === "is_static" && inlineWhenUnflattened != null && inlineWhenUnflattened.has(key4)) {
@@ -6212,7 +6328,7 @@ var require_getSplitStyles_native = __commonJS({
6212
6328
  try {
6213
6329
  for (var _iterator2 = pseudoStyles[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
6214
6330
  var psuedoStyle = _step2.value, fullKey = `${psuedoStyle[import_helpers.StyleObjectProperty]}${PROP_SPLIT}${descriptor.name}`;
6215
- fullKey in usedKeys || (addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers.StyleObjectIdentifier]);
6331
+ addStyleToInsertRules(rulesToInsert, psuedoStyle), classNames[fullKey] = psuedoStyle[import_helpers.StyleObjectIdentifier];
6216
6332
  }
6217
6333
  } catch (err) {
6218
6334
  _didIteratorError2 = !0, _iteratorError2 = err;
@@ -6232,19 +6348,19 @@ var require_getSplitStyles_native = __commonJS({
6232
6348
  var _$val = pseudoStyleObject[pkey];
6233
6349
  if (isDisabled) applyDefaultStyle(pkey, styleState);
6234
6350
  else {
6235
- var curImportance = usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
6351
+ var curImportance = styleState.usedKeys[pkey] || 0, shouldMerge = importance >= curImportance;
6236
6352
  if (shouldMerge) {
6237
6353
  if (process.env.IS_STATIC === "is_static") {
6238
6354
  var _pseudos1, _key1;
6239
6355
  pseudos || (pseudos = {}), (_pseudos1 = pseudos)[_key1 = key4] || (_pseudos1[_key1] = {}), pseudos[key4][pkey] = _$val;
6240
6356
  }
6241
- mergeStyle(styleState, pkey, _$val);
6357
+ mergeStyle(styleState, pkey, _$val, importance);
6242
6358
  }
6243
6359
  }
6244
6360
  }
6245
6361
  if (!isDisabled) for (var _$key in val2) {
6246
6362
  var k = shorthands[_$key] || _$key;
6247
- usedKeys[k] = Math.max(importance, usedKeys[k] || 0);
6363
+ styleState.usedKeys[k] = Math.max(importance, styleState.usedKeys[k] || 0);
6248
6364
  }
6249
6365
  }
6250
6366
  return;
@@ -6253,21 +6369,20 @@ var require_getSplitStyles_native = __commonJS({
6253
6369
  if (!val2) return;
6254
6370
  var hasSpace = val2.space, mediaKeyShort = key4.slice(isMedia == "theme" ? 7 : 1);
6255
6371
  if (hasMedia || (hasMedia = !0), (hasSpace || !shouldDoClasses || styleProps.willBeAnimated) && ((!hasMedia || typeof hasMedia == "boolean") && (hasMedia = /* @__PURE__ */ new Set()), hasMedia.add(mediaKeyShort)), isMedia === "platform" && !(0, import_isActivePlatform.isActivePlatform)(key4)) return;
6256
- if (shouldDoClasses) {
6372
+ var priority = mediaStylesSeen;
6373
+ if (mediaStylesSeen += 1, shouldDoClasses) {
6257
6374
  var mediaStyle = getSubStyle(styleState, key4, val2, !1);
6258
6375
  if (hasSpace && (delete mediaStyle.space, mediaState3[mediaKeyShort])) {
6259
- var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", usedKeys, !0);
6260
- importance1 && (space = val2.space, usedKeys.space = importance1);
6376
+ var importance1 = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKeyShort, "space", styleState, !0);
6377
+ importance1 && (space = val2.space, styleState.usedKeys.space = importance1);
6261
6378
  }
6262
- var mediaStyles = (0, import_getCSSStylesAtomic.getCSSStylesAtomic)(mediaStyle), priority = mediaStylesSeen;
6263
- mediaStylesSeen += 1;
6264
- var _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
6379
+ var mediaStyles = (0, import_getCSSStylesAtomic.getCSSStylesAtomic)(mediaStyle), _iteratorNormalCompletion12 = !0, _didIteratorError12 = !1, _iteratorError12 = void 0;
6265
6380
  try {
6266
6381
  for (var _iterator12 = mediaStyles[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = !0) {
6267
6382
  var style3 = _step12.value, property = style3[import_helpers.StyleObjectProperty], isSubStyle = property[0] === "$";
6268
6383
  if (!(isSubStyle && !(0, import_isActivePlatform.isActivePlatform)(property))) {
6269
6384
  var out = (0, import_createMediaStyle.createMediaStyle)(style3, mediaKeyShort, import_useMedia.mediaQueryConfig, isMedia, !1, priority), subKey = isSubStyle ? style3[2] : "", fullKey1 = `${style3[import_helpers.StyleObjectProperty]}${subKey}${PROP_SPLIT}${mediaKeyShort}${style3[import_helpers.StyleObjectPseudo] || ""}`;
6270
- fullKey1 in usedKeys || (addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers.StyleObjectIdentifier]);
6385
+ addStyleToInsertRules(rulesToInsert, out), classNames[fullKey1] = out[import_helpers.StyleObjectIdentifier];
6271
6386
  }
6272
6387
  }
6273
6388
  } catch (err) {
@@ -6283,7 +6398,7 @@ var require_getSplitStyles_native = __commonJS({
6283
6398
  var mergeMediaStyle2 = function(key5, val3) {
6284
6399
  var _styleState4;
6285
6400
  (_styleState4 = styleState).style || (_styleState4.style = {});
6286
- var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, usedKeys, mediaState3[mediaKeyShort], importanceBump, debug);
6401
+ var didMerge = mergeMediaByImportance(styleState, mediaKeyShort, key5, val3, mediaState3[mediaKeyShort], importanceBump, debug);
6287
6402
  didMerge && key5 === "fontFamily" && (styleState.fontFamily = mediaStyle1.fontFamily);
6288
6403
  }, mergeMediaStyle = mergeMediaStyle2, isThemeMedia = isMedia === "theme", isGroupMedia = isMedia === "group", isPlatformMedia = isMedia === "platform";
6289
6404
  if (!isThemeMedia && !isPlatformMedia && !isGroupMedia && !mediaState3[mediaKeyShort])
@@ -6300,27 +6415,28 @@ var require_getSplitStyles_native = __commonJS({
6300
6415
  scheme,
6301
6416
  val: _$val1,
6302
6417
  oppositeVal
6303
- }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1]);
6418
+ }), mergeStyle(styleState, subKey1, mediaStyle1[subKey1], priority);
6304
6419
  }
6305
6420
  } else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
6306
6421
  } else if (isGroupMedia) {
6307
- var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = componentContext == null ? void 0 : componentContext.groups.state[groupName];
6308
- if (!groupContext)
6422
+ var _groupContext_groupName, _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupState = groupContext == null || (_groupContext_groupName = groupContext[groupName]) === null || _groupContext_groupName === void 0 ? void 0 : _groupContext_groupName.state;
6423
+ if (!groupState)
6309
6424
  return;
6310
6425
  var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
6311
6426
  if (groupMediaKey) {
6312
6427
  mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
6313
6428
  var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
6314
- if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), !isActive) {
6429
+ if (!mediaState1 && groupState.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupState.layout)), !isActive) {
6315
6430
  for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
6316
6431
  return;
6317
6432
  }
6318
6433
  importanceBump = 2;
6319
6434
  }
6320
6435
  if (groupPseudoKey) {
6436
+ var _this;
6321
6437
  pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
6322
- var componentGroupPseudoState = (componentGroupState || // fallback to context initially
6323
- componentContext.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
6438
+ var componentGroupPseudoState = (_this = componentGroupState || // fallback to context initially
6439
+ (groupContext == null ? void 0 : groupContext[groupName].state)) === null || _this === void 0 ? void 0 : _this.pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
6324
6440
  if (!isActive1) {
6325
6441
  for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
6326
6442
  return;
@@ -6351,7 +6467,7 @@ var require_getSplitStyles_native = __commonJS({
6351
6467
  conf = conf || (0, import_config.getConfig)();
6352
6468
  var animationDriver = (componentContext == null ? void 0 : componentContext.animationDriver) || conf.animations;
6353
6469
  import_constants4.isWeb && styleProps.isAnimated && animationDriver.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
6354
- var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState3 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants4.isWeb && !styleProps.noClass && !styleProps.isAnimated, rulesToInsert = void 0, classNames = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles), styleState = {
6470
+ var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState3 = styleProps.mediaState || import_useMedia.mediaState, shouldDoClasses = acceptsClassName && import_constants4.isWeb && !styleProps.noClass && !styleProps.isAnimated, rulesToInsert = void 0, classNames = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers.stylePropsText : import_helpers.validStyles), styleState = {
6355
6471
  classNames,
6356
6472
  conf,
6357
6473
  props,
@@ -6360,7 +6476,7 @@ var require_getSplitStyles_native = __commonJS({
6360
6476
  staticConfig,
6361
6477
  style: null,
6362
6478
  theme,
6363
- usedKeys,
6479
+ usedKeys: {},
6364
6480
  viewProps,
6365
6481
  context: componentContext,
6366
6482
  debug
@@ -6468,11 +6584,11 @@ var require_getSplitStyles_native = __commonJS({
6468
6584
  mergeTransform(target, key, val, !0);
6469
6585
  });
6470
6586
  }
6471
- function mergeStyle(styleState, key, val) {
6472
- var disableNormalize = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : !1, { viewProps, styleProps, staticConfig } = styleState;
6473
- if (key in import_helpers.stylePropsTransform) {
6587
+ function mergeStyle(styleState, key, val, importance) {
6588
+ var disableNormalize = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, { viewProps, styleProps, staticConfig, usedKeys } = styleState, existingImportance = usedKeys[key] || 0;
6589
+ if (!(existingImportance > importance)) if (key in import_helpers.stylePropsTransform) {
6474
6590
  var _styleState;
6475
- (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), styleState.flatTransforms[key] = val;
6591
+ (_styleState = styleState).flatTransforms || (_styleState.flatTransforms = {}), usedKeys[key] = importance, styleState.flatTransforms[key] = val;
6476
6592
  } else {
6477
6593
  var shouldNormalize = import_constants4.isWeb && !disableNormalize && !styleProps.noNormalize, out = shouldNormalize ? (0, import_normalizeValueWithProperty.normalizeValueWithProperty)(val, key) : val;
6478
6594
  if (
@@ -6481,7 +6597,7 @@ var require_getSplitStyles_native = __commonJS({
6481
6597
  ) viewProps[key] = out;
6482
6598
  else {
6483
6599
  var _styleState1;
6484
- (_styleState1 = styleState).style || (_styleState1.style = {}), styleState.style[key] = // if you dont do this you'll be passing props.transform arrays directly here and then mutating them
6600
+ (_styleState1 = styleState).style || (_styleState1.style = {}), usedKeys[key] = importance, styleState.style[key] = // if you dont do this you'll be passing props.transform arrays directly here and then mutating them
6485
6601
  // if theres any flatTransforms later, causing issues (mutating props is bad, in strict mode styles get borked)
6486
6602
  key === "transform" && Array.isArray(out) ? [
6487
6603
  ...out
@@ -6512,8 +6628,8 @@ var require_getSplitStyles_native = __commonJS({
6512
6628
  }
6513
6629
  return styleProps.noNormalize || (0, import_expandStyles.fixStyles)(styleOut), styleOut;
6514
6630
  }, useInsertEffectCompat = import_constants4.isWeb ? import_react3.default.useInsertionEffect || import_constants4.useIsomorphicLayoutEffect : function() {
6515
- }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k) {
6516
- var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k);
6631
+ }, useSplitStyles = function(a, b, c, d, e, f, g, h, i, j, k, l) {
6632
+ var res = getSplitStyles(a, b, c, d, e, f, g, h, i, j, k, l);
6517
6633
  return res;
6518
6634
  };
6519
6635
  function addStyleToInsertRules(rulesToInsert, styleObject) {
@@ -6558,14 +6674,14 @@ var require_getSplitStyles_native = __commonJS({
6558
6674
  delete viewProps[key], viewProps[key] = next;
6559
6675
  } else viewProps[key] = val;
6560
6676
  }
6561
- function mergeMediaByImportance(styleState, mediaKey, key, value, importancesUsed, isSizeMedia, importanceBump, debugProp) {
6562
- var importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, importancesUsed, isSizeMedia);
6677
+ function mergeMediaByImportance(styleState, mediaKey, key, value, isSizeMedia, importanceBump, debugProp) {
6678
+ var usedKeys = styleState.usedKeys, importance = (0, import_useMedia.getMediaImportanceIfMoreImportant)(mediaKey, key, styleState, isSizeMedia);
6563
6679
  if (importanceBump && (importance = (importance || 0) + importanceBump), importance === null) return !1;
6564
- if (importancesUsed[key] = importance, key in import_pseudoDescriptors.pseudoDescriptors) {
6680
+ if (key in import_pseudoDescriptors.pseudoDescriptors) {
6565
6681
  var descriptor = import_pseudoDescriptors.pseudoDescriptors[key], descriptorKey = descriptor.stateKey || descriptor.name, isDisabled = styleState.componentState[descriptorKey] === !1;
6566
6682
  if (isDisabled) return !1;
6567
- for (var subKey in value) mergeStyle(styleState, subKey, value[subKey]);
6568
- } else mergeStyle(styleState, key, value);
6683
+ for (var subKey in value) mergeStyle(styleState, subKey, value[subKey], importance);
6684
+ } else mergeStyle(styleState, key, value, importance);
6569
6685
  return !0;
6570
6686
  }
6571
6687
  function normalizeStyle(style) {
@@ -6578,7 +6694,7 @@ var require_getSplitStyles_native = __commonJS({
6578
6694
  }
6579
6695
  function applyDefaultStyle(pkey, styleState) {
6580
6696
  var defaultValues = animatableDefaults[pkey];
6581
- defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues);
6697
+ defaultValues != null && !(pkey in styleState.usedKeys) && (!styleState.style || !(pkey in styleState.style)) && mergeStyle(styleState, pkey, defaultValues, 1);
6582
6698
  }
6583
6699
  }
6584
6700
  });
@@ -6699,79 +6815,6 @@ var require_setElementProps_native = __commonJS({
6699
6815
  }
6700
6816
  });
6701
6817
 
6702
- // ../../packages/is-equal-shallow/dist/cjs/index.native.js
6703
- var require_index_native13 = __commonJS({
6704
- "../../packages/is-equal-shallow/dist/cjs/index.native.js"(exports2, module2) {
6705
- "use strict";
6706
- var __defProp2 = Object.defineProperty, __getOwnPropDesc2 = Object.getOwnPropertyDescriptor, __getOwnPropNames2 = Object.getOwnPropertyNames, __hasOwnProp2 = Object.prototype.hasOwnProperty, __export2 = function(target, all) {
6707
- for (var name in all) __defProp2(target, name, {
6708
- get: all[name],
6709
- enumerable: !0
6710
- });
6711
- }, __copyProps2 = function(to, from, except, desc) {
6712
- var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
6713
- if (from && typeof from == "object" || typeof from == "function") try {
6714
- for (var _loop = function() {
6715
- var key = _step.value;
6716
- !__hasOwnProp2.call(to, key) && key !== except && __defProp2(to, key, {
6717
- get: function() {
6718
- return from[key];
6719
- },
6720
- enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
6721
- });
6722
- }, _iterator = __getOwnPropNames2(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
6723
- } catch (err) {
6724
- _didIteratorError = !0, _iteratorError = err;
6725
- } finally {
6726
- try {
6727
- !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
6728
- } finally {
6729
- if (_didIteratorError)
6730
- throw _iteratorError;
6731
- }
6732
- }
6733
- return to;
6734
- }, __toCommonJS2 = function(mod) {
6735
- return __copyProps2(__defProp2({}, "__esModule", {
6736
- value: !0
6737
- }), mod);
6738
- }, index_exports2 = {};
6739
- __export2(index_exports2, {
6740
- isEqualShallow: function() {
6741
- return isEqualShallow;
6742
- },
6743
- mergeIfNotShallowEqual: function() {
6744
- return mergeIfNotShallowEqual;
6745
- },
6746
- useCreateShallowSetState: function() {
6747
- return useCreateShallowSetState;
6748
- }
6749
- });
6750
- module2.exports = __toCommonJS2(index_exports2);
6751
- var import_react3 = require("react");
6752
- function useCreateShallowSetState(setter, debugIn) {
6753
- return (0, import_react3.useCallback)(function(next) {
6754
- setter(function(prev) {
6755
- return mergeIfNotShallowEqual(prev, next, debugIn);
6756
- });
6757
- }, [
6758
- setter,
6759
- debugIn
6760
- ]);
6761
- }
6762
- function mergeIfNotShallowEqual(prev, next, debug) {
6763
- return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
6764
- ...prev,
6765
- ...next
6766
- };
6767
- }
6768
- function isEqualShallow(prev, next) {
6769
- for (var key in next) if (prev[key] !== next[key]) return !1;
6770
- return !0;
6771
- }
6772
- }
6773
- });
6774
-
6775
6818
  // ../../core/web/dist/cjs/helpers/subscribeToContextGroup.native.js
6776
6819
  var require_subscribeToContextGroup_native = __commonJS({
6777
6820
  "../../core/web/dist/cjs/helpers/subscribeToContextGroup.native.js"(exports2, module2) {
@@ -6815,31 +6858,57 @@ var require_subscribeToContextGroup_native = __commonJS({
6815
6858
  }
6816
6859
  });
6817
6860
  module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
6818
- var import_useMedia = require_useMedia_native(), import_is_equal_shallow = require_index_native13(), subscribeToContextGroup = function(param) {
6819
- var { setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
6861
+ var import_is_equal_shallow = require_index_native12(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(props) {
6862
+ var { pseudoGroups, mediaGroups, groupContext } = props;
6820
6863
  if (pseudoGroups || mediaGroups) {
6821
- var _componentContext_groups_subscribe, _componentContext_groups;
6822
- return (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
6823
- var { layout, pseudo } = param2, _state_group, current = ((_state_group = state.group) === null || _state_group === void 0 ? void 0 : _state_group[name]) || {
6864
+ var disposables = /* @__PURE__ */ new Set();
6865
+ if (pseudoGroups) for (var _i = 0, _iter = [
6866
+ ...pseudoGroups
6867
+ ]; _i < _iter.length; _i++) {
6868
+ var name = _iter[_i];
6869
+ disposables.add(createGroupListener(name, props));
6870
+ }
6871
+ if (mediaGroups) for (var _i1 = 0, _iter1 = [
6872
+ ...mediaGroups
6873
+ ]; _i1 < _iter1.length; _i1++) {
6874
+ var name1 = _iter1[_i1];
6875
+ disposables.add(createGroupListener(name1, props));
6876
+ }
6877
+ return function() {
6878
+ disposables.forEach(function(d) {
6879
+ return d();
6880
+ });
6881
+ };
6882
+ }
6883
+ }, createGroupListener = function(name, param) {
6884
+ var { setStateShallow, pseudoGroups, mediaGroups, groupContext } = param, parent = groupContext == null ? void 0 : groupContext[name];
6885
+ return parent ? parent.subscribe(function(param2) {
6886
+ var { layout, pseudo } = param2;
6887
+ setStateShallow(function(prev) {
6888
+ var _prev_group, didChange = !1, group = ((_prev_group = prev.group) === null || _prev_group === void 0 ? void 0 : _prev_group[name]) || {
6824
6889
  pseudo: {},
6825
6890
  media: {}
6826
6891
  };
6827
- if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
6828
- else if (layout && mediaGroups) {
6829
- var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(current.media || {}, mediaState3);
6830
- next !== current.media && (Object.assign(current.media, next), persist());
6831
- }
6832
- function persist() {
6833
- var group = {
6834
- ...state.group,
6835
- [name]: current
6836
- };
6837
- setStateShallow({
6838
- group
6839
- });
6892
+ if (pseudo && pseudoGroups != null && pseudoGroups.has(name)) {
6893
+ var _group;
6894
+ (_group = group).pseudo || (_group.pseudo = {});
6895
+ var next = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(group.pseudo, pseudo);
6896
+ next !== group.pseudo && (Object.assign(group.pseudo, pseudo), didChange = !0);
6897
+ } else if (layout && mediaGroups) {
6898
+ var _group1;
6899
+ (_group1 = group).media || (_group1.media = {});
6900
+ var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next1 = (0, import_is_equal_shallow.mergeIfNotShallowEqual)(group.media, mediaState3);
6901
+ next1 !== group.media && (Object.assign(group.media, next1), didChange = !0);
6840
6902
  }
6903
+ return didChange ? {
6904
+ group: {
6905
+ ...prev.group,
6906
+ [name]: group
6907
+ }
6908
+ } : prev;
6841
6909
  });
6842
- }
6910
+ }) : function() {
6911
+ };
6843
6912
  };
6844
6913
  }
6845
6914
  });
@@ -7800,8 +7869,8 @@ var require_useComponentState_native = __commonJS({
7800
7869
  }
7801
7870
  });
7802
7871
  module2.exports = __toCommonJS2(useComponentState_exports);
7803
- var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native13(), import_use_did_finish_ssr = require_index_native14(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
7804
- var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), needsHydration = !(0, import_use_did_finish_ssr.useIsClientOnly)(), [startedUnhydrated] = (0, import_react3.useState)(needsHydration && !isHydrated), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7872
+ var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native12(), import_use_did_finish_ssr = require_index_native14(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, animationDriver, staticConfig, config) {
7873
+ var _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), needsHydration = !(0, import_use_did_finish_ssr.useIsClientOnly)(), [startedUnhydrated] = (0, import_react3.useState)(needsHydration && !isHydrated), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7805
7874
  stateRef.current || (stateRef.current = {});
7806
7875
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSS = animationDriver == null ? void 0 : animationDriver.supportsCSS, curStateRef = stateRef.current;
7807
7876
  !needsHydration && hasAnimationProp && (curStateRef.hasAnimated = !0);
@@ -7824,9 +7893,7 @@ var require_useComponentState_native = __commonJS({
7824
7893
  var states = (0, import_react3.useState)(initialState), state = props.forceStyle ? {
7825
7894
  ...states[0],
7826
7895
  [props.forceStyle]: !0
7827
- } : states[0], setState = states[1];
7828
- stateRef.current.nextComponentState && (Object.assign(state, stateRef.current.nextComponentState), stateRef.current.nextComponentState = void 0);
7829
- var isAnimated = willBeAnimated;
7896
+ } : states[0], setState = states[1], isAnimated = willBeAnimated;
7830
7897
  import_constants4.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), state.disabled = disabled, setState(function(_) {
7831
7898
  return {
7832
7899
  ...state
@@ -7844,46 +7911,6 @@ var require_useComponentState_native = __commonJS({
7844
7911
  var isAnimatedAndHydrated = isAnimated && !supportsCSS, isClassNameDisabled = !staticConfig.acceptsClassName && (config.disableSSR || !state.unmounted), isDisabledManually = disableClassName && !state.unmounted;
7845
7912
  (isAnimatedAndHydrated || isDisabledManually || isClassNameDisabled) && (noClass = !0);
7846
7913
  }
7847
- if (groupName && !curStateRef.group) {
7848
- var listeners = /* @__PURE__ */ new Set();
7849
- curStateRef.group = {
7850
- listeners,
7851
- emit(name, state2) {
7852
- listeners.forEach(function(l) {
7853
- return l(name, state2);
7854
- });
7855
- },
7856
- subscribe(cb) {
7857
- return listeners.add(cb), setStateShallow({
7858
- hasDynGroupChildren: !0
7859
- }), function() {
7860
- listeners.delete(cb), listeners.size === 0 && setStateShallow({
7861
- hasDynGroupChildren: !1
7862
- });
7863
- };
7864
- }
7865
- };
7866
- }
7867
- if (!curStateRef.stateEmitter && hasAnimationProp) {
7868
- var listeners1 = /* @__PURE__ */ new Set();
7869
- curStateRef.stateEmitter = {
7870
- listeners: listeners1,
7871
- emit(state2) {
7872
- listeners1.forEach(function(l) {
7873
- return l(state2);
7874
- });
7875
- },
7876
- subscribe(cb) {
7877
- return listeners1.add(cb), setStateShallow({
7878
- hasDynGroupChildren: !0
7879
- }), function() {
7880
- listeners1.delete(cb), listeners1.size === 0 && setStateShallow({
7881
- hasDynGroupChildren: !1
7882
- });
7883
- };
7884
- }
7885
- };
7886
- }
7887
7914
  return {
7888
7915
  startedUnhydrated,
7889
7916
  curStateRef,
@@ -8133,17 +8160,26 @@ var require_createComponent_native = __commonJS({
8133
8160
  }
8134
8161
  });
8135
8162
  module2.exports = __toCommonJS2(createComponent_exports);
8136
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), componentSetStates = /* @__PURE__ */ new Set();
8163
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_is_equal_shallow = require_index_native12(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_GroupContext = require_GroupContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), NextState = /* @__PURE__ */ new WeakMap(), componentSetStates = /* @__PURE__ */ new Set(), avoidReRenderKeys = /* @__PURE__ */ new Set([
8164
+ "hover",
8165
+ "press",
8166
+ "pressIn",
8167
+ "group",
8168
+ "focus",
8169
+ "focusWithin",
8170
+ "media",
8171
+ "group"
8172
+ ]);
8137
8173
  if (0) var cancelTouches;
8138
8174
  var BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
8139
8175
  value: !1
8140
8176
  };
8141
- import_constants4.isWeb && globalThis.document && (document.addEventListener("keydown", function() {
8142
- lastInteractionWasKeyboard.value = !0;
8177
+ import_constants4.isWeb && typeof document < "u" && (document.addEventListener("keydown", function() {
8178
+ lastInteractionWasKeyboard.value || (lastInteractionWasKeyboard.value = !0);
8143
8179
  }), document.addEventListener("mousedown", function() {
8144
- lastInteractionWasKeyboard.value = !1;
8180
+ lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
8145
8181
  }), document.addEventListener("mousemove", function() {
8146
- lastInteractionWasKeyboard.value = !1;
8182
+ lastInteractionWasKeyboard.value && (lastInteractionWasKeyboard.value = !1);
8147
8183
  }));
8148
8184
  function createComponent2(staticConfig) {
8149
8185
  var _staticConfig_defaultProps, { componentName } = staticConfig, config = null, defaultProps = staticConfig.defaultProps;
@@ -8168,7 +8204,7 @@ var require_createComponent_native = __commonJS({
8168
8204
  var _propsIn_datatestrenders, _current, _;
8169
8205
  (_ = (_propsIn_datatestrenders = propsIn["data-test-renders"])[_current = "current"]) !== null && _ !== void 0 || (_propsIn_datatestrenders[_current] = 0), propsIn["data-test-renders"].current += 1;
8170
8206
  }
8171
- var componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, { context, isReactNative } = staticConfig;
8207
+ var styledContextProps, overriddenContextProps, contextValue, { context, isReactNative } = staticConfig;
8172
8208
  if (context && (contextValue = import_react3.default.useContext(context), contextValue))
8173
8209
  for (var key in context.props) {
8174
8210
  var propVal = (0, import_getShorthandValue.getShorthandValue)(propsIn, key);
@@ -8187,21 +8223,65 @@ var require_createComponent_native = __commonJS({
8187
8223
  ...styledContextProps
8188
8224
  } : defaultProps, props = propsIn;
8189
8225
  curDefaultProps && (props = (0, import_mergeProps.mergeProps)(curDefaultProps, propsIn));
8190
- var componentName2 = props.componentName || staticConfig.componentName, animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config), { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, supportsCSS, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState, setStateShallow = componentState.setStateShallow, hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants4.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
8226
+ var componentName2 = props.componentName || staticConfig.componentName, componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), groupContextParent = import_react3.default.useContext(import_GroupContext.GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, animationDriver, staticConfig, config), { disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, supportsCSS, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState;
8227
+ hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders && (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8228
+ var pendingState = NextState.get(stateRef);
8229
+ pendingState && (setStateShallow(pendingState), NextState.set(stateRef, void 0));
8230
+ });
8231
+ var allGroupContexts = (0, import_react3.useMemo)(function() {
8232
+ var _stateRef_current_group;
8233
+ if (!groupName) return groupContextParent;
8234
+ (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.listeners.clear();
8235
+ var listeners = /* @__PURE__ */ new Set();
8236
+ return stateRef.current.group = {
8237
+ listeners,
8238
+ emit(state2) {
8239
+ listeners.forEach(function(l) {
8240
+ return l(state2);
8241
+ });
8242
+ },
8243
+ subscribe(cb) {
8244
+ return listeners.add(cb), listeners.size === 1 && setStateShallow({
8245
+ hasDynGroupChildren: !0
8246
+ }), function() {
8247
+ listeners.delete(cb), listeners.size === 0 && setStateShallow({
8248
+ hasDynGroupChildren: !1
8249
+ });
8250
+ };
8251
+ }
8252
+ }, {
8253
+ ...groupContextParent,
8254
+ [groupName]: {
8255
+ state: {
8256
+ pseudo: import_defaultComponentState.defaultComponentStateMounted
8257
+ },
8258
+ subscribe: function(listener) {
8259
+ var _stateRef_current_group2, dispose = (_stateRef_current_group2 = stateRef.current.group) === null || _stateRef_current_group2 === void 0 ? void 0 : _stateRef_current_group2.subscribe(listener);
8260
+ return function() {
8261
+ dispose == null || dispose();
8262
+ };
8263
+ }
8264
+ }
8265
+ };
8266
+ }, [
8267
+ stateRef,
8268
+ groupName,
8269
+ groupContextParent
8270
+ ]), setStateShallow = componentState.setStateShallow, hasTextAncestor = !!(import_constants4.isWeb && isText && componentContext.inText), isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants4.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
8191
8271
  animationDriver && isAnimated && // this should really be behind another prop as it's not really related to
8192
8272
  // "needsWebStyles" basically with motion we just animate a plain div, but
8193
8273
  // we still have animated.View/Text for Sheet which wants to control
8194
8274
  // things declaratively
8195
8275
  !animationDriver.needsWebStyles && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
8196
8276
  var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
8197
- props.themeShallow && (curStateRef.themeShallow = !0);
8277
+ props.themeShallow && (stateRef.current.themeShallow = !0);
8198
8278
  var themeStateProps = {
8199
8279
  componentName: componentName2,
8200
8280
  disable: disableTheme,
8201
- shallow: curStateRef.themeShallow,
8281
+ shallow: stateRef.current.themeShallow,
8202
8282
  debug: debugProp
8203
8283
  };
8204
- if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof curStateRef.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = function() {
8284
+ if ("themeInverse" in props && (themeStateProps.inverse = props.themeInverse), "theme" in props && (themeStateProps.name = props.theme), typeof stateRef.current.isListeningToTheme == "boolean" && (themeStateProps.needsUpdate = function() {
8205
8285
  return !!stateRef.current.isListeningToTheme;
8206
8286
  }), themeStateProps.deopt = willBeAnimated, !1) {
8207
8287
  var name, type, dataIs, banner;
@@ -8223,33 +8303,47 @@ var require_createComponent_native = __commonJS({
8223
8303
  willBeAnimated,
8224
8304
  styledContextProps,
8225
8305
  noMergeStyle: isAnimated && (animationDriver == null ? void 0 : animationDriver.needsWebStyles)
8226
- }, themeName = (themeState == null ? void 0 : themeState.name) || "", splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
8227
- if (hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders) {
8228
- var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
8229
- setStateShallow = function(next) {
8230
- var avoidReRenderKeys = /* @__PURE__ */ new Set([
8231
- "hover",
8232
- "press",
8233
- "pressIn"
8234
- ]), canAvoidReRender = Object.keys(next).every(function(key3) {
8235
- return avoidReRenderKeys.has(key3);
8306
+ }, themeName = (themeState == null ? void 0 : themeState.name) || "", splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), groupContext = groupName && (allGroupContexts == null ? void 0 : allGroupContexts[groupName]) || null;
8307
+ if (groupContext) {
8308
+ var groupState = groupContext == null ? void 0 : groupContext.state;
8309
+ if (groupState && groupState.layout === void 0) {
8310
+ var _splitStyles_style, _splitStyles_style1;
8311
+ (!((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0) && _splitStyles_style.width || !((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0) && _splitStyles_style1.height) && (groupState.layout = {
8312
+ width: fromPx(splitStyles.style.width),
8313
+ height: fromPx(splitStyles.style.height)
8236
8314
  });
8237
- if (canAvoidReRender && styleListener) {
8238
- var updatedState = {
8239
- ...state,
8240
- ...next
8241
- };
8242
- stateRef.current.nextComponentState = updatedState;
8243
- var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
8244
- styleListener(nextStyles.style);
8245
- } else ogSetStateShallow(next);
8315
+ }
8316
+ }
8317
+ if ((hasAnimationProp || groupName) && animationDriver != null && animationDriver.avoidReRenders) {
8318
+ var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
8319
+ stateRef.current.setStateShallow = function(nextOrGetNext) {
8320
+ var prev = NextState.get(stateRef) || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
8321
+ if (!(next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next))) {
8322
+ var canAvoidReRender = Object.keys(next).every(function(key3) {
8323
+ return avoidReRenderKeys.has(key3);
8324
+ });
8325
+ if (canAvoidReRender) {
8326
+ var updatedState = {
8327
+ ...prev,
8328
+ ...next
8329
+ };
8330
+ NextState.set(stateRef, updatedState);
8331
+ var { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
8332
+ if (groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState), !hasAnimationProp || !styleListener) return;
8333
+ var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
8334
+ styleListener(nextStyles.style);
8335
+ } else ogSetStateShallow(next);
8336
+ }
8337
+ }, setStateShallow = function(state2) {
8338
+ var _stateRef_current_setStateShallow, _stateRef_current;
8339
+ (_stateRef_current_setStateShallow = (_stateRef_current = stateRef.current).setStateShallow) === null || _stateRef_current_setStateShallow === void 0 || _stateRef_current_setStateShallow.call(_stateRef_current, state2);
8246
8340
  };
8247
8341
  }
8248
- if (props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
8342
+ if (props.group && props.untilMeasured === "hide" && !stateRef.current.hasMeasured) {
8249
8343
  var _splitStyles;
8250
8344
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
8251
8345
  }
8252
- curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
8346
+ splitStyles.dynamicThemeAccess != null && (stateRef.current.isListeningToTheme = splitStyles.dynamicThemeAccess);
8253
8347
  var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
8254
8348
  (0, import_useMedia.setMediaShouldUpdate)(componentContext, shouldListenForMedia, mediaListeningKeys);
8255
8349
  var { viewProps: viewPropsIn, pseudos, style: splitStylesStyle, classNames, space } = splitStyles, propsWithAnimation = props, {
@@ -8302,18 +8396,18 @@ var require_createComponent_native = __commonJS({
8302
8396
  });
8303
8397
  animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`), animations.ref && (animatedRef = animations.ref));
8304
8398
  }
8305
- groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
8306
- var layout = e.nativeEvent.layout;
8307
- stateRef.current.group.layout = layout, stateRef.current.group.emit(groupName, {
8399
+ groupContext && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
8400
+ var _stateRef_current_group, layout = e.nativeEvent.layout;
8401
+ groupContext.state.layout = layout, (_stateRef_current_group = stateRef.current.group) === null || _stateRef_current_group === void 0 || _stateRef_current_group.emit({
8308
8402
  layout
8309
8403
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
8310
8404
  return {
8311
8405
  ...prev
8312
8406
  };
8313
8407
  }), stateRef.current.hasMeasured = !0;
8314
- })), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, curStateRef.willHydrate)) || nonTamaguiProps, curStateRef.composedRef || (curStateRef.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
8408
+ })), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, stateRef.current.willHydrate)) || nonTamaguiProps, stateRef.current.composedRef || (stateRef.current.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
8315
8409
  return stateRef.current.host = x;
8316
- }, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = curStateRef.composedRef;
8410
+ }, forwardedRef, import_setElementProps.setElementProps, animatedRef)), viewProps.ref = stateRef.current.composedRef;
8317
8411
  var { pseudoGroups, mediaGroups } = splitStyles, unPress = function() {
8318
8412
  setStateShallow({
8319
8413
  press: !1,
@@ -8341,18 +8435,21 @@ var require_createComponent_native = __commonJS({
8341
8435
  });
8342
8436
  return;
8343
8437
  }
8344
- var dispose = !disabled && (pseudoGroups || mediaGroups) ? (0, import_subscribeToContextGroup.subscribeToContextGroup)({
8345
- componentContext,
8346
- setStateShallow,
8347
- state,
8348
- mediaGroups,
8349
- pseudoGroups
8350
- }) : null;
8351
8438
  return function() {
8352
- dispose == null || dispose(), componentSetStates.delete(setState);
8439
+ componentSetStates.delete(setState);
8353
8440
  };
8354
8441
  }, [
8355
8442
  state.unmounted,
8443
+ disabled
8444
+ ]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8445
+ if (!disabled && !(!pseudoGroups && !mediaGroups) && allGroupContexts) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
8446
+ groupContext: allGroupContexts,
8447
+ setStateShallow,
8448
+ mediaGroups,
8449
+ pseudoGroups
8450
+ });
8451
+ }, [
8452
+ allGroupContexts,
8356
8453
  disabled,
8357
8454
  pseudoGroups ? Object.keys([
8358
8455
  ...pseudoGroups
@@ -8360,24 +8457,13 @@ var require_createComponent_native = __commonJS({
8360
8457
  mediaGroups ? Object.keys([
8361
8458
  ...mediaGroups
8362
8459
  ]).join("") : 0
8363
- ]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8364
- var _curStateRef_group;
8365
- if (groupName) {
8366
- curStateRef.group.emit(groupName, {
8367
- pseudo: state,
8368
- layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
8369
- });
8370
- var groupContextState = componentContext == null ? void 0 : componentContext.groups;
8371
- if (groupContextState) {
8372
- var next = {
8373
- ...groupContextState[groupName],
8374
- ...state
8375
- };
8376
- groupContextState[groupName] = next;
8377
- }
8378
- }
8460
+ ]);
8461
+ var groupEmitter = stateRef.current.group;
8462
+ (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8463
+ !groupContext || !groupEmitter || notifyGroupSubscribers(groupContext, groupEmitter, state);
8379
8464
  }, [
8380
- groupName,
8465
+ groupContext,
8466
+ groupEmitter,
8381
8467
  state
8382
8468
  ]);
8383
8469
  var runtimePressStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur || componentContext.setParentFocusState), hasDynamicGroupChildren = !!(groupName && state.hasDynGroupChildren), attachPress = !!(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(hasDynamicGroupChildren || runtimeHoverStyle), attachHover = import_constants4.isWeb && !!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(hasDynamicGroupChildren || runtimePressStyle), events = shouldAttach ? {
@@ -8391,7 +8477,7 @@ var require_createComponent_native = __commonJS({
8391
8477
  },
8392
8478
  onMouseLeave: function(e) {
8393
8479
  var next = {};
8394
- needsHoverState && (next.hover = !1), needsPressState && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
8480
+ needsHoverState && (next.hover = !1), needsPressState && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
8395
8481
  }
8396
8482
  },
8397
8483
  onPressIn: attachPress ? function(e) {
@@ -8410,24 +8496,16 @@ var require_createComponent_native = __commonJS({
8410
8496
  },
8411
8497
  ...attachFocus && {
8412
8498
  onFocus: function(e) {
8413
- componentContext.setParentFocusState && componentContext.setParentFocusState({
8414
- focusWithin: !0
8415
- }), pseudos != null && pseudos.focusVisibleStyle ? setTimeout(function() {
8416
- setStateShallow({
8417
- focus: !0,
8418
- focusVisible: !!lastInteractionWasKeyboard.value
8419
- });
8420
- }, 0) : setStateShallow({
8421
- focus: !0,
8422
- focusVisible: !1
8423
- }), onFocus == null || onFocus(e);
8499
+ var next = {};
8500
+ componentContext.setParentFocusState && (next.focusWithin = !0), pseudos != null && pseudos.focusVisibleStyle && lastInteractionWasKeyboard.value ? next.focusVisible = !0 : next.focus = !0, setStateShallow(next), onFocus == null || onFocus(e);
8424
8501
  },
8425
8502
  onBlur: function(e) {
8426
8503
  componentContext.setParentFocusState && componentContext.setParentFocusState({
8427
8504
  focusWithin: !1
8428
8505
  }), setStateShallow({
8429
8506
  focus: !1,
8430
- focusVisible: !1
8507
+ focusVisible: !1,
8508
+ focusWithin: !1
8431
8509
  }), onBlur == null || onBlur(e);
8432
8510
  }
8433
8511
  }
@@ -8462,37 +8540,15 @@ var require_createComponent_native = __commonJS({
8462
8540
  var useChildrenResult;
8463
8541
  import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ import_react3.default.createElement(elementType, viewProps, content);
8464
8542
  var ResetPresence2 = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence;
8465
- ResetPresence2 && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence2, {
8543
+ if (ResetPresence2 && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ResetPresence2, {
8466
8544
  children: content
8467
- }));
8468
- var groupState = curStateRef.group, subGroupContext = import_react3.default.useMemo(function() {
8469
- var _splitStyles_style, _splitStyles_style1;
8470
- if (!(!groupState || !groupName)) return groupState.listeners.clear(), {
8471
- ...componentContext.groups,
8472
- // change reference so as we mutate it doesn't affect siblings etc
8473
- state: {
8474
- ...componentContext.groups.state,
8475
- [groupName]: {
8476
- pseudo: import_defaultComponentState.defaultComponentStateMounted,
8477
- // capture just initial width and height if they exist
8478
- // will have top, left, width, height (not x, y)
8479
- layout: {
8480
- width: fromPx((_splitStyles_style = splitStyles.style) === null || _splitStyles_style === void 0 ? void 0 : _splitStyles_style.width),
8481
- height: fromPx((_splitStyles_style1 = splitStyles.style) === null || _splitStyles_style1 === void 0 ? void 0 : _splitStyles_style1.height)
8482
- }
8483
- }
8484
- },
8485
- emit: groupState.emit,
8486
- subscribe: groupState.subscribe
8487
- };
8488
- }, [
8489
- groupName
8490
- ]);
8491
- if (("group" in props || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
8545
+ })), "focusWithinStyle" in propsIn && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
8492
8546
  ...componentContext,
8493
- groups: subGroupContext,
8494
8547
  setParentFocusState: setStateShallow,
8495
8548
  children: content
8549
+ })), "group" in props && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_GroupContext.GroupContext.Provider, {
8550
+ value: allGroupContexts,
8551
+ children: content
8496
8552
  })), content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), staticConfig.context) {
8497
8553
  var contextProps = staticConfig.context.props;
8498
8554
  for (var key1 in contextProps) if (viewProps.style && key1 in viewProps.style || key1 in viewProps) {
@@ -8518,6 +8574,15 @@ var require_createComponent_native = __commonJS({
8518
8574
  }
8519
8575
  return content;
8520
8576
  });
8577
+ function notifyGroupSubscribers(groupContext, groupEmitter, pseudo) {
8578
+ if (!(!groupContext || !groupEmitter)) {
8579
+ var nextState = {
8580
+ ...groupContext.state,
8581
+ pseudo
8582
+ };
8583
+ groupEmitter.emit(nextState), groupContext.state = nextState;
8584
+ }
8585
+ }
8521
8586
  staticConfig.componentName && (component.displayName = staticConfig.componentName);
8522
8587
  var res = component;
8523
8588
  (process.env.TAMAGUI_FORCE_MEMO || staticConfig.memo) && (res = /* @__PURE__ */ import_react3.default.memo(res)), res.staticConfig = staticConfig;
@@ -10287,13 +10352,8 @@ var require_useConfiguration_native = __commonJS({
10287
10352
  }
10288
10353
  });
10289
10354
  module2.exports = __toCommonJS2(useConfiguration_exports);
10290
- var import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), useConfiguration2 = function() {
10291
- var { groups, animationDriver, ...restComponentConfig } = import_react3.default.useContext(import_ComponentContext.ComponentContext), { animations, ...restConfig } = (0, import_config.getConfig)();
10292
- return {
10293
- ...restConfig,
10294
- ...restComponentConfig,
10295
- animationDriver: animationDriver ?? (0, import_config.getConfig)().animations
10296
- };
10355
+ var import_react3 = __toESM2(require("react")), import_ComponentContext = require_ComponentContext_native(), useConfiguration2 = function() {
10356
+ return import_react3.default.useContext(import_ComponentContext.ComponentContext);
10297
10357
  };
10298
10358
  }
10299
10359
  });
@@ -10460,7 +10520,7 @@ var require_useProps_native = __commonJS({
10460
10520
  }
10461
10521
  });
10462
10522
  module2.exports = __toCommonJS2(useProps_exports);
10463
- var import_constants4 = require_index_native6(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_getSplitStyles = require_getSplitStyles_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_Stack = require_Stack_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
10523
+ var import_constants4 = require_index_native6(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_ComponentContext = require_ComponentContext_native(), import_GroupContext = require_GroupContext_native(), import_getSplitStyles = require_getSplitStyles_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_Stack = require_Stack_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native();
10464
10524
  function useProps2(props, opts) {
10465
10525
  var [propsOut, styleOut] = usePropsAndStyle2(props, {
10466
10526
  ...opts,
@@ -10484,7 +10544,7 @@ var require_useProps_native = __commonJS({
10484
10544
  needsUpdate() {
10485
10545
  return !0;
10486
10546
  }
10487
- }), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, (0, import_config.getConfig)()), mediaStateNow = opts != null && opts.noMedia ? (
10547
+ }), componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), groupContext = import_react3.default.useContext(import_GroupContext.GroupContext), { state, disabled, setStateShallow } = (0, import_useComponentState.useComponentState)(props, componentContext.animationDriver, staticConfig, (0, import_config.getConfig)()), mediaStateNow = opts != null && opts.noMedia ? (
10488
10548
  // not safe to use mediaState but really marginal to hit this
10489
10549
  import_useMedia.mediaState
10490
10550
  ) : (0, import_useMedia.useMedia)(), splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, (themeState == null ? void 0 : themeState.name) || "", state, {
@@ -10495,7 +10555,7 @@ var require_useProps_native = __commonJS({
10495
10555
  noClass: !0,
10496
10556
  resolveValues: "auto",
10497
10557
  ...opts
10498
- }, null, componentContext), { mediaGroups, pseudoGroups } = splitStyles;
10558
+ }, null, componentContext, groupContext), { mediaGroups, pseudoGroups } = splitStyles;
10499
10559
  return (0, import_constants4.useIsomorphicLayoutEffect)(function() {
10500
10560
  if (!disabled) {
10501
10561
  if (state.unmounted) {
@@ -10504,16 +10564,16 @@ var require_useProps_native = __commonJS({
10504
10564
  });
10505
10565
  return;
10506
10566
  }
10507
- return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
10508
- componentContext,
10567
+ if (groupContext) return (0, import_subscribeToContextGroup.subscribeToContextGroup)({
10568
+ groupContext,
10509
10569
  setStateShallow,
10510
- state,
10511
10570
  mediaGroups,
10512
10571
  pseudoGroups
10513
10572
  });
10514
10573
  }
10515
10574
  }, [
10516
10575
  disabled,
10576
+ groupContext,
10517
10577
  pseudoGroups ? Object.keys([
10518
10578
  ...pseudoGroups
10519
10579
  ]).join("") : 0,
@@ -11091,10 +11151,11 @@ var require_index_native15 = __commonJS({
11091
11151
  var import_config = require_config_native(), import_insertStyleRule = require_insertStyleRule_native();
11092
11152
  __reExport2(index_exports2, require_constants_native2(), module2.exports);
11093
11153
  __reExport2(index_exports2, require_ComponentContext_native(), module2.exports);
11154
+ __reExport2(index_exports2, require_GroupContext_native(), module2.exports);
11094
11155
  __reExport2(index_exports2, require_withStableStyle_native(), module2.exports);
11095
11156
  __reExport2(index_exports2, require_createMediaStyle_native(), module2.exports);
11096
11157
  __reExport2(index_exports2, require_getShorthandValue_native(), module2.exports);
11097
- __reExport2(index_exports2, require_index_native13(), module2.exports);
11158
+ __reExport2(index_exports2, require_index_native12(), module2.exports);
11098
11159
  var import_insertStyleRule2 = require_insertStyleRule_native();
11099
11160
  __reExport2(index_exports2, require_createStyledContext_native(), module2.exports);
11100
11161
  __reExport2(index_exports2, require_expandStyles_native(), module2.exports);
@@ -12771,7 +12832,7 @@ var require_index_native19 = __commonJS({
12771
12832
  }
12772
12833
  });
12773
12834
  module2.exports = __toCommonJS2(index_exports2);
12774
- var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native13(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), strategy = "async";
12835
+ var import_constants4 = require_index_native6(), import_is_equal_shallow = require_index_native12(), LayoutHandlers = /* @__PURE__ */ new WeakMap(), Nodes = /* @__PURE__ */ new Set(), strategy = "async";
12775
12836
  function setOnLayoutStrategy3(state) {
12776
12837
  strategy = state;
12777
12838
  }
@@ -12813,7 +12874,9 @@ var require_index_native19 = __commonJS({
12813
12874
  } else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
12814
12875
  var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
12815
12876
  if (!cachedRect || // has changed one rect
12816
- !(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
12877
+ // @ts-expect-error DOMRectReadOnly can go into object
12878
+ !(0, import_is_equal_shallow.isEqualShallow)(cachedRect, nodeRect) && // @ts-expect-error DOMRectReadOnly can go into object
12879
+ (!cachedParentRect || !(0, import_is_equal_shallow.isEqualShallow)(cachedParentRect, parentRect))) {
12817
12880
  NodeRectCache.set(node, nodeRect), ParentRectCache.set(parentNode, parentRect);
12818
12881
  var event = getElementLayoutEvent(nodeRect, parentRect);
12819
12882
  avoidUpdates ? queuedUpdates.set(node, function() {
@@ -17866,7 +17929,9 @@ var require_SheetImplementationCustom_native = __commonJS({
17866
17929
  var import_jsx_runtime6 = require("react/jsx-runtime"), import_adapt = require_index_native31(), import_animate_presence = require_index_native4(), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_core12 = require_index_native20(), import_portal2 = require_index_native30(), import_react3 = __toESM2(require("react")), import_react_native4 = require_fake_react_native(), import_contexts = require_contexts_native(), import_helpers = require_helpers_native2(), import_SheetContext = require_SheetContext_native(), import_useSheetOpenState = require_useSheetOpenState_native(), import_useSheetProviderProps = require_useSheetProviderProps_native(), hiddenSize = 10000.1, sheetHiddenStyleSheet = null, relativeDimensionTo = import_constants4.isWeb ? "window" : "screen", SheetImplementationCustom = /* @__PURE__ */ import_react3.default.forwardRef(function(props, forwardedRef) {
17867
17930
  var parentSheet = import_react3.default.useContext(import_contexts.ParentSheetContext), { animation, animationConfig: animationConfigProp, modal = !1, zIndex = parentSheet.zIndex + 1, moveOnKeyboardChange = !1, unmountChildrenWhenHidden = !1, portalProps, containerComponent: ContainerComponent = import_react3.default.Fragment } = props, state = (0, import_useSheetOpenState.useSheetOpenState)(props), [overlayComponent, setOverlayComponent] = import_react3.default.useState(null), providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state, {
17868
17931
  onOverlayComponent: setOverlayComponent
17869
- }), { frameSize, setFrameSize, snapPoints, snapPointsMode, hasFit, position, setPosition, scrollBridge, screenSize, setMaxContentSize, maxSnapPoint } = providerProps, { open, controller, isHidden } = state, sheetRef = import_react3.default.useRef(void 0), ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef, providerProps.contentRef), { animationDriver } = (0, import_core12.useConfiguration)(), animationConfig = function() {
17932
+ }), { frameSize, setFrameSize, snapPoints, snapPointsMode, hasFit, position, setPosition, scrollBridge, screenSize, setMaxContentSize, maxSnapPoint } = providerProps, { open, controller, isHidden } = state, sheetRef = import_react3.default.useRef(void 0), ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef, providerProps.contentRef), { animationDriver } = (0, import_core12.useConfiguration)();
17933
+ if (!animationDriver) throw new Error("Sheet reqiures an animation driver to be set");
17934
+ var animationConfig = function() {
17870
17935
  if (animationDriver.supportsCSS) return {};
17871
17936
  var [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [
17872
17937
  animation
@@ -30024,6 +30089,7 @@ __export(index_exports, {
30024
30089
  EnsureFlexed: () => EnsureFlexed,
30025
30090
  Fieldset: () => Fieldset,
30026
30091
  FontLanguage: () => import_core11.FontLanguage,
30092
+ GroupContext: () => import_core11.GroupContext,
30027
30093
  Input: () => Input,
30028
30094
  InputFrame: () => InputFrame,
30029
30095
  Spacer: () => import_core11.Spacer,
@@ -30400,6 +30466,7 @@ var import_core11 = __toESM(require_index_native20());
30400
30466
  EnsureFlexed,
30401
30467
  Fieldset,
30402
30468
  FontLanguage,
30469
+ GroupContext,
30403
30470
  Input,
30404
30471
  InputFrame,
30405
30472
  Spacer,