Changeset 2922197
- Timestamp:
- 06/06/2023 09:19:58 AM (3 years ago)
- Location:
- custom-post-types
- Files:
-
- 43 added
- 9 edited
-
tags/4.0.3 (added)
-
tags/4.0.3/assets (added)
-
tags/4.0.3/assets/css (added)
-
tags/4.0.3/assets/css/backend.css (added)
-
tags/4.0.3/assets/icon-256x256.png (added)
-
tags/4.0.3/assets/icon.svg (added)
-
tags/4.0.3/assets/js (added)
-
tags/4.0.3/assets/js/backend.js (added)
-
tags/4.0.3/custom-post-types.php (added)
-
tags/4.0.3/includes (added)
-
tags/4.0.3/includes/Api.php (added)
-
tags/4.0.3/includes/Component.php (added)
-
tags/4.0.3/includes/Fields.php (added)
-
tags/4.0.3/includes/Notices.php (added)
-
tags/4.0.3/includes/Pages.php (added)
-
tags/4.0.3/includes/PostTypes.php (added)
-
tags/4.0.3/includes/Taxonomies.php (added)
-
tags/4.0.3/includes/Templates.php (added)
-
tags/4.0.3/includes/index.php (added)
-
tags/4.0.3/index.php (added)
-
tags/4.0.3/parts (added)
-
tags/4.0.3/parts/fields (added)
-
tags/4.0.3/parts/fields/checkbox.php (added)
-
tags/4.0.3/parts/fields/color.php (added)
-
tags/4.0.3/parts/fields/date.php (added)
-
tags/4.0.3/parts/fields/email.php (added)
-
tags/4.0.3/parts/fields/file.php (added)
-
tags/4.0.3/parts/fields/html.php (added)
-
tags/4.0.3/parts/fields/number.php (added)
-
tags/4.0.3/parts/fields/post_rel.php (added)
-
tags/4.0.3/parts/fields/radio.php (added)
-
tags/4.0.3/parts/fields/repeater.php (added)
-
tags/4.0.3/parts/fields/select.php (added)
-
tags/4.0.3/parts/fields/tax_rel.php (added)
-
tags/4.0.3/parts/fields/tel.php (added)
-
tags/4.0.3/parts/fields/text.php (added)
-
tags/4.0.3/parts/fields/textarea.php (added)
-
tags/4.0.3/parts/fields/time.php (added)
-
tags/4.0.3/parts/fields/tinymce.php (added)
-
tags/4.0.3/parts/pages (added)
-
tags/4.0.3/parts/pages/tools.php (added)
-
tags/4.0.3/readme.txt (added)
-
trunk/assets/css/backend.css (modified) (1 diff)
-
trunk/assets/js/backend.js (modified) (1 diff)
-
trunk/custom-post-types.php (modified) (2 diffs)
-
trunk/includes/Api.php (added)
-
trunk/includes/Component.php (modified) (1 diff)
-
trunk/includes/Fields.php (modified) (1 diff)
-
trunk/includes/Pages.php (modified) (2 diffs)
-
trunk/includes/PostTypes.php (modified) (2 diffs)
-
trunk/includes/Taxonomies.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
custom-post-types/trunk/assets/css/backend.css
r2915886 r2922197 1 .cpt-fields-section:not([data-template]),.cpt-field .cpt-repeater-fields:not([data-template]),.cpt-fields-section[data-template=post-type-form],.cpt-field [data-template=post-type-form].cpt-repeater-fields{margin-bottom:1em;background:#e0e0e0;display:flex;flex-flow:row wrap}.inside .cpt-fields-section:not([data-template]),.inside .cpt-field .cpt-repeater-fields:not([data-template]),.cpt-field .inside .cpt-repeater-fields:not([data-template]),.inside .cpt-fields-section[data-template=post-type-form],.inside .cpt-field [data-template=post-type-form].cpt-repeater-fields,.cpt-field .inside [data-template=post-type-form].cpt-repeater-fields{margin:-6px -12px -12px}.cpt-field{width:100%}.cpt-field .cpt-color-section{align-items:center;display:flex;flex-flow:row nowrap;max-width:150px;width:100%}.cpt-field .cpt-color-section .preview{background-color:#f0f1f2;box-shadow:0 1px 3px rgba(0,0,0,.4);border-radius:100%;cursor:pointer;flex:0 0 22px;height:22px;margin-right:10px}.cpt-field .cpt-file-section{position:relative}.cpt-field .cpt-file-section input{bottom:0;opacity:0;position:absolute;pointer-events:none;max-width:148px}.cpt-field .cpt-file-wrap{height:150px;position:relative;width:150px}.cpt-field .cpt-file-wrap:hover .cpt-file-actions{z-index:3}.cpt-field .cpt-file-preview{background-color:#f5f5f5;height:100%;width:100%;position:absolute}.cpt-field .cpt-file-preview img{position:relative;z-index:2;background-color:#fff}.cpt-field .cpt-file-actions{align-items:center;background-color:rgba(245,245,245,.7);border:1px dashed #d5d8da;display:flex;flex-flow:column wrap;height:calc(100% - 22px);justify-content:flex-end;padding:10px;position:relative;transition:opacity .2s;width:calc(100% - 22px);z-index:1}.cpt-field .cpt-file-actions .file-name{font-size:smaller;padding-bottom:10px;overflow:hidden;text-overflow:ellipsis;width:100%;white-space:nowrap}.cpt-field .cpt-file-actions .buttons .button{z-index:2;line-height:0}.cpt-field .cpt-repeater-section{counter-reset:seq}.cpt-field .cpt-repeater-group{display:flex;flex-flow:row nowrap;position:relative;width:100%}.cpt-field .cpt-repeater-group .buttons{background-color:#e0e0e0;border:1px solid #fff;border-left:0;border-right:0;display:flex;flex-flow:column wrap}.cpt-field .cpt-repeater-group .buttons .order{align-items:center;display:flex;margin:8px auto}.cpt-field .cpt-repeater-group .buttons .order:before{background:#fff;border-radius:4px;color:#444;counter-increment:seq;content:counter(seq);font-size:10px;font-weight:bold;line-height:18px;padding:0 6px}.cpt-field .cpt-repeater-group .buttons .move{color:#444;cursor:grab}.cpt-field .cpt-repeater-group .buttons .remove{color:#dc3232}.cpt-field .cpt-repeater-group .buttons .button{line-height:0;border:0;padding:8px;background:rgba(0,0,0,0)}.cpt-field .cpt-repeater-group .buttons .button:focus{box-shadow:unset}.cpt-field .cpt-repeater-group .buttons .button:hover{background:#fff}.cpt-field .cpt-repeater-group:first-child>.buttons{border-top:0}.cpt-field .cpt-repeater-group:last-child>.buttons{border-bottom:0}.cpt-field .cpt-repeater-fields{margin:0 !important;width:100%}.cpt-field .cpt-repeater-extra{display:flex;flex-flow:row wrap;width:100%}.cpt-field .cpt-repeater-remove{background:rgba(224,224,224,.9);position:absolute;z-index:2;display:flex;flex-flow:row wrap;justify-content:center;align-items:center;height:100%;width:100%;gap:20px;opacity:0;pointer-events:none;transition:opacity .3s ease}.cpt-field .cpt-repeater-remove.active{opacity:1;pointer-events:inherit}.cpt-field .cpt-repeater-add{margin:10px 0 0;background:unset;border:0;color:#0071a1;cursor:pointer;height:30px;width:34px;padding:0}.cpt-field .cpt-repeater-add:focus{box-shadow:unset;outline:none}.cpt-field .cpt-repeater-add .dashicons{font-size:30px;height:auto;width:auto}.cpt-field .cpt-repeater-add:disabled{display:none}.cpt-field .cpt-repeater-spinner{align-items:center;display:flex;height:40px;justify-content:center;width:100%}.cpt-field .cpt-repeater-spinner .spinner{background-position:center;height:20px;margin:0;visibility:visible;width:20px}.cpt-field .select2-container .select2-selection{min-height:40px !important}@media screen and (min-width: 783px){.cpt-field .select2-container .select2-selection{min-height:30px !important}}.cpt-field .select2-container .select2-search--inline .select2-search__field{vertical-align:top !important}.cpt-field .select2-selection__arrow{height:37px !important}@media screen and (min-width: 783px){.cpt-field .select2-selection__arrow{height:29px !important}}.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__choice{margin-bottom:0 !important;margin-top:4px !important;line-height:27px}@media screen and (min-width: 783px){.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__choice{line-height:18px}}.cpt-field .select2-selection__choice__remove{line-height:27px}@media screen and (min-width: 783px){.cpt-field .select2-selection__choice__remove{line-height:18px}}.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__clear{height:34px !important;margin-top:0 !important}@media screen and (min-width: 783px){.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__clear{height:26px !important}}.cpt-field .select2-selection__rendered:not(ul){line-height:38px !important}@media screen and (min-width: 783px){.cpt-field .select2-selection__rendered:not(ul){line-height:28px !important}}.cpt-field-tinymce textarea{display:inline-block !important}.cpt-field-tinymce textarea[aria-hidden=true]{opacity:0;pointer-events:none;position:absolute;bottom:0;left:0}@media screen and (max-width: 782px){.cpt-field{width:100% !important}}.cpt-field-required label[for]:after{content:"*";margin-left:4px;font-weight:bold}.cpt-field-inner{margin:1px}.cpt-field-wrap{background:#fff;display:flex;flex-flow:column wrap;padding:10px 15px;transition:background .1s ease-in-out}.cpt-field-wrap:hover{background:#fcfcfd}.cpt-field-wrap label{margin-bottom:3px}.cpt-field-wrap.advanced-field{height:0;overflow:hidden;pointer-events:none;padding:0;margin:-1px 0}.cpt-field-wrap.advanced-field.active{height:auto;overflow:auto;pointer-events:auto;padding:10px 15px;margin:unset}.cpt-field-wrap.advanced-field-btn .button{align-items:center;display:flex;justify-content:center;min-height:35px;text-align:center;width:100%}.cpt-field-wrap.advanced-field-btn .button .dashicons{margin-right:10px}.cpt-field-wrap .input input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]),.cpt-field-wrap .input select,.cpt-field-wrap .input textarea{width:100%}.cpt-field-wrap .input textarea:not([class^=select2]){height:100px}.cpt-field-wrap .input .template-shortcode{margin:15px 0 0}.cpt-field-wrap .input .template-shortcode input{border:0;background:rgba(0,0,0,0);cursor:copy;margin:0}.cpt-field-wrap .input .template-shortcode input:not(:last-child){margin:0 0 10px}.cpt-field-wrap .description{margin-top:3px}.cpt-field-wrap .description p{font-size:smaller;opacity:.7;margin:0;padding:0}@media screen and (min-width: 783px){.cpt-field-wrap.horizontal{flex-flow:row wrap}.cpt-field-wrap.horizontal label{display:flex;justify-content:end;text-align:right;width:15%;padding-right:13px;margin:0}.cpt-field-wrap.horizontal .input{flex:1}.cpt-field-wrap.horizontal .description{width:35%;padding-left:13px;margin:0}}.cpt-notice .notice-title{display:block}.cpt-notice .message{margin:.5em 0;padding:2px}.cpt-notice .message p:first-child{margin-top:0;padding-top:0}.cpt-notice .message p:last-child{margin-bottom:0;padding-bottom:0}.cpt-notice .actions{margin-top:1em;padding-top:.5em;border-top:1px solid #d5d8da}.cpt-notice .actions .dashicons{font-size:110%;text-decoration:none;vertical-align:middle}.cpt-notice .actions a:not(:last-child){margin-right:20px}.cpt-notice .cpt-dismiss-notice{color:#b32d2e}.cpt- pro-banner{border:5px dashed #ffb900;display:inline-block;margin:20px 0;max-width:300px;padding:0 1em;text-align:center;width:100%}.cpt-row{display:flex;flex-flow:row wrap;margin-left:-15px;margin-right:-15px}.cpt-col-3{padding:0 15px;width:calc(100% - 30px)}@media screen and (min-width: 783px){.cpt-col-3{width:calc(33.3333333333% - 30px)}}1 .cpt-fields-section:not([data-template]),.cpt-field .cpt-repeater-fields:not([data-template]),.cpt-fields-section[data-template=post-type-form],.cpt-field [data-template=post-type-form].cpt-repeater-fields{margin-bottom:1em;background:#e0e0e0;display:flex;flex-flow:row wrap}.inside .cpt-fields-section:not([data-template]),.inside .cpt-field .cpt-repeater-fields:not([data-template]),.cpt-field .inside .cpt-repeater-fields:not([data-template]),.inside .cpt-fields-section[data-template=post-type-form],.inside .cpt-field [data-template=post-type-form].cpt-repeater-fields,.cpt-field .inside [data-template=post-type-form].cpt-repeater-fields{margin:-6px -12px -12px}.cpt-field{width:100%}.cpt-field .cpt-color-section{align-items:center;display:flex;flex-flow:row nowrap;max-width:150px;width:100%}.cpt-field .cpt-color-section .preview{background-color:#f0f1f2;box-shadow:0 1px 3px rgba(0,0,0,.4);border-radius:100%;cursor:pointer;flex:0 0 22px;height:22px;margin-right:10px}.cpt-field .cpt-file-section{position:relative}.cpt-field .cpt-file-section input{bottom:0;opacity:0;position:absolute;pointer-events:none;max-width:148px}.cpt-field .cpt-file-wrap{height:150px;position:relative;width:150px}.cpt-field .cpt-file-wrap:hover .cpt-file-actions{z-index:3}.cpt-field .cpt-file-preview{background-color:#f5f5f5;height:100%;width:100%;position:absolute}.cpt-field .cpt-file-preview img{position:relative;z-index:2;background-color:#fff}.cpt-field .cpt-file-actions{align-items:center;background-color:rgba(245,245,245,.7);border:1px dashed #d5d8da;display:flex;flex-flow:column wrap;height:calc(100% - 22px);justify-content:flex-end;padding:10px;position:relative;transition:opacity .2s;width:calc(100% - 22px);z-index:1}.cpt-field .cpt-file-actions .file-name{font-size:smaller;padding-bottom:10px;overflow:hidden;text-overflow:ellipsis;width:100%;white-space:nowrap}.cpt-field .cpt-file-actions .buttons .button{z-index:2;line-height:0}.cpt-field .cpt-repeater-section{counter-reset:seq}.cpt-field .cpt-repeater-group{display:flex;flex-flow:row nowrap;position:relative;width:100%}.cpt-field .cpt-repeater-group .buttons{background-color:#e0e0e0;border:1px solid #fff;border-left:0;border-right:0;display:flex;flex-flow:column wrap}.cpt-field .cpt-repeater-group .buttons .order{align-items:center;display:flex;margin:8px auto}.cpt-field .cpt-repeater-group .buttons .order:before{background:#fff;border-radius:4px;color:#444;counter-increment:seq;content:counter(seq);font-size:10px;font-weight:bold;line-height:18px;padding:0 6px}.cpt-field .cpt-repeater-group .buttons .move{color:#444;cursor:grab}.cpt-field .cpt-repeater-group .buttons .remove{color:#dc3232}.cpt-field .cpt-repeater-group .buttons .button{line-height:0;border:0;padding:8px;background:rgba(0,0,0,0)}.cpt-field .cpt-repeater-group .buttons .button:focus{box-shadow:unset}.cpt-field .cpt-repeater-group .buttons .button:hover{background:#fff}.cpt-field .cpt-repeater-group:first-child>.buttons{border-top:0}.cpt-field .cpt-repeater-group:last-child>.buttons{border-bottom:0}.cpt-field .cpt-repeater-fields{margin:0 !important;width:100%}.cpt-field .cpt-repeater-extra{display:flex;flex-flow:row wrap;width:100%}.cpt-field .cpt-repeater-remove{background:rgba(224,224,224,.9);position:absolute;z-index:2;display:flex;flex-flow:row wrap;justify-content:center;align-items:center;height:100%;width:100%;gap:20px;opacity:0;pointer-events:none;transition:opacity .3s ease}.cpt-field .cpt-repeater-remove.active{opacity:1;pointer-events:inherit}.cpt-field .cpt-repeater-add{margin:10px 0 0;background:unset;border:0;color:#0071a1;cursor:pointer;height:30px;width:34px;padding:0}.cpt-field .cpt-repeater-add:focus{box-shadow:unset;outline:none}.cpt-field .cpt-repeater-add .dashicons{font-size:30px;height:auto;width:auto}.cpt-field .cpt-repeater-add:disabled{display:none}.cpt-field .cpt-repeater-spinner{align-items:center;display:flex;height:40px;justify-content:center;width:100%}.cpt-field .cpt-repeater-spinner .spinner{background-position:center;height:20px;margin:0;visibility:visible;width:20px}.cpt-field .select2-container .select2-selection{min-height:40px !important}@media screen and (min-width: 783px){.cpt-field .select2-container .select2-selection{min-height:30px !important}}.cpt-field .select2-container .select2-search--inline .select2-search__field{vertical-align:top !important}.cpt-field .select2-selection__arrow{height:37px !important}@media screen and (min-width: 783px){.cpt-field .select2-selection__arrow{height:29px !important}}.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__choice{margin-bottom:0 !important;margin-top:4px !important;line-height:27px}@media screen and (min-width: 783px){.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__choice{line-height:18px}}.cpt-field .select2-selection__choice__remove{line-height:27px}@media screen and (min-width: 783px){.cpt-field .select2-selection__choice__remove{line-height:18px}}.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__clear{height:34px !important;margin-top:0 !important}@media screen and (min-width: 783px){.cpt-field .select2-container--default .select2-selection--multiple .select2-selection__clear{height:26px !important}}.cpt-field .select2-selection__rendered:not(ul){line-height:38px !important}@media screen and (min-width: 783px){.cpt-field .select2-selection__rendered:not(ul){line-height:28px !important}}.cpt-field-tinymce textarea{display:inline-block !important}.cpt-field-tinymce textarea[aria-hidden=true]{opacity:0;pointer-events:none;position:absolute;bottom:0;left:0}@media screen and (max-width: 782px){.cpt-field{width:100% !important}}.cpt-field-required label[for]:after{content:"*";margin-left:4px;font-weight:bold}.cpt-field-inner{margin:1px}.cpt-field-wrap{background:#fff;display:flex;flex-flow:column wrap;padding:10px 15px;transition:background .1s ease-in-out}.cpt-field-wrap:hover{background:#fcfcfd}.cpt-field-wrap label{margin-bottom:3px}.cpt-field-wrap.advanced-field{height:0;overflow:hidden;pointer-events:none;padding:0;margin:-1px 0}.cpt-field-wrap.advanced-field.active{height:auto;overflow:auto;pointer-events:auto;padding:10px 15px;margin:unset}.cpt-field-wrap.advanced-field-btn .button{align-items:center;display:flex;justify-content:center;min-height:35px;text-align:center;width:100%}.cpt-field-wrap.advanced-field-btn .button .dashicons{margin-right:10px}.cpt-field-wrap .input input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]),.cpt-field-wrap .input select,.cpt-field-wrap .input textarea{width:100%}.cpt-field-wrap .input textarea:not([class^=select2]){height:100px}.cpt-field-wrap .input .template-shortcode{margin:15px 0 0}.cpt-field-wrap .input .template-shortcode input{border:0;background:rgba(0,0,0,0);cursor:copy;margin:0}.cpt-field-wrap .input .template-shortcode input:not(:last-child){margin:0 0 10px}.cpt-field-wrap .description{margin-top:3px}.cpt-field-wrap .description p{font-size:smaller;opacity:.7;margin:0;padding:0}@media screen and (min-width: 783px){.cpt-field-wrap.horizontal{flex-flow:row wrap}.cpt-field-wrap.horizontal label{display:flex;justify-content:end;text-align:right;width:15%;padding-right:13px;margin:0}.cpt-field-wrap.horizontal .input{flex:1}.cpt-field-wrap.horizontal .description{width:35%;padding-left:13px;margin:0}}.cpt-notice .notice-title{display:block}.cpt-notice .message{margin:.5em 0;padding:2px}.cpt-notice .message p:first-child{margin-top:0;padding-top:0}.cpt-notice .message p:last-child{margin-bottom:0;padding-bottom:0}.cpt-notice .actions{margin-top:1em;padding-top:.5em;border-top:1px solid #d5d8da}.cpt-notice .actions .dashicons{font-size:110%;text-decoration:none;vertical-align:middle}.cpt-notice .actions a:not(:last-child){margin-right:20px}.cpt-notice .cpt-dismiss-notice{color:#b32d2e}.cpt-notice pre.error-code{margin:.5em 0 0}.cpt-notice pre.error-code code{padding:5px;display:none}.cpt-notice pre.error-code code.show{display:block}.cpt-pro-banner{border:5px dashed #ffb900;display:inline-block;margin:20px 0;max-width:300px;padding:0 1em;text-align:center;width:100%}.cpt-row{display:flex;flex-flow:row wrap;margin-left:-15px;margin-right:-15px}.cpt-col-3{padding:0 15px;width:calc(100% - 30px)}@media screen and (min-width: 783px){.cpt-col-3{width:calc(33.3333333333% - 30px)}} 2 2 .datepicker{display:none}.datepicker.active{display:block}.datepicker-dropdown{position:absolute;top:0;left:0;z-index:20;padding-top:4px}.datepicker-dropdown.datepicker-orient-top{padding-top:0;padding-bottom:4px}.datepicker-picker{display:inline-block;border-radius:4px;background-color:#fff}.datepicker-dropdown .datepicker-picker{box-shadow:0 2px 3px rgba(10,10,10,.1),0 0 0 1px rgba(10,10,10,.1)}.datepicker-picker span{display:block;flex:1;border:0;border-radius:4px;cursor:default;text-align:center;-webkit-touch-callout:none;user-select:none}.datepicker-main{padding:2px}.datepicker-footer{box-shadow:inset 0 1px 1px rgba(10,10,10,.1);background-color:#f5f5f5}.datepicker-grid,.datepicker-view .days-of-week,.datepicker-view,.datepicker-controls{display:flex}.datepicker-grid{flex-wrap:wrap}.datepicker-view .days .datepicker-cell,.datepicker-view .dow{flex-basis:14.2857142857%}.datepicker-view.datepicker-grid .datepicker-cell{flex-basis:25%}.datepicker-cell,.datepicker-view .week{height:2.25rem;line-height:2.25rem}.datepicker-title{box-shadow:inset 0 -1px 1px rgba(10,10,10,.1);background-color:#f5f5f5;padding:.375rem .75rem;text-align:center;font-weight:700}.datepicker-header .datepicker-controls{padding:2px 2px 0}.datepicker-controls .button{display:inline-flex;position:relative;align-items:center;justify-content:center;margin:0;border:1px solid #dbdbdb;border-radius:4px;box-shadow:none;background-color:#fff;cursor:pointer;padding:calc(0.375em - 1px) .75em;height:2.25em;vertical-align:top;text-align:center;line-height:1.5;white-space:nowrap;color:#363636;font-size:1rem}.datepicker-controls .button:focus,.datepicker-controls .button:active{outline:none}.datepicker-controls .button:hover{border-color:#b5b5b5;color:#363636}.datepicker-controls .button:focus{border-color:#3273dc;color:#363636}.datepicker-controls .button:focus:not(:active){box-shadow:0 0 0 .125em rgba(50,115,220,.25)}.datepicker-controls .button:active{border-color:#4a4a4a;color:#363636}.datepicker-controls .button[disabled]{cursor:not-allowed}.datepicker-header .datepicker-controls .button{border-color:rgba(0,0,0,0);font-weight:bold}.datepicker-header .datepicker-controls .button:hover{background-color:#f9f9f9}.datepicker-header .datepicker-controls .button:focus:not(:active){box-shadow:0 0 0 .125em rgba(255,255,255,.25)}.datepicker-header .datepicker-controls .button:active{background-color:#f2f2f2}.datepicker-header .datepicker-controls .button[disabled]{box-shadow:none}.datepicker-footer .datepicker-controls .button{margin:calc(.375rem - 1px) .375rem;border-radius:2px;width:100%;font-size:.75rem}.datepicker-controls .view-switch{flex:auto}.datepicker-controls .prev-btn,.datepicker-controls .next-btn{padding-right:.375rem;padding-left:.375rem;width:2.25rem}.datepicker-controls .prev-btn.disabled,.datepicker-controls .next-btn.disabled{visibility:hidden}.datepicker-view .dow{height:1.5rem;line-height:1.5rem;font-size:.875rem;font-weight:700}.datepicker-view .week{width:2.25rem;color:#b5b5b5;font-size:.75rem}@media(max-width: 22.5rem){.datepicker-view .week{width:1.96875rem}}.datepicker-grid{width:15.75rem}@media(max-width: 22.5rem){.calendar-weeks+.days .datepicker-grid{width:13.78125rem}}.datepicker-cell:not(.disabled):hover{background-color:#f9f9f9;cursor:pointer}.datepicker-cell.focused:not(.selected){background-color:#e8e8e8}.datepicker-cell.selected,.datepicker-cell.selected:hover{background-color:#3273dc;color:#fff;font-weight:600}.datepicker-cell.disabled{color:#dbdbdb}.datepicker-cell.prev:not(.disabled),.datepicker-cell.next:not(.disabled){color:#7a7a7a}.datepicker-cell.prev.selected,.datepicker-cell.next.selected{color:#e6e6e6}.datepicker-cell.highlighted:not(.selected):not(.range):not(.today){border-radius:0;background-color:#f5f5f5}.datepicker-cell.highlighted:not(.selected):not(.range):not(.today):not(.disabled):hover{background-color:#eee}.datepicker-cell.highlighted:not(.selected):not(.range):not(.today).focused{background-color:#e8e8e8}.datepicker-cell.today:not(.selected){background-color:#00d1b2}.datepicker-cell.today:not(.selected):not(.disabled){color:#fff}.datepicker-cell.today.focused:not(.selected){background-color:#00c4a7}.datepicker-cell.range-end:not(.selected),.datepicker-cell.range-start:not(.selected){background-color:#b5b5b5;color:#fff}.datepicker-cell.range-end.focused:not(.selected),.datepicker-cell.range-start.focused:not(.selected){background-color:#afafaf}.datepicker-cell.range-start{border-radius:4px 0 0 4px}.datepicker-cell.range-end{border-radius:0 4px 4px 0}.datepicker-cell.range{border-radius:0;background-color:#dbdbdb}.datepicker-cell.range:not(.disabled):not(.focused):not(.today):hover{background-color:#d5d5d5}.datepicker-cell.range.disabled{color:#c2c2c2}.datepicker-cell.range.focused{background-color:#cfcfcf}.datepicker-view.datepicker-grid .datepicker-cell{height:4.5rem;line-height:4.5rem}.datepicker-input.in-edit{border-color:#2366d1}.datepicker-input.in-edit:focus,.datepicker-input.in-edit:active{box-shadow:0 0 .25em .25em rgba(35,102,209,.2)} 3 3 .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{background-color:rgba(0,0,0,0);border:none;font-size:1em}.select2-container[dir=rtl] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline;list-style:none;padding:0}.select2-container .select2-selection--multiple .select2-selection__clear{background-color:rgba(0,0,0,0);border:none;font-size:1em}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;margin-left:5px;padding:0;max-width:100%;resize:none;height:18px;vertical-align:bottom;font-family:sans-serif;overflow:hidden;word-break:keep-all}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:#fff;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option--selectable{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;height:26px;margin-right:20px;padding-right:0px}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir=rtl] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #888 rgba(0,0,0,0);border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;padding-bottom:5px;padding-right:5px;position:relative}.select2-container--default .select2-selection--multiple.select2-selection--clearable{padding-right:25px}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;font-weight:bold;height:20px;margin-right:10px;margin-top:5px;position:absolute;right:0;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:inline-block;margin-left:5px;margin-top:5px;padding:0;padding-left:20px;position:relative;max-width:100%;overflow:hidden;text-overflow:ellipsis;vertical-align:bottom;white-space:nowrap}.select2-container--default .select2-selection--multiple .select2-selection__choice__display{cursor:default;padding-left:2px;padding-right:5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{background-color:rgba(0,0,0,0);border:none;border-right:1px solid #aaa;border-top-left-radius:4px;border-bottom-left-radius:4px;color:#999;cursor:pointer;font-size:1em;font-weight:bold;padding:0 4px;position:absolute;left:0;top:0}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover,.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:focus{background-color:#f1f1f1;color:#333;outline:none}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__display{padding-left:5px;padding-right:2px}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{border-left:1px solid #aaa;border-right:none;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}.select2-container--default[dir=rtl] .select2-selection--multiple .select2-selection__clear{float:left;margin-left:10px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid #000 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:rgba(0,0,0,0);border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--group{padding:0}.select2-container--default .select2-results__option--disabled{color:#999}.select2-container--default .select2-results__option--selected{background-color:#ddd}.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable{background-color:#5897fb;color:#fff}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, white 50%, #eeeeee 100%);background-image:-o-linear-gradient(top, white 50%, #eeeeee 100%);background-image:linear-gradient(to bottom, white 50%, #eeeeee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF", endColorstr="#FFEEEEEE", GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;height:26px;margin-right:20px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE", endColorstr="#FFCCCCCC", GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0);border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir=rtl] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:rgba(0,0,0,0);border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:rgba(0,0,0,0) rgba(0,0,0,0) #888 rgba(0,0,0,0);border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, white 0%, #eeeeee 50%);background-image:-o-linear-gradient(top, white 0%, #eeeeee 50%);background-image:linear-gradient(to bottom, white 0%, #eeeeee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFFFFFFF", endColorstr="#FFEEEEEE", GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eeeeee 50%, white 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, white 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, white 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#FFEEEEEE", endColorstr="#FFFFFFFF", GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:#fff;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0;padding-bottom:5px;padding-right:5px}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;display:inline-block;margin-left:5px;margin-top:5px;padding:0}.select2-container--classic .select2-selection--multiple .select2-selection__choice__display{cursor:default;padding-left:2px;padding-right:5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{background-color:rgba(0,0,0,0);border:none;border-top-left-radius:4px;border-bottom-left-radius:4px;color:#888;cursor:pointer;font-size:1em;font-weight:bold;padding:0 4px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555;outline:none}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__display{padding-left:5px;padding-right:2px}.select2-container--classic[dir=rtl] .select2-selection--multiple .select2-selection__choice__remove{border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:4px;border-bottom-right-radius:4px}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid rgba(0,0,0,0)}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option--group{padding:0}.select2-container--classic .select2-results__option--disabled{color:gray}.select2-container--classic .select2-results__option--highlighted.select2-results__option--selectable{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb} -
custom-post-types/trunk/assets/js/backend.js
r2915886 r2922197 12 12 * Released under the ISC license. 13 13 */ 14 var u=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},p=function(){function e(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,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,r=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(i=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,s=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw s}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(e){return 0===this.indexOf(e)},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var n=this;n.length<e;)n=t+n;return n};var f={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString();return n||"0"}var m=function(){function e(t,n,i,r){u(this,e);var s=this;if(void 0===t);else if(Array.isArray(t))this.rgba=t;else if(void 0===i){var o=t&&""+t;o&&function(t){if(t.startsWith("hsl")){var n=t.match(/([\-\d\.e]+)/g).map(Number),i=h(n,4),r=i[0],o=i[1],a=i[2],l=i[3];void 0===l&&(l=1),r/=360,o/=100,a/=100,s.hsla=[r,o,a,l]}else if(t.startsWith("rgb")){var c=t.match(/([\-\d\.e]+)/g).map(Number),d=h(c,4),u=d[0],p=d[1],f=d[2],g=d[3];void 0===g&&(g=1),s.rgba=[u,p,f,g]}else t.startsWith("#")?s.rgba=e.hexToRgb(t):s.rgba=e.nameToRgb(t)||e.hexToRgb(t)}(o.toLowerCase())}else this.rgba=[t,n,i,void 0===r?1:r]}return p(e,[{key:"printRGB",value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map((function(e,t){return g(e,3===t?3:0)}));return e?"rgba("+t+")":"rgb("+t+")"}},{key:"printHSL",value:function(e){var t=[360,100,100,1],n=["","%","%",""],i=(e?this.hsla:this.hsla.slice(0,3)).map((function(e,i){return g(e*t[i],3===i?3:1)+n[i]}));return e?"hsla("+i+")":"hsl("+i+")"}},{key:"printHex",value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=e.hslToRgb(this._hsla)},set:function(e){3===e.length&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=e.rgbToHsl(this._rgba)},set:function(e){3===e.length&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(e,t){return t<3?e.toString(16):Math.round(255*e).toString(16)})).map((function(e){return e.padStart(2,"0")})).join("")},set:function(t){this.rgba=e.hexToRgb(t)}}],[{key:"hexToRgb",value:function(e){var t=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!t.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var n=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(t){var n=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),i=f[n];return void 0===i?i:e.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var t=h(e,4),n=t[0],i=t[1],r=t[2],s=t[3];n/=255,i/=255,r/=255;var o=Math.max(n,i,r),a=Math.min(n,i,r),l=void 0,c=void 0,d=(o+a)/2;if(o===a)l=c=0;else{var u=o-a;switch(c=d>.5?u/(2-o-a):u/(o+a),o){case n:l=(i-r)/u+(i<r?6:0);break;case i:l=(r-n)/u+2;break;case r:l=(n-i)/u+4}l/=6}return[l,c,d,s]}},{key:"hslToRgb",value:function(e){var t=h(e,4),n=t[0],i=t[1],r=t[2],s=t[3],o=void 0,a=void 0,l=void 0;if(0===i)o=a=l=r;else{var c=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},d=r<.5?r*(1+i):r+i-r*i,u=2*r-d;o=c(u,d,n+1/3),a=c(u,d,n),l=c(u,d,n-1/3)}var p=[255*o,255*a,255*l].map(Math.round);return p[3]=s,p}}]),e}(),v=function(){function e(){u(this,e),this._events=[]}return p(e,[{key:"add",value:function(e,t,n){e.addEventListener(t,n,!1),this._events.push({target:e,type:t,handler:n})}},{key:"remove",value:function(t,n,i){this._events=this._events.filter((function(r){var s=!0;return t&&t!==r.target&&(s=!1),n&&n!==r.type&&(s=!1),i&&i!==r.handler&&(s=!1),s&&e._doRemove(r.target,r.type,r.handler),!s}))}},{key:"destroy",value:function(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(e,t,n){e.removeEventListener(t,n,!1)}}]),e}();function y(e,t,n){var i=!1;function r(e,t,n){return Math.max(t,Math.min(e,n))}function s(e,s,o){if(o&&(i=!0),i){e.preventDefault();var a=t.getBoundingClientRect(),l=a.width,c=a.height,d=s.clientX,u=s.clientY,p=r(d-a.left,0,l),h=r(u-a.top,0,c);n(p/l,h/c)}}function o(e,t){1===(void 0===e.buttons?e.which:e.buttons)?s(e,e,t):i=!1}function a(e,t){1===e.touches.length?s(e,e.touches[0],t):i=!1}e.add(t,"mousedown",(function(e){o(e,!0)})),e.add(t,"touchstart",(function(e){a(e,!0)})),e.add(window,"mousemove",o),e.add(t,"touchmove",a),e.add(window,"mouseup",(function(e){i=!1})),e.add(t,"touchend",(function(e){i=!1})),e.add(t,"touchcancel",(function(e){i=!1}))}function b(e,t){return(t||document).querySelector(e)}function w(e){e.preventDefault(),e.stopPropagation()}function _(e,t,n,i,r){e.add(t,"keydown",(function(e){n.indexOf(e.key)>=0&&(r&&w(e),i(e))}))}var k=function(){function e(t){u(this,e),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new v,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return p(e,[{key:"setOptions",value:function(e){var t=this;if(e){var n=this.settings;if(e instanceof HTMLElement)n.parent=e;else{n.parent&&e.parent&&n.parent!==e.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(e,t,n){for(var i in e)n&&n.indexOf(i)>=0||(t[i]=e[i])}(e,n),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var i=e.color||e.colour;i&&this._setColor(i)}var r=n.parent;if(r&&n.popup&&!this._popupInited){var s=function(e){return t.openHandler(e)};this._events.add(r,"click",s),_(this._events,r,[" ","Spacebar","Enter"],s),this._popupInited=!0}else e.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var t=e&&"keydown"===e.type?this._domEdit:this.domElement;setTimeout((function(){return t.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var t=e&&e.type,n=!1;if(e)if("mousedown"===t||"focusin"===t){var i=(this.__containedEvent||0)+100;e.timeStamp>i&&(n=!0)}else w(e),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="","mousedown"!==t&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,t){this.closeHandler(),this.setOptions(e),t&&this.openHandler()}},{key:"setColor",value:function(e,t){this._setColor(e,{silent:t})}},{key:"_setColor",value:function(e,t){if("string"==typeof e&&(e=e.trim()),e){t=t||{};var n=void 0;try{n=new m(e)}catch(e){if(t.failSilently)return;throw e}if(!this.settings.alpha){var i=n.hsla;i[3]=1,n.hsla=i}this.colour=this.color=n,this._setHSLA(null,null,null,null,t)}}},{key:"setColour",value:function(e,t){this.setColor(e,t)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var t,n,i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',r=(t=i,(n=document.createElement("div")).innerHTML=t,n.firstElementChild);return this.domElement=r,this._domH=b(".picker_hue",r),this._domSL=b(".picker_sl",r),this._domA=b(".picker_alpha",r),this._domEdit=b(".picker_editor input",r),this._domSample=b(".picker_sample",r),this._domOkay=b(".picker_done button",r),this._domCancel=b(".picker_cancel button",r),r.classList.add("layout_"+this.settings.layout),this.settings.alpha||r.classList.add("no_alpha"),this.settings.editor||r.classList.add("no_editor"),this.settings.cancelButton||r.classList.add("no_cancel"),this._ifPopup((function(){return r.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,t=this,n=this.domElement,i=this._events;function r(e,t,n){i.add(e,t,n)}r(n,"click",(function(e){return e.preventDefault()})),y(i,this._domH,(function(e,n){return t._setHSLA(e)})),y(i,this._domSL,(function(e,n){return t._setHSLA(null,e,1-n)})),this.settings.alpha&&y(i,this._domA,(function(e,n){return t._setHSLA(null,null,null,1-n)}));var s=this._domEdit;r(s,"input",(function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})})),r(s,"focus",(function(e){this.selectionStart===this.selectionEnd&&this.select()})),this._ifPopup((function(){var t=function(t){return e.closeHandler(t)};r(window,"mousedown",t),r(window,"focusin",t),_(i,n,["Esc","Escape"],t);var s=function(t){e.__containedEvent=t.timeStamp};r(n,"mousedown",s),r(n,"focusin",s),r(e._domCancel,"click",t)}));var o=function(t){e._ifPopup((function(){return e.closeHandler(t)})),e.onDone&&e.onDone(e.colour)};r(this._domOkay,"click",o),_(i,n,["Enter"],o)}},{key:"_setPosition",value:function(){var e=this.settings.parent,t=this.domElement;e!==t.parentNode&&e.appendChild(t),this._ifPopup((function(n){"static"===getComputedStyle(e).position&&(e.style.position="relative");var i=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){e===i?t.classList.add(e):t.classList.remove(e)})),t.classList.add(i)}))}},{key:"_setHSLA",value:function(e,t,n,i,r){r=r||{};var s=this.colour,o=s.hsla;[e,t,n,i].forEach((function(e,t){(e||0===e)&&(o[t]=e)})),s.hsla=o,this._updateUI(r),this.onChange&&!r.silent&&this.onChange(s)}},{key:"_updateUI",value:function(e){if(this.domElement){e=e||{};var t=this.colour,n=t.hsla,i="hsl("+360*n[0]+", 100%, 50%)",r=t.hslString,s=t.hslaString,o=this._domH,a=this._domSL,l=this._domA,c=b(".picker_selector",o),d=b(".picker_selector",a),u=b(".picker_selector",l);y(0,c,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,y(0,d,n[1]),w(0,d,1-n[2]),a.style.color=r,w(0,u,1-n[3]);var p=r,h=p.replace("hsl","hsla").replace(")",", 0)"),f="linear-gradient("+[p,h]+")";if(this._domA.style.background=f+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!e.fromEditor){var g=this.settings.editorFormat,m=this.settings.alpha,v=void 0;switch(g){case"rgb":v=t.printRGB(m);break;case"hsl":v=t.printHSL(m);break;default:v=t.printHex(m)}this._domEdit.value=v}this._domSample.style.color=s}function y(e,t,n){t.style.left=100*n+"%"}function w(e,t,n){t.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(e,t){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):t&&t()}},{key:"_toggleDOM",value:function(e){var t=this.domElement;if(!t)return!1;var n=e?"":"none",i=t.style.display!==n;return i&&(t.style.display=n),i}}]),e}(),x=document.createElement("style");x.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(x),k.StyleElement=x,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"),s=r()(n).children(".preview"),o=void 0!==r()(i).attr("alpha");new k({parent:n[0],popup:"top",alpha:o,color:i[0].value,onChange:function(e){s[0].style.backgroundColor=e.rgbaString,i[0].setAttribute("value",e.hex.endsWith("ff")&&e.hex.length>6?e.hex.slice(0,-2):e.hex)}})}},e}));n(4);function D(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $(e){return e[e.length-1]}function S(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function E(e,t){return e?e.split(t):[]}function C(e,t,n){return(void 0===t||e>=t)&&(void 0===n||e<=n)}function A(e,t,n){return e<t?t:e>n?n:e}function L(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 s=i+1;return s<t?L(e,t,n,s,r):r}function O(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function j(e){return new Date(e).setHours(0,0,0,0)}function T(){return(new Date).setHours(0,0,0,0)}function M(...e){switch(e.length){case 0:return T();case 1:return j(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function F(e,t){const n=new Date(e);return n.setDate(n.getDate()+t)}function N(e,t){const n=new Date(e),i=n.getMonth()+t;let r=i%12;r<0&&(r+=12);const s=n.setMonth(i);return n.getMonth()!==r?n.setDate(0):s}function I(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 P(e,t){return(e-t+7)%7}function q(e,t,n=0){const i=new Date(e).getDay();return F(e,P(t,n)-P(i,n))}function H(e,t){const n=new Date(e).getFullYear();return Math.floor(n/t)*t}function R(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 B=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,z=/[\s!-/:-@[-`{-~年月日]+/;let W={};const V={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))},U={d:e=>e.getDate(),dd:e=>Y(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>Y(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>Y(e.getFullYear(),2).slice(-2),yyyy:e=>Y(e.getFullYear(),4)};function Y(e,t){return e.toString().padStart(t,"0")}function G(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in W)return W[e];const t=e.split(B),n=e.match(new RegExp(B,"g"));if(0===t.length||!n)throw new Error("Invalid date format.");const i=n.map(e=>U[e]),r=Object.keys(V).reduce((e,t)=>(n.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return W[e]={parser(e,t){const i=e.split(z).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=V[n](e,i[n],t);return isNaN(r)?e:r},T())},formatter:(e,n)=>i.reduce((i,r,s)=>i+`${t[s]}${r(e,n)}`,"")+$(t)}}function K(e,t,n){if(e instanceof Date||"number"==typeof e){const t=j(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return T();if(t&&t.toValue){const i=t.toValue(e,t,n);return isNaN(i)?void 0:j(i)}return G(t).parser(e,n)}}function Z(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):G(t).formatter(i,n)}const J=document.createRange();function Q(e){return J.createContextualFragment(e)}function X(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function ee(e){return e.getRootNode().activeElement===e}function te(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function ne(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function ie(e){e.firstChild&&(e.removeChild(e.firstChild),ie(e))}const re=new WeakMap,{addEventListener:se,removeEventListener:oe}=EventTarget.prototype;function ae(e,t){let n=re.get(e);n||(n=[],re.set(e,n)),t.forEach(e=>{se.call(...e),n.push(e)})}function le(e){let t=re.get(e);t&&(t.forEach(e=>{oe.call(...e)}),re.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 ce(e,t){const n="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return function e(t,n,i){const[r,...s]=t;return n(r)?r:r!==i&&"HTML"!==r.tagName&&0!==s.length?e(s,n,i):void 0}(e.composedPath(),n,e.currentTarget)}const de={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"}};var ue={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,calendarWeeks:!1,clearBtn:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,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:"",todayBtn:!1,todayBtnMode:0,todayHighlight:!1,updateOnBlur:!0,weekStart:0};const{language:pe,format:he,weekStart:fe}=ue;function ge(e,t){return e.length<6&&t>=0&&t<7?S(e,t):e}function me(e){return(e+6)%7}function ve(e,t,n,i){const r=K(e,t,n);return void 0!==r?r:i}function ye(e,t,n=3){const i=parseInt(e,10);return i>=0&&i<=n?i:t}function be(e,t){const n=Object.assign({},e),i={},r=t.constructor.locales,s=t.rangeSideIndex;let{format:o,language:a,locale:l,maxDate:c,maxView:d,minDate:u,pickLevel:p,startView:h,weekStart:f}=t.config||{};if(n.language){let e;if(n.language!==a&&(r[n.language]?e=n.language:(e=n.language.split("-")[0],void 0===r[e]&&(e=!1))),delete n.language,e){a=i.language=e;const t=l||r[pe];l=Object.assign({format:he,weekStart:fe},r[pe]),a!==pe&&Object.assign(l,r[a]),i.locale=l,o===t.format&&(o=i.format=l.format),f===t.weekStart&&(f=i.weekStart=l.weekStart,i.weekEnd=me(l.weekStart))}}if(n.format){const e="function"==typeof n.format.toDisplay,t="function"==typeof n.format.toValue,r=B.test(n.format);(e&&t||r)&&(o=i.format=n.format),delete n.format}let g=p;void 0!==n.pickLevel&&(g=ye(n.pickLevel,2),delete n.pickLevel),g!==p&&(g>p&&(void 0===n.minDate&&(n.minDate=u),void 0===n.maxDate&&(n.maxDate=c)),n.datesDisabled||(n.datesDisabled=[]),p=i.pickLevel=g);let m=u,v=c;if(void 0!==n.minDate){const e=M(0,0,1);m=null===n.minDate?e:ve(n.minDate,o,l,m),m!==e&&(m=R(m,p,!1)),delete n.minDate}if(void 0!==n.maxDate&&(v=null===n.maxDate?void 0:ve(n.maxDate,o,l,v),void 0!==v&&(v=R(v,p,!0)),delete n.maxDate),v<m?(u=i.minDate=v,c=i.maxDate=m):(u!==m&&(u=i.minDate=m),c!==v&&(c=i.maxDate=v)),n.datesDisabled&&(i.datesDisabled=n.datesDisabled.reduce((e,t)=>{const n=K(t,o,l);return void 0!==n?S(e,R(n,p,s)):e},[]),delete n.datesDisabled),void 0!==n.defaultViewDate){const e=K(n.defaultViewDate,o,l);void 0!==e&&(i.defaultViewDate=e),delete n.defaultViewDate}if(void 0!==n.weekStart){const e=Number(n.weekStart)%7;isNaN(e)||(f=i.weekStart=e,i.weekEnd=me(e)),delete n.weekStart}if(n.daysOfWeekDisabled&&(i.daysOfWeekDisabled=n.daysOfWeekDisabled.reduce(ge,[]),delete n.daysOfWeekDisabled),n.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=n.daysOfWeekHighlighted.reduce(ge,[]),delete n.daysOfWeekHighlighted),void 0!==n.maxNumberOfDates){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 y=d;void 0!==n.maxView&&(y=ye(n.maxView,d),delete n.maxView),y=p>y?p:y,y!==d&&(d=i.maxView=y);let b=h;if(void 0!==n.startView&&(b=ye(n.startView,b),delete n.startView),b<p?b=p:b>d&&(b=d),b!==h&&(i.startView=b),n.prevArrow){const e=Q(n.prevArrow);e.childNodes.length>0&&(i.prevArrow=e.childNodes),delete n.prevArrow}if(n.nextArrow){const e=Q(n.nextArrow);e.childNodes.length>0&&(i.nextArrow=e.childNodes),delete n.nextArrow}if(void 0!==n.disableTouchKeyboard&&(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(void 0!==n.todayBtnMode){switch(n.todayBtnMode){case 0:case 1:i.todayBtnMode=n.todayBtnMode}delete n.todayBtnMode}return Object.keys(n).forEach(e=>{void 0!==n[e]&&D(ue,e)&&(i[e]=n[e])}),i}var we=O('<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-btn"></button>\n <button type="button" class="%buttonClass% view-switch"></button>\n <button type="button" class="%buttonClass% 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-btn"></button>\n <button type="button" class="%buttonClass% clear-btn"></button>\n </div>\n </div>\n </div>\n</div>');var _e=O(`<div class="days">\n <div class="days-of-week">${L("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${L("span",42)}</div>\n</div>`);var ke=O(`<div class="calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${L("span",6,{class:"week"})}</div>\n</div>`);class xe{constructor(e,t){Object.assign(this,t,{picker:e,element:Q('<div class="datepicker-view"></div>').firstChild,selected:[]}),this.init(this.picker.datepicker.config)}init(e){void 0!==e.pickLevel&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}performBeforeHook(e,t,n){let i=this.beforeShow(new Date(n));switch(typeof i){case"boolean":i={enabled:i};break;case"string":i={classes:i}}if(i){if(!1===i.enabled&&(e.classList.add("disabled"),S(this.disabled,t)),i.classes){const n=i.classes.split(/\s+/);e.classList.add(...n),n.includes("disabled")&&S(this.disabled,t)}i.content&&function(e,t){ie(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(Q(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,i.content)}}}class De extends xe{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=Q(_e).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if(D(e,"minDate")&&(this.minDate=e.minDate),D(e,"maxDate")&&(this.maxDate=e.maxDate),e.datesDisabled&&(this.datesDisabled=e.datesDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),void 0!==e.todayHighlight&&(this.todayHighlight=e.todayHighlight),void 0!==e.weekStart&&(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(void 0!==e.beforeShowDay&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),void 0!==e.calendarWeeks)if(e.calendarWeeks&&!this.calendarWeeks){const e=Q(ke).firstChild;this.calendarWeeks={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.calendarWeeks&&!e.calendarWeeks&&(this.element.removeChild(this.calendarWeeks.element),this.calendarWeeks=null);void 0!==e.showDaysOfWeek&&(e.showDaysOfWeek?(ne(this.dow),this.calendarWeeks&&ne(this.calendarWeeks.dow)):(te(this.dow),this.calendarWeeks&&te(this.calendarWeeks.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=M(t,n,1),r=q(i,this.weekStart,this.weekStart);this.first=i,this.last=M(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(){this.today=this.todayHighlight?T():void 0,this.disabled=[...this.datesDisabled];const e=Z(this.focused,this.switchLabelFormat,this.locale);if(this.picker.setViewSwitchLabel(e),this.picker.setPrevBtnDisabled(this.first<=this.minDate),this.picker.setNextBtnDisabled(this.last>=this.maxDate),this.calendarWeeks){const e=q(this.first,1,1);Array.from(this.calendarWeeks.weeks.children).forEach((t,n)=>{t.textContent=function(e){const t=q(e,4,1),n=q(new Date(t).setMonth(0,4),4,1);return Math.round((t-n)/6048e5)+1}(F(e,7*n))})}Array.from(this.grid.children).forEach((e,t)=>{const n=e.classList,i=F(this.start,t),r=new Date(i),s=r.getDay();if(e.className="datepicker-cell "+this.cellClass,e.dataset.date=i,e.textContent=r.getDate(),i<this.first?n.add("prev"):i>this.last&&n.add("next"),this.today===i&&n.add("today"),(i<this.minDate||i>this.maxDate||this.disabled.includes(i))&&n.add("disabled"),this.daysOfWeekDisabled.includes(s)&&(n.add("disabled"),S(this.disabled,i)),this.daysOfWeekHighlighted.includes(s)&&n.add("highlighted"),this.range){const[e,t]=this.range;i>e&&i<t&&n.add("range"),i===e&&n.add("range-start"),i===t&&n.add("range-end")}this.selected.includes(i)&&n.add("selected"),i===this.focused&&n.add("focused"),this.beforeShow&&this.performBeforeHook(e,i,i)})}refresh(){const[e,t]=this.range||[];this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(e=>{e.classList.remove("range","range-start","range-end","selected","focused")}),Array.from(this.grid.children).forEach(n=>{const i=Number(n.dataset.date),r=n.classList;i>e&&i<t&&r.add("range"),i===e&&r.add("range-start"),i===t&&r.add("range-end"),this.selected.includes(i)&&r.add("selected"),i===this.focused&&r.add("focused")})}refreshFocus(){const e=Math.round((this.focused-this.start)/864e5);this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}function $e(e,t){if(!e||!e[0]||!e[1])return;const[[n,i],[r,s]]=e;return n>t||r<t?void 0:[n===t?i:-1,r===t?s:12]}class Se extends xe{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(Q(L("span",12,{"data-month":e=>e})))),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),D(e,"minDate"))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(D(e,"maxDate"))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=M(this.maxYear,this.maxMonth+1,0)}this.isMinView?e.datesDisabled&&(this.datesDisabled=e.datesDisabled):this.datesDisabled=[],void 0!==e.beforeShowMonth&&(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]:S(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.disabled=this.datesDisabled.reduce((e,t)=>{const n=new Date(t);return this.year===n.getFullYear()&&e.push(n.getMonth()),e},[]),this.picker.setViewSwitchLabel(this.year),this.picker.setPrevBtnDisabled(this.year<=this.minYear),this.picker.setNextBtnDisabled(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=$e(this.range,this.year);Array.from(this.grid.children).forEach((s,o)=>{const a=s.classList,l=M(this.year,o,1);if(s.className="datepicker-cell "+this.cellClass,this.isMinView&&(s.dataset.date=l),s.textContent=this.monthNames[o],(t||n&&o<this.minMonth||i&&o>this.maxMonth||this.disabled.includes(o))&&a.add("disabled"),r){const[e,t]=r;o>e&&o<t&&a.add("range"),o===e&&a.add("range-start"),o===t&&a.add("range-end")}e.includes(o)&&a.add("selected"),o===this.focused&&a.add("focused"),this.beforeShow&&this.performBeforeHook(s,o,l)})}refresh(){const e=this.selected[this.year]||[],[t,n]=$e(this.range,this.year)||[];this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(e=>{e.classList.remove("range","range-start","range-end","selected","focused")}),Array.from(this.grid.children).forEach((i,r)=>{const s=i.classList;r>t&&r<n&&s.add("range"),r===t&&s.add("range-start"),r===n&&s.add("range-end"),e.includes(r)&&s.add("selected"),r===this.focused&&s.add("focused")})}refreshFocus(){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[this.focused].classList.add("focused")}}class Ee extends xe{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(Q(L("span",12)))),super.init(e)}setOptions(e){if(D(e,"minDate")&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=H(e.minDate,this.step),this.minDate=M(this.minYear,0,1))),D(e,"maxDate")&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=H(e.maxDate,this.step),this.maxDate=M(this.maxYear,11,31))),this.isMinView?e.datesDisabled&&(this.datesDisabled=e.datesDisabled):this.datesDisabled=[],void 0!==e[this.beforeShowOption]){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=H(e,this.navStep),n=t+9*this.step;this.first=t,this.last=n,this.start=t-this.step,this.focused=H(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>S(e,H(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return H(e,this.step)}))}render(){this.disabled=this.datesDisabled.map(e=>new Date(e).getFullYear()),this.picker.setViewSwitchLabel(`${this.first}-${this.last}`),this.picker.setPrevBtnDisabled(this.first<=this.minYear),this.picker.setNextBtnDisabled(this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const n=e.classList,i=this.start+t*this.step,r=M(i,0,1);if(e.className="datepicker-cell "+this.cellClass,this.isMinView&&(e.dataset.date=r),e.textContent=e.dataset.year=i,0===t?n.add("prev"):11===t&&n.add("next"),(i<this.minYear||i>this.maxYear||this.disabled.includes(i))&&n.add("disabled"),this.range){const[e,t]=this.range;i>e&&i<t&&n.add("range"),i===e&&n.add("range-start"),i===t&&n.add("range-end")}this.selected.includes(i)&&n.add("selected"),i===this.focused&&n.add("focused"),this.beforeShow&&this.performBeforeHook(e,i,r)})}refresh(){const[e,t]=this.range||[];this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(e=>{e.classList.remove("range","range-start","range-end","selected","focused")}),Array.from(this.grid.children).forEach(n=>{const i=Number(n.textContent),r=n.classList;i>e&&i<t&&r.add("range"),i===e&&r.add("range-start"),i===t&&r.add("range-end"),this.selected.includes(i)&&r.add("selected"),i===this.focused&&r.add("focused")})}refreshFocus(){const e=Math.round((this.focused-this.start)/this.step);this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}function Ce(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 Ae(e,t){const{minDate:n,maxDate:i}=e.config,{currentView:r,viewDate:s}=e.picker;let o;switch(r.id){case 0:o=N(s,t);break;case 1:o=I(s,t);break;default:o=I(s,t*r.navStep)}o=A(o,n,i),e.picker.changeFocus(o).render()}function Le(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function Oe(e){e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()}function je(e,t){const n=e.picker,i=new Date(n.viewDate),r=n.currentView.id,s=1===r?N(i,t-i.getMonth()):I(i,t-i.getFullYear());n.changeFocus(s).changeView(r-1).render()}function Te(e){const t=e.picker,n=T();if(1===e.config.todayBtnMode){if(e.config.autohide)return void e.setDate(n);e.setDate(n,{render:!1}),t.update()}t.viewDate!==n&&t.changeFocus(n),t.changeView(0).render()}function Me(e){e.setDate({clear:!0})}function Fe(e){Le(e)}function Ne(e){Ae(e,-1)}function Ie(e){Ae(e,1)}function Pe(e,t){const n=ce(t,".datepicker-cell");if(!n||n.classList.contains("disabled"))return;const{id:i,isMinView:r}=e.picker.currentView;r?e.setDate(Number(n.dataset.date)):je(e,Number(1===i?n.dataset.month:n.dataset.year))}function qe(e){e.preventDefault()}const He=["left","top","right","bottom"].reduce((e,t)=>(e[t]="datepicker-orient-"+t,e),{}),Re=e=>e?e+"px":e;function Be(e,t){if(void 0!==t.title&&(t.title?(e.controls.title.textContent=t.title,ne(e.controls.title)):(e.controls.title.textContent="",te(e.controls.title))),t.prevArrow){const n=e.controls.prevBtn;ie(n),t.prevArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const n=e.controls.nextBtn;ie(n),t.nextArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayBtn.textContent=t.locale.today,e.controls.clearBtn.textContent=t.locale.clear),void 0!==t.todayBtn&&(t.todayBtn?ne(e.controls.todayBtn):te(e.controls.todayBtn)),D(t,"minDate")||D(t,"maxDate")){const{minDate:t,maxDate:n}=e.datepicker.config;e.controls.todayBtn.disabled=!C(T(),t,n)}void 0!==t.clearBtn&&(t.clearBtn?ne(e.controls.clearBtn):te(e.controls.clearBtn))}function ze(e){const{dates:t,config:n}=e;return A(t.length>0?$(t):n.defaultViewDate,n.minDate,n.maxDate)}function We(e,t){const n=new Date(e.viewDate),i=new Date(t),{id:r,year:s,first:o,last:a}=e.currentView,l=i.getFullYear();switch(e.viewDate=t,l!==n.getFullYear()&&Ce(e.datepicker,"changeYear"),i.getMonth()!==n.getMonth()&&Ce(e.datepicker,"changeMonth"),r){case 0:return t<o||t>a;case 1:return l!==s;default:return l<o||l>a}}function Ve(e){return window.getComputedStyle(e).direction}class Ue{constructor(e){const{config:t}=this.datepicker=e,n=we.replace(/%buttonClass%/g,t.buttonClass),i=this.element=Q(n).firstChild,[r,s,o]=i.firstChild.children,a=r.firstElementChild,[l,c,d]=r.lastElementChild.children,[u,p]=o.firstChild.children,h={title:a,prevBtn:l,viewSwitch:c,nextBtn:d,todayBtn:u,clearBtn:p};this.main=s,this.controls=h;const f=e.inline?"inline":"dropdown";i.classList.add("datepicker-"+f),Be(this,t),this.viewDate=ze(e),ae(e,[[i,"mousedown",qe],[s,"click",Pe.bind(null,e)],[h.viewSwitch,"click",Fe.bind(null,e)],[h.prevBtn,"click",Ne.bind(null,e)],[h.nextBtn,"click",Ie.bind(null,e)],[h.todayBtn,"click",Te.bind(null,e)],[h.clearBtn,"click",Me.bind(null,e)]]),this.views=[new De(this),new Se(this),new Ee(this,{id:2,name:"years",cellClass:"year",step:1}),new Ee(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):e.inputField.after(this.element)}setOptions(e){Be(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;if(e.inline)t.classList.add("active");else{const n=Ve(e.inputField);n!==Ve(X(t))?t.dir=n:t.dir&&t.removeAttribute("dir"),t.style.visiblity="hidden",t.classList.add("active"),this.place(),t.style.visiblity="",e.config.disableTouchKeyboard&&e.inputField.blur()}this.active=!0,Ce(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,Ce(this.datepicker,"hide"))}place(){const{classList:e,offsetParent:t,style:n}=this.element,{config:i,inputField:r}=this.datepicker,{width:s,height:o}=this.element.getBoundingClientRect(),{left:a,top:l,right:c,bottom:d,width:u,height:p}=r.getBoundingClientRect();let{x:h,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=X(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"===h&&(a<y?(h="left",k=y-a):a+s>w?(h="right",w<c&&(k=w-c)):h="rtl"===Ve(r)?c-s<y?"left":"right":"left"),"right"===h&&(g+=u-s),g+=k,"auto"===f&&(f=l-o>b&&d+o>_?"top":"bottom"),"top"===f?m-=o:m+=p,e.remove(...Object.values(He)),e.add(He[h],He[f]),n.left=Re(g),n.top=Re(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevBtnDisabled(e){this.controls.prevBtn.disabled=e}setNextBtnDisabled(e){this.controls.nextBtn.disabled=e}changeView(e){const t=this.currentView,n=this.views[e];return n.id!==t.id&&(this.currentView=n,this._renderMethod="render",Ce(this.datepicker,"changeView"),this.main.replaceChild(n.element,t.element)),this}changeFocus(e){return this._renderMethod=We(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(){const e=ze(this.datepicker);return this._renderMethod=We(this,e)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const t=e&&this._renderMethod||"render";delete this._renderMethod,this.currentView[t]()}}function Ye(e,t,n,i){const r=e.picker,s=r.currentView,o=s.step||1;let a,l,c=r.viewDate;switch(s.id){case 0:c=i?F(c,7*n):t.ctrlKey||t.metaKey?I(c,n):F(c,n),a=F,l=e=>s.disabled.includes(e);break;case 1:c=N(c,i?4*n:n),a=N,l=e=>{const t=new Date(e),{year:n,disabled:i}=s;return t.getFullYear()===n&&i.includes(t.getMonth())};break;default:c=I(c,n*(i?4:1)*o),a=I,l=e=>s.disabled.includes(H(e,o))}c=function e(t,n,i,r,s,o){if(C(t,s,o)){if(r(t)){return e(n(t,i),n,i,r,s,o)}return t}}(c,a,n<0?-o:o,l,s.minDate,s.maxDate),void 0!==c&&r.changeFocus(c).render()}function Ge(e,t){const n=t.key;if("Tab"===n)return void Oe(e);const i=e.picker,{id:r,isMinView:s}=i.currentView;if(i.active){if(e.editMode)return void("Enter"===n?e.exitEditMode({update:!0,autohide:e.config.autohide}):"Escape"===n&&i.hide());if("ArrowLeft"===n)if(t.ctrlKey||t.metaKey)Ae(e,-1);else{if(t.shiftKey)return void e.enterEditMode();Ye(e,t,-1,!1)}else if("ArrowRight"===n)if(t.ctrlKey||t.metaKey)Ae(e,1);else{if(t.shiftKey)return void e.enterEditMode();Ye(e,t,1,!1)}else if("ArrowUp"===n)if(t.ctrlKey||t.metaKey)Le(e);else{if(t.shiftKey)return void e.enterEditMode();Ye(e,t,-1,!0)}else if("ArrowDown"===n){if(t.shiftKey&&!t.ctrlKey&&!t.metaKey)return void e.enterEditMode();Ye(e,t,1,!0)}else{if("Enter"!==n)return void("Escape"===n?i.hide():"Backspace"!==n&&"Delete"!==n&&(1!==n.length||t.ctrlKey||t.metaKey)||e.enterEditMode());if(s)return void e.setDate(i.viewDate);i.changeView(r-1).render()}}else{if("ArrowDown"!==n)return void("Enter"===n?e.update():"Escape"===n&&i.show());i.show()}t.preventDefault()}function Ke(e){e.config.showOnFocus&&!e._showing&&e.show()}function Ze(e,t){const n=t.target;(e.picker.active||e.config.showOnClick)&&(n._active=ee(n),n._clicking=setTimeout(()=>{delete n._active,delete n._clicking},2e3))}function Je(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 Qe(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function Xe(e,t){const{element:n,picker:i}=e;if(!i.active&&!ee(n))return;const r=i.element;ce(t,e=>e===n||e===r)||Oe(e)}function et(e,t){return e.map(e=>Z(e,t.format,t.locale)).join(t.dateDelimiter)}function tt(e,t,n=!1){const{config:i,dates:r,rangeSideIndex:s}=e;if(0===t.length)return n?[]:void 0;let o=t.reduce((e,t)=>{let n=K(t,i.format,i.locale);return void 0===n||(n=R(n,i.pickLevel,s),!C(n,i.minDate,i.maxDate)||e.includes(n)||i.datesDisabled.includes(n)||!(i.pickLevel>0)&&i.daysOfWeekDisabled.includes(new Date(n).getDay())||e.push(n)),e},[]);return 0!==o.length?(i.multidate&&!n&&(o=o.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!o.includes(e)))),i.maxNumberOfDates&&o.length>i.maxNumberOfDates?o.slice(-1*i.maxNumberOfDates):o):void 0}function nt(e,t=3,n=!0){const{config:i,picker:r,inputField:s}=e;if(2&t){const e=r.active?i.pickLevel:i.startView;r.update().changeView(e).render(n)}1&t&&s&&(s.value=et(e.dates,i))}function it(e,t,n){let{clear:i,render:r,autohide:s,revert:o}=n;void 0===r&&(r=!0),r?void 0===s&&(s=e.config.autohide):s=!1;const a=tt(e,t,i);(a||o)&&(a&&a.toString()!==e.dates.toString()?(e.dates=a,nt(e,r?3:1),Ce(e,"changeDate")):nt(e,1),s&&e.hide())}class rt{constructor(e,t={},n){e.datepicker=this,this.element=e;const i=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:T(),maxDate:void 0,minDate:void 0},be(ue,this)),r=this.inline="INPUT"!==e.tagName;let s,o;if(r?i.container=e:(t.container&&(i.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container)),s=this.inputField=e,s.classList.add("datepicker-input")),n){const e=n.inputs.indexOf(s),t=n.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,Object.defineProperty(this,"rangepicker",{get:()=>n}),Object.defineProperty(this,"rangeSideIndex",{get:()=>e})}this._options=t,Object.assign(i,be(t,this)),r?(o=E(e.dataset.date,i.dateDelimiter),delete e.dataset.date):o=E(s.value,i.dateDelimiter),this.dates=[];const a=tt(this,o);a&&a.length>0&&(this.dates=a),s&&(s.value=et(this.dates,i));const l=this.picker=new Ue(this);if(r)this.show();else{const e=Xe.bind(null,this);ae(this,[[s,"keydown",Ge.bind(null,this)],[s,"focus",Ke.bind(null,this)],[s,"mousedown",Ze.bind(null,this)],[s,"click",Je.bind(null,this)],[s,"paste",Qe.bind(null,this)],[document,"mousedown",e],[document,"touchstart",e],[window,"resize",l.place.bind(l)]])}}static formatDate(e,t,n){return Z(e,t,n&&de[n]||de.en)}static parseDate(e,t,n){return K(e,t,n&&de[n]||de.en)}static get locales(){return de}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=this.picker,n=be(e,this);Object.assign(this._options,e),Object.assign(this.config,n),t.setOptions(n),nt(this,3)}show(){if(this.inputField){if(this.inputField.disabled)return;ee(this.inputField)||this.config.disableTouchKeyboard||(this._showing=!0,this.inputField.focus(),delete this._showing)}this.picker.show()}hide(){this.inline||(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}destroy(){return this.hide(),le(this),this.picker.detach(),this.inline||this.inputField.classList.remove("datepicker-input"),delete this.element.datepicker,this}getDate(e){const t=e?t=>Z(t,e,this.config.locale):e=>new Date(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=$(e);"object"!=typeof i||Array.isArray(i)||i instanceof Date||!i||Object.assign(n,t.pop());it(this,Array.isArray(t[0])?t[0]:t,n)}update(e){if(this.inline)return;const t=Object.assign(e||{},{clear:!0,render:!0});it(this,E(this.inputField.value,this.config.dateDelimiter),t)}refresh(e,t=!1){let n;e&&"string"!=typeof e&&(t=e,e=void 0),n="picker"===e?2:"input"===e?1:3,nt(this,n,!t)}enterEditMode(){this.inline||!this.picker.active||this.editMode||(this.editMode=!0,this.inputField.classList.add("in-edit"))}exitEditMode(e){if(this.inline||!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 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,i.key,i)}}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"),s="no"!==r()(i).data("max")&&r()(i).data("max"),o="no"!==r()(i).data("min")&&r()(i).data("min");new rt(i[0],{autohide:!0,clearBtn:!0,maxDate:s,minDate:o,format:"dd/mm/yyyy"})}},e}));var ot=wp.i18n,at=ot.__;ot._x,ot._n,ot._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.file={load:function(e,t){new lt(e)}},e}));var lt=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(".upload"),this.removeButton=r()(this.fileSection).find(".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:at("Add file","custom-post-types"),frame:"select",library:wp.media.query({type:e.fileTypes,uploadedTo:wp.media.view.settings.post.id}),button:{text:at("Choose file","custom-post-types")},multiple:!1}).on("select",(function(){var t=n.state().get("selection").first().toJSON(),i=!!t.sizes&&t.sizes.thumbnail.url;i&&(r()(e.filePreview).attr("src",i),r()(e.filePreview).show());var s=t.mime;s.startsWith("image")&&(s="image"),s.startsWith("audio")&&(s="audio"),s.startsWith("video")&&(s="video"),"-1"!=r.a.inArray(s,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",at("Choose","custom-post-types"))}}])&&st(t.prototype,n),i&&st(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();n(1),n(2);function ct(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,i.key,i)}}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"),s={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(s.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(s)}},e}));var dt=wp.i18n;dt.__,dt._x,dt._n,dt._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.repeater={load:function(e,t){new ut(e)}},e}));var ut=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 s=r()(this.repeaterSection).find(".cpt-repeater-group");r.a.each(s,(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 s=r()(t.repeaterSection).children(".cpt-repeater-group").length,o=[];o.push({name:"action",value:"cpt-get-repeater-group"}),o.push({name:"nonce",value:cpt.ajax_nonce}),o.push({name:"fields",value:JSON.stringify(t.fields)}),o.push({name:"parent",value:t.parent+"["+s+"]"}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:o,success:function(n){if(n.success){r()(e).prop("disabled",!1),r()(i).remove();var s=r()(n.data);r()(t.repeaterSection).append(s),t.initFieldGroup(s)}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(".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("change",(function(e){r()(n).empty();var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(n).append(i);var s=!!r()(t).val().length&&r()(t).val();if(s){var o=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:s}),a.push({name:"parent",value:o}),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)}})}}))}}])&&ct(t.prototype,n),i&&ct(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function pt(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,i.key,i)}}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.select={load:function(e,t){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"),s={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(s.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(s)}},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"),s=r()(i).data("value")?r()(i).data("value"):"",o="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(":"),s=null!==(e=r[0])&&void 0!==e&&e,o=null!==(t=r[1])&&void 0!==t&&t,a=Number(s+o);return Number.isInteger(a)?a:i},c=l(o),d=l(a),u=0;u<=23;u++){u=u<10?"0"+u:u;for(var p=0;p<=59;p++){var h=u+":"+(p=p<10?"0"+p:p);(d>0&&l(h)<d||c>0&&l(h)>c)&&c>d||r()(i).append(r()('<option value="'+h+'"'+(s==h?' selected="selected"':"")+">"+h+"</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 ft(e)}},e}));var ft=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ht(this,"editorEl",void 0),ht(this,"editorId",void 0),ht(this,"editorForm",void 0),ht(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()}))}}])&&pt(t.prototype,n),i&&pt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),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,i.key,i)}}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.utils=new d,this.loadFields(),this.loadUiFeatures()}var t,n,i;return t=e,(n=[{key:"loadUiFeatures",value:function(){var e=this;r()("body").on("click",".cpt-field-wrap.advanced-field-btn .button",(function(e){e.preventDefault();var t=r()(this).closest(".cpt-fields-section"),n=r()(t).find(".cpt-field-wrap.advanced-field");r()(this).hasClass("button-secondary")?(r()(n).removeClass("active"),r()(this).removeClass("button-secondary").addClass("button-primary"),r()(this).find(".dashicons").attr("class","dashicons dashicons-insert"),r()(this).find(".label").html(vt("Advanced view","custom-post-types"))):(r()(n).addClass("active"),r()(this).addClass("button-secondary").removeClass("button-primary"),r()(this).find(".dashicons").attr("class","dashicons dashicons-remove"),r()(this).find(".label").html(vt("Simple view","custom-post-types")))})),r()("body").on("click",".cpt-field-wrap .template-shortcode input.copy-shortcode",(function(t){t.preventDefault();var n=r()(t.currentTarget);if(!r()(n).hasClass("copying")){var i=r()(n).val();e.utils.copyToClipboard(r()(n))&&(r()(n).val(vt("Copied to the clipboard...","custom-post-types")),r()(n).addClass("copying"),r()(n).mouseleave((function(){r()(this).val(i),r()(this).removeClass("copying")})))}})),r()("body").on("select2:select",".cpt-field-wrap.template-supports select",(function(e){e.preventDefault();var t=r()(this).val().length>0&&r()(this).val(),n=r()(this).closest(".cpt-fields-section"),i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');if(r()(n).find(".template-shortcode").html(""),r()(n).find(".template-shortcode").append(i),t){var s=[];s.push({name:"action",value:"cpt-get-template-shortcodes"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"post-type",value:t}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?(r()(n).find(".template-shortcode").html(""),r()(n).find(".template-shortcode.fields").html(e.data.fields.join("")),r()(n).find(".template-shortcode.taxs").html(e.data.taxonomies.join(""))):console.log("Error",e)}})}else r()(i).remove()})),r()(window).on("load",(function(){if(r()("body").hasClass("block-editor-page")){var e=r()('.cpt-fields-section *[id^="meta-fields-"][required]');e.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"))}(e)}),200)}})),r()("body").on("click",".cpt-notice.is-dismissible a.cpt-dismiss-notice",(function(e){e.preventDefault();var t=r()(this).closest(".cpt-notice").find("button.notice-dismiss"),n=r()(this).data("notice"),i=r()(this).data("duration"),s=[];s.push({name:"action",value:"cpt-dismiss-notice"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"key",value:n}),s.push({name:"duration",value:i}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?t.click():console.log("Error",e)}})})) ;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'),s=r()(n).find('input[id$="-id"]:first');e.utils.autoFillKey(s,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}())}]);14 var u=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},p=function(){function e(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,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),h=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,r=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(i=(o=a.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){r=!0,s=e}finally{try{!i&&a.return&&a.return()}finally{if(r)throw s}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")};String.prototype.startsWith=String.prototype.startsWith||function(e){return 0===this.indexOf(e)},String.prototype.padStart=String.prototype.padStart||function(e,t){for(var n=this;n.length<e;)n=t+n;return n};var f={cb:"0f8ff",tqw:"aebd7",q:"-ffff",qmrn:"7fffd4",zr:"0ffff",bg:"5f5dc",bsq:"e4c4",bck:"---",nch:"ebcd",b:"--ff",bvt:"8a2be2",brwn:"a52a2a",brw:"deb887",ctb:"5f9ea0",hrt:"7fff-",chcT:"d2691e",cr:"7f50",rnw:"6495ed",crns:"8dc",crms:"dc143c",cn:"-ffff",Db:"--8b",Dcn:"-8b8b",Dgnr:"b8860b",Dgr:"a9a9a9",Dgrn:"-64-",Dkhk:"bdb76b",Dmgn:"8b-8b",Dvgr:"556b2f",Drng:"8c-",Drch:"9932cc",Dr:"8b--",Dsmn:"e9967a",Dsgr:"8fbc8f",DsTb:"483d8b",DsTg:"2f4f4f",Dtrq:"-ced1",Dvt:"94-d3",ppnk:"1493",pskb:"-bfff",mgr:"696969",grb:"1e90ff",rbrc:"b22222",rwht:"af0",stg:"228b22",chs:"-ff",gnsb:"dcdcdc",st:"8f8ff",g:"d7-",gnr:"daa520",gr:"808080",grn:"-8-0",grnw:"adff2f",hnw:"0fff0",htpn:"69b4",nnr:"cd5c5c",ng:"4b-82",vr:"0",khk:"0e68c",vnr:"e6e6fa",nrb:"0f5",wngr:"7cfc-",mnch:"acd",Lb:"add8e6",Lcr:"08080",Lcn:"e0ffff",Lgnr:"afad2",Lgr:"d3d3d3",Lgrn:"90ee90",Lpnk:"b6c1",Lsmn:"a07a",Lsgr:"20b2aa",Lskb:"87cefa",LsTg:"778899",Lstb:"b0c4de",Lw:"e0",m:"-ff-",mgrn:"32cd32",nn:"af0e6",mgnt:"-ff",mrn:"8--0",mqm:"66cdaa",mmb:"--cd",mmrc:"ba55d3",mmpr:"9370db",msg:"3cb371",mmsT:"7b68ee","":"-fa9a",mtr:"48d1cc",mmvt:"c71585",mnLb:"191970",ntc:"5fffa",mstr:"e4e1",mccs:"e4b5",vjw:"dead",nv:"--80",c:"df5e6",v:"808-0",vrb:"6b8e23",rng:"a5-",rngr:"45-",rch:"da70d6",pgnr:"eee8aa",pgrn:"98fb98",ptrq:"afeeee",pvtr:"db7093",ppwh:"efd5",pchp:"dab9",pr:"cd853f",pnk:"c0cb",pm:"dda0dd",pwrb:"b0e0e6",prp:"8-080",cc:"663399",r:"--",sbr:"bc8f8f",rb:"4169e1",sbrw:"8b4513",smn:"a8072",nbr:"4a460",sgrn:"2e8b57",ssh:"5ee",snn:"a0522d",svr:"c0c0c0",skb:"87ceeb",sTb:"6a5acd",sTgr:"708090",snw:"afa",n:"-ff7f",stb:"4682b4",tn:"d2b48c",t:"-8080",thst:"d8bfd8",tmT:"6347",trqs:"40e0d0",vt:"ee82ee",whT:"5deb3",wht:"",hts:"5f5f5",w:"-",wgrn:"9acd32"};function g(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=t>0?e.toFixed(t).replace(/0+$/,"").replace(/\.$/,""):e.toString();return n||"0"}var m=function(){function e(t,n,i,r){u(this,e);var s=this;if(void 0===t);else if(Array.isArray(t))this.rgba=t;else if(void 0===i){var o=t&&""+t;o&&function(t){if(t.startsWith("hsl")){var n=t.match(/([\-\d\.e]+)/g).map(Number),i=h(n,4),r=i[0],o=i[1],a=i[2],l=i[3];void 0===l&&(l=1),r/=360,o/=100,a/=100,s.hsla=[r,o,a,l]}else if(t.startsWith("rgb")){var c=t.match(/([\-\d\.e]+)/g).map(Number),d=h(c,4),u=d[0],p=d[1],f=d[2],g=d[3];void 0===g&&(g=1),s.rgba=[u,p,f,g]}else t.startsWith("#")?s.rgba=e.hexToRgb(t):s.rgba=e.nameToRgb(t)||e.hexToRgb(t)}(o.toLowerCase())}else this.rgba=[t,n,i,void 0===r?1:r]}return p(e,[{key:"printRGB",value:function(e){var t=(e?this.rgba:this.rgba.slice(0,3)).map((function(e,t){return g(e,3===t?3:0)}));return e?"rgba("+t+")":"rgb("+t+")"}},{key:"printHSL",value:function(e){var t=[360,100,100,1],n=["","%","%",""],i=(e?this.hsla:this.hsla.slice(0,3)).map((function(e,i){return g(e*t[i],3===i?3:1)+n[i]}));return e?"hsla("+i+")":"hsl("+i+")"}},{key:"printHex",value:function(e){var t=this.hex;return e?t:t.substring(0,7)}},{key:"rgba",get:function(){if(this._rgba)return this._rgba;if(!this._hsla)throw new Error("No color is set");return this._rgba=e.hslToRgb(this._hsla)},set:function(e){3===e.length&&(e[3]=1),this._rgba=e,this._hsla=null}},{key:"rgbString",get:function(){return this.printRGB()}},{key:"rgbaString",get:function(){return this.printRGB(!0)}},{key:"hsla",get:function(){if(this._hsla)return this._hsla;if(!this._rgba)throw new Error("No color is set");return this._hsla=e.rgbToHsl(this._rgba)},set:function(e){3===e.length&&(e[3]=1),this._hsla=e,this._rgba=null}},{key:"hslString",get:function(){return this.printHSL()}},{key:"hslaString",get:function(){return this.printHSL(!0)}},{key:"hex",get:function(){return"#"+this.rgba.map((function(e,t){return t<3?e.toString(16):Math.round(255*e).toString(16)})).map((function(e){return e.padStart(2,"0")})).join("")},set:function(t){this.rgba=e.hexToRgb(t)}}],[{key:"hexToRgb",value:function(e){var t=(e.startsWith("#")?e.slice(1):e).replace(/^(\w{3})$/,"$1F").replace(/^(\w)(\w)(\w)(\w)$/,"$1$1$2$2$3$3$4$4").replace(/^(\w{6})$/,"$1FF");if(!t.match(/^([0-9a-fA-F]{8})$/))throw new Error("Unknown hex color; "+e);var n=t.match(/^(\w\w)(\w\w)(\w\w)(\w\w)$/).slice(1).map((function(e){return parseInt(e,16)}));return n[3]=n[3]/255,n}},{key:"nameToRgb",value:function(t){var n=t.toLowerCase().replace("at","T").replace(/[aeiouyldf]/g,"").replace("ght","L").replace("rk","D").slice(-5,4),i=f[n];return void 0===i?i:e.hexToRgb(i.replace(/\-/g,"00").padStart(6,"f"))}},{key:"rgbToHsl",value:function(e){var t=h(e,4),n=t[0],i=t[1],r=t[2],s=t[3];n/=255,i/=255,r/=255;var o=Math.max(n,i,r),a=Math.min(n,i,r),l=void 0,c=void 0,d=(o+a)/2;if(o===a)l=c=0;else{var u=o-a;switch(c=d>.5?u/(2-o-a):u/(o+a),o){case n:l=(i-r)/u+(i<r?6:0);break;case i:l=(r-n)/u+2;break;case r:l=(n-i)/u+4}l/=6}return[l,c,d,s]}},{key:"hslToRgb",value:function(e){var t=h(e,4),n=t[0],i=t[1],r=t[2],s=t[3],o=void 0,a=void 0,l=void 0;if(0===i)o=a=l=r;else{var c=function(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e},d=r<.5?r*(1+i):r+i-r*i,u=2*r-d;o=c(u,d,n+1/3),a=c(u,d,n),l=c(u,d,n-1/3)}var p=[255*o,255*a,255*l].map(Math.round);return p[3]=s,p}}]),e}(),v=function(){function e(){u(this,e),this._events=[]}return p(e,[{key:"add",value:function(e,t,n){e.addEventListener(t,n,!1),this._events.push({target:e,type:t,handler:n})}},{key:"remove",value:function(t,n,i){this._events=this._events.filter((function(r){var s=!0;return t&&t!==r.target&&(s=!1),n&&n!==r.type&&(s=!1),i&&i!==r.handler&&(s=!1),s&&e._doRemove(r.target,r.type,r.handler),!s}))}},{key:"destroy",value:function(){this._events.forEach((function(t){return e._doRemove(t.target,t.type,t.handler)})),this._events=[]}}],[{key:"_doRemove",value:function(e,t,n){e.removeEventListener(t,n,!1)}}]),e}();function y(e,t,n){var i=!1;function r(e,t,n){return Math.max(t,Math.min(e,n))}function s(e,s,o){if(o&&(i=!0),i){e.preventDefault();var a=t.getBoundingClientRect(),l=a.width,c=a.height,d=s.clientX,u=s.clientY,p=r(d-a.left,0,l),h=r(u-a.top,0,c);n(p/l,h/c)}}function o(e,t){1===(void 0===e.buttons?e.which:e.buttons)?s(e,e,t):i=!1}function a(e,t){1===e.touches.length?s(e,e.touches[0],t):i=!1}e.add(t,"mousedown",(function(e){o(e,!0)})),e.add(t,"touchstart",(function(e){a(e,!0)})),e.add(window,"mousemove",o),e.add(t,"touchmove",a),e.add(window,"mouseup",(function(e){i=!1})),e.add(t,"touchend",(function(e){i=!1})),e.add(t,"touchcancel",(function(e){i=!1}))}function b(e,t){return(t||document).querySelector(e)}function w(e){e.preventDefault(),e.stopPropagation()}function _(e,t,n,i,r){e.add(t,"keydown",(function(e){n.indexOf(e.key)>=0&&(r&&w(e),i(e))}))}var k=function(){function e(t){u(this,e),this.settings={popup:"right",layout:"default",alpha:!0,editor:!0,editorFormat:"hex",cancelButton:!1,defaultColor:"#0cf"},this._events=new v,this.onChange=null,this.onDone=null,this.onOpen=null,this.onClose=null,this.setOptions(t)}return p(e,[{key:"setOptions",value:function(e){var t=this;if(e){var n=this.settings;if(e instanceof HTMLElement)n.parent=e;else{n.parent&&e.parent&&n.parent!==e.parent&&(this._events.remove(n.parent),this._popupInited=!1),function(e,t,n){for(var i in e)n&&n.indexOf(i)>=0||(t[i]=e[i])}(e,n),e.onChange&&(this.onChange=e.onChange),e.onDone&&(this.onDone=e.onDone),e.onOpen&&(this.onOpen=e.onOpen),e.onClose&&(this.onClose=e.onClose);var i=e.color||e.colour;i&&this._setColor(i)}var r=n.parent;if(r&&n.popup&&!this._popupInited){var s=function(e){return t.openHandler(e)};this._events.add(r,"click",s),_(this._events,r,[" ","Spacebar","Enter"],s),this._popupInited=!0}else e.parent&&!n.popup&&this.show()}}},{key:"openHandler",value:function(e){if(this.show()){e&&e.preventDefault(),this.settings.parent.style.pointerEvents="none";var t=e&&"keydown"===e.type?this._domEdit:this.domElement;setTimeout((function(){return t.focus()}),100),this.onOpen&&this.onOpen(this.colour)}}},{key:"closeHandler",value:function(e){var t=e&&e.type,n=!1;if(e)if("mousedown"===t||"focusin"===t){var i=(this.__containedEvent||0)+100;e.timeStamp>i&&(n=!0)}else w(e),n=!0;else n=!0;n&&this.hide()&&(this.settings.parent.style.pointerEvents="","mousedown"!==t&&this.settings.parent.focus(),this.onClose&&this.onClose(this.colour))}},{key:"movePopup",value:function(e,t){this.closeHandler(),this.setOptions(e),t&&this.openHandler()}},{key:"setColor",value:function(e,t){this._setColor(e,{silent:t})}},{key:"_setColor",value:function(e,t){if("string"==typeof e&&(e=e.trim()),e){t=t||{};var n=void 0;try{n=new m(e)}catch(e){if(t.failSilently)return;throw e}if(!this.settings.alpha){var i=n.hsla;i[3]=1,n.hsla=i}this.colour=this.color=n,this._setHSLA(null,null,null,null,t)}}},{key:"setColour",value:function(e,t){this.setColor(e,t)}},{key:"show",value:function(){if(!this.settings.parent)return!1;if(this.domElement){var e=this._toggleDOM(!0);return this._setPosition(),e}var t,n,i=this.settings.template||'<div class="picker_wrapper" tabindex="-1"><div class="picker_arrow"></div><div class="picker_hue picker_slider"><div class="picker_selector"></div></div><div class="picker_sl"><div class="picker_selector"></div></div><div class="picker_alpha picker_slider"><div class="picker_selector"></div></div><div class="picker_editor"><input aria-label="Type a color name or hex value"/></div><div class="picker_sample"></div><div class="picker_done"><button>Ok</button></div><div class="picker_cancel"><button>Cancel</button></div></div>',r=(t=i,(n=document.createElement("div")).innerHTML=t,n.firstElementChild);return this.domElement=r,this._domH=b(".picker_hue",r),this._domSL=b(".picker_sl",r),this._domA=b(".picker_alpha",r),this._domEdit=b(".picker_editor input",r),this._domSample=b(".picker_sample",r),this._domOkay=b(".picker_done button",r),this._domCancel=b(".picker_cancel button",r),r.classList.add("layout_"+this.settings.layout),this.settings.alpha||r.classList.add("no_alpha"),this.settings.editor||r.classList.add("no_editor"),this.settings.cancelButton||r.classList.add("no_cancel"),this._ifPopup((function(){return r.classList.add("popup")})),this._setPosition(),this.colour?this._updateUI():this._setColor(this.settings.defaultColor),this._bindEvents(),!0}},{key:"hide",value:function(){return this._toggleDOM(!1)}},{key:"destroy",value:function(){this._events.destroy(),this.domElement&&this.settings.parent.removeChild(this.domElement)}},{key:"_bindEvents",value:function(){var e=this,t=this,n=this.domElement,i=this._events;function r(e,t,n){i.add(e,t,n)}r(n,"click",(function(e){return e.preventDefault()})),y(i,this._domH,(function(e,n){return t._setHSLA(e)})),y(i,this._domSL,(function(e,n){return t._setHSLA(null,e,1-n)})),this.settings.alpha&&y(i,this._domA,(function(e,n){return t._setHSLA(null,null,null,1-n)}));var s=this._domEdit;r(s,"input",(function(e){t._setColor(this.value,{fromEditor:!0,failSilently:!0})})),r(s,"focus",(function(e){this.selectionStart===this.selectionEnd&&this.select()})),this._ifPopup((function(){var t=function(t){return e.closeHandler(t)};r(window,"mousedown",t),r(window,"focusin",t),_(i,n,["Esc","Escape"],t);var s=function(t){e.__containedEvent=t.timeStamp};r(n,"mousedown",s),r(n,"focusin",s),r(e._domCancel,"click",t)}));var o=function(t){e._ifPopup((function(){return e.closeHandler(t)})),e.onDone&&e.onDone(e.colour)};r(this._domOkay,"click",o),_(i,n,["Enter"],o)}},{key:"_setPosition",value:function(){var e=this.settings.parent,t=this.domElement;e!==t.parentNode&&e.appendChild(t),this._ifPopup((function(n){"static"===getComputedStyle(e).position&&(e.style.position="relative");var i=!0===n?"popup_right":"popup_"+n;["popup_top","popup_bottom","popup_left","popup_right"].forEach((function(e){e===i?t.classList.add(e):t.classList.remove(e)})),t.classList.add(i)}))}},{key:"_setHSLA",value:function(e,t,n,i,r){r=r||{};var s=this.colour,o=s.hsla;[e,t,n,i].forEach((function(e,t){(e||0===e)&&(o[t]=e)})),s.hsla=o,this._updateUI(r),this.onChange&&!r.silent&&this.onChange(s)}},{key:"_updateUI",value:function(e){if(this.domElement){e=e||{};var t=this.colour,n=t.hsla,i="hsl("+360*n[0]+", 100%, 50%)",r=t.hslString,s=t.hslaString,o=this._domH,a=this._domSL,l=this._domA,c=b(".picker_selector",o),d=b(".picker_selector",a),u=b(".picker_selector",l);y(0,c,n[0]),this._domSL.style.backgroundColor=this._domH.style.color=i,y(0,d,n[1]),w(0,d,1-n[2]),a.style.color=r,w(0,u,1-n[3]);var p=r,h=p.replace("hsl","hsla").replace(")",", 0)"),f="linear-gradient("+[p,h]+")";if(this._domA.style.background=f+", linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0 / 2em 2em,\n linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em / 2em 2em",!e.fromEditor){var g=this.settings.editorFormat,m=this.settings.alpha,v=void 0;switch(g){case"rgb":v=t.printRGB(m);break;case"hsl":v=t.printHSL(m);break;default:v=t.printHex(m)}this._domEdit.value=v}this._domSample.style.color=s}function y(e,t,n){t.style.left=100*n+"%"}function w(e,t,n){t.style.top=100*n+"%"}}},{key:"_ifPopup",value:function(e,t){this.settings.parent&&this.settings.popup?e&&e(this.settings.popup):t&&t()}},{key:"_toggleDOM",value:function(e){var t=this.domElement;if(!t)return!1;var n=e?"":"none",i=t.style.display!==n;return i&&(t.style.display=n),i}}]),e}(),x=document.createElement("style");x.textContent='.picker_wrapper.no_alpha .picker_alpha{display:none}.picker_wrapper.no_editor .picker_editor{position:absolute;z-index:-1;opacity:0}.picker_wrapper.no_cancel .picker_cancel{display:none}.layout_default.picker_wrapper{display:flex;flex-flow:row wrap;justify-content:space-between;align-items:stretch;font-size:10px;width:25em;padding:.5em}.layout_default.picker_wrapper input,.layout_default.picker_wrapper button{font-size:1rem}.layout_default.picker_wrapper>*{margin:.5em}.layout_default.picker_wrapper::before{content:"";display:block;width:100%;height:0;order:1}.layout_default .picker_slider,.layout_default .picker_selector{padding:1em}.layout_default .picker_hue{width:100%}.layout_default .picker_sl{flex:1 1 auto}.layout_default .picker_sl::before{content:"";display:block;padding-bottom:100%}.layout_default .picker_editor{order:1;width:6.5rem}.layout_default .picker_editor input{width:100%;height:100%}.layout_default .picker_sample{order:1;flex:1 1 auto}.layout_default .picker_done,.layout_default .picker_cancel{order:1}.picker_wrapper{box-sizing:border-box;background:#f2f2f2;box-shadow:0 0 0 1px silver;cursor:default;font-family:sans-serif;color:#444;pointer-events:auto}.picker_wrapper:focus{outline:none}.picker_wrapper button,.picker_wrapper input{box-sizing:border-box;border:none;box-shadow:0 0 0 1px silver;outline:none}.picker_wrapper button:focus,.picker_wrapper button:active,.picker_wrapper input:focus,.picker_wrapper input:active{box-shadow:0 0 2px 1px #1e90ff}.picker_wrapper button{padding:.4em .6em;cursor:pointer;background-color:#f5f5f5;background-image:linear-gradient(0deg, gainsboro, transparent)}.picker_wrapper button:active{background-image:linear-gradient(0deg, transparent, gainsboro)}.picker_wrapper button:hover{background-color:#fff}.picker_selector{position:absolute;z-index:1;display:block;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);border:2px solid #fff;border-radius:100%;box-shadow:0 0 3px 1px #67b9ff;background:currentColor;cursor:pointer}.picker_slider .picker_selector{border-radius:2px}.picker_hue{position:relative;background-image:linear-gradient(90deg, red, yellow, lime, cyan, blue, magenta, red);box-shadow:0 0 0 1px silver}.picker_sl{position:relative;box-shadow:0 0 0 1px silver;background-image:linear-gradient(180deg, white, rgba(255, 255, 255, 0) 50%),linear-gradient(0deg, black, rgba(0, 0, 0, 0) 50%),linear-gradient(90deg, #808080, rgba(128, 128, 128, 0))}.picker_alpha,.picker_sample{position:relative;background:linear-gradient(45deg, lightgrey 25%, transparent 25%, transparent 75%, lightgrey 75%) 0 0/2em 2em,linear-gradient(45deg, lightgrey 25%, white 25%, white 75%, lightgrey 75%) 1em 1em/2em 2em;box-shadow:0 0 0 1px silver}.picker_alpha .picker_selector,.picker_sample .picker_selector{background:none}.picker_editor input{font-family:monospace;padding:.2em .4em}.picker_sample::before{content:"";position:absolute;display:block;width:100%;height:100%;background:currentColor}.picker_arrow{position:absolute;z-index:-1}.picker_wrapper.popup{position:absolute;z-index:2;margin:1.5em}.picker_wrapper.popup,.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{background:#f2f2f2;box-shadow:0 0 10px 1px rgba(0,0,0,.4)}.picker_wrapper.popup .picker_arrow{width:3em;height:3em;margin:0}.picker_wrapper.popup .picker_arrow::before,.picker_wrapper.popup .picker_arrow::after{content:"";display:block;position:absolute;top:0;left:0;z-index:-99}.picker_wrapper.popup .picker_arrow::before{width:100%;height:100%;-webkit-transform:skew(45deg);transform:skew(45deg);-webkit-transform-origin:0 100%;transform-origin:0 100%}.picker_wrapper.popup .picker_arrow::after{width:150%;height:150%;box-shadow:none}.popup.popup_top{bottom:100%;left:0}.popup.popup_top .picker_arrow{bottom:0;left:0;-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.popup.popup_bottom{top:100%;left:0}.popup.popup_bottom .picker_arrow{top:0;left:0;-webkit-transform:rotate(90deg) scale(1, -1);transform:rotate(90deg) scale(1, -1)}.popup.popup_left{top:0;right:100%}.popup.popup_left .picker_arrow{top:0;right:0;-webkit-transform:scale(-1, 1);transform:scale(-1, 1)}.popup.popup_right{top:0;left:100%}.popup.popup_right .picker_arrow{top:0;left:0}',document.documentElement.firstElementChild.appendChild(x),k.StyleElement=x,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"),s=r()(n).children(".preview"),o=void 0!==r()(i).attr("alpha");new k({parent:n[0],popup:"top",alpha:o,color:i[0].value,onChange:function(e){s[0].style.backgroundColor=e.rgbaString,i[0].setAttribute("value",e.hex.endsWith("ff")&&e.hex.length>6?e.hex.slice(0,-2):e.hex)}})}},e}));n(4);function D(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $(e){return e[e.length-1]}function S(e,...t){return t.forEach(t=>{e.includes(t)||e.push(t)}),e}function E(e,t){return e?e.split(t):[]}function C(e,t,n){return(void 0===t||e>=t)&&(void 0===n||e<=n)}function A(e,t,n){return e<t?t:e>n?n:e}function L(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 s=i+1;return s<t?L(e,t,n,s,r):r}function O(e){return e.replace(/>\s+/g,">").replace(/\s+</,"<")}function j(e){return new Date(e).setHours(0,0,0,0)}function T(){return(new Date).setHours(0,0,0,0)}function M(...e){switch(e.length){case 0:return T();case 1:return j(e[0])}const t=new Date(0);return t.setFullYear(...e),t.setHours(0,0,0,0)}function F(e,t){const n=new Date(e);return n.setDate(n.getDate()+t)}function N(e,t){const n=new Date(e),i=n.getMonth()+t;let r=i%12;r<0&&(r+=12);const s=n.setMonth(i);return n.getMonth()!==r?n.setDate(0):s}function I(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 P(e,t){return(e-t+7)%7}function q(e,t,n=0){const i=new Date(e).getDay();return F(e,P(t,n)-P(i,n))}function H(e,t){const n=new Date(e).getFullYear();return Math.floor(n/t)*t}function R(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 B=/dd?|DD?|mm?|MM?|yy?(?:yy)?/,z=/[\s!-/:-@[-`{-~年月日]+/;let W={};const V={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))},U={d:e=>e.getDate(),dd:e=>Y(e.getDate(),2),D:(e,t)=>t.daysShort[e.getDay()],DD:(e,t)=>t.days[e.getDay()],m:e=>e.getMonth()+1,mm:e=>Y(e.getMonth()+1,2),M:(e,t)=>t.monthsShort[e.getMonth()],MM:(e,t)=>t.months[e.getMonth()],y:e=>e.getFullYear(),yy:e=>Y(e.getFullYear(),2).slice(-2),yyyy:e=>Y(e.getFullYear(),4)};function Y(e,t){return e.toString().padStart(t,"0")}function G(e){if("string"!=typeof e)throw new Error("Invalid date format.");if(e in W)return W[e];const t=e.split(B),n=e.match(new RegExp(B,"g"));if(0===t.length||!n)throw new Error("Invalid date format.");const i=n.map(e=>U[e]),r=Object.keys(V).reduce((e,t)=>(n.find(e=>"D"!==e[0]&&e[0].toLowerCase()===t)&&e.push(t),e),[]);return W[e]={parser(e,t){const i=e.split(z).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=V[n](e,i[n],t);return isNaN(r)?e:r},T())},formatter:(e,n)=>i.reduce((i,r,s)=>i+`${t[s]}${r(e,n)}`,"")+$(t)}}function K(e,t,n){if(e instanceof Date||"number"==typeof e){const t=j(e);return isNaN(t)?void 0:t}if(e){if("today"===e)return T();if(t&&t.toValue){const i=t.toValue(e,t,n);return isNaN(i)?void 0:j(i)}return G(t).parser(e,n)}}function Z(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):G(t).formatter(i,n)}const J=document.createRange();function Q(e){return J.createContextualFragment(e)}function X(e){return e.parentElement||(e.parentNode instanceof ShadowRoot?e.parentNode.host:void 0)}function ee(e){return e.getRootNode().activeElement===e}function te(e){"none"!==e.style.display&&(e.style.display&&(e.dataset.styleDisplay=e.style.display),e.style.display="none")}function ne(e){"none"===e.style.display&&(e.dataset.styleDisplay?(e.style.display=e.dataset.styleDisplay,delete e.dataset.styleDisplay):e.style.display="")}function ie(e){e.firstChild&&(e.removeChild(e.firstChild),ie(e))}const re=new WeakMap,{addEventListener:se,removeEventListener:oe}=EventTarget.prototype;function ae(e,t){let n=re.get(e);n||(n=[],re.set(e,n)),t.forEach(e=>{se.call(...e),n.push(e)})}function le(e){let t=re.get(e);t&&(t.forEach(e=>{oe.call(...e)}),re.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 ce(e,t){const n="function"==typeof t?t:e=>e instanceof Element&&e.matches(t);return function e(t,n,i){const[r,...s]=t;return n(r)?r:r!==i&&"HTML"!==r.tagName&&0!==s.length?e(s,n,i):void 0}(e.composedPath(),n,e.currentTarget)}const de={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"}};var ue={autohide:!1,beforeShowDay:null,beforeShowDecade:null,beforeShowMonth:null,beforeShowYear:null,calendarWeeks:!1,clearBtn:!1,dateDelimiter:",",datesDisabled:[],daysOfWeekDisabled:[],daysOfWeekHighlighted:[],defaultViewDate:void 0,disableTouchKeyboard:!1,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:"",todayBtn:!1,todayBtnMode:0,todayHighlight:!1,updateOnBlur:!0,weekStart:0};const{language:pe,format:he,weekStart:fe}=ue;function ge(e,t){return e.length<6&&t>=0&&t<7?S(e,t):e}function me(e){return(e+6)%7}function ve(e,t,n,i){const r=K(e,t,n);return void 0!==r?r:i}function ye(e,t,n=3){const i=parseInt(e,10);return i>=0&&i<=n?i:t}function be(e,t){const n=Object.assign({},e),i={},r=t.constructor.locales,s=t.rangeSideIndex;let{format:o,language:a,locale:l,maxDate:c,maxView:d,minDate:u,pickLevel:p,startView:h,weekStart:f}=t.config||{};if(n.language){let e;if(n.language!==a&&(r[n.language]?e=n.language:(e=n.language.split("-")[0],void 0===r[e]&&(e=!1))),delete n.language,e){a=i.language=e;const t=l||r[pe];l=Object.assign({format:he,weekStart:fe},r[pe]),a!==pe&&Object.assign(l,r[a]),i.locale=l,o===t.format&&(o=i.format=l.format),f===t.weekStart&&(f=i.weekStart=l.weekStart,i.weekEnd=me(l.weekStart))}}if(n.format){const e="function"==typeof n.format.toDisplay,t="function"==typeof n.format.toValue,r=B.test(n.format);(e&&t||r)&&(o=i.format=n.format),delete n.format}let g=p;void 0!==n.pickLevel&&(g=ye(n.pickLevel,2),delete n.pickLevel),g!==p&&(g>p&&(void 0===n.minDate&&(n.minDate=u),void 0===n.maxDate&&(n.maxDate=c)),n.datesDisabled||(n.datesDisabled=[]),p=i.pickLevel=g);let m=u,v=c;if(void 0!==n.minDate){const e=M(0,0,1);m=null===n.minDate?e:ve(n.minDate,o,l,m),m!==e&&(m=R(m,p,!1)),delete n.minDate}if(void 0!==n.maxDate&&(v=null===n.maxDate?void 0:ve(n.maxDate,o,l,v),void 0!==v&&(v=R(v,p,!0)),delete n.maxDate),v<m?(u=i.minDate=v,c=i.maxDate=m):(u!==m&&(u=i.minDate=m),c!==v&&(c=i.maxDate=v)),n.datesDisabled&&(i.datesDisabled=n.datesDisabled.reduce((e,t)=>{const n=K(t,o,l);return void 0!==n?S(e,R(n,p,s)):e},[]),delete n.datesDisabled),void 0!==n.defaultViewDate){const e=K(n.defaultViewDate,o,l);void 0!==e&&(i.defaultViewDate=e),delete n.defaultViewDate}if(void 0!==n.weekStart){const e=Number(n.weekStart)%7;isNaN(e)||(f=i.weekStart=e,i.weekEnd=me(e)),delete n.weekStart}if(n.daysOfWeekDisabled&&(i.daysOfWeekDisabled=n.daysOfWeekDisabled.reduce(ge,[]),delete n.daysOfWeekDisabled),n.daysOfWeekHighlighted&&(i.daysOfWeekHighlighted=n.daysOfWeekHighlighted.reduce(ge,[]),delete n.daysOfWeekHighlighted),void 0!==n.maxNumberOfDates){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 y=d;void 0!==n.maxView&&(y=ye(n.maxView,d),delete n.maxView),y=p>y?p:y,y!==d&&(d=i.maxView=y);let b=h;if(void 0!==n.startView&&(b=ye(n.startView,b),delete n.startView),b<p?b=p:b>d&&(b=d),b!==h&&(i.startView=b),n.prevArrow){const e=Q(n.prevArrow);e.childNodes.length>0&&(i.prevArrow=e.childNodes),delete n.prevArrow}if(n.nextArrow){const e=Q(n.nextArrow);e.childNodes.length>0&&(i.nextArrow=e.childNodes),delete n.nextArrow}if(void 0!==n.disableTouchKeyboard&&(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(void 0!==n.todayBtnMode){switch(n.todayBtnMode){case 0:case 1:i.todayBtnMode=n.todayBtnMode}delete n.todayBtnMode}return Object.keys(n).forEach(e=>{void 0!==n[e]&&D(ue,e)&&(i[e]=n[e])}),i}var we=O('<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-btn"></button>\n <button type="button" class="%buttonClass% view-switch"></button>\n <button type="button" class="%buttonClass% 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-btn"></button>\n <button type="button" class="%buttonClass% clear-btn"></button>\n </div>\n </div>\n </div>\n</div>');var _e=O(`<div class="days">\n <div class="days-of-week">${L("span",7,{class:"dow"})}</div>\n <div class="datepicker-grid">${L("span",42)}</div>\n</div>`);var ke=O(`<div class="calendar-weeks">\n <div class="days-of-week"><span class="dow"></span></div>\n <div class="weeks">${L("span",6,{class:"week"})}</div>\n</div>`);class xe{constructor(e,t){Object.assign(this,t,{picker:e,element:Q('<div class="datepicker-view"></div>').firstChild,selected:[]}),this.init(this.picker.datepicker.config)}init(e){void 0!==e.pickLevel&&(this.isMinView=this.id===e.pickLevel),this.setOptions(e),this.updateFocus(),this.updateSelection()}performBeforeHook(e,t,n){let i=this.beforeShow(new Date(n));switch(typeof i){case"boolean":i={enabled:i};break;case"string":i={classes:i}}if(i){if(!1===i.enabled&&(e.classList.add("disabled"),S(this.disabled,t)),i.classes){const n=i.classes.split(/\s+/);e.classList.add(...n),n.includes("disabled")&&S(this.disabled,t)}i.content&&function(e,t){ie(e),t instanceof DocumentFragment?e.appendChild(t):"string"==typeof t?e.appendChild(Q(t)):"function"==typeof t.forEach&&t.forEach(t=>{e.appendChild(t)})}(e,i.content)}}}class De extends xe{constructor(e){super(e,{id:0,name:"days",cellClass:"day"})}init(e,t=!0){if(t){const e=Q(_e).firstChild;this.dow=e.firstChild,this.grid=e.lastChild,this.element.appendChild(e)}super.init(e)}setOptions(e){let t;if(D(e,"minDate")&&(this.minDate=e.minDate),D(e,"maxDate")&&(this.maxDate=e.maxDate),e.datesDisabled&&(this.datesDisabled=e.datesDisabled),e.daysOfWeekDisabled&&(this.daysOfWeekDisabled=e.daysOfWeekDisabled,t=!0),e.daysOfWeekHighlighted&&(this.daysOfWeekHighlighted=e.daysOfWeekHighlighted),void 0!==e.todayHighlight&&(this.todayHighlight=e.todayHighlight),void 0!==e.weekStart&&(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(void 0!==e.beforeShowDay&&(this.beforeShow="function"==typeof e.beforeShowDay?e.beforeShowDay:void 0),void 0!==e.calendarWeeks)if(e.calendarWeeks&&!this.calendarWeeks){const e=Q(ke).firstChild;this.calendarWeeks={element:e,dow:e.firstChild,weeks:e.lastChild},this.element.insertBefore(e,this.element.firstChild)}else this.calendarWeeks&&!e.calendarWeeks&&(this.element.removeChild(this.calendarWeeks.element),this.calendarWeeks=null);void 0!==e.showDaysOfWeek&&(e.showDaysOfWeek?(ne(this.dow),this.calendarWeeks&&ne(this.calendarWeeks.dow)):(te(this.dow),this.calendarWeeks&&te(this.calendarWeeks.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=M(t,n,1),r=q(i,this.weekStart,this.weekStart);this.first=i,this.last=M(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(){this.today=this.todayHighlight?T():void 0,this.disabled=[...this.datesDisabled];const e=Z(this.focused,this.switchLabelFormat,this.locale);if(this.picker.setViewSwitchLabel(e),this.picker.setPrevBtnDisabled(this.first<=this.minDate),this.picker.setNextBtnDisabled(this.last>=this.maxDate),this.calendarWeeks){const e=q(this.first,1,1);Array.from(this.calendarWeeks.weeks.children).forEach((t,n)=>{t.textContent=function(e){const t=q(e,4,1),n=q(new Date(t).setMonth(0,4),4,1);return Math.round((t-n)/6048e5)+1}(F(e,7*n))})}Array.from(this.grid.children).forEach((e,t)=>{const n=e.classList,i=F(this.start,t),r=new Date(i),s=r.getDay();if(e.className="datepicker-cell "+this.cellClass,e.dataset.date=i,e.textContent=r.getDate(),i<this.first?n.add("prev"):i>this.last&&n.add("next"),this.today===i&&n.add("today"),(i<this.minDate||i>this.maxDate||this.disabled.includes(i))&&n.add("disabled"),this.daysOfWeekDisabled.includes(s)&&(n.add("disabled"),S(this.disabled,i)),this.daysOfWeekHighlighted.includes(s)&&n.add("highlighted"),this.range){const[e,t]=this.range;i>e&&i<t&&n.add("range"),i===e&&n.add("range-start"),i===t&&n.add("range-end")}this.selected.includes(i)&&n.add("selected"),i===this.focused&&n.add("focused"),this.beforeShow&&this.performBeforeHook(e,i,i)})}refresh(){const[e,t]=this.range||[];this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(e=>{e.classList.remove("range","range-start","range-end","selected","focused")}),Array.from(this.grid.children).forEach(n=>{const i=Number(n.dataset.date),r=n.classList;i>e&&i<t&&r.add("range"),i===e&&r.add("range-start"),i===t&&r.add("range-end"),this.selected.includes(i)&&r.add("selected"),i===this.focused&&r.add("focused")})}refreshFocus(){const e=Math.round((this.focused-this.start)/864e5);this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}function $e(e,t){if(!e||!e[0]||!e[1])return;const[[n,i],[r,s]]=e;return n>t||r<t?void 0:[n===t?i:-1,r===t?s:12]}class Se extends xe{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(Q(L("span",12,{"data-month":e=>e})))),super.init(e)}setOptions(e){if(e.locale&&(this.monthNames=e.locale.monthsShort),D(e,"minDate"))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(D(e,"maxDate"))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=M(this.maxYear,this.maxMonth+1,0)}this.isMinView?e.datesDisabled&&(this.datesDisabled=e.datesDisabled):this.datesDisabled=[],void 0!==e.beforeShowMonth&&(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]:S(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.disabled=this.datesDisabled.reduce((e,t)=>{const n=new Date(t);return this.year===n.getFullYear()&&e.push(n.getMonth()),e},[]),this.picker.setViewSwitchLabel(this.year),this.picker.setPrevBtnDisabled(this.year<=this.minYear),this.picker.setNextBtnDisabled(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=$e(this.range,this.year);Array.from(this.grid.children).forEach((s,o)=>{const a=s.classList,l=M(this.year,o,1);if(s.className="datepicker-cell "+this.cellClass,this.isMinView&&(s.dataset.date=l),s.textContent=this.monthNames[o],(t||n&&o<this.minMonth||i&&o>this.maxMonth||this.disabled.includes(o))&&a.add("disabled"),r){const[e,t]=r;o>e&&o<t&&a.add("range"),o===e&&a.add("range-start"),o===t&&a.add("range-end")}e.includes(o)&&a.add("selected"),o===this.focused&&a.add("focused"),this.beforeShow&&this.performBeforeHook(s,o,l)})}refresh(){const e=this.selected[this.year]||[],[t,n]=$e(this.range,this.year)||[];this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(e=>{e.classList.remove("range","range-start","range-end","selected","focused")}),Array.from(this.grid.children).forEach((i,r)=>{const s=i.classList;r>t&&r<n&&s.add("range"),r===t&&s.add("range-start"),r===n&&s.add("range-end"),e.includes(r)&&s.add("selected"),r===this.focused&&s.add("focused")})}refreshFocus(){this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[this.focused].classList.add("focused")}}class Ee extends xe{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(Q(L("span",12)))),super.init(e)}setOptions(e){if(D(e,"minDate")&&(void 0===e.minDate?this.minYear=this.minDate=void 0:(this.minYear=H(e.minDate,this.step),this.minDate=M(this.minYear,0,1))),D(e,"maxDate")&&(void 0===e.maxDate?this.maxYear=this.maxDate=void 0:(this.maxYear=H(e.maxDate,this.step),this.maxDate=M(this.maxYear,11,31))),this.isMinView?e.datesDisabled&&(this.datesDisabled=e.datesDisabled):this.datesDisabled=[],void 0!==e[this.beforeShowOption]){const t=e[this.beforeShowOption];this.beforeShow="function"==typeof t?t:void 0}}updateFocus(){const e=new Date(this.picker.viewDate),t=H(e,this.navStep),n=t+9*this.step;this.first=t,this.last=n,this.start=t-this.step,this.focused=H(e,this.step)}updateSelection(){const{dates:e,rangepicker:t}=this.picker.datepicker;this.selected=e.reduce((e,t)=>S(e,H(t,this.step)),[]),t&&t.dates&&(this.range=t.dates.map(e=>{if(void 0!==e)return H(e,this.step)}))}render(){this.disabled=this.datesDisabled.map(e=>new Date(e).getFullYear()),this.picker.setViewSwitchLabel(`${this.first}-${this.last}`),this.picker.setPrevBtnDisabled(this.first<=this.minYear),this.picker.setNextBtnDisabled(this.last>=this.maxYear),Array.from(this.grid.children).forEach((e,t)=>{const n=e.classList,i=this.start+t*this.step,r=M(i,0,1);if(e.className="datepicker-cell "+this.cellClass,this.isMinView&&(e.dataset.date=r),e.textContent=e.dataset.year=i,0===t?n.add("prev"):11===t&&n.add("next"),(i<this.minYear||i>this.maxYear||this.disabled.includes(i))&&n.add("disabled"),this.range){const[e,t]=this.range;i>e&&i<t&&n.add("range"),i===e&&n.add("range-start"),i===t&&n.add("range-end")}this.selected.includes(i)&&n.add("selected"),i===this.focused&&n.add("focused"),this.beforeShow&&this.performBeforeHook(e,i,r)})}refresh(){const[e,t]=this.range||[];this.grid.querySelectorAll(".range, .range-start, .range-end, .selected, .focused").forEach(e=>{e.classList.remove("range","range-start","range-end","selected","focused")}),Array.from(this.grid.children).forEach(n=>{const i=Number(n.textContent),r=n.classList;i>e&&i<t&&r.add("range"),i===e&&r.add("range-start"),i===t&&r.add("range-end"),this.selected.includes(i)&&r.add("selected"),i===this.focused&&r.add("focused")})}refreshFocus(){const e=Math.round((this.focused-this.start)/this.step);this.grid.querySelectorAll(".focused").forEach(e=>{e.classList.remove("focused")}),this.grid.children[e].classList.add("focused")}}function Ce(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 Ae(e,t){const{minDate:n,maxDate:i}=e.config,{currentView:r,viewDate:s}=e.picker;let o;switch(r.id){case 0:o=N(s,t);break;case 1:o=I(s,t);break;default:o=I(s,t*r.navStep)}o=A(o,n,i),e.picker.changeFocus(o).render()}function Le(e){const t=e.picker.currentView.id;t!==e.config.maxView&&e.picker.changeView(t+1).render()}function Oe(e){e.config.updateOnBlur?e.update({revert:!0}):e.refresh("input"),e.hide()}function je(e,t){const n=e.picker,i=new Date(n.viewDate),r=n.currentView.id,s=1===r?N(i,t-i.getMonth()):I(i,t-i.getFullYear());n.changeFocus(s).changeView(r-1).render()}function Te(e){const t=e.picker,n=T();if(1===e.config.todayBtnMode){if(e.config.autohide)return void e.setDate(n);e.setDate(n,{render:!1}),t.update()}t.viewDate!==n&&t.changeFocus(n),t.changeView(0).render()}function Me(e){e.setDate({clear:!0})}function Fe(e){Le(e)}function Ne(e){Ae(e,-1)}function Ie(e){Ae(e,1)}function Pe(e,t){const n=ce(t,".datepicker-cell");if(!n||n.classList.contains("disabled"))return;const{id:i,isMinView:r}=e.picker.currentView;r?e.setDate(Number(n.dataset.date)):je(e,Number(1===i?n.dataset.month:n.dataset.year))}function qe(e){e.preventDefault()}const He=["left","top","right","bottom"].reduce((e,t)=>(e[t]="datepicker-orient-"+t,e),{}),Re=e=>e?e+"px":e;function Be(e,t){if(void 0!==t.title&&(t.title?(e.controls.title.textContent=t.title,ne(e.controls.title)):(e.controls.title.textContent="",te(e.controls.title))),t.prevArrow){const n=e.controls.prevBtn;ie(n),t.prevArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.nextArrow){const n=e.controls.nextBtn;ie(n),t.nextArrow.forEach(e=>{n.appendChild(e.cloneNode(!0))})}if(t.locale&&(e.controls.todayBtn.textContent=t.locale.today,e.controls.clearBtn.textContent=t.locale.clear),void 0!==t.todayBtn&&(t.todayBtn?ne(e.controls.todayBtn):te(e.controls.todayBtn)),D(t,"minDate")||D(t,"maxDate")){const{minDate:t,maxDate:n}=e.datepicker.config;e.controls.todayBtn.disabled=!C(T(),t,n)}void 0!==t.clearBtn&&(t.clearBtn?ne(e.controls.clearBtn):te(e.controls.clearBtn))}function ze(e){const{dates:t,config:n}=e;return A(t.length>0?$(t):n.defaultViewDate,n.minDate,n.maxDate)}function We(e,t){const n=new Date(e.viewDate),i=new Date(t),{id:r,year:s,first:o,last:a}=e.currentView,l=i.getFullYear();switch(e.viewDate=t,l!==n.getFullYear()&&Ce(e.datepicker,"changeYear"),i.getMonth()!==n.getMonth()&&Ce(e.datepicker,"changeMonth"),r){case 0:return t<o||t>a;case 1:return l!==s;default:return l<o||l>a}}function Ve(e){return window.getComputedStyle(e).direction}class Ue{constructor(e){const{config:t}=this.datepicker=e,n=we.replace(/%buttonClass%/g,t.buttonClass),i=this.element=Q(n).firstChild,[r,s,o]=i.firstChild.children,a=r.firstElementChild,[l,c,d]=r.lastElementChild.children,[u,p]=o.firstChild.children,h={title:a,prevBtn:l,viewSwitch:c,nextBtn:d,todayBtn:u,clearBtn:p};this.main=s,this.controls=h;const f=e.inline?"inline":"dropdown";i.classList.add("datepicker-"+f),Be(this,t),this.viewDate=ze(e),ae(e,[[i,"mousedown",qe],[s,"click",Pe.bind(null,e)],[h.viewSwitch,"click",Fe.bind(null,e)],[h.prevBtn,"click",Ne.bind(null,e)],[h.nextBtn,"click",Ie.bind(null,e)],[h.todayBtn,"click",Te.bind(null,e)],[h.clearBtn,"click",Me.bind(null,e)]]),this.views=[new De(this),new Se(this),new Ee(this,{id:2,name:"years",cellClass:"year",step:1}),new Ee(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):e.inputField.after(this.element)}setOptions(e){Be(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;if(e.inline)t.classList.add("active");else{const n=Ve(e.inputField);n!==Ve(X(t))?t.dir=n:t.dir&&t.removeAttribute("dir"),t.style.visiblity="hidden",t.classList.add("active"),this.place(),t.style.visiblity="",e.config.disableTouchKeyboard&&e.inputField.blur()}this.active=!0,Ce(e,"show")}hide(){this.active&&(this.datepicker.exitEditMode(),this.element.classList.remove("active"),this.active=!1,Ce(this.datepicker,"hide"))}place(){const{classList:e,offsetParent:t,style:n}=this.element,{config:i,inputField:r}=this.datepicker,{width:s,height:o}=this.element.getBoundingClientRect(),{left:a,top:l,right:c,bottom:d,width:u,height:p}=r.getBoundingClientRect();let{x:h,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=X(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"===h&&(a<y?(h="left",k=y-a):a+s>w?(h="right",w<c&&(k=w-c)):h="rtl"===Ve(r)?c-s<y?"left":"right":"left"),"right"===h&&(g+=u-s),g+=k,"auto"===f&&(f=l-o>b&&d+o>_?"top":"bottom"),"top"===f?m-=o:m+=p,e.remove(...Object.values(He)),e.add(He[h],He[f]),n.left=Re(g),n.top=Re(m)}setViewSwitchLabel(e){this.controls.viewSwitch.textContent=e}setPrevBtnDisabled(e){this.controls.prevBtn.disabled=e}setNextBtnDisabled(e){this.controls.nextBtn.disabled=e}changeView(e){const t=this.currentView,n=this.views[e];return n.id!==t.id&&(this.currentView=n,this._renderMethod="render",Ce(this.datepicker,"changeView"),this.main.replaceChild(n.element,t.element)),this}changeFocus(e){return this._renderMethod=We(this,e)?"render":"refreshFocus",this.views.forEach(e=>{e.updateFocus()}),this}update(){const e=ze(this.datepicker);return this._renderMethod=We(this,e)?"render":"refresh",this.views.forEach(e=>{e.updateFocus(),e.updateSelection()}),this}render(e=!0){const t=e&&this._renderMethod||"render";delete this._renderMethod,this.currentView[t]()}}function Ye(e,t,n,i){const r=e.picker,s=r.currentView,o=s.step||1;let a,l,c=r.viewDate;switch(s.id){case 0:c=i?F(c,7*n):t.ctrlKey||t.metaKey?I(c,n):F(c,n),a=F,l=e=>s.disabled.includes(e);break;case 1:c=N(c,i?4*n:n),a=N,l=e=>{const t=new Date(e),{year:n,disabled:i}=s;return t.getFullYear()===n&&i.includes(t.getMonth())};break;default:c=I(c,n*(i?4:1)*o),a=I,l=e=>s.disabled.includes(H(e,o))}c=function e(t,n,i,r,s,o){if(C(t,s,o)){if(r(t)){return e(n(t,i),n,i,r,s,o)}return t}}(c,a,n<0?-o:o,l,s.minDate,s.maxDate),void 0!==c&&r.changeFocus(c).render()}function Ge(e,t){const n=t.key;if("Tab"===n)return void Oe(e);const i=e.picker,{id:r,isMinView:s}=i.currentView;if(i.active){if(e.editMode)return void("Enter"===n?e.exitEditMode({update:!0,autohide:e.config.autohide}):"Escape"===n&&i.hide());if("ArrowLeft"===n)if(t.ctrlKey||t.metaKey)Ae(e,-1);else{if(t.shiftKey)return void e.enterEditMode();Ye(e,t,-1,!1)}else if("ArrowRight"===n)if(t.ctrlKey||t.metaKey)Ae(e,1);else{if(t.shiftKey)return void e.enterEditMode();Ye(e,t,1,!1)}else if("ArrowUp"===n)if(t.ctrlKey||t.metaKey)Le(e);else{if(t.shiftKey)return void e.enterEditMode();Ye(e,t,-1,!0)}else if("ArrowDown"===n){if(t.shiftKey&&!t.ctrlKey&&!t.metaKey)return void e.enterEditMode();Ye(e,t,1,!0)}else{if("Enter"!==n)return void("Escape"===n?i.hide():"Backspace"!==n&&"Delete"!==n&&(1!==n.length||t.ctrlKey||t.metaKey)||e.enterEditMode());if(s)return void e.setDate(i.viewDate);i.changeView(r-1).render()}}else{if("ArrowDown"!==n)return void("Enter"===n?e.update():"Escape"===n&&i.show());i.show()}t.preventDefault()}function Ke(e){e.config.showOnFocus&&!e._showing&&e.show()}function Ze(e,t){const n=t.target;(e.picker.active||e.config.showOnClick)&&(n._active=ee(n),n._clicking=setTimeout(()=>{delete n._active,delete n._clicking},2e3))}function Je(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 Qe(e,t){t.clipboardData.types.includes("text/plain")&&e.enterEditMode()}function Xe(e,t){const{element:n,picker:i}=e;if(!i.active&&!ee(n))return;const r=i.element;ce(t,e=>e===n||e===r)||Oe(e)}function et(e,t){return e.map(e=>Z(e,t.format,t.locale)).join(t.dateDelimiter)}function tt(e,t,n=!1){const{config:i,dates:r,rangeSideIndex:s}=e;if(0===t.length)return n?[]:void 0;let o=t.reduce((e,t)=>{let n=K(t,i.format,i.locale);return void 0===n||(n=R(n,i.pickLevel,s),!C(n,i.minDate,i.maxDate)||e.includes(n)||i.datesDisabled.includes(n)||!(i.pickLevel>0)&&i.daysOfWeekDisabled.includes(new Date(n).getDay())||e.push(n)),e},[]);return 0!==o.length?(i.multidate&&!n&&(o=o.reduce((e,t)=>(r.includes(t)||e.push(t),e),r.filter(e=>!o.includes(e)))),i.maxNumberOfDates&&o.length>i.maxNumberOfDates?o.slice(-1*i.maxNumberOfDates):o):void 0}function nt(e,t=3,n=!0){const{config:i,picker:r,inputField:s}=e;if(2&t){const e=r.active?i.pickLevel:i.startView;r.update().changeView(e).render(n)}1&t&&s&&(s.value=et(e.dates,i))}function it(e,t,n){let{clear:i,render:r,autohide:s,revert:o}=n;void 0===r&&(r=!0),r?void 0===s&&(s=e.config.autohide):s=!1;const a=tt(e,t,i);(a||o)&&(a&&a.toString()!==e.dates.toString()?(e.dates=a,nt(e,r?3:1),Ce(e,"changeDate")):nt(e,1),s&&e.hide())}class rt{constructor(e,t={},n){e.datepicker=this,this.element=e;const i=this.config=Object.assign({buttonClass:t.buttonClass&&String(t.buttonClass)||"button",container:null,defaultViewDate:T(),maxDate:void 0,minDate:void 0},be(ue,this)),r=this.inline="INPUT"!==e.tagName;let s,o;if(r?i.container=e:(t.container&&(i.container=t.container instanceof HTMLElement?t.container:document.querySelector(t.container)),s=this.inputField=e,s.classList.add("datepicker-input")),n){const e=n.inputs.indexOf(s),t=n.datepickers;if(e<0||e>1||!Array.isArray(t))throw Error("Invalid rangepicker object.");t[e]=this,Object.defineProperty(this,"rangepicker",{get:()=>n}),Object.defineProperty(this,"rangeSideIndex",{get:()=>e})}this._options=t,Object.assign(i,be(t,this)),r?(o=E(e.dataset.date,i.dateDelimiter),delete e.dataset.date):o=E(s.value,i.dateDelimiter),this.dates=[];const a=tt(this,o);a&&a.length>0&&(this.dates=a),s&&(s.value=et(this.dates,i));const l=this.picker=new Ue(this);if(r)this.show();else{const e=Xe.bind(null,this);ae(this,[[s,"keydown",Ge.bind(null,this)],[s,"focus",Ke.bind(null,this)],[s,"mousedown",Ze.bind(null,this)],[s,"click",Je.bind(null,this)],[s,"paste",Qe.bind(null,this)],[document,"mousedown",e],[document,"touchstart",e],[window,"resize",l.place.bind(l)]])}}static formatDate(e,t,n){return Z(e,t,n&&de[n]||de.en)}static parseDate(e,t,n){return K(e,t,n&&de[n]||de.en)}static get locales(){return de}get active(){return!(!this.picker||!this.picker.active)}get pickerElement(){return this.picker?this.picker.element:void 0}setOptions(e){const t=this.picker,n=be(e,this);Object.assign(this._options,e),Object.assign(this.config,n),t.setOptions(n),nt(this,3)}show(){if(this.inputField){if(this.inputField.disabled)return;ee(this.inputField)||this.config.disableTouchKeyboard||(this._showing=!0,this.inputField.focus(),delete this._showing)}this.picker.show()}hide(){this.inline||(this.picker.hide(),this.picker.update().changeView(this.config.startView).render())}destroy(){return this.hide(),le(this),this.picker.detach(),this.inline||this.inputField.classList.remove("datepicker-input"),delete this.element.datepicker,this}getDate(e){const t=e?t=>Z(t,e,this.config.locale):e=>new Date(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=$(e);"object"!=typeof i||Array.isArray(i)||i instanceof Date||!i||Object.assign(n,t.pop());it(this,Array.isArray(t[0])?t[0]:t,n)}update(e){if(this.inline)return;const t=Object.assign(e||{},{clear:!0,render:!0});it(this,E(this.inputField.value,this.config.dateDelimiter),t)}refresh(e,t=!1){let n;e&&"string"!=typeof e&&(t=e,e=void 0),n="picker"===e?2:"input"===e?1:3,nt(this,n,!t)}enterEditMode(){this.inline||!this.picker.active||this.editMode||(this.editMode=!0,this.inputField.classList.add("in-edit"))}exitEditMode(e){if(this.inline||!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 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,i.key,i)}}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"),s="no"!==r()(i).data("max")&&r()(i).data("max"),o="no"!==r()(i).data("min")&&r()(i).data("min");new rt(i[0],{autohide:!0,clearBtn:!0,maxDate:s,minDate:o,format:"dd/mm/yyyy"})}},e}));var ot=wp.i18n,at=ot.__;ot._x,ot._n,ot._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.file={load:function(e,t){new lt(e)}},e}));var lt=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(".upload"),this.removeButton=r()(this.fileSection).find(".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:at("Add file","custom-post-types"),frame:"select",library:wp.media.query({type:e.fileTypes,uploadedTo:wp.media.view.settings.post.id}),button:{text:at("Choose file","custom-post-types")},multiple:!1}).on("select",(function(){var t=n.state().get("selection").first().toJSON(),i=!!t.sizes&&t.sizes.thumbnail.url;i&&(r()(e.filePreview).attr("src",i),r()(e.filePreview).show());var s=t.mime;s.startsWith("image")&&(s="image"),s.startsWith("audio")&&(s="audio"),s.startsWith("video")&&(s="video"),"-1"!=r.a.inArray(s,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",at("Choose","custom-post-types"))}}])&&st(t.prototype,n),i&&st(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();n(1),n(2);function ct(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,i.key,i)}}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"),s={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(s.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(s)}},e}));var dt=wp.i18n;dt.__,dt._x,dt._n,dt._nx;wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.repeater={load:function(e,t){new ut(e)}},e}));var ut=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 s=r()(this.repeaterSection).find(".cpt-repeater-group");r.a.each(s,(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 s=r()(t.repeaterSection).children(".cpt-repeater-group").length,o=[];o.push({name:"action",value:"cpt-get-repeater-group"}),o.push({name:"nonce",value:cpt.ajax_nonce}),o.push({name:"fields",value:JSON.stringify(t.fields)}),o.push({name:"parent",value:t.parent+"["+s+"]"}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:o,success:function(n){if(n.success){r()(e).prop("disabled",!1),r()(i).remove();var s=r()(n.data);r()(t.repeaterSection).append(s),t.initFieldGroup(s)}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(".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("change",(function(e){r()(n).empty();var i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');r()(n).append(i);var s=!!r()(t).val().length&&r()(t).val();if(s){var o=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:s}),a.push({name:"parent",value:o}),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)}})}}))}}])&&ct(t.prototype,n),i&&ct(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();function pt(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,i.key,i)}}function ht(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}wp.hooks.addFilter(cpt.js_fields_events_hook,cpt.js_fields_events_namespace,(function(e){return e.select={load:function(e,t){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"),s={placeholder:r()(n).attr("placeholder")?r()(n).attr("placeholder"):" ... ",allowClear:!0,multiple:r()(n).prop("multiple")};i.length>0&&(s.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(s)}},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"),s=r()(i).data("value")?r()(i).data("value"):"",o="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(":"),s=null!==(e=r[0])&&void 0!==e&&e,o=null!==(t=r[1])&&void 0!==t&&t,a=Number(s+o);return Number.isInteger(a)?a:i},c=l(o),d=l(a),u=0;u<=23;u++){u=u<10?"0"+u:u;for(var p=0;p<=59;p++){var h=u+":"+(p=p<10?"0"+p:p);(d>0&&l(h)<d||c>0&&l(h)>c)&&c>d||r()(i).append(r()('<option value="'+h+'"'+(s==h?' selected="selected"':"")+">"+h+"</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 ft(e)}},e}));var ft=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ht(this,"editorEl",void 0),ht(this,"editorId",void 0),ht(this,"editorForm",void 0),ht(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()}))}}])&&pt(t.prototype,n),i&&pt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),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,i.key,i)}}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.utils=new d,this.loadFields(),this.loadUiFeatures()}var t,n,i;return t=e,(n=[{key:"loadUiFeatures",value:function(){var e=this;r()("body").on("click",".cpt-field-wrap.advanced-field-btn .button",(function(e){e.preventDefault();var t=r()(this).closest(".cpt-fields-section"),n=r()(t).find(".cpt-field-wrap.advanced-field");r()(this).hasClass("button-secondary")?(r()(n).removeClass("active"),r()(this).removeClass("button-secondary").addClass("button-primary"),r()(this).find(".dashicons").attr("class","dashicons dashicons-insert"),r()(this).find(".label").html(vt("Advanced view","custom-post-types"))):(r()(n).addClass("active"),r()(this).addClass("button-secondary").removeClass("button-primary"),r()(this).find(".dashicons").attr("class","dashicons dashicons-remove"),r()(this).find(".label").html(vt("Simple view","custom-post-types")))})),r()("body").on("click",".cpt-field-wrap .template-shortcode input.copy-shortcode",(function(t){t.preventDefault();var n=r()(t.currentTarget);if(!r()(n).hasClass("copying")){var i=r()(n).val();e.utils.copyToClipboard(r()(n))&&(r()(n).val(vt("Copied to the clipboard...","custom-post-types")),r()(n).addClass("copying"),r()(n).mouseleave((function(){r()(this).val(i),r()(this).removeClass("copying")})))}})),r()("body").on("select2:select",".cpt-field-wrap.template-supports select",(function(e){e.preventDefault();var t=r()(this).val().length>0&&r()(this).val(),n=r()(this).closest(".cpt-fields-section"),i=r()('<div class="cpt-repeater-spinner"><div class="spinner"></div></div>');if(r()(n).find(".template-shortcode").html(""),r()(n).find(".template-shortcode").append(i),t){var s=[];s.push({name:"action",value:"cpt-get-template-shortcodes"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"post-type",value:t}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?(r()(n).find(".template-shortcode").html(""),r()(n).find(".template-shortcode.fields").html(e.data.fields.join("")),r()(n).find(".template-shortcode.taxs").html(e.data.taxonomies.join(""))):console.log("Error",e)}})}else r()(i).remove()})),r()(window).on("load",(function(){if(r()("body").hasClass("block-editor-page")){var e=r()('.cpt-fields-section *[id^="meta-fields-"][required]');e.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"))}(e)}),200)}})),r()("body").on("click",".cpt-notice.is-dismissible a.cpt-dismiss-notice",(function(e){e.preventDefault();var t=r()(this).closest(".cpt-notice").find("button.notice-dismiss"),n=r()(this).data("notice"),i=r()(this).data("duration"),s=[];s.push({name:"action",value:"cpt-dismiss-notice"}),s.push({name:"nonce",value:cpt.ajax_nonce}),s.push({name:"key",value:n}),s.push({name:"duration",value:i}),r.a.ajax({type:"post",dataType:"json",url:cpt.ajax_url,data:s,success:function(e){e.success?t.click():console.log("Error",e)}})})),r()("body").on("click",".cpt-notice pre.error-code > a",(function(e){e.preventDefault(),r()(this).closest(".error-code").find("code").addClass("show"),r()(this).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'),s=r()(n).find('input[id$="-id"]:first');e.utils.autoFillKey(s,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/custom-post-types.php
r2918438 r2922197 8 8 Text Domain: custom-post-types 9 9 Domain Path: /languages/ 10 Version: 4.0. 210 Version: 4.0.3 11 11 */ 12 12 … … 860 860 update_option($this->getOptionName('installation_time'), time()); 861 861 862 $request_url = add_query_arg( 863 ['id' => 92, 'action' => 'updated', 'domain' => md5(get_home_url())], 864 'https://totalpress.org/wp-json/totalpress/v1/plugin-growth' 865 ); 866 wp_remote_get($request_url); 867 } 868 869 private function pluginActions() 870 { 871 register_activation_hook(__FILE__, function () { 862 if(!empty($installedVersion)){ 872 863 $request_url = add_query_arg( 873 ['id' => 92, 'action' => ' activate', 'domain' => md5(get_home_url())],864 ['id' => 92, 'action' => 'updated', 'domain' => md5(get_home_url()), 'v' => $currentVersion], 874 865 'https://totalpress.org/wp-json/totalpress/v1/plugin-growth' 875 866 ); 876 867 wp_remote_get($request_url); 877 }); 878 register_deactivation_hook(__FILE__, function () { 868 } 869 } 870 871 private function pluginActions() 872 { 873 $currentVersion = $this->getInfo('version'); 874 register_activation_hook(__FILE__, function () use ($currentVersion) { 879 875 $request_url = add_query_arg( 880 ['id' => 92, 'action' => 'deactivate', 'domain' => md5(get_home_url())], 876 ['id' => 92, 'action' => 'activate', 'domain' => md5(get_home_url()), 'v' => $currentVersion], 877 'https://totalpress.org/wp-json/totalpress/v1/plugin-growth' 878 ); 879 wp_remote_get($request_url); 880 }); 881 register_deactivation_hook(__FILE__, function () use ($currentVersion) { 882 $request_url = add_query_arg( 883 ['id' => 92, 'action' => 'deactivate', 'domain' => md5(get_home_url()), 'v' => $currentVersion], 881 884 'https://totalpress.org/wp-json/totalpress/v1/plugin-growth' 882 885 ); -
custom-post-types/trunk/includes/Component.php
r2917815 r2922197 385 385 return __('<strong>Custom post types</strong> notice:', 'custom-post-types'); 386 386 } 387 388 /** 389 * @param $args 390 * @param $type 391 * @return array 392 */ 393 public function getRegistrationErrorNoticeInfo($args = [], $type = 'post'){ 394 $idParts = []; 395 foreach ($args as $arg) { 396 $idParts[] = !empty($arg) ? (is_array($arg) ? count($arg) : $arg) : 'none'; 397 } 398 return [ 399 'id' => $type . '_args_error_' . implode('_', $idParts), 400 'details' => sprintf( 401 '<pre class="error-code"><a href="#" title="%1$s" aria-label="%1$s">%1$s</a><code>%2$s</code></pre>', 402 __('See registration args', 'custom-post-types'), 403 json_encode($args, JSON_PRETTY_PRINT) 404 ) 405 ]; 406 } 387 407 } -
custom-post-types/trunk/includes/Fields.php
r2915886 r2922197 439 439 } 440 440 if (!$id || !$supports || !$label) { 441 add_filter($this->getHookName('register_notices'), function ($args) use ($fieldGroup) { 441 $errorInfo = $this->getRegistrationErrorNoticeInfo($fieldGroup, 'field'); 442 443 add_filter($this->getHookName('register_notices'), function ($args) use ($errorInfo) { 442 444 $args[] = [ 443 'id' => 'field_args_error',445 'id' => $errorInfo['id'], 444 446 'title' => $this->getNoticesTitle(), 445 'message' => __('Field group registration was not successful ("id" "label" and "supports" args are required).', 'custom-post-types') ,447 'message' => __('Field group registration was not successful ("id" "label" and "supports" args are required).', 'custom-post-types') . $errorInfo['details'], 446 448 'type' => 'error', 447 'dismissible' => false,449 'dismissible' => 3, 448 450 'buttons' => false, 449 451 ]; -
custom-post-types/trunk/includes/Pages.php
r2915886 r2922197 32 32 33 33 if (!$id || !$title) { 34 add_filter($this->getHookName('register_notices'), function ($args) { 34 $errorInfo = $this->getRegistrationErrorNoticeInfo($page, 'page'); 35 36 add_filter($this->getHookName('register_notices'), function ($args) use ($errorInfo) { 35 37 $args[] = [ 36 'id' => 'page_args_error',38 'id' => $errorInfo['id'], 37 39 'title' => $this->getNoticesTitle(), 38 'message' => __('Admin page registration was not successful ("id" and "title" args are required).', 'custom-post-types') ,40 'message' => __('Admin page registration was not successful ("id" and "title" args are required).', 'custom-post-types') . $errorInfo['details'], 39 41 'type' => 'error', 40 'dismissible' => false,42 'dismissible' => 3, 41 43 'buttons' => false, 42 44 ]; … … 57 59 58 60 if (!$registeredAdminPage) { 59 add_filter($this->getHookName('register_notices'), function ($args) { 61 $errorInfo = $this->getRegistrationErrorNoticeInfo($page, 'page'); 62 63 add_filter($this->getHookName('register_notices'), function ($args) use ($errorInfo) { 60 64 $args[] = [ 61 'id' => 'page_wp_error',65 'id' => $errorInfo['id'] . '_core', 62 66 'title' => $this->getNoticesTitle(), 63 'message' => __('Admin page registration was not successful.', 'custom-post-types') ,67 'message' => __('Admin page registration was not successful.', 'custom-post-types') . $errorInfo['details'], 64 68 'type' => 'error', 65 'dismissible' => false,69 'dismissible' => 3, 66 70 'buttons' => false, 67 71 ]; -
custom-post-types/trunk/includes/PostTypes.php
r2915886 r2922197 230 230 231 231 if (!$id || !$singular || !$plural) { 232 add_filter($this->getHookName('register_notices'), function ($args) { 232 $errorInfo = $this->getRegistrationErrorNoticeInfo($postType); 233 234 add_filter($this->getHookName('register_notices'), function ($args) use ($errorInfo) { 233 235 $args[] = [ 234 'id' => 'post_args_error',236 'id' => $errorInfo['id'], 235 237 'title' => $this->getNoticesTitle(), 236 'message' => __('Post type registration was not successful ("id" "singular" and "plural" args are required).', 'custom-post-types') ,238 'message' => __('Post type registration was not successful ("id" "singular" and "plural" args are required).', 'custom-post-types') . $errorInfo['details'], 237 239 'type' => 'error', 238 'dismissible' => false,240 'dismissible' => 3, 239 241 'buttons' => false, 240 242 ]; … … 262 264 263 265 if (is_wp_error($register)) { 264 add_filter($this->getHookName('register_notices'), function ($args) { 266 $errorInfo = $this->getRegistrationErrorNoticeInfo($postType); 267 268 add_filter($this->getHookName('register_notices'), function ($args) use ($errorInfo) { 265 269 $args[] = [ 266 'id' => 'post_wp_error',270 'id' => $errorInfo['id'] . '_core', 267 271 'title' => $this->getNoticesTitle(), 268 'message' => __('Post type registration was not successful.', 'custom-post-types') ,272 'message' => __('Post type registration was not successful.', 'custom-post-types') . $errorInfo['details'], 269 273 'type' => 'error', 270 'dismissible' => false,274 'dismissible' => 3, 271 275 'buttons' => false, 272 276 ]; -
custom-post-types/trunk/includes/Taxonomies.php
r2915886 r2922197 182 182 183 183 if (!$id || !$singular || !$plural) { 184 add_filter($this->getHookName('register_notices'), function ($args) { 184 $errorInfo = $this->getRegistrationErrorNoticeInfo($taxonomy, 'tax'); 185 186 add_filter($this->getHookName('register_notices'), function ($args) use ($errorInfo) { 185 187 $args[] = [ 186 'id' => 'tax_args_error',188 'id' => $errorInfo['id'], 187 189 'title' => $this->getNoticesTitle(), 188 'message' => __('Taxonomy registration was not successful ("id" "singular" and "plural" args are required).', 'custom-post-types') ,190 'message' => __('Taxonomy registration was not successful ("id" "singular" and "plural" args are required).', 'custom-post-types') . $errorInfo['details'], 189 191 'type' => 'error', 190 'dismissible' => false,192 'dismissible' => 3, 191 193 'buttons' => false, 192 194 ]; … … 209 211 210 212 if (is_wp_error($register)) { 211 add_filter($this->getHookName('register_notices'), function ($args) { 213 $errorInfo = $this->getRegistrationErrorNoticeInfo($taxonomy, 'tax'); 214 215 add_filter($this->getHookName('register_notices'), function ($args) use ($errorInfo) { 212 216 $args[] = [ 213 'id' => 'tax_wp_error',217 'id' => $errorInfo['id'] . '_core', 214 218 'title' => $this->getNoticesTitle(), 215 'message' => __('Taxonomy registration was not successful.', 'custom-post-types') ,219 'message' => __('Taxonomy registration was not successful.', 'custom-post-types') . $errorInfo['details'], 216 220 'type' => 'error', 217 'dismissible' => false,221 'dismissible' => 3, 218 222 'buttons' => false, 219 223 ]; -
custom-post-types/trunk/readme.txt
r2918438 r2922197 5 5 Requires at least: 4.0 6 6 Tested up to: 6.2 7 Stable tag: 4.0. 27 Stable tag: 4.0.3 8 8 Requires PHP: 5.6 9 9 License: GPLv2 or later … … 240 240 == Changelog == 241 241 242 = 4.0.3 = 243 * Details on registration contents error notices 244 * Api functions 245 242 246 = 4.0.2 = 243 247 * Support for SEO plugin (thanks to @jitka88) … … 514 518 == Upgrade Notice == 515 519 520 = 4.0.3 = 521 Details on registration contents error notices 522 Api functions 523 516 524 = 4.0.2 = 517 525 Support for SEO plugin (thanks to @jitka88)
Note: See TracChangeset
for help on using the changeset viewer.