/* eslint-disable no-undef */
(function(widgetName, isIDE) {
    let widgets = isIDE ? TW.IDE.Widgets : TW.Runtime.Widgets;
    widgets[widgetName] = function() {
        let config = TW.Widget.widgetWrapper.config(widgetName);
        TW.Widget.widgetWrapper.inject(config.elementName, this, config, isIDE);

    //[ custom code
        this.serviceInvoked = function(serviceName) {

            if (serviceName === 'TriggerFoo') {
                this.jqElement[0].foo();
            } else {
                TW.log.error('Link widget, unexpected serviceName invoked "' + serviceName + '"');
            }
        };
    //]
    };

    let config = TW.Widget.widgetWrapper.config(widgetName); // = config;
    TW.Widget.widgetWrapper.loadImports(config.imports);
}('simpleel', false));
