@expo/prebuild-config 5.0.7 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/build/getAutolinkedPackages.js +3 -13
  2. package/build/getAutolinkedPackages.js.map +1 -1
  3. package/build/getPrebuildConfig.js +9 -24
  4. package/build/getPrebuildConfig.js.map +1 -1
  5. package/build/importExpoModulesAutolinking.d.ts +3 -3
  6. package/build/importExpoModulesAutolinking.js +0 -5
  7. package/build/importExpoModulesAutolinking.js.map +1 -1
  8. package/build/index.js +0 -5
  9. package/build/index.js.map +1 -1
  10. package/build/plugins/icons/AssetContents.d.ts +3 -3
  11. package/build/plugins/icons/AssetContents.js +1 -10
  12. package/build/plugins/icons/AssetContents.js.map +1 -1
  13. package/build/plugins/icons/withAndroidIcons.d.ts +7 -5
  14. package/build/plugins/icons/withAndroidIcons.js +52 -71
  15. package/build/plugins/icons/withAndroidIcons.js.map +1 -1
  16. package/build/plugins/icons/withAndroidManifestIcons.js +0 -10
  17. package/build/plugins/icons/withAndroidManifestIcons.js.map +1 -1
  18. package/build/plugins/icons/withIosIcons.js +24 -48
  19. package/build/plugins/icons/withIosIcons.js.map +1 -1
  20. package/build/plugins/unversioned/createLegacyPlugin.js +0 -11
  21. package/build/plugins/unversioned/createLegacyPlugin.js.map +1 -1
  22. package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js +0 -11
  23. package/build/plugins/unversioned/expo-ads-admob/expo-ads-admob.js.map +1 -1
  24. package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js +0 -14
  25. package/build/plugins/unversioned/expo-ads-admob/withAndroidAdMob.js.map +1 -1
  26. package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js +5 -14
  27. package/build/plugins/unversioned/expo-ads-admob/withIosAdMob.js.map +1 -1
  28. package/build/plugins/unversioned/expo-apple-authentication.js +0 -11
  29. package/build/plugins/unversioned/expo-apple-authentication.js.map +1 -1
  30. package/build/plugins/unversioned/expo-branch/expo-branch.js +4 -13
  31. package/build/plugins/unversioned/expo-branch/expo-branch.js.map +1 -1
  32. package/build/plugins/unversioned/expo-branch/withAndroidBranch.js +0 -12
  33. package/build/plugins/unversioned/expo-branch/withAndroidBranch.js.map +1 -1
  34. package/build/plugins/unversioned/expo-branch/withIosBranch.js +2 -11
  35. package/build/plugins/unversioned/expo-branch/withIosBranch.js.map +1 -1
  36. package/build/plugins/unversioned/expo-contacts.js +2 -13
  37. package/build/plugins/unversioned/expo-contacts.js.map +1 -1
  38. package/build/plugins/unversioned/expo-document-picker.js +2 -12
  39. package/build/plugins/unversioned/expo-document-picker.js.map +1 -1
  40. package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js +2 -9
  41. package/build/plugins/unversioned/expo-navigation-bar/expo-navigation-bar.js.map +1 -1
  42. package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js +0 -20
  43. package/build/plugins/unversioned/expo-navigation-bar/withAndroidNavigationBar.js.map +1 -1
  44. package/build/plugins/unversioned/expo-notifications/expo-notifications.js +4 -14
  45. package/build/plugins/unversioned/expo-notifications/expo-notifications.js.map +1 -1
  46. package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.d.ts +1 -1
  47. package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.js +1 -44
  48. package/build/plugins/unversioned/expo-notifications/withAndroidNotifications.js.map +1 -1
  49. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.d.ts +20 -20
  50. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js +14 -33
  51. package/build/plugins/unversioned/expo-splash-screen/InterfaceBuilder.js.map +1 -1
  52. package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js +0 -11
  53. package/build/plugins/unversioned/expo-splash-screen/expo-splash-screen.js.map +1 -1
  54. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.d.ts +1 -1
  55. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js +2 -11
  56. package/build/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.js.map +1 -1
  57. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.d.ts +1 -2
  58. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js +0 -26
  59. package/build/plugins/unversioned/expo-splash-screen/getIosSplashConfig.js.map +1 -1
  60. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js +4 -9
  61. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashDrawables.js.map +1 -1
  62. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js +9 -36
  63. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashImages.js.map +1 -1
  64. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js +13 -34
  65. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashLegacyMainActivity.js.map +1 -1
  66. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js +4 -46
  67. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashScreen.js.map +1 -1
  68. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js +0 -13
  69. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStrings.js.map +1 -1
  70. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js +2 -23
  71. package/build/plugins/unversioned/expo-splash-screen/withAndroidSplashStyles.js.map +1 -1
  72. package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js +16 -54
  73. package/build/plugins/unversioned/expo-splash-screen/withIosSplashAssets.js.map +1 -1
  74. package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js +6 -22
  75. package/build/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.js.map +1 -1
  76. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js +7 -35
  77. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreen.js.map +1 -1
  78. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js +9 -33
  79. package/build/plugins/unversioned/expo-splash-screen/withIosSplashScreenStoryboard.js.map +1 -1
  80. package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js +1 -18
  81. package/build/plugins/unversioned/expo-splash-screen/withIosSplashXcodeProject.js.map +1 -1
  82. package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js +2 -15
  83. package/build/plugins/unversioned/expo-splash-screen/wtihIosSplashScreenStoryboardImage.js.map +1 -1
  84. package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js +0 -17
  85. package/build/plugins/unversioned/expo-system-ui/expo-system-ui.js.map +1 -1
  86. package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js +0 -14
  87. package/build/plugins/unversioned/expo-system-ui/withAndroidRootViewBackgroundColor.js.map +1 -1
  88. package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js +2 -9
  89. package/build/plugins/unversioned/expo-system-ui/withAndroidUserInterfaceStyle.js.map +1 -1
  90. package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js +2 -27
  91. package/build/plugins/unversioned/expo-system-ui/withIosRootViewBackgroundColor.js.map +1 -1
  92. package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js +2 -14
  93. package/build/plugins/unversioned/expo-system-ui/withIosUserInterfaceStyle.js.map +1 -1
  94. package/build/plugins/unversioned/expo-updates.js +1 -8
  95. package/build/plugins/unversioned/expo-updates.js.map +1 -1
  96. package/build/plugins/unversioned/react-native-maps.js +4 -19
  97. package/build/plugins/unversioned/react-native-maps.js.map +1 -1
  98. package/build/plugins/withDefaultPlugins.d.ts +2 -2
  99. package/build/plugins/withDefaultPlugins.js +41 -94
  100. package/build/plugins/withDefaultPlugins.js.map +1 -1
  101. package/package.json +6 -6
  102. package/build/plugins/unversioned/expo-facebook/expo-facebook.d.ts +0 -2
  103. package/build/plugins/unversioned/expo-facebook/expo-facebook.js +0 -57
  104. package/build/plugins/unversioned/expo-facebook/expo-facebook.js.map +0 -1
  105. package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.d.ts +0 -13
  106. package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.js +0 -235
  107. package/build/plugins/unversioned/expo-facebook/withAndroidFacebook.js.map +0 -1
  108. package/build/plugins/unversioned/expo-facebook/withIosFacebook.d.ts +0 -26
  109. package/build/plugins/unversioned/expo-facebook/withIosFacebook.js +0 -233
  110. package/build/plugins/unversioned/expo-facebook/withIosFacebook.js.map +0 -1
  111. package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.d.ts +0 -9
  112. package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.js +0 -69
  113. package/build/plugins/unversioned/expo-facebook/withSKAdNetworkIdentifiers.js.map +0 -1
@@ -5,84 +5,60 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.buildContentsJsonImages = buildContentsJsonImages;
7
7
  exports.withIosSplashAssets = void 0;
8
-
9
8
  function _configPlugins() {
10
9
  const data = require("@expo/config-plugins");
11
-
12
10
  _configPlugins = function () {
13
11
  return data;
14
12
  };
15
-
16
13
  return data;
17
14
  }
18
-
19
15
  function _imageUtils() {
20
16
  const data = require("@expo/image-utils");
21
-
22
17
  _imageUtils = function () {
23
18
  return data;
24
19
  };
25
-
26
20
  return data;
27
21
  }
28
-
29
22
  function _debug() {
30
23
  const data = _interopRequireDefault(require("debug"));
31
-
32
24
  _debug = function () {
33
25
  return data;
34
26
  };
35
-
36
27
  return data;
37
28
  }
38
-
39
29
  function _fsExtra() {
40
30
  const data = _interopRequireDefault(require("fs-extra"));
41
-
42
31
  _fsExtra = function () {
43
32
  return data;
44
33
  };
45
-
46
34
  return data;
47
35
  }
48
-
49
36
  function _jimpCompact() {
50
37
  const data = _interopRequireDefault(require("jimp-compact"));
51
-
52
38
  _jimpCompact = function () {
53
39
  return data;
54
40
  };
55
-
56
41
  return data;
57
42
  }
58
-
59
43
  function path() {
60
44
  const data = _interopRequireWildcard(require("path"));
61
-
62
45
  path = function () {
63
46
  return data;
64
47
  };
65
-
66
48
  return data;
67
49
  }
68
-
69
50
  function _AssetContents() {
70
51
  const data = require("../../icons/AssetContents");
71
-
72
52
  _AssetContents = function () {
73
53
  return data;
74
54
  };
75
-
76
55
  return data;
77
56
  }
78
-
79
57
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
80
-
81
58
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
82
-
83
59
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
84
-
85
60
  // @ts-ignore
61
+
86
62
  const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:ios:assets');
87
63
  const IMAGE_CACHE_NAME = 'splash-ios';
88
64
  const IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';
@@ -91,17 +67,13 @@ const PNG_FILENAME = 'image.png';
91
67
  const DARK_PNG_FILENAME = 'dark_image.png';
92
68
  const TABLET_PNG_FILENAME = 'tablet_image.png';
93
69
  const DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';
94
-
95
70
  const withIosSplashAssets = (config, splash) => {
96
71
  if (!splash) {
97
72
  return config;
98
73
  }
99
-
100
74
  return (0, _configPlugins().withDangerousMod)(config, ['ios', async config => {
101
75
  var _splash$dark, _splash$dark2;
102
-
103
76
  const iosNamedProjectRoot = _configPlugins().IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);
104
-
105
77
  await createSplashScreenBackgroundImageAsync({
106
78
  iosNamedProjectRoot,
107
79
  splash
@@ -117,13 +89,11 @@ const withIosSplashAssets = (config, splash) => {
117
89
  return config;
118
90
  }]);
119
91
  };
92
+
120
93
  /**
121
94
  * Creates imageset containing image for Splash/Launch Screen.
122
95
  */
123
-
124
-
125
96
  exports.withIosSplashAssets = withIosSplashAssets;
126
-
127
97
  async function configureImageAssets({
128
98
  projectRoot,
129
99
  iosNamedProjectRoot,
@@ -132,14 +102,13 @@ async function configureImageAssets({
132
102
  tabletImage,
133
103
  darkTabletImage
134
104
  }) {
135
- const imageSetPath = path().resolve(iosNamedProjectRoot, IMAGESET_PATH); // ensure old SplashScreen imageSet is removed
105
+ const imageSetPath = path().resolve(iosNamedProjectRoot, IMAGESET_PATH);
136
106
 
107
+ // ensure old SplashScreen imageSet is removed
137
108
  await _fsExtra().default.remove(imageSetPath);
138
-
139
109
  if (!image) {
140
110
  return;
141
111
  }
142
-
143
112
  await writeContentsJsonFileAsync({
144
113
  assetPath: imageSetPath,
145
114
  image: PNG_FILENAME,
@@ -156,12 +125,10 @@ async function configureImageAssets({
156
125
  darkTabletImage
157
126
  });
158
127
  }
159
-
160
128
  async function createPngFileAsync(color, filePath) {
161
129
  const png = new (_jimpCompact().default)(1, 1, color);
162
130
  return png.writeAsync(filePath);
163
131
  }
164
-
165
132
  async function createBackgroundImagesAsync({
166
133
  iosNamedProjectRoot,
167
134
  color,
@@ -173,14 +140,12 @@ async function createBackgroundImagesAsync({
173
140
  async generateImageAsset(item, fileName) {
174
141
  await createPngFileAsync(item, path().resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName));
175
142
  },
176
-
177
143
  anyItem: color,
178
144
  darkItem: darkColor,
179
145
  tabletItem: tabletColor,
180
146
  darkTabletItem: darkTabletColor
181
147
  });
182
148
  }
183
-
184
149
  async function copyImageFiles({
185
150
  projectRoot,
186
151
  iosNamedProjectRoot,
@@ -200,19 +165,17 @@ async function copyImageFiles({
200
165
  cacheType: IMAGE_CACHE_NAME
201
166
  }, {
202
167
  src: item
203
- }); // Write image buffer to the file system.
168
+ });
169
+ // Write image buffer to the file system.
204
170
  // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);
205
-
206
171
  await _fsExtra().default.writeFile(path().resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);
207
172
  },
208
-
209
173
  anyItem: image,
210
174
  darkItem: darkImage,
211
175
  tabletItem: tabletImage,
212
176
  darkTabletItem: darkTabletImage
213
177
  });
214
178
  }
215
-
216
179
  async function generateImagesAssetsAsync({
217
180
  generateImageAsset,
218
181
  anyItem,
@@ -223,19 +186,17 @@ async function generateImagesAssetsAsync({
223
186
  const items = [[anyItem, PNG_FILENAME], [darkItem, DARK_PNG_FILENAME], [tabletItem, TABLET_PNG_FILENAME], [darkTabletItem, DARK_TABLET_PNG_FILENAME]].filter(([item]) => !!item);
224
187
  await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));
225
188
  }
226
-
227
189
  async function createSplashScreenBackgroundImageAsync({
228
190
  iosNamedProjectRoot,
229
191
  splash
230
192
  }) {
231
193
  var _splash$dark3, _splash$dark4;
232
-
233
194
  const color = splash.backgroundColor;
234
195
  const darkColor = (_splash$dark3 = splash.dark) === null || _splash$dark3 === void 0 ? void 0 : _splash$dark3.backgroundColor;
235
196
  const tabletColor = splash.tabletBackgroundColor;
236
197
  const darkTabletColor = (_splash$dark4 = splash.dark) === null || _splash$dark4 === void 0 ? void 0 : _splash$dark4.tabletBackgroundColor;
237
- const imagesetPath = path().join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH); // Ensure the Images.xcassets/... path exists
238
-
198
+ const imagesetPath = path().join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);
199
+ // Ensure the Images.xcassets/... path exists
239
200
  await _fsExtra().default.remove(imagesetPath);
240
201
  await _fsExtra().default.ensureDir(imagesetPath);
241
202
  await createBackgroundImagesAsync({
@@ -253,19 +214,18 @@ async function createSplashScreenBackgroundImageAsync({
253
214
  darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null
254
215
  });
255
216
  }
256
-
257
217
  const darkAppearances = [{
258
218
  appearance: 'luminosity',
259
219
  value: 'dark'
260
220
  }];
261
-
262
221
  function buildContentsJsonImages({
263
222
  image,
264
223
  darkImage,
265
224
  tabletImage,
266
225
  darkTabletImage
267
226
  }) {
268
- return [// Phone light
227
+ return [
228
+ // Phone light
269
229
  (0, _AssetContents().createContentsJsonItem)({
270
230
  idiom: 'universal',
271
231
  filename: image,
@@ -276,7 +236,8 @@ function buildContentsJsonImages({
276
236
  }), (0, _AssetContents().createContentsJsonItem)({
277
237
  idiom: 'universal',
278
238
  scale: '3x'
279
- }), // Phone dark
239
+ }),
240
+ // Phone dark
280
241
  darkImage && (0, _AssetContents().createContentsJsonItem)({
281
242
  idiom: 'universal',
282
243
  appearances: darkAppearances,
@@ -290,7 +251,8 @@ function buildContentsJsonImages({
290
251
  idiom: 'universal',
291
252
  appearances: darkAppearances,
292
253
  scale: '3x'
293
- }), // Tablet light
254
+ }),
255
+ // Tablet light
294
256
  tabletImage && (0, _AssetContents().createContentsJsonItem)({
295
257
  idiom: 'ipad',
296
258
  filename: tabletImage,
@@ -298,7 +260,8 @@ function buildContentsJsonImages({
298
260
  }), tabletImage && (0, _AssetContents().createContentsJsonItem)({
299
261
  idiom: 'ipad',
300
262
  scale: '2x'
301
- }), // Phone dark
263
+ }),
264
+ // Phone dark
302
265
  darkTabletImage && (0, _AssetContents().createContentsJsonItem)({
303
266
  idiom: 'ipad',
304
267
  appearances: darkAppearances,
@@ -310,7 +273,6 @@ function buildContentsJsonImages({
310
273
  scale: '2x'
311
274
  })].filter(Boolean);
312
275
  }
313
-
314
276
  async function writeContentsJsonFileAsync({
315
277
  assetPath,
316
278
  image,
@@ -1 +1 @@
1
- {"version":3,"file":"withIosSplashAssets.js","names":["debug","Debug","IMAGE_CACHE_NAME","IMAGESET_PATH","BACKGROUND_IMAGESET_PATH","PNG_FILENAME","DARK_PNG_FILENAME","TABLET_PNG_FILENAME","DARK_TABLET_PNG_FILENAME","withIosSplashAssets","config","splash","withDangerousMod","iosNamedProjectRoot","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","createSplashScreenBackgroundImageAsync","configureImageAssets","image","darkImage","dark","tabletImage","darkTabletImage","imageSetPath","path","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","createPngFileAsync","color","filePath","png","Jimp","writeAsync","createBackgroundImagesAsync","darkColor","tabletColor","darkTabletColor","generateImagesAssetsAsync","generateImageAsset","item","fileName","anyItem","darkItem","tabletItem","darkTabletItem","source","generateImageAsync","cacheType","src","writeFile","items","filter","Promise","all","map","backgroundColor","tabletBackgroundColor","imagesetPath","join","ensureDir","darkAppearances","appearance","value","buildContentsJsonImages","createContentsJsonItem","idiom","filename","scale","appearances","undefined","Boolean","images","writeContentsJsonAsync"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashAssets.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';\nimport { generateImageAsync } from '@expo/image-utils';\nimport Debug from 'debug';\nimport fs from 'fs-extra';\n// @ts-ignore\nimport Jimp from 'jimp-compact';\nimport * as path from 'path';\n\nimport {\n ContentsJsonImage,\n ContentsJsonImageAppearance,\n createContentsJsonItem,\n writeContentsJsonAsync,\n} from '../../icons/AssetContents';\nimport { IOSSplashConfig } from './getIosSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:assets');\n\nconst IMAGE_CACHE_NAME = 'splash-ios';\nconst IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';\nconst BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';\nconst PNG_FILENAME = 'image.png';\nconst DARK_PNG_FILENAME = 'dark_image.png';\nconst TABLET_PNG_FILENAME = 'tablet_image.png';\nconst DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';\n\nexport const withIosSplashAssets: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n if (!splash) {\n return config;\n }\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const iosNamedProjectRoot = IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);\n\n await createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n });\n\n await configureImageAssets({\n projectRoot: config.modRequest.projectRoot,\n iosNamedProjectRoot,\n image: splash.image,\n darkImage: splash.dark?.image,\n tabletImage: splash.tabletImage,\n darkTabletImage: splash.dark?.tabletImage,\n });\n\n return config;\n },\n ]);\n};\n\n/**\n * Creates imageset containing image for Splash/Launch Screen.\n */\nasync function configureImageAssets({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage: string | null;\n darkTabletImage?: string | null;\n}) {\n const imageSetPath = path.resolve(iosNamedProjectRoot, IMAGESET_PATH);\n\n // ensure old SplashScreen imageSet is removed\n await fs.remove(imageSetPath);\n\n if (!image) {\n return;\n }\n\n await writeContentsJsonFileAsync({\n assetPath: imageSetPath,\n image: PNG_FILENAME,\n darkImage: darkImage ? DARK_PNG_FILENAME : null,\n tabletImage: tabletImage ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null,\n });\n\n await copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n });\n}\n\nasync function createPngFileAsync(color: string, filePath: string) {\n const png = new Jimp(1, 1, color);\n return png.writeAsync(filePath);\n}\n\nasync function createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor,\n tabletColor,\n darkTabletColor,\n}: {\n iosNamedProjectRoot: string;\n color: string;\n darkColor: string | null;\n tabletColor: string | null;\n darkTabletColor: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n await createPngFileAsync(\n item,\n path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName)\n );\n },\n anyItem: color,\n darkItem: darkColor,\n tabletItem: tabletColor,\n darkTabletItem: darkTabletColor,\n });\n}\n\nasync function copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: item,\n } as any);\n // Write image buffer to the file system.\n // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(path.resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);\n },\n anyItem: image,\n darkItem: darkImage,\n tabletItem: tabletImage,\n darkTabletItem: darkTabletImage,\n });\n}\n\nasync function generateImagesAssetsAsync({\n generateImageAsset,\n anyItem,\n darkItem,\n tabletItem,\n darkTabletItem,\n}: {\n generateImageAsset: (item: string, fileName: string) => Promise<void>;\n anyItem: string;\n darkItem?: string | null;\n tabletItem?: string | null;\n darkTabletItem?: string | null;\n}) {\n const items = [\n [anyItem, PNG_FILENAME],\n [darkItem, DARK_PNG_FILENAME],\n [tabletItem, TABLET_PNG_FILENAME],\n [darkTabletItem, DARK_TABLET_PNG_FILENAME],\n ].filter(([item]) => !!item) as unknown as [string, string];\n\n await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));\n}\n\nasync function createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n}: {\n // Something like projectRoot/ios/MyApp/\n iosNamedProjectRoot: string;\n splash: IOSSplashConfig;\n}) {\n const color = splash.backgroundColor;\n const darkColor = splash.dark?.backgroundColor;\n const tabletColor = splash.tabletBackgroundColor;\n const darkTabletColor = splash.dark?.tabletBackgroundColor;\n\n const imagesetPath = path.join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);\n // Ensure the Images.xcassets/... path exists\n await fs.remove(imagesetPath);\n await fs.ensureDir(imagesetPath);\n\n await createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor: darkColor ? darkColor : null,\n tabletColor: tabletColor ? tabletColor : null,\n darkTabletColor: darkTabletColor ? darkTabletColor : null,\n });\n\n await writeContentsJsonFileAsync({\n assetPath: path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH),\n image: PNG_FILENAME,\n darkImage: darkColor ? DARK_PNG_FILENAME : null,\n tabletImage: tabletColor ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null,\n });\n}\n\nconst darkAppearances: ContentsJsonImageAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonImageAppearance,\n];\n\nexport function buildContentsJsonImages({\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n image: string;\n tabletImage: string | null;\n darkImage: string | null;\n darkTabletImage: string | null;\n}): ContentsJsonImage[] {\n return [\n // Phone light\n createContentsJsonItem({\n idiom: 'universal',\n filename: image,\n scale: '1x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '2x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '3x',\n }),\n // Phone dark\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n filename: darkImage,\n scale: '1x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: tabletImage,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: darkTabletImage ?? undefined,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n scale: '2x',\n }),\n ].filter(Boolean) as ContentsJsonImage[];\n}\n\nasync function writeContentsJsonFileAsync({\n assetPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n assetPath: string;\n image: string;\n darkImage: string | null;\n tabletImage: string | null;\n darkTabletImage: string | null;\n}) {\n const images = buildContentsJsonImages({ image, darkImage, tabletImage, darkTabletImage });\n\n debug(`create contents.json:`, assetPath);\n debug(`use images:`, images);\n await writeContentsJsonAsync(assetPath, { images });\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;;;AAJA;AAYA,MAAMA,KAAK,GAAG,IAAAC,gBAAA,EAAM,oDAAN,CAAd;AAEA,MAAMC,gBAAgB,GAAG,YAAzB;A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AuDLjD,eAAe,IACb,IAAA8C,uCAAA,EAAuB;IACrBC,KAAK,EAAE,MADc;IAErBG,WAAW,EAAER,eAFQ;IAGrBO,KAAK,EAAE;EAHc,CAAvB,CAxDG,EA6DLhB,MA7DK,CA6DEmB,OA7DF,CAAP;AA8DD;;AAED,eAAe9C,0BAAf,CAA0C;EACxCC,SADwC;EAExCX,KAFwC;EAGxCC,SAHwC;EAIxCE,WAJwC;EAKxCC;AALwC,CAA1C,EAYG;EACD,MAAMqD,MAAM,GAAGR,uBAAuB,CAAC;IAAEjD,KAAF;IAASC,SAAT;IAAoBE,WAApB;IAAiCC;EAAjC,CAAD,CAAtC;EAEAzB,KAAK,CAAE,uBAAF,EAA0BgC,SAA1B,CAAL;EACAhC,KAAK,CAAE,aAAF,EAAgB8E,MAAhB,CAAL;EACA,MAAM,IAAAC,uCAAA,EAAuB/C,SAAvB,EAAkC;IAAE8C;EAAF,CAAlC,CAAN;AACD"}
1
+ {"version":3,"file":"withIosSplashAssets.js","names":["debug","Debug","IMAGE_CACHE_NAME","IMAGESET_PATH","BACKGROUND_IMAGESET_PATH","PNG_FILENAME","DARK_PNG_FILENAME","TABLET_PNG_FILENAME","DARK_TABLET_PNG_FILENAME","withIosSplashAssets","config","splash","withDangerousMod","iosNamedProjectRoot","IOSConfig","Paths","getSourceRoot","modRequest","projectRoot","createSplashScreenBackgroundImageAsync","configureImageAssets","image","darkImage","dark","tabletImage","darkTabletImage","imageSetPath","path","resolve","fs","remove","writeContentsJsonFileAsync","assetPath","copyImageFiles","createPngFileAsync","color","filePath","png","Jimp","writeAsync","createBackgroundImagesAsync","darkColor","tabletColor","darkTabletColor","generateImagesAssetsAsync","generateImageAsset","item","fileName","anyItem","darkItem","tabletItem","darkTabletItem","source","generateImageAsync","cacheType","src","writeFile","items","filter","Promise","all","map","backgroundColor","tabletBackgroundColor","imagesetPath","join","ensureDir","darkAppearances","appearance","value","buildContentsJsonImages","createContentsJsonItem","idiom","filename","scale","appearances","undefined","Boolean","images","writeContentsJsonAsync"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashAssets.ts"],"sourcesContent":["import { ConfigPlugin, IOSConfig, withDangerousMod } from '@expo/config-plugins';\nimport { generateImageAsync } from '@expo/image-utils';\nimport Debug from 'debug';\nimport fs from 'fs-extra';\n// @ts-ignore\nimport Jimp from 'jimp-compact';\nimport * as path from 'path';\n\nimport {\n ContentsJsonImage,\n ContentsJsonImageAppearance,\n createContentsJsonItem,\n writeContentsJsonAsync,\n} from '../../icons/AssetContents';\nimport { IOSSplashConfig } from './getIosSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:assets');\n\nconst IMAGE_CACHE_NAME = 'splash-ios';\nconst IMAGESET_PATH = 'Images.xcassets/SplashScreen.imageset';\nconst BACKGROUND_IMAGESET_PATH = 'Images.xcassets/SplashScreenBackground.imageset';\nconst PNG_FILENAME = 'image.png';\nconst DARK_PNG_FILENAME = 'dark_image.png';\nconst TABLET_PNG_FILENAME = 'tablet_image.png';\nconst DARK_TABLET_PNG_FILENAME = 'dark_tablet_image.png';\n\nexport const withIosSplashAssets: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n if (!splash) {\n return config;\n }\n return withDangerousMod(config, [\n 'ios',\n async (config) => {\n const iosNamedProjectRoot = IOSConfig.Paths.getSourceRoot(config.modRequest.projectRoot);\n\n await createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n });\n\n await configureImageAssets({\n projectRoot: config.modRequest.projectRoot,\n iosNamedProjectRoot,\n image: splash.image,\n darkImage: splash.dark?.image,\n tabletImage: splash.tabletImage,\n darkTabletImage: splash.dark?.tabletImage,\n });\n\n return config;\n },\n ]);\n};\n\n/**\n * Creates imageset containing image for Splash/Launch Screen.\n */\nasync function configureImageAssets({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image?: string | null;\n darkImage?: string | null;\n tabletImage: string | null;\n darkTabletImage?: string | null;\n}) {\n const imageSetPath = path.resolve(iosNamedProjectRoot, IMAGESET_PATH);\n\n // ensure old SplashScreen imageSet is removed\n await fs.remove(imageSetPath);\n\n if (!image) {\n return;\n }\n\n await writeContentsJsonFileAsync({\n assetPath: imageSetPath,\n image: PNG_FILENAME,\n darkImage: darkImage ? DARK_PNG_FILENAME : null,\n tabletImage: tabletImage ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletImage ? DARK_TABLET_PNG_FILENAME : null,\n });\n\n await copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n });\n}\n\nasync function createPngFileAsync(color: string, filePath: string) {\n const png = new Jimp(1, 1, color);\n return png.writeAsync(filePath);\n}\n\nasync function createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor,\n tabletColor,\n darkTabletColor,\n}: {\n iosNamedProjectRoot: string;\n color: string;\n darkColor: string | null;\n tabletColor: string | null;\n darkTabletColor: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n await createPngFileAsync(\n item,\n path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH, fileName)\n );\n },\n anyItem: color,\n darkItem: darkColor,\n tabletItem: tabletColor,\n darkTabletItem: darkTabletColor,\n });\n}\n\nasync function copyImageFiles({\n projectRoot,\n iosNamedProjectRoot,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n projectRoot: string;\n iosNamedProjectRoot: string;\n image: string;\n darkImage?: string | null;\n tabletImage?: string | null;\n darkTabletImage?: string | null;\n}) {\n await generateImagesAssetsAsync({\n async generateImageAsset(item, fileName) {\n // Using this method will cache the images in `.expo` based on the properties used to generate them.\n // this method also supports remote URLs and using the global sharp instance.\n const { source } = await generateImageAsync({ projectRoot, cacheType: IMAGE_CACHE_NAME }, {\n src: item,\n } as any);\n // Write image buffer to the file system.\n // const assetPath = join(iosNamedProjectRoot, IMAGESET_PATH, filename);\n await fs.writeFile(path.resolve(iosNamedProjectRoot, IMAGESET_PATH, fileName), source);\n },\n anyItem: image,\n darkItem: darkImage,\n tabletItem: tabletImage,\n darkTabletItem: darkTabletImage,\n });\n}\n\nasync function generateImagesAssetsAsync({\n generateImageAsset,\n anyItem,\n darkItem,\n tabletItem,\n darkTabletItem,\n}: {\n generateImageAsset: (item: string, fileName: string) => Promise<void>;\n anyItem: string;\n darkItem?: string | null;\n tabletItem?: string | null;\n darkTabletItem?: string | null;\n}) {\n const items = [\n [anyItem, PNG_FILENAME],\n [darkItem, DARK_PNG_FILENAME],\n [tabletItem, TABLET_PNG_FILENAME],\n [darkTabletItem, DARK_TABLET_PNG_FILENAME],\n ].filter(([item]) => !!item) as unknown as [string, string];\n\n await Promise.all(items.map(([item, fileName]) => generateImageAsset(item, fileName)));\n}\n\nasync function createSplashScreenBackgroundImageAsync({\n iosNamedProjectRoot,\n splash,\n}: {\n // Something like projectRoot/ios/MyApp/\n iosNamedProjectRoot: string;\n splash: IOSSplashConfig;\n}) {\n const color = splash.backgroundColor;\n const darkColor = splash.dark?.backgroundColor;\n const tabletColor = splash.tabletBackgroundColor;\n const darkTabletColor = splash.dark?.tabletBackgroundColor;\n\n const imagesetPath = path.join(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH);\n // Ensure the Images.xcassets/... path exists\n await fs.remove(imagesetPath);\n await fs.ensureDir(imagesetPath);\n\n await createBackgroundImagesAsync({\n iosNamedProjectRoot,\n color,\n darkColor: darkColor ? darkColor : null,\n tabletColor: tabletColor ? tabletColor : null,\n darkTabletColor: darkTabletColor ? darkTabletColor : null,\n });\n\n await writeContentsJsonFileAsync({\n assetPath: path.resolve(iosNamedProjectRoot, BACKGROUND_IMAGESET_PATH),\n image: PNG_FILENAME,\n darkImage: darkColor ? DARK_PNG_FILENAME : null,\n tabletImage: tabletColor ? TABLET_PNG_FILENAME : null,\n darkTabletImage: darkTabletColor ? DARK_TABLET_PNG_FILENAME : null,\n });\n}\n\nconst darkAppearances: ContentsJsonImageAppearance[] = [\n {\n appearance: 'luminosity',\n value: 'dark',\n } as ContentsJsonImageAppearance,\n];\n\nexport function buildContentsJsonImages({\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n image: string;\n tabletImage: string | null;\n darkImage: string | null;\n darkTabletImage: string | null;\n}): ContentsJsonImage[] {\n return [\n // Phone light\n createContentsJsonItem({\n idiom: 'universal',\n filename: image,\n scale: '1x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '2x',\n }),\n createContentsJsonItem({\n idiom: 'universal',\n scale: '3x',\n }),\n // Phone dark\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n filename: darkImage,\n scale: '1x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '2x',\n }),\n darkImage &&\n createContentsJsonItem({\n idiom: 'universal',\n appearances: darkAppearances,\n scale: '3x',\n }),\n // Tablet light\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n filename: tabletImage,\n scale: '1x',\n }),\n tabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n scale: '2x',\n }),\n // Phone dark\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n filename: darkTabletImage ?? undefined,\n scale: '1x',\n }),\n darkTabletImage &&\n createContentsJsonItem({\n idiom: 'ipad',\n appearances: darkAppearances,\n scale: '2x',\n }),\n ].filter(Boolean) as ContentsJsonImage[];\n}\n\nasync function writeContentsJsonFileAsync({\n assetPath,\n image,\n darkImage,\n tabletImage,\n darkTabletImage,\n}: {\n assetPath: string;\n image: string;\n darkImage: string | null;\n tabletImage: string | null;\n darkTabletImage: string | null;\n}) {\n const images = buildContentsJsonImages({ image, darkImage, tabletImage, darkTabletImage });\n\n debug(`create contents.json:`, assetPath);\n debug(`use images:`, images);\n await writeContentsJsonAsync(assetPath, { images });\n}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C,uCAAsB,EAAC;IACrBC,KAAK,EAAE,MAAM;IACbG,WAAW,EAAER,eAAe;IAC5BM,QAAQ,EAAEhD,eAAe,aAAfA,eAAe,cAAfA,eAAe,GAAImD,SAAS;IACtCF,KAAK,EAAE;EACT,CAAC,CAAC,EACJjD,eAAe,IACb,IAAA8C,uCAAsB,EAAC;IACrBC,KAAK,EAAE,MAAM;IACbG,WAAW,EAAER,eAAe;IAC5BO,KAAK,EAAE;EACT,CAAC,CAAC,CACL,CAAChB,MAAM,CAACmB,OAAO,CAAC;AACnB;AAEA,eAAe9C,0BAA0B,CAAC;EACxCC,SAAS;EACTX,KAAK;EACLC,SAAS;EACTE,WAAW;EACXC;AAOF,CAAC,EAAE;EACD,MAAMqD,MAAM,GAAGR,uBAAuB,CAAC;IAAEjD,KAAK;IAAEC,SAAS;IAAEE,WAAW;IAAEC;EAAgB,CAAC,CAAC;EAE1FzB,KAAK,CAAE,uBAAsB,EAAEgC,SAAS,CAAC;EACzChC,KAAK,CAAE,aAAY,EAAE8E,MAAM,CAAC;EAC5B,MAAM,IAAAC,uCAAsB,EAAC/C,SAAS,EAAE;IAAE8C;EAAO,CAAC,CAAC;AACrD"}
@@ -5,64 +5,49 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.setSplashInfoPlist = setSplashInfoPlist;
7
7
  exports.withIosSplashInfoPlist = void 0;
8
-
9
8
  function _configPlugins() {
10
9
  const data = require("@expo/config-plugins");
11
-
12
10
  _configPlugins = function () {
13
11
  return data;
14
12
  };
15
-
16
13
  return data;
17
14
  }
18
-
19
15
  function _debug() {
20
16
  const data = _interopRequireDefault(require("debug"));
21
-
22
17
  _debug = function () {
23
18
  return data;
24
19
  };
25
-
26
20
  return data;
27
21
  }
28
-
29
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
-
31
23
  const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:ios:infoPlist');
32
-
33
24
  const withIosSplashInfoPlist = (config, splash) => {
34
25
  return (0, _configPlugins().withInfoPlist)(config, config => {
35
26
  config.modResults = setSplashInfoPlist(config, config.modResults, splash);
36
27
  return config;
37
28
  });
38
29
  };
39
-
40
30
  exports.withIosSplashInfoPlist = withIosSplashInfoPlist;
41
-
42
31
  function setSplashInfoPlist(config, infoPlist, splash) {
43
32
  var _splash$dark, _splash$dark2, _splash$dark3, _splash$dark4;
44
-
45
33
  const isDarkModeEnabled = !!(splash !== null && splash !== void 0 && (_splash$dark = splash.dark) !== null && _splash$dark !== void 0 && _splash$dark.image || splash !== null && splash !== void 0 && (_splash$dark2 = splash.dark) !== null && _splash$dark2 !== void 0 && _splash$dark2.tabletImage || splash !== null && splash !== void 0 && (_splash$dark3 = splash.dark) !== null && _splash$dark3 !== void 0 && _splash$dark3.backgroundColor || splash !== null && splash !== void 0 && (_splash$dark4 = splash.dark) !== null && _splash$dark4 !== void 0 && _splash$dark4.tabletBackgroundColor);
46
34
  debug(`isDarkModeEnabled: `, isDarkModeEnabled);
47
-
48
35
  if (isDarkModeEnabled) {
49
36
  var _config$ios$userInter, _config$ios;
50
-
51
37
  // IOSConfig.UserInterfaceStyle.getUserInterfaceStyle(config);
52
38
  // Determine if the user manually defined the userInterfaceStyle incorrectly
53
- const existing = (_config$ios$userInter = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.userInterfaceStyle) !== null && _config$ios$userInter !== void 0 ? _config$ios$userInter : config.userInterfaceStyle; // Add a warning to prevent the dark mode splash screen from not being shown -- this was learned the hard way.
54
-
39
+ const existing = (_config$ios$userInter = (_config$ios = config.ios) === null || _config$ios === void 0 ? void 0 : _config$ios.userInterfaceStyle) !== null && _config$ios$userInter !== void 0 ? _config$ios$userInter : config.userInterfaceStyle;
40
+ // Add a warning to prevent the dark mode splash screen from not being shown -- this was learned the hard way.
55
41
  if (existing && existing !== 'automatic') {
56
42
  _configPlugins().WarningAggregator.addWarningIOS('userInterfaceStyle', 'The existing `userInterfaceStyle` property is preventing splash screen from working properly. Please remove it or disable dark mode splash screens.');
57
- } // assigning it to auto anyways, but this is fragile because the order of operations matter now
58
-
59
-
43
+ }
44
+ // assigning it to auto anyways, but this is fragile because the order of operations matter now
60
45
  infoPlist.UIUserInterfaceStyle = 'Automatic';
61
- } else {// NOTE(brentvatne): Commented out this line because it causes https://github.com/expo/expo-cli/issues/3935
46
+ } else {
47
+ // NOTE(brentvatne): Commented out this line because it causes https://github.com/expo/expo-cli/issues/3935
62
48
  // We should revisit this approach.
63
49
  // delete infoPlist.UIUserInterfaceStyle;
64
50
  }
65
-
66
51
  if (splash) {
67
52
  // TODO: What to do here ??
68
53
  infoPlist.UILaunchStoryboardName = 'SplashScreen';
@@ -70,7 +55,6 @@ function setSplashInfoPlist(config, infoPlist, splash) {
70
55
  debug(`Disabling UILaunchStoryboardName`);
71
56
  delete infoPlist.UILaunchStoryboardName;
72
57
  }
73
-
74
58
  return infoPlist;
75
59
  }
76
60
  //# sourceMappingURL=withIosSplashInfoPlist.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withIosSplashInfoPlist.js","names":["debug","Debug","withIosSplashInfoPlist","config","splash","withInfoPlist","modResults","setSplashInfoPlist","infoPlist","isDarkModeEnabled","dark","image","tabletImage","backgroundColor","tabletBackgroundColor","existing","ios","userInterfaceStyle","WarningAggregator","addWarningIOS","UIUserInterfaceStyle","UILaunchStoryboardName"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, WarningAggregator, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { IOSSplashConfig } from './getIosSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:infoPlist');\n\nexport const withIosSplashInfoPlist: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setSplashInfoPlist(config, config.modResults, splash);\n return config;\n });\n};\n\nexport function setSplashInfoPlist(\n config: ExpoConfig,\n infoPlist: InfoPlist,\n splash: IOSSplashConfig\n): InfoPlist {\n const isDarkModeEnabled = !!(\n splash?.dark?.image ||\n splash?.dark?.tabletImage ||\n splash?.dark?.backgroundColor ||\n splash?.dark?.tabletBackgroundColor\n );\n debug(`isDarkModeEnabled: `, isDarkModeEnabled);\n\n if (isDarkModeEnabled) {\n // IOSConfig.UserInterfaceStyle.getUserInterfaceStyle(config);\n // Determine if the user manually defined the userInterfaceStyle incorrectly\n const existing = config.ios?.userInterfaceStyle ?? config.userInterfaceStyle;\n // Add a warning to prevent the dark mode splash screen from not being shown -- this was learned the hard way.\n if (existing && existing !== 'automatic') {\n WarningAggregator.addWarningIOS(\n 'userInterfaceStyle',\n 'The existing `userInterfaceStyle` property is preventing splash screen from working properly. Please remove it or disable dark mode splash screens.'\n );\n }\n // assigning it to auto anyways, but this is fragile because the order of operations matter now\n infoPlist.UIUserInterfaceStyle = 'Automatic';\n } else {\n // NOTE(brentvatne): Commented out this line because it causes https://github.com/expo/expo-cli/issues/3935\n // We should revisit this approach.\n // delete infoPlist.UIUserInterfaceStyle;\n }\n\n if (splash) {\n // TODO: What to do here ??\n infoPlist.UILaunchStoryboardName = 'SplashScreen';\n } else {\n debug(`Disabling UILaunchStoryboardName`);\n delete infoPlist.UILaunchStoryboardName;\n }\n\n return infoPlist;\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAIA,MAAMA,KAAK,GAAG,IAAAC,gBAAA,EAAM,uDAAN,CAAd;;AAEO,MAAMC,sBAAqD,GAAG,CAACC,MAAD,EAASC,MAAT,KAAoB;EACvF,OAAO,IAAAC,8BAAA,EAAcF,MAAd,EAAuBA,MAAD,IAAY;IACvCA,MAAM,CAACG,UAAP,GAAoBC,kBAAkB,CAACJ,MAAD,EAASA,MAAM,CAACG,UAAhB,EAA4BF,MAA5B,CAAtC;IACA,OAAOD,MAAP;EACD,CAHM,CAAP;AAID,CALM;;;;AAOA,SAASI,kBAAT,CACLJ,MADK,EAELK,SAFK,EAGLJ,MAHK,EAIM;EAAA;;EACX,MAAMK,iBAAiB,GAAG,CAAC,EACzBL,MAAM,SAAN,IAAAA,MAAM,WAAN,oBAAAA,MAAM,CAAEM,IAAR,sDAAcC,KAAd,IACAP,MADA,aACAA,MADA,gCACAA,MAAM,CAAEM,IADR,0CACA,cAAcE,WADd,IAEAR,MAFA,aAEAA,MAFA,gCAEAA,MAAM,CAAEM,IAFR,0CAEA,cAAcG,eAFd,IAGAT,MAHA,aAGAA,MAHA,gCAGAA,MAAM,CAAEM,IAHR,0CAGA,cAAcI,qBAJW,CAA3B;EAMAd,KAAK,CAAE,qBAAF,EAAwBS,iBAAxB,CAAL;;EAEA,IAAIA,iBAAJ,EAAuB;IAAA;;IACrB;IACA;IACA,MAAMM,QAAQ,2CAAGZ,MAAM,CAACa,GAAV,gDAAG,YAAYC,kBAAf,yEAAqCd,MAAM,CAACc,kBAA1D,CAHqB,CAIrB;;IACA,IAAIF,QAAQ,IAAIA,QAAQ,KAAK,WAA7B,EAA0C;MACxCG,kCAAA,CAAkBC,aAAlB,CACE,oBADF,EAEE,qJAFF;IAID,CAVoB,CAWrB;;;IACAX,SAAS,CAACY,oBAAV,GAAiC,WAAjC;EACD,CAbD,MAaO,CACL;IACA;IACA;EACD;;EAED,IAAIhB,MAAJ,EAAY;IACV;IACAI,SAAS,CAACa,sBAAV,GAAmC,cAAnC;EACD,CAHD,MAGO;IACLrB,KAAK,CAAE,kCAAF,CAAL;IACA,OAAOQ,SAAS,CAACa,sBAAjB;EACD;;EAED,OAAOb,SAAP;AACD"}
1
+ {"version":3,"file":"withIosSplashInfoPlist.js","names":["debug","Debug","withIosSplashInfoPlist","config","splash","withInfoPlist","modResults","setSplashInfoPlist","infoPlist","isDarkModeEnabled","dark","image","tabletImage","backgroundColor","tabletBackgroundColor","existing","ios","userInterfaceStyle","WarningAggregator","addWarningIOS","UIUserInterfaceStyle","UILaunchStoryboardName"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashInfoPlist.ts"],"sourcesContent":["import { ConfigPlugin, InfoPlist, WarningAggregator, withInfoPlist } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\nimport Debug from 'debug';\n\nimport { IOSSplashConfig } from './getIosSplashConfig';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios:infoPlist');\n\nexport const withIosSplashInfoPlist: ConfigPlugin<IOSSplashConfig> = (config, splash) => {\n return withInfoPlist(config, (config) => {\n config.modResults = setSplashInfoPlist(config, config.modResults, splash);\n return config;\n });\n};\n\nexport function setSplashInfoPlist(\n config: ExpoConfig,\n infoPlist: InfoPlist,\n splash: IOSSplashConfig\n): InfoPlist {\n const isDarkModeEnabled = !!(\n splash?.dark?.image ||\n splash?.dark?.tabletImage ||\n splash?.dark?.backgroundColor ||\n splash?.dark?.tabletBackgroundColor\n );\n debug(`isDarkModeEnabled: `, isDarkModeEnabled);\n\n if (isDarkModeEnabled) {\n // IOSConfig.UserInterfaceStyle.getUserInterfaceStyle(config);\n // Determine if the user manually defined the userInterfaceStyle incorrectly\n const existing = config.ios?.userInterfaceStyle ?? config.userInterfaceStyle;\n // Add a warning to prevent the dark mode splash screen from not being shown -- this was learned the hard way.\n if (existing && existing !== 'automatic') {\n WarningAggregator.addWarningIOS(\n 'userInterfaceStyle',\n 'The existing `userInterfaceStyle` property is preventing splash screen from working properly. Please remove it or disable dark mode splash screens.'\n );\n }\n // assigning it to auto anyways, but this is fragile because the order of operations matter now\n infoPlist.UIUserInterfaceStyle = 'Automatic';\n } else {\n // NOTE(brentvatne): Commented out this line because it causes https://github.com/expo/expo-cli/issues/3935\n // We should revisit this approach.\n // delete infoPlist.UIUserInterfaceStyle;\n }\n\n if (splash) {\n // TODO: What to do here ??\n infoPlist.UILaunchStoryboardName = 'SplashScreen';\n } else {\n deb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,CACtJ;IACH;IACA;IACAX,SAAS,CAACY,oBAAoB,GAAG,WAAW;EAC9C,CAAC,MAAM;IACL;IACA;IACA;EAAA;EAGF,IAAIhB,MAAM,EAAE;IACV;IACAI,SAAS,CAACa,sBAAsB,GAAG,cAAc;EACnD,CAAC,MAAM;IACLrB,KAAK,CAAE,kCAAiC,CAAC;IACzC,OAAOQ,SAAS,CAACa,sBAAsB;EACzC;EAEA,OAAOb,SAAS;AAClB"}
@@ -4,108 +4,80 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.withIosSplashScreen = void 0;
7
-
8
7
  function _configPlugins() {
9
8
  const data = require("@expo/config-plugins");
10
-
11
9
  _configPlugins = function () {
12
10
  return data;
13
11
  };
14
-
15
12
  return data;
16
13
  }
17
-
18
14
  function _debug() {
19
15
  const data = _interopRequireDefault(require("debug"));
20
-
21
16
  _debug = function () {
22
17
  return data;
23
18
  };
24
-
25
19
  return data;
26
20
  }
27
-
28
21
  function _getIosSplashConfig() {
29
22
  const data = require("./getIosSplashConfig");
30
-
31
23
  _getIosSplashConfig = function () {
32
24
  return data;
33
25
  };
34
-
35
26
  return data;
36
27
  }
37
-
38
28
  function _withIosSplashAssets() {
39
29
  const data = require("./withIosSplashAssets");
40
-
41
30
  _withIosSplashAssets = function () {
42
31
  return data;
43
32
  };
44
-
45
33
  return data;
46
34
  }
47
-
48
35
  function _withIosSplashInfoPlist() {
49
36
  const data = require("./withIosSplashInfoPlist");
50
-
51
37
  _withIosSplashInfoPlist = function () {
52
38
  return data;
53
39
  };
54
-
55
40
  return data;
56
41
  }
57
-
58
42
  function _withIosSplashScreenStoryboard() {
59
43
  const data = require("./withIosSplashScreenStoryboard");
60
-
61
44
  _withIosSplashScreenStoryboard = function () {
62
45
  return data;
63
46
  };
64
-
65
47
  return data;
66
48
  }
67
-
68
49
  function _withIosSplashXcodeProject() {
69
50
  const data = require("./withIosSplashXcodeProject");
70
-
71
51
  _withIosSplashXcodeProject = function () {
72
52
  return data;
73
53
  };
74
-
75
54
  return data;
76
55
  }
77
-
78
56
  function _wtihIosSplashScreenStoryboardImage() {
79
57
  const data = require("./wtihIosSplashScreenStoryboardImage");
80
-
81
58
  _wtihIosSplashScreenStoryboardImage = function () {
82
59
  return data;
83
60
  };
84
-
85
61
  return data;
86
62
  }
87
-
88
63
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
89
-
90
64
  const debug = (0, _debug().default)('expo:prebuild-config:expo-splash-screen:ios');
91
-
92
65
  const withIosSplashScreen = (config, splash) => {
93
- // only warn once
94
- (0, _getIosSplashConfig().warnUnsupportedSplashProperties)(config); // If the user didn't specify a splash object, infer the splash object from the Expo config.
95
-
66
+ // If the user didn't specify a splash object, infer the splash object from the Expo config.
96
67
  if (!splash) {
97
68
  splash = (0, _getIosSplashConfig().getIosSplashConfig)(config);
98
69
  } else {
99
70
  debug(`custom splash config provided`);
100
71
  }
101
-
102
72
  debug(`config:`, splash);
103
- return (0, _configPlugins().withPlugins)(config, [[_withIosSplashInfoPlist().withIosSplashInfoPlist, splash], [_withIosSplashAssets().withIosSplashAssets, splash], // Add the image settings to the storyboard.
104
- [_wtihIosSplashScreenStoryboardImage().withIosSplashScreenImage, splash], // Link storyboard to xcode project.
73
+ return (0, _configPlugins().withPlugins)(config, [[_withIosSplashInfoPlist().withIosSplashInfoPlist, splash], [_withIosSplashAssets().withIosSplashAssets, splash],
74
+ // Add the image settings to the storyboard.
75
+ [_wtihIosSplashScreenStoryboardImage().withIosSplashScreenImage, splash],
76
+ // Link storyboard to xcode project.
105
77
  // TODO: Maybe fold this into the base mod.
106
- _withIosSplashXcodeProject().withIosSplashXcodeProject, // Insert the base mod last, no other ios.splashScreenStoryboard mods can be added after this.
78
+ _withIosSplashXcodeProject().withIosSplashXcodeProject,
79
+ // Insert the base mod last, no other ios.splashScreenStoryboard mods can be added after this.
107
80
  _withIosSplashScreenStoryboard().withIosSplashScreenStoryboardBaseMod]);
108
81
  };
109
-
110
82
  exports.withIosSplashScreen = withIosSplashScreen;
111
83
  //# sourceMappingURL=withIosSplashScreen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withIosSplashScreen.js","names":["debug","Debug","withIosSplashScreen","config","splash","warnUnsupportedSplashProperties","getIosSplashConfig","withPlugins","withIosSplashInfoPlist","withIosSplashAssets","withIosSplashScreenImage","withIosSplashXcodeProject","withIosSplashScreenStoryboardBaseMod"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\nimport Debug from 'debug';\n\nimport {\n getIosSplashConfig,\n IOSSplashConfig,\n warnUnsupportedSplashProperties,\n} from './getIosSplashConfig';\nimport { withIosSplashAssets } from './withIosSplashAssets';\nimport { withIosSplashInfoPlist } from './withIosSplashInfoPlist';\nimport { withIosSplashScreenStoryboardBaseMod } from './withIosSplashScreenStoryboard';\nimport { withIosSplashXcodeProject } from './withIosSplashXcodeProject';\nimport { withIosSplashScreenImage } from './wtihIosSplashScreenStoryboardImage';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios');\n\nexport const withIosSplashScreen: ConfigPlugin<IOSSplashConfig | undefined | null | void> = (\n config,\n splash\n) => {\n // only warn once\n warnUnsupportedSplashProperties(config);\n\n // If the user didn't specify a splash object, infer the splash object from the Expo config.\n if (!splash) {\n splash = getIosSplashConfig(config);\n } else {\n debug(`custom splash config provided`);\n }\n\n debug(`config:`, splash);\n\n return withPlugins(config, [\n [withIosSplashInfoPlist, splash],\n [withIosSplashAssets, splash],\n // Add the image settings to the storyboard.\n [withIosSplashScreenImage, splash],\n // Link storyboard to xcode project.\n // TODO: Maybe fold this into the base mod.\n withIosSplashXcodeProject,\n // Insert the base mod last, no other ios.splashScreenStoryboard mods can be added after this.\n withIosSplashScreenStoryboardBaseMod,\n ]);\n};\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAKA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEA,MAAMA,KAAK,GAAG,IAAAC,gBAAA,EAAM,6CAAN,CAAd;;AAEO,MAAMC,mBAA4E,GAAG,CAC1FC,MAD0F,EAE1FC,MAF0F,KAGvF;EACH;EACA,IAAAC,qDAAA,EAAgCF,MAAhC,EAFG,CAIH;;EACA,IAAI,CAACC,MAAL,EAAa;IACXA,MAAM,GAAG,IAAAE,wCAAA,EAAmBH,MAAnB,CAAT;EACD,CAFD,MAEO;IACLH,KAAK,CAAE,+BAAF,CAAL;EACD;;EAEDA,KAAK,CAAE,SAAF,EAAYI,MAAZ,CAAL;EAEA,OAAO,IAAAG,4BAAA,EAAYJ,MAAZ,EAAoB,CACzB,CAACK,gDAAD,EAAyBJ,MAAzB,CADyB,EAEzB,CAACK,0CAAD,EAAsBL,MAAtB,CAFyB,EAGzB;EACA,CAACM,8DAAD,EAA2BN,MAA3B,CAJyB,EAKzB;EACA;EACAO,sDAPyB,EAQzB;EACAC,qEATyB,CAApB,CAAP;AAWD,CA3BM"}
1
+ {"version":3,"file":"withIosSplashScreen.js","names":["debug","Debug","withIosSplashScreen","config","splash","getIosSplashConfig","withPlugins","withIosSplashInfoPlist","withIosSplashAssets","withIosSplashScreenImage","withIosSplashXcodeProject","withIosSplashScreenStoryboardBaseMod"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/withIosSplashScreen.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\nimport Debug from 'debug';\n\nimport { getIosSplashConfig, IOSSplashConfig } from './getIosSplashConfig';\nimport { withIosSplashAssets } from './withIosSplashAssets';\nimport { withIosSplashInfoPlist } from './withIosSplashInfoPlist';\nimport { withIosSplashScreenStoryboardBaseMod } from './withIosSplashScreenStoryboard';\nimport { withIosSplashXcodeProject } from './withIosSplashXcodeProject';\nimport { withIosSplashScreenImage } from './wtihIosSplashScreenStoryboardImage';\n\nconst debug = Debug('expo:prebuild-config:expo-splash-screen:ios');\n\nexport const withIosSplashScreen: ConfigPlugin<IOSSplashConfig | undefined | null | void> = (\n config,\n splash\n) => {\n // If the user didn't specify a splash object, infer the splash object from the Expo config.\n if (!splash) {\n splash = getIosSplashConfig(config);\n } else {\n debug(`custom splash config provided`);\n }\n\n debug(`config:`, splash);\n\n return withPlugins(config, [\n [withIosSplashInfoPlist, splash],\n [withIosSplashAssets, splash],\n // Add the image settings to the storyboard.\n [withIosSplashScreenImage, splash],\n // Link storyboard to xcode project.\n // TODO: Maybe fold this into the base mod.\n withIosSplashXcodeProject,\n // Insert the base mod last, no other ios.splashScreenStoryboard mods can be added after this.\n withIosSplashScreenStoryboardBaseMod,\n ]);\n};\n"],"mappings":";;;;;;AAAA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAAgF;AAEhF,MAAMA,KAAK,GAAG,IAAAC,gBAAK,EAAC,6CAA6C,CAAC;AAE3D,MAAMC,mBAA4E,GAAG,CAC1FC,MAAM,EACNC,MAAM,KACH;EACH;EACA,IAAI,CAACA,MAAM,EAAE;IACXA,MAAM,GAAG,IAAAC,wCAAkB,EAACF,MAAM,CAAC;EACrC,CAAC,MAAM;IACLH,KAAK,CAAE,+BAA8B,CAAC;EACxC;EAEAA,KAAK,CAAE,SAAQ,EAAEI,MAAM,CAAC;EAExB,OAAO,IAAAE,4BAAW,EAACH,MAAM,EAAE,CACzB,CAACI,gDAAsB,EAAEH,MAAM,CAAC,EAChC,CAACI,0CAAmB,EAAEJ,MAAM,CAAC;EAC7B;EACA,CAACK,8DAAwB,EAAEL,MAAM,CAAC;EAClC;EACA;EACAM,sDAAyB;EACzB;EACAC,qEAAoC,CACrC,CAAC;AACJ,CAAC;AAAC"}