(function($){
    "use strict";

    $.pixeIconSettings = {

        tabHead: false,
        tabContent: false,

        // initiate content
        init: function(settings){
            settings = $.extend({
                onClose: function(){}
            }, settings);

            var t = this;

            var container = $('<div class="pixe-icon-settings pixe-box-sizing" ></div>');

            var tab = $('<div class="pixe-settings-tab" ></div>');
            tab.appendTo(container);

            // init header area
            t.tabHead = $('<div class="pixe-settings-tab-head" ></div>');
            t.tabHead.append(pixei18n.preset.icon);
            t.tabHead.append($.pixeGetAdminIcon('cancel', { class: 'pixe-close' }));
            tab.append(t.tabHead);
            
            // init content area
            t.tabContent = $('<div class="pixe-settings-tab-content" ></div>');
            t.getPresetTab();
            tab.append(t.tabContent);
            
            // popup
            var lb = new $.pixeLightboxPopup({
                class: 'pixe-lb-icon-settings',
                content: container,
                onClose: settings.onClose
            });
            t.tabHead.on('click', '.pixe-close', function(){
                lb.close();
            });

        },

        // preset tab
        getPresetTab: function(activePreset = 'font-awesome'){
            var t = this;
            t.tabContent.empty();
            
            var content = $('<div class="pixe-settings-tab-notice" ></div>');
            content.append($.pixeProNotice('feature', 'icon'));
            content.appendTo(t.tabContent);
        },
    };

    // initialize custom icon object
    $(document).ready(function(){
        if( !pixeData.iconPreset || Array.isArray(pixeData.iconPreset) ){
            pixeData.iconPreset = {};
        }
    });

})(jQuery);	
