@apps-in-toss/web-framework 0.0.30 → 0.0.31

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.
@@ -156372,10 +156372,163 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156372
156372
  });
156373
156373
  var import_react_native14 = _$$_REQUIRE(_dependencyMap[4], "react-native");
156374
156374
  var import_react_native_bedrock10 = _$$_REQUIRE(_dependencyMap[2], "react-native-bedrock");
156375
+ var FontA11yCategory = {
156376
+ Large: "Large",
156377
+ xLarge: "xLarge",
156378
+ xxLarge: "xxLarge",
156379
+ xxxLarge: "xxxLarge",
156380
+ A11y_Medium: "A11y_Medium",
156381
+ A11y_Large: "A11y_Large",
156382
+ A11y_xLarge: "A11y_xLarge",
156383
+ A11y_xxLarge: "A11y_xxLarge",
156384
+ A11y_xxxLarge: "A11y_xxxLarge"
156385
+ };
156386
+ var androidFontScaleMap = {
156387
+ 100: FontA11yCategory.Large,
156388
+ 110: FontA11yCategory.xLarge,
156389
+ 120: FontA11yCategory.xxLarge,
156390
+ 135: FontA11yCategory.xxxLarge,
156391
+ 160: FontA11yCategory.A11y_Medium,
156392
+ 190: FontA11yCategory.A11y_Large,
156393
+ 235: FontA11yCategory.A11y_xLarge,
156394
+ 275: FontA11yCategory.A11y_xxLarge,
156395
+ 310: FontA11yCategory.A11y_xxxLarge
156396
+ };
156397
+ var iosScaleToAndroidScale = {
156398
+ 0.823: 100,
156399
+ 0.882: 100,
156400
+ 0.941: 100,
156401
+ 1: 100,
156402
+ 1.118: 110,
156403
+ 1.235: 120,
156404
+ 1.353: 135,
156405
+ 1.786: 160,
156406
+ 2.143: 190,
156407
+ 2.643: 235,
156408
+ 3.143: 275,
156409
+ 3.571: 310
156410
+ };
156411
+ function convertToAndroidStyleScale(fontScale, platform) {
156412
+ if (platform === "android") {
156413
+ if (fontScale <= 1) {
156414
+ return 100;
156415
+ }
156416
+ var scaledValue = Math.round(fontScale * 100);
156417
+ var keys = Object.keys(androidFontScaleMap).map(Number).sort(function (a, b) {
156418
+ return a - b;
156419
+ });
156420
+ var closestKey = keys[0];
156421
+ var minDiff = Math.abs(scaledValue - closestKey);
156422
+ var _iterator2 = _createForOfIteratorHelper(keys),
156423
+ _step2;
156424
+ try {
156425
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
156426
+ var key = _step2.value;
156427
+ var diff = Math.abs(scaledValue - key);
156428
+ if (diff < minDiff) {
156429
+ minDiff = diff;
156430
+ closestKey = key;
156431
+ }
156432
+ }
156433
+ } catch (err) {
156434
+ _iterator2.e(err);
156435
+ } finally {
156436
+ _iterator2.f();
156437
+ }
156438
+ return closestKey;
156439
+ } else {
156440
+ var iosScales = Object.keys(iosScaleToAndroidScale).map(Number);
156441
+ var closestScale = iosScales[0];
156442
+ var _minDiff = Math.abs(fontScale - closestScale);
156443
+ var _iterator3 = _createForOfIteratorHelper(iosScales),
156444
+ _step3;
156445
+ try {
156446
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
156447
+ var scale = _step3.value;
156448
+ var _diff = Math.abs(fontScale - scale);
156449
+ if (_diff < _minDiff) {
156450
+ _minDiff = _diff;
156451
+ closestScale = scale;
156452
+ }
156453
+ }
156454
+ } catch (err) {
156455
+ _iterator3.e(err);
156456
+ } finally {
156457
+ _iterator3.f();
156458
+ }
156459
+ return iosScaleToAndroidScale[closestScale];
156460
+ }
156461
+ }
156462
+ function mapIOSFontScaleToCategory(fontScale) {
156463
+ if (fontScale < 1) {
156464
+ return FontA11yCategory.Large;
156465
+ }
156466
+ if (Math.abs(fontScale - 1) < 0.05) {
156467
+ return FontA11yCategory.Large;
156468
+ }
156469
+ if (Math.abs(fontScale - 1.118) < 0.05) {
156470
+ return FontA11yCategory.xLarge;
156471
+ }
156472
+ if (Math.abs(fontScale - 1.235) < 0.05) {
156473
+ return FontA11yCategory.xxLarge;
156474
+ }
156475
+ if (Math.abs(fontScale - 1.353) < 0.05) {
156476
+ return FontA11yCategory.xxxLarge;
156477
+ }
156478
+ if (Math.abs(fontScale - 1.786) < 0.05) {
156479
+ return FontA11yCategory.A11y_Medium;
156480
+ }
156481
+ if (Math.abs(fontScale - 2.143) < 0.05) {
156482
+ return FontA11yCategory.A11y_Large;
156483
+ }
156484
+ if (Math.abs(fontScale - 2.643) < 0.05) {
156485
+ return FontA11yCategory.A11y_xLarge;
156486
+ }
156487
+ if (Math.abs(fontScale - 3.143) < 0.05) {
156488
+ return FontA11yCategory.A11y_xxLarge;
156489
+ }
156490
+ if (Math.abs(fontScale - 3.571) < 0.05) {
156491
+ return FontA11yCategory.A11y_xxxLarge;
156492
+ }
156493
+ return FontA11yCategory.Large;
156494
+ }
156495
+ function mapAndroidFontScaleToCategory(fontScale) {
156496
+ if (fontScale <= 1) {
156497
+ return androidFontScaleMap[100];
156498
+ }
156499
+ var scaledValue = Math.round(fontScale * 100);
156500
+ var keys = Object.keys(androidFontScaleMap).map(Number).sort(function (a, b) {
156501
+ return a - b;
156502
+ });
156503
+ if (keys.length === 0) {
156504
+ return androidFontScaleMap[100];
156505
+ }
156506
+ var closestKey = keys[0];
156507
+ var minDiff = Math.abs(scaledValue - closestKey);
156508
+ var _iterator4 = _createForOfIteratorHelper(keys),
156509
+ _step4;
156510
+ try {
156511
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
156512
+ var key = _step4.value;
156513
+ var diff = Math.abs(scaledValue - key);
156514
+ if (diff < minDiff) {
156515
+ minDiff = diff;
156516
+ closestKey = key;
156517
+ }
156518
+ }
156519
+ } catch (err) {
156520
+ _iterator4.e(err);
156521
+ } finally {
156522
+ _iterator4.f();
156523
+ }
156524
+ return androidFontScaleMap[closestKey];
156525
+ }
156526
+ function mapFontScaleToCategory(fontScale, platform) {
156527
+ return platform === "ios" ? mapIOSFontScaleToCategory(fontScale) : mapAndroidFontScaleToCategory(fontScale);
156528
+ }
156375
156529
  function _useCreateUserAgent(_ref20) {
156376
156530
  var batteryModePreference = _ref20.batteryModePreference,
156377
156531
  colorPreference = _ref20.colorPreference,
156378
- fontA11y = _ref20.fontA11y,
156379
156532
  locale = _ref20.locale,
156380
156533
  navbarPreference = _ref20.navbarPreference,
156381
156534
  pureSafeArea = _ref20.pureSafeArea,
@@ -156383,21 +156536,24 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156383
156536
  safeAreaBottomTransparency = _ref20.safeAreaBottomTransparency;
156384
156537
  var platform = (0, import_react_native_bedrock10.getPlatformOS)();
156385
156538
  var appVersion = _getTossAppVersion();
156386
- var fontScale = (0, import_react_native14.useWindowDimensions)().fontScale;
156539
+ var _ref21 = (0, import_react_native14.useWindowDimensions)(),
156540
+ fontScale = _ref21.fontScale;
156387
156541
  var platformString = platform === "ios" ? "iPhone" : "Android";
156388
- return ["TossApp/".concat(appVersion), batteryModePreference && "TossBatteryModePreference/".concat(batteryModePreference), colorPreference && "TossColorPreference/".concat(colorPreference), fontA11y && "TossFontAccessibility/".concat(fontA11y), fontScale && "TossFontScale/".concat(fontScale), locale && "TossLocale/".concat(locale), navbarPreference && "TossNavbarPreference/".concat(navbarPreference), pureSafeArea && "TossPureSafeArea/".concat(pureSafeArea), safeArea && "TossSafeArea/".concat(safeArea), safeAreaBottomTransparency && "TossSafeAreaBottomTransparency/".concat(safeAreaBottomTransparency), platformString].filter(Boolean).join(" ");
156542
+ var fontA11y = mapFontScaleToCategory(fontScale, platform);
156543
+ var normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
156544
+ return ["TossApp/".concat(appVersion), batteryModePreference && "TossBatteryModePreference/".concat(batteryModePreference), colorPreference && "TossColorPreference/".concat(colorPreference), "TossFontAccessibility/".concat(fontA11y), "TossFontScale/".concat(normalizedFontScale), locale && "TossLocale/".concat(locale), navbarPreference && "TossNavbarPreference/".concat(navbarPreference), pureSafeArea && "TossPureSafeArea/".concat(pureSafeArea), safeArea && "TossSafeArea/".concat(safeArea), safeAreaBottomTransparency && "TossSafeAreaBottomTransparency/".concat(safeAreaBottomTransparency), platformString].filter(Boolean).join(" ");
156389
156545
  }
156390
156546
  var import_react6 = _$$_REQUIRE(_dependencyMap[3], "react");
156391
156547
  var import_react_native_bedrock11 = _$$_REQUIRE(_dependencyMap[2], "react-native-bedrock");
156392
- function _useGeolocation(_ref21) {
156393
- var accuracy = _ref21.accuracy,
156394
- distanceInterval = _ref21.distanceInterval,
156395
- timeInterval = _ref21.timeInterval;
156548
+ function _useGeolocation(_ref22) {
156549
+ var accuracy = _ref22.accuracy,
156550
+ distanceInterval = _ref22.distanceInterval,
156551
+ timeInterval = _ref22.timeInterval;
156396
156552
  var isVisible = (0, import_react_native_bedrock11.useVisibility)();
156397
- var _ref22 = (0, import_react6.useState)(null),
156398
- _ref23 = _slicedToArray(_ref22, 2),
156399
- location = _ref23[0],
156400
- setLocation = _ref23[1];
156553
+ var _ref23 = (0, import_react6.useState)(null),
156554
+ _ref24 = _slicedToArray(_ref23, 2),
156555
+ location = _ref24[0],
156556
+ setLocation = _ref24[1];
156401
156557
  (0, import_react6.useEffect)(function () {
156402
156558
  if (!isVisible) {
156403
156559
  return;
@@ -156471,19 +156627,19 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156471
156627
  var baseUrl = new URL(url);
156472
156628
  var schemeUrl = new URL((0, import_react_native_bedrock13.getSchemeUri)());
156473
156629
  baseUrl.pathname = schemeUrl.pathname;
156474
- var _iterator2 = _createForOfIteratorHelper(schemeUrl.searchParams.entries()),
156475
- _step2;
156630
+ var _iterator5 = _createForOfIteratorHelper(schemeUrl.searchParams.entries()),
156631
+ _step5;
156476
156632
  try {
156477
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
156478
- var _step2$value = _slicedToArray(_step2.value, 2),
156479
- key = _step2$value[0],
156480
- value = _step2$value[1];
156633
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
156634
+ var _step5$value = _slicedToArray(_step5.value, 2),
156635
+ key = _step5$value[0],
156636
+ value = _step5$value[1];
156481
156637
  baseUrl.searchParams.set(key, value);
156482
156638
  }
156483
156639
  } catch (err) {
156484
- _iterator2.e(err);
156640
+ _iterator5.e(err);
156485
156641
  } finally {
156486
- _iterator2.f();
156642
+ _iterator5.f();
156487
156643
  }
156488
156644
  return baseUrl;
156489
156645
  }
@@ -156501,11 +156657,11 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156501
156657
  }
156502
156658
  return url.toString();
156503
156659
  }
156504
- function _WebView(_ref24) {
156505
- var type = _ref24.type,
156506
- local = _ref24.local,
156507
- onMessage = _ref24.onMessage,
156508
- props = _objectWithoutProperties(_ref24, _excluded3);
156660
+ function _WebView(_ref25) {
156661
+ var type = _ref25.type,
156662
+ local = _ref25.local,
156663
+ onMessage = _ref25.onMessage,
156664
+ props = _objectWithoutProperties(_ref25, _excluded3);
156509
156665
  if (!TYPES.includes(type)) {
156510
156666
  throw new Error("Invalid WebView type: '".concat(type, "'"));
156511
156667
  }
@@ -156519,38 +156675,38 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156519
156675
  var handler = useBridgeHandler({
156520
156676
  onMessage: onMessage,
156521
156677
  eventListenerMap: _objectSpread(_objectSpread({}, event_bridges_exports), {}, {
156522
- backEvent: function backEvent(_ref25) {
156523
- var onEvent = _ref25.onEvent,
156524
- onError = _ref25.onError,
156525
- options = _ref25.options;
156678
+ backEvent: function backEvent(_ref26) {
156679
+ var onEvent = _ref26.onEvent,
156680
+ onError = _ref26.onError,
156681
+ options = _ref26.options;
156526
156682
  return bedrockEvent.addEventListener("backEvent", {
156527
156683
  onEvent: onEvent,
156528
156684
  onError: onError,
156529
156685
  options: options
156530
156686
  });
156531
156687
  },
156532
- entryMessageExited: function entryMessageExited(_ref26) {
156533
- var onEvent = _ref26.onEvent,
156534
- onError = _ref26.onError;
156688
+ entryMessageExited: function entryMessageExited(_ref27) {
156689
+ var onEvent = _ref27.onEvent,
156690
+ onError = _ref27.onError;
156535
156691
  return _appsInTossEvent.addEventListener("entryMessageExited", {
156536
156692
  onEvent: onEvent,
156537
156693
  onError: onError
156538
156694
  });
156539
156695
  },
156540
- updateLocationEvent: function updateLocationEvent(_ref27) {
156541
- var onEvent = _ref27.onEvent,
156542
- onError = _ref27.onError,
156543
- options = _ref27.options;
156696
+ updateLocationEvent: function updateLocationEvent(_ref28) {
156697
+ var onEvent = _ref28.onEvent,
156698
+ onError = _ref28.onError,
156699
+ options = _ref28.options;
156544
156700
  return _appsInTossEvent.addEventListener("updateLocationEvent", {
156545
156701
  onEvent: onEvent,
156546
156702
  onError: onError,
156547
156703
  options: options
156548
156704
  });
156549
156705
  },
156550
- appBridgeCallbackEvent: function appBridgeCallbackEvent(_ref28) {
156551
- var onEvent = _ref28.onEvent,
156552
- onError = _ref28.onError,
156553
- options = _ref28.options;
156706
+ appBridgeCallbackEvent: function appBridgeCallbackEvent(_ref29) {
156707
+ var onEvent = _ref29.onEvent,
156708
+ onError = _ref29.onError,
156709
+ options = _ref29.options;
156554
156710
  return _appsInTossEvent.addEventListener("appBridgeCallbackEvent", {
156555
156711
  onEvent: onEvent,
156556
156712
  onError: onError,
@@ -156569,10 +156725,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156569
156725
  getSafeAreaBottom: function getSafeAreaBottom() {
156570
156726
  return bottom;
156571
156727
  }
156572
- }, Object.fromEntries(Object.entries(global2).map(function (_ref29) {
156573
- var _ref30 = _slicedToArray(_ref29, 2),
156574
- key = _ref30[0],
156575
- value = _ref30[1];
156728
+ }, Object.fromEntries(Object.entries(global2).map(function (_ref30) {
156729
+ var _ref31 = _slicedToArray(_ref30, 2),
156730
+ key = _ref31[0],
156731
+ value = _ref31[1];
156576
156732
  return [key, function () {
156577
156733
  return value;
156578
156734
  }];
@@ -156161,10 +156161,163 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156161
156161
  });
156162
156162
  var import_react_native14 = _$$_REQUIRE(_dependencyMap[4], "react-native");
156163
156163
  var import_react_native_bedrock10 = _$$_REQUIRE(_dependencyMap[2], "react-native-bedrock");
156164
+ var FontA11yCategory = {
156165
+ Large: "Large",
156166
+ xLarge: "xLarge",
156167
+ xxLarge: "xxLarge",
156168
+ xxxLarge: "xxxLarge",
156169
+ A11y_Medium: "A11y_Medium",
156170
+ A11y_Large: "A11y_Large",
156171
+ A11y_xLarge: "A11y_xLarge",
156172
+ A11y_xxLarge: "A11y_xxLarge",
156173
+ A11y_xxxLarge: "A11y_xxxLarge"
156174
+ };
156175
+ var androidFontScaleMap = {
156176
+ 100: FontA11yCategory.Large,
156177
+ 110: FontA11yCategory.xLarge,
156178
+ 120: FontA11yCategory.xxLarge,
156179
+ 135: FontA11yCategory.xxxLarge,
156180
+ 160: FontA11yCategory.A11y_Medium,
156181
+ 190: FontA11yCategory.A11y_Large,
156182
+ 235: FontA11yCategory.A11y_xLarge,
156183
+ 275: FontA11yCategory.A11y_xxLarge,
156184
+ 310: FontA11yCategory.A11y_xxxLarge
156185
+ };
156186
+ var iosScaleToAndroidScale = {
156187
+ 0.823: 100,
156188
+ 0.882: 100,
156189
+ 0.941: 100,
156190
+ 1: 100,
156191
+ 1.118: 110,
156192
+ 1.235: 120,
156193
+ 1.353: 135,
156194
+ 1.786: 160,
156195
+ 2.143: 190,
156196
+ 2.643: 235,
156197
+ 3.143: 275,
156198
+ 3.571: 310
156199
+ };
156200
+ function convertToAndroidStyleScale(fontScale, platform) {
156201
+ if (platform === "android") {
156202
+ if (fontScale <= 1) {
156203
+ return 100;
156204
+ }
156205
+ var scaledValue = Math.round(fontScale * 100);
156206
+ var keys = Object.keys(androidFontScaleMap).map(Number).sort(function (a, b) {
156207
+ return a - b;
156208
+ });
156209
+ var closestKey = keys[0];
156210
+ var minDiff = Math.abs(scaledValue - closestKey);
156211
+ var _iterator2 = _createForOfIteratorHelper(keys),
156212
+ _step2;
156213
+ try {
156214
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
156215
+ var key = _step2.value;
156216
+ var diff = Math.abs(scaledValue - key);
156217
+ if (diff < minDiff) {
156218
+ minDiff = diff;
156219
+ closestKey = key;
156220
+ }
156221
+ }
156222
+ } catch (err) {
156223
+ _iterator2.e(err);
156224
+ } finally {
156225
+ _iterator2.f();
156226
+ }
156227
+ return closestKey;
156228
+ } else {
156229
+ var iosScales = Object.keys(iosScaleToAndroidScale).map(Number);
156230
+ var closestScale = iosScales[0];
156231
+ var _minDiff = Math.abs(fontScale - closestScale);
156232
+ var _iterator3 = _createForOfIteratorHelper(iosScales),
156233
+ _step3;
156234
+ try {
156235
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
156236
+ var scale = _step3.value;
156237
+ var _diff = Math.abs(fontScale - scale);
156238
+ if (_diff < _minDiff) {
156239
+ _minDiff = _diff;
156240
+ closestScale = scale;
156241
+ }
156242
+ }
156243
+ } catch (err) {
156244
+ _iterator3.e(err);
156245
+ } finally {
156246
+ _iterator3.f();
156247
+ }
156248
+ return iosScaleToAndroidScale[closestScale];
156249
+ }
156250
+ }
156251
+ function mapIOSFontScaleToCategory(fontScale) {
156252
+ if (fontScale < 1) {
156253
+ return FontA11yCategory.Large;
156254
+ }
156255
+ if (Math.abs(fontScale - 1) < 0.05) {
156256
+ return FontA11yCategory.Large;
156257
+ }
156258
+ if (Math.abs(fontScale - 1.118) < 0.05) {
156259
+ return FontA11yCategory.xLarge;
156260
+ }
156261
+ if (Math.abs(fontScale - 1.235) < 0.05) {
156262
+ return FontA11yCategory.xxLarge;
156263
+ }
156264
+ if (Math.abs(fontScale - 1.353) < 0.05) {
156265
+ return FontA11yCategory.xxxLarge;
156266
+ }
156267
+ if (Math.abs(fontScale - 1.786) < 0.05) {
156268
+ return FontA11yCategory.A11y_Medium;
156269
+ }
156270
+ if (Math.abs(fontScale - 2.143) < 0.05) {
156271
+ return FontA11yCategory.A11y_Large;
156272
+ }
156273
+ if (Math.abs(fontScale - 2.643) < 0.05) {
156274
+ return FontA11yCategory.A11y_xLarge;
156275
+ }
156276
+ if (Math.abs(fontScale - 3.143) < 0.05) {
156277
+ return FontA11yCategory.A11y_xxLarge;
156278
+ }
156279
+ if (Math.abs(fontScale - 3.571) < 0.05) {
156280
+ return FontA11yCategory.A11y_xxxLarge;
156281
+ }
156282
+ return FontA11yCategory.Large;
156283
+ }
156284
+ function mapAndroidFontScaleToCategory(fontScale) {
156285
+ if (fontScale <= 1) {
156286
+ return androidFontScaleMap[100];
156287
+ }
156288
+ var scaledValue = Math.round(fontScale * 100);
156289
+ var keys = Object.keys(androidFontScaleMap).map(Number).sort(function (a, b) {
156290
+ return a - b;
156291
+ });
156292
+ if (keys.length === 0) {
156293
+ return androidFontScaleMap[100];
156294
+ }
156295
+ var closestKey = keys[0];
156296
+ var minDiff = Math.abs(scaledValue - closestKey);
156297
+ var _iterator4 = _createForOfIteratorHelper(keys),
156298
+ _step4;
156299
+ try {
156300
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
156301
+ var key = _step4.value;
156302
+ var diff = Math.abs(scaledValue - key);
156303
+ if (diff < minDiff) {
156304
+ minDiff = diff;
156305
+ closestKey = key;
156306
+ }
156307
+ }
156308
+ } catch (err) {
156309
+ _iterator4.e(err);
156310
+ } finally {
156311
+ _iterator4.f();
156312
+ }
156313
+ return androidFontScaleMap[closestKey];
156314
+ }
156315
+ function mapFontScaleToCategory(fontScale, platform) {
156316
+ return platform === "ios" ? mapIOSFontScaleToCategory(fontScale) : mapAndroidFontScaleToCategory(fontScale);
156317
+ }
156164
156318
  function _useCreateUserAgent(_ref20) {
156165
156319
  var batteryModePreference = _ref20.batteryModePreference,
156166
156320
  colorPreference = _ref20.colorPreference,
156167
- fontA11y = _ref20.fontA11y,
156168
156321
  locale = _ref20.locale,
156169
156322
  navbarPreference = _ref20.navbarPreference,
156170
156323
  pureSafeArea = _ref20.pureSafeArea,
@@ -156172,21 +156325,24 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156172
156325
  safeAreaBottomTransparency = _ref20.safeAreaBottomTransparency;
156173
156326
  var platform = (0, import_react_native_bedrock10.getPlatformOS)();
156174
156327
  var appVersion = _getTossAppVersion();
156175
- var fontScale = (0, import_react_native14.useWindowDimensions)().fontScale;
156328
+ var _ref21 = (0, import_react_native14.useWindowDimensions)(),
156329
+ fontScale = _ref21.fontScale;
156176
156330
  var platformString = platform === "ios" ? "iPhone" : "Android";
156177
- return ["TossApp/".concat(appVersion), batteryModePreference && "TossBatteryModePreference/".concat(batteryModePreference), colorPreference && "TossColorPreference/".concat(colorPreference), fontA11y && "TossFontAccessibility/".concat(fontA11y), fontScale && "TossFontScale/".concat(fontScale), locale && "TossLocale/".concat(locale), navbarPreference && "TossNavbarPreference/".concat(navbarPreference), pureSafeArea && "TossPureSafeArea/".concat(pureSafeArea), safeArea && "TossSafeArea/".concat(safeArea), safeAreaBottomTransparency && "TossSafeAreaBottomTransparency/".concat(safeAreaBottomTransparency), platformString].filter(Boolean).join(" ");
156331
+ var fontA11y = mapFontScaleToCategory(fontScale, platform);
156332
+ var normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
156333
+ return ["TossApp/".concat(appVersion), batteryModePreference && "TossBatteryModePreference/".concat(batteryModePreference), colorPreference && "TossColorPreference/".concat(colorPreference), "TossFontAccessibility/".concat(fontA11y), "TossFontScale/".concat(normalizedFontScale), locale && "TossLocale/".concat(locale), navbarPreference && "TossNavbarPreference/".concat(navbarPreference), pureSafeArea && "TossPureSafeArea/".concat(pureSafeArea), safeArea && "TossSafeArea/".concat(safeArea), safeAreaBottomTransparency && "TossSafeAreaBottomTransparency/".concat(safeAreaBottomTransparency), platformString].filter(Boolean).join(" ");
156178
156334
  }
156179
156335
  var import_react6 = _$$_REQUIRE(_dependencyMap[3], "react");
156180
156336
  var import_react_native_bedrock11 = _$$_REQUIRE(_dependencyMap[2], "react-native-bedrock");
156181
- function _useGeolocation(_ref21) {
156182
- var accuracy = _ref21.accuracy,
156183
- distanceInterval = _ref21.distanceInterval,
156184
- timeInterval = _ref21.timeInterval;
156337
+ function _useGeolocation(_ref22) {
156338
+ var accuracy = _ref22.accuracy,
156339
+ distanceInterval = _ref22.distanceInterval,
156340
+ timeInterval = _ref22.timeInterval;
156185
156341
  var isVisible = (0, import_react_native_bedrock11.useVisibility)();
156186
- var _ref22 = (0, import_react6.useState)(null),
156187
- _ref23 = _slicedToArray(_ref22, 2),
156188
- location = _ref23[0],
156189
- setLocation = _ref23[1];
156342
+ var _ref23 = (0, import_react6.useState)(null),
156343
+ _ref24 = _slicedToArray(_ref23, 2),
156344
+ location = _ref24[0],
156345
+ setLocation = _ref24[1];
156190
156346
  (0, import_react6.useEffect)(function () {
156191
156347
  if (!isVisible) {
156192
156348
  return;
@@ -156260,19 +156416,19 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156260
156416
  var baseUrl = new URL(url);
156261
156417
  var schemeUrl = new URL((0, import_react_native_bedrock13.getSchemeUri)());
156262
156418
  baseUrl.pathname = schemeUrl.pathname;
156263
- var _iterator2 = _createForOfIteratorHelper(schemeUrl.searchParams.entries()),
156264
- _step2;
156419
+ var _iterator5 = _createForOfIteratorHelper(schemeUrl.searchParams.entries()),
156420
+ _step5;
156265
156421
  try {
156266
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
156267
- var _step2$value = _slicedToArray(_step2.value, 2),
156268
- key = _step2$value[0],
156269
- value = _step2$value[1];
156422
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
156423
+ var _step5$value = _slicedToArray(_step5.value, 2),
156424
+ key = _step5$value[0],
156425
+ value = _step5$value[1];
156270
156426
  baseUrl.searchParams.set(key, value);
156271
156427
  }
156272
156428
  } catch (err) {
156273
- _iterator2.e(err);
156429
+ _iterator5.e(err);
156274
156430
  } finally {
156275
- _iterator2.f();
156431
+ _iterator5.f();
156276
156432
  }
156277
156433
  return baseUrl;
156278
156434
  }
@@ -156290,11 +156446,11 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156290
156446
  }
156291
156447
  return url.toString();
156292
156448
  }
156293
- function _WebView(_ref24) {
156294
- var type = _ref24.type,
156295
- local = _ref24.local,
156296
- onMessage = _ref24.onMessage,
156297
- props = _objectWithoutProperties(_ref24, _excluded3);
156449
+ function _WebView(_ref25) {
156450
+ var type = _ref25.type,
156451
+ local = _ref25.local,
156452
+ onMessage = _ref25.onMessage,
156453
+ props = _objectWithoutProperties(_ref25, _excluded3);
156298
156454
  if (!TYPES.includes(type)) {
156299
156455
  throw new Error("Invalid WebView type: '".concat(type, "'"));
156300
156456
  }
@@ -156308,38 +156464,38 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156308
156464
  var handler = useBridgeHandler({
156309
156465
  onMessage: onMessage,
156310
156466
  eventListenerMap: _objectSpread(_objectSpread({}, event_bridges_exports), {}, {
156311
- backEvent: function backEvent(_ref25) {
156312
- var onEvent = _ref25.onEvent,
156313
- onError = _ref25.onError,
156314
- options = _ref25.options;
156467
+ backEvent: function backEvent(_ref26) {
156468
+ var onEvent = _ref26.onEvent,
156469
+ onError = _ref26.onError,
156470
+ options = _ref26.options;
156315
156471
  return bedrockEvent.addEventListener("backEvent", {
156316
156472
  onEvent: onEvent,
156317
156473
  onError: onError,
156318
156474
  options: options
156319
156475
  });
156320
156476
  },
156321
- entryMessageExited: function entryMessageExited(_ref26) {
156322
- var onEvent = _ref26.onEvent,
156323
- onError = _ref26.onError;
156477
+ entryMessageExited: function entryMessageExited(_ref27) {
156478
+ var onEvent = _ref27.onEvent,
156479
+ onError = _ref27.onError;
156324
156480
  return _appsInTossEvent.addEventListener("entryMessageExited", {
156325
156481
  onEvent: onEvent,
156326
156482
  onError: onError
156327
156483
  });
156328
156484
  },
156329
- updateLocationEvent: function updateLocationEvent(_ref27) {
156330
- var onEvent = _ref27.onEvent,
156331
- onError = _ref27.onError,
156332
- options = _ref27.options;
156485
+ updateLocationEvent: function updateLocationEvent(_ref28) {
156486
+ var onEvent = _ref28.onEvent,
156487
+ onError = _ref28.onError,
156488
+ options = _ref28.options;
156333
156489
  return _appsInTossEvent.addEventListener("updateLocationEvent", {
156334
156490
  onEvent: onEvent,
156335
156491
  onError: onError,
156336
156492
  options: options
156337
156493
  });
156338
156494
  },
156339
- appBridgeCallbackEvent: function appBridgeCallbackEvent(_ref28) {
156340
- var onEvent = _ref28.onEvent,
156341
- onError = _ref28.onError,
156342
- options = _ref28.options;
156495
+ appBridgeCallbackEvent: function appBridgeCallbackEvent(_ref29) {
156496
+ var onEvent = _ref29.onEvent,
156497
+ onError = _ref29.onError,
156498
+ options = _ref29.options;
156343
156499
  return _appsInTossEvent.addEventListener("appBridgeCallbackEvent", {
156344
156500
  onEvent: onEvent,
156345
156501
  onError: onError,
@@ -156358,10 +156514,10 @@ __d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, e
156358
156514
  getSafeAreaBottom: function getSafeAreaBottom() {
156359
156515
  return bottom;
156360
156516
  }
156361
- }, Object.fromEntries(Object.entries(global2).map(function (_ref29) {
156362
- var _ref30 = _slicedToArray(_ref29, 2),
156363
- key = _ref30[0],
156364
- value = _ref30[1];
156517
+ }, Object.fromEntries(Object.entries(global2).map(function (_ref30) {
156518
+ var _ref31 = _slicedToArray(_ref30, 2),
156519
+ key = _ref31[0],
156520
+ value = _ref31[1];
156365
156521
  return [key, function () {
156366
156522
  return value;
156367
156523
  }];
@@ -37786,18 +37786,162 @@ window.__bedrock.app = { name: Ait.appName, buildNumber: Ait.buildNumber };
37786
37786
  onMessage: $onMessage
37787
37787
  };
37788
37788
  }
37789
+ function convertToAndroidStyleScale(fontScale, platform) {
37790
+ if (platform === "android") {
37791
+ if (fontScale <= 1) {
37792
+ return 100;
37793
+ }
37794
+ var scaledValue = Math.round(fontScale * 100);
37795
+ var keys = Object.keys(androidFontScaleMap).map(Number).sort(function(a, b) {
37796
+ return a - b;
37797
+ });
37798
+ var closestKey = keys[0];
37799
+ var minDiff = Math.abs(scaledValue - closestKey);
37800
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
37801
+ try {
37802
+ for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
37803
+ var key = _step.value;
37804
+ var diff = Math.abs(scaledValue - key);
37805
+ if (diff < minDiff) {
37806
+ minDiff = diff;
37807
+ closestKey = key;
37808
+ }
37809
+ }
37810
+ } catch (err) {
37811
+ _didIteratorError = true;
37812
+ _iteratorError = err;
37813
+ } finally {
37814
+ try {
37815
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
37816
+ _iterator.return();
37817
+ }
37818
+ } finally {
37819
+ if (_didIteratorError) {
37820
+ throw _iteratorError;
37821
+ }
37822
+ }
37823
+ }
37824
+ return closestKey;
37825
+ } else {
37826
+ var iosScales = Object.keys(iosScaleToAndroidScale).map(Number);
37827
+ var closestScale = iosScales[0];
37828
+ var minDiff1 = Math.abs(fontScale - closestScale);
37829
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
37830
+ try {
37831
+ for (var _iterator1 = iosScales[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
37832
+ var scale = _step1.value;
37833
+ var diff1 = Math.abs(fontScale - scale);
37834
+ if (diff1 < minDiff1) {
37835
+ minDiff1 = diff1;
37836
+ closestScale = scale;
37837
+ }
37838
+ }
37839
+ } catch (err) {
37840
+ _didIteratorError1 = true;
37841
+ _iteratorError1 = err;
37842
+ } finally {
37843
+ try {
37844
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
37845
+ _iterator1.return();
37846
+ }
37847
+ } finally {
37848
+ if (_didIteratorError1) {
37849
+ throw _iteratorError1;
37850
+ }
37851
+ }
37852
+ }
37853
+ return iosScaleToAndroidScale[closestScale];
37854
+ }
37855
+ }
37856
+ function mapIOSFontScaleToCategory(fontScale) {
37857
+ if (fontScale < 1) {
37858
+ return FontA11yCategory.Large;
37859
+ }
37860
+ if (Math.abs(fontScale - 1) < 0.05) {
37861
+ return FontA11yCategory.Large;
37862
+ }
37863
+ if (Math.abs(fontScale - 1.118) < 0.05) {
37864
+ return FontA11yCategory.xLarge;
37865
+ }
37866
+ if (Math.abs(fontScale - 1.235) < 0.05) {
37867
+ return FontA11yCategory.xxLarge;
37868
+ }
37869
+ if (Math.abs(fontScale - 1.353) < 0.05) {
37870
+ return FontA11yCategory.xxxLarge;
37871
+ }
37872
+ if (Math.abs(fontScale - 1.786) < 0.05) {
37873
+ return FontA11yCategory.A11y_Medium;
37874
+ }
37875
+ if (Math.abs(fontScale - 2.143) < 0.05) {
37876
+ return FontA11yCategory.A11y_Large;
37877
+ }
37878
+ if (Math.abs(fontScale - 2.643) < 0.05) {
37879
+ return FontA11yCategory.A11y_xLarge;
37880
+ }
37881
+ if (Math.abs(fontScale - 3.143) < 0.05) {
37882
+ return FontA11yCategory.A11y_xxLarge;
37883
+ }
37884
+ if (Math.abs(fontScale - 3.571) < 0.05) {
37885
+ return FontA11yCategory.A11y_xxxLarge;
37886
+ }
37887
+ return FontA11yCategory.Large;
37888
+ }
37889
+ function mapAndroidFontScaleToCategory(fontScale) {
37890
+ if (fontScale <= 1) {
37891
+ return androidFontScaleMap[100];
37892
+ }
37893
+ var scaledValue = Math.round(fontScale * 100);
37894
+ var keys = Object.keys(androidFontScaleMap).map(Number).sort(function(a, b) {
37895
+ return a - b;
37896
+ });
37897
+ if (keys.length === 0) {
37898
+ return androidFontScaleMap[100];
37899
+ }
37900
+ var closestKey = keys[0];
37901
+ var minDiff = Math.abs(scaledValue - closestKey);
37902
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
37903
+ try {
37904
+ for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
37905
+ var key = _step.value;
37906
+ var diff = Math.abs(scaledValue - key);
37907
+ if (diff < minDiff) {
37908
+ minDiff = diff;
37909
+ closestKey = key;
37910
+ }
37911
+ }
37912
+ } catch (err) {
37913
+ _didIteratorError = true;
37914
+ _iteratorError = err;
37915
+ } finally {
37916
+ try {
37917
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
37918
+ _iterator.return();
37919
+ }
37920
+ } finally {
37921
+ if (_didIteratorError) {
37922
+ throw _iteratorError;
37923
+ }
37924
+ }
37925
+ }
37926
+ return androidFontScaleMap[closestKey];
37927
+ }
37928
+ function mapFontScaleToCategory(fontScale, platform) {
37929
+ return platform === "ios" ? mapIOSFontScaleToCategory(fontScale) : mapAndroidFontScaleToCategory(fontScale);
37930
+ }
37789
37931
  function useCreateUserAgent(param) {
37790
- var batteryModePreference = param.batteryModePreference, colorPreference = param.colorPreference, fontA11y = param.fontA11y, locale = param.locale, navbarPreference = param.navbarPreference, pureSafeArea = param.pureSafeArea, safeArea = param.safeArea, safeAreaBottomTransparency = param.safeAreaBottomTransparency;
37932
+ var batteryModePreference = param.batteryModePreference, colorPreference = param.colorPreference, locale = param.locale, navbarPreference = param.navbarPreference, pureSafeArea = param.pureSafeArea, safeArea = param.safeArea, safeAreaBottomTransparency = param.safeAreaBottomTransparency;
37791
37933
  var platform = getPlatformOS();
37792
37934
  var appVersion = getTossAppVersion();
37793
37935
  var fontScale = (0, import_react_native142.useWindowDimensions)().fontScale;
37794
37936
  var platformString = platform === "ios" ? "iPhone" : "Android";
37937
+ var fontA11y = mapFontScaleToCategory(fontScale, platform);
37938
+ var normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
37795
37939
  return [
37796
37940
  "TossApp/".concat(appVersion),
37797
37941
  batteryModePreference && "TossBatteryModePreference/".concat(batteryModePreference),
37798
37942
  colorPreference && "TossColorPreference/".concat(colorPreference),
37799
- fontA11y && "TossFontAccessibility/".concat(fontA11y),
37800
- fontScale && "TossFontScale/".concat(fontScale),
37943
+ "TossFontAccessibility/".concat(fontA11y),
37944
+ "TossFontScale/".concat(normalizedFontScale),
37801
37945
  locale && "TossLocale/".concat(locale),
37802
37946
  navbarPreference && "TossNavbarPreference/".concat(navbarPreference),
37803
37947
  pureSafeArea && "TossPureSafeArea/".concat(pureSafeArea),
@@ -38007,7 +38151,7 @@ window.__bedrock.app = { name: Ait.appName, buildNumber: Ait.buildNumber };
38007
38151
  }
38008
38152
  return value;
38009
38153
  }
38010
- var import_react146, import_react_native128, import_react_native129, import_react_native130, import_react147, import_react148, import_react_native132, import_jsx_runtime177, import_react149, import_react_native134, import_react150, import_react_native136, import_react_native138, import_react_native139, import_react_native140, import_jsx_runtime178, import_react_native141, import_jsx_runtime179, import_jsx_runtime180, import_react151, import_react_native142, import_react152, import_jsx_runtime181, __defProp2, __export2, env, AppsInTossModuleInstance, AppsInTossModule, SEMVER_REGEX, isWildcard, tryParse, coerceTypes, compareValues, parseVersion, compareSegments, compareVersions, TossCoreModule, ENTRY_APP_EVENT_SCHEMA_ID, AppEvent, EntryMessageExitedEvent, nativeEventEmitter2, UpdateLocationEvent, INTERNAL__callbacks, INTERNAL__appBridgeHandler, UNSAFE__nativeEventEmitter, AppBridgeCallbackEvent, VisibilityChangedByTransparentServiceWebEvent, appsInTossEvent, async_bridges_exports2, DEFAULT_MAX_COUNT, DEFAULT_MAX_WIDTH, AppsInToss, ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION, IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE, ENVIRONMENT, Storage, IAP, GoogleAdMob, RIGHT_MARGIN2, IOS_DEFAULT_MARGIN2, styles31, originXML, GameWebView, globalEventListenerMap, constant_bridges_exports2, event_bridges_exports, extractDateFromUUIDv7, getGroupId, getReferrer, trackScreen, appsInTossGlobals, operationalEnvironment, TYPES, WEBVIEW_TYPES, Analytics2;
38154
+ var import_react146, import_react_native128, import_react_native129, import_react_native130, import_react147, import_react148, import_react_native132, import_jsx_runtime177, import_react149, import_react_native134, import_react150, import_react_native136, import_react_native138, import_react_native139, import_react_native140, import_jsx_runtime178, import_react_native141, import_jsx_runtime179, import_jsx_runtime180, import_react151, import_react_native142, import_react152, import_jsx_runtime181, __defProp2, __export2, env, AppsInTossModuleInstance, AppsInTossModule, SEMVER_REGEX, isWildcard, tryParse, coerceTypes, compareValues, parseVersion, compareSegments, compareVersions, TossCoreModule, ENTRY_APP_EVENT_SCHEMA_ID, AppEvent, EntryMessageExitedEvent, nativeEventEmitter2, UpdateLocationEvent, INTERNAL__callbacks, INTERNAL__appBridgeHandler, UNSAFE__nativeEventEmitter, AppBridgeCallbackEvent, VisibilityChangedByTransparentServiceWebEvent, appsInTossEvent, async_bridges_exports2, DEFAULT_MAX_COUNT, DEFAULT_MAX_WIDTH, AppsInToss, ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION, IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE, ENVIRONMENT, Storage, IAP, GoogleAdMob, RIGHT_MARGIN2, IOS_DEFAULT_MARGIN2, styles31, originXML, GameWebView, globalEventListenerMap, constant_bridges_exports2, event_bridges_exports, FontA11yCategory, androidFontScaleMap, iosScaleToAndroidScale, extractDateFromUUIDv7, getGroupId, getReferrer, trackScreen, appsInTossGlobals, operationalEnvironment, TYPES, WEBVIEW_TYPES, Analytics2;
38011
38155
  var init_dist4 = __esm({
38012
38156
  "../../.yarn/__virtual__/@apps-in-toss-framework-virtual-574b136add/1/apps-in-toss-packages/framework/dist/index.js"() {
38013
38157
  "use strict";
@@ -38540,6 +38684,42 @@ window.__bedrock.app = { name: Ait.appName, buildNumber: Ait.buildNumber };
38540
38684
  return startUpdateLocation;
38541
38685
  }
38542
38686
  });
38687
+ FontA11yCategory = {
38688
+ Large: "Large",
38689
+ xLarge: "xLarge",
38690
+ xxLarge: "xxLarge",
38691
+ xxxLarge: "xxxLarge",
38692
+ A11y_Medium: "A11y_Medium",
38693
+ A11y_Large: "A11y_Large",
38694
+ A11y_xLarge: "A11y_xLarge",
38695
+ A11y_xxLarge: "A11y_xxLarge",
38696
+ A11y_xxxLarge: "A11y_xxxLarge"
38697
+ };
38698
+ androidFontScaleMap = {
38699
+ 100: FontA11yCategory.Large,
38700
+ 110: FontA11yCategory.xLarge,
38701
+ 120: FontA11yCategory.xxLarge,
38702
+ 135: FontA11yCategory.xxxLarge,
38703
+ 160: FontA11yCategory.A11y_Medium,
38704
+ 190: FontA11yCategory.A11y_Large,
38705
+ 235: FontA11yCategory.A11y_xLarge,
38706
+ 275: FontA11yCategory.A11y_xxLarge,
38707
+ 310: FontA11yCategory.A11y_xxxLarge
38708
+ };
38709
+ iosScaleToAndroidScale = {
38710
+ 0.823: 100,
38711
+ 0.882: 100,
38712
+ 0.941: 100,
38713
+ 1: 100,
38714
+ 1.118: 110,
38715
+ 1.235: 120,
38716
+ 1.353: 135,
38717
+ 1.786: 160,
38718
+ 2.143: 190,
38719
+ 2.643: 235,
38720
+ 3.143: 275,
38721
+ 3.571: 310
38722
+ };
38543
38723
  extractDateFromUUIDv7 = function(uuid) {
38544
38724
  var timestampHex = uuid.split("-").join("").slice(0, 12);
38545
38725
  var timestamp = Number.parseInt(timestampHex, 16);
@@ -37841,18 +37841,162 @@ window.__bedrock.app = { name: Ait.appName, buildNumber: Ait.buildNumber };
37841
37841
  onMessage: $onMessage
37842
37842
  };
37843
37843
  }
37844
+ function convertToAndroidStyleScale(fontScale, platform) {
37845
+ if (platform === "android") {
37846
+ if (fontScale <= 1) {
37847
+ return 100;
37848
+ }
37849
+ var scaledValue = Math.round(fontScale * 100);
37850
+ var keys = Object.keys(androidFontScaleMap).map(Number).sort(function(a, b) {
37851
+ return a - b;
37852
+ });
37853
+ var closestKey = keys[0];
37854
+ var minDiff = Math.abs(scaledValue - closestKey);
37855
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
37856
+ try {
37857
+ for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
37858
+ var key = _step.value;
37859
+ var diff = Math.abs(scaledValue - key);
37860
+ if (diff < minDiff) {
37861
+ minDiff = diff;
37862
+ closestKey = key;
37863
+ }
37864
+ }
37865
+ } catch (err) {
37866
+ _didIteratorError = true;
37867
+ _iteratorError = err;
37868
+ } finally {
37869
+ try {
37870
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
37871
+ _iterator.return();
37872
+ }
37873
+ } finally {
37874
+ if (_didIteratorError) {
37875
+ throw _iteratorError;
37876
+ }
37877
+ }
37878
+ }
37879
+ return closestKey;
37880
+ } else {
37881
+ var iosScales = Object.keys(iosScaleToAndroidScale).map(Number);
37882
+ var closestScale = iosScales[0];
37883
+ var minDiff1 = Math.abs(fontScale - closestScale);
37884
+ var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
37885
+ try {
37886
+ for (var _iterator1 = iosScales[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
37887
+ var scale = _step1.value;
37888
+ var diff1 = Math.abs(fontScale - scale);
37889
+ if (diff1 < minDiff1) {
37890
+ minDiff1 = diff1;
37891
+ closestScale = scale;
37892
+ }
37893
+ }
37894
+ } catch (err) {
37895
+ _didIteratorError1 = true;
37896
+ _iteratorError1 = err;
37897
+ } finally {
37898
+ try {
37899
+ if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
37900
+ _iterator1.return();
37901
+ }
37902
+ } finally {
37903
+ if (_didIteratorError1) {
37904
+ throw _iteratorError1;
37905
+ }
37906
+ }
37907
+ }
37908
+ return iosScaleToAndroidScale[closestScale];
37909
+ }
37910
+ }
37911
+ function mapIOSFontScaleToCategory(fontScale) {
37912
+ if (fontScale < 1) {
37913
+ return FontA11yCategory.Large;
37914
+ }
37915
+ if (Math.abs(fontScale - 1) < 0.05) {
37916
+ return FontA11yCategory.Large;
37917
+ }
37918
+ if (Math.abs(fontScale - 1.118) < 0.05) {
37919
+ return FontA11yCategory.xLarge;
37920
+ }
37921
+ if (Math.abs(fontScale - 1.235) < 0.05) {
37922
+ return FontA11yCategory.xxLarge;
37923
+ }
37924
+ if (Math.abs(fontScale - 1.353) < 0.05) {
37925
+ return FontA11yCategory.xxxLarge;
37926
+ }
37927
+ if (Math.abs(fontScale - 1.786) < 0.05) {
37928
+ return FontA11yCategory.A11y_Medium;
37929
+ }
37930
+ if (Math.abs(fontScale - 2.143) < 0.05) {
37931
+ return FontA11yCategory.A11y_Large;
37932
+ }
37933
+ if (Math.abs(fontScale - 2.643) < 0.05) {
37934
+ return FontA11yCategory.A11y_xLarge;
37935
+ }
37936
+ if (Math.abs(fontScale - 3.143) < 0.05) {
37937
+ return FontA11yCategory.A11y_xxLarge;
37938
+ }
37939
+ if (Math.abs(fontScale - 3.571) < 0.05) {
37940
+ return FontA11yCategory.A11y_xxxLarge;
37941
+ }
37942
+ return FontA11yCategory.Large;
37943
+ }
37944
+ function mapAndroidFontScaleToCategory(fontScale) {
37945
+ if (fontScale <= 1) {
37946
+ return androidFontScaleMap[100];
37947
+ }
37948
+ var scaledValue = Math.round(fontScale * 100);
37949
+ var keys = Object.keys(androidFontScaleMap).map(Number).sort(function(a, b) {
37950
+ return a - b;
37951
+ });
37952
+ if (keys.length === 0) {
37953
+ return androidFontScaleMap[100];
37954
+ }
37955
+ var closestKey = keys[0];
37956
+ var minDiff = Math.abs(scaledValue - closestKey);
37957
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
37958
+ try {
37959
+ for (var _iterator = keys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
37960
+ var key = _step.value;
37961
+ var diff = Math.abs(scaledValue - key);
37962
+ if (diff < minDiff) {
37963
+ minDiff = diff;
37964
+ closestKey = key;
37965
+ }
37966
+ }
37967
+ } catch (err) {
37968
+ _didIteratorError = true;
37969
+ _iteratorError = err;
37970
+ } finally {
37971
+ try {
37972
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
37973
+ _iterator.return();
37974
+ }
37975
+ } finally {
37976
+ if (_didIteratorError) {
37977
+ throw _iteratorError;
37978
+ }
37979
+ }
37980
+ }
37981
+ return androidFontScaleMap[closestKey];
37982
+ }
37983
+ function mapFontScaleToCategory(fontScale, platform) {
37984
+ return platform === "ios" ? mapIOSFontScaleToCategory(fontScale) : mapAndroidFontScaleToCategory(fontScale);
37985
+ }
37844
37986
  function useCreateUserAgent(param) {
37845
- var batteryModePreference = param.batteryModePreference, colorPreference = param.colorPreference, fontA11y = param.fontA11y, locale = param.locale, navbarPreference = param.navbarPreference, pureSafeArea = param.pureSafeArea, safeArea = param.safeArea, safeAreaBottomTransparency = param.safeAreaBottomTransparency;
37987
+ var batteryModePreference = param.batteryModePreference, colorPreference = param.colorPreference, locale = param.locale, navbarPreference = param.navbarPreference, pureSafeArea = param.pureSafeArea, safeArea = param.safeArea, safeAreaBottomTransparency = param.safeAreaBottomTransparency;
37846
37988
  var platform = getPlatformOS();
37847
37989
  var appVersion = getTossAppVersion();
37848
37990
  var fontScale = (0, import_react_native143.useWindowDimensions)().fontScale;
37849
37991
  var platformString = platform === "ios" ? "iPhone" : "Android";
37992
+ var fontA11y = mapFontScaleToCategory(fontScale, platform);
37993
+ var normalizedFontScale = convertToAndroidStyleScale(fontScale, platform);
37850
37994
  return [
37851
37995
  "TossApp/".concat(appVersion),
37852
37996
  batteryModePreference && "TossBatteryModePreference/".concat(batteryModePreference),
37853
37997
  colorPreference && "TossColorPreference/".concat(colorPreference),
37854
- fontA11y && "TossFontAccessibility/".concat(fontA11y),
37855
- fontScale && "TossFontScale/".concat(fontScale),
37998
+ "TossFontAccessibility/".concat(fontA11y),
37999
+ "TossFontScale/".concat(normalizedFontScale),
37856
38000
  locale && "TossLocale/".concat(locale),
37857
38001
  navbarPreference && "TossNavbarPreference/".concat(navbarPreference),
37858
38002
  pureSafeArea && "TossPureSafeArea/".concat(pureSafeArea),
@@ -38062,7 +38206,7 @@ window.__bedrock.app = { name: Ait.appName, buildNumber: Ait.buildNumber };
38062
38206
  }
38063
38207
  return value;
38064
38208
  }
38065
- var import_react146, import_react_native129, import_react_native130, import_react_native131, import_react147, import_react148, import_react_native133, import_jsx_runtime176, import_react149, import_react_native135, import_react150, import_react_native137, import_react_native139, import_react_native140, import_react_native141, import_jsx_runtime177, import_react_native142, import_jsx_runtime178, import_jsx_runtime179, import_react151, import_react_native143, import_react152, import_jsx_runtime180, __defProp2, __export2, env, AppsInTossModuleInstance, AppsInTossModule, SEMVER_REGEX, isWildcard, tryParse, coerceTypes, compareValues, parseVersion, compareSegments, compareVersions, TossCoreModule, ENTRY_APP_EVENT_SCHEMA_ID, AppEvent, EntryMessageExitedEvent, nativeEventEmitter2, UpdateLocationEvent, INTERNAL__callbacks, INTERNAL__appBridgeHandler, UNSAFE__nativeEventEmitter, AppBridgeCallbackEvent, VisibilityChangedByTransparentServiceWebEvent, appsInTossEvent, async_bridges_exports2, DEFAULT_MAX_COUNT, DEFAULT_MAX_WIDTH, AppsInToss, ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION, IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE, ENVIRONMENT, Storage, IAP, GoogleAdMob, RIGHT_MARGIN2, IOS_DEFAULT_MARGIN2, styles31, originXML, GameWebView, globalEventListenerMap, constant_bridges_exports2, event_bridges_exports, extractDateFromUUIDv7, getGroupId, getReferrer, trackScreen, appsInTossGlobals, operationalEnvironment, TYPES, WEBVIEW_TYPES, Analytics2;
38209
+ var import_react146, import_react_native129, import_react_native130, import_react_native131, import_react147, import_react148, import_react_native133, import_jsx_runtime176, import_react149, import_react_native135, import_react150, import_react_native137, import_react_native139, import_react_native140, import_react_native141, import_jsx_runtime177, import_react_native142, import_jsx_runtime178, import_jsx_runtime179, import_react151, import_react_native143, import_react152, import_jsx_runtime180, __defProp2, __export2, env, AppsInTossModuleInstance, AppsInTossModule, SEMVER_REGEX, isWildcard, tryParse, coerceTypes, compareValues, parseVersion, compareSegments, compareVersions, TossCoreModule, ENTRY_APP_EVENT_SCHEMA_ID, AppEvent, EntryMessageExitedEvent, nativeEventEmitter2, UpdateLocationEvent, INTERNAL__callbacks, INTERNAL__appBridgeHandler, UNSAFE__nativeEventEmitter, AppBridgeCallbackEvent, VisibilityChangedByTransparentServiceWebEvent, appsInTossEvent, async_bridges_exports2, DEFAULT_MAX_COUNT, DEFAULT_MAX_WIDTH, AppsInToss, ANDROID_GOOGLE_AD_MOB_SUPPORTED_VERSION, IOS_GOOGLE_AD_MOB_SUPPORTED_VERSION, UNSUPPORTED_ERROR_MESSAGE, ENVIRONMENT, Storage, IAP, GoogleAdMob, RIGHT_MARGIN2, IOS_DEFAULT_MARGIN2, styles31, originXML, GameWebView, globalEventListenerMap, constant_bridges_exports2, event_bridges_exports, FontA11yCategory, androidFontScaleMap, iosScaleToAndroidScale, extractDateFromUUIDv7, getGroupId, getReferrer, trackScreen, appsInTossGlobals, operationalEnvironment, TYPES, WEBVIEW_TYPES, Analytics2;
38066
38210
  var init_dist4 = __esm({
38067
38211
  "../../.yarn/__virtual__/@apps-in-toss-framework-virtual-574b136add/1/apps-in-toss-packages/framework/dist/index.js"() {
38068
38212
  "use strict";
@@ -38595,6 +38739,42 @@ window.__bedrock.app = { name: Ait.appName, buildNumber: Ait.buildNumber };
38595
38739
  return startUpdateLocation;
38596
38740
  }
38597
38741
  });
38742
+ FontA11yCategory = {
38743
+ Large: "Large",
38744
+ xLarge: "xLarge",
38745
+ xxLarge: "xxLarge",
38746
+ xxxLarge: "xxxLarge",
38747
+ A11y_Medium: "A11y_Medium",
38748
+ A11y_Large: "A11y_Large",
38749
+ A11y_xLarge: "A11y_xLarge",
38750
+ A11y_xxLarge: "A11y_xxLarge",
38751
+ A11y_xxxLarge: "A11y_xxxLarge"
38752
+ };
38753
+ androidFontScaleMap = {
38754
+ 100: FontA11yCategory.Large,
38755
+ 110: FontA11yCategory.xLarge,
38756
+ 120: FontA11yCategory.xxLarge,
38757
+ 135: FontA11yCategory.xxxLarge,
38758
+ 160: FontA11yCategory.A11y_Medium,
38759
+ 190: FontA11yCategory.A11y_Large,
38760
+ 235: FontA11yCategory.A11y_xLarge,
38761
+ 275: FontA11yCategory.A11y_xxLarge,
38762
+ 310: FontA11yCategory.A11y_xxxLarge
38763
+ };
38764
+ iosScaleToAndroidScale = {
38765
+ 0.823: 100,
38766
+ 0.882: 100,
38767
+ 0.941: 100,
38768
+ 1: 100,
38769
+ 1.118: 110,
38770
+ 1.235: 120,
38771
+ 1.353: 135,
38772
+ 1.786: 160,
38773
+ 2.143: 190,
38774
+ 2.643: 235,
38775
+ 3.143: 275,
38776
+ 3.571: 310
38777
+ };
38598
38778
  extractDateFromUUIDv7 = function(uuid) {
38599
38779
  var timestampHex = uuid.split("-").join("").slice(0, 12);
38600
38780
  var timestamp = Number.parseInt(timestampHex, 16);
@@ -2,13 +2,13 @@
2
2
  {
3
3
  "platform": "ios",
4
4
  "totalModuleCount": 1615,
5
- "duration": 1289.585083,
6
- "size": 1511511
5
+ "duration": 1448.8614160000002,
6
+ "size": 1517456
7
7
  },
8
8
  {
9
9
  "platform": "android",
10
10
  "totalModuleCount": 1615,
11
- "duration": 1318.3562500000003,
12
- "size": 1509870
11
+ "duration": 1467.9485,
12
+ "size": 1515815
13
13
  }
14
14
  ]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apps-in-toss/web-framework",
3
3
  "type": "module",
4
- "version": "0.0.30",
4
+ "version": "0.0.31",
5
5
  "description": "Web Framework for Apps In Toss",
6
6
  "scripts": {
7
7
  "prepack": "yarn build",
@@ -51,7 +51,7 @@
51
51
  "config.d.ts"
52
52
  ],
53
53
  "devDependencies": {
54
- "@apps-in-toss/framework": "0.0.30",
54
+ "@apps-in-toss/framework": "0.0.31",
55
55
  "@babel/plugin-proposal-class-properties": "^7.16.7",
56
56
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
57
57
  "@babel/plugin-proposal-numeric-separator": "^7.16.7",
@@ -102,16 +102,16 @@
102
102
  "zod": "3.24.4"
103
103
  },
104
104
  "dependencies": {
105
- "@apps-in-toss/bridge-core": "0.0.30",
106
- "@apps-in-toss/cli": "0.0.30",
107
- "@apps-in-toss/plugins": "0.0.30",
108
- "@apps-in-toss/web-analytics": "0.0.30",
109
- "@apps-in-toss/web-bridge": "0.0.30",
105
+ "@apps-in-toss/bridge-core": "0.0.31",
106
+ "@apps-in-toss/cli": "0.0.31",
107
+ "@apps-in-toss/plugins": "0.0.31",
108
+ "@apps-in-toss/web-analytics": "0.0.31",
109
+ "@apps-in-toss/web-bridge": "0.0.31",
110
110
  "@babel/core": "7.23.9",
111
111
  "@react-native-bedrock/utils": "0.0.25"
112
112
  },
113
113
  "publishConfig": {
114
114
  "access": "public"
115
115
  },
116
- "gitHead": "7390d4ed0f09dec042523a302bc1aa0d21474512"
116
+ "gitHead": "d4fa62f4014162182181b9911e0a2912fdec318d"
117
117
  }