{"version":3,"sources":["window-apis.ts"],"sourcesContent":["import { Datex } from \"datex-core-legacy/mod.ts\";\n\n/**\n * Redirects to the given URL, after all outgoing DATEX updates have been sent.\n * This should be used instead of globalThis.location.href = \"...\"\n * to ensure that all DATEX updates are sent before the redirect.\n * @param url the new URL to redirect to\n */\nexport async function redirect(url: string | URL) {\n\tawait Datex.Runtime.synchronized;\n\tglobalThis.location.href = url.toString();\n}\n\n// @ts-ignore globalThis\nglobalThis.redirect = redirect;\n\ntype redirectT = typeof redirect;\ndeclare global {\n\t/**\n\t * Redirects to the given URL, after all outgoing DATEX updates have been sent.\n\t * This should be used instead of globalThis.location.href = \"...\"\n\t * to ensure that all DATEX updates are sent before the redirect.\n\t * @param url the new URL to redirect to\n\t */\n\tconst redirect: redirectT;\n}"],"names":["Datex","redirect","url","Runtime","synchronized","globalThis","location","href","toString"],"mappings":"AAAA,SAASA,KAAK,QAAQ,2BAA2B;AAQjD,OAAO,eAAeC,SAASC,GAAiB;IAC/C,MAAMF,MAAMG,OAAO,CAACC,YAAY,EAChCC,WAAWC,QAAQ,CAACC,IAAI,GAAGL,IAAIM,QAAQ;AACxC;AAGAH,WAAWJ,QAAQ,GAAGA","sourceRoot":"/lib/uix-0.4.39/src/utils/","file":"window-apis.ts"}