calmlens 0.27.5 → 0.28.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 (85) hide show
  1. package/README.md +2 -2
  2. package/bin/calmlens.js +48 -26
  3. package/cjs/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
  4. package/cjs/{BrowserUpload-DhruIgFN.js → BrowserUpload-Dz4UwTTJ.js} +1 -1
  5. package/cjs/{CalmLensAppClient-BA_xaNHY.js → CalmLensAppClient-B0QZ1oJV.js} +3 -3
  6. package/{esm/CalmLensAppClient-DzoSqUgG.d.ts → cjs/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
  7. package/cjs/{CalmLensOptionKeys-BvLQghl-.js → CalmLensOptionKeys-Cat8CgOn.js} +2 -2
  8. package/cjs/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
  9. package/cjs/{CalmLensServerClient-D55xDZm4.js → CalmLensServerClient-CQdvhCGg.js} +14 -14
  10. package/cjs/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
  11. package/{esm/Core-CTO_Eh0l.d.ts → cjs/Core-BJaLU71Q.d.ts} +2 -2
  12. package/cjs/{Core-kKGmyk5V.js → Core-DCnnUsgF.js} +7 -4
  13. package/cjs/{CryptoUtils-B_x8lMIx-YBW1-bvL.js → CryptoUtils-BLCa-oZe-leCkr1ko.js} +1 -2
  14. package/cjs/{ModerationContextLimits-Cxaob3tc.js → ModerationContextLimits-_knOVCH0.js} +63 -8
  15. package/cjs/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
  16. package/cjs/{ReactUpload-Cx3Hi7xt.js → ReactUpload-BtmIrdky.js} +1 -1
  17. package/{esm/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → cjs/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
  18. package/cjs/{TestTriggers-Cvi7e2KA-DcT1pc_W.js → TestTriggers-uL2Ec8Vt-cPmmKvYd.js} +14 -15
  19. package/cjs/{UploadController-CC1afxmL.js → UploadController-CEL3N4Ae.js} +2 -2
  20. package/cjs/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.d.ts} +5 -1
  21. package/cjs/app.d.ts +4 -4
  22. package/cjs/app.js +2 -2
  23. package/cjs/elements.d.ts +4 -4
  24. package/cjs/elements.js +4 -4
  25. package/cjs/{index-BDxmVi-G.d.ts → index-DQUZYLVY.d.ts} +2 -2
  26. package/cjs/index.d.ts +3 -3
  27. package/cjs/index.js +1 -1
  28. package/cjs/react-native.d.ts +2 -2
  29. package/cjs/react-native.js +5 -5
  30. package/cjs/react.d.ts +4 -4
  31. package/cjs/react.js +5 -5
  32. package/cjs/server.d.ts +4 -4
  33. package/cjs/server.js +2 -2
  34. package/cjs/test-inputs.d.ts +1 -1
  35. package/cjs/test-inputs.js +13 -13
  36. package/cjs/testing.d.ts +36 -7
  37. package/cjs/testing.js +112 -43
  38. package/cjs/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.d.ts} +2 -2
  39. package/cjs/{ui-I75EvP9r.js → ui-DVQm0TFJ.js} +2 -2
  40. package/cjs/ui.d.ts +2 -2
  41. package/cjs/ui.js +3 -3
  42. package/cjs/vue.d.ts +5 -5
  43. package/cjs/vue.js +4 -4
  44. package/esm/{BrowserUpload-DJZY1LSU.d.ts → BrowserUpload-CRbCsX7a.d.ts} +2 -2
  45. package/esm/{BrowserUpload-CejeWw5r.js → BrowserUpload-DSq5Ezo1.js} +1 -1
  46. package/esm/{CalmLensAppClient-BxkCVPCl.js → CalmLensAppClient-B1QpSXYm.js} +3 -3
  47. package/{cjs/CalmLensAppClient-DzoSqUgG.d.ts → esm/CalmLensAppClient-B3u6BlP5.d.ts} +2 -2
  48. package/esm/{CalmLensOptionKeys-DC9FUO43.js → CalmLensOptionKeys-BYqFZ0FP.js} +2 -2
  49. package/esm/{CalmLensServerClient-D3K5HS9v.d.ts → CalmLensServerClient-B8ntjNL3.d.ts} +6 -6
  50. package/esm/{CalmLensServerClient-D-TIIQp2.js → CalmLensServerClient-D2Vr_jTR.js} +10 -10
  51. package/esm/{CalmLensTypes-OWZsGvBX.d.ts → CalmLensTypes-CtO4Dieu.d.ts} +79 -8
  52. package/{cjs/Core-CTO_Eh0l.d.ts → esm/Core-BJaLU71Q.d.ts} +2 -2
  53. package/esm/{Core-B85V5dxv.js → Core-Dz7BAias.js} +7 -4
  54. package/esm/{CryptoUtils-B_x8lMIx-DhuWGzqn.js → CryptoUtils-BLCa-oZe-DKr3LmN6.js} +1 -2
  55. package/esm/{ModerationContextLimits-Tev2lxE0.js → ModerationContextLimits-DaFaXt45.js} +46 -9
  56. package/esm/{ReactUpload-BDXV4aHT.d.ts → ReactUpload-BGUkcMpg.d.ts} +1 -1
  57. package/esm/{ReactUpload-B7QXMSWJ.js → ReactUpload-kSzn3SOj.js} +1 -1
  58. package/{cjs/TestTriggers-Dnukm-jm-DoEB7jJc.d.ts → esm/TestTriggers-dognME9k-PWyIfHMI.d.ts} +1 -2
  59. package/esm/{TestTriggers-Cvi7e2KA-BA83CRJb.js → TestTriggers-uL2Ec8Vt-DYbTEJWm.js} +11 -12
  60. package/esm/{UploadController-D7XmzO-p.js → UploadController--Qz3DP2W.js} +2 -2
  61. package/esm/{WebhookPayload-CrMU6lg0.d.ts → WebhookPayload-DZadhbAJ.d.ts} +5 -1
  62. package/esm/app.d.ts +4 -4
  63. package/esm/app.js +2 -2
  64. package/esm/elements.d.ts +4 -4
  65. package/esm/elements.js +4 -4
  66. package/esm/{index-BDxmVi-G.d.ts → index-DQUZYLVY.d.ts} +2 -2
  67. package/esm/index.d.ts +3 -3
  68. package/esm/index.js +1 -1
  69. package/esm/react-native.d.ts +2 -2
  70. package/esm/react-native.js +5 -5
  71. package/esm/react.d.ts +4 -4
  72. package/esm/react.js +5 -5
  73. package/esm/server.d.ts +4 -4
  74. package/esm/server.js +2 -2
  75. package/esm/test-inputs.d.ts +1 -1
  76. package/esm/test-inputs.js +1 -1
  77. package/esm/testing.d.ts +36 -7
  78. package/esm/testing.js +103 -34
  79. package/esm/{ui-cE1lyljs.js → ui-B951EpwC.js} +2 -2
  80. package/esm/{ui-DAbpyM2Z.d.ts → ui-BGywTQ2M.d.ts} +2 -2
  81. package/esm/ui.d.ts +2 -2
  82. package/esm/ui.js +3 -3
  83. package/esm/vue.d.ts +5 -5
  84. package/esm/vue.js +4 -4
  85. package/package.json +1 -1
@@ -1,8 +1,7 @@
1
- // src/contract/CryptoUtils-B_x8lMIx.js
1
+ // src/contract/CryptoUtils-BLCa-oZe.js
2
2
  const encoder = new TextEncoder();
3
3
  /** Lowercase hex of `bytes`, two characters per byte. */
4
4
  const bytesToHex = (bytes) => Array.from(bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes), (byte) => byte.toString(16).padStart(2, "0")).join("");
5
- /** SHA-256 of the UTF-8 encoding of `value`, as lowercase hex. */
6
5
  const sha256Hex = async (value) => bytesToHex(await crypto.subtle.digest("SHA-256", encoder.encode(value)));
7
6
  /** HMAC-SHA256 of `message` keyed with `secret` (both UTF-8 encoded), as lowercase hex. */
8
7
  const hmacSha256Hex = async (secret, message) => {
@@ -40,6 +40,7 @@ const API_ERROR_CODES = {
40
40
  INVALID_IMAGE: "image/invalid",
41
41
  IMAGE_TOO_LARGE: "image/too-large",
42
42
  FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted",
43
+ WEBSITE_BILLING_REQUIRED: "payment/billing-required",
43
44
  UPLOADS_PAUSED: "usage/uploads-paused",
44
45
  UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type",
45
46
  INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid",
@@ -79,6 +80,7 @@ const API_ERROR_CODES = {
79
80
  HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found",
80
81
  HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached",
81
82
  HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached",
83
+ HASH_LIST_ENTRY_QUALITY_TOO_LOW: "hash-list-entry/quality-too-low",
82
84
  HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed",
83
85
  POLICY_NOT_FOUND: "policy/not-found",
84
86
  POLICY_REVISION_CONFLICT: "policy/revision-conflict",
@@ -151,7 +153,7 @@ const API_ERROR_DEFINITIONS = {
151
153
  },
152
154
  "signed-url/original-not-granted": {
153
155
  status: 403,
154
- message: "This signed asset URL doesn't grant the original file. Sign it with original access."
156
+ message: "This signed asset URL doesn't grant the original file. Sign a URL for the original resource."
155
157
  },
156
158
  "validation/invalid-request": {
157
159
  status: 400,
@@ -277,6 +279,10 @@ const API_ERROR_DEFINITIONS = {
277
279
  status: 403,
278
280
  message: "This project's organisation has used its free uploads. Set up billing to continue uploading."
279
281
  },
282
+ "payment/billing-required": {
283
+ status: 409,
284
+ message: "Set up billing to upload websites."
285
+ },
280
286
  "usage/uploads-paused": {
281
287
  status: 402,
282
288
  message: "This upload would pass its organisation's usage limits, so it was refused. See details.reason; an owner can review them in Billing."
@@ -433,6 +439,10 @@ const API_ERROR_DEFINITIONS = {
433
439
  status: 409,
434
440
  message: "This project's hash lists hold the most entries they can. Remove entries to add more."
435
441
  },
442
+ "hash-list-entry/quality-too-low": {
443
+ status: 422,
444
+ message: "This hash cannot be matched. Use a more detailed image or a hash of higher quality."
445
+ },
436
446
  "hash-list/asset-not-hashed": {
437
447
  status: 409,
438
448
  message: "This asset has no perceptual hash. Only image assets that finished processing can be added."
@@ -1052,7 +1062,7 @@ const listPages = (fetchPage, { cursor, feed = false } = {}) => {
1052
1062
  };
1053
1063
  // src/client/CalmLensVersion.ts
1054
1064
  /** This SDK's version, from its package.json. */
1055
- const SDK_VERSION = "0.27.5";
1065
+ const SDK_VERSION = "0.28.0";
1056
1066
  const runtimeName = () => {
1057
1067
  const runtime = globalThis;
1058
1068
  if (isReactNativeRuntime()) return "react-native";
@@ -1432,7 +1442,7 @@ var CalmLensTransport = class {
1432
1442
  }
1433
1443
  }
1434
1444
  };
1435
- // src/contract/SharedConstants-DxUCZwLZ.js
1445
+ // src/contract/SharedConstants-D-QkbICw.js
1436
1446
  const IMPERSONATION_COOKIE_NAME = "CL_impersonation";
1437
1447
  const DAY_MS = 864e5;
1438
1448
  const YEAR_MS = 365 * DAY_MS;
@@ -1545,7 +1555,7 @@ const FIRST_PARTY_COOKIES = {
1545
1555
  },
1546
1556
  ASSET_DASHBOARD_STATE: {
1547
1557
  name: "CL_assetDashboardState",
1548
- description: "Remembers your asset dashboard view (view mode, filters, sorting and folder)",
1558
+ description: "Remembers your asset dashboard view (view mode and metadata grouping)",
1549
1559
  expirationDescription: "1 year",
1550
1560
  expirationMs: YEAR_MS,
1551
1561
  type: "functional",
@@ -1593,6 +1603,14 @@ const FIRST_PARTY_COOKIES = {
1593
1603
  type: "functional",
1594
1604
  providerName: "CalmLens"
1595
1605
  },
1606
+ CHATGPT_AD_CLICK: {
1607
+ name: "CL_chatgptAdClick",
1608
+ description: "Links a ChatGPT ad click to signups, moderation checks and credit checkouts",
1609
+ expirationDescription: "30 days",
1610
+ expirationMs: 30 * DAY_MS,
1611
+ type: "marketing",
1612
+ providerName: "CalmLens"
1613
+ },
1596
1614
  SEARCH_SDK_LANGUAGE: {
1597
1615
  name: "CL_searchSdkLanguage",
1598
1616
  description: "Remembers the SDK you chose to filter documentation search results by",
@@ -2272,6 +2290,15 @@ const appendAssetLocation = (assetUrl, location) => {
2272
2290
  }
2273
2291
  return `${path}${viewerClaimsQuery(viewerClaims)}`;
2274
2292
  };
2293
+ /**
2294
+ * The lens, transform and viewer claims added to a URL the API signed for `location.resource`,
2295
+ * which already ends in that resource.
2296
+ */
2297
+ const appendSignedLocation = (signedUrl, location) => {
2298
+ const resourcePath = location.resource === void 0 ? "" : `/${ASSET_RESOURCE_PATHS[location.resource]}`;
2299
+ if (!signedUrl.endsWith(resourcePath)) throw new CalmLensError(SDK_ERROR_CODES.INVALID_RESPONSE, { message: "The signed asset URL doesn't end in the resource it was signed for" });
2300
+ return `${signedUrl}${appendAssetLocation("", location).slice(resourcePath.length)}`;
2301
+ };
2275
2302
  /** An asset's public URL beneath a CDN base URL, with any resource, selector and claims. */
2276
2303
  const buildAssetUrl = (cdnBaseUrl, projectId, options) => {
2277
2304
  const { assetId, externalId, resource, lens, transform, viewerClaims } = options;
@@ -2288,16 +2315,26 @@ const buildAssetUrl = (cdnBaseUrl, projectId, options) => {
2288
2315
  };
2289
2316
  /** Checks `signAssetUrl`'s own options as the API does, before anything is sent. */
2290
2317
  const validateSignAssetUrlOptions = (options) => {
2291
- const { expiresIn, original } = options;
2318
+ const { expiresIn } = options;
2292
2319
  if (expiresIn !== void 0 && (!Number.isInteger(expiresIn) || expiresIn < 1 || expiresIn > 86400)) throw invalidArgument(`expiresIn must be a whole number from 1 to ${MAX_SIGNED_URL_EXPIRES_IN}`);
2293
- if (original !== void 0 && typeof original !== "boolean") throw invalidArgument("original must be a boolean");
2294
2320
  getAssetSegment(options);
2295
2321
  appendAssetLocation("", options);
2296
2322
  };
2323
+ /**
2324
+ * The asset URL of `url`, without its query: an asset URL (`…/assets/{projectId}/{asset}`) as it
2325
+ * is, and a resource URL beneath one, such as a URL signed for `original` or a rendered image's
2326
+ * lens URL, cut back to the asset URL its resources are paths beneath.
2327
+ */
2328
+ const assetUrlOf = (url) => {
2329
+ const path = (url.split("?", 1)[0] ?? "").replace(/\/+$/, "");
2330
+ const parts = path.split("/");
2331
+ const assets = parts.lastIndexOf("assets");
2332
+ return assets >= 3 && parts.length > assets + 3 ? parts.slice(0, assets + 3).join("/") : path;
2333
+ };
2297
2334
  /** An asset URL without its query: the viewer claims it carried, if any, are returned apart. */
2298
2335
  const splitAssetUrl = (url) => {
2299
- const [path = "", query] = url.split("?", 2);
2300
- const base = path.replace(/\/+$/, "");
2336
+ const query = url.split("?", 2)[1];
2337
+ const base = assetUrlOf(url);
2301
2338
  const raw = query ? new URLSearchParams(query).get("viewerClaims") : null;
2302
2339
  if (raw === null) return { base };
2303
2340
  try {
@@ -2394,6 +2431,12 @@ Object.defineProperty(exports, "API_ERROR_DEFINITIONS", {
2394
2431
  return API_ERROR_DEFINITIONS;
2395
2432
  }
2396
2433
  });
2434
+ Object.defineProperty(exports, "ASSET_RESOURCE_PATHS", {
2435
+ enumerable: true,
2436
+ get: function() {
2437
+ return ASSET_RESOURCE_PATHS;
2438
+ }
2439
+ });
2397
2440
  Object.defineProperty(exports, "AUTO_PAGING_TO_ARRAY_MAX", {
2398
2441
  enumerable: true,
2399
2442
  get: function() {
@@ -2586,6 +2629,18 @@ Object.defineProperty(exports, "appendAssetLocation", {
2586
2629
  return appendAssetLocation;
2587
2630
  }
2588
2631
  });
2632
+ Object.defineProperty(exports, "appendSignedLocation", {
2633
+ enumerable: true,
2634
+ get: function() {
2635
+ return appendSignedLocation;
2636
+ }
2637
+ });
2638
+ Object.defineProperty(exports, "assetUrlOf", {
2639
+ enumerable: true,
2640
+ get: function() {
2641
+ return assetUrlOf;
2642
+ }
2643
+ });
2589
2644
  Object.defineProperty(exports, "buildAssetUrl", {
2590
2645
  enumerable: true,
2591
2646
  get: function() {
@@ -1,4 +1,4 @@
1
- import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-CTO_Eh0l.js";
1
+ import { F as UploadFile, L as UploadSnapshot, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions } from "./Core-BJaLU71Q.js";
2
2
  import { ReactNode } from "react";
3
3
  type CalmLensProviderProps<F extends UploadFile = File> = CalmLensProvidedOptions<F> & {
4
4
  children?: ReactNode;
@@ -1,4 +1,4 @@
1
- const require_UploadController = require("./UploadController-CC1afxmL.js");
1
+ const require_UploadController = require("./UploadController-CEL3N4Ae.js");
2
2
  let react = require("react");
3
3
  // src/ui/ReactUpload.ts
4
4
  const CalmLensContext = (0, react.createContext)(void 0);
@@ -88,7 +88,6 @@ declare const TEST_INPUT_SCHEMA: z.ZodObject<{
88
88
  score: z.ZodOptional<z.ZodNumber>;
89
89
  action: z.ZodOptional<z.ZodEnum<{
90
90
  "age-restrict": "age-restrict";
91
- allow: "allow";
92
91
  block: "block";
93
92
  limit: "limit";
94
93
  }>>;
@@ -396,7 +395,7 @@ declare function detectTestImage(image: RgbaImage, key: string,
396
395
  instances: {
397
396
  category: "criminal-activity" | "harassment" | "hate" | "personal-information" | "profanity" | "self-harm" | "sexual" | "violence";
398
397
  score?: number | undefined;
399
- action?: "age-restrict" | "allow" | "block" | "limit" | undefined;
398
+ action?: "age-restrict" | "block" | "limit" | undefined;
400
399
  qualifiers: ("criminal-activity-alcohol" | "criminal-activity-coded-incitement" | "criminal-activity-csam" | "criminal-activity-demonstration" | "criminal-activity-discussion" | "criminal-activity-documentary" | "criminal-activity-educational" | "criminal-activity-fictional" | "criminal-activity-fraud" | "criminal-activity-gambling" | "criminal-activity-graffiti" | "criminal-activity-grooming" | "criminal-activity-historical" | "criminal-activity-instructions" | "criminal-activity-preparation" | "criminal-activity-promotion" | "criminal-activity-request" | "criminal-activity-sexual-solicitation" | "criminal-activity-substances" | "criminal-activity-support-prevention" | "criminal-activity-tobacco" | "harassment-abuse" | "harassment-bullying" | "harassment-documentary" | "harassment-educational" | "harassment-encouragement" | "harassment-fictional" | "harassment-historical" | "harassment-mild" | "harassment-public-target" | "harassment-sexual" | "harassment-support-prevention" | "harassment-threat" | "hate-abuse" | "hate-adjudicated-nazi-crimes-denial" | "hate-counterspeech" | "hate-dehumanization" | "hate-documentary" | "hate-educational" | "hate-exclusion" | "hate-fictional" | "hate-historical" | "hate-hostility" | "hate-inferiority" | "hate-nazi-genocide-denial-or-approval" | "hate-nazi-genocide-public-peace" | "hate-nazi-insignia-public-display" | "hate-nazi-symbols-public-display" | "hate-personal" | "hate-slurs" | "hate-support-prevention" | "hate-symbol" | "hate-threat" | "personal-information-contact" | "personal-information-credentials" | "personal-information-documentary" | "personal-information-educational" | "personal-information-email" | "personal-information-fictional" | "personal-information-financial" | "personal-information-government-id" | "personal-information-historical" | "personal-information-identifiers" | "personal-information-location" | "personal-information-phone" | "personal-information-request" | "personal-information-self-disclosure" | "personal-information-support-prevention" | "personal-information-third-party" | "profanity-documentary" | "profanity-educational" | "profanity-fictional" | "profanity-historical" | "profanity-mild" | "profanity-obfuscated" | "profanity-slurs" | "profanity-strong" | "profanity-support-prevention" | "self-harm-act" | "self-harm-age-restricted" | "self-harm-documentary" | "self-harm-educational" | "self-harm-encouragement" | "self-harm-fictional" | "self-harm-historical" | "self-harm-methods" | "self-harm-preparation" | "self-harm-support-prevention" | "self-harm-thoughts" | "sexual-activity" | "sexual-adult-promotion" | "sexual-artistic" | "sexual-assault-media" | "sexual-discussion" | "sexual-documentary" | "sexual-educational" | "sexual-explicit-language" | "sexual-extreme" | "sexual-fictional" | "sexual-historical" | "sexual-incest" | "sexual-intimate-image-abuse" | "sexual-minors" | "sexual-non-consensual" | "sexual-non-erotic-nudity" | "sexual-nudity" | "sexual-paid" | "sexual-pornographic-media" | "sexual-revealing-clothing" | "sexual-solicitation" | "sexual-strangulation" | "sexual-suggestive" | "sexual-support-prevention" | "sexual-text" | "violence-attack" | "violence-coded-incitement" | "violence-decapitation-act" | "violence-discussion" | "violence-documentary" | "violence-educational" | "violence-encouragement" | "violence-extremism" | "violence-fantasy" | "violence-fictional" | "violence-gore" | "violence-graphic" | "violence-high-impact" | "violence-historical" | "violence-injury" | "violence-natural-death" | "violence-preparation" | "violence-sport" | "violence-support-prevention" | "violence-text" | "violence-threat" | "violence-violent-death" | "violence-weapon" | "violence-wish")[];
401
400
  }[];
402
401
  detections?: {
@@ -19,7 +19,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
19
19
  value: mod,
20
20
  enumerable: true
21
21
  }) : target, mod));
22
- const require_CryptoUtils_B_x8lMIx = require("./CryptoUtils-B_x8lMIx-YBW1-bvL.js");
22
+ const require_CryptoUtils_BLCa_oZe = require("./CryptoUtils-BLCa-oZe-leCkr1ko.js");
23
23
  let zod = require("zod");
24
24
  zod = __toESM(zod, 1);
25
25
  // src/contract/ModerationCategories-CHFRoeWV.js
@@ -33,7 +33,7 @@ const CLASSIFICATION_CATEGORIES = [
33
33
  "personal-information",
34
34
  "profanity"
35
35
  ];
36
- // src/contract/LazySchema-D_3-dV1e.js
36
+ // src/contract/LazySchema-BKMpWIaF.js
37
37
  const registryMap = zod.globalRegistry._map;
38
38
  /**
39
39
  * A schema built the first time anything reads it, rather than when its module loads. Building
@@ -55,9 +55,9 @@ const lazySchema = /* @__NO_SIDE_EFFECTS__ */ (build) => {
55
55
  if (!schema) {
56
56
  const built = build();
57
57
  schema = built;
58
+ const internals = built._zod;
58
59
  const meta = registryMap.get(built);
59
60
  if (meta !== void 0) registryMap.set(proxy, meta);
60
- const internals = built._zod;
61
61
  const process = internals.processJSONSchema;
62
62
  if (process) internals.processJSONSchema = (context, json, params) => {
63
63
  const record = context.seen.get(proxy);
@@ -103,7 +103,7 @@ const lazySchema = /* @__NO_SIDE_EFFECTS__ */ (build) => {
103
103
  });
104
104
  return proxy;
105
105
  };
106
- // src/contract/Jurisdiction-CQN8qnzX.js
106
+ // src/contract/Jurisdiction-uODFGQGo.js
107
107
  /**
108
108
  * Jurisdictions with legal rules always apply to every project. An optional jurisdiction is a
109
109
  * product standard rather than a legal floor: every project serves it unless it opts out.
@@ -155,7 +155,7 @@ Object.keys(JURISDICTIONS).filter((code) => !JURISDICTIONS[code].optional);
155
155
  Object.keys(JURISDICTIONS).filter((code) => JURISDICTIONS[code].optional);
156
156
  new Set("AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW".split(" "));
157
157
  new Set("AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE".split(" "));
158
- // src/contract/TestRegionalActions-BhyWuU49.js
158
+ // src/contract/TestRegionalActions-Ce8EVv4q.js
159
159
  /**
160
160
  * Marks English text in shared, backend and data modules that the portal shows, so the app's
161
161
  * message catalog (packages/app/vite/messageCatalog.ts) extracts it and the portal can translate it
@@ -1186,7 +1186,7 @@ const TEST_REGIONAL_ACTIONS_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.array(
1186
1186
  "block"
1187
1187
  ])
1188
1188
  }).strict()).max(7).refine((entries) => new Set(entries.map((entry) => entry.region)).size === entries.length, "Choose each region once"));
1189
- // src/contract/TestTriggers-Cvi7e2KA.js
1189
+ // src/contract/TestTriggers-uL2Ec8Vt.js
1190
1190
  /**
1191
1191
  * The visual encoding of test images (shared by images and video frames), independent of what the
1192
1192
  * bytes mean. An odd N×N grid of square cells fills the image. Its outer ring alternates black and
@@ -1604,7 +1604,7 @@ const TEXT_CODE_SIGNALS = [
1604
1604
  /** A 128-bit, domain-separated tag; published samples never contain the project key. */
1605
1605
  const getTestInputTag = async (kind, signal, testInputKey) => {
1606
1606
  if (!TEST_INPUT_KEY_PATTERN.test(testInputKey)) throw new TypeError("Invalid test input key");
1607
- return (await require_CryptoUtils_B_x8lMIx.hmacSha256Hex(testInputKey, `calmlens-test:${kind}:${signal}`)).slice(0, 32);
1607
+ return (await require_CryptoUtils_BLCa_oZe.hmacSha256Hex(testInputKey, `calmlens-test:${kind}:${signal}`)).slice(0, 32);
1608
1608
  };
1609
1609
  /** Category shortcuts are presets in the same instance-based format. */
1610
1610
  function testInputForSignal(signal, kind = "text") {
@@ -1646,19 +1646,19 @@ const TEST_FACE_AGE_PRESETS = {
1646
1646
  }
1647
1647
  };
1648
1648
  const TEST_FACE_AGE_MAX = 120;
1649
- const basisPoints = zod.number().int().min(0).max(TEST_DETECTION_BOX_MAX);
1649
+ const basisPoints = /* @__PURE__ */ lazySchema(() => zod.number().int().min(0).max(TEST_DETECTION_BOX_MAX));
1650
1650
  const detectionShape = {
1651
- box: zod.tuple([
1651
+ box: /* @__PURE__ */ lazySchema(() => zod.tuple([
1652
1652
  basisPoints,
1653
1653
  basisPoints,
1654
1654
  basisPoints,
1655
1655
  basisPoints
1656
- ]),
1657
- confidence: zod.number().int().min(0).max(100).optional()
1656
+ ])),
1657
+ confidence: /* @__PURE__ */ lazySchema(() => zod.number().int().min(0).max(100).optional())
1658
1658
  };
1659
1659
  const fitsImage = ({ box: [left, top, width, height] }) => left + width <= 1e4 && top + height <= 1e4;
1660
1660
  const BOX_MESSAGE = msg("A box must lie inside the image: left + width and top + height are at most 10000.");
1661
- const ageYears = zod.number().int().min(0).max(120);
1661
+ const ageYears = /* @__PURE__ */ lazySchema(() => zod.number().int().min(0).max(120));
1662
1662
  const TEST_DETECTED_PERSON_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.object(detectionShape).strict().refine(fitsImage, BOX_MESSAGE));
1663
1663
  const TEST_DETECTED_FACE_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.object({
1664
1664
  ...detectionShape,
@@ -1680,7 +1680,6 @@ const TEST_INPUT_SCHEMA = /* @__PURE__ */ lazySchema(() => zod.object({
1680
1680
  category: zod.enum(CLASSIFICATION_CATEGORIES),
1681
1681
  score: zod.number().min(0).max(1).optional(),
1682
1682
  action: zod.enum([
1683
- "allow",
1684
1683
  "limit",
1685
1684
  "age-restrict",
1686
1685
  "block"
@@ -1866,7 +1865,7 @@ const TEST_INPUT_PRESETS = {
1866
1865
  * removed before the signature is checked.
1867
1866
  */
1868
1867
  const WHOLE_CODE = /^<!calmlens-\s*test\s+([A-Za-z0-9_\s-]{33,16384})>$/;
1869
- const tag = async (payload, key) => (await require_CryptoUtils_B_x8lMIx.hmacSha256Hex(key, `calmlens-test:v2:${payload}`)).slice(0, 32);
1868
+ const tag = async (payload, key) => (await require_CryptoUtils_BLCa_oZe.hmacSha256Hex(key, `calmlens-test:v2:${payload}`)).slice(0, 32);
1870
1869
  const toBase64Url = (bytes) => btoa(String.fromCharCode(...bytes)).replaceAll("+", "-").replaceAll("/", "_").replace(/=+$/, "");
1871
1870
  const fromBase64Url = (text) => Uint8Array.from(atob(text.replaceAll("-", "+").replaceAll("_", "/")), (char) => char.charCodeAt(0));
1872
1871
  /** The signed bytes: the scenario's canonical JSON (ASCII). */
@@ -1889,7 +1888,7 @@ async function detectTestTrigger(text, key) {
1889
1888
  const code = match[1].replace(/\s+/g, "");
1890
1889
  const signature = code.slice(0, 32);
1891
1890
  const payload = code.slice(32);
1892
- if (!/^[a-f0-9]{32}$/.test(signature) || !payload || payload.length > 8e3 || !require_CryptoUtils_B_x8lMIx.timingSafeEqual(signature, await tag(payload, key))) return;
1891
+ if (!/^[a-f0-9]{32}$/.test(signature) || !payload || payload.length > 8e3 || !require_CryptoUtils_BLCa_oZe.timingSafeEqual(signature, await tag(payload, key))) return;
1893
1892
  try {
1894
1893
  const json = fromBase64Url(payload);
1895
1894
  if (json.some((byte) => byte > 127)) return;
@@ -1,5 +1,5 @@
1
- const require_ModerationContextLimits = require("./ModerationContextLimits-Cxaob3tc.js");
2
- const require_CalmLensAppClient = require("./CalmLensAppClient-BA_xaNHY.js");
1
+ const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
2
+ const require_CalmLensAppClient = require("./CalmLensAppClient-B0QZ1oJV.js");
3
3
  // src/contract/PlaceholderHashDecode.js
4
4
  /**
5
5
  * Decodes a ThumbHash to an RGBA image. RGB is not be premultiplied by A.
@@ -1,4 +1,4 @@
1
- import { cn as EventAsset, ln as TypedEvent, sn as Actor } from "./CalmLensTypes-OWZsGvBX.js";
1
+ import { cn as EventAsset, ln as TypedEvent, sn as Actor } from "./CalmLensTypes-CtO4Dieu.js";
2
2
  import * as zod from "zod";
3
3
  /** Error codes the CalmLens API documents, by name. */
4
4
  declare const API_ERROR_CODES: {
@@ -41,6 +41,7 @@ declare const API_ERROR_CODES: {
41
41
  readonly INVALID_IMAGE: "image/invalid";
42
42
  readonly IMAGE_TOO_LARGE: "image/too-large";
43
43
  readonly FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted";
44
+ readonly WEBSITE_BILLING_REQUIRED: "payment/billing-required";
44
45
  readonly UPLOADS_PAUSED: "usage/uploads-paused";
45
46
  readonly UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type";
46
47
  readonly INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid";
@@ -80,6 +81,7 @@ declare const API_ERROR_CODES: {
80
81
  readonly HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found";
81
82
  readonly HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached";
82
83
  readonly HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached";
84
+ readonly HASH_LIST_ENTRY_QUALITY_TOO_LOW: "hash-list-entry/quality-too-low";
83
85
  readonly HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed";
84
86
  readonly POLICY_NOT_FOUND: "policy/not-found";
85
87
  readonly POLICY_REVISION_CONFLICT: "policy/revision-conflict";
@@ -189,6 +191,7 @@ declare const CALMLENS_ERROR_CODES: {
189
191
  readonly INVALID_IMAGE: "image/invalid";
190
192
  readonly IMAGE_TOO_LARGE: "image/too-large";
191
193
  readonly FREE_UPLOADS_EXHAUSTED: "usage/free-uploads-exhausted";
194
+ readonly WEBSITE_BILLING_REQUIRED: "payment/billing-required";
192
195
  readonly UPLOADS_PAUSED: "usage/uploads-paused";
193
196
  readonly UNSUPPORTED_UPLOAD_TYPE: "upload/unsupported-type";
194
197
  readonly INVALID_UPLOAD_PAYLOAD: "upload-payload/invalid";
@@ -228,6 +231,7 @@ declare const CALMLENS_ERROR_CODES: {
228
231
  readonly HASH_LIST_ENTRY_NOT_FOUND: "hash-list-entry/not-found";
229
232
  readonly HASH_LIST_LIMIT_REACHED: "hash-list/limit-reached";
230
233
  readonly HASH_LIST_ENTRY_LIMIT_REACHED: "hash-list-entry/limit-reached";
234
+ readonly HASH_LIST_ENTRY_QUALITY_TOO_LOW: "hash-list-entry/quality-too-low";
231
235
  readonly HASH_LIST_ASSET_NOT_HASHED: "hash-list/asset-not-hashed";
232
236
  readonly POLICY_NOT_FOUND: "policy/not-found";
233
237
  readonly POLICY_REVISION_CONFLICT: "policy/revision-conflict";
package/cjs/app.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { a as ClassificationNotEvaluatedReason, c as ModerationQualifier, d as HashListEntry, f as ModerationContext, g as selectModerationContextItems, h as ModerationContextItem, i as ClassificationCategoryReport, l as PolicyAction, m as MODERATION_CONTEXT_USED_ITEMS, n as ClassificationCategories, o as ClassificationQualifierResults, p as MODERATION_CONTEXT_USED_CHARACTERS, r as ClassificationCategory, s as Likelihood, u as HashList } from "./Classification-CMM2tZpJ-IdIh63n0.js";
2
- import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-OWZsGvBX.js";
3
- import { t as CalmLensAppClient } from "./CalmLensAppClient-DzoSqUgG.js";
4
- import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-BDxmVi-G.js";
5
- import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-CrMU6lg0.js";
2
+ import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-CtO4Dieu.js";
3
+ import { t as CalmLensAppClient } from "./CalmLensAppClient-B3u6BlP5.js";
4
+ import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-DQUZYLVY.js";
5
+ import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-DZadhbAJ.js";
6
6
  export { AUTO_PAGING_TO_ARRAY_MAX, type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type AppInfo, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type AutoPaging, type AutoPagingToArrayOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, CalmLensAppClient, type CalmLensAppClientOptions, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorKind, type CalmLensErrorOptions, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, type CalmLensLastResponse, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, type CalmLensResponse, type CalmLensServerClientOptions, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnResponse, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ClientRequestDefaults, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPage, type ListPoliciesOptions, type ListPromise, type ListUploadPresetsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestAttempt, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type ServedAssetInfo, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
package/cjs/app.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ModerationContextLimits = require("./ModerationContextLimits-Cxaob3tc.js");
2
+ const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
3
3
  require("./index.js");
4
- const require_CalmLensAppClient = require("./CalmLensAppClient-BA_xaNHY.js");
4
+ const require_CalmLensAppClient = require("./CalmLensAppClient-B0QZ1oJV.js");
5
5
  exports.AUTO_PAGING_TO_ARRAY_MAX = require_ModerationContextLimits.AUTO_PAGING_TO_ARRAY_MAX;
6
6
  exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
7
7
  exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
package/cjs/elements.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { i as AssetAvailability } from "./CalmLensTypes-OWZsGvBX.js";
2
- import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-CTO_Eh0l.js";
3
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-DJZY1LSU.js";
4
- import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-DAbpyM2Z.js";
1
+ import { i as AssetAvailability } from "./CalmLensTypes-CtO4Dieu.js";
2
+ import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-BJaLU71Q.js";
3
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CRbCsX7a.js";
4
+ import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-BGywTQ2M.js";
5
5
  declare const BaseElement$1: typeof HTMLElement;
6
6
  /**
7
7
  * An asset viewer element. Set the `src` attribute to the asset URL (public or signed) and the
package/cjs/elements.js CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ui = require("./ui-I75EvP9r.js");
3
- const require_Core = require("./Core-kKGmyk5V.js");
4
- const require_UploadController = require("./UploadController-CC1afxmL.js");
2
+ const require_ui = require("./ui-DVQm0TFJ.js");
3
+ const require_Core = require("./Core-DCnnUsgF.js");
4
+ const require_UploadController = require("./UploadController-CEL3N4Ae.js");
5
5
  const require_FileIcons = require("./FileIcons-Ob003MdS.js");
6
- const require_BrowserUpload = require("./BrowserUpload-DhruIgFN.js");
6
+ const require_BrowserUpload = require("./BrowserUpload-Dz4UwTTJ.js");
7
7
  // src/viewers/Elements.ts
8
8
  const BaseElement$1 = typeof HTMLElement === "undefined" ? class {} : HTMLElement;
9
9
  const PROPERTIES = [
@@ -1,6 +1,6 @@
1
1
  import "./Classification-CMM2tZpJ-IdIh63n0.js";
2
- import { In as AssetInfo, N as CdnResource, et as GetAssetInfoOptions } from "./CalmLensTypes-OWZsGvBX.js";
3
- import "./WebhookPayload-CrMU6lg0.js";
2
+ import { In as AssetInfo, N as CdnResource, et as GetAssetInfoOptions } from "./CalmLensTypes-CtO4Dieu.js";
3
+ import "./WebhookPayload-DZadhbAJ.js";
4
4
  /** Every CDN resource beneath an asset URL, as `getAssetUrl` and `signAssetUrl` accept them. */
5
5
  declare const CDN_RESOURCES: CdnResource[];
6
6
  /**
package/cjs/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as ClassificationNotEvaluatedReason, c as ModerationQualifier, d as HashListEntry, f as ModerationContext, g as selectModerationContextItems, h as ModerationContextItem, i as ClassificationCategoryReport, l as PolicyAction, m as MODERATION_CONTEXT_USED_ITEMS, n as ClassificationCategories, o as ClassificationQualifierResults, p as MODERATION_CONTEXT_USED_CHARACTERS, r as ClassificationCategory, s as Likelihood, u as HashList } from "./Classification-CMM2tZpJ-IdIh63n0.js";
2
- import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-OWZsGvBX.js";
3
- import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-BDxmVi-G.js";
4
- import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-CrMU6lg0.js";
2
+ import { $ as FolderPage, $t as VerifyWebhookSignatureOptions, A as CdnAssetLocation, An as Policy, At as RetrieveAssetOptions, B as CreateHashListOptions, Bn as AssetRendered, Bt as UpdateAssetOptions, C as AssetUploadStatus, Cn as BoundingBox, Ct as MultipartUploadPartOptions, D as BatchAssetsResponse, Dn as ProcessingFeatureResults, Dt as RequestAttempt, E as BatchAssetsOptions, En as ProcessingFeatureId, Et as RemoveAssetContentOptions, F as CdnTransform, Ft as SignUploadTokenOptions, G as DeleteAssetOptions, Gn as FileMetadata, Gt as UpdateProjectSettingsOptions, H as CreateMultipartUploadPartOptions, Hn as AssetSafetyHold, Ht as UpdateHashListOptions, I as ClassifyTextOptions, In as AssetInfo, It as SignedAssetUrl, J as EnsureLensesOptions, Jt as UploadPresetDefinition, K as DeleteMetadataFieldOptions, Kn as MetadataItem, Kt as UpgradePolicyOptions, L as ClientRequestDefaults, Ln as AssetHls, Lt as SignedUploadToken, M as CdnAssetUrlOptions, Mn as LensType, Mt as SearchAssetsOptions, N as CdnResource, Nn as AssetSearchMatchField, Nt as SetPolicyAutomaticUpdatesOptions, O as CalmLensAppClientOptions, On as ProcessingFeatureStage, Ot as RequestOptions, P as CdnServeOptions, Pn as AssetSearchQuery, Pt as SignAssetUrlOptions, Q as FolderIdOptions, Qt as UploadedAsset, R as ConnectionOptions, Rn as AssetHlsRendition, Rt as StreamingFeatureOptions, S as AssetUpload, Sn as AgeRange, St as MultipartUploadOptions, T as AssignPolicyOptions, Tn as DetectedPerson, Tt as PolicyPage, U as CreatePolicyOptions, Un as AssetSafetyHoldReason, Ut as UpdateLensOptions, V as CreateLensOptions, Vn as AssetRenderedKind, Vt as UpdateFolderOptions, W as DecideAssetOptions, Wn as ExtractedText, Wt as UpdatePolicyOptions, X as EnsureUploadPresetsOptions, Xt as UploadPresetPage, Y as EnsureMetadataFieldsOptions, Yt as UploadPresetIdOptions, Z as EnsureUploadPresetsResponse, Zt as UploadPresetSubmitAssetOptions, _ as AssetPage, _n as Folder, _t as ListLensesOptions, a as AssetChecksums, an as AssetTimelineSegment, at as IdempotencyOptions, b as AssetTimelinePage, bn as PublicProjectSettings, bt as MoveAssetOptions, c as AssetClassificationFailureReason, cn as EventAsset, ct as LensIdOptions, d as AssetContentOptions, dn as EventFact, dt as ListAssetTimelineOptions, en as ViewerClaims, et as GetAssetInfoOptions, f as AssetContentRemovalReason, fn as EventFactValues, ft as ListAssetsOptions, g as AssetModerationStatus, gt as ListHashListsOptions, h as AssetModerationDecision, hn as EventType, ht as ListHashListEntriesOptions, i as AssetAvailability, in as AssetBatchOperation, it as HashListPage, j as CdnAssetReference, jn as CursorPage, jt as RetryAssetOptions, k as CalmLensServerClientOptions, kn as ProcessingFeatures, kt as ResetPolicyOptions, l as AssetClassificationStatus, ln as TypedEvent, lt as LensPage, m as AssetModeration, mn as EventSeverity, mt as ListFoldersOptions, n as AppInfo, nn as WebhookHeadersInput, nt as HashListEntryPage, o as AssetChildrenPage, on as GetEventsResponse, ot as ImageTransformOptions, p as AssetContentStatus, pn as EventFacts, pt as ListEventsOptions, q as EnsureLensOptions, qn as ProcessingOptions, qt as UploadAssetPartOptions, r as Asset, rn as WebhookPayloadInput, rt as HashListIdOptions, s as AssetClassification, st as Lens, t as AddHashListEntryOptions, tn as WaitForAssetDecisionOptions, tt as HashListEntryIdOptions, u as AssetContent, un as EventCategory, ut as ListAssetChildrenOptions, v as AssetSearchResponse, vn as MetadataFieldsResource, vt as ListPoliciesOptions, w as AssetVisibility, wn as DetectedFace, wt as PolicyIdOptions, x as AssetType, xn as UploadPreset, xt as MoveFolderOptions, y as AssetSearchResult, yn as ProjectSettingsResource, yt as ListUploadPresetsOptions, z as CreateFolderOptions, zn as AssetPreview, zt as SubmitAssetOptions } from "./CalmLensTypes-CtO4Dieu.js";
3
+ import { i as getAssetInfo, n as DEFAULT_CDN_BASE_URL, r as CDN_RESOURCES, t as SDK_VERSION } from "./index-DQUZYLVY.js";
4
+ import { A as CalmLensRateLimitError, C as CalmLensErrorKind, D as CalmLensNotFoundError, E as CalmLensInvalidResponseError, F as SdkErrorCode, I as ApiErrorCode, M as CalmLensTimeoutError, N as CalmLensUnprocessableEntityError, O as CalmLensPayloadTooLargeError, P as CalmLensWebhookVerificationError, S as CalmLensErrorDetails, T as CalmLensInvalidArgumentError, _ as CalmLensConfigurationError, a as AUTO_PAGING_TO_ARRAY_MAX, b as CalmLensError, c as CalmLensLastResponse, d as ListPromise, f as CALMLENS_ERROR_CODES, g as CalmLensCancelledError, h as CalmLensBadRequestError, i as ServedAssetInfo, j as CalmLensServerError, k as CalmLensPermissionDeniedError, l as CalmLensResponse, m as CalmLensAuthenticationError, o as AutoPaging, p as CalmLensApiError, r as CdnResponse, s as AutoPagingToArrayOptions, t as ReceivedWebhookEventPayload, u as ListPage, v as CalmLensConflictError, w as CalmLensErrorOptions, x as CalmLensErrorCode, y as CalmLensConnectionError } from "./WebhookPayload-DZadhbAJ.js";
5
5
  export { AUTO_PAGING_TO_ARRAY_MAX, type AddHashListEntryOptions, type AgeRange, type ApiErrorCode, type AppInfo, type Asset, type AssetAvailability, type AssetBatchOperation, type AssetChecksums, type AssetChildrenPage, type AssetClassification, type AssetClassificationFailureReason, type AssetClassificationStatus, type AssetContent, type AssetContentOptions, type AssetContentRemovalReason, type AssetContentStatus, type AssetHls, type AssetHlsRendition, type AssetInfo, type AssetModeration, type AssetModerationDecision, type AssetModerationStatus, type AssetPage, type AssetPreview, type AssetRendered, type AssetRenderedKind, type AssetSafetyHold, type AssetSafetyHoldReason, type AssetSearchMatchField, type AssetSearchQuery, type AssetSearchResponse, type AssetSearchResult, type AssetTimelinePage, type AssetTimelineSegment, type AssetType, type AssetUpload, type AssetUploadStatus, type AssetVisibility, type AssignPolicyOptions, type AutoPaging, type AutoPagingToArrayOptions, type BatchAssetsOptions, type BatchAssetsResponse, type BoundingBox, CALMLENS_ERROR_CODES, CDN_RESOURCES, CalmLensApiError, type CalmLensAppClientOptions, CalmLensAuthenticationError, CalmLensBadRequestError, CalmLensCancelledError, CalmLensConfigurationError, CalmLensConflictError, CalmLensConnectionError, CalmLensError, type CalmLensErrorCode, type CalmLensErrorDetails, type CalmLensErrorKind, type CalmLensErrorOptions, CalmLensInvalidArgumentError, CalmLensInvalidResponseError, type CalmLensLastResponse, CalmLensNotFoundError, CalmLensPayloadTooLargeError, CalmLensPermissionDeniedError, CalmLensRateLimitError, type CalmLensResponse, type CalmLensServerClientOptions, CalmLensServerError, CalmLensTimeoutError, CalmLensUnprocessableEntityError, CalmLensWebhookVerificationError, type CdnAssetLocation, type CdnAssetReference, type CdnAssetUrlOptions, type CdnResource, type CdnResponse, type CdnServeOptions, type CdnTransform, type ClassificationCategories, type ClassificationCategory, type ClassificationCategoryReport, type ClassificationNotEvaluatedReason, type ClassificationQualifierResults, type ClassifyTextOptions, type ClientRequestDefaults, type ConnectionOptions, type CreateFolderOptions, type CreateHashListOptions, type CreateLensOptions, type CreateMultipartUploadPartOptions, type CreatePolicyOptions, type CursorPage, DEFAULT_CDN_BASE_URL, type DecideAssetOptions, type DeleteAssetOptions, type DeleteMetadataFieldOptions, type DetectedFace, type DetectedPerson, type EnsureLensOptions, type EnsureLensesOptions, type EnsureMetadataFieldsOptions, type EnsureUploadPresetsOptions, type EnsureUploadPresetsResponse, type EventAsset, type EventCategory, type EventFact, type EventFactValues, type EventFacts, type EventSeverity, type EventType, type GetEventsResponse as EventsPage, type ExtractedText, type FileMetadata, type Folder, type FolderIdOptions, type FolderPage, type GetAssetInfoOptions, type HashList, type HashListEntry, type HashListEntryIdOptions, type HashListEntryPage, type HashListIdOptions, type HashListPage, type IdempotencyOptions, type ImageTransformOptions, type Lens, type LensIdOptions, type LensPage, type LensType, type Likelihood, type ListAssetChildrenOptions, type ListAssetTimelineOptions, type ListAssetsOptions, type ListEventsOptions, type ListFoldersOptions, type ListHashListEntriesOptions, type ListHashListsOptions, type ListLensesOptions, type ListPage, type ListPoliciesOptions, type ListPromise, type ListUploadPresetsOptions, MODERATION_CONTEXT_USED_CHARACTERS, MODERATION_CONTEXT_USED_ITEMS, type MetadataFieldsResource, type MetadataItem, type ModerationContext, type ModerationContextItem, type ModerationQualifier, type MoveAssetOptions, type MoveFolderOptions, type MultipartUploadOptions, type MultipartUploadPartOptions, type Policy, type PolicyAction, type PolicyIdOptions, type PolicyPage, type ProcessingFeatureId, type ProcessingFeatureResults, type ProcessingFeatureStage, type ProcessingFeatures, type ProcessingOptions, type ProjectSettingsResource, type PublicProjectSettings, type RemoveAssetContentOptions, type RequestAttempt, type RequestOptions, type ResetPolicyOptions, type RetrieveAssetOptions, type RetryAssetOptions, SDK_VERSION, type SdkErrorCode, type SearchAssetsOptions, type ServedAssetInfo, type SetPolicyAutomaticUpdatesOptions, type SignAssetUrlOptions, type SignUploadTokenOptions, type SignedAssetUrl, type SignedUploadToken, type StreamingFeatureOptions, type SubmitAssetOptions, type TypedEvent, type UpdateAssetOptions, type UpdateFolderOptions, type UpdateHashListOptions, type UpdateLensOptions, type UpdatePolicyOptions, type UpdateProjectSettingsOptions, type UpgradePolicyOptions, type UploadAssetPartOptions, type UploadPreset, type UploadPresetDefinition, type UploadPresetIdOptions, type UploadPresetPage, type UploadPresetSubmitAssetOptions, type UploadedAsset, type VerifyWebhookSignatureOptions, type ViewerClaims, type WaitForAssetDecisionOptions, type ReceivedWebhookEventPayload as WebhookEventPayload, type WebhookHeadersInput, type WebhookPayloadInput, getAssetInfo, selectModerationContextItems };
package/cjs/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ModerationContextLimits = require("./ModerationContextLimits-Cxaob3tc.js");
2
+ const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
3
3
  exports.AUTO_PAGING_TO_ARRAY_MAX = require_ModerationContextLimits.AUTO_PAGING_TO_ARRAY_MAX;
4
4
  exports.CALMLENS_ERROR_CODES = require_ModerationContextLimits.CALMLENS_ERROR_CODES;
5
5
  exports.CDN_RESOURCES = require_ModerationContextLimits.CDN_RESOURCES;
@@ -1,5 +1,5 @@
1
- import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getAssetAspectRatio, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./Core-CTO_Eh0l.js";
2
- import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-BDXV4aHT.js";
1
+ import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, I as UploadItem, J as AssetSessionState, K as AssetOptions, L as UploadSnapshot, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, P as UploadControllerOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, c as ICON_ATTRIBUTES, d as AssetDisplayOptions, et as getAssetAspectRatio, f as AssetEventHandlers, g as CalmLensMessages, h as UploaderProps, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, k as CalmLensUpload, l as IconName, m as UploaderDisplayOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, v as UploadItemView, w as getDropzoneHint, x as describeUploader, y as UploaderView, z as createUploadController } from "./Core-BJaLU71Q.js";
2
+ import { i as useCalmLensUpload, n as CalmLensProviderProps, r as UseCalmLensUploadResult, t as CalmLensProvider } from "./ReactUpload-BGUkcMpg.js";
3
3
  import { ReactNode } from "react";
4
4
  import { StyleProp, ViewStyle } from "react-native";
5
5
  /** What the uploader asks your picker for. */
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_ModerationContextLimits = require("./ModerationContextLimits-Cxaob3tc.js");
3
- const require_Core = require("./Core-kKGmyk5V.js");
4
- const require_UploadController = require("./UploadController-CC1afxmL.js");
2
+ const require_ModerationContextLimits = require("./ModerationContextLimits-_knOVCH0.js");
3
+ const require_Core = require("./Core-DCnnUsgF.js");
4
+ const require_UploadController = require("./UploadController-CEL3N4Ae.js");
5
5
  const require_FileIcons = require("./FileIcons-Ob003MdS.js");
6
- const require_ReactUpload = require("./ReactUpload-Cx3Hi7xt.js");
6
+ const require_ReactUpload = require("./ReactUpload-BtmIrdky.js");
7
7
  let react = require("react");
8
8
  let react_jsx_runtime = require("react/jsx-runtime");
9
9
  let react_native = require("react-native");
@@ -412,7 +412,7 @@ function CalmLensAsset(props) {
412
412
  onAvailabilityChange
413
413
  };
414
414
  (0, react.useEffect)(() => session.load());
415
- const base = state.src?.split("?", 1)[0];
415
+ const base = state.src ? require_ModerationContextLimits.assetUrlOf(state.src) : void 0;
416
416
  const previewUrl = base && state.info?.content?.preview ? require_ModerationContextLimits.appendAssetLocation(base, {
417
417
  resource: "preview",
418
418
  viewerClaims
package/cjs/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-CTO_Eh0l.js";
2
- import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-BDXV4aHT.js";
3
- import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-DJZY1LSU.js";
4
- import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-DAbpyM2Z.js";
1
+ import { $ as MediaPlayback, A as CustomUploadContext, B as isFileAccepted, C as formatMessage, D as resolveMessages, E as getUploadItemOutcome, F as UploadFile, G as AssetImageSource, H as AssetDisplay, J as AssetSessionState, K as AssetOptions, M as UploadClient, N as UploadController, O as CalmLensProvidedOptions, Q as INSTANT_LOAD_MS, R as UploadStage, S as formatBytes, T as getUploadItemMessage, U as AssetDocumentOptions, V as withProvidedOptions, W as AssetImageOptions, X as AssetVideoOptions, Y as AssetSpreadsheetOptions, Z as AssetView, _ as DEFAULT_MESSAGES, _t as DEFAULT_VIEWER_MESSAGES, a as ProgressFetchOptions, at as isImageReady, b as describeUploadItem, bt as resolveViewerMessages, c as ICON_ATTRIBUTES, ct as DocumentViewerOptions, d as AssetDisplayOptions, dt as TextViewerOptions, et as getAssetAspectRatio, f as AssetEventHandlers, ft as ViewerAsset, g as CalmLensMessages, gt as isSpreadsheetFormat, ht as getAssetViewerKind, i as CALMLENS_STYLES, it as getPlayedPercent, j as CustomUploadResult, l as IconName, lt as PdfAssetOptions, m as UploaderDisplayOptions, mt as ViewerTextOptions, n as CalmLensTheme, nt as getAssetViewKey, o as createProgressFetch, ot as pickAssetSource, p as AssetProps, pt as ViewerOptions, q as AssetSession, r as resolveTheme, rt as getPeakHeights, s as ICONS, st as AssetViewerKind, t as CALMLENS_THEME, tt as getAssetView, u as ASSET_FILE_ICON_SIZE, ut as SpreadsheetViewerOptions, v as UploadItemView, vt as ViewerMessages, w as getDropzoneHint, x as describeUploader, y as UploaderView, yt as formatViewerMessage } from "./Core-BJaLU71Q.js";
2
+ import { n as CalmLensProviderProps, t as CalmLensProvider } from "./ReactUpload-BGUkcMpg.js";
3
+ import { a as UploaderProps, i as UploadSnapshot, n as UploadControllerOptions, o as UseCalmLensUploadResult, r as UploadItem, s as createUploadController, t as CalmLensUpload } from "./BrowserUpload-CRbCsX7a.js";
4
+ import { _ as spreadsheetColumnIndex, a as isMountedViewerKind, b as AssetViewer, c as AssetViewerOptionsByKind, d as createTextViewer, f as SpreadsheetCell, g as parseSpreadsheetText, h as getSpreadsheetPage, i as getMountedViewerOptions, l as VIEWER_STYLES, m as SpreadsheetSheet, n as AssetViewerMount, o as ASSET_VIEWERS, p as SpreadsheetRow, r as MountedViewerKind, s as AssetViewerName, t as MediaStreamPlayer, u as createSpreadsheetViewer, v as loadPdfJs, x as ViewerState, y as createDocumentViewer } from "./ui-BGywTQ2M.js";
5
5
  import { CSSProperties, HTMLAttributes, ReactNode } from "react";
6
6
  type ElementProps = Omit<HTMLAttributes<HTMLDivElement>, "children"> & {
7
7
  /** Leaves out the stylesheet the viewers render, so you can style the `calmlens-*` classes. */
package/cjs/react.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const require_ui = require("./ui-I75EvP9r.js");
4
- const require_Core = require("./Core-kKGmyk5V.js");
5
- const require_UploadController = require("./UploadController-CC1afxmL.js");
3
+ const require_ui = require("./ui-DVQm0TFJ.js");
4
+ const require_Core = require("./Core-DCnnUsgF.js");
5
+ const require_UploadController = require("./UploadController-CEL3N4Ae.js");
6
6
  const require_FileIcons = require("./FileIcons-Ob003MdS.js");
7
- const require_ReactUpload = require("./ReactUpload-Cx3Hi7xt.js");
8
- const require_BrowserUpload = require("./BrowserUpload-DhruIgFN.js");
7
+ const require_ReactUpload = require("./ReactUpload-BtmIrdky.js");
8
+ const require_BrowserUpload = require("./BrowserUpload-Dz4UwTTJ.js");
9
9
  let react = require("react");
10
10
  let react_jsx_runtime = require("react/jsx-runtime");
11
11
  const OPTION_NAMES = /* @__PURE__ */ new Set([