import { I as Identifier } from './Token-ba2c5d5c.js';
import './index-c2c33860.js';
import { a as Connection } from './Item-f4cbd6f4.js';
import { S as Settlement$1 } from './index-8e333ab5.js';
import './ok-c9833bf3.js';
import './index-714bb39b.js';
import './index-063af7ee.js';
import './TextDecoder-357ac2ce.js';
import './_commonjsHelpers-9943807e.js';
import './index-1f953d81.js';

class Settlement {
    constructor(connection) {
        this.connection = connection;
    }
    async list(date, days) {
        return await this.connection.get("settlement" +
            (date && days ? `?date=${date}&days=${days}` : date ? `?date=${date}` : days ? `?days=${days}` : ""));
    }
    async report(settlements, language) {
        return this.connection.post(`settlement/report?language=${language}`, settlements);
    }
    async load(id) {
        return Identifier.is(id)
            ? await this.connection.get("settlement/" + id)
            : (await Promise.all(id.map(i => this.connection.get("settlement/" + i)))).filter(Settlement$1.is);
    }
    static open(url, token) {
        const connection = Connection.open(url, token);
        return connection && new Settlement(connection);
    }
}

export { Settlement };
