"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.destination = void 0;
const tslib_1 = require("tslib");
const shim_1 = require("../../runtime/shim");
const attach_1 = tslib_1.__importDefault(require("./attach"));
exports.destination = {
    name: 'Sabil',
    slug: 'actions-sabil',
    mode: 'device',
    settings: {
        client_id: {
            description: 'Your project API client ID. You can find it in your Sabil [dashboard](https://dashboard.sabil.io/api_keys)',
            label: 'Client ID',
            required: true,
            type: 'string'
        }
    },
    initialize: async (_options, deps) => {
        try {
            await deps.loadScript('https://cdn.sabil.io/global.js');
            await deps.resolveWhen(() => Object.prototype.hasOwnProperty.call(window, 'Sabil'), 100);
            return window.Sabil;
        }
        catch (err) {
            throw new Error('Could not load the Sabil js package');
        }
    },
    actions: {
        attach: attach_1.default
    }
};
exports.default = shim_1.browserDestination(exports.destination);
//# sourceMappingURL=index.js.map