{"version":3,"file":"windowNavigate.mjs","names":[],"sources":["../../../../src/internal/clerk-js/windowNavigate.ts"],"sourcesContent":["export const CLERK_BEFORE_UNLOAD_EVENT = 'clerk:beforeunload';\n\n/**\n * Additional protocols can be provided using the `allowedRedirectProtocols` Clerk option.\n */\nexport const ALLOWED_PROTOCOLS = [\n  'http:',\n  'https:',\n  // Refers to https://wails.io/\n  'wails:',\n  'chrome-extension:',\n];\n\n/**\n * Helper utility to navigate via window.location.href. Also dispatches a clerk:beforeunload custom event.\n *\n * Note that this utility should **never** be called with a user-provided URL. We make no specific checks against the contents of the URL here and assume it is safe. Use `Clerk.navigate()` instead for user-provided URLs.\n */\nexport function windowNavigate(to: URL | string): void {\n  const toURL = new URL(to, window.location.href);\n  window.dispatchEvent(new CustomEvent(CLERK_BEFORE_UNLOAD_EVENT));\n  window.location.href = toURL.href;\n}\n"],"mappings":";AAAA,MAAa,4BAA4B;;;;AAKzC,MAAa,oBAAoB;CAC/B;CACA;CAEA;CACA;CACD;;;;;;AAOD,SAAgB,eAAe,IAAwB;CACrD,MAAM,QAAQ,IAAI,IAAI,IAAI,OAAO,SAAS,KAAK;AAC/C,QAAO,cAAc,IAAI,YAAY,0BAA0B,CAAC;AAChE,QAAO,SAAS,OAAO,MAAM"}