// One rule for a configured demo origin, used by startup storage selection and by the entry alike. It imports // nothing, so the environment can use it without a cycle. export const bareHttpsOrigin = (value: string | undefined): string | undefined => { if (!value) return undefined; try { const url = new URL(value); return url.protocol === 'https:' && url.origin === value.replace(/\/$/, '') ? url.origin : undefined; } catch { return undefined; } };