/**
 * @since Last modified: 2024-09-04 18:04:49
 * @function privacy
 * @description Notice about collecting user cookie privacy.
 * @param {object} opts  - Parameters.
 * @param {string} [opts.content='']  - Text content.Refer to the getContent function.
 * @param {string} [opts.contType]  - Content type.Refer to the getContent function.
 * @param {object} [opts.contData]  - Content data.Refer to the getContent function.
 * @param {function} [cb]  - Call back after confirm.
 * @returns {null} Return null.
 * @see {@link https://codepen.io/axui/pen/jOjZEaw|demo @ codepen}
 * @example
 * ax.privacy({});
 * <!--return null-->
 */
'use strict';
import { T_el, T_fn, T_obj, T_sel } from '../../../types/ax';
import ax from '../global/namespace';
import config from '../global/config';
import Drawer from '../modules/Drawer';
import createEl from './createEl';
import getContent from './getContent';
import getDataType from './getDataType';
import getEl from './getEl';
import isEmpty from './isEmpty';
import storage from './storage';
import trim from './trim';
const privacy = ({ content = config.lang.privacy.content, contType, contData, cb }: { content?: any, contType?: string, contData?: T_obj, cb?: T_fn }): void => {
    if (!storage.get('AXUI_GOT_PRIVACY')) {
        new Drawer(undefined, {
            content,
            contType,
            contData,
            footer: {
                children: [
                    {
                        name: 'cancel',
                        label: config.lang.privacy.cancel,
                    },
                    {
                        name: 'confirm',
                        label: config.lang.privacy.confirm,
                    },
                ]
            },
            onConfirm: () => {
                storage.set('AXUI_GOT_PRIVACY', true);
                cb && cb();
            }
        }).show();
    }
}
export default privacy;
