import{r as e}from"./chunk-Bdh3yLIe.js";import{t}from"./fetch-base-skT9NKps.js";var n=e({OttoAdapter:()=>o}),r=Object.defineProperty,i=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a=(e,t,n)=>i(e,typeof t==`symbol`?t:t+``,n),o=class extends t{constructor(e){if(super({...e,refreshToken:!1}),a(this,`apiKey`),a(this,`port`),a(this,`getToken`,()=>Promise.resolve(this.apiKey)),this.apiKey=e.auth.apiKey,this.port=e.auth.ottoPort,this.apiKey.startsWith(`KEY_`))this.baseUrl.port=(this.port??3030).toString();else if(this.apiKey.startsWith(`dk_`))this.baseUrl.pathname=`otto/${this.baseUrl.pathname.replace(/^\/+|\/+$/g,``)}`;else throw Error(`Invalid Otto API key format. Must start with 'KEY_' (Otto v3) or 'dk_' (OttoFMS)`)}};export{n,o as t};
//# sourceMappingURL=otto-_Y_2cS-B.js.map