diff --git a/acf.php b/acf.php
index 0236fdd..7eedbea 100644
--- a/acf.php
+++ b/acf.php
@@ -3,7 +3,7 @@
Plugin Name: Advanced Custom Fields PRO
Plugin URI: https://www.advancedcustomfields.com/
Description: Customize WordPress with powerful, professional and intuitive fields.
-Version: 5.7.8
+Version: 5.7.9
Author: Elliot Condon
Author URI: http://www.elliotcondon.com/
Copyright: Elliot Condon
@@ -18,7 +18,7 @@ if( ! class_exists('ACF') ) :
class ACF {
/** @var string The plugin version number */
- var $version = '5.7.8';
+ var $version = '5.7.9';
/** @var array The plugin settings array */
var $settings = array();
@@ -170,6 +170,7 @@ class ACF {
acf_include('includes/forms/form-front.php');
acf_include('includes/forms/form-nav-menu.php');
acf_include('includes/forms/form-post.php');
+ acf_include('includes/forms/form-gutenberg.php');
acf_include('includes/forms/form-taxonomy.php');
acf_include('includes/forms/form-user.php');
acf_include('includes/forms/form-widget.php');
diff --git a/assets/css/acf-global.css b/assets/css/acf-global.css
index 1f6c5a2..9cce786 100644
--- a/assets/css/acf-global.css
+++ b/assets/css/acf-global.css
@@ -190,7 +190,7 @@
border-bottom-width: 0;
}
.acf-tooltip.right {
- margin-right: -8px;
+ margin-left: 8px;
}
.acf-tooltip.right:before {
top: 50%;
@@ -200,7 +200,7 @@
border-left-width: 0;
}
.acf-tooltip.bottom {
- margin-bottom: -8px;
+ margin-top: 8px;
}
.acf-tooltip.bottom:before {
bottom: 100%;
diff --git a/assets/css/acf-input.css b/assets/css/acf-input.css
index b05a073..55d9588 100644
--- a/assets/css/acf-input.css
+++ b/assets/css/acf-input.css
@@ -279,9 +279,6 @@ html[dir="rtl"] .acf-fields.-left > .acf-field > .acf-input {
.acf-postbox {
position: relative;
}
-#acf_after_title-sortables .acf-postbox {
- margin: 20px 0 0;
-}
.acf-postbox > .inside {
margin: 0 !important;
/* override WP style - do not delete - you have tried this before */
@@ -310,6 +307,9 @@ html[dir="rtl"] .acf-fields.-left > .acf-field > .acf-input {
padding: 15px;
text-align: center;
}
+#post-body-content #acf_after_title-sortables {
+ margin: 20px 0 -20px;
+}
/* seamless */
.acf-postbox.seamless {
border: 0 none;
diff --git a/assets/js/acf-input.js b/assets/js/acf-input.js
index 21bebf1..9fbf156 100644
--- a/assets/js/acf-input.js
+++ b/assets/js/acf-input.js
@@ -777,69 +777,42 @@
return $el.find('select, textarea, input').serializeArray();
}
-
/**
- * acf.serializeAjax
+ * acf.serializeForAjax
*
* Returns an object containing name => value data ready to be encoded for Ajax.
*
- * @date 15/8/18
- * @since 5.7.3
+ * @date 17/12/18
+ * @since 5.8.0
*
* @param jQUery $el The element or form to serialize.
- * @param string prefix The input prefix to scope to.
* @return object
*/
-
-/*
- acf.serializeAjax = function( $el, prefix ){
+ acf.serializeForAjax = function( $el ){
// vars
var data = {};
var index = {};
- var inputs = $el.find('select, textarea, input').serializeArray();
- // remove prefix
- if( prefix !== undefined ) {
-
- // filter and modify
- inputs = inputs.filter(function( item ){
- return item.name.indexOf(prefix) === 0;
- }).map(function( item ){
-
- // remove prefix from name
- item.name = item.name.slice(prefix.length);
-
- // fix [foo][bar] to foo[bar]
- if( item.name.slice(0, 1) == '[' ) {
- item.name = item.name.slice(1).replace(']', '');
- }
- return item;
- });
- }
+ // Serialize inputs.
+ var inputs = acf.serializeArray( $el );
- // build object
+ // Loop over inputs and build data.
inputs.map(function( item ){
- // fix foo[] to foo[0], foo[1], etc
+ // Append to array.
if( item.name.slice(-2) === '[]' ) {
-
- // ensure index exists
- index[ item.name ] = index[ item.name ] || 0;
- index[ item.name ]++;
-
- // replace [] with [0]
- item.name = item.name.replace('[]', '[' + (index[ item.name ]-1) + ']');
+ data[ item.name ] = data[ item.name ] || [];
+ data[ item.name ].push( item.value );
+ // Append
+ } else {
+ data[ item.name ] = item.value;
}
-
- // append to data
- data[ item.name ] = item.value;
});
// return
return data;
};
-*/
/**
* addAction
@@ -2112,6 +2085,21 @@
return ( getLocks( $el, type ).length > 0 );
};
+ /**
+ * acf.isGutenberg
+ *
+ * Returns true if the Gutenberg editor is being used.
+ *
+ * @date 14/11/18
+ * @since 5.8.0
+ *
+ * @param vois
+ * @return bool
+ */
+ acf.isGutenberg = function(){
+ return ( window.wp && wp.blocks );
+ };
+
/*
* exists
*
@@ -3489,12 +3477,13 @@
changed: false,
actions: {
- 'validation_failure': 'startListening'
+ 'validation_failure': 'startListening',
+ 'validation_success': 'stopListening'
},
events: {
- 'change .acf-field': 'startListening',
- 'submit form': 'stopListening'
+ 'change form .acf-field': 'startListening',
+ 'submit form': 'stopListening'
},
reset: function(){
@@ -4036,46 +4025,47 @@
var $target = this.get('target');
if( !$target ) return;
- // reset class
- $tooltip.removeClass('right left bottom top');
+ // Reset position.
+ $tooltip.removeClass('right left bottom top').css({ top: 0, left: 0 });
- // position
+ // Declare tollerance to edge of screen.
var tolerance = 10;
- var target_w = $target.outerWidth();
- var target_h = $target.outerHeight();
- var target_t = $target.offset().top;
- var target_l = $target.offset().left;
- var tooltip_w = $tooltip.outerWidth();
- var tooltip_h = $tooltip.outerHeight();
- // calculate top
- var top = target_t - tooltip_h;
- var left = target_l + (target_w / 2) - (tooltip_w / 2);
+ // Find target position.
+ var targetWidth = $target.outerWidth();
+ var targetHeight = $target.outerHeight();
+ var targetTop = $target.offset().top;
+ var targetLeft = $target.offset().left;
- // too far left
+ // Find tooltip position.
+ var tooltipWidth = $tooltip.outerWidth();
+ var tooltipHeight = $tooltip.outerHeight();
+ var tooltipTop = $tooltip.offset().top; // Should be 0, but WP media grid causes this to be 32 (toolbar padding).
+
+ // Assume default top alignment.
+ var top = targetTop - tooltipHeight - tooltipTop;
+ var left = targetLeft + (targetWidth / 2) - (tooltipWidth / 2);
+
+ // Check if too far left.
if( left < tolerance ) {
-
$tooltip.addClass('right');
- left = target_l + target_w;
- top = target_t + (target_h / 2) - (tooltip_h / 2);
+ left = targetLeft + targetWidth;
+ top = targetTop + (targetHeight / 2) - (tooltipHeight / 2) - tooltipTop;
- // too far right
- } else if( (left + tooltip_w + tolerance) > $(window).width() ) {
-
+ // Check if too far right.
+ } else if( (left + tooltipWidth + tolerance) > $(window).width() ) {
$tooltip.addClass('left');
- left = target_l - tooltip_w;
- top = target_t + (target_h / 2) - (tooltip_h / 2);
+ left = targetLeft - tooltipWidth;
+ top = targetTop + (targetHeight / 2) - (tooltipHeight / 2) - tooltipTop;
- // too far top
+ // Check if too far up.
} else if( top - $(window).scrollTop() < tolerance ) {
-
$tooltip.addClass('bottom');
- top = target_t + target_h;
-
+ top = targetTop + targetHeight - tooltipTop;
+
+ // No colision with edges.
} else {
-
$tooltip.addClass('top');
-
}
// update css
@@ -5540,6 +5530,15 @@
return this.$('input[type="text"]');
},
+ setValue: function( val ){
+
+ // update input (with change)
+ acf.val( this.$input(), val );
+
+ // update iris
+ this.$inputText().iris('color', val);
+ },
+
initialize: function(){
// vars
@@ -6011,8 +6010,7 @@
var lat = this.get('lat');
var lng = this.get('lng');
-
- // map
+ // Create Map.
var mapArgs = {
scrollwheel: false,
zoom: parseInt( zoom ),
@@ -6026,10 +6024,8 @@
};
mapArgs = acf.applyFilters('google_map_args', mapArgs, this);
var map = new google.maps.Map( this.$canvas()[0], mapArgs );
- this.addMapEvents( map, this );
-
- // marker
+ // Create Marker.
var markerArgs = acf.parseArgs(mapArgs.marker, {
draggable: true,
raiseOnDrag: true,
@@ -6037,12 +6033,23 @@
});
markerArgs = acf.applyFilters('google_map_marker_args', markerArgs, this);
var marker = new google.maps.Marker( markerArgs );
- this.addMarkerEvents( marker, this );
+ // Maybe Create Autocomplete.
+ var autocomplete = false;
+ if( acf.isset(google, 'maps', 'places', 'Autocomplete') ) {
+ var autocompleteArgs = mapArgs.autocomplete || {};
+ autocompleteArgs = acf.applyFilters('google_map_autocomplete_args', autocompleteArgs, this);
+ autocomplete = new google.maps.places.Autocomplete( this.$search()[0], autocompleteArgs );
+ autocomplete.bindTo('bounds', map);
+ }
+
+ // Add map events.
+ this.addMapEvents( this, map, marker, autocomplete );
- // reference
+ // Append references.
map.acf = this;
map.marker = marker;
+ map.autocomplete = autocomplete;
this.map = map;
// action for 3rd party customization
@@ -6053,29 +6060,11 @@
this.renderVal( val );
},
- addMapEvents: function( map, field ){
+ addMapEvents: function( field, map, marker, autocomplete ){
- // autocomplete
- if( acf.isset(window, 'google', 'maps', 'places', 'Autocomplete') ) {
-
- // vars
- var autocompleteArgs = map.autocomplete || {};
- var autocomplete = new google.maps.places.Autocomplete( this.$search()[0], autocompleteArgs );
-
- // bind
- autocomplete.bindTo('bounds', map);
-
- // autocomplete event place_changed is triggered each time the input changes
- // customize the place object with the current "search value" to allow users controll over the address text
- google.maps.event.addListener(autocomplete, 'place_changed', function() {
- var place = this.getPlace();
- place.address = field.getSearchVal();
- field.setPlace( place );
- });
- }
-
- // click
+ // Click map.
google.maps.event.addListener( map, 'click', function( e ) {
+
// vars
var lat = e.latLng.lat();
var lng = e.latLng.lng();
@@ -6083,12 +6072,10 @@
// search
field.searchPosition( lat, lng );
});
- },
-
- addMarkerEvents: function( marker, field ){
- // dragend
+ // Drag marker.
google.maps.event.addListener( marker, 'dragend', function(){
+
// vars
var position = this.getPosition();
var lat = position.lat();
@@ -6097,6 +6084,18 @@
// search
field.searchPosition( lat, lng );
});
+
+ // Autocomplete search.
+ if( autocomplete ) {
+
+ // autocomplete event place_changed is triggered each time the input changes
+ // customize the place object with the current "search value" to allow users controll over the address text
+ google.maps.event.addListener(autocomplete, 'place_changed', function() {
+ var place = this.getPlace();
+ place.address = field.getSearchVal();
+ field.setPlace( place );
+ });
+ }
},
searchPosition: function( lat, lng ){
@@ -10508,6 +10507,24 @@
// return
return this;
+ },
+
+ save: function( event ) {
+ var data = {};
+
+ if ( event ) {
+ event.preventDefault();
+ }
+
+ //_.each( this.$el.serializeArray(), function( pair ) {
+ // data[ pair.name ] = pair.value;
+ //});
+
+ // Serialize data more thoroughly to allow chckbox inputs to save.
+ data = acf.serializeForAjax(this.$el);
+
+ this.controller.trigger( 'attachment:compat:waiting', ['waiting'] );
+ this.model.saveCompat( data ).always( _.bind( this.postSave, this ) );
}
});
@@ -10649,30 +10666,6 @@
'change #product-type': 'onChange'
},
- initialize: function(){
-
- },
-/*
-
- checkScreenEvents: function(){
-
- // vars
- var events = [
- 'change #page_template',
- 'change #parent_id',
- 'change #post-formats-select input',
- 'change .categorychecklist input',
- 'change .categorychecklist select',
- 'change .acf-taxonomy-field[data-save="1"] input',
- 'change .acf-taxonomy-field[data-save="1"] select',
- 'change #product-type'
- ];
-
- acf.screen.on('change', '#product-type', 'fetch');
- },
-*/
-
-
isPost: function(){
return acf.get('screen') === 'post';
},
@@ -10715,6 +10708,10 @@
return this.getPageParent() ? 'child' : 'parent';
},
+ getPostType: function(){
+ return $('#post_type').val();
+ },
+
getPostFormat: function( e, $el ){
var $el = $('#post-formats-select input:checked');
if( $el.length ) {
@@ -10724,7 +10721,7 @@
return null;
},
- getPostTerms: function(){
+ getPostCoreTerms: function(){
// vars
var terms = {};
@@ -10750,6 +10747,15 @@
}
}
+ // return
+ return terms;
+ },
+
+ getPostTerms: function(){
+
+ // Get core terms.
+ var terms = this.getPostCoreTerms();
+
// loop over taxonomy fields and add their values
acf.getFields({type: 'taxonomy'}).map(function( field ){
@@ -10819,6 +10825,11 @@
ajaxData.post_id = acf.get('post_id');
}
+ // post type
+ if( (postType = this.getPostType()) !== null ) {
+ ajaxData.post_type = postType;
+ }
+
// page template
if( (pageTemplate = this.getPageTemplate()) !== null ) {
ajaxData.page_template = pageTemplate;
@@ -10914,47 +10925,113 @@
}
});
-/*
- // tests
- acf.registerScreenChange('#page_template', function( e, $el ){
- return $('#page_template').val();
- });
-
- acf.registerScreenData({
- name: 'page_template',
- change: '#page_template',
- val: function(){
- var $input = $(this.el);
- return $input.length ? $input.val() : null;
- }
- });
-
- acf.registerScreenData({
- name: 'post_terms',
- change: '.acf-taxonomy-field[data-save="1"]',
- val: function(){
- var $input = $(this.el);
- return $input.length ? $input.val() : null;
- }
- });
-
- acf.registerScreenData({
- name: 'post_terms',
- change: '#product-type',
- val: function( terms ){
- var $select = $('#product-type');
- if( $select.length ) {
- terms.push('product_cat:'+$select.val());
+ /**
+ * gutenScreen
+ *
+ * Adds compatibility with the Gutenberg edit screen.
+ *
+ * @date 11/12/18
+ * @since 5.8.0
+ *
+ * @param void
+ * @return void
+ */
+ var gutenScreen = new acf.Model({
+
+ // Wait until load to avoid 'core' issues when loading taxonomies.
+ wait: 'load',
+
+ initialize: function(){
+
+ // Bail early if not Gutenberg.
+ if( !acf.isGutenberg() ) {
+ return;
}
+
+ // Listen for changes.
+ wp.data.subscribe(this.proxy(this.onChange));
+
+ // Customize "acf.screen.get" functions.
+ acf.screen.getPageTemplate = this.getPageTemplate;
+ acf.screen.getPageParent = this.getPageParent;
+ acf.screen.getPostType = this.getPostType;
+ acf.screen.getPostFormat = this.getPostFormat;
+ acf.screen.getPostCoreTerms = this.getPostCoreTerms;
+ },
+
+ onChange: function(){
+
+ // Get edits.
+ var edits = wp.data.select( 'core/editor' ).getPostEdits();
+
+ // Check specific attributes.
+ var attributes = [
+ 'template',
+ 'parent',
+ 'format'
+ ];
+
+ // Append taxonomy attributes.
+ var taxonomies = wp.data.select( 'core' ).getTaxonomies() || [];
+ taxonomies.map(function( taxonomy ){
+ attributes.push( taxonomy.rest_base );
+ });
+
+ // Filter out attributes that have not changed.
+ attributes = attributes.filter(this.proxy(function( attr ){
+ return ( edits[attr] && edits[attr] !== this.get(attr) );
+ }));
+
+ // Trigger change if has attributes.
+ if( attributes.length ) {
+ this.triggerChange( edits )
+ }
+ },
+
+ triggerChange: function( edits ){
+
+ // Update this.data if edits are provided.
+ if( edits !== undefined ) {
+ this.data = edits;
+ }
+
+ // Check screen.
+ acf.screen.check();
+ },
+
+ getPageTemplate: function(){
+ return wp.data.select( 'core/editor' ).getEditedPostAttribute( 'template' );
+ },
+
+ getPageParent: function( e, $el ){
+ return wp.data.select( 'core/editor' ).getEditedPostAttribute( 'parent' );
+ },
+
+ getPostType: function(){
+ return wp.data.select( 'core/editor' ).getEditedPostAttribute( 'type' );
+ },
+
+ getPostFormat: function( e, $el ){
+ return wp.data.select( 'core/editor' ).getEditedPostAttribute( 'format' );
+ },
+
+ getPostCoreTerms: function(){
+
+ // vars
+ var terms = {};
+
+ // Loop over taxonomies.
+ var taxonomies = wp.data.select( 'core' ).getTaxonomies() || [];
+ taxonomies.map(function( taxonomy ){
+
+ // Append selected taxonomies to terms object.
+ terms[ taxonomy.slug ] = wp.data.select( 'core/editor' ).getEditedPostAttribute( taxonomy.rest_base );
+ });
+
+ // return
return terms;
- }
+ },
});
-
-
- acf.screen.get('post_terms');
- acf.screen.getPostTerms();
-
-*/
})(jQuery);
diff --git a/assets/js/acf-input.min.js b/assets/js/acf-input.min.js
index deaff62..22f29da 100644
--- a/assets/js/acf-input.min.js
+++ b/assets/js/acf-input.min.js
@@ -1,4 +1,4 @@
-!function(r,s){var c={};(window.acf=c).data={},c.get=function(t){return this.data[t]||null},c.has=function(t){return null!==this.get(t)},c.set=function(t,e){return this.data[t]=e,this};var i=0;c.uniqueId=function(t){var e=++i+"";return t?t+e:e},c.uniqueArray=function(t){function e(t,e,i){return i.indexOf(t)===e}return t.filter(e)};var a="";c.uniqid=function(t,e){var i;void 0===t&&(t="");var n=function(t,e){return e<(t=parseInt(t,10).toString(16)).length?t.slice(t.length-e):e>t.length?Array(e-t.length+1).join("0")+t:t};return a||(a=Math.floor(123456789*Math.random())),a++,i=t,i+=n(parseInt((new Date).getTime()/1e3,10),8),i+=n(a,5),e&&(i+=(10*Math.random()).toFixed(8).toString()),i},c.strReplace=function(t,e,i){return i.split(t).join(e)},c.strCamelCase=function(t){return t=(t=t.replace(/[_-]/g," ")).replace(/(?:^\w|\b\w|\s+)/g,function(t,e){return 0==+t?"":0==e?t.toLowerCase():t.toUpperCase()})},c.strPascalCase=function(t){var e=c.strCamelCase(t);return e.charAt(0).toUpperCase()+e.slice(1)},c.strSlugify=function(t){return c.strReplace("_","-",t.toLowerCase())},c.strSanitize=function(t){var e={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","ß":"s","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","ĝ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o"," ":"_","'":"","?":"","/":"","\\":"",".":"",",":"","`":"",">":"","<":"",'"':"","[":"","]":"","|":"","{":"","}":"","(":"",")":""},i=/\W/g,n=function(t){return e[t]!==s?e[t]:t};return t=(t=t.replace(i,n)).toLowerCase()},c.strMatch=function(t,e){for(var i=0,n=Math.min(t.length,e.length),a=0;a
"+this.get("text")+"
"),this.get("dismiss")&&(this.$el.append(''),this.$el.addClass("-dismiss"));var t=this.get("timeout");t&&this.away(t)},update:function(t){e.extend(this.data,t),this.initialize(),this.removeEvents(),this.addEvents()},show:function(){var t=this.get("target");t&&t.prepend(this.$el)},hide:function(){this.$el.remove()},away:function(t){this.setTimeout(function(){acf.remove(this.$el)},t)},type:function(t){var e=this.get("type");e&&this.$el.removeClass("-"+e),this.$el.addClass("-"+t),"error"==t&&this.$el.addClass("acf-error-message")},html:function(t){this.$el.html(t)},text:function(t){this.$("p").html(t)},onClickClose:function(t,e){t.preventDefault(),this.get("close").apply(this,arguments),this.remove()}});acf.newNotice=function(t){return"object"!=typeof t&&(t={text:t}),new i(t)};var n=new acf.Model({wait:"prepare",priority:1,initialize:function(){var t=e(".acf-admin-notice");t.length&&e("h1:first").after(t)}})}(jQuery),function(e,t){acf.getPostbox=function(t){return"string"==typeof t&&(t=e("#"+t)),acf.getInstance(t)},acf.getPostboxes=function(){var t=e(".acf-postbox");return acf.getInstances(t)},acf.newPostbox=function(t){return new acf.models.Postbox(t)},acf.models.Postbox=acf.Model.extend({data:{id:"",key:"",style:"default",label:"top",visible:!0,edit:"",html:!0},setup:function(t){t.editLink&&(t.edit=t.editLink),e.extend(this.data,t),this.$el=this.$postbox()},$postbox:function(){return e("#"+this.get("id"))},$placeholder:function(){return e("#"+this.get("id")+"-placeholder")},$hide:function(){return e("#"+this.get("id")+"-hide")},$hideLabel:function(){return this.$hide().parent()},$hndle:function(){return this.$("> .hndle")},$inside:function(){return this.$("> .inside")},isVisible:function(){return this.get("visible")},hasHTML:function(){return this.get("html")},initialize:function(){this.$el.addClass("acf-postbox"),this.$el.removeClass("hide-if-js");var t=this.get("style");"default"!==t&&this.$el.addClass(t),this.$inside().addClass("acf-fields").addClass("-"+this.get("label"));var e=this.get("edit");e&&this.$hndle().append(''),this.isVisible()?this.show():(this.set("html",!1),this.hide())},show:function(){this.$hideLabel().show(),this.$hide().prop("checked",!0),this.$el.show().removeClass("acf-hidden")},enable:function(){acf.enable(this.$el,"postbox")},showEnable:function(){this.show(),this.enable()},hide:function(){this.$hideLabel().hide(),this.$el.hide().addClass("acf-hidden")},disable:function(){acf.disable(this.$el,"postbox")},hideDisable:function(){this.hide(),this.disable()},html:function(t){this.$inside().html(t),this.set("html",!0),acf.doAction("append",this.$el)}})}(jQuery),function(d,e){acf.newTooltip=function(t){return"object"!=typeof t&&(t={text:t}),t.confirmRemove!==e?(t.textConfirm=acf.__("Remove"),t.textCancel=acf.__("Cancel"),new n(t)):t.confirm!==e?new n(t):new i(t)};var i=acf.Model.extend({data:{text:"",timeout:0,target:null},tmpl:function(){return''},setup:function(t){d.extend(this.data,t),this.$el=d(this.tmpl())},initialize:function(){this.render(),this.show(),this.position();var t=this.get("timeout");t&&setTimeout(d.proxy(this.fade,this),t)},update:function(t){d.extend(this.data,t),this.initialize()},render:function(){this.html(this.get("text"))},show:function(){d("body").append(this.$el)},hide:function(){this.$el.remove()},fade:function(){this.$el.addClass("acf-fade-up"),this.setTimeout(function(){this.remove()},250)},html:function(t){this.$el.html(t)},position:function(){var t=this.$el,e=this.get("target");if(e){t.removeClass("right left bottom top");var i=10,n=e.outerWidth(),a=e.outerHeight(),r=e.offset().top,s=e.offset().left,o=t.outerWidth(),c=t.outerHeight(),l=r-c,u=s+n/2-o/2;u<10?(t.addClass("right"),u=s+n,l=r+a/2-c/2):u+o+10>d(window).width()?(t.addClass("left"),u=s-o,l=r+a/2-c/2):l-d(window).scrollTop()<10?(t.addClass("bottom"),l=r+a):t.addClass("top"),t.css({top:l,left:u})}}}),n=i.extend({data:{text:"",textConfirm:"",textCancel:"",target:null,targetConfirm:!0,confirm:function(){},cancel:function(){},context:!1},events:{'click [data-event="cancel"]':"onCancel",'click [data-event="confirm"]':"onConfirm"},addEvents:function(){acf.Model.prototype.addEvents.apply(this);var t=d(document),e=this.get("target");this.setTimeout(function(){this.on(t,"click","onCancel")}),this.get("targetConfirm")&&this.on(e,"click","onConfirm")},removeEvents:function(){acf.Model.prototype.removeEvents.apply(this);var t=d(document),e=this.get("target");this.off(t,"click"),this.off(e,"click")},render:function(){var t,e,i,n=[this.get("text")||acf.__("Are you sure?"),''+(this.get("textConfirm")||acf.__("Yes"))+"",''+(this.get("textCancel")||acf.__("No"))+""].join(" ");this.html(n),this.$el.addClass("-confirm")},onCancel:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("cancel"),n=this.get("context")||this;i.apply(n,arguments),this.remove()},onConfirm:function(t,e){t.preventDefault(),t.stopImmediatePropagation();var i=this.get("confirm"),n=this.get("context")||this;i.apply(n,arguments),this.remove()}});acf.models.Tooltip=i,acf.models.TooltipConfirm=n;var t=new acf.Model({tooltip:!1,events:{"mouseenter .acf-js-tooltip":"showTitle","mouseup .acf-js-tooltip":"hideTitle","mouseleave .acf-js-tooltip":"hideTitle"},showTitle:function(t,e){var i=e.attr("title");i&&(e.attr("title",""),this.tooltip?this.tooltip.update({text:i,target:e}):this.tooltip=acf.newTooltip({text:i,target:e}))},hideTitle:function(t,e){this.tooltip.hide(),e.attr("title",this.tooltip.get("text"))}})}(jQuery),function(e,i){var r=[];acf.Field=acf.Model.extend({type:"",eventScope:".acf-field",wait:"ready",setup:function(t){this.$el=t,this.inherit(t),this.inherit(this.$control())},val:function(t){return t!==i?this.setValue(t):this.prop("disabled")?null:this.getValue()},getValue:function(){return this.$input().val()},setValue:function(t){return acf.val(this.$input(),t)},__:function(t){return acf._e(this.type,t)},$control:function(){return!1},$input:function(){return this.$("[name]:first")},$inputWrap:function(){return this.$(".acf-input:first")},$labelWrap:function(){return this.$(".acf-label:first")},getInputName:function(){return this.$input().attr("name")||""},parent:function(){var t=this.parents();return!!t.length&&t[0]},parents:function(){var t=this.$el.parents(".acf-field"),e;return acf.getFields(t)},show:function(t,e){var i=acf.show(this.$el,t);return i&&(this.prop("hidden",!1),acf.doAction("show_field",this,e)),i},hide:function(t,e){var i=acf.hide(this.$el,t);return i&&(this.prop("hidden",!0),acf.doAction("hide_field",this,e)),i},enable:function(t,e){var i=acf.enable(this.$el,t);return i&&(this.prop("disabled",!1),acf.doAction("enable_field",this,e)),i},disable:function(t,e){var i=acf.disable(this.$el,t);return i&&(this.prop("disabled",!0),acf.doAction("disable_field",this,e)),i},showEnable:function(t,e){return this.enable.apply(this,arguments),this.show.apply(this,arguments)},hideDisable:function(t,e){return this.disable.apply(this,arguments),this.hide.apply(this,arguments)},showNotice:function(t){"object"!=typeof t&&(t={text:t}),this.notice&&this.notice.remove(),t.target=this.$inputWrap(),this.notice=acf.newNotice(t)},removeNotice:function(t){this.notice&&(this.notice.away(t||0),this.notice=!1)},showError:function(t){this.$el.addClass("acf-error"),t!==i&&this.showNotice({text:t,type:"error",dismiss:!1}),acf.doAction("invalid_field",this),this.$el.one("focus change","input, select, textarea",e.proxy(this.removeError,this))},removeError:function(){this.$el.removeClass("acf-error"),this.removeNotice(250),acf.doAction("valid_field",this)},trigger:function(t,e,i){return"invalidField"==t&&(i=!0),acf.Model.prototype.trigger.apply(this,[t,e,i])}}),acf.newField=function(t){var e=t.data("type"),i=s(e),n,a=new(acf.models[i]||acf.Field)(t);return acf.doAction("new_field",a),a};var s=function(t){return acf.strPascalCase(t||"")+"Field"};acf.registerFieldType=function(t){var e,i=t.prototype.type,n=s(i);acf.models[n]=t,r.push(i)},acf.getFieldType=function(t){var e=s(t);return acf.models[e]||!1},acf.getFieldTypes=function(n){n=acf.parseArgs(n,{category:""});var a=[];return r.map(function(t){var e=acf.getFieldType(t),i=e.prototype;n.category&&i.category!==n.category||a.push(e)}),a}}(jQuery),function(n,t){acf.findFields=function(t){var e=".acf-field",i=!1;return(t=acf.parseArgs(t,{key:"",name:"",type:"",is:"",parent:!1,sibling:!1,limit:!1,visible:!1,suppressFilters:!1})).suppressFilters||(t=acf.applyFilters("find_fields_args",t)),t.key&&(e+='[data-key="'+t.key+'"]'),t.type&&(e+='[data-type="'+t.type+'"]'),t.name&&(e+='[data-name="'+t.name+'"]'),t.is&&(e+=t.is),t.visible&&(e+=":visible"),i=t.parent?t.parent.find(e):t.sibling?t.sibling.siblings(e):n(e),t.suppressFilters||(i=i.not(".acf-clone .acf-field"),i=acf.applyFilters("find_fields",i)),t.limit&&(i=i.slice(0,t.limit)),i},acf.findField=function(t,e){return acf.findFields({key:t,limit:1,parent:e,suppressFilters:!0})},acf.getField=function(t){t instanceof jQuery||(t=acf.findField(t));var e=t.data("acf");return e||(e=acf.newField(t)),e},acf.getFields=function(t){t instanceof jQuery||(t=acf.findFields(t));var e=[];return t.each(function(){var t=acf.getField(n(this));e.push(t)}),e},acf.findClosestField=function(t){return t.closest(".acf-field")},acf.getClosestField=function(t){var e=acf.findClosestField(t);return this.getField(e)};var e=function(t){var e=t,r=t+"_fields",a=t+"_field",i=function(t){var e,i=acf.arrayArgs(arguments).slice(1),n=acf.getFields({parent:t});if(n.length){var a=[r,n].concat(i);acf.doAction.apply(null,a)}},n=function(t){var e,n=acf.arrayArgs(arguments).slice(1);t.map(function(t,e){var i=[a,t].concat(n);acf.doAction.apply(null,i)})};acf.addAction(e,i),acf.addAction(r,n),s(t)},s=function(e){var r=e+"_field",s=e+"Field",t=function(i){var n=acf.arrayArgs(arguments),a=n.slice(1),t;["type","name","key"].map(function(t){var e="/"+t+"="+i.get(t);n=[r+e,i].concat(a),acf.doAction.apply(null,n)}),-1