WP ULike - Version 4.1.1

Version Description

  • Fixed: A JavaScript issue in setting panel.
  • Fixed: Some small issues.
Download this release

Release Info

Developer alimir
Plugin Icon 128x128 WP ULike
Version 4.1.1
Comparing to
See all releases

Code changes from version 4.1.0 to 4.1.1

admin/admin-hooks.php CHANGED
@@ -126,7 +126,7 @@ function wp_ulike_notice_manager(){
126
  $screen = get_current_screen();
127
  $notice_list = [];
128
 
129
- if( ! wp_ulike_is_true( get_option( 'wp_ulike_upgrade_option_panel_status', false ) ) && '' !== get_option( 'wp_ulike_general' ) ){
130
  $notice_list[ 'wp_ulike_upgrade_option_panel' ] = new wp_ulike_notices([
131
  'id' => 'wp_ulike_upgrade_option_panel',
132
  'title' => __( 'Upgrade Settings Panel', WP_ULIKE_SLUG ),
126
  $screen = get_current_screen();
127
  $notice_list = [];
128
 
129
+ if( ! wp_ulike_is_true( get_option( 'wp_ulike_upgrade_option_panel_status', false ) ) && '' != get_option( 'wp_ulike_general' ) ){
130
  $notice_list[ 'wp_ulike_upgrade_option_panel' ] = new wp_ulike_notices([
131
  'id' => 'wp_ulike_upgrade_option_panel',
132
  'title' => __( 'Upgrade Settings Panel', WP_ULIKE_SLUG ),
admin/assets/js/plugins.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! WP ULike - v4.1.0
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
1
+ /*! WP ULike - v4.1.1
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
admin/classes/class-wp-ulike-admin-panel.php CHANGED
@@ -448,6 +448,7 @@ if ( ! class_exists( 'wp_ulike_admin_panel' ) ) {
448
  'desc' => __('With this option, you can disable automatic display on these pages.', WP_ULIKE_SLUG),
449
  'chosen' => true,
450
  'multiple' => true,
 
451
  'options' => array(
452
  'home' => __('Home', WP_ULIKE_SLUG),
453
  'single' => __('Singular', WP_ULIKE_SLUG),
448
  'desc' => __('With this option, you can disable automatic display on these pages.', WP_ULIKE_SLUG),
449
  'chosen' => true,
450
  'multiple' => true,
451
+ 'default' => 'single',
452
  'options' => array(
453
  'home' => __('Home', WP_ULIKE_SLUG),
454
  'single' => __('Singular', WP_ULIKE_SLUG),
admin/settings/assets/js/csf.js CHANGED
@@ -2745,8 +2745,8 @@
2745
  // WP Color Picker
2746
  //
2747
  if( typeof Color === 'function' ) {
2748
-
2749
- Color.fn.toString = function() {
2750
 
2751
  if( this._alpha < 1 ) {
2752
  return this.toCSS('rgba', this._alpha).replace(/\s+/g, '');
@@ -3136,7 +3136,7 @@
3136
  //
3137
  $.fn.csf_customizer_listen = function( options ) {
3138
 
3139
- var settings = $.extend({
3140
  closest: false,
3141
  }, options );
3142
 
2745
  // WP Color Picker
2746
  //
2747
  if( typeof Color === 'function' ) {
2748
+ var toStringFn = typeof Color.fn !== 'undefined' ? Color.fn.toString : Color.toString;
2749
+ toStringFn = function() {
2750
 
2751
  if( this._alpha < 1 ) {
2752
  return this.toCSS('rgba', this._alpha).replace(/\s+/g, '');
3136
  //
3137
  $.fn.csf_customizer_listen = function( options ) {
3138
 
3139
+ var settings = $.extend({
3140
  closest: false,
3141
  }, options );
3142
 
admin/settings/assets/js/csf.min.js CHANGED
@@ -1,3 +1 @@
1
- /* Codestar Framework | A Simple and Lightweight WordPress Option Framework - v2.1.3.x*/
2
-
3
- !function(e,t,n,i){"use strict";var a=a||{};a.funcs={},a.vars={onloaded:!1,$body:e("body"),$window:e(t),$document:e(n),$form_warning:null,form_modified:!1,code_themes:[],is_rtl:e("body").hasClass("rtl")},a.helper={uid:function(e){return(e||"")+Math.random().toString(36).substr(2,9)},preg_quote:function(e){return(e+"").replace(/(\[|\-|\])/g,"\\$1")},name_nested_replace:function(t,n){var i=new RegExp("("+a.helper.preg_quote(n)+")\\[(\\d+)\\]","g");t.find(":radio").each(function(){(this.checked||this.orginal_checked)&&(this.orginal_checked=!0)}),t.each(function(t){e(this).find(":input").each(function(){this.name=this.name.replace(i,n+"["+t+"]"),this.orginal_checked&&(this.checked=!0)})})},debounce:function(e,t,n){var i;return function(){var a=this,s=arguments,c=n&&!i;clearTimeout(i),i=setTimeout(function(){i=null,n||e.apply(a,s)},t),c&&e.apply(a,s)}},get_cookie:function(e){var t,i,a=n.cookie,s=e+"=";if(a){if(-1===(i=a.indexOf("; "+s))){if(0!==(i=a.indexOf(s)))return null}else i+=2;return-1===(t=a.indexOf(";",i))&&(t=a.length),decodeURIComponent(a.substring(i+s.length,t))}},set_cookie:function(e,t,i,a,s,c){var r=new Date;"object"==typeof i&&i.toGMTString?i=i.toGMTString():parseInt(i,10)?(r.setTime(r.getTime()+1e3*parseInt(i,10)),i=r.toGMTString()):i="",n.cookie=e+"="+encodeURIComponent(t)+(i?"; expires="+i:"")+(a?"; path="+a:"")+(s?"; domain="+s:"")+(c?"; secure":"")},remove_cookie:function(e,t,n,i){a.helper.set_cookie(e,"",-1e3,t,n,i)}},e.fn.csf_clone=function(){for(var t=e.fn.clone.apply(this,arguments),n=this.find("select").add(this.filter("select")),i=t.find("select").add(t.filter("select")),a=0;a<n.length;++a)for(var s=0;s<n[a].options.length;++s)!0===n[a].options[s].selected&&(i[a].options[s].selected=!0);return this.find(":radio").each(function(){this.orginal_checked=this.checked}),t},e.fn.csf_expand_all=function(){return this.each(function(){e(this).on("click",function(t){t.preventDefault(),e(".csf-wrapper").toggleClass("csf-show-all"),e(".csf-section").csf_reload_script(),e(this).find(".fa").toggleClass("fa-indent").toggleClass("fa-outdent")})})},e.fn.csf_nav_options=function(){return this.each(function(){var n,a=e(this),s=a.find("a"),c=a.closest(".csf").find(".csf-section-id");e(t).on("hashchange",function(){var a=t.location.hash.match(new RegExp("tab=([^&]*)")),r=a?a[1]:s.first().attr("href").replace("#tab=",""),o=e("#csf-tab-link-"+r);if(o.length>0){o.closest(".csf-tab-depth-0").addClass("csf-tab-active").siblings().removeClass("csf-tab-active"),s.removeClass("csf-section-active"),o.addClass("csf-section-active"),n!==i&&n.hide();var f=e("#csf-section-"+r);f.css({display:"block"}),f.csf_reload_script(),c.val(r),n=f}}).trigger("hashchange")})},e.fn.csf_nav_metabox=function(){return this.each(function(){var t,n,s=e(this),c=s.find("a"),r=s.data("unique"),o=e("#post_ID").val()||"global";c.on("click",function(s){s.preventDefault();var c=e(this),f=c.data("section");n!==i&&n.removeClass("csf-section-active"),t!==i&&t.hide(),c.addClass("csf-section-active");var l=e("#csf-section-"+f);l.css({display:"block"}),l.csf_reload_script(),a.helper.set_cookie("csf-last-metabox-tab-"+o+"-"+r,f),t=l,n=c});var f=a.helper.get_cookie("csf-last-metabox-tab-"+o+"-"+r);f?s.find('a[data-section="'+f+'"]').trigger("click"):c.first("a").trigger("click")})},e.fn.csf_page_templates=function(){this.length&&e(n).on("change",".editor-page-attributes__template select, #page_template",function(){var t=e(this).val()||"default";e(".csf-page-templates").removeClass("csf-show").addClass("csf-hide"),e(".csf-page-"+t.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-")).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_post_formats=function(){this.length&&e(n).on("change",'.editor-post-format select, #formatdiv input[name="post_format"]',function(){var t=e(this).val()||"default";t="0"===t?"default":t,e(".csf-post-formats").removeClass("csf-show").addClass("csf-hide"),e(".csf-post-format-"+t).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_search=function(){return this.each(function(){e(this).find("input").on("change keyup",function(){var t=e(this).val(),n=e(".csf-wrapper"),i=n.find(".csf-section").find("> .csf-field:not(.hidden)"),a=i.find("> .csf-title, .csf-search-tags");t.length>3?(i.addClass("csf-hidden"),n.addClass("csf-search-all"),a.each(function(){var n=e(this);if(n.text().match(new RegExp(".*?"+t+".*?","i"))){var i=n.closest(".csf-field");i.removeClass("csf-hidden"),i.parent().csf_reload_script()}})):(i.removeClass("csf-hidden"),n.removeClass("csf-search-all"))})})},e.fn.csf_sticky=function(){return this.each(function(){var i=e(this),a=e(t),s=i.find(".csf-header-inner"),c=parseInt(s.css("padding-left"))+parseInt(s.css("padding-right")),r=0,o=!1,f=function(){o||requestAnimationFrame(function(){var e,a,f;e=i.offset().top,a=Math.max(32,e-r),f=Math.max(n.documentElement.clientWidth,t.innerWidth||0),a<=32&&f>782?(s.css({width:i.outerWidth()-c}),i.css({height:i.outerHeight()}).addClass("csf-sticky")):(s.removeAttr("style"),i.removeAttr("style").removeClass("csf-sticky")),o=!1}),o=!0},l=function(){r=a.scrollTop(),f()};a.on("scroll resize",l),l()})},e.fn.csf_dependency=function(){return this.each(function(){var t=e(this),n=e.csf_deps.createRuleset(),i=[],s=!1;t.children("[data-controller]").each(function(){var t=e(this),a=t.data("controller").split("|"),c=t.data("condition").split("|"),r=t.data("value").toString().split("|"),o=n;t.data("depend-global")&&(s=!0),e.each(a,function(e,n){var a=r[e]||"",s=c[e]||c[0];(o=o.createRule('[data-depend-id="'+n+'"]',s,a)).include(t),i.push(n)})}),i.length&&(s?e.csf_deps.enable(a.vars.$body,n,i):e.csf_deps.enable(t,n,i))})},e.fn.csf_field_accordion=function(){return this.each(function(){e(this).find(".csf-accordion-title").on("click",function(){var t=e(this),n=t.find(".csf-accordion-icon"),i=t.next();n.hasClass("fa-angle-right")?n.removeClass("fa-angle-right").addClass("fa-angle-down"):n.removeClass("fa-angle-down").addClass("fa-angle-right"),i.data("opened")||(i.csf_reload_script(),i.data("opened",!0)),i.toggleClass("csf-accordion-open")})})},e.fn.csf_field_backup=function(){return this.each(function(){if(t.wp.customize!==i){var n=this,s=e(this),c=(e("body"),s.find(".csf-import")),r=s.find(".csf-reset");n.notification=function(e){wp.customize.notifications&&wp.customize.OverlayNotification&&(wp.customize.state("saved").get()||(wp.customize.state("changesetStatus").set("trash"),wp.customize.each(function(e){e._dirty=!1}),wp.customize.state("saved").set(!0)),wp.customize.notifications.add(new wp.customize.OverlayNotification("csf_field_backup_notification",{type:"info",message:e,loading:!0})))},r.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.reset_notification),t.wp.ajax.post("csf-reset",{unique:r.data("unique"),nonce:r.data("nonce")}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))}),c.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.import_notification),t.wp.ajax.post("csf-import",{unique:c.data("unique"),nonce:c.data("nonce"),import_data:s.find(".csf-import-data").val()}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))})}})},e.fn.csf_field_background=function(){return this.each(function(){e(this).find(".csf--background-image").csf_reload_script()})},e.fn.csf_field_code_editor=function(){return this.each(function(){if("function"==typeof CodeMirror){var t=e(this),n=t.find("textarea"),i=t.find(".CodeMirror"),s=n.data("editor");i.length&&i.remove();var c=setInterval(function(){if(t.is(":visible")){var i=CodeMirror.fromTextArea(n[0],s);if("default"!==s.theme&&-1===a.vars.code_themes.indexOf(s.theme)){var r=e("<link>");e("#csf-codemirror-css").after(r),r.attr({rel:"stylesheet",id:"csf-codemirror-"+s.theme+"-css",href:s.cdnURL+"/theme/"+s.theme+".min.css",type:"text/css",media:"all"}),a.vars.code_themes.push(s.theme)}CodeMirror.modeURL=s.cdnURL+"/mode/%N/%N.min.js",CodeMirror.autoLoadMode(i,s.mode),i.on("change",function(e,t){n.val(i.getValue()).trigger("change")}),clearInterval(c)}})}})},e.fn.csf_field_date=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-date-settings").data("settings"),a={showAnim:"",beforeShow:function(t,n){e(n.dpDiv).addClass("csf-datepicker-wrapper")},onClose:function(t,n){e(n.dpDiv).removeClass("csf-datepicker-wrapper")}};i=e.extend({},i,a),2===n.length&&(i=e.extend({},i,{onSelect:function(t){e(this),n.first();var a=n.first().attr("id")===e(this).attr("id")?"minDate":"maxDate",s=e.datepicker.parseDate(i.dateFormat,t);n.not(this).datepicker("option",a,s)}})),n.each(function(){var t=e(this);t.hasClass("hasDatepicker")&&t.removeAttr("id").removeClass("hasDatepicker"),t.datepicker(i)})})},e.fn.csf_field_fieldset=function(){return this.each(function(){e(this).find(".csf-fieldset-content").csf_reload_script()})},e.fn.csf_field_gallery=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf-edit-gallery"),s=i.find(".csf-clear-gallery"),c=i.find("ul"),r=i.find("input");i.find("img");i.on("click",".csf-button, .csf-edit-gallery",function(i){var o=e(this),f=r.val(),l=o.hasClass("csf-edit-gallery")?"edit":"add",d="add"!==l||f.length?"gallery-edit":"gallery";i.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&("gallery"===d?(n=t.wp.media({library:{type:"image"},frame:"post",state:"gallery",multiple:!0})).open():(n=t.wp.media.gallery.edit('[gallery ids="'+f+'"]'),"add"===l&&n.setState("gallery-library")),n.on("update",function(e){c.empty();var t=e.models.map(function(e){var t=e.toJSON(),n=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url?t.sizes.thumbnail.url:t.url;return c.append('<li><img src="'+n+'"></li>'),t.id});r.val(t.join(",")).trigger("change"),s.removeClass("hidden"),a.removeClass("hidden")}))}),s.on("click",function(e){e.preventDefault(),c.empty(),r.val("").trigger("change"),s.addClass("hidden"),a.addClass("hidden")})})},e.fn.csf_field_group=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-cloneable-wrapper"),c=i.children(".csf-cloneable-hidden"),r=i.children(".csf-cloneable-max"),o=i.children(".csf-cloneable-min"),f=s.data("field-id"),l=s.data("unique-id"),d=Boolean(Number(s.data("title-number"))),h=parseInt(s.data("max")),p=parseInt(s.data("min"));s.hasClass("ui-accordion")&&s.find(".ui-accordion-header-icon").remove();var u=function(t){t.find(".csf-cloneable-title-number").each(function(t){e(this).html(e(this).closest(".csf-cloneable-item").index()+1+".")})};s.accordion({header:"> .csf-cloneable-item > .csf-cloneable-title",collapsible:!0,active:!1,animate:!1,heightStyle:"content",icons:{header:"csf-cloneable-header-icon fa fa-angle-right",activeHeader:"csf-cloneable-header-icon fa fa-angle-down"},activate:function(e,t){var n=t.newPanel,i=t.newHeader;if(n.length&&!n.data("opened")){var a=n.children().first().find(":input").first(),s=i.find(".csf-cloneable-value");a.on("keyup",function(e){s.text(a.val())}),n.csf_reload_script(),n.data("opened",!0),n.data("retry",!1)}else n.data("retry")&&(n.csf_reload_script_retry(),n.data("retry",!1))}}),s.sortable({axis:"y",handle:".csf-cloneable-title,.csf-cloneable-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",start:function(e,t){s.accordion({active:!1}),s.sortable("refreshPositions"),t.item.children(".csf-cloneable-content").data("retry",!0)},update:function(e,t){a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s)}}),i.children(".csf-cloneable-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-cloneable-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),s.accordion("refresh"),s.accordion({active:n}),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}});var v=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=e(this).parent().parent(),c=i.children(".csf-cloneable-helper").csf_clone(!0),l=i.children(".csf-cloneable-title").csf_clone(),p=i.children(".csf-cloneable-content").csf_clone(),v=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");p.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(v,f+"["+(i.index()+1)+"]"))});var g=e('<div class="csf-cloneable-item" />');g.append(c),g.append(l),g.append(p),s.children().eq(i.index()).after(g),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.accordion("refresh"),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v);var g=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;r.hide(),o.hide(),p&&n-1<p?o.show():(e(this).closest(".csf-cloneable-item").remove(),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s))};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g)})},e.fn.csf_field_icon=function(){return this.each(function(){var n=e(this);n.on("click",".csf-icon-add",function(i){i.preventDefault();var s=e(this),c=e("#csf-modal-icon");c.show(),a.vars.$icon_target=n,a.vars.icon_modal_loaded||(c.find(".csf-modal-loading").show(),t.wp.ajax.post("csf-get-icons",{nonce:s.data("nonce")}).done(function(t){c.find(".csf-modal-loading").hide(),a.vars.icon_modal_loaded=!0;var n=c.find(".csf-modal-load").html(t.content);n.on("click","a",function(t){t.preventDefault();var n=e(this).data("csf-icon");a.vars.$icon_target.find("i").removeAttr("class").addClass(n),a.vars.$icon_target.find("input").val(n).trigger("change"),a.vars.$icon_target.find(".csf-icon-preview").removeClass("hidden"),a.vars.$icon_target.find(".csf-icon-remove").removeClass("hidden"),c.hide()}),c.on("change keyup",".csf-icon-search",function(){var t=e(this).val();n.find("a").each(function(){var n=e(this);n.data("csf-icon").search(new RegExp(t,"i"))<0?n.hide():n.show()})}),c.on("click",".csf-modal-close, .csf-modal-overlay",function(){c.hide()})}).fail(function(e){c.find(".csf-modal-loading").hide(),c.find(".csf-modal-load").html(e.error),c.on("click",function(){c.hide()})}))}),n.on("click",".csf-icon-remove",function(t){t.preventDefault(),n.find(".csf-icon-preview").addClass("hidden"),n.find("input").val("").trigger("change"),e(this).addClass("hidden")})})},e.fn.csf_field_map=function(){return this.each(function(){if("undefined"!=typeof L){var t=e(this),n=t.find(".csf--map-osm"),i=t.find(".csf--map-search input"),a=t.find(".csf--latitude"),s=t.find(".csf--longitude"),c=t.find(".csf--zoom"),r=n.data("map"),o=L.map(n.get(0),r);L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(o);var f=L.marker(r.center,{draggable:!0}).addTo(o),l=function(e){a.val(e.lat),s.val(e.lng),c.val(o.getZoom())};o.on("click",function(e){f.setLatLng(e.latlng),l(e.latlng)}),o.on("zoom",function(){l(f.getLatLng())}),f.on("drag",function(){l(f.getLatLng())}),i.length||(i=e('[data-depend-id="'+t.find(".csf--address-field").data("address-field")+'"]')),i.autocomplete({source:function(t,n){e.get("https://nominatim.openstreetmap.org/search",{format:"json",q:t.term},function(e){e.length?n(e.map(function(e){return{value:e.display_name,label:e.display_name,lat:e.lat,lon:e.lon}},"json")):n([{value:"no-data",label:"No Results."}])})},select:function(e,t){if("no-data"===t.item.value)return!1;var n=L.latLng(t.item.lat,t.item.lon);o.panTo(n),f.setLatLng(n),l(n)},create:function(t,n){e(this).autocomplete("widget").addClass("csf-map-ui-autocomplate")}});var d=function(){var e=L.latLng(a.val(),s.val());o.panTo(e),f.setLatLng(e)};a.on("change",d),s.on("change",d)}})},e.fn.csf_field_media=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf--button"),s=i.find(".csf--remove"),c=a.data("library")&&a.data("library").split(",")||"",r=!!i.hasClass("csf-assign-field-background")&&i.closest(".csf-field-background").find(".csf--auto-attributes");a.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:c}})).on("select",function(){var e,t=n.state().get("selection").first().attributes,o=a.data("preview-size")||"thumbnail";c.length&&-1===c.indexOf(t.subtype)&&-1===c.indexOf(t.type)||(i.find(".csf--id").val(t.id),i.find(".csf--width").val(t.width),i.find(".csf--height").val(t.height),i.find(".csf--alt").val(t.alt),i.find(".csf--title").val(t.title),i.find(".csf--description").val(t.description),e=void 0!==t.sizes&&void 0!==t.sizes.thumbnail&&"thumbnail"===o?t.sizes.thumbnail.url:void 0!==t.sizes&&void 0!==t.sizes.full?t.sizes.full.url:t.icon,r&&r.removeClass("csf--attributes-hidden"),s.removeClass("hidden"),i.find(".csf--preview").removeClass("hidden"),i.find(".csf--src").attr("src",e),i.find(".csf--thumbnail").val(e),i.find(".csf--url").val(t.url).trigger("change"))}),n.open()))}),s.on("click",function(e){e.preventDefault(),r&&r.addClass("csf--attributes-hidden"),s.addClass("hidden"),i.find("input").val(""),i.find(".csf--preview").addClass("hidden"),i.find(".csf--url").trigger("change")})})},e.fn.csf_field_repeater=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-repeater-wrapper"),c=i.children(".csf-repeater-hidden"),r=i.children(".csf-repeater-max"),o=i.children(".csf-repeater-min"),f=s.data("field-id"),l=s.data("unique-id"),d=parseInt(s.data("max")),h=parseInt(s.data("min"));s.children(".csf-repeater-item").children(".csf-repeater-content").csf_reload_script(),s.sortable({axis:"y",handle:".csf-repeater-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,t){a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),t.item.csf_reload_script_retry()}}),i.children(".csf-repeater-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-repeater-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),a.children(".csf-repeater-content").csf_reload_script(),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}});var p=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=e(this).parent().parent().parent(),c=i.children(".csf-repeater-content").csf_clone(),l=i.children(".csf-repeater-helper").csf_clone(!0),h=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");c.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(h,f+"["+(i.index()+1)+"]"))});var p=e('<div class="csf-repeater-item" />');p.append(c),p.append(l),s.children().eq(i.index()).after(p),p.children(".csf-repeater-content").csf_reload_script(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p);var u=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;r.hide(),o.hide(),h&&n-1<h?o.show():(e(this).closest(".csf-repeater-item").remove(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh())};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u)})},e.fn.csf_field_slider=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-slider-ui"),a=n.data(),s=n.val()||0;i.hasClass("ui-slider")&&i.empty(),i.slider({range:"min",value:s,min:a.min,max:a.max,step:a.step,slide:function(e,t){n.val(t.value).trigger("change")}}),n.keyup(function(){i.slider("value",n.val())})})},e.fn.csf_field_sortable=function(){return this.each(function(){var t=e(this).find(".csf--sortable");t.sortable({axis:"y",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,n){t.csf_customizer_refresh()}}),t.find(".csf--sortable-content").csf_reload_script()})},e.fn.csf_field_sorter=function(){return this.each(function(){var t=e(this),n=t.find(".csf-enabled"),i=t.find(".csf-disabled"),a=!!i.length&&i;n.sortable({connectWith:a,placeholder:"ui-sortable-placeholder",update:function(e,n){var i=n.item.find("input");n.item.parent().hasClass("csf-enabled")?i.attr("name",i.attr("name").replace("disabled","enabled")):i.attr("name",i.attr("name").replace("enabled","disabled")),t.csf_customizer_refresh()}}),a&&a.sortable({connectWith:n,placeholder:"ui-sortable-placeholder",update:function(e,n){t.csf_customizer_refresh()}})})},e.fn.csf_field_spinner=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".ui-spinner-button"),a=n.data("unit");i.length&&i.remove(),n.spinner({max:n.data("max")||100,min:n.data("min")||0,step:n.data("step")||1,create:function(e,n){a.length&&t.find(".ui-spinner-up").after('<span class="ui-button-text-only csf--unit">'+a+"</span>")},spin:function(e,t){n.val(t.value).trigger("change")}})})},e.fn.csf_field_switcher=function(){return this.each(function(){var t=e(this).find(".csf--switcher");t.on("click",function(){var e=0,n=t.find("input");t.hasClass("csf--active")?t.removeClass("csf--active"):(e=1,t.addClass("csf--active")),n.val(e).trigger("change")})})},e.fn.csf_field_tabbed=function(){return this.each(function(){var t=e(this),n=t.find(".csf-tabbed-nav a"),i=t.find(".csf-tabbed-section");i.eq(0).csf_reload_script(),n.on("click",function(t){t.preventDefault();var n=e(this),a=n.index(),s=i.eq(a);n.addClass("csf-tabbed-active").siblings().removeClass("csf-tabbed-active"),s.csf_reload_script(),s.removeClass("hidden").siblings().addClass("hidden")})})},e.fn.csf_field_typography=function(){return this.each(function(){var t=this,n=e(this),i=[],s=csf_typography_json.webfonts,c=csf_typography_json.googlestyles,r=csf_typography_json.defaultstyles;t.sanitize_subset=function(e){return e=(e=e.replace("-ext"," Extended")).charAt(0).toUpperCase()+e.slice(1)},t.sanitize_style=function(e){return c[e]?c[e]:e},t.load_google_font=function(e,t,n){e&&"object"==typeof WebFont&&(t=t?t.replace("normal",""):"",n=n?n.replace("normal",""):"",(t||n)&&(e=e+":"+t+n),-1===i.indexOf(e)&&WebFont.load({google:{families:[e]}}),i.push(e))},t.append_select_options=function(n,i,a,s,c){n.find("option").not(":first").remove();var r="";e.each(i,function(e,n){var i,o=n;i=c?a&&-1!==a.indexOf(n)?" selected":"":a&&a===n?" selected":"","subset"===s?o=t.sanitize_subset(n):"style"===s&&(o=t.sanitize_style(n)),r+='<option value="'+n+'"'+i+">"+o+"</option>"}),n.append(r).trigger("csf.change").trigger("chosen:updated")},t.init=function(){var i=[],c=n.find(".csf--typography"),o=n.find(".csf--type"),f=n.find(".csf--block-font-style"),l=c.data("unit"),d=c.data("exclude")?c.data("exclude").split(","):[];n.find(".csf--chosen").length&&n.find("select").each(function(){var t=e(this),n=t.parent().find(".chosen-container");n.length&&n.remove(),t.chosen({allow_single_deselect:!0,disable_search_threshold:15,width:"100%"})});var h=n.find(".csf--font-family"),p=h.val();h.find("option").not(":first-child").remove();var u="";e.each(s,function(t,n){d&&-1!==d.indexOf(t)||(u+='<optgroup label="'+n.label+'">',e.each(n.fonts,function(e,n){u+='<option value="'+(n="object"==typeof n?e:n)+'" data-type="'+t+'"'+(n===p?" selected":"")+">"+n+"</option>"}),u+="</optgroup>")}),h.append(u).trigger("chosen:updated");var v=n.find(".csf--block-font-style");if(v.length){var g=n.find(".csf--font-style-select"),_=g.val()?g.val().replace(/normal/g,""):"";g.on("change csf.change",function(e){var t=g.val();!t&&i&&-1===i.indexOf("normal")&&(t=i[0]);var a=t&&"italic"!==t&&"normal"===t?"normal":"",s=t&&"italic"!==t&&"normal"!==t?t.replace("italic",""):a,c=t&&"italic"===t.substr(-6)?"italic":"";n.find(".csf--font-weight").val(s),n.find(".csf--font-style").val(c)});var m=n.find(".csf--block-extra-styles");if(m.length)var b=n.find(".csf--extra-styles"),y=b.val()}var w=n.find(".csf--block-subset");if(w.length)var k=n.find(".csf--subset"),C=k.val(),x=k.data("multiple")||!1;var z=n.find(".csf--block-backup-font-family");h.on("change csf.change",function(e){w.length&&w.addClass("hidden"),m.length&&m.addClass("hidden"),z.length&&z.addClass("hidden");var n=h.find(":selected"),a=n.val(),c=n.data("type");if(c&&a){if("google"!==c&&"custom"!==c||!z.length||z.removeClass("hidden"),v.length){var l=r;"google"===c&&s[c].fonts[a][0]?l=s[c].fonts[a][0]:"custom"===c&&s[c].fonts[a]&&(l=s[c].fonts[a]),i=l;var d=-1!==l.indexOf("normal")?"normal":l[0],p=_&&-1!==l.indexOf(_)?_:d;t.append_select_options(g,l,p,"style"),_=!1,v.removeClass("hidden"),"google"===c&&m.length&&l.length>1&&(t.append_select_options(b,l,y,"style",!0),y=!1,m.removeClass("hidden"))}if("google"===c&&w.length&&s[c].fonts[a][1]){var u=s[c].fonts[a][1],D=u.length<2&&"latin"!==u[0]?u[0]:"",O=C&&-1!==u.indexOf(C)?C:D;O=x&&C?C:O,t.append_select_options(k,u,O,"subset",x),C=!1,w.removeClass("hidden")}}else f.find(":input").val(""),w.length&&(k.find("option").not(":first-child").remove(),k.trigger("chosen:updated")),v.length&&(g.find("option").not(":first-child").remove(),g.trigger("chosen:updated"));o.val(c)}).trigger("csf.change");var D=n.find(".csf--block-preview");if(D.length){var O=n.find(".csf--preview");n.on("change",a.helper.debounce(function(e){D.removeClass("hidden");var i=h.val(),a=n.find(".csf--font-weight").val(),s=n.find(".csf--font-style").val(),c=n.find(".csf--font-size").val(),r=n.find(".csf--font-variant").val(),o=n.find(".csf--line-height").val(),f=n.find(".csf--text-align").val(),d=n.find(".csf--text-transform").val(),p=n.find(".csf--text-decoration").val(),u=n.find(".csf--color").val(),v=n.find(".csf--word-spacing").val(),g=n.find(".csf--letter-spacing").val(),_=n.find(".csf--custom-style").val();"google"===n.find(".csf--type").val()&&t.load_google_font(i,a,s);var m={};i&&(m.fontFamily=i),a&&(m.fontWeight=a),s&&(m.fontStyle=s),r&&(m.fontVariant=r),c&&(m.fontSize=c+l),o&&(m.lineHeight=o+l),g&&(m.letterSpacing=g+l),v&&(m.wordSpacing=v+l),f&&(m.textAlign=f),d&&(m.textTransform=d),p&&(m.textDecoration=p),u&&(m.color=u),O.removeAttr("style"),_&&O.attr("style",_),O.css(m)},100)),D.on("click",function(){O.toggleClass("csf--black-background");var e=D.find(".csf--toggle");e.hasClass("fa-toggle-off")?e.removeClass("fa-toggle-off").addClass("fa-toggle-on"):e.removeClass("fa-toggle-on").addClass("fa-toggle-off")}),D.hasClass("hidden")||n.trigger("change")}},t.init()})},e.fn.csf_field_upload=function(){return this.each(function(){var n,i=e(this),a=i.find("input"),s=i.find(".csf--button"),c=i.find(".csf--remove"),r=s.data("library")&&s.data("library").split(",")||"";a.on("change",function(e){a.val()?c.removeClass("hidden"):c.addClass("hidden")}),s.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:r}})).on("select",function(){var e=n.state().get("selection").first().attributes;r.length&&-1===r.indexOf(e.subtype)&&-1===r.indexOf(e.type)||a.val(e.url).trigger("change")}),n.open()))}),c.on("click",function(e){e.preventDefault(),a.val("").trigger("change")})})},e.fn.csf_field_wp_editor=function(){return this.each(function(){if(void 0!==t.wp.editor&&void 0!==t.tinyMCEPreInit&&void 0!==t.tinyMCEPreInit.mceInit.csf_wp_editor){var n=e(this),i=n.find(".csf-wp-editor"),s=n.find("textarea");(n.find(".wp-editor-wrap").length||n.find(".mce-container").length)&&(i.empty(),i.append(s),s.css("display",""));var c=a.helper.uid("csf-editor-");s.attr("id",c);var r={tinymce:t.tinyMCEPreInit.mceInit.csf_wp_editor,quicktags:t.tinyMCEPreInit.qtInit.csf_wp_editor},o=i.data("editor-settings"),f=wp.oldEditor?wp.oldEditor:wp.editor;f&&f.hasOwnProperty("autop")&&(wp.editor.autop=f.autop,wp.editor.removep=f.removep,wp.editor.initialize=f.initialize),r.tinymce=e.extend({},r.tinymce,{selector:"#"+c,setup:function(e){e.on("change",a.helper.debounce(function(){e.save(),s.trigger("change")},250))}}),!1===o.tinymce&&(r.tinymce=!1,i.addClass("csf-no-tinymce")),!1===o.quicktags&&(r.quicktags=!1,i.addClass("csf-no-quicktags"));var l=setInterval(function(){n.is(":visible")&&(t.wp.editor.initialize(c,r),clearInterval(l))});if(o.media_buttons&&t.csf_media_buttons){var d=i.find(".wp-media-buttons");if(d.length)d.find(".csf-shortcode-button").data("editor-id",c);else{var h=e(t.csf_media_buttons);h.find(".csf-shortcode-button").data("editor-id",c),i.prepend(h)}}}})},e.fn.csf_confirm=function(){return this.each(function(){e(this).on("click",function(n){var i=e(this).data("confirm")||t.csf_vars.i18n.confirm,s=confirm(i);if(a.vars.is_confirm=!0,!s)return n.preventDefault(),a.vars.is_confirm=!1,!1})})},e.fn.serializeObject=function(){var t={};return e.each(this.serializeArray(),function(n,a){var s=a.name,c=a.value;t[s]=t[s]===i?c:e.isArray(t[s])?t[s].concat(c):[t[s],c]}),t},e.fn.csf_save=function(){return this.each(function(){var n,i=e(this),s=e(".csf-save"),c=e(".csf-options"),r=!1;i.on("click",function(o){if(!r){var f=i.data("save"),l=i.val();s.attr("value",f),i.hasClass("csf-save-ajax")&&(o.preventDefault(),c.addClass("csf-saving"),s.prop("disabled",!0),t.wp.ajax.post("csf_"+c.data("unique")+"_ajax_save",{data:e("#csf-form").serializeJSONCSF()}).done(function(t){if(e(".csf-error").remove(),Object.keys(t.errors).length){var i='<i class="csf-label-error csf-error">!</i>';e.each(t.errors,function(t,n){var a=e('[data-depend-id="'+t+'"]'),s=e("#csf-tab-link-"+(a.closest(".csf-section").index()+1)),c=s.closest(".csf-tab-depth-0");a.closest(".csf-fieldset").append('<p class="csf-text-error csf-error">'+n+"</p>"),s.find(".csf-error").length||s.append(i),c.find(".csf-arrow .csf-error").length||c.find(".csf-arrow").append(i),console.log(n)})}c.removeClass("csf-saving"),s.prop("disabled",!1).attr("value",l),r=!1,a.vars.form_modified=!1,a.vars.$form_warning.hide(),clearTimeout(n);var o=e(".csf-form-success");o.empty().append(t.notice).fadeIn("fast",function(){n=setTimeout(function(){o.fadeOut("fast")},1e3)})}).fail(function(e){alert(e.error)}))}r=!0})})},e.fn.csf_options=function(){return this.each(function(){var s=e(this),c=s.find(".csf-content"),r=s.find(".csf-form-success"),o=s.find(".csf-form-warning"),f=s.find(".csf-header .csf-save");a.vars.$form_warning=o,o.length&&(t.onbeforeunload=function(){return!!a.vars.form_modified||i},c.on("change keypress",":input",function(){a.vars.form_modified||(r.hide(),o.fadeIn("fast"),a.vars.form_modified=!0)})),r.hasClass("csf-form-show")&&setTimeout(function(){r.fadeOut("fast")},1e3),e(n).keydown(function(e){if((e.ctrlKey||e.metaKey)&&83===e.which)return f.trigger("click"),e.preventDefault(),!1})})},e.fn.csf_taxonomy=function(){return this.each(function(){var t=e(this),n=t.parents("form");if("addtag"===n.attr("id")){var i=n.find("#submit"),a=t.find(".csf-field").csf_clone();i.on("click",function(){n.find(".form-required").hasClass("form-invalid")||(t.data("inited",!1),t.empty(),t.html(a),a=a.csf_clone(),t.csf_reload_script())})}})},e.fn.csf_shortcode=function(){var s=this;return s.shortcode_parse=function(t,n){var i="";return e.each(t,function(t,a){i+="["+(n=n||t),e.each(a,function(e,t){"content"===e?(i+="]",i+=t,i+="[/"+n):i+=s.shortcode_tags(e,t)}),i+="]"}),i},s.shortcode_tags=function(t,n){var i="";return""!==n&&("object"!=typeof n||e.isArray(n)?i+=" "+t.replace("-","_")+'="'+n.toString()+'"':e.each(n,function(e,t){switch(e){case"background-image":t=t.url?t.url:""}""!==t&&(i+=" "+e.replace("-","_")+'="'+t.toString()+'"')})),i},s.insertAtChars=function(e,t){var n=void 0!==e[0].name?e[0]:e;return n.value.length&&void 0!==n.selectionStart?(n.focus(),n.value.substring(0,n.selectionStart)+t+n.value.substring(n.selectionEnd,n.value.length)):(n.focus(),t)},s.send_to_editor=function(t,n){var i;if("undefined"!=typeof tinymce&&(i=tinymce.get(n)),i&&!i.isHidden())i.execCommand("mceInsertContent",!1,t);else{var a=e("#"+n);a.val(s.insertAtChars(a,t)).trigger("change")}},this.each(function(){var c,r,o,f,l,d,h,p,u,v=e(this),g=v.find(".csf-modal-load"),_=(v.find(".csf-modal-content"),v.find(".csf-modal-insert")),m=v.find(".csf-modal-loading"),b=v.find("select"),y=v.data("modal-id"),w=v.data("nonce");e(n).on("click",'.csf-shortcode-button[data-modal-id="'+y+'"]',function(t){t.preventDefault(),u=e(this),c=u.data("editor-id")||!1,r=u.data("target-id")||!1,o=u.data("gutenberg-id")||!1,v.show(),v.hasClass("csf-shortcode-single")&&l===i&&b.trigger("change")}),b.on("change",function(){var n=e(this),i=n.find(":selected");f=n.val(),l=i.data("shortcode"),d=i.data("view")||"normal",h=i.data("group")||l,g.empty(),f?(m.show(),t.wp.ajax.post("csf-get-shortcode-"+y,{shortcode_key:f,nonce:w}).done(function(t){m.hide();var n=e(t.content).appendTo(g);_.parent().removeClass("hidden"),p=n.find(".csf--repeat-shortcode").csf_clone(),n.csf_reload_script(),n.find(".csf-fields").csf_reload_script()})):_.parent().addClass("hidden")}),_.on("click",function(n){if(n.preventDefault(),!_.prop("disabled")&&!_.attr("disabled")){var i="",a=v.find(".csf-field:not(.hidden)").find(":input:not(.ignore)").serializeObjectCSF();switch(d){case"contents":var f=l?a[l]:a;e.each(f,function(e,t){var n=l||e;i+="["+n+"]"+t+"[/"+n+"]"});break;case"group":i+="["+l,e.each(a[l],function(e,t){i+=s.shortcode_tags(e,t)}),i+="]",i+=s.shortcode_parse(a[h],h),i+="[/"+l+"]";break;case"repeater":i+=s.shortcode_parse(a[h],h);break;default:i+=s.shortcode_parse(a)}if(i=""===i?"["+l+"]":i,o){var p=t.csf_gutenberg_props.attributes.hasOwnProperty("shortcode")?t.csf_gutenberg_props.attributes.shortcode:"";t.csf_gutenberg_props.setAttributes({shortcode:p+i})}else if(c)s.send_to_editor(i,c);else{var g=r?e(r):u.parent().find("textarea");g.val(s.insertAtChars(g,i)).trigger("change")}v.hide()}}),v.on("click",".csf--repeat-button",function(e){e.preventDefault();var t=v.find(".csf--repeatable"),n=p.csf_clone(),i=n.find(".csf-repeat-remove");n.appendTo(t);n.find(".csf-fields").csf_reload_script(),a.helper.name_nested_replace(v.find(".csf--repeat-shortcode"),h),i.on("click",function(){n.remove(),a.helper.name_nested_replace(v.find(".csf--repeat-shortcode"),h)})}),v.on("click",".csf-modal-close, .csf-modal-overlay",function(){v.hide()})})},"function"==typeof Color&&(Color.fn.toString=function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e}),a.funcs.parse_color=function(e){var t=e.replace(/\s+/g,""),n=-1!==t.indexOf("rgba")?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100;return{value:t,transparent:n,rgba:n<100}},e.fn.csf_color=function(){return this.each(function(){var n,i=e(this),s=a.funcs.parse_color(i.val()),c=!t.csf_vars.color_palette.length||t.csf_vars.color_palette;i.hasClass("wp-color-picker")&&i.closest(".wp-picker-container").after(i).remove(),i.wpColorPicker({palettes:c,change:function(e,t){var a=t.color.toString();n.removeClass("csf--transparent-active"),n.find(".csf--transparent-offset").css("background-color",a),i.val(a).trigger("change")},create:function(){n=i.closest(".wp-picker-container");var t=i.data("a8cIris"),c=e('<div class="csf--transparent-wrap"><div class="csf--transparent-slider"></div><div class="csf--transparent-offset"></div><div class="csf--transparent-text"></div><div class="csf--transparent-button">transparent <i class="fa fa-toggle-off"></i></div></div>').appendTo(n.find(".wp-picker-holder")),r=c.find(".csf--transparent-slider"),o=c.find(".csf--transparent-text"),f=c.find(".csf--transparent-offset"),l=c.find(".csf--transparent-button");"transparent"===i.val()&&n.addClass("csf--transparent-active"),l.on("click",function(){"transparent"!==i.val()?(i.val("transparent").trigger("change").removeClass("iris-error"),n.addClass("csf--transparent-active")):(i.val(t._color.toString()).trigger("change"),n.removeClass("csf--transparent-active"))}),r.slider({value:s.transparent,step:1,min:0,max:100,slide:function(e,n){var a=parseFloat(n.value/100);t._color._alpha=a,i.wpColorPicker("color",t._color.toString()),o.text(1===a||0===a?"":a)},create:function(){var e=parseFloat(s.transparent/100),c=e<1?e:"";o.text(c),f.css("background-color",s.value),n.on("click",".wp-picker-clear",function(){t._color._alpha=1,o.text(""),r.slider("option","value",100),n.removeClass("csf--transparent-active"),i.trigger("change")}),n.on("click",".wp-picker-default",function(){var e=a.funcs.parse_color(i.data("default-color")),n=parseFloat(e.transparent/100),s=n<1?n:"";t._color._alpha=n,o.text(s),r.slider("option","value",e.transparent)})}})}})})},e.fn.csf_chosen=function(){return this.each(function(){var n=e(this),a=n.parent().find(".chosen-container"),s=n.hasClass("csf-chosen-sortable")||!1,c=n.hasClass("csf-chosen-ajax")||!1,r=n.attr("multiple")||!1,o=r?"100%":"auto",f=e.extend({allow_single_deselect:!0,disable_search_threshold:10,width:o,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));if(a.length&&a.remove(),c){var l=e.extend({data:{type:"post",nonce:""},allow_single_deselect:!0,disable_search_threshold:-1,width:"100%",min_length:3,type_delay:500,typing_text:t.csf_vars.i18n.typing_text,searching_text:t.csf_vars.i18n.searching_text,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));n.CSFAjaxChosen(l)}else n.chosen(f);if(r){var d=n.parent().find(".csf-hidden-select"),h=d.val()||[];n.on("change",function(e,n){n&&n.selected?d.append('<option value="'+n.selected+'" selected="selected">'+n.selected+"</option>"):n&&n.deselected&&d.find('option[value="'+n.deselected+'"]').remove(),0===d.children().length&&t.wp.customize!==i&&t.wp.customize.control(d.data("customize-setting-link")).setting.set(""),d.trigger("change")}),n.CSFChosenOrder(h,!0)}if(s){var p=n.parent().find(".chosen-container").find(".chosen-choices");p.bind("mousedown",function(t){e(t.target).is("span")&&t.stopPropagation()}),p.sortable({items:"li:not(.search-field)",helper:"orginal",cursor:"move",placeholder:"search-choice-placeholder",start:function(e,t){t.placeholder.width(t.item.innerWidth()),t.placeholder.height(t.item.innerHeight())},update:function(t,i){var a="",s=n.data("chosen"),c=n.parent().find(".csf-hidden-select");p.find(".search-choice-close").each(function(){var t=e(this).data("option-array-index");e.each(s.results_data,function(e,n){n.array_index===t&&(a+='<option value="'+n.value+'" selected>'+n.value+"</option>")})}),c.children().remove(),c.append(a),c.trigger("change")}})}})},e.fn.csf_checkbox=function(){return this.each(function(){var t=e(this),n=t.find(".csf--input"),i=t.find(".csf--checkbox");i.on("click",function(){n.val(Number(i.prop("checked"))).trigger("change")})})},e.fn.csf_siblings=function(){return this.each(function(){var t=e(this),n=t.find(".csf--sibling"),i=t.data("multiple")||!1;n.on("click",function(){var n=e(this);i?n.hasClass("csf--active")?(n.removeClass("csf--active"),n.find("input").prop("checked",!1).trigger("change")):(n.addClass("csf--active"),n.find("input").prop("checked",!0).trigger("change")):(t.find("input").prop("checked",!1),n.find("input").prop("checked",!0).trigger("change"),n.addClass("csf--active").siblings().removeClass("csf--active"))})})},e.fn.csf_help=function(){return this.each(function(){var t,n,s=e(this);s.on({mouseenter:function(){t=e('<div class="csf-tooltip"></div>').html(s.find(".csf-help-text").html()).appendTo("body"),n=a.vars.is_rtl?s.offset().left+24:s.offset().left-t.outerWidth(),t.css({top:s.offset().top-(t.outerHeight()/2-14),left:n})},mouseleave:function(){t!==i&&t.remove()}})})},e.fn.csf_customizer_refresh=function(){return this.each(function(){var i=e(this),a=i.closest(".csf-customize-complex");if(a.length){var s=a.find(":input"),c=a.data("unique-id"),r=a.data("option-id"),o=s.serializeObjectCSF(),f=e.isEmptyObject(o)?"":o[c][r],l=t.wp.customize.control(c+"["+r+"]");l.setting._value=null,l.setting.set(f)}else i.find(":input").first().trigger("change");e(n).trigger("csf-customizer-refresh",i)})},e.fn.csf_customizer_listen=function(n){var s=e.extend({closest:!1},n);return this.each(function(){if(t.wp.customize!==i){var n=s.closest?e(this).closest(".csf-customize-complex"):e(this),c=n.find(":input"),r=n.data("unique-id"),o=n.data("option-id");r!==i&&c.on("change keyup",a.helper.debounce(function(){var i=n.find(":input").serializeObjectCSF(),a=!e.isEmptyObject(i)&&i[r]&&i[r][o]?i[r][o]:"";t.wp.customize.control(r+"["+o+"]").setting.set(a)},250))}})},e(n).on("expanded",".control-section",function(){var t=e(this);if(t.hasClass("open")&&!t.data("inited")){var n=t.find(".csf-customize-field"),i=t.find(".csf-customize-complex");n.length&&(t.csf_dependency(),n.csf_reload_script({dependency:!1}),i.csf_customizer_listen()),t.data("inited",!0)}}),a.vars.$window.on("resize csf.resize",a.helper.debounce(function(n){(navigator.userAgent.indexOf("AppleWebKit/")>-1?a.vars.$window.width():t.innerWidth)<=782&&!a.vars.onloaded&&(e(".csf-section").csf_reload_script(),a.vars.onloaded=!0)},200)).trigger("csf.resize"),e.fn.csf_widgets=function(){this.length&&(e(n).on("widget-added widget-updated",function(e,t){t.find(".csf-fields").csf_reload_script()}),e(".widgets-sortables, .control-section-sidebar").on("sortstop",function(e,t){t.item.find(".csf-fields").csf_reload_script_retry()}),e(n).on("click",".widget-top",function(t){e(this).parent().find(".csf-fields").csf_reload_script()}))},e.fn.csf_reload_script_retry=function(){return this.each(function(){var t=e(this);t.data("inited")&&t.children(".csf-field-wp_editor").csf_field_wp_editor()})},e.fn.csf_reload_script=function(t){var i=e.extend({dependency:!0},t);return this.each(function(){var t=e(this);t.data("inited")||(t.children(".csf-field-accordion").csf_field_accordion(),t.children(".csf-field-backup").csf_field_backup(),t.children(".csf-field-background").csf_field_background(),t.children(".csf-field-code_editor").csf_field_code_editor(),t.children(".csf-field-date").csf_field_date(),t.children(".csf-field-fieldset").csf_field_fieldset(),t.children(".csf-field-gallery").csf_field_gallery(),t.children(".csf-field-group").csf_field_group(),t.children(".csf-field-icon").csf_field_icon(),t.children(".csf-field-media").csf_field_media(),t.children(".csf-field-map").csf_field_map(),t.children(".csf-field-repeater").csf_field_repeater(),t.children(".csf-field-slider").csf_field_slider(),t.children(".csf-field-sortable").csf_field_sortable(),t.children(".csf-field-sorter").csf_field_sorter(),t.children(".csf-field-spinner").csf_field_spinner(),t.children(".csf-field-switcher").csf_field_switcher(),t.children(".csf-field-tabbed").csf_field_tabbed(),t.children(".csf-field-typography").csf_field_typography(),t.children(".csf-field-upload").csf_field_upload(),t.children(".csf-field-wp_editor").csf_field_wp_editor(),t.children(".csf-field-border").find(".csf-color").csf_color(),t.children(".csf-field-background").find(".csf-color").csf_color(),t.children(".csf-field-color").find(".csf-color").csf_color(),t.children(".csf-field-color_group").find(".csf-color").csf_color(),t.children(".csf-field-link_color").find(".csf-color").csf_color(),t.children(".csf-field-typography").find(".csf-color").csf_color(),t.children(".csf-field-select").find(".csf-chosen").csf_chosen(),t.children(".csf-field-checkbox").find(".csf-checkbox").csf_checkbox(),t.children(".csf-field-button_set").find(".csf-siblings").csf_siblings(),t.children(".csf-field-image_select").find(".csf-siblings").csf_siblings(),t.children(".csf-field-palette").find(".csf-siblings").csf_siblings(),t.children(".csf-field").find(".csf-help").csf_help(),i.dependency&&t.csf_dependency(),t.data("inited",!0),e(n).trigger("csf-reload-script",t))})},e(n).ready(function(){e(".csf-save").csf_save(),e(".csf-options").csf_options(),e(".csf-sticky-header").csf_sticky(),e(".csf-nav-options").csf_nav_options(),e(".csf-nav-metabox").csf_nav_metabox(),e(".csf-taxonomy").csf_taxonomy(),e(".csf-page-templates").csf_page_templates(),e(".csf-post-formats").csf_post_formats(),e(".csf-shortcode").csf_shortcode(),e(".csf-search").csf_search(),e(".csf-confirm").csf_confirm(),e(".csf-expand-all").csf_expand_all(),e(".csf-onload").csf_reload_script(),e(".widget").csf_widgets()})}(jQuery,window,document);
1
+ !function(e,t,n,i){"use strict";var a=a||{};if(a.funcs={},a.vars={onloaded:!1,$body:e("body"),$window:e(t),$document:e(n),$form_warning:null,form_modified:!1,code_themes:[],is_rtl:e("body").hasClass("rtl")},a.helper={uid:function(e){return(e||"")+Math.random().toString(36).substr(2,9)},preg_quote:function(e){return(e+"").replace(/(\[|\-|\])/g,"\\$1")},name_nested_replace:function(t,n){var i=new RegExp("("+a.helper.preg_quote(n)+")\\[(\\d+)\\]","g");t.find(":radio").each(function(){(this.checked||this.orginal_checked)&&(this.orginal_checked=!0)}),t.each(function(t){e(this).find(":input").each(function(){this.name=this.name.replace(i,n+"["+t+"]"),this.orginal_checked&&(this.checked=!0)})})},debounce:function(e,t,n){var i;return function(){var a=this,s=arguments,c=n&&!i;clearTimeout(i),i=setTimeout(function(){i=null,n||e.apply(a,s)},t),c&&e.apply(a,s)}},get_cookie:function(e){var t,i,a=n.cookie,s=e+"=";if(a){if(-1===(i=a.indexOf("; "+s))){if(0!==(i=a.indexOf(s)))return null}else i+=2;return-1===(t=a.indexOf(";",i))&&(t=a.length),decodeURIComponent(a.substring(i+s.length,t))}},set_cookie:function(e,t,i,a,s,c){var r=new Date;"object"==typeof i&&i.toGMTString?i=i.toGMTString():parseInt(i,10)?(r.setTime(r.getTime()+1e3*parseInt(i,10)),i=r.toGMTString()):i="",n.cookie=e+"="+encodeURIComponent(t)+(i?"; expires="+i:"")+(a?"; path="+a:"")+(s?"; domain="+s:"")+(c?"; secure":"")},remove_cookie:function(e,t,n,i){a.helper.set_cookie(e,"",-1e3,t,n,i)}},e.fn.csf_clone=function(){for(var t=e.fn.clone.apply(this,arguments),n=this.find("select").add(this.filter("select")),i=t.find("select").add(t.filter("select")),a=0;a<n.length;++a)for(var s=0;s<n[a].options.length;++s)!0===n[a].options[s].selected&&(i[a].options[s].selected=!0);return this.find(":radio").each(function(){this.orginal_checked=this.checked}),t},e.fn.csf_expand_all=function(){return this.each(function(){e(this).on("click",function(t){t.preventDefault(),e(".csf-wrapper").toggleClass("csf-show-all"),e(".csf-section").csf_reload_script(),e(this).find(".fa").toggleClass("fa-indent").toggleClass("fa-outdent")})})},e.fn.csf_nav_options=function(){return this.each(function(){var n,i=e(this),a=i.find("a"),s=i.closest(".csf").find(".csf-section-id");e(t).on("hashchange",function(){var i=t.location.hash.match(new RegExp("tab=([^&]*)")),c=i?i[1]:a.first().attr("href").replace("#tab=",""),r=e("#csf-tab-link-"+c);if(r.length>0){r.closest(".csf-tab-depth-0").addClass("csf-tab-active").siblings().removeClass("csf-tab-active"),a.removeClass("csf-section-active"),r.addClass("csf-section-active"),void 0!==n&&n.hide();var o=e("#csf-section-"+c);o.css({display:"block"}),o.csf_reload_script(),s.val(c),n=o}}).trigger("hashchange")})},e.fn.csf_nav_metabox=function(){return this.each(function(){var t,n,i=e(this),s=i.find("a"),c=i.data("unique"),r=e("#post_ID").val()||"global";s.on("click",function(i){i.preventDefault();var s=e(this),o=s.data("section");void 0!==n&&n.removeClass("csf-section-active"),void 0!==t&&t.hide(),s.addClass("csf-section-active");var f=e("#csf-section-"+o);f.css({display:"block"}),f.csf_reload_script(),a.helper.set_cookie("csf-last-metabox-tab-"+r+"-"+c,o),t=f,n=s});var o=a.helper.get_cookie("csf-last-metabox-tab-"+r+"-"+c);o?i.find('a[data-section="'+o+'"]').trigger("click"):s.first("a").trigger("click")})},e.fn.csf_page_templates=function(){this.length&&e(n).on("change",".editor-page-attributes__template select, #page_template",function(){var t=e(this).val()||"default";e(".csf-page-templates").removeClass("csf-show").addClass("csf-hide"),e(".csf-page-"+t.toLowerCase().replace(/[^a-zA-Z0-9]+/g,"-")).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_post_formats=function(){this.length&&e(n).on("change",'.editor-post-format select, #formatdiv input[name="post_format"]',function(){var t=e(this).val()||"default";t="0"===t?"default":t,e(".csf-post-formats").removeClass("csf-show").addClass("csf-hide"),e(".csf-post-format-"+t).removeClass("csf-hide").addClass("csf-show")})},e.fn.csf_search=function(){return this.each(function(){e(this).find("input").on("change keyup",function(){var t=e(this).val(),n=e(".csf-wrapper"),i=n.find(".csf-section").find("> .csf-field:not(.hidden)"),a=i.find("> .csf-title, .csf-search-tags");t.length>3?(i.addClass("csf-hidden"),n.addClass("csf-search-all"),a.each(function(){var n=e(this);if(n.text().match(new RegExp(".*?"+t+".*?","i"))){var i=n.closest(".csf-field");i.removeClass("csf-hidden"),i.parent().csf_reload_script()}})):(i.removeClass("csf-hidden"),n.removeClass("csf-search-all"))})})},e.fn.csf_sticky=function(){return this.each(function(){var i=e(this),a=e(t),s=i.find(".csf-header-inner"),c=parseInt(s.css("padding-left"))+parseInt(s.css("padding-right")),r=0,o=!1,f=function(){o||requestAnimationFrame(function(){var e,a,f;e=i.offset().top,a=Math.max(32,e-r),f=Math.max(n.documentElement.clientWidth,t.innerWidth||0),a<=32&&f>782?(s.css({width:i.outerWidth()-c}),i.css({height:i.outerHeight()}).addClass("csf-sticky")):(s.removeAttr("style"),i.removeAttr("style").removeClass("csf-sticky")),o=!1}),o=!0},l=function(){r=a.scrollTop(),f()};a.on("scroll resize",l),l()})},e.fn.csf_dependency=function(){return this.each(function(){var t=e(this),n=e.csf_deps.createRuleset(),i=[],s=!1;t.children("[data-controller]").each(function(){var t=e(this),a=t.data("controller").split("|"),c=t.data("condition").split("|"),r=t.data("value").toString().split("|"),o=n;t.data("depend-global")&&(s=!0),e.each(a,function(e,n){var a=r[e]||"",s=c[e]||c[0];(o=o.createRule('[data-depend-id="'+n+'"]',s,a)).include(t),i.push(n)})}),i.length&&(s?e.csf_deps.enable(a.vars.$body,n,i):e.csf_deps.enable(t,n,i))})},e.fn.csf_field_accordion=function(){return this.each(function(){e(this).find(".csf-accordion-title").on("click",function(){var t=e(this),n=t.find(".csf-accordion-icon"),i=t.next();n.hasClass("fa-angle-right")?n.removeClass("fa-angle-right").addClass("fa-angle-down"):n.removeClass("fa-angle-down").addClass("fa-angle-right"),i.data("opened")||(i.csf_reload_script(),i.data("opened",!0)),i.toggleClass("csf-accordion-open")})})},e.fn.csf_field_backup=function(){return this.each(function(){if(void 0!==t.wp.customize){var n=this,i=e(this),s=(e("body"),i.find(".csf-import")),c=i.find(".csf-reset");n.notification=function(e){wp.customize.notifications&&wp.customize.OverlayNotification&&(wp.customize.state("saved").get()||(wp.customize.state("changesetStatus").set("trash"),wp.customize.each(function(e){e._dirty=!1}),wp.customize.state("saved").set(!0)),wp.customize.notifications.add(new wp.customize.OverlayNotification("csf_field_backup_notification",{type:"info",message:e,loading:!0})))},c.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.reset_notification),t.wp.ajax.post("csf-reset",{unique:c.data("unique"),nonce:c.data("nonce")}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))}),s.on("click",function(e){e.preventDefault(),a.vars.is_confirm&&(n.notification(t.csf_vars.i18n.import_notification),t.wp.ajax.post("csf-import",{unique:s.data("unique"),nonce:s.data("nonce"),import_data:i.find(".csf-import-data").val()}).done(function(e){t.location.reload(!0)}).fail(function(e){alert(e.error),wp.customize.notifications.remove("csf_field_backup_notification")}))})}})},e.fn.csf_field_background=function(){return this.each(function(){e(this).find(".csf--background-image").csf_reload_script()})},e.fn.csf_field_code_editor=function(){return this.each(function(){if("function"==typeof CodeMirror){var t=e(this),n=t.find("textarea"),i=t.find(".CodeMirror"),s=n.data("editor");i.length&&i.remove();var c=setInterval(function(){if(t.is(":visible")){var i=CodeMirror.fromTextArea(n[0],s);if("default"!==s.theme&&-1===a.vars.code_themes.indexOf(s.theme)){var r=e("<link>");e("#csf-codemirror-css").after(r),r.attr({rel:"stylesheet",id:"csf-codemirror-"+s.theme+"-css",href:s.cdnURL+"/theme/"+s.theme+".min.css",type:"text/css",media:"all"}),a.vars.code_themes.push(s.theme)}CodeMirror.modeURL=s.cdnURL+"/mode/%N/%N.min.js",CodeMirror.autoLoadMode(i,s.mode),i.on("change",function(e,t){n.val(i.getValue()).trigger("change")}),clearInterval(c)}})}})},e.fn.csf_field_date=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-date-settings").data("settings"),a={showAnim:"",beforeShow:function(t,n){e(n.dpDiv).addClass("csf-datepicker-wrapper")},onClose:function(t,n){e(n.dpDiv).removeClass("csf-datepicker-wrapper")}};i=e.extend({},i,a),2===n.length&&(i=e.extend({},i,{onSelect:function(t){e(this),n.first();var a=n.first().attr("id")===e(this).attr("id")?"minDate":"maxDate",s=e.datepicker.parseDate(i.dateFormat,t);n.not(this).datepicker("option",a,s)}})),n.each(function(){var t=e(this);t.hasClass("hasDatepicker")&&t.removeAttr("id").removeClass("hasDatepicker"),t.datepicker(i)})})},e.fn.csf_field_fieldset=function(){return this.each(function(){e(this).find(".csf-fieldset-content").csf_reload_script()})},e.fn.csf_field_gallery=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf-edit-gallery"),s=i.find(".csf-clear-gallery"),c=i.find("ul"),r=i.find("input");i.find("img");i.on("click",".csf-button, .csf-edit-gallery",function(i){var o=e(this),f=r.val(),l=o.hasClass("csf-edit-gallery")?"edit":"add",d="add"!==l||f.length?"gallery-edit":"gallery";i.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&("gallery"===d?(n=t.wp.media({library:{type:"image"},frame:"post",state:"gallery",multiple:!0})).open():(n=t.wp.media.gallery.edit('[gallery ids="'+f+'"]'),"add"===l&&n.setState("gallery-library")),n.on("update",function(e){c.empty();var t=e.models.map(function(e){var t=e.toJSON(),n=t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url?t.sizes.thumbnail.url:t.url;return c.append('<li><img src="'+n+'"></li>'),t.id});r.val(t.join(",")).trigger("change"),s.removeClass("hidden"),a.removeClass("hidden")}))}),s.on("click",function(e){e.preventDefault(),c.empty(),r.val("").trigger("change"),s.addClass("hidden"),a.addClass("hidden")})})},e.fn.csf_field_group=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-cloneable-wrapper"),c=i.children(".csf-cloneable-hidden"),r=i.children(".csf-cloneable-max"),o=i.children(".csf-cloneable-min"),f=s.data("field-id"),l=s.data("unique-id"),d=Boolean(Number(s.data("title-number"))),h=parseInt(s.data("max")),p=parseInt(s.data("min"));s.hasClass("ui-accordion")&&s.find(".ui-accordion-header-icon").remove();var u=function(t){t.find(".csf-cloneable-title-number").each(function(t){e(this).html(e(this).closest(".csf-cloneable-item").index()+1+".")})};s.accordion({header:"> .csf-cloneable-item > .csf-cloneable-title",collapsible:!0,active:!1,animate:!1,heightStyle:"content",icons:{header:"csf-cloneable-header-icon fa fa-angle-right",activeHeader:"csf-cloneable-header-icon fa fa-angle-down"},activate:function(e,t){var n=t.newPanel,i=t.newHeader;if(n.length&&!n.data("opened")){var a=n.children().first().find(":input").first(),s=i.find(".csf-cloneable-value");a.on("keyup",function(e){s.text(a.val())}),n.csf_reload_script(),n.data("opened",!0),n.data("retry",!1)}else n.data("retry")&&(n.csf_reload_script_retry(),n.data("retry",!1))}}),s.sortable({axis:"y",handle:".csf-cloneable-title,.csf-cloneable-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",start:function(e,t){s.accordion({active:!1}),s.sortable("refreshPositions"),t.item.children(".csf-cloneable-content").data("retry",!0)},update:function(e,t){a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s)}}),i.children(".csf-cloneable-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-cloneable-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),s.accordion("refresh"),s.accordion({active:n}),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}});var v=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;if(o.hide(),h&&n+1>h)r.show();else{var i=e(this).parent().parent(),c=i.children(".csf-cloneable-helper").csf_clone(!0),l=i.children(".csf-cloneable-title").csf_clone(),p=i.children(".csf-cloneable-content").csf_clone(),v=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");p.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(v,f+"["+(i.index()+1)+"]"))});var g=e('<div class="csf-cloneable-item" />');g.append(c),g.append(l),g.append(p),s.children().eq(i.index()).after(g),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.accordion("refresh"),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0}),d&&u(s)}};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-clone",v);var g=function(t){t.preventDefault();var n=s.children(".csf-cloneable-item").length;r.hide(),o.hide(),p&&n-1<p?o.show():(e(this).closest(".csf-cloneable-item").remove(),a.helper.name_nested_replace(s.children(".csf-cloneable-item"),f),s.csf_customizer_refresh(),d&&u(s))};s.children(".csf-cloneable-item").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g),i.children(".csf-cloneable-hidden").children(".csf-cloneable-helper").on("click",".csf-cloneable-remove",g)})},e.fn.csf_field_icon=function(){return this.each(function(){var n=e(this);n.on("click",".csf-icon-add",function(i){i.preventDefault();var s=e(this),c=e("#csf-modal-icon");c.show(),a.vars.$icon_target=n,a.vars.icon_modal_loaded||(c.find(".csf-modal-loading").show(),t.wp.ajax.post("csf-get-icons",{nonce:s.data("nonce")}).done(function(t){c.find(".csf-modal-loading").hide(),a.vars.icon_modal_loaded=!0;var n=c.find(".csf-modal-load").html(t.content);n.on("click","a",function(t){t.preventDefault();var n=e(this).data("csf-icon");a.vars.$icon_target.find("i").removeAttr("class").addClass(n),a.vars.$icon_target.find("input").val(n).trigger("change"),a.vars.$icon_target.find(".csf-icon-preview").removeClass("hidden"),a.vars.$icon_target.find(".csf-icon-remove").removeClass("hidden"),c.hide()}),c.on("change keyup",".csf-icon-search",function(){var t=e(this).val();n.find("a").each(function(){var n=e(this);n.data("csf-icon").search(new RegExp(t,"i"))<0?n.hide():n.show()})}),c.on("click",".csf-modal-close, .csf-modal-overlay",function(){c.hide()})}).fail(function(e){c.find(".csf-modal-loading").hide(),c.find(".csf-modal-load").html(e.error),c.on("click",function(){c.hide()})}))}),n.on("click",".csf-icon-remove",function(t){t.preventDefault(),n.find(".csf-icon-preview").addClass("hidden"),n.find("input").val("").trigger("change"),e(this).addClass("hidden")})})},e.fn.csf_field_map=function(){return this.each(function(){if("undefined"!=typeof L){var t=e(this),n=t.find(".csf--map-osm"),i=t.find(".csf--map-search input"),a=t.find(".csf--latitude"),s=t.find(".csf--longitude"),c=t.find(".csf--zoom"),r=n.data("map"),o=L.map(n.get(0),r);L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}).addTo(o);var f=L.marker(r.center,{draggable:!0}).addTo(o),l=function(e){a.val(e.lat),s.val(e.lng),c.val(o.getZoom())};o.on("click",function(e){f.setLatLng(e.latlng),l(e.latlng)}),o.on("zoom",function(){l(f.getLatLng())}),f.on("drag",function(){l(f.getLatLng())}),i.length||(i=e('[data-depend-id="'+t.find(".csf--address-field").data("address-field")+'"]')),i.autocomplete({source:function(t,n){e.get("https://nominatim.openstreetmap.org/search",{format:"json",q:t.term},function(e){e.length?n(e.map(function(e){return{value:e.display_name,label:e.display_name,lat:e.lat,lon:e.lon}},"json")):n([{value:"no-data",label:"No Results."}])})},select:function(e,t){if("no-data"===t.item.value)return!1;var n=L.latLng(t.item.lat,t.item.lon);o.panTo(n),f.setLatLng(n),l(n)},create:function(t,n){e(this).autocomplete("widget").addClass("csf-map-ui-autocomplate")}});var d=function(){var e=L.latLng(a.val(),s.val());o.panTo(e),f.setLatLng(e)};a.on("change",d),s.on("change",d)}})},e.fn.csf_field_media=function(){return this.each(function(){var n,i=e(this),a=i.find(".csf--button"),s=i.find(".csf--remove"),c=a.data("library")&&a.data("library").split(",")||"",r=!!i.hasClass("csf-assign-field-background")&&i.closest(".csf-field-background").find(".csf--auto-attributes");a.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:c}})).on("select",function(){var e,t=n.state().get("selection").first().attributes,o=a.data("preview-size")||"thumbnail";c.length&&-1===c.indexOf(t.subtype)&&-1===c.indexOf(t.type)||(i.find(".csf--id").val(t.id),i.find(".csf--width").val(t.width),i.find(".csf--height").val(t.height),i.find(".csf--alt").val(t.alt),i.find(".csf--title").val(t.title),i.find(".csf--description").val(t.description),e=void 0!==t.sizes&&void 0!==t.sizes.thumbnail&&"thumbnail"===o?t.sizes.thumbnail.url:void 0!==t.sizes&&void 0!==t.sizes.full?t.sizes.full.url:t.icon,r&&r.removeClass("csf--attributes-hidden"),s.removeClass("hidden"),i.find(".csf--preview").removeClass("hidden"),i.find(".csf--src").attr("src",e),i.find(".csf--thumbnail").val(e),i.find(".csf--url").val(t.url).trigger("change"))}),n.open()))}),s.on("click",function(e){e.preventDefault(),r&&r.addClass("csf--attributes-hidden"),s.addClass("hidden"),i.find("input").val(""),i.find(".csf--preview").addClass("hidden"),i.find(".csf--url").trigger("change")})})},e.fn.csf_field_repeater=function(){return this.each(function(){var t=e(this),n=t.children(".csf-fieldset"),i=n.length?n:t,s=i.children(".csf-repeater-wrapper"),c=i.children(".csf-repeater-hidden"),r=i.children(".csf-repeater-max"),o=i.children(".csf-repeater-min"),f=s.data("field-id"),l=s.data("unique-id"),d=parseInt(s.data("max")),h=parseInt(s.data("min"));s.children(".csf-repeater-item").children(".csf-repeater-content").csf_reload_script(),s.sortable({axis:"y",handle:".csf-repeater-sort",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,t){a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),t.item.csf_reload_script_retry()}}),i.children(".csf-repeater-add").on("click",function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=l+f+"["+n+"]",a=c.csf_clone(!0);a.removeClass("csf-repeater-hidden"),a.find(':input[name!="_pseudo"]').each(function(){this.name=i+this.name.replace(this.name.startsWith("_nonce")?"_nonce":l,"")}),a.find(".csf-data-wrapper").each(function(){e(this).attr("data-unique-id",i)}),s.append(a),a.children(".csf-repeater-content").csf_reload_script(),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}});var p=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;if(o.hide(),d&&n+1>d)r.show();else{var i=e(this).parent().parent().parent(),c=i.children(".csf-repeater-content").csf_clone(),l=i.children(".csf-repeater-helper").csf_clone(!0),h=new RegExp("("+a.helper.preg_quote(f)+")\\[(\\d+)\\]","g");c.find(".csf-data-wrapper").each(function(){var t=e(this);t.attr("data-unique-id",t.attr("data-unique-id").replace(h,f+"["+(i.index()+1)+"]"))});var p=e('<div class="csf-repeater-item" />');p.append(c),p.append(l),s.children().eq(i.index()).after(p),p.children(".csf-repeater-content").csf_reload_script(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh(),s.csf_customizer_listen({closest:!0})}};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-clone",p);var u=function(t){t.preventDefault();var n=s.children(".csf-repeater-item").length;r.hide(),o.hide(),h&&n-1<h?o.show():(e(this).closest(".csf-repeater-item").remove(),a.helper.name_nested_replace(s.children(".csf-repeater-item"),f),s.csf_customizer_refresh())};s.children(".csf-repeater-item").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u),i.children(".csf-repeater-hidden").children(".csf-repeater-helper").on("click",".csf-repeater-remove",u)})},e.fn.csf_field_slider=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".csf-slider-ui"),a=n.data(),s=n.val()||0;i.hasClass("ui-slider")&&i.empty(),i.slider({range:"min",value:s,min:a.min,max:a.max,step:a.step,slide:function(e,t){n.val(t.value).trigger("change")}}),n.keyup(function(){i.slider("value",n.val())})})},e.fn.csf_field_sortable=function(){return this.each(function(){var t=e(this).find(".csf--sortable");t.sortable({axis:"y",helper:"original",cursor:"move",placeholder:"widget-placeholder",update:function(e,n){t.csf_customizer_refresh()}}),t.find(".csf--sortable-content").csf_reload_script()})},e.fn.csf_field_sorter=function(){return this.each(function(){var t=e(this),n=t.find(".csf-enabled"),i=t.find(".csf-disabled"),a=!!i.length&&i;n.sortable({connectWith:a,placeholder:"ui-sortable-placeholder",update:function(e,n){var i=n.item.find("input");n.item.parent().hasClass("csf-enabled")?i.attr("name",i.attr("name").replace("disabled","enabled")):i.attr("name",i.attr("name").replace("enabled","disabled")),t.csf_customizer_refresh()}}),a&&a.sortable({connectWith:n,placeholder:"ui-sortable-placeholder",update:function(e,n){t.csf_customizer_refresh()}})})},e.fn.csf_field_spinner=function(){return this.each(function(){var t=e(this),n=t.find("input"),i=t.find(".ui-spinner-button"),a=n.data("unit");i.length&&i.remove(),n.spinner({max:n.data("max")||100,min:n.data("min")||0,step:n.data("step")||1,create:function(e,n){a.length&&t.find(".ui-spinner-up").after('<span class="ui-button-text-only csf--unit">'+a+"</span>")},spin:function(e,t){n.val(t.value).trigger("change")}})})},e.fn.csf_field_switcher=function(){return this.each(function(){var t=e(this).find(".csf--switcher");t.on("click",function(){var e=0,n=t.find("input");t.hasClass("csf--active")?t.removeClass("csf--active"):(e=1,t.addClass("csf--active")),n.val(e).trigger("change")})})},e.fn.csf_field_tabbed=function(){return this.each(function(){var t=e(this),n=t.find(".csf-tabbed-nav a"),i=t.find(".csf-tabbed-section");i.eq(0).csf_reload_script(),n.on("click",function(t){t.preventDefault();var n=e(this),a=n.index(),s=i.eq(a);n.addClass("csf-tabbed-active").siblings().removeClass("csf-tabbed-active"),s.csf_reload_script(),s.removeClass("hidden").siblings().addClass("hidden")})})},e.fn.csf_field_typography=function(){return this.each(function(){var t=this,n=e(this),i=[],s=csf_typography_json.webfonts,c=csf_typography_json.googlestyles,r=csf_typography_json.defaultstyles;t.sanitize_subset=function(e){return e=(e=e.replace("-ext"," Extended")).charAt(0).toUpperCase()+e.slice(1)},t.sanitize_style=function(e){return c[e]?c[e]:e},t.load_google_font=function(e,t,n){e&&"object"==typeof WebFont&&(t=t?t.replace("normal",""):"",n=n?n.replace("normal",""):"",(t||n)&&(e=e+":"+t+n),-1===i.indexOf(e)&&WebFont.load({google:{families:[e]}}),i.push(e))},t.append_select_options=function(n,i,a,s,c){n.find("option").not(":first").remove();var r="";e.each(i,function(e,n){var i,o=n;i=c?a&&-1!==a.indexOf(n)?" selected":"":a&&a===n?" selected":"","subset"===s?o=t.sanitize_subset(n):"style"===s&&(o=t.sanitize_style(n)),r+='<option value="'+n+'"'+i+">"+o+"</option>"}),n.append(r).trigger("csf.change").trigger("chosen:updated")},t.init=function(){var i=[],c=n.find(".csf--typography"),o=n.find(".csf--type"),f=n.find(".csf--block-font-style"),l=c.data("unit"),d=c.data("exclude")?c.data("exclude").split(","):[];n.find(".csf--chosen").length&&n.find("select").each(function(){var t=e(this),n=t.parent().find(".chosen-container");n.length&&n.remove(),t.chosen({allow_single_deselect:!0,disable_search_threshold:15,width:"100%"})});var h=n.find(".csf--font-family"),p=h.val();h.find("option").not(":first-child").remove();var u="";e.each(s,function(t,n){d&&-1!==d.indexOf(t)||(u+='<optgroup label="'+n.label+'">',e.each(n.fonts,function(e,n){u+='<option value="'+(n="object"==typeof n?e:n)+'" data-type="'+t+'"'+(n===p?" selected":"")+">"+n+"</option>"}),u+="</optgroup>")}),h.append(u).trigger("chosen:updated");var v=n.find(".csf--block-font-style");if(v.length){var g=n.find(".csf--font-style-select"),_=g.val()?g.val().replace(/normal/g,""):"";g.on("change csf.change",function(e){var t=g.val();!t&&i&&-1===i.indexOf("normal")&&(t=i[0]);var a=t&&"italic"!==t&&"normal"===t?"normal":"",s=t&&"italic"!==t&&"normal"!==t?t.replace("italic",""):a,c=t&&"italic"===t.substr(-6)?"italic":"";n.find(".csf--font-weight").val(s),n.find(".csf--font-style").val(c)});var m=n.find(".csf--block-extra-styles");if(m.length)var b=n.find(".csf--extra-styles"),y=b.val()}var w=n.find(".csf--block-subset");if(w.length)var k=n.find(".csf--subset"),C=k.val(),x=k.data("multiple")||!1;var z=n.find(".csf--block-backup-font-family");h.on("change csf.change",function(e){w.length&&w.addClass("hidden"),m.length&&m.addClass("hidden"),z.length&&z.addClass("hidden");var n=h.find(":selected"),a=n.val(),c=n.data("type");if(c&&a){if("google"!==c&&"custom"!==c||!z.length||z.removeClass("hidden"),v.length){var l=r;"google"===c&&s[c].fonts[a][0]?l=s[c].fonts[a][0]:"custom"===c&&s[c].fonts[a]&&(l=s[c].fonts[a]),i=l;var d=-1!==l.indexOf("normal")?"normal":l[0],p=_&&-1!==l.indexOf(_)?_:d;t.append_select_options(g,l,p,"style"),_=!1,v.removeClass("hidden"),"google"===c&&m.length&&l.length>1&&(t.append_select_options(b,l,y,"style",!0),y=!1,m.removeClass("hidden"))}if("google"===c&&w.length&&s[c].fonts[a][1]){var u=s[c].fonts[a][1],D=u.length<2&&"latin"!==u[0]?u[0]:"",S=C&&-1!==u.indexOf(C)?C:D;S=x&&C?C:S,t.append_select_options(k,u,S,"subset",x),C=!1,w.removeClass("hidden")}}else f.find(":input").val(""),w.length&&(k.find("option").not(":first-child").remove(),k.trigger("chosen:updated")),v.length&&(g.find("option").not(":first-child").remove(),g.trigger("chosen:updated"));o.val(c)}).trigger("csf.change");var D=n.find(".csf--block-preview");if(D.length){var S=n.find(".csf--preview");n.on("change",a.helper.debounce(function(e){D.removeClass("hidden");var i=h.val(),a=n.find(".csf--font-weight").val(),s=n.find(".csf--font-style").val(),c=n.find(".csf--font-size").val(),r=n.find(".csf--font-variant").val(),o=n.find(".csf--line-height").val(),f=n.find(".csf--text-align").val(),d=n.find(".csf--text-transform").val(),p=n.find(".csf--text-decoration").val(),u=n.find(".csf--color").val(),v=n.find(".csf--word-spacing").val(),g=n.find(".csf--letter-spacing").val(),_=n.find(".csf--custom-style").val();"google"===n.find(".csf--type").val()&&t.load_google_font(i,a,s);var m={};i&&(m.fontFamily=i),a&&(m.fontWeight=a),s&&(m.fontStyle=s),r&&(m.fontVariant=r),c&&(m.fontSize=c+l),o&&(m.lineHeight=o+l),g&&(m.letterSpacing=g+l),v&&(m.wordSpacing=v+l),f&&(m.textAlign=f),d&&(m.textTransform=d),p&&(m.textDecoration=p),u&&(m.color=u),S.removeAttr("style"),_&&S.attr("style",_),S.css(m)},100)),D.on("click",function(){S.toggleClass("csf--black-background");var e=D.find(".csf--toggle");e.hasClass("fa-toggle-off")?e.removeClass("fa-toggle-off").addClass("fa-toggle-on"):e.removeClass("fa-toggle-on").addClass("fa-toggle-off")}),D.hasClass("hidden")||n.trigger("change")}},t.init()})},e.fn.csf_field_upload=function(){return this.each(function(){var n,i=e(this),a=i.find("input"),s=i.find(".csf--button"),c=i.find(".csf--remove"),r=s.data("library")&&s.data("library").split(",")||"";a.on("change",function(e){a.val()?c.removeClass("hidden"):c.addClass("hidden")}),s.on("click",function(e){e.preventDefault(),void 0!==t.wp&&t.wp.media&&t.wp.media.gallery&&(n?n.open():((n=t.wp.media({library:{type:r}})).on("select",function(){var e=n.state().get("selection").first().attributes;r.length&&-1===r.indexOf(e.subtype)&&-1===r.indexOf(e.type)||a.val(e.url).trigger("change")}),n.open()))}),c.on("click",function(e){e.preventDefault(),a.val("").trigger("change")})})},e.fn.csf_field_wp_editor=function(){return this.each(function(){if(void 0!==t.wp.editor&&void 0!==t.tinyMCEPreInit&&void 0!==t.tinyMCEPreInit.mceInit.csf_wp_editor){var n=e(this),i=n.find(".csf-wp-editor"),s=n.find("textarea");(n.find(".wp-editor-wrap").length||n.find(".mce-container").length)&&(i.empty(),i.append(s),s.css("display",""));var c=a.helper.uid("csf-editor-");s.attr("id",c);var r={tinymce:t.tinyMCEPreInit.mceInit.csf_wp_editor,quicktags:t.tinyMCEPreInit.qtInit.csf_wp_editor},o=i.data("editor-settings"),f=wp.oldEditor?wp.oldEditor:wp.editor;f&&f.hasOwnProperty("autop")&&(wp.editor.autop=f.autop,wp.editor.removep=f.removep,wp.editor.initialize=f.initialize),r.tinymce=e.extend({},r.tinymce,{selector:"#"+c,setup:function(e){e.on("change",a.helper.debounce(function(){e.save(),s.trigger("change")},250))}}),!1===o.tinymce&&(r.tinymce=!1,i.addClass("csf-no-tinymce")),!1===o.quicktags&&(r.quicktags=!1,i.addClass("csf-no-quicktags"));var l=setInterval(function(){n.is(":visible")&&(t.wp.editor.initialize(c,r),clearInterval(l))});if(o.media_buttons&&t.csf_media_buttons){var d=i.find(".wp-media-buttons");if(d.length)d.find(".csf-shortcode-button").data("editor-id",c);else{var h=e(t.csf_media_buttons);h.find(".csf-shortcode-button").data("editor-id",c),i.prepend(h)}}}})},e.fn.csf_confirm=function(){return this.each(function(){e(this).on("click",function(n){var i=e(this).data("confirm")||t.csf_vars.i18n.confirm,s=confirm(i);if(a.vars.is_confirm=!0,!s)return n.preventDefault(),a.vars.is_confirm=!1,!1})})},e.fn.serializeObject=function(){var t={};return e.each(this.serializeArray(),function(n,i){var a=i.name,s=i.value;t[a]=void 0===t[a]?s:e.isArray(t[a])?t[a].concat(s):[t[a],s]}),t},e.fn.csf_save=function(){return this.each(function(){var n,i=e(this),s=e(".csf-save"),c=e(".csf-options"),r=!1;i.on("click",function(o){if(!r){var f=i.data("save"),l=i.val();s.attr("value",f),i.hasClass("csf-save-ajax")&&(o.preventDefault(),c.addClass("csf-saving"),s.prop("disabled",!0),t.wp.ajax.post("csf_"+c.data("unique")+"_ajax_save",{data:e("#csf-form").serializeJSONCSF()}).done(function(t){if(e(".csf-error").remove(),Object.keys(t.errors).length){var i='<i class="csf-label-error csf-error">!</i>';e.each(t.errors,function(t,n){var a=e('[data-depend-id="'+t+'"]'),s=e("#csf-tab-link-"+(a.closest(".csf-section").index()+1)),c=s.closest(".csf-tab-depth-0");a.closest(".csf-fieldset").append('<p class="csf-text-error csf-error">'+n+"</p>"),s.find(".csf-error").length||s.append(i),c.find(".csf-arrow .csf-error").length||c.find(".csf-arrow").append(i),console.log(n)})}c.removeClass("csf-saving"),s.prop("disabled",!1).attr("value",l),r=!1,a.vars.form_modified=!1,a.vars.$form_warning.hide(),clearTimeout(n);var o=e(".csf-form-success");o.empty().append(t.notice).fadeIn("fast",function(){n=setTimeout(function(){o.fadeOut("fast")},1e3)})}).fail(function(e){alert(e.error)}))}r=!0})})},e.fn.csf_options=function(){return this.each(function(){var i=e(this),s=i.find(".csf-content"),c=i.find(".csf-form-success"),r=i.find(".csf-form-warning"),o=i.find(".csf-header .csf-save");a.vars.$form_warning=r,r.length&&(t.onbeforeunload=function(){return!!a.vars.form_modified||void 0},s.on("change keypress",":input",function(){a.vars.form_modified||(c.hide(),r.fadeIn("fast"),a.vars.form_modified=!0)})),c.hasClass("csf-form-show")&&setTimeout(function(){c.fadeOut("fast")},1e3),e(n).keydown(function(e){if((e.ctrlKey||e.metaKey)&&83===e.which)return o.trigger("click"),e.preventDefault(),!1})})},e.fn.csf_taxonomy=function(){return this.each(function(){var t=e(this),n=t.parents("form");if("addtag"===n.attr("id")){var i=n.find("#submit"),a=t.find(".csf-field").csf_clone();i.on("click",function(){n.find(".form-required").hasClass("form-invalid")||(t.data("inited",!1),t.empty(),t.html(a),a=a.csf_clone(),t.csf_reload_script())})}})},e.fn.csf_shortcode=function(){var i=this;return i.shortcode_parse=function(t,n){var a="";return e.each(t,function(t,s){a+="["+(n=n||t),e.each(s,function(e,t){"content"===e?(a+="]",a+=t,a+="[/"+n):a+=i.shortcode_tags(e,t)}),a+="]"}),a},i.shortcode_tags=function(t,n){var i="";return""!==n&&("object"!=typeof n||e.isArray(n)?i+=" "+t.replace("-","_")+'="'+n.toString()+'"':e.each(n,function(e,t){switch(e){case"background-image":t=t.url?t.url:""}""!==t&&(i+=" "+e.replace("-","_")+'="'+t.toString()+'"')})),i},i.insertAtChars=function(e,t){var n=void 0!==e[0].name?e[0]:e;return n.value.length&&void 0!==n.selectionStart?(n.focus(),n.value.substring(0,n.selectionStart)+t+n.value.substring(n.selectionEnd,n.value.length)):(n.focus(),t)},i.send_to_editor=function(t,n){var a;if("undefined"!=typeof tinymce&&(a=tinymce.get(n)),a&&!a.isHidden())a.execCommand("mceInsertContent",!1,t);else{var s=e("#"+n);s.val(i.insertAtChars(s,t)).trigger("change")}},this.each(function(){var s,c,r,o,f,l,d,h,p,u=e(this),v=u.find(".csf-modal-load"),g=(u.find(".csf-modal-content"),u.find(".csf-modal-insert")),_=u.find(".csf-modal-loading"),m=u.find("select"),b=u.data("modal-id"),y=u.data("nonce");e(n).on("click",'.csf-shortcode-button[data-modal-id="'+b+'"]',function(t){t.preventDefault(),p=e(this),s=p.data("editor-id")||!1,c=p.data("target-id")||!1,r=p.data("gutenberg-id")||!1,u.show(),u.hasClass("csf-shortcode-single")&&void 0===f&&m.trigger("change")}),m.on("change",function(){var n=e(this),i=n.find(":selected");o=n.val(),f=i.data("shortcode"),l=i.data("view")||"normal",d=i.data("group")||f,v.empty(),o?(_.show(),t.wp.ajax.post("csf-get-shortcode-"+b,{shortcode_key:o,nonce:y}).done(function(t){_.hide();var n=e(t.content).appendTo(v);g.parent().removeClass("hidden"),h=n.find(".csf--repeat-shortcode").csf_clone(),n.csf_reload_script(),n.find(".csf-fields").csf_reload_script()})):g.parent().addClass("hidden")}),g.on("click",function(n){if(n.preventDefault(),!g.prop("disabled")&&!g.attr("disabled")){var a="",o=u.find(".csf-field:not(.hidden)").find(":input:not(.ignore)").serializeObjectCSF();switch(l){case"contents":var h=f?o[f]:o;e.each(h,function(e,t){var n=f||e;a+="["+n+"]"+t+"[/"+n+"]"});break;case"group":a+="["+f,e.each(o[f],function(e,t){a+=i.shortcode_tags(e,t)}),a+="]",a+=i.shortcode_parse(o[d],d),a+="[/"+f+"]";break;case"repeater":a+=i.shortcode_parse(o[d],d);break;default:a+=i.shortcode_parse(o)}if(a=""===a?"["+f+"]":a,r){var v=t.csf_gutenberg_props.attributes.hasOwnProperty("shortcode")?t.csf_gutenberg_props.attributes.shortcode:"";t.csf_gutenberg_props.setAttributes({shortcode:v+a})}else if(s)i.send_to_editor(a,s);else{var _=c?e(c):p.parent().find("textarea");_.val(i.insertAtChars(_,a)).trigger("change")}u.hide()}}),u.on("click",".csf--repeat-button",function(e){e.preventDefault();var t=u.find(".csf--repeatable"),n=h.csf_clone(),i=n.find(".csf-repeat-remove");n.appendTo(t);n.find(".csf-fields").csf_reload_script(),a.helper.name_nested_replace(u.find(".csf--repeat-shortcode"),d),i.on("click",function(){n.remove(),a.helper.name_nested_replace(u.find(".csf--repeat-shortcode"),d)})}),u.on("click",".csf-modal-close, .csf-modal-overlay",function(){u.hide()})})},"function"==typeof Color){void 0!==Color.fn.toString?Color.fn.toString:Color.toString;(function(){if(this._alpha<1)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var e=parseInt(this._color,10).toString(16);if(this.error)return"";if(e.length<6)for(var t=6-e.length-1;t>=0;t--)e="0"+e;return"#"+e})}a.funcs.parse_color=function(e){var t=e.replace(/\s+/g,""),n=-1!==t.indexOf("rgba")?parseFloat(100*t.replace(/^.*,(.+)\)/,"$1")):100;return{value:t,transparent:n,rgba:n<100}},e.fn.csf_color=function(){return this.each(function(){var n,i=e(this),s=a.funcs.parse_color(i.val()),c=!t.csf_vars.color_palette.length||t.csf_vars.color_palette;i.hasClass("wp-color-picker")&&i.closest(".wp-picker-container").after(i).remove(),i.wpColorPicker({palettes:c,change:function(e,t){var a=t.color.toString();n.removeClass("csf--transparent-active"),n.find(".csf--transparent-offset").css("background-color",a),i.val(a).trigger("change")},create:function(){n=i.closest(".wp-picker-container");var t=i.data("a8cIris"),c=e('<div class="csf--transparent-wrap"><div class="csf--transparent-slider"></div><div class="csf--transparent-offset"></div><div class="csf--transparent-text"></div><div class="csf--transparent-button">transparent <i class="fa fa-toggle-off"></i></div></div>').appendTo(n.find(".wp-picker-holder")),r=c.find(".csf--transparent-slider"),o=c.find(".csf--transparent-text"),f=c.find(".csf--transparent-offset"),l=c.find(".csf--transparent-button");"transparent"===i.val()&&n.addClass("csf--transparent-active"),l.on("click",function(){"transparent"!==i.val()?(i.val("transparent").trigger("change").removeClass("iris-error"),n.addClass("csf--transparent-active")):(i.val(t._color.toString()).trigger("change"),n.removeClass("csf--transparent-active"))}),r.slider({value:s.transparent,step:1,min:0,max:100,slide:function(e,n){var a=parseFloat(n.value/100);t._color._alpha=a,i.wpColorPicker("color",t._color.toString()),o.text(1===a||0===a?"":a)},create:function(){var e=parseFloat(s.transparent/100),c=e<1?e:"";o.text(c),f.css("background-color",s.value),n.on("click",".wp-picker-clear",function(){t._color._alpha=1,o.text(""),r.slider("option","value",100),n.removeClass("csf--transparent-active"),i.trigger("change")}),n.on("click",".wp-picker-default",function(){var e=a.funcs.parse_color(i.data("default-color")),n=parseFloat(e.transparent/100),s=n<1?n:"";t._color._alpha=n,o.text(s),r.slider("option","value",e.transparent)})}})}})})},e.fn.csf_chosen=function(){return this.each(function(){var n=e(this),i=n.parent().find(".chosen-container"),a=n.hasClass("csf-chosen-sortable")||!1,s=n.hasClass("csf-chosen-ajax")||!1,c=n.attr("multiple")||!1,r=c?"100%":"auto",o=e.extend({allow_single_deselect:!0,disable_search_threshold:10,width:r,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));if(i.length&&i.remove(),s){var f=e.extend({data:{type:"post",nonce:""},allow_single_deselect:!0,disable_search_threshold:-1,width:"100%",min_length:3,type_delay:500,typing_text:t.csf_vars.i18n.typing_text,searching_text:t.csf_vars.i18n.searching_text,no_results_text:t.csf_vars.i18n.no_results_text},n.data("chosen-settings"));n.CSFAjaxChosen(f)}else n.chosen(o);if(c){var l=n.parent().find(".csf-hidden-select"),d=l.val()||[];n.on("change",function(e,n){n&&n.selected?l.append('<option value="'+n.selected+'" selected="selected">'+n.selected+"</option>"):n&&n.deselected&&l.find('option[value="'+n.deselected+'"]').remove(),0===l.children().length&&void 0!==t.wp.customize&&t.wp.customize.control(l.data("customize-setting-link")).setting.set(""),l.trigger("change")}),n.CSFChosenOrder(d,!0)}if(a){var h=n.parent().find(".chosen-container").find(".chosen-choices");h.bind("mousedown",function(t){e(t.target).is("span")&&t.stopPropagation()}),h.sortable({items:"li:not(.search-field)",helper:"orginal",cursor:"move",placeholder:"search-choice-placeholder",start:function(e,t){t.placeholder.width(t.item.innerWidth()),t.placeholder.height(t.item.innerHeight())},update:function(t,i){var a="",s=n.data("chosen"),c=n.parent().find(".csf-hidden-select");h.find(".search-choice-close").each(function(){var t=e(this).data("option-array-index");e.each(s.results_data,function(e,n){n.array_index===t&&(a+='<option value="'+n.value+'" selected>'+n.value+"</option>")})}),c.children().remove(),c.append(a),c.trigger("change")}})}})},e.fn.csf_checkbox=function(){return this.each(function(){var t=e(this),n=t.find(".csf--input"),i=t.find(".csf--checkbox");i.on("click",function(){n.val(Number(i.prop("checked"))).trigger("change")})})},e.fn.csf_siblings=function(){return this.each(function(){var t=e(this),n=t.find(".csf--sibling"),i=t.data("multiple")||!1;n.on("click",function(){var n=e(this);i?n.hasClass("csf--active")?(n.removeClass("csf--active"),n.find("input").prop("checked",!1).trigger("change")):(n.addClass("csf--active"),n.find("input").prop("checked",!0).trigger("change")):(t.find("input").prop("checked",!1),n.find("input").prop("checked",!0).trigger("change"),n.addClass("csf--active").siblings().removeClass("csf--active"))})})},e.fn.csf_help=function(){return this.each(function(){var t,n,i=e(this);i.on({mouseenter:function(){t=e('<div class="csf-tooltip"></div>').html(i.find(".csf-help-text").html()).appendTo("body"),n=a.vars.is_rtl?i.offset().left+24:i.offset().left-t.outerWidth(),t.css({top:i.offset().top-(t.outerHeight()/2-14),left:n})},mouseleave:function(){void 0!==t&&t.remove()}})})},e.fn.csf_customizer_refresh=function(){return this.each(function(){var i=e(this),a=i.closest(".csf-customize-complex");if(a.length){var s=a.find(":input"),c=a.data("unique-id"),r=a.data("option-id"),o=s.serializeObjectCSF(),f=e.isEmptyObject(o)?"":o[c][r],l=t.wp.customize.control(c+"["+r+"]");l.setting._value=null,l.setting.set(f)}else i.find(":input").first().trigger("change");e(n).trigger("csf-customizer-refresh",i)})},e.fn.csf_customizer_listen=function(n){var i=e.extend({closest:!1},n);return this.each(function(){if(void 0!==t.wp.customize){var n=i.closest?e(this).closest(".csf-customize-complex"):e(this),s=n.find(":input"),c=n.data("unique-id"),r=n.data("option-id");void 0!==c&&s.on("change keyup",a.helper.debounce(function(){var i=n.find(":input").serializeObjectCSF(),a=!e.isEmptyObject(i)&&i[c]&&i[c][r]?i[c][r]:"";t.wp.customize.control(c+"["+r+"]").setting.set(a)},250))}})},e(n).on("expanded",".control-section",function(){var t=e(this);if(t.hasClass("open")&&!t.data("inited")){var n=t.find(".csf-customize-field"),i=t.find(".csf-customize-complex");n.length&&(t.csf_dependency(),n.csf_reload_script({dependency:!1}),i.csf_customizer_listen()),t.data("inited",!0)}}),a.vars.$window.on("resize csf.resize",a.helper.debounce(function(n){(navigator.userAgent.indexOf("AppleWebKit/")>-1?a.vars.$window.width():t.innerWidth)<=782&&!a.vars.onloaded&&(e(".csf-section").csf_reload_script(),a.vars.onloaded=!0)},200)).trigger("csf.resize"),e.fn.csf_widgets=function(){this.length&&(e(n).on("widget-added widget-updated",function(e,t){t.find(".csf-fields").csf_reload_script()}),e(".widgets-sortables, .control-section-sidebar").on("sortstop",function(e,t){t.item.find(".csf-fields").csf_reload_script_retry()}),e(n).on("click",".widget-top",function(t){e(this).parent().find(".csf-fields").csf_reload_script()}))},e.fn.csf_reload_script_retry=function(){return this.each(function(){var t=e(this);t.data("inited")&&t.children(".csf-field-wp_editor").csf_field_wp_editor()})},e.fn.csf_reload_script=function(t){var i=e.extend({dependency:!0},t);return this.each(function(){var t=e(this);t.data("inited")||(t.children(".csf-field-accordion").csf_field_accordion(),t.children(".csf-field-backup").csf_field_backup(),t.children(".csf-field-background").csf_field_background(),t.children(".csf-field-code_editor").csf_field_code_editor(),t.children(".csf-field-date").csf_field_date(),t.children(".csf-field-fieldset").csf_field_fieldset(),t.children(".csf-field-gallery").csf_field_gallery(),t.children(".csf-field-group").csf_field_group(),t.children(".csf-field-icon").csf_field_icon(),t.children(".csf-field-media").csf_field_media(),t.children(".csf-field-map").csf_field_map(),t.children(".csf-field-repeater").csf_field_repeater(),t.children(".csf-field-slider").csf_field_slider(),t.children(".csf-field-sortable").csf_field_sortable(),t.children(".csf-field-sorter").csf_field_sorter(),t.children(".csf-field-spinner").csf_field_spinner(),t.children(".csf-field-switcher").csf_field_switcher(),t.children(".csf-field-tabbed").csf_field_tabbed(),t.children(".csf-field-typography").csf_field_typography(),t.children(".csf-field-upload").csf_field_upload(),t.children(".csf-field-wp_editor").csf_field_wp_editor(),t.children(".csf-field-border").find(".csf-color").csf_color(),t.children(".csf-field-background").find(".csf-color").csf_color(),t.children(".csf-field-color").find(".csf-color").csf_color(),t.children(".csf-field-color_group").find(".csf-color").csf_color(),t.children(".csf-field-link_color").find(".csf-color").csf_color(),t.children(".csf-field-typography").find(".csf-color").csf_color(),t.children(".csf-field-select").find(".csf-chosen").csf_chosen(),t.children(".csf-field-checkbox").find(".csf-checkbox").csf_checkbox(),t.children(".csf-field-button_set").find(".csf-siblings").csf_siblings(),t.children(".csf-field-image_select").find(".csf-siblings").csf_siblings(),t.children(".csf-field-palette").find(".csf-siblings").csf_siblings(),t.children(".csf-field").find(".csf-help").csf_help(),i.dependency&&t.csf_dependency(),t.data("inited",!0),e(n).trigger("csf-reload-script",t))})},e(n).ready(function(){e(".csf-save").csf_save(),e(".csf-options").csf_options(),e(".csf-sticky-header").csf_sticky(),e(".csf-nav-options").csf_nav_options(),e(".csf-nav-metabox").csf_nav_metabox(),e(".csf-taxonomy").csf_taxonomy(),e(".csf-page-templates").csf_page_templates(),e(".csf-post-formats").csf_post_formats(),e(".csf-shortcode").csf_shortcode(),e(".csf-search").csf_search(),e(".csf-confirm").csf_confirm(),e(".csf-expand-all").csf_expand_all(),e(".csf-onload").csf_reload_script(),e(".widget").csf_widgets()})}(jQuery,window,document);
 
 
admin/settings/classes/setup.class.php CHANGED
@@ -411,16 +411,16 @@ if( ! class_exists( 'CSF' ) ) {
411
  wp_enqueue_style( 'csf-fa', 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css', array(), '4.7.1', 'all' );
412
 
413
  // framework core styles
414
- wp_enqueue_style( 'csf', CSF::include_plugin_url( 'assets/css/csf'. $min .'.css' ), array(), '1.0.0', 'all' );
415
 
416
  // rtl styles
417
  if( is_rtl() ) {
418
- wp_enqueue_style( 'csf-rtl', CSF::include_plugin_url( 'assets/css/csf-rtl'. $min .'.css' ), array(), '1.0.0', 'all' );
419
  }
420
 
421
  // framework core scripts
422
- wp_enqueue_script( 'csf-plugins', CSF::include_plugin_url( 'assets/js/csf-plugins'. $min .'.js' ), array(), '1.0.0', true );
423
- wp_enqueue_script( 'csf', CSF::include_plugin_url( 'assets/js/csf'. $min .'.js' ), array( 'csf-plugins' ), '1.0.0', true );
424
 
425
  wp_localize_script( 'csf', 'csf_vars', array(
426
  'color_palette' => apply_filters( 'csf_color_palette', array() ),
411
  wp_enqueue_style( 'csf-fa', 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css', array(), '4.7.1', 'all' );
412
 
413
  // framework core styles
414
+ wp_enqueue_style( 'csf', CSF::include_plugin_url( 'assets/css/csf'. $min .'.css' ), array(), '1.1.0', 'all' );
415
 
416
  // rtl styles
417
  if( is_rtl() ) {
418
+ wp_enqueue_style( 'csf-rtl', CSF::include_plugin_url( 'assets/css/csf-rtl'. $min .'.css' ), array(), '1.1.0', 'all' );
419
  }
420
 
421
  // framework core scripts
422
+ wp_enqueue_script( 'csf-plugins', CSF::include_plugin_url( 'assets/js/csf-plugins'. $min .'.js' ), array(), '1.1.0', true );
423
+ wp_enqueue_script( 'csf', CSF::include_plugin_url( 'assets/js/csf'. $min .'.js' ), array( 'csf-plugins' ), '1.1.0', true );
424
 
425
  wp_localize_script( 'csf', 'csf_vars', array(
426
  'color_palette' => apply_filters( 'csf_color_palette', array() ),
assets/js/wp-ulike.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! WP ULike - v4.1.0
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
1
+ /*! WP ULike - v4.1.1
2
  * https://wpulike.com
3
  * TechnoWich 2020;
4
  */
readme.txt CHANGED
@@ -6,7 +6,7 @@ Tags: wp ulike, like button, elementor, like, dislike, wordpress youlike plugin,
6
  Requires PHP: 5.4
7
  Requires at least: 3.5.0
8
  Tested up to: 5.3.2
9
- Stable tag: 4.1.0
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -186,6 +186,10 @@ define( 'WP_MEMORY_LIMIT', '256M' );
186
 
187
  == Changelog ==
188
 
 
 
 
 
189
  = 4.1.0 =
190
  * Added: New professional configuration panel.
191
  * Added: New controller to filter post types.
6
  Requires PHP: 5.4
7
  Requires at least: 3.5.0
8
  Tested up to: 5.3.2
9
+ Stable tag: 4.1.1
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
186
 
187
  == Changelog ==
188
 
189
+ = 4.1.1 =
190
+ * Fixed: A JavaScript issue in setting panel.
191
+ * Fixed: Some small issues.
192
+
193
  = 4.1.0 =
194
  * Added: New professional configuration panel.
195
  * Added: New controller to filter post types.
wp-ulike.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: WP ULike
11
  * Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
12
  * Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
13
- * Version: 4.1.0
14
  * Author: Ali Mirzaei
15
  * Author URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
16
  * Text Domain: wp-ulike
@@ -46,7 +46,7 @@ if ( defined( 'WP_INSTALLING' ) && WP_INSTALLING ) {
46
 
47
  // Do not change these values
48
  define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
49
- define( 'WP_ULIKE_VERSION' , '4.1.0' );
50
  define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
51
  define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));
52
 
10
  * Plugin Name: WP ULike
11
  * Plugin URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=plugin-uri&utm_medium=wp-dash
12
  * Description: WP ULike plugin allows to integrate a beautiful Ajax Like Button into your wordPress website to allow your visitors to like and unlike pages, posts, comments AND buddypress activities. Its very simple to use and supports many options.
13
+ * Version: 4.1.1
14
  * Author: Ali Mirzaei
15
  * Author URI: https://wpulike.com/?utm_source=wp-plugins&utm_campaign=author-uri&utm_medium=wp-dash
16
  * Text Domain: wp-ulike
46
 
47
  // Do not change these values
48
  define( 'WP_ULIKE_PLUGIN_URI' , 'https://wpulike.com/' );
49
+ define( 'WP_ULIKE_VERSION' , '4.1.1' );
50
  define( 'WP_ULIKE_SLUG' , 'wp-ulike' );
51
  define( 'WP_ULIKE_NAME' , __( 'WP ULike', WP_ULIKE_SLUG ));
52