@tinkerlandai/indiana-sdk 0.6.4 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +15 -5
  2. package/README.md +11 -10
  3. package/README.zh-CN.md +16 -11
  4. package/dist/{ai-usage-B4W5m4Ie.d.ts → ai-usage-Bigjb8MS.d.ts} +570 -560
  5. package/dist/chunk-2A6UYUFA.js +1 -0
  6. package/dist/chunk-3BQFJANQ.js +1 -0
  7. package/dist/chunk-3ENVRJE6.js +350 -0
  8. package/dist/chunk-A3N4ZZTM.js +7 -0
  9. package/dist/chunk-AE4CUTUE.js +1 -0
  10. package/dist/chunk-CXYOZSOF.js +1 -0
  11. package/dist/{chunk-2EJSV6BA.js → chunk-G2R56FKU.js} +1 -1
  12. package/dist/chunk-KQCTDXVD.js +17 -0
  13. package/dist/{chunk-5TEZEOHX.js → chunk-OVMNCZYC.js} +1 -1
  14. package/dist/chunk-RRII2DMC.js +1 -0
  15. package/dist/chunk-YAFMBXIE.js +4 -0
  16. package/dist/{configuration-sync-C2mytNwU.d.ts → configuration-sync-VFbY1pCN.d.ts} +356 -49
  17. package/dist/content-K2HCZVC2.js +1 -0
  18. package/dist/{customer-page-B4FGCVpt.d.ts → customer-page-BrCZxcaQ.d.ts} +278 -5
  19. package/dist/funnel-runtime-host-HNZ47TZW.js +1 -0
  20. package/dist/{funnel-runtime-start-sZ8ZCNlq.d.ts → funnel-runtime-start-DKcTCRrd.d.ts} +6930 -3327
  21. package/dist/index.d.ts +17432 -14987
  22. package/dist/index.js +1 -1
  23. package/dist/native-shell.js +1 -1
  24. package/dist/openrouter.d.ts +2 -2
  25. package/dist/openrouter.js +1 -1
  26. package/dist/page.d.ts +17 -17
  27. package/dist/page.js +1 -1
  28. package/dist/paywall-PD62B2AY.js +1 -0
  29. package/dist/popup.d.ts +7 -282
  30. package/dist/popup.js +1 -350
  31. package/dist/react-native.d.ts +15 -15
  32. package/dist/react-native.js +1 -1
  33. package/dist/{screen-16d-xADb.d.ts → screen-BazUOjwM.d.ts} +163 -160
  34. package/dist/server.d.ts +5 -5
  35. package/dist/server.js +1 -1
  36. package/dist/src-4MRSESVS.js +1 -0
  37. package/dist/visual.d.ts +5 -2
  38. package/dist/visual.js +2 -2
  39. package/package.json +1 -7
  40. package/dist/chunk-4K25DELJ.js +0 -1
  41. package/dist/chunk-63BWE27V.js +0 -1
  42. package/dist/chunk-CB63JLGT.js +0 -1
  43. package/dist/chunk-D7YHFS6B.js +0 -4
  44. package/dist/chunk-HTRQPMJO.js +0 -11
  45. package/dist/chunk-ISUXYPYL.js +0 -1
  46. package/dist/chunk-QG3WUJG5.js +0 -1
  47. package/dist/chunk-RMJJOSVZ.js +0 -1
  48. package/dist/chunk-S2MSIA57.js +0 -17
  49. package/dist/chunk-U6S6AZM6.js +0 -1
  50. package/dist/chunk-VVSQKVE7.js +0 -1
  51. package/dist/client-OYRHOMUQ.js +0 -1
  52. package/dist/funnel-runtime-host-NWS3URFA.js +0 -1
  53. package/dist/iam.d.ts +0 -131
  54. package/dist/iam.js +0 -1
  55. package/dist/paywall-4XZ6NDMY.js +0 -1
  56. package/dist/src-WV6GZYWA.js +0 -1
  57. package/dist/{errors-DrdTlPwf.d.ts → errors-BpCmukJr.d.ts} +1 -1
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
- import { S as StackNode } from './screen-16d-xADb.js';
2
+ import { S as StackNode } from './screen-BazUOjwM.js';
3
3
 
4
4
  declare const configurationScopeSchema: z.ZodObject<{
5
5
  projectId: z.ZodString;
6
6
  environment: z.ZodEnum<{
7
- sandbox: "sandbox";
8
7
  live: "live";
8
+ sandbox: "sandbox";
9
9
  }>;
10
10
  environmentId: z.ZodUUID;
11
11
  }, z.core.$strict>;
@@ -15,8 +15,8 @@ declare const sdkConfigurationManifestSchema: z.ZodObject<{
15
15
  scope: z.ZodObject<{
16
16
  projectId: z.ZodString;
17
17
  environment: z.ZodEnum<{
18
- sandbox: "sandbox";
19
18
  live: "live";
19
+ sandbox: "sandbox";
20
20
  }>;
21
21
  environmentId: z.ZodUUID;
22
22
  }, z.core.$strict>;
@@ -32,6 +32,7 @@ declare const sdkConfigurationManifestSchema: z.ZodObject<{
32
32
  }, z.core.$strict>;
33
33
  artifacts: z.ZodRecord<z.ZodString, z.ZodObject<{
34
34
  kind: z.ZodEnum<{
35
+ paywall: "paywall";
35
36
  funnel: "funnel";
36
37
  gb_features: "gb_features";
37
38
  gb_page_experiments: "gb_page_experiments";
@@ -66,6 +67,19 @@ declare const sdkConfigurationManifestSchema: z.ZodObject<{
66
67
  couponDigests: z.ZodOptional<z.ZodRecord<z.ZodUUID, z.ZodString>>;
67
68
  }, z.core.$strict>>;
68
69
  }, z.core.$strict>>;
70
+ paywalls: z.ZodOptional<z.ZodRecord<z.ZodUUID, z.ZodObject<{
71
+ state: z.ZodEnum<{
72
+ archived: "archived";
73
+ published: "published";
74
+ }>;
75
+ controlRevision: z.ZodNumber;
76
+ currentVersionId: z.ZodUUID;
77
+ versions: z.ZodRecord<z.ZodUUID, z.ZodObject<{
78
+ version: z.ZodNumber;
79
+ artifact: z.ZodString;
80
+ sourceDigest: z.ZodString;
81
+ }, z.core.$strict>>;
82
+ }, z.core.$strict>>>;
69
83
  }, z.core.$strict>;
70
84
  type SdkConfigurationManifest = z.infer<typeof sdkConfigurationManifestSchema>;
71
85
  type ConfigurationScope = z.infer<typeof configurationScopeSchema>;
@@ -90,7 +104,7 @@ type Listener = () => void;
90
104
  declare function createConfigurationSync(options: ConfigurationSyncOptions): {
91
105
  scope: Readonly<{
92
106
  projectId: string;
93
- environment: "sandbox" | "live";
107
+ environment: "live" | "sandbox";
94
108
  environmentId: string;
95
109
  }>;
96
110
  refresh: () => Promise<Manifest>;
@@ -103,7 +117,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
103
117
  schemaVersion: 1;
104
118
  scope: {
105
119
  projectId: string;
106
- environment: "sandbox" | "live";
120
+ environment: "live" | "sandbox";
107
121
  environmentId: string;
108
122
  };
109
123
  revision: number;
@@ -117,7 +131,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
117
131
  pageExperiments: string | null;
118
132
  };
119
133
  artifacts: Record<string, {
120
- kind: "funnel" | "gb_features" | "gb_page_experiments";
134
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
121
135
  formatVersion: number;
122
136
  url: string;
123
137
  sha256: string;
@@ -141,15 +155,21 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
141
155
  couponDigests?: Record<string, string> | undefined;
142
156
  }>;
143
157
  }>;
158
+ paywalls?: Record<string, {
159
+ state: "archived" | "published";
160
+ controlRevision: number;
161
+ currentVersionId: string;
162
+ versions: Record<string, {
163
+ version: number;
164
+ artifact: string;
165
+ sourceDigest: string;
166
+ }>;
167
+ }> | undefined;
144
168
  } | null;
145
169
  readonly remainingMs: number;
146
170
  features(): Promise<{
147
171
  evaluatedAt: string;
148
172
  expiresAt: string;
149
- scope: {
150
- projectId: string;
151
- environment: "sandbox" | "live";
152
- };
153
173
  features: Record<string, {
154
174
  defaultValue?: z.core.util.JSONType | undefined;
155
175
  rules?: {
@@ -246,6 +266,10 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
246
266
  phase?: string | undefined;
247
267
  }[] | undefined;
248
268
  }>;
269
+ scope: {
270
+ projectId: string;
271
+ environment: "live" | "sandbox";
272
+ };
249
273
  generation: string;
250
274
  savedGroups: Record<string, {
251
275
  type: "hashed";
@@ -318,41 +342,41 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
318
342
  urlRedirect: string;
319
343
  }[];
320
344
  name?: string | undefined;
321
- coverage?: number | undefined;
322
- condition?: Record<string, z.core.util.JSONType> | undefined;
345
+ meta?: {
346
+ key?: string | undefined;
347
+ name?: string | undefined;
348
+ passthrough?: boolean | undefined;
349
+ }[] | undefined;
350
+ filters?: {
351
+ seed: string;
352
+ hashVersion: 2;
353
+ ranges: [number, number][];
354
+ attribute?: string | undefined;
355
+ }[] | undefined;
323
356
  seed?: string | undefined;
324
357
  hashVersion?: 2 | undefined;
325
358
  ranges?: [number, number][] | undefined;
326
- force?: number | undefined;
359
+ condition?: Record<string, z.core.util.JSONType> | undefined;
327
360
  urlPatterns?: {
328
361
  include: boolean;
329
362
  type: "regex" | "simple";
330
363
  pattern: string;
331
364
  }[] | undefined;
365
+ force?: number | undefined;
332
366
  persistQueryString?: boolean | undefined;
333
367
  hashAttribute?: string | undefined;
334
- phase?: string | undefined;
335
- filters?: {
336
- seed: string;
337
- hashVersion: 2;
338
- ranges: [number, number][];
339
- attribute?: string | undefined;
340
- }[] | undefined;
341
368
  parentConditions?: {
342
369
  id: string;
343
370
  condition: Record<string, z.core.util.JSONType>;
344
371
  gate?: boolean | undefined;
345
372
  }[] | undefined;
346
373
  weights?: number[] | undefined;
374
+ coverage?: number | undefined;
347
375
  fallbackAttribute?: string | undefined;
348
376
  disableStickyBucketing?: boolean | undefined;
349
377
  bucketVersion?: number | undefined;
350
378
  minBucketVersion?: number | undefined;
351
- meta?: {
352
- key?: string | undefined;
353
- name?: string | undefined;
354
- passthrough?: boolean | undefined;
355
- }[] | undefined;
379
+ phase?: string | undefined;
356
380
  }[];
357
381
  savedGroups: Record<string, {
358
382
  type: "hashed";
@@ -584,7 +608,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
584
608
  event: string;
585
609
  } | {
586
610
  type: "api";
587
- operation: "update" | "refund" | "setupPayment" | "readBalanceSource" | "adjustBalance" | "readUsage" | "setUsage" | "manageBalanceGrant" | "listBalanceGrants" | "restoreNativePurchase" | "readPaymentSetup" | "verifySubscriptions" | "previewAttach" | "attach" | "readSubscriptionOperation" | "previewUpdate" | "readSubscriptionUpdate" | "previewRefund" | "readRefund" | "readBillingControls" | "prepareBillingAuthorization" | "confirmBillingAuthorization" | "setBillingCoupons" | "revokeBillingAuthorization" | "listBillingInvoices" | "confirmBillingAdjustment" | "manageBillingLimits" | "manageUsageEntity" | "readUsageAnalytics" | "readCreditAnalytics" | "submitUsageBatch" | "readUsageBatch" | "checkEntitlement" | "resolveOffering" | "readHoldings" | "readLedger" | "readBillingInvoice" | "readCreditStatement" | "quoteBalance" | "trackUsage" | "mutateBalance" | "redeemReward" | "createReferralCode" | "claimRewardProduct" | "readSeats" | "manageSeat" | "redeemCoupon" | "listOffers" | "grantOffer";
611
+ operation: "attach" | "refund" | "update" | "readBalanceSource" | "adjustBalance" | "readUsage" | "setUsage" | "manageBalanceGrant" | "listBalanceGrants" | "restoreNativePurchase" | "setupPayment" | "readPaymentSetup" | "verifySubscriptions" | "previewAttach" | "readSubscriptionOperation" | "previewUpdate" | "readSubscriptionUpdate" | "previewRefund" | "readRefund" | "readBillingControls" | "prepareBillingAuthorization" | "confirmBillingAuthorization" | "setBillingCoupons" | "revokeBillingAuthorization" | "listBillingInvoices" | "confirmBillingAdjustment" | "manageBillingLimits" | "manageUsageEntity" | "readUsageAnalytics" | "readCreditAnalytics" | "submitUsageBatch" | "readUsageBatch" | "checkEntitlement" | "resolveOffering" | "readHoldings" | "readLedger" | "readBillingInvoice" | "readCreditStatement" | "quoteBalance" | "trackUsage" | "mutateBalance" | "redeemReward" | "createReferralCode" | "claimRewardProduct" | "readSeats" | "manageSeat" | "redeemCoupon" | "listOffers" | "grantOffer";
588
612
  inputs: Record<string, {
589
613
  source: "literal";
590
614
  value: z.core.util.JSONType;
@@ -633,11 +657,6 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
633
657
  nodeId?: string | undefined;
634
658
  contentHash?: string | undefined;
635
659
  renderKey?: string | undefined;
636
- observed?: {
637
- versionId: string;
638
- sha256: string;
639
- contentHash: string;
640
- } | undefined;
641
660
  } | undefined;
642
661
  position?: {
643
662
  x: number;
@@ -645,7 +664,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
645
664
  } | undefined;
646
665
  } | {
647
666
  type: "end";
648
- outcome: "failed" | "completed" | "closed" | "ineligible";
667
+ outcome: "closed" | "failed" | "completed" | "ineligible";
649
668
  id: string;
650
669
  name: string;
651
670
  output?: {
@@ -696,7 +715,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
696
715
  kind: "screen";
697
716
  schemaVersion: 4;
698
717
  name: string;
699
- surface: "paywall" | "popup" | "onboarding" | "page";
718
+ surface: "paywall" | "popup" | "onboarding" | "page" | "banner";
700
719
  presentation: {
701
720
  type: "modal";
702
721
  size: "sm" | "md" | "lg";
@@ -705,12 +724,14 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
705
724
  size: "sm" | "md" | "lg";
706
725
  } | {
707
726
  type: "fullscreen";
727
+ } | {
728
+ type: "inline";
708
729
  };
709
730
  theme: {
710
731
  primary: string;
711
732
  background: string;
712
733
  text: string;
713
- radius: "none" | "full" | "sm" | "md" | "lg";
734
+ radius: "sm" | "md" | "lg" | "none" | "full";
714
735
  font: "system" | "serif" | "rounded" | "mono";
715
736
  };
716
737
  pages: {
@@ -721,7 +742,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
721
742
  primary: string;
722
743
  background: string;
723
744
  text: string;
724
- radius: "none" | "full" | "sm" | "md" | "lg";
745
+ radius: "sm" | "md" | "lg" | "none" | "full";
725
746
  font: "system" | "serif" | "rounded" | "mono";
726
747
  } | undefined;
727
748
  editorPosition?: {
@@ -771,20 +792,20 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
771
792
  };
772
793
  publicData?: {
773
794
  couponDigests: Record<string, string>;
774
- variables: Record<string, Record<string, Partial<Record<"offer.headline" | "offer.name" | "offer.description" | "offer.eligibility" | "offer.validity" | "offer.terms" | "offer.discount" | "offer.months" | "offer.ends_at", string>>>>;
795
+ variables: Record<string, Record<string, Partial<Record<"offer.ends_at" | "offer.headline" | "offer.name" | "offer.description" | "offer.eligibility" | "offer.validity" | "offer.terms" | "offer.discount" | "offer.months", string>>>>;
775
796
  locales: Record<string, {
776
- plans: Record<string, never>;
777
797
  nodes: Record<string, {
778
798
  base: {
779
- couponId?: string | undefined;
780
- label?: string | undefined;
781
799
  text?: string | undefined;
800
+ label?: string | undefined;
782
801
  alt?: string | undefined;
783
802
  html?: string | undefined;
784
803
  countdownAt?: string | undefined;
804
+ couponId?: string | undefined;
785
805
  missing?: string[] | undefined;
786
806
  };
787
807
  }>;
808
+ plans: Record<string, never>;
788
809
  pickers: Record<string, never>;
789
810
  diagnostics: {
790
811
  nodeId: string;
@@ -864,10 +885,6 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
864
885
  growth: {
865
886
  evaluatedAt: string;
866
887
  expiresAt: string;
867
- scope: {
868
- projectId: string;
869
- environment: "sandbox" | "live";
870
- };
871
888
  features: Record<string, {
872
889
  defaultValue?: z.core.util.JSONType | undefined;
873
890
  rules?: {
@@ -964,6 +981,10 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
964
981
  phase?: string | undefined;
965
982
  }[] | undefined;
966
983
  }>;
984
+ scope: {
985
+ projectId: string;
986
+ environment: "live" | "sandbox";
987
+ };
967
988
  generation: string;
968
989
  savedGroups: Record<string, {
969
990
  type: "hashed";
@@ -1048,7 +1069,283 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
1048
1069
  schemaVersion: 1;
1049
1070
  scope: {
1050
1071
  projectId: string;
1051
- environment: "sandbox" | "live";
1072
+ environment: "live" | "sandbox";
1073
+ environmentId: string;
1074
+ };
1075
+ revision: number;
1076
+ generation: string;
1077
+ policy: {
1078
+ refreshIntervalSeconds: number;
1079
+ maxControlAgeSeconds: number;
1080
+ };
1081
+ gb: {
1082
+ features: string | null;
1083
+ pageExperiments: string | null;
1084
+ };
1085
+ artifacts: Record<string, {
1086
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
1087
+ formatVersion: number;
1088
+ url: string;
1089
+ sha256: string;
1090
+ byteLength: number;
1091
+ generation?: string | undefined;
1092
+ }>;
1093
+ funnels: Record<string, {
1094
+ state: "active" | "archived" | "paused";
1095
+ controlRevision: number;
1096
+ evaluationMode: "local" | "remote";
1097
+ evaluationRevision: number;
1098
+ currentVersionId: string;
1099
+ versions: Record<string, {
1100
+ artifact: string;
1101
+ dependencies: {
1102
+ features: string[];
1103
+ experiments: Record<string, string[]>;
1104
+ savedGroups: string[];
1105
+ };
1106
+ definitionDigest?: string | undefined;
1107
+ couponDigests?: Record<string, string> | undefined;
1108
+ }>;
1109
+ }>;
1110
+ paywalls?: Record<string, {
1111
+ state: "archived" | "published";
1112
+ controlRevision: number;
1113
+ currentVersionId: string;
1114
+ versions: Record<string, {
1115
+ version: number;
1116
+ artifact: string;
1117
+ sourceDigest: string;
1118
+ }>;
1119
+ }> | undefined;
1120
+ };
1121
+ }>;
1122
+ paywall: (paywallId: string, versionId?: string) => Promise<{
1123
+ document: {
1124
+ kind: "paywall";
1125
+ formatVersion: 1;
1126
+ name: string;
1127
+ offeringVersionId: string;
1128
+ presentation: {
1129
+ type: "modal";
1130
+ size: "sm" | "md" | "lg";
1131
+ } | {
1132
+ type: "sheet";
1133
+ size: "sm" | "md" | "lg";
1134
+ } | {
1135
+ type: "fullscreen";
1136
+ } | {
1137
+ type: "inline";
1138
+ };
1139
+ screen: {
1140
+ kind: "screen";
1141
+ schemaVersion: 4;
1142
+ name: string;
1143
+ surface: "paywall" | "popup" | "onboarding" | "page" | "banner";
1144
+ presentation: {
1145
+ type: "modal";
1146
+ size: "sm" | "md" | "lg";
1147
+ } | {
1148
+ type: "sheet";
1149
+ size: "sm" | "md" | "lg";
1150
+ } | {
1151
+ type: "fullscreen";
1152
+ } | {
1153
+ type: "inline";
1154
+ };
1155
+ theme: {
1156
+ primary: string;
1157
+ background: string;
1158
+ text: string;
1159
+ radius: "sm" | "md" | "lg" | "none" | "full";
1160
+ font: "system" | "serif" | "rounded" | "mono";
1161
+ };
1162
+ pages: {
1163
+ id: string;
1164
+ name: string;
1165
+ root: StackNode;
1166
+ theme?: {
1167
+ primary: string;
1168
+ background: string;
1169
+ text: string;
1170
+ radius: "sm" | "md" | "lg" | "none" | "full";
1171
+ font: "system" | "serif" | "rounded" | "mono";
1172
+ } | undefined;
1173
+ editorPosition?: {
1174
+ x: number;
1175
+ y: number;
1176
+ } | undefined;
1177
+ }[];
1178
+ strings: {
1179
+ defaultLocale: string;
1180
+ locales: Record<string, Record<string, string>>;
1181
+ };
1182
+ actions: ({
1183
+ type: "navigate";
1184
+ close: false;
1185
+ pageId: string;
1186
+ id: string;
1187
+ event: string;
1188
+ properties: Record<string, string | number | boolean | null>;
1189
+ } | {
1190
+ type: "event";
1191
+ close: boolean;
1192
+ id: string;
1193
+ event: string;
1194
+ properties: Record<string, string | number | boolean | null>;
1195
+ } | {
1196
+ type: "close";
1197
+ close: true;
1198
+ id: string;
1199
+ event: string;
1200
+ properties: Record<string, string | number | boolean | null>;
1201
+ } | {
1202
+ type: "open_url";
1203
+ close: boolean;
1204
+ url: string;
1205
+ id: string;
1206
+ event: string;
1207
+ properties: Record<string, string | number | boolean | null>;
1208
+ } | {
1209
+ type: "claim_offer";
1210
+ close: boolean;
1211
+ couponId: string;
1212
+ id: string;
1213
+ event: string;
1214
+ properties: Record<string, string | number | boolean | null>;
1215
+ })[];
1216
+ initialPageId?: string | undefined;
1217
+ };
1218
+ products: {
1219
+ items: {
1220
+ productVersionId: string;
1221
+ label: string;
1222
+ }[];
1223
+ defaultProductVersionId: string | null;
1224
+ grouping?: {
1225
+ tiers: {
1226
+ id: string;
1227
+ name: string;
1228
+ }[];
1229
+ assignments: {
1230
+ productVersionId: string;
1231
+ tierId: string;
1232
+ period: "month" | "year";
1233
+ }[];
1234
+ } | undefined;
1235
+ };
1236
+ catalog: Record<string, {
1237
+ name: string;
1238
+ interval: "free" | "week" | "month" | "year" | "one_time";
1239
+ intervalCount: number;
1240
+ trial: {
1241
+ days: number;
1242
+ cardRequired: boolean;
1243
+ } | null;
1244
+ benefits: {
1245
+ featureId: string;
1246
+ name: string;
1247
+ allowance: string | null;
1248
+ access: boolean;
1249
+ }[];
1250
+ channels: {
1251
+ stripe?: {
1252
+ prices: {
1253
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
1254
+ amountMinor: number;
1255
+ }[];
1256
+ } | undefined;
1257
+ apple?: {
1258
+ productIds: string[];
1259
+ } | undefined;
1260
+ google?: {
1261
+ products: {
1262
+ productId: string;
1263
+ basePlanId: string | null;
1264
+ }[];
1265
+ } | undefined;
1266
+ };
1267
+ }>;
1268
+ buttons: Record<string, {
1269
+ type: "checkout";
1270
+ product: {
1271
+ type: "picker";
1272
+ pickerId: string;
1273
+ allowedProductVersionIds: string[];
1274
+ } | {
1275
+ type: "fixed";
1276
+ productVersionId: string;
1277
+ };
1278
+ } | {
1279
+ type: "close";
1280
+ } | {
1281
+ type: "action";
1282
+ action: {
1283
+ type: "event";
1284
+ event: string;
1285
+ } | {
1286
+ type: "open_url";
1287
+ url: string;
1288
+ };
1289
+ }>;
1290
+ coupons: Record<string, {
1291
+ digest: string;
1292
+ content: {
1293
+ discount: {
1294
+ type: "percent";
1295
+ percentOff: number;
1296
+ } | {
1297
+ type: "amount";
1298
+ amountOffCents: number;
1299
+ currency: "USD" | "EUR" | "CNY" | "GBP" | "JPY" | "CAD" | "AUD" | "NZD" | "CHF" | "HKD" | "SGD" | "KRW" | "INR" | "BRL" | "MXN" | "TWD" | "THB" | "IDR" | "MYR" | "PHP" | "VND" | "ZAR" | "AED" | "SAR" | "SEK" | "NOK" | "DKK" | "PLN" | "CZK" | "HUF" | "ILS" | "TRY" | "RON";
1300
+ };
1301
+ duration: {
1302
+ type: "once";
1303
+ } | {
1304
+ type: "repeating";
1305
+ months: number;
1306
+ } | {
1307
+ type: "forever";
1308
+ };
1309
+ appliesTo: {
1310
+ type: "all";
1311
+ } | {
1312
+ type: "plans";
1313
+ planIds: string[];
1314
+ };
1315
+ displayCopy: {
1316
+ defaultLocale: string;
1317
+ locales: Record<string, {
1318
+ name: string;
1319
+ description: string;
1320
+ }>;
1321
+ } | null;
1322
+ firstPurchaseOnly: boolean;
1323
+ qualificationRequired: boolean;
1324
+ startsAt: string | null;
1325
+ endsAt: string | null;
1326
+ grantWindowHours: number;
1327
+ perCustomerLimit: number;
1328
+ };
1329
+ }>;
1330
+ };
1331
+ versionId: string;
1332
+ version: number;
1333
+ control: {
1334
+ state: "archived" | "published";
1335
+ controlRevision: number;
1336
+ currentVersionId: string;
1337
+ versions: Record<string, {
1338
+ version: number;
1339
+ artifact: string;
1340
+ sourceDigest: string;
1341
+ }>;
1342
+ };
1343
+ manifest: {
1344
+ kind: "sdk_configuration";
1345
+ schemaVersion: 1;
1346
+ scope: {
1347
+ projectId: string;
1348
+ environment: "live" | "sandbox";
1052
1349
  environmentId: string;
1053
1350
  };
1054
1351
  revision: number;
@@ -1062,7 +1359,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
1062
1359
  pageExperiments: string | null;
1063
1360
  };
1064
1361
  artifacts: Record<string, {
1065
- kind: "funnel" | "gb_features" | "gb_page_experiments";
1362
+ kind: "paywall" | "funnel" | "gb_features" | "gb_page_experiments";
1066
1363
  formatVersion: number;
1067
1364
  url: string;
1068
1365
  sha256: string;
@@ -1086,6 +1383,16 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
1086
1383
  couponDigests?: Record<string, string> | undefined;
1087
1384
  }>;
1088
1385
  }>;
1386
+ paywalls?: Record<string, {
1387
+ state: "archived" | "published";
1388
+ controlRevision: number;
1389
+ currentVersionId: string;
1390
+ versions: Record<string, {
1391
+ version: number;
1392
+ artifact: string;
1393
+ sourceDigest: string;
1394
+ }>;
1395
+ }> | undefined;
1089
1396
  };
1090
1397
  }>;
1091
1398
  localFunnel(funnelId: string, versionId?: string): Promise<{
@@ -1093,7 +1400,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
1093
1400
  growth: {
1094
1401
  scope: {
1095
1402
  projectId: string;
1096
- environment: "sandbox" | "live";
1403
+ environment: "live" | "sandbox";
1097
1404
  };
1098
1405
  generation: string;
1099
1406
  evaluatedAt: string;
@@ -1254,7 +1561,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
1254
1561
  }[]>;
1255
1562
  scope: {
1256
1563
  projectId: string;
1257
- environment: "sandbox" | "live";
1564
+ environment: "live" | "sandbox";
1258
1565
  };
1259
1566
  funnelId: string;
1260
1567
  versionId: string;
@@ -1264,7 +1571,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
1264
1571
  entry: string;
1265
1572
  nodes: {
1266
1573
  id: string;
1267
- type: "output" | "action" | "condition" | "split" | "end" | "coupon" | "coupons" | "screen" | "offering" | "feature" | "entry" | "external_page" | "wait";
1574
+ type: "output" | "action" | "screen" | "end" | "coupon" | "feature" | "split" | "condition" | "offering" | "coupons" | "entry" | "external_page" | "wait";
1268
1575
  outputs: Record<string, string>;
1269
1576
  writes: Record<string, string>;
1270
1577
  resources: {
@@ -1309,7 +1616,7 @@ declare function createConfigurationSync(options: ConfigurationSyncOptions): {
1309
1616
  } | undefined;
1310
1617
  };
1311
1618
  terminals: Record<string, {
1312
- outcome: "failed" | "completed" | "closed" | "ineligible";
1619
+ outcome: "closed" | "failed" | "completed" | "ineligible";
1313
1620
  output: {
1314
1621
  type: "literal";
1315
1622
  value: z.core.util.JSONType;
@@ -0,0 +1 @@
1
+ import{h as H}from"./chunk-3ENVRJE6.js";import{a as b}from"./chunk-6X42DWOM.js";import"./chunk-CXYOZSOF.js";import{jc as D}from"./chunk-A3N4ZZTM.js";import{a as f}from"./chunk-OVMNCZYC.js";import{Eb as T,Mb as L,Ob as j,tb as k}from"./chunk-3BQFJANQ.js";import"./chunk-AE4CUTUE.js";import"./chunk-S5TVMQRC.js";import{a as I}from"./chunk-RRII2DMC.js";import"./chunk-KQCTDXVD.js";import{z as l}from"zod";var x=new WeakMap;function P(o){let t={string:l.string(),number:l.number().finite(),boolean:l.boolean(),strings:l.array(l.string()),json:I}[o.type];return o.nullable?t.nullable():t}async function J(o,t){let S=D.parse(t.content),r=S.document;if(x.has(o))throw new f("CONFLICT","Content is already mounted in this container");let u=l.record(l.string(),I).parse(t.inputs??{});if(Object.keys(u).length>40)throw new f("INVALID_REQUEST","Too many content inputs");for(let[e,i]of Object.entries(u))L.parse({[e]:i});if(Object.keys(u).some(e=>!Object.hasOwn(r.contract.inputs,e)))throw new f("INVALID_REQUEST","Undeclared content input");for(let[e,i]of Object.entries(r.contract.inputs))if(Object.hasOwn(u,e))P(i).parse(u[e]);else if(i.required)throw new f("INVALID_REQUEST",`Missing content input ${e}`);for(let e of Object.keys(r.contract.outputs))if(typeof t.actions[e]!="function")throw new f("INVALID_REQUEST",`Missing host handler for ${e}`);let R=j.parse(t.bindings??[]),d=o.ownerDocument,v=d.activeElement,A=r.kind==="popup",n=A?d.createElement("dialog"):null,s=d.createElement("div");if(s.dataset.indianaContent=r.kind,s.setAttribute("aria-label",r.name),s.style.cssText="width:100%;min-width:0",n){n.setAttribute("aria-label",r.name);let e=r.screen.presentation;n.style.cssText="box-sizing:border-box;padding:0;border:0;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto",e.type==="modal"||e.type==="sheet"?(n.style.width=`${k[e.size]}px`,e.type==="sheet"&&(n.style.margin="auto auto 0")):n.style.width="100vw",n.append(s),o.append(n)}else o.append(s);let m=!1,g=!1,a=null,w=structuredClone(r.screen);w.actions=w.actions.map(e=>e.type==="event"?{...e,close:!1}:e);let h;function E(){m||(m=!0,h?.destroy(),n?.close(),n?.remove(),s.remove(),x.delete(o),n&&v instanceof HTMLElement&&v.isConnected&&v.focus())}let C=()=>{E(),b(t.onDismiss)};if(n){let e=d.createElement("button");e.type="button",e.textContent="\xD7",e.setAttribute("aria-label",t.locale?.startsWith("zh")?"\u5173\u95ED":"Close"),e.style.cssText="position:absolute;right:8px;top:8px;width:30px;height:30px;z-index:1",e.addEventListener("click",C),n.prepend(e)}n?.addEventListener("cancel",e=>{e.preventDefault(),C()});async function V(){if(m||g||!a)return;let e=a;g=!0,s.setAttribute("aria-busy","true");try{await t.actions[e.actionId](structuredClone(e)),a=null}catch(i){b(t.onError,i)}finally{g=!1,m||s.removeAttribute("aria-busy")}}try{n?.showModal(),h=H(s,{mode:"live",title:r.name,viewportHeight:r.kind==="page"?o.clientHeight||d.defaultView?.innerHeight||800:void 0,onError:c=>b(t.onError,new Error(c)),onEscape:A?C:void 0,onAction:(c,U,M)=>{if(m||g||a)return;let p=r.screen.actions.find(y=>y.id===c),O=r.contract.outputs[c];if(!(p?.type!=="event"||!O))try{let y=P(O).parse(Object.hasOwn(p.properties,"value")?p.properties.value:p.properties);a={requestId:crypto.randomUUID(),contentVersionId:S.id,actionId:c,event:p.event,value:y,selection:U??{},answers:M??{},requestedClose:p.close},V()}catch(y){b(t.onError,y)}}});let e={destroy:E,get pendingAction(){return a?structuredClone(a):null},retryAction:V,updateCapabilities:c=>h?.updateCapabilities(c)};x.set(o,e);let i=T(w,[t.locale,...d.defaultView?.navigator.languages??[]]);return h.update(w,i,{capabilities:t.capabilities,serverInput:{bindings:R,answers:{},values:u}}),await h.ready,e}catch(e){throw E(),e}}export{J as mountContent};