1import{g as a}from"./environment-DWQ6JMN2.js";import"./validation-iZIxApcD.js";const f=(t,o)=>{const n=new URL(t),e=o??i(t);if(!e)return n.origin;if(a().DEVEL==="true"&&n.hostname==="localhost")return`${n.origin}/console`;const c=n.searchParams.get("ref")??"",l=c?`?ref=${c}`:"",u=n.hostname.endsWith(".com")?"com":"space",r=s(t);return`https://${e}${r?`.${r}`:""}.toggl.${u}${l}`},i=t=>{const o=new URL(t);if(o.pathname.startsWith("/app/"))return"focus";const n=o.pathname.match(/\/(track|plan|work|focus)\//)?.[1];return n||null},h=(t,o,n)=>t.startsWith("/app/")?`/app/${n}`:o?`/${o}/${n}`:`/${n}`,m=t=>t.track_user?"track":t.plan_user?"plan":t.work_user?"work":t.focus_user?"focus":null,L=t=>{if(t.match(/^https:\/\/accounts\.toggl\.com/))return"https://labs.toggl.com";const o=s(t);return`https://labs${o?`.${o}`:""}.toggl.space`},R=(t="",o=!1)=>o?a().PUBLIC_API_URL?a().PUBLIC_API_URL:t?new URL(t).origin:"":t&&new URL(t).hostname==="localhost"?new URL(t).origin:a().API_URL,_=(t="",o=!1)=>o?a().SSO_PUBLIC_API_URL?a().SSO_PUBLIC_API_URL:t?new URL(t).origin:"":t&&new URL(t).hostname==="localhost"?new URL(t).origin:a().SSO_API_URL,w=(t="",o=!1)=>o?a().ORG_PUBLIC_API_URL?a().ORG_PUBLIC_API_URL:t?new URL(t).origin:"":t&&new URL(t).hostname==="localhost"?new URL(t).origin:a().ORG_API_URL,$=(t,o,n)=>{switch(t){case"track":switch(o){case"Android":const e=document.location.hostname.endsWith(".com")?"com":"space",c=s(document.location.href);return`https://accounts${c?`.${c}`:""}.toggl.${e}/auth/track/${n}`;case"iOS":case"Mac":case"Windows":return"toggltrack://"+n;default:return null}case"plan":switch(o){case"Android":case"iOS":return"togglplanapp://"+n;default:return null}case"focus":switch(o){case"Android":case"iOS":return"togglfocusapp://"+n;default:return null}default:return null}},d=t=>{if(!t)return!1;const o=new URL(t,"https://accounts.toggl.space");return o.hostname==="localhost"||o.hostname==="local.toggl.space"||o.hostname==="local.accounts.toggl.space"||o.hostname==="local.focus.toggl.space"||o.hostname==="local.solutions.toggl.space"||o.hostname==="fe.toggl.space"||!!o.hostname.match(/^toggl.(com|space)$/)||!!o.hostname.match(/^(accounts|track|plan|work|solutions|focus)\.toggl\.(com|space)$/)||!!o.hostname.match(/^(accounts|track|plan|work|solutions|focus)\.\S+\.toggl\.space$/)||!!o.hostname.match(/^[\w-]+\.pull\.focus\.toggl\.space$/)||!!o.protocol.match(/^toggl(track|plan|focus):$/)||!!o.protocol.startsWith("toggltrack-")||o.protocol==="toggltrackdebug:"||o.protocol==="togglplanapp:"||o.protocol==="togglfocusapp:"},s=t=>t?new URL(t).hostname.match(/^accounts\.(\S+)\.toggl\.space/)?.[1]??null:null;export{$ as a,h as b,m as c,L as d,_ as e,R as f,f as g,i as h,d as i,w as j};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.