@clerk/chrome-extension 3.0.0-snapshot.v20251204175016 → 3.0.0-snapshot.v20251211120550

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.
@@ -1,4 +1,4 @@
1
- import { createClerkClient, SCOPE } from '../chunk-WGZF3FA5.js';
1
+ import { createClerkClient, SCOPE } from '../chunk-RJ27MAKX.js';
2
2
 
3
3
  // src/background/clerk.ts
4
4
  async function createClerkClient2(opts) {
@@ -1,4 +1,4 @@
1
- import { __export, buildErrorThrower, createDevOrStagingUrlCache, ClerkRuntimeError, parsePublishableKey, createClerkClient, isClerkAPIResponseError } from './chunk-WGZF3FA5.js';
1
+ import { __export, buildErrorThrower, createDevOrStagingUrlCache, ClerkRuntimeError, parsePublishableKey, createClerkClient, isClerkAPIResponseError } from './chunk-RJ27MAKX.js';
2
2
  import React7, { createContext, useContext, useState, useRef, useEffect, createElement, useCallback, useMemo, useSyncExternalStore, useLayoutEffect, useDebugValue } from 'react';
3
3
  import { useSyncExternalStore as useSyncExternalStore$1 } from 'use-sync-external-store/shim/index.js';
4
4
  import { createPortal } from 'react-dom';
@@ -191,7 +191,7 @@ var resolveAuthState = ({ authObject: { sessionId, sessionStatus, userId, actor,
191
191
  };
192
192
  };
193
193
 
194
- // ../shared/dist/runtime/organization-JwY1zGRo.mjs
194
+ // ../shared/dist/runtime/organization-CDNOZNzF.mjs
195
195
  function getCurrentOrganizationMembership(organizationMemberships, organizationId) {
196
196
  return organizationMemberships.find((organizationMembership) => organizationMembership.organization.id === organizationId);
197
197
  }
@@ -2828,7 +2828,7 @@ var isThatComponent = (v, component) => {
2828
2828
  return !!v && React7.isValidElement(v) && (v == null ? void 0 : v.type) === component;
2829
2829
  };
2830
2830
  var useUserProfileCustomPages = (children, options) => {
2831
- const reorderItemsLabels = ["account", "security"];
2831
+ const reorderItemsLabels = ["account", "security", "billing", "apiKeys"];
2832
2832
  return useCustomPages(
2833
2833
  {
2834
2834
  children,
@@ -2842,7 +2842,7 @@ var useUserProfileCustomPages = (children, options) => {
2842
2842
  );
2843
2843
  };
2844
2844
  var useOrganizationProfileCustomPages = (children, options) => {
2845
- const reorderItemsLabels = ["general", "members"];
2845
+ const reorderItemsLabels = ["general", "members", "billing", "apiKeys"];
2846
2846
  return useCustomPages(
2847
2847
  {
2848
2848
  children,
@@ -3690,6 +3690,27 @@ withClerk(
3690
3690
  },
3691
3691
  { component: "TaskChooseOrganization", renderWhileLoading: true }
3692
3692
  );
3693
+ withClerk(
3694
+ ({ clerk, component, fallback, ...props }) => {
3695
+ const mountingStatus = useWaitForComponentMount(component);
3696
+ const shouldShowFallback = mountingStatus === "rendering" || !clerk.loaded;
3697
+ const rendererRootProps = {
3698
+ ...shouldShowFallback && fallback && { style: { display: "none" } }
3699
+ };
3700
+ return /* @__PURE__ */ React7.createElement(React7.Fragment, null, shouldShowFallback && fallback, clerk.loaded && /* @__PURE__ */ React7.createElement(
3701
+ ClerkHostRenderer,
3702
+ {
3703
+ component,
3704
+ mount: clerk.mountTaskResetPassword,
3705
+ unmount: clerk.unmountTaskResetPassword,
3706
+ updateProps: clerk.__internal_updateProps,
3707
+ props,
3708
+ rootProps: rendererRootProps
3709
+ }
3710
+ ));
3711
+ },
3712
+ { component: "TaskResetPassword", renderWhileLoading: true }
3713
+ );
3693
3714
 
3694
3715
  // ../react/dist/chunk-OANWQR3B.mjs
3695
3716
  var __typeError = (msg) => {
@@ -3752,7 +3773,7 @@ var retry = async (callback, options = {}) => {
3752
3773
  }
3753
3774
  };
3754
3775
 
3755
- // ../shared/dist/runtime/loadScript-DDWWb733.mjs
3776
+ // ../shared/dist/runtime/loadScript-CHWOPTAN.mjs
3756
3777
  var NO_DOCUMENT_ERROR = "loadScript cannot be called when document does not exist";
3757
3778
  var NO_SRC_ERROR = "loadScript cannot be called without a src";
3758
3779
  async function loadScript(src = "", opts) {
@@ -3766,7 +3787,6 @@ async function loadScript(src = "", opts) {
3766
3787
  script.async = async || false;
3767
3788
  script.defer = defer || false;
3768
3789
  script.addEventListener("load", () => {
3769
- console.log("this loaded ", src);
3770
3790
  script.remove();
3771
3791
  resolve(script);
3772
3792
  });
@@ -3782,7 +3802,6 @@ async function loadScript(src = "", opts) {
3782
3802
  });
3783
3803
  };
3784
3804
  return retry(load, { shouldRetry: (_, iterations) => {
3785
- console.log("nikos 3", _, iterations);
3786
3805
  return iterations <= 5;
3787
3806
  } });
3788
3807
  }
@@ -3813,12 +3832,12 @@ function addClerkPrefix(str) {
3813
3832
  return `clerk.${str.replace(regex, "")}`;
3814
3833
  }
3815
3834
 
3816
- // ../shared/dist/runtime/versionSelector-C99RARtR.mjs
3817
- var versionSelector = (clerkJSVersion, packageVersion = "6.0.0-snapshot.v20251204175016") => {
3835
+ // ../shared/dist/runtime/versionSelector-v6LvGO6I.mjs
3836
+ var versionSelector = (clerkJSVersion, packageVersion = "6.0.0-snapshot.v20251211120550") => {
3818
3837
  if (clerkJSVersion) return clerkJSVersion;
3819
3838
  const prereleaseTag = getPrereleaseTag(packageVersion);
3820
3839
  if (prereleaseTag) {
3821
- if (prereleaseTag === "snapshot") return "6.0.0-snapshot.v20251204175016";
3840
+ if (prereleaseTag === "snapshot") return packageVersion;
3822
3841
  return prereleaseTag;
3823
3842
  }
3824
3843
  return getMajorVersion(packageVersion);
@@ -3837,6 +3856,21 @@ function isClerkGlobalProperlyLoaded(prop) {
3837
3856
  return !!window[prop];
3838
3857
  }
3839
3858
  var isClerkUiProperlyLoaded = () => isClerkGlobalProperlyLoaded("__internal_ClerkUiCtor");
3859
+ function hasScriptRequestError(scriptUrl) {
3860
+ if (typeof window === "undefined" || !window.performance) return false;
3861
+ const entries = performance.getEntriesByName(scriptUrl, "resource");
3862
+ if (entries.length === 0) return false;
3863
+ const scriptEntry = entries[entries.length - 1];
3864
+ if (scriptEntry.transferSize === 0 && scriptEntry.decodedBodySize === 0) {
3865
+ if (scriptEntry.responseEnd === 0) return true;
3866
+ if (scriptEntry.responseEnd > 0 && scriptEntry.responseStart > 0) return true;
3867
+ if ("responseStatus" in scriptEntry) {
3868
+ if (scriptEntry.responseStatus >= 400) return true;
3869
+ if (scriptEntry.responseStatus === 0) return true;
3870
+ }
3871
+ }
3872
+ return false;
3873
+ }
3840
3874
  var loadClerkUiScript = async (opts) => {
3841
3875
  var _a;
3842
3876
  const timeout = (_a = opts == null ? void 0 : opts.scriptLoadTimeout) != null ? _a : 15e3;
@@ -3845,13 +3879,21 @@ var loadClerkUiScript = async (opts) => {
3845
3879
  cause: error
3846
3880
  });
3847
3881
  if (isClerkUiProperlyLoaded()) return null;
3848
- if (document.querySelector("script[data-clerk-ui-script]")) return waitForPredicateWithTimeout(timeout, isClerkUiProperlyLoaded, rejectWith());
3849
3882
  if (!(opts == null ? void 0 : opts.publishableKey)) {
3850
3883
  errorThrower2.throwMissingPublishableKeyError();
3851
3884
  return null;
3852
3885
  }
3886
+ const scriptUrl = clerkUiScriptUrl(opts);
3887
+ const existingScript = document.querySelector("script[data-clerk-ui-script]");
3888
+ if (existingScript) if (hasScriptRequestError(scriptUrl)) existingScript.remove();
3889
+ else try {
3890
+ await waitForPredicateWithTimeout(timeout, isClerkUiProperlyLoaded, rejectWith(), existingScript);
3891
+ return null;
3892
+ } catch {
3893
+ existingScript.remove();
3894
+ }
3853
3895
  const loadPromise = waitForPredicateWithTimeout(timeout, isClerkUiProperlyLoaded, rejectWith());
3854
- loadScript(clerkUiScriptUrl(opts), {
3896
+ loadScript(scriptUrl, {
3855
3897
  async: true,
3856
3898
  crossOrigin: "anonymous",
3857
3899
  nonce: opts.nonce,
@@ -3868,7 +3910,7 @@ var clerkUiScriptUrl = (opts) => {
3868
3910
  publishableKey,
3869
3911
  proxyUrl,
3870
3912
  domain
3871
- })}/npm/@clerk/ui@${versionSelector(clerkUiVersion)}/dist/ui.browser.js`;
3913
+ })}/npm/@clerk/ui@${versionSelector(clerkUiVersion, "1.0.0-snapshot.v20251211120550")}/dist/ui.browser.js`;
3872
3914
  };
3873
3915
  var buildClerkJsScriptAttributes = (options) => {
3874
3916
  const obj = {};
@@ -3891,13 +3933,17 @@ var buildScriptHost = (opts) => {
3891
3933
  else if (domain && !isDevOrStagingUrl(((_a = parsePublishableKey(publishableKey)) == null ? void 0 : _a.frontendApi) || "")) return addClerkPrefix(domain);
3892
3934
  else return ((_b = parsePublishableKey(publishableKey)) == null ? void 0 : _b.frontendApi) || "";
3893
3935
  };
3894
- function waitForPredicateWithTimeout(timeoutMs, predicate, rejectWith) {
3936
+ function waitForPredicateWithTimeout(timeoutMs, predicate, rejectWith, existingScript) {
3895
3937
  return new Promise((resolve, reject) => {
3896
3938
  let resolved = false;
3897
3939
  const cleanup = (timeoutId$1, pollInterval$1) => {
3898
3940
  clearTimeout(timeoutId$1);
3899
3941
  clearInterval(pollInterval$1);
3900
3942
  };
3943
+ existingScript == null ? void 0 : existingScript.addEventListener("error", () => {
3944
+ cleanup(timeoutId, pollInterval);
3945
+ reject(rejectWith);
3946
+ });
3901
3947
  const checkAndResolve = () => {
3902
3948
  if (resolved) return;
3903
3949
  if (predicate()) {
@@ -4510,7 +4556,7 @@ if (typeof globalThis.__BUILD_DISABLE_RHC__ === "undefined") {
4510
4556
  }
4511
4557
  var SDK_METADATA = {
4512
4558
  name: "@clerk/react",
4513
- version: "6.0.0-snapshot.v20251204175016",
4559
+ version: "6.0.0-snapshot.v20251211120550",
4514
4560
  environment: process.env.NODE_ENV
4515
4561
  };
4516
4562
  var _status;
@@ -4553,6 +4599,7 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
4553
4599
  this.premountAPIKeysNodes = /* @__PURE__ */ new Map();
4554
4600
  this.premountOAuthConsentNodes = /* @__PURE__ */ new Map();
4555
4601
  this.premountTaskChooseOrganizationNodes = /* @__PURE__ */ new Map();
4602
+ this.premountTaskResetPasswordNodes = /* @__PURE__ */ new Map();
4556
4603
  this.premountAddListenerCalls = /* @__PURE__ */ new Map();
4557
4604
  this.loadedListeners = [];
4558
4605
  __privateAdd2(this, _status, "loading");
@@ -4831,6 +4878,9 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
4831
4878
  this.premountTaskChooseOrganizationNodes.forEach((props, node) => {
4832
4879
  clerkjs.mountTaskChooseOrganization(node, props);
4833
4880
  });
4881
+ this.premountTaskResetPasswordNodes.forEach((props, node) => {
4882
+ clerkjs.mountTaskResetPassword(node, props);
4883
+ });
4834
4884
  if (typeof this.clerkjs.status === "undefined") {
4835
4885
  __privateGet2(this, _eventBus).emit(clerkEvents.Status, "ready");
4836
4886
  }
@@ -5228,6 +5278,20 @@ var _IsomorphicClerk = class _IsomorphicClerk2 {
5228
5278
  this.premountTaskChooseOrganizationNodes.delete(node);
5229
5279
  }
5230
5280
  };
5281
+ this.mountTaskResetPassword = (node, props) => {
5282
+ if (this.clerkjs && this.loaded) {
5283
+ this.clerkjs.mountTaskResetPassword(node, props);
5284
+ } else {
5285
+ this.premountTaskResetPasswordNodes.set(node, props);
5286
+ }
5287
+ };
5288
+ this.unmountTaskResetPassword = (node) => {
5289
+ if (this.clerkjs && this.loaded) {
5290
+ this.clerkjs.unmountTaskResetPassword(node);
5291
+ } else {
5292
+ this.premountTaskResetPasswordNodes.delete(node);
5293
+ }
5294
+ };
5231
5295
  this.addListener = (listener) => {
5232
5296
  if (this.clerkjs) {
5233
5297
  return this.clerkjs.addListener(listener);
@@ -5915,5 +5979,5 @@ function ClerkProvider2(props) {
5915
5979
  var GoogleOneTap2 = () => null;
5916
5980
 
5917
5981
  export { APIKeys, AuthenticateWithRedirectCallback, ClerkDegraded, ClerkFailed, ClerkLoaded, ClerkLoading, ClerkProvider2 as ClerkProvider, CreateOrganization, GoogleOneTap2 as GoogleOneTap, OrganizationList, OrganizationProfile, OrganizationSwitcher, PricingTable, Protect, RedirectToCreateOrganization, RedirectToOrganizationProfile, RedirectToSignIn, RedirectToSignUp, RedirectToUserProfile, SignIn, SignInButton, SignInWithMetamaskButton, SignOutButton, SignUp, SignUpButton, SignedIn, SignedOut, UserAvatar, UserButton, UserProfile, Waitlist, setErrorThrowerOptions, useAuth, useClerk, useEmailLink, useOrganization, useOrganizationList, useReverification, useSession, useSessionList, useSignIn, useSignUp, useUser };
5918
- //# sourceMappingURL=chunk-NJBILYFZ.js.map
5919
- //# sourceMappingURL=chunk-NJBILYFZ.js.map
5982
+ //# sourceMappingURL=chunk-GLPNDMWF.js.map
5983
+ //# sourceMappingURL=chunk-GLPNDMWF.js.map