Changeset 2955361
- Timestamp:
- 08/18/2023 12:35:02 PM (2 years ago)
- Location:
- custom-post-types
- Files:
-
- 3 added
- 13 edited
-
assets/banner-1544x500.png (added)
-
assets/banner-772x250.png (modified) (previous)
-
assets/icon-256x256.png (modified) (previous)
-
assets/icon.svg (modified) (1 diff)
-
tags/4.0.10/assets/dashboard-icon.svg (added)
-
tags/4.0.10/assets/icon-256x256.png (modified) (previous)
-
tags/4.0.10/assets/icon.svg (modified) (1 diff)
-
tags/4.0.10/assets/js/backend.js (modified) (1 diff)
-
tags/4.0.10/includes/classes/Core.php (modified) (2 diffs)
-
tags/4.0.10/includes/classes/Utils.php (modified) (1 diff)
-
trunk/assets/dashboard-icon.svg (added)
-
trunk/assets/icon-256x256.png (modified) (previous)
-
trunk/assets/icon.svg (modified) (1 diff)
-
trunk/assets/js/backend.js (modified) (1 diff)
-
trunk/includes/classes/Core.php (modified) (2 diffs)
-
trunk/includes/classes/Utils.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
custom-post-types/assets/icon.svg
r2955302 r2955361 1 1 <?xml version="1.0" encoding="iso-8859-1"?> 2 2 <svg style="background-color: #00acfe;" fill="#fff" height="500px" width="500px" version="1.1" id="custom-post-types-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 3 viewBox="-50 -50 6 20 620" xml:space="preserve">3 viewBox="-50 -50 612 612" xml:space="preserve"> 4 4 <style> 5 5 @keyframes pulse-1 { -
custom-post-types/tags/4.0.10/assets/icon.svg
r2955028 r2955361 1 <svg id="Plugin_icon" data-name="Plugin icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 16"><title>plugin-icon</title><path id="_Track_" data-name="<Track>" d="M1,3.17V18H19V4H8V3.17A1.18,1.18,0,0,0,6.82,2H2.18a1.12,1.12,0,0,0-.83.34A1.1,1.1,0,0,0,1,3.17ZM10,6V8H3V6Zm7,0V16H12V6Zm-7,4v2H3V10Zm0,4v2H3V14Z" transform="translate(-1 -2)" style="fill:#00acfe"/></svg> 1 <?xml version="1.0" encoding="iso-8859-1"?> 2 <svg style="background-color: #00acfe;" fill="#fff" height="500px" width="500px" version="1.1" id="custom-post-types-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 3 viewBox="-50 -50 612 612" xml:space="preserve"> 4 <style> 5 @keyframes pulse-1 { 6 0% { 7 transform: scale(1); 8 } 9 5% { 10 transform: scale(1.1); 11 } 12 10% { 13 transform: scale(1); 14 } 15 } 16 @keyframes pulse-2 { 17 10% { 18 transform: scale(1); 19 } 20 15% { 21 transform: scale(1.1); 22 } 23 20% { 24 transform: scale(1); 25 } 26 } 27 @keyframes pulse-3 { 28 20% { 29 transform: scale(1); 30 } 31 25% { 32 transform: scale(1.1); 33 } 34 30% { 35 transform: scale(1); 36 } 37 } 38 @keyframes pulse-4 { 39 30% { 40 transform: scale(1); 41 } 42 35% { 43 transform: scale(1.1); 44 } 45 40% { 46 transform: scale(1); 47 } 48 } 49 50 .part { 51 transform-origin: 181px 181px; 52 53 animation-name: pulse-1; 54 animation-duration: 2s; 55 animation-timing-function: ease-in-out; 56 animation-iteration-count: infinite; 57 } 58 59 .part-2 { 60 transform-origin: 431px 181px; 61 62 animation-name: pulse-2; 63 } 64 65 .part-3 { 66 transform-origin: 431px 431px; 67 68 animation-name: pulse-3; 69 } 70 71 .part-4 { 72 transform-origin: 181px 75%; 73 74 animation-name: pulse-4; 75 } 76 </style> 77 <g> 78 <g class="part part-1"> 79 <path d="M237.714,70.29c0-7.543,0-62.709,0-70.289H54.857C24.609,0.001,0,24.609,0,54.858v182.857c8.319,0,84.971,0,94.903,0 80 c12.46,0,21.328,12.255,17.329,24.124c-0.984,2.921-11.208,16.844-1.413,33.807c11.752,20.352,40.903,20.345,52.649,0 81 c5.486-9.501,5.617-20.908,0.078-30.502c-7.034-12.186,1.792-27.429,15.837-27.429h58.331v-33.718 82 c-0.844,0.078-1.69,0.139-2.534,0.184c-36.257,1.925-70.608-26.622-70.608-67.038C164.571,95.879,200.429,66.865,237.714,70.29z" 83 /> 84 </g> 85 <g class="part part-2"> 86 <path d="M457.143,0.001H274.286c0,8.319,0,84.971,0,94.903c0,14.069-15.265,22.86-27.427,15.837 87 c-19.917-11.494-45.716,2.547-45.716,26.403c0,23.884,25.817,37.888,45.716,26.403c12.187-7.034,27.427,1.792,27.427,15.837 88 v58.331h33.718c-1.248-13.605,1.764-27.36,8.859-39.648c25.826-44.727,90.231-44.611,115.99,0 89 c7.033,12.178,10.114,25.969,8.86,39.647c7.543,0,62.709,0,70.289,0V54.858C512,24.609,487.391,0.001,457.143,0.001z"/> 90 </g> 91 <g class="part part-3"> 92 <path d="M417.097,274.286c-14.069,0-22.857-15.264-15.837-27.427c5.605-9.71,5.342-21.116-0.078-30.503 93 c-11.62-20.124-40.836-20.458-52.648,0c-5.389,9.333-5.703,20.76-0.079,30.503c7.055,12.222-1.833,27.427-15.838,27.427h-58.331 94 v33.704c13.507-1.24,27.274,1.714,39.647,8.859c44.734,25.829,44.62,90.228,0,115.991c-12.373,7.144-26.142,10.1-39.647,8.859 95 c0,7.545,0,62.729,0,70.3h182.857c30.248,0,54.857-24.609,54.857-54.857V274.286C503.681,274.286,427.029,274.286,417.097,274.286 96 z"/> 97 </g> 98 <g class="part part-4"> 99 <path d="M295.645,348.52c-17.232-9.951-30.41,0.552-34.951,1.758c-11.621,3.087-22.979-5.704-22.979-17.674v-58.318h-33.718 100 c1.24,13.506-1.714,27.274-8.859,39.647c-25.805,44.694-90.201,44.668-115.991,0c-7.145-12.373-10.099-26.141-8.859-39.647 101 c-7.543,0-62.708,0-70.288,0v182.857c0,30.248,24.609,54.857,54.857,54.857h182.857c0-8.264,0-85.003,0-94.915 102 c0-14.069,15.265-22.86,27.427-15.837c9.669,5.582,21.075,5.365,30.503-0.079C316.122,389.346,315.782,360.148,295.645,348.52z"/> 103 </g> 104 </g> 105 </svg> -
custom-post-types/tags/4.0.10/assets/js/backend.js
r2955028 r2955361 15 15 * Licensed under the GPLv2 license or later. 16 16 */ 17 !function(e,t){var n={version:302};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var i=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(i)&&i>=n.version)return}if(!Color.fn.hasOwnProperty("to_s")){Color.fn.to_s=function(e){"hex"===(e=e||"hex")&&this._alpha<1&&(e="rgba");var t="";return"hex"===e?t=this.toString():this.error||(t=this.toCSS(e).replace(/\(\s+/,"(").replace(/\s+\)/,")")),t},window.wpColorPickerAlpha=n;var r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(e){return void 0===e&&(e=this._color),this.alphaOptions.alphaEnabled?(e=e.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(e=e.replace(/\s+/g,"")),e):e.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(e){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(e){var t=this,n=function(n){var i=e.val(),r=new Color(i),o=(i=i.replace(/^(#|(rgb|hsl)a?)/,""),t.alphaOptions.alphaColorType);e.removeClass("iris-error"),r.error?""!==i&&e.addClass("iris-error"):"hex"===o&&"keyup"===n.type&&i.match(/^[0-9a-fA-F]{3}$/)||r.toIEOctoHex()!==t._color.toIEOctoHex()&&t._setOption("color",t._getColor(r))};e.on("change",n).on("keyup",t._debounce(n,100)),t.options.hide&&e.one("focus",(function(){t.show()}))},_initControls:function(){if(this._super(),this.alphaOptions.alphaEnabled){var t=this,n=t.controls.strip.clone(!1,!1),i=n.find(".iris-slider-offset"),r={stripAlpha:n,stripAlphaSlider:i};n.addClass("iris-strip-alpha"),i.addClass("iris-slider-offset-alpha"),n.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,(function(e,n){t.controls[e]=n})),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(e,n){t.active="strip",t._color._alpha=parseFloat(n.value/100),t._change.apply(t,arguments)}})}},_dimensions:function(e){if(this._super(e),this.alphaOptions.alphaEnabled){var t,n,i,r,o,s=this.options,a=this.controls.square,l=this.picker.find(".iris-strip");for(t=Math.round(this.picker.outerWidth(!0)-(s.border?22:0)),n=Math.round(a.outerWidth()),i=Math.round((t-n)/2),r=Math.round(i/2),o=Math.round(n+2*i+2*r);o>t;)i=Math.round(i-2),r=Math.round(r-1),o=Math.round(n+2*i+2*r);a.css("margin","0"),l.width(i).css("margin-left",r+"px")}},_change:function(){var t=this,n=t.active;if(t._super(),t.alphaOptions.alphaEnabled){var i=t.controls,o=parseInt(100*t._color._alpha),s=t._color.toRgb(),a=["rgb("+s.r+","+s.g+","+s.b+") 0%","rgba("+s.r+","+s.g+","+s.b+", 0) 100%"];t.picker.closest(".wp-picker-container").find(".wp-color-result");t.options.color=t._getColor(),i.stripAlpha.css({background:"linear-gradient(to bottom, "+a.join(", ")+"), url("+r+")"}),n&&i.stripAlphaSlider.slider("value",o),t._color.error||t.element.removeClass("iris-error").val(t.options.color),t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",(function(){var n=e(this).data("color");t.alphaOptions.alphaReset&&(t._color._alpha=1,n=t._getColor()),t._setOption("color",n)}))}},_paintDimension:function(e,t){var n=!1;this.alphaOptions.alphaEnabled&&"strip"===t&&(n=this._color,this._color=new Color(n.toString()),this.hue=this._color.h()),this._super(e,t),n&&(this._color=n)},_setOption:function(e,t){if("color"!==e||!this.alphaOptions.alphaEnabled)return this._super(e,t);t=""+t,newColor=new Color(t).setHSpace(this.options.mode),newColor.error||this._getColor(newColor)===this._getColor()||(this._color=newColor,this.options.color=this._getColor(),this.active="external",this._change())},color:function(e){return!0===e?this._color.clone():void 0===e?this._getColor():void this.option("color",e)}}),e.widget("wp.wpColorPicker",e.wp.wpColorPicker,{alphaOptions:{alphaEnabled:!1},_getAlphaOptions:function(){var t=this.element,n=t.data("type")||this.options.type,i=t.data("defaultColor")||t.val(),r={alphaEnabled:t.data("alphaEnabled")||!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"rgb",alphaColorWithSpace:!1};return r.alphaEnabled&&(r.alphaEnabled=t.is("input")&&"full"===n),r.alphaEnabled?(r.alphaColorWithSpace=i&&i.match(/\s/),e.each(r,(function(e,n){var o=t.data(e)||n;switch(e){case"alphaCustomWidth":o=o?parseInt(o,10):0,o=isNaN(o)?n:o;break;case"alphaColorType":o.match(/^(hex|(rgb|hsl)a?)$/)||(o=i&&i.match(/^#/)?"hex":i&&i.match(/^hsla?/)?"hsl":n);break;default:o=!!o}r[e]=o})),r):r},_create:function(){e.support.iris&&(this.alphaOptions=this._getAlphaOptions(),this._super())},_addListeners:function(){if(!this.alphaOptions.alphaEnabled)return this._super();var t=this,n=t.element,i=t.toggler.is("a");this.alphaOptions.defaultWidth=n.width(),this.alphaOptions.alphaCustomWidth&&n.width(parseInt(this.alphaOptions.defaultWidth+this.alphaOptions.alphaCustomWidth,10)),t.toggler.css({position:"relative","background-image":"url("+r+")"}),i?t.toggler.html('<span class="color-alpha" />'):t.toggler.append('<span class="color-alpha" />'),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":n.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),n.iris({change:function(e,n){t.colorAlpha.css({"background-color":n.color.to_s(t.alphaOptions.alphaColorType)}),"function"==typeof t.options.change&&t.options.change.call(this,e,n)}}),t.wrap.on("click.wpcolorpicker",(function(e){e.stopPropagation()})),t.toggler.on("click",(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()})),n.on("change",(function(r){var o=e(this).val();(n.hasClass("iris-error")||""===o||o.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r))})),t.button.on("click",(function(r){e(this).hasClass("wp-picker-default")?n.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(n.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r),n.trigger("change"))}))}})}}(jQuery)},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n.p,n.p,n (3);var i=n(0),r=n.n(i);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,s=Object.create(o.prototype),a=new $(r||[]);return i(s,"_invoke",{value:D(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function f(){}function g(){}function m(){}var v={};u(v,a,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(C([])));b&&b!==t&&n.call(b,a)&&(v=b);var w=m.prototype=f.prototype=Object.create(v);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){var r;i(this,"_invoke",{value:function(i,s){function a(){return new t((function(r,a){!function i(r,s,a,l){var c=h(e[r],e,s);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==o(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,l)}),(function(e){i("throw",e,a,l)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,l)}))}l(c.arg)}(i,s,r,a)}))}return r=r?r.then(a,a):a()}})}function D(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return E()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=x(s,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function $(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:E}}function E(){return{value:void 0,done:!0}}return g.prototype=m,i(w,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},_(k.prototype),u(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new k(d(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=C,$.prototype={constructor:$,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function a(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(i,r)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(e){a(o,i,r,s,l,"next",e)}function l(e){a(o,i,r,s,l,"throw",e)}s(void 0)}))}}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,s=void 0,s=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===o(s)?s:String(s)),i)}var r,s}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"appendFieldEvents",value:function(e,t){this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]);var n=this.fieldsEvents[e];n&&r.a.each(n,(function(e,n){r()(t).on(e,(function(e){n(t,e)}))}))}},{key:"sanitizeTitle",value:function(e){e=(e=e.replace(/^\s+|\s+$/g,"")).toLowerCase();for(var t="àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;",n=0,i=t.length;n<i;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuuncescrzyuudtn------".charAt(n));return e=e.replace(".","-").replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/\//g,"")}},{key:"autoFillKey",value:function(e,t){var n=this;r()(t).add(e).on("focusout",(function(){var i=r()(e).val(),o=r()(t).val();!i.length&&o.length&&r()(e).val(n.sanitizeTitle(o))}))}},{key:"copyToClipboard",value:function(e){var t=navigator.clipboard.writeText(r()(e).val()).then((function(){return!0}),(function(){return!1}));return l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"disableProFieldSelectOptions",value:function(e){var t=r()(e).closest(".cpt-fields-section");if(t&&"manage_cpt_field"===t.data("id")){var n=r()(e).find("select > option");r.a.each(n,(function(e,t){t.text.endsWith(" [PRO only]")&&(t.disabled=!0)}))}}}])&&c(t.prototype,n),i&&c(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();window.cptUtils=new u,wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.checkbox={load:function(e,t){var n=r()(e).find('input[type="checkbox"][required]');r()(n).on("click",(function(t){r()(n).prop("required",!r()(e).find('input[type="checkbox"]:checked').length)}))}},e}));n(4);wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.color={load:function(e,t){var n=r()(e).find(".cpt-color-section:first"),i=r()(n).children("input");r()(i).wpColorPicker({palettes:!0})}},e}));n(5);function d(e){return e[e.length-1]}function h(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function p(e,t){return e?e.split(t):[]}function f(e,t,n){return(void 0===t||e>=t)&&(void 0===n||e<=n)}function g(e,t,n){return e<t?t:e>n?n:e}function m(e,t,n={},i=0,r=""){r+=`<${Object.keys(n).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(r=r(i)),`${e} ${t}="${r}"`},e)}></${e}>`;const o=i+1;return o<t?m(e,t,n,o,r):r}function v(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function y(e){return new Date(e).setHours(0,0,0,0)}function b(){return(new Date).setHours(0,0,0,0)}function w(...e){switch(e.length){case 0:return b();case 1:return y(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function _(e,t){const n=new Date(e);return n.setDate(n.getDate()+t)}function k(e,t){const n=new Date(e),i=n.getMonth()+t;let r=i%12;r<0&&(r+=12);const o=n.setMonth(i);return n.getMonth()!==r?n.setDate(0):o}function D(e,t){const n=new Date(e),i=n.getMonth(),r=n.setFullYear(n.getFullYear()+t);return 1===i&&2===n.getMonth()?n.setDate(0):r}function x(e,t){return(e-t+7)%7}function S(e,t,n=0){const i=new Date(e).getDay();return _(e,x(t,n)-x(i,n))}function A(e,t){return Math.round((e-t)/6048e5)+1}function $(e){const t=S(e,4,1);return A(t,S(new Date(t).setMonth(0,4),4,1))}function C(e,t){const n=S(new Date(e).setMonth(0,1),t,t),i=S(e,t,t),r=A(i,n);if(r<53)return r;return i===S(new Date(e).setDate(32),t,t)?1:r}function E(e){return C(e,0)}function O(e){return C(e,6)}function L(e,t){const n=new Date(e).getFullYear();return Math.floor(n/t)*t}function j(e,t,n){if(1!==t&&2!==t)return e;const i=new Date(e);return 1===t?n?i.setMonth(i.getMonth()+1,0):i.setDate(1):n?i.setFullYear(i.getFullYear()+1,0,0):i.setMonth(0,1),i.setHours(0,0,0,0)}const M=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,T=/[\s!-/:-@[-`{-~年月日]+/;let N={};const F={y:(e,t)=>new Date(e).setFullYear(parseInt(t,10)),m(e,t,n){const i=new Date(e);let r=parseInt(t,10)-1;if(isNaN(r)){if(!t)return NaN;const e=t.toLowerCase(),i=t=>t.toLowerCase().startsWith(e);if(r=n.monthsShort.findIndex(i),r<0&&(r=n.months.findIndex(i)),r<0)return NaN}return i.setMonth(r),i.getMonth()!==function e(t){return t>-1?t%12:e(t+12)}(r)?i.setDate(0):i.getTime()},d:(e,t)=>new Date(e).setDate(parseInt(t,10))},I={d:e=>e.getDate(),dd:e=>P(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>P(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>P(e.getFullYear(),2).slice(-2),yyyy:e=>P(e.getFullYear(),4)};function P(e,t){return e.toString().padStart(t,"0")}function B(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in N)return N[e];const t=e.split(M),n=e.match(new RegExp(M,"g"));if(0===t.length||!n)throw new Error("Invalid date format.");const i=n.map(e=>I[e]),r=Object.keys(F).reduce((e,t)=>(n.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return N[e]={parser(e,t){const i=e.split(T).reduce((e,t,i)=>{if(t.length>0&&n[i]){const r=n[i][0];"M"===r?e.m=t:"D"!==r&&(e[r]=t)}return e},{});return r.reduce((e,n)=>{const r=F[n](e,i[n],t);return isNaN(r)?e:r},b())},formatter:(e,n)=>i.reduce((i,r,o)=>i+`${t[o]}${r(e,n)}`,"")+d(t)}}function R(e,t,n){if(e instanceof Date||"number"==typeof e){const t=y(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return b();if(t&&t.toValue){const i=t.toValue(e,t,n);return isNaN(i)?void 0:y(i)}return B(t).parser(e,n)}}function q(e,t,n){if(isNaN(e)||!e&&0!==e)return"";const i="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(i,t,n):B(t).formatter(i,n)}const H=document.createRange();function V(e){return H.createContextualFragment(e)}function W(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function U(e){return e.getRootNode().activeElement===e}function z(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function Y(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function G(e){e.firstChild&&(e.removeChild(e.firstChild),G(e))}const K=new WeakMap,{addEventListener:Z,removeEventListener:J}=EventTarget.prototype;function Q(e,t){let n=K.get(e);n||(n=[],K.set(e,n)),t.forEach(e=>{Z.call(...e),n.push(e)})}function X(e){let t=K.get(e);t&&(t.forEach(e=>{J.call(...e)}),K.delete(e))}if(!Event.prototype.composedPath){const e=(t,n=[])=>{let i;return n.push(t),t.parentNode?i=t.parentNode:t.host?i=t.host:t.defaultView&&(i=t.defaultView),i?e(i,n):n};Event.prototype.composedPath=function(){return e(this.target)}}function ee(e,t){const n="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return function e(t,n,i){const[r,...o]=t;return n(r)?r:r!==i&&"HTML"!==r.tagName&&0!==o.length?e(o,n,i):void 0}(e.composedPath(),n,e.currentTarget)}var te={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},ne={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:ie,format:re,weekStart:oe}=ne;function se(e,t){return e.length<6&&t>=0&&t<7?h(e,t):e}function ae(e,t){switch(4===e?6===t?3:!t+1:e){case 1:return $;case 2:return E;case 3:return O}}function le(e,t,n){return t.weekStart=e,t.weekEnd=(e+6)%7,4===n&&(t.getWeekNumber=ae(4,e)),e}function ce(e,t,n,i){const r=R(e,t,n);return void 0!==r?r:i}function ue(e,t,n=3){const i=parseInt(e,10);return i>=0&&i<=n?i:t}function de(e,t,n,i){t in e&&(n in e||(e[n]=i?i(e[t]):e[t]),delete e[t])}function he(e,t){const n=Object.assign({},e),i={},r=t.constructor.locales,o=!!t.rangeSideIndex;let{datesDisabled:s,format:a,language:l,locale:c,maxDate:u,maxView:d,minDate:p,pickLevel:f,startView:g,weekNumbers:m,weekStart:v}=t.config||{};if(de(n,"calendarWeeks","weekNumbers",e=>e?1:0),de(n,"clearBtn","clearButton"),de(n,"todayBtn","todayButton"),de(n,"todayBtnMode","todayButtonMode"),n.language){let e;if(n.language!==l&&(r[n.language]?e=n.language:(e=n.language.split("-")[0],r[e]||(e=!1))),delete n.language,e){l=i.language=e;const t=c||r[ie];c=Object.assign({format:re,weekStart:oe},r[ie]),l!==ie&&Object.assign(c,r[l]),i.locale=c,a===t.format&&(a=i.format=c.format),v===t.weekStart&&(v=le(c.weekStart,i,m))}}if(n.format){const e="function"==typeof n.format.toDisplay,t="function"==typeof n.format.toValue,r=M.test(n.format);(e&&t||r)&&(a=i.format=n.format),delete n.format}let y=f;"pickLevel"in n&&(y=ue(n.pickLevel,f,2),delete n.pickLevel),y!==f&&(y>f&&("minDate"in n||(n.minDate=p),"maxDate"in n||(n.maxDate=u)),s&&!n.datesDisabled&&(n.datesDisabled=[]),f=i.pickLevel=y);let b=p,_=u;if("minDate"in n){const e=w(0,0,1);b=null===n.minDate?e:ce(n.minDate,a,c,b),b!==e&&(b=j(b,f,!1)),delete n.minDate}if("maxDate"in n&&(_=null===n.maxDate?void 0:ce(n.maxDate,a,c,_),void 0!==_&&(_=j(_,f,!0)),delete n.maxDate),_<b?(p=i.minDate=_,u=i.maxDate=b):(p!==b&&(p=i.minDate=b),u!==_&&(u=i.maxDate=_)),n.datesDisabled){const e=n.datesDisabled;if("function"==typeof e)i.datesDisabled=null,i.checkDisabled=(t,n)=>e(new Date(t),n,o);else{const t=i.datesDisabled=e.reduce((e,t)=>{const n=R(t,a,c);return void 0!==n?h(e,j(n,f,o)):e},[]);i.checkDisabled=e=>t.includes(e)}delete n.datesDisabled}if("defaultViewDate"in n){const e=R(n.defaultViewDate,a,c);void 0!==e&&(i.defaultViewDate=e),delete n.defaultViewDate}if("weekStart"in n){const e=Number(n.weekStart)%7;isNaN(e)||(v=le(e,i,m)),delete n.weekStart}if(n.daysOfWeekDisabled&&(i.daysOfWeekDisabled=n.daysOfWeekDisabled.reduce(se,[]),delete n.daysOfWeekDisabled),n.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=n.daysOfWeekHighlighted.reduce(se,[]),delete n.daysOfWeekHighlighted),"weekNumbers"in n){let e=n.weekNumbers;if(e){const t="function"==typeof e?(t,n)=>e(new Date(t),n):ae(e=parseInt(e,10),v);t&&(m=i.weekNumbers=e,i.getWeekNumber=t)}else m=i.weekNumbers=0,i.getWeekNumber=null;delete n.weekNumbers}if("maxNumberOfDates"in n){const e=parseInt(n.maxNumberOfDates,10);e>=0&&(i.maxNumberOfDates=e,i.multidate=1!==e),delete n.maxNumberOfDates}n.dateDelimiter&&(i.dateDelimiter=String(n.dateDelimiter),delete n.dateDelimiter);let k=d;"maxView"in n&&(k=ue(n.maxView,d),delete n.maxView),k=f>k?f:k,k!==d&&(d=i.maxView=k);let D=g;if("startView"in n&&(D=ue(n.startView,D),delete n.startView),D<f?D=f:D>d&&(D=d),D!==g&&(i.startView=D),n.prevArrow){const e=V(n.prevArrow);e.childNodes.length>0&&(i.prevArrow=e.childNodes),delete n.prevArrow}if(n.nextArrow){const e=V(n.nextArrow);e.childNodes.length>0&&(i.nextArrow=e.childNodes),delete n.nextArrow}if("disableTouchKeyboard"in n&&(i.disableTouchKeyboard="ontouchstart"in document&&!!n.disableTouchKeyboard,delete n.disableTouchKeyboard),n.orientation){const e=n.orientation.toLowerCase().split(/\s+/g);i.orientation={x:e.find(e=>"left"===e||"right"===e)||"auto",y:e.find(e=>"top"===e||"bottom"===e)||"auto"},delete n.orientation}if("todayButtonMode"in n){switch(n.todayButtonMode){case 0:case 1:i.todayButtonMode=n.todayButtonMode}delete n.todayButtonMode}return Object.entries(n).forEach(([e,t])=>{void 0!==t&&e in ne&&(i[e]=t)}),i}const pe={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};var fe=v('<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% prev-button prev-btn"></button>\n <button type="button" class="%buttonClass% view-switch"></button>\n <button type="button" class="%buttonClass% next-button next-btn"></button>\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% today-button today-btn"></button>\n <button type="button" class="%buttonClass% clear-button clear-btn"></button>\n </div>\n </div>\n </div>\n</div>'),ge=v(`<div class="days">\n <div class="days-of-week">${m("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${m("span",42)}</div>\n</div>`),me=v(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${m("span",6,{class:"week"})}</div>\n</div>`);class ve{constructor(e,t){Object.assign(this,t,{picker:e,element:V('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!e.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(e){"pickLevel"in e&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}prepareForRender(e,t,n){this.disabled=[];const i=this.picker;i.setViewSwitchLabel(e),i.setPrevButtonDisabled(t),i.setNextButtonDisabled(n)}setDisabled(e,t){t.add("disabled"),h(this.disabled,e)}performBeforeHook(e,t){let n=this.beforeShow(new Date(t));switch(typeof n){case"boolean":n={enabled:n};break;case"string":n={classes:n}}if(n){const i=e.classList;if(!1===n.enabled&&this.setDisabled(t,i),n.classes){const e=n.classes.split(/\s+/);i.add(...e),e.includes("disabled")&&this.setDisabled(t,i)}n.content&&function(e,t){G(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(V(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,n.content)}}renderCell(e,t,n,i,{selected:r,range:o},s,a=[]){e.textContent=t,this.isMinView&&(e.dataset.date=i);const l=e.classList;if(e.className="datepicker-cell "+this.cellClass,n<this.first?l.add("prev"):n>this.last&&l.add("next"),l.add(...a),(s||this.checkDisabled(i,this.id))&&this.setDisabled(i,l),o){const[e,t]=o;n>e&&n<t&&l.add("range"),n===e&&l.add("range-start"),n===t&&l.add("range-end")}r.includes(n)&&l.add("selected"),n===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(e,i)}refreshCell(e,t,n,[i,r]){const o=e.classList;o.remove("range","range-start","range-end","selected","focused"),t>i&&t<r&&o.add("range"),t===i&&o.add("range-start"),t===r&&o.add("range-end"),n.includes(t)&&o.add("selected"),t===this.focused&&o.add("focused")}changeFocusedCell(e){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}class ye extends ve{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=V(ge).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if("minDate"in e&&(this.minDate=e.minDate),"maxDate"in e&&(this.maxDate=e.maxDate),e.checkDisabled&&(this.checkDisabled=e.checkDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),"todayHighlight"in e&&(this.todayHighlight=e.todayHighlight),"weekStart"in e&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const n=this.locale=e.locale;this.dayNames=n.daysMin,this.switchLabelFormat=n.titleFormat,t=!0}if("beforeShowDay"in e&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),"weekNumbers"in e)if(e.weekNumbers&&!this.weekNumbers){const e=V(me).firstChild;this.weekNumbers={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.weekNumbers&&!e.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in e&&(this.getWeekNumber=e.getWeekNumber),"showDaysOfWeek"in e&&(e.showDaysOfWeek?(Y(this.dow),this.weekNumbers&&Y(this.weekNumbers.dow)):(z(this.dow),this.weekNumbers&&z(this.weekNumbers.dow))),t&&Array.from(this.dow.children).forEach((e,t)=>{const n=(this.weekStart+t)%7;e.textContent=this.dayNames[n],e.className=this.daysOfWeekDisabled.includes(n)?"dow disabled":"dow"})}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),n=e.getMonth(),i=w(t,n,1),r=S(i,this.weekStart,this.weekStart);this.first=i,this.last=w(t,n+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){if(this.today=this.todayHighlight?b():void 0,this.prepareForRender(q(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const e=this.weekStart,t=S(this.first,e,e);Array.from(this.weekNumbers.weeks.children).forEach((n,i)=>{const r=_(t,7*i);n.textContent=this.getWeekNumber(r,e),i>3&&n.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((e,t)=>{const n=_(this.start,t),i=new Date(n),r=i.getDay(),o=[];this.today===n&&o.push("today"),this.daysOfWeekHighlighted.includes(r)&&o.push("highlighted"),this.renderCell(e,i.getDate(),n,n,this,n<this.minDate||n>this.maxDate||this.daysOfWeekDisabled.includes(r),o)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.dataset.date),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function be(e,t){if(!e||!e[0]||!e[1])return;const[[n,i],[r,o]]=e;return n>t||r<t?void 0:[n===t?i:-1,r===t?o:12]}class we extends ve{constructor(e){super(e,{id:1,name:"months",cellClass:"month"})}init(e,t=!0){t&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(V(m("span",12,{"data-month":e=>e}))),this.first=0,this.last=11),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),"minDate"in e)if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if("maxDate"in e)if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=w(this.maxYear,this.maxMonth+1,0)}e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),"beforeShowMonth"in e&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>{const n=new Date(t),i=n.getFullYear(),r=n.getMonth();return void 0===e[i]?e[i]=[r]:h(e[i],r),e},{}),t&&t.dates&&(this.range=t.dates.map(e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.year<this.minYear||this.year>this.maxYear,n=this.year===this.minYear,i=this.year===this.maxYear,r=be(this.range,this.year);Array.from(this.grid.children).forEach((o,s)=>{const a=j(new Date(this.year,s,1),1,this.isRangeEnd);this.renderCell(o,this.monthNames[s],s,a,{selected:e,range:r},t||n&&s<this.minMonth||i&&s>this.maxMonth)})}refresh(){const e=this.selected[this.year]||[],t=be(this.range,this.year)||[];Array.from(this.grid.children).forEach((n,i)=>{this.refreshCell(n,i,e,t)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class _e extends ve{constructor(e,t){super(e,t)}init(e,t=!0){var n;t&&(this.navStep=10*this.step,this.beforeShowOption="beforeShow"+(n=this.cellClass,[...n].reduce((e,t,n)=>e+(n?t:t.toUpperCase()),"")),this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(V(m("span",12)))),super.init(e)}setOptions(e){if("minDate"in e&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=L(e.minDate,this.step),this.minDate=w(this.minYear,0,1))),"maxDate"in e&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=L(e.maxDate,this.step),this.maxDate=w(this.maxYear,11,31))),e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),this.beforeShowOption in e){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=L(e,this.navStep),n=t+9*this.step;this.first=t,this.last=n,this.start=t-this.step,this.focused=L(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>h(e,L(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return L(e,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const n=this.start+t*this.step,i=j(new Date(n,0,1),2,this.isRangeEnd);e.dataset.year=n,this.renderCell(e,n,n,i,this,n<this.minYear||n>this.maxYear)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.textContent),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function ke(e,t){const n={date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e};e.element.dispatchEvent(new CustomEvent(t,{detail:n}))}function De(e,t){const{config:n,picker:i}=e,{currentView:r,viewDate:o}=i;let s;switch(r.id){case 0:s=k(o,t);break;case 1:s=D(o,t);break;default:s=D(o,t*r.navStep)}s=g(s,n.minDate,n.maxDate),i.changeFocus(s).render()}function xe(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function Se(e){e.setDate({clear:!0})}function Ae(e){const t=b();1===e.config.todayButtonMode?e.setDate(t,{forceRefresh:!0,viewDate:t}):e.setFocusedDate(t,!0)}function $e(e){const t=()=>{e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()},n=e.element;U(n)?n.addEventListener("blur",t,{once:!0}):t()}function Ce(e,t){const n=e.picker,i=new Date(n.viewDate),r=n.currentView.id,o=1===r?k(i,t-i.getMonth()):D(i,t-i.getFullYear());n.changeFocus(o).changeView(r-1).render()}function Ee(e){xe(e)}function Oe(e){De(e,-1)}function Le(e){De(e,1)}function je(e,t){const n=ee(t,".datepicker-cell");if(!n||n.classList.contains("disabled"))return;const{id:i,isMinView:r}=e.picker.currentView,o=n.dataset;r?e.setDate(Number(o.date)):Ce(e,Number(1===i?o.month:o.year))}function Me(e){e.preventDefault()}const Te=["left","top","right","bottom"].reduce((e,t)=>(e[t]="datepicker-orient-"+t,e),{}),Ne=e=>e?e+"px":e;function Fe(e,t){if("title"in t&&(t.title?(e.controls.title.textContent=t.title,Y(e.controls.title)):(e.controls.title.textContent="",z(e.controls.title))),t.prevArrow){const n=e.controls.prevButton;G(n),t.prevArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const n=e.controls.nextButton;G(n),t.nextArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayButton.textContent=t.locale.today,e.controls.clearButton.textContent=t.locale.clear),"todayButton"in t&&(t.todayButton?Y(e.controls.todayButton):z(e.controls.todayButton)),"minDate"in t||"maxDate"in t){const{minDate:t,maxDate:n}=e.datepicker.config;e.controls.todayButton.disabled=!f(b(),t,n)}"clearButton"in t&&(t.clearButton?Y(e.controls.clearButton):z(e.controls.clearButton))}function Ie(e){const{dates:t,config:n,rangeSideIndex:i}=e;return g(t.length>0?d(t):j(n.defaultViewDate,n.pickLevel,i),n.minDate,n.maxDate)}function Pe(e,t){"_oldViewDate"in e||t===e.viewDate||(e._oldViewDate=e.viewDate),e.viewDate=t;const{id:n,year:i,first:r,last:o}=e.currentView,s=new Date(t).getFullYear();switch(n){case 0:return t<r||t>o;case 1:return s!==i;default:return s<r||s>o}}function Be(e){return window.getComputedStyle(e).direction}class Re{constructor(e){const{config:t,inputField:n}=this.datepicker=e,i=fe.replace(/%buttonClass%/g,t.buttonClass),r=this.element=V(i).firstChild,[o,s,a]=r.firstChild.children,l=o.firstElementChild,[c,u,d]=o.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:u,nextButton:d,todayButton:h,clearButton:p};this.main=s,this.controls=f;const g=n?"dropdown":"inline";r.classList.add("datepicker-"+g),Fe(this,t),this.viewDate=Ie(e),Q(e,[[r,"mousedown",Me],[s,"click",je.bind(null,e)],[f.viewSwitch,"click",Ee.bind(null,e)],[f.prevButton,"click",Oe.bind(null,e)],[f.nextButton,"click",Le.bind(null,e)],[f.todayButton,"click",Ae.bind(null,e)],[f.clearButton,"click",Se.bind(null,e)]]),this.views=[new ye(this),new we(this),new _e(this,{id:2,name:"years",cellClass:"year",step:1}),new _e(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[t.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),t.container?t.container.appendChild(this.element):n.after(this.element)}setOptions(e){Fe(this,e),this.views.forEach(t=>{t.init(e,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:e,element:t}=this,n=e.inputField;if(n){const i=Be(n);i!==Be(W(t))?t.dir=i:t.dir&&t.removeAttribute("dir"),t.style.visibility="hidden",t.classList.add("active"),this.place(),t.style.visibility="",e.config.disableTouchKeyboard&&n.blur()}else t.classList.add("active");this.active=!0,ke(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,ke(this.datepicker,"hide"))}place(){const{classList:e,offsetParent:t,style:n}=this.element,{config:i,inputField:r}=this.datepicker,{width:o,height:s}=this.element.getBoundingClientRect(),{left:a,top:l,right:c,bottom:u,width:d,height:h}=r.getBoundingClientRect();let{x:p,y:f}=i.orientation,g=a,m=l;if(t!==document.body&&t){const e=t.getBoundingClientRect();g-=e.left-t.scrollLeft,m-=e.top-t.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=function e(t){const n=W(t);if(n!==document.body&&n)return"visible"!==window.getComputedStyle(n).overflow?n:e(n)}(r);let y=0,b=0,{clientWidth:w,clientHeight:_}=document.documentElement;if(v){const e=v.getBoundingClientRect();e.top>0&&(b=e.top),e.left>0&&(y=e.left),e.right<w&&(w=e.right),e.bottom<_&&(_=e.bottom)}let k=0;"auto"===p&&(a<y?(p="left",k=y-a):a+o>w?(p="right",w<c&&(k=w-c)):p="rtl"===Be(r)?c-o<y?"left":"right":"left"),"right"===p&&(g+=d-o),g+=k,"auto"===f&&(f=l-s>b&&u+s>_?"top":"bottom"),"top"===f?m-=s:m+=h,e.remove(...Object.values(Te)),e.add(Te[p],Te[f]),n.left=Ne(g),n.top=Ne(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevButtonDisabled(e){this.controls.prevButton.disabled=e}setNextButtonDisabled(e){this.controls.nextButton.disabled=e}changeView(e){const t=this.currentView;return e!==t.id&&(this._oldView||(this._oldView=t),this.currentView=this.views[e],this._renderMethod="render"),this}changeFocus(e){return this._renderMethod=Pe(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(e){const t=void 0===e?Ie(this.datepicker):e;return this._renderMethod=Pe(this,t)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const{currentView:t,datepicker:n,_oldView:i}=this,r=new Date(this._oldViewDate),o=e&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,t[o](),i&&(this.main.replaceChild(t.element,i.element),ke(n,"changeView")),!isNaN(r)){const e=new Date(this.viewDate);e.getFullYear()!==r.getFullYear()&&ke(n,"changeYear"),e.getMonth()!==r.getMonth()&&ke(n,"changeMonth")}}}function qe(e,t,n){const i=e.picker,r=i.currentView,o=r.step||1;let s,a=i.viewDate;switch(r.id){case 0:a=_(a,n?7*t:t),s=_;break;case 1:a=k(a,n?4*t:t),s=k;break;default:a=D(a,t*(n?4:1)*o),s=D}a=function e(t,n,i,r,o,s){if(f(t,o,s)){if(r(t)){return e(n(t,i),n,i,r,o,s)}return t}}(a,s,t<0?-o:o,e=>r.disabled.includes(e),r.minDate,r.maxDate),void 0!==a&&i.changeFocus(a).render()}function He(e,t){const{config:n,picker:i,editMode:r}=e,o=i.active,{key:s,altKey:a,shiftKey:l}=t,c=t.ctrlKey||t.metaKey,u=()=>{t.preventDefault(),t.stopPropagation()};if("Tab"===s)return void $e(e);if("Enter"===s){if(o)if(r)e.exitEditMode({update:!0,autohide:n.autohide});else{const t=i.currentView;t.isMinView?e.setDate(i.viewDate):(i.changeView(t.id-1).render(),u())}else e.update();return}const d=n.shortcutKeys,h={key:s,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(d).find(e=>{const t=d[e];return!Object.keys(t).find(e=>t[e]!==h[e])});if(p){let t;if("toggle"===p?t=p:r?"exitEditMode"===p&&(t=p):o?"hide"===p?t=p:"prevButton"===p?t=[De,[e,-1]]:"nextButton"===p?t=[De,[e,1]]:"viewSwitch"===p?t=[xe,[e]]:n.clearButton&&"clearButton"===p?t=[Se,[e]]:n.todayButton&&"todayButton"===p&&(t=[Ae,[e]]):"show"===p&&(t=p),t)return Array.isArray(t)?t[0].apply(null,t[1]):e[t](),void u()}if(!o||r)return;const f=(n,i)=>{l||c||a?e.enterEditMode():(qe(e,n,i),t.preventDefault())};"ArrowLeft"===s?f(-1,!1):"ArrowRight"===s?f(1,!1):"ArrowUp"===s?f(-1,!0):"ArrowDown"===s?f(1,!0):("Backspace"===s||"Delete"===s||s&&1===s.length&&!c)&&e.enterEditMode()}function Ve(e){e.config.showOnFocus&&!e._showing&&e.show()}function We(e,t){const n=t.target;(e.picker.active||e.config.showOnClick)&&(n._active=U(n),n._clicking=setTimeout(()=>{delete n._active,delete n._clicking},2e3))}function Ue(e,t){const n=t.target;n._clicking&&(clearTimeout(n._clicking),delete n._clicking,n._active&&e.enterEditMode(),delete n._active,e.config.showOnClick&&e.show())}function ze(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function Ye(e,t){const{element:n,picker:i}=e;if(!i.active&&!U(n))return;const r=i.element;ee(t,e=>e===n||e===r)||$e(e)}function Ge(e,t){return e.map(e=>q(e,t.format,t.locale)).join(t.dateDelimiter)}function Ke(e,t,n=!1){if(0===t.length)return n?[]:void 0;const{config:i,dates:r,rangeSideIndex:o}=e,{pickLevel:s,maxNumberOfDates:a}=i;let l=t.reduce((e,t)=>{let n=R(t,i.format,i.locale);return void 0===n||(n=j(n,s,o),!f(n,i.minDate,i.maxDate)||e.includes(n)||i.checkDisabled(n,s)||!(s>0)&&i.daysOfWeekDisabled.includes(new Date(n).getDay())||e.push(n)),e},[]);return 0!==l.length?(i.multidate&&!n&&(l=l.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!l.includes(e)))),a&&l.length>a?l.slice(-1*a):l):void 0}function Ze(e,t=3,n=!0,i){const{config:r,picker:o,inputField:s}=e;if(2&t){const e=o.active?r.pickLevel:r.startView;o.update(i).changeView(e).render(n)}1&t&&s&&(s.value=Ge(e.dates,r))}function Je(e,t,n){const i=e.config;let{clear:r,render:o,autohide:s,revert:a,forceRefresh:l,viewDate:c}=n;void 0===o&&(o=!0),o?void 0===s&&(s=i.autohide):s=l=!1,c=R(c,i.format,i.locale);const u=Ke(e,t,r);(u||a)&&(u&&u.toString()!==e.dates.toString()?(e.dates=u,Ze(e,o?3:1,!0,c),ke(e,"changeDate")):Ze(e,l?3:1,!0,c),s&&e.hide())}function Qe(e,t){return t?n=>q(n,t,e.config.locale):e=>new Date(e)}class Xe{constructor(e,t={},n){e.datepicker=this,this.element=e,this.dates=[];const i=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:b(),maxDate:void 0,minDate:void 0},he(ne,this));let r;if("INPUT"===e.tagName?(r=this.inputField=e,r.classList.add("datepicker-input"),t.container&&(i.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container))):i.container=e,n){const e=n.inputs.indexOf(r),t=n.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,this.rangepicker=n,this.rangeSideIndex=e}this._options=t,Object.assign(i,he(t,this)),i.shortcutKeys=function(e){return Object.keys(pe).reduce((t,n)=>{const i=void 0===e[n]?pe[n]:e[n],r=i&&i.key;if(!r||"string"!=typeof r)return t;const o={key:r,ctrlOrMetaKey:!!(i.ctrlOrMetaKey||i.ctrlKey||i.metaKey)};return r.length>1&&(o.altKey=!!i.altKey,o.shiftKey=!!i.shiftKey),t[n]=o,t},{})}(t.shortcutKeys||{});const o=p(e.value||e.dataset.date,i.dateDelimiter);delete e.dataset.date;const s=Ke(this,o);s&&s.length>0&&(this.dates=s),r&&(r.value=Ge(this.dates,i));const a=this.picker=new Re(this),l=[e,"keydown",He.bind(null,this)];r?Q(this,[l,[r,"focus",Ve.bind(null,this)],[r,"mousedown",We.bind(null,this)],[r,"click",Ue.bind(null,this)],[r,"paste",ze.bind(null,this)],[document,"mousedown",Ye.bind(null,this)],[window,"resize",a.place.bind(a)]]):(Q(this,[l]),this.show())}static formatDate(e,t,n){return q(e,t,n&&te[n]||te.en)}static parseDate(e,t,n){return R(e,t,n&&te[n]||te.en)}static get locales(){return te}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=he(e,this);Object.assign(this._options,e),Object.assign(this.config,t),this.picker.setOptions(t),Ze(this,3)}show(){if(this.inputField){const{config:e,inputField:t}=this;if(t.disabled||t.readOnly&&!e.enableOnReadonly)return;U(t)||e.disableTouchKeyboard||(this._showing=!0,t.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),X(this),this.picker.detach();const e=this.element;return e.classList.remove("datepicker-input"),delete e.datepicker,this}getDate(e){const t=Qe(this,e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],n={},i=d(e);!i||"object"!=typeof i||Array.isArray(i)||i instanceof Date||Object.assign(n,t.pop());Je(this,Array.isArray(t[0])?t[0]:t,n)}update(e){if(!this.inputField)return;const t=Object.assign(e||{},{clear:!0,render:!0,viewDate:void 0});Je(this,p(this.inputField.value,this.config.dateDelimiter),t)}getFocusedDate(e){return Qe(this,e)(this.picker.viewDate)}setFocusedDate(e,t=!1){const{config:n,picker:i,active:r,rangeSideIndex:o}=this,s=n.pickLevel,a=R(e,n.format,n.locale);void 0!==a&&(i.changeFocus(j(a,s,o)),r&&t&&i.changeView(s),i.render())}refresh(e,t=!1){let n;e&&"string"!=typeof e&&(t=e,e=void 0),n="picker"===e?2:"input"===e?1:3,Ze(this,n,!t)}enterEditMode(){const e=this.inputField;e&&!e.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,e.classList.add("in-edit"))}exitEditMode(e){if(!this.inputField||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit"),t.update&&this.update(t)}}function et(e){return(et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==et(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===et(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.date={load:function(e,t){var n=r()(e).find(".cpt-date-section:first"),i=r()(n).children("input"),o="no"!==r()(i).data("max")&&r()(i).data("max"),s="no"!==r()(i).data("min")&&r()(i).data("min");new Xe(i[0],{autohide:!0,clearBtn:!0,maxDate:o,minDate:s,format:"dd/mm/yyyy"})}},e}));var nt=wp.i18n,it=nt.__;nt._x,nt._n,nt._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.file={load:function(e,t){new rt(e)}},e}));var rt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fileSection=r()(t).find(".cpt-file-section:first"),this.fileTypes=r()(this.fileSection).data("type"),this.fileInput=r()(this.fileSection).find("input"),this.filePreview=r()(this.fileSection).find("img"),this.fileActions=r()(this.fileSection).find(".cpt-file-actions"),this.fileName=r()(this.fileSection).find(".file-name"),this.addButton=r()(this.fileSection).find(".cpt-file-upload"),this.removeButton=r()(this.fileSection).find(".cpt-file-remove"),this.listenRemoveEvent(),this.listenAddEvent()}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(){var e=this;r()(this.addButton).on("click",(function(t){t.preventDefault();var n=wp.media({title:it("Add file","custom-post-types"),frame:"select",library:wp.media.query({type:e.fileTypes,uploadedTo:wp.media.view.settings.post.id}),button:{text:it("Choose file","custom-post-types")},multiple:!1}).on("select",(function(){var t=n.state().get("selection").first().toJSON(),i=!!(t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url)&&t.sizes.thumbnail.url;i&&(r()(e.filePreview).attr("src",i),r()(e.filePreview).show());var o=t.mime;o.startsWith("image")&&(o="image"),o.startsWith("audio")&&(o="audio"),o.startsWith("video")&&(o="video"),"-1"!=r.a.inArray(o,e.fileTypes)?(r()(e.fileName).html(t.url.split("/").reverse()[0]),r()(e.fileActions).attr("title",t.url.split("/").reverse()[0]),r()(e.fileInput).val(t.id),r()(e.removeButton).prop("disabled",!1)):e.resetField()})).open()}))}},{key:"listenRemoveEvent",value:function(){var e=this;r()(this.removeButton).on("click",(function(t){t.preventDefault(),e.resetField()}))}},{key:"resetField",value:function(){r()(this.fileName).html(""),r()(this.fileInput).val(""),r()(this.filePreview).removeAttr("src"),r()(this.filePreview).hide(),r()(this.removeButton).prop("disabled",!0),r()(this.fileActions).attr("title",it("Choose","custom-post-types"))}}])&&tt(t.prototype,n),i&&tt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();n(1),n(2);function ot(e){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function st(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ot(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ot(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ot(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.post_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-post_rel-options",nonce:cpt.ajax_nonce,search:e.term,post_type:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e}));var at=wp.i18n;at.__,at._x,at._n,at._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.repeater={load:function(e,t){new lt(e)}},e}));var lt=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.repeaterSection=r()(t).find(".cpt-repeater-section:first"),this.parent=r()(this.repeaterSection).data("parent"),this.fields=r()(this.repeaterSection).data("fields"),this.initSortable();var i=r()(this.repeaterSection).parent().children(".cpt-repeater-add:first");i.length>0&&this.listenAddEvent(i);var o=r()(this.repeaterSection).find(".cpt-repeater-group");r.a.each(o,(function(e,t){n.initFieldGroup(t)}))}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(e){var t=this;r()(e).on("click",(function(n){n.preventDefault(),r()(e).prop("disabled",!0);var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(t.repeaterSection).append(i);var o=r()(t.repeaterSection).children(".cpt-repeater-group").length,s=[];s.push({name:"action",value:"cpt-get-repeater-group"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"fields",value:JSON.stringify(t.fields)}),s.push({name:"parent",value:t.parent+"["+o+"]"}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(n){if(n.success){r()(e).prop("disabled",!1),r()(i).remove();var o=r()(n.data);r()(t.repeaterSection).append(o),t.initFieldGroup(o)}else r()(e).prop("disabled",!1),r()(i).remove(),console.log("Error",n)}})}))}},{key:"initSortable",value:function(){var e=r()(this.repeaterSection).children(".cpt-repeater-group").children(".cpt-repeater-buttons").find(".move");r()(e).on("click",(function(e){e.preventDefault()})),r()(this.repeaterSection).sortable({handle:".move",cancel:"",cursor:"grab",axis:"y",delay:150,dropOnEmpty:!1,opacity:.5,revert:!0})}},{key:"initFieldGroup",value:function(e){var t=r()(e).find(".cpt-repeater-fields:first").children(".cpt-field"),n=r()(e).find(".cpt-repeater-fields:first .cpt-repeater-extra").children(".cpt-field");r.a.each(r.a.merge(t,n),(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")})),this.listenRemoveEvent(e),this.autofillKeyInput(e),this.listenSwitchFieldTypeEvent(e)}},{key:"listenRemoveEvent",value:function(e){var t=r()(e).find(".remove:first"),n=r()(t).closest(".cpt-repeater-group").children(".cpt-repeater-remove");r()(t).on("click",(function(e){e.preventDefault(),r()(n).addClass("active")})),r()(n).find(".abort:first").on("click",(function(e){e.preventDefault(),r()(n).removeClass("active")})),r()(n).find(".confirm:first").on("click",(function(t){t.preventDefault(),r()(e).remove()}))}},{key:"autofillKeyInput",value:function(e){var t=r()(e).find('input[id$="-label"]:first'),n=r()(e).find('input[id$="-key"]:first');window.cptUtils.autoFillKey(n,t)}},{key:"listenSwitchFieldTypeEvent",value:function(e){var t=r()(e).find(".cpt-repeater-field-type:first").find("select"),n=r()(e).find(".cpt-repeater-extra:first");r()(t).on("select2:select",(function(e){r()(n).empty();var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(n).append(i);var o=!!r()(t).val().length&&r()(t).val();if(o){var s=r()(t).attr("name").replace("meta-fields","").replace("[type]",""),a=[];a.push({name:"action",value:"cpt-get-repeater-extra-fields"}),a.push({name:"nonce",value:cpt.ajax_nonce}),a.push({name:"field-type",value:o}),a.push({name:"parent",value:s}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:a,success:function(e){if(e.success){r()(i).remove();var t=r()(e.data);r()(n).append(t),r()(n).children(".cpt-field"),r.a.each(t,(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")}))}else r()(i).remove(),console.log("Error",e)}})}else r()(i).remove()}))}}])&&st(t.prototype,n),i&&st(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ct(e){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ut(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ht(i.key),i)}}function dt(e,t,n){return(t=ht(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ht(e){var t=function(e,t){if("object"!==ct(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ct(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ct(t)?t:String(t)}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.select={load:function(e,t){window.cptUtils.disableProFieldSelectOptions(e);var n=r()(e).find("select:first"),i={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};r()(n).select2(i)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tax_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-tax_rel-options",nonce:cpt.ajax_nonce,search:e.term,taxonomy:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.text={load:function(e,t){}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.time={load:function(e,t){for(var n=r()(e).find(".cpt-time-section:first"),i=r()(n).children("select"),o=r()(i).data("value")?r()(i).data("value"):"",s="no"!==r()(i).data("max")&&r()(i).data("max"),a="no"!==r()(i).data("min")&&r()(i).data("min"),l=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"00:00",i=0;if(!n)return i;var r=!!n.split(":")&&n.split(":"),o=null!==(e=r[0])&&void 0!==e&&e,s=null!==(t=r[1])&&void 0!==t&&t,a=Number(o+s);return Number.isInteger(a)?a:i},c=l(s),u=l(a),d=0;d<=23;d++){d=d<10?"0"+d:d;for(var h=0;h<=59;h++){var p=d+":"+(h=h<10?"0"+h:h);(u>0&&l(p)<u||c>0&&l(p)>c)&&c>u||r()(i).append(r()('<option value="'+p+'"'+(o==p?' selected="selected"':"")+">"+p+"</option>"))}}var f={placeholder:r()(i).attr("placeholder")?r()(selectEl).attr("placeholder"):" ... ",allowClear:!0,multiple:!1};r()(i).select2(f)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tinymce={load:function(e,t){new pt(e)}},e}));var pt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),dt(this,"editorEl",void 0),dt(this,"editorId",void 0),dt(this,"editorForm",void 0),dt(this,"defaultArgs",{tinymce:{wpautop:!1,plugins:"charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern",toolbar1:"formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,wp_more,spellchecker,fullscreen,wp_adv,listbuttons",toolbar2:"styleselect,strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",textarea_rows:20,wp_autoresize_on:!1,autoresize_min_height:50},quicktags:{buttons:"strong,em,link,block,del,ins,img,ul,ol,li,code,more,close"},mediaButtons:!0}),this.editorEl=r()(t).find("textarea:first"),this.editorId=r()(this.editorEl).attr("id"),this.defaultArgs.tinymce.wp_autoresize_on=r()(this.editorEl).is("[autoresize]"),this.editorForm=r()(t).closest("form"),this.startEditor()}var t,n,i;return t=e,(n=[{key:"startEditor",value:function(){var e=this,t=!1,n=setInterval((function(){!r()("#post-title-0")&&r()("body").hasClass("block-editor-page")||(t=!0,e.removeEditor(),e.initializeEditor(),e.listenSubmitEvent(),e.listenSortableEvent()),t&&clearInterval(n)}),500)}},{key:"initializeEditor",value:function(){wp.oldEditor.initialize(this.editorId,this.defaultArgs)}},{key:"removeEditor",value:function(){wp.oldEditor.remove(this.editorId)}},{key:"listenSubmitEvent",value:function(){var e=tinyMCE.editors[this.editorId];r()(this.editorForm).on("submit",(function(t){e.save()})),e.on("blur",(function(t){e.save()})),r()(document).ajaxComplete((function(t,n,i){i.data&&i.data.match(/action=add-tag/)&&(e.setContent(""),e.save())}))}},{key:"listenSortableEvent",value:function(){var e=this,t=r()(this.editorEl).closest(".ui-sortable");r()(t).on("sortstart",(function(){e.removeEditor()})),r()(t).on("sortstop",(function(){e.initializeEditor()}))}}])&&ut(t.prototype,n),i&&ut(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ft(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ft(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ft(o)?o:String(o)),i)}var r,o}var mt=wp.i18n,vt=mt.__;mt._x,mt._n,mt._nx;new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.body=r()("body"),this.window=r()(window),this.utils=new u,this.loadFields(),this.loadUiFeatures()}var t,n,i;return t=e,(n=[{key:"loadUiFeatures",value:function(){var e=this;this.body.on("click",".cpt-field-wrap.advanced-field-btn .button",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-fields-section"),i=r()(n).find(".cpt-field-wrap.advanced-field");r()(t).hasClass("button-secondary")?(r()(i).removeClass("active"),r()(t).removeClass("button-secondary").addClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-insert"),r()(t).find(".label").html(vt("Advanced view","custom-post-types"))):(r()(i).addClass("active"),r()(t).addClass("button-secondary").removeClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-remove"),r()(t).find(".label").html(vt("Simple view","custom-post-types")))})),this.window.on("load",(function(){if(e.body.hasClass("block-editor-page")){var t=r()('.cpt-fields-section *[id^="meta-fields-"][required]');t.length<=0||setInterval((function(){!function(e){var t=!0;r.a.each(e,(function(e,n){var i=r()(n).val().length>0;t=!!t&&i}));var n=r()(".edit-post-header__settings button.editor-post-publish-button__button");t?(r()(n).removeAttr("disabled"),r()(n).attr("aria-disabled","false")):(r()(n).attr("disabled","disabled"),r()(n).attr("aria-disabled","true"))}(t)}),200)}})),this.body.on("click",".cpt-notice.is-dismissible a.cpt-dismiss-notice",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-notice").find("button.notice-dismiss"),i=r()(t).data("notice"),o=r()(t).data("duration"),s=[];s.push({name:"action",value:"cpt-dismiss-notice"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"key",value:i}),s.push({name:"duration",value:o}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?n.click():console.log("Error",e)}})})),this.body.on("click",".cpt-notice pre.error-code > a",(function(e){e.preventDefault();var t=e.currentTarget;r()(t).closest(".error-code").find("code").addClass("show"),r()(t).remove()}));var t=r()('div[data-id="manage_cpt"].cpt-fields-section, div[data-id="manage_cpt_tax"].cpt-fields-section');r.a.each(t,(function(t,n){var i=r()(n).find('input[id$="-plural"]:first'),o=r()(n).find('input[id$="-id"]:first');e.utils.autoFillKey(o,i)}))}},{key:"loadFields",value:function(){var e=this;this.$fieldGroups=r()(".cpt-fields-section"),this.$fieldGroups&&(this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]),r.a.each(this.$fieldGroups,(function(t,n){var i=r()(n).children(".cpt-field");i&&r.a.each(i,(function(t,n){var i=r()(n).data("field-type");e.utils.appendFieldEvents(i,n),r()(n).trigger("load")}))})))}}])&>(t.prototype,n),i&>(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}())}]);17 !function(e,t){var n={version:302};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var i=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(i)&&i>=n.version)return}if(!Color.fn.hasOwnProperty("to_s")){Color.fn.to_s=function(e){"hex"===(e=e||"hex")&&this._alpha<1&&(e="rgba");var t="";return"hex"===e?t=this.toString():this.error||(t=this.toCSS(e).replace(/\(\s+/,"(").replace(/\s+\)/,")")),t},window.wpColorPickerAlpha=n;var r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(e){return void 0===e&&(e=this._color),this.alphaOptions.alphaEnabled?(e=e.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(e=e.replace(/\s+/g,"")),e):e.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(e){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(e){var t=this,n=function(n){var i=e.val(),r=new Color(i),o=(i=i.replace(/^(#|(rgb|hsl)a?)/,""),t.alphaOptions.alphaColorType);e.removeClass("iris-error"),r.error?""!==i&&e.addClass("iris-error"):"hex"===o&&"keyup"===n.type&&i.match(/^[0-9a-fA-F]{3}$/)||r.toIEOctoHex()!==t._color.toIEOctoHex()&&t._setOption("color",t._getColor(r))};e.on("change",n).on("keyup",t._debounce(n,100)),t.options.hide&&e.one("focus",(function(){t.show()}))},_initControls:function(){if(this._super(),this.alphaOptions.alphaEnabled){var t=this,n=t.controls.strip.clone(!1,!1),i=n.find(".iris-slider-offset"),r={stripAlpha:n,stripAlphaSlider:i};n.addClass("iris-strip-alpha"),i.addClass("iris-slider-offset-alpha"),n.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,(function(e,n){t.controls[e]=n})),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(e,n){t.active="strip",t._color._alpha=parseFloat(n.value/100),t._change.apply(t,arguments)}})}},_dimensions:function(e){if(this._super(e),this.alphaOptions.alphaEnabled){var t,n,i,r,o,s=this.options,a=this.controls.square,l=this.picker.find(".iris-strip");for(t=Math.round(this.picker.outerWidth(!0)-(s.border?22:0)),n=Math.round(a.outerWidth()),i=Math.round((t-n)/2),r=Math.round(i/2),o=Math.round(n+2*i+2*r);o>t;)i=Math.round(i-2),r=Math.round(r-1),o=Math.round(n+2*i+2*r);a.css("margin","0"),l.width(i).css("margin-left",r+"px")}},_change:function(){var t=this,n=t.active;if(t._super(),t.alphaOptions.alphaEnabled){var i=t.controls,o=parseInt(100*t._color._alpha),s=t._color.toRgb(),a=["rgb("+s.r+","+s.g+","+s.b+") 0%","rgba("+s.r+","+s.g+","+s.b+", 0) 100%"];t.picker.closest(".wp-picker-container").find(".wp-color-result");t.options.color=t._getColor(),i.stripAlpha.css({background:"linear-gradient(to bottom, "+a.join(", ")+"), url("+r+")"}),n&&i.stripAlphaSlider.slider("value",o),t._color.error||t.element.removeClass("iris-error").val(t.options.color),t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",(function(){var n=e(this).data("color");t.alphaOptions.alphaReset&&(t._color._alpha=1,n=t._getColor()),t._setOption("color",n)}))}},_paintDimension:function(e,t){var n=!1;this.alphaOptions.alphaEnabled&&"strip"===t&&(n=this._color,this._color=new Color(n.toString()),this.hue=this._color.h()),this._super(e,t),n&&(this._color=n)},_setOption:function(e,t){if("color"!==e||!this.alphaOptions.alphaEnabled)return this._super(e,t);t=""+t,newColor=new Color(t).setHSpace(this.options.mode),newColor.error||this._getColor(newColor)===this._getColor()||(this._color=newColor,this.options.color=this._getColor(),this.active="external",this._change())},color:function(e){return!0===e?this._color.clone():void 0===e?this._getColor():void this.option("color",e)}}),e.widget("wp.wpColorPicker",e.wp.wpColorPicker,{alphaOptions:{alphaEnabled:!1},_getAlphaOptions:function(){var t=this.element,n=t.data("type")||this.options.type,i=t.data("defaultColor")||t.val(),r={alphaEnabled:t.data("alphaEnabled")||!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"rgb",alphaColorWithSpace:!1};return r.alphaEnabled&&(r.alphaEnabled=t.is("input")&&"full"===n),r.alphaEnabled?(r.alphaColorWithSpace=i&&i.match(/\s/),e.each(r,(function(e,n){var o=t.data(e)||n;switch(e){case"alphaCustomWidth":o=o?parseInt(o,10):0,o=isNaN(o)?n:o;break;case"alphaColorType":o.match(/^(hex|(rgb|hsl)a?)$/)||(o=i&&i.match(/^#/)?"hex":i&&i.match(/^hsla?/)?"hsl":n);break;default:o=!!o}r[e]=o})),r):r},_create:function(){e.support.iris&&(this.alphaOptions=this._getAlphaOptions(),this._super())},_addListeners:function(){if(!this.alphaOptions.alphaEnabled)return this._super();var t=this,n=t.element,i=t.toggler.is("a");this.alphaOptions.defaultWidth=n.width(),this.alphaOptions.alphaCustomWidth&&n.width(parseInt(this.alphaOptions.defaultWidth+this.alphaOptions.alphaCustomWidth,10)),t.toggler.css({position:"relative","background-image":"url("+r+")"}),i?t.toggler.html('<span class="color-alpha" />'):t.toggler.append('<span class="color-alpha" />'),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":n.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),n.iris({change:function(e,n){t.colorAlpha.css({"background-color":n.color.to_s(t.alphaOptions.alphaColorType)}),"function"==typeof t.options.change&&t.options.change.call(this,e,n)}}),t.wrap.on("click.wpcolorpicker",(function(e){e.stopPropagation()})),t.toggler.on("click",(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()})),n.on("change",(function(r){var o=e(this).val();(n.hasClass("iris-error")||""===o||o.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r))})),t.button.on("click",(function(r){e(this).hasClass("wp-picker-default")?n.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(n.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r),n.trigger("change"))}))}})}}(jQuery)},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n.p,n.p,n.p,n(3);var i=n(0),r=n.n(i);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,s=Object.create(o.prototype),a=new $(r||[]);return i(s,"_invoke",{value:D(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function f(){}function g(){}function m(){}var v={};u(v,a,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(C([])));b&&b!==t&&n.call(b,a)&&(v=b);var w=m.prototype=f.prototype=Object.create(v);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){var r;i(this,"_invoke",{value:function(i,s){function a(){return new t((function(r,a){!function i(r,s,a,l){var c=h(e[r],e,s);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==o(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,l)}),(function(e){i("throw",e,a,l)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,l)}))}l(c.arg)}(i,s,r,a)}))}return r=r?r.then(a,a):a()}})}function D(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return E()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=x(s,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function $(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:E}}function E(){return{value:void 0,done:!0}}return g.prototype=m,i(w,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},_(k.prototype),u(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new k(d(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=C,$.prototype={constructor:$,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function a(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(i,r)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(e){a(o,i,r,s,l,"next",e)}function l(e){a(o,i,r,s,l,"throw",e)}s(void 0)}))}}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,s=void 0,s=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===o(s)?s:String(s)),i)}var r,s}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"appendFieldEvents",value:function(e,t){this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]);var n=this.fieldsEvents[e];n&&r.a.each(n,(function(e,n){r()(t).on(e,(function(e){n(t,e)}))}))}},{key:"sanitizeTitle",value:function(e){e=(e=e.replace(/^\s+|\s+$/g,"")).toLowerCase();for(var t="àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;",n=0,i=t.length;n<i;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuuncescrzyuudtn------".charAt(n));return e=e.replace(".","-").replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/\//g,"")}},{key:"autoFillKey",value:function(e,t){var n=this;r()(t).add(e).on("focusout",(function(){var i=r()(e).val(),o=r()(t).val();!i.length&&o.length&&r()(e).val(n.sanitizeTitle(o))}))}},{key:"copyToClipboard",value:function(e){var t=navigator.clipboard.writeText(r()(e).val()).then((function(){return!0}),(function(){return!1}));return l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"disableProFieldSelectOptions",value:function(e){var t=r()(e).closest(".cpt-fields-section");if(t&&"manage_cpt_field"===t.data("id")){var n=r()(e).find("select > option");r.a.each(n,(function(e,t){t.text.endsWith(" [PRO only]")&&(t.disabled=!0)}))}}}])&&c(t.prototype,n),i&&c(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();window.cptUtils=new u,wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.checkbox={load:function(e,t){var n=r()(e).find('input[type="checkbox"][required]');r()(n).on("click",(function(t){r()(n).prop("required",!r()(e).find('input[type="checkbox"]:checked').length)}))}},e}));n(4);wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.color={load:function(e,t){var n=r()(e).find(".cpt-color-section:first"),i=r()(n).children("input");r()(i).wpColorPicker({palettes:!0})}},e}));n(5);function d(e){return e[e.length-1]}function h(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function p(e,t){return e?e.split(t):[]}function f(e,t,n){return(void 0===t||e>=t)&&(void 0===n||e<=n)}function g(e,t,n){return e<t?t:e>n?n:e}function m(e,t,n={},i=0,r=""){r+=`<${Object.keys(n).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(r=r(i)),`${e} ${t}="${r}"`},e)}></${e}>`;const o=i+1;return o<t?m(e,t,n,o,r):r}function v(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function y(e){return new Date(e).setHours(0,0,0,0)}function b(){return(new Date).setHours(0,0,0,0)}function w(...e){switch(e.length){case 0:return b();case 1:return y(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function _(e,t){const n=new Date(e);return n.setDate(n.getDate()+t)}function k(e,t){const n=new Date(e),i=n.getMonth()+t;let r=i%12;r<0&&(r+=12);const o=n.setMonth(i);return n.getMonth()!==r?n.setDate(0):o}function D(e,t){const n=new Date(e),i=n.getMonth(),r=n.setFullYear(n.getFullYear()+t);return 1===i&&2===n.getMonth()?n.setDate(0):r}function x(e,t){return(e-t+7)%7}function S(e,t,n=0){const i=new Date(e).getDay();return _(e,x(t,n)-x(i,n))}function A(e,t){return Math.round((e-t)/6048e5)+1}function $(e){const t=S(e,4,1);return A(t,S(new Date(t).setMonth(0,4),4,1))}function C(e,t){const n=S(new Date(e).setMonth(0,1),t,t),i=S(e,t,t),r=A(i,n);if(r<53)return r;return i===S(new Date(e).setDate(32),t,t)?1:r}function E(e){return C(e,0)}function O(e){return C(e,6)}function L(e,t){const n=new Date(e).getFullYear();return Math.floor(n/t)*t}function j(e,t,n){if(1!==t&&2!==t)return e;const i=new Date(e);return 1===t?n?i.setMonth(i.getMonth()+1,0):i.setDate(1):n?i.setFullYear(i.getFullYear()+1,0,0):i.setMonth(0,1),i.setHours(0,0,0,0)}const M=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,T=/[\s!-/:-@[-`{-~年月日]+/;let N={};const F={y:(e,t)=>new Date(e).setFullYear(parseInt(t,10)),m(e,t,n){const i=new Date(e);let r=parseInt(t,10)-1;if(isNaN(r)){if(!t)return NaN;const e=t.toLowerCase(),i=t=>t.toLowerCase().startsWith(e);if(r=n.monthsShort.findIndex(i),r<0&&(r=n.months.findIndex(i)),r<0)return NaN}return i.setMonth(r),i.getMonth()!==function e(t){return t>-1?t%12:e(t+12)}(r)?i.setDate(0):i.getTime()},d:(e,t)=>new Date(e).setDate(parseInt(t,10))},I={d:e=>e.getDate(),dd:e=>P(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>P(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>P(e.getFullYear(),2).slice(-2),yyyy:e=>P(e.getFullYear(),4)};function P(e,t){return e.toString().padStart(t,"0")}function B(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in N)return N[e];const t=e.split(M),n=e.match(new RegExp(M,"g"));if(0===t.length||!n)throw new Error("Invalid date format.");const i=n.map(e=>I[e]),r=Object.keys(F).reduce((e,t)=>(n.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return N[e]={parser(e,t){const i=e.split(T).reduce((e,t,i)=>{if(t.length>0&&n[i]){const r=n[i][0];"M"===r?e.m=t:"D"!==r&&(e[r]=t)}return e},{});return r.reduce((e,n)=>{const r=F[n](e,i[n],t);return isNaN(r)?e:r},b())},formatter:(e,n)=>i.reduce((i,r,o)=>i+`${t[o]}${r(e,n)}`,"")+d(t)}}function R(e,t,n){if(e instanceof Date||"number"==typeof e){const t=y(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return b();if(t&&t.toValue){const i=t.toValue(e,t,n);return isNaN(i)?void 0:y(i)}return B(t).parser(e,n)}}function q(e,t,n){if(isNaN(e)||!e&&0!==e)return"";const i="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(i,t,n):B(t).formatter(i,n)}const H=document.createRange();function V(e){return H.createContextualFragment(e)}function W(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function U(e){return e.getRootNode().activeElement===e}function z(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function Y(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function G(e){e.firstChild&&(e.removeChild(e.firstChild),G(e))}const K=new WeakMap,{addEventListener:Z,removeEventListener:J}=EventTarget.prototype;function Q(e,t){let n=K.get(e);n||(n=[],K.set(e,n)),t.forEach(e=>{Z.call(...e),n.push(e)})}function X(e){let t=K.get(e);t&&(t.forEach(e=>{J.call(...e)}),K.delete(e))}if(!Event.prototype.composedPath){const e=(t,n=[])=>{let i;return n.push(t),t.parentNode?i=t.parentNode:t.host?i=t.host:t.defaultView&&(i=t.defaultView),i?e(i,n):n};Event.prototype.composedPath=function(){return e(this.target)}}function ee(e,t){const n="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return function e(t,n,i){const[r,...o]=t;return n(r)?r:r!==i&&"HTML"!==r.tagName&&0!==o.length?e(o,n,i):void 0}(e.composedPath(),n,e.currentTarget)}var te={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},ne={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:ie,format:re,weekStart:oe}=ne;function se(e,t){return e.length<6&&t>=0&&t<7?h(e,t):e}function ae(e,t){switch(4===e?6===t?3:!t+1:e){case 1:return $;case 2:return E;case 3:return O}}function le(e,t,n){return t.weekStart=e,t.weekEnd=(e+6)%7,4===n&&(t.getWeekNumber=ae(4,e)),e}function ce(e,t,n,i){const r=R(e,t,n);return void 0!==r?r:i}function ue(e,t,n=3){const i=parseInt(e,10);return i>=0&&i<=n?i:t}function de(e,t,n,i){t in e&&(n in e||(e[n]=i?i(e[t]):e[t]),delete e[t])}function he(e,t){const n=Object.assign({},e),i={},r=t.constructor.locales,o=!!t.rangeSideIndex;let{datesDisabled:s,format:a,language:l,locale:c,maxDate:u,maxView:d,minDate:p,pickLevel:f,startView:g,weekNumbers:m,weekStart:v}=t.config||{};if(de(n,"calendarWeeks","weekNumbers",e=>e?1:0),de(n,"clearBtn","clearButton"),de(n,"todayBtn","todayButton"),de(n,"todayBtnMode","todayButtonMode"),n.language){let e;if(n.language!==l&&(r[n.language]?e=n.language:(e=n.language.split("-")[0],r[e]||(e=!1))),delete n.language,e){l=i.language=e;const t=c||r[ie];c=Object.assign({format:re,weekStart:oe},r[ie]),l!==ie&&Object.assign(c,r[l]),i.locale=c,a===t.format&&(a=i.format=c.format),v===t.weekStart&&(v=le(c.weekStart,i,m))}}if(n.format){const e="function"==typeof n.format.toDisplay,t="function"==typeof n.format.toValue,r=M.test(n.format);(e&&t||r)&&(a=i.format=n.format),delete n.format}let y=f;"pickLevel"in n&&(y=ue(n.pickLevel,f,2),delete n.pickLevel),y!==f&&(y>f&&("minDate"in n||(n.minDate=p),"maxDate"in n||(n.maxDate=u)),s&&!n.datesDisabled&&(n.datesDisabled=[]),f=i.pickLevel=y);let b=p,_=u;if("minDate"in n){const e=w(0,0,1);b=null===n.minDate?e:ce(n.minDate,a,c,b),b!==e&&(b=j(b,f,!1)),delete n.minDate}if("maxDate"in n&&(_=null===n.maxDate?void 0:ce(n.maxDate,a,c,_),void 0!==_&&(_=j(_,f,!0)),delete n.maxDate),_<b?(p=i.minDate=_,u=i.maxDate=b):(p!==b&&(p=i.minDate=b),u!==_&&(u=i.maxDate=_)),n.datesDisabled){const e=n.datesDisabled;if("function"==typeof e)i.datesDisabled=null,i.checkDisabled=(t,n)=>e(new Date(t),n,o);else{const t=i.datesDisabled=e.reduce((e,t)=>{const n=R(t,a,c);return void 0!==n?h(e,j(n,f,o)):e},[]);i.checkDisabled=e=>t.includes(e)}delete n.datesDisabled}if("defaultViewDate"in n){const e=R(n.defaultViewDate,a,c);void 0!==e&&(i.defaultViewDate=e),delete n.defaultViewDate}if("weekStart"in n){const e=Number(n.weekStart)%7;isNaN(e)||(v=le(e,i,m)),delete n.weekStart}if(n.daysOfWeekDisabled&&(i.daysOfWeekDisabled=n.daysOfWeekDisabled.reduce(se,[]),delete n.daysOfWeekDisabled),n.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=n.daysOfWeekHighlighted.reduce(se,[]),delete n.daysOfWeekHighlighted),"weekNumbers"in n){let e=n.weekNumbers;if(e){const t="function"==typeof e?(t,n)=>e(new Date(t),n):ae(e=parseInt(e,10),v);t&&(m=i.weekNumbers=e,i.getWeekNumber=t)}else m=i.weekNumbers=0,i.getWeekNumber=null;delete n.weekNumbers}if("maxNumberOfDates"in n){const e=parseInt(n.maxNumberOfDates,10);e>=0&&(i.maxNumberOfDates=e,i.multidate=1!==e),delete n.maxNumberOfDates}n.dateDelimiter&&(i.dateDelimiter=String(n.dateDelimiter),delete n.dateDelimiter);let k=d;"maxView"in n&&(k=ue(n.maxView,d),delete n.maxView),k=f>k?f:k,k!==d&&(d=i.maxView=k);let D=g;if("startView"in n&&(D=ue(n.startView,D),delete n.startView),D<f?D=f:D>d&&(D=d),D!==g&&(i.startView=D),n.prevArrow){const e=V(n.prevArrow);e.childNodes.length>0&&(i.prevArrow=e.childNodes),delete n.prevArrow}if(n.nextArrow){const e=V(n.nextArrow);e.childNodes.length>0&&(i.nextArrow=e.childNodes),delete n.nextArrow}if("disableTouchKeyboard"in n&&(i.disableTouchKeyboard="ontouchstart"in document&&!!n.disableTouchKeyboard,delete n.disableTouchKeyboard),n.orientation){const e=n.orientation.toLowerCase().split(/\s+/g);i.orientation={x:e.find(e=>"left"===e||"right"===e)||"auto",y:e.find(e=>"top"===e||"bottom"===e)||"auto"},delete n.orientation}if("todayButtonMode"in n){switch(n.todayButtonMode){case 0:case 1:i.todayButtonMode=n.todayButtonMode}delete n.todayButtonMode}return Object.entries(n).forEach(([e,t])=>{void 0!==t&&e in ne&&(i[e]=t)}),i}const pe={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};var fe=v('<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% prev-button prev-btn"></button>\n <button type="button" class="%buttonClass% view-switch"></button>\n <button type="button" class="%buttonClass% next-button next-btn"></button>\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% today-button today-btn"></button>\n <button type="button" class="%buttonClass% clear-button clear-btn"></button>\n </div>\n </div>\n </div>\n</div>'),ge=v(`<div class="days">\n <div class="days-of-week">${m("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${m("span",42)}</div>\n</div>`),me=v(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${m("span",6,{class:"week"})}</div>\n</div>`);class ve{constructor(e,t){Object.assign(this,t,{picker:e,element:V('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!e.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(e){"pickLevel"in e&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}prepareForRender(e,t,n){this.disabled=[];const i=this.picker;i.setViewSwitchLabel(e),i.setPrevButtonDisabled(t),i.setNextButtonDisabled(n)}setDisabled(e,t){t.add("disabled"),h(this.disabled,e)}performBeforeHook(e,t){let n=this.beforeShow(new Date(t));switch(typeof n){case"boolean":n={enabled:n};break;case"string":n={classes:n}}if(n){const i=e.classList;if(!1===n.enabled&&this.setDisabled(t,i),n.classes){const e=n.classes.split(/\s+/);i.add(...e),e.includes("disabled")&&this.setDisabled(t,i)}n.content&&function(e,t){G(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(V(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,n.content)}}renderCell(e,t,n,i,{selected:r,range:o},s,a=[]){e.textContent=t,this.isMinView&&(e.dataset.date=i);const l=e.classList;if(e.className="datepicker-cell "+this.cellClass,n<this.first?l.add("prev"):n>this.last&&l.add("next"),l.add(...a),(s||this.checkDisabled(i,this.id))&&this.setDisabled(i,l),o){const[e,t]=o;n>e&&n<t&&l.add("range"),n===e&&l.add("range-start"),n===t&&l.add("range-end")}r.includes(n)&&l.add("selected"),n===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(e,i)}refreshCell(e,t,n,[i,r]){const o=e.classList;o.remove("range","range-start","range-end","selected","focused"),t>i&&t<r&&o.add("range"),t===i&&o.add("range-start"),t===r&&o.add("range-end"),n.includes(t)&&o.add("selected"),t===this.focused&&o.add("focused")}changeFocusedCell(e){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}class ye extends ve{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=V(ge).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if("minDate"in e&&(this.minDate=e.minDate),"maxDate"in e&&(this.maxDate=e.maxDate),e.checkDisabled&&(this.checkDisabled=e.checkDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),"todayHighlight"in e&&(this.todayHighlight=e.todayHighlight),"weekStart"in e&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const n=this.locale=e.locale;this.dayNames=n.daysMin,this.switchLabelFormat=n.titleFormat,t=!0}if("beforeShowDay"in e&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),"weekNumbers"in e)if(e.weekNumbers&&!this.weekNumbers){const e=V(me).firstChild;this.weekNumbers={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.weekNumbers&&!e.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in e&&(this.getWeekNumber=e.getWeekNumber),"showDaysOfWeek"in e&&(e.showDaysOfWeek?(Y(this.dow),this.weekNumbers&&Y(this.weekNumbers.dow)):(z(this.dow),this.weekNumbers&&z(this.weekNumbers.dow))),t&&Array.from(this.dow.children).forEach((e,t)=>{const n=(this.weekStart+t)%7;e.textContent=this.dayNames[n],e.className=this.daysOfWeekDisabled.includes(n)?"dow disabled":"dow"})}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),n=e.getMonth(),i=w(t,n,1),r=S(i,this.weekStart,this.weekStart);this.first=i,this.last=w(t,n+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){if(this.today=this.todayHighlight?b():void 0,this.prepareForRender(q(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const e=this.weekStart,t=S(this.first,e,e);Array.from(this.weekNumbers.weeks.children).forEach((n,i)=>{const r=_(t,7*i);n.textContent=this.getWeekNumber(r,e),i>3&&n.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((e,t)=>{const n=_(this.start,t),i=new Date(n),r=i.getDay(),o=[];this.today===n&&o.push("today"),this.daysOfWeekHighlighted.includes(r)&&o.push("highlighted"),this.renderCell(e,i.getDate(),n,n,this,n<this.minDate||n>this.maxDate||this.daysOfWeekDisabled.includes(r),o)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.dataset.date),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function be(e,t){if(!e||!e[0]||!e[1])return;const[[n,i],[r,o]]=e;return n>t||r<t?void 0:[n===t?i:-1,r===t?o:12]}class we extends ve{constructor(e){super(e,{id:1,name:"months",cellClass:"month"})}init(e,t=!0){t&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(V(m("span",12,{"data-month":e=>e}))),this.first=0,this.last=11),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),"minDate"in e)if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if("maxDate"in e)if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=w(this.maxYear,this.maxMonth+1,0)}e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),"beforeShowMonth"in e&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>{const n=new Date(t),i=n.getFullYear(),r=n.getMonth();return void 0===e[i]?e[i]=[r]:h(e[i],r),e},{}),t&&t.dates&&(this.range=t.dates.map(e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.year<this.minYear||this.year>this.maxYear,n=this.year===this.minYear,i=this.year===this.maxYear,r=be(this.range,this.year);Array.from(this.grid.children).forEach((o,s)=>{const a=j(new Date(this.year,s,1),1,this.isRangeEnd);this.renderCell(o,this.monthNames[s],s,a,{selected:e,range:r},t||n&&s<this.minMonth||i&&s>this.maxMonth)})}refresh(){const e=this.selected[this.year]||[],t=be(this.range,this.year)||[];Array.from(this.grid.children).forEach((n,i)=>{this.refreshCell(n,i,e,t)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class _e extends ve{constructor(e,t){super(e,t)}init(e,t=!0){var n;t&&(this.navStep=10*this.step,this.beforeShowOption="beforeShow"+(n=this.cellClass,[...n].reduce((e,t,n)=>e+(n?t:t.toUpperCase()),"")),this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(V(m("span",12)))),super.init(e)}setOptions(e){if("minDate"in e&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=L(e.minDate,this.step),this.minDate=w(this.minYear,0,1))),"maxDate"in e&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=L(e.maxDate,this.step),this.maxDate=w(this.maxYear,11,31))),e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),this.beforeShowOption in e){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=L(e,this.navStep),n=t+9*this.step;this.first=t,this.last=n,this.start=t-this.step,this.focused=L(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>h(e,L(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return L(e,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const n=this.start+t*this.step,i=j(new Date(n,0,1),2,this.isRangeEnd);e.dataset.year=n,this.renderCell(e,n,n,i,this,n<this.minYear||n>this.maxYear)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.textContent),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function ke(e,t){const n={date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e};e.element.dispatchEvent(new CustomEvent(t,{detail:n}))}function De(e,t){const{config:n,picker:i}=e,{currentView:r,viewDate:o}=i;let s;switch(r.id){case 0:s=k(o,t);break;case 1:s=D(o,t);break;default:s=D(o,t*r.navStep)}s=g(s,n.minDate,n.maxDate),i.changeFocus(s).render()}function xe(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function Se(e){e.setDate({clear:!0})}function Ae(e){const t=b();1===e.config.todayButtonMode?e.setDate(t,{forceRefresh:!0,viewDate:t}):e.setFocusedDate(t,!0)}function $e(e){const t=()=>{e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()},n=e.element;U(n)?n.addEventListener("blur",t,{once:!0}):t()}function Ce(e,t){const n=e.picker,i=new Date(n.viewDate),r=n.currentView.id,o=1===r?k(i,t-i.getMonth()):D(i,t-i.getFullYear());n.changeFocus(o).changeView(r-1).render()}function Ee(e){xe(e)}function Oe(e){De(e,-1)}function Le(e){De(e,1)}function je(e,t){const n=ee(t,".datepicker-cell");if(!n||n.classList.contains("disabled"))return;const{id:i,isMinView:r}=e.picker.currentView,o=n.dataset;r?e.setDate(Number(o.date)):Ce(e,Number(1===i?o.month:o.year))}function Me(e){e.preventDefault()}const Te=["left","top","right","bottom"].reduce((e,t)=>(e[t]="datepicker-orient-"+t,e),{}),Ne=e=>e?e+"px":e;function Fe(e,t){if("title"in t&&(t.title?(e.controls.title.textContent=t.title,Y(e.controls.title)):(e.controls.title.textContent="",z(e.controls.title))),t.prevArrow){const n=e.controls.prevButton;G(n),t.prevArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const n=e.controls.nextButton;G(n),t.nextArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayButton.textContent=t.locale.today,e.controls.clearButton.textContent=t.locale.clear),"todayButton"in t&&(t.todayButton?Y(e.controls.todayButton):z(e.controls.todayButton)),"minDate"in t||"maxDate"in t){const{minDate:t,maxDate:n}=e.datepicker.config;e.controls.todayButton.disabled=!f(b(),t,n)}"clearButton"in t&&(t.clearButton?Y(e.controls.clearButton):z(e.controls.clearButton))}function Ie(e){const{dates:t,config:n,rangeSideIndex:i}=e;return g(t.length>0?d(t):j(n.defaultViewDate,n.pickLevel,i),n.minDate,n.maxDate)}function Pe(e,t){"_oldViewDate"in e||t===e.viewDate||(e._oldViewDate=e.viewDate),e.viewDate=t;const{id:n,year:i,first:r,last:o}=e.currentView,s=new Date(t).getFullYear();switch(n){case 0:return t<r||t>o;case 1:return s!==i;default:return s<r||s>o}}function Be(e){return window.getComputedStyle(e).direction}class Re{constructor(e){const{config:t,inputField:n}=this.datepicker=e,i=fe.replace(/%buttonClass%/g,t.buttonClass),r=this.element=V(i).firstChild,[o,s,a]=r.firstChild.children,l=o.firstElementChild,[c,u,d]=o.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:u,nextButton:d,todayButton:h,clearButton:p};this.main=s,this.controls=f;const g=n?"dropdown":"inline";r.classList.add("datepicker-"+g),Fe(this,t),this.viewDate=Ie(e),Q(e,[[r,"mousedown",Me],[s,"click",je.bind(null,e)],[f.viewSwitch,"click",Ee.bind(null,e)],[f.prevButton,"click",Oe.bind(null,e)],[f.nextButton,"click",Le.bind(null,e)],[f.todayButton,"click",Ae.bind(null,e)],[f.clearButton,"click",Se.bind(null,e)]]),this.views=[new ye(this),new we(this),new _e(this,{id:2,name:"years",cellClass:"year",step:1}),new _e(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[t.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),t.container?t.container.appendChild(this.element):n.after(this.element)}setOptions(e){Fe(this,e),this.views.forEach(t=>{t.init(e,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:e,element:t}=this,n=e.inputField;if(n){const i=Be(n);i!==Be(W(t))?t.dir=i:t.dir&&t.removeAttribute("dir"),t.style.visibility="hidden",t.classList.add("active"),this.place(),t.style.visibility="",e.config.disableTouchKeyboard&&n.blur()}else t.classList.add("active");this.active=!0,ke(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,ke(this.datepicker,"hide"))}place(){const{classList:e,offsetParent:t,style:n}=this.element,{config:i,inputField:r}=this.datepicker,{width:o,height:s}=this.element.getBoundingClientRect(),{left:a,top:l,right:c,bottom:u,width:d,height:h}=r.getBoundingClientRect();let{x:p,y:f}=i.orientation,g=a,m=l;if(t!==document.body&&t){const e=t.getBoundingClientRect();g-=e.left-t.scrollLeft,m-=e.top-t.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=function e(t){const n=W(t);if(n!==document.body&&n)return"visible"!==window.getComputedStyle(n).overflow?n:e(n)}(r);let y=0,b=0,{clientWidth:w,clientHeight:_}=document.documentElement;if(v){const e=v.getBoundingClientRect();e.top>0&&(b=e.top),e.left>0&&(y=e.left),e.right<w&&(w=e.right),e.bottom<_&&(_=e.bottom)}let k=0;"auto"===p&&(a<y?(p="left",k=y-a):a+o>w?(p="right",w<c&&(k=w-c)):p="rtl"===Be(r)?c-o<y?"left":"right":"left"),"right"===p&&(g+=d-o),g+=k,"auto"===f&&(f=l-s>b&&u+s>_?"top":"bottom"),"top"===f?m-=s:m+=h,e.remove(...Object.values(Te)),e.add(Te[p],Te[f]),n.left=Ne(g),n.top=Ne(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevButtonDisabled(e){this.controls.prevButton.disabled=e}setNextButtonDisabled(e){this.controls.nextButton.disabled=e}changeView(e){const t=this.currentView;return e!==t.id&&(this._oldView||(this._oldView=t),this.currentView=this.views[e],this._renderMethod="render"),this}changeFocus(e){return this._renderMethod=Pe(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(e){const t=void 0===e?Ie(this.datepicker):e;return this._renderMethod=Pe(this,t)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const{currentView:t,datepicker:n,_oldView:i}=this,r=new Date(this._oldViewDate),o=e&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,t[o](),i&&(this.main.replaceChild(t.element,i.element),ke(n,"changeView")),!isNaN(r)){const e=new Date(this.viewDate);e.getFullYear()!==r.getFullYear()&&ke(n,"changeYear"),e.getMonth()!==r.getMonth()&&ke(n,"changeMonth")}}}function qe(e,t,n){const i=e.picker,r=i.currentView,o=r.step||1;let s,a=i.viewDate;switch(r.id){case 0:a=_(a,n?7*t:t),s=_;break;case 1:a=k(a,n?4*t:t),s=k;break;default:a=D(a,t*(n?4:1)*o),s=D}a=function e(t,n,i,r,o,s){if(f(t,o,s)){if(r(t)){return e(n(t,i),n,i,r,o,s)}return t}}(a,s,t<0?-o:o,e=>r.disabled.includes(e),r.minDate,r.maxDate),void 0!==a&&i.changeFocus(a).render()}function He(e,t){const{config:n,picker:i,editMode:r}=e,o=i.active,{key:s,altKey:a,shiftKey:l}=t,c=t.ctrlKey||t.metaKey,u=()=>{t.preventDefault(),t.stopPropagation()};if("Tab"===s)return void $e(e);if("Enter"===s){if(o)if(r)e.exitEditMode({update:!0,autohide:n.autohide});else{const t=i.currentView;t.isMinView?e.setDate(i.viewDate):(i.changeView(t.id-1).render(),u())}else e.update();return}const d=n.shortcutKeys,h={key:s,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(d).find(e=>{const t=d[e];return!Object.keys(t).find(e=>t[e]!==h[e])});if(p){let t;if("toggle"===p?t=p:r?"exitEditMode"===p&&(t=p):o?"hide"===p?t=p:"prevButton"===p?t=[De,[e,-1]]:"nextButton"===p?t=[De,[e,1]]:"viewSwitch"===p?t=[xe,[e]]:n.clearButton&&"clearButton"===p?t=[Se,[e]]:n.todayButton&&"todayButton"===p&&(t=[Ae,[e]]):"show"===p&&(t=p),t)return Array.isArray(t)?t[0].apply(null,t[1]):e[t](),void u()}if(!o||r)return;const f=(n,i)=>{l||c||a?e.enterEditMode():(qe(e,n,i),t.preventDefault())};"ArrowLeft"===s?f(-1,!1):"ArrowRight"===s?f(1,!1):"ArrowUp"===s?f(-1,!0):"ArrowDown"===s?f(1,!0):("Backspace"===s||"Delete"===s||s&&1===s.length&&!c)&&e.enterEditMode()}function Ve(e){e.config.showOnFocus&&!e._showing&&e.show()}function We(e,t){const n=t.target;(e.picker.active||e.config.showOnClick)&&(n._active=U(n),n._clicking=setTimeout(()=>{delete n._active,delete n._clicking},2e3))}function Ue(e,t){const n=t.target;n._clicking&&(clearTimeout(n._clicking),delete n._clicking,n._active&&e.enterEditMode(),delete n._active,e.config.showOnClick&&e.show())}function ze(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function Ye(e,t){const{element:n,picker:i}=e;if(!i.active&&!U(n))return;const r=i.element;ee(t,e=>e===n||e===r)||$e(e)}function Ge(e,t){return e.map(e=>q(e,t.format,t.locale)).join(t.dateDelimiter)}function Ke(e,t,n=!1){if(0===t.length)return n?[]:void 0;const{config:i,dates:r,rangeSideIndex:o}=e,{pickLevel:s,maxNumberOfDates:a}=i;let l=t.reduce((e,t)=>{let n=R(t,i.format,i.locale);return void 0===n||(n=j(n,s,o),!f(n,i.minDate,i.maxDate)||e.includes(n)||i.checkDisabled(n,s)||!(s>0)&&i.daysOfWeekDisabled.includes(new Date(n).getDay())||e.push(n)),e},[]);return 0!==l.length?(i.multidate&&!n&&(l=l.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!l.includes(e)))),a&&l.length>a?l.slice(-1*a):l):void 0}function Ze(e,t=3,n=!0,i){const{config:r,picker:o,inputField:s}=e;if(2&t){const e=o.active?r.pickLevel:r.startView;o.update(i).changeView(e).render(n)}1&t&&s&&(s.value=Ge(e.dates,r))}function Je(e,t,n){const i=e.config;let{clear:r,render:o,autohide:s,revert:a,forceRefresh:l,viewDate:c}=n;void 0===o&&(o=!0),o?void 0===s&&(s=i.autohide):s=l=!1,c=R(c,i.format,i.locale);const u=Ke(e,t,r);(u||a)&&(u&&u.toString()!==e.dates.toString()?(e.dates=u,Ze(e,o?3:1,!0,c),ke(e,"changeDate")):Ze(e,l?3:1,!0,c),s&&e.hide())}function Qe(e,t){return t?n=>q(n,t,e.config.locale):e=>new Date(e)}class Xe{constructor(e,t={},n){e.datepicker=this,this.element=e,this.dates=[];const i=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:b(),maxDate:void 0,minDate:void 0},he(ne,this));let r;if("INPUT"===e.tagName?(r=this.inputField=e,r.classList.add("datepicker-input"),t.container&&(i.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container))):i.container=e,n){const e=n.inputs.indexOf(r),t=n.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,this.rangepicker=n,this.rangeSideIndex=e}this._options=t,Object.assign(i,he(t,this)),i.shortcutKeys=function(e){return Object.keys(pe).reduce((t,n)=>{const i=void 0===e[n]?pe[n]:e[n],r=i&&i.key;if(!r||"string"!=typeof r)return t;const o={key:r,ctrlOrMetaKey:!!(i.ctrlOrMetaKey||i.ctrlKey||i.metaKey)};return r.length>1&&(o.altKey=!!i.altKey,o.shiftKey=!!i.shiftKey),t[n]=o,t},{})}(t.shortcutKeys||{});const o=p(e.value||e.dataset.date,i.dateDelimiter);delete e.dataset.date;const s=Ke(this,o);s&&s.length>0&&(this.dates=s),r&&(r.value=Ge(this.dates,i));const a=this.picker=new Re(this),l=[e,"keydown",He.bind(null,this)];r?Q(this,[l,[r,"focus",Ve.bind(null,this)],[r,"mousedown",We.bind(null,this)],[r,"click",Ue.bind(null,this)],[r,"paste",ze.bind(null,this)],[document,"mousedown",Ye.bind(null,this)],[window,"resize",a.place.bind(a)]]):(Q(this,[l]),this.show())}static formatDate(e,t,n){return q(e,t,n&&te[n]||te.en)}static parseDate(e,t,n){return R(e,t,n&&te[n]||te.en)}static get locales(){return te}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=he(e,this);Object.assign(this._options,e),Object.assign(this.config,t),this.picker.setOptions(t),Ze(this,3)}show(){if(this.inputField){const{config:e,inputField:t}=this;if(t.disabled||t.readOnly&&!e.enableOnReadonly)return;U(t)||e.disableTouchKeyboard||(this._showing=!0,t.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),X(this),this.picker.detach();const e=this.element;return e.classList.remove("datepicker-input"),delete e.datepicker,this}getDate(e){const t=Qe(this,e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],n={},i=d(e);!i||"object"!=typeof i||Array.isArray(i)||i instanceof Date||Object.assign(n,t.pop());Je(this,Array.isArray(t[0])?t[0]:t,n)}update(e){if(!this.inputField)return;const t=Object.assign(e||{},{clear:!0,render:!0,viewDate:void 0});Je(this,p(this.inputField.value,this.config.dateDelimiter),t)}getFocusedDate(e){return Qe(this,e)(this.picker.viewDate)}setFocusedDate(e,t=!1){const{config:n,picker:i,active:r,rangeSideIndex:o}=this,s=n.pickLevel,a=R(e,n.format,n.locale);void 0!==a&&(i.changeFocus(j(a,s,o)),r&&t&&i.changeView(s),i.render())}refresh(e,t=!1){let n;e&&"string"!=typeof e&&(t=e,e=void 0),n="picker"===e?2:"input"===e?1:3,Ze(this,n,!t)}enterEditMode(){const e=this.inputField;e&&!e.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,e.classList.add("in-edit"))}exitEditMode(e){if(!this.inputField||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit"),t.update&&this.update(t)}}function et(e){return(et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==et(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===et(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.date={load:function(e,t){var n=r()(e).find(".cpt-date-section:first"),i=r()(n).children("input"),o="no"!==r()(i).data("max")&&r()(i).data("max"),s="no"!==r()(i).data("min")&&r()(i).data("min");new Xe(i[0],{autohide:!0,clearBtn:!0,maxDate:o,minDate:s,format:"dd/mm/yyyy"})}},e}));var nt=wp.i18n,it=nt.__;nt._x,nt._n,nt._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.file={load:function(e,t){new rt(e)}},e}));var rt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fileSection=r()(t).find(".cpt-file-section:first"),this.fileTypes=r()(this.fileSection).data("type"),this.fileInput=r()(this.fileSection).find("input"),this.filePreview=r()(this.fileSection).find("img"),this.fileActions=r()(this.fileSection).find(".cpt-file-actions"),this.fileName=r()(this.fileSection).find(".file-name"),this.addButton=r()(this.fileSection).find(".cpt-file-upload"),this.removeButton=r()(this.fileSection).find(".cpt-file-remove"),this.listenRemoveEvent(),this.listenAddEvent()}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(){var e=this;r()(this.addButton).on("click",(function(t){t.preventDefault();var n=wp.media({title:it("Add file","custom-post-types"),frame:"select",library:wp.media.query({type:e.fileTypes,uploadedTo:wp.media.view.settings.post.id}),button:{text:it("Choose file","custom-post-types")},multiple:!1}).on("select",(function(){var t=n.state().get("selection").first().toJSON(),i=!!(t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url)&&t.sizes.thumbnail.url;i&&(r()(e.filePreview).attr("src",i),r()(e.filePreview).show());var o=t.mime;o.startsWith("image")&&(o="image"),o.startsWith("audio")&&(o="audio"),o.startsWith("video")&&(o="video"),"-1"!=r.a.inArray(o,e.fileTypes)?(r()(e.fileName).html(t.url.split("/").reverse()[0]),r()(e.fileActions).attr("title",t.url.split("/").reverse()[0]),r()(e.fileInput).val(t.id),r()(e.removeButton).prop("disabled",!1)):e.resetField()})).open()}))}},{key:"listenRemoveEvent",value:function(){var e=this;r()(this.removeButton).on("click",(function(t){t.preventDefault(),e.resetField()}))}},{key:"resetField",value:function(){r()(this.fileName).html(""),r()(this.fileInput).val(""),r()(this.filePreview).removeAttr("src"),r()(this.filePreview).hide(),r()(this.removeButton).prop("disabled",!0),r()(this.fileActions).attr("title",it("Choose","custom-post-types"))}}])&&tt(t.prototype,n),i&&tt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();n(1),n(2);function ot(e){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function st(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ot(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ot(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ot(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.post_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-post_rel-options",nonce:cpt.ajax_nonce,search:e.term,post_type:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e}));var at=wp.i18n;at.__,at._x,at._n,at._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.repeater={load:function(e,t){new lt(e)}},e}));var lt=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.repeaterSection=r()(t).find(".cpt-repeater-section:first"),this.parent=r()(this.repeaterSection).data("parent"),this.fields=r()(this.repeaterSection).data("fields"),this.initSortable();var i=r()(this.repeaterSection).parent().children(".cpt-repeater-add:first");i.length>0&&this.listenAddEvent(i);var o=r()(this.repeaterSection).find(".cpt-repeater-group");r.a.each(o,(function(e,t){n.initFieldGroup(t)}))}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(e){var t=this;r()(e).on("click",(function(n){n.preventDefault(),r()(e).prop("disabled",!0);var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(t.repeaterSection).append(i);var o=r()(t.repeaterSection).children(".cpt-repeater-group").length,s=[];s.push({name:"action",value:"cpt-get-repeater-group"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"fields",value:JSON.stringify(t.fields)}),s.push({name:"parent",value:t.parent+"["+o+"]"}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(n){if(n.success){r()(e).prop("disabled",!1),r()(i).remove();var o=r()(n.data);r()(t.repeaterSection).append(o),t.initFieldGroup(o)}else r()(e).prop("disabled",!1),r()(i).remove(),console.log("Error",n)}})}))}},{key:"initSortable",value:function(){var e=r()(this.repeaterSection).children(".cpt-repeater-group").children(".cpt-repeater-buttons").find(".move");r()(e).on("click",(function(e){e.preventDefault()})),r()(this.repeaterSection).sortable({handle:".move",cancel:"",cursor:"grab",axis:"y",delay:150,dropOnEmpty:!1,opacity:.5,revert:!0})}},{key:"initFieldGroup",value:function(e){var t=r()(e).find(".cpt-repeater-fields:first").children(".cpt-field"),n=r()(e).find(".cpt-repeater-fields:first .cpt-repeater-extra").children(".cpt-field");r.a.each(r.a.merge(t,n),(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")})),this.listenRemoveEvent(e),this.autofillKeyInput(e),this.listenSwitchFieldTypeEvent(e)}},{key:"listenRemoveEvent",value:function(e){var t=r()(e).find(".remove:first"),n=r()(t).closest(".cpt-repeater-group").children(".cpt-repeater-remove");r()(t).on("click",(function(e){e.preventDefault(),r()(n).addClass("active")})),r()(n).find(".abort:first").on("click",(function(e){e.preventDefault(),r()(n).removeClass("active")})),r()(n).find(".confirm:first").on("click",(function(t){t.preventDefault(),r()(e).remove()}))}},{key:"autofillKeyInput",value:function(e){var t=r()(e).find('input[id$="-label"]:first'),n=r()(e).find('input[id$="-key"]:first');window.cptUtils.autoFillKey(n,t)}},{key:"listenSwitchFieldTypeEvent",value:function(e){var t=r()(e).find(".cpt-repeater-field-type:first").find("select"),n=r()(e).find(".cpt-repeater-extra:first");r()(t).on("select2:select",(function(e){r()(n).empty();var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(n).append(i);var o=!!r()(t).val().length&&r()(t).val();if(o){var s=r()(t).attr("name").replace("meta-fields","").replace("[type]",""),a=[];a.push({name:"action",value:"cpt-get-repeater-extra-fields"}),a.push({name:"nonce",value:cpt.ajax_nonce}),a.push({name:"field-type",value:o}),a.push({name:"parent",value:s}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:a,success:function(e){if(e.success){r()(i).remove();var t=r()(e.data);r()(n).append(t),r()(n).children(".cpt-field"),r.a.each(t,(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")}))}else r()(i).remove(),console.log("Error",e)}})}else r()(i).remove()}))}}])&&st(t.prototype,n),i&&st(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ct(e){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ut(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ht(i.key),i)}}function dt(e,t,n){return(t=ht(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ht(e){var t=function(e,t){if("object"!==ct(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ct(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ct(t)?t:String(t)}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.select={load:function(e,t){window.cptUtils.disableProFieldSelectOptions(e);var n=r()(e).find("select:first"),i={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};r()(n).select2(i)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tax_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-tax_rel-options",nonce:cpt.ajax_nonce,search:e.term,taxonomy:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.text={load:function(e,t){}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.time={load:function(e,t){for(var n=r()(e).find(".cpt-time-section:first"),i=r()(n).children("select"),o=r()(i).data("value")?r()(i).data("value"):"",s="no"!==r()(i).data("max")&&r()(i).data("max"),a="no"!==r()(i).data("min")&&r()(i).data("min"),l=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"00:00",i=0;if(!n)return i;var r=!!n.split(":")&&n.split(":"),o=null!==(e=r[0])&&void 0!==e&&e,s=null!==(t=r[1])&&void 0!==t&&t,a=Number(o+s);return Number.isInteger(a)?a:i},c=l(s),u=l(a),d=0;d<=23;d++){d=d<10?"0"+d:d;for(var h=0;h<=59;h++){var p=d+":"+(h=h<10?"0"+h:h);(u>0&&l(p)<u||c>0&&l(p)>c)&&c>u||r()(i).append(r()('<option value="'+p+'"'+(o==p?' selected="selected"':"")+">"+p+"</option>"))}}var f={placeholder:r()(i).attr("placeholder")?r()(selectEl).attr("placeholder"):" ... ",allowClear:!0,multiple:!1};r()(i).select2(f)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tinymce={load:function(e,t){new pt(e)}},e}));var pt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),dt(this,"editorEl",void 0),dt(this,"editorId",void 0),dt(this,"editorForm",void 0),dt(this,"defaultArgs",{tinymce:{wpautop:!1,plugins:"charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern",toolbar1:"formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,wp_more,spellchecker,fullscreen,wp_adv,listbuttons",toolbar2:"styleselect,strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",textarea_rows:20,wp_autoresize_on:!1,autoresize_min_height:50},quicktags:{buttons:"strong,em,link,block,del,ins,img,ul,ol,li,code,more,close"},mediaButtons:!0}),this.editorEl=r()(t).find("textarea:first"),this.editorId=r()(this.editorEl).attr("id"),this.defaultArgs.tinymce.wp_autoresize_on=r()(this.editorEl).is("[autoresize]"),this.editorForm=r()(t).closest("form"),this.startEditor()}var t,n,i;return t=e,(n=[{key:"startEditor",value:function(){var e=this,t=!1,n=setInterval((function(){!r()("#post-title-0")&&r()("body").hasClass("block-editor-page")||(t=!0,e.removeEditor(),e.initializeEditor(),e.listenSubmitEvent(),e.listenSortableEvent()),t&&clearInterval(n)}),500)}},{key:"initializeEditor",value:function(){wp.oldEditor.initialize(this.editorId,this.defaultArgs)}},{key:"removeEditor",value:function(){wp.oldEditor.remove(this.editorId)}},{key:"listenSubmitEvent",value:function(){var e=tinyMCE.editors[this.editorId];r()(this.editorForm).on("submit",(function(t){e.save()})),e.on("blur",(function(t){e.save()})),r()(document).ajaxComplete((function(t,n,i){i.data&&i.data.match(/action=add-tag/)&&(e.setContent(""),e.save())}))}},{key:"listenSortableEvent",value:function(){var e=this,t=r()(this.editorEl).closest(".ui-sortable");r()(t).on("sortstart",(function(){e.removeEditor()})),r()(t).on("sortstop",(function(){e.initializeEditor()}))}}])&&ut(t.prototype,n),i&&ut(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ft(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ft(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ft(o)?o:String(o)),i)}var r,o}var mt=wp.i18n,vt=mt.__;mt._x,mt._n,mt._nx;new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.body=r()("body"),this.window=r()(window),this.utils=new u,this.loadFields(),this.loadUiFeatures()}var t,n,i;return t=e,(n=[{key:"loadUiFeatures",value:function(){var e=this;this.body.on("click",".cpt-field-wrap.advanced-field-btn .button",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-fields-section"),i=r()(n).find(".cpt-field-wrap.advanced-field");r()(t).hasClass("button-secondary")?(r()(i).removeClass("active"),r()(t).removeClass("button-secondary").addClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-insert"),r()(t).find(".label").html(vt("Advanced view","custom-post-types"))):(r()(i).addClass("active"),r()(t).addClass("button-secondary").removeClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-remove"),r()(t).find(".label").html(vt("Simple view","custom-post-types")))})),this.window.on("load",(function(){if(e.body.hasClass("block-editor-page")){var t=r()('.cpt-fields-section *[id^="meta-fields-"][required]');t.length<=0||setInterval((function(){!function(e){var t=!0;r.a.each(e,(function(e,n){var i=r()(n).val().length>0;t=!!t&&i}));var n=r()(".edit-post-header__settings button.editor-post-publish-button__button");t?(r()(n).removeAttr("disabled"),r()(n).attr("aria-disabled","false")):(r()(n).attr("disabled","disabled"),r()(n).attr("aria-disabled","true"))}(t)}),200)}})),this.body.on("click",".cpt-notice.is-dismissible a.cpt-dismiss-notice",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-notice").find("button.notice-dismiss"),i=r()(t).data("notice"),o=r()(t).data("duration"),s=[];s.push({name:"action",value:"cpt-dismiss-notice"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"key",value:i}),s.push({name:"duration",value:o}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?n.click():console.log("Error",e)}})})),this.body.on("click",".cpt-notice pre.error-code > a",(function(e){e.preventDefault();var t=e.currentTarget;r()(t).closest(".error-code").find("code").addClass("show"),r()(t).remove()}));var t=r()('div[data-id="manage_cpt"].cpt-fields-section, div[data-id="manage_cpt_tax"].cpt-fields-section');r.a.each(t,(function(t,n){var i=r()(n).find('input[id$="-plural"]:first'),o=r()(n).find('input[id$="-id"]:first');e.utils.autoFillKey(o,i)}))}},{key:"loadFields",value:function(){var e=this;this.$fieldGroups=r()(".cpt-fields-section"),this.$fieldGroups&&(this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]),r.a.each(this.$fieldGroups,(function(t,n){var i=r()(n).children(".cpt-field");i&&r.a.each(i,(function(t,n){var i=r()(n).data("field-type");e.utils.appendFieldEvents(i,n),r()(n).trigger("load")}))})))}}])&>(t.prototype,n),i&>(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}())}]); -
custom-post-types/tags/4.0.10/includes/classes/Core.php
r2955028 r2955361 139 139 /** 140 140 * @return void 141 * 142 * @see \CustomPostTypes\includes\classes\Utils::getUiPostTypesArgs 141 143 */ 142 144 private function registerUiPostTypes() 143 145 { 144 // CustomPostTypes\includes\classes\Utils::getUiPostTypesArgs145 146 146 // Remove quick edit links 147 147 add_filter('post_row_actions', function ($actions, $post) { … … 233 233 /** 234 234 * @return void 235 * 236 * @see \CustomPostTypes\includes\classes\Utils::getUiAdminPagesArgs 235 237 */ 236 238 private function registerUiPages() 237 239 { 238 // CustomPostTypes\includes\classes\Utils::getUiAdminPagesArgs239 240 240 // Remove new post type menu 241 241 add_action('admin_menu', function () { -
custom-post-types/tags/4.0.10/includes/classes/Utils.php
r2955028 r2955361 587 587 'menu_position' => null, 588 588 'supports' => [''], 589 'menu_icon' => 'da shicons-index-card',589 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode(file_get_contents(Utils::getInfo('path') . 'assets/dashboard-icon.svg')), 590 590 'can_export' => false, 591 591 ]; -
custom-post-types/trunk/assets/icon.svg
r2627723 r2955361 1 <svg id="Plugin_icon" data-name="Plugin icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 16"><title>plugin-icon</title><path id="_Track_" data-name="<Track>" d="M1,3.17V18H19V4H8V3.17A1.18,1.18,0,0,0,6.82,2H2.18a1.12,1.12,0,0,0-.83.34A1.1,1.1,0,0,0,1,3.17ZM10,6V8H3V6Zm7,0V16H12V6Zm-7,4v2H3V10Zm0,4v2H3V14Z" transform="translate(-1 -2)" style="fill:#00acfe"/></svg> 1 <?xml version="1.0" encoding="iso-8859-1"?> 2 <svg style="background-color: #00acfe;" fill="#fff" height="500px" width="500px" version="1.1" id="custom-post-types-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" 3 viewBox="-50 -50 612 612" xml:space="preserve"> 4 <style> 5 @keyframes pulse-1 { 6 0% { 7 transform: scale(1); 8 } 9 5% { 10 transform: scale(1.1); 11 } 12 10% { 13 transform: scale(1); 14 } 15 } 16 @keyframes pulse-2 { 17 10% { 18 transform: scale(1); 19 } 20 15% { 21 transform: scale(1.1); 22 } 23 20% { 24 transform: scale(1); 25 } 26 } 27 @keyframes pulse-3 { 28 20% { 29 transform: scale(1); 30 } 31 25% { 32 transform: scale(1.1); 33 } 34 30% { 35 transform: scale(1); 36 } 37 } 38 @keyframes pulse-4 { 39 30% { 40 transform: scale(1); 41 } 42 35% { 43 transform: scale(1.1); 44 } 45 40% { 46 transform: scale(1); 47 } 48 } 49 50 .part { 51 transform-origin: 181px 181px; 52 53 animation-name: pulse-1; 54 animation-duration: 2s; 55 animation-timing-function: ease-in-out; 56 animation-iteration-count: infinite; 57 } 58 59 .part-2 { 60 transform-origin: 431px 181px; 61 62 animation-name: pulse-2; 63 } 64 65 .part-3 { 66 transform-origin: 431px 431px; 67 68 animation-name: pulse-3; 69 } 70 71 .part-4 { 72 transform-origin: 181px 75%; 73 74 animation-name: pulse-4; 75 } 76 </style> 77 <g> 78 <g class="part part-1"> 79 <path d="M237.714,70.29c0-7.543,0-62.709,0-70.289H54.857C24.609,0.001,0,24.609,0,54.858v182.857c8.319,0,84.971,0,94.903,0 80 c12.46,0,21.328,12.255,17.329,24.124c-0.984,2.921-11.208,16.844-1.413,33.807c11.752,20.352,40.903,20.345,52.649,0 81 c5.486-9.501,5.617-20.908,0.078-30.502c-7.034-12.186,1.792-27.429,15.837-27.429h58.331v-33.718 82 c-0.844,0.078-1.69,0.139-2.534,0.184c-36.257,1.925-70.608-26.622-70.608-67.038C164.571,95.879,200.429,66.865,237.714,70.29z" 83 /> 84 </g> 85 <g class="part part-2"> 86 <path d="M457.143,0.001H274.286c0,8.319,0,84.971,0,94.903c0,14.069-15.265,22.86-27.427,15.837 87 c-19.917-11.494-45.716,2.547-45.716,26.403c0,23.884,25.817,37.888,45.716,26.403c12.187-7.034,27.427,1.792,27.427,15.837 88 v58.331h33.718c-1.248-13.605,1.764-27.36,8.859-39.648c25.826-44.727,90.231-44.611,115.99,0 89 c7.033,12.178,10.114,25.969,8.86,39.647c7.543,0,62.709,0,70.289,0V54.858C512,24.609,487.391,0.001,457.143,0.001z"/> 90 </g> 91 <g class="part part-3"> 92 <path d="M417.097,274.286c-14.069,0-22.857-15.264-15.837-27.427c5.605-9.71,5.342-21.116-0.078-30.503 93 c-11.62-20.124-40.836-20.458-52.648,0c-5.389,9.333-5.703,20.76-0.079,30.503c7.055,12.222-1.833,27.427-15.838,27.427h-58.331 94 v33.704c13.507-1.24,27.274,1.714,39.647,8.859c44.734,25.829,44.62,90.228,0,115.991c-12.373,7.144-26.142,10.1-39.647,8.859 95 c0,7.545,0,62.729,0,70.3h182.857c30.248,0,54.857-24.609,54.857-54.857V274.286C503.681,274.286,427.029,274.286,417.097,274.286 96 z"/> 97 </g> 98 <g class="part part-4"> 99 <path d="M295.645,348.52c-17.232-9.951-30.41,0.552-34.951,1.758c-11.621,3.087-22.979-5.704-22.979-17.674v-58.318h-33.718 100 c1.24,13.506-1.714,27.274-8.859,39.647c-25.805,44.694-90.201,44.668-115.991,0c-7.145-12.373-10.099-26.141-8.859-39.647 101 c-7.543,0-62.708,0-70.288,0v182.857c0,30.248,24.609,54.857,54.857,54.857h182.857c0-8.264,0-85.003,0-94.915 102 c0-14.069,15.265-22.86,27.427-15.837c9.669,5.582,21.075,5.365,30.503-0.079C316.122,389.346,315.782,360.148,295.645,348.52z"/> 103 </g> 104 </g> 105 </svg> -
custom-post-types/trunk/assets/js/backend.js
r2955028 r2955361 15 15 * Licensed under the GPLv2 license or later. 16 16 */ 17 !function(e,t){var n={version:302};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var i=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(i)&&i>=n.version)return}if(!Color.fn.hasOwnProperty("to_s")){Color.fn.to_s=function(e){"hex"===(e=e||"hex")&&this._alpha<1&&(e="rgba");var t="";return"hex"===e?t=this.toString():this.error||(t=this.toCSS(e).replace(/\(\s+/,"(").replace(/\s+\)/,")")),t},window.wpColorPickerAlpha=n;var r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(e){return void 0===e&&(e=this._color),this.alphaOptions.alphaEnabled?(e=e.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(e=e.replace(/\s+/g,"")),e):e.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(e){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(e){var t=this,n=function(n){var i=e.val(),r=new Color(i),o=(i=i.replace(/^(#|(rgb|hsl)a?)/,""),t.alphaOptions.alphaColorType);e.removeClass("iris-error"),r.error?""!==i&&e.addClass("iris-error"):"hex"===o&&"keyup"===n.type&&i.match(/^[0-9a-fA-F]{3}$/)||r.toIEOctoHex()!==t._color.toIEOctoHex()&&t._setOption("color",t._getColor(r))};e.on("change",n).on("keyup",t._debounce(n,100)),t.options.hide&&e.one("focus",(function(){t.show()}))},_initControls:function(){if(this._super(),this.alphaOptions.alphaEnabled){var t=this,n=t.controls.strip.clone(!1,!1),i=n.find(".iris-slider-offset"),r={stripAlpha:n,stripAlphaSlider:i};n.addClass("iris-strip-alpha"),i.addClass("iris-slider-offset-alpha"),n.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,(function(e,n){t.controls[e]=n})),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(e,n){t.active="strip",t._color._alpha=parseFloat(n.value/100),t._change.apply(t,arguments)}})}},_dimensions:function(e){if(this._super(e),this.alphaOptions.alphaEnabled){var t,n,i,r,o,s=this.options,a=this.controls.square,l=this.picker.find(".iris-strip");for(t=Math.round(this.picker.outerWidth(!0)-(s.border?22:0)),n=Math.round(a.outerWidth()),i=Math.round((t-n)/2),r=Math.round(i/2),o=Math.round(n+2*i+2*r);o>t;)i=Math.round(i-2),r=Math.round(r-1),o=Math.round(n+2*i+2*r);a.css("margin","0"),l.width(i).css("margin-left",r+"px")}},_change:function(){var t=this,n=t.active;if(t._super(),t.alphaOptions.alphaEnabled){var i=t.controls,o=parseInt(100*t._color._alpha),s=t._color.toRgb(),a=["rgb("+s.r+","+s.g+","+s.b+") 0%","rgba("+s.r+","+s.g+","+s.b+", 0) 100%"];t.picker.closest(".wp-picker-container").find(".wp-color-result");t.options.color=t._getColor(),i.stripAlpha.css({background:"linear-gradient(to bottom, "+a.join(", ")+"), url("+r+")"}),n&&i.stripAlphaSlider.slider("value",o),t._color.error||t.element.removeClass("iris-error").val(t.options.color),t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",(function(){var n=e(this).data("color");t.alphaOptions.alphaReset&&(t._color._alpha=1,n=t._getColor()),t._setOption("color",n)}))}},_paintDimension:function(e,t){var n=!1;this.alphaOptions.alphaEnabled&&"strip"===t&&(n=this._color,this._color=new Color(n.toString()),this.hue=this._color.h()),this._super(e,t),n&&(this._color=n)},_setOption:function(e,t){if("color"!==e||!this.alphaOptions.alphaEnabled)return this._super(e,t);t=""+t,newColor=new Color(t).setHSpace(this.options.mode),newColor.error||this._getColor(newColor)===this._getColor()||(this._color=newColor,this.options.color=this._getColor(),this.active="external",this._change())},color:function(e){return!0===e?this._color.clone():void 0===e?this._getColor():void this.option("color",e)}}),e.widget("wp.wpColorPicker",e.wp.wpColorPicker,{alphaOptions:{alphaEnabled:!1},_getAlphaOptions:function(){var t=this.element,n=t.data("type")||this.options.type,i=t.data("defaultColor")||t.val(),r={alphaEnabled:t.data("alphaEnabled")||!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"rgb",alphaColorWithSpace:!1};return r.alphaEnabled&&(r.alphaEnabled=t.is("input")&&"full"===n),r.alphaEnabled?(r.alphaColorWithSpace=i&&i.match(/\s/),e.each(r,(function(e,n){var o=t.data(e)||n;switch(e){case"alphaCustomWidth":o=o?parseInt(o,10):0,o=isNaN(o)?n:o;break;case"alphaColorType":o.match(/^(hex|(rgb|hsl)a?)$/)||(o=i&&i.match(/^#/)?"hex":i&&i.match(/^hsla?/)?"hsl":n);break;default:o=!!o}r[e]=o})),r):r},_create:function(){e.support.iris&&(this.alphaOptions=this._getAlphaOptions(),this._super())},_addListeners:function(){if(!this.alphaOptions.alphaEnabled)return this._super();var t=this,n=t.element,i=t.toggler.is("a");this.alphaOptions.defaultWidth=n.width(),this.alphaOptions.alphaCustomWidth&&n.width(parseInt(this.alphaOptions.defaultWidth+this.alphaOptions.alphaCustomWidth,10)),t.toggler.css({position:"relative","background-image":"url("+r+")"}),i?t.toggler.html('<span class="color-alpha" />'):t.toggler.append('<span class="color-alpha" />'),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":n.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),n.iris({change:function(e,n){t.colorAlpha.css({"background-color":n.color.to_s(t.alphaOptions.alphaColorType)}),"function"==typeof t.options.change&&t.options.change.call(this,e,n)}}),t.wrap.on("click.wpcolorpicker",(function(e){e.stopPropagation()})),t.toggler.on("click",(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()})),n.on("change",(function(r){var o=e(this).val();(n.hasClass("iris-error")||""===o||o.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r))})),t.button.on("click",(function(r){e(this).hasClass("wp-picker-default")?n.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(n.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r),n.trigger("change"))}))}})}}(jQuery)},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n.p,n.p,n (3);var i=n(0),r=n.n(i);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,s=Object.create(o.prototype),a=new $(r||[]);return i(s,"_invoke",{value:D(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function f(){}function g(){}function m(){}var v={};u(v,a,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(C([])));b&&b!==t&&n.call(b,a)&&(v=b);var w=m.prototype=f.prototype=Object.create(v);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){var r;i(this,"_invoke",{value:function(i,s){function a(){return new t((function(r,a){!function i(r,s,a,l){var c=h(e[r],e,s);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==o(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,l)}),(function(e){i("throw",e,a,l)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,l)}))}l(c.arg)}(i,s,r,a)}))}return r=r?r.then(a,a):a()}})}function D(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return E()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=x(s,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function $(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:E}}function E(){return{value:void 0,done:!0}}return g.prototype=m,i(w,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},_(k.prototype),u(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new k(d(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=C,$.prototype={constructor:$,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function a(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(i,r)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(e){a(o,i,r,s,l,"next",e)}function l(e){a(o,i,r,s,l,"throw",e)}s(void 0)}))}}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,s=void 0,s=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===o(s)?s:String(s)),i)}var r,s}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"appendFieldEvents",value:function(e,t){this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]);var n=this.fieldsEvents[e];n&&r.a.each(n,(function(e,n){r()(t).on(e,(function(e){n(t,e)}))}))}},{key:"sanitizeTitle",value:function(e){e=(e=e.replace(/^\s+|\s+$/g,"")).toLowerCase();for(var t="àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;",n=0,i=t.length;n<i;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuuncescrzyuudtn------".charAt(n));return e=e.replace(".","-").replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/\//g,"")}},{key:"autoFillKey",value:function(e,t){var n=this;r()(t).add(e).on("focusout",(function(){var i=r()(e).val(),o=r()(t).val();!i.length&&o.length&&r()(e).val(n.sanitizeTitle(o))}))}},{key:"copyToClipboard",value:function(e){var t=navigator.clipboard.writeText(r()(e).val()).then((function(){return!0}),(function(){return!1}));return l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"disableProFieldSelectOptions",value:function(e){var t=r()(e).closest(".cpt-fields-section");if(t&&"manage_cpt_field"===t.data("id")){var n=r()(e).find("select > option");r.a.each(n,(function(e,t){t.text.endsWith(" [PRO only]")&&(t.disabled=!0)}))}}}])&&c(t.prototype,n),i&&c(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();window.cptUtils=new u,wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.checkbox={load:function(e,t){var n=r()(e).find('input[type="checkbox"][required]');r()(n).on("click",(function(t){r()(n).prop("required",!r()(e).find('input[type="checkbox"]:checked').length)}))}},e}));n(4);wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.color={load:function(e,t){var n=r()(e).find(".cpt-color-section:first"),i=r()(n).children("input");r()(i).wpColorPicker({palettes:!0})}},e}));n(5);function d(e){return e[e.length-1]}function h(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function p(e,t){return e?e.split(t):[]}function f(e,t,n){return(void 0===t||e>=t)&&(void 0===n||e<=n)}function g(e,t,n){return e<t?t:e>n?n:e}function m(e,t,n={},i=0,r=""){r+=`<${Object.keys(n).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(r=r(i)),`${e} ${t}="${r}"`},e)}></${e}>`;const o=i+1;return o<t?m(e,t,n,o,r):r}function v(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function y(e){return new Date(e).setHours(0,0,0,0)}function b(){return(new Date).setHours(0,0,0,0)}function w(...e){switch(e.length){case 0:return b();case 1:return y(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function _(e,t){const n=new Date(e);return n.setDate(n.getDate()+t)}function k(e,t){const n=new Date(e),i=n.getMonth()+t;let r=i%12;r<0&&(r+=12);const o=n.setMonth(i);return n.getMonth()!==r?n.setDate(0):o}function D(e,t){const n=new Date(e),i=n.getMonth(),r=n.setFullYear(n.getFullYear()+t);return 1===i&&2===n.getMonth()?n.setDate(0):r}function x(e,t){return(e-t+7)%7}function S(e,t,n=0){const i=new Date(e).getDay();return _(e,x(t,n)-x(i,n))}function A(e,t){return Math.round((e-t)/6048e5)+1}function $(e){const t=S(e,4,1);return A(t,S(new Date(t).setMonth(0,4),4,1))}function C(e,t){const n=S(new Date(e).setMonth(0,1),t,t),i=S(e,t,t),r=A(i,n);if(r<53)return r;return i===S(new Date(e).setDate(32),t,t)?1:r}function E(e){return C(e,0)}function O(e){return C(e,6)}function L(e,t){const n=new Date(e).getFullYear();return Math.floor(n/t)*t}function j(e,t,n){if(1!==t&&2!==t)return e;const i=new Date(e);return 1===t?n?i.setMonth(i.getMonth()+1,0):i.setDate(1):n?i.setFullYear(i.getFullYear()+1,0,0):i.setMonth(0,1),i.setHours(0,0,0,0)}const M=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,T=/[\s!-/:-@[-`{-~年月日]+/;let N={};const F={y:(e,t)=>new Date(e).setFullYear(parseInt(t,10)),m(e,t,n){const i=new Date(e);let r=parseInt(t,10)-1;if(isNaN(r)){if(!t)return NaN;const e=t.toLowerCase(),i=t=>t.toLowerCase().startsWith(e);if(r=n.monthsShort.findIndex(i),r<0&&(r=n.months.findIndex(i)),r<0)return NaN}return i.setMonth(r),i.getMonth()!==function e(t){return t>-1?t%12:e(t+12)}(r)?i.setDate(0):i.getTime()},d:(e,t)=>new Date(e).setDate(parseInt(t,10))},I={d:e=>e.getDate(),dd:e=>P(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>P(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>P(e.getFullYear(),2).slice(-2),yyyy:e=>P(e.getFullYear(),4)};function P(e,t){return e.toString().padStart(t,"0")}function B(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in N)return N[e];const t=e.split(M),n=e.match(new RegExp(M,"g"));if(0===t.length||!n)throw new Error("Invalid date format.");const i=n.map(e=>I[e]),r=Object.keys(F).reduce((e,t)=>(n.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return N[e]={parser(e,t){const i=e.split(T).reduce((e,t,i)=>{if(t.length>0&&n[i]){const r=n[i][0];"M"===r?e.m=t:"D"!==r&&(e[r]=t)}return e},{});return r.reduce((e,n)=>{const r=F[n](e,i[n],t);return isNaN(r)?e:r},b())},formatter:(e,n)=>i.reduce((i,r,o)=>i+`${t[o]}${r(e,n)}`,"")+d(t)}}function R(e,t,n){if(e instanceof Date||"number"==typeof e){const t=y(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return b();if(t&&t.toValue){const i=t.toValue(e,t,n);return isNaN(i)?void 0:y(i)}return B(t).parser(e,n)}}function q(e,t,n){if(isNaN(e)||!e&&0!==e)return"";const i="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(i,t,n):B(t).formatter(i,n)}const H=document.createRange();function V(e){return H.createContextualFragment(e)}function W(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function U(e){return e.getRootNode().activeElement===e}function z(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function Y(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function G(e){e.firstChild&&(e.removeChild(e.firstChild),G(e))}const K=new WeakMap,{addEventListener:Z,removeEventListener:J}=EventTarget.prototype;function Q(e,t){let n=K.get(e);n||(n=[],K.set(e,n)),t.forEach(e=>{Z.call(...e),n.push(e)})}function X(e){let t=K.get(e);t&&(t.forEach(e=>{J.call(...e)}),K.delete(e))}if(!Event.prototype.composedPath){const e=(t,n=[])=>{let i;return n.push(t),t.parentNode?i=t.parentNode:t.host?i=t.host:t.defaultView&&(i=t.defaultView),i?e(i,n):n};Event.prototype.composedPath=function(){return e(this.target)}}function ee(e,t){const n="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return function e(t,n,i){const[r,...o]=t;return n(r)?r:r!==i&&"HTML"!==r.tagName&&0!==o.length?e(o,n,i):void 0}(e.composedPath(),n,e.currentTarget)}var te={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},ne={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:ie,format:re,weekStart:oe}=ne;function se(e,t){return e.length<6&&t>=0&&t<7?h(e,t):e}function ae(e,t){switch(4===e?6===t?3:!t+1:e){case 1:return $;case 2:return E;case 3:return O}}function le(e,t,n){return t.weekStart=e,t.weekEnd=(e+6)%7,4===n&&(t.getWeekNumber=ae(4,e)),e}function ce(e,t,n,i){const r=R(e,t,n);return void 0!==r?r:i}function ue(e,t,n=3){const i=parseInt(e,10);return i>=0&&i<=n?i:t}function de(e,t,n,i){t in e&&(n in e||(e[n]=i?i(e[t]):e[t]),delete e[t])}function he(e,t){const n=Object.assign({},e),i={},r=t.constructor.locales,o=!!t.rangeSideIndex;let{datesDisabled:s,format:a,language:l,locale:c,maxDate:u,maxView:d,minDate:p,pickLevel:f,startView:g,weekNumbers:m,weekStart:v}=t.config||{};if(de(n,"calendarWeeks","weekNumbers",e=>e?1:0),de(n,"clearBtn","clearButton"),de(n,"todayBtn","todayButton"),de(n,"todayBtnMode","todayButtonMode"),n.language){let e;if(n.language!==l&&(r[n.language]?e=n.language:(e=n.language.split("-")[0],r[e]||(e=!1))),delete n.language,e){l=i.language=e;const t=c||r[ie];c=Object.assign({format:re,weekStart:oe},r[ie]),l!==ie&&Object.assign(c,r[l]),i.locale=c,a===t.format&&(a=i.format=c.format),v===t.weekStart&&(v=le(c.weekStart,i,m))}}if(n.format){const e="function"==typeof n.format.toDisplay,t="function"==typeof n.format.toValue,r=M.test(n.format);(e&&t||r)&&(a=i.format=n.format),delete n.format}let y=f;"pickLevel"in n&&(y=ue(n.pickLevel,f,2),delete n.pickLevel),y!==f&&(y>f&&("minDate"in n||(n.minDate=p),"maxDate"in n||(n.maxDate=u)),s&&!n.datesDisabled&&(n.datesDisabled=[]),f=i.pickLevel=y);let b=p,_=u;if("minDate"in n){const e=w(0,0,1);b=null===n.minDate?e:ce(n.minDate,a,c,b),b!==e&&(b=j(b,f,!1)),delete n.minDate}if("maxDate"in n&&(_=null===n.maxDate?void 0:ce(n.maxDate,a,c,_),void 0!==_&&(_=j(_,f,!0)),delete n.maxDate),_<b?(p=i.minDate=_,u=i.maxDate=b):(p!==b&&(p=i.minDate=b),u!==_&&(u=i.maxDate=_)),n.datesDisabled){const e=n.datesDisabled;if("function"==typeof e)i.datesDisabled=null,i.checkDisabled=(t,n)=>e(new Date(t),n,o);else{const t=i.datesDisabled=e.reduce((e,t)=>{const n=R(t,a,c);return void 0!==n?h(e,j(n,f,o)):e},[]);i.checkDisabled=e=>t.includes(e)}delete n.datesDisabled}if("defaultViewDate"in n){const e=R(n.defaultViewDate,a,c);void 0!==e&&(i.defaultViewDate=e),delete n.defaultViewDate}if("weekStart"in n){const e=Number(n.weekStart)%7;isNaN(e)||(v=le(e,i,m)),delete n.weekStart}if(n.daysOfWeekDisabled&&(i.daysOfWeekDisabled=n.daysOfWeekDisabled.reduce(se,[]),delete n.daysOfWeekDisabled),n.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=n.daysOfWeekHighlighted.reduce(se,[]),delete n.daysOfWeekHighlighted),"weekNumbers"in n){let e=n.weekNumbers;if(e){const t="function"==typeof e?(t,n)=>e(new Date(t),n):ae(e=parseInt(e,10),v);t&&(m=i.weekNumbers=e,i.getWeekNumber=t)}else m=i.weekNumbers=0,i.getWeekNumber=null;delete n.weekNumbers}if("maxNumberOfDates"in n){const e=parseInt(n.maxNumberOfDates,10);e>=0&&(i.maxNumberOfDates=e,i.multidate=1!==e),delete n.maxNumberOfDates}n.dateDelimiter&&(i.dateDelimiter=String(n.dateDelimiter),delete n.dateDelimiter);let k=d;"maxView"in n&&(k=ue(n.maxView,d),delete n.maxView),k=f>k?f:k,k!==d&&(d=i.maxView=k);let D=g;if("startView"in n&&(D=ue(n.startView,D),delete n.startView),D<f?D=f:D>d&&(D=d),D!==g&&(i.startView=D),n.prevArrow){const e=V(n.prevArrow);e.childNodes.length>0&&(i.prevArrow=e.childNodes),delete n.prevArrow}if(n.nextArrow){const e=V(n.nextArrow);e.childNodes.length>0&&(i.nextArrow=e.childNodes),delete n.nextArrow}if("disableTouchKeyboard"in n&&(i.disableTouchKeyboard="ontouchstart"in document&&!!n.disableTouchKeyboard,delete n.disableTouchKeyboard),n.orientation){const e=n.orientation.toLowerCase().split(/\s+/g);i.orientation={x:e.find(e=>"left"===e||"right"===e)||"auto",y:e.find(e=>"top"===e||"bottom"===e)||"auto"},delete n.orientation}if("todayButtonMode"in n){switch(n.todayButtonMode){case 0:case 1:i.todayButtonMode=n.todayButtonMode}delete n.todayButtonMode}return Object.entries(n).forEach(([e,t])=>{void 0!==t&&e in ne&&(i[e]=t)}),i}const pe={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};var fe=v('<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% prev-button prev-btn"></button>\n <button type="button" class="%buttonClass% view-switch"></button>\n <button type="button" class="%buttonClass% next-button next-btn"></button>\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% today-button today-btn"></button>\n <button type="button" class="%buttonClass% clear-button clear-btn"></button>\n </div>\n </div>\n </div>\n</div>'),ge=v(`<div class="days">\n <div class="days-of-week">${m("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${m("span",42)}</div>\n</div>`),me=v(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${m("span",6,{class:"week"})}</div>\n</div>`);class ve{constructor(e,t){Object.assign(this,t,{picker:e,element:V('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!e.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(e){"pickLevel"in e&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}prepareForRender(e,t,n){this.disabled=[];const i=this.picker;i.setViewSwitchLabel(e),i.setPrevButtonDisabled(t),i.setNextButtonDisabled(n)}setDisabled(e,t){t.add("disabled"),h(this.disabled,e)}performBeforeHook(e,t){let n=this.beforeShow(new Date(t));switch(typeof n){case"boolean":n={enabled:n};break;case"string":n={classes:n}}if(n){const i=e.classList;if(!1===n.enabled&&this.setDisabled(t,i),n.classes){const e=n.classes.split(/\s+/);i.add(...e),e.includes("disabled")&&this.setDisabled(t,i)}n.content&&function(e,t){G(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(V(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,n.content)}}renderCell(e,t,n,i,{selected:r,range:o},s,a=[]){e.textContent=t,this.isMinView&&(e.dataset.date=i);const l=e.classList;if(e.className="datepicker-cell "+this.cellClass,n<this.first?l.add("prev"):n>this.last&&l.add("next"),l.add(...a),(s||this.checkDisabled(i,this.id))&&this.setDisabled(i,l),o){const[e,t]=o;n>e&&n<t&&l.add("range"),n===e&&l.add("range-start"),n===t&&l.add("range-end")}r.includes(n)&&l.add("selected"),n===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(e,i)}refreshCell(e,t,n,[i,r]){const o=e.classList;o.remove("range","range-start","range-end","selected","focused"),t>i&&t<r&&o.add("range"),t===i&&o.add("range-start"),t===r&&o.add("range-end"),n.includes(t)&&o.add("selected"),t===this.focused&&o.add("focused")}changeFocusedCell(e){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}class ye extends ve{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=V(ge).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if("minDate"in e&&(this.minDate=e.minDate),"maxDate"in e&&(this.maxDate=e.maxDate),e.checkDisabled&&(this.checkDisabled=e.checkDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),"todayHighlight"in e&&(this.todayHighlight=e.todayHighlight),"weekStart"in e&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const n=this.locale=e.locale;this.dayNames=n.daysMin,this.switchLabelFormat=n.titleFormat,t=!0}if("beforeShowDay"in e&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),"weekNumbers"in e)if(e.weekNumbers&&!this.weekNumbers){const e=V(me).firstChild;this.weekNumbers={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.weekNumbers&&!e.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in e&&(this.getWeekNumber=e.getWeekNumber),"showDaysOfWeek"in e&&(e.showDaysOfWeek?(Y(this.dow),this.weekNumbers&&Y(this.weekNumbers.dow)):(z(this.dow),this.weekNumbers&&z(this.weekNumbers.dow))),t&&Array.from(this.dow.children).forEach((e,t)=>{const n=(this.weekStart+t)%7;e.textContent=this.dayNames[n],e.className=this.daysOfWeekDisabled.includes(n)?"dow disabled":"dow"})}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),n=e.getMonth(),i=w(t,n,1),r=S(i,this.weekStart,this.weekStart);this.first=i,this.last=w(t,n+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){if(this.today=this.todayHighlight?b():void 0,this.prepareForRender(q(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const e=this.weekStart,t=S(this.first,e,e);Array.from(this.weekNumbers.weeks.children).forEach((n,i)=>{const r=_(t,7*i);n.textContent=this.getWeekNumber(r,e),i>3&&n.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((e,t)=>{const n=_(this.start,t),i=new Date(n),r=i.getDay(),o=[];this.today===n&&o.push("today"),this.daysOfWeekHighlighted.includes(r)&&o.push("highlighted"),this.renderCell(e,i.getDate(),n,n,this,n<this.minDate||n>this.maxDate||this.daysOfWeekDisabled.includes(r),o)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.dataset.date),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function be(e,t){if(!e||!e[0]||!e[1])return;const[[n,i],[r,o]]=e;return n>t||r<t?void 0:[n===t?i:-1,r===t?o:12]}class we extends ve{constructor(e){super(e,{id:1,name:"months",cellClass:"month"})}init(e,t=!0){t&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(V(m("span",12,{"data-month":e=>e}))),this.first=0,this.last=11),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),"minDate"in e)if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if("maxDate"in e)if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=w(this.maxYear,this.maxMonth+1,0)}e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),"beforeShowMonth"in e&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>{const n=new Date(t),i=n.getFullYear(),r=n.getMonth();return void 0===e[i]?e[i]=[r]:h(e[i],r),e},{}),t&&t.dates&&(this.range=t.dates.map(e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.year<this.minYear||this.year>this.maxYear,n=this.year===this.minYear,i=this.year===this.maxYear,r=be(this.range,this.year);Array.from(this.grid.children).forEach((o,s)=>{const a=j(new Date(this.year,s,1),1,this.isRangeEnd);this.renderCell(o,this.monthNames[s],s,a,{selected:e,range:r},t||n&&s<this.minMonth||i&&s>this.maxMonth)})}refresh(){const e=this.selected[this.year]||[],t=be(this.range,this.year)||[];Array.from(this.grid.children).forEach((n,i)=>{this.refreshCell(n,i,e,t)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class _e extends ve{constructor(e,t){super(e,t)}init(e,t=!0){var n;t&&(this.navStep=10*this.step,this.beforeShowOption="beforeShow"+(n=this.cellClass,[...n].reduce((e,t,n)=>e+(n?t:t.toUpperCase()),"")),this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(V(m("span",12)))),super.init(e)}setOptions(e){if("minDate"in e&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=L(e.minDate,this.step),this.minDate=w(this.minYear,0,1))),"maxDate"in e&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=L(e.maxDate,this.step),this.maxDate=w(this.maxYear,11,31))),e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),this.beforeShowOption in e){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=L(e,this.navStep),n=t+9*this.step;this.first=t,this.last=n,this.start=t-this.step,this.focused=L(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>h(e,L(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return L(e,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const n=this.start+t*this.step,i=j(new Date(n,0,1),2,this.isRangeEnd);e.dataset.year=n,this.renderCell(e,n,n,i,this,n<this.minYear||n>this.maxYear)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.textContent),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function ke(e,t){const n={date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e};e.element.dispatchEvent(new CustomEvent(t,{detail:n}))}function De(e,t){const{config:n,picker:i}=e,{currentView:r,viewDate:o}=i;let s;switch(r.id){case 0:s=k(o,t);break;case 1:s=D(o,t);break;default:s=D(o,t*r.navStep)}s=g(s,n.minDate,n.maxDate),i.changeFocus(s).render()}function xe(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function Se(e){e.setDate({clear:!0})}function Ae(e){const t=b();1===e.config.todayButtonMode?e.setDate(t,{forceRefresh:!0,viewDate:t}):e.setFocusedDate(t,!0)}function $e(e){const t=()=>{e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()},n=e.element;U(n)?n.addEventListener("blur",t,{once:!0}):t()}function Ce(e,t){const n=e.picker,i=new Date(n.viewDate),r=n.currentView.id,o=1===r?k(i,t-i.getMonth()):D(i,t-i.getFullYear());n.changeFocus(o).changeView(r-1).render()}function Ee(e){xe(e)}function Oe(e){De(e,-1)}function Le(e){De(e,1)}function je(e,t){const n=ee(t,".datepicker-cell");if(!n||n.classList.contains("disabled"))return;const{id:i,isMinView:r}=e.picker.currentView,o=n.dataset;r?e.setDate(Number(o.date)):Ce(e,Number(1===i?o.month:o.year))}function Me(e){e.preventDefault()}const Te=["left","top","right","bottom"].reduce((e,t)=>(e[t]="datepicker-orient-"+t,e),{}),Ne=e=>e?e+"px":e;function Fe(e,t){if("title"in t&&(t.title?(e.controls.title.textContent=t.title,Y(e.controls.title)):(e.controls.title.textContent="",z(e.controls.title))),t.prevArrow){const n=e.controls.prevButton;G(n),t.prevArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const n=e.controls.nextButton;G(n),t.nextArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayButton.textContent=t.locale.today,e.controls.clearButton.textContent=t.locale.clear),"todayButton"in t&&(t.todayButton?Y(e.controls.todayButton):z(e.controls.todayButton)),"minDate"in t||"maxDate"in t){const{minDate:t,maxDate:n}=e.datepicker.config;e.controls.todayButton.disabled=!f(b(),t,n)}"clearButton"in t&&(t.clearButton?Y(e.controls.clearButton):z(e.controls.clearButton))}function Ie(e){const{dates:t,config:n,rangeSideIndex:i}=e;return g(t.length>0?d(t):j(n.defaultViewDate,n.pickLevel,i),n.minDate,n.maxDate)}function Pe(e,t){"_oldViewDate"in e||t===e.viewDate||(e._oldViewDate=e.viewDate),e.viewDate=t;const{id:n,year:i,first:r,last:o}=e.currentView,s=new Date(t).getFullYear();switch(n){case 0:return t<r||t>o;case 1:return s!==i;default:return s<r||s>o}}function Be(e){return window.getComputedStyle(e).direction}class Re{constructor(e){const{config:t,inputField:n}=this.datepicker=e,i=fe.replace(/%buttonClass%/g,t.buttonClass),r=this.element=V(i).firstChild,[o,s,a]=r.firstChild.children,l=o.firstElementChild,[c,u,d]=o.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:u,nextButton:d,todayButton:h,clearButton:p};this.main=s,this.controls=f;const g=n?"dropdown":"inline";r.classList.add("datepicker-"+g),Fe(this,t),this.viewDate=Ie(e),Q(e,[[r,"mousedown",Me],[s,"click",je.bind(null,e)],[f.viewSwitch,"click",Ee.bind(null,e)],[f.prevButton,"click",Oe.bind(null,e)],[f.nextButton,"click",Le.bind(null,e)],[f.todayButton,"click",Ae.bind(null,e)],[f.clearButton,"click",Se.bind(null,e)]]),this.views=[new ye(this),new we(this),new _e(this,{id:2,name:"years",cellClass:"year",step:1}),new _e(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[t.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),t.container?t.container.appendChild(this.element):n.after(this.element)}setOptions(e){Fe(this,e),this.views.forEach(t=>{t.init(e,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:e,element:t}=this,n=e.inputField;if(n){const i=Be(n);i!==Be(W(t))?t.dir=i:t.dir&&t.removeAttribute("dir"),t.style.visibility="hidden",t.classList.add("active"),this.place(),t.style.visibility="",e.config.disableTouchKeyboard&&n.blur()}else t.classList.add("active");this.active=!0,ke(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,ke(this.datepicker,"hide"))}place(){const{classList:e,offsetParent:t,style:n}=this.element,{config:i,inputField:r}=this.datepicker,{width:o,height:s}=this.element.getBoundingClientRect(),{left:a,top:l,right:c,bottom:u,width:d,height:h}=r.getBoundingClientRect();let{x:p,y:f}=i.orientation,g=a,m=l;if(t!==document.body&&t){const e=t.getBoundingClientRect();g-=e.left-t.scrollLeft,m-=e.top-t.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=function e(t){const n=W(t);if(n!==document.body&&n)return"visible"!==window.getComputedStyle(n).overflow?n:e(n)}(r);let y=0,b=0,{clientWidth:w,clientHeight:_}=document.documentElement;if(v){const e=v.getBoundingClientRect();e.top>0&&(b=e.top),e.left>0&&(y=e.left),e.right<w&&(w=e.right),e.bottom<_&&(_=e.bottom)}let k=0;"auto"===p&&(a<y?(p="left",k=y-a):a+o>w?(p="right",w<c&&(k=w-c)):p="rtl"===Be(r)?c-o<y?"left":"right":"left"),"right"===p&&(g+=d-o),g+=k,"auto"===f&&(f=l-s>b&&u+s>_?"top":"bottom"),"top"===f?m-=s:m+=h,e.remove(...Object.values(Te)),e.add(Te[p],Te[f]),n.left=Ne(g),n.top=Ne(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevButtonDisabled(e){this.controls.prevButton.disabled=e}setNextButtonDisabled(e){this.controls.nextButton.disabled=e}changeView(e){const t=this.currentView;return e!==t.id&&(this._oldView||(this._oldView=t),this.currentView=this.views[e],this._renderMethod="render"),this}changeFocus(e){return this._renderMethod=Pe(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(e){const t=void 0===e?Ie(this.datepicker):e;return this._renderMethod=Pe(this,t)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const{currentView:t,datepicker:n,_oldView:i}=this,r=new Date(this._oldViewDate),o=e&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,t[o](),i&&(this.main.replaceChild(t.element,i.element),ke(n,"changeView")),!isNaN(r)){const e=new Date(this.viewDate);e.getFullYear()!==r.getFullYear()&&ke(n,"changeYear"),e.getMonth()!==r.getMonth()&&ke(n,"changeMonth")}}}function qe(e,t,n){const i=e.picker,r=i.currentView,o=r.step||1;let s,a=i.viewDate;switch(r.id){case 0:a=_(a,n?7*t:t),s=_;break;case 1:a=k(a,n?4*t:t),s=k;break;default:a=D(a,t*(n?4:1)*o),s=D}a=function e(t,n,i,r,o,s){if(f(t,o,s)){if(r(t)){return e(n(t,i),n,i,r,o,s)}return t}}(a,s,t<0?-o:o,e=>r.disabled.includes(e),r.minDate,r.maxDate),void 0!==a&&i.changeFocus(a).render()}function He(e,t){const{config:n,picker:i,editMode:r}=e,o=i.active,{key:s,altKey:a,shiftKey:l}=t,c=t.ctrlKey||t.metaKey,u=()=>{t.preventDefault(),t.stopPropagation()};if("Tab"===s)return void $e(e);if("Enter"===s){if(o)if(r)e.exitEditMode({update:!0,autohide:n.autohide});else{const t=i.currentView;t.isMinView?e.setDate(i.viewDate):(i.changeView(t.id-1).render(),u())}else e.update();return}const d=n.shortcutKeys,h={key:s,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(d).find(e=>{const t=d[e];return!Object.keys(t).find(e=>t[e]!==h[e])});if(p){let t;if("toggle"===p?t=p:r?"exitEditMode"===p&&(t=p):o?"hide"===p?t=p:"prevButton"===p?t=[De,[e,-1]]:"nextButton"===p?t=[De,[e,1]]:"viewSwitch"===p?t=[xe,[e]]:n.clearButton&&"clearButton"===p?t=[Se,[e]]:n.todayButton&&"todayButton"===p&&(t=[Ae,[e]]):"show"===p&&(t=p),t)return Array.isArray(t)?t[0].apply(null,t[1]):e[t](),void u()}if(!o||r)return;const f=(n,i)=>{l||c||a?e.enterEditMode():(qe(e,n,i),t.preventDefault())};"ArrowLeft"===s?f(-1,!1):"ArrowRight"===s?f(1,!1):"ArrowUp"===s?f(-1,!0):"ArrowDown"===s?f(1,!0):("Backspace"===s||"Delete"===s||s&&1===s.length&&!c)&&e.enterEditMode()}function Ve(e){e.config.showOnFocus&&!e._showing&&e.show()}function We(e,t){const n=t.target;(e.picker.active||e.config.showOnClick)&&(n._active=U(n),n._clicking=setTimeout(()=>{delete n._active,delete n._clicking},2e3))}function Ue(e,t){const n=t.target;n._clicking&&(clearTimeout(n._clicking),delete n._clicking,n._active&&e.enterEditMode(),delete n._active,e.config.showOnClick&&e.show())}function ze(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function Ye(e,t){const{element:n,picker:i}=e;if(!i.active&&!U(n))return;const r=i.element;ee(t,e=>e===n||e===r)||$e(e)}function Ge(e,t){return e.map(e=>q(e,t.format,t.locale)).join(t.dateDelimiter)}function Ke(e,t,n=!1){if(0===t.length)return n?[]:void 0;const{config:i,dates:r,rangeSideIndex:o}=e,{pickLevel:s,maxNumberOfDates:a}=i;let l=t.reduce((e,t)=>{let n=R(t,i.format,i.locale);return void 0===n||(n=j(n,s,o),!f(n,i.minDate,i.maxDate)||e.includes(n)||i.checkDisabled(n,s)||!(s>0)&&i.daysOfWeekDisabled.includes(new Date(n).getDay())||e.push(n)),e},[]);return 0!==l.length?(i.multidate&&!n&&(l=l.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!l.includes(e)))),a&&l.length>a?l.slice(-1*a):l):void 0}function Ze(e,t=3,n=!0,i){const{config:r,picker:o,inputField:s}=e;if(2&t){const e=o.active?r.pickLevel:r.startView;o.update(i).changeView(e).render(n)}1&t&&s&&(s.value=Ge(e.dates,r))}function Je(e,t,n){const i=e.config;let{clear:r,render:o,autohide:s,revert:a,forceRefresh:l,viewDate:c}=n;void 0===o&&(o=!0),o?void 0===s&&(s=i.autohide):s=l=!1,c=R(c,i.format,i.locale);const u=Ke(e,t,r);(u||a)&&(u&&u.toString()!==e.dates.toString()?(e.dates=u,Ze(e,o?3:1,!0,c),ke(e,"changeDate")):Ze(e,l?3:1,!0,c),s&&e.hide())}function Qe(e,t){return t?n=>q(n,t,e.config.locale):e=>new Date(e)}class Xe{constructor(e,t={},n){e.datepicker=this,this.element=e,this.dates=[];const i=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:b(),maxDate:void 0,minDate:void 0},he(ne,this));let r;if("INPUT"===e.tagName?(r=this.inputField=e,r.classList.add("datepicker-input"),t.container&&(i.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container))):i.container=e,n){const e=n.inputs.indexOf(r),t=n.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,this.rangepicker=n,this.rangeSideIndex=e}this._options=t,Object.assign(i,he(t,this)),i.shortcutKeys=function(e){return Object.keys(pe).reduce((t,n)=>{const i=void 0===e[n]?pe[n]:e[n],r=i&&i.key;if(!r||"string"!=typeof r)return t;const o={key:r,ctrlOrMetaKey:!!(i.ctrlOrMetaKey||i.ctrlKey||i.metaKey)};return r.length>1&&(o.altKey=!!i.altKey,o.shiftKey=!!i.shiftKey),t[n]=o,t},{})}(t.shortcutKeys||{});const o=p(e.value||e.dataset.date,i.dateDelimiter);delete e.dataset.date;const s=Ke(this,o);s&&s.length>0&&(this.dates=s),r&&(r.value=Ge(this.dates,i));const a=this.picker=new Re(this),l=[e,"keydown",He.bind(null,this)];r?Q(this,[l,[r,"focus",Ve.bind(null,this)],[r,"mousedown",We.bind(null,this)],[r,"click",Ue.bind(null,this)],[r,"paste",ze.bind(null,this)],[document,"mousedown",Ye.bind(null,this)],[window,"resize",a.place.bind(a)]]):(Q(this,[l]),this.show())}static formatDate(e,t,n){return q(e,t,n&&te[n]||te.en)}static parseDate(e,t,n){return R(e,t,n&&te[n]||te.en)}static get locales(){return te}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=he(e,this);Object.assign(this._options,e),Object.assign(this.config,t),this.picker.setOptions(t),Ze(this,3)}show(){if(this.inputField){const{config:e,inputField:t}=this;if(t.disabled||t.readOnly&&!e.enableOnReadonly)return;U(t)||e.disableTouchKeyboard||(this._showing=!0,t.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),X(this),this.picker.detach();const e=this.element;return e.classList.remove("datepicker-input"),delete e.datepicker,this}getDate(e){const t=Qe(this,e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],n={},i=d(e);!i||"object"!=typeof i||Array.isArray(i)||i instanceof Date||Object.assign(n,t.pop());Je(this,Array.isArray(t[0])?t[0]:t,n)}update(e){if(!this.inputField)return;const t=Object.assign(e||{},{clear:!0,render:!0,viewDate:void 0});Je(this,p(this.inputField.value,this.config.dateDelimiter),t)}getFocusedDate(e){return Qe(this,e)(this.picker.viewDate)}setFocusedDate(e,t=!1){const{config:n,picker:i,active:r,rangeSideIndex:o}=this,s=n.pickLevel,a=R(e,n.format,n.locale);void 0!==a&&(i.changeFocus(j(a,s,o)),r&&t&&i.changeView(s),i.render())}refresh(e,t=!1){let n;e&&"string"!=typeof e&&(t=e,e=void 0),n="picker"===e?2:"input"===e?1:3,Ze(this,n,!t)}enterEditMode(){const e=this.inputField;e&&!e.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,e.classList.add("in-edit"))}exitEditMode(e){if(!this.inputField||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit"),t.update&&this.update(t)}}function et(e){return(et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==et(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===et(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.date={load:function(e,t){var n=r()(e).find(".cpt-date-section:first"),i=r()(n).children("input"),o="no"!==r()(i).data("max")&&r()(i).data("max"),s="no"!==r()(i).data("min")&&r()(i).data("min");new Xe(i[0],{autohide:!0,clearBtn:!0,maxDate:o,minDate:s,format:"dd/mm/yyyy"})}},e}));var nt=wp.i18n,it=nt.__;nt._x,nt._n,nt._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.file={load:function(e,t){new rt(e)}},e}));var rt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fileSection=r()(t).find(".cpt-file-section:first"),this.fileTypes=r()(this.fileSection).data("type"),this.fileInput=r()(this.fileSection).find("input"),this.filePreview=r()(this.fileSection).find("img"),this.fileActions=r()(this.fileSection).find(".cpt-file-actions"),this.fileName=r()(this.fileSection).find(".file-name"),this.addButton=r()(this.fileSection).find(".cpt-file-upload"),this.removeButton=r()(this.fileSection).find(".cpt-file-remove"),this.listenRemoveEvent(),this.listenAddEvent()}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(){var e=this;r()(this.addButton).on("click",(function(t){t.preventDefault();var n=wp.media({title:it("Add file","custom-post-types"),frame:"select",library:wp.media.query({type:e.fileTypes,uploadedTo:wp.media.view.settings.post.id}),button:{text:it("Choose file","custom-post-types")},multiple:!1}).on("select",(function(){var t=n.state().get("selection").first().toJSON(),i=!!(t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url)&&t.sizes.thumbnail.url;i&&(r()(e.filePreview).attr("src",i),r()(e.filePreview).show());var o=t.mime;o.startsWith("image")&&(o="image"),o.startsWith("audio")&&(o="audio"),o.startsWith("video")&&(o="video"),"-1"!=r.a.inArray(o,e.fileTypes)?(r()(e.fileName).html(t.url.split("/").reverse()[0]),r()(e.fileActions).attr("title",t.url.split("/").reverse()[0]),r()(e.fileInput).val(t.id),r()(e.removeButton).prop("disabled",!1)):e.resetField()})).open()}))}},{key:"listenRemoveEvent",value:function(){var e=this;r()(this.removeButton).on("click",(function(t){t.preventDefault(),e.resetField()}))}},{key:"resetField",value:function(){r()(this.fileName).html(""),r()(this.fileInput).val(""),r()(this.filePreview).removeAttr("src"),r()(this.filePreview).hide(),r()(this.removeButton).prop("disabled",!0),r()(this.fileActions).attr("title",it("Choose","custom-post-types"))}}])&&tt(t.prototype,n),i&&tt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();n(1),n(2);function ot(e){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function st(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ot(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ot(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ot(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.post_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-post_rel-options",nonce:cpt.ajax_nonce,search:e.term,post_type:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e}));var at=wp.i18n;at.__,at._x,at._n,at._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.repeater={load:function(e,t){new lt(e)}},e}));var lt=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.repeaterSection=r()(t).find(".cpt-repeater-section:first"),this.parent=r()(this.repeaterSection).data("parent"),this.fields=r()(this.repeaterSection).data("fields"),this.initSortable();var i=r()(this.repeaterSection).parent().children(".cpt-repeater-add:first");i.length>0&&this.listenAddEvent(i);var o=r()(this.repeaterSection).find(".cpt-repeater-group");r.a.each(o,(function(e,t){n.initFieldGroup(t)}))}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(e){var t=this;r()(e).on("click",(function(n){n.preventDefault(),r()(e).prop("disabled",!0);var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(t.repeaterSection).append(i);var o=r()(t.repeaterSection).children(".cpt-repeater-group").length,s=[];s.push({name:"action",value:"cpt-get-repeater-group"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"fields",value:JSON.stringify(t.fields)}),s.push({name:"parent",value:t.parent+"["+o+"]"}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(n){if(n.success){r()(e).prop("disabled",!1),r()(i).remove();var o=r()(n.data);r()(t.repeaterSection).append(o),t.initFieldGroup(o)}else r()(e).prop("disabled",!1),r()(i).remove(),console.log("Error",n)}})}))}},{key:"initSortable",value:function(){var e=r()(this.repeaterSection).children(".cpt-repeater-group").children(".cpt-repeater-buttons").find(".move");r()(e).on("click",(function(e){e.preventDefault()})),r()(this.repeaterSection).sortable({handle:".move",cancel:"",cursor:"grab",axis:"y",delay:150,dropOnEmpty:!1,opacity:.5,revert:!0})}},{key:"initFieldGroup",value:function(e){var t=r()(e).find(".cpt-repeater-fields:first").children(".cpt-field"),n=r()(e).find(".cpt-repeater-fields:first .cpt-repeater-extra").children(".cpt-field");r.a.each(r.a.merge(t,n),(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")})),this.listenRemoveEvent(e),this.autofillKeyInput(e),this.listenSwitchFieldTypeEvent(e)}},{key:"listenRemoveEvent",value:function(e){var t=r()(e).find(".remove:first"),n=r()(t).closest(".cpt-repeater-group").children(".cpt-repeater-remove");r()(t).on("click",(function(e){e.preventDefault(),r()(n).addClass("active")})),r()(n).find(".abort:first").on("click",(function(e){e.preventDefault(),r()(n).removeClass("active")})),r()(n).find(".confirm:first").on("click",(function(t){t.preventDefault(),r()(e).remove()}))}},{key:"autofillKeyInput",value:function(e){var t=r()(e).find('input[id$="-label"]:first'),n=r()(e).find('input[id$="-key"]:first');window.cptUtils.autoFillKey(n,t)}},{key:"listenSwitchFieldTypeEvent",value:function(e){var t=r()(e).find(".cpt-repeater-field-type:first").find("select"),n=r()(e).find(".cpt-repeater-extra:first");r()(t).on("select2:select",(function(e){r()(n).empty();var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(n).append(i);var o=!!r()(t).val().length&&r()(t).val();if(o){var s=r()(t).attr("name").replace("meta-fields","").replace("[type]",""),a=[];a.push({name:"action",value:"cpt-get-repeater-extra-fields"}),a.push({name:"nonce",value:cpt.ajax_nonce}),a.push({name:"field-type",value:o}),a.push({name:"parent",value:s}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:a,success:function(e){if(e.success){r()(i).remove();var t=r()(e.data);r()(n).append(t),r()(n).children(".cpt-field"),r.a.each(t,(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")}))}else r()(i).remove(),console.log("Error",e)}})}else r()(i).remove()}))}}])&&st(t.prototype,n),i&&st(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ct(e){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ut(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ht(i.key),i)}}function dt(e,t,n){return(t=ht(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ht(e){var t=function(e,t){if("object"!==ct(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ct(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ct(t)?t:String(t)}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.select={load:function(e,t){window.cptUtils.disableProFieldSelectOptions(e);var n=r()(e).find("select:first"),i={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};r()(n).select2(i)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tax_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-tax_rel-options",nonce:cpt.ajax_nonce,search:e.term,taxonomy:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.text={load:function(e,t){}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.time={load:function(e,t){for(var n=r()(e).find(".cpt-time-section:first"),i=r()(n).children("select"),o=r()(i).data("value")?r()(i).data("value"):"",s="no"!==r()(i).data("max")&&r()(i).data("max"),a="no"!==r()(i).data("min")&&r()(i).data("min"),l=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"00:00",i=0;if(!n)return i;var r=!!n.split(":")&&n.split(":"),o=null!==(e=r[0])&&void 0!==e&&e,s=null!==(t=r[1])&&void 0!==t&&t,a=Number(o+s);return Number.isInteger(a)?a:i},c=l(s),u=l(a),d=0;d<=23;d++){d=d<10?"0"+d:d;for(var h=0;h<=59;h++){var p=d+":"+(h=h<10?"0"+h:h);(u>0&&l(p)<u||c>0&&l(p)>c)&&c>u||r()(i).append(r()('<option value="'+p+'"'+(o==p?' selected="selected"':"")+">"+p+"</option>"))}}var f={placeholder:r()(i).attr("placeholder")?r()(selectEl).attr("placeholder"):" ... ",allowClear:!0,multiple:!1};r()(i).select2(f)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tinymce={load:function(e,t){new pt(e)}},e}));var pt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),dt(this,"editorEl",void 0),dt(this,"editorId",void 0),dt(this,"editorForm",void 0),dt(this,"defaultArgs",{tinymce:{wpautop:!1,plugins:"charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern",toolbar1:"formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,wp_more,spellchecker,fullscreen,wp_adv,listbuttons",toolbar2:"styleselect,strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",textarea_rows:20,wp_autoresize_on:!1,autoresize_min_height:50},quicktags:{buttons:"strong,em,link,block,del,ins,img,ul,ol,li,code,more,close"},mediaButtons:!0}),this.editorEl=r()(t).find("textarea:first"),this.editorId=r()(this.editorEl).attr("id"),this.defaultArgs.tinymce.wp_autoresize_on=r()(this.editorEl).is("[autoresize]"),this.editorForm=r()(t).closest("form"),this.startEditor()}var t,n,i;return t=e,(n=[{key:"startEditor",value:function(){var e=this,t=!1,n=setInterval((function(){!r()("#post-title-0")&&r()("body").hasClass("block-editor-page")||(t=!0,e.removeEditor(),e.initializeEditor(),e.listenSubmitEvent(),e.listenSortableEvent()),t&&clearInterval(n)}),500)}},{key:"initializeEditor",value:function(){wp.oldEditor.initialize(this.editorId,this.defaultArgs)}},{key:"removeEditor",value:function(){wp.oldEditor.remove(this.editorId)}},{key:"listenSubmitEvent",value:function(){var e=tinyMCE.editors[this.editorId];r()(this.editorForm).on("submit",(function(t){e.save()})),e.on("blur",(function(t){e.save()})),r()(document).ajaxComplete((function(t,n,i){i.data&&i.data.match(/action=add-tag/)&&(e.setContent(""),e.save())}))}},{key:"listenSortableEvent",value:function(){var e=this,t=r()(this.editorEl).closest(".ui-sortable");r()(t).on("sortstart",(function(){e.removeEditor()})),r()(t).on("sortstop",(function(){e.initializeEditor()}))}}])&&ut(t.prototype,n),i&&ut(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ft(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ft(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ft(o)?o:String(o)),i)}var r,o}var mt=wp.i18n,vt=mt.__;mt._x,mt._n,mt._nx;new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.body=r()("body"),this.window=r()(window),this.utils=new u,this.loadFields(),this.loadUiFeatures()}var t,n,i;return t=e,(n=[{key:"loadUiFeatures",value:function(){var e=this;this.body.on("click",".cpt-field-wrap.advanced-field-btn .button",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-fields-section"),i=r()(n).find(".cpt-field-wrap.advanced-field");r()(t).hasClass("button-secondary")?(r()(i).removeClass("active"),r()(t).removeClass("button-secondary").addClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-insert"),r()(t).find(".label").html(vt("Advanced view","custom-post-types"))):(r()(i).addClass("active"),r()(t).addClass("button-secondary").removeClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-remove"),r()(t).find(".label").html(vt("Simple view","custom-post-types")))})),this.window.on("load",(function(){if(e.body.hasClass("block-editor-page")){var t=r()('.cpt-fields-section *[id^="meta-fields-"][required]');t.length<=0||setInterval((function(){!function(e){var t=!0;r.a.each(e,(function(e,n){var i=r()(n).val().length>0;t=!!t&&i}));var n=r()(".edit-post-header__settings button.editor-post-publish-button__button");t?(r()(n).removeAttr("disabled"),r()(n).attr("aria-disabled","false")):(r()(n).attr("disabled","disabled"),r()(n).attr("aria-disabled","true"))}(t)}),200)}})),this.body.on("click",".cpt-notice.is-dismissible a.cpt-dismiss-notice",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-notice").find("button.notice-dismiss"),i=r()(t).data("notice"),o=r()(t).data("duration"),s=[];s.push({name:"action",value:"cpt-dismiss-notice"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"key",value:i}),s.push({name:"duration",value:o}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?n.click():console.log("Error",e)}})})),this.body.on("click",".cpt-notice pre.error-code > a",(function(e){e.preventDefault();var t=e.currentTarget;r()(t).closest(".error-code").find("code").addClass("show"),r()(t).remove()}));var t=r()('div[data-id="manage_cpt"].cpt-fields-section, div[data-id="manage_cpt_tax"].cpt-fields-section');r.a.each(t,(function(t,n){var i=r()(n).find('input[id$="-plural"]:first'),o=r()(n).find('input[id$="-id"]:first');e.utils.autoFillKey(o,i)}))}},{key:"loadFields",value:function(){var e=this;this.$fieldGroups=r()(".cpt-fields-section"),this.$fieldGroups&&(this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]),r.a.each(this.$fieldGroups,(function(t,n){var i=r()(n).children(".cpt-field");i&&r.a.each(i,(function(t,n){var i=r()(n).data("field-type");e.utils.appendFieldEvents(i,n),r()(n).trigger("load")}))})))}}])&>(t.prototype,n),i&>(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}())}]);17 !function(e,t){var n={version:302};if("wpColorPickerAlpha"in window&&"version"in window.wpColorPickerAlpha){var i=parseInt(window.wpColorPickerAlpha.version,10);if(!isNaN(i)&&i>=n.version)return}if(!Color.fn.hasOwnProperty("to_s")){Color.fn.to_s=function(e){"hex"===(e=e||"hex")&&this._alpha<1&&(e="rgba");var t="";return"hex"===e?t=this.toString():this.error||(t=this.toCSS(e).replace(/\(\s+/,"(").replace(/\s+\)/,")")),t},window.wpColorPickerAlpha=n;var r="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==";e.widget("a8c.iris",e.a8c.iris,{alphaOptions:{alphaEnabled:!1},_getColor:function(e){return void 0===e&&(e=this._color),this.alphaOptions.alphaEnabled?(e=e.to_s(this.alphaOptions.alphaColorType),this.alphaOptions.alphaColorWithSpace||(e=e.replace(/\s+/g,"")),e):e.toString()},_create:function(){try{this.alphaOptions=this.element.wpColorPicker("instance").alphaOptions}catch(e){}e.extend({},this.alphaOptions,{alphaEnabled:!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"hex",alphaColorWithSpace:!1}),this._super()},_addInputListeners:function(e){var t=this,n=function(n){var i=e.val(),r=new Color(i),o=(i=i.replace(/^(#|(rgb|hsl)a?)/,""),t.alphaOptions.alphaColorType);e.removeClass("iris-error"),r.error?""!==i&&e.addClass("iris-error"):"hex"===o&&"keyup"===n.type&&i.match(/^[0-9a-fA-F]{3}$/)||r.toIEOctoHex()!==t._color.toIEOctoHex()&&t._setOption("color",t._getColor(r))};e.on("change",n).on("keyup",t._debounce(n,100)),t.options.hide&&e.one("focus",(function(){t.show()}))},_initControls:function(){if(this._super(),this.alphaOptions.alphaEnabled){var t=this,n=t.controls.strip.clone(!1,!1),i=n.find(".iris-slider-offset"),r={stripAlpha:n,stripAlphaSlider:i};n.addClass("iris-strip-alpha"),i.addClass("iris-slider-offset-alpha"),n.appendTo(t.picker.find(".iris-picker-inner")),e.each(r,(function(e,n){t.controls[e]=n})),t.controls.stripAlphaSlider.slider({orientation:"vertical",min:0,max:100,step:1,value:parseInt(100*t._color._alpha),slide:function(e,n){t.active="strip",t._color._alpha=parseFloat(n.value/100),t._change.apply(t,arguments)}})}},_dimensions:function(e){if(this._super(e),this.alphaOptions.alphaEnabled){var t,n,i,r,o,s=this.options,a=this.controls.square,l=this.picker.find(".iris-strip");for(t=Math.round(this.picker.outerWidth(!0)-(s.border?22:0)),n=Math.round(a.outerWidth()),i=Math.round((t-n)/2),r=Math.round(i/2),o=Math.round(n+2*i+2*r);o>t;)i=Math.round(i-2),r=Math.round(r-1),o=Math.round(n+2*i+2*r);a.css("margin","0"),l.width(i).css("margin-left",r+"px")}},_change:function(){var t=this,n=t.active;if(t._super(),t.alphaOptions.alphaEnabled){var i=t.controls,o=parseInt(100*t._color._alpha),s=t._color.toRgb(),a=["rgb("+s.r+","+s.g+","+s.b+") 0%","rgba("+s.r+","+s.g+","+s.b+", 0) 100%"];t.picker.closest(".wp-picker-container").find(".wp-color-result");t.options.color=t._getColor(),i.stripAlpha.css({background:"linear-gradient(to bottom, "+a.join(", ")+"), url("+r+")"}),n&&i.stripAlphaSlider.slider("value",o),t._color.error||t.element.removeClass("iris-error").val(t.options.color),t.picker.find(".iris-palette-container").on("click.palette",".iris-palette",(function(){var n=e(this).data("color");t.alphaOptions.alphaReset&&(t._color._alpha=1,n=t._getColor()),t._setOption("color",n)}))}},_paintDimension:function(e,t){var n=!1;this.alphaOptions.alphaEnabled&&"strip"===t&&(n=this._color,this._color=new Color(n.toString()),this.hue=this._color.h()),this._super(e,t),n&&(this._color=n)},_setOption:function(e,t){if("color"!==e||!this.alphaOptions.alphaEnabled)return this._super(e,t);t=""+t,newColor=new Color(t).setHSpace(this.options.mode),newColor.error||this._getColor(newColor)===this._getColor()||(this._color=newColor,this.options.color=this._getColor(),this.active="external",this._change())},color:function(e){return!0===e?this._color.clone():void 0===e?this._getColor():void this.option("color",e)}}),e.widget("wp.wpColorPicker",e.wp.wpColorPicker,{alphaOptions:{alphaEnabled:!1},_getAlphaOptions:function(){var t=this.element,n=t.data("type")||this.options.type,i=t.data("defaultColor")||t.val(),r={alphaEnabled:t.data("alphaEnabled")||!1,alphaCustomWidth:130,alphaReset:!1,alphaColorType:"rgb",alphaColorWithSpace:!1};return r.alphaEnabled&&(r.alphaEnabled=t.is("input")&&"full"===n),r.alphaEnabled?(r.alphaColorWithSpace=i&&i.match(/\s/),e.each(r,(function(e,n){var o=t.data(e)||n;switch(e){case"alphaCustomWidth":o=o?parseInt(o,10):0,o=isNaN(o)?n:o;break;case"alphaColorType":o.match(/^(hex|(rgb|hsl)a?)$/)||(o=i&&i.match(/^#/)?"hex":i&&i.match(/^hsla?/)?"hsl":n);break;default:o=!!o}r[e]=o})),r):r},_create:function(){e.support.iris&&(this.alphaOptions=this._getAlphaOptions(),this._super())},_addListeners:function(){if(!this.alphaOptions.alphaEnabled)return this._super();var t=this,n=t.element,i=t.toggler.is("a");this.alphaOptions.defaultWidth=n.width(),this.alphaOptions.alphaCustomWidth&&n.width(parseInt(this.alphaOptions.defaultWidth+this.alphaOptions.alphaCustomWidth,10)),t.toggler.css({position:"relative","background-image":"url("+r+")"}),i?t.toggler.html('<span class="color-alpha" />'):t.toggler.append('<span class="color-alpha" />'),t.colorAlpha=t.toggler.find("span.color-alpha").css({width:"30px",height:"100%",position:"absolute",top:0,"background-color":n.val()}),"ltr"===t.colorAlpha.css("direction")?t.colorAlpha.css({"border-bottom-left-radius":"2px","border-top-left-radius":"2px",left:0}):t.colorAlpha.css({"border-bottom-right-radius":"2px","border-top-right-radius":"2px",right:0}),n.iris({change:function(e,n){t.colorAlpha.css({"background-color":n.color.to_s(t.alphaOptions.alphaColorType)}),"function"==typeof t.options.change&&t.options.change.call(this,e,n)}}),t.wrap.on("click.wpcolorpicker",(function(e){e.stopPropagation()})),t.toggler.on("click",(function(){t.toggler.hasClass("wp-picker-open")?t.close():t.open()})),n.on("change",(function(r){var o=e(this).val();(n.hasClass("iris-error")||""===o||o.match(/^(#|(rgb|hsl)a?)$/))&&(i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r))})),t.button.on("click",(function(r){e(this).hasClass("wp-picker-default")?n.val(t.options.defaultColor).change():e(this).hasClass("wp-picker-clear")&&(n.val(""),i&&t.toggler.removeAttr("style"),t.colorAlpha.css("background-color",""),"function"==typeof t.options.clear&&t.options.clear.call(this,r),n.trigger("change"))}))}})}}(jQuery)},function(e,t,n){},function(e,t,n){"use strict";n.r(t);n.p,n.p,n.p,n(3);var i=n(0),r=n.n(i);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */s=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},r="function"==typeof Symbol?Symbol:{},a=r.iterator||"@@iterator",l=r.asyncIterator||"@@asyncIterator",c=r.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function d(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,s=Object.create(o.prototype),a=new $(r||[]);return i(s,"_invoke",{value:D(e,n,a)}),s}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var p={};function f(){}function g(){}function m(){}var v={};u(v,a,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(C([])));b&&b!==t&&n.call(b,a)&&(v=b);var w=m.prototype=f.prototype=Object.create(v);function _(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){var r;i(this,"_invoke",{value:function(i,s){function a(){return new t((function(r,a){!function i(r,s,a,l){var c=h(e[r],e,s);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==o(d)&&n.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,a,l)}),(function(e){i("throw",e,a,l)})):t.resolve(d).then((function(e){u.value=e,a(u)}),(function(e){return i("throw",e,a,l)}))}l(c.arg)}(i,s,r,a)}))}return r=r?r.then(a,a):a()}})}function D(e,t,n){var i="suspendedStart";return function(r,o){if("executing"===i)throw new Error("Generator is already running");if("completed"===i){if("throw"===r)throw o;return E()}for(n.method=r,n.arg=o;;){var s=n.delegate;if(s){var a=x(s,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===i)throw i="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i="executing";var l=h(e,t,n);if("normal"===l.type){if(i=n.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(i="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=t.method,i=e.iterator[n];if(void 0===i)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),p;var r=h(i,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,p;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,p):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,p)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function $(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,r=function t(){for(;++i<e.length;)if(n.call(e,i))return t.value=e[i],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:E}}function E(){return{value:void 0,done:!0}}return g.prototype=m,i(w,"constructor",{value:m,configurable:!0}),i(m,"constructor",{value:g,configurable:!0}),g.displayName=u(m,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},e.awrap=function(e){return{__await:e}},_(k.prototype),u(k.prototype,l,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,i,r,o){void 0===o&&(o=Promise);var s=new k(d(t,n,i,r),o);return e.isGeneratorFunction(n)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},_(w),u(w,c,"Generator"),u(w,a,(function(){return this})),u(w,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var i in t)n.push(i);return n.reverse(),function e(){for(;n.length;){var i=n.pop();if(i in t)return e.value=i,e.done=!1,e}return e.done=!0,e}},e.values=C,$.prototype={constructor:$,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(A),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function i(n,i){return s.type="throw",s.arg=e,t.next=n,i&&(t.method="next",t.arg=void 0),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var a=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(a&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var r=i.arg;A(n)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),p}},e}function a(e,t,n,i,r,o,s){try{var a=e[o](s),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(i,r)}function l(e){return function(){var t=this,n=arguments;return new Promise((function(i,r){var o=e.apply(t,n);function s(e){a(o,i,r,s,l,"next",e)}function l(e){a(o,i,r,s,l,"throw",e)}s(void 0)}))}}function c(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,s=void 0,s=function(e,t){if("object"!==o(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==o(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===o(s)?s:String(s)),i)}var r,s}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,i;return t=e,(n=[{key:"appendFieldEvents",value:function(e,t){this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]);var n=this.fieldsEvents[e];n&&r.a.each(n,(function(e,n){r()(t).on(e,(function(e){n(t,e)}))}))}},{key:"sanitizeTitle",value:function(e){e=(e=e.replace(/^\s+|\s+$/g,"")).toLowerCase();for(var t="àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;",n=0,i=t.length;n<i;n++)e=e.replace(new RegExp(t.charAt(n),"g"),"aaaaeeeeiiiioooouuuuncescrzyuudtn------".charAt(n));return e=e.replace(".","-").replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/\//g,"")}},{key:"autoFillKey",value:function(e,t){var n=this;r()(t).add(e).on("focusout",(function(){var i=r()(e).val(),o=r()(t).val();!i.length&&o.length&&r()(e).val(n.sanitizeTitle(o))}))}},{key:"copyToClipboard",value:function(e){var t=navigator.clipboard.writeText(r()(e).val()).then((function(){return!0}),(function(){return!1}));return l(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))}},{key:"disableProFieldSelectOptions",value:function(e){var t=r()(e).closest(".cpt-fields-section");if(t&&"manage_cpt_field"===t.data("id")){var n=r()(e).find("select > option");r.a.each(n,(function(e,t){t.text.endsWith(" [PRO only]")&&(t.disabled=!0)}))}}}])&&c(t.prototype,n),i&&c(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();window.cptUtils=new u,wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.checkbox={load:function(e,t){var n=r()(e).find('input[type="checkbox"][required]');r()(n).on("click",(function(t){r()(n).prop("required",!r()(e).find('input[type="checkbox"]:checked').length)}))}},e}));n(4);wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.color={load:function(e,t){var n=r()(e).find(".cpt-color-section:first"),i=r()(n).children("input");r()(i).wpColorPicker({palettes:!0})}},e}));n(5);function d(e){return e[e.length-1]}function h(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function p(e,t){return e?e.split(t):[]}function f(e,t,n){return(void 0===t||e>=t)&&(void 0===n||e<=n)}function g(e,t,n){return e<t?t:e>n?n:e}function m(e,t,n={},i=0,r=""){r+=`<${Object.keys(n).reduce((e,t)=>{let r=n[t];return"function"==typeof r&&(r=r(i)),`${e} ${t}="${r}"`},e)}></${e}>`;const o=i+1;return o<t?m(e,t,n,o,r):r}function v(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function y(e){return new Date(e).setHours(0,0,0,0)}function b(){return(new Date).setHours(0,0,0,0)}function w(...e){switch(e.length){case 0:return b();case 1:return y(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function _(e,t){const n=new Date(e);return n.setDate(n.getDate()+t)}function k(e,t){const n=new Date(e),i=n.getMonth()+t;let r=i%12;r<0&&(r+=12);const o=n.setMonth(i);return n.getMonth()!==r?n.setDate(0):o}function D(e,t){const n=new Date(e),i=n.getMonth(),r=n.setFullYear(n.getFullYear()+t);return 1===i&&2===n.getMonth()?n.setDate(0):r}function x(e,t){return(e-t+7)%7}function S(e,t,n=0){const i=new Date(e).getDay();return _(e,x(t,n)-x(i,n))}function A(e,t){return Math.round((e-t)/6048e5)+1}function $(e){const t=S(e,4,1);return A(t,S(new Date(t).setMonth(0,4),4,1))}function C(e,t){const n=S(new Date(e).setMonth(0,1),t,t),i=S(e,t,t),r=A(i,n);if(r<53)return r;return i===S(new Date(e).setDate(32),t,t)?1:r}function E(e){return C(e,0)}function O(e){return C(e,6)}function L(e,t){const n=new Date(e).getFullYear();return Math.floor(n/t)*t}function j(e,t,n){if(1!==t&&2!==t)return e;const i=new Date(e);return 1===t?n?i.setMonth(i.getMonth()+1,0):i.setDate(1):n?i.setFullYear(i.getFullYear()+1,0,0):i.setMonth(0,1),i.setHours(0,0,0,0)}const M=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,T=/[\s!-/:-@[-`{-~年月日]+/;let N={};const F={y:(e,t)=>new Date(e).setFullYear(parseInt(t,10)),m(e,t,n){const i=new Date(e);let r=parseInt(t,10)-1;if(isNaN(r)){if(!t)return NaN;const e=t.toLowerCase(),i=t=>t.toLowerCase().startsWith(e);if(r=n.monthsShort.findIndex(i),r<0&&(r=n.months.findIndex(i)),r<0)return NaN}return i.setMonth(r),i.getMonth()!==function e(t){return t>-1?t%12:e(t+12)}(r)?i.setDate(0):i.getTime()},d:(e,t)=>new Date(e).setDate(parseInt(t,10))},I={d:e=>e.getDate(),dd:e=>P(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>P(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>P(e.getFullYear(),2).slice(-2),yyyy:e=>P(e.getFullYear(),4)};function P(e,t){return e.toString().padStart(t,"0")}function B(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in N)return N[e];const t=e.split(M),n=e.match(new RegExp(M,"g"));if(0===t.length||!n)throw new Error("Invalid date format.");const i=n.map(e=>I[e]),r=Object.keys(F).reduce((e,t)=>(n.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return N[e]={parser(e,t){const i=e.split(T).reduce((e,t,i)=>{if(t.length>0&&n[i]){const r=n[i][0];"M"===r?e.m=t:"D"!==r&&(e[r]=t)}return e},{});return r.reduce((e,n)=>{const r=F[n](e,i[n],t);return isNaN(r)?e:r},b())},formatter:(e,n)=>i.reduce((i,r,o)=>i+`${t[o]}${r(e,n)}`,"")+d(t)}}function R(e,t,n){if(e instanceof Date||"number"==typeof e){const t=y(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return b();if(t&&t.toValue){const i=t.toValue(e,t,n);return isNaN(i)?void 0:y(i)}return B(t).parser(e,n)}}function q(e,t,n){if(isNaN(e)||!e&&0!==e)return"";const i="number"==typeof e?new Date(e):e;return t.toDisplay?t.toDisplay(i,t,n):B(t).formatter(i,n)}const H=document.createRange();function V(e){return H.createContextualFragment(e)}function W(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function U(e){return e.getRootNode().activeElement===e}function z(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function Y(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function G(e){e.firstChild&&(e.removeChild(e.firstChild),G(e))}const K=new WeakMap,{addEventListener:Z,removeEventListener:J}=EventTarget.prototype;function Q(e,t){let n=K.get(e);n||(n=[],K.set(e,n)),t.forEach(e=>{Z.call(...e),n.push(e)})}function X(e){let t=K.get(e);t&&(t.forEach(e=>{J.call(...e)}),K.delete(e))}if(!Event.prototype.composedPath){const e=(t,n=[])=>{let i;return n.push(t),t.parentNode?i=t.parentNode:t.host?i=t.host:t.defaultView&&(i=t.defaultView),i?e(i,n):n};Event.prototype.composedPath=function(){return e(this.target)}}function ee(e,t){const n="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return function e(t,n,i){const[r,...o]=t;return n(r)?r:r!==i&&"HTML"!==r.tagName&&0!==o.length?e(o,n,i):void 0}(e.composedPath(),n,e.currentTarget)}var te={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM y"}},ne={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,clearButton:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,enableOnReadonly:!0,format:"mm/dd/yyyy",language:"en",maxDate:null,maxNumberOfDates:1,maxView:3,minDate:null,nextArrow:"»",orientation:"auto",pickLevel:0,prevArrow:"«",showDaysOfWeek:!0,showOnClick:!0,showOnFocus:!0,startView:0,title:"",todayButton:!1,todayButtonMode:0,todayHighlight:!1,updateOnBlur:!0,weekNumbers:0,weekStart:0};const{language:ie,format:re,weekStart:oe}=ne;function se(e,t){return e.length<6&&t>=0&&t<7?h(e,t):e}function ae(e,t){switch(4===e?6===t?3:!t+1:e){case 1:return $;case 2:return E;case 3:return O}}function le(e,t,n){return t.weekStart=e,t.weekEnd=(e+6)%7,4===n&&(t.getWeekNumber=ae(4,e)),e}function ce(e,t,n,i){const r=R(e,t,n);return void 0!==r?r:i}function ue(e,t,n=3){const i=parseInt(e,10);return i>=0&&i<=n?i:t}function de(e,t,n,i){t in e&&(n in e||(e[n]=i?i(e[t]):e[t]),delete e[t])}function he(e,t){const n=Object.assign({},e),i={},r=t.constructor.locales,o=!!t.rangeSideIndex;let{datesDisabled:s,format:a,language:l,locale:c,maxDate:u,maxView:d,minDate:p,pickLevel:f,startView:g,weekNumbers:m,weekStart:v}=t.config||{};if(de(n,"calendarWeeks","weekNumbers",e=>e?1:0),de(n,"clearBtn","clearButton"),de(n,"todayBtn","todayButton"),de(n,"todayBtnMode","todayButtonMode"),n.language){let e;if(n.language!==l&&(r[n.language]?e=n.language:(e=n.language.split("-")[0],r[e]||(e=!1))),delete n.language,e){l=i.language=e;const t=c||r[ie];c=Object.assign({format:re,weekStart:oe},r[ie]),l!==ie&&Object.assign(c,r[l]),i.locale=c,a===t.format&&(a=i.format=c.format),v===t.weekStart&&(v=le(c.weekStart,i,m))}}if(n.format){const e="function"==typeof n.format.toDisplay,t="function"==typeof n.format.toValue,r=M.test(n.format);(e&&t||r)&&(a=i.format=n.format),delete n.format}let y=f;"pickLevel"in n&&(y=ue(n.pickLevel,f,2),delete n.pickLevel),y!==f&&(y>f&&("minDate"in n||(n.minDate=p),"maxDate"in n||(n.maxDate=u)),s&&!n.datesDisabled&&(n.datesDisabled=[]),f=i.pickLevel=y);let b=p,_=u;if("minDate"in n){const e=w(0,0,1);b=null===n.minDate?e:ce(n.minDate,a,c,b),b!==e&&(b=j(b,f,!1)),delete n.minDate}if("maxDate"in n&&(_=null===n.maxDate?void 0:ce(n.maxDate,a,c,_),void 0!==_&&(_=j(_,f,!0)),delete n.maxDate),_<b?(p=i.minDate=_,u=i.maxDate=b):(p!==b&&(p=i.minDate=b),u!==_&&(u=i.maxDate=_)),n.datesDisabled){const e=n.datesDisabled;if("function"==typeof e)i.datesDisabled=null,i.checkDisabled=(t,n)=>e(new Date(t),n,o);else{const t=i.datesDisabled=e.reduce((e,t)=>{const n=R(t,a,c);return void 0!==n?h(e,j(n,f,o)):e},[]);i.checkDisabled=e=>t.includes(e)}delete n.datesDisabled}if("defaultViewDate"in n){const e=R(n.defaultViewDate,a,c);void 0!==e&&(i.defaultViewDate=e),delete n.defaultViewDate}if("weekStart"in n){const e=Number(n.weekStart)%7;isNaN(e)||(v=le(e,i,m)),delete n.weekStart}if(n.daysOfWeekDisabled&&(i.daysOfWeekDisabled=n.daysOfWeekDisabled.reduce(se,[]),delete n.daysOfWeekDisabled),n.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=n.daysOfWeekHighlighted.reduce(se,[]),delete n.daysOfWeekHighlighted),"weekNumbers"in n){let e=n.weekNumbers;if(e){const t="function"==typeof e?(t,n)=>e(new Date(t),n):ae(e=parseInt(e,10),v);t&&(m=i.weekNumbers=e,i.getWeekNumber=t)}else m=i.weekNumbers=0,i.getWeekNumber=null;delete n.weekNumbers}if("maxNumberOfDates"in n){const e=parseInt(n.maxNumberOfDates,10);e>=0&&(i.maxNumberOfDates=e,i.multidate=1!==e),delete n.maxNumberOfDates}n.dateDelimiter&&(i.dateDelimiter=String(n.dateDelimiter),delete n.dateDelimiter);let k=d;"maxView"in n&&(k=ue(n.maxView,d),delete n.maxView),k=f>k?f:k,k!==d&&(d=i.maxView=k);let D=g;if("startView"in n&&(D=ue(n.startView,D),delete n.startView),D<f?D=f:D>d&&(D=d),D!==g&&(i.startView=D),n.prevArrow){const e=V(n.prevArrow);e.childNodes.length>0&&(i.prevArrow=e.childNodes),delete n.prevArrow}if(n.nextArrow){const e=V(n.nextArrow);e.childNodes.length>0&&(i.nextArrow=e.childNodes),delete n.nextArrow}if("disableTouchKeyboard"in n&&(i.disableTouchKeyboard="ontouchstart"in document&&!!n.disableTouchKeyboard,delete n.disableTouchKeyboard),n.orientation){const e=n.orientation.toLowerCase().split(/\s+/g);i.orientation={x:e.find(e=>"left"===e||"right"===e)||"auto",y:e.find(e=>"top"===e||"bottom"===e)||"auto"},delete n.orientation}if("todayButtonMode"in n){switch(n.todayButtonMode){case 0:case 1:i.todayButtonMode=n.todayButtonMode}delete n.todayButtonMode}return Object.entries(n).forEach(([e,t])=>{void 0!==t&&e in ne&&(i[e]=t)}),i}const pe={show:{key:"ArrowDown"},hide:null,toggle:{key:"Escape"},prevButton:{key:"ArrowLeft",ctrlOrMetaKey:!0},nextButton:{key:"ArrowRight",ctrlOrMetaKey:!0},viewSwitch:{key:"ArrowUp",ctrlOrMetaKey:!0},clearButton:{key:"Backspace",ctrlOrMetaKey:!0},todayButton:{key:".",ctrlOrMetaKey:!0},exitEditMode:{key:"ArrowDown",ctrlOrMetaKey:!0}};var fe=v('<div class="datepicker">\n <div class="datepicker-picker">\n <div class="datepicker-header">\n <div class="datepicker-title"></div>\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% prev-button prev-btn"></button>\n <button type="button" class="%buttonClass% view-switch"></button>\n <button type="button" class="%buttonClass% next-button next-btn"></button>\n </div>\n </div>\n <div class="datepicker-main"></div>\n <div class="datepicker-footer">\n <div class="datepicker-controls">\n <button type="button" class="%buttonClass% today-button today-btn"></button>\n <button type="button" class="%buttonClass% clear-button clear-btn"></button>\n </div>\n </div>\n </div>\n</div>'),ge=v(`<div class="days">\n <div class="days-of-week">${m("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${m("span",42)}</div>\n</div>`),me=v(`<div class="week-numbers calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${m("span",6,{class:"week"})}</div>\n</div>`);class ve{constructor(e,t){Object.assign(this,t,{picker:e,element:V('<div class="datepicker-view"></div>').firstChild,selected:[],isRangeEnd:!!e.datepicker.rangeSideIndex}),this.init(this.picker.datepicker.config)}init(e){"pickLevel"in e&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}prepareForRender(e,t,n){this.disabled=[];const i=this.picker;i.setViewSwitchLabel(e),i.setPrevButtonDisabled(t),i.setNextButtonDisabled(n)}setDisabled(e,t){t.add("disabled"),h(this.disabled,e)}performBeforeHook(e,t){let n=this.beforeShow(new Date(t));switch(typeof n){case"boolean":n={enabled:n};break;case"string":n={classes:n}}if(n){const i=e.classList;if(!1===n.enabled&&this.setDisabled(t,i),n.classes){const e=n.classes.split(/\s+/);i.add(...e),e.includes("disabled")&&this.setDisabled(t,i)}n.content&&function(e,t){G(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(V(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,n.content)}}renderCell(e,t,n,i,{selected:r,range:o},s,a=[]){e.textContent=t,this.isMinView&&(e.dataset.date=i);const l=e.classList;if(e.className="datepicker-cell "+this.cellClass,n<this.first?l.add("prev"):n>this.last&&l.add("next"),l.add(...a),(s||this.checkDisabled(i,this.id))&&this.setDisabled(i,l),o){const[e,t]=o;n>e&&n<t&&l.add("range"),n===e&&l.add("range-start"),n===t&&l.add("range-end")}r.includes(n)&&l.add("selected"),n===this.focused&&l.add("focused"),this.beforeShow&&this.performBeforeHook(e,i)}refreshCell(e,t,n,[i,r]){const o=e.classList;o.remove("range","range-start","range-end","selected","focused"),t>i&&t<r&&o.add("range"),t===i&&o.add("range-start"),t===r&&o.add("range-end"),n.includes(t)&&o.add("selected"),t===this.focused&&o.add("focused")}changeFocusedCell(e){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}class ye extends ve{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=V(ge).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if("minDate"in e&&(this.minDate=e.minDate),"maxDate"in e&&(this.maxDate=e.maxDate),e.checkDisabled&&(this.checkDisabled=e.checkDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),"todayHighlight"in e&&(this.todayHighlight=e.todayHighlight),"weekStart"in e&&(this.weekStart=e.weekStart,this.weekEnd=e.weekEnd,t=!0),e.locale){const n=this.locale=e.locale;this.dayNames=n.daysMin,this.switchLabelFormat=n.titleFormat,t=!0}if("beforeShowDay"in e&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),"weekNumbers"in e)if(e.weekNumbers&&!this.weekNumbers){const e=V(me).firstChild;this.weekNumbers={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.weekNumbers&&!e.weekNumbers&&(this.element.removeChild(this.weekNumbers.element),this.weekNumbers=null);"getWeekNumber"in e&&(this.getWeekNumber=e.getWeekNumber),"showDaysOfWeek"in e&&(e.showDaysOfWeek?(Y(this.dow),this.weekNumbers&&Y(this.weekNumbers.dow)):(z(this.dow),this.weekNumbers&&z(this.weekNumbers.dow))),t&&Array.from(this.dow.children).forEach((e,t)=>{const n=(this.weekStart+t)%7;e.textContent=this.dayNames[n],e.className=this.daysOfWeekDisabled.includes(n)?"dow disabled":"dow"})}updateFocus(){const e=new Date(this.picker.viewDate),t=e.getFullYear(),n=e.getMonth(),i=w(t,n,1),r=S(i,this.weekStart,this.weekStart);this.first=i,this.last=w(t,n+1,0),this.start=r,this.focused=this.picker.viewDate}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e,t&&(this.range=t.dates)}render(){if(this.today=this.todayHighlight?b():void 0,this.prepareForRender(q(this.focused,this.switchLabelFormat,this.locale),this.first<=this.minDate,this.last>=this.maxDate),this.weekNumbers){const e=this.weekStart,t=S(this.first,e,e);Array.from(this.weekNumbers.weeks.children).forEach((n,i)=>{const r=_(t,7*i);n.textContent=this.getWeekNumber(r,e),i>3&&n.classList[r>this.last?"add":"remove"]("next")})}Array.from(this.grid.children).forEach((e,t)=>{const n=_(this.start,t),i=new Date(n),r=i.getDay(),o=[];this.today===n&&o.push("today"),this.daysOfWeekHighlighted.includes(r)&&o.push("highlighted"),this.renderCell(e,i.getDate(),n,n,this,n<this.minDate||n>this.maxDate||this.daysOfWeekDisabled.includes(r),o)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.dataset.date),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/864e5))}}function be(e,t){if(!e||!e[0]||!e[1])return;const[[n,i],[r,o]]=e;return n>t||r<t?void 0:[n===t?i:-1,r===t?o:12]}class we extends ve{constructor(e){super(e,{id:1,name:"months",cellClass:"month"})}init(e,t=!0){t&&(this.grid=this.element,this.element.classList.add("months","datepicker-grid"),this.grid.appendChild(V(m("span",12,{"data-month":e=>e}))),this.first=0,this.last=11),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),"minDate"in e)if(void 0===e.minDate)this.minYear=this.minMonth=this.minDate=void 0;else{const t=new Date(e.minDate);this.minYear=t.getFullYear(),this.minMonth=t.getMonth(),this.minDate=t.setDate(1)}if("maxDate"in e)if(void 0===e.maxDate)this.maxYear=this.maxMonth=this.maxDate=void 0;else{const t=new Date(e.maxDate);this.maxYear=t.getFullYear(),this.maxMonth=t.getMonth(),this.maxDate=w(this.maxYear,this.maxMonth+1,0)}e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),"beforeShowMonth"in e&&(this.beforeShow="function"==typeof e.beforeShowMonth?e.beforeShowMonth:void 0)}updateFocus(){const e=new Date(this.picker.viewDate);this.year=e.getFullYear(),this.focused=e.getMonth()}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>{const n=new Date(t),i=n.getFullYear(),r=n.getMonth();return void 0===e[i]?e[i]=[r]:h(e[i],r),e},{}),t&&t.dates&&(this.range=t.dates.map(e=>{const t=new Date(e);return isNaN(t)?void 0:[t.getFullYear(),t.getMonth()]}))}render(){this.prepareForRender(this.year,this.year<=this.minYear,this.year>=this.maxYear);const e=this.selected[this.year]||[],t=this.year<this.minYear||this.year>this.maxYear,n=this.year===this.minYear,i=this.year===this.maxYear,r=be(this.range,this.year);Array.from(this.grid.children).forEach((o,s)=>{const a=j(new Date(this.year,s,1),1,this.isRangeEnd);this.renderCell(o,this.monthNames[s],s,a,{selected:e,range:r},t||n&&s<this.minMonth||i&&s>this.maxMonth)})}refresh(){const e=this.selected[this.year]||[],t=be(this.range,this.year)||[];Array.from(this.grid.children).forEach((n,i)=>{this.refreshCell(n,i,e,t)})}refreshFocus(){this.changeFocusedCell(this.focused)}}class _e extends ve{constructor(e,t){super(e,t)}init(e,t=!0){var n;t&&(this.navStep=10*this.step,this.beforeShowOption="beforeShow"+(n=this.cellClass,[...n].reduce((e,t,n)=>e+(n?t:t.toUpperCase()),"")),this.grid=this.element,this.element.classList.add(this.name,"datepicker-grid"),this.grid.appendChild(V(m("span",12)))),super.init(e)}setOptions(e){if("minDate"in e&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=L(e.minDate,this.step),this.minDate=w(this.minYear,0,1))),"maxDate"in e&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=L(e.maxDate,this.step),this.maxDate=w(this.maxYear,11,31))),e.checkDisabled&&(this.checkDisabled=this.isMinView||null===e.datesDisabled?e.checkDisabled:()=>!1),this.beforeShowOption in e){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=L(e,this.navStep),n=t+9*this.step;this.first=t,this.last=n,this.start=t-this.step,this.focused=L(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>h(e,L(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return L(e,this.step)}))}render(){this.prepareForRender(`${this.first}-${this.last}`,this.first<=this.minYear,this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const n=this.start+t*this.step,i=j(new Date(n,0,1),2,this.isRangeEnd);e.dataset.year=n,this.renderCell(e,n,n,i,this,n<this.minYear||n>this.maxYear)})}refresh(){const e=this.range||[];Array.from(this.grid.children).forEach(t=>{this.refreshCell(t,Number(t.textContent),this.selected,e)})}refreshFocus(){this.changeFocusedCell(Math.round((this.focused-this.start)/this.step))}}function ke(e,t){const n={date:e.getDate(),viewDate:new Date(e.picker.viewDate),viewId:e.picker.currentView.id,datepicker:e};e.element.dispatchEvent(new CustomEvent(t,{detail:n}))}function De(e,t){const{config:n,picker:i}=e,{currentView:r,viewDate:o}=i;let s;switch(r.id){case 0:s=k(o,t);break;case 1:s=D(o,t);break;default:s=D(o,t*r.navStep)}s=g(s,n.minDate,n.maxDate),i.changeFocus(s).render()}function xe(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function Se(e){e.setDate({clear:!0})}function Ae(e){const t=b();1===e.config.todayButtonMode?e.setDate(t,{forceRefresh:!0,viewDate:t}):e.setFocusedDate(t,!0)}function $e(e){const t=()=>{e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()},n=e.element;U(n)?n.addEventListener("blur",t,{once:!0}):t()}function Ce(e,t){const n=e.picker,i=new Date(n.viewDate),r=n.currentView.id,o=1===r?k(i,t-i.getMonth()):D(i,t-i.getFullYear());n.changeFocus(o).changeView(r-1).render()}function Ee(e){xe(e)}function Oe(e){De(e,-1)}function Le(e){De(e,1)}function je(e,t){const n=ee(t,".datepicker-cell");if(!n||n.classList.contains("disabled"))return;const{id:i,isMinView:r}=e.picker.currentView,o=n.dataset;r?e.setDate(Number(o.date)):Ce(e,Number(1===i?o.month:o.year))}function Me(e){e.preventDefault()}const Te=["left","top","right","bottom"].reduce((e,t)=>(e[t]="datepicker-orient-"+t,e),{}),Ne=e=>e?e+"px":e;function Fe(e,t){if("title"in t&&(t.title?(e.controls.title.textContent=t.title,Y(e.controls.title)):(e.controls.title.textContent="",z(e.controls.title))),t.prevArrow){const n=e.controls.prevButton;G(n),t.prevArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const n=e.controls.nextButton;G(n),t.nextArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayButton.textContent=t.locale.today,e.controls.clearButton.textContent=t.locale.clear),"todayButton"in t&&(t.todayButton?Y(e.controls.todayButton):z(e.controls.todayButton)),"minDate"in t||"maxDate"in t){const{minDate:t,maxDate:n}=e.datepicker.config;e.controls.todayButton.disabled=!f(b(),t,n)}"clearButton"in t&&(t.clearButton?Y(e.controls.clearButton):z(e.controls.clearButton))}function Ie(e){const{dates:t,config:n,rangeSideIndex:i}=e;return g(t.length>0?d(t):j(n.defaultViewDate,n.pickLevel,i),n.minDate,n.maxDate)}function Pe(e,t){"_oldViewDate"in e||t===e.viewDate||(e._oldViewDate=e.viewDate),e.viewDate=t;const{id:n,year:i,first:r,last:o}=e.currentView,s=new Date(t).getFullYear();switch(n){case 0:return t<r||t>o;case 1:return s!==i;default:return s<r||s>o}}function Be(e){return window.getComputedStyle(e).direction}class Re{constructor(e){const{config:t,inputField:n}=this.datepicker=e,i=fe.replace(/%buttonClass%/g,t.buttonClass),r=this.element=V(i).firstChild,[o,s,a]=r.firstChild.children,l=o.firstElementChild,[c,u,d]=o.lastElementChild.children,[h,p]=a.firstChild.children,f={title:l,prevButton:c,viewSwitch:u,nextButton:d,todayButton:h,clearButton:p};this.main=s,this.controls=f;const g=n?"dropdown":"inline";r.classList.add("datepicker-"+g),Fe(this,t),this.viewDate=Ie(e),Q(e,[[r,"mousedown",Me],[s,"click",je.bind(null,e)],[f.viewSwitch,"click",Ee.bind(null,e)],[f.prevButton,"click",Oe.bind(null,e)],[f.nextButton,"click",Le.bind(null,e)],[f.todayButton,"click",Ae.bind(null,e)],[f.clearButton,"click",Se.bind(null,e)]]),this.views=[new ye(this),new we(this),new _e(this,{id:2,name:"years",cellClass:"year",step:1}),new _e(this,{id:3,name:"decades",cellClass:"decade",step:10})],this.currentView=this.views[t.startView],this.currentView.render(),this.main.appendChild(this.currentView.element),t.container?t.container.appendChild(this.element):n.after(this.element)}setOptions(e){Fe(this,e),this.views.forEach(t=>{t.init(e,!1)}),this.currentView.render()}detach(){this.element.remove()}show(){if(this.active)return;const{datepicker:e,element:t}=this,n=e.inputField;if(n){const i=Be(n);i!==Be(W(t))?t.dir=i:t.dir&&t.removeAttribute("dir"),t.style.visibility="hidden",t.classList.add("active"),this.place(),t.style.visibility="",e.config.disableTouchKeyboard&&n.blur()}else t.classList.add("active");this.active=!0,ke(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,ke(this.datepicker,"hide"))}place(){const{classList:e,offsetParent:t,style:n}=this.element,{config:i,inputField:r}=this.datepicker,{width:o,height:s}=this.element.getBoundingClientRect(),{left:a,top:l,right:c,bottom:u,width:d,height:h}=r.getBoundingClientRect();let{x:p,y:f}=i.orientation,g=a,m=l;if(t!==document.body&&t){const e=t.getBoundingClientRect();g-=e.left-t.scrollLeft,m-=e.top-t.scrollTop}else g+=window.scrollX,m+=window.scrollY;const v=function e(t){const n=W(t);if(n!==document.body&&n)return"visible"!==window.getComputedStyle(n).overflow?n:e(n)}(r);let y=0,b=0,{clientWidth:w,clientHeight:_}=document.documentElement;if(v){const e=v.getBoundingClientRect();e.top>0&&(b=e.top),e.left>0&&(y=e.left),e.right<w&&(w=e.right),e.bottom<_&&(_=e.bottom)}let k=0;"auto"===p&&(a<y?(p="left",k=y-a):a+o>w?(p="right",w<c&&(k=w-c)):p="rtl"===Be(r)?c-o<y?"left":"right":"left"),"right"===p&&(g+=d-o),g+=k,"auto"===f&&(f=l-s>b&&u+s>_?"top":"bottom"),"top"===f?m-=s:m+=h,e.remove(...Object.values(Te)),e.add(Te[p],Te[f]),n.left=Ne(g),n.top=Ne(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevButtonDisabled(e){this.controls.prevButton.disabled=e}setNextButtonDisabled(e){this.controls.nextButton.disabled=e}changeView(e){const t=this.currentView;return e!==t.id&&(this._oldView||(this._oldView=t),this.currentView=this.views[e],this._renderMethod="render"),this}changeFocus(e){return this._renderMethod=Pe(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(e){const t=void 0===e?Ie(this.datepicker):e;return this._renderMethod=Pe(this,t)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const{currentView:t,datepicker:n,_oldView:i}=this,r=new Date(this._oldViewDate),o=e&&this._renderMethod||"render";if(delete this._oldView,delete this._oldViewDate,delete this._renderMethod,t[o](),i&&(this.main.replaceChild(t.element,i.element),ke(n,"changeView")),!isNaN(r)){const e=new Date(this.viewDate);e.getFullYear()!==r.getFullYear()&&ke(n,"changeYear"),e.getMonth()!==r.getMonth()&&ke(n,"changeMonth")}}}function qe(e,t,n){const i=e.picker,r=i.currentView,o=r.step||1;let s,a=i.viewDate;switch(r.id){case 0:a=_(a,n?7*t:t),s=_;break;case 1:a=k(a,n?4*t:t),s=k;break;default:a=D(a,t*(n?4:1)*o),s=D}a=function e(t,n,i,r,o,s){if(f(t,o,s)){if(r(t)){return e(n(t,i),n,i,r,o,s)}return t}}(a,s,t<0?-o:o,e=>r.disabled.includes(e),r.minDate,r.maxDate),void 0!==a&&i.changeFocus(a).render()}function He(e,t){const{config:n,picker:i,editMode:r}=e,o=i.active,{key:s,altKey:a,shiftKey:l}=t,c=t.ctrlKey||t.metaKey,u=()=>{t.preventDefault(),t.stopPropagation()};if("Tab"===s)return void $e(e);if("Enter"===s){if(o)if(r)e.exitEditMode({update:!0,autohide:n.autohide});else{const t=i.currentView;t.isMinView?e.setDate(i.viewDate):(i.changeView(t.id-1).render(),u())}else e.update();return}const d=n.shortcutKeys,h={key:s,ctrlOrMetaKey:c,altKey:a,shiftKey:l},p=Object.keys(d).find(e=>{const t=d[e];return!Object.keys(t).find(e=>t[e]!==h[e])});if(p){let t;if("toggle"===p?t=p:r?"exitEditMode"===p&&(t=p):o?"hide"===p?t=p:"prevButton"===p?t=[De,[e,-1]]:"nextButton"===p?t=[De,[e,1]]:"viewSwitch"===p?t=[xe,[e]]:n.clearButton&&"clearButton"===p?t=[Se,[e]]:n.todayButton&&"todayButton"===p&&(t=[Ae,[e]]):"show"===p&&(t=p),t)return Array.isArray(t)?t[0].apply(null,t[1]):e[t](),void u()}if(!o||r)return;const f=(n,i)=>{l||c||a?e.enterEditMode():(qe(e,n,i),t.preventDefault())};"ArrowLeft"===s?f(-1,!1):"ArrowRight"===s?f(1,!1):"ArrowUp"===s?f(-1,!0):"ArrowDown"===s?f(1,!0):("Backspace"===s||"Delete"===s||s&&1===s.length&&!c)&&e.enterEditMode()}function Ve(e){e.config.showOnFocus&&!e._showing&&e.show()}function We(e,t){const n=t.target;(e.picker.active||e.config.showOnClick)&&(n._active=U(n),n._clicking=setTimeout(()=>{delete n._active,delete n._clicking},2e3))}function Ue(e,t){const n=t.target;n._clicking&&(clearTimeout(n._clicking),delete n._clicking,n._active&&e.enterEditMode(),delete n._active,e.config.showOnClick&&e.show())}function ze(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function Ye(e,t){const{element:n,picker:i}=e;if(!i.active&&!U(n))return;const r=i.element;ee(t,e=>e===n||e===r)||$e(e)}function Ge(e,t){return e.map(e=>q(e,t.format,t.locale)).join(t.dateDelimiter)}function Ke(e,t,n=!1){if(0===t.length)return n?[]:void 0;const{config:i,dates:r,rangeSideIndex:o}=e,{pickLevel:s,maxNumberOfDates:a}=i;let l=t.reduce((e,t)=>{let n=R(t,i.format,i.locale);return void 0===n||(n=j(n,s,o),!f(n,i.minDate,i.maxDate)||e.includes(n)||i.checkDisabled(n,s)||!(s>0)&&i.daysOfWeekDisabled.includes(new Date(n).getDay())||e.push(n)),e},[]);return 0!==l.length?(i.multidate&&!n&&(l=l.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!l.includes(e)))),a&&l.length>a?l.slice(-1*a):l):void 0}function Ze(e,t=3,n=!0,i){const{config:r,picker:o,inputField:s}=e;if(2&t){const e=o.active?r.pickLevel:r.startView;o.update(i).changeView(e).render(n)}1&t&&s&&(s.value=Ge(e.dates,r))}function Je(e,t,n){const i=e.config;let{clear:r,render:o,autohide:s,revert:a,forceRefresh:l,viewDate:c}=n;void 0===o&&(o=!0),o?void 0===s&&(s=i.autohide):s=l=!1,c=R(c,i.format,i.locale);const u=Ke(e,t,r);(u||a)&&(u&&u.toString()!==e.dates.toString()?(e.dates=u,Ze(e,o?3:1,!0,c),ke(e,"changeDate")):Ze(e,l?3:1,!0,c),s&&e.hide())}function Qe(e,t){return t?n=>q(n,t,e.config.locale):e=>new Date(e)}class Xe{constructor(e,t={},n){e.datepicker=this,this.element=e,this.dates=[];const i=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:b(),maxDate:void 0,minDate:void 0},he(ne,this));let r;if("INPUT"===e.tagName?(r=this.inputField=e,r.classList.add("datepicker-input"),t.container&&(i.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container))):i.container=e,n){const e=n.inputs.indexOf(r),t=n.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,this.rangepicker=n,this.rangeSideIndex=e}this._options=t,Object.assign(i,he(t,this)),i.shortcutKeys=function(e){return Object.keys(pe).reduce((t,n)=>{const i=void 0===e[n]?pe[n]:e[n],r=i&&i.key;if(!r||"string"!=typeof r)return t;const o={key:r,ctrlOrMetaKey:!!(i.ctrlOrMetaKey||i.ctrlKey||i.metaKey)};return r.length>1&&(o.altKey=!!i.altKey,o.shiftKey=!!i.shiftKey),t[n]=o,t},{})}(t.shortcutKeys||{});const o=p(e.value||e.dataset.date,i.dateDelimiter);delete e.dataset.date;const s=Ke(this,o);s&&s.length>0&&(this.dates=s),r&&(r.value=Ge(this.dates,i));const a=this.picker=new Re(this),l=[e,"keydown",He.bind(null,this)];r?Q(this,[l,[r,"focus",Ve.bind(null,this)],[r,"mousedown",We.bind(null,this)],[r,"click",Ue.bind(null,this)],[r,"paste",ze.bind(null,this)],[document,"mousedown",Ye.bind(null,this)],[window,"resize",a.place.bind(a)]]):(Q(this,[l]),this.show())}static formatDate(e,t,n){return q(e,t,n&&te[n]||te.en)}static parseDate(e,t,n){return R(e,t,n&&te[n]||te.en)}static get locales(){return te}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=he(e,this);Object.assign(this._options,e),Object.assign(this.config,t),this.picker.setOptions(t),Ze(this,3)}show(){if(this.inputField){const{config:e,inputField:t}=this;if(t.disabled||t.readOnly&&!e.enableOnReadonly)return;U(t)||e.disableTouchKeyboard||(this._showing=!0,t.focus(),delete this._showing)}this.picker.show()}hide(){this.inputField&&(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}toggle(){this.picker.active?this.inputField&&this.picker.hide():this.show()}destroy(){this.hide(),X(this),this.picker.detach();const e=this.element;return e.classList.remove("datepicker-input"),delete e.datepicker,this}getDate(e){const t=Qe(this,e);return this.config.multidate?this.dates.map(t):this.dates.length>0?t(this.dates[0]):void 0}setDate(...e){const t=[...e],n={},i=d(e);!i||"object"!=typeof i||Array.isArray(i)||i instanceof Date||Object.assign(n,t.pop());Je(this,Array.isArray(t[0])?t[0]:t,n)}update(e){if(!this.inputField)return;const t=Object.assign(e||{},{clear:!0,render:!0,viewDate:void 0});Je(this,p(this.inputField.value,this.config.dateDelimiter),t)}getFocusedDate(e){return Qe(this,e)(this.picker.viewDate)}setFocusedDate(e,t=!1){const{config:n,picker:i,active:r,rangeSideIndex:o}=this,s=n.pickLevel,a=R(e,n.format,n.locale);void 0!==a&&(i.changeFocus(j(a,s,o)),r&&t&&i.changeView(s),i.render())}refresh(e,t=!1){let n;e&&"string"!=typeof e&&(t=e,e=void 0),n="picker"===e?2:"input"===e?1:3,Ze(this,n,!t)}enterEditMode(){const e=this.inputField;e&&!e.readOnly&&this.picker.active&&!this.editMode&&(this.editMode=!0,e.classList.add("in-edit"))}exitEditMode(e){if(!this.inputField||!this.editMode)return;const t=Object.assign({update:!1},e);delete this.editMode,this.inputField.classList.remove("in-edit"),t.update&&this.update(t)}}function et(e){return(et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==et(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==et(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===et(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.date={load:function(e,t){var n=r()(e).find(".cpt-date-section:first"),i=r()(n).children("input"),o="no"!==r()(i).data("max")&&r()(i).data("max"),s="no"!==r()(i).data("min")&&r()(i).data("min");new Xe(i[0],{autohide:!0,clearBtn:!0,maxDate:o,minDate:s,format:"dd/mm/yyyy"})}},e}));var nt=wp.i18n,it=nt.__;nt._x,nt._n,nt._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.file={load:function(e,t){new rt(e)}},e}));var rt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fileSection=r()(t).find(".cpt-file-section:first"),this.fileTypes=r()(this.fileSection).data("type"),this.fileInput=r()(this.fileSection).find("input"),this.filePreview=r()(this.fileSection).find("img"),this.fileActions=r()(this.fileSection).find(".cpt-file-actions"),this.fileName=r()(this.fileSection).find(".file-name"),this.addButton=r()(this.fileSection).find(".cpt-file-upload"),this.removeButton=r()(this.fileSection).find(".cpt-file-remove"),this.listenRemoveEvent(),this.listenAddEvent()}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(){var e=this;r()(this.addButton).on("click",(function(t){t.preventDefault();var n=wp.media({title:it("Add file","custom-post-types"),frame:"select",library:wp.media.query({type:e.fileTypes,uploadedTo:wp.media.view.settings.post.id}),button:{text:it("Choose file","custom-post-types")},multiple:!1}).on("select",(function(){var t=n.state().get("selection").first().toJSON(),i=!!(t.sizes&&t.sizes.thumbnail&&t.sizes.thumbnail.url)&&t.sizes.thumbnail.url;i&&(r()(e.filePreview).attr("src",i),r()(e.filePreview).show());var o=t.mime;o.startsWith("image")&&(o="image"),o.startsWith("audio")&&(o="audio"),o.startsWith("video")&&(o="video"),"-1"!=r.a.inArray(o,e.fileTypes)?(r()(e.fileName).html(t.url.split("/").reverse()[0]),r()(e.fileActions).attr("title",t.url.split("/").reverse()[0]),r()(e.fileInput).val(t.id),r()(e.removeButton).prop("disabled",!1)):e.resetField()})).open()}))}},{key:"listenRemoveEvent",value:function(){var e=this;r()(this.removeButton).on("click",(function(t){t.preventDefault(),e.resetField()}))}},{key:"resetField",value:function(){r()(this.fileName).html(""),r()(this.fileInput).val(""),r()(this.filePreview).removeAttr("src"),r()(this.filePreview).hide(),r()(this.removeButton).prop("disabled",!0),r()(this.fileActions).attr("title",it("Choose","custom-post-types"))}}])&&tt(t.prototype,n),i&&tt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();n(1),n(2);function ot(e){return(ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function st(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ot(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ot(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ot(o)?o:String(o)),i)}var r,o}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.post_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-post_rel-options",nonce:cpt.ajax_nonce,search:e.term,post_type:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e}));var at=wp.i18n;at.__,at._x,at._n,at._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.repeater={load:function(e,t){new lt(e)}},e}));var lt=function(){function e(t){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.repeaterSection=r()(t).find(".cpt-repeater-section:first"),this.parent=r()(this.repeaterSection).data("parent"),this.fields=r()(this.repeaterSection).data("fields"),this.initSortable();var i=r()(this.repeaterSection).parent().children(".cpt-repeater-add:first");i.length>0&&this.listenAddEvent(i);var o=r()(this.repeaterSection).find(".cpt-repeater-group");r.a.each(o,(function(e,t){n.initFieldGroup(t)}))}var t,n,i;return t=e,(n=[{key:"listenAddEvent",value:function(e){var t=this;r()(e).on("click",(function(n){n.preventDefault(),r()(e).prop("disabled",!0);var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(t.repeaterSection).append(i);var o=r()(t.repeaterSection).children(".cpt-repeater-group").length,s=[];s.push({name:"action",value:"cpt-get-repeater-group"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"fields",value:JSON.stringify(t.fields)}),s.push({name:"parent",value:t.parent+"["+o+"]"}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(n){if(n.success){r()(e).prop("disabled",!1),r()(i).remove();var o=r()(n.data);r()(t.repeaterSection).append(o),t.initFieldGroup(o)}else r()(e).prop("disabled",!1),r()(i).remove(),console.log("Error",n)}})}))}},{key:"initSortable",value:function(){var e=r()(this.repeaterSection).children(".cpt-repeater-group").children(".cpt-repeater-buttons").find(".move");r()(e).on("click",(function(e){e.preventDefault()})),r()(this.repeaterSection).sortable({handle:".move",cancel:"",cursor:"grab",axis:"y",delay:150,dropOnEmpty:!1,opacity:.5,revert:!0})}},{key:"initFieldGroup",value:function(e){var t=r()(e).find(".cpt-repeater-fields:first").children(".cpt-field"),n=r()(e).find(".cpt-repeater-fields:first .cpt-repeater-extra").children(".cpt-field");r.a.each(r.a.merge(t,n),(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")})),this.listenRemoveEvent(e),this.autofillKeyInput(e),this.listenSwitchFieldTypeEvent(e)}},{key:"listenRemoveEvent",value:function(e){var t=r()(e).find(".remove:first"),n=r()(t).closest(".cpt-repeater-group").children(".cpt-repeater-remove");r()(t).on("click",(function(e){e.preventDefault(),r()(n).addClass("active")})),r()(n).find(".abort:first").on("click",(function(e){e.preventDefault(),r()(n).removeClass("active")})),r()(n).find(".confirm:first").on("click",(function(t){t.preventDefault(),r()(e).remove()}))}},{key:"autofillKeyInput",value:function(e){var t=r()(e).find('input[id$="-label"]:first'),n=r()(e).find('input[id$="-key"]:first');window.cptUtils.autoFillKey(n,t)}},{key:"listenSwitchFieldTypeEvent",value:function(e){var t=r()(e).find(".cpt-repeater-field-type:first").find("select"),n=r()(e).find(".cpt-repeater-extra:first");r()(t).on("select2:select",(function(e){r()(n).empty();var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(n).append(i);var o=!!r()(t).val().length&&r()(t).val();if(o){var s=r()(t).attr("name").replace("meta-fields","").replace("[type]",""),a=[];a.push({name:"action",value:"cpt-get-repeater-extra-fields"}),a.push({name:"nonce",value:cpt.ajax_nonce}),a.push({name:"field-type",value:o}),a.push({name:"parent",value:s}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:a,success:function(e){if(e.success){r()(i).remove();var t=r()(e.data);r()(n).append(t),r()(n).children(".cpt-field"),r.a.each(t,(function(e,t){var n=r()(t).data("field-type");window.cptUtils.appendFieldEvents(n,t),r()(t).trigger("load")}))}else r()(i).remove(),console.log("Error",e)}})}else r()(i).remove()}))}}])&&st(t.prototype,n),i&&st(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ct(e){return(ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ut(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,ht(i.key),i)}}function dt(e,t,n){return(t=ht(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ht(e){var t=function(e,t){if("object"!==ct(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ct(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===ct(t)?t:String(t)}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.select={load:function(e,t){window.cptUtils.disableProFieldSelectOptions(e);var n=r()(e).find("select:first"),i={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};r()(n).select2(i)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tax_rel={load:function(e,t){var n=r()(e).find("select:first"),i=r()(n).data("type"),o={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(o.ajax={url:cpt.ajax_url,data:function(e){return{action:"cpt-get-tax_rel-options",nonce:cpt.ajax_nonce,search:e.term,taxonomy:i}},processResults:function(e){return{results:e.data}}}),r()(n).select2(o)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.text={load:function(e,t){}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.time={load:function(e,t){for(var n=r()(e).find(".cpt-time-section:first"),i=r()(n).children("select"),o=r()(i).data("value")?r()(i).data("value"):"",s="no"!==r()(i).data("max")&&r()(i).data("max"),a="no"!==r()(i).data("min")&&r()(i).data("min"),l=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"00:00",i=0;if(!n)return i;var r=!!n.split(":")&&n.split(":"),o=null!==(e=r[0])&&void 0!==e&&e,s=null!==(t=r[1])&&void 0!==t&&t,a=Number(o+s);return Number.isInteger(a)?a:i},c=l(s),u=l(a),d=0;d<=23;d++){d=d<10?"0"+d:d;for(var h=0;h<=59;h++){var p=d+":"+(h=h<10?"0"+h:h);(u>0&&l(p)<u||c>0&&l(p)>c)&&c>u||r()(i).append(r()('<option value="'+p+'"'+(o==p?' selected="selected"':"")+">"+p+"</option>"))}}var f={placeholder:r()(i).attr("placeholder")?r()(selectEl).attr("placeholder"):" ... ",allowClear:!0,multiple:!1};r()(i).select2(f)}},e})),wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.tinymce={load:function(e,t){new pt(e)}},e}));var pt=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),dt(this,"editorEl",void 0),dt(this,"editorId",void 0),dt(this,"editorForm",void 0),dt(this,"defaultArgs",{tinymce:{wpautop:!1,plugins:"charmap colorpicker hr lists paste tabfocus textcolor fullscreen wordpress wpautoresize wpeditimage wpemoji wpgallery wplink wptextpattern",toolbar1:"formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,wp_more,spellchecker,fullscreen,wp_adv,listbuttons",toolbar2:"styleselect,strikethrough,hr,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",textarea_rows:20,wp_autoresize_on:!1,autoresize_min_height:50},quicktags:{buttons:"strong,em,link,block,del,ins,img,ul,ol,li,code,more,close"},mediaButtons:!0}),this.editorEl=r()(t).find("textarea:first"),this.editorId=r()(this.editorEl).attr("id"),this.defaultArgs.tinymce.wp_autoresize_on=r()(this.editorEl).is("[autoresize]"),this.editorForm=r()(t).closest("form"),this.startEditor()}var t,n,i;return t=e,(n=[{key:"startEditor",value:function(){var e=this,t=!1,n=setInterval((function(){!r()("#post-title-0")&&r()("body").hasClass("block-editor-page")||(t=!0,e.removeEditor(),e.initializeEditor(),e.listenSubmitEvent(),e.listenSortableEvent()),t&&clearInterval(n)}),500)}},{key:"initializeEditor",value:function(){wp.oldEditor.initialize(this.editorId,this.defaultArgs)}},{key:"removeEditor",value:function(){wp.oldEditor.remove(this.editorId)}},{key:"listenSubmitEvent",value:function(){var e=tinyMCE.editors[this.editorId];r()(this.editorForm).on("submit",(function(t){e.save()})),e.on("blur",(function(t){e.save()})),r()(document).ajaxComplete((function(t,n,i){i.data&&i.data.match(/action=add-tag/)&&(e.setContent(""),e.save())}))}},{key:"listenSortableEvent",value:function(){var e=this,t=r()(this.editorEl).closest(".ui-sortable");r()(t).on("sortstart",(function(){e.removeEditor()})),r()(t).on("sortstop",(function(){e.initializeEditor()}))}}])&&ut(t.prototype,n),i&&ut(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ft(e){return(ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function gt(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,(r=i.key,o=void 0,o=function(e,t){if("object"!==ft(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!==ft(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(r,"string"),"symbol"===ft(o)?o:String(o)),i)}var r,o}var mt=wp.i18n,vt=mt.__;mt._x,mt._n,mt._nx;new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.body=r()("body"),this.window=r()(window),this.utils=new u,this.loadFields(),this.loadUiFeatures()}var t,n,i;return t=e,(n=[{key:"loadUiFeatures",value:function(){var e=this;this.body.on("click",".cpt-field-wrap.advanced-field-btn .button",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-fields-section"),i=r()(n).find(".cpt-field-wrap.advanced-field");r()(t).hasClass("button-secondary")?(r()(i).removeClass("active"),r()(t).removeClass("button-secondary").addClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-insert"),r()(t).find(".label").html(vt("Advanced view","custom-post-types"))):(r()(i).addClass("active"),r()(t).addClass("button-secondary").removeClass("button-primary"),r()(t).find(".dashicons").attr("class","dashicons dashicons-remove"),r()(t).find(".label").html(vt("Simple view","custom-post-types")))})),this.window.on("load",(function(){if(e.body.hasClass("block-editor-page")){var t=r()('.cpt-fields-section *[id^="meta-fields-"][required]');t.length<=0||setInterval((function(){!function(e){var t=!0;r.a.each(e,(function(e,n){var i=r()(n).val().length>0;t=!!t&&i}));var n=r()(".edit-post-header__settings button.editor-post-publish-button__button");t?(r()(n).removeAttr("disabled"),r()(n).attr("aria-disabled","false")):(r()(n).attr("disabled","disabled"),r()(n).attr("aria-disabled","true"))}(t)}),200)}})),this.body.on("click",".cpt-notice.is-dismissible a.cpt-dismiss-notice",(function(e){e.preventDefault();var t=e.currentTarget,n=r()(t).closest(".cpt-notice").find("button.notice-dismiss"),i=r()(t).data("notice"),o=r()(t).data("duration"),s=[];s.push({name:"action",value:"cpt-dismiss-notice"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"key",value:i}),s.push({name:"duration",value:o}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?n.click():console.log("Error",e)}})})),this.body.on("click",".cpt-notice pre.error-code > a",(function(e){e.preventDefault();var t=e.currentTarget;r()(t).closest(".error-code").find("code").addClass("show"),r()(t).remove()}));var t=r()('div[data-id="manage_cpt"].cpt-fields-section, div[data-id="manage_cpt_tax"].cpt-fields-section');r.a.each(t,(function(t,n){var i=r()(n).find('input[id$="-plural"]:first'),o=r()(n).find('input[id$="-id"]:first');e.utils.autoFillKey(o,i)}))}},{key:"loadFields",value:function(){var e=this;this.$fieldGroups=r()(".cpt-fields-section"),this.$fieldGroups&&(this.fieldsEvents=wp.hooks.applyFilters(cpt.js_fields_events_hook,[]),r.a.each(this.$fieldGroups,(function(t,n){var i=r()(n).children(".cpt-field");i&&r.a.each(i,(function(t,n){var i=r()(n).data("field-type");e.utils.appendFieldEvents(i,n),r()(n).trigger("load")}))})))}}])&>(t.prototype,n),i&>(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}())}]); -
custom-post-types/trunk/includes/classes/Core.php
r2955028 r2955361 139 139 /** 140 140 * @return void 141 * 142 * @see \CustomPostTypes\includes\classes\Utils::getUiPostTypesArgs 141 143 */ 142 144 private function registerUiPostTypes() 143 145 { 144 // CustomPostTypes\includes\classes\Utils::getUiPostTypesArgs145 146 146 // Remove quick edit links 147 147 add_filter('post_row_actions', function ($actions, $post) { … … 233 233 /** 234 234 * @return void 235 * 236 * @see \CustomPostTypes\includes\classes\Utils::getUiAdminPagesArgs 235 237 */ 236 238 private function registerUiPages() 237 239 { 238 // CustomPostTypes\includes\classes\Utils::getUiAdminPagesArgs239 240 240 // Remove new post type menu 241 241 add_action('admin_menu', function () { -
custom-post-types/trunk/includes/classes/Utils.php
r2955028 r2955361 587 587 'menu_position' => null, 588 588 'supports' => [''], 589 'menu_icon' => 'da shicons-index-card',589 'menu_icon' => 'data:image/svg+xml;base64,' . base64_encode(file_get_contents(Utils::getInfo('path') . 'assets/dashboard-icon.svg')), 590 590 'can_export' => false, 591 591 ];
Note: See TracChangeset
for help on using the changeset viewer.