abchospitality/wp-content/plugins/advanced-custom-fields-pro/assets/build/js/acf.min.js

1 line
29 KiB
JavaScript
Raw Normal View History

2024-04-18 09:47:23 +00:00
(()=>{var t={204:()=>{!function(t,e){"use strict";acf.hooks=new function(){var t={removeFilter:function(e,i){return"string"==typeof e&&n("filters",e,i),t},applyFilters:function(){var e=Array.prototype.slice.call(arguments),n=e.shift();return"string"==typeof n?o("filters",n,e):t},addFilter:function(e,n,o,r){return"string"==typeof e&&"function"==typeof n&&i("filters",e,n,o=parseInt(o||10,10),r),t},removeAction:function(e,i){return"string"==typeof e&&n("actions",e,i),t},doAction:function(){var e=Array.prototype.slice.call(arguments),n=e.shift();return"string"==typeof n&&o("actions",n,e),t},addAction:function(e,n,o,r){return"string"==typeof e&&"function"==typeof n&&i("actions",e,n,o=parseInt(o||10,10),r),t},storage:function(){return e}},e={actions:{},filters:{}};function n(t,n,i,o){if(e[t][n])if(i){var r,a=e[t][n];if(o)for(r=a.length;r--;){var s=a[r];s.callback===i&&s.context===o&&a.splice(r,1)}else for(r=a.length;r--;)a[r].callback===i&&a.splice(r,1)}else e[t][n]=[]}function i(t,n,i,o,r){var a={callback:i,priority:o,context:r},s=e[t][n];s?(s.push(a),s=function(t){for(var e,n,i,o=1,r=t.length;o<r;o++){for(e=t[o],n=o;(i=t[n-1])&&i.priority>e.priority;)t[n]=t[n-1],--n;t[n]=e}return t}(s)):s=[a],e[t][n]=s}function o(t,n,i){var o=e[t][n];if(!o)return"filters"===t&&i[0];var r=0,a=o.length;if("filters"===t)for(;r<a;r++)i[0]=o[r].callback.apply(o[r].context,i);else for(;r<a;r++)o[r].callback.apply(o[r].context,i);return"filters"!==t||i[0]}return t}}(window)},2206:()=>{var t;t=jQuery,acf.models.Modal=acf.Model.extend({data:{title:"",content:"",toolbar:""},events:{"click .acf-modal-close":"onClickClose"},setup:function(e){t.extend(this.data,e),this.$el=t(),this.render()},initialize:function(){this.open()},render:function(){var e=this.get("title"),n=this.get("content"),i=this.get("toolbar"),o=t(["<div>",'<div class="acf-modal">','<div class="acf-modal-title">',"<h2>"+e+"</h2>",'<button class="acf-modal-close" type="button"><span class="dashicons dashicons-no"></span></button>',"</div>",'<div class="acf-modal-content">'+n+"</div>",'<div class="acf-modal-toolbar">'+i+"</div>","</div>",'<div class="acf-modal-backdrop acf-modal-close"></div>',"</div>"].join(""));this.$el&&this.$el.replaceWith(o),this.$el=o,acf.doAction("append",o)},update:function(t){this.data=acf.parseArgs(t,this.data),this.render()},title:function(t){this.$(".acf-modal-title h2").html(t)},content:function(t){this.$(".acf-modal-content").html(t)},toolbar:function(t){this.$(".acf-modal-toolbar").html(t)},open:function(){t("body").append(this.$el)},close:function(){this.remove()},onClickClose:function(t,e){t.preventDefault(),this.close()},focus:function(){this.$el.find(".acf-icon").first().trigger("focus")},lockFocusToModal:function(e){let n=t("#wpwrap");n.length&&(n[0].inert=e,n.attr("aria-hidden",e))},returnFocusToOrigin:function(){this.data.openedBy instanceof t&&this.data.openedBy.closest("body").length>0&&this.data.openedBy.trigger("focus")}}),acf.newModal=function(t){return new acf.models.Modal(t)}},9653:()=>{var t,e,n;t=jQuery,e=/^(\S+)\s*(.*)$/,n=acf.Model=function(){this.cid=acf.uniqueId("acf"),this.data=t.extend(!0,{},this.data),this.setup.apply(this,arguments),this.$el&&!this.$el.data("acf")&&this.$el.data("acf",this);var e=function(){this.initialize(),this.addEvents(),this.addActions(),this.addFilters()};this.wait&&!acf.didAction(this.wait)?this.addAction(this.wait,e):e.apply(this)},t.extend(n.prototype,{id:"",cid:"",$el:null,data:{},busy:!1,changed:!1,events:{},actions:{},filters:{},eventScope:"",wait:!1,priority:10,get:function(t){return this.data[t]},has:function(t){return null!=this.get(t)},set:function(t,e,n){var i=this.get(t);return i==e||(this.data[t]=e,n||(this.changed=!0,this.trigger("changed:"+t,[e,i]),this.trigger("changed",[t,e,i]))),this},inherit:function(e){return e instanceof jQuery&&(e=e.data()),t.extend(this.data,e),this},prop:function(){return this.$el.prop.apply(this.$el,arguments)},setup:function(e){t.extend(this,e)},initialize:function(){},addElements:function(t){if(!(t=t||this.elements||null)||!Object.keys(t).length)return!1;for(var e in