PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.5.4
Secure Custom Fields v6.5.4
6.9.2 6.9.1 6.9.0 6.8.9 6.8.7 6.8.8 6.8.6 6.8.4 6.8.5 trunk 6.4.0-beta1 6.4.0-beta2 6.4.1 6.4.1-beta3 6.4.1-beta4 6.4.1-beta5 6.4.1-beta6 6.4.1-beta7 6.4.2 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 6.5.6 6.5.7 6.6.0 6.7.0 6.7.1 6.8.0 6.8.1 6.8.2 6.8.3
secure-custom-fields / assets / build / js / acf.js
secure-custom-fields / assets / build / js Last commit date
commands 1 year ago pro 1 year ago acf-escaped-html-notice.asset.php 1 year ago acf-escaped-html-notice.js 1 year ago acf-escaped-html-notice.js.map 1 year ago acf-escaped-html-notice.min.asset.php 1 year ago acf-escaped-html-notice.min.js 1 year ago acf-field-group.asset.php 1 year ago acf-field-group.js 1 year ago acf-field-group.js.map 1 year ago acf-field-group.min.asset.php 1 year ago acf-field-group.min.js 1 year ago acf-input.asset.php 1 year ago acf-input.js 1 year ago acf-input.js.map 1 year ago acf-input.min.asset.php 1 year ago acf-input.min.js 1 year ago acf-internal-post-type.asset.php 1 year ago acf-internal-post-type.js 1 year ago acf-internal-post-type.js.map 1 year ago acf-internal-post-type.min.asset.php 1 year ago acf-internal-post-type.min.js 1 year ago acf.asset.php 1 year ago acf.js 1 year ago acf.js.map 1 year ago acf.min.asset.php 1 year ago acf.min.js 1 year ago index.php 1 year ago scf-bindings.asset.php 1 year ago scf-bindings.js 1 year ago scf-bindings.js.map 1 year ago scf-bindings.min.asset.php 1 year ago scf-bindings.min.js 1 year ago
acf.js
4501 lines
1 /******/ (() => { // webpackBootstrap
2 /******/ var __webpack_modules__ = ({
3
4 /***/ "./assets/src/js/_acf-hooks.js":
5 /*!*************************************!*\
6 !*** ./assets/src/js/_acf-hooks.js ***!
7 \*************************************/
8 /***/ (() => {
9
10 (function (window, undefined) {
11 'use strict';
12
13 /**
14 * Handles managing all events for whatever you plug it into. Priorities for hooks are based on lowest to highest in
15 * that, lowest priority hooks are fired first.
16 */
17 var EventManager = function () {
18 /**
19 * Maintain a reference to the object scope so our public methods never get confusing.
20 */
21 var MethodsAvailable = {
22 removeFilter: removeFilter,
23 applyFilters: applyFilters,
24 addFilter: addFilter,
25 removeAction: removeAction,
26 doAction: doAction,
27 addAction: addAction,
28 storage: getStorage
29 };
30
31 /**
32 * Contains the hooks that get registered with this EventManager. The array for storage utilizes a "flat"
33 * object literal such that looking up the hook utilizes the native object literal hash.
34 */
35 var STORAGE = {
36 actions: {},
37 filters: {}
38 };
39 function getStorage() {
40 return STORAGE;
41 }
42
43 /**
44 * Adds an action to the event manager.
45 *
46 * @param action Must contain namespace.identifier
47 * @param callback Must be a valid callback function before this action is added
48 * @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook
49 * @param [context] Supply a value to be used for this
50 */
51 function addAction(action, callback, priority, context) {
52 if (typeof action === 'string' && typeof callback === 'function') {
53 priority = parseInt(priority || 10, 10);
54 _addHook('actions', action, callback, priority, context);
55 }
56 return MethodsAvailable;
57 }
58
59 /**
60 * Performs an action if it exists. You can pass as many arguments as you want to this function; the only rule is
61 * that the first argument must always be the action.
62 */
63 function doAction(/* action, arg1, arg2, ... */
64 ) {
65 var args = Array.prototype.slice.call(arguments);
66 var action = args.shift();
67 if (typeof action === 'string') {
68 _runHook('actions', action, args);
69 }
70 return MethodsAvailable;
71 }
72
73 /**
74 * Removes the specified action if it contains a namespace.identifier & exists.
75 *
76 * @param action The action to remove
77 * @param [callback] Callback function to remove
78 */
79 function removeAction(action, callback) {
80 if (typeof action === 'string') {
81 _removeHook('actions', action, callback);
82 }
83 return MethodsAvailable;
84 }
85
86 /**
87 * Adds a filter to the event manager.
88 *
89 * @param filter Must contain namespace.identifier
90 * @param callback Must be a valid callback function before this action is added
91 * @param [priority=10] Used to control when the function is executed in relation to other callbacks bound to the same hook
92 * @param [context] Supply a value to be used for this
93 */
94 function addFilter(filter, callback, priority, context) {
95 if (typeof filter === 'string' && typeof callback === 'function') {
96 priority = parseInt(priority || 10, 10);
97 _addHook('filters', filter, callback, priority, context);
98 }
99 return MethodsAvailable;
100 }
101
102 /**
103 * Performs a filter if it exists. You should only ever pass 1 argument to be filtered. The only rule is that
104 * the first argument must always be the filter.
105 */
106 function applyFilters(/* filter, filtered arg, arg2, ... */
107 ) {
108 var args = Array.prototype.slice.call(arguments);
109 var filter = args.shift();
110 if (typeof filter === 'string') {
111 return _runHook('filters', filter, args);
112 }
113 return MethodsAvailable;
114 }
115
116 /**
117 * Removes the specified filter if it contains a namespace.identifier & exists.
118 *
119 * @param filter The action to remove
120 * @param [callback] Callback function to remove
121 */
122 function removeFilter(filter, callback) {
123 if (typeof filter === 'string') {
124 _removeHook('filters', filter, callback);
125 }
126 return MethodsAvailable;
127 }
128
129 /**
130 * Removes the specified hook by resetting the value of it.
131 *
132 * @param type Type of hook, either 'actions' or 'filters'
133 * @param hook The hook (namespace.identifier) to remove
134 * @private
135 */
136 function _removeHook(type, hook, callback, context) {
137 if (!STORAGE[type][hook]) {
138 return;
139 }
140 if (!callback) {
141 STORAGE[type][hook] = [];
142 } else {
143 var handlers = STORAGE[type][hook];
144 var i;
145 if (!context) {
146 for (i = handlers.length; i--;) {
147 if (handlers[i].callback === callback) {
148 handlers.splice(i, 1);
149 }
150 }
151 } else {
152 for (i = handlers.length; i--;) {
153 var handler = handlers[i];
154 if (handler.callback === callback && handler.context === context) {
155 handlers.splice(i, 1);
156 }
157 }
158 }
159 }
160 }
161
162 /**
163 * Adds the hook to the appropriate storage container
164 *
165 * @param type 'actions' or 'filters'
166 * @param hook The hook (namespace.identifier) to add to our event manager
167 * @param callback The function that will be called when the hook is executed.
168 * @param priority The priority of this hook. Must be an integer.
169 * @param [context] A value to be used for this
170 * @private
171 */
172 function _addHook(type, hook, callback, priority, context) {
173 var hookObject = {
174 callback: callback,
175 priority: priority,
176 context: context
177 };
178
179 // Utilize 'prop itself' : http://jsperf.com/hasownproperty-vs-in-vs-undefined/19
180 var hooks = STORAGE[type][hook];
181 if (hooks) {
182 hooks.push(hookObject);
183 hooks = _hookInsertSort(hooks);
184 } else {
185 hooks = [hookObject];
186 }
187 STORAGE[type][hook] = hooks;
188 }
189
190 /**
191 * Use an insert sort for keeping our hooks organized based on priority. This function is ridiculously faster
192 * than bubble sort, etc: http://jsperf.com/javascript-sort
193 *
194 * @param hooks The custom array containing all of the appropriate hooks to perform an insert sort on.
195 * @private
196 */
197 function _hookInsertSort(hooks) {
198 var tmpHook, j, prevHook;
199 for (var i = 1, len = hooks.length; i < len; i++) {
200 tmpHook = hooks[i];
201 j = i;
202 while ((prevHook = hooks[j - 1]) && prevHook.priority > tmpHook.priority) {
203 hooks[j] = hooks[j - 1];
204 --j;
205 }
206 hooks[j] = tmpHook;
207 }
208 return hooks;
209 }
210
211 /**
212 * Runs the specified hook. If it is an action, the value is not modified but if it is a filter, it is.
213 *
214 * @param type 'actions' or 'filters'
215 * @param hook The hook ( namespace.identifier ) to be ran.
216 * @param args Arguments to pass to the action/filter. If it's a filter, args is actually a single parameter.
217 * @private
218 */
219 function _runHook(type, hook, args) {
220 var handlers = STORAGE[type][hook];
221 if (!handlers) {
222 return type === 'filters' ? args[0] : false;
223 }
224 var i = 0,
225 len = handlers.length;
226 if (type === 'filters') {
227 for (; i < len; i++) {
228 args[0] = handlers[i].callback.apply(handlers[i].context, args);
229 }
230 } else {
231 for (; i < len; i++) {
232 handlers[i].callback.apply(handlers[i].context, args);
233 }
234 }
235 return type === 'filters' ? args[0] : true;
236 }
237
238 // return all of the publicly available methods
239 return MethodsAvailable;
240 };
241
242 // instantiate
243 acf.hooks = new EventManager();
244 })(window);
245
246 /***/ }),
247
248 /***/ "./assets/src/js/_acf-modal.js":
249 /*!*************************************!*\
250 !*** ./assets/src/js/_acf-modal.js ***!
251 \*************************************/
252 /***/ (() => {
253
254 (function ($, undefined) {
255 acf.models.Modal = acf.Model.extend({
256 data: {
257 title: '',
258 content: '',
259 toolbar: ''
260 },
261 events: {
262 'click .acf-modal-close': 'onClickClose'
263 },
264 setup: function (props) {
265 $.extend(this.data, props);
266 this.$el = $();
267 this.render();
268 },
269 initialize: function () {
270 this.open();
271 },
272 render: function () {
273 // Extract vars.
274 var title = this.get('title');
275 var content = this.get('content');
276 var toolbar = this.get('toolbar');
277
278 // Create element.
279 var $el = $(['<div>', '<div class="acf-modal">', '<div class="acf-modal-title">', '<h2>' + title + '</h2>', '<button class="acf-modal-close" type="button"><span class="dashicons dashicons-no"></span></button>', '</div>', '<div class="acf-modal-content">' + content + '</div>', '<div class="acf-modal-toolbar">' + toolbar + '</div>', '</div>', '<div class="acf-modal-backdrop acf-modal-close"></div>', '</div>'].join(''));
280
281 // Update DOM.
282 if (this.$el) {
283 this.$el.replaceWith($el);
284 }
285 this.$el = $el;
286
287 // Trigger action.
288 acf.doAction('append', $el);
289 },
290 update: function (props) {
291 this.data = acf.parseArgs(props, this.data);
292 this.render();
293 },
294 title: function (title) {
295 this.$('.acf-modal-title h2').html(title);
296 },
297 content: function (content) {
298 this.$('.acf-modal-content').html(content);
299 },
300 toolbar: function (toolbar) {
301 this.$('.acf-modal-toolbar').html(toolbar);
302 },
303 open: function () {
304 $('body').append(this.$el);
305 },
306 close: function () {
307 this.remove();
308 },
309 onClickClose: function (e, $el) {
310 e.preventDefault();
311 this.close();
312 },
313 /**
314 * Places focus within the popup.
315 */
316 focus: function () {
317 this.$el.find('.acf-icon').first().trigger('focus');
318 },
319 /**
320 * Locks focus within the modal.
321 *
322 * @param {boolean} locked True to lock focus, false to unlock.
323 */
324 lockFocusToModal: function (locked) {
325 let inertElement = $('#wpwrap');
326 if (!inertElement.length) {
327 return;
328 }
329 inertElement[0].inert = locked;
330 inertElement.attr('aria-hidden', locked);
331 },
332 /**
333 * Returns focus to the element that opened the popup
334 * if it still exists in the DOM.
335 */
336 returnFocusToOrigin: function () {
337 if (this.data.openedBy instanceof $ && this.data.openedBy.closest('body').length > 0) {
338 this.data.openedBy.trigger('focus');
339 }
340 }
341 });
342
343 /**
344 * Returns a new modal.
345 *
346 * @date 21/4/20
347 * @since ACF 5.9.0
348 *
349 * @param object props The modal props.
350 * @return object
351 */
352 acf.newModal = function (props) {
353 return new acf.models.Modal(props);
354 };
355 })(jQuery);
356
357 /***/ }),
358
359 /***/ "./assets/src/js/_acf-model.js":
360 /*!*************************************!*\
361 !*** ./assets/src/js/_acf-model.js ***!
362 \*************************************/
363 /***/ (() => {
364
365 (function ($, undefined) {
366 // Cached regex to split keys for `addEvent`.
367 var delegateEventSplitter = /^(\S+)\s*(.*)$/;
368
369 /**
370 * extend
371 *
372 * Helper function to correctly set up the prototype chain for subclasses
373 * Heavily inspired by backbone.js
374 *
375 * @date 14/12/17
376 * @since ACF 5.6.5
377 *
378 * @param object protoProps New properties for this object.
379 * @return function.
380 */
381
382 var extend = function (protoProps) {
383 // vars
384 var Parent = this;
385 var Child;
386
387 // The constructor function for the new subclass is either defined by you
388 // (the "constructor" property in your `extend` definition), or defaulted
389 // by us to simply call the parent constructor.
390 if (protoProps && protoProps.hasOwnProperty('constructor')) {
391 Child = protoProps.constructor;
392 } else {
393 Child = function () {
394 return Parent.apply(this, arguments);
395 };
396 }
397
398 // Add static properties to the constructor function, if supplied.
399 $.extend(Child, Parent);
400
401 // Set the prototype chain to inherit from `parent`, without calling
402 // `parent`'s constructor function and add the prototype properties.
403 Child.prototype = Object.create(Parent.prototype);
404 $.extend(Child.prototype, protoProps);
405 Child.prototype.constructor = Child;
406
407 // Set a convenience property in case the parent's prototype is needed later.
408 //Child.prototype.__parent__ = Parent.prototype;
409
410 // return
411 return Child;
412 };
413
414 /**
415 * Model
416 *
417 * Base class for all inheritance
418 *
419 * @date 14/12/17
420 * @since ACF 5.6.5
421 *
422 * @param object props
423 * @return function.
424 */
425
426 var Model = acf.Model = function () {
427 // generate unique client id
428 this.cid = acf.uniqueId('acf');
429
430 // set vars to avoid modifying prototype
431 this.data = $.extend(true, {}, this.data);
432
433 // pass props to setup function
434 this.setup.apply(this, arguments);
435
436 // store on element (allow this.setup to create this.$el)
437 if (this.$el && !this.$el.data('acf')) {
438 this.$el.data('acf', this);
439 }
440
441 // initialize
442 var initialize = function () {
443 this.initialize();
444 this.addEvents();
445 this.addActions();
446 this.addFilters();
447 };
448
449 // initialize on action
450 if (this.wait && !acf.didAction(this.wait)) {
451 this.addAction(this.wait, initialize);
452
453 // initialize now
454 } else {
455 initialize.apply(this);
456 }
457 };
458
459 // Attach all inheritable methods to the Model prototype.
460 $.extend(Model.prototype, {
461 // Unique model id
462 id: '',
463 // Unique client id
464 cid: '',
465 // jQuery element
466 $el: null,
467 // Data specific to this instance
468 data: {},
469 // toggle used when changing data
470 busy: false,
471 changed: false,
472 // Setup events hooks
473 events: {},
474 actions: {},
475 filters: {},
476 // class used to avoid nested event triggers
477 eventScope: '',
478 // action to wait until initialize
479 wait: false,
480 // action priority default
481 priority: 10,
482 /**
483 * get
484 *
485 * Gets a specific data value
486 *
487 * @date 14/12/17
488 * @since ACF 5.6.5
489 *
490 * @param string name
491 * @return mixed
492 */
493
494 get: function (name) {
495 return this.data[name];
496 },
497 /**
498 * has
499 *
500 * Returns `true` if the data exists and is not null
501 *
502 * @date 14/12/17
503 * @since ACF 5.6.5
504 *
505 * @param string name
506 * @return boolean
507 */
508
509 has: function (name) {
510 return this.get(name) != null;
511 },
512 /**
513 * set
514 *
515 * Sets a specific data value
516 *
517 * @date 14/12/17
518 * @since ACF 5.6.5
519 *
520 * @param string name
521 * @param mixed value
522 * @return this
523 */
524
525 set: function (name, value, silent) {
526 // bail if unchanged
527 var prevValue = this.get(name);
528 if (prevValue == value) {
529 return this;
530 }
531
532 // set data
533 this.data[name] = value;
534
535 // trigger events
536 if (!silent) {
537 this.changed = true;
538 this.trigger('changed:' + name, [value, prevValue]);
539 this.trigger('changed', [name, value, prevValue]);
540 }
541
542 // return
543 return this;
544 },
545 /**
546 * inherit
547 *
548 * Inherits the data from a jQuery element
549 *
550 * @date 14/12/17
551 * @since ACF 5.6.5
552 *
553 * @param jQuery $el
554 * @return this
555 */
556
557 inherit: function (data) {
558 // allow jQuery
559 if (data instanceof jQuery) {
560 data = data.data();
561 }
562
563 // extend
564 $.extend(this.data, data);
565
566 // return
567 return this;
568 },
569 /**
570 * prop
571 *
572 * mimics the jQuery prop function
573 *
574 * @date 4/6/18
575 * @since ACF 5.6.9
576 *
577 * @param type $var Description. Default.
578 * @return type Description.
579 */
580
581 prop: function () {
582 return this.$el.prop.apply(this.$el, arguments);
583 },
584 /**
585 * setup
586 *
587 * Run during constructor function
588 *
589 * @date 14/12/17
590 * @since ACF 5.6.5
591 *
592 * @param n/a
593 * @return n/a
594 */
595
596 setup: function (props) {
597 $.extend(this, props);
598 },
599 /**
600 * initialize
601 *
602 * Also run during constructor function
603 *
604 * @date 14/12/17
605 * @since ACF 5.6.5
606 *
607 * @param n/a
608 * @return n/a
609 */
610
611 initialize: function () {},
612 /**
613 * addElements
614 *
615 * Adds multiple jQuery elements to this object
616 *
617 * @date 9/5/18
618 * @since ACF 5.6.9
619 *
620 * @param type $var Description. Default.
621 * @return type Description.
622 */
623
624 addElements: function (elements) {
625 elements = elements || this.elements || null;
626 if (!elements || !Object.keys(elements).length) return false;
627 for (var i in elements) {
628 this.addElement(i, elements[i]);
629 }
630 },
631 /**
632 * addElement
633 *
634 * description
635 *
636 * @date 9/5/18
637 * @since ACF 5.6.9
638 *
639 * @param type $var Description. Default.
640 * @return type Description.
641 */
642
643 addElement: function (name, selector) {
644 this['$' + name] = this.$(selector);
645 },
646 /**
647 * addEvents
648 *
649 * Adds multiple event handlers
650 *
651 * @date 14/12/17
652 * @since ACF 5.6.5
653 *
654 * @param object events {event1 : callback, event2 : callback, etc }
655 * @return n/a
656 */
657
658 addEvents: function (events) {
659 events = events || this.events || null;
660 if (!events) return false;
661 for (var key in events) {
662 var match = key.match(delegateEventSplitter);
663 this.on(match[1], match[2], events[key]);
664 }
665 },
666 /**
667 * removeEvents
668 *
669 * Removes multiple event handlers
670 *
671 * @date 14/12/17
672 * @since ACF 5.6.5
673 *
674 * @param object events {event1 : callback, event2 : callback, etc }
675 * @return n/a
676 */
677
678 removeEvents: function (events) {
679 events = events || this.events || null;
680 if (!events) return false;
681 for (var key in events) {
682 var match = key.match(delegateEventSplitter);
683 this.off(match[1], match[2], events[key]);
684 }
685 },
686 /**
687 * getEventTarget
688 *
689 * Returns a jQuery element to trigger an event on.
690 *
691 * @date 5/6/18
692 * @since ACF 5.6.9
693 *
694 * @param jQuery $el The default jQuery element. Optional.
695 * @param string event The event name. Optional.
696 * @return jQuery
697 */
698
699 getEventTarget: function ($el, event) {
700 return $el || this.$el || $(document);
701 },
702 /**
703 * validateEvent
704 *
705 * Returns true if the event target's closest $el is the same as this.$el
706 * Requires both this.el and this.$el to be defined
707 *
708 * @date 5/6/18
709 * @since ACF 5.6.9
710 *
711 * @param type $var Description. Default.
712 * @return type Description.
713 */
714
715 validateEvent: function (e) {
716 if (this.eventScope) {
717 return $(e.target).closest(this.eventScope).is(this.$el);
718 } else {
719 return true;
720 }
721 },
722 /**
723 * proxyEvent
724 *
725 * Returns a new event callback function scoped to this model
726 *
727 * @date 29/3/18
728 * @since ACF 5.6.9
729 *
730 * @param function callback
731 * @return function
732 */
733
734 proxyEvent: function (callback) {
735 return this.proxy(function (e) {
736 // validate
737 if (!this.validateEvent(e)) {
738 return;
739 }
740
741 // construct args
742 var args = acf.arrayArgs(arguments);
743 var extraArgs = args.slice(1);
744 var eventArgs = [e, $(e.currentTarget)].concat(extraArgs);
745
746 // callback
747 callback.apply(this, eventArgs);
748 });
749 },
750 /**
751 * on
752 *
753 * Adds an event handler similar to jQuery
754 * Uses the instance 'cid' to namespace event
755 *
756 * @date 14/12/17
757 * @since ACF 5.6.5
758 *
759 * @param string name
760 * @param string callback
761 * @return n/a
762 */
763
764 on: function (a1, a2, a3, a4) {
765 // vars
766 var $el, event, selector, callback, args;
767
768 // find args
769 if (a1 instanceof jQuery) {
770 // 1. args( $el, event, selector, callback )
771 if (a4) {
772 $el = a1;
773 event = a2;
774 selector = a3;
775 callback = a4;
776
777 // 2. args( $el, event, callback )
778 } else {
779 $el = a1;
780 event = a2;
781 callback = a3;
782 }
783 } else {
784 // 3. args( event, selector, callback )
785 if (a3) {
786 event = a1;
787 selector = a2;
788 callback = a3;
789
790 // 4. args( event, callback )
791 } else {
792 event = a1;
793 callback = a2;
794 }
795 }
796
797 // element
798 $el = this.getEventTarget($el);
799
800 // modify callback
801 if (typeof callback === 'string') {
802 callback = this.proxyEvent(this[callback]);
803 }
804
805 // modify event
806 event = event + '.' + this.cid;
807
808 // args
809 if (selector) {
810 args = [event, selector, callback];
811 } else {
812 args = [event, callback];
813 }
814
815 // on()
816 $el.on.apply($el, args);
817 },
818 /**
819 * off
820 *
821 * Removes an event handler similar to jQuery
822 *
823 * @date 14/12/17
824 * @since ACF 5.6.5
825 *
826 * @param string name
827 * @param string callback
828 * @return n/a
829 */
830
831 off: function (a1, a2, a3) {
832 // vars
833 var $el, event, selector, args;
834
835 // find args
836 if (a1 instanceof jQuery) {
837 // 1. args( $el, event, selector )
838 if (a3) {
839 $el = a1;
840 event = a2;
841 selector = a3;
842
843 // 2. args( $el, event )
844 } else {
845 $el = a1;
846 event = a2;
847 }
848 } else {
849 // 3. args( event, selector )
850 if (a2) {
851 event = a1;
852 selector = a2;
853
854 // 4. args( event )
855 } else {
856 event = a1;
857 }
858 }
859
860 // element
861 $el = this.getEventTarget($el);
862
863 // modify event
864 event = event + '.' + this.cid;
865
866 // args
867 if (selector) {
868 args = [event, selector];
869 } else {
870 args = [event];
871 }
872
873 // off()
874 $el.off.apply($el, args);
875 },
876 /**
877 * trigger
878 *
879 * Triggers an event similar to jQuery
880 *
881 * @date 14/12/17
882 * @since ACF 5.6.5
883 *
884 * @param string name
885 * @param string callback
886 * @return n/a
887 */
888
889 trigger: function (name, args, bubbles) {
890 var $el = this.getEventTarget();
891 if (bubbles) {
892 $el.trigger.apply($el, arguments);
893 } else {
894 $el.triggerHandler.apply($el, arguments);
895 }
896 return this;
897 },
898 /**
899 * addActions
900 *
901 * Adds multiple action handlers
902 *
903 * @date 14/12/17
904 * @since ACF 5.6.5
905 *
906 * @param object actions {action1 : callback, action2 : callback, etc }
907 * @return n/a
908 */
909
910 addActions: function (actions) {
911 actions = actions || this.actions || null;
912 if (!actions) return false;
913 for (var i in actions) {
914 this.addAction(i, actions[i]);
915 }
916 },
917 /**
918 * removeActions
919 *
920 * Removes multiple action handlers
921 *
922 * @date 14/12/17
923 * @since ACF 5.6.5
924 *
925 * @param object actions {action1 : callback, action2 : callback, etc }
926 * @return n/a
927 */
928
929 removeActions: function (actions) {
930 actions = actions || this.actions || null;
931 if (!actions) return false;
932 for (var i in actions) {
933 this.removeAction(i, actions[i]);
934 }
935 },
936 /**
937 * addAction
938 *
939 * Adds an action using the wp.hooks library
940 *
941 * @date 14/12/17
942 * @since ACF 5.6.5
943 *
944 * @param string name
945 * @param string callback
946 * @return n/a
947 */
948
949 addAction: function (name, callback, priority) {
950 //console.log('addAction', name, priority);
951 // defaults
952 priority = priority || this.priority;
953
954 // modify callback
955 if (typeof callback === 'string') {
956 callback = this[callback];
957 }
958
959 // add
960 acf.addAction(name, callback, priority, this);
961 },
962 /**
963 * removeAction
964 *
965 * Remove an action using the wp.hooks library
966 *
967 * @date 14/12/17
968 * @since ACF 5.6.5
969 *
970 * @param string name
971 * @param string callback
972 * @return n/a
973 */
974
975 removeAction: function (name, callback) {
976 acf.removeAction(name, this[callback]);
977 },
978 /**
979 * addFilters
980 *
981 * Adds multiple filter handlers
982 *
983 * @date 14/12/17
984 * @since ACF 5.6.5
985 *
986 * @param object filters {filter1 : callback, filter2 : callback, etc }
987 * @return n/a
988 */
989
990 addFilters: function (filters) {
991 filters = filters || this.filters || null;
992 if (!filters) return false;
993 for (var i in filters) {
994 this.addFilter(i, filters[i]);
995 }
996 },
997 /**
998 * addFilter
999 *
1000 * Adds a filter using the wp.hooks library
1001 *
1002 * @date 14/12/17
1003 * @since ACF 5.6.5
1004 *
1005 * @param string name
1006 * @param string callback
1007 * @return n/a
1008 */
1009
1010 addFilter: function (name, callback, priority) {
1011 // defaults
1012 priority = priority || this.priority;
1013
1014 // modify callback
1015 if (typeof callback === 'string') {
1016 callback = this[callback];
1017 }
1018
1019 // add
1020 acf.addFilter(name, callback, priority, this);
1021 },
1022 /**
1023 * removeFilters
1024 *
1025 * Removes multiple filter handlers
1026 *
1027 * @date 14/12/17
1028 * @since ACF 5.6.5
1029 *
1030 * @param object filters {filter1 : callback, filter2 : callback, etc }
1031 * @return n/a
1032 */
1033
1034 removeFilters: function (filters) {
1035 filters = filters || this.filters || null;
1036 if (!filters) return false;
1037 for (var i in filters) {
1038 this.removeFilter(i, filters[i]);
1039 }
1040 },
1041 /**
1042 * removeFilter
1043 *
1044 * Remove a filter using the wp.hooks library
1045 *
1046 * @date 14/12/17
1047 * @since ACF 5.6.5
1048 *
1049 * @param string name
1050 * @param string callback
1051 * @return n/a
1052 */
1053
1054 removeFilter: function (name, callback) {
1055 acf.removeFilter(name, this[callback]);
1056 },
1057 /**
1058 * $
1059 *
1060 * description
1061 *
1062 * @date 16/12/17
1063 * @since ACF 5.6.5
1064 *
1065 * @param type $var Description. Default.
1066 * @return type Description.
1067 */
1068
1069 $: function (selector) {
1070 return this.$el.find(selector);
1071 },
1072 /**
1073 * remove
1074 *
1075 * Removes the element and listeners
1076 *
1077 * @date 19/12/17
1078 * @since ACF 5.6.5
1079 *
1080 * @param type $var Description. Default.
1081 * @return type Description.
1082 */
1083
1084 remove: function () {
1085 this.removeEvents();
1086 this.removeActions();
1087 this.removeFilters();
1088 this.$el.remove();
1089 },
1090 /**
1091 * setTimeout
1092 *
1093 * description
1094 *
1095 * @date 16/1/18
1096 * @since ACF 5.6.5
1097 *
1098 * @param type $var Description. Default.
1099 * @return type Description.
1100 */
1101
1102 setTimeout: function (callback, milliseconds) {
1103 return setTimeout(this.proxy(callback), milliseconds);
1104 },
1105 /**
1106 * time
1107 *
1108 * used for debugging
1109 *
1110 * @date 7/3/18
1111 * @since ACF 5.6.9
1112 *
1113 * @param type $var Description. Default.
1114 * @return type Description.
1115 */
1116
1117 time: function () {
1118 console.time(this.id || this.cid);
1119 },
1120 /**
1121 * timeEnd
1122 *
1123 * used for debugging
1124 *
1125 * @date 7/3/18
1126 * @since ACF 5.6.9
1127 *
1128 * @param type $var Description. Default.
1129 * @return type Description.
1130 */
1131
1132 timeEnd: function () {
1133 console.timeEnd(this.id || this.cid);
1134 },
1135 /**
1136 * show
1137 *
1138 * description
1139 *
1140 * @date 15/3/18
1141 * @since ACF 5.6.9
1142 *
1143 * @param type $var Description. Default.
1144 * @return type Description.
1145 */
1146
1147 show: function () {
1148 acf.show(this.$el);
1149 },
1150 /**
1151 * hide
1152 *
1153 * description
1154 *
1155 * @date 15/3/18
1156 * @since ACF 5.6.9
1157 *
1158 * @param type $var Description. Default.
1159 * @return type Description.
1160 */
1161
1162 hide: function () {
1163 acf.hide(this.$el);
1164 },
1165 /**
1166 * proxy
1167 *
1168 * Returns a new function scoped to this model
1169 *
1170 * @date 29/3/18
1171 * @since ACF 5.6.9
1172 *
1173 * @param function callback
1174 * @return function
1175 */
1176
1177 proxy: function (callback) {
1178 return $.proxy(callback, this);
1179 }
1180 });
1181
1182 // Set up inheritance for the model
1183 Model.extend = extend;
1184
1185 // Global model storage
1186 acf.models = {};
1187
1188 /**
1189 * acf.getInstance
1190 *
1191 * This function will get an instance from an element
1192 *
1193 * @date 5/3/18
1194 * @since ACF 5.6.9
1195 *
1196 * @param type $var Description. Default.
1197 * @return type Description.
1198 */
1199
1200 acf.getInstance = function ($el) {
1201 return $el.data('acf');
1202 };
1203
1204 /**
1205 * acf.getInstances
1206 *
1207 * This function will get an array of instances from multiple elements
1208 *
1209 * @date 5/3/18
1210 * @since ACF 5.6.9
1211 *
1212 * @param type $var Description. Default.
1213 * @return type Description.
1214 */
1215
1216 acf.getInstances = function ($el) {
1217 var instances = [];
1218 $el.each(function () {
1219 instances.push(acf.getInstance($(this)));
1220 });
1221 return instances;
1222 };
1223 })(jQuery);
1224
1225 /***/ }),
1226
1227 /***/ "./assets/src/js/_acf-notice.js":
1228 /*!**************************************!*\
1229 !*** ./assets/src/js/_acf-notice.js ***!
1230 \**************************************/
1231 /***/ (() => {
1232
1233 (function ($, undefined) {
1234 var Notice = acf.Model.extend({
1235 data: {
1236 text: '',
1237 type: '',
1238 timeout: 0,
1239 dismiss: true,
1240 target: false,
1241 location: 'before',
1242 close: function () {}
1243 },
1244 events: {
1245 'click .acf-notice-dismiss': 'onClickClose'
1246 },
1247 tmpl: function () {
1248 return '<div class="acf-notice"></div>';
1249 },
1250 setup: function (props) {
1251 $.extend(this.data, props);
1252 this.$el = $(this.tmpl());
1253 },
1254 initialize: function () {
1255 // render
1256 this.render();
1257
1258 // show
1259 this.show();
1260 },
1261 render: function () {
1262 // class
1263 this.type(this.get('type'));
1264
1265 // text
1266 this.html('<p>' + this.get('text') + '</p>');
1267
1268 // close
1269 if (this.get('dismiss')) {
1270 this.$el.append('<a href="#" class="acf-notice-dismiss acf-icon -cancel small"></a>');
1271 this.$el.addClass('-dismiss');
1272 }
1273
1274 // timeout
1275 var timeout = this.get('timeout');
1276 if (timeout) {
1277 this.away(timeout);
1278 }
1279 },
1280 update: function (props) {
1281 // update
1282 $.extend(this.data, props);
1283
1284 // re-initialize
1285 this.initialize();
1286
1287 // refresh events
1288 this.removeEvents();
1289 this.addEvents();
1290 },
1291 show: function () {
1292 var $target = this.get('target');
1293 var location = this.get('location');
1294 if ($target) {
1295 if (location === 'after') {
1296 $target.append(this.$el);
1297 } else {
1298 $target.prepend(this.$el);
1299 }
1300 }
1301 },
1302 hide: function () {
1303 this.$el.remove();
1304 },
1305 away: function (timeout) {
1306 this.setTimeout(function () {
1307 acf.remove(this.$el);
1308 }, timeout);
1309 },
1310 type: function (type) {
1311 // remove prev type
1312 var prevType = this.get('type');
1313 if (prevType) {
1314 this.$el.removeClass('-' + prevType);
1315 }
1316
1317 // add new type
1318 this.$el.addClass('-' + type);
1319
1320 // backwards compatibility
1321 if (type == 'error') {
1322 this.$el.addClass('acf-error-message');
1323 }
1324 },
1325 html: function (html) {
1326 this.$el.html(acf.escHtml(html));
1327 },
1328 text: function (text) {
1329 this.$('p').html(acf.escHtml(text));
1330 },
1331 onClickClose: function (e, $el) {
1332 e.preventDefault();
1333 this.get('close').apply(this, arguments);
1334 this.remove();
1335 }
1336 });
1337 acf.newNotice = function (props) {
1338 // ensure object
1339 if (typeof props !== 'object') {
1340 props = {
1341 text: props
1342 };
1343 }
1344
1345 // instantiate
1346 return new Notice(props);
1347 };
1348 var noticeManager = new acf.Model({
1349 wait: 'prepare',
1350 priority: 1,
1351 initialize: function () {
1352 const $notices = $('.acf-admin-notice');
1353 $notices.each(function () {
1354 if ($(this).data('persisted')) {
1355 let dismissed = acf.getPreference('dismissed-notices');
1356 if (dismissed && typeof dismissed == 'object' && dismissed.includes($(this).data('persist-id'))) {
1357 $(this).remove();
1358 } else {
1359 $(this).show();
1360 $(this).on('click', '.notice-dismiss', function (e) {
1361 dismissed = acf.getPreference('dismissed-notices');
1362 if (!dismissed || typeof dismissed != 'object') {
1363 dismissed = [];
1364 }
1365 dismissed.push($(this).closest('.acf-admin-notice').data('persist-id'));
1366 acf.setPreference('dismissed-notices', dismissed);
1367 });
1368 }
1369 }
1370 });
1371 }
1372 });
1373 })(jQuery);
1374
1375 /***/ }),
1376
1377 /***/ "./assets/src/js/_acf-panel.js":
1378 /*!*************************************!*\
1379 !*** ./assets/src/js/_acf-panel.js ***!
1380 \*************************************/
1381 /***/ (() => {
1382
1383 (function ($, undefined) {
1384 var panel = new acf.Model({
1385 events: {
1386 'click .acf-panel-title': 'onClick'
1387 },
1388 onClick: function (e, $el) {
1389 e.preventDefault();
1390 this.toggle($el.parent());
1391 },
1392 isOpen: function ($el) {
1393 return $el.hasClass('-open');
1394 },
1395 toggle: function ($el) {
1396 this.isOpen($el) ? this.close($el) : this.open($el);
1397 },
1398 open: function ($el) {
1399 $el.addClass('-open');
1400 $el.find('.acf-panel-title i').attr('class', 'dashicons dashicons-arrow-down');
1401 },
1402 close: function ($el) {
1403 $el.removeClass('-open');
1404 $el.find('.acf-panel-title i').attr('class', 'dashicons dashicons-arrow-right');
1405 }
1406 });
1407 })(jQuery);
1408
1409 /***/ }),
1410
1411 /***/ "./assets/src/js/_acf-popup.js":
1412 /*!*************************************!*\
1413 !*** ./assets/src/js/_acf-popup.js ***!
1414 \*************************************/
1415 /***/ (() => {
1416
1417 (function ($, undefined) {
1418 acf.models.Popup = acf.Model.extend({
1419 data: {
1420 title: '',
1421 content: '',
1422 width: 0,
1423 height: 0,
1424 loading: false,
1425 openedBy: null
1426 },
1427 events: {
1428 'click [data-event="close"]': 'onClickClose',
1429 'click .acf-close-popup': 'onClickClose',
1430 'keydown': 'onPressEscapeClose'
1431 },
1432 setup: function (props) {
1433 $.extend(this.data, props);
1434 this.$el = $(this.tmpl());
1435 },
1436 initialize: function () {
1437 this.render();
1438 this.open();
1439 this.focus();
1440 this.lockFocusToPopup(true);
1441 },
1442 tmpl: function () {
1443 return ['<div id="acf-popup" role="dialog" tabindex="-1">', '<div class="acf-popup-box acf-box">', '<div class="title"><h3></h3><a href="#" class="acf-icon -cancel grey" data-event="close" aria-label="' + acf.__('Close modal') + '"></a></div>', '<div class="inner"></div>', '<div class="loading"><i class="acf-loading"></i></div>', '</div>', '<div class="bg" data-event="close"></div>', '</div>'].join('');
1444 },
1445 render: function () {
1446 // Extract Vars.
1447 var title = this.get('title');
1448 var content = this.get('content');
1449 var loading = this.get('loading');
1450 var width = this.get('width');
1451 var height = this.get('height');
1452
1453 // Update.
1454 this.title(title);
1455 this.content(content);
1456 if (width) {
1457 this.$('.acf-popup-box').css('width', width);
1458 }
1459 if (height) {
1460 this.$('.acf-popup-box').css('min-height', height);
1461 }
1462 this.loading(loading);
1463
1464 // Trigger action.
1465 acf.doAction('append', this.$el);
1466 },
1467 /**
1468 * Places focus within the popup.
1469 */
1470 focus: function () {
1471 this.$el.find('.acf-icon').first().trigger('focus');
1472 },
1473 /**
1474 * Locks focus within the popup.
1475 *
1476 * @param {boolean} locked True to lock focus, false to unlock.
1477 */
1478 lockFocusToPopup: function (locked) {
1479 let inertElement = $('#wpwrap');
1480 if (!inertElement.length) {
1481 return;
1482 }
1483 inertElement[0].inert = locked;
1484 inertElement.attr('aria-hidden', locked);
1485 },
1486 update: function (props) {
1487 this.data = acf.parseArgs(props, this.data);
1488 this.render();
1489 },
1490 title: function (title) {
1491 this.$('.title:first h3').html(title);
1492 },
1493 content: function (content) {
1494 this.$('.inner:first').html(content);
1495 },
1496 loading: function (show) {
1497 var $loading = this.$('.loading:first');
1498 show ? $loading.show() : $loading.hide();
1499 },
1500 open: function () {
1501 $('body').append(this.$el);
1502 },
1503 close: function () {
1504 this.lockFocusToPopup(false);
1505 this.returnFocusToOrigin();
1506 this.remove();
1507 },
1508 onClickClose: function (e, $el) {
1509 e.preventDefault();
1510 this.close();
1511 },
1512 /**
1513 * Closes the popup when the escape key is pressed.
1514 *
1515 * @param {KeyboardEvent} e
1516 */
1517 onPressEscapeClose: function (e) {
1518 if (e.key === 'Escape') {
1519 this.close();
1520 }
1521 },
1522 /**
1523 * Returns focus to the element that opened the popup
1524 * if it still exists in the DOM.
1525 */
1526 returnFocusToOrigin: function () {
1527 if (this.data.openedBy instanceof $ && this.data.openedBy.closest('body').length > 0) {
1528 this.data.openedBy.trigger('focus');
1529 }
1530 }
1531 });
1532
1533 /**
1534 * newPopup
1535 *
1536 * Creates a new Popup with the supplied props
1537 *
1538 * @date 17/12/17
1539 * @since ACF 5.6.5
1540 *
1541 * @param object props
1542 * @return object
1543 */
1544
1545 acf.newPopup = function (props) {
1546 return new acf.models.Popup(props);
1547 };
1548 })(jQuery);
1549
1550 /***/ }),
1551
1552 /***/ "./assets/src/js/_acf-tooltip.js":
1553 /*!***************************************!*\
1554 !*** ./assets/src/js/_acf-tooltip.js ***!
1555 \***************************************/
1556 /***/ (() => {
1557
1558 (function ($, undefined) {
1559 acf.newTooltip = function (props) {
1560 // ensure object
1561 if (typeof props !== 'object') {
1562 props = {
1563 text: props
1564 };
1565 }
1566
1567 // confirmRemove
1568 if (props.confirmRemove !== undefined) {
1569 props.textConfirm = acf.__('Remove');
1570 props.textCancel = acf.__('Cancel');
1571 return new TooltipConfirm(props);
1572
1573 // confirm
1574 } else if (props.confirm !== undefined) {
1575 return new TooltipConfirm(props);
1576
1577 // default
1578 } else {
1579 return new Tooltip(props);
1580 }
1581 };
1582 var Tooltip = acf.Model.extend({
1583 data: {
1584 text: '',
1585 timeout: 0,
1586 target: null
1587 },
1588 tmpl: function () {
1589 return '<div class="acf-tooltip"></div>';
1590 },
1591 setup: function (props) {
1592 $.extend(this.data, props);
1593 this.$el = $(this.tmpl());
1594 },
1595 initialize: function () {
1596 // render
1597 this.render();
1598
1599 // append
1600 this.show();
1601
1602 // position
1603 this.position();
1604
1605 // timeout
1606 var timeout = this.get('timeout');
1607 if (timeout) {
1608 setTimeout($.proxy(this.fade, this), timeout);
1609 }
1610 },
1611 update: function (props) {
1612 $.extend(this.data, props);
1613 this.initialize();
1614 },
1615 render: function () {
1616 this.$el.text(this.get('text'));
1617 },
1618 show: function () {
1619 $('body').append(this.$el);
1620 },
1621 hide: function () {
1622 this.$el.remove();
1623 },
1624 fade: function () {
1625 // add class
1626 this.$el.addClass('acf-fade-up');
1627
1628 // remove
1629 this.setTimeout(function () {
1630 this.remove();
1631 }, 250);
1632 },
1633 html: function (html) {
1634 this.$el.html(html);
1635 },
1636 position: function () {
1637 // vars
1638 var $tooltip = this.$el;
1639 var $target = this.get('target');
1640 if (!$target) return;
1641
1642 // Reset position.
1643 $tooltip.removeClass('right left bottom top').css({
1644 top: 0,
1645 left: 0
1646 });
1647
1648 // Declare tolerance to edge of screen.
1649 var tolerance = 10;
1650
1651 // Find target position.
1652 var targetWidth = $target.outerWidth();
1653 var targetHeight = $target.outerHeight();
1654 var targetTop = $target.offset().top;
1655 var targetLeft = $target.offset().left;
1656
1657 // Find tooltip position.
1658 var tooltipWidth = $tooltip.outerWidth();
1659 var tooltipHeight = $tooltip.outerHeight();
1660 var tooltipTop = $tooltip.offset().top; // Should be 0, but WP media grid causes this to be 32 (toolbar padding).
1661
1662 // Assume default top alignment.
1663 var top = targetTop - tooltipHeight - tooltipTop;
1664 var left = targetLeft + targetWidth / 2 - tooltipWidth / 2;
1665
1666 // Check if too far left.
1667 if (left < tolerance) {
1668 $tooltip.addClass('right');
1669 left = targetLeft + targetWidth;
1670 top = targetTop + targetHeight / 2 - tooltipHeight / 2 - tooltipTop;
1671
1672 // Check if too far right.
1673 } else if (left + tooltipWidth + tolerance > $(window).width()) {
1674 $tooltip.addClass('left');
1675 left = targetLeft - tooltipWidth;
1676 top = targetTop + targetHeight / 2 - tooltipHeight / 2 - tooltipTop;
1677
1678 // Check if too far up.
1679 } else if (top - $(window).scrollTop() < tolerance) {
1680 $tooltip.addClass('bottom');
1681 top = targetTop + targetHeight - tooltipTop;
1682
1683 // No collision with edges.
1684 } else {
1685 $tooltip.addClass('top');
1686 }
1687
1688 // update css
1689 $tooltip.css({
1690 top: top,
1691 left: left
1692 });
1693 }
1694 });
1695 var TooltipConfirm = Tooltip.extend({
1696 data: {
1697 text: '',
1698 textConfirm: '',
1699 textCancel: '',
1700 target: null,
1701 targetConfirm: true,
1702 confirm: function () {},
1703 cancel: function () {},
1704 context: false
1705 },
1706 events: {
1707 'click [data-event="cancel"]': 'onCancel',
1708 'click [data-event="confirm"]': 'onConfirm'
1709 },
1710 addEvents: function () {
1711 // add events
1712 acf.Model.prototype.addEvents.apply(this);
1713
1714 // vars
1715 var $document = $(document);
1716 var $target = this.get('target');
1717
1718 // add global 'cancel' click event
1719 // - use timeout to avoid the current 'click' event triggering the onCancel function
1720 this.setTimeout(function () {
1721 this.on($document, 'click', 'onCancel');
1722 });
1723
1724 // add target 'confirm' click event
1725 // - allow setting to control this feature
1726 if (this.get('targetConfirm')) {
1727 this.on($target, 'click', 'onConfirm');
1728 }
1729 },
1730 removeEvents: function () {
1731 // remove events
1732 acf.Model.prototype.removeEvents.apply(this);
1733
1734 // vars
1735 var $document = $(document);
1736 var $target = this.get('target');
1737
1738 // remove custom events
1739 this.off($document, 'click');
1740 this.off($target, 'click');
1741 },
1742 render: function () {
1743 // defaults
1744 var text = this.get('text') || acf.__('Are you sure?');
1745 var textConfirm = this.get('textConfirm') || acf.__('Yes');
1746 var textCancel = this.get('textCancel') || acf.__('No');
1747
1748 // html
1749 var html = [text, '<a href="#" data-event="confirm">' + textConfirm + '</a>', '<a href="#" data-event="cancel">' + textCancel + '</a>'].join(' ');
1750
1751 // html
1752 this.html(html);
1753
1754 // class
1755 this.$el.addClass('-confirm');
1756 },
1757 onCancel: function (e, $el) {
1758 // prevent default
1759 e.preventDefault();
1760 e.stopImmediatePropagation();
1761
1762 // callback
1763 var callback = this.get('cancel');
1764 var context = this.get('context') || this;
1765 callback.apply(context, arguments);
1766
1767 //remove
1768 this.remove();
1769 },
1770 onConfirm: function (e, $el) {
1771 // Prevent event from propagating completely to allow "targetConfirm" to be clicked.
1772 e.preventDefault();
1773 e.stopImmediatePropagation();
1774
1775 // callback
1776 var callback = this.get('confirm');
1777 var context = this.get('context') || this;
1778 callback.apply(context, arguments);
1779
1780 //remove
1781 this.remove();
1782 }
1783 });
1784
1785 // storage
1786 acf.models.Tooltip = Tooltip;
1787 acf.models.TooltipConfirm = TooltipConfirm;
1788
1789 /**
1790 * tooltipManager
1791 *
1792 * description
1793 *
1794 * @date 17/4/18
1795 * @since ACF 5.6.9
1796 *
1797 * @param type $var Description. Default.
1798 * @return type Description.
1799 */
1800
1801 var tooltipHoverHelper = new acf.Model({
1802 tooltip: false,
1803 events: {
1804 'mouseenter .acf-js-tooltip': 'showTitle',
1805 'mouseup .acf-js-tooltip': 'hideTitle',
1806 'mouseleave .acf-js-tooltip': 'hideTitle',
1807 'focus .acf-js-tooltip': 'showTitle',
1808 'blur .acf-js-tooltip': 'hideTitle',
1809 'keyup .acf-js-tooltip': 'onKeyUp'
1810 },
1811 showTitle: function (e, $el) {
1812 // vars
1813 var title = $el.attr('title');
1814
1815 // bail early if no title
1816 if (!title) {
1817 return;
1818 }
1819
1820 // clear title to avoid default browser tooltip
1821 $el.attr('title', '');
1822
1823 // create
1824 if (!this.tooltip) {
1825 this.tooltip = acf.newTooltip({
1826 text: title,
1827 target: $el
1828 });
1829
1830 // update
1831 } else {
1832 this.tooltip.update({
1833 text: title,
1834 target: $el
1835 });
1836 }
1837 },
1838 hideTitle: function (e, $el) {
1839 // hide tooltip
1840 this.tooltip.hide();
1841
1842 // restore title
1843 $el.attr('title', this.tooltip.get('text'));
1844 },
1845 onKeyUp: function (e, $el) {
1846 if ('Escape' === e.key) {
1847 this.hideTitle(e, $el);
1848 }
1849 }
1850 });
1851 })(jQuery);
1852
1853 /***/ }),
1854
1855 /***/ "./assets/src/js/_acf.js":
1856 /*!*******************************!*\
1857 !*** ./assets/src/js/_acf.js ***!
1858 \*******************************/
1859 /***/ (() => {
1860
1861 (function ($, undefined) {
1862 /**
1863 * acf
1864 *
1865 * description
1866 *
1867 * @date 14/12/17
1868 * @since ACF 5.6.5
1869 *
1870 * @param type $var Description. Default.
1871 * @return type Description.
1872 */
1873
1874 // The global acf object
1875 var acf = {};
1876
1877 // Set as a browser global
1878 window.acf = acf;
1879
1880 /** @var object Data sent from PHP */
1881 acf.data = {};
1882
1883 /**
1884 * get
1885 *
1886 * Gets a specific data value
1887 *
1888 * @date 14/12/17
1889 * @since ACF 5.6.5
1890 *
1891 * @param string name
1892 * @return mixed
1893 */
1894
1895 acf.get = function (name) {
1896 return this.data[name] || null;
1897 };
1898
1899 /**
1900 * has
1901 *
1902 * Returns `true` if the data exists and is not null
1903 *
1904 * @date 14/12/17
1905 * @since ACF 5.6.5
1906 *
1907 * @param string name
1908 * @return boolean
1909 */
1910
1911 acf.has = function (name) {
1912 return this.get(name) !== null;
1913 };
1914
1915 /**
1916 * set
1917 *
1918 * Sets a specific data value
1919 *
1920 * @date 14/12/17
1921 * @since ACF 5.6.5
1922 *
1923 * @param string name
1924 * @param mixed value
1925 * @return this
1926 */
1927
1928 acf.set = function (name, value) {
1929 this.data[name] = value;
1930 return this;
1931 };
1932
1933 /**
1934 * uniqueId
1935 *
1936 * Returns a unique ID
1937 *
1938 * @date 9/11/17
1939 * @since ACF 5.6.3
1940 *
1941 * @param string prefix Optional prefix.
1942 * @return string
1943 */
1944
1945 var idCounter = 0;
1946 acf.uniqueId = function (prefix) {
1947 var id = ++idCounter + '';
1948 return prefix ? prefix + id : id;
1949 };
1950
1951 /**
1952 * acf.uniqueArray
1953 *
1954 * Returns a new array with only unique values
1955 * Credit: https://stackoverflow.com/questions/1960473/get-all-unique-values-in-an-array-remove-duplicates
1956 *
1957 * @date 23/3/18
1958 * @since ACF 5.6.9
1959 *
1960 * @param type $var Description. Default.
1961 * @return type Description.
1962 */
1963
1964 acf.uniqueArray = function (array) {
1965 function onlyUnique(value, index, self) {
1966 return self.indexOf(value) === index;
1967 }
1968 return array.filter(onlyUnique);
1969 };
1970
1971 /**
1972 * uniqid
1973 *
1974 * Returns a unique ID (PHP version)
1975 *
1976 * @date 9/11/17
1977 * @since ACF 5.6.3
1978 * @source http://locutus.io/php/misc/uniqid/
1979 *
1980 * @param string prefix Optional prefix.
1981 * @return string
1982 */
1983
1984 var uniqidSeed = '';
1985 acf.uniqid = function (prefix, moreEntropy) {
1986 // discuss at: http://locutus.io/php/uniqid/
1987 // original by: Kevin van Zonneveld (http://kvz.io)
1988 // revised by: Kankrelune (http://www.webfaktory.info/)
1989 // note 1: Uses an internal counter (in locutus global) to avoid collision
1990 // example 1: var $id = uniqid()
1991 // example 1: var $result = $id.length === 13
1992 // returns 1: true
1993 // example 2: var $id = uniqid('foo')
1994 // example 2: var $result = $id.length === (13 + 'foo'.length)
1995 // returns 2: true
1996 // example 3: var $id = uniqid('bar', true)
1997 // example 3: var $result = $id.length === (23 + 'bar'.length)
1998 // returns 3: true
1999 if (typeof prefix === 'undefined') {
2000 prefix = '';
2001 }
2002 var retId;
2003 var formatSeed = function (seed, reqWidth) {
2004 seed = parseInt(seed, 10).toString(16); // to hex str
2005 if (reqWidth < seed.length) {
2006 // so long we split
2007 return seed.slice(seed.length - reqWidth);
2008 }
2009 if (reqWidth > seed.length) {
2010 // so short we pad
2011 return Array(1 + (reqWidth - seed.length)).join('0') + seed;
2012 }
2013 return seed;
2014 };
2015 if (!uniqidSeed) {
2016 // init seed with big random int
2017 uniqidSeed = Math.floor(Math.random() * 0x75bcd15);
2018 }
2019 uniqidSeed++;
2020 retId = prefix; // start with prefix, add current milliseconds hex string
2021 retId += formatSeed(parseInt(new Date().getTime() / 1000, 10), 8);
2022 retId += formatSeed(uniqidSeed, 5); // add seed hex string
2023 if (moreEntropy) {
2024 // for more entropy we add a float lower to 10
2025 retId += (Math.random() * 10).toFixed(8).toString();
2026 }
2027 return retId;
2028 };
2029
2030 /**
2031 * strReplace
2032 *
2033 * Performs a string replace
2034 *
2035 * @date 14/12/17
2036 * @since ACF 5.6.5
2037 *
2038 * @param string search
2039 * @param string replace
2040 * @param string subject
2041 * @return string
2042 */
2043
2044 acf.strReplace = function (search, replace, subject) {
2045 return subject.split(search).join(replace);
2046 };
2047
2048 /**
2049 * strCamelCase
2050 *
2051 * Converts a string into camelCase
2052 * Thanks to https://stackoverflow.com/questions/2970525/converting-any-string-into-camel-case
2053 *
2054 * @date 14/12/17
2055 * @since ACF 5.6.5
2056 *
2057 * @param string str
2058 * @return string
2059 */
2060
2061 acf.strCamelCase = function (str) {
2062 var matches = str.match(/([a-zA-Z0-9]+)/g);
2063 return matches ? matches.map(function (s, i) {
2064 var c = s.charAt(0);
2065 return (i === 0 ? c.toLowerCase() : c.toUpperCase()) + s.slice(1);
2066 }).join('') : '';
2067 };
2068
2069 /**
2070 * strPascalCase
2071 *
2072 * Converts a string into PascalCase
2073 * Thanks to https://stackoverflow.com/questions/1026069/how-do-i-make-the-first-letter-of-a-string-uppercase-in-javascript
2074 *
2075 * @date 14/12/17
2076 * @since ACF 5.6.5
2077 *
2078 * @param string str
2079 * @return string
2080 */
2081
2082 acf.strPascalCase = function (str) {
2083 var camel = acf.strCamelCase(str);
2084 return camel.charAt(0).toUpperCase() + camel.slice(1);
2085 };
2086
2087 /**
2088 * acf.strSlugify
2089 *
2090 * Converts a string into a HTML class friendly slug
2091 *
2092 * @date 21/3/18
2093 * @since ACF 5.6.9
2094 *
2095 * @param string str
2096 * @return string
2097 */
2098
2099 acf.strSlugify = function (str) {
2100 return acf.strReplace('_', '-', str.toLowerCase());
2101 };
2102 acf.strSanitize = function (str, toLowerCase = true) {
2103 // chars (https://jsperf.com/replace-foreign-characters)
2104 var map = {
2105 À: 'A',
2106 Á: 'A',
2107 Â: 'A',
2108 Ã: 'A',
2109 Ä: 'A',
2110
2111 : 'A',
2112 Æ: 'AE',
2113 Ç: 'C',
2114 È: 'E',
2115 É: 'E',
2116 Ê: 'E',
2117 Ë: 'E',
2118 Ì: 'I',
2119 Í: 'I',
2120 Î: 'I',
2121 Ï: 'I',
2122 Ð: 'D',
2123 Ñ: 'N',
2124 Ò: 'O',
2125 Ó: 'O',
2126 Ô: 'O',
2127 Õ: 'O',
2128 Ö: 'O',
2129 Ø: 'O',
2130 Ù: 'U',
2131 Ú: 'U',
2132 Û: 'U',
2133 Ü: 'U',
2134 Ý: 'Y',
2135 ß: 's',
2136 à: 'a',
2137 á: 'a',
2138 â: 'a',
2139 ã: 'a',
2140 ä: 'a',
2141 å: 'a',
2142 æ: 'ae',
2143 ç: 'c',
2144 è: 'e',
2145 é: 'e',
2146 ê: 'e',
2147 ë: 'e',
2148 ì: 'i',
2149 í: 'i',
2150 î: 'i',
2151 ï: 'i',
2152 ñ: 'n',
2153 ò: 'o',
2154 ó: 'o',
2155 ô: 'o',
2156 õ: 'o',
2157 ö: 'o',
2158 ø: 'o',
2159 ù: 'u',
2160 ú: 'u',
2161 û: 'u',
2162 ü: 'u',
2163 ý: 'y',
2164 ÿ: 'y',
2165 Ā: 'A',
2166 ā: 'a',
2167 Ă: 'A',
2168 ă: 'a',
2169 Ą: 'A',
2170
2171 : 'a',
2172 Ć: 'C',
2173 ć: 'c',
2174 Ĉ: 'C',
2175 ĉ: 'c',
2176 Ċ: 'C',
2177 ċ: 'c',
2178 Č: 'C',
2179 č: 'c',
2180 Ď: 'D',
2181 ď: 'd',
2182 Đ: 'D',
2183 đ: 'd',
2184 Ē: 'E',
2185 ē: 'e',
2186 Ĕ: 'E',
2187 ĕ: 'e',
2188 Ė: 'E',
2189 ė: 'e',
2190 Ę: 'E',
2191 ę: 'e',
2192 Ě: 'E',
2193 ě: 'e',
2194 Ĝ: 'G',
2195 ĝ: 'g',
2196 Ğ: 'G',
2197 ğ: 'g',
2198 Ġ: 'G',
2199 ġ: 'g',
2200 Ģ: 'G',
2201 ģ: 'g',
2202 Ĥ: 'H',
2203 ĥ: 'h',
2204 Ħ: 'H',
2205 ħ: 'h',
2206 Ĩ: 'I',
2207 ĩ: 'i',
2208 Ī: 'I',
2209 ī: 'i',
2210 Ĭ: 'I',
2211 ĭ: 'i',
2212 Į: 'I',
2213 į: 'i',
2214 İ: 'I',
2215 ı: 'i',
2216 IJ: 'IJ',
2217 ij: 'ij',
2218 Ĵ: 'J',
2219 ĵ: 'j',
2220 Ķ: 'K',
2221 ķ: 'k',
2222 Ĺ: 'L',
2223 ĺ: 'l',
2224 Ļ: 'L',
2225 ļ: 'l',
2226 Ľ: 'L',
2227 ľ: 'l',
2228 Ŀ: 'L',
2229 ŀ: 'l',
2230 Ł: 'l',
2231 ł: 'l',
2232 Ń: 'N',
2233 ń: 'n',
2234
2235 : 'N',
2236 ņ: 'n',
2237 Ň: 'N',
2238 ň: 'n',
2239 ʼn: 'n',
2240 Ō: 'O',
2241 ō: 'o',
2242 Ŏ: 'O',
2243 ŏ: 'o',
2244 Ő: 'O',
2245 ő: 'o',
2246 Œ: 'OE',
2247 œ: 'oe',
2248 Ŕ: 'R',
2249 ŕ: 'r',
2250 Ŗ: 'R',
2251 ŗ: 'r',
2252 Ř: 'R',
2253 ř: 'r',
2254 Ś: 'S',
2255 ś: 's',
2256 Ŝ: 'S',
2257 ŝ: 's',
2258 Ş: 'S',
2259 ş: 's',
2260 Š: 'S',
2261 š: 's',
2262 Ţ: 'T',
2263 ţ: 't',
2264 Ť: 'T',
2265 ť: 't',
2266 Ŧ: 'T',
2267 ŧ: 't',
2268 Ũ: 'U',
2269 ũ: 'u',
2270 Ū: 'U',
2271 ū: 'u',
2272 Ŭ: 'U',
2273 ŭ: 'u',
2274 Ů: 'U',
2275 ů: 'u',
2276 Ű: 'U',
2277 ű: 'u',
2278 Ų: 'U',
2279 ų: 'u',
2280 Ŵ: 'W',
2281 ŵ: 'w',
2282 Ŷ: 'Y',
2283 ŷ: 'y',
2284 Ÿ: 'Y',
2285 Ź: 'Z',
2286 ź: 'z',
2287 Ż: 'Z',
2288 ż: 'z',
2289 Ž: 'Z',
2290 ž: 'z',
2291 ſ: 's',
2292 ƒ: 'f',
2293 Ơ: 'O',
2294 ơ: 'o',
2295 Ư: 'U',
2296 ư: 'u',
2297 Ǎ: 'A',
2298 ǎ: 'a',
2299 Ǐ: 'I',
2300 ǐ: 'i',
2301 Ǒ: 'O',
2302 ǒ: 'o',
2303 Ǔ: 'U',
2304 ǔ: 'u',
2305 Ǖ: 'U',
2306 ǖ: 'u',
2307 Ǘ: 'U',
2308 ǘ: 'u',
2309 Ǚ: 'U',
2310 ǚ: 'u',
2311 Ǜ: 'U',
2312 ǜ: 'u',
2313 Ǻ: 'A',
2314 ǻ: 'a',
2315 Ǽ: 'AE',
2316 ǽ: 'ae',
2317 Ǿ: 'O',
2318 ǿ: 'o',
2319 // extra
2320 ' ': '_',
2321 "'": '',
2322 '?': '',
2323 '/': '',
2324 '\\': '',
2325 '.': '',
2326 ',': '',
2327 '`': '',
2328 '>': '',
2329 '<': '',
2330 '"': '',
2331 '[': '',
2332 ']': '',
2333 '|': '',
2334 '{': '',
2335 '}': '',
2336 '(': '',
2337 ')': ''
2338 };
2339
2340 // vars
2341 var nonWord = /\W/g;
2342 var mapping = function (c) {
2343 return map[c] !== undefined ? map[c] : c;
2344 };
2345
2346 // replace
2347 str = str.replace(nonWord, mapping);
2348
2349 // lowercase
2350 if (toLowerCase) {
2351 str = str.toLowerCase();
2352 }
2353
2354 // return
2355 return str;
2356 };
2357
2358 /**
2359 * acf.strMatch
2360 *
2361 * Returns the number of characters that match between two strings
2362 *
2363 * @date 1/2/18
2364 * @since ACF 5.6.5
2365 *
2366 * @param type $var Description. Default.
2367 * @return type Description.
2368 */
2369
2370 acf.strMatch = function (s1, s2) {
2371 // vars
2372 var val = 0;
2373 var min = Math.min(s1.length, s2.length);
2374
2375 // loop
2376 for (var i = 0; i < min; i++) {
2377 if (s1[i] !== s2[i]) {
2378 break;
2379 }
2380 val++;
2381 }
2382
2383 // return
2384 return val;
2385 };
2386
2387 /**
2388 * Escapes HTML entities from a string.
2389 *
2390 * @date 08/06/2020
2391 * @since ACF 5.9.0
2392 *
2393 * @param string string The input string.
2394 * @return string
2395 */
2396 acf.strEscape = function (string) {
2397 var htmlEscapes = {
2398 '&': '&amp;',
2399 '<': '&lt;',
2400 '>': '&gt;',
2401 '"': '&quot;',
2402 "'": '&#39;'
2403 };
2404 return ('' + string).replace(/[&<>"']/g, function (chr) {
2405 return htmlEscapes[chr];
2406 });
2407 };
2408
2409 // Tests.
2410 //console.log( acf.strEscape('Test 1') );
2411 //console.log( acf.strEscape('Test & 1') );
2412 //console.log( acf.strEscape('Test\'s &amp; 1') );
2413 //console.log( acf.strEscape('<script>js</script>') );
2414
2415 /**
2416 * Unescapes HTML entities from a string.
2417 *
2418 * @date 08/06/2020
2419 * @since ACF 5.9.0
2420 *
2421 * @param string string The input string.
2422 * @return string
2423 */
2424 acf.strUnescape = function (string) {
2425 var htmlUnescapes = {
2426 '&amp;': '&',
2427 '&lt;': '<',
2428 '&gt;': '>',
2429 '&quot;': '"',
2430 '&#39;': "'"
2431 };
2432 return ('' + string).replace(/&amp;|&lt;|&gt;|&quot;|&#39;/g, function (entity) {
2433 return htmlUnescapes[entity];
2434 });
2435 };
2436
2437 // Tests.
2438 //console.log( acf.strUnescape( acf.strEscape('Test 1') ) );
2439 //console.log( acf.strUnescape( acf.strEscape('Test & 1') ) );
2440 //console.log( acf.strUnescape( acf.strEscape('Test\'s &amp; 1') ) );
2441 //console.log( acf.strUnescape( acf.strEscape('<script>js</script>') ) );
2442
2443 /**
2444 * Escapes HTML entities from a string.
2445 *
2446 * @date 08/06/2020
2447 * @since ACF 5.9.0
2448 *
2449 * @param string string The input string.
2450 * @return string
2451 */
2452 acf.escAttr = acf.strEscape;
2453
2454 /**
2455 * Encodes <script> tags for safe HTML output.
2456 *
2457 * @date 08/06/2020
2458 * @since ACF 5.9.0
2459 *
2460 * @param string string The input string.
2461 * @return string
2462 */
2463 acf.escHtml = function (string) {
2464 return ('' + string).replace(/<script|<\/script/g, function (html) {
2465 return acf.strEscape(html);
2466 });
2467 };
2468
2469 // Tests.
2470 //console.log( acf.escHtml('<script>js</script>') );
2471 //console.log( acf.escHtml( acf.strEscape('<script>js</script>') ) );
2472 //console.log( acf.escHtml( '<script>js1</script><script>js2</script>' ) );
2473
2474 /**
2475 * Encode a string potentially containing HTML into it's HTML entities equivalent.
2476 *
2477 * @since ACF 6.3.6
2478 *
2479 * @param {string} string String to encode.
2480 * @return {string} The encoded string
2481 */
2482 acf.encode = function (string) {
2483 return $('<textarea/>').text(string).html();
2484 };
2485
2486 /**
2487 * Decode a HTML encoded string into it's original form.
2488 *
2489 * @since ACF 5.6.5
2490 *
2491 * @param {string} string String to encode.
2492 * @return {string} The encoded string
2493 */
2494 acf.decode = function (string) {
2495 return $('<textarea/>').html(string).text();
2496 };
2497
2498 /**
2499 * parseArgs
2500 *
2501 * Merges together defaults and args much like the WP wp_parse_args function
2502 *
2503 * @date 14/12/17
2504 * @since ACF 5.6.5
2505 *
2506 * @param object args
2507 * @param object defaults
2508 * @return object
2509 */
2510
2511 acf.parseArgs = function (args, defaults) {
2512 if (typeof args !== 'object') args = {};
2513 if (typeof defaults !== 'object') defaults = {};
2514 return $.extend({}, defaults, args);
2515 };
2516
2517 /**
2518 * __
2519 *
2520 * Retrieve the translation of $text.
2521 *
2522 * @date 16/4/18
2523 * @since ACF 5.6.9
2524 *
2525 * @param string text Text to translate.
2526 * @return string Translated text.
2527 */
2528
2529 // Make sure a global acfL10n object exists to prevent errors in other scopes
2530 window.acfL10n = window.acfL10n || {};
2531 acf.__ = function (text) {
2532 return acfL10n[text] || text;
2533 };
2534
2535 /**
2536 * _x
2537 *
2538 * Retrieve translated string with gettext context.
2539 *
2540 * @date 16/4/18
2541 * @since ACF 5.6.9
2542 *
2543 * @param string text Text to translate.
2544 * @param string context Context information for the translators.
2545 * @return string Translated text.
2546 */
2547
2548 acf._x = function (text, context) {
2549 return acfL10n[text + '.' + context] || acfL10n[text] || text;
2550 };
2551
2552 /**
2553 * _n
2554 *
2555 * Retrieve the plural or single form based on the amount.
2556 *
2557 * @date 16/4/18
2558 * @since ACF 5.6.9
2559 *
2560 * @param string single Single text to translate.
2561 * @param string plural Plural text to translate.
2562 * @param int number The number to compare against.
2563 * @return string Translated text.
2564 */
2565
2566 acf._n = function (single, plural, number) {
2567 if (number == 1) {
2568 return acf.__(single);
2569 } else {
2570 return acf.__(plural);
2571 }
2572 };
2573 acf.isArray = function (a) {
2574 return Array.isArray(a);
2575 };
2576 acf.isObject = function (a) {
2577 return typeof a === 'object';
2578 };
2579
2580 /**
2581 * serialize
2582 *
2583 * description
2584 *
2585 * @date 24/12/17
2586 * @since ACF 5.6.5
2587 *
2588 * @param type $var Description. Default.
2589 * @return type Description.
2590 */
2591
2592 var buildObject = function (obj, name, value) {
2593 // replace [] with placeholder
2594 name = name.replace('[]', '[%%index%%]');
2595
2596 // vars
2597 var keys = name.match(/([^\[\]])+/g);
2598 if (!keys) return;
2599 var length = keys.length;
2600 var ref = obj;
2601
2602 // loop
2603 for (var i = 0; i < length; i++) {
2604 // vars
2605 var key = String(keys[i]);
2606
2607 // value
2608 if (i == length - 1) {
2609 // %%index%%
2610 if (key === '%%index%%') {
2611 ref.push(value);
2612
2613 // default
2614 } else {
2615 ref[key] = value;
2616 }
2617
2618 // path
2619 } else {
2620 // array
2621 if (keys[i + 1] === '%%index%%') {
2622 if (!acf.isArray(ref[key])) {
2623 ref[key] = [];
2624 }
2625
2626 // object
2627 } else {
2628 if (!acf.isObject(ref[key])) {
2629 ref[key] = {};
2630 }
2631 }
2632
2633 // crawl
2634 ref = ref[key];
2635 }
2636 }
2637 };
2638 acf.serialize = function ($el, prefix) {
2639 // vars
2640 var obj = {};
2641 var inputs = acf.serializeArray($el);
2642
2643 // prefix
2644 if (prefix !== undefined) {
2645 // filter and modify
2646 inputs = inputs.filter(function (item) {
2647 return item.name.indexOf(prefix) === 0;
2648 }).map(function (item) {
2649 item.name = item.name.slice(prefix.length);
2650 return item;
2651 });
2652 }
2653
2654 // loop
2655 for (var i = 0; i < inputs.length; i++) {
2656 buildObject(obj, inputs[i].name, inputs[i].value);
2657 }
2658
2659 // return
2660 return obj;
2661 };
2662
2663 /**
2664 * acf.serializeArray
2665 *
2666 * Similar to $.serializeArray() but works with a parent wrapping element.
2667 *
2668 * @date 19/8/18
2669 * @since ACF 5.7.3
2670 *
2671 * @param jQuery $el The element or form to serialize.
2672 * @return array
2673 */
2674
2675 acf.serializeArray = function ($el) {
2676 return $el.find('select, textarea, input').serializeArray();
2677 };
2678
2679 /**
2680 * acf.serializeForAjax
2681 *
2682 * Returns an object containing name => value data ready to be encoded for Ajax.
2683 *
2684 * @date 17/12/18
2685 * @since ACF 5.8.0
2686 *
2687 * @param jQuery $el The element or form to serialize.
2688 * @return object
2689 */
2690 acf.serializeForAjax = function ($el) {
2691 // vars
2692 var data = {};
2693 var index = {};
2694
2695 // Serialize inputs.
2696 var inputs = acf.serializeArray($el);
2697
2698 // Loop over inputs and build data.
2699 inputs.map(function (item) {
2700 // Append to array.
2701 if (item.name.slice(-2) === '[]') {
2702 data[item.name] = data[item.name] || [];
2703 data[item.name].push(item.value);
2704 // Append
2705 } else {
2706 data[item.name] = item.value;
2707 }
2708 });
2709
2710 // return
2711 return data;
2712 };
2713
2714 /**
2715 * addAction
2716 *
2717 * Wrapper for acf.hooks.addAction
2718 *
2719 * @date 14/12/17
2720 * @since ACF 5.6.5
2721 *
2722 * @param n/a
2723 * @return this
2724 */
2725
2726 /*
2727 var prefixAction = function( action ){
2728 return 'acf_' + action;
2729 }
2730 */
2731
2732 acf.addAction = function (action, callback, priority, context) {
2733 //action = prefixAction(action);
2734 acf.hooks.addAction.apply(this, arguments);
2735 return this;
2736 };
2737
2738 /**
2739 * removeAction
2740 *
2741 * Wrapper for acf.hooks.removeAction
2742 *
2743 * @date 14/12/17
2744 * @since ACF 5.6.5
2745 *
2746 * @param n/a
2747 * @return this
2748 */
2749
2750 acf.removeAction = function (action, callback) {
2751 //action = prefixAction(action);
2752 acf.hooks.removeAction.apply(this, arguments);
2753 return this;
2754 };
2755
2756 /**
2757 * doAction
2758 *
2759 * Wrapper for acf.hooks.doAction
2760 *
2761 * @date 14/12/17
2762 * @since ACF 5.6.5
2763 *
2764 * @param n/a
2765 * @return this
2766 */
2767
2768 var actionHistory = {};
2769 //var currentAction = false;
2770 acf.doAction = function (action) {
2771 //action = prefixAction(action);
2772 //currentAction = action;
2773 actionHistory[action] = 1;
2774 acf.hooks.doAction.apply(this, arguments);
2775 actionHistory[action] = 0;
2776 return this;
2777 };
2778
2779 /**
2780 * doingAction
2781 *
2782 * Return true if doing action
2783 *
2784 * @date 14/12/17
2785 * @since ACF 5.6.5
2786 *
2787 * @param n/a
2788 * @return this
2789 */
2790
2791 acf.doingAction = function (action) {
2792 //action = prefixAction(action);
2793 return actionHistory[action] === 1;
2794 };
2795
2796 /**
2797 * didAction
2798 *
2799 * Wrapper for acf.hooks.doAction
2800 *
2801 * @date 14/12/17
2802 * @since ACF 5.6.5
2803 *
2804 * @param n/a
2805 * @return this
2806 */
2807
2808 acf.didAction = function (action) {
2809 //action = prefixAction(action);
2810 return actionHistory[action] !== undefined;
2811 };
2812
2813 /**
2814 * currentAction
2815 *
2816 * Wrapper for acf.hooks.doAction
2817 *
2818 * @date 14/12/17
2819 * @since ACF 5.6.5
2820 *
2821 * @param n/a
2822 * @return this
2823 */
2824
2825 acf.currentAction = function () {
2826 for (var k in actionHistory) {
2827 if (actionHistory[k]) {
2828 return k;
2829 }
2830 }
2831 return false;
2832 };
2833
2834 /**
2835 * addFilter
2836 *
2837 * Wrapper for acf.hooks.addFilter
2838 *
2839 * @date 14/12/17
2840 * @since ACF 5.6.5
2841 *
2842 * @param n/a
2843 * @return this
2844 */
2845
2846 acf.addFilter = function (action) {
2847 //action = prefixAction(action);
2848 acf.hooks.addFilter.apply(this, arguments);
2849 return this;
2850 };
2851
2852 /**
2853 * removeFilter
2854 *
2855 * Wrapper for acf.hooks.removeFilter
2856 *
2857 * @date 14/12/17
2858 * @since ACF 5.6.5
2859 *
2860 * @param n/a
2861 * @return this
2862 */
2863
2864 acf.removeFilter = function (action) {
2865 //action = prefixAction(action);
2866 acf.hooks.removeFilter.apply(this, arguments);
2867 return this;
2868 };
2869
2870 /**
2871 * applyFilters
2872 *
2873 * Wrapper for acf.hooks.applyFilters
2874 *
2875 * @date 14/12/17
2876 * @since ACF 5.6.5
2877 *
2878 * @param n/a
2879 * @return this
2880 */
2881
2882 acf.applyFilters = function (action) {
2883 //action = prefixAction(action);
2884 return acf.hooks.applyFilters.apply(this, arguments);
2885 };
2886
2887 /**
2888 * getArgs
2889 *
2890 * description
2891 *
2892 * @date 15/12/17
2893 * @since ACF 5.6.5
2894 *
2895 * @param type $var Description. Default.
2896 * @return type Description.
2897 */
2898
2899 acf.arrayArgs = function (args) {
2900 return Array.prototype.slice.call(args);
2901 };
2902
2903 /**
2904 * extendArgs
2905 *
2906 * description
2907 *
2908 * @date 15/12/17
2909 * @since ACF 5.6.5
2910 *
2911 * @param type $var Description. Default.
2912 * @return type Description.
2913 */
2914
2915 /*
2916 acf.extendArgs = function( ){
2917 var args = Array.prototype.slice.call( arguments );
2918 var realArgs = args.shift();
2919
2920 Array.prototype.push.call(arguments, 'bar')
2921 return Array.prototype.push.apply( args, arguments );
2922 };
2923 */
2924
2925 // Preferences
2926 // - use try/catch to avoid JS error if cookies are disabled on front-end form
2927 try {
2928 var preferences = JSON.parse(localStorage.getItem('acf')) || {};
2929 } catch (e) {
2930 var preferences = {};
2931 }
2932
2933 /**
2934 * getPreferenceName
2935 *
2936 * Gets the true preference name.
2937 * Converts "this.thing" to "thing-123" if editing post 123.
2938 *
2939 * @date 11/11/17
2940 * @since ACF 5.6.5
2941 *
2942 * @param string name
2943 * @return string
2944 */
2945
2946 var getPreferenceName = function (name) {
2947 if (name.substr(0, 5) === 'this.') {
2948 name = name.substr(5) + '-' + acf.get('post_id');
2949 }
2950 return name;
2951 };
2952
2953 /**
2954 * acf.getPreference
2955 *
2956 * Gets a preference setting or null if not set.
2957 *
2958 * @date 11/11/17
2959 * @since ACF 5.6.5
2960 *
2961 * @param string name
2962 * @return mixed
2963 */
2964
2965 acf.getPreference = function (name) {
2966 name = getPreferenceName(name);
2967 return preferences[name] || null;
2968 };
2969
2970 /**
2971 * acf.setPreference
2972 *
2973 * Sets a preference setting.
2974 *
2975 * @date 11/11/17
2976 * @since ACF 5.6.5
2977 *
2978 * @param string name
2979 * @param mixed value
2980 * @return n/a
2981 */
2982
2983 acf.setPreference = function (name, value) {
2984 name = getPreferenceName(name);
2985 if (value === null) {
2986 delete preferences[name];
2987 } else {
2988 preferences[name] = value;
2989 }
2990 localStorage.setItem('acf', JSON.stringify(preferences));
2991 };
2992
2993 /**
2994 * acf.removePreference
2995 *
2996 * Removes a preference setting.
2997 *
2998 * @date 11/11/17
2999 * @since ACF 5.6.5
3000 *
3001 * @param string name
3002 * @return n/a
3003 */
3004
3005 acf.removePreference = function (name) {
3006 acf.setPreference(name, null);
3007 };
3008
3009 /**
3010 * remove
3011 *
3012 * Removes an element with fade effect
3013 *
3014 * @date 1/1/18
3015 * @since ACF 5.6.5
3016 *
3017 * @param type $var Description. Default.
3018 * @return type Description.
3019 */
3020
3021 acf.remove = function (props) {
3022 // allow jQuery
3023 if (props instanceof jQuery) {
3024 props = {
3025 target: props
3026 };
3027 }
3028
3029 // defaults
3030 props = acf.parseArgs(props, {
3031 target: false,
3032 endHeight: 0,
3033 complete: function () {}
3034 });
3035
3036 // action
3037 acf.doAction('remove', props.target);
3038
3039 // tr
3040 if (props.target.is('tr')) {
3041 removeTr(props);
3042
3043 // div
3044 } else {
3045 removeDiv(props);
3046 }
3047 };
3048
3049 /**
3050 * removeDiv
3051 *
3052 * description
3053 *
3054 * @date 16/2/18
3055 * @since ACF 5.6.9
3056 *
3057 * @param type $var Description. Default.
3058 * @return type Description.
3059 */
3060
3061 var removeDiv = function (props) {
3062 // vars
3063 var $el = props.target;
3064 var height = $el.height();
3065 var width = $el.width();
3066 var margin = $el.css('margin');
3067 var outerHeight = $el.outerHeight(true);
3068 var style = $el.attr('style') + ''; // needed to copy
3069
3070 // wrap
3071 $el.wrap('<div class="acf-temp-remove" style="height:' + outerHeight + 'px"></div>');
3072 var $wrap = $el.parent();
3073
3074 // set pos
3075 $el.css({
3076 height: height,
3077 width: width,
3078 margin: margin,
3079 position: 'absolute'
3080 });
3081
3082 // fade wrap
3083 setTimeout(function () {
3084 $wrap.css({
3085 opacity: 0,
3086 height: props.endHeight
3087 });
3088 }, 50);
3089
3090 // remove
3091 setTimeout(function () {
3092 $el.attr('style', style);
3093 $wrap.remove();
3094 props.complete();
3095 }, 301);
3096 };
3097
3098 /**
3099 * removeTr
3100 *
3101 * description
3102 *
3103 * @date 16/2/18
3104 * @since ACF 5.6.9
3105 *
3106 * @param type $var Description. Default.
3107 * @return type Description.
3108 */
3109
3110 var removeTr = function (props) {
3111 // vars
3112 var $tr = props.target;
3113 var height = $tr.height();
3114 var children = $tr.children().length;
3115
3116 // create dummy td
3117 var $td = $('<td class="acf-temp-remove" style="padding:0; height:' + height + 'px" colspan="' + children + '"></td>');
3118
3119 // fade away tr
3120 $tr.addClass('acf-remove-element');
3121
3122 // update HTML after fade animation
3123 setTimeout(function () {
3124 $tr.html($td);
3125 }, 251);
3126
3127 // allow .acf-temp-remove to exist before changing CSS
3128 setTimeout(function () {
3129 // remove class
3130 $tr.removeClass('acf-remove-element');
3131
3132 // collapse
3133 $td.css({
3134 height: props.endHeight
3135 });
3136 }, 300);
3137
3138 // remove
3139 setTimeout(function () {
3140 $tr.remove();
3141 props.complete();
3142 }, 451);
3143 };
3144
3145 /**
3146 * duplicate
3147 *
3148 * description
3149 *
3150 * @date 3/1/18
3151 * @since ACF 5.6.5
3152 *
3153 * @param type $var Description. Default.
3154 * @return type Description.
3155 */
3156
3157 acf.duplicate = function (args) {
3158 // allow jQuery
3159 if (args instanceof jQuery) {
3160 args = {
3161 target: args
3162 };
3163 }
3164
3165 // defaults
3166 args = acf.parseArgs(args, {
3167 target: false,
3168 search: '',
3169 replace: '',
3170 rename: true,
3171 before: function ($el) {},
3172 after: function ($el, $el2) {},
3173 append: function ($el, $el2) {
3174 $el.after($el2);
3175 }
3176 });
3177
3178 // compatibility
3179 args.target = args.target || args.$el;
3180
3181 // vars
3182 var $el = args.target;
3183
3184 // search
3185 args.search = args.search || $el.attr('data-id');
3186 args.replace = args.replace || acf.uniqid();
3187
3188 // before
3189 // - allow acf to modify DOM
3190 // - fixes bug where select field option is not selected
3191 args.before($el);
3192 acf.doAction('before_duplicate', $el);
3193
3194 // clone
3195 var $el2 = $el.clone();
3196
3197 // rename
3198 if (args.rename) {
3199 acf.rename({
3200 target: $el2,
3201 search: args.search,
3202 replace: args.replace,
3203 replacer: typeof args.rename === 'function' ? args.rename : null
3204 });
3205 }
3206
3207 // remove classes
3208 $el2.removeClass('acf-clone');
3209 $el2.find('.ui-sortable').removeClass('ui-sortable');
3210
3211 // remove any initialised select2s prevent the duplicated object stealing the previous select2.
3212 $el2.find('[data-select2-id]').removeAttr('data-select2-id');
3213 $el2.find('.select2').remove();
3214
3215 // subfield select2 renames happen after init and contain a duplicated ID. force change those IDs to prevent this.
3216 $el2.find('.acf-is-subfields select[data-ui="1"]').each(function () {
3217 $(this).prop('id', $(this).prop('id').replace('acf_fields', acf.uniqid('duplicated_') + '_acf_fields'));
3218 });
3219
3220 // remove tab wrapper to ensure proper init
3221 $el2.find('.acf-field-settings > .acf-tab-wrap').remove();
3222
3223 // after
3224 // - allow acf to modify DOM
3225 args.after($el, $el2);
3226 acf.doAction('after_duplicate', $el, $el2);
3227
3228 // append
3229 args.append($el, $el2);
3230
3231 /**
3232 * Fires after an element has been duplicated and appended to the DOM.
3233 *
3234 * @date 30/10/19
3235 * @since ACF 5.8.7
3236 *
3237 * @param jQuery $el The original element.
3238 * @param jQuery $el2 The duplicated element.
3239 */
3240 acf.doAction('duplicate', $el, $el2);
3241
3242 // append
3243 acf.doAction('append', $el2);
3244
3245 // return
3246 return $el2;
3247 };
3248
3249 /**
3250 * rename
3251 *
3252 * description
3253 *
3254 * @date 7/1/18
3255 * @since ACF 5.6.5
3256 *
3257 * @param type $var Description. Default.
3258 * @return type Description.
3259 */
3260
3261 acf.rename = function (args) {
3262 // Allow jQuery param.
3263 if (args instanceof jQuery) {
3264 args = {
3265 target: args
3266 };
3267 }
3268
3269 // Apply default args.
3270 args = acf.parseArgs(args, {
3271 target: false,
3272 destructive: false,
3273 search: '',
3274 replace: '',
3275 replacer: null
3276 });
3277
3278 // Extract args.
3279 var $el = args.target;
3280
3281 // Provide backup for empty args.
3282 if (!args.search) {
3283 args.search = $el.attr('data-id');
3284 }
3285 if (!args.replace) {
3286 args.replace = acf.uniqid('acf');
3287 }
3288 if (!args.replacer) {
3289 args.replacer = function (name, value, search, replace) {
3290 return value.replace(search, replace);
3291 };
3292 }
3293
3294 // Callback function for jQuery replacing.
3295 var withReplacer = function (name) {
3296 return function (i, value) {
3297 return args.replacer(name, value, args.search, args.replace);
3298 };
3299 };
3300
3301 // Destructive Replace.
3302 if (args.destructive) {
3303 var html = acf.strReplace(args.search, args.replace, $el.outerHTML());
3304 $el.replaceWith(html);
3305
3306 // Standard Replace.
3307 } else {
3308 $el.attr('data-id', args.replace);
3309 $el.find('[id*="' + args.search + '"]').attr('id', withReplacer('id'));
3310 $el.find('[for*="' + args.search + '"]').attr('for', withReplacer('for'));
3311 $el.find('[name*="' + args.search + '"]').attr('name', withReplacer('name'));
3312 }
3313
3314 // return
3315 return $el;
3316 };
3317
3318 /**
3319 * Prepares AJAX data prior to being sent.
3320 *
3321 * @since ACF 5.6.5
3322 *
3323 * @param Object data The data to prepare
3324 * @param boolean use_global_nonce Should we ignore any nonce provided in the data object and force ACF's global nonce for this request
3325 * @return Object The prepared data.
3326 */
3327 acf.prepareForAjax = function (data, use_global_nonce = false) {
3328 // Set a default nonce if we don't have one already.
3329 if (use_global_nonce || 'undefined' === typeof data.nonce) {
3330 data.nonce = acf.get('nonce');
3331 }
3332 data.post_id = acf.get('post_id');
3333 if (acf.has('language')) {
3334 data.lang = acf.get('language');
3335 }
3336
3337 // Filter for 3rd party customization.
3338 data = acf.applyFilters('prepare_for_ajax', data);
3339 return data;
3340 };
3341
3342 /**
3343 * acf.startButtonLoading
3344 *
3345 * description
3346 *
3347 * @date 5/1/18
3348 * @since ACF 5.6.5
3349 *
3350 * @param type $var Description. Default.
3351 * @return type Description.
3352 */
3353
3354 acf.startButtonLoading = function ($el) {
3355 $el.prop('disabled', true);
3356 $el.after(' <i class="acf-loading"></i>');
3357 };
3358 acf.stopButtonLoading = function ($el) {
3359 $el.prop('disabled', false);
3360 $el.next('.acf-loading').remove();
3361 };
3362
3363 /**
3364 * acf.showLoading
3365 *
3366 * description
3367 *
3368 * @date 12/1/18
3369 * @since ACF 5.6.5
3370 *
3371 * @param type $var Description. Default.
3372 * @return type Description.
3373 */
3374
3375 acf.showLoading = function ($el) {
3376 $el.append('<div class="acf-loading-overlay"><i class="acf-loading"></i></div>');
3377 };
3378 acf.hideLoading = function ($el) {
3379 $el.children('.acf-loading-overlay').remove();
3380 };
3381
3382 /**
3383 * acf.updateUserSetting
3384 *
3385 * description
3386 *
3387 * @date 5/1/18
3388 * @since ACF 5.6.5
3389 *
3390 * @param type $var Description. Default.
3391 * @return type Description.
3392 */
3393
3394 acf.updateUserSetting = function (name, value) {
3395 var ajaxData = {
3396 action: 'acf/ajax/user_setting',
3397 name: name,
3398 value: value
3399 };
3400 $.ajax({
3401 url: acf.get('ajaxurl'),
3402 data: acf.prepareForAjax(ajaxData),
3403 type: 'post',
3404 dataType: 'html'
3405 });
3406 };
3407
3408 /**
3409 * acf.val
3410 *
3411 * description
3412 *
3413 * @date 8/1/18
3414 * @since ACF 5.6.5
3415 *
3416 * @param type $var Description. Default.
3417 * @return type Description.
3418 */
3419
3420 acf.val = function ($input, value, silent) {
3421 // vars
3422 var prevValue = $input.val();
3423
3424 // bail if no change
3425 if (value === prevValue) {
3426 return false;
3427 }
3428
3429 // update value
3430 $input.val(value);
3431
3432 // prevent select elements displaying blank value if option doesn't exist
3433 if ($input.is('select') && $input.val() === null) {
3434 $input.val(prevValue);
3435 return false;
3436 }
3437
3438 // update with trigger
3439 if (silent !== true) {
3440 $input.trigger('change');
3441 }
3442
3443 // return
3444 return true;
3445 };
3446
3447 /**
3448 * acf.show
3449 *
3450 * description
3451 *
3452 * @date 9/2/18
3453 * @since ACF 5.6.5
3454 *
3455 * @param type $var Description. Default.
3456 * @return type Description.
3457 */
3458
3459 acf.show = function ($el, lockKey) {
3460 // unlock
3461 if (lockKey) {
3462 acf.unlock($el, 'hidden', lockKey);
3463 }
3464
3465 // bail early if $el is still locked
3466 if (acf.isLocked($el, 'hidden')) {
3467 //console.log( 'still locked', getLocks( $el, 'hidden' ));
3468 return false;
3469 }
3470
3471 // $el is hidden, remove class and return true due to change in visibility
3472 if ($el.hasClass('acf-hidden')) {
3473 $el.removeClass('acf-hidden');
3474 return true;
3475
3476 // $el is visible, return false due to no change in visibility
3477 } else {
3478 return false;
3479 }
3480 };
3481
3482 /**
3483 * acf.hide
3484 *
3485 * description
3486 *
3487 * @date 9/2/18
3488 * @since ACF 5.6.5
3489 *
3490 * @param type $var Description. Default.
3491 * @return type Description.
3492 */
3493
3494 acf.hide = function ($el, lockKey) {
3495 // lock
3496 if (lockKey) {
3497 acf.lock($el, 'hidden', lockKey);
3498 }
3499
3500 // $el is hidden, return false due to no change in visibility
3501 if ($el.hasClass('acf-hidden')) {
3502 return false;
3503
3504 // $el is visible, add class and return true due to change in visibility
3505 } else {
3506 $el.addClass('acf-hidden');
3507 return true;
3508 }
3509 };
3510
3511 /**
3512 * acf.isHidden
3513 *
3514 * description
3515 *
3516 * @date 9/2/18
3517 * @since ACF 5.6.5
3518 *
3519 * @param type $var Description. Default.
3520 * @return type Description.
3521 */
3522
3523 acf.isHidden = function ($el) {
3524 return $el.hasClass('acf-hidden');
3525 };
3526
3527 /**
3528 * acf.isVisible
3529 *
3530 * description
3531 *
3532 * @date 9/2/18
3533 * @since ACF 5.6.5
3534 *
3535 * @param type $var Description. Default.
3536 * @return type Description.
3537 */
3538
3539 acf.isVisible = function ($el) {
3540 return !acf.isHidden($el);
3541 };
3542
3543 /**
3544 * enable
3545 *
3546 * description
3547 *
3548 * @date 12/3/18
3549 * @since ACF 5.6.9
3550 *
3551 * @param type $var Description. Default.
3552 * @return type Description.
3553 */
3554
3555 var enable = function ($el, lockKey) {
3556 // check class. Allow .acf-disabled to overrule all JS
3557 if ($el.hasClass('acf-disabled')) {
3558 return false;
3559 }
3560
3561 // unlock
3562 if (lockKey) {
3563 acf.unlock($el, 'disabled', lockKey);
3564 }
3565
3566 // bail early if $el is still locked
3567 if (acf.isLocked($el, 'disabled')) {
3568 return false;
3569 }
3570
3571 // $el is disabled, remove prop and return true due to change
3572 if ($el.prop('disabled')) {
3573 $el.prop('disabled', false);
3574 return true;
3575
3576 // $el is enabled, return false due to no change
3577 } else {
3578 return false;
3579 }
3580 };
3581
3582 /**
3583 * acf.enable
3584 *
3585 * description
3586 *
3587 * @date 9/2/18
3588 * @since ACF 5.6.5
3589 *
3590 * @param type $var Description. Default.
3591 * @return type Description.
3592 */
3593
3594 acf.enable = function ($el, lockKey) {
3595 // enable single input
3596 if ($el.attr('name')) {
3597 return enable($el, lockKey);
3598 }
3599
3600 // find and enable child inputs
3601 // return true if any inputs have changed
3602 var results = false;
3603 $el.find('[name]').each(function () {
3604 var result = enable($(this), lockKey);
3605 if (result) {
3606 results = true;
3607 }
3608 });
3609 return results;
3610 };
3611
3612 /**
3613 * disable
3614 *
3615 * description
3616 *
3617 * @date 12/3/18
3618 * @since ACF 5.6.9
3619 *
3620 * @param type $var Description. Default.
3621 * @return type Description.
3622 */
3623
3624 var disable = function ($el, lockKey) {
3625 // lock
3626 if (lockKey) {
3627 acf.lock($el, 'disabled', lockKey);
3628 }
3629
3630 // $el is disabled, return false due to no change
3631 if ($el.prop('disabled')) {
3632 return false;
3633
3634 // $el is enabled, add prop and return true due to change
3635 } else {
3636 $el.prop('disabled', true);
3637 return true;
3638 }
3639 };
3640
3641 /**
3642 * acf.disable
3643 *
3644 * description
3645 *
3646 * @date 9/2/18
3647 * @since ACF 5.6.5
3648 *
3649 * @param type $var Description. Default.
3650 * @return type Description.
3651 */
3652
3653 acf.disable = function ($el, lockKey) {
3654 // disable single input
3655 if ($el.attr('name')) {
3656 return disable($el, lockKey);
3657 }
3658
3659 // find and enable child inputs
3660 // return true if any inputs have changed
3661 var results = false;
3662 $el.find('[name]').each(function () {
3663 var result = disable($(this), lockKey);
3664 if (result) {
3665 results = true;
3666 }
3667 });
3668 return results;
3669 };
3670
3671 /**
3672 * acf.isset
3673 *
3674 * description
3675 *
3676 * @date 10/1/18
3677 * @since ACF 5.6.5
3678 *
3679 * @param type $var Description. Default.
3680 * @return type Description.
3681 */
3682
3683 acf.isset = function (obj /*, level1, level2, ... */) {
3684 for (var i = 1; i < arguments.length; i++) {
3685 if (!obj || !obj.hasOwnProperty(arguments[i])) {
3686 return false;
3687 }
3688 obj = obj[arguments[i]];
3689 }
3690 return true;
3691 };
3692
3693 /**
3694 * acf.isget
3695 *
3696 * description
3697 *
3698 * @date 10/1/18
3699 * @since ACF 5.6.5
3700 *
3701 * @param type $var Description. Default.
3702 * @return type Description.
3703 */
3704
3705 acf.isget = function (obj /*, level1, level2, ... */) {
3706 for (var i = 1; i < arguments.length; i++) {
3707 if (!obj || !obj.hasOwnProperty(arguments[i])) {
3708 return null;
3709 }
3710 obj = obj[arguments[i]];
3711 }
3712 return obj;
3713 };
3714
3715 /**
3716 * acf.getFileInputData
3717 *
3718 * description
3719 *
3720 * @date 10/1/18
3721 * @since ACF 5.6.5
3722 *
3723 * @param type $var Description. Default.
3724 * @return type Description.
3725 */
3726
3727 acf.getFileInputData = function ($input, callback) {
3728 // vars
3729 var value = $input.val();
3730
3731 // bail early if no value
3732 if (!value) {
3733 return false;
3734 }
3735
3736 // data
3737 var data = {
3738 url: value
3739 };
3740
3741 // modern browsers
3742 var file = $input[0].files.length ? acf.isget($input[0].files, 0) : false;
3743 if (file) {
3744 // update data
3745 data.size = file.size;
3746 data.type = file.type;
3747
3748 // image
3749 if (file.type.indexOf('image') > -1) {
3750 // vars
3751 var windowURL = window.URL || window.webkitURL;
3752 var img = new Image();
3753 img.onload = function () {
3754 // update
3755 data.width = this.width;
3756 data.height = this.height;
3757 callback(data);
3758 };
3759 img.src = windowURL.createObjectURL(file);
3760 } else {
3761 callback(data);
3762 }
3763 } else {
3764 callback(data);
3765 }
3766 };
3767
3768 /**
3769 * acf.isAjaxSuccess
3770 *
3771 * description
3772 *
3773 * @date 18/1/18
3774 * @since ACF 5.6.5
3775 *
3776 * @param type $var Description. Default.
3777 * @return type Description.
3778 */
3779
3780 acf.isAjaxSuccess = function (json) {
3781 return json && json.success;
3782 };
3783
3784 /**
3785 * acf.getAjaxMessage
3786 *
3787 * description
3788 *
3789 * @date 18/1/18
3790 * @since ACF 5.6.5
3791 *
3792 * @param type $var Description. Default.
3793 * @return type Description.
3794 */
3795
3796 acf.getAjaxMessage = function (json) {
3797 return acf.isget(json, 'data', 'message');
3798 };
3799
3800 /**
3801 * acf.getAjaxError
3802 *
3803 * description
3804 *
3805 * @date 18/1/18
3806 * @since ACF 5.6.5
3807 *
3808 * @param type $var Description. Default.
3809 * @return type Description.
3810 */
3811
3812 acf.getAjaxError = function (json) {
3813 return acf.isget(json, 'data', 'error');
3814 };
3815
3816 /**
3817 * Returns the error message from an XHR object.
3818 *
3819 * @date 17/3/20
3820 * @since ACF 5.8.9
3821 *
3822 * @param object xhr The XHR object.
3823 * @return (string)
3824 */
3825 acf.getXhrError = function (xhr) {
3826 if (xhr.responseJSON) {
3827 // Responses via `return new WP_Error();`
3828 if (xhr.responseJSON.message) {
3829 return xhr.responseJSON.message;
3830 }
3831
3832 // Responses via `wp_send_json_error();`.
3833 if (xhr.responseJSON.data && xhr.responseJSON.data.error) {
3834 return xhr.responseJSON.data.error;
3835 }
3836 } else if (xhr.statusText) {
3837 return xhr.statusText;
3838 }
3839 return '';
3840 };
3841
3842 /**
3843 * acf.renderSelect
3844 *
3845 * Renders the inner html for a select field.
3846 *
3847 * @date 19/2/18
3848 * @since ACF 5.6.9
3849 *
3850 * @param jQuery $select The select element.
3851 * @param array choices An array of choices.
3852 * @return void
3853 */
3854
3855 acf.renderSelect = function ($select, choices) {
3856 // vars
3857 var value = $select.val();
3858 var values = [];
3859
3860 // callback
3861 var crawl = function (items) {
3862 // vars
3863 var itemsHtml = '';
3864
3865 // loop
3866 items.map(function (item) {
3867 // vars
3868 var text = item.text || item.label || '';
3869 var id = item.id || item.value || '';
3870
3871 // append
3872 values.push(id);
3873
3874 // optgroup
3875 if (item.children) {
3876 itemsHtml += '<optgroup label="' + acf.escAttr(text) + '">' + crawl(item.children) + '</optgroup>';
3877
3878 // option
3879 } else {
3880 itemsHtml += '<option value="' + acf.escAttr(id) + '"' + (item.disabled ? ' disabled="disabled"' : '') + '>' + acf.strEscape(text) + '</option>';
3881 }
3882 });
3883 // return
3884 return itemsHtml;
3885 };
3886
3887 // update HTML
3888 $select.html(crawl(choices));
3889
3890 // update value
3891 if (values.indexOf(value) > -1) {
3892 $select.val(value);
3893 }
3894
3895 // return selected value
3896 return $select.val();
3897 };
3898
3899 /**
3900 * acf.lock
3901 *
3902 * Creates a "lock" on an element for a given type and key
3903 *
3904 * @date 22/2/18
3905 * @since ACF 5.6.9
3906 *
3907 * @param jQuery $el The element to lock.
3908 * @param string type The type of lock such as "condition" or "visibility".
3909 * @param string key The key that will be used to unlock.
3910 * @return void
3911 */
3912
3913 var getLocks = function ($el, type) {
3914 return $el.data('acf-lock-' + type) || [];
3915 };
3916 var setLocks = function ($el, type, locks) {
3917 $el.data('acf-lock-' + type, locks);
3918 };
3919 acf.lock = function ($el, type, key) {
3920 var locks = getLocks($el, type);
3921 var i = locks.indexOf(key);
3922 if (i < 0) {
3923 locks.push(key);
3924 setLocks($el, type, locks);
3925 }
3926 };
3927
3928 /**
3929 * acf.unlock
3930 *
3931 * Unlocks a "lock" on an element for a given type and key
3932 *
3933 * @date 22/2/18
3934 * @since ACF 5.6.9
3935 *
3936 * @param jQuery $el The element to lock.
3937 * @param string type The type of lock such as "condition" or "visibility".
3938 * @param string key The key that will be used to unlock.
3939 * @return void
3940 */
3941
3942 acf.unlock = function ($el, type, key) {
3943 var locks = getLocks($el, type);
3944 var i = locks.indexOf(key);
3945 if (i > -1) {
3946 locks.splice(i, 1);
3947 setLocks($el, type, locks);
3948 }
3949
3950 // return true if is unlocked (no locks)
3951 return locks.length === 0;
3952 };
3953
3954 /**
3955 * acf.isLocked
3956 *
3957 * Returns true if a lock exists for a given type
3958 *
3959 * @date 22/2/18
3960 * @since ACF 5.6.9
3961 *
3962 * @param jQuery $el The element to lock.
3963 * @param string type The type of lock such as "condition" or "visibility".
3964 * @return void
3965 */
3966
3967 acf.isLocked = function ($el, type) {
3968 return getLocks($el, type).length > 0;
3969 };
3970
3971 /**
3972 * acf.isGutenberg
3973 *
3974 * Returns true if the Gutenberg editor is being used.
3975 *
3976 * @since ACF 5.8.0
3977 *
3978 * @return bool
3979 */
3980 acf.isGutenberg = function () {
3981 return !!(window.wp && wp.data && wp.data.select && wp.data.select('core/editor'));
3982 };
3983
3984 /**
3985 * acf.isGutenbergPostEditor
3986 *
3987 * Returns true if the Gutenberg post editor is being used.
3988 *
3989 * @since ACF 6.2.2
3990 *
3991 * @return bool
3992 */
3993 acf.isGutenbergPostEditor = function () {
3994 return !!(window.wp && wp.data && wp.data.select && wp.data.select('core/edit-post'));
3995 };
3996
3997 /**
3998 * acf.objectToArray
3999 *
4000 * Returns an array of items from the given object.
4001 *
4002 * @date 20/11/18
4003 * @since ACF 5.8.0
4004 *
4005 * @param object obj The object of items.
4006 * @return array
4007 */
4008 acf.objectToArray = function (obj) {
4009 return Object.keys(obj).map(function (key) {
4010 return obj[key];
4011 });
4012 };
4013
4014 /**
4015 * acf.debounce
4016 *
4017 * Returns a debounced version of the passed function which will postpone its execution until after `wait` milliseconds have elapsed since the last time it was invoked.
4018 *
4019 * @date 28/8/19
4020 * @since ACF 5.8.1
4021 *
4022 * @param function callback The callback function.
4023 * @return int wait The number of milliseconds to wait.
4024 */
4025 acf.debounce = function (callback, wait) {
4026 var timeout;
4027 return function () {
4028 var context = this;
4029 var args = arguments;
4030 var later = function () {
4031 callback.apply(context, args);
4032 };
4033 clearTimeout(timeout);
4034 timeout = setTimeout(later, wait);
4035 };
4036 };
4037
4038 /**
4039 * acf.throttle
4040 *
4041 * Returns a throttled version of the passed function which will allow only one execution per `limit` time period.
4042 *
4043 * @date 28/8/19
4044 * @since ACF 5.8.1
4045 *
4046 * @param function callback The callback function.
4047 * @return int wait The number of milliseconds to wait.
4048 */
4049 acf.throttle = function (callback, limit) {
4050 var busy = false;
4051 return function () {
4052 if (busy) return;
4053 busy = true;
4054 setTimeout(function () {
4055 busy = false;
4056 }, limit);
4057 callback.apply(this, arguments);
4058 };
4059 };
4060
4061 /**
4062 * acf.isInView
4063 *
4064 * Returns true if the given element is in view.
4065 *
4066 * @date 29/8/19
4067 * @since ACF 5.8.1
4068 *
4069 * @param elem el The dom element to inspect.
4070 * @return bool
4071 */
4072 acf.isInView = function (el) {
4073 if (el instanceof jQuery) {
4074 el = el[0];
4075 }
4076 var rect = el.getBoundingClientRect();
4077 return rect.top !== rect.bottom && rect.top >= 0 && rect.left >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && rect.right <= (window.innerWidth || document.documentElement.clientWidth);
4078 };
4079
4080 /**
4081 * acf.onceInView
4082 *
4083 * Watches for a dom element to become visible in the browser and then executes the passed callback.
4084 *
4085 * @date 28/8/19
4086 * @since ACF 5.8.1
4087 *
4088 * @param dom el The dom element to inspect.
4089 * @param function callback The callback function.
4090 */
4091 acf.onceInView = function () {
4092 // Define list.
4093 var items = [];
4094 var id = 0;
4095
4096 // Define check function.
4097 var check = function () {
4098 items.forEach(function (item) {
4099 if (acf.isInView(item.el)) {
4100 item.callback.apply(this);
4101 pop(item.id);
4102 }
4103 });
4104 };
4105
4106 // And create a debounced version.
4107 var debounced = acf.debounce(check, 300);
4108
4109 // Define add function.
4110 var push = function (el, callback) {
4111 // Add event listener.
4112 if (!items.length) {
4113 $(window).on('scroll resize', debounced).on('acfrefresh orientationchange', check);
4114 }
4115
4116 // Append to list.
4117 items.push({
4118 id: id++,
4119 el: el,
4120 callback: callback
4121 });
4122 };
4123
4124 // Define remove function.
4125 var pop = function (id) {
4126 // Remove from list.
4127 items = items.filter(function (item) {
4128 return item.id !== id;
4129 });
4130
4131 // Clean up listener.
4132 if (!items.length) {
4133 $(window).off('scroll resize', debounced).off('acfrefresh orientationchange', check);
4134 }
4135 };
4136
4137 // Define returned function.
4138 return function (el, callback) {
4139 // Allow jQuery object.
4140 if (el instanceof jQuery) el = el[0];
4141
4142 // Execute callback if already in view or add to watch list.
4143 if (acf.isInView(el)) {
4144 callback.apply(this);
4145 } else {
4146 push(el, callback);
4147 }
4148 };
4149 }();
4150
4151 /**
4152 * acf.once
4153 *
4154 * Creates a function that is restricted to invoking `func` once.
4155 *
4156 * @date 2/9/19
4157 * @since ACF 5.8.1
4158 *
4159 * @param function func The function to restrict.
4160 * @return function
4161 */
4162 acf.once = function (func) {
4163 var i = 0;
4164 return function () {
4165 if (i++ > 0) {
4166 return func = undefined;
4167 }
4168 return func.apply(this, arguments);
4169 };
4170 };
4171
4172 /**
4173 * Focuses attention to a specific element.
4174 *
4175 * @date 05/05/2020
4176 * @since ACF 5.9.0
4177 *
4178 * @param jQuery $el The jQuery element to focus.
4179 * @return void
4180 */
4181 acf.focusAttention = function ($el) {
4182 var wait = 1000;
4183
4184 // Apply class to focus attention.
4185 $el.addClass('acf-attention -focused');
4186
4187 // Scroll to element if needed.
4188 var scrollTime = 500;
4189 if (!acf.isInView($el)) {
4190 $('body, html').animate({
4191 scrollTop: $el.offset().top - $(window).height() / 2
4192 }, scrollTime);
4193 wait += scrollTime;
4194 }
4195
4196 // Remove class after $wait amount of time.
4197 var fadeTime = 250;
4198 setTimeout(function () {
4199 $el.removeClass('-focused');
4200 setTimeout(function () {
4201 $el.removeClass('acf-attention');
4202 }, fadeTime);
4203 }, wait);
4204 };
4205
4206 /**
4207 * Description
4208 *
4209 * @date 05/05/2020
4210 * @since ACF 5.9.0
4211 *
4212 * @param type Var Description.
4213 * @return type Description.
4214 */
4215 acf.onFocus = function ($el, callback) {
4216 // Only run once per element.
4217 // if( $el.data('acf.onFocus') ) {
4218 // return false;
4219 // }
4220
4221 // Vars.
4222 var ignoreBlur = false;
4223 var focus = false;
4224
4225 // Functions.
4226 var onFocus = function () {
4227 ignoreBlur = true;
4228 setTimeout(function () {
4229 ignoreBlur = false;
4230 }, 1);
4231 setFocus(true);
4232 };
4233 var onBlur = function () {
4234 if (!ignoreBlur) {
4235 setFocus(false);
4236 }
4237 };
4238 var addEvents = function () {
4239 $(document).on('click', onBlur);
4240 //$el.on('acfBlur', onBlur);
4241 $el.on('blur', 'input, select, textarea', onBlur);
4242 };
4243 var removeEvents = function () {
4244 $(document).off('click', onBlur);
4245 //$el.off('acfBlur', onBlur);
4246 $el.off('blur', 'input, select, textarea', onBlur);
4247 };
4248 var setFocus = function (value) {
4249 if (focus === value) {
4250 return;
4251 }
4252 if (value) {
4253 addEvents();
4254 } else {
4255 removeEvents();
4256 }
4257 focus = value;
4258 callback(value);
4259 };
4260
4261 // Add events and set data.
4262 $el.on('click', onFocus);
4263 //$el.on('acfFocus', onFocus);
4264 $el.on('focus', 'input, select, textarea', onFocus);
4265 //$el.data('acf.onFocus', true);
4266 };
4267
4268 /**
4269 * Disable form submit buttons
4270 *
4271 * @since ACF 6.2.3
4272 *
4273 * @param event e
4274 * @returns void
4275 */
4276 acf.disableForm = function (e) {
4277 // Disable submit button.
4278 if (e.submitter) e.submitter.classList.add('disabled');
4279 };
4280
4281 /*
4282 * exists
4283 *
4284 * This function will return true if a jQuery selection exists
4285 *
4286 * @type function
4287 * @date 8/09/2014
4288 * @since ACF 5.0.0
4289 *
4290 * @param n/a
4291 * @return (boolean)
4292 */
4293
4294 $.fn.exists = function () {
4295 return $(this).length > 0;
4296 };
4297
4298 /*
4299 * outerHTML
4300 *
4301 * This function will return a string containing the HTML of the selected element
4302 *
4303 * @type function
4304 * @date 19/11/2013
4305 * @since ACF 5.0.0
4306 *
4307 * @param $.fn
4308 * @return (string)
4309 */
4310
4311 $.fn.outerHTML = function () {
4312 return $(this).get(0).outerHTML;
4313 };
4314
4315 /*
4316 * indexOf
4317 *
4318 * This function will provide compatibility for ie8
4319 *
4320 * @type function
4321 * @date 5/3/17
4322 * @since ACF 5.5.10
4323 *
4324 * @param n/a
4325 * @return n/a
4326 */
4327
4328 if (!Array.prototype.indexOf) {
4329 Array.prototype.indexOf = function (val) {
4330 return $.inArray(val, this);
4331 };
4332 }
4333
4334 /**
4335 * Returns true if value is a number or a numeric string.
4336 *
4337 * @date 30/11/20
4338 * @since ACF 5.9.4
4339 * @link https://stackoverflow.com/questions/9716468/pure-javascript-a-function-like-jquerys-isnumeric/9716488#9716488
4340 *
4341 * @param mixed n The variable being evaluated.
4342 * @return bool.
4343 */
4344 acf.isNumeric = function (n) {
4345 return !isNaN(parseFloat(n)) && isFinite(n);
4346 };
4347
4348 /**
4349 * Triggers a "refresh" action used by various Components to redraw the DOM.
4350 *
4351 * @date 26/05/2020
4352 * @since ACF 5.9.0
4353 *
4354 * @param void
4355 * @return void
4356 */
4357 acf.refresh = acf.debounce(function () {
4358 $(window).trigger('acfrefresh');
4359 acf.doAction('refresh');
4360 }, 0);
4361
4362 /**
4363 * Log something to console if we're in debug mode.
4364 *
4365 * @since ACF 6.3
4366 */
4367 acf.debug = function () {
4368 if (acf.get('debug')) console.log.apply(null, arguments);
4369 };
4370
4371 // Set up actions from events
4372 $(document).ready(function () {
4373 acf.doAction('ready');
4374 });
4375 $(window).on('load', function () {
4376 // Use timeout to ensure action runs after Gutenberg has modified DOM elements during "DOMContentLoaded".
4377 setTimeout(function () {
4378 acf.doAction('load');
4379 });
4380 });
4381 $(window).on('beforeunload', function () {
4382 acf.doAction('unload');
4383 });
4384 $(window).on('resize', function () {
4385 acf.doAction('resize');
4386 });
4387 $(document).on('sortstart', function (event, ui) {
4388 acf.doAction('sortstart', ui.item, ui.placeholder);
4389 });
4390 $(document).on('sortstop', function (event, ui) {
4391 acf.doAction('sortstop', ui.item, ui.placeholder);
4392 });
4393 })(jQuery);
4394
4395 /***/ })
4396
4397 /******/ });
4398 /************************************************************************/
4399 /******/ // The module cache
4400 /******/ var __webpack_module_cache__ = {};
4401 /******/
4402 /******/ // The require function
4403 /******/ function __webpack_require__(moduleId) {
4404 /******/ // Check if module is in cache
4405 /******/ var cachedModule = __webpack_module_cache__[moduleId];
4406 /******/ if (cachedModule !== undefined) {
4407 /******/ return cachedModule.exports;
4408 /******/ }
4409 /******/ // Create a new module (and put it into the cache)
4410 /******/ var module = __webpack_module_cache__[moduleId] = {
4411 /******/ // no module.id needed
4412 /******/ // no module.loaded needed
4413 /******/ exports: {}
4414 /******/ };
4415 /******/
4416 /******/ // Execute the module function
4417 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
4418 /******/
4419 /******/ // Return the exports of the module
4420 /******/ return module.exports;
4421 /******/ }
4422 /******/
4423 /************************************************************************/
4424 /******/ /* webpack/runtime/compat get default export */
4425 /******/ (() => {
4426 /******/ // getDefaultExport function for compatibility with non-harmony modules
4427 /******/ __webpack_require__.n = (module) => {
4428 /******/ var getter = module && module.__esModule ?
4429 /******/ () => (module['default']) :
4430 /******/ () => (module);
4431 /******/ __webpack_require__.d(getter, { a: getter });
4432 /******/ return getter;
4433 /******/ };
4434 /******/ })();
4435 /******/
4436 /******/ /* webpack/runtime/define property getters */
4437 /******/ (() => {
4438 /******/ // define getter functions for harmony exports
4439 /******/ __webpack_require__.d = (exports, definition) => {
4440 /******/ for(var key in definition) {
4441 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
4442 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
4443 /******/ }
4444 /******/ }
4445 /******/ };
4446 /******/ })();
4447 /******/
4448 /******/ /* webpack/runtime/hasOwnProperty shorthand */
4449 /******/ (() => {
4450 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
4451 /******/ })();
4452 /******/
4453 /******/ /* webpack/runtime/make namespace object */
4454 /******/ (() => {
4455 /******/ // define __esModule on exports
4456 /******/ __webpack_require__.r = (exports) => {
4457 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
4458 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4459 /******/ }
4460 /******/ Object.defineProperty(exports, '__esModule', { value: true });
4461 /******/ };
4462 /******/ })();
4463 /******/
4464 /************************************************************************/
4465 var __webpack_exports__ = {};
4466 // This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
4467 (() => {
4468 "use strict";
4469 /*!******************************!*\
4470 !*** ./assets/src/js/acf.js ***!
4471 \******************************/
4472 __webpack_require__.r(__webpack_exports__);
4473 /* harmony import */ var _acf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_acf.js */ "./assets/src/js/_acf.js");
4474 /* harmony import */ var _acf_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_acf_js__WEBPACK_IMPORTED_MODULE_0__);
4475 /* harmony import */ var _acf_hooks_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_acf-hooks.js */ "./assets/src/js/_acf-hooks.js");
4476 /* harmony import */ var _acf_hooks_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_acf_hooks_js__WEBPACK_IMPORTED_MODULE_1__);
4477 /* harmony import */ var _acf_model_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_acf-model.js */ "./assets/src/js/_acf-model.js");
4478 /* harmony import */ var _acf_model_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_acf_model_js__WEBPACK_IMPORTED_MODULE_2__);
4479 /* harmony import */ var _acf_popup_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_acf-popup.js */ "./assets/src/js/_acf-popup.js");
4480 /* harmony import */ var _acf_popup_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_acf_popup_js__WEBPACK_IMPORTED_MODULE_3__);
4481 /* harmony import */ var _acf_modal_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_acf-modal.js */ "./assets/src/js/_acf-modal.js");
4482 /* harmony import */ var _acf_modal_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_acf_modal_js__WEBPACK_IMPORTED_MODULE_4__);
4483 /* harmony import */ var _acf_panel_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_acf-panel.js */ "./assets/src/js/_acf-panel.js");
4484 /* harmony import */ var _acf_panel_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_acf_panel_js__WEBPACK_IMPORTED_MODULE_5__);
4485 /* harmony import */ var _acf_notice_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_acf-notice.js */ "./assets/src/js/_acf-notice.js");
4486 /* harmony import */ var _acf_notice_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_acf_notice_js__WEBPACK_IMPORTED_MODULE_6__);
4487 /* harmony import */ var _acf_tooltip_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_acf-tooltip.js */ "./assets/src/js/_acf-tooltip.js");
4488 /* harmony import */ var _acf_tooltip_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_acf_tooltip_js__WEBPACK_IMPORTED_MODULE_7__);
4489
4490
4491
4492
4493
4494
4495
4496
4497 })();
4498
4499 /******/ })()
4500 ;
4501 //# sourceMappingURL=acf.js.map