!function(t,o,e,i){var n="exopiteSOFMinicolors";function s(o,e){this.element=o,this._name=n,this.$element=t(o),this.init()}s.prototype={init:function(){var o=this;o.minicolorOptions={theme:"default",swatches:"#000|#fff|#f00|#dd9933|#eeee22|#81d742|#1e73be|#8224e3|#2196f3|#4caf50|#ffeb3b|#ff9800|#795548|rgba(0, 0, 0, 0)".split("|"),change:function(e,i){o.change(e,i,t(this))},hide:function(){let e=t(this).val();t(this).val(o.rgb2hex(e))}},o.$element.find(".minicolor").each(function(e,i){t(i).closest(".exopite-sof-cloneable__item").hasClass("exopite-sof-cloneable__muster")||t(i).hasClass("disabled")||(o.minicolorOptions.opacity=t(i).attr("data-opacity")||!1,o.minicolorOptions.control=t(i).attr("data-control")||"saturation",o.minicolorOptions.format=t(i).attr("data-format")||"rgb",t(i).minicolors(o.minicolorOptions))}),o.$element.closest(".exopite-sof-wrapper").on("exopite-sof-field-group-item-added-after",function(e,i){i.find(".minicolor").each(function(e,i){t(i).closest(".exopite-sof-cloneable__item").hasClass("exopite-sof-cloneable__muster")||t(i).hasClass("disabled")||t(i).minicolors(o.minicolorOptions)})})},rgb2hex:function(t){return rgba=t.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?1[\s+]?\)/i),console.log("rgba: "+rgba),null===rgba?t:rgba&&4===rgba.length?"#"+("0"+parseInt(rgba[1],10).toString(16)).slice(-2)+("0"+parseInt(rgba[2],10).toString(16)).slice(-2)+("0"+parseInt(rgba[3],10).toString(16)).slice(-2):""},change:function(t,o,e){var i=t;e.hasClass("font-color-js")&&(console.log("has font-color"),e.parents(".exopite-sof-font-field").find(".exopite-sof-font-preview").css({color:i})),e.val(this.rgb2hex(i))}},t.fn[n]=function(o){return this.each(function(){t.data(this,"plugin_"+n)||t.data(this,"plugin_"+n,new s(this,o))})}}(jQuery,window,document),function(t){"use strict";t(document).ready(function(){t(".exopite-sof-field").exopiteSOFMinicolors()})}(jQuery);