posthog-react-native 4.77.1 → 4.78.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/error-tracking/index.d.ts +18 -0
- package/dist/error-tracking/index.js.map +1 -1
- package/dist/posthog-rn.d.ts +3 -0
- package/dist/posthog-rn.js +1 -1
- package/dist/posthog-rn.js.map +1 -1
- package/dist/surveys/components/Cancel.js +1 -1
- package/dist/surveys/components/Cancel.js.map +1 -1
- package/dist/tooling/expoconfig.d.ts +12 -8
- package/dist/tooling/expoconfig.js +1 -1
- package/dist/tooling/expoconfig.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Cancel=Cancel;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _icons=require("../icons");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/Cancel.js";function Cancel(_ref){var onPress=_ref.onPress,appearance=_ref.appearance;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.cancelBtnWrapper,{borderColor:appearance.borderColor}],onPress:onPress,children:(0,_jsxRuntime.jsx)(_icons.CancelSVG,{})});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({cancelBtnWrapper:{width:_surveysUtils.closeButtonSize,height:_surveysUtils.closeButtonSize,borderRadius:_surveysUtils.closeButtonSize/2,borderWidth:1,justifyContent:'center',alignItems:'center',backgroundColor:'white'}});
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.Cancel=Cancel;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _icons=require("../icons");var _safeStyleSheet=require("../safeStyleSheet");var _surveysUtils=require("../surveys-utils");var _jsxRuntime=require("react/jsx-runtime");var _jsxFileName="/home/runner/work/posthog-js/posthog-js/packages/react-native/dist/surveys/components/Cancel.js";function Cancel(_ref){var onPress=_ref.onPress,appearance=_ref.appearance;return(0,_jsxRuntime.jsx)(_reactNative.TouchableOpacity,{style:[styles.cancelBtnWrapper,{borderColor:appearance.borderColor}],onPress:onPress,accessibilityRole:"button",accessibilityLabel:"Close survey",children:(0,_jsxRuntime.jsx)(_icons.CancelSVG,{})});}var styles=(0,_safeStyleSheet.createSafeStyleSheet)({cancelBtnWrapper:{width:_surveysUtils.closeButtonSize,height:_surveysUtils.closeButtonSize,borderRadius:_surveysUtils.closeButtonSize/2,borderWidth:1,justifyContent:'center',alignItems:'center',backgroundColor:'white'}});
|
|
2
2
|
//# sourceMappingURL=Cancel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Cancel.js","names":["_react","_interopRequireDefault","require","_reactNative","_icons","_safeStyleSheet","_surveysUtils","_jsxRuntime","_jsxFileName","Cancel","_ref","onPress","appearance","jsx","TouchableOpacity","style","styles","cancelBtnWrapper","borderColor","children","CancelSVG","createSafeStyleSheet","width","closeButtonSize","height","borderRadius","borderWidth","justifyContent","alignItems","backgroundColor"],"sources":["../../../src/surveys/components/Cancel.tsx"],"sourcesContent":["import React from 'react'\nimport { TouchableOpacity } from 'react-native'\nimport { CancelSVG } from '../icons'\n\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport { closeButtonSize, SurveyAppearanceTheme } from '../surveys-utils'\n\nexport function Cancel({\n onPress,\n appearance,\n}: {\n onPress: () => void\n appearance: SurveyAppearanceTheme\n}): JSX.Element {\n return (\n <TouchableOpacity
|
|
1
|
+
{"version":3,"file":"Cancel.js","names":["_react","_interopRequireDefault","require","_reactNative","_icons","_safeStyleSheet","_surveysUtils","_jsxRuntime","_jsxFileName","Cancel","_ref","onPress","appearance","jsx","TouchableOpacity","style","styles","cancelBtnWrapper","borderColor","accessibilityRole","accessibilityLabel","children","CancelSVG","createSafeStyleSheet","width","closeButtonSize","height","borderRadius","borderWidth","justifyContent","alignItems","backgroundColor"],"sources":["../../../src/surveys/components/Cancel.tsx"],"sourcesContent":["import React from 'react'\nimport { TouchableOpacity } from 'react-native'\nimport { CancelSVG } from '../icons'\n\nimport { createSafeStyleSheet } from '../safeStyleSheet'\nimport { closeButtonSize, SurveyAppearanceTheme } from '../surveys-utils'\n\nexport function Cancel({\n onPress,\n appearance,\n}: {\n onPress: () => void\n appearance: SurveyAppearanceTheme\n}): JSX.Element {\n return (\n <TouchableOpacity\n style={[styles.cancelBtnWrapper, { borderColor: appearance.borderColor }]}\n onPress={onPress}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Close survey\"\n >\n <CancelSVG />\n </TouchableOpacity>\n )\n}\n\nconst styles = createSafeStyleSheet({\n cancelBtnWrapper: {\n width: closeButtonSize,\n height: closeButtonSize,\n borderRadius: closeButtonSize / 2,\n borderWidth: 1,\n justifyContent: 'center',\n alignItems: 'center',\n backgroundColor: 'white',\n },\n})\n"],"mappings":"+KAAA,IAAAA,MAAA,CAAAC,sBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBACA,IAAAE,MAAA,CAAAF,OAAA,aAEA,IAAAG,eAAA,CAAAH,OAAA,sBACA,IAAAI,aAAA,CAAAJ,OAAA,qBAAyE,IAAAK,WAAA,CAAAL,OAAA,0BAAAM,YAAA,mGAEnE,QAAU,CAAAC,MAAMA,CAAAC,IAAA,CAMrB,IALC,CAAAC,OAAO,CAAAD,IAAA,CAAPC,OAAO,CACPC,UAAU,CAAAF,IAAA,CAAVE,UAAU,CAKV,MACE,GAAAL,WAAA,CAAAM,GAAA,EAACV,YAAA,CAAAW,gBAAgB,EACfC,KAAK,CAAE,CAACC,MAAM,CAACC,gBAAgB,CAAE,CAAEC,WAAW,CAAEN,UAAU,CAACM,WAAW,CAAE,CAAE,CAC1EP,OAAO,CAAEA,OAAQ,CACjBQ,iBAAiB,CAAC,QAAQ,CAC1BC,kBAAkB,CAAC,cAAc,CAAAC,QAAA,CAEjC,GAAAd,WAAA,CAAAM,GAAA,EAACT,MAAA,CAAAkB,SAAS,IACZ,CAAkB,CAAC,CAEvB,CAEA,GAAM,CAAAN,MAAM,CAAG,GAAAO,oCAAoB,EAAC,CAClCN,gBAAgB,CAAE,CAChBO,KAAK,CAAEC,6BAAe,CACtBC,MAAM,CAAED,6BAAe,CACvBE,YAAY,CAAEF,6BAAe,CAAG,CAAC,CACjCG,WAAW,CAAE,CAAC,CACdC,cAAc,CAAE,QAAQ,CACxBC,UAAU,CAAE,QAAQ,CACpBC,eAAe,CAAE,O,EAEpB,CAAC","ignoreList":[]}
|
|
@@ -18,6 +18,8 @@ export declare function addPostHogAndroidGradlePluginClasspath(projectBuildGradl
|
|
|
18
18
|
classpathPresent: boolean;
|
|
19
19
|
};
|
|
20
20
|
export declare function applyPostHogAndroidGradlePlugin(appBuildGradle: string): string;
|
|
21
|
+
export declare function removePostHogAndroidNativeSymbolsExtension(appBuildGradle: string): string;
|
|
22
|
+
export declare function setPostHogAndroidNativeSymbolsExtension(appBuildGradle: string, includeSource: boolean): string;
|
|
21
23
|
/**
|
|
22
24
|
* Adds (or, when disabled, removes) the managed `onNewIntent` override in MainActivity.
|
|
23
25
|
*
|
|
@@ -71,15 +73,16 @@ type PostHogPluginProps = {
|
|
|
71
73
|
* - iOS: a build phase that runs posthog-ios's `upload-symbols.sh`
|
|
72
74
|
* (`posthog-cli dsym upload`).
|
|
73
75
|
* - Android: the official `com.posthog.android` Gradle plugin, which uploads
|
|
74
|
-
* ProGuard/R8 mapping files and injects the matching map-id into the app
|
|
76
|
+
* ProGuard/R8 mapping files and injects the matching map-id into the app, and
|
|
77
|
+
* uploads native (`.so`) debug symbols for NDK crashes (`uploadNativeSymbols`).
|
|
75
78
|
*
|
|
76
79
|
* Pass `{ includeSource: true }` to also upload native source files so PostHog
|
|
77
|
-
* can show source-code context around native crashes
|
|
78
|
-
*
|
|
79
|
-
* is ignored there. Note it uploads your source code to PostHog, hence opt-in.
|
|
80
|
+
* can show source-code context around native crashes (on Android, C/C++ sources via
|
|
81
|
+
* `includeNativeSymbolSources`). Note it uploads your source code to PostHog, hence opt-in.
|
|
80
82
|
*
|
|
81
|
-
* Default: false. Pair this with `errorTracking.autocapture.nativeCrashes`
|
|
82
|
-
*
|
|
83
|
+
* Default: false. Pair this with `errorTracking.autocapture.nativeCrashes` (and
|
|
84
|
+
* `androidNdkCrashes` for Android NDK crashes) at runtime — without uploaded
|
|
85
|
+
* symbols, native stack traces won't be symbolicated.
|
|
83
86
|
* Requires `posthog-cli` to be available and authenticated during release builds.
|
|
84
87
|
*/
|
|
85
88
|
uploadNativeSymbols?: boolean | {
|
|
@@ -139,8 +142,9 @@ type PostHogPluginProps = {
|
|
|
139
142
|
* This steers the Hermes source map upload only. iOS dSYMs and Android R8 mappings always bind to
|
|
140
143
|
* the release their build creates. The R8 half of that needs the `com.posthog.android` gradle
|
|
141
144
|
* plugin 1.6.0, which ignores the deprecated `posthog.releaseMode` key. A fresh prebuild injects
|
|
142
|
-
* that version
|
|
143
|
-
*
|
|
145
|
+
* that version. With `uploadNativeSymbols` on, an existing literal classpath older than 1.5.0 is
|
|
146
|
+
* bumped to 1.6.0. Any other older line, whether 1.5.x, older with `uploadNativeSymbols` off, or
|
|
147
|
+
* variable-driven, is kept: bump it by hand or prebuild with `--clean`.
|
|
144
148
|
*
|
|
145
149
|
* `event` (the default; still EXPERIMENTAL while the rollout settles) uploads the maps
|
|
146
150
|
* release-independent, and each event resolves its own release from the `$app_namespace` /
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.POSTHOG_RELEASE_MODES=void 0;exports.addDsymUploadBuildPhase=addDsymUploadBuildPhase;exports.addPostHogAndroidGradlePluginClasspath=addPostHogAndroidGradlePluginClasspath;exports.addPostHogWithBundledScriptsToBundleShellScript=addPostHogWithBundledScriptsToBundleShellScript;exports.applyDotenvFileBuildSetting=applyDotenvFileBuildSetting;exports.applyPostHogAndroidGradlePlugin=applyPostHogAndroidGradlePlugin;exports.buildAndroidDotenvFileGradleValue=buildAndroidDotenvFileGradleValue;exports.buildAndroidForceGradleLine=buildAndroidForceGradleLine;exports.buildAndroidSkipOnConflictGradleLine=buildAndroidSkipOnConflictGradleLine;exports.buildDsymUploadShellScript=buildDsymUploadShellScript;exports.buildIosDotenvFileBuildSetting=buildIosDotenvFileBuildSetting;exports.disableUserScriptSandboxing=disableUserScriptSandboxing;exports.modifyExistingXcodeBuildScript=modifyExistingXcodeBuildScript;exports.moveDsymUploadBuildPhaseToEnd=moveDsymUploadBuildPhaseToEnd;exports.resolveDotenvFileProp=resolveDotenvFileProp;exports.resolveNativeSymbolUpload=resolveNativeSymbolUpload;exports.resolveReleaseModeProp=resolveReleaseModeProp;exports.updateDotenvFileGradleProperties=updateDotenvFileGradleProperties;exports.updateHermesReleaseModeGradleProperties=updateHermesReleaseModeGradleProperties;exports.updateMainActivityNewIntentOverride=updateMainActivityNewIntentOverride;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _excluded=["nextMod"],_excluded2=["nextMod"];function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}var fs=require('fs');var path=require('path');var _require=require('@expo/config-plugins'),AndroidConfig=_require.AndroidConfig,withAppBuildGradle=_require.withAppBuildGradle,withBaseMod=_require.withBaseMod,withDangerousMod=_require.withDangerousMod,withGradleProperties=_require.withGradleProperties,withXcodeProject=_require.withXcodeProject;var POSTHOG_ANDROID_GRADLE_PLUGIN_VERSION='1.6.0';var resolvePostHogReactNativePackageJsonPath="[\"node\", \"--print\", \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog.gradle')\"].execute().text.trim()";var POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY='posthogReactNativeSkipOnConflict';var POSTHOG_ANDROID_FORCE_PROPERTY='posthogReactNativeForce';var POSTHOG_HERMES_RELEASE_MODE_GRADLE_PROPERTY='posthog.hermesReleaseMode';var POSTHOG_RELEASE_MODES=exports.POSTHOG_RELEASE_MODES=['symbol-set','event'];function resolveReleaseModeProp(releaseMode,environmentMode){var trimmed=(releaseMode===null||releaseMode===void 0?void 0:releaseMode.trim())||(environmentMode===null||environmentMode===void 0?void 0:environmentMode.trim());if(!trimmed){return undefined;}if(!POSTHOG_RELEASE_MODES.includes(trimmed)){throw new Error("[posthog-react-native] releaseMode must be one of ".concat(POSTHOG_RELEASE_MODES.join(', '),", was '").concat(trimmed,"'"));}return trimmed;}function buildAndroidSkipOnConflictGradleLine(skipOnConflict){if(!skipOnConflict){return null;}return"project.ext.".concat(POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY," = true");}function buildAndroidForceGradleLine(force){if(!force){return null;}return"project.ext.".concat(POSTHOG_ANDROID_FORCE_PROPERTY," = true");}var androidConflictPropertyPattern=function androidConflictPropertyPattern(property){return new RegExp("^project\\.ext\\.".concat(property,"\\s*=\\s*(true|false)\\n?"),'m');};var withAndroidPlugin=function withAndroidPlugin(config){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return withAppBuildGradle(config,function(config){if(config.modResults.language!=='groovy'){console.warn('Cannot configure PostHog in the app gradle because the build.gradle is not groovy');}var buildGradle=config.modResults.contents;var applyFrom="apply from: new File(".concat(resolvePostHogReactNativePackageJsonPath,")");var conflictLines=[buildAndroidSkipOnConflictGradleLine(skipOnConflict),buildAndroidForceGradleLine(force)].filter(function(line){return line!==null;}).join('\n');var applyBlock=conflictLines?"".concat(conflictLines,"\n").concat(applyFrom):applyFrom;var conflictPatterns=[androidConflictPropertyPattern(POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY),androidConflictPropertyPattern(POSTHOG_ANDROID_FORCE_PROPERTY)];if(buildGradle.includes(applyFrom)){var contents=conflictPatterns.reduce(function(gradle,pattern){return gradle.replace(pattern,'');},buildGradle);if(conflictLines){contents=contents.replace(applyFrom,"".concat(conflictLines,"\n").concat(applyFrom));}config.modResults.contents=contents;return config;}var pattern=/^android\s*\{/m;if(buildGradle.match(pattern)){config.modResults.contents=buildGradle.replace(pattern,"".concat(applyBlock,"\n\nandroid {"));}else{console.warn('PostHog: Could not find "android {" block in build.gradle');}return config;});};function matchingBraceIndex(s,openBraceIndex){var depth=0;for(var i=openBraceIndex;i<s.length;i++){if(s[i]==='{'){depth++;}else if(s[i]==='}'){depth--;if(depth===0){return i;}}}return-1;}function addPostHogAndroidGradlePluginClasspath(projectBuildGradle){if(projectBuildGradle.includes('posthog-android-gradle-plugin')){return{contents:projectBuildGradle,classpathPresent:true};}var classpathLine=" classpath(\"com.posthog:posthog-android-gradle-plugin:".concat(POSTHOG_ANDROID_GRADLE_PLUGIN_VERSION,"\")");var buildscriptMatch=/buildscript\s*\{/.exec(projectBuildGradle);var buildscriptOpenBrace=buildscriptMatch?buildscriptMatch.index+buildscriptMatch[0].length-1:-1;var buildscriptEnd=buildscriptOpenBrace===-1?-1:matchingBraceIndex(projectBuildGradle,buildscriptOpenBrace);var buildscriptBody=buildscriptEnd===-1?'':projectBuildGradle.slice(buildscriptOpenBrace,buildscriptEnd);var dependenciesMatch=buildscriptBody?/dependencies\s*\{/.exec(buildscriptBody):null;if(!dependenciesMatch){console.warn('PostHog: Could not find a buildscript dependencies block in the project build.gradle; '+'skipping the com.posthog.android classpath. Native symbols will not be uploaded.');return{contents:projectBuildGradle,classpathPresent:false};}var insertAt=buildscriptOpenBrace+dependenciesMatch.index+dependenciesMatch[0].length;return{contents:"".concat(projectBuildGradle.slice(0,insertAt),"\n").concat(classpathLine).concat(projectBuildGradle.slice(insertAt)),classpathPresent:true};}function applyPostHogAndroidGradlePlugin(appBuildGradle){if(/apply plugin: ["']com\.posthog\.android["']/.test(appBuildGradle)){return appBuildGradle;}var applyLine='apply plugin: "com.posthog.android"';var appPluginPattern=/^([ \t]*apply plugin: ["']com\.android\.application["'].*)$/m;if(appPluginPattern.test(appBuildGradle)){return appBuildGradle.replace(appPluginPattern,"$1\n".concat(applyLine));}var androidBlockPattern=/^android\s*\{/m;if(androidBlockPattern.test(appBuildGradle)){return appBuildGradle.replace(androidBlockPattern,"".concat(applyLine,"\n\nandroid {"));}console.warn('PostHog: Could not find where to apply com.posthog.android in the app build.gradle');return appBuildGradle;}var withFinalizedProjectBuildGradle=function withFinalizedProjectBuildGradle(config,_action){return withBaseMod(config,{platform:'android',mod:'projectBuildGradle',skipEmptyMod:false,action:function action(config){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var _config$modRequest,nextMod,modRequest,results;return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:_config$modRequest=config.modRequest,nextMod=_config$modRequest.nextMod,modRequest=(0,_objectWithoutProperties2["default"])(_config$modRequest,_excluded);_context.next=1;return nextMod(_objectSpread(_objectSpread({},config),{},{modRequest:modRequest}));case 1:results=_context.sent;return _context.abrupt("return",_action(results));case 2:case"end":return _context.stop();}},_callee);}))();}});};var withAndroidNativeSymbolsPlugin=function withAndroidNativeSymbolsPlugin(config){return withFinalizedProjectBuildGradle(config,function(){var _ref=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(config){var result,appBuildGradle,contents;return _regenerator["default"].wrap(function(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!(config.modResults.language!=='groovy')){_context2.next=1;break;}console.warn('Cannot configure the PostHog Android Gradle plugin because the project build.gradle is not groovy');return _context2.abrupt("return",config);case 1:result=addPostHogAndroidGradlePluginClasspath(config.modResults.contents);if(!(result.contents!==config.modResults.contents)){_context2.next=3;break;}_context2.next=2;return fs.promises.writeFile(config.modResults.path,result.contents);case 2:config.modResults.contents=result.contents;case 3:if(result.classpathPresent){_context2.next=4;break;}return _context2.abrupt("return",config);case 4:_context2.next=5;return AndroidConfig.Paths.getAppBuildGradleAsync(config.modRequest.projectRoot);case 5:appBuildGradle=_context2.sent;if(!(appBuildGradle.language!=='groovy')){_context2.next=6;break;}console.warn('Cannot configure the PostHog Android Gradle plugin because the app build.gradle is not groovy');return _context2.abrupt("return",config);case 6:contents=applyPostHogAndroidGradlePlugin(appBuildGradle.contents);if(!(contents!==appBuildGradle.contents)){_context2.next=7;break;}_context2.next=7;return fs.promises.writeFile(appBuildGradle.path,contents);case 7:return _context2.abrupt("return",config);case 8:case"end":return _context2.stop();}},_callee2);}));return function(_x){return _ref.apply(this,arguments);};}());};var POSTHOG_NEW_INTENT_MARKER='posthog-new-intent';var POSTHOG_NEW_INTENT_BEGIN="// @generated begin ".concat(POSTHOG_NEW_INTENT_MARKER," - posthog-react-native (DO NOT MODIFY)");var POSTHOG_NEW_INTENT_END="// @generated end ".concat(POSTHOG_NEW_INTENT_MARKER);var NEW_INTENT_DOC=" /**\n * Records the intent that reopened the app so getIntent() stays correct.\n *\n * Works around a React Native defect that drops notification taps and deep links arriving while\n * the React context is still starting. Managed by the posthog-react-native Expo config plugin;\n * remove it with { patchMainActivityNewIntent: false } in app.json.\n * https://posthog.com/docs/workflows/push-notifications/react-native\n */";var NEW_INTENT_KOTLIN_BODY=" override fun onNewIntent(intent: android.content.Intent) {\n setIntent(intent)\n super.onNewIntent(intent)\n }";var NEW_INTENT_JAVA_BODY=" @Override\n public void onNewIntent(android.content.Intent intent) {\n setIntent(intent);\n super.onNewIntent(intent);\n }";function newIntentOverrideBlock(language){var body=language==='java'?NEW_INTENT_JAVA_BODY:NEW_INTENT_KOTLIN_BODY;return"\n ".concat(POSTHOG_NEW_INTENT_BEGIN,"\n").concat(NEW_INTENT_DOC,"\n").concat(body,"\n ").concat(POSTHOG_NEW_INTENT_END,"\n");}function escapeRegExp(value){return value.replace(/[.*+?^${}()|[\]\\]/g,'\\$&');}var POSTHOG_NEW_INTENT_BLOCK_PATTERN=new RegExp("\\r?\\n?[ \\t]*".concat(escapeRegExp(POSTHOG_NEW_INTENT_BEGIN),"[\\s\\S]*?").concat(escapeRegExp(POSTHOG_NEW_INTENT_END),"[ \\t]*\\r?\\n"),'g');function literalEnd(s,start,language){var quote=s[start];var raw=quote==='"'&&s.startsWith('"""',start);var i=start+(raw?3:1);while(i<s.length){var c=s[i];if(raw){if(s.startsWith('"""',i)){while(s[i]==='"'){i++;}return i;}}else if(c==='\n'){return-1;}else if(c===quote){return i+1;}if(c==='\\'&&(!raw||language==='java')){i+=2;continue;}if(language==='kt'&"e==='"'&&c==='$'&&s[i+1]==='{'){var close=matchingBraceIndexInSource(s,i+1,language);if(close===-1){return-1;}i=close+1;continue;}i++;}return-1;}function matchingBraceIndexInSource(s,openBraceIndex,language){var depth=0;var i=openBraceIndex;while(i<s.length){var c=s[i];if(c==='/'&&s[i+1]==='/'){var end=s.indexOf('\n',i);i=end===-1?s.length:end;continue;}if(c==='/'&&s[i+1]==='*'){var depthOfComment=1;i+=2;while(i<s.length&&depthOfComment>0){if(language==='kt'&&s[i]==='/'&&s[i+1]==='*'){depthOfComment++;i+=2;continue;}if(s[i]==='*'&&s[i+1]==='/'){depthOfComment--;i+=2;continue;}i++;}if(depthOfComment>0){return-1;}continue;}if(c==='"'||c==="'"){var _end=literalEnd(s,i,language);if(_end===-1){return-1;}i=_end;continue;}if(c==='{'){depth++;}else if(c==='}'){depth--;if(depth===0){return i;}}i++;}return-1;}function maskCommentsAndLiterals(source,language){var out=source.split('');var blank=function blank(from,to){for(var j=from;j<to&&j<out.length;j++){if(out[j]!=='\n'){out[j]=' ';}}};var i=0;while(i<source.length){var c=source[i];if(c==='/'&&source[i+1]==='/'){var end=source.indexOf('\n',i);var stop=end===-1?source.length:end;blank(i,stop);i=stop;continue;}if(c==='/'&&source[i+1]==='*'){var depth=1;var j=i+2;while(j<source.length&&depth>0){if(language==='kt'&&source[j]==='/'&&source[j+1]==='*'){depth++;j+=2;continue;}if(source[j]==='*'&&source[j+1]==='/'){depth--;j+=2;continue;}j++;}blank(i,j);i=j;continue;}if(c==='"'||c==="'"){var _end2=literalEnd(source,i,language);if(_end2===-1){blank(i,source.length);return out.join('');}blank(i,_end2);i=_end2;continue;}i++;}return out.join('');}function mainActivityBody(contents,language){var code=maskCommentsAndLiterals(contents,language);var declaration=/\bclass\s+MainActivity\b/.exec(code);if(!declaration){return undefined;}var searchFrom=declaration.index+declaration[0].length;var open=code.indexOf('{',searchFrom);if(open===-1||!/^[^;{}]*$/.test(code.slice(searchFrom,open))){return undefined;}var depth=0;var close=-1;for(var i=open;i<code.length;i++){if(code[i]==='{'){depth++;}else if(code[i]==='}'){depth--;if(depth===0){close=i;break;}}}return close===-1?undefined:{open:open,close:close};}function updateMainActivityNewIntentOverride(contents,language,enabled){var withoutManagedBlock=contents.replace(POSTHOG_NEW_INTENT_BLOCK_PATTERN,'');if(!enabled){return withoutManagedBlock;}var body=mainActivityBody(withoutManagedBlock,language);if(!body){console.warn('[posthog-react-native] Could not find the MainActivity class body; skipping the onNewIntent '+'override. Notification taps delivered while the React context is starting will be lost.');return withoutManagedBlock;}var codeOnly=maskCommentsAndLiterals(withoutManagedBlock,language);if(/\b(fun|void)\s+onNewIntent\s*\(/.test(codeOnly.slice(body.open,body.close))){console.warn('[posthog-react-native] MainActivity already overrides onNewIntent; leaving it alone. '+'Add `setIntent(intent)` as its first statement so a notification tap that arrives before '+'the React context is ready is not lost, or set `{ patchMainActivityNewIntent: false }` '+'on the plugin to silence this.');return withoutManagedBlock;}return withoutManagedBlock.slice(0,body.open+1)+newIntentOverrideBlock(language)+withoutManagedBlock.slice(body.open+1);}var MAIN_ACTIVITY_SOURCE_ROOTS=['android/app/src/main/java','android/app/src/main/kotlin'];function findMainActivityPath(projectRoot){var _walk=function walk(dir){if(!fs.existsSync(dir)){return undefined;}var _iterator=_createForOfIteratorHelper(fs.readdirSync(dir,{withFileTypes:true})),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var entry=_step.value;var candidate=path.join(dir,entry.name);if(!entry.isDirectory()){if(/^MainActivity\.(kt|java)$/.test(entry.name)){return candidate;}continue;}var hit=_walk(candidate);if(hit){return hit;}}}catch(err){_iterator.e(err);}finally{_iterator.f();}return undefined;};for(var _i=0,_MAIN_ACTIVITY_SOURCE=MAIN_ACTIVITY_SOURCE_ROOTS;_i<_MAIN_ACTIVITY_SOURCE.length;_i++){var sourceRoot=_MAIN_ACTIVITY_SOURCE[_i];var hit=_walk(path.join(projectRoot,sourceRoot));if(hit){return hit;}}return undefined;}var withMainActivityNewIntent=function withMainActivityNewIntent(config,enabled){return withDangerousMod(config,['android',(function(){var _ref2=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3(config){var mainActivityPath,contents,updated;return _regenerator["default"].wrap(function(_context3){while(1)switch(_context3.prev=_context3.next){case 0:mainActivityPath=findMainActivityPath(config.modRequest.projectRoot);if(mainActivityPath){_context3.next=1;break;}console.warn('[posthog-react-native] Could not find MainActivity under android/app/src/main/{java,kotlin}; '+'skipping the onNewIntent override. Notification taps delivered while the React context is '+'starting will be lost.');return _context3.abrupt("return",config);case 1:_context3.next=2;return fs.promises.readFile(mainActivityPath,'utf8');case 2:contents=_context3.sent;updated=updateMainActivityNewIntentOverride(contents,mainActivityPath.endsWith('.java')?'java':'kt',enabled);if(!(updated!==contents)){_context3.next=3;break;}_context3.next=3;return fs.promises.writeFile(mainActivityPath,updated);case 3:if(!contents.includes(POSTHOG_NEW_INTENT_BEGIN)&&updated.includes(POSTHOG_NEW_INTENT_BEGIN)){console.warn("[posthog-react-native] Added an onNewIntent override to ".concat(path.relative(config.modRequest.projectRoot,mainActivityPath)," so a notification tap that arrives before the React context is ready is not lost. ")+'Set `{ patchMainActivityNewIntent: false }` on the plugin in app.json to opt out.');}return _context3.abrupt("return",config);case 4:case"end":return _context3.stop();}},_callee3);}));return function(_x2){return _ref2.apply(this,arguments);};}())]);};function modifyExistingXcodeBuildScript(script){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var releaseMode=arguments.length>2?arguments[2]:undefined;var force=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(!(script===null||script===void 0?void 0:script.shellScript)){console.warn("[posthog-react-native] Could not find the 'Bundle React Native code and images' build phase; "+'skipping sourcemap upload setup.');return;}if(!script.shellScript.match(/(packager|scripts)\/react-native-xcode\.sh\b/)){return;}if(script.shellScript.includes('posthog-xcode.sh')){var _code=migrateLegacyPostHogWrapperInvocation(JSON.parse(script.shellScript));script.shellScript=JSON.stringify(updatePostHogBundlePhaseExports(_code,skipOnConflict,releaseMode,force));return;}if(script.shellScript.includes('posthog-react-native')){return;}var code=JSON.parse(script.shellScript);script.shellScript=JSON.stringify(addPostHogWithBundledScriptsToBundleShellScript(code,skipOnConflict,releaseMode,force));}var POSTHOG_REACT_NATIVE_XCODE_PATH="`\"$NODE_BINARY\" --print \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog-xcode.sh')\"`";var POSTHOG_SKIP_ON_CONFLICT_EXPORT='export POSTHOG_SKIP_ON_CONFLICT=1';var POSTHOG_FORCE_EXPORT='export POSTHOG_FORCE=1';var POSTHOG_RELEASE_MODE_EXPORT_PREFIX='export POSTHOG_RELEASE_MODE=';function buildBundlePhaseExports(skipOnConflict,releaseMode){var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var exports=[];if(skipOnConflict){exports.push(POSTHOG_SKIP_ON_CONFLICT_EXPORT);}if(force){exports.push(POSTHOG_FORCE_EXPORT);}if(releaseMode){exports.push("".concat(POSTHOG_RELEASE_MODE_EXPORT_PREFIX).concat(releaseMode));}return exports;}var REACT_NATIVE_XCODE_LINE=/^([ \t]*)(?![A-Za-z_][A-Za-z0-9_]*=)([^\n]*(?:packager|scripts)\/react-native-xcode\.sh\b[^\n]*)$/m;function migrateLegacyPostHogWrapperInvocation(script){return script.replace("/bin/sh ".concat(POSTHOG_REACT_NATIVE_XCODE_PATH),POSTHOG_REACT_NATIVE_XCODE_PATH);}function updatePostHogBundlePhaseExports(script,skipOnConflict,releaseMode){var force=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var _a;var _b;var skipArg='--posthog-skip-on-conflict --';var lines=script.replace(new RegExp("\\s*".concat(skipArg,"\\s*"),'g'),' ').split('\n').filter(function(line){return line.trim()!==POSTHOG_SKIP_ON_CONFLICT_EXPORT;}).filter(function(line){return line.trim()!==POSTHOG_FORCE_EXPORT;}).filter(function(line){return!line.trim().startsWith(POSTHOG_RELEASE_MODE_EXPORT_PREFIX);});var exports=buildBundlePhaseExports(skipOnConflict,releaseMode,force);if(exports.length>0){var commandIndex=lines.findIndex(function(line){return line.includes(POSTHOG_REACT_NATIVE_XCODE_PATH);});if(commandIndex!==-1){var indent=(_b=(_a=lines[commandIndex].match(/^[ \t]*/))===null||_a===void 0?void 0:_a[0])!==null&&_b!==void 0?_b:'';lines.splice.apply(lines,[commandIndex,0].concat((0,_toConsumableArray2["default"])(exports.map(function(line){return"".concat(indent).concat(line);}))));}}return lines.join('\n');}function addPostHogWithBundledScriptsToBundleShellScript(script){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var releaseMode=arguments.length>2?arguments[2]:undefined;var force=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return script.replace(REACT_NATIVE_XCODE_LINE,function(_match,indent,rnCommand){var exports=buildBundlePhaseExports(skipOnConflict,releaseMode,force).map(function(line){return"".concat(indent).concat(line,"\n");}).join('');return"".concat(exports).concat(indent).concat(POSTHOG_REACT_NATIVE_XCODE_PATH," ").concat(rnCommand);});}var POSTHOG_DSYM_BUILD_PHASE_NAME='Upload PostHog Debug Symbols';var POSTHOG_DSYM_INPUT_PATH='"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Resources/DWARF/$(EXECUTABLE_NAME)"';function buildDsymUploadShellScript(){var includeSource=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return composeDsymUploadShellScript(includeSource,skipOnConflict,force);}function composeDsymUploadShellScript(includeSource,skipOnConflict,force){var lines=['# Upload iOS dSYMs to PostHog so native crashes can be symbolicated.','# upload-symbols.sh ships inside the posthog-ios dependency.'];if(includeSource){lines.push('# Also upload native source files for source-code context around crashes.','export POSTHOG_INCLUDE_SOURCE=1');}if(skipOnConflict){lines.push('# Skip dSYMs that already exist in PostHog with different content instead of failing the build.','export POSTHOG_SKIP_ON_CONFLICT=1');}if(force){lines.push('# Overwrite dSYMs that already exist in PostHog with different content instead of failing the build.','export POSTHOG_FORCE=1');}lines.push('PODS_SCRIPT="${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh"','SPM_SCRIPT="${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh"','if [ -f "$PODS_SCRIPT" ]; then',' /bin/sh "$PODS_SCRIPT"','elif [ -f "$SPM_SCRIPT" ]; then',' /bin/sh "$SPM_SCRIPT"','else',' echo "warning: PostHog upload-symbols.sh not found in Pods or SwiftPM checkouts; skipping dSYM upload."','fi');return lines.join('\n');}function legacyDsymReleaseModeLines(releaseMode){return[releaseMode?"POSTHOG_RESOLVED_RELEASE_MODE=\"".concat(releaseMode,"\""):'POSTHOG_RESOLVED_RELEASE_MODE="${POSTHOG_RELEASE_MODE:-}"','case "$POSTHOG_RESOLVED_RELEASE_MODE" in',' ""|symbol-set) ;;',' event)',' # Upload dSYMs without binding them to a release, so each crash resolves its own from the',' # app version and namespace the SDK sends. posthog-ios versions whose upload-symbols.sh',' # does not read this variable ignore it and keep binding the dSYMs.',' export POSTHOG_NO_RELEASE_BIND=1',' ;;',' *)'," echo \"error: posthog release mode must be 'symbol-set' or 'event', was '$POSTHOG_RESOLVED_RELEASE_MODE'\"",' exit 1',' ;;','esac'];}function buildLegacyReleaseModeDsymUploadShellScript(includeSource,skipOnConflict,releaseMode){var lines=composeDsymUploadShellScript(includeSource,skipOnConflict,false).split('\n');var uploadIndex=lines.findIndex(function(line){return line.startsWith('PODS_SCRIPT=');});lines.splice.apply(lines,[uploadIndex,0].concat((0,_toConsumableArray2["default"])(legacyDsymReleaseModeLines(releaseMode))));return lines.join('\n');}function encodePbxShellScript(script){return'"'+script.replace(/"/g,'\\"')+'"';}function decodePbxShellScript(stored){if(!stored.startsWith('"')||!stored.endsWith('"')){return stored;}return stored.slice(1,-1).replace(/\\(.)/g,function(_match,ch){return ch==='n'?'\n':ch==='t'?'\t':ch;});}function isPluginGeneratedDsymUploadBuildPhase(phase){if(typeof(phase===null||phase===void 0?void 0:phase.shellScript)!=='string'){return false;}var stored=decodePbxShellScript(phase.shellScript);return[false,true].some(function(source){return[false,true].some(function(skip){return[false,true].some(function(force){return stored===buildDsymUploadShellScript(source,skip,force);})||[undefined].concat(POSTHOG_RELEASE_MODES).some(function(mode){return stored===buildLegacyReleaseModeDsymUploadShellScript(source,skip,mode);});});});}function moveDsymUploadBuildPhaseToEnd(xcodeProject){var _a,_b;var existing=xcodeProject.pbxItemByComment(POSTHOG_DSYM_BUILD_PHASE_NAME,'PBXShellScriptBuildPhase');if(!isPluginGeneratedDsymUploadBuildPhase(existing)){return;}var buildPhases=(_b=(_a=xcodeProject.getFirstTarget)===null||_a===void 0?void 0:_a.call(xcodeProject).firstTarget)===null||_b===void 0?void 0:_b.buildPhases;if(Array.isArray(buildPhases)){var phaseIndex=buildPhases.findIndex(function(phase){return phase.comment===POSTHOG_DSYM_BUILD_PHASE_NAME;});if(phaseIndex!==-1&&phaseIndex!==buildPhases.length-1){buildPhases.push.apply(buildPhases,(0,_toConsumableArray2["default"])(buildPhases.splice(phaseIndex,1)));}}}function addDsymUploadBuildPhase(xcodeProject){var includeSource=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var skipOnConflict=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var force=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var existing=xcodeProject.pbxItemByComment(POSTHOG_DSYM_BUILD_PHASE_NAME,'PBXShellScriptBuildPhase');if(existing){if(isPluginGeneratedDsymUploadBuildPhase(existing)){existing.shellScript=encodePbxShellScript(buildDsymUploadShellScript(includeSource,skipOnConflict,force));existing.inputPaths=Array.from(new Set([].concat((0,_toConsumableArray2["default"])(Array.isArray(existing.inputPaths)?existing.inputPaths:[]),[POSTHOG_DSYM_INPUT_PATH])));}}else{xcodeProject.addBuildPhase([],'PBXShellScriptBuildPhase',POSTHOG_DSYM_BUILD_PHASE_NAME,null,{inputPaths:[POSTHOG_DSYM_INPUT_PATH],shellPath:'/bin/sh',shellScript:buildDsymUploadShellScript(includeSource,skipOnConflict,force)});}moveDsymUploadBuildPhaseToEnd(xcodeProject);}function disableUserScriptSandboxing(xcodeProject){var configurations=xcodeProject.pbxXCBuildConfigurationSection();for(var key in configurations){var configuration=configurations[key];if(configuration&&configuration.buildSettings){configuration.buildSettings.ENABLE_USER_SCRIPT_SANDBOXING='"NO"';}}}var POSTHOG_DOTENV_BUILD_SETTING='POSTHOG_CLI_DOTENV_FILE';var POSTHOG_DOTENV_GRADLE_PROPERTY='posthog.dotenvFile';function normalizeDotenvFileProp(dotenvFile){return dotenvFile.replace(/^\.\//,'');}function resolveDotenvFileProp(dotenvFile){var trimmed=dotenvFile===null||dotenvFile===void 0?void 0:dotenvFile.trim();return trimmed?trimmed:undefined;}function isAbsoluteDotenvPath(dotenvFile){return dotenvFile.startsWith('/')||/^[A-Za-z]:[\\/]/.test(dotenvFile);}function buildIosDotenvFileBuildSetting(dotenvFile){var value=isAbsoluteDotenvPath(dotenvFile)?dotenvFile:"$(SRCROOT)/../".concat(normalizeDotenvFileProp(dotenvFile));return'"'+value.replace(/(["\\])/g,'\\$1')+'"';}function applyDotenvFileBuildSetting(xcodeProject,dotenvFile){var configurations=xcodeProject.pbxXCBuildConfigurationSection();for(var key in configurations){var configuration=configurations[key];if(configuration&&configuration.buildSettings){if(dotenvFile){configuration.buildSettings[POSTHOG_DOTENV_BUILD_SETTING]=buildIosDotenvFileBuildSetting(dotenvFile);}else{delete configuration.buildSettings[POSTHOG_DOTENV_BUILD_SETTING];}}}}function buildAndroidDotenvFileGradleValue(dotenvFile){return isAbsoluteDotenvPath(dotenvFile)?dotenvFile:"../".concat(normalizeDotenvFileProp(dotenvFile));}function updateDotenvFileGradleProperties(properties,dotenvFile){var rest=properties.filter(function(item){return!(item.type==='property'&&item.key===POSTHOG_DOTENV_GRADLE_PROPERTY);});if(!dotenvFile){return rest;}rest.push({type:'property',key:POSTHOG_DOTENV_GRADLE_PROPERTY,value:buildAndroidDotenvFileGradleValue(dotenvFile)});return rest;}function updateHermesReleaseModeGradleProperties(properties,releaseMode){var rest=properties.filter(function(item){return!(item.type==='property'&&item.key===POSTHOG_HERMES_RELEASE_MODE_GRADLE_PROPERTY);});if(!releaseMode){return rest;}rest.push({type:'property',key:POSTHOG_HERMES_RELEASE_MODE_GRADLE_PROPERTY,value:releaseMode});return rest;}var withPostHogGradleProperties=function withPostHogGradleProperties(config,dotenvFile,releaseMode){return withGradleProperties(config,function(config){config.modResults=updateDotenvFileGradleProperties(config.modResults,dotenvFile);config.modResults=updateHermesReleaseModeGradleProperties(config.modResults,releaseMode);return config;});};function resolveNativeSymbolUpload(prop){if(prop===true){return{enabled:true,includeSource:false};}if(prop&&(0,_typeof2["default"])(prop)==='object'){return{enabled:true,includeSource:prop.includeSource===true};}return{enabled:false,includeSource:false};}var withFinalizedXcodeProject=function withFinalizedXcodeProject(config,_action2){return withBaseMod(config,{platform:'ios',mod:'xcodeproj',action:function action(config){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(){var _config$modRequest2,nextMod,modRequest,results;return _regenerator["default"].wrap(function(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_config$modRequest2=config.modRequest,nextMod=_config$modRequest2.nextMod,modRequest=(0,_objectWithoutProperties2["default"])(_config$modRequest2,_excluded2);_context4.next=1;return nextMod(_objectSpread(_objectSpread({},config),{},{modRequest:modRequest}));case 1:results=_context4.sent;return _context4.abrupt("return",_action2(results));case 2:case"end":return _context4.stop();}},_callee4);}))();}});};var withIosPlugin=function withIosPlugin(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var nativeSymbols=resolveNativeSymbolUpload(props.uploadNativeSymbols);config=withXcodeProject(config,function(config){var xcodeProject=config.modResults;var bundleReactNativePhase=xcodeProject.pbxItemByComment('Bundle React Native code and images','PBXShellScriptBuildPhase');modifyExistingXcodeBuildScript(bundleReactNativePhase,props.skipOnConflict===true,props.releaseMode,props.force===true);if(nativeSymbols.enabled){addDsymUploadBuildPhase(xcodeProject,nativeSymbols.includeSource,props.skipOnConflict===true,props.force===true);}applyDotenvFileBuildSetting(xcodeProject,props.dotenvFile);if(props.disableSandboxing!==false){disableUserScriptSandboxing(xcodeProject);console.warn('[posthog-react-native] Setting ENABLE_USER_SCRIPT_SANDBOXING=NO on all Xcode '+'build configurations so sourcemap uploads can resolve git metadata. '+'If your org requires sandboxing to stay enabled, set `{ disableSandboxing: false }` '+'on the plugin in app.json — note that stock Expo projects may fail to build under '+'sandboxing until every script build phase declares its input/output files.');}return config;});if(nativeSymbols.enabled){config=withFinalizedXcodeProject(config,function(config){moveDsymUploadBuildPhaseToEnd(config.modResults);return config;});}return config;};var withPostHogPlugin=function withPostHogPlugin(config){var rawProps=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(rawProps.skipOnConflict===true&&rawProps.force===true){throw new Error('[posthog-react-native] skipOnConflict and force cannot both be enabled: posthog-cli accepts only one of --skip-on-conflict and --force');}var props=_objectSpread(_objectSpread({},rawProps),{},{dotenvFile:resolveDotenvFileProp(rawProps.dotenvFile),releaseMode:resolveReleaseModeProp(rawProps.releaseMode,process.env.POSTHOG_RELEASE_MODE)});if(resolveNativeSymbolUpload(props.uploadNativeSymbols).enabled){config=withAndroidNativeSymbolsPlugin(config);}config=withAndroidPlugin(config,props.skipOnConflict===true,props.force===true);config=withPostHogGradleProperties(config,props.dotenvFile,props.releaseMode);config=withMainActivityNewIntent(config,props.patchMainActivityNewIntent!==false);return withIosPlugin(config,props);};var postHogPlugin=function postHogPlugin(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return withPostHogPlugin(config,props);};module.exports=postHogPlugin;module.exports.modifyExistingXcodeBuildScript=modifyExistingXcodeBuildScript;module.exports.addPostHogWithBundledScriptsToBundleShellScript=addPostHogWithBundledScriptsToBundleShellScript;module.exports.disableUserScriptSandboxing=disableUserScriptSandboxing;module.exports.buildDsymUploadShellScript=buildDsymUploadShellScript;module.exports.addDsymUploadBuildPhase=addDsymUploadBuildPhase;module.exports.moveDsymUploadBuildPhaseToEnd=moveDsymUploadBuildPhaseToEnd;module.exports.resolveNativeSymbolUpload=resolveNativeSymbolUpload;module.exports.buildAndroidSkipOnConflictGradleLine=buildAndroidSkipOnConflictGradleLine;module.exports.buildAndroidForceGradleLine=buildAndroidForceGradleLine;module.exports.addPostHogAndroidGradlePluginClasspath=addPostHogAndroidGradlePluginClasspath;module.exports.applyPostHogAndroidGradlePlugin=applyPostHogAndroidGradlePlugin;module.exports.buildIosDotenvFileBuildSetting=buildIosDotenvFileBuildSetting;module.exports.applyDotenvFileBuildSetting=applyDotenvFileBuildSetting;module.exports.resolveDotenvFileProp=resolveDotenvFileProp;module.exports.buildAndroidDotenvFileGradleValue=buildAndroidDotenvFileGradleValue;module.exports.updateDotenvFileGradleProperties=updateDotenvFileGradleProperties;module.exports.POSTHOG_RELEASE_MODES=POSTHOG_RELEASE_MODES;module.exports.resolveReleaseModeProp=resolveReleaseModeProp;module.exports.updateHermesReleaseModeGradleProperties=updateHermesReleaseModeGradleProperties;module.exports.updateMainActivityNewIntentOverride=updateMainActivityNewIntentOverride;
|
|
1
|
+
"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.POSTHOG_RELEASE_MODES=void 0;exports.addDsymUploadBuildPhase=addDsymUploadBuildPhase;exports.addPostHogAndroidGradlePluginClasspath=addPostHogAndroidGradlePluginClasspath;exports.addPostHogWithBundledScriptsToBundleShellScript=addPostHogWithBundledScriptsToBundleShellScript;exports.applyDotenvFileBuildSetting=applyDotenvFileBuildSetting;exports.applyPostHogAndroidGradlePlugin=applyPostHogAndroidGradlePlugin;exports.buildAndroidDotenvFileGradleValue=buildAndroidDotenvFileGradleValue;exports.buildAndroidForceGradleLine=buildAndroidForceGradleLine;exports.buildAndroidSkipOnConflictGradleLine=buildAndroidSkipOnConflictGradleLine;exports.buildDsymUploadShellScript=buildDsymUploadShellScript;exports.buildIosDotenvFileBuildSetting=buildIosDotenvFileBuildSetting;exports.disableUserScriptSandboxing=disableUserScriptSandboxing;exports.modifyExistingXcodeBuildScript=modifyExistingXcodeBuildScript;exports.moveDsymUploadBuildPhaseToEnd=moveDsymUploadBuildPhaseToEnd;exports.removePostHogAndroidNativeSymbolsExtension=removePostHogAndroidNativeSymbolsExtension;exports.resolveDotenvFileProp=resolveDotenvFileProp;exports.resolveNativeSymbolUpload=resolveNativeSymbolUpload;exports.resolveReleaseModeProp=resolveReleaseModeProp;exports.setPostHogAndroidNativeSymbolsExtension=setPostHogAndroidNativeSymbolsExtension;exports.updateDotenvFileGradleProperties=updateDotenvFileGradleProperties;exports.updateHermesReleaseModeGradleProperties=updateHermesReleaseModeGradleProperties;exports.updateMainActivityNewIntentOverride=updateMainActivityNewIntentOverride;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _typeof2=_interopRequireDefault(require("@babel/runtime/helpers/typeof"));var _toConsumableArray2=_interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var _excluded=["nextMod"],_excluded2=["nextMod"];function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]};},e:function e(r){throw r;},f:F};}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}var o,a=!0,u=!1;return{s:function s(){t=t.call(r);},n:function n(){var r=t.next();return a=r.done,r;},e:function e(r){u=!0,o=r;},f:function f(){try{a||null==t["return"]||t["return"]();}finally{if(u)throw o;}}};}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0;}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){(0,_defineProperty2["default"])(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}var fs=require('fs');var path=require('path');var _require=require('@expo/config-plugins'),AndroidConfig=_require.AndroidConfig,withAppBuildGradle=_require.withAppBuildGradle,withBaseMod=_require.withBaseMod,withDangerousMod=_require.withDangerousMod,withGradleProperties=_require.withGradleProperties,withXcodeProject=_require.withXcodeProject;var POSTHOG_ANDROID_GRADLE_PLUGIN_VERSION='1.6.0';var POSTHOG_ANDROID_GRADLE_PLUGIN_NATIVE_SYMBOLS_VERSION=[1,5];var resolvePostHogReactNativePackageJsonPath="[\"node\", \"--print\", \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog.gradle')\"].execute().text.trim()";var POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY='posthogReactNativeSkipOnConflict';var POSTHOG_ANDROID_FORCE_PROPERTY='posthogReactNativeForce';var POSTHOG_HERMES_RELEASE_MODE_GRADLE_PROPERTY='posthog.hermesReleaseMode';var POSTHOG_RELEASE_MODES=exports.POSTHOG_RELEASE_MODES=['symbol-set','event'];function resolveReleaseModeProp(releaseMode,environmentMode){var trimmed=(releaseMode===null||releaseMode===void 0?void 0:releaseMode.trim())||(environmentMode===null||environmentMode===void 0?void 0:environmentMode.trim());if(!trimmed){return undefined;}if(!POSTHOG_RELEASE_MODES.includes(trimmed)){throw new Error("[posthog-react-native] releaseMode must be one of ".concat(POSTHOG_RELEASE_MODES.join(', '),", was '").concat(trimmed,"'"));}return trimmed;}function buildAndroidSkipOnConflictGradleLine(skipOnConflict){if(!skipOnConflict){return null;}return"project.ext.".concat(POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY," = true");}function buildAndroidForceGradleLine(force){if(!force){return null;}return"project.ext.".concat(POSTHOG_ANDROID_FORCE_PROPERTY," = true");}var androidConflictPropertyPattern=function androidConflictPropertyPattern(property){return new RegExp("^project\\.ext\\.".concat(property,"\\s*=\\s*(true|false)\\n?"),'m');};var withAndroidPlugin=function withAndroidPlugin(config){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return withAppBuildGradle(config,function(config){if(config.modResults.language!=='groovy'){console.warn('Cannot configure PostHog in the app gradle because the build.gradle is not groovy');}var buildGradle=config.modResults.contents;var applyFrom="apply from: new File(".concat(resolvePostHogReactNativePackageJsonPath,")");var conflictLines=[buildAndroidSkipOnConflictGradleLine(skipOnConflict),buildAndroidForceGradleLine(force)].filter(function(line){return line!==null;}).join('\n');var applyBlock=conflictLines?"".concat(conflictLines,"\n").concat(applyFrom):applyFrom;var conflictPatterns=[androidConflictPropertyPattern(POSTHOG_ANDROID_SKIP_ON_CONFLICT_PROPERTY),androidConflictPropertyPattern(POSTHOG_ANDROID_FORCE_PROPERTY)];if(buildGradle.includes(applyFrom)){var contents=conflictPatterns.reduce(function(gradle,pattern){return gradle.replace(pattern,'');},buildGradle);if(conflictLines){contents=contents.replace(applyFrom,"".concat(conflictLines,"\n").concat(applyFrom));}config.modResults.contents=contents;return config;}var pattern=/^android\s*\{/m;if(buildGradle.match(pattern)){config.modResults.contents=buildGradle.replace(pattern,"".concat(applyBlock,"\n\nandroid {"));}else{console.warn('PostHog: Could not find "android {" block in build.gradle');}return config;});};function matchingBraceIndex(s,openBraceIndex){var depth=0;for(var i=openBraceIndex;i<s.length;i++){if(s[i]==='{'){depth++;}else if(s[i]==='}'){depth--;if(depth===0){return i;}}}return-1;}function addPostHogAndroidGradlePluginClasspath(projectBuildGradle){if(projectBuildGradle.includes('posthog-android-gradle-plugin')){return{contents:bumpPostHogAndroidGradlePluginClasspath(projectBuildGradle),classpathPresent:true};}var classpathLine=" classpath(\"com.posthog:posthog-android-gradle-plugin:".concat(POSTHOG_ANDROID_GRADLE_PLUGIN_VERSION,"\")");var buildscriptMatch=/buildscript\s*\{/.exec(projectBuildGradle);var buildscriptOpenBrace=buildscriptMatch?buildscriptMatch.index+buildscriptMatch[0].length-1:-1;var buildscriptEnd=buildscriptOpenBrace===-1?-1:matchingBraceIndex(projectBuildGradle,buildscriptOpenBrace);var buildscriptBody=buildscriptEnd===-1?'':projectBuildGradle.slice(buildscriptOpenBrace,buildscriptEnd);var dependenciesMatch=buildscriptBody?/dependencies\s*\{/.exec(buildscriptBody):null;if(!dependenciesMatch){console.warn('PostHog: Could not find a buildscript dependencies block in the project build.gradle; '+'skipping the com.posthog.android classpath. Native symbols will not be uploaded.');return{contents:projectBuildGradle,classpathPresent:false};}var insertAt=buildscriptOpenBrace+dependenciesMatch.index+dependenciesMatch[0].length;return{contents:"".concat(projectBuildGradle.slice(0,insertAt),"\n").concat(classpathLine).concat(projectBuildGradle.slice(insertAt)),classpathPresent:true};}function bumpPostHogAndroidGradlePluginClasspath(projectBuildGradle){var minMajor=POSTHOG_ANDROID_GRADLE_PLUGIN_NATIVE_SYMBOLS_VERSION[0],minMinor=POSTHOG_ANDROID_GRADLE_PLUGIN_NATIVE_SYMBOLS_VERSION[1];if(!/com\.posthog:posthog-android-gradle-plugin:\d+\.\d+\.\d+/.test(projectBuildGradle)){console.warn('PostHog: Could not read the com.posthog:posthog-android-gradle-plugin version in the project build.gradle. '+"uploadNativeSymbols needs ".concat(minMajor,".").concat(minMinor,".0 or later, or the build fails."));}return projectBuildGradle.replace(/(com\.posthog:posthog-android-gradle-plugin:)(\d+)\.(\d+)\.\d+/g,function(match,prefix,major,minor){var older=Number(major)<minMajor||Number(major)===minMajor&&Number(minor)<minMinor;return older?"".concat(prefix).concat(POSTHOG_ANDROID_GRADLE_PLUGIN_VERSION):match;});}function applyPostHogAndroidGradlePlugin(appBuildGradle){if(/apply plugin: ["']com\.posthog\.android["']/.test(appBuildGradle)){return appBuildGradle;}var applyLine='apply plugin: "com.posthog.android"';var appPluginPattern=/^([ \t]*apply plugin: ["']com\.android\.application["'].*)$/m;if(appPluginPattern.test(appBuildGradle)){return appBuildGradle.replace(appPluginPattern,"$1\n".concat(applyLine));}var androidBlockPattern=/^android\s*\{/m;if(androidBlockPattern.test(appBuildGradle)){return appBuildGradle.replace(androidBlockPattern,"".concat(applyLine,"\n\nandroid {"));}console.warn('PostHog: Could not find where to apply com.posthog.android in the app build.gradle');return appBuildGradle;}var POSTHOG_NATIVE_SYMBOLS_MARKER='posthog-native-symbols';var POSTHOG_NATIVE_SYMBOLS_BEGIN="// @generated begin ".concat(POSTHOG_NATIVE_SYMBOLS_MARKER," - posthog-react-native (DO NOT MODIFY)");var POSTHOG_NATIVE_SYMBOLS_END="// @generated end ".concat(POSTHOG_NATIVE_SYMBOLS_MARKER);var POSTHOG_NATIVE_SYMBOLS_BLOCK_PATTERN=new RegExp("\\r?\\n[ \\t]*".concat(escapeRegExp(POSTHOG_NATIVE_SYMBOLS_BEGIN),"[\\s\\S]*?").concat(escapeRegExp(POSTHOG_NATIVE_SYMBOLS_END),"[ \\t]*"),'g');function removePostHogAndroidNativeSymbolsExtension(appBuildGradle){return appBuildGradle.replace(POSTHOG_NATIVE_SYMBOLS_BLOCK_PATTERN,'');}function setPostHogAndroidNativeSymbolsExtension(appBuildGradle,includeSource){var contents=removePostHogAndroidNativeSymbolsExtension(appBuildGradle);var applyPattern=/^([ \t]*apply plugin: ["']com\.posthog\.android["'].*)$/m;if(!applyPattern.test(contents)){return appBuildGradle;}var block=[POSTHOG_NATIVE_SYMBOLS_BEGIN,'posthog {',' uploadNativeSymbols = true'," includeNativeSymbolSources = ".concat(includeSource),'}',POSTHOG_NATIVE_SYMBOLS_END].join('\n');return contents.replace(applyPattern,"$1\n".concat(block));}var withFinalizedProjectBuildGradle=function withFinalizedProjectBuildGradle(config,_action){return withBaseMod(config,{platform:'android',mod:'projectBuildGradle',skipEmptyMod:false,action:function action(config){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(){var _config$modRequest,nextMod,modRequest,results;return _regenerator["default"].wrap(function(_context){while(1)switch(_context.prev=_context.next){case 0:_config$modRequest=config.modRequest,nextMod=_config$modRequest.nextMod,modRequest=(0,_objectWithoutProperties2["default"])(_config$modRequest,_excluded);_context.next=1;return nextMod(_objectSpread(_objectSpread({},config),{},{modRequest:modRequest}));case 1:results=_context.sent;return _context.abrupt("return",_action(results));case 2:case"end":return _context.stop();}},_callee);}))();}});};var withAndroidNativeSymbolsPlugin=function withAndroidNativeSymbolsPlugin(config,includeSource){return withFinalizedProjectBuildGradle(config,function(){var _ref=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee2(config){var result,appBuildGradle,contents;return _regenerator["default"].wrap(function(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!(config.modResults.language!=='groovy')){_context2.next=1;break;}console.warn('Cannot configure the PostHog Android Gradle plugin because the project build.gradle is not groovy');return _context2.abrupt("return",config);case 1:result=addPostHogAndroidGradlePluginClasspath(config.modResults.contents);if(!(result.contents!==config.modResults.contents)){_context2.next=3;break;}_context2.next=2;return fs.promises.writeFile(config.modResults.path,result.contents);case 2:config.modResults.contents=result.contents;case 3:if(result.classpathPresent){_context2.next=4;break;}return _context2.abrupt("return",config);case 4:_context2.next=5;return AndroidConfig.Paths.getAppBuildGradleAsync(config.modRequest.projectRoot);case 5:appBuildGradle=_context2.sent;if(!(appBuildGradle.language!=='groovy')){_context2.next=6;break;}console.warn('Cannot configure the PostHog Android Gradle plugin because the app build.gradle is not groovy');return _context2.abrupt("return",config);case 6:contents=setPostHogAndroidNativeSymbolsExtension(applyPostHogAndroidGradlePlugin(appBuildGradle.contents),includeSource);if(!(contents!==appBuildGradle.contents)){_context2.next=7;break;}_context2.next=7;return fs.promises.writeFile(appBuildGradle.path,contents);case 7:return _context2.abrupt("return",config);case 8:case"end":return _context2.stop();}},_callee2);}));return function(_x){return _ref.apply(this,arguments);};}());};var withoutAndroidNativeSymbolsExtension=function withoutAndroidNativeSymbolsExtension(config){return withAppBuildGradle(config,function(config){if(config.modResults.language==='groovy'){config.modResults.contents=removePostHogAndroidNativeSymbolsExtension(config.modResults.contents);}return config;});};var POSTHOG_NEW_INTENT_MARKER='posthog-new-intent';var POSTHOG_NEW_INTENT_BEGIN="// @generated begin ".concat(POSTHOG_NEW_INTENT_MARKER," - posthog-react-native (DO NOT MODIFY)");var POSTHOG_NEW_INTENT_END="// @generated end ".concat(POSTHOG_NEW_INTENT_MARKER);var NEW_INTENT_DOC=" /**\n * Records the intent that reopened the app so getIntent() stays correct.\n *\n * Works around a React Native defect that drops notification taps and deep links arriving while\n * the React context is still starting. Managed by the posthog-react-native Expo config plugin;\n * remove it with { patchMainActivityNewIntent: false } in app.json.\n * https://posthog.com/docs/workflows/push-notifications/react-native\n */";var NEW_INTENT_KOTLIN_BODY=" override fun onNewIntent(intent: android.content.Intent) {\n setIntent(intent)\n super.onNewIntent(intent)\n }";var NEW_INTENT_JAVA_BODY=" @Override\n public void onNewIntent(android.content.Intent intent) {\n setIntent(intent);\n super.onNewIntent(intent);\n }";function newIntentOverrideBlock(language){var body=language==='java'?NEW_INTENT_JAVA_BODY:NEW_INTENT_KOTLIN_BODY;return"\n ".concat(POSTHOG_NEW_INTENT_BEGIN,"\n").concat(NEW_INTENT_DOC,"\n").concat(body,"\n ").concat(POSTHOG_NEW_INTENT_END,"\n");}function escapeRegExp(value){return value.replace(/[.*+?^${}()|[\]\\]/g,'\\$&');}var POSTHOG_NEW_INTENT_BLOCK_PATTERN=new RegExp("\\r?\\n?[ \\t]*".concat(escapeRegExp(POSTHOG_NEW_INTENT_BEGIN),"[\\s\\S]*?").concat(escapeRegExp(POSTHOG_NEW_INTENT_END),"[ \\t]*\\r?\\n"),'g');function literalEnd(s,start,language){var quote=s[start];var raw=quote==='"'&&s.startsWith('"""',start);var i=start+(raw?3:1);while(i<s.length){var c=s[i];if(raw){if(s.startsWith('"""',i)){while(s[i]==='"'){i++;}return i;}}else if(c==='\n'){return-1;}else if(c===quote){return i+1;}if(c==='\\'&&(!raw||language==='java')){i+=2;continue;}if(language==='kt'&"e==='"'&&c==='$'&&s[i+1]==='{'){var close=matchingBraceIndexInSource(s,i+1,language);if(close===-1){return-1;}i=close+1;continue;}i++;}return-1;}function matchingBraceIndexInSource(s,openBraceIndex,language){var depth=0;var i=openBraceIndex;while(i<s.length){var c=s[i];if(c==='/'&&s[i+1]==='/'){var end=s.indexOf('\n',i);i=end===-1?s.length:end;continue;}if(c==='/'&&s[i+1]==='*'){var depthOfComment=1;i+=2;while(i<s.length&&depthOfComment>0){if(language==='kt'&&s[i]==='/'&&s[i+1]==='*'){depthOfComment++;i+=2;continue;}if(s[i]==='*'&&s[i+1]==='/'){depthOfComment--;i+=2;continue;}i++;}if(depthOfComment>0){return-1;}continue;}if(c==='"'||c==="'"){var _end=literalEnd(s,i,language);if(_end===-1){return-1;}i=_end;continue;}if(c==='{'){depth++;}else if(c==='}'){depth--;if(depth===0){return i;}}i++;}return-1;}function maskCommentsAndLiterals(source,language){var out=source.split('');var blank=function blank(from,to){for(var j=from;j<to&&j<out.length;j++){if(out[j]!=='\n'){out[j]=' ';}}};var i=0;while(i<source.length){var c=source[i];if(c==='/'&&source[i+1]==='/'){var end=source.indexOf('\n',i);var stop=end===-1?source.length:end;blank(i,stop);i=stop;continue;}if(c==='/'&&source[i+1]==='*'){var depth=1;var j=i+2;while(j<source.length&&depth>0){if(language==='kt'&&source[j]==='/'&&source[j+1]==='*'){depth++;j+=2;continue;}if(source[j]==='*'&&source[j+1]==='/'){depth--;j+=2;continue;}j++;}blank(i,j);i=j;continue;}if(c==='"'||c==="'"){var _end2=literalEnd(source,i,language);if(_end2===-1){blank(i,source.length);return out.join('');}blank(i,_end2);i=_end2;continue;}i++;}return out.join('');}function mainActivityBody(contents,language){var code=maskCommentsAndLiterals(contents,language);var declaration=/\bclass\s+MainActivity\b/.exec(code);if(!declaration){return undefined;}var searchFrom=declaration.index+declaration[0].length;var open=code.indexOf('{',searchFrom);if(open===-1||!/^[^;{}]*$/.test(code.slice(searchFrom,open))){return undefined;}var depth=0;var close=-1;for(var i=open;i<code.length;i++){if(code[i]==='{'){depth++;}else if(code[i]==='}'){depth--;if(depth===0){close=i;break;}}}return close===-1?undefined:{open:open,close:close};}function updateMainActivityNewIntentOverride(contents,language,enabled){var withoutManagedBlock=contents.replace(POSTHOG_NEW_INTENT_BLOCK_PATTERN,'');if(!enabled){return withoutManagedBlock;}var body=mainActivityBody(withoutManagedBlock,language);if(!body){console.warn('[posthog-react-native] Could not find the MainActivity class body; skipping the onNewIntent '+'override. Notification taps delivered while the React context is starting will be lost.');return withoutManagedBlock;}var codeOnly=maskCommentsAndLiterals(withoutManagedBlock,language);if(/\b(fun|void)\s+onNewIntent\s*\(/.test(codeOnly.slice(body.open,body.close))){console.warn('[posthog-react-native] MainActivity already overrides onNewIntent; leaving it alone. '+'Add `setIntent(intent)` as its first statement so a notification tap that arrives before '+'the React context is ready is not lost, or set `{ patchMainActivityNewIntent: false }` '+'on the plugin to silence this.');return withoutManagedBlock;}return withoutManagedBlock.slice(0,body.open+1)+newIntentOverrideBlock(language)+withoutManagedBlock.slice(body.open+1);}var MAIN_ACTIVITY_SOURCE_ROOTS=['android/app/src/main/java','android/app/src/main/kotlin'];function findMainActivityPath(projectRoot){var _walk=function walk(dir){if(!fs.existsSync(dir)){return undefined;}var _iterator=_createForOfIteratorHelper(fs.readdirSync(dir,{withFileTypes:true})),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var entry=_step.value;var candidate=path.join(dir,entry.name);if(!entry.isDirectory()){if(/^MainActivity\.(kt|java)$/.test(entry.name)){return candidate;}continue;}var hit=_walk(candidate);if(hit){return hit;}}}catch(err){_iterator.e(err);}finally{_iterator.f();}return undefined;};for(var _i=0,_MAIN_ACTIVITY_SOURCE=MAIN_ACTIVITY_SOURCE_ROOTS;_i<_MAIN_ACTIVITY_SOURCE.length;_i++){var sourceRoot=_MAIN_ACTIVITY_SOURCE[_i];var hit=_walk(path.join(projectRoot,sourceRoot));if(hit){return hit;}}return undefined;}var withMainActivityNewIntent=function withMainActivityNewIntent(config,enabled){return withDangerousMod(config,['android',(function(){var _ref2=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee3(config){var mainActivityPath,contents,updated;return _regenerator["default"].wrap(function(_context3){while(1)switch(_context3.prev=_context3.next){case 0:mainActivityPath=findMainActivityPath(config.modRequest.projectRoot);if(mainActivityPath){_context3.next=1;break;}console.warn('[posthog-react-native] Could not find MainActivity under android/app/src/main/{java,kotlin}; '+'skipping the onNewIntent override. Notification taps delivered while the React context is '+'starting will be lost.');return _context3.abrupt("return",config);case 1:_context3.next=2;return fs.promises.readFile(mainActivityPath,'utf8');case 2:contents=_context3.sent;updated=updateMainActivityNewIntentOverride(contents,mainActivityPath.endsWith('.java')?'java':'kt',enabled);if(!(updated!==contents)){_context3.next=3;break;}_context3.next=3;return fs.promises.writeFile(mainActivityPath,updated);case 3:if(!contents.includes(POSTHOG_NEW_INTENT_BEGIN)&&updated.includes(POSTHOG_NEW_INTENT_BEGIN)){console.warn("[posthog-react-native] Added an onNewIntent override to ".concat(path.relative(config.modRequest.projectRoot,mainActivityPath)," so a notification tap that arrives before the React context is ready is not lost. ")+'Set `{ patchMainActivityNewIntent: false }` on the plugin in app.json to opt out.');}return _context3.abrupt("return",config);case 4:case"end":return _context3.stop();}},_callee3);}));return function(_x2){return _ref2.apply(this,arguments);};}())]);};function modifyExistingXcodeBuildScript(script){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var releaseMode=arguments.length>2?arguments[2]:undefined;var force=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(!(script===null||script===void 0?void 0:script.shellScript)){console.warn("[posthog-react-native] Could not find the 'Bundle React Native code and images' build phase; "+'skipping sourcemap upload setup.');return;}if(!script.shellScript.match(/(packager|scripts)\/react-native-xcode\.sh\b/)){return;}if(script.shellScript.includes('posthog-xcode.sh')){var _code=migrateLegacyPostHogWrapperInvocation(JSON.parse(script.shellScript));script.shellScript=JSON.stringify(updatePostHogBundlePhaseExports(_code,skipOnConflict,releaseMode,force));return;}if(script.shellScript.includes('posthog-react-native')){return;}var code=JSON.parse(script.shellScript);script.shellScript=JSON.stringify(addPostHogWithBundledScriptsToBundleShellScript(code,skipOnConflict,releaseMode,force));}var POSTHOG_REACT_NATIVE_XCODE_PATH="`\"$NODE_BINARY\" --print \"require('path').join(require('path').dirname(require.resolve('posthog-react-native')), '..', 'tooling', 'posthog-xcode.sh')\"`";var POSTHOG_SKIP_ON_CONFLICT_EXPORT='export POSTHOG_SKIP_ON_CONFLICT=1';var POSTHOG_FORCE_EXPORT='export POSTHOG_FORCE=1';var POSTHOG_RELEASE_MODE_EXPORT_PREFIX='export POSTHOG_RELEASE_MODE=';function buildBundlePhaseExports(skipOnConflict,releaseMode){var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var exports=[];if(skipOnConflict){exports.push(POSTHOG_SKIP_ON_CONFLICT_EXPORT);}if(force){exports.push(POSTHOG_FORCE_EXPORT);}if(releaseMode){exports.push("".concat(POSTHOG_RELEASE_MODE_EXPORT_PREFIX).concat(releaseMode));}return exports;}var REACT_NATIVE_XCODE_LINE=/^([ \t]*)(?![A-Za-z_][A-Za-z0-9_]*=)([^\n]*(?:packager|scripts)\/react-native-xcode\.sh\b[^\n]*)$/m;function migrateLegacyPostHogWrapperInvocation(script){return script.replace("/bin/sh ".concat(POSTHOG_REACT_NATIVE_XCODE_PATH),POSTHOG_REACT_NATIVE_XCODE_PATH);}function updatePostHogBundlePhaseExports(script,skipOnConflict,releaseMode){var force=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var _a;var _b;var skipArg='--posthog-skip-on-conflict --';var lines=script.replace(new RegExp("\\s*".concat(skipArg,"\\s*"),'g'),' ').split('\n').filter(function(line){return line.trim()!==POSTHOG_SKIP_ON_CONFLICT_EXPORT;}).filter(function(line){return line.trim()!==POSTHOG_FORCE_EXPORT;}).filter(function(line){return!line.trim().startsWith(POSTHOG_RELEASE_MODE_EXPORT_PREFIX);});var exports=buildBundlePhaseExports(skipOnConflict,releaseMode,force);if(exports.length>0){var commandIndex=lines.findIndex(function(line){return line.includes(POSTHOG_REACT_NATIVE_XCODE_PATH);});if(commandIndex!==-1){var indent=(_b=(_a=lines[commandIndex].match(/^[ \t]*/))===null||_a===void 0?void 0:_a[0])!==null&&_b!==void 0?_b:'';lines.splice.apply(lines,[commandIndex,0].concat((0,_toConsumableArray2["default"])(exports.map(function(line){return"".concat(indent).concat(line);}))));}}return lines.join('\n');}function addPostHogWithBundledScriptsToBundleShellScript(script){var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var releaseMode=arguments.length>2?arguments[2]:undefined;var force=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;return script.replace(REACT_NATIVE_XCODE_LINE,function(_match,indent,rnCommand){var exports=buildBundlePhaseExports(skipOnConflict,releaseMode,force).map(function(line){return"".concat(indent).concat(line,"\n");}).join('');return"".concat(exports).concat(indent).concat(POSTHOG_REACT_NATIVE_XCODE_PATH," ").concat(rnCommand);});}var POSTHOG_DSYM_BUILD_PHASE_NAME='Upload PostHog Debug Symbols';var POSTHOG_DSYM_INPUT_PATH='"$(DWARF_DSYM_FOLDER_PATH)/$(DWARF_DSYM_FILE_NAME)/Contents/Resources/DWARF/$(EXECUTABLE_NAME)"';function buildDsymUploadShellScript(){var includeSource=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var skipOnConflict=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;return composeDsymUploadShellScript(includeSource,skipOnConflict,force);}function composeDsymUploadShellScript(includeSource,skipOnConflict,force){var lines=['# Upload iOS dSYMs to PostHog so native crashes can be symbolicated.','# upload-symbols.sh ships inside the posthog-ios dependency.'];if(includeSource){lines.push('# Also upload native source files for source-code context around crashes.','export POSTHOG_INCLUDE_SOURCE=1');}if(skipOnConflict){lines.push('# Skip dSYMs that already exist in PostHog with different content instead of failing the build.','export POSTHOG_SKIP_ON_CONFLICT=1');}if(force){lines.push('# Overwrite dSYMs that already exist in PostHog with different content instead of failing the build.','export POSTHOG_FORCE=1');}lines.push('PODS_SCRIPT="${PODS_ROOT}/PostHog/build-tools/upload-symbols.sh"','SPM_SCRIPT="${BUILD_DIR%/Build/*}/SourcePackages/checkouts/posthog-ios/build-tools/upload-symbols.sh"','if [ -f "$PODS_SCRIPT" ]; then',' /bin/sh "$PODS_SCRIPT"','elif [ -f "$SPM_SCRIPT" ]; then',' /bin/sh "$SPM_SCRIPT"','else',' echo "warning: PostHog upload-symbols.sh not found in Pods or SwiftPM checkouts; skipping dSYM upload."','fi');return lines.join('\n');}function legacyDsymReleaseModeLines(releaseMode){return[releaseMode?"POSTHOG_RESOLVED_RELEASE_MODE=\"".concat(releaseMode,"\""):'POSTHOG_RESOLVED_RELEASE_MODE="${POSTHOG_RELEASE_MODE:-}"','case "$POSTHOG_RESOLVED_RELEASE_MODE" in',' ""|symbol-set) ;;',' event)',' # Upload dSYMs without binding them to a release, so each crash resolves its own from the',' # app version and namespace the SDK sends. posthog-ios versions whose upload-symbols.sh',' # does not read this variable ignore it and keep binding the dSYMs.',' export POSTHOG_NO_RELEASE_BIND=1',' ;;',' *)'," echo \"error: posthog release mode must be 'symbol-set' or 'event', was '$POSTHOG_RESOLVED_RELEASE_MODE'\"",' exit 1',' ;;','esac'];}function buildLegacyReleaseModeDsymUploadShellScript(includeSource,skipOnConflict,releaseMode){var lines=composeDsymUploadShellScript(includeSource,skipOnConflict,false).split('\n');var uploadIndex=lines.findIndex(function(line){return line.startsWith('PODS_SCRIPT=');});lines.splice.apply(lines,[uploadIndex,0].concat((0,_toConsumableArray2["default"])(legacyDsymReleaseModeLines(releaseMode))));return lines.join('\n');}function encodePbxShellScript(script){return'"'+script.replace(/"/g,'\\"')+'"';}function decodePbxShellScript(stored){if(!stored.startsWith('"')||!stored.endsWith('"')){return stored;}return stored.slice(1,-1).replace(/\\(.)/g,function(_match,ch){return ch==='n'?'\n':ch==='t'?'\t':ch;});}function isPluginGeneratedDsymUploadBuildPhase(phase){if(typeof(phase===null||phase===void 0?void 0:phase.shellScript)!=='string'){return false;}var stored=decodePbxShellScript(phase.shellScript);return[false,true].some(function(source){return[false,true].some(function(skip){return[false,true].some(function(force){return stored===buildDsymUploadShellScript(source,skip,force);})||[undefined].concat(POSTHOG_RELEASE_MODES).some(function(mode){return stored===buildLegacyReleaseModeDsymUploadShellScript(source,skip,mode);});});});}function moveDsymUploadBuildPhaseToEnd(xcodeProject){var _a,_b;var existing=xcodeProject.pbxItemByComment(POSTHOG_DSYM_BUILD_PHASE_NAME,'PBXShellScriptBuildPhase');if(!isPluginGeneratedDsymUploadBuildPhase(existing)){return;}var buildPhases=(_b=(_a=xcodeProject.getFirstTarget)===null||_a===void 0?void 0:_a.call(xcodeProject).firstTarget)===null||_b===void 0?void 0:_b.buildPhases;if(Array.isArray(buildPhases)){var phaseIndex=buildPhases.findIndex(function(phase){return phase.comment===POSTHOG_DSYM_BUILD_PHASE_NAME;});if(phaseIndex!==-1&&phaseIndex!==buildPhases.length-1){buildPhases.push.apply(buildPhases,(0,_toConsumableArray2["default"])(buildPhases.splice(phaseIndex,1)));}}}function addDsymUploadBuildPhase(xcodeProject){var includeSource=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var skipOnConflict=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var force=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var existing=xcodeProject.pbxItemByComment(POSTHOG_DSYM_BUILD_PHASE_NAME,'PBXShellScriptBuildPhase');if(existing){if(isPluginGeneratedDsymUploadBuildPhase(existing)){existing.shellScript=encodePbxShellScript(buildDsymUploadShellScript(includeSource,skipOnConflict,force));existing.inputPaths=Array.from(new Set([].concat((0,_toConsumableArray2["default"])(Array.isArray(existing.inputPaths)?existing.inputPaths:[]),[POSTHOG_DSYM_INPUT_PATH])));}}else{xcodeProject.addBuildPhase([],'PBXShellScriptBuildPhase',POSTHOG_DSYM_BUILD_PHASE_NAME,null,{inputPaths:[POSTHOG_DSYM_INPUT_PATH],shellPath:'/bin/sh',shellScript:buildDsymUploadShellScript(includeSource,skipOnConflict,force)});}moveDsymUploadBuildPhaseToEnd(xcodeProject);}function disableUserScriptSandboxing(xcodeProject){var configurations=xcodeProject.pbxXCBuildConfigurationSection();for(var key in configurations){var configuration=configurations[key];if(configuration&&configuration.buildSettings){configuration.buildSettings.ENABLE_USER_SCRIPT_SANDBOXING='"NO"';}}}var POSTHOG_DOTENV_BUILD_SETTING='POSTHOG_CLI_DOTENV_FILE';var POSTHOG_DOTENV_GRADLE_PROPERTY='posthog.dotenvFile';function normalizeDotenvFileProp(dotenvFile){return dotenvFile.replace(/^\.\//,'');}function resolveDotenvFileProp(dotenvFile){var trimmed=dotenvFile===null||dotenvFile===void 0?void 0:dotenvFile.trim();return trimmed?trimmed:undefined;}function isAbsoluteDotenvPath(dotenvFile){return dotenvFile.startsWith('/')||/^[A-Za-z]:[\\/]/.test(dotenvFile);}function buildIosDotenvFileBuildSetting(dotenvFile){var value=isAbsoluteDotenvPath(dotenvFile)?dotenvFile:"$(SRCROOT)/../".concat(normalizeDotenvFileProp(dotenvFile));return'"'+value.replace(/(["\\])/g,'\\$1')+'"';}function applyDotenvFileBuildSetting(xcodeProject,dotenvFile){var configurations=xcodeProject.pbxXCBuildConfigurationSection();for(var key in configurations){var configuration=configurations[key];if(configuration&&configuration.buildSettings){if(dotenvFile){configuration.buildSettings[POSTHOG_DOTENV_BUILD_SETTING]=buildIosDotenvFileBuildSetting(dotenvFile);}else{delete configuration.buildSettings[POSTHOG_DOTENV_BUILD_SETTING];}}}}function buildAndroidDotenvFileGradleValue(dotenvFile){return isAbsoluteDotenvPath(dotenvFile)?dotenvFile:"../".concat(normalizeDotenvFileProp(dotenvFile));}function updateDotenvFileGradleProperties(properties,dotenvFile){var rest=properties.filter(function(item){return!(item.type==='property'&&item.key===POSTHOG_DOTENV_GRADLE_PROPERTY);});if(!dotenvFile){return rest;}rest.push({type:'property',key:POSTHOG_DOTENV_GRADLE_PROPERTY,value:buildAndroidDotenvFileGradleValue(dotenvFile)});return rest;}function updateHermesReleaseModeGradleProperties(properties,releaseMode){var rest=properties.filter(function(item){return!(item.type==='property'&&item.key===POSTHOG_HERMES_RELEASE_MODE_GRADLE_PROPERTY);});if(!releaseMode){return rest;}rest.push({type:'property',key:POSTHOG_HERMES_RELEASE_MODE_GRADLE_PROPERTY,value:releaseMode});return rest;}var withPostHogGradleProperties=function withPostHogGradleProperties(config,dotenvFile,releaseMode){return withGradleProperties(config,function(config){config.modResults=updateDotenvFileGradleProperties(config.modResults,dotenvFile);config.modResults=updateHermesReleaseModeGradleProperties(config.modResults,releaseMode);return config;});};function resolveNativeSymbolUpload(prop){if(prop===true){return{enabled:true,includeSource:false};}if(prop&&(0,_typeof2["default"])(prop)==='object'){return{enabled:true,includeSource:prop.includeSource===true};}return{enabled:false,includeSource:false};}var withFinalizedXcodeProject=function withFinalizedXcodeProject(config,_action2){return withBaseMod(config,{platform:'ios',mod:'xcodeproj',action:function action(config){return(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee4(){var _config$modRequest2,nextMod,modRequest,results;return _regenerator["default"].wrap(function(_context4){while(1)switch(_context4.prev=_context4.next){case 0:_config$modRequest2=config.modRequest,nextMod=_config$modRequest2.nextMod,modRequest=(0,_objectWithoutProperties2["default"])(_config$modRequest2,_excluded2);_context4.next=1;return nextMod(_objectSpread(_objectSpread({},config),{},{modRequest:modRequest}));case 1:results=_context4.sent;return _context4.abrupt("return",_action2(results));case 2:case"end":return _context4.stop();}},_callee4);}))();}});};var withIosPlugin=function withIosPlugin(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var nativeSymbols=resolveNativeSymbolUpload(props.uploadNativeSymbols);config=withXcodeProject(config,function(config){var xcodeProject=config.modResults;var bundleReactNativePhase=xcodeProject.pbxItemByComment('Bundle React Native code and images','PBXShellScriptBuildPhase');modifyExistingXcodeBuildScript(bundleReactNativePhase,props.skipOnConflict===true,props.releaseMode,props.force===true);if(nativeSymbols.enabled){addDsymUploadBuildPhase(xcodeProject,nativeSymbols.includeSource,props.skipOnConflict===true,props.force===true);}applyDotenvFileBuildSetting(xcodeProject,props.dotenvFile);if(props.disableSandboxing!==false){disableUserScriptSandboxing(xcodeProject);console.warn('[posthog-react-native] Setting ENABLE_USER_SCRIPT_SANDBOXING=NO on all Xcode '+'build configurations so sourcemap uploads can resolve git metadata. '+'If your org requires sandboxing to stay enabled, set `{ disableSandboxing: false }` '+'on the plugin in app.json — note that stock Expo projects may fail to build under '+'sandboxing until every script build phase declares its input/output files.');}return config;});if(nativeSymbols.enabled){config=withFinalizedXcodeProject(config,function(config){moveDsymUploadBuildPhaseToEnd(config.modResults);return config;});}return config;};var withPostHogPlugin=function withPostHogPlugin(config){var rawProps=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(rawProps.skipOnConflict===true&&rawProps.force===true){throw new Error('[posthog-react-native] skipOnConflict and force cannot both be enabled: posthog-cli accepts only one of --skip-on-conflict and --force');}var props=_objectSpread(_objectSpread({},rawProps),{},{dotenvFile:resolveDotenvFileProp(rawProps.dotenvFile),releaseMode:resolveReleaseModeProp(rawProps.releaseMode,process.env.POSTHOG_RELEASE_MODE)});var nativeSymbols=resolveNativeSymbolUpload(props.uploadNativeSymbols);config=nativeSymbols.enabled?withAndroidNativeSymbolsPlugin(config,nativeSymbols.includeSource):withoutAndroidNativeSymbolsExtension(config);config=withAndroidPlugin(config,props.skipOnConflict===true,props.force===true);config=withPostHogGradleProperties(config,props.dotenvFile,props.releaseMode);config=withMainActivityNewIntent(config,props.patchMainActivityNewIntent!==false);return withIosPlugin(config,props);};var postHogPlugin=function postHogPlugin(config){var props=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return withPostHogPlugin(config,props);};module.exports=postHogPlugin;module.exports.modifyExistingXcodeBuildScript=modifyExistingXcodeBuildScript;module.exports.addPostHogWithBundledScriptsToBundleShellScript=addPostHogWithBundledScriptsToBundleShellScript;module.exports.disableUserScriptSandboxing=disableUserScriptSandboxing;module.exports.buildDsymUploadShellScript=buildDsymUploadShellScript;module.exports.addDsymUploadBuildPhase=addDsymUploadBuildPhase;module.exports.moveDsymUploadBuildPhaseToEnd=moveDsymUploadBuildPhaseToEnd;module.exports.resolveNativeSymbolUpload=resolveNativeSymbolUpload;module.exports.buildAndroidSkipOnConflictGradleLine=buildAndroidSkipOnConflictGradleLine;module.exports.buildAndroidForceGradleLine=buildAndroidForceGradleLine;module.exports.addPostHogAndroidGradlePluginClasspath=addPostHogAndroidGradlePluginClasspath;module.exports.applyPostHogAndroidGradlePlugin=applyPostHogAndroidGradlePlugin;module.exports.setPostHogAndroidNativeSymbolsExtension=setPostHogAndroidNativeSymbolsExtension;module.exports.removePostHogAndroidNativeSymbolsExtension=removePostHogAndroidNativeSymbolsExtension;module.exports.buildIosDotenvFileBuildSetting=buildIosDotenvFileBuildSetting;module.exports.applyDotenvFileBuildSetting=applyDotenvFileBuildSetting;module.exports.resolveDotenvFileProp=resolveDotenvFileProp;module.exports.buildAndroidDotenvFileGradleValue=buildAndroidDotenvFileGradleValue;module.exports.updateDotenvFileGradleProperties=updateDotenvFileGradleProperties;module.exports.POSTHOG_RELEASE_MODES=POSTHOG_RELEASE_MODES;module.exports.resolveReleaseModeProp=resolveReleaseModeProp;module.exports.updateHermesReleaseModeGradleProperties=updateHermesReleaseModeGradleProperties;module.exports.updateMainActivityNewIntentOverride=updateMainActivityNewIntentOverride;
|
|
2
2
|
//# sourceMappingURL=expoconfig.js.map
|