posthog-react-native 3.15.0 → 3.15.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.
Files changed (149) hide show
  1. package/lib/posthog-core/src/eventemitter.d.ts +8 -8
  2. package/lib/posthog-core/src/eventemitter.js +1 -0
  3. package/lib/posthog-core/src/eventemitter.js.map +1 -0
  4. package/lib/posthog-core/src/featureFlagUtils.d.ts +34 -34
  5. package/lib/posthog-core/src/featureFlagUtils.js +1 -0
  6. package/lib/posthog-core/src/featureFlagUtils.js.map +1 -0
  7. package/lib/posthog-core/src/index.d.ts +242 -239
  8. package/lib/posthog-core/src/index.js +1 -0
  9. package/lib/posthog-core/src/index.js.map +1 -0
  10. package/lib/posthog-core/src/lz-string.d.ts +8 -8
  11. package/lib/posthog-core/src/lz-string.js +1 -0
  12. package/lib/posthog-core/src/lz-string.js.map +1 -0
  13. package/lib/posthog-core/src/types.d.ts +422 -423
  14. package/lib/posthog-core/src/types.js +1 -0
  15. package/lib/posthog-core/src/types.js.map +1 -0
  16. package/lib/posthog-core/src/utils.d.ts +19 -19
  17. package/lib/posthog-core/src/utils.js +1 -0
  18. package/lib/posthog-core/src/utils.js.map +1 -0
  19. package/lib/posthog-core/src/vendor/uuidv7.d.ts +179 -179
  20. package/lib/posthog-core/src/vendor/uuidv7.js +7 -0
  21. package/lib/posthog-core/src/vendor/uuidv7.js.map +1 -0
  22. package/lib/posthog-react-native/index.d.ts +10 -10
  23. package/lib/posthog-react-native/index.js +1 -0
  24. package/lib/posthog-react-native/index.js.map +1 -0
  25. package/lib/posthog-react-native/src/PostHogContext.d.ts +5 -5
  26. package/lib/posthog-react-native/src/PostHogContext.js +1 -0
  27. package/lib/posthog-react-native/src/PostHogContext.js.map +1 -0
  28. package/lib/posthog-react-native/src/PostHogProvider.d.ts +14 -14
  29. package/lib/posthog-react-native/src/PostHogProvider.js +1 -0
  30. package/lib/posthog-react-native/src/PostHogProvider.js.map +1 -0
  31. package/lib/posthog-react-native/src/autocapture.d.ts +4 -4
  32. package/lib/posthog-react-native/src/autocapture.js +1 -0
  33. package/lib/posthog-react-native/src/autocapture.js.map +1 -0
  34. package/lib/posthog-react-native/src/frameworks/wix-navigation.d.ts +3 -3
  35. package/lib/posthog-react-native/src/frameworks/wix-navigation.js +1 -0
  36. package/lib/posthog-react-native/src/frameworks/wix-navigation.js.map +1 -0
  37. package/lib/posthog-react-native/src/hooks/useFeatureFlag.d.ts +5 -5
  38. package/lib/posthog-react-native/src/hooks/useFeatureFlag.js +1 -0
  39. package/lib/posthog-react-native/src/hooks/useFeatureFlag.js.map +1 -0
  40. package/lib/posthog-react-native/src/hooks/useFeatureFlags.d.ts +3 -3
  41. package/lib/posthog-react-native/src/hooks/useFeatureFlags.js +1 -0
  42. package/lib/posthog-react-native/src/hooks/useFeatureFlags.js.map +1 -0
  43. package/lib/posthog-react-native/src/hooks/useNavigationTracker.d.ts +6 -6
  44. package/lib/posthog-react-native/src/hooks/useNavigationTracker.js +1 -0
  45. package/lib/posthog-react-native/src/hooks/useNavigationTracker.js.map +1 -0
  46. package/lib/posthog-react-native/src/hooks/usePostHog.d.ts +2 -2
  47. package/lib/posthog-react-native/src/hooks/usePostHog.js +1 -0
  48. package/lib/posthog-react-native/src/hooks/usePostHog.js.map +1 -0
  49. package/lib/posthog-react-native/src/legacy.d.ts +4 -4
  50. package/lib/posthog-react-native/src/legacy.js +1 -0
  51. package/lib/posthog-react-native/src/legacy.js.map +1 -0
  52. package/lib/posthog-react-native/src/native-deps.d.ts +4 -4
  53. package/lib/posthog-react-native/src/native-deps.js +1 -0
  54. package/lib/posthog-react-native/src/native-deps.js.map +1 -0
  55. package/lib/posthog-react-native/src/optional/OptionalAsyncStorage.d.ts +2 -2
  56. package/lib/posthog-react-native/src/optional/OptionalAsyncStorage.js +1 -0
  57. package/lib/posthog-react-native/src/optional/OptionalAsyncStorage.js.map +1 -0
  58. package/lib/posthog-react-native/src/optional/OptionalExpoApplication.d.ts +2 -2
  59. package/lib/posthog-react-native/src/optional/OptionalExpoApplication.js +1 -0
  60. package/lib/posthog-react-native/src/optional/OptionalExpoApplication.js.map +1 -0
  61. package/lib/posthog-react-native/src/optional/OptionalExpoDevice.d.ts +2 -2
  62. package/lib/posthog-react-native/src/optional/OptionalExpoDevice.js +1 -0
  63. package/lib/posthog-react-native/src/optional/OptionalExpoDevice.js.map +1 -0
  64. package/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.d.ts +2 -2
  65. package/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.js +1 -0
  66. package/lib/posthog-react-native/src/optional/OptionalExpoFileSystem.js.map +1 -0
  67. package/lib/posthog-react-native/src/optional/OptionalExpoLocalization.d.ts +2 -2
  68. package/lib/posthog-react-native/src/optional/OptionalExpoLocalization.js +1 -0
  69. package/lib/posthog-react-native/src/optional/OptionalExpoLocalization.js.map +1 -0
  70. package/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.d.ts +2 -2
  71. package/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.js +1 -0
  72. package/lib/posthog-react-native/src/optional/OptionalReactNativeDeviceInfo.js.map +1 -0
  73. package/lib/posthog-react-native/src/optional/OptionalReactNativeLocalize.d.ts +13 -13
  74. package/lib/posthog-react-native/src/optional/OptionalReactNativeLocalize.js +1 -0
  75. package/lib/posthog-react-native/src/optional/OptionalReactNativeLocalize.js.map +1 -0
  76. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.d.ts +2 -2
  77. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.js +1 -0
  78. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigation.js.map +1 -0
  79. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.d.ts +2 -2
  80. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.js +1 -0
  81. package/lib/posthog-react-native/src/optional/OptionalReactNativeNavigationWix.js.map +1 -0
  82. package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.d.ts +2 -2
  83. package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.js +1 -0
  84. package/lib/posthog-react-native/src/optional/OptionalReactNativeSafeArea.js.map +1 -0
  85. package/lib/posthog-react-native/src/optional/OptionalSessionReplay.d.ts +2 -2
  86. package/lib/posthog-react-native/src/optional/OptionalSessionReplay.js +1 -0
  87. package/lib/posthog-react-native/src/optional/OptionalSessionReplay.js.map +1 -0
  88. package/lib/posthog-react-native/src/posthog-rn.d.ts +71 -71
  89. package/lib/posthog-react-native/src/posthog-rn.js +1 -0
  90. package/lib/posthog-react-native/src/posthog-rn.js.map +1 -0
  91. package/lib/posthog-react-native/src/storage.d.ts +21 -21
  92. package/lib/posthog-react-native/src/storage.js +1 -0
  93. package/lib/posthog-react-native/src/storage.js.map +1 -0
  94. package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.d.ts +16 -16
  95. package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.js +1 -0
  96. package/lib/posthog-react-native/src/surveys/PostHogSurveyProvider.js.map +1 -0
  97. package/lib/posthog-react-native/src/surveys/components/BottomSection.d.ts +9 -9
  98. package/lib/posthog-react-native/src/surveys/components/BottomSection.js +1 -0
  99. package/lib/posthog-react-native/src/surveys/components/BottomSection.js.map +1 -0
  100. package/lib/posthog-react-native/src/surveys/components/Cancel.d.ts +6 -6
  101. package/lib/posthog-react-native/src/surveys/components/Cancel.js +1 -0
  102. package/lib/posthog-react-native/src/surveys/components/Cancel.js.map +1 -0
  103. package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.d.ts +13 -13
  104. package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.js +1 -0
  105. package/lib/posthog-react-native/src/surveys/components/ConfirmationMessage.js.map +1 -0
  106. package/lib/posthog-react-native/src/surveys/components/QuestionHeader.d.ts +7 -7
  107. package/lib/posthog-react-native/src/surveys/components/QuestionHeader.js +1 -0
  108. package/lib/posthog-react-native/src/surveys/components/QuestionHeader.js.map +1 -0
  109. package/lib/posthog-react-native/src/surveys/components/QuestionTypes.d.ts +27 -27
  110. package/lib/posthog-react-native/src/surveys/components/QuestionTypes.js +1 -0
  111. package/lib/posthog-react-native/src/surveys/components/QuestionTypes.js.map +1 -0
  112. package/lib/posthog-react-native/src/surveys/components/SurveyModal.d.ts +10 -10
  113. package/lib/posthog-react-native/src/surveys/components/SurveyModal.js +1 -0
  114. package/lib/posthog-react-native/src/surveys/components/SurveyModal.js.map +1 -0
  115. package/lib/posthog-react-native/src/surveys/components/Surveys.d.ts +14 -14
  116. package/lib/posthog-react-native/src/surveys/components/Surveys.js +1 -0
  117. package/lib/posthog-react-native/src/surveys/components/Surveys.js.map +1 -0
  118. package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.d.ts +2 -2
  119. package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.js +1 -0
  120. package/lib/posthog-react-native/src/surveys/getActiveMatchingSurveys.js.map +1 -0
  121. package/lib/posthog-react-native/src/surveys/icons.d.ts +8 -10
  122. package/lib/posthog-react-native/src/surveys/icons.js +1 -0
  123. package/lib/posthog-react-native/src/surveys/icons.js.map +1 -0
  124. package/lib/posthog-react-native/src/surveys/index.d.ts +6 -6
  125. package/lib/posthog-react-native/src/surveys/index.js +1 -0
  126. package/lib/posthog-react-native/src/surveys/index.js.map +1 -0
  127. package/lib/posthog-react-native/src/surveys/surveys-utils.d.ts +13 -13
  128. package/lib/posthog-react-native/src/surveys/surveys-utils.js +1 -0
  129. package/lib/posthog-react-native/src/surveys/surveys-utils.js.map +1 -0
  130. package/lib/posthog-react-native/src/surveys/useActivatedSurveys.d.ts +3 -3
  131. package/lib/posthog-react-native/src/surveys/useActivatedSurveys.js +1 -0
  132. package/lib/posthog-react-native/src/surveys/useActivatedSurveys.js.map +1 -0
  133. package/lib/posthog-react-native/src/surveys/useSurveyStorage.d.ts +8 -8
  134. package/lib/posthog-react-native/src/surveys/useSurveyStorage.js +1 -0
  135. package/lib/posthog-react-native/src/surveys/useSurveyStorage.js.map +1 -0
  136. package/lib/posthog-react-native/src/types.d.ts +112 -112
  137. package/lib/posthog-react-native/src/types.js +1 -0
  138. package/lib/posthog-react-native/src/types.js.map +1 -0
  139. package/lib/posthog-react-native/src/version.d.ts +1 -1
  140. package/lib/posthog-react-native/src/version.js +1 -0
  141. package/lib/posthog-react-native/src/version.js.map +1 -0
  142. package/lib/posthog-react-native/tsconfig.tsbuildinfo +1 -0
  143. package/package.json +8 -9
  144. package/lib/index.cjs.js +0 -4677
  145. package/lib/index.cjs.js.map +0 -1
  146. package/lib/index.d.ts +0 -875
  147. package/lib/index.esm.js +0 -4659
  148. package/lib/index.esm.js.map +0 -1
  149. package/lib/posthog-react-native/test/test-utils.d.ts +0 -2
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.SurveyWidgetType=exports.SurveyType=exports.SurveyRatingDisplay=exports.SurveyQuestionType=exports.SurveyQuestionDescriptionContentType=exports.SurveyQuestionBranchingType=exports.SurveyPosition=exports.SurveyMatchType=exports.PostHogPersistedProperty=exports.ActionStepStringMatching=void 0;var PostHogPersistedProperty;(function(PostHogPersistedProperty){PostHogPersistedProperty["AnonymousId"]="anonymous_id";PostHogPersistedProperty["DistinctId"]="distinct_id";PostHogPersistedProperty["Props"]="props";PostHogPersistedProperty["FeatureFlagDetails"]="feature_flag_details";PostHogPersistedProperty["FeatureFlags"]="feature_flags";PostHogPersistedProperty["FeatureFlagPayloads"]="feature_flag_payloads";PostHogPersistedProperty["BootstrapFeatureFlagDetails"]="bootstrap_feature_flag_details";PostHogPersistedProperty["BootstrapFeatureFlags"]="bootstrap_feature_flags";PostHogPersistedProperty["BootstrapFeatureFlagPayloads"]="bootstrap_feature_flag_payloads";PostHogPersistedProperty["OverrideFeatureFlags"]="override_feature_flags";PostHogPersistedProperty["Queue"]="queue";PostHogPersistedProperty["OptedOut"]="opted_out";PostHogPersistedProperty["SessionId"]="session_id";PostHogPersistedProperty["SessionLastTimestamp"]="session_timestamp";PostHogPersistedProperty["PersonProperties"]="person_properties";PostHogPersistedProperty["GroupProperties"]="group_properties";PostHogPersistedProperty["InstalledAppBuild"]="installed_app_build";PostHogPersistedProperty["InstalledAppVersion"]="installed_app_version";PostHogPersistedProperty["SessionReplay"]="session_replay";PostHogPersistedProperty["DecideEndpointWasHit"]="decide_endpoint_was_hit";PostHogPersistedProperty["SurveyLastSeenDate"]="survey_last_seen_date";PostHogPersistedProperty["SurveysSeen"]="surveys_seen";PostHogPersistedProperty["Surveys"]="surveys";PostHogPersistedProperty["RemoteConfig"]="remote_config";})(PostHogPersistedProperty||(exports.PostHogPersistedProperty=PostHogPersistedProperty={}));var SurveyPosition;(function(SurveyPosition){SurveyPosition["Left"]="left";SurveyPosition["Right"]="right";SurveyPosition["Center"]="center";})(SurveyPosition||(exports.SurveyPosition=SurveyPosition={}));var SurveyWidgetType;(function(SurveyWidgetType){SurveyWidgetType["Button"]="button";SurveyWidgetType["Tab"]="tab";SurveyWidgetType["Selector"]="selector";})(SurveyWidgetType||(exports.SurveyWidgetType=SurveyWidgetType={}));var SurveyType;(function(SurveyType){SurveyType["Popover"]="popover";SurveyType["API"]="api";SurveyType["Widget"]="widget";})(SurveyType||(exports.SurveyType=SurveyType={}));var SurveyQuestionDescriptionContentType;(function(SurveyQuestionDescriptionContentType){SurveyQuestionDescriptionContentType["Html"]="html";SurveyQuestionDescriptionContentType["Text"]="text";})(SurveyQuestionDescriptionContentType||(exports.SurveyQuestionDescriptionContentType=SurveyQuestionDescriptionContentType={}));var SurveyRatingDisplay;(function(SurveyRatingDisplay){SurveyRatingDisplay["Number"]="number";SurveyRatingDisplay["Emoji"]="emoji";})(SurveyRatingDisplay||(exports.SurveyRatingDisplay=SurveyRatingDisplay={}));var SurveyQuestionType;(function(SurveyQuestionType){SurveyQuestionType["Open"]="open";SurveyQuestionType["MultipleChoice"]="multiple_choice";SurveyQuestionType["SingleChoice"]="single_choice";SurveyQuestionType["Rating"]="rating";SurveyQuestionType["Link"]="link";})(SurveyQuestionType||(exports.SurveyQuestionType=SurveyQuestionType={}));var SurveyQuestionBranchingType;(function(SurveyQuestionBranchingType){SurveyQuestionBranchingType["NextQuestion"]="next_question";SurveyQuestionBranchingType["End"]="end";SurveyQuestionBranchingType["ResponseBased"]="response_based";SurveyQuestionBranchingType["SpecificQuestion"]="specific_question";})(SurveyQuestionBranchingType||(exports.SurveyQuestionBranchingType=SurveyQuestionBranchingType={}));var SurveyMatchType;(function(SurveyMatchType){SurveyMatchType["Regex"]="regex";SurveyMatchType["NotRegex"]="not_regex";SurveyMatchType["Exact"]="exact";SurveyMatchType["IsNot"]="is_not";SurveyMatchType["Icontains"]="icontains";SurveyMatchType["NotIcontains"]="not_icontains";})(SurveyMatchType||(exports.SurveyMatchType=SurveyMatchType={}));var ActionStepStringMatching;(function(ActionStepStringMatching){ActionStepStringMatching["Contains"]="contains";ActionStepStringMatching["Exact"]="exact";ActionStepStringMatching["Regex"]="regex";})(ActionStepStringMatching||(exports.ActionStepStringMatching=ActionStepStringMatching={}));
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../posthog-core/src/types.ts"],"names":[],"mappings":"AA2DA,MAAM,CAAN,IAAY,wBAyBX;AAzBD,WAAY,wBAAwB;IAClC,wDAA4B,CAAA;IAC5B,sDAA0B,CAAA;IAC1B,2CAAe,CAAA;IACf,uEAA2C,CAAA;IAC3C,0DAA8B,CAAA;IAC9B,yEAA6C,CAAA;IAC7C,0FAA8D,CAAA;IAC9D,6EAAiD,CAAA;IACjD,4FAAgE,CAAA;IAChE,2EAA+C,CAAA;IAC/C,2CAAe,CAAA;IACf,kDAAsB,CAAA;IACtB,oDAAwB,CAAA;IACxB,sEAA0C,CAAA;IAC1C,kEAAsC,CAAA;IACtC,gEAAoC,CAAA;IACpC,qEAAyC,CAAA;IACzC,yEAA6C,CAAA;IAC7C,4DAAgC,CAAA;IAChC,4EAAgD,CAAA;IAChD,wEAA4C,CAAA;IAC5C,wD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CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,yCAAsB,CAAA;IACtB,kCAAe,CAAA;IACf,mCAAgB,CAAA;IAChB,0CAAuB,CAAA;IACvB,iDAA8B,CAAA;AAChC,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AAkED,2CAA2C;AAC3C,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,iDAAqB,CAAA;IACrB,2CAAe,CAAA;IACf,2CAAe,CAAA;AACjB,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC"}
@@ -1,19 +1,19 @@
1
- import { FetchLike } from './types';
2
- export declare const NEW_FLAGS_ROLLOUT_PERCENTAGE = 1;
3
- export declare const NEW_FLAGS_EXCLUDED_HASHES: Set<string>;
4
- export declare function assert(truthyValue: any, message: string): void;
5
- export declare function removeTrailingSlash(url: string): string;
6
- export interface RetriableOptions {
7
- retryCount: number;
8
- retryDelay: number;
9
- retryCheck: (err: any) => boolean;
10
- }
11
- export declare function retriable<T>(fn: () => Promise<T>, props: RetriableOptions): Promise<T>;
12
- export declare function currentTimestamp(): number;
13
- export declare function currentISOTime(): string;
14
- export declare function safeSetTimeout(fn: () => void, timeout: number): any;
15
- export declare const isPromise: (obj: any) => obj is Promise<any>;
16
- export declare const isError: (x: unknown) => x is Error;
17
- export declare function getFetch(): FetchLike | undefined;
18
- export declare const isFunction: (f: any) => f is (...args: any[]) => any;
19
- export declare function isTokenInRollout(token: string, percentage?: number, excludedHashes?: Set<string>): boolean;
1
+ import { FetchLike } from './types';
2
+ export declare const NEW_FLAGS_ROLLOUT_PERCENTAGE = 1;
3
+ export declare const NEW_FLAGS_EXCLUDED_HASHES: Set<string>;
4
+ export declare function assert(truthyValue: any, message: string): void;
5
+ export declare function removeTrailingSlash(url: string): string;
6
+ export interface RetriableOptions {
7
+ retryCount: number;
8
+ retryDelay: number;
9
+ retryCheck: (err: any) => boolean;
10
+ }
11
+ export declare function retriable<T>(fn: () => Promise<T>, props: RetriableOptions): Promise<T>;
12
+ export declare function currentTimestamp(): number;
13
+ export declare function currentISOTime(): string;
14
+ export declare function safeSetTimeout(fn: () => void, timeout: number): any;
15
+ export declare const isPromise: (obj: any) => obj is Promise<any>;
16
+ export declare const isError: (x: unknown) => x is Error;
17
+ export declare function getFetch(): FetchLike | undefined;
18
+ export declare const isFunction: (f: any) => f is (...args: any[]) => any;
19
+ export declare function isTokenInRollout(token: string, percentage?: number, excludedHashes?: Set<string>): boolean;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.NEW_FLAGS_ROLLOUT_PERCENTAGE=exports.NEW_FLAGS_EXCLUDED_HASHES=void 0;exports.assert=assert;exports.currentISOTime=currentISOTime;exports.currentTimestamp=currentTimestamp;exports.getFetch=getFetch;exports.isPromise=exports.isFunction=exports.isError=void 0;exports.isTokenInRollout=isTokenInRollout;exports.removeTrailingSlash=removeTrailingSlash;exports.retriable=retriable;exports.safeSetTimeout=safeSetTimeout;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _asyncToGenerator2=_interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));var NEW_FLAGS_ROLLOUT_PERCENTAGE=exports.NEW_FLAGS_ROLLOUT_PERCENTAGE=1;var NEW_FLAGS_EXCLUDED_HASHES=exports.NEW_FLAGS_EXCLUDED_HASHES=new Set(['61be3dd8','96f6df5f','8cfdba9b','bf027177','e59430a8','7fa5500b','569798e9','04809ff7','0ebc61a5','32de7f98','3beeb69a','12d34ad9','733853ec','0645bb64','5dcbee21','b1f95fa3','2189e408','82b460c2','3a8cc979','29ef8843','2cdbf767','38084b54','50f9f8de','41d0df91','5c236689','c11aedd3','ada46672','f4331ee1','42fed62a','c957462c','d62f705a','e0162666','01b3e5cf','441cef7f','bb9cafee','8f348eb0','b2553f3a','97469d7d','39f21a76','03706dcc','27d50569','307584a7','6433e92e','150c7fbb','49f57f22','3772f65b','01eb8256','3c9e9234','f853c7f7','c0ac4b67','cd609d40','10ca9b1a','8a87f11b','8e8e5216','1f6b63b3','db7943dd','79b7164c','07f78e33','2d21b6fd','952db5ee','a7d3b43f','1924dd9c','84e1b8f6','dff631b6','c5aa8a79','fa133a95','498a4508','24748755','98f3d658','21bbda67','7dbfed69','be3ec24c','fc80b8e2','75cc0998']);function assert(truthyValue,message){if(!truthyValue||typeof truthyValue!=='string'||isEmpty(truthyValue)){throw new Error(message);}}function isEmpty(truthyValue){if(truthyValue.trim().length===0){return true;}return false;}function removeTrailingSlash(url){return url===null||url===void 0?void 0:url.replace(/\/+$/,'');}function retriable(_x,_x2){return _retriable.apply(this,arguments);}function _retriable(){_retriable=(0,_asyncToGenerator2["default"])(_regenerator["default"].mark(function _callee(fn,props){var lastError,i,res;return _regenerator["default"].wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:lastError=null;i=0;case 2:if(!(i<props.retryCount+1)){_context.next=21;break;}if(!(i>0)){_context.next=6;break;}_context.next=6;return new Promise(function(r){return setTimeout(r,props.retryDelay);});case 6:_context.prev=6;_context.next=9;return fn();case 9:res=_context.sent;return _context.abrupt("return",res);case 13:_context.prev=13;_context.t0=_context["catch"](6);lastError=_context.t0;if(props.retryCheck(_context.t0)){_context.next=18;break;}throw _context.t0;case 18:i++;_context.next=2;break;case 21:throw lastError;case 22:case"end":return _context.stop();}},_callee,null,[[6,13]]);}));return _retriable.apply(this,arguments);}function currentTimestamp(){return new Date().getTime();}function currentISOTime(){return new Date().toISOString();}function safeSetTimeout(fn,timeout){var t=setTimeout(fn,timeout);(t===null||t===void 0?void 0:t.unref)&&(t===null||t===void 0?void 0:t.unref());return t;}var isPromise=exports.isPromise=function isPromise(obj){return obj&&typeof obj.then==='function';};var isError=exports.isError=function isError(x){return x instanceof Error;};function getFetch(){return typeof fetch!=='undefined'?fetch:typeof globalThis.fetch!=='undefined'?globalThis.fetch:undefined;}var isFunction=exports.isFunction=function isFunction(f){return typeof f==='function';};function fnv1a(str){var hash=0x811c9dc5;for(var i=0;i<str.length;i++){hash^=str.charCodeAt(i);hash+=(hash<<1)+(hash<<4)+(hash<<7)+(hash<<8)+(hash<<24);}return(hash>>>0).toString(16).padStart(8,'0');}function isTokenInRollout(token){var percentage=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var excludedHashes=arguments.length>2?arguments[2]:undefined;var tokenHash=fnv1a(token);if(excludedHashes===null||excludedHashes===void 0?void 0:excludedHashes.has(tokenHash)){return false;}var hashInt=parseInt(tokenHash,16);var hashFloat=hashInt/0xffffffff;return hashFloat<percentage;}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../posthog-core/src/utils.ts"],"names":[],"mappings":"AAEA,oBAAoB;AACpB,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAA;AAC7C,+EAA+E;AAC/E,yFAAyF;AACzF,iFAAiF;AACjF,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAC;IAC/C,OAAO;IACP,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,eAAe;IACf,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,wDAAwD;IACxD,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,UAAU;IACV,U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
- export declare class UUID {
3
- readonly bytes: Readonly<Uint8Array>;
4
- /** @param bytes - The 16-byte byte array representation. */
5
- private constructor();
6
- /**
7
- * Creates an object from the internal representation, a 16-byte byte array
8
- * containing the binary UUID representation in the big-endian byte order.
9
- *
10
- * This method does NOT shallow-copy the argument, and thus the created object
11
- * holds the reference to the underlying buffer.
12
- *
13
- * @throws TypeError if the length of the argument is not 16.
14
- */
15
- static ofInner(bytes: Readonly<Uint8Array>): UUID;
16
- /**
17
- * Builds a byte array from UUIDv7 field values.
18
- *
19
- * @param unixTsMs - A 48-bit `unix_ts_ms` field value.
20
- * @param randA - A 12-bit `rand_a` field value.
21
- * @param randBHi - The higher 30 bits of 62-bit `rand_b` field value.
22
- * @param randBLo - The lower 32 bits of 62-bit `rand_b` field value.
23
- * @throws RangeError if any field value is out of the specified range.
24
- */
25
- static fromFieldsV7(unixTsMs: number, randA: number, randBHi: number, randBLo: number): UUID;
26
- /**
27
- * Builds a byte array from a string representation.
28
- *
29
- * This method accepts the following formats:
30
- *
31
- * - 32-digit hexadecimal format without hyphens: `0189dcd553117d408db09496a2eef37b`
32
- * - 8-4-4-4-12 hyphenated format: `0189dcd5-5311-7d40-8db0-9496a2eef37b`
33
- * - Hyphenated format with surrounding braces: `{0189dcd5-5311-7d40-8db0-9496a2eef37b}`
34
- * - RFC 4122 URN format: `urn:uuid:0189dcd5-5311-7d40-8db0-9496a2eef37b`
35
- *
36
- * Leading and trailing whitespaces represents an error.
37
- *
38
- * @throws SyntaxError if the argument could not parse as a valid UUID string.
39
- */
40
- static parse(uuid: string): UUID;
41
- /**
42
- * @returns The 8-4-4-4-12 canonical hexadecimal string representation
43
- * (`0189dcd5-5311-7d40-8db0-9496a2eef37b`).
44
- */
45
- toString(): string;
46
- /**
47
- * @returns The 32-digit hexadecimal representation without hyphens
48
- * (`0189dcd553117d408db09496a2eef37b`).
49
- */
50
- toHex(): string;
51
- /** @returns The 8-4-4-4-12 canonical hexadecimal string representation. */
52
- toJSON(): string;
53
- /**
54
- * Reports the variant field value of the UUID or, if appropriate, "NIL" or
55
- * "MAX".
56
- *
57
- * For convenience, this method reports "NIL" or "MAX" if `this` represents
58
- * the Nil or Max UUID, although the Nil and Max UUIDs are technically
59
- * subsumed under the variants `0b0` and `0b111`, respectively.
60
- */
61
- getVariant(): "VAR_0" | "VAR_10" | "VAR_110" | "VAR_RESERVED" | "NIL" | "MAX";
62
- /**
63
- * Returns the version field value of the UUID or `undefined` if the UUID does
64
- * not have the variant field value of `0b10`.
65
- */
66
- getVersion(): number | undefined;
67
- /** Creates an object from `this`. */
68
- clone(): UUID;
69
- /** Returns true if `this` is equivalent to `other`. */
70
- equals(other: UUID): boolean;
71
- /**
72
- * Returns a negative integer, zero, or positive integer if `this` is less
73
- * than, equal to, or greater than `other`, respectively.
74
- */
75
- compareTo(other: UUID): number;
76
- }
77
- /**
78
- * Encapsulates the monotonic counter state.
79
- *
80
- * This class provides APIs to utilize a separate counter state from that of the
81
- * global generator used by {@link uuidv7} and {@link uuidv7obj}. In addition to
82
- * the default {@link generate} method, this class has {@link generateOrAbort}
83
- * that is useful to absolutely guarantee the monotonically increasing order of
84
- * generated UUIDs. See their respective documentation for details.
85
- */
86
- export declare class V7Generator {
87
- private timestamp;
88
- private counter;
89
- /** The random number generator used by the generator. */
90
- private readonly random;
91
- /**
92
- * Creates a generator object with the default random number generator, or
93
- * with the specified one if passed as an argument. The specified random
94
- * number generator should be cryptographically strong and securely seeded.
95
- */
96
- constructor(randomNumberGenerator?: {
97
- /** Returns a 32-bit random unsigned integer. */
98
- nextUint32(): number;
99
- });
100
- /**
101
- * Generates a new UUIDv7 object from the current timestamp, or resets the
102
- * generator upon significant timestamp rollback.
103
- *
104
- * This method returns a monotonically increasing UUID by reusing the previous
105
- * timestamp even if the up-to-date timestamp is smaller than the immediately
106
- * preceding UUID's. However, when such a clock rollback is considered
107
- * significant (i.e., by more than ten seconds), this method resets the
108
- * generator and returns a new UUID based on the given timestamp, breaking the
109
- * increasing order of UUIDs.
110
- *
111
- * See {@link generateOrAbort} for the other mode of generation and
112
- * {@link generateOrResetCore} for the low-level primitive.
113
- */
114
- generate(): UUID;
115
- /**
116
- * Generates a new UUIDv7 object from the current timestamp, or returns
117
- * `undefined` upon significant timestamp rollback.
118
- *
119
- * This method returns a monotonically increasing UUID by reusing the previous
120
- * timestamp even if the up-to-date timestamp is smaller than the immediately
121
- * preceding UUID's. However, when such a clock rollback is considered
122
- * significant (i.e., by more than ten seconds), this method aborts and
123
- * returns `undefined` immediately.
124
- *
125
- * See {@link generate} for the other mode of generation and
126
- * {@link generateOrAbortCore} for the low-level primitive.
127
- */
128
- generateOrAbort(): UUID | undefined;
129
- /**
130
- * Generates a new UUIDv7 object from the `unixTsMs` passed, or resets the
131
- * generator upon significant timestamp rollback.
132
- *
133
- * This method is equivalent to {@link generate} except that it takes a custom
134
- * timestamp and clock rollback allowance.
135
- *
136
- * @param rollbackAllowance - The amount of `unixTsMs` rollback that is
137
- * considered significant. A suggested value is `10_000` (milliseconds).
138
- * @throws RangeError if `unixTsMs` is not a 48-bit positive integer.
139
- */
140
- generateOrResetCore(unixTsMs: number, rollbackAllowance: number): UUID;
141
- /**
142
- * Generates a new UUIDv7 object from the `unixTsMs` passed, or returns
143
- * `undefined` upon significant timestamp rollback.
144
- *
145
- * This method is equivalent to {@link generateOrAbort} except that it takes a
146
- * custom timestamp and clock rollback allowance.
147
- *
148
- * @param rollbackAllowance - The amount of `unixTsMs` rollback that is
149
- * considered significant. A suggested value is `10_000` (milliseconds).
150
- * @throws RangeError if `unixTsMs` is not a 48-bit positive integer.
151
- */
152
- generateOrAbortCore(unixTsMs: number, rollbackAllowance: number): UUID | undefined;
153
- /** Initializes the counter at a 42-bit random integer. */
154
- private resetCounter;
155
- /**
156
- * Generates a new UUIDv4 object utilizing the random number generator inside.
157
- *
158
- * @internal
159
- */
160
- generateV4(): UUID;
161
- }
162
- /**
163
- * Generates a UUIDv7 string.
164
- *
165
- * @returns The 8-4-4-4-12 canonical hexadecimal string representation
166
- * ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
167
- */
168
- export declare const uuidv7: () => string;
169
- /** Generates a UUIDv7 object. */
170
- export declare const uuidv7obj: () => UUID;
171
- /**
172
- * Generates a UUIDv4 string.
173
- *
174
- * @returns The 8-4-4-4-12 canonical hexadecimal string representation
175
- * ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
176
- */
177
- export declare const uuidv4: () => string;
178
- /** Generates a UUIDv4 object. */
179
- export declare const uuidv4obj: () => UUID;
1
+ /** Represents a UUID as a 16-byte byte array. */
2
+ export declare class UUID {
3
+ readonly bytes: Readonly<Uint8Array>;
4
+ /** @param bytes - The 16-byte byte array representation. */
5
+ private constructor();
6
+ /**
7
+ * Creates an object from the internal representation, a 16-byte byte array
8
+ * containing the binary UUID representation in the big-endian byte order.
9
+ *
10
+ * This method does NOT shallow-copy the argument, and thus the created object
11
+ * holds the reference to the underlying buffer.
12
+ *
13
+ * @throws TypeError if the length of the argument is not 16.
14
+ */
15
+ static ofInner(bytes: Readonly<Uint8Array>): UUID;
16
+ /**
17
+ * Builds a byte array from UUIDv7 field values.
18
+ *
19
+ * @param unixTsMs - A 48-bit `unix_ts_ms` field value.
20
+ * @param randA - A 12-bit `rand_a` field value.
21
+ * @param randBHi - The higher 30 bits of 62-bit `rand_b` field value.
22
+ * @param randBLo - The lower 32 bits of 62-bit `rand_b` field value.
23
+ * @throws RangeError if any field value is out of the specified range.
24
+ */
25
+ static fromFieldsV7(unixTsMs: number, randA: number, randBHi: number, randBLo: number): UUID;
26
+ /**
27
+ * Builds a byte array from a string representation.
28
+ *
29
+ * This method accepts the following formats:
30
+ *
31
+ * - 32-digit hexadecimal format without hyphens: `0189dcd553117d408db09496a2eef37b`
32
+ * - 8-4-4-4-12 hyphenated format: `0189dcd5-5311-7d40-8db0-9496a2eef37b`
33
+ * - Hyphenated format with surrounding braces: `{0189dcd5-5311-7d40-8db0-9496a2eef37b}`
34
+ * - RFC 4122 URN format: `urn:uuid:0189dcd5-5311-7d40-8db0-9496a2eef37b`
35
+ *
36
+ * Leading and trailing whitespaces represents an error.
37
+ *
38
+ * @throws SyntaxError if the argument could not parse as a valid UUID string.
39
+ */
40
+ static parse(uuid: string): UUID;
41
+ /**
42
+ * @returns The 8-4-4-4-12 canonical hexadecimal string representation
43
+ * (`0189dcd5-5311-7d40-8db0-9496a2eef37b`).
44
+ */
45
+ toString(): string;
46
+ /**
47
+ * @returns The 32-digit hexadecimal representation without hyphens
48
+ * (`0189dcd553117d408db09496a2eef37b`).
49
+ */
50
+ toHex(): string;
51
+ /** @returns The 8-4-4-4-12 canonical hexadecimal string representation. */
52
+ toJSON(): string;
53
+ /**
54
+ * Reports the variant field value of the UUID or, if appropriate, "NIL" or
55
+ * "MAX".
56
+ *
57
+ * For convenience, this method reports "NIL" or "MAX" if `this` represents
58
+ * the Nil or Max UUID, although the Nil and Max UUIDs are technically
59
+ * subsumed under the variants `0b0` and `0b111`, respectively.
60
+ */
61
+ getVariant(): "VAR_0" | "VAR_10" | "VAR_110" | "VAR_RESERVED" | "NIL" | "MAX";
62
+ /**
63
+ * Returns the version field value of the UUID or `undefined` if the UUID does
64
+ * not have the variant field value of `0b10`.
65
+ */
66
+ getVersion(): number | undefined;
67
+ /** Creates an object from `this`. */
68
+ clone(): UUID;
69
+ /** Returns true if `this` is equivalent to `other`. */
70
+ equals(other: UUID): boolean;
71
+ /**
72
+ * Returns a negative integer, zero, or positive integer if `this` is less
73
+ * than, equal to, or greater than `other`, respectively.
74
+ */
75
+ compareTo(other: UUID): number;
76
+ }
77
+ /**
78
+ * Encapsulates the monotonic counter state.
79
+ *
80
+ * This class provides APIs to utilize a separate counter state from that of the
81
+ * global generator used by {@link uuidv7} and {@link uuidv7obj}. In addition to
82
+ * the default {@link generate} method, this class has {@link generateOrAbort}
83
+ * that is useful to absolutely guarantee the monotonically increasing order of
84
+ * generated UUIDs. See their respective documentation for details.
85
+ */
86
+ export declare class V7Generator {
87
+ private timestamp;
88
+ private counter;
89
+ /** The random number generator used by the generator. */
90
+ private readonly random;
91
+ /**
92
+ * Creates a generator object with the default random number generator, or
93
+ * with the specified one if passed as an argument. The specified random
94
+ * number generator should be cryptographically strong and securely seeded.
95
+ */
96
+ constructor(randomNumberGenerator?: {
97
+ /** Returns a 32-bit random unsigned integer. */
98
+ nextUint32(): number;
99
+ });
100
+ /**
101
+ * Generates a new UUIDv7 object from the current timestamp, or resets the
102
+ * generator upon significant timestamp rollback.
103
+ *
104
+ * This method returns a monotonically increasing UUID by reusing the previous
105
+ * timestamp even if the up-to-date timestamp is smaller than the immediately
106
+ * preceding UUID's. However, when such a clock rollback is considered
107
+ * significant (i.e., by more than ten seconds), this method resets the
108
+ * generator and returns a new UUID based on the given timestamp, breaking the
109
+ * increasing order of UUIDs.
110
+ *
111
+ * See {@link generateOrAbort} for the other mode of generation and
112
+ * {@link generateOrResetCore} for the low-level primitive.
113
+ */
114
+ generate(): UUID;
115
+ /**
116
+ * Generates a new UUIDv7 object from the current timestamp, or returns
117
+ * `undefined` upon significant timestamp rollback.
118
+ *
119
+ * This method returns a monotonically increasing UUID by reusing the previous
120
+ * timestamp even if the up-to-date timestamp is smaller than the immediately
121
+ * preceding UUID's. However, when such a clock rollback is considered
122
+ * significant (i.e., by more than ten seconds), this method aborts and
123
+ * returns `undefined` immediately.
124
+ *
125
+ * See {@link generate} for the other mode of generation and
126
+ * {@link generateOrAbortCore} for the low-level primitive.
127
+ */
128
+ generateOrAbort(): UUID | undefined;
129
+ /**
130
+ * Generates a new UUIDv7 object from the `unixTsMs` passed, or resets the
131
+ * generator upon significant timestamp rollback.
132
+ *
133
+ * This method is equivalent to {@link generate} except that it takes a custom
134
+ * timestamp and clock rollback allowance.
135
+ *
136
+ * @param rollbackAllowance - The amount of `unixTsMs` rollback that is
137
+ * considered significant. A suggested value is `10_000` (milliseconds).
138
+ * @throws RangeError if `unixTsMs` is not a 48-bit positive integer.
139
+ */
140
+ generateOrResetCore(unixTsMs: number, rollbackAllowance: number): UUID;
141
+ /**
142
+ * Generates a new UUIDv7 object from the `unixTsMs` passed, or returns
143
+ * `undefined` upon significant timestamp rollback.
144
+ *
145
+ * This method is equivalent to {@link generateOrAbort} except that it takes a
146
+ * custom timestamp and clock rollback allowance.
147
+ *
148
+ * @param rollbackAllowance - The amount of `unixTsMs` rollback that is
149
+ * considered significant. A suggested value is `10_000` (milliseconds).
150
+ * @throws RangeError if `unixTsMs` is not a 48-bit positive integer.
151
+ */
152
+ generateOrAbortCore(unixTsMs: number, rollbackAllowance: number): UUID | undefined;
153
+ /** Initializes the counter at a 42-bit random integer. */
154
+ private resetCounter;
155
+ /**
156
+ * Generates a new UUIDv4 object utilizing the random number generator inside.
157
+ *
158
+ * @internal
159
+ */
160
+ generateV4(): UUID;
161
+ }
162
+ /**
163
+ * Generates a UUIDv7 string.
164
+ *
165
+ * @returns The 8-4-4-4-12 canonical hexadecimal string representation
166
+ * ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
167
+ */
168
+ export declare const uuidv7: () => string;
169
+ /** Generates a UUIDv7 object. */
170
+ export declare const uuidv7obj: () => UUID;
171
+ /**
172
+ * Generates a UUIDv4 string.
173
+ *
174
+ * @returns The 8-4-4-4-12 canonical hexadecimal string representation
175
+ * ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx").
176
+ */
177
+ export declare const uuidv4: () => string;
178
+ /** Generates a UUIDv4 object. */
179
+ export declare const uuidv4obj: () => UUID;
@@ -0,0 +1,7 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.uuidv7obj=exports.uuidv7=exports.uuidv4obj=exports.uuidv4=exports.V7Generator=exports.UUID=void 0;var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));/**
2
+ * uuidv7: An experimental implementation of the proposed UUID Version 7
3
+ *
4
+ * @license Apache-2.0
5
+ * @copyright 2021-2023 LiosK
6
+ * @packageDocumentation
7
+ */var DIGITS="0123456789abcdef";var UUID=exports.UUID=function(){function UUID(bytes){(0,_classCallCheck2["default"])(this,UUID);this.bytes=bytes;}return(0,_createClass2["default"])(UUID,[{key:"toString",value:function toString(){var text="";for(var i=0;i<this.bytes.length;i++){text+=DIGITS.charAt(this.bytes[i]>>>4);text+=DIGITS.charAt(this.bytes[i]&0xf);if(i===3||i===5||i===7||i===9){text+="-";}}return text;}},{key:"toHex",value:function toHex(){var text="";for(var i=0;i<this.bytes.length;i++){text+=DIGITS.charAt(this.bytes[i]>>>4);text+=DIGITS.charAt(this.bytes[i]&0xf);}return text;}},{key:"toJSON",value:function toJSON(){return this.toString();}},{key:"getVariant",value:function getVariant(){var n=this.bytes[8]>>>4;if(n<0){throw new Error("unreachable");}else if(n<=7){return this.bytes.every(function(e){return e===0;})?"NIL":"VAR_0";}else if(n<=11){return"VAR_10";}else if(n<=13){return"VAR_110";}else if(n<=15){return this.bytes.every(function(e){return e===0xff;})?"MAX":"VAR_RESERVED";}else{throw new Error("unreachable");}}},{key:"getVersion",value:function getVersion(){return this.getVariant()==="VAR_10"?this.bytes[6]>>>4:undefined;}},{key:"clone",value:function clone(){return new UUID(this.bytes.slice(0));}},{key:"equals",value:function equals(other){return this.compareTo(other)===0;}},{key:"compareTo",value:function compareTo(other){for(var i=0;i<16;i++){var diff=this.bytes[i]-other.bytes[i];if(diff!==0){return Math.sign(diff);}}return 0;}}],[{key:"ofInner",value:function ofInner(bytes){if(bytes.length!==16){throw new TypeError("not 128-bit length");}else{return new UUID(bytes);}}},{key:"fromFieldsV7",value:function fromFieldsV7(unixTsMs,randA,randBHi,randBLo){if(!Number.isInteger(unixTsMs)||!Number.isInteger(randA)||!Number.isInteger(randBHi)||!Number.isInteger(randBLo)||unixTsMs<0||randA<0||randBHi<0||randBLo<0||unixTsMs>281474976710655||randA>0xfff||randBHi>1073741823||randBLo>4294967295){throw new RangeError("invalid field value");}var bytes=new Uint8Array(16);bytes[0]=unixTsMs/Math.pow(2,40);bytes[1]=unixTsMs/Math.pow(2,32);bytes[2]=unixTsMs/Math.pow(2,24);bytes[3]=unixTsMs/Math.pow(2,16);bytes[4]=unixTsMs/Math.pow(2,8);bytes[5]=unixTsMs;bytes[6]=0x70|randA>>>8;bytes[7]=randA;bytes[8]=0x80|randBHi>>>24;bytes[9]=randBHi>>>16;bytes[10]=randBHi>>>8;bytes[11]=randBHi;bytes[12]=randBLo>>>24;bytes[13]=randBLo>>>16;bytes[14]=randBLo>>>8;bytes[15]=randBLo;return new UUID(bytes);}},{key:"parse",value:function parse(uuid){var _a,_b,_c,_d;var hex=undefined;switch(uuid.length){case 32:hex=(_a=/^[0-9a-f]{32}$/i.exec(uuid))===null||_a===void 0?void 0:_a[0];break;case 36:hex=(_b=/^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(uuid))===null||_b===void 0?void 0:_b.slice(1,6).join("");break;case 38:hex=(_c=/^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(uuid))===null||_c===void 0?void 0:_c.slice(1,6).join("");break;case 45:hex=(_d=/^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(uuid))===null||_d===void 0?void 0:_d.slice(1,6).join("");break;default:break;}if(hex){var inner=new Uint8Array(16);for(var i=0;i<16;i+=4){var n=parseInt(hex.substring(2*i,2*i+8),16);inner[i+0]=n>>>24;inner[i+1]=n>>>16;inner[i+2]=n>>>8;inner[i+3]=n;}return new UUID(inner);}else{throw new SyntaxError("could not parse UUID string");}}}]);}();var V7Generator=exports.V7Generator=function(){function V7Generator(randomNumberGenerator){(0,_classCallCheck2["default"])(this,V7Generator);this.timestamp=0;this.counter=0;this.random=randomNumberGenerator!==null&&randomNumberGenerator!==void 0?randomNumberGenerator:getDefaultRandom();}return(0,_createClass2["default"])(V7Generator,[{key:"generate",value:function generate(){return this.generateOrResetCore(Date.now(),10000);}},{key:"generateOrAbort",value:function generateOrAbort(){return this.generateOrAbortCore(Date.now(),10000);}},{key:"generateOrResetCore",value:function generateOrResetCore(unixTsMs,rollbackAllowance){var value=this.generateOrAbortCore(unixTsMs,rollbackAllowance);if(value===undefined){this.timestamp=0;value=this.generateOrAbortCore(unixTsMs,rollbackAllowance);}return value;}},{key:"generateOrAbortCore",value:function generateOrAbortCore(unixTsMs,rollbackAllowance){var MAX_COUNTER=4398046511103;if(!Number.isInteger(unixTsMs)||unixTsMs<1||unixTsMs>281474976710655){throw new RangeError("`unixTsMs` must be a 48-bit positive integer");}else if(rollbackAllowance<0||rollbackAllowance>281474976710655){throw new RangeError("`rollbackAllowance` out of reasonable range");}if(unixTsMs>this.timestamp){this.timestamp=unixTsMs;this.resetCounter();}else if(unixTsMs+rollbackAllowance>=this.timestamp){this.counter++;if(this.counter>MAX_COUNTER){this.timestamp++;this.resetCounter();}}else{return undefined;}return UUID.fromFieldsV7(this.timestamp,Math.trunc(this.counter/Math.pow(2,30)),this.counter&Math.pow(2,30)-1,this.random.nextUint32());}},{key:"resetCounter",value:function resetCounter(){this.counter=this.random.nextUint32()*0x400+(this.random.nextUint32()&0x3ff);}},{key:"generateV4",value:function generateV4(){var bytes=new Uint8Array(Uint32Array.of(this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32(),this.random.nextUint32()).buffer);bytes[6]=0x40|bytes[6]>>>4;bytes[8]=0x80|bytes[8]>>>2;return UUID.ofInner(bytes);}}]);}();var getDefaultRandom=function getDefaultRandom(){return{nextUint32:function nextUint32(){return Math.trunc(Math.random()*65536)*65536+Math.trunc(Math.random()*65536);}};};var defaultGenerator;var uuidv7=exports.uuidv7=function uuidv7(){return uuidv7obj().toString();};var uuidv7obj=exports.uuidv7obj=function uuidv7obj(){return(defaultGenerator||(defaultGenerator=new V7Generator())).generate();};var uuidv4=exports.uuidv4=function uuidv4(){return uuidv4obj().toString();};var uuidv4obj=exports.uuidv4obj=function uuidv4obj(){return(defaultGenerator||(defaultGenerator=new V7Generator())).generateV4();};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uuidv7.js","sourceRoot":"","sources":["../../../../../posthog-core/src/vendor/uuidv7.ts"],"names":[],"mappings":"AAAA,0GAA0G;AAC1G,0CAA0C;AAE1C;;;;;;GAMG;AAEH,MAAM,MAAM,GAAG,kBAAkB,CAAC;AAElC,iDAAiD;AACjD,MAAM,OAAO,IAAI;IACf,4DAA4D;IAC5D,YAA6B,KAA2B;QAA3B,UAAK,GAAL,KAAK,CAAsB;IAAG,CAAC;IAE5D;;;;;;;;OAQG;IACH,MAAM,CAAC,OAAO,CAAC,KAA2B;QACxC,IAAI,KAAK,CAAC,MAAM,KAAK,EAAE,EAAE;YACvB,MAAM,IAAI,SAAS,CAAC,oBAAoB,CAAC,CAAC;SAC3C;aAAM;YACL,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;SACxB;IACH,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,YAAY,CACjB,QAAgB,EAChB,KAAa,EACb,OAAe,EACf,OAAe;QAEf,IACE,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;YAC3B,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;YACxB,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;YAC1B,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;YAC1B,QAAQ,GAAG,CAAC;YACZ,KAAK,GAAG,CAAC;YACT,OAAO,GAAG,CAAC;YACX,OAAO,GAAG,CAAC;YACX,QAAQ,GAAG,eAAgB;YAC3B,KAAK,GAAG,KAAK;YACb,OAAO,GAAG,UAAW;YACrB,OAAO,GAAG,UAAW,EACrB;YACA,MAAM,IAAI,UAAU,CAAC,qBAAqB,C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M;AACN,6EAA6E;AAC7E,2EAA2E;AAC3E,qEAAqE;AACrE,MAAM;AACN,+BAA+B;AAC/B,kDAAkD;AAClD,6BAA6B;AAC7B,2BAA2B;AAC3B,+CAA+C;AAC/C,6CAA6C;AAC7C,yBAAyB;AACzB,QAAQ;AACR,yCAAyC;AACzC,MAAM;AACN,IAAI;AAEJ,IAAI,gBAAyC,CAAC;AAE9C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAW,EAAE,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE3D,iCAAiC;AACjC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAS,EAAE,CAClC,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,GAAG,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,GAAW,EAAE,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE3D,iCAAiC;AACjC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAS,EAAE,CAClC,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,GAAG,IAAI,WAAW,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC"}
@@ -1,10 +1,10 @@
1
- import { PostHog } from './src/posthog-rn';
2
- export default PostHog;
3
- export * from './src/posthog-rn';
4
- export * from './src/hooks/useNavigationTracker';
5
- export * from './src/hooks/useFeatureFlags';
6
- export * from './src/hooks/useFeatureFlag';
7
- export * from './src/hooks/usePostHog';
8
- export * from './src/PostHogProvider';
9
- export * from './src/types';
10
- export * from './src/surveys';
1
+ import { PostHog } from './src/posthog-rn';
2
+ export default PostHog;
3
+ export * from './src/posthog-rn';
4
+ export * from './src/hooks/useNavigationTracker';
5
+ export * from './src/hooks/useFeatureFlags';
6
+ export * from './src/hooks/useFeatureFlag';
7
+ export * from './src/hooks/usePostHog';
8
+ export * from './src/PostHogProvider';
9
+ export * from './src/types';
10
+ export * from './src/surveys';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:true});var _exportNames={};exports["default"]=void 0;var _posthogRn=require("./src/posthog-rn");Object.keys(_posthogRn).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_posthogRn[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _posthogRn[key];}});});var _useNavigationTracker=require("./src/hooks/useNavigationTracker");Object.keys(_useNavigationTracker).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_useNavigationTracker[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _useNavigationTracker[key];}});});var _useFeatureFlags=require("./src/hooks/useFeatureFlags");Object.keys(_useFeatureFlags).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_useFeatureFlags[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _useFeatureFlags[key];}});});var _useFeatureFlag=require("./src/hooks/useFeatureFlag");Object.keys(_useFeatureFlag).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_useFeatureFlag[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _useFeatureFlag[key];}});});var _usePostHog=require("./src/hooks/usePostHog");Object.keys(_usePostHog).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_usePostHog[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _usePostHog[key];}});});var _PostHogProvider=require("./src/PostHogProvider");Object.keys(_PostHogProvider).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_PostHogProvider[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _PostHogProvider[key];}});});var _types=require("./src/types");Object.keys(_types).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_types[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _types[key];}});});var _surveys=require("./src/surveys");Object.keys(_surveys).forEach(function(key){if(key==="default"||key==="__esModule")return;if(Object.prototype.hasOwnProperty.call(_exportNames,key))return;if(key in exports&&exports[key]===_surveys[key])return;Object.defineProperty(exports,key,{enumerable:true,get:function get(){return _surveys[key];}});});var _default=exports["default"]=_posthogRn.PostHog;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,eAAe,OAAO,CAAA;AACtB,cAAc,kBAAkB,CAAA;AAChC,cAAc,kCAAkC,CAAA;AAChD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { PostHog } from './posthog-rn';
3
- export declare const PostHogContext: React.Context<{
4
- client: PostHog;
5
- }>;
1
+ import React from 'react';
2
+ import { PostHog } from './posthog-rn';
3
+ export declare const PostHogContext: React.Context<{
4
+ client: PostHog;
5
+ }>;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHogContext=void 0;var _react=_interopRequireDefault(require("react"));var PostHogContext=exports.PostHogContext=_react["default"].createContext({client:undefined});
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostHogContext.js","sourceRoot":"","sources":["../../../src/PostHogContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAsB,EAAE,MAAM,EAAE,SAA+B,EAAE,CAAC,CAAA"}
@@ -1,14 +1,14 @@
1
- import React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
- import { PostHog, PostHogOptions } from './posthog-rn';
4
- import { PostHogAutocaptureOptions } from './types';
5
- export interface PostHogProviderProps {
6
- children: React.ReactNode;
7
- options?: PostHogOptions;
8
- apiKey?: string;
9
- client?: PostHog;
10
- autocapture?: boolean | PostHogAutocaptureOptions;
11
- debug?: boolean;
12
- style?: StyleProp<ViewStyle>;
13
- }
14
- export declare const PostHogProvider: ({ children, client, options, apiKey, autocapture, style, debug, }: PostHogProviderProps) => JSX.Element | null;
1
+ import React from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ import { PostHog, PostHogOptions } from './posthog-rn';
4
+ import { PostHogAutocaptureOptions } from './types';
5
+ export interface PostHogProviderProps {
6
+ children: React.ReactNode;
7
+ options?: PostHogOptions;
8
+ apiKey?: string;
9
+ client?: PostHog;
10
+ autocapture?: boolean | PostHogAutocaptureOptions;
11
+ debug?: boolean;
12
+ style?: StyleProp<ViewStyle>;
13
+ }
14
+ export declare const PostHogProvider: ({ children, client, options, apiKey, autocapture, style, debug, }: PostHogProviderProps) => JSX.Element | null;
@@ -0,0 +1 @@
1
+ "use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");var _typeof=require("@babel/runtime/helpers/typeof");Object.defineProperty(exports,"__esModule",{value:true});exports.PostHogProvider=void 0;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _defineProperty2=_interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _posthogRn=require("./posthog-rn");var _autocapture=require("./autocapture");var _useNavigationTracker=require("./hooks/useNavigationTracker");var _PostHogContext=require("./PostHogContext");var _this=void 0,_jsxFileName="/home/runner/work/posthog-js-lite/posthog-js-lite/posthog-react-native/lib/posthog-react-native/src/PostHogProvider.js";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=_typeof(e)&&"function"!=typeof e)return{"default":e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n["default"]=e,t&&t.set(e,n),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;}function PostHogNavigationHook(_ref){var options=_ref.options,client=_ref.client;(0,_useNavigationTracker.useNavigationTracker)(options===null||options===void 0?void 0:options.navigation,options===null||options===void 0?void 0:options.navigationRef,client);return null;}var PostHogProvider=exports.PostHogProvider=function PostHogProvider(_ref2){var children=_ref2.children,client=_ref2.client,options=_ref2.options,apiKey=_ref2.apiKey,autocapture=_ref2.autocapture,style=_ref2.style,_ref2$debug=_ref2.debug,debug=_ref2$debug===void 0?false:_ref2$debug;var _a;if(!client&&!apiKey){throw new Error('Either a PostHog client or an apiKey is required. If you want to use the PostHogProvider without a client, please provide an apiKey and the options={ disabled: true }.');}var captureAll=autocapture===true;var captureNone=autocapture===false;var posthog=(0,_react.useMemo)(function(){var _a;if(client&&apiKey){console.warn('You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client.');}if(client){return client;}var parsedOptions=_objectSpread(_objectSpread({},options),{},{captureNativeAppLifecycleEvents:(options===null||options===void 0?void 0:options.captureNativeAppLifecycleEvents)!==undefined?options.captureNativeAppLifecycleEvents:!captureNone&&(captureAll||((_a=autocaptureOptions===null||autocaptureOptions===void 0?void 0:autocaptureOptions.captureLifecycleEvents)!==null&&_a!==void 0?_a:true))});return new _posthogRn.PostHog(apiKey!==null&&apiKey!==void 0?apiKey:'',parsedOptions);},[client,apiKey]);var autocaptureOptions=(0,_react.useMemo)(function(){return autocapture&&typeof autocapture!=='boolean'?autocapture:{};},[autocapture]);var captureTouches=!captureNone&&posthog&&(captureAll||(autocaptureOptions===null||autocaptureOptions===void 0?void 0:autocaptureOptions.captureTouches));var captureScreens=!captureNone&&posthog&&(captureAll||((_a=autocaptureOptions===null||autocaptureOptions===void 0?void 0:autocaptureOptions.captureScreens)!==null&&_a!==void 0?_a:true));var phLabelProp=(autocaptureOptions===null||autocaptureOptions===void 0?void 0:autocaptureOptions.customLabelProp)||_autocapture.defaultPostHogLabelProp;(0,_react.useEffect)(function(){posthog.debug(debug);},[debug,posthog]);var onTouch=(0,_react.useCallback)(function(type,e){if(!captureTouches){return;}if(type==='end'){(0,_autocapture.autocaptureFromTouchEvent)(e,posthog,autocaptureOptions);}},[captureTouches,posthog,autocaptureOptions]);return _react["default"].createElement(_reactNative.View,(0,_extends2["default"])({},(0,_defineProperty2["default"])({},phLabelProp,'PostHogProvider'),{style:style||{flex:1},onTouchEndCapture:captureTouches?function(e){return onTouch('end',e);}:undefined,__self:_this,__source:{fileName:_jsxFileName,lineNumber:53,columnNumber:13}}),_react["default"].createElement(_PostHogContext.PostHogContext.Provider,{value:{client:posthog},__self:_this,__source:{fileName:_jsxFileName,lineNumber:55,columnNumber:7}},captureScreens&&_react["default"].createElement(PostHogNavigationHook,{options:autocaptureOptions,client:posthog,__self:_this,__source:{fileName:_jsxFileName,lineNumber:56,columnNumber:28}}),children));};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PostHogProvider.js","sourceRoot":"","sources":["../../../src/PostHogProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,EAAoC,IAAI,EAAa,MAAM,cAAc,CAAA;AAChF,OAAO,EAAE,OAAO,EAAkB,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAA;AAYvD,SAAS,qBAAqB,CAAC,EAC7B,OAAO,EACP,MAAM,GAIP;IACC,oBAAoB,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,EAAE,MAAM,CAAC,CAAA;IACzE,OAAO,IAAI,CAAA;AACb,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,OAAO,EACP,MAAM,EACN,WAAW,EACX,KAAK,EACL,KAAK,GAAG,KAAK,GACQ,EAAsB,EAAE;;IAC7C,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE;QACtB,MAAM,IAAI,KAAK,CACb,yKAAyK,CAC1K,CAAA;KACF;IAED,MAAM,UAAU,GAAG,WAAW,KAA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AAQ,CAC3B;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { PostHog } from './posthog-rn';
2
- import { PostHogAutocaptureOptions } from './types';
3
- export declare const defaultPostHogLabelProp = "ph-label";
4
- export declare const autocaptureFromTouchEvent: (e: any, posthog: PostHog, options?: PostHogAutocaptureOptions) => void;
1
+ import { PostHog } from './posthog-rn';
2
+ import { PostHogAutocaptureOptions } from './types';
3
+ export declare const defaultPostHogLabelProp = "ph-label";
4
+ export declare const autocaptureFromTouchEvent: (e: any, posthog: PostHog, options?: PostHogAutocaptureOptions) => void;