(rawUrl)
| 18 | } |
| 19 | |
| 20 | function normalizeSub2ApiUrl(rawUrl) { |
| 21 | const input = (rawUrl || '').trim() || DEFAULT_SUB2API_URL; |
| 22 | const withProtocol = /^https?:\/\//i.test(input) ? input : `https://${input}`; |
| 23 | const parsed = new URL(withProtocol); |
| 24 | if (!parsed.pathname || parsed.pathname === '/') { |
| 25 | parsed.pathname = '/admin/accounts'; |
| 26 | } |
| 27 | parsed.hash = ''; |
| 28 | return parsed.toString(); |
| 29 | } |
| 30 | |
| 31 | function getPanelMode(state = {}) { |
| 32 | return state.panelMode === 'sub2api' ? 'sub2api' : 'cpa'; |
no outgoing calls
no test coverage detected