!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){"use strict";(function(t){
/**!
 * @fileOverview Kickass library to create and place poppers near their reference elements.
 * @version 1.16.1
 * @license
 * Copyright (c) 2016 Federico Zivolo and contributors
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,o=function(){for(var t=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(n&&navigator.userAgent.indexOf(t[e])>=0)return 1;return 0}();var r=n&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout((function(){e=!1,t()}),o))}};function i(t){return t&&"[object Function]"==={}.toString.call(t)}function a(t,e){if(1!==t.nodeType)return[];var n=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?n[e]:n}function s(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function l(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=a(t),n=e.overflow,o=e.overflowX,r=e.overflowY;return/(auto|scroll|overlay)/.test(n+r+o)?t:l(s(t))}function c(t){return t&&t.referenceNode?t.referenceNode:t}var u=n&&!(!window.MSInputMethodContext||!document.documentMode),p=n&&/MSIE 10/.test(navigator.userAgent);function d(t){return 11===t?u:10===t?p:u||p}function f(t){if(!t)return document.documentElement;for(var e=d(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var o=n&&n.nodeName;return o&&"BODY"!==o&&"HTML"!==o?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?f(n):n:t?t.ownerDocument.documentElement:document.documentElement}function h(t){return null!==t.parentNode?h(t.parentNode):t}function m(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,o=n?t:e,r=n?e:t,i=document.createRange();i.setStart(o,0),i.setEnd(r,0);var a,s,l=i.commonAncestorContainer;if(t!==l&&e!==l||o.contains(r))return"BODY"===(s=(a=l).nodeName)||"HTML"!==s&&f(a.firstElementChild)!==a?f(l):l;var c=h(t);return c.host?m(c.host,e):m(t,h(e).host)}function y(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===e?"scrollTop":"scrollLeft",o=t.nodeName;if("BODY"===o||"HTML"===o){var r=t.ownerDocument.documentElement,i=t.ownerDocument.scrollingElement||r;return i[n]}return t[n]}function _(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=y(e,"top"),r=y(e,"left"),i=n?-1:1;return t.top+=o*i,t.bottom+=o*i,t.left+=r*i,t.right+=r*i,t}function g(t,e){var n="x"===e?"Left":"Top",o="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+o+"Width"])}function v(t,e,n,o){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],d(10)?parseInt(n["offset"+t])+parseInt(o["margin"+("Height"===t?"Top":"Left")])+parseInt(o["margin"+("Height"===t?"Bottom":"Right")]):0)}function b(t){var e=t.body,n=t.documentElement,o=d(10)&&getComputedStyle(n);return{height:v("Height",e,n,o),width:v("Width",e,n,o)}}var E=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),C=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},S=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t};function O(t){return S({},t,{right:t.left+t.width,bottom:t.top+t.height})}function T(t){var e={};try{if(d(10)){e=t.getBoundingClientRect();var n=y(t,"top"),o=y(t,"left");e.top+=n,e.left+=o,e.bottom+=n,e.right+=o}else e=t.getBoundingClientRect()}catch(t){}var r={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},i="HTML"===t.nodeName?b(t.ownerDocument):{},s=i.width||t.clientWidth||r.width,l=i.height||t.clientHeight||r.height,c=t.offsetWidth-s,u=t.offsetHeight-l;if(c||u){var p=a(t);c-=g(p,"x"),u-=g(p,"y"),r.width-=c,r.height-=u}return O(r)}function A(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=d(10),r="HTML"===e.nodeName,i=T(t),s=T(e),c=l(t),u=a(e),p=parseFloat(u.borderTopWidth),f=parseFloat(u.borderLeftWidth);n&&r&&(s.top=Math.max(s.top,0),s.left=Math.max(s.left,0));var h=O({top:i.top-s.top-p,left:i.left-s.left-f,width:i.width,height:i.height});if(h.marginTop=0,h.marginLeft=0,!o&&r){var m=parseFloat(u.marginTop),y=parseFloat(u.marginLeft);h.top-=p-m,h.bottom-=p-m,h.left-=f-y,h.right-=f-y,h.marginTop=m,h.marginLeft=y}return(o&&!n?e.contains(c):e===c&&"BODY"!==c.nodeName)&&(h=_(h,e)),h}function j(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.ownerDocument.documentElement,o=A(t,n),r=Math.max(n.clientWidth,window.innerWidth||0),i=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:y(n),s=e?0:y(n,"left"),l={top:a-o.top+o.marginTop,left:s-o.left+o.marginLeft,width:r,height:i};return O(l)}function P(t){var e=t.nodeName;if("BODY"===e||"HTML"===e)return!1;if("fixed"===a(t,"position"))return!0;var n=s(t);return!!n&&P(n)}function L(t){if(!t||!t.parentElement||d())return document.documentElement;for(var e=t.parentElement;e&&"none"===a(e,"transform");)e=e.parentElement;return e||document.documentElement}function x(t,e,n,o){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={top:0,left:0},a=r?L(t):m(t,c(e));if("viewport"===o)i=j(a,r);else{var u=void 0;"scrollParent"===o?"BODY"===(u=l(s(e))).nodeName&&(u=t.ownerDocument.documentElement):u="window"===o?t.ownerDocument.documentElement:o;var p=A(u,a,r);if("HTML"!==u.nodeName||P(a))i=p;else{var d=b(t.ownerDocument),f=d.height,h=d.width;i.top+=p.top-p.marginTop,i.bottom=f+p.top,i.left+=p.left-p.marginLeft,i.right=h+p.left}}var y="number"==typeof(n=n||0);return i.left+=y?n:n.left||0,i.top+=y?n:n.top||0,i.right-=y?n:n.right||0,i.bottom-=y?n:n.bottom||0,i}function k(t){return t.width*t.height}function q(t,e,n,o,r){var i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var a=x(n,o,i,r),s={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},l=Object.keys(s).map((function(t){return S({key:t},s[t],{area:k(s[t])})})).sort((function(t,e){return e.area-t.area})),c=l.filter((function(t){var e=t.width,o=t.height;return e>=n.clientWidth&&o>=n.clientHeight})),u=c.length>0?c[0].key:l[0].key,p=t.split("-")[1];return u+(p?"-"+p:"")}function I(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,r=o?L(e):m(e,c(n));return A(n,r,o)}function M(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),o=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+o,height:t.offsetHeight+n}}function D(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,(function(t){return e[t]}))}function V(t,e,n){n=n.split("-")[0];var o=M(t),r={width:o.width,height:o.height},i=-1!==["right","left"].indexOf(n),a=i?"top":"left",s=i?"left":"top",l=i?"height":"width",c=i?"width":"height";return r[a]=e[a]+e[l]/2-o[l]/2,r[s]=n===s?e[s]-o[c]:e[D(s)],r}function H(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function R(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex((function(t){return t[e]===n}));var o=H(t,(function(t){return t[e]===n}));return t.indexOf(o)}(t,"name",n))).forEach((function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&i(n)&&(e.offsets.popper=O(e.offsets.popper),e.offsets.reference=O(e.offsets.reference),e=n(e,t))})),e}function F(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=I(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=q(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=V(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=R(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function N(t,e){return t.some((function(t){var n=t.name;return t.enabled&&n===e}))}function B(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),o=0;o<e.length;o++){var r=e[o],i=r?""+r+n:t;if(void 0!==document.body.style[i])return i}return null}function W(){return this.state.isDestroyed=!0,N(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.position="",this.popper.style.top="",this.popper.style.left="",this.popper.style.right="",this.popper.style.bottom="",this.popper.style.willChange="",this.popper.style[B("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}function Q(t){var e=t.ownerDocument;return e?e.defaultView:window}function U(t,e,n,o){n.updateBound=o,Q(t).addEventListener("resize",n.updateBound,{passive:!0});var r=l(t);return function t(e,n,o,r){var i="BODY"===e.nodeName,a=i?e.ownerDocument.defaultView:e;a.addEventListener(n,o,{passive:!0}),i||t(l(a.parentNode),n,o,r),r.push(a)}(r,"scroll",n.updateBound,n.scrollParents),n.scrollElement=r,n.eventsEnabled=!0,n}function Y(){this.state.eventsEnabled||(this.state=U(this.reference,this.options,this.state,this.scheduleUpdate))}function J(){var t,e;this.state.eventsEnabled&&(cancelAnimationFrame(this.scheduleUpdate),this.state=(t=this.reference,e=this.state,Q(t).removeEventListener("resize",e.updateBound),e.scrollParents.forEach((function(t){t.removeEventListener("scroll",e.updateBound)})),e.updateBound=null,e.scrollParents=[],e.scrollElement=null,e.eventsEnabled=!1,e))}function z(t){return""!==t&&!isNaN(parseFloat(t))&&isFinite(t)}function G(t,e){Object.keys(e).forEach((function(n){var o="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&z(e[n])&&(o="px"),t.style[n]=e[n]+o}))}var $=n&&/Firefox/i.test(navigator.userAgent);function X(t,e,n){var o=H(t,(function(t){return t.name===e})),r=!!o&&t.some((function(t){return t.name===n&&t.enabled&&t.order<o.order}));if(!r){var i="`"+e+"`",a="`"+n+"`";console.warn(a+" modifier is required by "+i+" modifier in order to work, be sure to include it before "+i+"!")}return r}var K=["auto-start","auto","auto-end","top-start","top","top-end","right-start","right","right-end","bottom-end","bottom","bottom-start","left-end","left","left-start"],Z=K.slice(3);function tt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=Z.indexOf(t),o=Z.slice(n+1).concat(Z.slice(0,n));return e?o.reverse():o}var et="flip",nt="clockwise",ot="counterclockwise";function rt(t,e,n,o){var r=[0,0],i=-1!==["right","left"].indexOf(o),a=t.split(/(\+|\-)/).map((function(t){return t.trim()})),s=a.indexOf(H(a,(function(t){return-1!==t.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return(c=c.map((function(t,o){var r=(1===o?!i:i)?"height":"width",a=!1;return t.reduce((function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,a=!0,t):a?(t[t.length-1]+=e,a=!1,t):t.concat(e)}),[]).map((function(t){return function(t,e,n,o){var r=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),i=+r[1],a=r[2];if(!i)return t;if(0===a.indexOf("%")){var s=void 0;switch(a){case"%p":s=n;break;case"%":case"%r":default:s=o}return O(s)[e]/100*i}if("vh"===a||"vw"===a){return("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*i}return i}(t,r,e,n)}))}))).forEach((function(t,e){t.forEach((function(n,o){z(n)&&(r[e]+=n*("-"===t[o-1]?-1:1))}))})),r}var it={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],o=e.split("-")[1];if(o){var r=t.offsets,i=r.reference,a=r.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",c=s?"width":"height",u={start:C({},l,i[l]),end:C({},l,i[l]+i[c]-a[c])};t.offsets.popper=S({},a,u[o])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n=e.offset,o=t.placement,r=t.offsets,i=r.popper,a=r.reference,s=o.split("-")[0],l=void 0;return l=z(+n)?[+n,0]:rt(n,i,a,s),"left"===s?(i.top+=l[0],i.left-=l[1]):"right"===s?(i.top+=l[0],i.left+=l[1]):"top"===s?(i.left+=l[0],i.top-=l[1]):"bottom"===s&&(i.left+=l[0],i.top+=l[1]),t.popper=i,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||f(t.instance.popper);t.instance.reference===n&&(n=f(n));var o=B("transform"),r=t.instance.popper.style,i=r.top,a=r.left,s=r[o];r.top="",r.left="",r[o]="";var l=x(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);r.top=i,r.left=a,r[o]=s,e.boundaries=l;var c=e.priority,u=t.offsets.popper,p={primary:function(t){var n=u[t];return u[t]<l[t]&&!e.escapeWithReference&&(n=Math.max(u[t],l[t])),C({},t,n)},secondary:function(t){var n="right"===t?"left":"top",o=u[n];return u[t]>l[t]&&!e.escapeWithReference&&(o=Math.min(u[n],l[t]-("right"===t?u.width:u.height))),C({},n,o)}};return c.forEach((function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";u=S({},u,p[e](t))})),t.offsets.popper=u,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,o=e.reference,r=t.placement.split("-")[0],i=Math.floor,a=-1!==["top","bottom"].indexOf(r),s=a?"right":"bottom",l=a?"left":"top",c=a?"width":"height";return n[s]<i(o[l])&&(t.offsets.popper[l]=i(o[l])-n[c]),n[l]>i(o[s])&&(t.offsets.popper[l]=i(o[s])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!X(t.instance.modifiers,"arrow","keepTogether"))return t;var o=e.element;if("string"==typeof o){if(!(o=t.instance.popper.querySelector(o)))return t}else if(!t.instance.popper.contains(o))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var r=t.placement.split("-")[0],i=t.offsets,s=i.popper,l=i.reference,c=-1!==["left","right"].indexOf(r),u=c?"height":"width",p=c?"Top":"Left",d=p.toLowerCase(),f=c?"left":"top",h=c?"bottom":"right",m=M(o)[u];l[h]-m<s[d]&&(t.offsets.popper[d]-=s[d]-(l[h]-m)),l[d]+m>s[h]&&(t.offsets.popper[d]+=l[d]+m-s[h]),t.offsets.popper=O(t.offsets.popper);var y=l[d]+l[u]/2-m/2,_=a(t.instance.popper),g=parseFloat(_["margin"+p]),v=parseFloat(_["border"+p+"Width"]),b=y-t.offsets.popper[d]-g-v;return b=Math.max(Math.min(s[u]-m,b),0),t.arrowElement=o,t.offsets.arrow=(C(n={},d,Math.round(b)),C(n,f,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(N(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=x(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),o=t.placement.split("-")[0],r=D(o),i=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case et:a=[o,r];break;case nt:a=tt(o);break;case ot:a=tt(o,!0);break;default:a=e.behavior}return a.forEach((function(s,l){if(o!==s||a.length===l+1)return t;o=t.placement.split("-")[0],r=D(o);var c=t.offsets.popper,u=t.offsets.reference,p=Math.floor,d="left"===o&&p(c.right)>p(u.left)||"right"===o&&p(c.left)<p(u.right)||"top"===o&&p(c.bottom)>p(u.top)||"bottom"===o&&p(c.top)<p(u.bottom),f=p(c.left)<p(n.left),h=p(c.right)>p(n.right),m=p(c.top)<p(n.top),y=p(c.bottom)>p(n.bottom),_="left"===o&&f||"right"===o&&h||"top"===o&&m||"bottom"===o&&y,g=-1!==["top","bottom"].indexOf(o),v=!!e.flipVariations&&(g&&"start"===i&&f||g&&"end"===i&&h||!g&&"start"===i&&m||!g&&"end"===i&&y),b=!!e.flipVariationsByContent&&(g&&"start"===i&&h||g&&"end"===i&&f||!g&&"start"===i&&y||!g&&"end"===i&&m),E=v||b;(d||_||E)&&(t.flipped=!0,(d||_)&&(o=a[l+1]),E&&(i=function(t){return"end"===t?"start":"start"===t?"end":t}(i)),t.placement=o+(i?"-"+i:""),t.offsets.popper=S({},t.offsets.popper,V(t.instance.popper,t.offsets.reference,t.placement)),t=R(t.instance.modifiers,t,"flip"))})),t},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],o=t.offsets,r=o.popper,i=o.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return r[a?"left":"top"]=i[n]-(s?r[a?"width":"height"]:0),t.placement=D(e),t.offsets.popper=O(r),t}},hide:{order:800,enabled:!0,fn:function(t){if(!X(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=H(t.instance.modifiers,(function(t){return"preventOverflow"===t.name})).boundaries;if(e.bottom<n.top||e.left>n.right||e.top>n.bottom||e.right<n.left){if(!0===t.hide)return t;t.hide=!0,t.attributes["x-out-of-boundaries"]=""}else{if(!1===t.hide)return t;t.hide=!1,t.attributes["x-out-of-boundaries"]=!1}return t}},computeStyle:{order:850,enabled:!0,fn:function(t,e){var n=e.x,o=e.y,r=t.offsets.popper,i=H(t.instance.modifiers,(function(t){return"applyStyle"===t.name})).gpuAcceleration;void 0!==i&&console.warn("WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!");var a=void 0!==i?i:e.gpuAcceleration,s=f(t.instance.popper),l=T(s),c={position:r.position},u=function(t,e){var n=t.offsets,o=n.popper,r=n.reference,i=Math.round,a=Math.floor,s=function(t){return t},l=i(r.width),c=i(o.width),u=-1!==["left","right"].indexOf(t.placement),p=-1!==t.placement.indexOf("-"),d=e?u||p||l%2==c%2?i:a:s,f=e?i:s;return{left:d(l%2==1&&c%2==1&&!p&&e?o.left-1:o.left),top:f(o.top),bottom:f(o.bottom),right:d(o.right)}}(t,window.devicePixelRatio<2||!$),p="bottom"===n?"top":"bottom",d="right"===o?"left":"right",h=B("transform"),m=void 0,y=void 0;if(y="bottom"===p?"HTML"===s.nodeName?-s.clientHeight+u.bottom:-l.height+u.bottom:u.top,m="right"===d?"HTML"===s.nodeName?-s.clientWidth+u.right:-l.width+u.right:u.left,a&&h)c[h]="translate3d("+m+"px, "+y+"px, 0)",c[p]=0,c[d]=0,c.willChange="transform";else{var _="bottom"===p?-1:1,g="right"===d?-1:1;c[p]=y*_,c[d]=m*g,c.willChange=p+", "+d}var v={"x-placement":t.placement};return t.attributes=S({},v,t.attributes),t.styles=S({},c,t.styles),t.arrowStyles=S({},t.offsets.arrow,t.arrowStyles),t},gpuAcceleration:!0,x:"bottom",y:"right"},applyStyle:{order:900,enabled:!0,fn:function(t){var e,n;return G(t.instance.popper,t.styles),e=t.instance.popper,n=t.attributes,Object.keys(n).forEach((function(t){!1!==n[t]?e.setAttribute(t,n[t]):e.removeAttribute(t)})),t.arrowElement&&Object.keys(t.arrowStyles).length&&G(t.arrowElement,t.arrowStyles),t},onLoad:function(t,e,n,o,r){var i=I(r,e,t,n.positionFixed),a=q(n.placement,i,e,t,n.modifiers.flip.boundariesElement,n.modifiers.flip.padding);return e.setAttribute("x-placement",a),G(e,{position:n.positionFixed?"fixed":"absolute"}),n},gpuAcceleration:void 0}}},at=function(){function t(e,n){var o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};E(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(o.update)},this.update=r(this.update.bind(this)),this.options=S({},t.Defaults,a),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(S({},t.Defaults.modifiers,a.modifiers)).forEach((function(e){o.options.modifiers[e]=S({},t.Defaults.modifiers[e]||{},a.modifiers?a.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(t){return S({name:t},o.options.modifiers[t])})).sort((function(t,e){return t.order-e.order})),this.modifiers.forEach((function(t){t.enabled&&i(t.onLoad)&&t.onLoad(o.reference,o.popper,o.options,t,o.state)})),this.update();var s=this.options.eventsEnabled;s&&this.enableEventListeners(),this.state.eventsEnabled=s}return w(t,[{key:"update",value:function(){return F.call(this)}},{key:"destroy",value:function(){return W.call(this)}},{key:"enableEventListeners",value:function(){return Y.call(this)}},{key:"disableEventListeners",value:function(){return J.call(this)}}]),t}();at.Utils=("undefined"!=typeof window?window:t).PopperUtils,at.placements=K,at.Defaults=it,e.a=at}).call(this,n(2))},function(t,e){var n=function(){function t(){}return t.escapeRegex=function(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},t.formatOptionsSelect2=function(t){var e=[];if(void 0===t)return e;for(var n=0;n<t.length;n++){var o=void 0;if(void 0!==t[n].options)for(var r in o={text:t[n].label,children:[]},t[n].options)t[n].options.hasOwnProperty(r)&&o.children.push({value:t[n].options[r].value,id:t[n].options[r].value,text:t[n].options[r].label});else o={value:t[n].value,id:t[n].value,text:t[n].label};e.push(o)}return e},t}();t.exports=n},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(t){t.hasOwnProperty("append")||Object.defineProperty(t,"append",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=Array.prototype.slice.call(arguments),e=document.createDocumentFragment();t.forEach((function(t){var n=t instanceof Node;e.appendChild(n?t:document.createTextNode(String(t)))})),this.appendChild(e)}})})),[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(t){t.hasOwnProperty("prepend")||Object.defineProperty(t,"prepend",{configurable:!0,enumerable:!0,writable:!0,value:function(){var t=Array.prototype.slice.call(arguments),e=document.createDocumentFragment();t.forEach((function(t){var n=t instanceof Node;e.appendChild(n?t:document.createTextNode(String(t)))})),this.insertBefore(e,this.firstChild)}})}))},function(t,e,n){"use strict";n.r(e);var o,r=function(){function t(){}return t.input=function(e,n,o){void 0===n&&(n=null),void 0===o&&(o={});var r=document.createElement("input");return r.setAttribute("name",e),n&&(r.value=n),o=Object.assign({},{type:"text"},o),t.setHtmlAttributes(r,o),r},t.textarea=function(e,n,o){void 0===n&&(n="ss"),void 0===o&&(o={});var r=document.createElement("textarea");return r.setAttribute("name",e),t.setHtmlAttributes(r,o),r},t.checkbox=function(t,e,n){var o=document.createElement("label");return o.classList.add("input__checkbox"),o.innerHTML='<input type="checkbox" name="'+t+'" class="input__checkbox__input" value="'+e+'"><span class="input__checkbox__label">'+n+"</span>",o},t.setHtmlAttributes=function(t,e){Object.keys(e).forEach((function(n){var o=e[n];t.setAttribute(n,o)}))},t.inputGroup=function(t,e){return'\n\t\t<div class="input__group">\n\t\t\t<label>'+t+'</label>\n\t\t\t<div class="input__controlgroup">'+e+"</div>\n\t\t</div>\n\t\t"},t}(),i=function(){function t(){this.form=r,this.setElement(),this.setError(!1)}return t.prototype.setTemplate=function(t){var e=this.el.querySelector(".aceditable__form__inputs");e.innerHTML="",e.insertAdjacentHTML("afterBegin",t)},t.prototype.setError=function(t){var e=this.el.querySelector(".aceditable__form__error");t?(e.innerHTML=t,e.style.display="block"):e.style.display="none"},t.prototype.addClass=function(t){this.el.classList.add(t)},t.prototype.setSubmitButton=function(t){this.el.querySelector("[data-submit]").innerHTML=t},t.prototype.showButtons=function(t){void 0===t&&(t=!0);var e=this.el.querySelector(".aceditable__form__controls");e.style.display=t?"block":"none"},t.prototype.setElement=function(){var e=document.createElement("div");e.classList.add("aceditable"),e.innerHTML=t.getElementMarkup(),this.el=e},t.getElementMarkup=function(){return'\t\t\n\t\t\t<div class="aceditable__content">\n\t\t\t\t<form class="aceditable__form" autocomplete="nope">\n\t\t\t\t\t<div class="aceditable__form__inputs">\n\t\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="aceditable__form__controls">\n\t\t\t\t\t\t<button data-submit="" class="button aceditable__button -primary"><span class="dashicons dashicons-yes"></span></button>\n\t\t\t\t\t\t<button data-cancel="" class="button aceditable__button"><span class="dashicons dashicons-no"></span></button>\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t\t<div class="aceditable__form__error"></div>\n\t\t\t</div>\n\t\t\t<div class="aceditable__spinner spinner"></div>\n\t\t'},t}(),a=function(){function t(){this.listeners=new Map}return t.prototype.addListener=function(t,e){this.listeners.has(t)||this.listeners.set(t,[]),this.listeners.get(t).push(e)},t.prototype.removeListener=function(e,n){var o,r=this.listeners.get(e);return!!(r&&r.length&&(o=r.reduce((function(e,o,r){return t.isFunction(o)&&o===n?e=r:e}),-1))>-1)&&(r.splice(o,1),this.listeners.set(e,r),!0)},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var o=this.listeners.get(t);return!(!o||!o.length)&&(o.forEach((function(t){t.apply(void 0,e)})),!0)},t.isFunction=function(t){return"function"==typeof t||!1},t}(),s=function(){return(s=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},l={title:!1,value:null,showbuttons:!0,type:"default",mode:"inline"},c=function(){function t(t){this._template=new i,this._element=null,this._args=this._getArgs(t),this._isInit=!1,this._isDisabled=!1,this.Events=new a,new u}return t.prototype.close=function(){return this.removeElement(),Window.ACEditable=null,this.Events.emit("close",this),this},t.prototype.get=function(){return this._element=this.createElement(),this.beforeRender(),this.render(),this.valueToInput(this._args.value),this.initEvents(),this._element},t.prototype.getEditableTemplate=function(){return this._template},t.prototype.disable=function(){return this._element.querySelectorAll("input, select, textarea, button").forEach((function(t){t.disabled=!0})),this._isDisabled=!0,this},t.prototype.enable=function(){return this._element.querySelectorAll("input, select, textarea, button").forEach((function(t){t.disabled=!1})),this._isDisabled=!1,this},t.prototype.beforeRender=function(){this._template.setTemplate(this.getTemplate()),this._template.addClass("-"+this._args.type),this._template.setError(""),this._args.hasOwnProperty("showbuttons")||this._args.showbuttons||this._template.showButtons(!1)},t.prototype.save=function(){if(!this._isDisabled){var t=this.getValue();this.validate(t)&&this.Events.emit("save",this)}},t.prototype.initEvents=function(){var t=this;this._isInit||(this.getElement().addEventListener("click",(function(e){t.preventStopPropagation(e)||e.stopPropagation()})),this.getElement().querySelector("button[data-submit]").addEventListener("click",(function(e){e.preventDefault(),t.save()})),this.getElement().querySelector("button[data-cancel]").addEventListener("click",(function(e){e.preventDefault(),t.close()})),this.getElement().querySelector("form").addEventListener("submit",(function(e){e.preventDefault(),t.save()})),this._isInit=!0)},t.prototype.preventStopPropagation=function(t,e){return!1},t.prototype.removeElement=function(){this._element&&this._element.remove()},t.prototype.toggleLoading=function(t){void 0===t&&(t=!0),this.getElement()&&(t?this.getElement().classList.add("-loading"):this.getElement().classList.remove("-loading"))},t.prototype.createElement=function(){return this._template.el},t.prototype.setValue=function(t){return this._args.value=t,this},t.prototype.setObjectId=function(t){return this._args.object_id=t,this},t.prototype.getObjectId=function(){return!!this._args.hasOwnProperty("object_id")&&this._args.object_id},t.prototype.setError=function(t){this._template.setError(t)},t.prototype.getElement=function(){return this._element},t.prototype.getValue=function(){},t.prototype.getTemplate=function(){},t.prototype.render=function(){},t.prototype.valueToInput=function(t){},t.prototype.validate=function(){if(t.hasFormValidation()){var e=this.getElement().querySelector("form");if(!this.getElement().querySelector("form").checkValidity())return e.reportValidity(),!1}return!0},t.prototype._getArgs=function(t){return this._defaults=s({},l),this._setDefaults(),Object.assign({},this._defaults,t)},t.prototype._setDefaults=function(){},t.prototype._handleOutsideClickEvent=function(){this.close()},t.hasFormValidation=function(){return"function"==typeof document.createElement("input").checkValidity},t}(),u=function(){function t(){AC_SERVICES.getService("Editing").Editables.loaded||(this._setEscapeEvent(),AC_SERVICES.getService("Editing").Editables.loaded=!0)}return t.prototype._setEscapeEvent=function(){document.addEventListener("keydown",(function(t){"Escape"!==t.key&&"Esc"!==t.key||Window.ACEditable&&Window.ACEditable.close()}),!0)},t.prototype._setClickEvent=function(){document.addEventListener("click",(function(t){t.target!==document.body&&(t.target.classList.contains("select2-results__option")||Window.ACEditable&&Window.ACEditable.close())}))},t}(),p=(o=function(t,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return p(e,t),e.prototype.render=function(){var t=this,e=this.getElement().querySelector(".input__group.-checkbox");Object.keys(this._args.options).forEach((function(n){var o=t._args.options[n];e.insertAdjacentHTML("beforeEnd",t._template.form.checkbox("option[]",o.value,o.text).outerHTML)}))},e.prototype.valueToInput=function(t){var e=this;Array.isArray(t)&&t.forEach((function(t){var n=e._element.querySelector('input[value="'+t+'"]');n&&(n.checked=!0)}))},e.prototype.getValue=function(){var t=[];return this.getElement().querySelectorAll("form input[type=checkbox]:checked").forEach((function(e){return t.push(e.value)})),t},e.prototype.getTemplate=function(){return'<div class="input__group -checkbox"></div>'},e.prototype._setDefaults=function(){this._defaults.options=[],this._defaults.type="checkbox"},e}(c),f=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.valueToInput=function(t){var e=this.getElement().querySelector("input");t&&e&&(e.value=t),jQuery(e).wpColorPicker()},e.prototype.getValue=function(){return this._element.querySelector("input").value},e.prototype.getTemplate=function(){return this._template.form.input("color").outerHTML},e.prototype._setDefaults=function(){this._defaults.type="color"},e}(c),m=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),y=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return m(e,t),e.prototype.render=function(){var t=this,e=this,n=jQuery(this.getElement().querySelector("[name=date]"));document.body.classList.add("ac-jqui"),n.prop("readonly",!0).datepicker({dateFormat:"yy-mm-dd",changeYear:!0,firstDay:this._args.weekstart,showButtonPanel:!0,onSelect:function(){t._args.showbuttons||e.save()},beforeShow:function(t,n){setTimeout((function(){var t=n.dpDiv.get(0);t.style.position="relative",t.style.left=0,t.style.top=0,e.getElement().querySelector(".input__date").append(t)}),0)}}).on("click",(function(){n.prop("readonly",!1)})).on("blur",(function(){n.prop("readonly",!0)}))},e.prototype.valueToInput=function(t){var n=this;t&&(8===t.length&&(t=e.mapACFDateFormat(t)),setTimeout((function(){jQuery(n.getElement().querySelector("[name=date]")).val(t).datepicker("show")}),0))},e.prototype.getValue=function(){return this.getElement().querySelector("[name=date]").value},e.prototype.getTemplate=function(){return"\n\t\t\t"+this._template.form.input("date","",{placeholder:"yyyy-mm-dd",autocomplete:"nope"}).outerHTML+'\n\t\t\t<div class="input__date"></div>\n\t\t'},e.prototype._setDefaults=function(){this._defaults.weekstart=1,this._defaults.type="date",this._defaults.showbuttons=!0},e.mapACFDateFormat=function(t){return t=[(t=[t.slice(0,4),"-",t.slice(4)].join("")).slice(0,7),"-",t.slice(7)].join("")},e}(c),_=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),g=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _(e,t),e.prototype.render=function(){var t=this.getElement().querySelector("[name=date]"),n=this.getElement().querySelector("[name=time_hours]"),o=this.getElement().querySelector("[name=time_minutes]"),r=this.getElement().querySelector("[name=time_seconds]");document.body.classList.add("ac-jqui"),e.createSelectHours(n,this._args.timeformat),e.createSelectIncementalOptions(o),e.createSelectIncementalOptions(r),jQuery(t).datepicker({dateFormat:"yy-mm-dd",changeYear:!0,showButtonPanel:!0,firstDay:this._args.weekstart})},e.prototype.close=function(){document.body.classList.remove("ac-jqui"),t.prototype.close.call(this)},e.prototype.valueToInput=function(t){if(t){var e=new Date(t.replace(/-/g,"/"));isNaN(e.getTime())||(this.getElement().querySelector("[name=date]").value=e.getFullYear()+"-"+("0"+(e.getMonth()+1)).slice(-2)+"-"+("0"+e.getDate()).slice(-2),this.getElement().querySelector("[name=time_hours]").value=("0"+e.getHours()).slice(-2),this.getElement().querySelector("[name=time_minutes]").value=("0"+e.getMinutes()).slice(-2),this.getElement().querySelector("[name=time_seconds]").value=("0"+e.getSeconds()).slice(-2))}},e.prototype.getValue=function(){var t=this.getElement().querySelector("[name=date]").value,e=this.getElement().querySelector("[name=time_hours]").value,n=this.getElement().querySelector("[name=time_minutes]").value,o=this.getElement().querySelector("[name=time_seconds]").value;return!!(t&&e&&n&&o)&&t+" "+e+":"+n+":"+o},e.prototype.getTemplate=function(){return"\n\t\t\t"+this._template.form.input("date","",{placeholder:"yyyy-mm-dd",autocomplete:"nope"}).outerHTML+'\n\t\t\t<div class="input__time">\n\t\t\t\t<select name="time_hours"></select>\t\t\t\t\n\t\t\t\t<select name="time_minutes"></select>\t\t\t\t\n\t\t\t\t<select name="time_seconds"></select>\t\t\t\t\n\t\t\t</div>\n\t\t'},e.prototype._setDefaults=function(){this._defaults.type="datetime",this._defaults.weekstart=0,this._defaults.timeformat=12},e.createSelectHours=function(t,n){for(var o=0;o<24;o++){var r=document.createElement("option"),i=("0"+o).slice(-2);r.setAttribute("value",i),r.text=12===n?e.formatAMPM(i):i,t.append(r)}},e.formatAMPM=function(t){var e=t>=12?"pm":"am";return(t=(t%=12)||12)+" "+e},e.createSelectIncementalOptions=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=60);for(var o=e;o<n;o++){var r=document.createElement("option"),i=("0"+o).slice(-2);r.setAttribute("value",i),r.text=i,t.append(r)}},e}(c),v=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return v(e,t),e.prototype.render=function(){var t=this;this._args.hasOwnProperty("html_attributes")&&this._args.html_attributes.hasOwnProperty("type")&&this.getElement().classList.add("-input-"+this._args.html_attributes.type),setTimeout((function(){t.getElement().querySelector("input").focus()}),0)},e.prototype.valueToInput=function(t){t&&(this.getElement().querySelector("input").value=t)},e.prototype.getValue=function(){return this.getElement().querySelector("input").value},e.prototype.getTemplate=function(){return this._template.form.input("input",null,this._args.html_attributes).outerHTML},e.prototype._setDefaults=function(){this._defaults.type="text"},e}(c),E=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),w=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype.render=function(){this.getElement().querySelector("textarea").focus()},e.prototype.valueToInput=function(t){var e=this.getElement().querySelector("textarea");setTimeout((function(){e.focus(),e.setSelectionRange(0,0)}),0),t&&(e.value=t)},e.prototype.getValue=function(){return this.getElement().querySelector("textarea").value},e.prototype.getTemplate=function(){return this._args.html_attributes.rows||(this._args.html_attributes.rows=6),this._template.form.textarea("text",null,this._args.html_attributes).outerHTML},e.prototype._setDefaults=function(){this._defaults.type="textarea"},e}(c),C=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return C(e,t),e.prototype.render=function(){var t=this._args.options,n=this.getFirstInput(),o=this.getSecondInput();n.value=t[0].value,o.value=t[1].value,n.parentElement.querySelector(".toggle__label").innerHTML=t[0].label,o.parentElement.querySelector(".toggle__label").innerHTML=t[1].label,e.getTrueValues().includes(t[0].label.toString().toLowerCase())?(n.parentElement.querySelector(".toggle__label").innerHTML=e.getDefaultTrueLabel(),o.parentElement.querySelector(".toggle__label").innerHTML=e.getDefaultFalseLabel()):e.getFalseValues().includes(t[0].label.toString().toLowerCase())&&(n.parentElement.querySelector(".toggle__label").innerHTML=e.getDefaultFalseLabel(),o.parentElement.querySelector(".toggle__label").innerHTML=e.getDefaultTrueLabel())},e.prototype.valueToInput=function(t){if(!this._args.showbuttons&&null!==t){var e=!1,n=this.getElement().querySelector("input[data-o1]"),o=this.getElement().querySelector("input[data-o2]");n.value.toString()===t.toString()&&(o.checked=!0,e=!0),o.value.toString()===t.toString()&&(n.checked=!0,e=!0),e||(this.getTrueInput().checked=!0),this.save(),this.close()}},e.prototype.getFalseInput=function(){return e.getFalseValues().includes(this._args.options[0].value.toString().toLowerCase())?this.getFirstInput():this.getSecondInput()},e.prototype.getTrueInput=function(){return e.getTrueValues().includes(this._args.options[0].value.toString().toLowerCase())?this.getFirstInput():this.getSecondInput()},e.prototype.getFirstInput=function(){return this.getElement().querySelector("input[data-o1]")},e.prototype.getSecondInput=function(){return this.getElement().querySelector("input[data-o2]")},e.prototype.getValue=function(){return this.getElement().querySelector("input:checked").value},e.getTrueValues=function(){return["true","yes","1","on"]},e.getFalseValues=function(){return["","0","no","false","off"]},e.getDefaultTrueLabel=function(){return'<span class="dashicons dashicons-yes"></span>'},e.getDefaultFalseLabel=function(){return'<span class="dashicons dashicons-no"></span>'},e.prototype.getTemplate=function(){return'\n\t\t<label >\n\t\t\t<input type="radio" name="toggle" data-o1>\n\t\t\t<span class="toggle__label"></span>\n\t\t</label>\n\t\t<label data-false>\n\t\t\t<input type="radio" name="toggle" data-o2>\n\t\t\t<span class="toggle__label"></span>\n\t\t</label>'},e.prototype._setDefaults=function(){this._defaults.type="togglable",this._defaults.showbuttons=!0},e}(c),O=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return O(e,t),e.prototype.render=function(){this._element.querySelector('[name="first_name"]').setAttribute("placeholder",this._args.placeholder_first_name),this._element.querySelector('[name="last_name"]').setAttribute("placeholder",this._args.placeholder_last_name)},e.prototype.valueToInput=function(t){t.hasOwnProperty("first_name")&&(this._element.querySelector('[name="first_name"]').value=t.first_name),t.hasOwnProperty("last_name")&&(this._element.querySelector('[name="last_name"]').value=t.last_name)},e.prototype.getValue=function(){return{first_name:this._element.querySelector('[name="first_name"]').value,last_name:this._element.querySelector('[name="last_name"]').value}},e.prototype.getTemplate=function(){return'\n\t\t\t<div class="aceditable__form__inputs">\n\t\t\t\t<div class="input__group">\n\t\t\t\t<input name="first_name" type="text" placeholder="First name">\n\t\t\t\t<input name="last_name" type="text" placeholder="Last name">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t'},e.prototype._setDefaults=function(){this._defaults.type="fullname"},e}(c),A=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return A(e,t),e.prototype.render=function(){var t=this,e=this.getElement().querySelector("select");Object.keys(this._args.options).forEach((function(n){var o=t._args.options[n],r=document.createElement("option");r.setAttribute("value",o.value),r.innerText=o.text,e.append(r)}))},e.prototype.valueToInput=function(t){t&&(this.getElement().querySelector("select").value=t)},e.prototype.getValue=function(){return this.getElement().querySelector("select").value},e.prototype.getTemplate=function(){return'<select name="select"></select>'},e.prototype._setDefaults=function(){this._defaults.type="select"},e}(c),P=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return P(e,t),e.prototype.render=function(){this.hasOwnProperty("formattedValues")||(this.formattedValues=[]);var t=this.getElement().querySelector(".acs2");this.getObjectId()&&(t.dataset.objectId=this.getObjectId()),this._args.select2.multiple&&t.setAttribute("multiple",!0),this._args.showbuttons||(this.getElement().querySelector(".aceditable__form__controls").style.display="none")},e.prototype.close=function(){var e=this.getElement().querySelector(".acs2");jQuery(e).ac_select2("close"),t.prototype.close.call(this)},e.prototype.valueToInput=function(t){t=t||[],t=Array.isArray(t)?t:[t];var e=this,n=e.getElement().querySelector(".acs2"),o=jQuery(n);if(!e._args.ajax&&t){var r=Array.isArray(t)?t:[t];this._args.select2.data.map((function(t){t.selected=!1})),r.forEach((function(t){e.setSelectedOption(t)}))}e._args.ajax&&t&&t.forEach((function(t){Object.keys(t).forEach((function(e){var o=document.createElement("option");o.setAttribute("selected",!0),o.value=e,o.text=t[e],n.append(o)}))})),o.ac_select2(e._args.select2),this._args.showbuttons||o.on("change",(function(){e.save()}))},e.prototype.setSelectedOption=function(t){var e=this._args.select2.data;return e.some((function(e){return e.value.toString()===t.toString()&&(e.selected=!0,!0)})),e},e.prototype.getValue=function(){var t=this.getElement().querySelector("select.acs2");return this._args.select2.multiple?this.getSelectedValues():t.value},e.prototype.getSelectedValues=function(){var t=this.getElement().querySelectorAll("select.acs2 option:checked");return Array.from(t).map((function(t){return t.value}))},e.prototype.getTemplate=function(){return'<select class="acs2"></select>'},e.prototype._setDefaults=function(){this._defaults.type="select2",this._defaults.showbuttons=!0},e}(c),x=function(){function t(t,e){void 0===e&&(e=""),this.element=t,this.content=e||t.dataset.acTip,this.tip=k(this.content),this.initEvents()}return t.prototype.initEvents=function(){var t=this;"1"!==this.element.dataset.acTooltipInit&&(this.element.dataset.acTooltipInit="1",document.body.appendChild(this.tip),this.element.addEventListener("mouseenter",(function(){var e=document.body.getBoundingClientRect(),n=t.element.getBoundingClientRect();t.tip.style.left=n.left-e.left+t.element.offsetWidth/2+"px",t.tip.style.top=n.top-e.top+t.element.offsetHeight+"px",t.tip.classList.add("hover")})),this.element.addEventListener("mouseleave",(function(){t.tip.classList.remove("hover")})))},t}(),k=function(t){var e=document.createElement("div");return e.classList.add("ac-tooltip"),e.innerHTML=t,e},q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),I=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return q(e,t),e.prototype.render=function(){this.library=wp.media({multiple:this._args.multiple,library:this._args.library,title:this._args.title}),this.displaySaveButton(!1),this.currentValues=[],this._addEvents()},e.prototype.valueToInput=function(t){t&&(this.currentValues=Array.isArray(t)?t:[t]),this._args.showbuttons||this.library.open()},e.prototype.getValue=function(){return this.currentValues},e.prototype.getTemplate=function(){return'\n\t\t<a href="#" class="wplib button">Select</a>\n\t\t<div class="aceditable__selected"></div>'},e.prototype._addEvents=function(){var t=this;this.getElement().querySelector(".wplib").addEventListener("click",(function(e){e.preventDefault(),t.library.open()})),this.library.on("open",(function(){var e=t.library.state().get("selection"),n=t.currentValues;n&&!t._args.disableSelection&&n.forEach((function(t){var n=wp.media.attachment(t);n.fetch(),e.add(n?[n]:[])}))})),this.library.on("select",(function(){var e=t.library.state().get("selection").toJSON(),n=[];e.forEach((function(t){n.push(t.id)})),t.currentValues=t._args.multiple?n:n[0],t._args.showbuttons||(t.save(),t.close()),t.SetImagesFromSelection(t.library.state().get("selection").models),t.displayLibraryButton(!1),t.displaySaveButton(!0)})),this.library.on("close",(function(){t._args.showbuttons||setTimeout((function(){t.close()}),0)}))},e.prototype.displaySaveButton=function(t){var e=this.getElement().querySelector(".aceditable__form__controls");e.style.display=t?"inline-block":"none"},e.prototype.displayLibraryButton=function(t){void 0===t&&(t=!0);var e=this.getElement().querySelector(".wplib");e.style.display=t?"inline-block":"none"},e.prototype.SetImagesFromSelection=function(t){var n=this,o=this.getElement().querySelector(".aceditable__selected");0!==t.length&&t.forEach((function(t){var r=document.createElement("div"),i=null;switch(t.attributes.type){case"image":i=e.getImageElement(t);break;default:i=e.getFileElement(t)}if(i){r.append(i),r.append(e.getInfoElement(t)),r.classList.add("aceditable__selected__item");var a=r.querySelector(".aceditable__selected__item__info").innerHTML;new x(r,a),i.addEventListener("click",(function(t){t.preventDefault(),n.library.open()})),o.append(r)}}))},e.getInfoElement=function(t){var e=document.createElement("div");return e.classList.add("aceditable__selected__item__info"),e.innerHTML="\n\t\t\t<div>"+t.attributes.title+"</div>\n\t\t\t<div>"+t.attributes.filename+"</div>\n\t\t\t<div>ID: "+t.attributes.id+"</div>\n\t\t",e},e.getImageElement=function(t){var e=document.createElement("img"),n=t.attributes.url;return t.attributes.sizes.hasOwnProperty("thumbnail")&&(n=t.attributes.sizes.thumbnail.url),e.setAttribute("src",n),e.classList.add("image"),e},e.getFileElement=function(t){var e=document.createElement("img");return e.setAttribute("src",t.attributes.icon),e.classList.add("file"),e},e.prototype._setDefaults=function(){this._defaults.type="media",this._defaults.title="Media",this._defaults.multiple=!0,this._defaults.showbuttons=!1,this._defaults.disableSelection=!1,this._defaults.library={uploadedTo:!0}},e}(c);function M(t,e){e.parentNode.insertBefore(t,e.nextSibling)}var D=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return D(e,t),e.prototype.render=function(){},e.prototype.valueToInput=function(t){var e=this;(!t||Array.isArray(t)&&0===t.length)&&(t=[""]),t.forEach((function(t){var n=e.createSingleInput(t);e.getElement().querySelector(".acp-ie-multi-container").append(n)}))},e.prototype.createSingleInput=function(t){var e=this._args.subtype,n=document.createElement("div"),o=null;switch(n.classList.add("single-input"),e){case"textarea":o=this._template.form.textarea("input",t);break;default:o=this._template.form.input("input",t,{type:this._args.subtype})}if(o.value=t,o)return n.append(o),n.append(this.createControls()),n},e.prototype.deterimineControls=function(){this.getElement().querySelectorAll(".single-input").length>1?this.getElement().querySelectorAll(".single-input__control.-remove").forEach((function(t){return t.style.display="inline-block"})):this.getElement().querySelectorAll(".single-input__control.-remove").forEach((function(t){return t.style.display="none"}))},e.prototype.createControls=function(){var t=this,e=document.createElement("div");return e.classList.add("single-input__controls"),e.innerHTML='\n\t\t\t<span class="single-input__control -add">\n\t\t\t\t<span class="dashicons dashicons-plus"></span>\n\t\t\t</span>\n\t\t\t<span class="single-input__control -remove">\n\t\t\t\t<span class="dashicons dashicons-minus"></span>\n\t\t\t</span>\n\t\t',e.querySelector(".-add").addEventListener("click",(function(e){t.eventNewRow(e)})),e.querySelector(".-remove").addEventListener("click",(function(e){e.target.closest(".single-input").remove(),t.deterimineControls()})),setTimeout((function(){t.deterimineControls()}),0),e},e.prototype.eventNewRow=function(t){var e=t.target.closest(".single-input");e&&M(this.createSingleInput(""),e)},e.prototype.getValue=function(){var t=[];return this.getElement().querySelectorAll(".single-input input, .single-input textarea").forEach((function(e){t.push(e.value)})),t},e.prototype.getTemplate=function(){return'<div class="acp-ie-multi-container"></div>'},e.prototype._setDefaults=function(){this._defaults.type="multi_input",this._defaults.subtype="text"},e}(c),H=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),R='\n\t<div class="input__group -type">\n\t<select class="type" name="save_strategy">\n\t\t<option value="replace">'+ACP_Editing.i18n.replace_with+'..</option>\n\t\t<option value="add">'+ACP_Editing.i18n.add+'..</option>\n\t\t<option value="remove">'+ACP_Editing.i18n.remove+"..</option>\n\t</select>\n\t</div>\n",F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return H(e,t),e.prototype.render=function(){t.prototype.render.call(this),this.getElement().querySelector(".aceditable__form__inputs").insertAdjacentHTML("afterbegin",R),"inline"===this._args.mode?(this.getTypeElement().style.display="none",this.getTypeElement().value="replace"):this.getTypeElement().style.display="block"},e.prototype.getTypeElement=function(){return this.getElement().querySelector("[name=save_strategy]")},e.prototype.getValue=function(){return{terms:t.prototype.getValue.call(this),save_strategy:this.getElement().querySelector("[name=save_strategy]").value}},e.prototype._setDefaults=function(){this._defaults.type="taxonomy"},e}(L),N=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),B="ac-edit-popper-wrapper",W=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return N(e,t),e.prototype.render=function(){var t=this,e=this.getEditorId();jQuery(this.getElement().querySelector("textarea")).attr("id",e),this.getElement().addEventListener("click",(function(t){return t.preventDefault()})),setTimeout((function(){var n=t.getEditorSettings(),o=t.getElement().closest(".ac-edit-popper"),r=t.getElement().closest(".ac-modal.-bulkedit");o&&(o.classList.add("-full"),t.wrapPopper()),r&&(r.classList.add("-wysiwyg"),n.tinymce.height="300px"),wp.editor.initialize(e,n)}))},e.prototype.wrapPopper=function(){var t=document.createElement("div"),e=this.getElement().closest(".ac-edit-popper");t.classList.add(B),document.body.append(t),t.appendChild(e)},e.prototype.removePopperwrap=function(){document.querySelectorAll("."+B).forEach((function(t){return t.remove()}))},e.prototype.getEditorSettings=function(){var t=Object.assign({},wp.editor.getDefaultSettings());return t.tinymce.toolbar1="formatselect,bold,italic,bullist,numlist,blockquote,alignleft,alignright,aligncenter,link,unlink,wp_add_media,wp_more,fullscreen,wp_adv",t.tinymce.toolbar2="strikethrough,hr,forecolor,pastetext,removeformat,charmap,undo,redo",t.tinymce.width="100%",t.quicktags=!0,t.mediaButtons=!0,t},e.prototype.close=function(){return this.id=null,this.removePopperwrap(),t.prototype.close.call(this)},e.prototype.getEditorId=function(){return this.id||(this.id="acp_"+Math.floor(1e4*Math.random())+"_"+Math.floor(1e4*Math.random())+"_"+Math.floor(1e4*Math.random())),this.id},e.prototype.valueToInput=function(t){var e=this.getElement().querySelector("textarea");t&&e&&(e.value=t)},e.prototype.getValue=function(){var t=this.getEditorId();return wp.editor.getContent(t)},e.prototype.preventStopPropagation=function(t,e){return!0},e.prototype.getTemplate=function(){return"<textarea></textarea>"},e.prototype._setDefaults=function(){this._defaults.type="wysiwyg"},e}(c),Q=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),U=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Q(e,t),e.prototype.close=function(){jQuery(this.getElement().querySelector(".acs2")).ac_select2("close"),t.prototype.close.call(this)},e.prototype.valueToInput=function(t){var e=this;this.getRemoteData().done((function(n){var o=e._args.select2;o.data=n.data.results,jQuery(e.getElement().querySelector(".acs2")).ac_select2(o).val(t).trigger("change")}))},e.prototype.getRemoteData=function(){var t=this.getObjectId();return jQuery.ajax({url:ajaxurl,dataType:"json",method:"get",data:{action:"acp_editing_single_request",method:"get_select_values",layout:AC.layout,column:this._args.column,item_id:t||null,list_screen:AC.list_screen,_ajax_nonce:AC.ajax_nonce}})},e.prototype.getValue=function(){return this.getElement().querySelector("select.acs2").value},e.prototype.getTemplate=function(){return'<select class="acs2"></select>'},e.prototype._setDefaults=function(){this._defaults.type="select2_remote",this._defaults.showbuttons=!0},e}(c),Y=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Y(e,t),e.prototype.render=function(){this.hasOwnProperty("formattedValues")||(this.formattedValues=[]),this.getObjectId()&&(this.getElement().querySelector(".acs2").dataset.objectId=this.getObjectId()),this._args.showbuttons||(this.getElement().querySelector(".aceditable__form__controls").style.display="none")},e.prototype.close=function(){var e=this.getElement().querySelector(".acs2");jQuery(e).ac_select2("close"),t.prototype.close.call(this)},e.prototype.valueToInput=function(t){console.log("Hi");var e=jQuery(this.getElement().querySelector(".acs2"));e.ac_select2(this._args.select2),Object.keys(t).forEach((function(n){var o=new Option(t[n],n,!0,!0);e.append(o).trigger("change")})),this._args.showbuttons||e.on("change",(function(){self.save()}))},e.prototype.getValue=function(){return this.getElement().querySelector("select.acs2").value},e.prototype.getTemplate=function(){return'<select class="acs2"></select>'},e.prototype._setDefaults=function(){this._defaults.type="select2_ajax",this._defaults.showbuttons=!0},e}(c),z=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),G=ACP_Editing.i18n.replace_with,$=ACP_Editing.i18n.add,X=ACP_Editing.i18n.subtract,K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return z(e,t),e.prototype.valueToInput=function(t){t&&(this.getElement().querySelector("input").value=t)},e.prototype.getValue=function(){return{allow_negative:!0,value:this.getElement().querySelector("input").value,computation_type:this.getElement().querySelector("[name=save_strategy]").value}},e.prototype.getTemplate=function(){var t=this._template.form.input("input",null,this._args.html_attributes).outerHTML;return"\n\t\t\t"+Z+"\n\t\t\t"+t+"\n\t\t"},e.prototype._setDefaults=function(){this._defaults.type="number"},e}(c),Z='\n\t<div class="input__group -type -strategy">\n\t<select class="type" name="save_strategy">\n\t\t<option value="replace">'+G+'..</option>\n\t\t<option value="add">'+$+'..</option>\n\t\t<option value="substract">'+X+"..</option>\n\t</select>\n\t</div>\n",tt=function(){function t(){this.editables={}}return t.prototype.initEditables=function(){this.editables._abstract=c,this.editables.text=b,this.editables.textarea=w,this.editables.number=b,this.editables.number_extended=K,this.editables.checklist=d,this.editables.color=h,this.editables.select=j,this.editables.select2_ajax=J,this.editables.select2=L,this.editables.select2_remote=U,this.editables.date=y,this.editables.fullname=T,this.editables.date_time=g,this.editables.toggle=S,this.editables.wp_library=I,this.editables.multi_input=V,this.editables.taxonomy=F,this.editables.wysiwyg=W,document.dispatchEvent(new CustomEvent("AC_Editing_Register_Editables",{detail:this}))},t.prototype.registerEditable=function(t,e){return this.editables[t]=e,this},t.prototype.get=function(t){return!!this.editables.hasOwnProperty(t)&&this.editables[t]},t.prototype.abstract=function(){return this.get("_abstract")},t}(),et=n(1),nt=n.n(et),ot=function(){function t(t,e){this.Editables=t,this.column=e,this.args={},this.map()}return t.prototype.getEditable=function(){return!1},t.prototype.getArgs=function(){return this.args},t.prototype.hasMediaActions=function(){return!1},t.prototype.map=function(){},t}(),rt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),it=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rt(e,t),e.prototype.getEditable=function(){return this.Editables.get("number_extended")},e.prototype.map=function(){return this.mapHTMLAttributes(this.column.editable),this.args},e.prototype.mapHTMLAttributes=function(t){var e={type:"number"};t.hasOwnProperty("range_max")&&(e.max=t.range_max),t.hasOwnProperty("range_min")&&(e.min=t.range_min),t.hasOwnProperty("range_step")&&(e.step=t.range_step),this.args.html_attributes=e},e}(ot),at=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),st=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return at(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("text");return t||!1},e.prototype.map=function(){return this.mapHTMLAttributes(this.column.editable),this.args},e.prototype.mapHTMLAttributes=function(t){var e={};t.hasOwnProperty("required")&&(e.required=t.required),t.hasOwnProperty("placeholder")&&null!==t.placeholder&&(e.placeholder=t.placeholder),t.hasOwnProperty("range_max")&&(e.max=t.range_max),t.hasOwnProperty("range_min")&&(e.min=t.range_min),t.hasOwnProperty("range_step")&&(e.step=t.range_step),t.hasOwnProperty("maxlength")&&(e.maxlength=t.maxlength),this.args.html_attributes=e},e}(ot),lt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return at(e,t),e.prototype.map=function(){return t.prototype.map.call(this),this.args.html_attributes.type="email",this.args},e}(st),ct=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return at(e,t),e.prototype.map=function(){return t.prototype.map.call(this),this.args.html_attributes.type="number",this.args},e}(st),ut=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return at(e,t),e.prototype.map=function(){return t.prototype.map.call(this),this.args.html_attributes.type="url",this.args},e}(st),pt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return at(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("textarea");return t||!1},e.prototype.map=function(){return t.prototype.map.call(this),this.args},e}(st),dt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return at(e,t),e.prototype.map=function(){return t.prototype.map.call(this),this.args.html_attributes.type="number",this.args.html_attributes.step="any",this.args},e}(st),ft=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return at(e,t),e.prototype.map=function(){return t.prototype.map.call(this),this.args.html_attributes.type="password",this.args},e}(st),ht=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ht(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("date");return t||!1},e.prototype.map=function(){return this.args.showbuttons=!1,this.args},e}(ot),yt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ht(e,t),e.prototype.map=function(){return this.args.timeformat=this.column.editable.timeformat,this.args},e.prototype.getEditable=function(){var t=this.Editables.get("date_time");return t||!1},e}(ot),_t=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),gt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return _t(e,t),e.prototype.map=function(){return this.args.options=AC_SERVICES.getService("Editing").Helper.formatOptionsSelect2(this.column.editable.options),this.args},e.prototype.getEditable=function(){var t=this.Editables.get("checklist");return t||!1},e}(ot),vt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),bt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return vt(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("color");return t||!1},e}(ot),Et=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),wt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Et(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("select");return t||!1},e.prototype.map=function(){return this.args.options=AC_SERVICES.getService("Editing").Helper.formatOptionsSelect2(this.column.editable.options),this.args},e}(ot),Ct=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),St=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ct(e,t),e.prototype.getEditable=function(){return this.Editables.get("select2")},e.prototype.map=function(){this.args.select2={width:320,theme:"acs2",data:AC_SERVICES.getService("Editing").Helper.formatOptionsSelect2(this.column.editable.options),escapeMarkup:function(t){return jQuery("<div>"+t+"</div>").text()}},this.column.editable.ajax_populate&&(this.args.select2.ajax=this.mapAjax(),this.args.ajax=!0),this.column.editable.multiple&&(this.args.select2.multiple=!0,this.args.select2.closeOnSelect=!1),this.column.editable.tags&&(this.args.select2.tags=!0)},e.prototype.mapAjax=function(){var t=this.column.name;return{url:ajaxurl,dataType:"json",delay:500,data:function(e){var n={action:"acp_editing_single_request",method:"get_select_values",layout:AC.layout,searchterm:e.term,page:e.page,column:t,list_screen:AC.list_screen,_ajax_nonce:AC.ajax_nonce};return this[0].dataset.hasOwnProperty("objectId")&&(n.item_id=this[0].dataset.objectId),n},processResults:function(t){return t.success?t.data:{results:[]}}}},e}(ot),Ot=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Tt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ot(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("toggle");return t||!1},e.prototype.map=function(){return this.args.options=this.column.editable.options,this.args.showbuttons=!1,this.args},e.prototype.flattenOptionArray=function(t){var e=[];return t.forEach((function(t){e.push(t.label)})),e},e}(ot),At=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),jt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return At(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("taxonomy");return t||!1},e}(St),Pt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Lt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Pt(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("wp_library");return t||!1},e.prototype.map=function(){var t=this.column.editable;return this.args.showbuttons=!1,this.args.multiple=!(!t.hasOwnProperty("multiple")||!t.multiple),t.hasOwnProperty("attachment")&&t.attachment.hasOwnProperty("library")&&(this.args.library=t.attachment.library),t.hasOwnProperty("attachment")&&t.attachment.hasOwnProperty("disable_select_current")&&t.attachment.disable_select_current&&(this.args.disableSelection=!0),this.args},e.prototype.hasMediaActions=function(){return!0},e}(ot),xt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Pt(e,t),e.prototype.map=function(){return t.prototype.map.call(this),this.args.attachment=!0,this.args},e}(Lt),kt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),qt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return kt(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("multi_input");return t||!1},e.prototype.map=function(){return this.args.subtype=this.column.editable.subtype,this.args},e}(ot),It=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return It(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("wysiwyg");return t||!1},e.prototype.map=function(){return this.args},e}(ot),Dt=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Vt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Dt(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("fullname");return t||!1},e.prototype.map=function(){return this.args.placeholder_first_name=this.column.editable.placeholder_first_name,this.args.placeholder_last_name=this.column.editable.placeholder_last_name,this.args},e}(ot),Ht=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),Rt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Ht(e,t),e.prototype.getEditable=function(){var t=this.Editables.get("select2_remote");return t||!1},e.prototype.map=function(){this.args.column=this.column.name,this.args.select2={width:320,theme:"acs2",escapeMarkup:function(t){return jQuery("<div>"+t+"</div>").text()}}},e}(ot),Ft=function(){function t(t){this.Editables=t,this.middleware=new Map,this.middleware.set("_abstract",ot),this.middleware.set("default",st),this.middleware.set("text",st),this.middleware.set("url",ut),this.middleware.set("number",ct),this.middleware.set("number_extended",it),this.middleware.set("password",ft),this.middleware.set("email",lt),this.middleware.set("checklist",gt),this.middleware.set("color",bt),this.middleware.set("select",wt),this.middleware.set("select2_remote",Rt),this.middleware.set("select2_dropdown",St),this.middleware.set("date",mt),this.middleware.set("date_time",yt),this.middleware.set("textarea",pt),this.middleware.set("togglable",Tt),this.middleware.set("attachment",xt),this.middleware.set("media",Lt),this.middleware.set("float",dt),this.middleware.set("multi_input",qt),this.middleware.set("types_multi_input",qt),this.middleware.set("taxonomy",jt),this.middleware.set("wysiwyg",Mt),this.middleware.set("fullname",Vt),document.dispatchEvent(new CustomEvent("AC_Editing_Register_Middleware",{detail:this}))}return t.prototype.register=function(t,e){return this.middleware.set(t,e),this},t.prototype.get=function(t){var e=this.middleware.get(t.editable.type);return e||(e=this.middleware.get("default")),new e(this.Editables,t)},t}(),Nt=n(0);function Bt(t){var e=Array.prototype.slice.call(arguments,1);return t.replace(/{(\d+)}/g,(function(t,n){return void 0!==e[n]?e[n]:t}))}var Wt={FINISHED:ACP_Editing.i18n.bulk_edit.feedback.finished,UPDATING:ACP_Editing.i18n.bulk_edit.feedback.updating,PROCESSED:Bt(ACP_Editing.i18n.bulk_edit.feedback.processed,"<span data-processed>0</span>","<span data-total-items></span>"),FAIL:ACP_Editing.i18n.bulk_edit.feedback.failure,DONE:ACP_Editing.i18n.done,DONE_DESELECT:ACP_Editing.i18n.bulk_edit.selecting.done_deselect,CANCEL:ACP_Editing.i18n.cancel,ERROR:Bt(ACP_Editing.i18n.bulk_edit.feedback.error,"<span data-errors>0</span>")},Qt='\n\t\t<div class="acp-be-progress">\n\t\t\t<div class="acp-be-progress__timer" data-timer></div>\n\t\t\t<div class="acp-be-progress__process">'+Wt.PROCESSED+' (<span data-percentage></span>)</div>\n\t\t</div>\n\n\t\t<div class="acp-be-statusbar">\n\t\t\t<div class="acp-be-statusbar__progress" data-status-percentage></div>\n\t\t</div>\n\n\t\t<div class="errors" style="display: none;">\n\t\t\t<div class="errors__info">'+Wt.ERROR+'</div>\n\t\t\t<div class="errors__lines"></div>\n\t\t</div>\n\n\t\t<button data-close class="button">Cancel</button>\n',Ut=function(){function t(t,e,n,o){void 0===o&&(o=!1),this.Events=new a,this.column=t,this.value=e,this._items=n,this._total=Array.isArray(n)?n.length:n,this._processed=0,this._perPage=ACP_Editing.bulk_edit.updated_rows_per_iteration,this._processAll=o,this._isCanceled=!1,this._isFinished=!1,this.errors=[],this.timer={seconds:0,minutes:0},this.prepareElement(),this.startTimer(),this.prepareJob(),this.attachCancelEvent(),this.updateTotal(),this.updatePercentage(0)}return t.prototype.getElement=function(){return this.element},t.prototype.prepareJob=function(t){var e=this;void 0===t&&(t=1),this._processAll?(1===t&&(this._items=[]),jQuery.ajax({url:window.location.href,method:"get",data:{ac_action:"get_editable_rows",ac_page:t,_ajax_nonce:AC.ajax_nonce}}).done((function(n){if(n.hasOwnProperty("success")&&n.success&&n.data.hasOwnProperty("editable_rows")){if(e._items=[].concat(e._items,n.data.editable_rows),e._total=e._items.length,n.data.rows_per_iteration===n.data.editable_rows.length)return e.updateTotal(),void e.prepareJob(t+1);e.updateTotal(),e.runJob()}}))):this.runJob()},t.prototype.runJob=function(){var t=this;if(!this._isCanceled){var e=this,n=e._items.splice(0,e._perPage);0!==n.length?this.startUpdateThread(n).then((function(n){if(n.success){var o=n.data.total;e._processed+=o,t.updateProcessed(e._processed),o>0&&!e._isCanceled?e.runJob():e.onComplete()}})):e.onComplete()}},t.prototype.startUpdateThread=function(t){return jQuery.ajax({url:ajaxurl,data:{action:"acp_editing_bulk_request",method:"save",list_screen:AC.list_screen,layout:AC.layout,column:this.column.name,ids:t,value:this.value,_ajax_nonce:AC.ajax_nonce},method:"POST",dataType:"json"})},t.prototype.prepareElement=function(){var t=document.createElement("div");t.classList.add("acp-be-processing"),t.innerHTML=Qt,this.element=t},t.prototype.attachCancelEvent=function(){var t=this,e=this.element.querySelector("[data-close]");e&&e.addEventListener("click",(function(){t._isFinished?(e.remove(),t.Events.emit("close",{})):(t._isCanceled=!0,t.onComplete())}))},t.prototype.processResponse=function(t){this.updateProcessed(t.num_rows_processed)},t.prototype.updateTotal=function(){this.element.querySelector("[data-total-items]").innerHTML=this._total},t.prototype.updateProcessed=function(t){this.element.querySelector("[data-processed]").innerHTML=t;var e=Math.round(t/this._total*100);this.updatePercentage(e)},t.prototype.updatePercentage=function(t){this.element.querySelector("[data-percentage]").innerHTML=t+"%",this.element.querySelector("[data-status-percentage]").style.width=t+"%"},t.prototype.onComplete=function(){this._isCanceled||(this.element.querySelector(".acp-be-progress__process").innerHTML=Bt(Wt.FINISHED,this._total)+' (100%) <span class="dashicons dashicons-yes"></span>'),this.element.querySelector("[data-close]").innerHTML=Wt.DONE,this.element.querySelector("[data-close]").classList.add("button-primary"),this.element.querySelector("[data-status-percentage]").classList.add("-finished"),this._isFinished=!0,this.stopTimer(),this.canDismiss=!1,this.element.querySelector(".done-deselect")||this.addDeselectDoneButton(),this.Events.emit("finished")},t.prototype.addDeselectDoneButton=function(){var t=this,e=new Yt;e.el.addEventListener("click",(function(e){e.preventDefault(),AC_SERVICES.getService("Table").el.querySelectorAll(".check-column input[type=checkbox]:checked").forEach((function(t){t.checked=!1,t.dispatchEvent(new Event("change"))})),t.Events.emit("close")})),this.element.append(e.el)},t.prototype.startTimer=function(){var t=this;this.addSecond(),this.timerInterval=setInterval((function(){t.addSecond()}),1e3)},t.prototype.stopTimer=function(){clearInterval(this.timerInterval)},t.prototype.addSecond=function(){var t=this.element.querySelector("[data-timer]");this.timer.seconds++,this.timer.seconds>=60&&(this.timer.seconds=0,this.timer.minutes++),t.textContent=(this.timer.minutes?this.timer.minutes>9?this.timer.minutes:"0"+this.timer.minutes:"00")+":"+(this.timer.seconds>9?this.timer.seconds:"0"+this.timer.seconds)},t}(),Yt=function(){function t(){this.createElement()}return t.prototype.createElement=function(){var t=document.createElement("button");t.classList.add("button","done-deselect"),t.innerText=Wt.DONE_DESELECT,t.dataset.close=!0,this.el=t},t}(),Jt="acp-be-editrow",zt=ACP_Editing.i18n.bulk_edit.bulk_edit,Gt=function(){function t(t){this.BulkEdit=t,this.Table=t.Table,this.Middleware=t.Middleware}return t.prototype.add=function(){var t=this.Table.el.getElementsByTagName("thead")[0].children[0].children,e=document.createElement("tr");e.classList.add(Jt);for(var n=0;n<t.length;n++){var o=t[n],r=this.Table.Columns.get(o.id),i=document.createElement("td");if(i.classList.add("column-"+o.id),"cb"!==o.id&&r.editable){if(r.editable.hasOwnProperty("bulk_editable")&&!1===r.editable.bulk_editable){e.appendChild(i);continue}i.innerHTML='<button class="button">'+zt+"</button>",i.column=r,this.initEvents(i)}e.appendChild(i)}return this.Table.el.querySelector("tbody").insertAdjacentElement("afterBegin",e),this.refresh(),e},t.prototype.remove=function(){var t=this.Table.el.querySelector("."+Jt);t&&t.remove()},t.prototype.initEvents=function(t){var e=this;t.querySelector("button").addEventListener("click",(function(n){n.preventDefault(),n.stopPropagation(),e.BulkEdit.onButtonTrigger(t)}),!0)},t.prototype.getRow=function(){return this.Table.el.querySelector("."+Jt)},t.prototype.refresh=function(){for(var t=this.Table.el.getElementsByTagName("thead")[0].children[0].children,e=0;e<t.length;e++){var n=t[e],o=n.classList.contains("hidden"),r=this.getRow().querySelector(".column-"+n.id);r&&(o?r.classList.add("hidden"):r.classList.remove("hidden"))}},t}(),$t={SELECTED:ACP_Editing.i18n.bulk_edit.selecting.selected,SELECTALL:ACP_Editing.i18n.bulk_edit.selecting.select_all},Xt="acp-be-noticerow",Kt=function(){function t(t){this.notice=null,this.Table=t}return t.prototype.addNotice=function(){var t=this;this.createNotice(),this.createNoticeRow(),this.refreshNoticeRow(),document.querySelectorAll(".hide-column-tog").forEach((function(e){e.addEventListener("click",(function(){t.refreshNoticeRow()}))}))},t.prototype.removeNotice=function(){var t=this.Table.el.querySelector("."+Xt);t&&t.remove()},t.prototype.createNotice=function(){var t=document.createElement("div");t.classList.add("acp-be-notice");var e=document.createElement("p"),n=Bt($t.SELECTED+" ","<span data-acp-be-count></span>");e.insertAdjacentHTML("beforeEnd",n),t.append(e),this.notice=t},t.prototype.createSelectAll=function(t){if(document.querySelector(".ac-be-selectall"))return document.querySelector(".ac-be-selectall");if(!1!==t&&"all"!==t||(t=""),this.notice){var e=document.createElement("a");return e.innerHTML=Bt($t.SELECTALL,t),e.classList.add("ac-be-selectall"),this.notice.querySelector("p").append(e),e}},t.prototype.createNoticeRow=function(){var t=document.createElement("tr"),e=document.createElement("td");t.append(e),t.classList.add(Xt);var n=AC_SERVICES.getService("Table").el.querySelector("thead tr").children.length;return e.setAttribute("colspan",n),e.append(this.notice),this.Table.el.querySelector("tbody").insertAdjacentElement("afterBegin",t),t},t.prototype.refreshNoticeRow=function(){var t=this.Table.el.firstElementChild.firstElementChild.querySelectorAll("td,th"),e=0;t.forEach((function(t){t.classList.contains("hidden")||e++})),this.Table.el.querySelector("."+Xt+" td").setAttribute("colspan",e)},t}(),Zt=function(){function t(t){t&&(this.el=t,this.dialog=t.querySelector(".ac-modal__dialog"),this.initEvents())}return t.prototype.getElement=function(){return this.el},t.prototype.initEvents=function(){var t=this,e=this;document.addEventListener("keydown",(function(e){var n=e.key;t.isOpen()&&"Escape"===n&&t.close()}));var n=this.el.querySelectorAll('[data-dismiss="modal"], .ac-modal__dialog__close');n.length>0&&n.forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault(),e.close()}))})),this.el.addEventListener("click",(function(t){t.target.classList.contains("ac-modal")&&e.close()}))},t.prototype.isOpen=function(){return this.el.classList.contains("-active")},t.prototype.close=function(){this.onClose(),this.el.classList.remove("-active")},t.prototype.open=function(){var t=this;setTimeout((function(){t.onOpen(),t.el.removeAttribute("style"),t.el.classList.add("-active")}))},t.prototype.destroy=function(){this.el.remove()},t.prototype.onClose=function(){},t.prototype.onOpen=function(){},t}(),te=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ee='This will affect <strong><span data-total="">12.500</span> entries</strong>',ne=function(t){function e(e,n){var o=t.call(this,e)||this;return o.canDismiss=!0,o.Editable=n,o.Events=new a,o.hideProcess(),o.setEditable(o.Editable.get()),o}return te(e,t),e.prototype.close=function(){this.canDismiss&&(t.prototype.close.call(this),this.Events.emit("close"))},e.prototype.setTotal=function(t){this.el.querySelectorAll("[data-total] ").forEach((function(e){e.innerHTML=t}))},e.prototype.setEditable=function(t){this.Editable=t,this.el.querySelector("[data-editable]").append(t)},e.prototype.setTitle=function(t){this.el.querySelector("[data-title]").innerHTML=t},e.prototype.setProcess=function(t){var e=this.el.querySelector("[data-process]");this.el.querySelector(".ac-modal__dialog__content.-info").style.display="none",e.innerHTML="",e.append(t),e.style.display="block",this.canDismiss=!1,this.toggleCloseButton(!1)},e.prototype.setCanDismiss=function(t){this.canDismiss=t},e.prototype.toggleCloseButton=function(t){this.el.querySelector(".ac-modal__dialog__close").style.display=t?"block":"none"},e.prototype.hideProcess=function(){this.el.querySelector("[data-process]").style.display="none"},e.appendMarkup=function(){var t=document.createElement("div");return t.classList.add("ac-modal"),t.classList.add("-bulkedit"),t.innerHTML='\n\t\t\t\t<div class="ac-modal__dialog">\n\t\t\t\t\t<div class="ac-modal__dialog__header">\n\t\t\t\t\t\t<span data-title></span>\n\t\t\t\t\t\t<button class="ac-modal__dialog__close">\n\t\t\t\t\t\t\t<span class="dashicons dashicons-no"></span>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ac-modal__dialog__content -editable" data-editable></div>\n\t\t\t\t\t<div class="ac-modal__dialog__content -info">\n\t\t\t\t\t\t<span class="acp-be-warning__icon dashicons dashicons-info"></span><em>'+ee+'</em> \n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ac-modal__dialog__content -process" data-process>\n\t\t\t\t\t\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t',document.body.appendChild(t),t},e}(Zt),oe=Bt(ACP_Editing.i18n.bulk_edit.form.update_values,"<span data-acp-be-count>0</span>"),re=ACP_Editing.i18n.bulk_edit.form.are_you_sure,ie=ACP_Editing.i18n.bulk_edit.form.yes_update,ae=ACP_Editing.i18n.cancel,se=function(){function t(t,e){this.Table=t,this.Editables=e,this.Middleware=new Ft(this.Editables),this.Notice=new Kt(this.Table),this.EditableModal=!1,this.EditRow=new Gt(this),this.Modal=ne,this._allSelected=!1,this._isConfirmed=!1,this.total_count=ACP_Editing.bulk_edit.total_items,this.init()}return t.prototype.init=function(){this.addTableEvents()},t.prototype.setConfirmed=function(t){return this._isConfirmed=t,this},t.prototype.isConfirmed=function(){return!(!ACP_Editing.bulk_edit.hasOwnProperty("show_confirmation")||ACP_Editing.bulk_edit.show_confirmation)||this._isConfirmed},t.prototype.onSave=function(t,e){var n=this;if(this.isConfirmed()){var o=new Ut(e.column,t.getValue(),this.getItemsToProcess(),this._allSelected);this._locked=!0,this.EditableModal.setProcess(o.getElement()),this.Editable.disable(),t.getElement().querySelector(".aceditable__form__controls [data-submit]").style.display="none",o.Events.addListener("close",(function(){n.EditableModal.close()})),o.Events.addListener("finished",(function(){AC_SERVICES.getService("Editing").TableUpdate.updateSelectedCells(e.column.name,t.getValue()),n.EditableModal&&(n.EditableModal.setCanDismiss(!0),n.EditableModal.toggleCloseButton(!0))}))}else this.confirm(t)},t.prototype.onButtonTrigger=function(t){var e=this,n=this.Middleware.get(t.column),o=n.getEditable(),r=AC_SERVICES.getService("Editing").BulkEdit.Modal;if(this.setConfirmed(!1),!o||this.EditableModal)return!1;var i=n.getArgs();i.showbuttons=!0,i.mode="bulk";var a=new o(i),s=new r(r.appendMarkup(),a);a.getEditableTemplate().setSubmitButton("Update"),s.setTitle("Bulk Edit “"+t.column.label+"”"),s.setTotal(this.getSelectedCount()),s.open(),this.EditableModal=s,this.Editable=a,this.updateCount(),a.Events.addListener("save",(function(n){e.onSave(n,t)})),s.Events.addListener("close",(function(){e.destroyEditable(),e.EditableModal=null}))},t.prototype.destroyEditable=function(){this.removeConfirm(),this.Editable.close(),this.EditableModal.destroy()},t.prototype.confirm=function(t){var e=this;this.removeConfirm();var n=document.createElement("div");n.classList.add("acp-be-confirm"),n.innerHTML='\n\t\t\t<span class="acp-be-confirm__caret"></span>\n\t\t\t<em class="acp-be-confirm__info">'+oe+'</em>\n\t\t\t<div class="acp-be-confirm__controls"><strong>'+re+'</strong> <a data-confirm class="acp-be-confirm__controls__link -confirm">'+ie+'</a> <a data-cancel class="acp-be-confirm__controls__link -cancel">'+ae+"</a></div>\n\t\t",document.body.append(n),new Nt.a(t.getEditableTemplate().el.querySelector("[data-submit]"),n,{modifiers:{preventOverflow:{enabled:!1},hide:{enabled:!1},arrow:{element:".acp-be-confirm__caret"}}}),this._confirmElement=n,this.setConfirmed(!1),this.updateCount();var o=this.EditableModal.el.querySelector(".ac-modal__dialog"),r=n.querySelector("[data-confirm]"),i=n.querySelector("[data-cancel]");o.addEventListener("keypress",(function(n){"Enter"===n.key&&document.querySelectorAll(".acp-be-confirm").length>0&&(e.setConfirmed(!0),e.removeConfirm(),t.save())})),r.addEventListener("click",(function(){e.setConfirmed(!0),e.removeConfirm(),t.save()})),i.addEventListener("click",(function(){e.setConfirmed(!1),e.removeConfirm()}))},t.prototype.addTableEvents=function(){var t=this;this.Table.el.querySelectorAll(".check-column input[type=checkbox]").forEach((function(e){e.addEventListener("change",(function(){t._allSelected=!1,setTimeout((function(){if(t.Table.Selection.getCount()>1?t.toggleEditRows(!0):t.toggleEditRows(!1),t.Table.Selection.isAllSelected()&&t.total_count&&t.Table.Selection.getCount()<t.total_count){var e=t.Notice.createSelectAll(t.total_count);t.total_count=t.total_count?t.total_count:"all",e&&(e.style.display="inline",e.addEventListener("click",(function(){e.style.display="none",t._allSelected=!0,t.updateCount()})))}t.updateCount()}))}))})),this.Table.el.addEventListener("scroll",(function(t){var e=AC_SERVICES.getService("Table").el,n=e.querySelector(".acp-be-noticerow .acp-be-notice p");n&&(document.body.classList.contains("acp-overflow-table")?n.style.left=e.scrollLeft+"px":n.style.left=0)}))},t.prototype.toggleEditRows=function(t){void 0===t&&(t=!0),this.Notice.removeNotice(),this.EditRow.remove(),t&&(this.Notice.addNotice(),this.EditRow.add())},t.prototype.getSelectedCount=function(){var t=this.Table.Selection.getCount();return this._allSelected&&(t=this.total_count),t},t.prototype.updateCount=function(){var t=this;document.querySelectorAll("[data-acp-be-count]").forEach((function(e){e.innerHTML=t.getSelectedCount()}))},t.prototype.getItemsToProcess=function(){return this._allSelected?this.total_count:this.Table.Selection.getIDs()},t.prototype.removeConfirm=function(){this._confirmElement&&this._confirmElement.remove()},t}(),le=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),ce=function(){function t(t){this.EditCell=t,this.Cell=this.EditCell.Cell,this.reset()}return t.prototype.reset=function(){var t=this.Cell.el.querySelector(".acp-ie-controls__items");t&&t.remove()},t.prototype.isRevisioningEnabled=function(){return!this.Cell.getSettings().editable.hasOwnProperty("disable_revisioning")},t.prototype.render=function(){var e=t.createContainer(),n=this.Cell.el.querySelector(".acp-ie-value");this.Cell.el.appendChild(e),n&&M(e,n),t.appendButton(this.renderEdit(),e),this.isRevisioningEnabled()&&(t.appendButton(this.renderUndo(),e),t.appendButton(this.renderRedo(),e)),t.appendButton(this.renderClear(),e)},t.createContainer=function(){var t=document.createElement("div");return t.classList.add("acp-ie-controls"),t},t.appendButton=function(t,e){t&&e.appendChild(t)},t.prototype.renderEdit=function(){var e=this,n=t.createButtonElement(ACP_Editing.i18n.edit,"-edit");return n.tabIndex="",n.addEventListener("keypress",(function(t){"Enter"===t.key&&(t.preventDefault(),t.stopPropagation(),e.EditCell.openEditable())})),n.insertAdjacentHTML("beforeEnd",'<span class="dashicons dashicons-edit"></span>'),n.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),e.EditCell.openEditable()})),n},t.prototype.renderUndo=function(){var e=this;if(0===this.Cell.dataStorage.current_revision)return!1;var n=t.createButtonElement(ACP_Editing.i18n.undo,"-undo");return n.insertAdjacentHTML("beforeEnd",'<span class="dashicons dashicons-undo"></span>'),n.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),e.EditCell.undo()})),n},t.prototype.renderRedo=function(){var e=this,n=this.Cell.dataStorage;if(!(n.current_revision>=n.revisions.length-1)){var o=t.createButtonElement(ACP_Editing.i18n.redo,"-redo");return o.insertAdjacentHTML("beforeEnd",'<span class="dashicons dashicons-redo"></span>'),o.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),e.EditCell.redo()})),o}},t.prototype.renderClear=function(){var e=this,n=this.Cell.dataStorage;if(this.Cell.getSettings().editable.clear_button&&n.getValue()&&("object"!=typeof n.getValue()||0!==n.getValue().length)){var o=t.createButtonElement(ACP_Editing.i18n.delete,"-clear");return o.insertAdjacentHTML("beforeEnd",'<span class="dashicons dashicons-no-alt"></span>'),o.addEventListener("click",(function(t){t.preventDefault(),t.stopPropagation(),e.EditCell.clear()})),o}},t.createButtonElement=function(t,e){var n=document.createElement("span");return n.classList.add("acp-ie-controls__item"),n.classList.add(e),n.setAttribute("title",t),n},t}(),ue=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return le(e,t),e.prototype.render=function(){this.wrapImages()},e.prototype.wrapImages=function(){var t=this.Cell.el.querySelectorAll(".ac-image"),e=this.Cell.el.querySelector(".acp-ie-controls");t&&(t.forEach((function(t){var e=t.dataset.mediaId,n=document.createElement("div"),o=document.createElement("div");o.classList.add("acp-ie-image-controls"),n.dataset.mediaId=e,n.classList.add("acp-ie-image-item"),t.parentNode.insertBefore(n,t),n.appendChild(t),n.appendChild(o)})),this.Cell.getSettings().editable.multiple?(this.addSingleImageDelete(),e.classList.add("-multiple")):(this.moveActions(),e.classList.add("-single")))},e.prototype.addSingleImageDelete=function(){var t=this,e=this.Cell.el.querySelectorAll(".acp-ie-image-item");e&&e.forEach((function(e){var n=e.querySelector(".acp-ie-image-controls"),o=t.renderDelete();n.append(o)}))},e.prototype.moveActions=function(){var t=this.Cell.el.querySelector(".acp-ie-controls"),e=this.Cell.el.querySelector(".acp-ie-image-controls");t&&e&&(t.querySelectorAll(".acp-ie-controls__item").forEach((function(t){e.append(t)})),e.classList.add("-single"))},e.prototype.renderDelete=function(){var t=this,n=this,o=e.createButtonElement(ACP_Editing.i18n.delete,"-delete");return o.insertAdjacentHTML("beforeend",'<span class="dashicons dashicons-no-alt"></span>'),o.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation();var o=e.target.closest(".acp-ie-image-item"),r=n.Cell.dataStorage.getValue();r=Array.isArray(r)?r.filter((function(t){return parseInt(t)!==parseInt(o.dataset.mediaId)})):"",t.EditCell.saveValue(r)})),o},e.prototype.renderDownload=function(){var t=this,e=ce.createButtonElement(ACP_Editing.i18n.download,"-download");return e.insertAdjacentHTML("beforeEnd",'<span class="dashicons dashicons-migrate"></span>'),e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation(),t.EditCell.redo()})),e},e}(ce);function pe(t,e){var n=document.createElement("tr");e=e.replace(/\./g,"\\."),n.innerHTML=t;var o=n.querySelector("td.column-"+e);if(o){var r=o.querySelectorAll(".row-actions");return r&&r.forEach((function(t){t.remove()})),o.innerHTML}return""}var de="acp-ie-editable",fe="acp-ie-value",he=function(){function t(t,e,n,o){this._editableClass=o,this.InlineEdit=t,this.Cell=e,this.Middleware=n,this.Editable=null,this.Popper=null,this.wrapCellContent(),this.attachEditable(),this.insertControls(),this.attachEvents()}return t.prototype.attachEditable=function(){var t=this;if(this.Cell.dataStorage&&!this.Editable){var e=this.Cell.dataStorage.getFormattedValue();null!==e&&(this.Editable=new this._editableClass(this.Middleware.getArgs()),this.Editable.setValue(e),this.Cell.getObjectID()&&this.Editable.setObjectId(this.Cell.getObjectID()),this.Editable.Events.addListener("save",(function(e){t.saveValue(e.getValue())})),this.Editable.Events.addListener("close",(function(){me.destroy(),t.destroyPopper()})))}},t.prototype.attachEvents=function(){var t=this;this.getTargetElement().addEventListener("click",(function(e){t.InlineEdit._enabled&&"A"!==e.target.tagName&&(e.preventDefault(),e.stopPropagation(),t.openEditable())})),document.addEventListener("ACP_InlineEditing_Close",(function(){t.Popper&&t.Editable.close()}))},t.prototype.saveValue=function(t){var e=this;this.Editable.toggleLoading(!0),this.Cell.dataStorage.storeRevision(t).save().done((function(t){if(!t.success)return e.Editable.toggleLoading(!1),void e.Editable.setError(t.data.message);e.setValue(t.data),e.Editable.setValue(t.data.value).close(),e.Editable.toggleLoading(!1);var n={column:e.Cell.getName(),item:e.Cell.getObjectID(),value:t.data.value};document.dispatchEvent(new CustomEvent("ACP_InlineEditing_After_Save",{detail:n}))}))},t.prototype.openEditable=function(){var t=AC_SERVICES.getService("Editing").InlineEdit;t.closeOpenEditables();var e=this.getPopperContainer();e.append(this.Editable.get()),this.popper=new Nt.a(this.getTargetElement(),e,{modifiers:{arrow:{element:".ac-edit-popper__caret"}}}),t._open_editables.push(this.Editable),me.bind()},t.prototype.wrapCellContent=function(){var t=this,e=this.Cell.getSettings().editable,n=document.createElement("span");for(this.Cell.el.classList.add(de),this.Cell.el.classList.add(de+"--"+e.type),n.classList.add(fe);this.Cell.el.firstChild;)n.appendChild(this.Cell.el.firstChild);this.Cell.el.append(n);var o=n.querySelectorAll(".row-actions");return o&&o.forEach((function(e){t.Cell.el.appendChild(e)})),n},t.prototype.undo=function(){var t=this;this.Cell.dataStorage.undo()&&this.Cell.dataStorage.save().done((function(e){t.setValue(e.data),t.Editable.setValue(e.data.value)}))},t.prototype.redo=function(){var t=this;this.Cell.dataStorage.redo()&&this.Cell.dataStorage.save().done((function(e){t.setValue(e.data),t.Editable.setValue(e.data.value)}))},t.prototype.clear=function(){var t=this;this.Cell.dataStorage.storeRevision("").save().done((function(e){t.setValue(e.data),t.Editable.setValue(e.data.value)}))},t.prototype.setCellValue=function(t){var e=this.Cell.el.querySelector(".row-actions");this.Cell.el.innerHTML=t,e&&this.Cell.el.append(e),this.afterSetValue()},t.prototype.setValue=function(t){var e=this,n=t.display_value;n?this.setCellValue(n):(this.getTargetElement().style.backgroundColor="#f2f093",this.getRowsHTML([t.id]).done((function(n){n.hasOwnProperty("data")&&e.setValueFromRowHTML(n.data.table_rows[t.id])})))},t.prototype.valueUpdateVisual=function(){var t=this.getTargetElement();t&&(t.style.animation="acp-value-highlight .9s")},t.prototype.getTargetElement=function(){var t=this.Cell.el.querySelector("."+fe);return t||!1},t.prototype.insertControls=function(){(new ce(this).render(),this.Middleware.hasMediaActions())&&new ue(this).render();this.moveActions()},t.prototype.moveActions=function(){var t=this.Cell.getSettings().editable;if(t.hasOwnProperty("js")&&t.js.hasOwnProperty("selector")){var e=this.Cell.el.querySelector(t.js.selector);M(this.Cell.el.querySelector(".acp-ie-controls"),e)}},t.prototype.getRowsHTML=function(t){return void 0===t&&(t=[]),jQuery.ajax({url:window.location.href,method:"post",data:{ac_action:"get_table_rows",ac_ids:t,_ajax_nonce:AC.ajax_nonce}})},t.prototype.afterSetValue=function(){this.wrapCellContent(),this.valueUpdateVisual(),this.insertControls(),this.attachEvents(),this.Cell.el.dispatchEvent(new CustomEvent("ACP_InlineEditing_After_SetValue"))},t.prototype.setValueFromRowHTML=function(t){var e=this.Cell.getSettings();this.setCellValue(pe(t,e.name))},t.prototype.destroyPopper=function(){document.querySelectorAll(".ac-edit-popper").forEach((function(t){t.remove()})),this.popper&&this.popper.destroy()},t.prototype.getPopperContainer=function(){return this.Popper=document.createElement("div"),this.Popper.classList.add("ac-edit-popper"),this.Popper.insertAdjacentHTML("afterbegin",'<span class="ac-edit-popper__caret">'),document.body.append(this.Popper),this.Popper},t}(),me=function(){function t(){}return t.bind=function(){document.addEventListener("keyup",t.escapeEvent),document.addEventListener("click",t.clickEvent),document.querySelectorAll(".select2-container--acs2").forEach((function(t){t.addEventListener("click",(function(t){t.stopPropagation()}))}))},t.destroy=function(){document.removeEventListener("keyup",t.escapeEvent),document.removeEventListener("click",t.clickEvent)},t.escapeEvent=function(t){"Escape"===t.key&&document.dispatchEvent(new CustomEvent("ACP_InlineEditing_Close"))},t.clickEvent=function(e){e.target!==document.body&&(t.checkInvalidParentClasses(e.target)||document.dispatchEvent(new CustomEvent("ACP_InlineEditing_Close")))},t.checkInvalidParentClasses=function(e){var n=!1;return["mce-container","wp-editor-wrap","media-modal","select2-container"].map((function(t){e.classList.contains(t)&&(n=!0)})),["ui-","mce-"].map((function(t){e.hasAttribute("class")&&-1!==e.getAttribute("class").indexOf(t)&&(n=!0)})),["wp-link"].map((function(t){-1!==e.id.indexOf(t)&&(n=!0)})),!!n||!!e.parentElement&&t.checkInvalidParentClasses(e.parentElement)},t}(),ye=function(){function t(t){this.name=t.column_name,this.id=t.id,this.current_revision=0,this.revisions=[t.value],this.formattedValue=t.formatted_value?t.formatted_value:t.value}return t.prototype.getCell=function(){return AC_SERVICES.getService("Table").Table.Cells.get(this.id,this.name)},t.prototype.setFormattedValue=function(t){this.formattedValue=t},t.prototype.getFormattedValue=function(){return this.formattedValue},t.prototype.setCurrentRevision=function(t){return this.current_revision=t,this},t.prototype.getCurrentRevision=function(){return this.current_revision},t.prototype.getValue=function(){return this.revisions[this.getCurrentRevision()]},t.prototype.updateValue=function(t){return this.getCell().el.target.innerHTML=t||this.getValue()},t.prototype.storeRevision=function(t){for(var e=this.revisions.length-this.getCurrentRevision()-1,n=0;n<e;n++)this.revisions.pop();return this.revisions.push(t),this.setCurrentRevision(this.getCurrentRevision()+1),this},t.prototype.save=function(){return jQuery.ajax({url:ajaxurl,data:{action:"acp_editing_single_request",method:"save",list_screen:AC.list_screen,layout:AC.layout,column:this.name,id:this.id,screen:AC.screen,value:this.getValue(),_ajax_nonce:AC.ajax_nonce},method:"POST",dataType:"json"})},t.prototype.undo=function(){return!!this.prev()},t.prototype.redo=function(){return!!this.next()},t.prototype.prev=function(){var t=this.getCurrentRevision();return 0!==t&&(this.setCurrentRevision(t-1),!0)},t.prototype.next=function(){var t=this.getCurrentRevision();return t!==this.revisions.length-1&&(this.setCurrentRevision(t+1),!0)},t}();function _e(t){return jQuery.ajax({url:ajaxurl,method:"post",data:{action:"acp_editing_single_request",method:"get_editable_values",ids:t,list_screen:AC.list_screen,layout:AC.layout,_ajax_nonce:AC.ajax_nonce}})}var ge=function(t){if(t.classList.contains("no-items"))return 0;var e,n,o=ve(t.id);if(!o){var r=t.querySelector(".check-column input[type=checkbox]");r&&(o=ve(r.id))}if(!o){var i=t.parentElement.querySelector(".edit a");if(i){var a=i.getAttribute("href");a&&(o=parseInt((e="id",(n=a).includes("?")?new URLSearchParams(n.split("?")[1]).get(e):null)))}}return t.dataset.id=o.toString(),o},ve=function(t){var e=t.split(/[_,\-]+/);return parseInt(e[e.length-1])},be=function(){function t(t,e,n,o){this.Editables=e,this.Table=t,this.Middleware=new Ft(this.Editables),this._enabled=n,this._version=o,this._initialised=!1,this._open_editables=[],this._setTableClass(),this._addEvents(),this._initCells(),this._setInputState()}return t.prototype.isEnabled=function(){return this._enabled},t.prototype.getVersion=function(){return this._version},t.prototype.enable=function(){this._enabled=!0,this._storePreference(),this._setTableClass(),this._initCells(),this._setInputState()},t.prototype._setInputState=function(){var t=document.getElementById("acp-enable-editing");t&&(t.checked=this.isEnabled())},t.prototype.disable=function(){this._enabled=!1,this._storePreference(),this._setTableClass()},t.prototype.setInitialised=function(t){return void 0===t&&(t=!0),this._initialised=t,this},t.prototype.isInitialised=function(){return this._initialised},t.prototype._setTableClass=function(){var t=this.Table.el;t.classList.add("acp-ie-table"),t.classList.add("acp-ie-table--"+this.getVersion()),this.isEnabled()?(t.classList.add("acp-ie-enabled"),t.classList.remove("acp-ie-disabled")):(t.classList.add("acp-ie-disabled"),t.classList.remove("acp-ie-enabled"))},t.prototype._initCells=function(){var t=this;if(!this.isInitialised()&&this.isEnabled()){var e=this.Table.Columns.getColumns();Object.keys(e).forEach((function(n){var o=e[n];if(o&&o.editable&&o.editable.type){var r=t.Middleware.get(o),i=r.getEditable();i?t.Table.Cells.getByName(n).forEach((function(e){e.hasOwnProperty("IEdit")||e.dataStorage&&(e.IEdit=new he(t,e,r,i))})):console.info(o.editable.type+" does not exist or is not loaded")}})),this.setInitialised()}},t.prototype.initCell=function(t){var e=t.getSettings();if(e&&e.editable&&e.editable.type&&e.editable.inline_edit&&!t.hasOwnProperty("IEdit")){var n=this.Middleware.get(e),o=n.getEditable();o&&(t.dataStorage||(t.dataStorage=new ye({column_name:t.getName(),id:t.getObjectID()})),t.IEdit=new he(this,t,n,o))}},t.prototype.initRow=function(t){var e=this;_e([t]).done((function(t){t.data.editable_values.forEach((function(t){var n=e.Table.Cells.get(t.id,t.column_name);e.initCell(n),n.IEdit&&n.IEdit.hasOwnProperty("Editable")&&n.IEdit.Editable.setValue(t.value)}))}))},t.prototype.updateRowCells=function(t){var e=this,n=t.target,o=ge(n),r=this.Table.Columns.getColumns();Object.keys(r).forEach((function(t){var r=e.Table.Cells.get(o,t);r&&(r.el=function(t,e){return t.querySelector("td.column-"+e)}(n,t),r.IEdit&&r.IEdit.afterSetValue())}))},t.prototype._storePreference=function(){var t=this.isEnabled()?1:0;return jQuery.post(ajaxurl,{action:"acp_editing_single_request",method:"editability_state",value:t,list_screen:AC.list_screen,layout:AC.layout,_ajax_nonce:AC.ajax_nonce})},t.prototype._addEvents=function(){var t=this,e=this,n=document.getElementById("acp-enable-editing");n&&n.addEventListener("change",(function(){n.checked?e.enable():e.disable()})),document.addEventListener("ACP_InlineEditing_Close",(function(){t.closeOpenEditables()})),this.updateRowCell=this.updateRowCells.bind(this),jQuery(this.Table.el).on("updated","tr",this.updateRowCell)},t.prototype.closeOpenEditables=function(){this._open_editables.forEach((function(t){t.close()})),this._open_editables=[]},t}(),Ee=function(){function t(){}return t.map=function(t,e){return Object.keys(e).forEach((function(n){var o=e[n],r=t.get(n);r.editable=o.editable,r.type=o.type,r.editable.inline_edit=o.inline_edit,r.editable.hasOwnProperty("bulk_editable")||(r.editable.bulk_editable=o.bulk_edit)})),t},t}(),we=function(t,e){return e.forEach((function(e){var n=t.get(e.id,e.column_name);if(n){var o=n.getSettings().editable;o&&(o.hasOwnProperty("store_values")&&!o.store_values&&(e.formatted_value=e.value,e.value=Object.keys(e.value)),o.hasOwnProperty("store_single_value")&&o.store_single_value&&(e.formatted_value=e.value,e.value=Object.keys(e.value)[0]),n.dataStorage=new ye(e))}})),t},Ce=function(){function t(){}return t.prototype.updateSelectedCells=function(t,e){var n=this;void 0===e&&(e="");var o=Se().Selection.getIDs();0!==o.length&&this.getRows(o).done((function(o){if(o.hasOwnProperty("data")&&o.data.hasOwnProperty("table_rows")){var r=o.data.table_rows;Object.keys(r).forEach((function(e){var n=Se().Cells.get(e,t),o=n.IEdit;o?o.setValueFromRowHTML(r[e]):n.getElement().innerHTML=pe(r[e],t)})),n.updateSelectedEditingCells(t,r,e)}}))},t.prototype.updateSelectedEditingCells=function(t,e,n){var o=Se().Selection.getIDs();0!==o.length&&jQuery.ajax({url:ajaxurl,method:"post",data:{action:"acp_editing_single_request",method:"get_editable_values",ids:o,column:t,list_screen:AC.list_screen,layout:AC.layout,_ajax_nonce:AC.ajax_nonce}}).done((function(o){o.data.editable_values.forEach((function(o){if(o.column_name===t){var r=Se().Cells.get(o.id,t),i=r.IEdit;i&&(r.dataStorage.storeRevision(n),i.Editable.setValue(o.value),i.setValueFromRowHTML(e[o.id]))}}))}))},t.prototype.getRows=function(t){return jQuery.ajax({url:window.location.href,method:"post",data:{ac_action:"get_table_rows",ac_ids:t,_ajax_nonce:AC.ajax_nonce}})},t}(),Se=function(){return AC_SERVICES.getService("Table")};n(3);AC_SERVICES.addListener("Table.Ready",(function(t){var e=t.table;if(AC.hasOwnProperty("layout")&&null!==AC.layout){Ee.map(e.Columns,ACP_Editing_Columns),window.AdminColumns=void 0===window.AdminColumns?{}:window.AdminColumns,AdminColumns.Editing={},AdminColumns.Editing.Helper=nt.a;var n={};if(AC_SERVICES.registerService("Editing",n),n.Editables=new tt,n.Editables.initEditables(),n.Helper=nt.a,Te(ACP_Editing_Columns)&&(n.BulkEdit=new se(e,n.Editables)),n.TableUpdate=new Ce,Oe(ACP_Editing_Columns)){_e(e.getIdsFromTable()).done((function(t){if(t.success&&t.data){if(t.data.hasOwnProperty("editable_values")){var o=ACP_Editing.inline_edit.hasOwnProperty("active")&&ACP_Editing.inline_edit.active;ACP_Editing.inline_edit.hasOwnProperty("persistent")&&ACP_Editing.inline_edit.persistent&&(o=!0),we(e.Cells,t.data.editable_values),n.InlineEdit=new be(e,n.Editables,o,ACP_Editing.inline_edit.version)}}else console.info("Admin Columns Inline Edit could not be loaded")}))}else{var o=document.querySelector(".ac-table-button.-toggle.-iedit");o&&o.remove()}}}));var Oe=function(t){for(var e=0,n=Object.keys(t);e<n.length;e++){var o=t[n[e]];if(o.hasOwnProperty("inline_edit")&&o.inline_edit)return!0}return!1},Te=function(t){for(var e=0,n=Object.keys(t);e<n.length;e++){var o=t[n[e]];if(o.hasOwnProperty("bulk_edit")&&o.bulk_edit)return!0}return!1}}]);