"use strict";
(function ($) {
    $.field_duration1 = function (element, options) {
        var defaults = {
            input_name: ""
        }
        var plugin = this;
        plugin.settings = {}
        var $element = $(element), 
            element = element;
        plugin.init = function () {
            plugin.settings = $.extend({}, defaults, options);
            let $duration1Numeric = $element.find('input[type="text"].duration1');
            let $duration1 = $element.find(`input[name="${plugin.settings.input_name}"]`);
            $duration1Numeric.autoNumeric('init', {
                mDec: '10',
                vMin: '-999999999.99'
            });
            $duration1Numeric.on('keyup', function () {
                $duration1.val($duration1Numeric.autoNumeric('get'));
            })
        }
        plugin.example_function = function () {
        };
        plugin.init();
    }
    
    $.fn.field_duration1 = function (options) {
        
        return this.each(function () {
            
            if (undefined == $(this).data('field_duration1')) {
                var plugin = new $.field_duration1(this, options);
                $(this).data('field_duration1', plugin);
            }
        });
    }
})(jQuery);
