Version Description
- New: We added more free snippets to the snippet library, simply connect your website to the WPCode Library and load them directly from the WPCode plugin.
- New: We added a new code type for CSS Styles that many of you requested, so now it's even easier to add custom styles to your site with all the powerful WPCode features.
- Tweak: We added an extra check to make sure when you copy-paste a PHP snippet it's easier to use by removing the opening tag, if present.
- Fix: We fixed a bug where in certain scenarios a snippet's code would get changed when changing its status from the list of snippets.
Download this release
Release Info
Developer | gripgrip |
Plugin | Insert Headers and Footers |
Version | 2.0.4 |
Comparing to | |
See all releases |
Code changes from version 2.0.3 to 2.0.4
- build/admin-global-lite.asset.php +1 -0
- build/admin-global-lite.css +2 -0
- build/admin-global-lite.js +1 -0
- build/admin.asset.php +1 -1
- build/admin.css +1 -1
- build/admin.js +1 -1
- build/notices.asset.php +1 -0
- build/notices.js +1 -0
- ihaf.php +149 -18
- includes/admin/admin-menu.php +0 -107
- includes/admin/admin-scripts.php +46 -0
- includes/admin/class-wpcode-admin-notice.php +301 -0
- includes/admin/class-wpcode-admin-page-loader.php +198 -0
- includes/admin/class-wpcode-code-editor.php +134 -0
- includes/admin/class-wpcode-docs.php +1 -1
- includes/admin/class-wpcode-metabox-snippets.php +216 -0
- includes/admin/class-wpcode-upgrade-welcome.php +9 -2
- includes/admin/pages/class-wpcode-admin-page-generator.php +11 -7
- includes/admin/pages/class-wpcode-admin-page-headers-footers.php +27 -17
- includes/admin/pages/class-wpcode-admin-page-library.php +343 -6
- includes/admin/pages/class-wpcode-admin-page-settings.php +30 -2
- includes/admin/pages/class-wpcode-admin-page-snippet-manager.php +305 -88
- includes/admin/pages/class-wpcode-admin-page-tools.php +9 -5
- includes/admin/pages/class-wpcode-admin-page.php +230 -74
- includes/auto-insert/class-wpcode-auto-insert-archive.php +3 -5
- includes/auto-insert/class-wpcode-auto-insert-everywhere.php +2 -0
- includes/auto-insert/class-wpcode-auto-insert-single.php +3 -4
- includes/auto-insert/class-wpcode-auto-insert-site-wide.php +5 -12
- includes/auto-insert/class-wpcode-auto-insert-type.php +64 -2
- includes/class-wpcode-auto-insert.php +10 -4
- includes/class-wpcode-conditional-logic.php +10 -2
- includes/class-wpcode-file-cache.php +13 -0
- includes/class-wpcode-install.php +34 -0
- includes/class-wpcode-library-auth.php +188 -0
- includes/class-wpcode-library.php +154 -56
- includes/class-wpcode-settings.php +6 -5
- includes/class-wpcode-snippet-cache.php +17 -0
- includes/class-wpcode-snippet-execute.php +12 -0
- includes/class-wpcode-snippet.php +122 -11
- includes/conditional-logic/class-wpcode-conditional-page.php +2 -0
- includes/conditional-logic/class-wpcode-conditional-type.php +14 -8
- includes/conditional-logic/class-wpcode-conditional-user.php +2 -0
- includes/execute/class-wpcode-snippet-execute-css.php +35 -0
- includes/execute/class-wpcode-snippet-execute-php.php +1 -1
- includes/execute/class-wpcode-snippet-execute-universal.php +4 -0
- includes/helpers.php +170 -4
- includes/icons.php +54 -35
- includes/ihaf.php +11 -0
- includes/lite/admin/admin-scripts.php +17 -0
- includes/lite/admin/class-wpcode-metabox-snippets-lite.php +297 -0
- includes/lite/admin/notices.php +38 -0
- includes/lite/auto-insert/class-wpcode-auto-insert-edd.php +50 -0
- includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php +54 -0
- includes/lite/conditional-logic/class-wpcode-conditional-edd.php +76 -0
- includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php +91 -0
- includes/lite/loader.php +33 -0
- includes/post-type.php +3 -3
- languages/insert-headers-and-footers.pot +537 -144
- readme.txt +31 -2
- uninstall.php +5 -0
build/admin-global-lite.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array(), 'version' => 'bd66227046fdf7f8dcbc96d6454caf6c');
|
build/admin-global-lite.css
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
1 |
+
:root{--wpcode-background-gray:#F8F8F8;--wpcode-background-highlight:#F6FAFF;--wpcode-background-light:#F3F4F5;--wpcode-background-red:#DF2A35;--wpcode-background-white:#fff;--wpcode-border-color:#ddd;--wpcode-button-disabled-bg:#F5F5F5;--wpcode-button-disabled-border:1px solid #DDDDDD;--wpcode-button-disabled-text:#bbb;--wpcode-button-primary-bg:var(--wpcode-color-primary);--wpcode-button-primary-bg-hover:#397EEB;--wpcode-button-primary-text:#fff;--wpcode-button-primary-text-hover:#fff;--wpcode-button-secondary-bg:#F8F8F8;--wpcode-button-secondary-bg-hover:#fff;--wpcode-button-secondary-border:1px solid #DDDDDD;--wpcode-button-secondary-text:#777;--wpcode-button-orange-bg:#E06B44;--wpcode-button-orange-bg-hover:#e17f5e;--wpcode-button-secondary-text-hover:#454545;--wpcode-color-primary:#3568B7;--wpcode-color-red:#DF2A35;--wpcode-color-red-darker:#AB2028;--wpcode-font-size-l:18px;--wpcode-font-size-m:16px;--wpcode-font-size-s:14px;--wpcode-font-size-xl:22px;--wpcode-font-size-xs:12px;--wpcode-font-size-xxl:24px;--wpcode-input-border:1px solid #DDD;--wpcode-input-border-active:#3568B7;--wpcode-input-text-color:#454545;--wpcode-notice-success-bg:#09A347;--wpcode-notice-success-text:#fff;--wpcode-space-h:36px;--wpcode-space-v:24px;--wpcode-text-color-heading:#454545;--wpcode-text-color-highlight:#3568B7;--wpcode-text-color-light-bg:#848A8A;--wpcode-text-color-paragraph:#777777;--wpcode-text-color-placeholder:#bbb}.wpcode-admin-tabs{font-size:14px;list-style:none;margin:0;overflow:auto;padding:0}.wpcode-admin-tabs li{float:left;margin:0 30px 0 0;padding:0}.wpcode-admin-tabs li button{border:none;background:transparent;cursor:pointer}.wpcode-admin-tabs li button,.wpcode-admin-tabs li a{border-bottom:4px solid #fff;box-shadow:none;color:var(--wpcode-text-color-paragraph);display:block;font-weight:600;padding:20px 0 18px 0;text-decoration:none;transition:border 300ms ease}.wpcode-admin-tabs li button.active,.wpcode-admin-tabs li a.active{border-color:var(--wpcode-color-primary);color:var(--wpcode-text-color-heading)}.wpcode-admin-tabs li button:focus,.wpcode-admin-tabs li button:hover,.wpcode-admin-tabs li a:focus,.wpcode-admin-tabs li a:hover{border-color:var(--wpcode-text-color-paragraph)}.wpcode-admin-tab-content{display:none;position:relative}.wpcode-admin-tab-content.active{display:block}.wpcode-smart-tags{position:relative;display:inline-block;vertical-align:top}.wpcode-smart-tags .wpcode-smart-tags-toggle{background:none;border:none;color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s)}.wpcode-smart-tags .wpcode-smart-tags-toggle svg{vertical-align:middle}.wpcode-smart-tags .wpcode-smart-tags-toggle span{text-decoration:underline}.wpcode-smart-tags .wpcode-text-active{display:none}.wpcode-smart-tags .wpcode-smart-tags-dropdown{border:1px solid var(--wpcode-border-color);border-radius:4px;display:none;left:0;position:absolute;top:100%;z-index:1900;background:#fff;width:300px;margin-top:7px}.wpcode-smart-tags .wpcode-smart-tags-dropdown ul{border-top:1px solid var(--wpcode-border-color)}.wpcode-smart-tags .wpcode-smart-tags-dropdown ul:first-child{border-top:none}.wpcode-smart-tags .wpcode-smart-tags-dropdown ul li{padding:0 15px;margin:12px 0}.wpcode-smart-tags .wpcode-smart-tags-dropdown .wpcode-smart-tag-category-label{font-weight:600;font-size:var(--wpcode-font-size-s);color:var(--wpcode-text-color-paragraph)}.wpcode-smart-tags.wpcode-smart-tags-open .wpcode-text-active{display:inline-block}.wpcode-smart-tags.wpcode-smart-tags-open .wpcode-text-default{display:none}.wpcode-smart-tags.wpcode-smart-tags-open .wpcode-smart-tags-dropdown{display:block}.wpcode-insert-smart-tag{border:0;color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s);padding:0;text-align:left;background:none}.wpcode-blur-area{filter:blur(2px);pointer-events:none}.wpcode-library .wpcode-content{position:relative}#poststuff .wpcode-upsell-box,.wpcode-upsell-box{position:absolute;z-index:20;background:#fff;width:662px;max-width:100%;top:50%;left:50%;transform:translate(-50%,-50%);padding:40px;text-align:center;border-radius:8px;border:1px solid var(--wpcode-border-color)}#poststuff .wpcode-upsell-box *,.wpcode-upsell-box *{box-sizing:border-box}#poststuff .wpcode-upsell-box h2,.wpcode-upsell-box h2{font-size:var(--wpcode-font-size-xxl);margin-top:0;line-height:1.2}#poststuff .wpcode-upsell-box .wpcode-button,.wpcode-upsell-box .wpcode-button{margin-top:6px}#poststuff .wpcode-upsell-box .wpcode-upsell-button-text,.wpcode-upsell-box .wpcode-upsell-button-text{margin-top:16px;display:inline-block;font-size:var(--wpcode-font-size-s);color:var(--wpcode-text-color-light-bg)}#poststuff .wpcode-upsell-box .wpcode-upsell-button-text:hover,.wpcode-upsell-box .wpcode-upsell-button-text:hover{text-decoration:none}#poststuff .wpcode-upsell-box p,.wpcode-upsell-box p{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s)}#poststuff .wpcode-upsell-box.wpcode-upsell-box-with-features,.wpcode-upsell-box.wpcode-upsell-box-with-features{width:892px;padding:56px}#poststuff .wpcode-upsell-box.wpcode-upsell-box-with-features .wpcode-upsell-text,.wpcode-upsell-box.wpcode-upsell-box-with-features .wpcode-upsell-text{max-width:600px;margin:0 auto}#poststuff .wpcode-upsell-box .wpcode-upsell-features,.wpcode-upsell-box .wpcode-upsell-features{display:flex;flex-wrap:wrap;justify-content:space-between;margin-top:40px;margin-bottom:24px;text-align:left}#poststuff .wpcode-upsell-box .wpcode-upsell-features .wpcode-upsell-feature,.wpcode-upsell-box .wpcode-upsell-features .wpcode-upsell-feature{width:50%;color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-m);margin-bottom:16px;line-height:1.5;padding-left:34px;position:relative;padding-right:10px}#poststuff .wpcode-upsell-box .wpcode-upsell-features .wpcode-upsell-feature:before,.wpcode-upsell-box .wpcode-upsell-features .wpcode-upsell-feature:before{content:'';background-image:url("data:image/svg+xml,%3Csvg width=%2719%27 height=%2718%27 viewBox=%270 0 19 18%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath fill-rule=%27evenodd%27 clip-rule=%27evenodd%27 d=%27M9.5 0.416016C4.67 0.416016 0.75 4.33602 0.75 9.16602C0.75 13.996 4.67 17.916 9.5 17.916C14.33 17.916 18.25 13.996 18.25 9.16602C18.25 4.33602 14.33 0.416016 9.5 0.416016ZM9.5 16.166C5.64125 16.166 2.5 13.0248 2.5 9.16602C2.5 5.30727 5.64125 2.16602 9.5 2.16602C13.3587 2.16602 16.5 5.30727 16.5 9.16602C16.5 13.0248 13.3587 16.166 9.5 16.166ZM7.75 11.0648L13.5163 5.29852L14.75 6.54102L7.75 13.541L4.25 10.041L5.48375 8.80727L7.75 11.0648Z%27 fill=%27%2309A347%27/%3E%3C/svg%3E");display:block;width:19px;height:18px;position:absolute;left:0;top:3px}.wpcode-button{background-color:var(--wpcode-button-primary-bg);border:1px solid var(--wpcode-button-primary-bg);border-radius:4px;color:var(--wpcode-button-primary-text);cursor:pointer;display:inline-block;font-size:var(--wpcode-font-size-s);font-weight:700;line-height:1;padding:10px 16px;text-decoration:none}.wpcode-button.wpcode-button-icon{align-items:center;display:inline-flex;padding-bottom:12px;padding-top:12px}.wpcode-button.wpcode-button-icon svg{margin-right:5px}.wpcode-button.wpcode-button-icon.wpcode-copy-target{padding-bottom:10px;padding-top:10px}.wpcode-button.wpcode-button-wide{padding-left:50px;padding-right:50px}.wpcode-button:hover,.wpcode-button:focus{background-color:var(--wpcode-button-primary-bg-hover);border-color:var(--wpcode-button-primary-bg-hover);color:var(--wpcode-button-primary-text-hover)}.wpcode-button.wpcode-button-secondary{background-color:var(--wpcode-button-secondary-bg);border:var(--wpcode-button-secondary-border);color:var(--wpcode-button-secondary-text)}.wpcode-button.wpcode-button-secondary:hover,.wpcode-button.wpcode-button-secondary:focus{background-color:var(--wpcode-button-secondary-bg-hover);color:var(--wpcode-button-secondary-text-hover)}.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-inactive{background-color:var(--wpcode-button-disabled-bg);border-color:var(--wpcode-button-disabled-bg)}.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-selected{border-color:var(--wpcode-button-primary-bg)}.wpcode-button.wpcode-button-orange{background-color:var(--wpcode-button-orange-bg);border-color:var(--wpcode-button-orange-bg);color:var(--wpcode-button-primary-text)}.wpcode-button.wpcode-button-orange:hover,.wpcode-button.wpcode-button-orange:focus{background-color:var(--wpcode-button-orange-bg-hover);color:var(--wpcode-button-primary-text)}.wpcode-button.wpcode-button-large{align-items:center;display:inline-flex;font-size:var(--wpcode-font-size-m);height:56px;justify-content:center;padding-left:var(--wpcode-space-h);padding-right:var(--wpcode-space-h);text-align:center}.wpcode-button.wpcode-button-large svg{margin-right:7px}.wpcode-button.wpcode-button-small{font-size:var(--wpcode-font-size-xs);padding:9px}.wpcode-button:disabled:hover,.wpcode-button:disabled{background-color:var(--wpcode-button-disabled-bg);border:var(--wpcode-button-disabled-border);color:var(--wpcode-button-disabled-text)}.wpcode-button-toggle{align-items:center;display:flex;justify-content:space-between;min-width:424px}.wpcode-button-toggle .wpcode-button{width:calc(50% - 5px);background:#fff;color:var(--wpcode-input-text-color)}.wpcode-button-toggle .wpcode-button-secondary{border:2px solid var(--wpcode-color-primary)}.wpcode-success-icon{display:none}.wpcode-show-success-icon .wpcode-success-icon{display:inline-block}.wpcode-show-success-icon .wpcode-default-icon{display:none}.wpcode-button-just-icon{background:none;border:none;cursor:pointer;padding:0}.wpcode-button-just-icon .wpcode-icon{display:block}.wpcode-text-button-icon{align-items:center;background:none;border:none;color:var(--wpcode-text-color-paragraph);cursor:pointer;display:inline-flex;font-size:var(--wpcode-font-size-s);font-weight:600;padding:0}.wpcode-text-button-icon:hover{color:var(--wpcode-text-color-heading)}.wpcode-text-button-icon:hover path{fill:var(--wpcode-text-color-heading)}.wpcode-text-button-icon .wpcode-icon{margin-right:5px}.wpcode-just-icon-button{background:none;border:none;cursor:pointer}.wpcode-button-text{background:none;border:none;color:var(--wpcode-text-color-paragraph);cursor:pointer;font-size:var(--wpcode-font-size-xs);padding:0;text-decoration:underline}.wpcode-button-text .wpcode-icon{margin-right:11px}.wpcode-button-text:focus,.wpcode-button-text:hover{text-decoration:none;background:none;color:var(--wpcode-text-color-heading)}.wpcode-button-text:focus svg path,.wpcode-button-text:hover svg path{fill:var(--wpcode-text-color-heading)}.wpcode-items-metabox{display:flex;padding:0}.wpcode-items-sidebar{flex-shrink:0;padding:var(--wpcode-space-v);width:242px}.wpcode-items-list{border-left:1px solid var(--wpcode-border-color);min-height:400px;padding:calc(var(--wpcode-space-v) / 2) 12px;width:100%}.wpcode-items-categories-list{margin:0}.wpcode-items-categories-list li{margin:0}.wpcode-items-categories-list button{background:transparent;border:none;color:var(--wpcode-text-color-paragraph);cursor:pointer;display:block;font-size:var(--wpcode-font-size-m);font-weight:500;padding:12px 8px;position:relative;text-align:left;width:100%}.wpcode-items-categories-list button:focus,.wpcode-items-categories-list button.wpcode-active{background:var(--wpcode-background-highlight);color:var(--wpcode-text-color-highlight)}.wpcode-items-categories-list button:hover{text-decoration:underline}.wpcode-items-categories-list button.wpcode-active{font-weight:700}.wpcode-items-categories-list button.wpcode-active:after{background-image:url("data:image/svg+xml,%3Csvg width=%2716%27 height=%2712%27 viewBox=%270 0 16 12%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M5.33329 9.25326L1.83329 5.75326L0.666626 6.91992L5.33329 11.5866L15.3333 1.58659L14.1666 0.419922L5.33329 9.25326Z%27 fill=%27%233568B7%27/%3E%3C/svg%3E%0A");content:'';height:12px;position:absolute;right:10px;top:50%;transform:translateY(-50%);width:16px}.wpcode-items-categories-list button.wpcode-active:hover{text-decoration:none}.wpcode-items-list-category{align-content:stretch;display:flex;flex-wrap:wrap;justify-content:flex-start}.wpcode-list-item{border:1px solid var(--wpcode-border-color);border-radius:4px;margin-bottom:24px;margin-right:12px;margin-left:12px;max-width:100%;padding:16px 20px;position:relative;width:100%}@media (min-width:961px){.wpcode-list-item{width:calc(50% - 24px)}}@media (min-width:1440px){.wpcode-list-item{width:calc(100% / 3 - 24px)}}.wpcode-list-item h3{font-size:var(--wpcode-font-size-m);line-height:1.2;margin:0;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.wpcode-list-item p{margin-bottom:0}.wpcode-list-item:hover .wpcode-list-item-description,.wpcode-list-item:focus .wpcode-list-item-description{opacity:0}.wpcode-list-item:hover .wpcode-list-item-buttons,.wpcode-list-item:focus .wpcode-list-item-buttons{opacity:1}@media (hover:none){.wpcode-list-item .wpcode-list-item-description{opacity:0}.wpcode-list-item .wpcode-list-item-buttons{opacity:1}}.wpcode-list-item .wpcode-list-item-pill{position:absolute;top:10px;right:10px;font-size:8px;font-weight:700;text-transform:uppercase;line-height:1;padding:4px 8px;border-radius:40px}.wpcode-list-item .wpcode-list-item-pill.wpcode-list-item-pill-blue{background:var(--wpcode-color-primary);color:#fff}.wpcode-list-item .wpcode-list-item-pill.wpcode-list-item-pill-gray{background:var(--wpcode-text-color-heading);color:#fff}.wpcode-list-item.wpcode-list-item-has-pill h3{max-width:calc(100% - 60px)}.wpcode-list-item-actions{position:relative}.wpcode-list-item-description{min-height:40px}.wpcode-list-item-buttons{display:flex;justify-content:space-between;opacity:0;position:absolute;top:0;width:100%;z-index:10}.wpcode-list-item-buttons .wpcode-button{flex-grow:1;margin-left:10px;text-align:center}.wpcode-list-item-buttons .wpcode-button:first-child{margin-left:0}.wpcode-items-search{margin-bottom:20px;position:relative}.wpcode-items-search input{border-color:var(--wpcode-border-color);font-size:var(--wpcode-font-size-s);height:38px;padding-left:32px;width:100%}.wpcode-items-search input::-moz-placeholder{color:var(--wpcode-text-color-placeholder)}.wpcode-items-search input:-ms-input-placeholder{color:var(--wpcode-text-color-placeholder)}.wpcode-items-search input::placeholder{color:var(--wpcode-text-color-placeholder)}.wpcode-items-search label{left:10px;position:absolute;top:11px}.wpcode-library-preview-header{padding-bottom:25px}.wpcode-library-preview-header h2{margin:0}.wpcode-library-preview-header .wpcode-close-modal{float:right}.wpcode-library-preview-content .CodeMirror{background:var(--wpcode-background-gray)}.wpcode-library-preview-content .CodeMirror-activeline-background{background:transparent !important}.wpcode-library-preview-content .CodeMirror-focused .CodeMirror-activeline-background{background:rgba(100,100,100,0.1) !important}.wpcode-library-preview-buttons{margin-top:25px}.wpcode-item-use-button.wpcode-start-auth{padding-top:6px;padding-bottom:6px;justify-content:center}.wpcode-item-use-button.wpcode-start-auth svg{margin-right:9px}.wpcode-content *{box-sizing:border-box}.wpcode-metabox-snippets:after{display:table;clear:both;content:''}#wpcode-picked-snippets{align-content:stretch;display:flex;flex-wrap:wrap;justify-content:flex-start}.wpcode-snippet-picker-item{border-bottom:1px solid var(--wpcode-border-color);padding:15px 0;display:flex;justify-content:space-between;color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-m)}.wpcode-snippet-picker-item .wpcode-checkbox-toggle{flex-shrink:0;flex-grow:0}.wpcode-selected-snippet-item h4{margin-top:12px}.wpcode-selected-snippet-item label{margin:5px 0;display:block}#wpcode-snippet-chooser{width:30%;float:left}#wpcode-snippet-chooser .wpcode-chooser-fixed-height{height:400px;overflow:auto}.wpcode-picked-snippets-area{margin-left:30%;padding-left:16px}.wpcode-picked-snippets-area>h3{margin-left:12px}.wpcode-snippet-chooser-closed #wpcode-snippet-chooser{width:0;overflow:hidden}.wpcode-snippet-chooser-closed .wpcode-picked-snippets-area{margin-left:0;padding-left:0}.wpcode-snippet-chooser-closed .wpcode-picked-snippets-area>h3{margin-left:0}.wpcode-snippet-chooser-closed #wpcode-picked-snippets{margin:0 -12px}.wpcode-snippets-search{padding-bottom:16px;position:relative}.wpcode-snippets-search input{width:100%}#wpcode-close-drawer{float:right}.wpcode-input-row{margin:24px 0}.wpcode-input-row label{font-size:var(--wpcode-font-size-s);color:var(--wpcode-text-color-heading);margin-bottom:20px;display:inline-block;font-weight:600}#wpcode-no-snippets-selected{margin-left:12px}.wpcode-choose-actions{text-align:center}#wpcode-metabox-load-more{margin:15px 0}#wpcode-chooser-spinner{right:0;top:12px}.wpcode-auto-insert-number-wrap.wpcode-hidden{display:none}.wpcode-list-item-location-details{display:flex}.wpcode-list-item-location-details .wpcode-auto-insert-location-wrap{width:100%}.wpcode-list-item-location-details .wpcode-auto-insert-number-wrap input{width:100px}
|
2 |
+
|
build/admin-global-lite.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(){var t={624:function(){jQuery((function(t){t(".wpcode-admin-tabs-navigation").on("click",".wpcode-admin-tabs button",(function(e){e.preventDefault();const n=t(this).data("target");t(this).addClass("active").parent().siblings().find("button").removeClass("active"),t(document.getElementById(n)).addClass("active").siblings().removeClass("active"),window.wpcode_editor&&jQuery.each(window.wpcode_editor,(function(t,e){e.codemirror.refresh()}))}))}))}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,n),i.exports}n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},function(){"use strict";n(624)}()}();
|
build/admin.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('jquery'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('jquery'), 'version' => 'af6a26982cecbf095103a426db634f6d');
|
build/admin.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
:root{--wpcode-background-gray:#F8F8F8;--wpcode-background-highlight:#F6FAFF;--wpcode-background-light:#F3F4F5;--wpcode-background-red:#DF2A35;--wpcode-background-white:#fff;--wpcode-border-color:#ddd;--wpcode-button-disabled-bg:#F5F5F5;--wpcode-button-disabled-border:1px solid #DDDDDD;--wpcode-button-disabled-text:#bbb;--wpcode-button-primary-bg:var(--wpcode-color-primary);--wpcode-button-primary-bg-hover:#397EEB;--wpcode-button-primary-text:#fff;--wpcode-button-primary-text-hover:#fff;--wpcode-button-secondary-bg:#F8F8F8;--wpcode-button-secondary-bg-hover:#fff;--wpcode-button-secondary-border:1px solid #DDDDDD;--wpcode-button-secondary-text:#777;--wpcode-button-secondary-text-hover:#454545;--wpcode-color-primary:#3568B7;--wpcode-color-red:#DF2A35;--wpcode-color-red-darker:#AB2028;--wpcode-font-size-l:18px;--wpcode-font-size-m:16px;--wpcode-font-size-s:14px;--wpcode-font-size-xl:22px;--wpcode-font-size-xs:12px;--wpcode-font-size-xxl:24px;--wpcode-input-border:1px solid #DDD;--wpcode-input-border-active:#3568B7;--wpcode-input-text-color:#454545;--wpcode-notice-success-bg:#09A347;--wpcode-notice-success-text:#fff;--wpcode-space-h:36px;--wpcode-space-v:24px;--wpcode-text-color-heading:#454545;--wpcode-text-color-highlight:#3568B7;--wpcode-text-color-light-bg:#848A8A;--wpcode-text-color-paragraph:#777777;--wpcode-text-color-placeholder:#bbb}.wpcode-button{background-color:var(--wpcode-button-primary-bg);border:1px solid var(--wpcode-button-primary-bg);border-radius:4px;color:var(--wpcode-button-primary-text);cursor:pointer;display:inline-block;font-size:var(--wpcode-font-size-s);font-weight:700;line-height:1;padding:10px 16px;text-decoration:none}.wpcode-button.wpcode-button-icon{align-items:center;display:inline-flex;padding-bottom:12px;padding-top:12px}.wpcode-button.wpcode-button-icon svg{margin-right:5px}.wpcode-button.wpcode-button-icon.wpcode-copy-target{padding-bottom:10px;padding-top:10px}.wpcode-button.wpcode-button-wide{padding-left:50px;padding-right:50px}.wpcode-button:hover,.wpcode-button:focus{background-color:var(--wpcode-button-primary-bg-hover);border-color:var(--wpcode-button-primary-bg-hover);color:var(--wpcode-button-primary-text-hover)}.wpcode-button.wpcode-button-secondary{background-color:var(--wpcode-button-secondary-bg);border:var(--wpcode-button-secondary-border);color:var(--wpcode-button-secondary-text)}.wpcode-button.wpcode-button-secondary:hover,.wpcode-button.wpcode-button-secondary:focus{background-color:var(--wpcode-button-secondary-bg-hover);color:var(--wpcode-button-secondary-text-hover)}.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-inactive{background-color:var(--wpcode-button-disabled-bg);border-color:var(--wpcode-button-disabled-bg)}.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-selected{border-color:var(--wpcode-button-primary-bg)}.wpcode-button.wpcode-button-large{align-items:center;display:inline-flex;font-size:var(--wpcode-font-size-m);height:56px;justify-content:center;padding-left:var(--wpcode-space-h);padding-right:var(--wpcode-space-h);text-align:center}.wpcode-button.wpcode-button-large svg{margin-right:7px}.wpcode-button.wpcode-button-small{font-size:var(--wpcode-font-size-xs);padding:9px}.wpcode-button:disabled:hover,.wpcode-button:disabled{background-color:var(--wpcode-button-disabled-bg);border:var(--wpcode-button-disabled-border);color:var(--wpcode-button-disabled-text)}.wpcode-button-toggle{align-items:center;display:flex;justify-content:space-between;min-width:424px}.wpcode-button-toggle .wpcode-button{width:calc(50% - 5px);background:#fff;color:var(--wpcode-input-text-color)}.wpcode-button-toggle .wpcode-button-secondary{border:2px solid var(--wpcode-color-primary)}.wpcode-success-icon{display:none}.wpcode-show-success-icon .wpcode-success-icon{display:inline-block}.wpcode-show-success-icon .wpcode-default-icon{display:none}.wpcode-button-just-icon{background:none;border:none;cursor:pointer;padding:0}.wpcode-button-just-icon .wpcode-icon{display:block}.wpcode-text-button-icon{align-items:center;background:none;border:none;color:var(--wpcode-text-color-paragraph);cursor:pointer;display:inline-flex;font-size:var(--wpcode-font-size-s);font-weight:600;padding:0}.wpcode-text-button-icon:hover{color:var(--wpcode-text-color-heading)}.wpcode-text-button-icon:hover path{fill:var(--wpcode-text-color-heading)}.wpcode-text-button-icon .wpcode-icon{margin-right:5px}.wpcode-just-icon-button{background:none;border:none;cursor:pointer}.wpcode-button-text{background:none;border:none;color:var(--wpcode-text-color-paragraph);cursor:pointer;font-size:var(--wpcode-font-size-xs);padding:0;text-decoration:underline}.wpcode-button-text:hover{text-decoration:none}.wpcode-headers-footers #wpcontent,.wpcode-admin-page #wpcontent{padding-left:0 !important}.wpcode-headers-footers #wpwrap,.wpcode-admin-page #wpwrap{background:var(--wpcode-background-light)}.wpcode-header-top{align-items:center;background:var(--wpcode-background-gray);display:flex;justify-content:space-between;padding:var(--wpcode-space-v) var(--wpcode-space-h)}.wpcode-header-right button{margin-left:18px;vertical-align:middle}.wpcode-header-bottom{align-items:center;background:var(--wpcode-background-white);border-color:var(--wpcode-border-color);border-style:solid;border-width:1px 0;display:flex;justify-content:space-between;min-height:60px;padding:0 var(--wpcode-space-h)}.wpcode-header-bottom h1{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-xl);margin:0}.wpcode-header-bottom.wpcode-sticky{left:160px;position:fixed;right:0;top:32px;z-index:100}.folded .wpcode-header-bottom.wpcode-sticky{left:36px}.wpcode-column{align-items:center;display:flex;flex-flow:row}.wpcode-column .wpcode-button{margin-left:20px}#wpcode-header-logo{display:block}.wpcode-admin-tabs{font-size:14px;list-style:none;margin:0;overflow:auto;padding:0}.wpcode-admin-tabs li{float:left;margin:0 30px 0 0;padding:0}.wpcode-admin-tabs li a{border-bottom:4px solid #fff;box-shadow:none;color:var(--wpcode-text-color-paragraph);display:block;font-weight:600;padding:20px 0 18px 0;text-decoration:none;transition:border 300ms ease}.wpcode-admin-tabs li a.active{border-color:var(--wpcode-color-primary);color:var(--wpcode-text-color-heading)}.wpcode-admin-tabs li a:focus,.wpcode-admin-tabs li a:hover{border-color:var(--wpcode-text-color-paragraph)}.wpcode-notifications-inbox{position:relative}.wpcode-notifications-inbox[data-count]:after{background:var(--wpcode-color-red);border-radius:50%;bottom:100%;color:#fff;content:attr(data-count);display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:700;height:16px;left:100%;line-height:18px;min-width:16px;position:absolute;text-align:center;transform:translate(-50%,50%)}.wpcode-content{padding:28px var(--wpcode-space-h)}.wpcode-content *{box-sizing:border-box}.wpcode-content h2{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-l)}.wpcode-content p{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s)}.wpcode-add-snippet .wpcode-content{padding-top:20px}.wpcode-content>hr{margin-bottom:36px;margin-top:36px}.wpcode-code-textarea{margin-bottom:var(--wpcode-space-h)}.wpcode-code-textarea h2{margin:12px 0 20px}.wrap{margin:0;padding:0 var(--wpcode-space-h)}.wrap div.error,.wrap div.updated{margin-bottom:0;position:relative}.wrap div:first-child{margin-top:28px}#wpfooter{padding-left:var(--wpcode-space-h);padding-right:var(--wpcode-space-h)}.wpcode-modal-overlay{background:rgba(0,0,0,0.3);bottom:0;display:none;left:0;position:fixed;right:0;top:0;z-index:1000}.admin-bar .wpcode-modal-overlay{top:32px}.wpcode-show-modal .wpcode-modal-overlay{display:block}.wpcode-modal{background:#fff;border:1px solid var(--wpcode-border-color);border-radius:8px;display:none;left:50%;max-width:100%;padding:25px;position:fixed;top:50%;transform:translate(-50%,-50%);width:752px;z-index:1050}.wpcode-show-modal .wpcode-modal{display:block}@media screen and (min-width:783px){.wpcode-modal{margin-left:18px}}@media screen and (min-width:961px){.wpcode-modal{margin-left:80px}.folded .wpcode-modal{margin-left:18px}}.wpcode-content .CodeMirror{border:1px solid var(--wpcode-border-color);border-radius:3px;font-size:var(--wpcode-font-size-s);line-height:25px}.wpcode-content .CodeMirror-linenumber{color:var(--wpcode-text-color-light-bg);font-size:var(--wpcode-font-size-xs)}.wpcode-content .CodeMirror-lines{padding:20px 0}.wpcode-content .CodeMirror-gutters{background-color:var(--wpcode-button-disabled-bg)}.CodeMirror-sizer:before{color:var(--wpcode-text-color-light-bg);position:absolute}[data-code-type="php"] .CodeMirror-sizer:before{content:"<?php"}[data-code-type="js"] .CodeMirror-sizer:before{content:"<script>"}.wpcode-input-title input.wpcode-input-text{font-size:var(--wpcode-font-size-m)}input.wpcode-input-number,input.wpcode-input-text{border:var(--wpcode-input-border);border-radius:4px;color:var(--wpcode-input-text-color);font-size:var(--wpcode-font-size-s);height:40px}input.wpcode-input-number:focus,input.wpcode-input-text:focus{border-color:var(--wpcode-input-border-active)}.wpcode-input-textarea{border:var(--wpcode-input-border);border-radius:4px;color:var(--wpcode-input-text-color);font-size:var(--wpcode-font-size-s);max-width:100%;resize:none;width:424px}.wpcode-input-select{align-items:center;display:flex}.wpcode-input-select label{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-s);font-weight:600}.wpcode-input-select select{margin-left:13px}.wpcode-metabox-form-row-input{width:100%}.wpcode-metabox-form-row-input select{min-width:424px}.wpcode-inline-select select{min-width:98px}.wpcode-inline-select>span{color:var(--wpcode-text-color-paragraph);display:inline-block;font-size:13px;margin-left:12px}.wpcode-separator{border-color:var(--wpcode-border-color);border-style:solid;border-width:1px 0 0;margin:var(--wpcode-space-v) 0}.wpcode-checkbox-toggle{display:inline-block;height:20px;position:relative;width:36px}.wpcode-checkbox-toggle input{display:none;height:0;opacity:0;width:0}.wpcode-checkbox-toggle input:checked+.wpcode-checkbox-toggle-slider{background-color:var(--wpcode-color-primary)}.wpcode-checkbox-toggle input:checked+.wpcode-checkbox-toggle-slider:before{transform:translateX(16px)}.wpcode-checkbox-toggle input:focus+.wpcode-checkbox-toggle-slider{box-shadow:0 0 1px #2196F3}.wpcode-checkbox-toggle .wpcode-checkbox-toggle-slider{background-color:#ccc;border-radius:20px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:.4s}.wpcode-checkbox-toggle .wpcode-checkbox-toggle-slider:before{background-color:white;border-radius:50%;bottom:3px;content:"";height:14px;left:3px;position:absolute;transition:.4s;width:14px}.wpcode-input-with-button{display:flex;width:100%}.wpcode-input-with-button .wpcode-input-text{margin-right:10px;width:100%}.wpcode-snippet-manager.wp-core-ui select,.wpcode-tools.wp-core-ui select,.wpcode-generator.wp-core-ui select{background-position-x:calc(100% - 13px);border-color:var(--wpcode-border-color);border-radius:4px;color:var(--wpcode-text-color-heading);line-height:38px;min-height:40px;padding-left:12px;padding-right:32px}.wpcode-metabox .select2-container .select2-search--inline{margin:0}.wpcode-metabox .select2-container .select2-search--inline .select2-search__field{color:var(--wpcode-text-color-heading);font-size:14px;margin:5px 5px 0}.wpcode-metabox .select2-container.select2-container--default .select2-selection--multiple{border-color:var(--wpcode-border-color)}.wpcode-metabox .select2-container.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:var(--wpcode-button-disabled-bg);border:none;border-radius:3px;color:var(--wpcode-text-color-heading);font-size:14px;margin:9px 8px 9px 0;padding:1px 4px}.wpcode-metabox .select2-container.select2-container--default .select2-selection--multiple .select2-selection__rendered{display:block;padding:0 8px}.wpcode-metabox .select2-container.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{margin-right:4px}.wpcode-admin-page .select2-dropdown{border-color:var(--wpcode-border-color);color:var(--wpcode-text-color-heading)}.wpcode-checkboxes-list label{display:block;margin-bottom:16px}.wpcode-checkboxes-list input{margin-right:12px}.wpcode-file-upload .wpcode-file-field{background-color:#fff;border:1px solid #ddd;border-radius:3px;box-shadow:none;color:var(--wpcode-text-color-paragraph);display:inline-block;margin:0 10px 0 0;min-height:40px;overflow:hidden;padding:10px 10px;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap;width:400px}.wpcode-file-upload input[type=file]{height:0.1px;opacity:0;overflow:hidden;position:absolute;width:0.1px;z-index:-1}.wpcode-file-upload label{cursor:pointer;display:inline-flex;outline:none;padding:0;text-overflow:ellipsis;white-space:nowrap}.wpcode-checkbox-multiselect-columns{max-width:600px;position:relative}.wpcode-checkbox-multiselect-columns:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;min-height:0;visibility:hidden}.wpcode-checkbox-multiselect-columns:before{background-image:url("data:image/svg+xml,%3Csvg width=%2718%27 height=%2714%27 viewBox=%270 0 18 14%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M3.99 6L0 10L3.99 14V11H11V9H3.99V6ZM18 4L14.01 0V3H7V5H14.01V8L18 4Z%27 fill=%27%23999%27/%3E%3C/svg%3E%0A");color:#999;content:"";display:block;height:14px;left:50%;margin:0 0 0 -10px;position:absolute;top:130px;width:18px}.wpcode-checkbox-multiselect-columns .header{font-size:13px;font-weight:600;margin:0;padding:0 0 5px 0;text-align:center}.wpcode-checkbox-multiselect-columns .first-column,.wpcode-checkbox-multiselect-columns .second-column{float:left;width:45%}.wpcode-checkbox-multiselect-columns .second-column{float:right}.wpcode-checkbox-multiselect-columns .second-column ul li{padding:10px}.wpcode-checkbox-multiselect-columns ul{background-color:#fff;border:1px solid #ddd;border-radius:3px;height:250px;list-style-type:none;margin:0;overflow-y:auto;padding:0;position:relative}.wpcode-checkbox-multiselect-columns ul li{border-bottom:1px #eee solid;color:var(--wpcode-text-color-paragraph);font-size:14px;margin:0}.wpcode-checkbox-multiselect-columns ul li label{display:block;padding:10px 10px 10px 32px;position:relative;vertical-align:baseline}.wpcode-checkbox-multiselect-columns ul li label:hover{background-color:var(--wpcode-color-primary);color:#fff}.wpcode-checkbox-multiselect-columns ul li label:before{color:#ddd;content:"\f0c8";font:normal normal normal 16px/1 Georgia;-webkit-font-smoothing:antialiased;left:10px;-moz-osx-font-smoothing:grayscale;position:absolute;text-rendering:auto;top:12px}.wpcode-checkbox-multiselect-columns ul li label.checked{color:rgba(119,119,119,0.6)}.wpcode-checkbox-multiselect-columns ul li label.checked:hover{color:#fff}.wpcode-checkbox-multiselect-columns ul li label.checked:before{background-image:url("data:image/svg+xml,%3Csvg width=%2710%27 height=%278%27 viewBox=%270 0 10 8%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M1.38462 3.03448L0 4.13793L3.23077 8H4.46154L10 0.965517L8.76923 0L3.69231 4.96552L1.38462 3.03448Z%27 fill=%27%234982BF%27/%3E%3C/svg%3E%0A");background-position:3px 3px;background-repeat:no-repeat;background-size:10px 8px}.wpcode-checkbox-multiselect-columns ul li label input{display:none}.wpcode-checkbox-multiselect-columns .all{color:#999;display:inline-block;font-size:13px;margin:10px 0 0}.wpcode-flex{display:flex}.wpcode-code-textarea>.wpcode-flex{justify-content:space-between}.wpcode-input-title{margin-bottom:8px}.wpcode-status-text{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s);margin-right:8px;min-width:51px}#wp-wpcode_snippet_text-wrap{display:none}.wpcode-show-tinymce .wpcode-code-textarea .CodeMirror{display:none}.wpcode-show-tinymce #wp-wpcode_snippet_text-wrap{display:block}.wpcode-add-snippet-description{padding:var(--wpcode-space-v);background:#fff;border:1px solid var(--wpcode-border-color);border-bottom:0;border-radius:4px 4px 0 0;font-size:var(--wpcode-font-size-s);color:var(--wpcode-text-color-paragraph)}.wpcode-add-snippet-description a:hover{text-decoration:none}.wpcode-add-snippet-description+.wpcode-metabox{border-radius:0 0 4px 4px}.wpcode-metabox{background:var(--wpcode-background-white);border:1px solid var(--wpcode-border-color);border-radius:4px;margin-bottom:var(--wpcode-space-h)}.wpcode-metabox-title{align-items:center;border-bottom:1px solid var(--wpcode-border-color);display:flex;justify-content:space-between}.wpcode-metabox-title-text{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-m);font-weight:600;padding:0 var(--wpcode-space-v)}.wpcode-metabox-button-toggle{background-color:var(--wpcode-background-white);border:none;cursor:pointer;height:60px;margin:0;text-align:center;width:60px}.wpcode-metabox-collapsed .wpcode-metabox-button-toggle svg{transform:rotate(180deg)}.wpcode-metabox-content{padding:var(--wpcode-space-v);padding-bottom:0}.wpcode-metabox-collapsed .wpcode-metabox-content{display:none}.wpcode-metabox-content p:first-child{margin-top:0}.wpcode-metabox-form{max-width:670px}.wpcode-metabox-form-row{display:flex;margin-bottom:var(--wpcode-space-v)}.wpcode-metabox-form-row-label{flex-shrink:0;width:245px}.wpcode-metabox-form-row-label label{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-s);font-weight:600}.wp-list-table.wpcode-snippets .column-status{width:65px}@media screen and (min-width:783px){.wp-list-table.wpcode-snippets .column-status{text-align:center}}.wp-list-table.wpcode-snippets .column-name a{color:var(--wpcode-text-color-heading);font-size:14px;text-decoration:none}.wp-list-table.wpcode-snippets .column-name a:hover,.wp-list-table.wpcode-snippets .column-name a:focus{color:var(--wpcode-text-color-paragraph)}.wp-list-table.wpcode-snippets .column-name .delete a,.wp-list-table.wpcode-snippets .column-name .trash a{color:var(--wpcode-background-red)}.wp-list-table.wpcode-snippets .column-name .delete a:hover,.wp-list-table.wpcode-snippets .column-name .delete a:focus,.wp-list-table.wpcode-snippets .column-name .trash a:hover,.wp-list-table.wpcode-snippets .column-name .trash a:focus{color:var(--wpcode-color-red-darker)}.wp-list-table.wpcode-snippets .column-location a,.wp-list-table.wpcode-snippets .column-author a{color:var(--wpcode-text-color-paragraph)}.wp-list-table.wpcode-snippets .column-location a:hover,.wp-list-table.wpcode-snippets .column-location a:focus,.wp-list-table.wpcode-snippets .column-author a:hover,.wp-list-table.wpcode-snippets .column-author a:focus{color:var(--wpcode-text-color-heading)}.wp-list-table.wpcode-snippets th.column-created a{color:var(--wpcode-text-color-heading)}.wp-list-table.wpcode-snippets th.column-created a:hover,.wp-list-table.wpcode-snippets th.column-created a:focus{color:var(--wpcode-text-color-paragraph)}.wp-list-table.wpcode-snippets .column-created{color:var(--wpcode-text-color-paragraph)}.wp-list-table.wpcode-snippets td.column-tags{color:var(--wpcode-color-primary)}.wp-list-table.wpcode-snippets td.column-tags a{color:var(--wpcode-color-primary);text-decoration:underline}.wp-list-table.wpcode-snippets td.column-tags a:hover,.wp-list-table.wpcode-snippets td.column-tags a:focus{text-decoration:none}.wp-list-table.wpcode-snippets .alternate,.wp-list-table.wpcode-snippets.striped>tbody>:nth-child(odd),.wp-list-table.wpcode-snippets ul.striped>:nth-child(odd){background-color:var(--wpcode-background-gray)}.wpcode-admin-page.wpcode .tablenav.top{margin-bottom:16px}.wpcode-admin-page.wpcode .tablenav.bottom{margin-top:11px}.wpcode-admin-page.wpcode .wpcode-content a{}.wpcode-admin-page.wpcode .button{background:var(--wpcode-background-light);border-color:var(--wpcode-color-primary);color:var(--wpcode-color-primary)}.wpcode-cl-group{background:var(--wpcode-button-disabled-bg);border-radius:4px;margin-top:50px;padding:16px;position:relative}.wpcode-cl-group:first-child{margin-top:0}.wpcode-cl-group:first-child .wpcode-cl-group-or{display:none}#wpcode-conditions-holder{margin:16px 0;max-width:685px}.wpcode-cl-group-or{bottom:100%;height:50px;left:0;position:absolute;right:0}.wpcode-cl-group-or .wpcode-cl-group-or-line{background-color:var(--wpcode-button-disabled-bg);height:2px;left:0;position:absolute;right:0;top:50%}.wpcode-cl-group-or .wpcode-cl-group-or-text{background:#F5F5F5;border-radius:10px;color:var(--wpcode-text-color-heading);font-size:12px;font-weight:500;left:50%;padding:2px 9px;position:absolute;top:50%;transform:translate(-50%,-50%)}.wpcode-cl-rules-row{align-items:center;display:flex;justify-content:space-between;margin-bottom:8px}.wpcode-cl-rules-row .wpcode-cl-rules-row-options{align-items:flex-start;display:flex;max-width:653px}.wpcode-metabox-form-row-input .wpcode-cl-rules-row select{margin:0 16px 0 0;min-width:0;width:175px}.wpcode-metabox-form-row-input .wpcode-cl-rules-row select.wpcode-cl-rule-relation{width:130px}.wpcode-cl-rules-row .wpcode-cl-remove-row{flex-shrink:0}.wpcode-items-metabox{display:flex;padding:0}.wpcode-items-sidebar{flex-shrink:0;padding:var(--wpcode-space-v);width:242px}.wpcode-items-list{border-left:1px solid var(--wpcode-border-color);min-height:400px;padding:calc(var(--wpcode-space-v) / 2) 12px;width:100%}.wpcode-items-categories-list{margin:0}.wpcode-items-categories-list li{margin:0}.wpcode-items-categories-list button{background:transparent;border:none;color:var(--wpcode-text-color-paragraph);cursor:pointer;display:block;font-size:var(--wpcode-font-size-m);font-weight:500;padding:12px 8px;position:relative;text-align:left;width:100%}.wpcode-items-categories-list button:focus,.wpcode-items-categories-list button.wpcode-active{background:var(--wpcode-background-highlight);color:var(--wpcode-text-color-highlight)}.wpcode-items-categories-list button:hover{text-decoration:underline}.wpcode-items-categories-list button.wpcode-active{font-weight:700}.wpcode-items-categories-list button.wpcode-active:after{background-image:url("data:image/svg+xml,%3Csvg width=%2716%27 height=%2712%27 viewBox=%270 0 16 12%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M5.33329 9.25326L1.83329 5.75326L0.666626 6.91992L5.33329 11.5866L15.3333 1.58659L14.1666 0.419922L5.33329 9.25326Z%27 fill=%27%233568B7%27/%3E%3C/svg%3E%0A");content:'';height:12px;position:absolute;right:10px;top:50%;transform:translateY(-50%);width:16px}.wpcode-items-categories-list button.wpcode-active:hover{text-decoration:none}.wpcode-items-list-category{align-content:stretch;display:flex;flex-wrap:wrap;justify-content:flex-start}.wpcode-list-item{border:1px solid var(--wpcode-border-color);border-radius:4px;margin-bottom:24px;margin-right:12px;margin-left:12px;max-width:100%;padding:16px 20px;position:relative;width:100%}@media (min-width:961px){.wpcode-list-item{width:calc(50% - 24px)}}@media (min-width:1440px){.wpcode-list-item{width:calc(100% / 3 - 24px)}}.wpcode-list-item h3{font-size:var(--wpcode-font-size-m);line-height:1.2;margin:0;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.wpcode-list-item p{margin-bottom:0}.wpcode-list-item:hover .wpcode-list-item-description,.wpcode-list-item:focus .wpcode-list-item-description{opacity:0}.wpcode-list-item:hover .wpcode-list-item-buttons,.wpcode-list-item:focus .wpcode-list-item-buttons{opacity:1}@media (hover:none){.wpcode-list-item .wpcode-list-item-description{opacity:0}.wpcode-list-item .wpcode-list-item-buttons{opacity:1}}.wpcode-list-item .wpcode-list-item-pill{position:absolute;top:10px;right:10px;font-size:8px;font-weight:700;text-transform:uppercase;line-height:1;padding:4px 8px;border-radius:40px}.wpcode-list-item .wpcode-list-item-pill.wpcode-list-item-pill-blue{background:var(--wpcode-color-primary);color:#fff}.wpcode-list-item.wpcode-list-item-has-pill h3{max-width:calc(100% - 60px)}.wpcode-list-item-actions{position:relative}.wpcode-list-item-description{min-height:40px}.wpcode-list-item-buttons{display:flex;justify-content:space-between;opacity:0;position:absolute;top:0;width:100%;z-index:10}.wpcode-list-item-buttons .wpcode-button{flex-grow:1;margin-left:10px;text-align:center}.wpcode-list-item-buttons .wpcode-button:first-child{margin-left:0}.wpcode-items-search{margin-bottom:20px;position:relative}.wpcode-items-search input{border-color:var(--wpcode-border-color);font-size:var(--wpcode-font-size-s);height:38px;padding-left:32px;width:100%}.wpcode-items-search input::-moz-placeholder{color:var(--wpcode-text-color-placeholder)}.wpcode-items-search input:-ms-input-placeholder{color:var(--wpcode-text-color-placeholder)}.wpcode-items-search input::placeholder{color:var(--wpcode-text-color-placeholder)}.wpcode-items-search label{left:10px;position:absolute;top:11px}.wpcode-library-preview-header{padding-bottom:25px}.wpcode-library-preview-header h2{margin:0}.wpcode-library-preview-header .wpcode-close-modal{float:right}.wpcode-library-preview-content .CodeMirror{background:var(--wpcode-background-gray)}.wpcode-library-preview-content .CodeMirror-activeline-background{background:transparent !important}.wpcode-library-preview-content .CodeMirror-focused .CodeMirror-activeline-background{background:rgba(100,100,100,0.1) !important}.wpcode-library-preview-buttons{margin-top:25px}.wpcode-generator .wpcode-items-metabox{margin-bottom:0}.wpcode-generator .wpcode-generator-preview .CodeMirror{height:auto}.wpcode-generator-preview{background-color:var(--wpcode-background-highlight);border-color:var(--wpcode-border-color);border-style:solid;border-width:0 1px 1px;padding:15px 28px 24px}.wpcode-generator-preview-header{align-items:center;display:flex;margin-bottom:14px}.wpcode-generator-preview-header h2{margin:0 8px 0 0}.wpcode-generator-preview-header .wpcode-button{margin-left:12px}.wpcode-form-tab:after{clear:both;content:'';display:table}.wpcode-generator-column{float:left;padding:14px 14px;width:calc(100% / 3)}.wpcode-generator-actions{padding:28px 14px 14px;text-align:center}.wpcode-generator-field{margin-bottom:24px}.wpcode-generator-field label{color:var(--wpcode-text-color-heading);display:block;font-size:var(--wpcode-font-size-s);font-weight:600;margin-bottom:8px}.wpcode-generator-field input[type="text"]{width:100%}.wpcode-generator-field select{max-width:100%;width:100%}.wpcode-field-description{margin-top:8px}.wpcode-generator-field-list ul{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s);list-style:disc;padding-left:18px}.wpcode-loading-spinner{-webkit-animation:wpcode-spinner-rotation 0.8s linear infinite;animation:wpcode-spinner-rotation 0.8s linear infinite;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4MCA4MCI+CiAgICA8cGF0aCBkPSJNNDAgMEMxNy45IDAgMCAxNy45IDAgNDBzMTcuOSA0MCA0MCA0MCA0MC0xNy45IDQwLTQwUzYyLjEgMCA0MCAwem0wIDcyQzIyLjMgNzIgOCA1Ny43IDggNDBTMjIuMyA4IDQwIDhzMzIgMTQuMyAzMiAzMi0xNC4zIDMyLTMyIDMyeiIKICAgICAgICAgIG9wYWNpdHk9Ii4xNSIvPgogICAgPHBhdGggZmlsbD0iIzM1NjhCNyIKICAgICAgICAgIGQ9Ik03NS44IDQ3LjRoLS40Yy0yLjItLjItMy44LTIuMi0zLjYtNC40LjEtMSAuMS0yIC4xLTNDNzIgMjIuNCA1Ny42IDggNDAgOGMtMi4yIDAtNC0xLjgtNC00czEuOC00IDQtNGMyMi4xIDAgNDAgMTcuOSA0MCA0MCAwIDEuMy0uMSAyLjUtLjIgMy44LS4yIDIuMS0xLjkgMy42LTQgMy42eiIvPgo8L3N2Zz4K);background-repeat:no-repeat;background-size:16px 16px;display:none;height:16px;margin:0 10px;position:absolute;width:16px;z-index:40}@-webkit-keyframes wpcode-spinner-rotation{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes wpcode-spinner-rotation{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.wpcode-checkbox-line{margin-bottom:14px}.wpcode-checkbox-line .wpcode-checkbox-toggle{margin-right:8px}.wpcode-checkbox-line label{display:inline-block}.wpcode-repeater-group{border-top:1px solid var(--wpcode-border-color);padding-top:24px}.wpcode-repeater-group .wpcode-remove-row{margin-bottom:24px}#wpcode-importer-process{display:none}#wpcode-importer-process .process-completed{display:none}#wpcode-importer-process .status{background-color:#fff;border:1px solid #ddd;border-radius:3px;display:none;margin:20px 0 30px;max-height:800px;overflow-y:scroll}#wpcode-importer-process .item{border-bottom:1px solid #ddd;padding:20px}#wpcode-importer-process .item:last-of-type{border:none}#wpcode-importer-process .item .name{float:left;font-size:14px}#wpcode-importer-process .item .name svg{display:inline-block;margin:0 10px 0 0}#wpcode-importer-process .item .actions{float:right;font-size:14px}.wpcode-clear:after{clear:both;content:" ";display:table}#wpcode-plugins-importer{margin-bottom:20px;max-width:100%;width:400px}.wpcode-tools .pre-error,.wpcode-tools .info-area{background:#fff;border:1px solid #ddd;box-shadow:none;display:block;font-family:Menlo,Monaco,monospace;font-size:12px;height:450px;max-width:1000px;overflow:auto;padding:20px;white-space:pre;width:100%}.wpcode-admin-page .wpcode-alert{border:1px solid transparent;margin-bottom:18px;padding:16px}.wpcode-admin-page .wpcode-alert h4{color:inherit;margin-top:0}.wpcode-admin-page .wpcode-alert p{margin:0 0 15px 0}.wpcode-admin-page .wpcode-alert p:last-of-type{margin:0}.wpcode-admin-page .wpcode-alert.wpcode-alert-nomargin{margin:0}.wpcode-admin-page .wpcode-alert.wpcode-alert-small{font-size:12px}.wpcode-admin-page .wpcode-alert.wpcode-alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.wpcode-admin-page .wpcode-alert.wpcode-alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.wpcode-admin-page .wpcode-alert.wpcode-alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.wpcode-admin-page .wpcode-alert.wpcode-alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.wpcode-docs-overlay{background-color:#ffffff;bottom:0;display:none;left:0;max-height:100vh;opacity:1;overflow-y:auto;position:fixed;right:0;top:46px;z-index:100100}.wpcode-docs-overlay *{box-sizing:border-box}@media screen and (min-width:783px){.wpcode-docs-overlay{left:36px;top:32px}}@media screen and (min-width:961px){.wpcode-docs-overlay{left:160px}.folded .wpcode-docs-overlay{left:36px}}#wpcode-help-logo{left:36px;position:absolute;top:24px}#wpcode-help-close{cursor:pointer;display:inline-block;height:30px;padding:5px;position:absolute;right:37px;top:25px;transition:all 0.05s ease-out;width:30px;z-index:10}.wpcode-docs-content{background-color:#fff;margin:0 auto 50px auto;max-width:100%;padding:0 30px;width:760px}.wpcode-help-docs{margin-bottom:20px;padding:0 18px}.wpcode-help-docs a{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-m);text-decoration:none}.wpcode-help-docs a:hover,.wpcode-help-docs a:focus{color:var(--wpcode-text-color-heading);text-decoration:underline}.wpcode-help-docs .wpcode-icon-file-text{margin-right:14px}.wpcode-help-docs li{margin-bottom:18px}.wpcode-help-categories-toggle{border-bottom:1px solid var(--wpcode-border-color);margin-bottom:40px}.wpcode-help-category{border-top:1px solid var(--wpcode-border-color);margin:0}.wpcode-help-category header{align-items:center;color:var(--wpcode-text-color-heading);cursor:pointer;display:flex;flex-direction:row;font-size:var(--wpcode-font-size-l);font-weight:600;justify-content:flex-start;padding-left:18px;padding-right:25px}.wpcode-help-category header:hover{color:var(--wpcode-color-primary)}.wpcode-help-category .wpcode-icon-folder{margin:23px 11px 23px 0}.wpcode-help-category .wpcode-icon-arrow{margin-left:auto;transform-origin:center;transition:transform 300ms ease}.wpcode-help-category.open .wpcode-icon-arrow{transform:rotate(90deg)}.wpcode-help-category .wpcode-help-docs{display:none}#wpcode-help-search{padding:74px 0 50px 0;position:relative;text-align:center;top:0}#wpcode-help-search .wpcode-icon-search{display:none;left:17px;position:absolute;top:92px}#wpcode-help-search input{background-image:none;background-position:22px center;background-repeat:no-repeat;background-size:20px 20px;border:1px solid var(--wpcode-border-color);border-radius:3px;color:var(--wpcode-text-color-heading);font-size:20px;letter-spacing:0;line-height:20px;min-height:48px;padding:10px 10px 10px 42px;text-align:left;width:100%}#wpcode-help-search #wpcode-help-search-clear{cursor:pointer;left:17px;opacity:.7;position:absolute;top:92px}#wpcode-help-search.wpcode-search-empty #wpcode-help-search-clear{display:none}#wpcode-help-search.wpcode-search-empty .wpcode-icon-search{display:block}#wpcode-help-no-result li span{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s)}.wpcode-help-footer{align-items:center;display:flex;justify-content:space-between}.wpcode-help-footer .wpcode-help-footer-box{border:1px solid var(--wpcode-border-color);border-radius:8px;padding:40px 38px;text-align:center;width:calc(50% - 18px)}.wpcode-help-footer .wpcode-help-footer-box h3{font-size:var(--wpcode-font-size-l)}.wpcode-help-footer .wpcode-help-footer-box p{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-m)}.wpcode-notifications-drawer{background:#fff;border-left:1px solid var(--wpcode-border-color);bottom:0;position:fixed;right:-375px;top:32px;transition:right 300ms ease 0s,visibility 0s ease 400ms;visibility:hidden;width:375px;z-index:1100}.wpcode-notifications-open .wpcode-notifications-drawer{right:0;transition:right 300ms ease 0s,visibility 0s ease 0ms;visibility:visible}.wpcode-notifications-overlay{background-color:rgba(0,0,0,0.3);bottom:0;display:none;left:0;opacity:.5;position:fixed;right:0;top:46px;transition:.5s;z-index:1052}.folded .wpcode-notifications-overlay{left:36px}.wpcode-notifications-open .wpcode-notifications-overlay{display:block}@media screen and (min-width:783px){.wpcode-notifications-overlay{left:36px}.admin-bar .wpcode-notifications-overlay{top:32px}}@media screen and (min-width:961px){.wpcode-notifications-overlay{left:160px}.folded .wpcode-notifications-overlay{left:36px}}.wpcode-notifications-header{background:var(--wpcode-background-highlight);border-bottom:1px solid var(--wpcode-border-color);padding:18px 40px 18px 20px}.wpcode-notifications-header .wpcode-notifications-close{position:absolute;right:18px;top:22px}.wpcode-notifications-header .wpcode-notifications-close path{fill:var(--wpcode-text-color-heading)}.wpcode-notifications-header h3{color:var(--wpcode-text-color-heading);display:inline-block;font-size:var(--wpcode-font-size-s);font-weight:700;line-height:21px;margin:0 10px 0 0}.wpcode-notifications-list{height:calc(100% - 130px);overflow:auto}.wpcode-notifications-list ul{margin:0}.wpcode-notifications-list li{border-top:1px solid var(--wpcode-border-color);display:flex;margin:0;padding:24px}.wpcode-notifications-list li:first-child{border-top:none}.wpcode-notifications-list li h4{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-s);font-weight:600;line-height:21px;margin:0}.wpcode-notifications-list p{color:var(--wpcode-text-color-light-bg);font-size:var(--wpcode-font-size-s);margin:8px 0}.wpcode-notifications-list p.wpcode-start{font-size:var(--wpcode-font-size-xs)}.wpcode-notification-actions .wpcode-button{margin-right:10px}.wpcode-notifications-footer{border-top:1px solid var(--wpcode-border-color);padding:24px 27px;text-align:right}#wpcode-dismissed-title,#wpcode-notifications-show-active,.wpcode-notifications-dismissed{display:none}.show-dismissed #wpcode-notifications-show-dismissed,.show-dismissed .wpcode-notifications-active,.show-dismissed #wpcode-active-title{display:none}.show-dismissed #wpcode-notifications-show-active,.show-dismissed #wpcode-dismissed-title{display:inline-block}.show-dismissed .wpcode-notifications-dismissed{display:block}.wpcode-notifications-dismissed .wpcode-notification-dismiss{display:none}.wpcode-notification-icon{margin-right:10px}.wpcode-help-tooltip{cursor:help;display:inline-block;position:relative;vertical-align:middle}.wpcode-help-tooltip .wpcode-help-tooltip-text{background-color:var(--wpcode-color-primary);border-radius:6px;bottom:100%;color:#fff;font-size:var(--wpcode-font-size-s);font-weight:400;left:50%;margin-bottom:12px;margin-left:-90px;padding:12px 12px;position:absolute;text-align:center;visibility:hidden;width:180px;z-index:500}.wpcode-help-tooltip .wpcode-help-tooltip-text:after{border-color:var(--wpcode-color-primary) transparent transparent transparent;border-style:solid;border-width:10px 9px 0 9px;content:'';height:0;left:50%;margin-left:-9px;position:absolute;top:100%;width:0}.wpcode-help-tooltip:hover .wpcode-help-tooltip-text{visibility:visible}.wpcode-help-tooltip .wpcode-icon-help{margin-top:1px}.wpcode-help-tooltip .wpcode-icon-help path{fill:#8A8A8A}.wpcode-upgrade-welcome{background:#f3f4f5}.wpcode-welcome-content{max-width:1168px;margin:24px auto;clear:both}.wpcode-welcome-content *{box-sizing:border-box}.wpcode-welcome-content h2{font-size:22px;font-weight:600;margin-top:0;line-height:1.2}.wpcode-welcome-content h3{font-size:1.5em}.wpcode-welcome-content p{font-size:1.2em}.wpcode-welcome-box{background:#fff;padding:40px;border:1px solid #ddd;border-radius:4px;margin-bottom:30px}@media (max-width:767px){.wpcode-welcome-box{padding:26px}}.wpcode-welcome-logo{margin:4px 0 28px}.wpcode-welcome-text{width:700px;margin:32px auto;max-width:100%}.wpcode-welcome-features{display:flex;justify-content:space-between;flex-wrap:wrap;margin-top:42px}.wpcode-welcome-features .wpcode-welcome-feature{width:calc(33.3% - 16px);text-align:center;margin-bottom:32px;display:flex}@media (max-width:782px){.wpcode-welcome-features .wpcode-welcome-feature{width:100%}}.wpcode-welcome-features .wpcode-welcome-feature p{font-size:16px}.wpcode-welcome-features .wpcode-welcome-feature h3{font-size:18px;margin-top:6px}.wpcode-welcome-features .wpcode-welcome-feature .wpcode-welcome-feature-text{text-align:left;margin-left:16px}.wpcode-welcome-features .wpcode-welcome-feature-icon-icon path{fill:var(--wpcode-color-primary)}.wpcode-welcome-highlight{grid-template-columns:1fr 1fr;display:grid}@media (max-width:767px){.wpcode-welcome-highlight{grid-template-columns:1fr}}.wpcode-welcome-highlight .wpcode-welcome-highlight-column{padding:16px 0;align-self:center;grid-column-start:2}@media (min-width:768px){.wpcode-welcome-highlight .wpcode-welcome-highlight-column{padding:16px 20px}.wpcode-welcome-highlight .wpcode-welcome-highlight-column:nth-of-type(2n+1){grid-column-start:1}.wpcode-welcome-highlight .wpcode-welcome-highlight-column:nth-of-type(2n){grid-column-start:2}}.wpcode-welcome-highlight img{max-width:100%;width:100%;height:auto}.wpcode-buttons-row{text-align:left}.wpcode-welcome-syed-mircea{font-size:1.2em}.wpcode-welcome-syed-mircea .wpcode-welcome-person{display:inline-flex;align-items:center;margin-right:60px;margin-top:32px}.wpcode-welcome-syed-mircea .wpcode-welcome-person-image{margin-right:15px}.wpcode-welcome-syed-mircea .wpcode-welcome-person-text{font-size:13px;color:var(--wpcode-text-color-paragraph)}.wpcode-welcome-syed-mircea h4{color:var(--wpcode-text-color-heading);margin:0 0 4px;font-size:16px;font-weight:600}.wpcode-welcome-syed-mircea img{display:block;margin-bottom:0}.wpcode-welcome-syed-mircea span{align-self:end}.wpcode-upgrade-welcome #wpcontent{padding-right:10px}@media screen and (min-width:783px){.wpcode-upgrade-welcome #wpcontent{padding-right:20px}}
|
2 |
|
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;-moz-user-select:none;-ms-user-select:none;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{position:relative}.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;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;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;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{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}.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 transparent transparent transparent;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:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.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__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 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:transparent;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[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.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--highlighted[aria-selected]{background-color:#5897fb;color:white}.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:linear-gradient(to bottom,#fff 50%,#eee 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;margin-right:10px}.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:linear-gradient(to bottom,#eee 50%,#ccc 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 transparent transparent transparent;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:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;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:linear-gradient(to bottom,#fff 0%,#eee 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:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE',endColorstr='#FFFFFFFF',GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.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;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.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 transparent}.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[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{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}
|
4 |
|
1 |
+
:root{--wpcode-background-gray:#F8F8F8;--wpcode-background-highlight:#F6FAFF;--wpcode-background-light:#F3F4F5;--wpcode-background-red:#DF2A35;--wpcode-background-white:#fff;--wpcode-border-color:#ddd;--wpcode-button-disabled-bg:#F5F5F5;--wpcode-button-disabled-border:1px solid #DDDDDD;--wpcode-button-disabled-text:#bbb;--wpcode-button-primary-bg:var(--wpcode-color-primary);--wpcode-button-primary-bg-hover:#397EEB;--wpcode-button-primary-text:#fff;--wpcode-button-primary-text-hover:#fff;--wpcode-button-secondary-bg:#F8F8F8;--wpcode-button-secondary-bg-hover:#fff;--wpcode-button-secondary-border:1px solid #DDDDDD;--wpcode-button-secondary-text:#777;--wpcode-button-orange-bg:#E06B44;--wpcode-button-orange-bg-hover:#e17f5e;--wpcode-button-secondary-text-hover:#454545;--wpcode-color-primary:#3568B7;--wpcode-color-red:#DF2A35;--wpcode-color-red-darker:#AB2028;--wpcode-font-size-l:18px;--wpcode-font-size-m:16px;--wpcode-font-size-s:14px;--wpcode-font-size-xl:22px;--wpcode-font-size-xs:12px;--wpcode-font-size-xxl:24px;--wpcode-input-border:1px solid #DDD;--wpcode-input-border-active:#3568B7;--wpcode-input-text-color:#454545;--wpcode-notice-success-bg:#09A347;--wpcode-notice-success-text:#fff;--wpcode-space-h:36px;--wpcode-space-v:24px;--wpcode-text-color-heading:#454545;--wpcode-text-color-highlight:#3568B7;--wpcode-text-color-light-bg:#848A8A;--wpcode-text-color-paragraph:#777777;--wpcode-text-color-placeholder:#bbb}.wpcode-button,.swal2-styled.swal2-confirm.wpcode-button,.swal2-styled.wpcode-button{background-color:var(--wpcode-button-primary-bg);border:1px solid var(--wpcode-button-primary-bg);border-radius:4px;color:var(--wpcode-button-primary-text);cursor:pointer;display:inline-block;font-size:var(--wpcode-font-size-s);font-weight:700;line-height:1;padding:10px 16px;text-decoration:none}.wpcode-button.wpcode-button-icon,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-icon,.swal2-styled.wpcode-button.wpcode-button-icon{align-items:center;display:inline-flex;padding-bottom:12px;padding-top:12px}.wpcode-button.wpcode-button-icon svg,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-icon svg,.swal2-styled.wpcode-button.wpcode-button-icon svg{margin-right:5px}.wpcode-button.wpcode-button-icon.wpcode-copy-target,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-icon.wpcode-copy-target,.swal2-styled.wpcode-button.wpcode-button-icon.wpcode-copy-target{padding-bottom:10px;padding-top:10px}.wpcode-button.wpcode-button-wide,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-wide,.swal2-styled.wpcode-button.wpcode-button-wide{padding-left:50px;padding-right:50px}.wpcode-button:hover,.wpcode-button:focus,.swal2-styled.swal2-confirm.wpcode-button:hover,.swal2-styled.swal2-confirm.wpcode-button:focus,.swal2-styled.wpcode-button:hover,.swal2-styled.wpcode-button:focus{background-color:var(--wpcode-button-primary-bg-hover);border-color:var(--wpcode-button-primary-bg-hover);color:var(--wpcode-button-primary-text-hover)}.wpcode-button.wpcode-button-secondary,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-secondary,.swal2-styled.wpcode-button.wpcode-button-secondary{background-color:var(--wpcode-button-secondary-bg);border:var(--wpcode-button-secondary-border);color:var(--wpcode-button-secondary-text)}.wpcode-button.wpcode-button-secondary:hover,.wpcode-button.wpcode-button-secondary:focus,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-secondary:hover,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-secondary:focus,.swal2-styled.wpcode-button.wpcode-button-secondary:hover,.swal2-styled.wpcode-button.wpcode-button-secondary:focus{background-color:var(--wpcode-button-secondary-bg-hover);color:var(--wpcode-button-secondary-text-hover)}.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-inactive,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-inactive,.swal2-styled.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-inactive{background-color:var(--wpcode-button-disabled-bg);border-color:var(--wpcode-button-disabled-bg)}.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-selected,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-selected,.swal2-styled.wpcode-button.wpcode-button-secondary.wpcode-button-secondary-selected{border-color:var(--wpcode-button-primary-bg)}.wpcode-button.wpcode-button-orange,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-orange,.swal2-styled.wpcode-button.wpcode-button-orange{background-color:var(--wpcode-button-orange-bg);border-color:var(--wpcode-button-orange-bg);color:var(--wpcode-button-primary-text)}.wpcode-button.wpcode-button-orange:hover,.wpcode-button.wpcode-button-orange:focus,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-orange:hover,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-orange:focus,.swal2-styled.wpcode-button.wpcode-button-orange:hover,.swal2-styled.wpcode-button.wpcode-button-orange:focus{background-color:var(--wpcode-button-orange-bg-hover);color:var(--wpcode-button-primary-text)}.wpcode-button.wpcode-button-large,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-large,.swal2-styled.wpcode-button.wpcode-button-large{align-items:center;display:inline-flex;font-size:var(--wpcode-font-size-m);height:56px;justify-content:center;padding-left:var(--wpcode-space-h);padding-right:var(--wpcode-space-h);text-align:center}.wpcode-button.wpcode-button-large svg,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-large svg,.swal2-styled.wpcode-button.wpcode-button-large svg{margin-right:7px}.wpcode-button.wpcode-button-small,.swal2-styled.swal2-confirm.wpcode-button.wpcode-button-small,.swal2-styled.wpcode-button.wpcode-button-small{font-size:var(--wpcode-font-size-xs);padding:9px}.wpcode-button:disabled:hover,.wpcode-button:disabled,.swal2-styled.swal2-confirm.wpcode-button:disabled:hover,.swal2-styled.swal2-confirm.wpcode-button:disabled,.swal2-styled.wpcode-button:disabled:hover,.swal2-styled.wpcode-button:disabled{background-color:var(--wpcode-button-disabled-bg);border:var(--wpcode-button-disabled-border);color:var(--wpcode-button-disabled-text)}.wpcode-button-toggle{align-items:center;display:flex;justify-content:space-between;min-width:424px}.wpcode-button-toggle .wpcode-button,.wpcode-button-toggle .swal2-styled.swal2-confirm.wpcode-button,.wpcode-button-toggle .swal2-styled.wpcode-button{width:calc(50% - 5px);background:#fff;color:var(--wpcode-input-text-color)}.wpcode-button-toggle .wpcode-button-secondary{border:2px solid var(--wpcode-color-primary)}.wpcode-success-icon{display:none}.wpcode-show-success-icon .wpcode-success-icon{display:inline-block}.wpcode-show-success-icon .wpcode-default-icon{display:none}.wpcode-button-just-icon{background:none;border:none;cursor:pointer;padding:0}.wpcode-button-just-icon .wpcode-icon{display:block}.wpcode-text-button-icon{align-items:center;background:none;border:none;color:var(--wpcode-text-color-paragraph);cursor:pointer;display:inline-flex;font-size:var(--wpcode-font-size-s);font-weight:600;padding:0}.wpcode-text-button-icon:hover{color:var(--wpcode-text-color-heading)}.wpcode-text-button-icon:hover path{fill:var(--wpcode-text-color-heading)}.wpcode-text-button-icon .wpcode-icon{margin-right:5px}.wpcode-just-icon-button{background:none;border:none;cursor:pointer}.wpcode-button-text{background:none;border:none;color:var(--wpcode-text-color-paragraph);cursor:pointer;font-size:var(--wpcode-font-size-xs);padding:0;text-decoration:underline}.wpcode-button-text .wpcode-icon{margin-right:11px}.wpcode-button-text:focus,.wpcode-button-text:hover{text-decoration:none;background:none;color:var(--wpcode-text-color-heading)}.wpcode-button-text:focus svg path,.wpcode-button-text:hover svg path{fill:var(--wpcode-text-color-heading)}.wpcode-headers-footers #wpcontent,.wpcode-admin-page #wpcontent{padding-left:0 !important}.wpcode-headers-footers #wpwrap,.wpcode-admin-page #wpwrap{background:var(--wpcode-background-light)}.wpcode-header-top{align-items:center;background:var(--wpcode-background-gray);display:flex;justify-content:space-between;padding:var(--wpcode-space-v) var(--wpcode-space-h)}.wpcode-header-right button{margin-left:18px;vertical-align:middle}.wpcode-header-bottom{align-items:center;background:var(--wpcode-background-white);border-color:var(--wpcode-border-color);border-style:solid;border-width:1px 0;display:flex;justify-content:space-between;min-height:60px;padding:0 var(--wpcode-space-h)}.wpcode-header-bottom h1{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-xl);margin:0}.wpcode-header-bottom.wpcode-sticky{left:160px;position:fixed;right:0;top:32px;z-index:100}.folded .wpcode-header-bottom.wpcode-sticky{left:36px}.wpcode-column{align-items:center;display:flex;flex-flow:row}.wpcode-column .wpcode-button,.wpcode-column .swal2-styled.swal2-confirm.wpcode-button,.wpcode-column .swal2-styled.wpcode-button{margin-left:20px}#wpcode-header-logo{display:block}.wpcode-notifications-inbox{position:relative}.wpcode-notifications-inbox[data-count]:after{background:var(--wpcode-color-red);border-radius:50%;bottom:100%;color:#fff;content:attr(data-count);display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;font-weight:700;height:16px;left:100%;line-height:18px;min-width:16px;position:absolute;text-align:center;transform:translate(-50%,50%)}.wpcode-admin-tabs{font-size:14px;list-style:none;margin:0;overflow:auto;padding:0}.wpcode-admin-tabs li{float:left;margin:0 30px 0 0;padding:0}.wpcode-admin-tabs li button{border:none;background:transparent;cursor:pointer}.wpcode-admin-tabs li button,.wpcode-admin-tabs li a{border-bottom:4px solid #fff;box-shadow:none;color:var(--wpcode-text-color-paragraph);display:block;font-weight:600;padding:20px 0 18px 0;text-decoration:none;transition:border 300ms ease}.wpcode-admin-tabs li button.active,.wpcode-admin-tabs li a.active{border-color:var(--wpcode-color-primary);color:var(--wpcode-text-color-heading)}.wpcode-admin-tabs li button:focus,.wpcode-admin-tabs li button:hover,.wpcode-admin-tabs li a:focus,.wpcode-admin-tabs li a:hover{border-color:var(--wpcode-text-color-paragraph)}.wpcode-admin-tab-content{display:none;position:relative}.wpcode-admin-tab-content.active{display:block}.wpcode-content{padding:28px var(--wpcode-space-h)}.wpcode-content *{box-sizing:border-box}.wpcode-content h2{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-l)}.wpcode-content p{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s)}.wpcode-add-snippet .wpcode-content{padding-top:20px}.wpcode-content>hr{margin-bottom:36px;margin-top:36px}.wpcode-code-textarea{margin-bottom:var(--wpcode-space-h)}.wpcode-code-textarea h2{margin:12px 0 20px}.wrap{margin:0;padding:0 var(--wpcode-space-h)}.wrap div.error,.wrap div.updated{margin-bottom:0;position:relative}.wrap div:first-child{margin-top:28px}#wpfooter{padding-left:var(--wpcode-space-h);padding-right:var(--wpcode-space-h)}.wpcode-modal-overlay{background:rgba(0,0,0,0.3);bottom:0;display:none;left:0;position:fixed;right:0;top:0;z-index:1000}.admin-bar .wpcode-modal-overlay{top:32px}.wpcode-show-modal .wpcode-modal-overlay{display:block}.wpcode-modal{background:#fff;border:1px solid var(--wpcode-border-color);border-radius:8px;display:none;left:50%;max-width:100%;padding:25px;position:fixed;top:50%;transform:translate(-50%,-50%);width:752px;z-index:1050}.wpcode-show-modal .wpcode-modal{display:block}@media screen and (min-width:783px){.wpcode-modal{margin-left:18px}}@media screen and (min-width:961px){.wpcode-modal{margin-left:80px}.folded .wpcode-modal{margin-left:18px}}.wpcode-content .CodeMirror{border:1px solid var(--wpcode-border-color);border-radius:3px;font-size:var(--wpcode-font-size-s);line-height:25px}.wpcode-content .CodeMirror-linenumber{color:var(--wpcode-text-color-light-bg);font-size:var(--wpcode-font-size-xs)}.wpcode-content .CodeMirror-lines{padding:20px 0}.wpcode-content .CodeMirror-gutters{background-color:var(--wpcode-button-disabled-bg)}.CodeMirror-sizer:before{color:var(--wpcode-text-color-light-bg);position:absolute}[data-code-type="php"] .CodeMirror-sizer:before{content:"<?php"}[data-code-type="js"] .CodeMirror-sizer:before{content:"<script>"}.wpcode-input-title input.wpcode-input-text{font-size:var(--wpcode-font-size-m)}input.wpcode-input-number,input.wpcode-input-text{border:var(--wpcode-input-border);border-radius:4px;color:var(--wpcode-input-text-color);font-size:var(--wpcode-font-size-s);height:40px}input.wpcode-input-number:focus,input.wpcode-input-text:focus{border-color:var(--wpcode-input-border-active)}input.wpcode-input-text{width:100%}.wpcode-input-textarea{border:var(--wpcode-input-border);border-radius:4px;color:var(--wpcode-input-text-color);font-size:var(--wpcode-font-size-s);max-width:100%;resize:none;width:424px}.wpcode-input-select{align-items:center;display:flex}.wpcode-input-select label{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-s);font-weight:600}.wpcode-input-select select{margin-left:13px}.wpcode-metabox-form-row-input{width:100%}.wpcode-metabox-form-row-input select{min-width:424px}.wpcode-inline-select select{min-width:98px}.wpcode-inline-select>span{color:var(--wpcode-text-color-paragraph);display:inline-block;font-size:13px;margin-left:12px}.wpcode-separator{border-color:var(--wpcode-border-color);border-style:solid;border-width:1px 0 0;margin:var(--wpcode-space-v) 0}.wpcode-checkbox-toggle{display:inline-block;height:20px;position:relative;width:36px}.wpcode-checkbox-toggle input{display:none;height:0;opacity:0;width:0}.wpcode-checkbox-toggle input:checked+.wpcode-checkbox-toggle-slider{background-color:var(--wpcode-color-primary)}.wpcode-checkbox-toggle input:checked+.wpcode-checkbox-toggle-slider:before{transform:translateX(16px)}.wpcode-checkbox-toggle input:focus+.wpcode-checkbox-toggle-slider{box-shadow:0 0 1px #2196F3}.wpcode-checkbox-toggle .wpcode-checkbox-toggle-slider{background-color:#ccc;border-radius:20px;bottom:0;cursor:pointer;left:0;position:absolute;right:0;top:0;transition:.4s}.wpcode-checkbox-toggle .wpcode-checkbox-toggle-slider:before{background-color:white;border-radius:50%;bottom:3px;content:"";height:14px;left:3px;position:absolute;transition:.4s;width:14px}.wpcode-input-with-button{display:flex;width:100%}.wpcode-input-with-button .wpcode-input-text{margin-right:10px;width:100%}.wpcode-snippet-manager.wp-core-ui select,.wpcode-tools.wp-core-ui select,.wpcode-generator.wp-core-ui select{background-position-x:calc(100% - 13px);border-color:var(--wpcode-border-color);border-radius:4px;color:var(--wpcode-text-color-heading);line-height:38px;min-height:40px;padding-left:12px;padding-right:32px}.wpcode-metabox .select2-container .select2-search--inline{margin:0}.wpcode-metabox .select2-container .select2-search--inline .select2-search__field{color:var(--wpcode-text-color-heading);font-size:14px;margin:5px 5px 0}.wpcode-metabox .select2-container.select2-container--default .select2-selection--multiple{border-color:var(--wpcode-border-color)}.wpcode-metabox .select2-container.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:var(--wpcode-button-disabled-bg);border:none;border-radius:3px;color:var(--wpcode-text-color-heading);font-size:14px;margin:9px 8px 9px 0;padding:1px 4px}.wpcode-metabox .select2-container.select2-container--default .select2-selection--multiple .select2-selection__rendered{display:block;padding:0 8px}.wpcode-metabox .select2-container.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{margin-right:4px}.wpcode-metabox .select2-container .select2-selection--single{height:40px;font-size:var(--wpcode-font-size-s);border-color:var(--wpcode-border-color)}.wpcode-metabox .select2-container .select2-selection--single .select2-selection__rendered{padding:0 8px;line-height:40px}.wpcode-metabox .select2-container .select2-selection--single .select2-selection__arrow{height:40px;width:30px}.wpcode-admin-page .select2-dropdown{border-color:var(--wpcode-border-color);color:var(--wpcode-text-color-heading)}.wpcode-admin-page .select2-results .wpcode-pro-pill{margin-left:7px;vertical-align:middle}.wpcode-checkboxes-list label{display:block;margin-bottom:16px}.wpcode-checkboxes-list input{margin-right:12px}.wpcode-file-upload .wpcode-file-field{background-color:#fff;border:1px solid #ddd;border-radius:3px;box-shadow:none;color:var(--wpcode-text-color-paragraph);display:inline-block;margin:0 10px 0 0;min-height:40px;overflow:hidden;padding:10px 10px;text-overflow:ellipsis;vertical-align:middle;white-space:nowrap;width:400px}.wpcode-file-upload input[type=file]{height:0.1px;opacity:0;overflow:hidden;position:absolute;width:0.1px;z-index:-1}.wpcode-file-upload label{cursor:pointer;display:inline-flex;outline:none;padding:0;text-overflow:ellipsis;white-space:nowrap}.wpcode-checkbox-multiselect-columns{max-width:600px;position:relative}.wpcode-checkbox-multiselect-columns:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;min-height:0;visibility:hidden}.wpcode-checkbox-multiselect-columns:before{background-image:url("data:image/svg+xml,%3Csvg width=%2718%27 height=%2714%27 viewBox=%270 0 18 14%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M3.99 6L0 10L3.99 14V11H11V9H3.99V6ZM18 4L14.01 0V3H7V5H14.01V8L18 4Z%27 fill=%27%23999%27/%3E%3C/svg%3E%0A");color:#999;content:"";display:block;height:14px;left:50%;margin:0 0 0 -10px;position:absolute;top:130px;width:18px}.wpcode-checkbox-multiselect-columns .header{font-size:13px;font-weight:600;margin:0;padding:0 0 5px 0;text-align:center}.wpcode-checkbox-multiselect-columns .first-column,.wpcode-checkbox-multiselect-columns .second-column{float:left;width:45%}.wpcode-checkbox-multiselect-columns .second-column{float:right}.wpcode-checkbox-multiselect-columns .second-column ul li{padding:10px}.wpcode-checkbox-multiselect-columns ul{background-color:#fff;border:1px solid #ddd;border-radius:3px;height:250px;list-style-type:none;margin:0;overflow-y:auto;padding:0;position:relative}.wpcode-checkbox-multiselect-columns ul li{border-bottom:1px #eee solid;color:var(--wpcode-text-color-paragraph);font-size:14px;margin:0}.wpcode-checkbox-multiselect-columns ul li label{display:block;padding:10px 10px 10px 32px;position:relative;vertical-align:baseline}.wpcode-checkbox-multiselect-columns ul li label:hover{background-color:var(--wpcode-color-primary);color:#fff}.wpcode-checkbox-multiselect-columns ul li label:before{color:#ddd;content:"\f0c8";font:normal normal normal 16px/1 Georgia;-webkit-font-smoothing:antialiased;left:10px;-moz-osx-font-smoothing:grayscale;position:absolute;text-rendering:auto;top:12px}.wpcode-checkbox-multiselect-columns ul li label.checked{color:rgba(119,119,119,0.6)}.wpcode-checkbox-multiselect-columns ul li label.checked:hover{color:#fff}.wpcode-checkbox-multiselect-columns ul li label.checked:before{background-image:url("data:image/svg+xml,%3Csvg width=%2710%27 height=%278%27 viewBox=%270 0 10 8%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M1.38462 3.03448L0 4.13793L3.23077 8H4.46154L10 0.965517L8.76923 0L3.69231 4.96552L1.38462 3.03448Z%27 fill=%27%234982BF%27/%3E%3C/svg%3E%0A");background-position:3px 3px;background-repeat:no-repeat;background-size:10px 8px}.wpcode-checkbox-multiselect-columns ul li label input{display:none}.wpcode-checkbox-multiselect-columns .all{color:#999;display:inline-block;font-size:13px;margin:10px 0 0}.wpcode-admin-page .select2-container--default{font-size:12px;font-weight:500}.wpcode-admin-page .select2-container--default .select2-results__option .select2-results__option{padding-left:30px;color:var(--wpcode-text-color-heading);font-weight:500;margin-bottom:0}.wpcode-admin-page .select2-container--default .select2-results__option .select2-results__option[aria-disabled=true]{color:var(--wpcode-text-color-paragraph);opacity:0.5}.wpcode-admin-page .select2-container--default .select2-results__option .select2-results__option[aria-selected=true]{background-color:var(--wpcode-button-primary-bg);color:#fff}.wpcode-admin-page .select2-container--default .select2-results__option--highlighted[aria-selected]{background:var(--wpcode-button-disabled-bg);color:var(--wpcode-text-color-light-bg)}.wpcode-admin-page .select2-container--default .select2-results__group{padding-left:16px;color:var(--wpcode-text-color-paragraph);font-weight:500}.wpcode-flex{display:flex}.wpcode-code-textarea>.wpcode-flex{justify-content:space-between}.wpcode-input-title{margin-bottom:8px}.wpcode-status-text{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s);margin-right:8px;min-width:51px}#wp-wpcode_snippet_text-wrap{display:none}.wpcode-show-tinymce .wpcode-code-textarea .CodeMirror{display:none}.wpcode-show-tinymce #wp-wpcode_snippet_text-wrap{display:block}.wpcode-add-snippet-description{padding:var(--wpcode-space-v);background:#fff;border:1px solid var(--wpcode-border-color);border-bottom:0;border-radius:4px 4px 0 0;font-size:var(--wpcode-font-size-s);color:var(--wpcode-text-color-paragraph)}.wpcode-add-snippet-description a:hover{text-decoration:none}.wpcode-add-snippet-description+.wpcode-metabox{border-radius:0 0 4px 4px}.wpcode-button-save-to-library{margin-right:14px;text-decoration:none;font-size:var(--wpcode-font-size-s);font-weight:600;color:var(--wpcode-text-color-paragraph)}.wpcode-button-save-to-library svg{vertical-align:middle}.wpcode-button-save-to-library svg path{fill:var(--wpcode-text-color-paragraph)}.wpcode-button-save-to-library:hover{text-decoration:underline;color:var(--wpcode-text-color-heading)}.wpcode-button-save-to-library:hover svg path{fill:var(--wpcode-text-color-heading)}.wpcode-button-save-to-library:disabled{background-color:transparent;border:none}.wpcode-button-save-to-library#wpcode_save_to_library{opacity:0.5}.swal2-title{line-height:1.2}.wpcode-metabox{background:var(--wpcode-background-white);border:1px solid var(--wpcode-border-color);border-radius:4px;margin-bottom:var(--wpcode-space-h)}.wpcode-metabox-title{align-items:center;border-bottom:1px solid var(--wpcode-border-color);display:flex;justify-content:space-between}.wpcode-metabox-title-text{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-m);font-weight:600;padding:0 var(--wpcode-space-v)}.wpcode-metabox-button-toggle{background-color:var(--wpcode-background-white);border:none;cursor:pointer;height:60px;margin:0;text-align:center;width:60px}.wpcode-metabox-collapsed .wpcode-metabox-button-toggle svg{transform:rotate(180deg)}.wpcode-metabox-content{padding:var(--wpcode-space-v);padding-bottom:0}.wpcode-metabox-collapsed .wpcode-metabox-content{display:none}.wpcode-metabox-content p:first-child{margin-top:0}.wpcode-metabox-form{max-width:670px}.wpcode-metabox-form-row{display:flex;margin-bottom:var(--wpcode-space-v)}.wpcode-metabox-form-row-label{flex-shrink:0;width:245px}.wpcode-metabox-form-row-label label{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-s);font-weight:600}.wp-list-table.wpcode-snippets .column-status{width:65px}@media screen and (min-width:783px){.wp-list-table.wpcode-snippets .column-status{text-align:center}}.wp-list-table.wpcode-snippets .column-name a{color:var(--wpcode-text-color-heading);font-size:14px;text-decoration:none}.wp-list-table.wpcode-snippets .column-name a:hover,.wp-list-table.wpcode-snippets .column-name a:focus{color:var(--wpcode-text-color-paragraph)}.wp-list-table.wpcode-snippets .column-name .delete a,.wp-list-table.wpcode-snippets .column-name .trash a{color:var(--wpcode-background-red)}.wp-list-table.wpcode-snippets .column-name .delete a:hover,.wp-list-table.wpcode-snippets .column-name .delete a:focus,.wp-list-table.wpcode-snippets .column-name .trash a:hover,.wp-list-table.wpcode-snippets .column-name .trash a:focus{color:var(--wpcode-color-red-darker)}.wp-list-table.wpcode-snippets .column-location a,.wp-list-table.wpcode-snippets .column-author a{color:var(--wpcode-text-color-paragraph)}.wp-list-table.wpcode-snippets .column-location a:hover,.wp-list-table.wpcode-snippets .column-location a:focus,.wp-list-table.wpcode-snippets .column-author a:hover,.wp-list-table.wpcode-snippets .column-author a:focus{color:var(--wpcode-text-color-heading)}.wp-list-table.wpcode-snippets th.column-created a{color:var(--wpcode-text-color-heading)}.wp-list-table.wpcode-snippets th.column-created a:hover,.wp-list-table.wpcode-snippets th.column-created a:focus{color:var(--wpcode-text-color-paragraph)}.wp-list-table.wpcode-snippets .column-created{color:var(--wpcode-text-color-paragraph)}.wp-list-table.wpcode-snippets td.column-tags{color:var(--wpcode-color-primary)}.wp-list-table.wpcode-snippets td.column-tags a{color:var(--wpcode-color-primary);text-decoration:underline}.wp-list-table.wpcode-snippets td.column-tags a:hover,.wp-list-table.wpcode-snippets td.column-tags a:focus{text-decoration:none}.wp-list-table.wpcode-snippets .alternate,.wp-list-table.wpcode-snippets.striped>tbody>:nth-child(odd),.wp-list-table.wpcode-snippets ul.striped>:nth-child(odd){background-color:var(--wpcode-background-gray)}.wpcode-admin-page.wpcode .tablenav.top{margin-bottom:16px}.wpcode-admin-page.wpcode .tablenav.bottom{margin-top:11px}.wpcode-admin-page.wpcode .wpcode-content a{}.wpcode-admin-page.wpcode .button{background:var(--wpcode-background-light);border-color:var(--wpcode-color-primary);color:var(--wpcode-color-primary)}.wpcode-cl-group{background:var(--wpcode-button-disabled-bg);border-radius:4px;margin-top:50px;padding:16px;position:relative}.wpcode-cl-group:first-child{margin-top:0}.wpcode-cl-group:first-child .wpcode-cl-group-or{display:none}#wpcode-conditions-holder{margin:16px 0;max-width:685px}.wpcode-cl-group-or{bottom:100%;height:50px;left:0;position:absolute;right:0}.wpcode-cl-group-or .wpcode-cl-group-or-line{background-color:var(--wpcode-button-disabled-bg);height:2px;left:0;position:absolute;right:0;top:50%}.wpcode-cl-group-or .wpcode-cl-group-or-text{background:#F5F5F5;border-radius:10px;color:var(--wpcode-text-color-heading);font-size:12px;font-weight:500;left:50%;padding:2px 9px;position:absolute;top:50%;transform:translate(-50%,-50%)}.wpcode-cl-rules-row{align-items:center;display:flex;justify-content:space-between;margin-bottom:8px}.wpcode-cl-rules-row .wpcode-cl-rules-row-options{align-items:flex-start;display:flex;max-width:653px}.wpcode-metabox-form-row-input .wpcode-cl-rules-row select{margin:0 16px 0 0;min-width:0;width:175px}.wpcode-metabox-form-row-input .wpcode-cl-rules-row select.wpcode-cl-rule-relation{width:130px}.wpcode-cl-rules-row .wpcode-cl-remove-row{flex-shrink:0}.wpcode-items-metabox{display:flex;padding:0}.wpcode-items-sidebar{flex-shrink:0;padding:var(--wpcode-space-v);width:242px}.wpcode-items-list{border-left:1px solid var(--wpcode-border-color);min-height:400px;padding:calc(var(--wpcode-space-v) / 2) 12px;width:100%}.wpcode-items-categories-list{margin:0}.wpcode-items-categories-list li{margin:0}.wpcode-items-categories-list button{background:transparent;border:none;color:var(--wpcode-text-color-paragraph);cursor:pointer;display:block;font-size:var(--wpcode-font-size-m);font-weight:500;padding:12px 8px;position:relative;text-align:left;width:100%}.wpcode-items-categories-list button:focus,.wpcode-items-categories-list button.wpcode-active{background:var(--wpcode-background-highlight);color:var(--wpcode-text-color-highlight)}.wpcode-items-categories-list button:hover{text-decoration:underline}.wpcode-items-categories-list button.wpcode-active{font-weight:700}.wpcode-items-categories-list button.wpcode-active:after{background-image:url("data:image/svg+xml,%3Csvg width=%2716%27 height=%2712%27 viewBox=%270 0 16 12%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath d=%27M5.33329 9.25326L1.83329 5.75326L0.666626 6.91992L5.33329 11.5866L15.3333 1.58659L14.1666 0.419922L5.33329 9.25326Z%27 fill=%27%233568B7%27/%3E%3C/svg%3E%0A");content:'';height:12px;position:absolute;right:10px;top:50%;transform:translateY(-50%);width:16px}.wpcode-items-categories-list button.wpcode-active:hover{text-decoration:none}.wpcode-items-list-category{align-content:stretch;display:flex;flex-wrap:wrap;justify-content:flex-start}.wpcode-list-item{border:1px solid var(--wpcode-border-color);border-radius:4px;margin-bottom:24px;margin-right:12px;margin-left:12px;max-width:100%;padding:16px 20px;position:relative;width:100%}@media (min-width:961px){.wpcode-list-item{width:calc(50% - 24px)}}@media (min-width:1440px){.wpcode-list-item{width:calc(100% / 3 - 24px)}}.wpcode-list-item h3{font-size:var(--wpcode-font-size-m);line-height:1.2;margin:0;overflow:hidden;position:relative;text-overflow:ellipsis;white-space:nowrap}.wpcode-list-item p{margin-bottom:0}.wpcode-list-item:hover .wpcode-list-item-description,.wpcode-list-item:focus .wpcode-list-item-description{opacity:0}.wpcode-list-item:hover .wpcode-list-item-buttons,.wpcode-list-item:focus .wpcode-list-item-buttons{opacity:1}@media (hover:none){.wpcode-list-item .wpcode-list-item-description{opacity:0}.wpcode-list-item .wpcode-list-item-buttons{opacity:1}}.wpcode-list-item .wpcode-list-item-pill{position:absolute;top:10px;right:10px;font-size:8px;font-weight:700;text-transform:uppercase;line-height:1;padding:4px 8px;border-radius:40px}.wpcode-list-item .wpcode-list-item-pill.wpcode-list-item-pill-blue{background:var(--wpcode-color-primary);color:#fff}.wpcode-list-item .wpcode-list-item-pill.wpcode-list-item-pill-gray{background:var(--wpcode-text-color-heading);color:#fff}.wpcode-list-item.wpcode-list-item-has-pill h3{max-width:calc(100% - 60px)}.wpcode-list-item-actions{position:relative}.wpcode-list-item-description{min-height:40px}.wpcode-list-item-buttons{display:flex;justify-content:space-between;opacity:0;position:absolute;top:0;width:100%;z-index:10}.wpcode-list-item-buttons .wpcode-button,.wpcode-list-item-buttons .swal2-styled.swal2-confirm.wpcode-button,.wpcode-list-item-buttons .swal2-styled.wpcode-button{flex-grow:1;margin-left:10px;text-align:center}.wpcode-list-item-buttons .wpcode-button:first-child,.wpcode-list-item-buttons .swal2-styled.swal2-confirm.wpcode-button:first-child,.wpcode-list-item-buttons .swal2-styled.wpcode-button:first-child{margin-left:0}.wpcode-items-search{margin-bottom:20px;position:relative}.wpcode-items-search input{border-color:var(--wpcode-border-color);font-size:var(--wpcode-font-size-s);height:38px;padding-left:32px;width:100%}.wpcode-items-search input::-moz-placeholder{color:var(--wpcode-text-color-placeholder)}.wpcode-items-search input:-ms-input-placeholder{color:var(--wpcode-text-color-placeholder)}.wpcode-items-search input::placeholder{color:var(--wpcode-text-color-placeholder)}.wpcode-items-search label{left:10px;position:absolute;top:11px}.wpcode-library-preview-header{padding-bottom:25px}.wpcode-library-preview-header h2{margin:0}.wpcode-library-preview-header .wpcode-close-modal{float:right}.wpcode-library-preview-content .CodeMirror{background:var(--wpcode-background-gray)}.wpcode-library-preview-content .CodeMirror-activeline-background{background:transparent !important}.wpcode-library-preview-content .CodeMirror-focused .CodeMirror-activeline-background{background:rgba(100,100,100,0.1) !important}.wpcode-library-preview-buttons{margin-top:25px}.wpcode-item-use-button.wpcode-start-auth{padding-top:6px;padding-bottom:6px;justify-content:center}.wpcode-item-use-button.wpcode-start-auth svg{margin-right:9px}.wpcode-generator .wpcode-items-metabox{margin-bottom:0}.wpcode-generator .wpcode-generator-preview .CodeMirror{height:auto}.wpcode-generator-preview{background-color:var(--wpcode-background-highlight);border-color:var(--wpcode-border-color);border-style:solid;border-width:0 1px 1px;padding:15px 28px 24px}.wpcode-generator-preview-header{align-items:center;display:flex;margin-bottom:14px}.wpcode-generator-preview-header h2{margin:0 8px 0 0}.wpcode-generator-preview-header .wpcode-button,.wpcode-generator-preview-header .swal2-styled.swal2-confirm.wpcode-button,.wpcode-generator-preview-header .swal2-styled.wpcode-button{margin-left:12px}.wpcode-form-tab:after{clear:both;content:'';display:table}.wpcode-generator-column{float:left;padding:14px 14px;width:calc(100% / 3)}.wpcode-generator-actions{padding:28px 14px 14px;text-align:center}.wpcode-generator-field{margin-bottom:24px}.wpcode-generator-field label{color:var(--wpcode-text-color-heading);display:block;font-size:var(--wpcode-font-size-s);font-weight:600;margin-bottom:8px}.wpcode-generator-field input[type="text"]{width:100%}.wpcode-generator-field select{max-width:100%;width:100%}.wpcode-field-description{margin-top:8px}.wpcode-generator-field-list ul{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s);list-style:disc;padding-left:18px}.wpcode-checkbox-line{margin-bottom:14px}.wpcode-checkbox-line .wpcode-checkbox-toggle{margin-right:8px}.wpcode-checkbox-line label{display:inline-block}.wpcode-repeater-group{border-top:1px solid var(--wpcode-border-color);padding-top:24px}.wpcode-repeater-group .wpcode-remove-row{margin-bottom:24px}#wpcode-importer-process{display:none}#wpcode-importer-process .process-completed{display:none}#wpcode-importer-process .status{background-color:#fff;border:1px solid #ddd;border-radius:3px;display:none;margin:20px 0 30px;max-height:800px;overflow-y:scroll}#wpcode-importer-process .item{border-bottom:1px solid #ddd;padding:20px}#wpcode-importer-process .item:last-of-type{border:none}#wpcode-importer-process .item .name{float:left;font-size:14px}#wpcode-importer-process .item .name svg{display:inline-block;margin:0 10px 0 0}#wpcode-importer-process .item .actions{float:right;font-size:14px}.wpcode-clear:after{clear:both;content:" ";display:table}#wpcode-plugins-importer{margin-bottom:20px;max-width:100%;width:400px}.wpcode-tools .pre-error,.wpcode-tools .info-area{background:#fff;border:1px solid #ddd;box-shadow:none;display:block;font-family:Menlo,Monaco,monospace;font-size:12px;height:450px;max-width:1000px;overflow:auto;padding:20px;white-space:pre;width:100%}.wpcode-admin-page .wpcode-alert{border:1px solid transparent;margin-bottom:18px;padding:16px}.wpcode-admin-page .wpcode-alert h4{color:inherit;margin-top:0}.wpcode-admin-page .wpcode-alert p{margin:0 0 15px 0}.wpcode-admin-page .wpcode-alert p:last-of-type{margin:0}.wpcode-admin-page .wpcode-alert.wpcode-alert-nomargin{margin:0}.wpcode-admin-page .wpcode-alert.wpcode-alert-small{font-size:12px}.wpcode-admin-page .wpcode-alert.wpcode-alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.wpcode-admin-page .wpcode-alert.wpcode-alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.wpcode-admin-page .wpcode-alert.wpcode-alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.wpcode-admin-page .wpcode-alert.wpcode-alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.wpcode-docs-overlay{background-color:#ffffff;bottom:0;display:none;left:0;max-height:100vh;opacity:1;overflow-y:auto;position:fixed;right:0;top:46px;z-index:100100}.wpcode-docs-overlay *{box-sizing:border-box}@media screen and (min-width:783px){.wpcode-docs-overlay{left:36px;top:32px}}@media screen and (min-width:961px){.wpcode-docs-overlay{left:160px}.folded .wpcode-docs-overlay{left:36px}}#wpcode-help-logo{left:36px;position:absolute;top:24px}#wpcode-help-close{cursor:pointer;display:inline-block;height:30px;padding:5px;position:absolute;right:37px;top:25px;transition:all 0.05s ease-out;width:30px;z-index:10}.wpcode-docs-content{background-color:#fff;margin:0 auto 50px auto;max-width:100%;padding:0 30px;width:760px}.wpcode-help-docs{margin-bottom:20px;padding:0 18px}.wpcode-help-docs a{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-m);text-decoration:none}.wpcode-help-docs a:hover,.wpcode-help-docs a:focus{color:var(--wpcode-text-color-heading);text-decoration:underline}.wpcode-help-docs .wpcode-icon-file-text{margin-right:14px}.wpcode-help-docs li{margin-bottom:18px}.wpcode-help-categories-toggle{border-bottom:1px solid var(--wpcode-border-color);margin-bottom:40px}.wpcode-help-category{border-top:1px solid var(--wpcode-border-color);margin:0}.wpcode-help-category header{align-items:center;color:var(--wpcode-text-color-heading);cursor:pointer;display:flex;flex-direction:row;font-size:var(--wpcode-font-size-l);font-weight:600;justify-content:flex-start;padding-left:18px;padding-right:25px}.wpcode-help-category header:hover{color:var(--wpcode-color-primary)}.wpcode-help-category .wpcode-icon-folder{margin:23px 11px 23px 0}.wpcode-help-category .wpcode-icon-arrow{margin-left:auto;transform-origin:center;transition:transform 300ms ease}.wpcode-help-category.open .wpcode-icon-arrow{transform:rotate(90deg)}.wpcode-help-category .wpcode-help-docs{display:none}#wpcode-help-search{padding:74px 0 50px 0;position:relative;text-align:center;top:0}#wpcode-help-search .wpcode-icon-search{display:none;left:17px;position:absolute;top:92px}#wpcode-help-search input{background-image:none;background-position:22px center;background-repeat:no-repeat;background-size:20px 20px;border:1px solid var(--wpcode-border-color);border-radius:3px;color:var(--wpcode-text-color-heading);font-size:20px;letter-spacing:0;line-height:20px;min-height:48px;padding:10px 10px 10px 42px;text-align:left;width:100%}#wpcode-help-search #wpcode-help-search-clear{cursor:pointer;left:17px;opacity:.7;position:absolute;top:92px}#wpcode-help-search.wpcode-search-empty #wpcode-help-search-clear{display:none}#wpcode-help-search.wpcode-search-empty .wpcode-icon-search{display:block}#wpcode-help-no-result li span{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s)}.wpcode-help-footer{align-items:center;display:flex;justify-content:space-between}.wpcode-help-footer .wpcode-help-footer-box{border:1px solid var(--wpcode-border-color);border-radius:8px;padding:40px 38px;text-align:center;width:calc(50% - 18px)}.wpcode-help-footer .wpcode-help-footer-box h3{font-size:var(--wpcode-font-size-l)}.wpcode-help-footer .wpcode-help-footer-box p{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-m)}.wpcode-notifications-drawer{background:#fff;border-left:1px solid var(--wpcode-border-color);bottom:0;position:fixed;right:-375px;top:32px;transition:right 300ms ease 0s,visibility 0s ease 400ms;visibility:hidden;width:375px;z-index:1100}.wpcode-notifications-open .wpcode-notifications-drawer{right:0;transition:right 300ms ease 0s,visibility 0s ease 0ms;visibility:visible}.wpcode-notifications-overlay{background-color:rgba(0,0,0,0.3);bottom:0;display:none;left:0;opacity:.5;position:fixed;right:0;top:46px;transition:.5s;z-index:1052}.folded .wpcode-notifications-overlay{left:36px}.wpcode-notifications-open .wpcode-notifications-overlay{display:block}@media screen and (min-width:783px){.wpcode-notifications-overlay{left:36px}.admin-bar .wpcode-notifications-overlay{top:32px}}@media screen and (min-width:961px){.wpcode-notifications-overlay{left:160px}.folded .wpcode-notifications-overlay{left:36px}}.wpcode-notifications-header{background:var(--wpcode-background-highlight);border-bottom:1px solid var(--wpcode-border-color);padding:18px 40px 18px 20px}.wpcode-notifications-header .wpcode-notifications-close{position:absolute;right:18px;top:22px}.wpcode-notifications-header .wpcode-notifications-close path{fill:var(--wpcode-text-color-heading)}.wpcode-notifications-header h3{color:var(--wpcode-text-color-heading);display:inline-block;font-size:var(--wpcode-font-size-s);font-weight:700;line-height:21px;margin:0 10px 0 0}.wpcode-notifications-list{height:calc(100% - 130px);overflow:auto}.wpcode-notifications-list ul{margin:0}.wpcode-notifications-list li{border-top:1px solid var(--wpcode-border-color);display:flex;margin:0;padding:24px}.wpcode-notifications-list li:first-child{border-top:none}.wpcode-notifications-list li h4{color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-s);font-weight:600;line-height:21px;margin:0}.wpcode-notifications-list p{color:var(--wpcode-text-color-light-bg);font-size:var(--wpcode-font-size-s);margin:8px 0}.wpcode-notifications-list p.wpcode-start{font-size:var(--wpcode-font-size-xs)}.wpcode-notification-actions .wpcode-button,.wpcode-notification-actions .swal2-styled.swal2-confirm.wpcode-button,.wpcode-notification-actions .swal2-styled.wpcode-button{margin-right:10px}.wpcode-notifications-footer{border-top:1px solid var(--wpcode-border-color);padding:24px 27px;text-align:right}#wpcode-dismissed-title,#wpcode-notifications-show-active,.wpcode-notifications-dismissed{display:none}.show-dismissed #wpcode-notifications-show-dismissed,.show-dismissed .wpcode-notifications-active,.show-dismissed #wpcode-active-title{display:none}.show-dismissed #wpcode-notifications-show-active,.show-dismissed #wpcode-dismissed-title{display:inline-block}.show-dismissed .wpcode-notifications-dismissed{display:block}.wpcode-notifications-dismissed .wpcode-notification-dismiss{display:none}.wpcode-notification-icon{margin-right:10px}.wpcode-help-tooltip{cursor:help;display:inline-block;position:relative;vertical-align:middle}.wpcode-help-tooltip .wpcode-help-tooltip-text{background-color:var(--wpcode-color-primary);border-radius:6px;bottom:100%;color:#fff;font-size:var(--wpcode-font-size-s);font-weight:400;left:50%;margin-bottom:12px;margin-left:-90px;padding:12px 12px;position:absolute;text-align:center;visibility:hidden;width:180px;z-index:500}.wpcode-help-tooltip .wpcode-help-tooltip-text:after{border-color:var(--wpcode-color-primary) transparent transparent transparent;border-style:solid;border-width:10px 9px 0 9px;content:'';height:0;left:50%;margin-left:-9px;position:absolute;top:100%;width:0}.wpcode-help-tooltip:hover .wpcode-help-tooltip-text{visibility:visible}.wpcode-help-tooltip .wpcode-icon-help{margin-top:1px}.wpcode-help-tooltip .wpcode-icon-help path{fill:#8A8A8A}.wpcode-upgrade-welcome{background:#f3f4f5}.wpcode-welcome-content{max-width:1168px;margin:24px auto;clear:both}.wpcode-welcome-content *{box-sizing:border-box}.wpcode-welcome-content h2{font-size:22px;font-weight:600;margin-top:0;line-height:1.2}.wpcode-welcome-content h3{font-size:1.5em}.wpcode-welcome-content p{font-size:1.2em}.wpcode-welcome-box{background:#fff;padding:40px;border:1px solid #ddd;border-radius:4px;margin-bottom:30px}@media (max-width:767px){.wpcode-welcome-box{padding:26px}}.wpcode-welcome-logo{margin:4px 0 28px}.wpcode-welcome-text{width:700px;margin:32px auto;max-width:100%}.wpcode-welcome-features{display:flex;justify-content:space-between;flex-wrap:wrap;margin-top:42px}.wpcode-welcome-features .wpcode-welcome-feature{width:calc(33.3% - 16px);text-align:center;margin-bottom:32px;display:flex}@media (max-width:782px){.wpcode-welcome-features .wpcode-welcome-feature{width:100%}}.wpcode-welcome-features .wpcode-welcome-feature p{font-size:16px}.wpcode-welcome-features .wpcode-welcome-feature h3{font-size:18px;margin-top:6px}.wpcode-welcome-features .wpcode-welcome-feature .wpcode-welcome-feature-text{text-align:left;margin-left:16px}.wpcode-welcome-features .wpcode-welcome-feature-icon-icon path{fill:var(--wpcode-color-primary)}.wpcode-welcome-highlight{grid-template-columns:1fr 1fr;display:grid}@media (max-width:767px){.wpcode-welcome-highlight{grid-template-columns:1fr}}.wpcode-welcome-highlight .wpcode-welcome-highlight-column{padding:16px 0;align-self:center;grid-column-start:2}@media (min-width:768px){.wpcode-welcome-highlight .wpcode-welcome-highlight-column{padding:16px 20px}.wpcode-welcome-highlight .wpcode-welcome-highlight-column:nth-of-type(2n+1){grid-column-start:1}.wpcode-welcome-highlight .wpcode-welcome-highlight-column:nth-of-type(2n){grid-column-start:2}}.wpcode-welcome-highlight img{max-width:100%;width:100%;height:auto}.wpcode-buttons-row{text-align:left}.wpcode-welcome-syed-mircea{font-size:1.2em}.wpcode-welcome-syed-mircea .wpcode-welcome-person{display:inline-flex;align-items:center;margin-right:60px;margin-top:32px}.wpcode-welcome-syed-mircea .wpcode-welcome-person-image{margin-right:15px}.wpcode-welcome-syed-mircea .wpcode-welcome-person-text{font-size:13px;color:var(--wpcode-text-color-paragraph)}.wpcode-welcome-syed-mircea h4{color:var(--wpcode-text-color-heading);margin:0 0 4px;font-size:16px;font-weight:600}.wpcode-welcome-syed-mircea img{display:block;margin-bottom:0}.wpcode-welcome-syed-mircea span{align-self:end}.wpcode-upgrade-welcome #wpcontent{padding-right:10px}@media screen and (min-width:783px){.wpcode-upgrade-welcome #wpcontent{padding-right:20px}}.wpcode-loading-spinner{-webkit-animation:wpcode-spinner-rotation 0.8s linear infinite;animation:wpcode-spinner-rotation 0.8s linear infinite;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4MCA4MCI+CiAgICA8cGF0aCBkPSJNNDAgMEMxNy45IDAgMCAxNy45IDAgNDBzMTcuOSA0MCA0MCA0MCA0MC0xNy45IDQwLTQwUzYyLjEgMCA0MCAwem0wIDcyQzIyLjMgNzIgOCA1Ny43IDggNDBTMjIuMyA4IDQwIDhzMzIgMTQuMyAzMiAzMi0xNC4zIDMyLTMyIDMyeiIKICAgICAgICAgIG9wYWNpdHk9Ii4xNSIvPgogICAgPHBhdGggZmlsbD0iIzM1NjhCNyIKICAgICAgICAgIGQ9Ik03NS44IDQ3LjRoLS40Yy0yLjItLjItMy44LTIuMi0zLjYtNC40LjEtMSAuMS0yIC4xLTNDNzIgMjIuNCA1Ny42IDggNDAgOGMtMi4yIDAtNC0xLjgtNC00czEuOC00IDQtNGMyMi4xIDAgNDAgMTcuOSA0MCA0MCAwIDEuMy0uMSAyLjUtLjIgMy44LS4yIDIuMS0xLjkgMy42LTQgMy42eiIvPgo8L3N2Zz4K);background-repeat:no-repeat;background-size:16px 16px;display:none;height:16px;margin:0 10px;position:absolute;width:16px;z-index:40}@-webkit-keyframes wpcode-spinner-rotation{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}@keyframes wpcode-spinner-rotation{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.wpcode-pro-pill{background:#bbb;color:#fff;text-transform:uppercase;padding:4px 7px;border-radius:9px;font-size:8px;line-height:1;display:inline-block;vertical-align:text-top}.wpcode-revisions-list-area{margin:24px 0 24px;position:relative}.wpcode-revisions-list-area #wpcode-show-all-snippets{margin-top:24px}.wpcode-revisions-list{border-left:1px solid var(--wpcode-border-color);padding-left:22px;margin:0}.wpcode-revisions-list.wpcode-revisions-list-collapsed{display:none}.wpcode-revisions-list.wpcode-revisions-list-extra{margin-top:0}.wpcode-revisions-list.wpcode-revisions-list-extra .wpcode-revision-list-item:first-child{background-color:var(--wpcode-button-disabled-bg)}.wpcode-revision-list-item{background:var(--wpcode-button-disabled-bg);padding:6px 9px;font-size:var(--wpcode-font-size-s);position:relative}.wpcode-revision-list-item .avatar{border-radius:50%;vertical-align:middle}.wpcode-revision-list-item:before{position:absolute;content:'';width:7px;height:7px;border-radius:50%;background-color:#C4C4C4;border:2px solid #FFF;right:100%;margin-right:17px;top:50%;margin-top:-5px}.wpcode-revision-list-item:first-child{background-color:var(--wpcode-background-highlight)}.wpcode-revision-list-author{display:inline-block;margin:0 10px 0 12px;font-weight:600;color:var(--wpcode-text-color-heading)}.wpcode-revision-list-date{color:var(--wpcode-text-color-light-bg)}.wpcode-revision-list-item-actions{float:right;display:inline-flex;vertical-align:middle;align-items:center;margin-top:7px;margin-right:6px}.wpcode-revision-list-item-actions span,.wpcode-revision-list-item-actions a{font-size:12px;color:var(--wpcode-text-color-paragraph);margin-left:14px}.wpcode-revision-list-item-actions span:hover,.wpcode-revision-list-item-actions a:hover{text-decoration:none}.wpcode-blur-area{filter:blur(2px);pointer-events:none}.wpcode-library .wpcode-content{position:relative}#poststuff .wpcode-upsell-box,.wpcode-upsell-box{position:absolute;z-index:20;background:#fff;width:662px;max-width:100%;top:50%;left:50%;transform:translate(-50%,-50%);padding:40px;text-align:center;border-radius:8px;border:1px solid var(--wpcode-border-color)}#poststuff .wpcode-upsell-box *,.wpcode-upsell-box *{box-sizing:border-box}#poststuff .wpcode-upsell-box h2,.wpcode-upsell-box h2{font-size:var(--wpcode-font-size-xxl);margin-top:0;line-height:1.2}#poststuff .wpcode-upsell-box .wpcode-button,#poststuff .wpcode-upsell-box .swal2-styled.swal2-confirm.wpcode-button,#poststuff .wpcode-upsell-box .swal2-styled.wpcode-button,.wpcode-upsell-box .wpcode-button,.wpcode-upsell-box .swal2-styled.swal2-confirm.wpcode-button,.wpcode-upsell-box .swal2-styled.wpcode-button{margin-top:6px}#poststuff .wpcode-upsell-box .wpcode-upsell-button-text,.wpcode-upsell-box .wpcode-upsell-button-text{margin-top:16px;display:inline-block;font-size:var(--wpcode-font-size-s);color:var(--wpcode-text-color-light-bg)}#poststuff .wpcode-upsell-box .wpcode-upsell-button-text:hover,.wpcode-upsell-box .wpcode-upsell-button-text:hover{text-decoration:none}#poststuff .wpcode-upsell-box p,.wpcode-upsell-box p{color:var(--wpcode-text-color-paragraph);font-size:var(--wpcode-font-size-s)}#poststuff .wpcode-upsell-box.wpcode-upsell-box-with-features,.wpcode-upsell-box.wpcode-upsell-box-with-features{width:892px;padding:56px}#poststuff .wpcode-upsell-box.wpcode-upsell-box-with-features .wpcode-upsell-text,.wpcode-upsell-box.wpcode-upsell-box-with-features .wpcode-upsell-text{max-width:600px;margin:0 auto}#poststuff .wpcode-upsell-box .wpcode-upsell-features,.wpcode-upsell-box .wpcode-upsell-features{display:flex;flex-wrap:wrap;justify-content:space-between;margin-top:40px;margin-bottom:24px;text-align:left}#poststuff .wpcode-upsell-box .wpcode-upsell-features .wpcode-upsell-feature,.wpcode-upsell-box .wpcode-upsell-features .wpcode-upsell-feature{width:50%;color:var(--wpcode-text-color-heading);font-size:var(--wpcode-font-size-m);margin-bottom:16px;line-height:1.5;padding-left:34px;position:relative;padding-right:10px}#poststuff .wpcode-upsell-box .wpcode-upsell-features .wpcode-upsell-feature:before,.wpcode-upsell-box .wpcode-upsell-features .wpcode-upsell-feature:before{content:'';background-image:url("data:image/svg+xml,%3Csvg width=%2719%27 height=%2718%27 viewBox=%270 0 19 18%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cpath fill-rule=%27evenodd%27 clip-rule=%27evenodd%27 d=%27M9.5 0.416016C4.67 0.416016 0.75 4.33602 0.75 9.16602C0.75 13.996 4.67 17.916 9.5 17.916C14.33 17.916 18.25 13.996 18.25 9.16602C18.25 4.33602 14.33 0.416016 9.5 0.416016ZM9.5 16.166C5.64125 16.166 2.5 13.0248 2.5 9.16602C2.5 5.30727 5.64125 2.16602 9.5 2.16602C13.3587 2.16602 16.5 5.30727 16.5 9.16602C16.5 13.0248 13.3587 16.166 9.5 16.166ZM7.75 11.0648L13.5163 5.29852L14.75 6.54102L7.75 13.541L4.25 10.041L5.48375 8.80727L7.75 11.0648Z%27 fill=%27%2309A347%27/%3E%3C/svg%3E");display:block;width:19px;height:18px;position:absolute;left:0;top:3px}.wpcode-admin-page .swal2-title{font-size:var(--wpcode-font-size-xxl);color:var(--wpcode-text-color-heading);padding:0}.wpcode-admin-page .swal2-html-container{font-size:var(--wpcode-font-size-s);color:var(--wpcode-text-color-paragraph);line-height:1.5;margin-top:24px}.wpcode-admin-page .swal2-popup{padding:36px;width:560px;border:1px solid var(--wpcode-border-color);border-radius:0}.wpcode-admin-page .swal2-styled.swal2-confirm.wpcode-button:focus,.wpcode-admin-page .swal2-styled.wpcode-button:focus{box-shadow:0 0 0 3px rgb(53 104 183/50%)}.wpcode-admin-page .swal2-styled.swal2-confirm.wpcode-button.wpcode-button-orange:focus,.wpcode-admin-page .swal2-styled.wpcode-button.wpcode-button-orange:focus{box-shadow:0 0 0 3px rgb(224 107 68/50%)}.wpcode-admin-page .swal2-icon.wpcode-lock{border:none;height:auto;width:auto;margin-top:0;margin-bottom:14px}.wpcode-admin-page .swal2-close{position:absolute;top:10px;right:10px;color:var(--wpcode-text-color-heading);font-size:25px}.wpcode-admin-page .swal2-close:hover{color:var(--wpcode-button-orange-bg)}.wpcode-hide{display:none}.wpcode-setting-license-wrapper .wpcode-input-text{max-width:400px}
|
2 |
|
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;-moz-user-select:none;-ms-user-select:none;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{position:relative}.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;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;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;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{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}.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 transparent transparent transparent;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:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.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__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 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:transparent;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[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.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--highlighted[aria-selected]{background-color:#5897fb;color:white}.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:linear-gradient(to bottom,#fff 50%,#eee 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;margin-right:10px}.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:linear-gradient(to bottom,#eee 50%,#ccc 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 transparent transparent transparent;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:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;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:linear-gradient(to bottom,#fff 0%,#eee 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:linear-gradient(to bottom,#eee 50%,#fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE',endColorstr='#FFFFFFFF',GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.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;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.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 transparent}.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[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{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}
|
4 |
|
build/admin.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(){var e={233:function(){(window.WPCodeAdminCodeEditor||function(e,t,n){const i={l18n:wpcode,init(){t.WPCodeAdminCodeEditor=i},switch_code_mode(e){const t=i.get_editor();if(void 0===t)return!1;t.setOption("mode",i.get_mime_for_code_type(e)),t.setOption("lint",i.get_lint_for_code_type(e)),jQuery(t.getTextArea()).closest(".wpcode-code-textarea").attr("data-code-type",e)},get_editor:()=>(void 0===i.editor&&void 0!==wpcode_editor&&(i.editor=wpcode_editor.codemirror),i.editor),set_value(e){const t=i.get_editor();if(void 0===t)return!1;t.getDoc().setValue(e)},get_mime_for_code_type:e=>i.l18n.code_type_options[e].mime,get_lint_for_code_type:e=>i.l18n.code_type_options[e].lint,refresh(){i.get_editor().refresh()},get_value:()=>i.get_editor().getValue()};return i}(document,window,jQuery)).init()},560:function(){(window.WPCodeSnippetsTable||function(e,t,n){const i={l10n:wpcode,init:function(){i.should_init()&&i.init_status_toggle()},should_init:function(){return null!==e.getElementById("wpcode-code-snippets-table")},init_status_toggle:function(){n(".wpcode-status-toggle").on("change",(function(){const e=n(this),t=e.is(":checked"),o=e.data("id");i.update_status(t,o).fail((function(){e.prop("checked",!1)})).done((function(n){!1===n.success&&(e.prop("checked",!t),n.data.message&&WPCodeAdminNotices.add_notice(n.data.message,"error"))})).fail((function(e){e.responseText&&WPCodeAdminNotices.add_notice(e.responseText,"error")}))}))},update_status:function(e,t){return n.post(ajaxurl,{_wpnonce:i.l10n.nonce,action:"wpcode_update_snippet_status",snippet_id:t,active:e})}};return i}(document,window,jQuery)).init()},569:function(){(window.WPCodeConditionalLogic||function(e,t,n){const i={l10n:wpcode,init:function(){i.should_init()&&(i.find_elements(),i.add_events(),i.show_relations_for_all_rows())},should_init:function(){return void 0!==wpcode.conditions},find_elements:function(){i.conditions=wpcode.conditions,i.conditions_holder=n(e.getElementById("wpcode-conditions-holder")),i.conditions_input=n(e.getElementById("wpcode-cl-rules")),i.add_group_button=n(e.getElementById("wpcode-cl-add-group")),i.group_template=n(e.getElementById("wpcode-conditions-group-markup")).html(),i.row_template=n(e.getElementById("wpcode-conditions-group-row-markup")).html(),i.show_hide_input=n(e.getElementById("wpcode-cl-show-hide"))},add_events:function(){i.init_add_group(),i.init_add_row(),i.init_remove_row(),i.init_change_type(),i.init_capture_rules(),i.init_change_show_hide(),i.init_select2()},show_relations_for_all_rows(){i.conditions_holder.find(".wpcode-cl-rules-row").each((function(){i.show_hide_relation_options(n(this))}))},init_add_group:function(){i.add_group_button.on("click",(function(){i.add_group()}))},add_group(){const e=i.get_new_group();i.conditions_holder.append(e),i.add_new_row(e.find(".wpcode-cl-group-rules")),i.build_rules_from_inputs()},get_new_group:()=>n(i.group_template),get_new_row:()=>n(i.row_template),init_add_row(){i.conditions_holder.on("click",".wpcode-cl-add-row",(function(){i.add_new_row(n(this).closest(".wpcode-cl-group").find(".wpcode-cl-group-rules"))}))},init_remove_row(){i.conditions_holder.on("click",".wpcode-cl-remove-row",(function(){const e=n(this).closest(".wpcode-cl-group");n(this).closest(".wpcode-cl-rules-row").remove(),i.maybe_remove_group(e),i.build_rules_from_inputs()}))},maybe_remove_group(e){0===e.find(".wpcode-cl-group-rules .wpcode-cl-rules-row").length&&i.remove_group(e)},remove_group(e){e.remove(),i.build_rules_from_inputs()},add_new_row(e){const t=i.get_new_row();t.appendTo(e),i.handle_type_change(t.find(".wpcode-cl-rule-type")),i.build_rules_from_inputs()},init_change_type(){i.conditions_holder.on("change",".wpcode-cl-rule-type",(function(){i.handle_type_change(n(this))}))},init_change_show_hide(){i.show_hide_input.on("change",(function(){i.build_rules_from_inputs()}))},handle_type_change(e){const t=e.find("option:selected"),n=e.val(),o=t.closest("optgroup").data("type"),s=i.conditions[o].options[n],r=e.closest(".wpcode-cl-rules-row");e.parent().find(".wpcode-cl-rule-value").html(i.get_input_markup(s)),i.show_hide_relation_options(r),r.find(".wpcode-cl-rule-relation option").prop("selected",!1),i.init_select2()},get_input_markup(e){let t="";switch(e.type){case"select":t=i.get_input_select(e.options);break;case"text":t=i.get_input_text();break;case"ajax":t=i.get_input_ajax(e.options)}return t},get_input_select(e){const t=n("<select/>");return n.each(e,(function(e,i){t.append(n("<option />",{value:i.value}).text(i.label))})),t},get_input_text:()=>n('<input type="text" class="wpcode-input-text" />'),get_input_ajax:e=>n('<select data-action="'+e+'" class="wpcode-select2" multiple />'),init_capture_rules(){i.conditions_holder.on("change","input,select",(function(){i.build_rules_from_inputs()}))},build_rules_from_inputs(){const e=i.conditions_holder.find(".wpcode-cl-group"),t=[];e.each((function(e){const o=n(this).find(".wpcode-cl-rules-row");t[e]=[],o.each((function(){const o=n(this),s=o.find(".wpcode-cl-rule-type"),r=s.find("option:selected").closest("optgroup").data("type"),a=s.val(),l={},c=i.conditions[r].options[a];l.type=r,l.option=a,l.relation=o.find(".wpcode-cl-rule-relation").val(),l.value=i.get_input_value(c,o),t[e].push(l)}))}));const o={show:i.show_hide_input.val(),groups:t};i.conditions_input.val(JSON.stringify(o))},get_input_value(e,t){let n="";switch(e.type){case"select":case"ajax":n=t.find(".wpcode-cl-rule-value select").val();break;case"text":n=t.find(".wpcode-cl-rule-value input").val()}return n},show_hide_relation_options(e){const t=e.find(".wpcode-cl-rule-type"),o=t.val(),s=t.find("option:selected").closest("optgroup").data("type"),r=e.find(".wpcode-cl-rule-relation option"),a={select:["=","!="],ajax:["=","!="],text:["=","!=","contains","notcontains"]}[i.conditions[s].options[o].type];r.each((function(){a.indexOf(n(this).attr("value"))>-1?n(this).show():n(this).hide()}))},init_select2(){i.conditions_holder.find(".wpcode-select2").select2({ajax:{url:ajaxurl,data:function(e){return{action:n(this).data("action"),term:e.term,_wpnonce:i.l10n.nonce}}}})}};return i}(document,window,jQuery)).init()},786:function(){(window.WPCodeAdminGenerator||function(e,t,n){const i={doing_ajax_call:!1,ajax_snippet_update:!1,init:function(){i.should_init()&&(i.find_elements(),i.init_generator_form(),i.init_code_editor(),i.init_tabs(),i.init_use_snippet(),i.init_copy_editor(),i.init_repeater(),i.do_spacer(),n(e).ready((function(){i.init_autocomplete()})))},should_init:()=>(i.generator_form=n("#wpcode_generator_form"),i.generator_form.length>0),find_elements(){i.tabs_buttons=n(".wpcode-items-tabs"),i.tabs_content=n(".wpcode-items-list .wpcode-form-tab"),i.use_snippet=n("#wpcode-generator-use-snippet"),i.spinner=n("#wpcode-generator-spinner"),i.update_button=n("#wpcode-generator-update-code"),i.repeater_row=n("#wpcode-generator-repeater-row").html()},init_generator_form(){i.generator_form.on("submit",(function(e){e.preventDefault(),i.update_snippet()})),i.generator_form.on("change","input, select",(function(){i.update_snippet()}))},update_snippet(){i.doing_ajax_call||(i.ajax_snippet_update&&i.ajax_snippet_update.abort(),i.show_button_spinner(i.update_button),i.ajax_snippet_update=n.post(ajaxurl,n(i.generator_form).serialize()).done((function(e){i.ajax_snippet_update=!1,WPCodeAdminCodeEditor.set_value(e),i.hide_button_spinner(i.update_button)})))},init_tabs(){i.tabs_buttons.on("click","button",(function(e){e.preventDefault(),i.switch_active_tab(n(this))}))},switch_active_tab(e){i.tabs_buttons.find("button").removeClass("wpcode-active"),e.addClass("wpcode-active");const t=e.data("category");i.tabs_content.hide(),i.tabs_content.filter((function(){return n(this).data("tab")===t})).show(),i.do_spacer(),WPCodeAdminCodeEditor.refresh()},init_use_snippet(){i.use_snippet.on("click",(function(e){if(e.preventDefault(),i.doing_ajax_call)return;i.doing_ajax_call=!0;const o=i.generator_form.serializeArray(),s=n(this);n.each(o,(function(e,t){"action"===t.name&&(o[e].value="wpcode_save_generated_snippet")})),i.show_button_spinner(s),n.post(ajaxurl,n.param(o)).done((function(e){i.doing_ajax_call=!1,i.hide_button_spinner(s),e.success&&e.data.url&&(t.location=e.data.url)}))}))},show_button_spinner(e){e.prop("disabled",!0);const t=e.offset(),o=n("#adminmenuwrap").width(),s=n("#wpadminbar").height();i.spinner.show(),i.spinner.css({left:t.left-o+e.outerWidth(),top:t.top-s+e.outerHeight()/2-i.spinner.height()/2})},hide_button_spinner(e){e.prop("disabled",!1),i.spinner.hide()},init_copy_editor:function(){n(".wpcode-copy-target").on("click",(function(e){e.preventDefault();const t=n(this),i=WPCodeAdminCodeEditor.get_value();i&&(navigator.clipboard.writeText(i),t.addClass("wpcode-show-success-icon"),setTimeout((function(){t.removeClass("wpcode-show-success-icon")}),500))}))},init_repeater(){i.row_id=0,i.tabs_content.on("click",".wpcode-repeater-button",(function(){const e=n(this).data("target"),t=n(n('[data-repeater="'+e+'"]').get().reverse());let o,s,r=0;i.row_id++,t.each((function(){const e=n(this).closest(".wpcode-generator-column");e.is(o)||(r++,o=e,s=n(i.repeater_row),r>1?s.find("button").remove():s.find("button").data("target",i.row_id),s.attr("data-id",i.row_id),e.append(s)),n(this).clone().attr("data-repeater",null).prependTo(s).find("input").val(null)}));let a=0,l=n('.wpcode-repeater-group[data-id="'+i.row_id+'"]');l.each((function(){const e=n(this).height();e>a&&(a=e)})),l.height(a),l.first().find("input").first().focus()})),i.tabs_content.on("click",".wpcode-remove-row",(function(){const e=n(this).data("target");n('.wpcode-repeater-group[data-id="'+e+'"]').remove()}))},do_spacer(){n(".wpcode-generator-field-spacer").each((function(){const e=n(this).closest(".wpcode-generator-column"),t=n(this).closest(".wpcode-generator-column").outerHeight();let i=0;e.siblings(".wpcode-generator-column").each((function(){const e=n(this).height();e>i&&(i=e)})),i>t&&n(this).height(i-t+3)}))},init_autocomplete(){n(".wpcode-generator-field-autocomplete").each((function(){const e=n(this).find('input[type="text"]'),t=n(this).find(".wpcode-field-autocomplete").text();e.autocomplete({source:JSON.parse(t)})}))},init_code_editor(){const e=n(".wpcode-generator-code");if(0===e.length)return;const t=wp.codeEditor.initialize(e);i.CodeMirror=t.codemirror,i.CodeMirror.setOption("readOnly",!1),i.CodeMirror.on("change",(function(e){clearTimeout(i.editor_change_handler),i.editor_change_handler=setTimeout((function(){jQuery(e.getTextArea()).val(e.getValue()).change(),i.update_snippet()}),300)}))}};return i}(document,window,jQuery)).init()},448:function(){(window.WPCodeHeader||function(e,t,n){const i={init(){i.should_init()&&n(e).ready((function(){i.init_sticky_header()}))},should_init:()=>n("#wpcode_snippet_code").length>0||n("#ihaf_insert_header").length>0,init_sticky_header(){const e=n(".wpcode-header-bottom"),i=e.height(),o=e.offset().top,s=e.parent();n(t).scroll((function(){const r=n(t).scrollTop();o<r+32?(e.addClass("wpcode-sticky"),s.css("paddingBottom",i+"px")):(e.removeClass("wpcode-sticky"),s.css("paddingBottom",0))}))}};return i}(document,window,jQuery)).init()},847:function(){(window.WPCodeHelp||function(e,t,n){const i={init:function(){i.should_init()&&(i.find_elements(),i.init_show(),i.init_close_button(),i.init_search(),i.init_accordion())},should_init:()=>(i.$overlay=n("#wpcode-docs-overlay"),i.$overlay.length>0),find_elements(){i.$close_button=n("#wpcode-help-close"),i.$search=n("#wpcode-help-search"),i.$no_result=n("#wpcode-help-no-result"),i.$search_results=n("#wpcode-help-result ul"),i.$categories=n("#wpcode-help-categories")},init_close_button(){i.$close_button.on("click",(function(e){e.preventDefault(),i.$overlay.fadeOut(200)}))},init_show(){n(e).on("click",".wpcode-show-help",(function(e){e.preventDefault(),i.$overlay.fadeIn(200)}))},init_accordion(){i.$categories.on("click",".wpcode-help-category header",(function(){const e=n(this).closest(".wpcode-help-category");i.toggle_category(e)})),i.$categories.on("click",".viewall",(function(e){e.preventDefault(),n(this).closest(".wpcode-help-docs").find("div").slideDown(),n(this).hide()}))},toggle_category(e){e.toggleClass("open"),e.find(".wpcode-help-docs").slideToggle()},init_search(){i.$search.on("keyup","input",i.input_search),i.$search.on("click","#wpcode-help-search-clear",i.clear_search)},input_search(){i.$search_results.html("");const e=n(this).val().toLowerCase(),t=n("#wpcode-help-categories .wpcode-help-docs li").filter((function(){return n(this).text().toLowerCase().indexOf(""+e)>-1}));e.length>2&&t.clone().appendTo(i.$search_results),0===t.length?i.$no_result.show():i.$no_result.hide(),i.$search.toggleClass("wpcode-search-empty",!e)},clear_search(){i.$search.find("input").val("").trigger("keyup")}};return i}(document,window,jQuery)).init()},298:function(){(window.WPCodeInputs||function(e,t,n){const i={init(){n(i.ready)},ready(){i.initFileUploads(),i.initCheckboxMultiselectColumns()},initFileUploads(){n(".wpcode-file-upload").each((function(){const e=n(this).find("input[type=file]"),t=n(this).find("label"),i=t.html();e.on("change",(function(e){let n="";this.files&&this.files.length>1?n=(this.getAttribute("data-multiple-caption")||"").replace("{count}",this.files.length):e.target.value&&(n=e.target.value.split("\\").pop()),n?t.find(".wpcode-file-field").html(n):t.html(i)})),e.on("focus",(function(){e.addClass("has-focus")})).on("blur",(function(){e.removeClass("has-focus")}))}))},initCheckboxMultiselectColumns(){n(e).on("change",".wpcode-checkbox-multiselect-columns input",(function(){var e=n(this),t=e.parent(),i=e.closest(".wpcode-checkbox-multiselect-columns"),o=t.text(),s="check-item-"+e.val(),r=i.find("#"+s);e.prop("checked")?(e.parent().addClass("checked"),r.length||i.find(".second-column ul").append('<li id="'+s+'">'+o+"</li>")):(e.parent().removeClass("checked"),i.find("#"+s).remove())})),n(e).on("click",".wpcode-checkbox-multiselect-columns .all",(function(e){e.preventDefault(),n(this).closest(".wpcode-checkbox-multiselect-columns").find("input[type=checkbox]").prop("checked",!0).trigger("change")}))}};return i}(document,window,jQuery)).init()},900:function(){(window.WPCodeItemsList||function(e,t,n){const i={category:"*",search_term:"",init:function(){i.should_init()&&(i.find_elements(),i.init_category_switch(),i.init_search())},should_init:()=>(i.categories_list=n(".wpcode-items-filters"),i.categories_list.length>0),find_elements(){i.search_input=n("#wpcode-items-search")},init_category_switch(){i.categories_list.on("click","button",(function(){const e=n(this);e.hasClass("wpcode-active")||(i.switch_to_category(e.data("category")),i.switch_category_button(e))}))},switch_category_button(e){i.categories_list.find("button").removeClass("wpcode-active"),e.addClass("wpcode-active")},switch_to_category(e){i.category=e,i.filter_items()},filter_items(){let e;const t=n(".wpcode-list-item"),o=t.filter((function(){return"*"===i.category||n(this).data("categories").indexOf(i.category)>-1}));if(i.search_term.length>2){const o=i.search_term.toLowerCase();e=t.filter((function(){return n(this).text().toLowerCase().indexOf(""+o)>-1}))}else e=o;t.hide(),e.show()},init_search(){i.search_input.on("keyup change search",(function(){const e=n(this).val();e.length<3?i.search_term="":i.search_term=e,i.filter_items()}))}};return i}(document,window,jQuery)).init()},423:function(){(window.WPCodeAdminLibrary||function(e,t,n){const i={l10n:wpcode,init:function(){i.should_init()&&(i.find_elements(),i.init_preview())},should_init:()=>n(".wpcode-library-preview-button").length>0,find_elements(){i.library_list=n(".wpcode-items-list"),i.code_preview_use=n("#wpcode-preview-use-code"),i.code_preview_title=n("#wpcode-preview-title")},init_preview(){i.library_list.on("click",".wpcode-library-preview-button",(function(e){e.preventDefault();const t=n(this).parent().find(".wpcode-item-use-button"),o=n(this).closest(".wpcode-list-item").data("id");i.show_code_preview(o,t.attr("href")),i.code_preview_use.text(t.text())})),n(".wpcode-close-modal, .wpcode-modal-overlay").on("click",(function(){n("body").removeClass("wpcode-show-modal")}))},show_code_preview(e,t){const o=i.l10n.library.snippets.find((t=>t.library_id===e));WPCodeAdminCodeEditor.switch_code_mode(o.code_type),WPCodeAdminCodeEditor.set_value(o.code),i.code_preview_use.attr("href",t),i.code_preview_title.text(o.title),n("body").addClass("wpcode-show-modal"),WPCodeAdminCodeEditor.refresh()}};return i}(document,window,jQuery)).init()},5:function(){const e=window.WPCodeAdminNotices||function(e,t,n){const i={init:function(){t.WPCodeAdminNotices=i,i.notice_holder=n(e.getElementById("wpcode-notice-area")),i.document=n(e)},add_notice(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"updated";const o=n("<div />"),s=n("<p />");s.html(e),o.addClass("fade notice is-dismissible"),o.addClass(t),o.append(s),i.notice_holder.append(o),i.document.trigger("wp-updates-notice-added"),o.find("button").focus()}};return i}(document,window,jQuery);e.init()},770:function(){(window.WPCodeAdminNotifications||function(e,t,n){const i={init(){i.should_init()&&(i.find_elements(),i.init_open(),i.init_close(),i.init_dismiss(),i.init_view_switch(),i.update_count(i.active_count))},should_init:()=>(i.$drawer=n("#wpcode-notifications-drawer"),i.$drawer.length>0),find_elements(){i.$open_button=n("#wpcode-notifications-button"),i.$count=i.$drawer.find("#wpcode-notifications-count"),i.$dismissed_count=i.$drawer.find("#wpcode-notifications-dismissed-count"),i.active_count=i.$open_button.data("count")?i.$open_button.data("count"):0,i.dismissed_count=i.$open_button.data("dismissed"),i.$body=n("body"),i.$dismissed_button=n("#wpcode-notifications-show-dismissed"),i.$active_button=n("#wpcode-notifications-show-active"),i.$active_list=n(".wpcode-notifications-list .wpcode-notifications-active"),i.$dismissed_list=n(".wpcode-notifications-list .wpcode-notifications-dismissed"),i.$dismiss_all=n("#wpcode-dismiss-all")},update_count(e){i.$open_button.data("count",e).attr("data-count",e),0===e&&i.$open_button.removeAttr("data-count"),i.$count.text(e),i.dismissed_count+=Math.abs(e-i.active_count),i.active_count=e,i.$dismissed_count.text(i.dismissed_count),0===i.active_count&&i.$dismiss_all.hide()},init_open(){i.$open_button.on("click",(function(e){e.preventDefault(),i.$body.addClass("wpcode-notifications-open")}))},init_close(){i.$body.on("click",".wpcode-notifications-close, .wpcode-notifications-overlay",(function(e){e.preventDefault(),i.$body.removeClass("wpcode-notifications-open")}))},init_dismiss(){i.$drawer.on("click",".wpcode-notification-dismiss",(function(e){e.preventDefault();const t=n(this).data("id");if(i.dismiss_notification(t),"all"===t)return i.move_to_dismissed(i.$active_list.find("li")),void i.update_count(0);i.move_to_dismissed(n(this).closest("li")),i.update_count(i.active_count-1)}))},move_to_dismissed(e){e.slideUp((function(){n(this).prependTo(i.$dismissed_list).show()}))},dismiss_notification:e=>n.post(ajaxurl,{action:"wpcode_notification_dismiss",nonce:wpcode.nonce,id:e}),init_view_switch(){i.$dismissed_button.on("click",(function(e){e.preventDefault(),i.$drawer.addClass("show-dismissed")})),i.$active_button.on("click",(function(e){e.preventDefault(),i.$drawer.removeClass("show-dismissed")}))}};return i}(document,window,jQuery)).init()},801:function(){(window.WPCodeAdminTools||function(e,t,n){const i={init:function(){i.should_init()&&(i.find_elements(),i.init_importer(),i.init_ssl_verify())},should_init:()=>n("body").hasClass("wpcode-tools"),find_elements(){i.importer_button=n("#wpcode-importer-snippets-submit"),i.$import_progress=n("#wpcode-importer-process"),i.provider=n("#wpcode-importer-provider").val(),i.status_update=n("#wpcode-importer-status-update").html()},init_importer(){i.importer_button.on("click",(function(e){e.preventDefault();const t=n("#wpcode-importer-snippets input:checked");if(t.length){const e=[];t.each((function(){e.push(n(this).val())})),i.import_snippets(e)}}))},import_snippets(e){i.$import_progress.find(".snippet-total").text(e.length),i.$import_progress.find(".snippet-current").text("1"),n("#wpcode-importer-snippets").hide(),i.$import_progress.show(),i.import_queue=e,i.imported=0,i.import_snippet()},import_snippet(){const e=i.import_queue[0];n.post(ajaxurl,{action:"wpcode_import_snippet_"+i.provider,snippet_id:e,_wpnonce:wpcode.nonce}).done((function(e){if(e.success){i.import_queue.shift(),i.imported++;const t=n(i.status_update);t.find(".name span").text(e.data.name),t.find(".actions a").attr("href",e.data.edit),i.$import_progress.find(".status").prepend(t),i.$import_progress.find(".status").show(),0===i.import_queue.length?(i.$import_progress.find(".process-count").hide(),i.$import_progress.find(".snippets-completed").text(i.imported),i.$import_progress.find(".process-completed").show()):(i.$import_progress.find(".snippet-current").text(i.imported+1),i.import_snippet())}}))},init_ssl_verify(){n(e).on("click","#wpcode-ssl-verify",(function(e){e.preventDefault(),i.verify_ssl()}))},verify_ssl(){const e=n("#wpcode-ssl-verify"),t=e.text(),i=e.outerWidth(),o=e.parent(),s={action:"wpcode_verify_ssl",nonce:wpcode.nonce};e.css("width",i).prop("disabled",!0).text(wpcode.testing),n.post(ajaxurl,s,(function(n){console.log(n),o.find(".wpcode-alert, .wpcode-ssl-error").remove(),n.success&&e.before('<div class="wpcode-alert wpcode-alert-success">'+n.data.msg+"</div>"),!n.success&&n.data.msg&&e.before('<div class="wpcode-alert wpcode-alert-danger">'+n.data.msg+"</div>"),!n.success&&n.data.debug&&e.before('<div class="wpcode-ssl-error pre-error">'+n.data.debug+"</div>"),e.css("width",i).prop("disabled",!1).text(t)}))}};return i}(document,window,jQuery)).init()},868:function(){(window.WPCodeAdminWelcome||function(e,t,n){const i={init:function(){i.add_listener()},add_listener(){n("#wpbody-content").on("click",".wpcode-scroll-to",(function(e){e.preventDefault();const t=n(this).attr("href"),i=n(t);n("html, body").animate({scrollTop:i.offset().top},700)}))}};return i}(document,window,jQuery)).init()},686:function(e,t,n){var i,o,s;o=[n(567)],i=function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var n,i,o;return t&&t.requirejs||(t?i=t:t={},function(e){var t,s,r,a,l={},c={},d={},u={},p=Object.prototype.hasOwnProperty,h=[].slice,f=/\.js$/;function g(e,t){return p.call(e,t)}function _(e,t){var n,i,o,s,r,a,l,c,u,p,h,g=t&&t.split("/"),_=d.map,m=_&&_["*"]||{};if(e){for(r=(e=e.split("/")).length-1,d.nodeIdCompat&&f.test(e[r])&&(e[r]=e[r].replace(f,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),u=0;u<e.length;u++)if("."===(h=e[u]))e.splice(u,1),u-=1;else if(".."===h){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;u>0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((g||m)&&_){for(u=(n=e.split("/")).length;u>0;u-=1){if(i=n.slice(0,u).join("/"),g)for(p=g.length;p>0;p-=1)if((o=_[g.slice(0,p).join("/")])&&(o=o[i])){s=o,a=u;break}if(s)break;!l&&m&&m[i]&&(l=m[i],c=u)}!s&&l&&(s=l,a=c),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function m(t,n){return function(){var i=h.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),s.apply(e,i.concat([t,n]))}}function v(e){return function(t){l[e]=t}}function w(n){if(g(c,n)){var i=c[n];delete c[n],u[n]=!0,t.apply(e,i)}if(!g(l,n)&&!g(u,n))throw new Error("No "+n);return l[n]}function y(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function b(e){return e?y(e):[]}function $(e){return function(){return d&&d.config&&d.config[e]||{}}}r=function(e,t){var n,i,o=y(e),s=o[0],r=t[1];return e=o[1],s&&(n=w(s=_(s,r))),s?e=n&&n.normalize?n.normalize(e,(i=r,function(e){return _(e,i)})):_(e,r):(s=(o=y(e=_(e,r)))[0],e=o[1],s&&(n=w(s))),{f:s?s+"!"+e:e,n:e,pr:s,p:n}},a={require:function(e){return m(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:$(e)}}},t=function(t,n,i,o){var s,d,p,h,f,_,y,$=[],x=typeof i;if(_=b(o=o||t),"undefined"===x||"function"===x){for(n=!n.length&&i.length?["require","exports","module"]:n,f=0;f<n.length;f+=1)if("require"===(d=(h=r(n[f],_)).f))$[f]=a.require(t);else if("exports"===d)$[f]=a.exports(t),y=!0;else if("module"===d)s=$[f]=a.module(t);else if(g(l,d)||g(c,d)||g(u,d))$[f]=w(d);else{if(!h.p)throw new Error(t+" missing "+d);h.p.load(h.n,m(o,!0),v(d),{}),$[f]=l[d]}p=i?i.apply(l[t],$):void 0,t&&(s&&s.exports!==e&&s.exports!==l[t]?l[t]=s.exports:p===e&&y||(l[t]=p))}else t&&(l[t]=i)},n=i=s=function(n,i,o,l,c){if("string"==typeof n)return a[n]?a[n](i):w(r(n,b(i)).f);if(!n.splice){if((d=n).deps&&s(d.deps,d.callback),!i)return;i.splice?(n=i,i=o,o=null):n=e}return i=i||function(){},"function"==typeof o&&(o=l,l=c),l?t(e,n,i,o):setTimeout((function(){t(e,n,i,o)}),4),s},s.config=function(e){return s(e)},n._defined=l,(o=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),g(l,e)||g(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),t.requirejs=n,t.require=i,t.define=o),t.define("almond",(function(){})),t.define("jquery",[],(function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t})),t.define("select2/utils",["jquery"],(function(e){var t={};function n(e){var t=e.prototype,n=[];for(var i in t)"function"==typeof t[i]&&"constructor"!==i&&n.push(i);return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var o in t)n.call(t,o)&&(e[o]=t[o]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},t.Decorate=function(e,t){var i=n(t),o=n(e);function s(){var n=Array.prototype.unshift,i=t.prototype.constructor.length,o=e.prototype.constructor;i>0&&(n.call(arguments,e.prototype.constructor),o=t.prototype.constructor),o.apply(this,arguments)}t.displayName=e.displayName,s.prototype=new function(){this.constructor=s};for(var r=0;r<o.length;r++){var a=o[r];s.prototype[a]=e.prototype[a]}for(var l=function(e){var n=function(){};e in s.prototype&&(n=s.prototype[e]);var i=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,n),i.apply(this,arguments)}},c=0;c<i.length;c++){var d=i[c];s.prototype[d]=l(d)}return s};var i=function(){this.listeners={}};i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},t.Observable=i,t.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},t.bind=function(e,t){return function(){e.apply(t,arguments)}},t._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var o=0;o<n.length;o++){var s=n[o];(s=s.substring(0,1).toLowerCase()+s.substring(1))in i||(i[s]={}),o==n.length-1&&(i[s]=e[t]),i=i[s]}delete e[t]}}return e},t.hasScroll=function(t,n){var i=e(n),o=n.style.overflowX,s=n.style.overflowY;return(o!==s||"hidden"!==s&&"visible"!==s)&&("scroll"===o||"scroll"===s||i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth)},t.escapeMarkup=function(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,(function(e){return t[e]}))},t.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(n,(function(e){i=i.add(e)})),n=i}t.append(n)},t.__cache={};var o=0;return t.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++o),t=o.toString())),t},t.StoreData=function(e,n,i){var o=t.GetUniqueElementId(e);t.__cache[o]||(t.__cache[o]={}),t.__cache[o][n]=i},t.GetData=function(n,i){var o=t.GetUniqueElementId(n);return i?t.__cache[o]&&null!=t.__cache[o][i]?t.__cache[o][i]:e(n).data(i):t.__cache[o]},t.RemoveData=function(e){var n=t.GetUniqueElementId(e);null!=t.__cache[n]&&delete t.__cache[n],e.removeAttribute("data-select2-id")},t})),t.define("select2/results",["jquery","./utils"],(function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),o=this.options.get("translations").get(t.message);i.append(n(o(t.args))),i[0].className+=" select2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],o=this.option(i);t.push(o)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},n.prototype.position=function(e,t){t.find(".select2-results").append(e)},n.prototype.sort=function(e){return this.options.get("sorter")(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var n=this;this.data.current((function(i){var o=e.map(i,(function(e){return e.id.toString()}));n.$results.find(".select2-results__option[aria-selected]").each((function(){var n=e(this),i=t.GetData(this,"data"),s=""+i.id;null!=i.element&&i.element.selected||null==i.element&&e.inArray(s,o)>-1?n.attr("aria-selected","true"):n.attr("aria-selected","false")}))}))},n.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(n){var i=document.createElement("li");i.className="select2-results__option";var o={role:"option","aria-selected":"false"},s=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var r in(null!=n.element&&s.call(n.element,":disabled")||null==n.element&&n.disabled)&&(delete o["aria-selected"],o["aria-disabled"]="true"),null==n.id&&delete o["aria-selected"],null!=n._resultId&&(i.id=n._resultId),n.title&&(i.title=n.title),n.children&&(o.role="group",o["aria-label"]=n.text,delete o["aria-selected"]),o){var a=o[r];i.setAttribute(r,a)}if(n.children){var l=e(i),c=document.createElement("strong");c.className="select2-results__group",e(c),this.template(n,c);for(var d=[],u=0;u<n.children.length;u++){var p=n.children[u],h=this.option(p);d.push(h)}var f=e("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});f.append(d),l.append(c),l.append(f)}else this.template(n,i);return t.StoreData(i,"data",n),i},n.prototype.bind=function(n,i){var o=this,s=n.id+"-results";this.$results.attr("id",s),n.on("results:all",(function(e){o.clear(),o.append(e.data),n.isOpen()&&(o.setClasses(),o.highlightFirstItem())})),n.on("results:append",(function(e){o.append(e.data),n.isOpen()&&o.setClasses()})),n.on("query",(function(e){o.hideMessages(),o.showLoading(e)})),n.on("select",(function(){n.isOpen()&&(o.setClasses(),o.options.get("scrollAfterSelect")&&o.highlightFirstItem())})),n.on("unselect",(function(){n.isOpen()&&(o.setClasses(),o.options.get("scrollAfterSelect")&&o.highlightFirstItem())})),n.on("open",(function(){o.$results.attr("aria-expanded","true"),o.$results.attr("aria-hidden","false"),o.setClasses(),o.ensureHighlightVisible()})),n.on("close",(function(){o.$results.attr("aria-expanded","false"),o.$results.attr("aria-hidden","true"),o.$results.removeAttr("aria-activedescendant")})),n.on("results:toggle",(function(){var e=o.getHighlightedResults();0!==e.length&&e.trigger("mouseup")})),n.on("results:select",(function(){var e=o.getHighlightedResults();if(0!==e.length){var n=t.GetData(e[0],"data");"true"==e.attr("aria-selected")?o.trigger("close",{}):o.trigger("select",{data:n})}})),n.on("results:previous",(function(){var e=o.getHighlightedResults(),t=o.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var i=n-1;0===e.length&&(i=0);var s=t.eq(i);s.trigger("mouseenter");var r=o.$results.offset().top,a=s.offset().top,l=o.$results.scrollTop()+(a-r);0===i?o.$results.scrollTop(0):a-r<0&&o.$results.scrollTop(l)}})),n.on("results:next",(function(){var e=o.getHighlightedResults(),t=o.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var s=o.$results.offset().top+o.$results.outerHeight(!1),r=i.offset().top+i.outerHeight(!1),a=o.$results.scrollTop()+r-s;0===n?o.$results.scrollTop(0):r>s&&o.$results.scrollTop(a)}})),n.on("results:focus",(function(e){e.element.addClass("select2-results__option--highlighted")})),n.on("results:message",(function(e){o.displayMessage(e)})),e.fn.mousewheel&&this.$results.on("mousewheel",(function(e){var t=o.$results.scrollTop(),n=o.$results.get(0).scrollHeight-t+e.deltaY,i=e.deltaY>0&&t-e.deltaY<=0,s=e.deltaY<0&&n<=o.$results.height();i?(o.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):s&&(o.$results.scrollTop(o.$results.get(0).scrollHeight-o.$results.height()),e.preventDefault(),e.stopPropagation())})),this.$results.on("mouseup",".select2-results__option[aria-selected]",(function(n){var i=e(this),s=t.GetData(this,"data");"true"!==i.attr("aria-selected")?o.trigger("select",{originalEvent:n,data:s}):o.options.get("multiple")?o.trigger("unselect",{originalEvent:n,data:s}):o.trigger("close",{})})),this.$results.on("mouseenter",".select2-results__option[aria-selected]",(function(n){var i=t.GetData(this,"data");o.getHighlightedResults().removeClass("select2-results__option--highlighted"),o.trigger("results:focus",{data:i,element:e(this)})}))},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,i=e.offset().top,o=this.$results.scrollTop()+(i-n),s=i-n;o-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(o)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),o=this.options.get("escapeMarkup"),s=i(t,n);null==s?n.style.display="none":"string"==typeof s?n.innerHTML=o(s):e(n).append(s)},n})),t.define("select2/keys",[],(function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}})),t.define("select2/selection/base",["jquery","../utils","../keys"],(function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var n=e('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=t.GetData(this.$element[0],"old-tabindex")?this._tabindex=t.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),n.attr("title",this.$element.attr("title")),n.attr("tabindex",this._tabindex),n.attr("aria-disabled","false"),this.$selection=n,n},i.prototype.bind=function(e,t){var i=this,o=e.id+"-results";this.container=e,this.$selection.on("focus",(function(e){i.trigger("focus",e)})),this.$selection.on("blur",(function(e){i._handleBlur(e)})),this.$selection.on("keydown",(function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()})),e.on("results:focus",(function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)})),e.on("selection:update",(function(e){i.update(e.data)})),e.on("open",(function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",o),i._attachCloseHandler(e)})),e.on("close",(function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.trigger("focus"),i._detachCloseHandler(e)})),e.on("enable",(function(){i.$selection.attr("tabindex",i._tabindex),i.$selection.attr("aria-disabled","false")})),e.on("disable",(function(){i.$selection.attr("tabindex","-1"),i.$selection.attr("aria-disabled","true")}))},i.prototype._handleBlur=function(t){var n=this;window.setTimeout((function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)}),1)},i.prototype._attachCloseHandler=function(n){e(document.body).on("mousedown.select2."+n.id,(function(n){var i=e(n.target).closest(".select2");e(".select2.select2-container--open").each((function(){this!=i[0]&&t.GetData(this,"element").select2("close")}))}))},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},i.prototype.position=function(e,t){t.find(".selection").append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i.prototype.isEnabled=function(){return!this.isDisabled()},i.prototype.isDisabled=function(){return this.options.get("disabled")},i})),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function(e,t,n,i){function o(){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},o.prototype.bind=function(e,t){var n=this;o.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",(function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})})),this.$selection.on("focus",(function(e){})),this.$selection.on("blur",(function(e){})),e.on("focus",(function(t){e.isOpen()||n.$selection.trigger("focus")}))},o.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},o.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},o.prototype.selectionContainer=function(){return e("<span></span>")},o.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i);var o=t.title||t.text;o?n.attr("title",o):n.removeAttr("title")}else this.clear()},o})),t.define("select2/selection/multiple",["jquery","./base","../utils"],(function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},i.prototype.bind=function(t,o){var s=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",(function(e){s.trigger("toggle",{originalEvent:e})})),this.$selection.on("click",".select2-selection__choice__remove",(function(t){if(!s.isDisabled()){var i=e(this).parent(),o=n.GetData(i[0],"data");s.trigger("unselect",{originalEvent:t,data:o})}}))},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i<e.length;i++){var o=e[i],s=this.selectionContainer(),r=this.display(o,s);s.append(r);var a=o.title||o.text;a&&s.attr("title",a),n.StoreData(s[0],"data",o),t.push(s)}var l=this.$selection.find(".select2-selection__rendered");n.appendMany(l,t)}},i})),t.define("select2/selection/placeholder",["../utils"],(function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t})),t.define("select2/selection/allowClear",["jquery","../keys","../utils"],(function(e,t,n){function i(){}return i.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",(function(e){i._handleClear(e)})),t.on("keypress",(function(e){i._handleKeyboardClear(e,t)}))},i.prototype._handleClear=function(e,t){if(!this.isDisabled()){var i=this.$selection.find(".select2-selection__clear");if(0!==i.length){t.stopPropagation();var o=n.GetData(i[0],"data"),s=this.$element.val();this.$element.val(this.placeholder.id);var r={data:o};if(this.trigger("clear",r),r.prevented)this.$element.val(s);else{for(var a=0;a<o.length;a++)if(r={data:o[a]},this.trigger("unselect",r),r.prevented)return void this.$element.val(s);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},i.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},i.prototype.update=function(t,i){if(t.call(this,i),!(this.$selection.find(".select2-selection__placeholder").length>0||0===i.length)){var o=this.options.get("translations").get("removeAllItems"),s=e('<span class="select2-selection__clear" title="'+o()+'">×</span>');n.StoreData(s[0],"data",i),this.$selection.find(".select2-selection__rendered").prepend(s)}},i})),t.define("select2/selection/search",["jquery","../utils","../keys"],(function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=e('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,i,o){var s=this,r=i.id+"-results";e.call(this,i,o),i.on("open",(function(){s.$search.attr("aria-controls",r),s.$search.trigger("focus")})),i.on("close",(function(){s.$search.val(""),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.trigger("focus")})),i.on("enable",(function(){s.$search.prop("disabled",!1),s._transferTabIndex()})),i.on("disable",(function(){s.$search.prop("disabled",!0)})),i.on("focus",(function(e){s.$search.trigger("focus")})),i.on("results:focus",(function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")})),this.$selection.on("focusin",".select2-search--inline",(function(e){s.trigger("focus",e)})),this.$selection.on("focusout",".select2-search--inline",(function(e){s._handleBlur(e)})),this.$selection.on("keydown",".select2-search--inline",(function(e){if(e.stopPropagation(),s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which===n.BACKSPACE&&""===s.$search.val()){var i=s.$searchContainer.prev(".select2-selection__choice");if(i.length>0){var o=t.GetData(i[0],"data");s.searchRemoveChoice(o),e.preventDefault()}}})),this.$selection.on("click",".select2-search--inline",(function(e){s.$search.val()&&e.stopPropagation()}));var a=document.documentMode,l=a&&a<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(e){l?s.$selection.off("input.search input.searchcheck"):s.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(e){if(l&&"input"===e.type)s.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&s.handleSearch(e)}}))},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e;e=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").width():.75*(this.$search.val().length+1)+"em",this.$search.css("width",e)},i})),t.define("select2/selection/eventRelay",["jquery"],(function(e){function t(){}return t.prototype.bind=function(t,n,i){var o=this,s=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],r=["opening","closing","selecting","unselecting","clearing"];t.call(this,n,i),n.on("*",(function(t,n){if(-1!==e.inArray(t,s)){n=n||{};var i=e.Event("select2:"+t,{params:n});o.$element.trigger(i),-1!==e.inArray(t,r)&&(n.prevented=i.isDefaultPrevented())}}))},t})),t.define("select2/translation",["jquery","require"],(function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n})),t.define("select2/diacritics",[],(function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}})),t.define("select2/data/base",["../utils"],(function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),null!=n.id?i+="-"+n.id.toString():i+="-"+e.generateChars(4),i},t})),t.define("select2/data/select",["./base","../utils","jquery"],(function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each((function(){var e=n(this),o=i.item(e);t.push(o)})),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current((function(i){var o=[];(e=[e]).push.apply(e,i);for(var s=0;s<e.length;s++){var r=e[s].id;-1===n.inArray(r,o)&&o.push(r)}t.$element.val(o),t.$element.trigger("input").trigger("change")}));else{var i=e.id;this.$element.val(i),this.$element.trigger("input").trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,n(e.element).is("option"))return e.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current((function(i){for(var o=[],s=0;s<i.length;s++){var r=i[s].id;r!==e.id&&-1===n.inArray(r,o)&&o.push(r)}t.$element.val(o),t.$element.trigger("input").trigger("change")}))}},i.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",(function(e){n.select(e.data)})),e.on("unselect",(function(e){n.unselect(e.data)}))},i.prototype.destroy=function(){this.$element.find("*").each((function(){t.RemoveData(this)}))},i.prototype.query=function(e,t){var i=[],o=this;this.$element.children().each((function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var s=o.item(t),r=o.matches(e,s);null!==r&&i.push(r)}})),t({results:i})},i.prototype.addOptions=function(e){t.appendMany(this.$element,e)},i.prototype.option=function(e){var i;e.children?(i=document.createElement("optgroup")).label=e.text:void 0!==(i=document.createElement("option")).textContent?i.textContent=e.text:i.innerText=e.text,void 0!==e.id&&(i.value=e.id),e.disabled&&(i.disabled=!0),e.selected&&(i.selected=!0),e.title&&(i.title=e.title);var o=n(i),s=this._normalizeItem(e);return s.element=i,t.StoreData(i,"data",s),o},i.prototype.item=function(e){var i={};if(null!=(i=t.GetData(e[0],"data")))return i;if(e.is("option"))i={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){i={text:e.prop("label"),children:[],title:e.prop("title")};for(var o=e.children("option"),s=[],r=0;r<o.length;r++){var a=n(o[r]),l=this.item(a);s.push(l)}i.children=s}return(i=this._normalizeItem(i)).element=e[0],t.StoreData(e[0],"data",i),i},i.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=n.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},{selected:!1,disabled:!1},e)},i.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},i})),t.define("select2/data/array",["./select","../utils","jquery"],(function(e,t,n){function i(e,t){this._dataToConvert=t.get("data")||[],i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype.bind=function(e,t){i.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},i.prototype.select=function(e){var t=this.$element.find("option").filter((function(t,n){return n.value==e.id.toString()}));0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){var i=this,o=this.$element.find("option"),s=o.map((function(){return i.item(n(this)).id})).get(),r=[];function a(e){return function(){return n(this).val()==e.id}}for(var l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,s)>=0){var d=o.filter(a(c)),u=this.item(d),p=n.extend(!0,{},c,u),h=this.option(p);d.replaceWith(h)}else{var f=this.option(c);if(c.children){var g=this.convertToOptions(c.children);t.appendMany(f,g)}r.push(f)}}return r},i})),t.define("select2/data/ajax",["./array","../utils","jquery"],(function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var o=n.ajax(e);return o.then(t),o.fail(i),o}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){var i=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var o=n.extend({type:"GET"},this.ajaxOptions);function s(){var s=o.transport(o,(function(o){var s=i.processResults(o,e);i.options.get("debug")&&window.console&&console.error&&(s&&s.results&&n.isArray(s.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(s)}),(function(){(!("status"in s)||0!==s.status&&"0"!==s.status)&&i.trigger("results:message",{message:"errorLoading"})}));i._request=s}"function"==typeof o.url&&(o.url=o.url.call(this.$element,e)),"function"==typeof o.data&&(o.data=o.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(s,this.ajaxOptions.delay)):s()},i})),t.define("select2/data/tags",["jquery"],(function(e){function t(t,n,i){var o=i.get("tags"),s=i.get("createTag");void 0!==s&&(this.createTag=s);var r=i.get("insertTag");if(void 0!==r&&(this.insertTag=r),t.call(this,n,i),e.isArray(o))for(var a=0;a<o.length;a++){var l=o[a],c=this._normalizeItem(l),d=this.option(c);this.$element.append(d)}}return t.prototype.query=function(e,t,n){var i=this;this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,(function e(o,s){for(var r=o.results,a=0;a<r.length;a++){var l=r[a],c=null!=l.children&&!e({results:l.children},!0);if((l.text||"").toUpperCase()===(t.term||"").toUpperCase()||c)return!s&&(o.data=r,void n(o))}if(s)return!0;var d=i.createTag(t);if(null!=d){var u=i.option(d);u.attr("data-select2-tag",!0),i.addOptions([u]),i.insertTag(r,d)}o.results=r,n(o)})):e.call(this,t,n)},t.prototype.createTag=function(t,n){var i=e.trim(n.term);return""===i?null:{id:i,text:i}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){this.$element.find("option[data-select2-tag]").each((function(){this.selected||e(this).remove()}))},t})),t.define("select2/data/tokenizer",["jquery"],(function(e){function t(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,n,i){var o=this;n.term=n.term||"";var s=this.tokenizer(n,this.options,(function(t){var n=o._normalizeItem(t);if(!o.$element.find("option").filter((function(){return e(this).val()===n.id})).length){var i=o.option(n);i.attr("data-select2-tag",!0),o._removeOldTags(),o.addOptions([i])}!function(e){o.trigger("select",{data:e})}(n)}));s.term!==n.term&&(this.$search.length&&(this.$search.val(s.term),this.$search.trigger("focus")),n.term=s.term),t.call(this,n,i)},t.prototype.tokenizer=function(t,n,i,o){for(var s=i.get("tokenSeparators")||[],r=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<r.length;){var c=r[a];if(-1!==e.inArray(c,s)){var d=r.substr(0,a),u=l(e.extend({},n,{term:d}));null!=u?(o(u),r=r.substr(a+1)||"",a=0):a++}else a++}return{term:r}},t})),t.define("select2/data/minimumInputLength",[],(function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumInputLength",[],(function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumSelectionLength",[],(function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",(function(){i._checkIfMaximumSelected()}))},e.prototype.query=function(e,t,n){var i=this;this._checkIfMaximumSelected((function(){e.call(i,t,n)}))},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current((function(e){var i=null!=e?e.length:0;n.maximumSelectionLength>0&&i>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()}))},e})),t.define("select2/dropdown",["jquery","./utils"],(function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n})),t.define("select2/dropdown/search",["jquery","../utils"],(function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(t,n,i){var o=this,s=n.id+"-results";t.call(this,n,i),this.$search.on("keydown",(function(e){o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented()})),this.$search.on("input",(function(t){e(this).off("keyup")})),this.$search.on("keyup input",(function(e){o.handleSearch(e)})),n.on("open",(function(){o.$search.attr("tabindex",0),o.$search.attr("aria-controls",s),o.$search.trigger("focus"),window.setTimeout((function(){o.$search.trigger("focus")}),0)})),n.on("close",(function(){o.$search.attr("tabindex",-1),o.$search.removeAttr("aria-controls"),o.$search.removeAttr("aria-activedescendant"),o.$search.val(""),o.$search.trigger("blur")})),n.on("focus",(function(){n.isOpen()||o.$search.trigger("focus")})),n.on("results:all",(function(e){null!=e.query.term&&""!==e.query.term||(o.showSearch(e)?o.$searchContainer.removeClass("select2-search--hide"):o.$searchContainer.addClass("select2-search--hide"))})),n.on("results:focus",(function(e){e.data._resultId?o.$search.attr("aria-activedescendant",e.data._resultId):o.$search.removeAttr("aria-activedescendant")}))},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n})),t.define("select2/dropdown/hidePlaceholder",[],(function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var o=t[i];this.placeholder.id===o.id&&n.splice(i,1)}return n},e})),t.define("select2/dropdown/infiniteScroll",["jquery"],(function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},t.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",(function(e){i.lastParams=e,i.loading=!0})),t.on("query:append",(function(e){i.lastParams=e,i.loading=!0})),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},t.prototype.loadMoreIfNeeded=function(){var t=e.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&t&&this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore()},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t})),t.define("select2/dropdown/attachBody",["jquery","../utils"],(function(e,t){function n(t,n,i){this.$dropdownParent=e(i.get("dropdownParent")||document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("open",(function(){i._showDropdown(),i._attachPositioningHandler(t),i._bindContainerResultHandlers(t)})),t.on("close",(function(){i._hideDropdown(),i._detachPositioningHandler(t)})),this.$dropdownContainer.on("mousedown",(function(e){e.stopPropagation()}))},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:append",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:message",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("select",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("unselect",(function(){n._positionDropdown(),n._resizeDropdown()})),this._containerResultsHandlersBound=!0}},n.prototype._attachPositioningHandler=function(n,i){var o=this,s="scroll.select2."+i.id,r="resize.select2."+i.id,a="orientationchange.select2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each((function(){t.StoreData(this,"select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})})),l.on(s,(function(n){var i=t.GetData(this,"select2-scroll-position");e(this).scrollTop(i.y)})),e(window).on(s+" "+r+" "+a,(function(e){o._positionDropdown(),o._resizeDropdown()}))},n.prototype._detachPositioningHandler=function(n,i){var o="scroll.select2."+i.id,s="resize.select2."+i.id,r="orientationchange.select2."+i.id;this.$container.parents().filter(t.hasScroll).off(o),e(window).off(o+" "+s+" "+r)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("select2-dropdown--above"),i=this.$dropdown.hasClass("select2-dropdown--below"),o=null,s=this.$container.offset();s.bottom=s.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=s.top,r.bottom=s.top+r.height;var a=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),d=l<s.top-a,u=c>s.bottom+a,p={left:s.left,top:r.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var f={top:0,left:0};(e.contains(document.body,h[0])||h[0].isConnected)&&(f=h.offset()),p.top-=f.top,p.left-=f.left,n||i||(o="below"),u||!d||n?!d&&u&&n&&(o="below"):o="above",("above"==o||n&&"below"!==o)&&(p.top=r.top-f.top-a),null!=o&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+o),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+o)),this.$dropdownContainer.css(p)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n})),t.define("select2/dropdown/minimumResultsForSearch",[],(function(){function e(t){for(var n=0,i=0;i<t.length;i++){var o=t[i];o.children?n+=e(o.children):n++}return n}function t(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t})),t.define("select2/dropdown/selectOnClose",["../utils"],(function(e){function t(){}return t.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",(function(e){i._handleSelectOnClose(e)}))},t.prototype._handleSelectOnClose=function(t,n){if(n&&null!=n.originalSelect2Event){var i=n.originalSelect2Event;if("select"===i._type||"unselect"===i._type)return}var o=this.getHighlightedResults();if(!(o.length<1)){var s=e.GetData(o[0],"data");null!=s.element&&s.element.selected||null==s.element&&s.selected||this.trigger("select",{data:s})}},t})),t.define("select2/dropdown/closeOnSelect",[],(function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",(function(e){i._selectTriggered(e)})),t.on("unselect",(function(e){i._selectTriggered(e)}))},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e})),t.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}})),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],(function(e,t,n,i,o,s,r,a,l,c,d,u,p,h,f,g,_,m,v,w,y,b,$,x,C,A,D,E,S){function k(){this.reset()}return k.prototype.apply=function(d){if(null==(d=e.extend(!0,{},this.defaults,d)).dataAdapter){if(null!=d.ajax?d.dataAdapter=f:null!=d.data?d.dataAdapter=h:d.dataAdapter=p,d.minimumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,m)),d.maximumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,v)),d.maximumSelectionLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,w)),d.tags&&(d.dataAdapter=c.Decorate(d.dataAdapter,g)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=c.Decorate(d.dataAdapter,_)),null!=d.query){var u=t(d.amdBase+"compat/query");d.dataAdapter=c.Decorate(d.dataAdapter,u)}if(null!=d.initSelection){var S=t(d.amdBase+"compat/initSelection");d.dataAdapter=c.Decorate(d.dataAdapter,S)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,x)),null!=d.placeholder&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,$)),d.selectOnClose&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,D))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=y;else{var k=c.Decorate(y,b);d.dropdownAdapter=k}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,A)),d.closeOnSelect&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,E)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var O=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=c.Decorate(d.dropdownAdapter,O)}d.dropdownAdapter=c.Decorate(d.dropdownAdapter,C)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=o:d.selectionAdapter=i,null!=d.placeholder&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,s)),d.allowClear&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,r)),d.multiple&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var T=t(d.amdBase+"compat/containerCss");d.selectionAdapter=c.Decorate(d.selectionAdapter,T)}d.selectionAdapter=c.Decorate(d.selectionAdapter,l)}d.language=this._resolveLanguage(d.language),d.language.push("en");for(var j=[],P=0;P<d.language.length;P++){var q=d.language[P];-1===j.indexOf(q)&&j.push(q)}return d.language=j,d.translations=this._processTranslations(d.language,d.debug),d},k.prototype.reset=function(){function t(e){return e.replace(/[^\u0000-\u007E]/g,(function(e){return u[e]||e}))}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:{},matcher:function n(i,o){if(""===e.trim(i.term))return o;if(o.children&&o.children.length>0){for(var s=e.extend(!0,{},o),r=o.children.length-1;r>=0;r--)null==n(i,o.children[r])&&s.children.splice(r,1);return s.children.length>0?s:n(i,s)}var a=t(o.text).toUpperCase(),l=t(i.term).toUpperCase();return a.indexOf(l)>-1?o:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},k.prototype.applyFromElement=function(e,t){var n=e.language,i=this.defaults.language,o=t.prop("lang"),s=t.closest("[lang]").prop("lang"),r=Array.prototype.concat.call(this._resolveLanguage(o),this._resolveLanguage(n),this._resolveLanguage(i),this._resolveLanguage(s));return e.language=r,e},k.prototype._resolveLanguage=function(t){if(!t)return[];if(e.isEmptyObject(t))return[];if(e.isPlainObject(t))return[t];var n;n=e.isArray(t)?t:[t];for(var i=[],o=0;o<n.length;o++)if(i.push(n[o]),"string"==typeof n[o]&&n[o].indexOf("-")>0){var s=n[o].split("-")[0];i.push(s)}return i},k.prototype._processTranslations=function(t,n){for(var i=new d,o=0;o<t.length;o++){var s=new d,r=t[o];if("string"==typeof r)try{s=d.loadPath(r)}catch(e){try{r=this.defaults.amdLanguageBase+r,s=d.loadPath(r)}catch(e){n&&window.console&&console.warn&&console.warn('Select2: The language file for "'+r+'" could not be automatically loaded. A fallback will be used instead.')}}else s=e.isPlainObject(r)?new d(r):r;i.extend(s)}return i},k.prototype.set=function(t,n){var i={};i[e.camelCase(t)]=n;var o=c._convertData(i);e.extend(!0,this.defaults,o)},new k})),t.define("select2/options",["require","jquery","./defaults","./utils"],(function(e,t,n,i){function o(t,o){if(this.options=t,null!=o&&this.fromElement(o),null!=o&&(this.options=n.applyFromElement(this.options,o)),this.options=n.apply(this.options),o&&o.is("input")){var s=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,s)}}return o.prototype.fromElement=function(e){var n=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),i.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),i.StoreData(e[0],"data",i.GetData(e[0],"select2Tags")),i.StoreData(e[0],"tags",!0)),i.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",i.GetData(e[0],"ajaxUrl")),i.StoreData(e[0],"ajax-Url",i.GetData(e[0],"ajaxUrl")));var o={};function s(e,t){return t.toUpperCase()}for(var r=0;r<e[0].attributes.length;r++){var a=e[0].attributes[r].name,l="data-";if(a.substr(0,l.length)==l){var c=a.substring(l.length),d=i.GetData(e[0],c);o[c.replace(/-([a-z])/g,s)]=d}}t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset&&(o=t.extend(!0,{},e[0].dataset,o));var u=t.extend(!0,{},i.GetData(e[0]),o);for(var p in u=i._convertData(u))t.inArray(p,n)>-1||(t.isPlainObject(this.options[p])?t.extend(this.options[p],u[p]):this.options[p]=u[p]);return this},o.prototype.get=function(e){return this.options[e]},o.prototype.set=function(e,t){this.options[e]=t},o})),t.define("select2/core",["jquery","./options","./utils","./keys"],(function(e,t,n,i){var o=function(e,i){null!=n.GetData(e[0],"select2")&&n.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),i=i||{},this.options=new t(i,e),o.__super__.constructor.call(this);var s=e.attr("tabindex")||0;n.StoreData(e[0],"old-tabindex",s),e.attr("tabindex","-1");var r=this.options.get("dataAdapter");this.dataAdapter=new r(e,this.options);var a=this.render();this._placeContainer(a);var l=this.options.get("selectionAdapter");this.selection=new l(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var c=this.options.get("dropdownAdapter");this.dropdown=new c(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var d=this.options.get("resultsAdapter");this.results=new d(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var u=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(e){u.trigger("selection:update",{data:e})})),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),n.StoreData(e[0],"select2",this),e.data("select2",this)};return n.Extend(o,n.Observable),o.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},o.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},o.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var o=e.outerWidth(!1);return o<=0?"auto":o+"px"}if("style"==t){var s=e.attr("style");if("string"!=typeof s)return null;for(var r=s.split(";"),a=0,l=r.length;a<l;a+=1){var c=r[a].replace(/\s/g,"").match(n);if(null!==c&&c.length>=1)return c[1]}return null}return"computedstyle"==t?window.getComputedStyle(e[0]).width:t},o.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},o.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2",(function(){e.dataAdapter.current((function(t){e.trigger("selection:update",{data:t})}))})),this.$element.on("focus.select2",(function(t){e.trigger("focus",t)})),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=t?(this._observer=new t((function(t){e._syncA(),e._syncS(null,t)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",e._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",e._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",e._syncS,!1))},o.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",(function(t,n){e.trigger(t,n)}))},o.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",(function(){t.toggleDropdown()})),this.selection.on("focus",(function(e){t.focus(e)})),this.selection.on("*",(function(i,o){-1===e.inArray(i,n)&&t.trigger(i,o)}))},o.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",(function(t,n){e.trigger(t,n)}))},o.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",(function(t,n){e.trigger(t,n)}))},o.prototype._registerEvents=function(){var e=this;this.on("open",(function(){e.$container.addClass("select2-container--open")})),this.on("close",(function(){e.$container.removeClass("select2-container--open")})),this.on("enable",(function(){e.$container.removeClass("select2-container--disabled")})),this.on("disable",(function(){e.$container.addClass("select2-container--disabled")})),this.on("blur",(function(){e.$container.removeClass("select2-container--focus")})),this.on("query",(function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,(function(n){e.trigger("results:all",{data:n,query:t})}))})),this.on("query:append",(function(t){this.dataAdapter.query(t,(function(n){e.trigger("results:append",{data:n,query:t})}))})),this.on("keypress",(function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&t.altKey?(e.close(t),t.preventDefault()):n===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())}))},o.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},o.prototype._isChangeMutation=function(t,n){var i=!1,o=this;if(!t||!t.target||"OPTION"===t.target.nodeName||"OPTGROUP"===t.target.nodeName){if(n)if(n.addedNodes&&n.addedNodes.length>0)for(var s=0;s<n.addedNodes.length;s++)n.addedNodes[s].selected&&(i=!0);else n.removedNodes&&n.removedNodes.length>0?i=!0:e.isArray(n)&&e.each(n,(function(e,t){if(o._isChangeMutation(e,t))return i=!0,!1}));else i=!0;return i}},o.prototype._syncSubtree=function(e,t){var n=this._isChangeMutation(e,t),i=this;n&&this.dataAdapter.current((function(e){i.trigger("selection:update",{data:e})}))},o.prototype.trigger=function(e,t){var n=o.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in i){var s=i[e],r={prevented:!1,name:e,args:t};if(n.call(this,s,r),r.prevented)return void(t.prevented=!0)}n.call(this,e,t)},o.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},o.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},o.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},o.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},o.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},o.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},o.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current((function(t){e=t})),e},o.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,(function(e){return e.toString()}))),this.$element.val(n).trigger("input").trigger("change")},o.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",n.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),n.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},o.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),n.StoreData(t[0],"element",this.$element),t},o})),t.define("jquery-mousewheel",["jquery"],(function(e){return e})),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],(function(e,t,n,i,o){if(null==e.fn.select2){var s=["open","close","destroy"];e.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each((function(){var i=e.extend(!0,{},t);new n(e(this),i)})),this;if("string"==typeof t){var i,r=Array.prototype.slice.call(arguments,1);return this.each((function(){var e=o.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),i=e[t].apply(e,r)})),e.inArray(t,s)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=i),n})),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n},void 0===(s=i.apply(t,o))||(e.exports=s)},567:function(e){"use strict";e.exports=window.jQuery}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,n),s.exports}!function(){"use strict";n(233),n(686);const e=window.WPCodeSnippetManager||function(e,t,n){const i={editor_id:"wpcode_snippet_code",unload_set:!1,init:function(){i.should_init()&&(i.find_elements(),i.init_snippet_type_switcher(),i.init_auto_insert_toggle(),i.init_dynamic_hide(),i.init_copy_target(),i.init_tags_picker(),i.init_metabox_toggler(),i.init_select2(),i.init_tinymce_listener(),i.unload_change_listener())},should_init:function(){return void 0!==t.wpcode_editor&&null!==e.getElementById(i.editor_id)},find_elements(){i.location_dropdown=n("#wpcode_auto_insert_location"),i.switcher=n(e.getElementById("wpcode_snippet_type")),i.$body=n("body"),i.$text_editor=tinymce.get("wpcode_snippet_text")},init_snippet_type_switcher:function(){i.switcher.on("change",(function(){i.set_before_unload(),t.WPCodeAdminCodeEditor.switch_code_mode(n(this).val(),n(this).find(":selected").data("mode"),n(this).find(":selected").data("lint")),"text"===i.switcher.val()?(i.$body.addClass("wpcode-show-tinymce"),i.$text_editor.setContent(t.WPCodeAdminCodeEditor.get_value())):(i.$body.removeClass("wpcode-show-tinymce"),t.WPCodeAdminCodeEditor.refresh()),i.update_available_locations(i.switcher.val())}))},update_available_locations(e){const t=i.location_dropdown.find("optgroup");t.find("option").prop("disabled",!1).prop("selected",!1);const o=t.filter((function(){const t=n(this).data("code-type");return"all"!==t&&e!==t}));o.length>0&&o.find("option").prop("disabled",!0).prop("selected",!1)},init_auto_insert_toggle:function(){const t={toggles:"",init:function(){t.toggles=n(e.querySelectorAll(".wpcode-button-toggle")),t.listen_to_switch()},listen_to_switch:function(){t.toggles.each((function(){const e=n(this).find(".wpcode-button-toggle-input");n(this).on("click",".wpcode-button",(function(o){o.preventDefault(),i.set_before_unload(),e.val(n(this).val()).change(),t.make_button_active(n(this))}))}))},make_button_active:function(e){e.closest(".wpcode-button-toggle").find(".wpcode-button").each((function(){e.is(n(this))?n(this).removeClass("wpcode-button-secondary-inactive"):n(this).addClass("wpcode-button-secondary-inactive")}))}};t.init()},init_dynamic_hide:function(){const e={init:function(){e.elements=n("[data-show-if-id]"),e.add_listeners()},add_listeners:function(){e.elements.each((function(){const t=n(this),i=t.data("show-if-id");if(""===i)return;const o=String(t.data("show-if-value")).split(","),s=n(i);s.on("change",(function(){e.maybe_hide(s,t,o)})),e.maybe_hide(s,t,o)}))},maybe_hide:function(e,t,n){let i=String(e.val());"checkbox"===e.attr("type")&&(i=e.prop("checked")?"1":"0"),n.indexOf(i)<0?t.hide():t.show()}};e.init()},init_copy_target:function(){n(".wpcode-copy-target").on("click",(function(e){e.preventDefault();const t=n(this),i=t.data("target"),o=n(i).val();o&&(navigator.clipboard.writeText(o),t.addClass("wpcode-show-success-icon"),setTimeout((function(){t.removeClass("wpcode-show-success-icon")}),500))}))},init_select2:function(){n(".wpcode-select2").select2()},init_tags_picker:function(){const e=n(".wpcode-tags-picker");e.select2({tags:!0,ajax:{url:ajaxurl,data:function(e){return{action:"ajax-tag-search",tax:"wpcode_tags",q:e.term?e.term:""}},processResults:function(e){const t=e.split(","),n=[];return t.forEach((function(e){""!==e&&n.push({id:e,text:e})})),{results:n}}}}),e.on("change",(function(){i.set_before_unload();const e=n(this).data("target");n(e).val(n(this).val().join(","))}))},init_metabox_toggler:function(){n(".wpcode-metabox-title").on("click",(function(){n(this).parent().toggleClass("wpcode-metabox-collapsed")}))},init_tinymce_listener(){i.$text_editor.on("Paste Change input Undo Redo",(function(){i.set_before_unload(),clearTimeout(i.editor_change_handler),i.editor_change_handler=setTimeout((function(){t.WPCodeAdminCodeEditor.set_value(i.$text_editor.getContent())}),100)}))},set_before_unload(){i.unload_set||(i.unload_set=!0,n(t).on("beforeunload",(function(){return""})))},unload_change_listener(){t.WPCodeAdminCodeEditor.get_editor().on("change",(function(){i.set_before_unload()}));const e=n("#wpcode-snippet-manager-form");e.on("change","input, select",(function(){i.set_before_unload()})),e.on("submit",(function(){n(t).off("beforeunload")}))}};return i}(document,window,jQuery);jQuery((function(){e.init()})),n(560),n(569),n(5),n(900),n(423),n(786),n(298),n(801),n(847),n(770),n(868),n(448)}()}();
|
1 |
+
!function(){var e={233:function(){(window.WPCodeAdminCodeEditor||function(e,t,n){const o={l18n:wpcode,init(){t.WPCodeAdminCodeEditor=o},switch_code_mode(e,t){const n=o.get_editor(e);if(void 0===n)return!1;n.setOption("mode",o.get_mime_for_code_type(t)),n.setOption("lint",o.get_lint_for_code_type(t)),jQuery(n.getTextArea()).closest(".wpcode-code-textarea").attr("data-code-type",t)},get_editor:e=>wpcode_editor[e]?wpcode_editor[e].codemirror:void 0,set_value(e,t){const n=o.get_editor(e);if(void 0===n)return!1;n.getDoc().setValue(t)},get_mime_for_code_type:e=>o.l18n.code_type_options[e].mime,get_lint_for_code_type:e=>o.l18n.code_type_options[e].lint,refresh(e){o.get_editor(e).refresh()},get_value:e=>o.get_editor(e).getValue(),refresh_all(){n.each(wpcode_editor,(function(e,t){t.codemirror.refresh()}))}};return o}(document,window,jQuery)).init()},560:function(){(window.WPCodeSnippetsTable||function(e,t,n){const o={l10n:wpcode,init:function(){o.should_init()&&o.init_status_toggle()},should_init:function(){return null!==e.getElementById("wpcode-code-snippets-table")},init_status_toggle:function(){n(".wpcode-status-toggle").on("change",(function(){const e=n(this),t=e.is(":checked"),i=e.data("id");o.update_status(t,i).fail((function(){e.prop("checked",!1)})).done((function(n){!1===n.success&&(e.prop("checked",!t),n.data.message&&WPCodeAdminNotices.add_notice(n.data.message,"error"))})).fail((function(e){e.responseText&&WPCodeAdminNotices.add_notice(e.responseText,"error")}))}))},update_status:function(e,t){return n.post(ajaxurl,{_wpnonce:o.l10n.nonce,action:"wpcode_update_snippet_status",snippet_id:t,active:e})}};return o}(document,window,jQuery)).init()},569:function(){(window.WPCodeConditionalLogic||function(e,t,n){const o={l10n:wpcode,init:function(){o.should_init()&&(o.find_elements(),o.add_events(),o.show_relations_for_all_rows())},should_init:function(){return void 0!==wpcode.conditions},find_elements:function(){o.conditions=wpcode.conditions,o.conditions_holder=n(e.getElementById("wpcode-conditions-holder")),o.conditions_input=n(e.getElementById("wpcode-cl-rules")),o.add_group_button=n(e.getElementById("wpcode-cl-add-group")),o.group_template=n(e.getElementById("wpcode-conditions-group-markup")).html(),o.row_template=n(e.getElementById("wpcode-conditions-group-row-markup")).html(),o.show_hide_input=n(e.getElementById("wpcode-cl-show-hide"))},add_events:function(){o.init_add_group(),o.init_add_row(),o.init_remove_row(),o.init_change_type(),o.init_capture_rules(),o.init_change_show_hide(),o.init_select2()},show_relations_for_all_rows(){o.conditions_holder.find(".wpcode-cl-rules-row").each((function(){o.show_hide_relation_options(n(this))}))},init_add_group:function(){o.add_group_button.on("click",(function(){o.add_group()}))},add_group(){const e=o.get_new_group();o.conditions_holder.append(e),o.add_new_row(e.find(".wpcode-cl-group-rules")),o.build_rules_from_inputs()},get_new_group:()=>n(o.group_template),get_new_row:()=>n(o.row_template),init_add_row(){o.conditions_holder.on("click",".wpcode-cl-add-row",(function(){o.add_new_row(n(this).closest(".wpcode-cl-group").find(".wpcode-cl-group-rules"))}))},init_remove_row(){o.conditions_holder.on("click",".wpcode-cl-remove-row",(function(){const e=n(this).closest(".wpcode-cl-group");n(this).closest(".wpcode-cl-rules-row").remove(),o.maybe_remove_group(e),o.build_rules_from_inputs()}))},maybe_remove_group(e){0===e.find(".wpcode-cl-group-rules .wpcode-cl-rules-row").length&&o.remove_group(e)},remove_group(e){e.remove(),o.build_rules_from_inputs()},add_new_row(e){const t=o.get_new_row();t.appendTo(e),o.handle_type_change(t.find(".wpcode-cl-rule-type")),o.build_rules_from_inputs()},init_change_type(){o.conditions_holder.on("change",".wpcode-cl-rule-type",(function(){o.handle_type_change(n(this))}))},init_change_show_hide(){o.show_hide_input.on("change",(function(){o.build_rules_from_inputs()}))},handle_type_change(e){const t=e.find("option:selected"),n=e.val(),i=t.closest("optgroup").data("type"),s=o.conditions[i].options[n],r=e.closest(".wpcode-cl-rules-row");e.parent().find(".wpcode-cl-rule-value").html(o.get_input_markup(s)),o.show_hide_relation_options(r),r.find(".wpcode-cl-rule-relation option").prop("selected",!1),o.init_select2()},get_input_markup(e){let t="";switch(e.type){case"select":t=o.get_input_select(e.options);break;case"text":t=o.get_input_text();break;case"ajax":t=o.get_input_ajax(e.options)}return t},get_input_select(e){const t=n("<select/>");return n.each(e,(function(e,o){t.append(n("<option />",{value:o.value,disabled:!0===o.disabled}).text(o.label))})),t},get_input_text:()=>n('<input type="text" class="wpcode-input-text" />'),get_input_ajax:e=>n('<select data-action="'+e+'" class="wpcode-select2" multiple />'),init_capture_rules(){o.conditions_holder.on("change","input,select",(function(){o.build_rules_from_inputs()}))},build_rules_from_inputs(){const e=o.conditions_holder.find(".wpcode-cl-group"),t=[];e.each((function(e){const i=n(this).find(".wpcode-cl-rules-row");t[e]=[],i.each((function(){const i=n(this),s=i.find(".wpcode-cl-rule-type"),r=s.find("option:selected").closest("optgroup").data("type"),a=s.val(),l={},c=o.conditions[r].options[a];l.type=r,l.option=a,l.relation=i.find(".wpcode-cl-rule-relation").val(),l.value=o.get_input_value(c,i),null!==l.value&&t[e].push(l)}))}));const i={show:o.show_hide_input.val(),groups:t};o.conditions_input.val(JSON.stringify(i))},get_input_value(e,t){let n="";switch(e.type){case"select":case"ajax":n=t.find(".wpcode-cl-rule-value select").val();break;case"text":n=t.find(".wpcode-cl-rule-value input").val()}return n},show_hide_relation_options(e){const t=e.find(".wpcode-cl-rule-type"),i=t.val(),s=t.find("option:selected").closest("optgroup").data("type"),r=e.find(".wpcode-cl-rule-relation option"),a={select:["=","!="],ajax:["=","!="],text:["=","!=","contains","notcontains"]}[o.conditions[s].options[i].type];r.each((function(){a.indexOf(n(this).attr("value"))>-1?n(this).show():n(this).hide()}))},init_select2(){o.conditions_holder.find(".wpcode-select2").select2({ajax:{url:ajaxurl,data:function(e){return{action:n(this).data("action"),term:e.term,_wpnonce:o.l10n.nonce}}}})}};return o}(document,window,jQuery)).init()},786:function(){(window.WPCodeAdminGenerator||function(e,t,n){const o={doing_ajax_call:!1,ajax_snippet_update:!1,editor_id:"wpcode_generator_code_preview",init:function(){o.should_init()&&(o.find_elements(),o.init_generator_form(),o.init_code_editor(),o.init_tabs(),o.init_use_snippet(),o.init_copy_editor(),o.init_repeater(),o.do_spacer(),n(e).ready((function(){o.init_autocomplete()})))},should_init:()=>(o.generator_form=n("#wpcode_generator_form"),o.generator_form.length>0),find_elements(){o.tabs_buttons=n(".wpcode-items-tabs"),o.tabs_content=n(".wpcode-items-list .wpcode-form-tab"),o.use_snippet=n("#wpcode-generator-use-snippet"),o.update_button=n("#wpcode-generator-update-code"),o.repeater_row=n("#wpcode-generator-repeater-row").html()},init_generator_form(){o.generator_form.on("submit",(function(e){e.preventDefault(),o.update_snippet()})),o.generator_form.on("change","input, select",(function(){o.update_snippet()}))},update_snippet(){o.doing_ajax_call||(o.ajax_snippet_update&&o.ajax_snippet_update.abort(),o.show_button_spinner(o.update_button),o.ajax_snippet_update=n.post(ajaxurl,n(o.generator_form).serialize()).done((function(e){o.ajax_snippet_update=!1,WPCodeAdminCodeEditor.set_value(o.editor_id,e),o.hide_button_spinner(o.update_button)})))},init_tabs(){o.tabs_buttons.on("click","button",(function(e){e.preventDefault(),o.switch_active_tab(n(this))}))},switch_active_tab(e){o.tabs_buttons.find("button").removeClass("wpcode-active"),e.addClass("wpcode-active");const t=e.data("category");o.tabs_content.hide(),o.tabs_content.filter((function(){return n(this).data("tab")===t})).show(),o.do_spacer(),WPCodeAdminCodeEditor.refresh(o.editor_id)},init_use_snippet(){o.use_snippet.on("click",(function(e){if(e.preventDefault(),o.doing_ajax_call)return;o.doing_ajax_call=!0;const i=o.generator_form.serializeArray(),s=n(this);n.each(i,(function(e,t){"action"===t.name&&(i[e].value="wpcode_save_generated_snippet")})),o.show_button_spinner(s),n.post(ajaxurl,n.param(i)).done((function(e){o.doing_ajax_call=!1,o.hide_button_spinner(s),e.success&&e.data.url&&(t.location=e.data.url)}))}))},show_button_spinner(e){t.WPCodeSpinner.show_button_spinner(e)},hide_button_spinner(e){t.WPCodeSpinner.hide_button_spinner(e)},init_copy_editor:function(){n(".wpcode-copy-target").on("click",(function(e){e.preventDefault();const t=n(this),i=WPCodeAdminCodeEditor.get_value(o.editor_id);i&&(navigator.clipboard.writeText(i),t.addClass("wpcode-show-success-icon"),setTimeout((function(){t.removeClass("wpcode-show-success-icon")}),500))}))},init_repeater(){o.row_id=0,o.tabs_content.on("click",".wpcode-repeater-button",(function(){const e=n(this).data("target"),t=n(n('[data-repeater="'+e+'"]').get().reverse());let i,s,r=0;o.row_id++,t.each((function(){const e=n(this).closest(".wpcode-generator-column");e.is(i)||(r++,i=e,s=n(o.repeater_row),r>1?s.find("button").remove():s.find("button").data("target",o.row_id),s.attr("data-id",o.row_id),e.append(s)),n(this).clone().attr("data-repeater",null).prependTo(s).find("input").val(null)}));let a=0,l=n('.wpcode-repeater-group[data-id="'+o.row_id+'"]');l.each((function(){const e=n(this).height();e>a&&(a=e)})),l.height(a),l.first().find("input").first().focus()})),o.tabs_content.on("click",".wpcode-remove-row",(function(){const e=n(this).data("target");n('.wpcode-repeater-group[data-id="'+e+'"]').remove()}))},do_spacer(){n(".wpcode-generator-field-spacer").each((function(){const e=n(this).closest(".wpcode-generator-column"),t=n(this).closest(".wpcode-generator-column").outerHeight();let o=0;e.siblings(".wpcode-generator-column").each((function(){const e=n(this).height();e>o&&(o=e)})),o>t&&n(this).height(o-t+3)}))},init_autocomplete(){n(".wpcode-generator-field-autocomplete").each((function(){const e=n(this).find('input[type="text"]'),t=n(this).find(".wpcode-field-autocomplete").text();e.autocomplete({source:JSON.parse(t)})}))},init_code_editor(){const e=n(".wpcode-generator-code");if(0===e.length)return;const t=wp.codeEditor.initialize(e);o.CodeMirror=t.codemirror,o.CodeMirror.setOption("readOnly",!1),o.CodeMirror.on("change",(function(e){clearTimeout(o.editor_change_handler),o.editor_change_handler=setTimeout((function(){jQuery(e.getTextArea()).val(e.getValue()).change(),o.update_snippet()}),300)}))}};return o}(document,window,jQuery)).init()},448:function(){(window.WPCodeHeader||function(e,t,n){const o={init(){o.should_init()&&n(e).ready((function(){o.init_sticky_header()}))},should_init:()=>n("#wpcode_snippet_code").length>0||n("#ihaf_insert_header").length>0,init_sticky_header(){const e=n(".wpcode-header-bottom"),o=e.height(),i=e.offset().top,s=e.parent();n(t).scroll((function(){const r=n(t).scrollTop();i<r+32?(e.addClass("wpcode-sticky"),s.css("paddingBottom",o+"px")):(e.removeClass("wpcode-sticky"),s.css("paddingBottom",0))}))}};return o}(document,window,jQuery)).init()},847:function(){(window.WPCodeHelp||function(e,t,n){const o={init:function(){o.should_init()&&(o.find_elements(),o.init_show(),o.init_close_button(),o.init_search(),o.init_accordion())},should_init:()=>(o.$overlay=n("#wpcode-docs-overlay"),o.$overlay.length>0),find_elements(){o.$close_button=n("#wpcode-help-close"),o.$search=n("#wpcode-help-search"),o.$no_result=n("#wpcode-help-no-result"),o.$search_results=n("#wpcode-help-result ul"),o.$categories=n("#wpcode-help-categories")},init_close_button(){o.$close_button.on("click",(function(e){e.preventDefault(),o.$overlay.fadeOut(200)}))},init_show(){n(e).on("click",".wpcode-show-help",(function(e){e.preventDefault(),o.$overlay.fadeIn(200)}))},init_accordion(){o.$categories.on("click",".wpcode-help-category header",(function(){const e=n(this).closest(".wpcode-help-category");o.toggle_category(e)})),o.$categories.on("click",".viewall",(function(e){e.preventDefault(),n(this).closest(".wpcode-help-docs").find("div").slideDown(),n(this).hide()}))},toggle_category(e){e.toggleClass("open"),e.find(".wpcode-help-docs").slideToggle()},init_search(){o.$search.on("keyup","input",o.input_search),o.$search.on("click","#wpcode-help-search-clear",o.clear_search)},input_search(){o.$search_results.html("");const e=n(this).val().toLowerCase(),t=n("#wpcode-help-categories .wpcode-help-docs li").filter((function(){return n(this).text().toLowerCase().indexOf(""+e)>-1}));e.length>2&&t.clone().appendTo(o.$search_results),0===t.length?o.$no_result.show():o.$no_result.hide(),o.$search.toggleClass("wpcode-search-empty",!e)},clear_search(){o.$search.find("input").val("").trigger("keyup")}};return o}(document,window,jQuery)).init()},298:function(){(window.WPCodeInputs||function(e,t,n){const o={init(){n(o.ready)},ready(){o.initFileUploads(),o.initCheckboxMultiselectColumns()},initFileUploads(){n(".wpcode-file-upload").each((function(){const e=n(this).find("input[type=file]"),t=n(this).find("label"),o=t.html();e.on("change",(function(e){let n="";this.files&&this.files.length>1?n=(this.getAttribute("data-multiple-caption")||"").replace("{count}",this.files.length):e.target.value&&(n=e.target.value.split("\\").pop()),n?t.find(".wpcode-file-field").html(n):t.html(o)})),e.on("focus",(function(){e.addClass("has-focus")})).on("blur",(function(){e.removeClass("has-focus")}))}))},initCheckboxMultiselectColumns(){n(e).on("change",".wpcode-checkbox-multiselect-columns input",(function(){var e=n(this),t=e.parent(),o=e.closest(".wpcode-checkbox-multiselect-columns"),i=t.text(),s="check-item-"+e.val(),r=o.find("#"+s);e.prop("checked")?(e.parent().addClass("checked"),r.length||o.find(".second-column ul").append('<li id="'+s+'">'+i+"</li>")):(e.parent().removeClass("checked"),o.find("#"+s).remove())})),n(e).on("click",".wpcode-checkbox-multiselect-columns .all",(function(e){e.preventDefault(),n(this).closest(".wpcode-checkbox-multiselect-columns").find("input[type=checkbox]").prop("checked",!0).trigger("change")}))}};return o}(document,window,jQuery)).init()},900:function(){(window.WPCodeItemsList||function(e,t,n){const o={category:"*",search_term:"",init:function(){o.should_init()&&(o.find_elements(),o.init_category_switch(),o.init_search())},should_init:()=>(o.categories_list=n(".wpcode-items-filters"),o.categories_list.length>0),find_elements(){o.search_input=n("#wpcode-items-search")},init_category_switch(){o.categories_list.on("click","button",(function(){const e=n(this);e.hasClass("wpcode-active")||(o.switch_to_category(e.data("category")),o.switch_category_button(e))}))},switch_category_button(e){o.categories_list.find("button").removeClass("wpcode-active"),e.addClass("wpcode-active")},switch_to_category(e){o.category=e,o.filter_items()},filter_items(){let e;const t=n(".wpcode-list-item"),i=t.filter((function(){return"*"===o.category||n(this).data("categories").indexOf(o.category)>-1}));if(o.search_term.length>2){const i=o.search_term.toLowerCase();e=t.filter((function(){return n(this).text().toLowerCase().indexOf(""+i)>-1}))}else e=i;t.hide(),e.show()},init_search(){o.search_input.on("keyup change search",(function(){const e=n(this).val();e.length<3?o.search_term="":o.search_term=e,o.filter_items()}))}};return o}(document,window,jQuery)).init()},423:function(){(window.WPCodeAdminLibrary||function(e,t,n){const o={l10n:wpcode,init:function(){o.should_init()&&(o.find_elements(),o.init_preview())},should_init:()=>n(".wpcode-library-preview-button").length>0,find_elements(){o.library_list=n(".wpcode-items-list"),o.code_preview_use=n("#wpcode-preview-use-code"),o.code_preview_edit=n("#wpcode-preview-edit-snippet"),o.code_preview_updated=n("#wpcode-preview-updated"),o.code_preview_title=n("#wpcode-preview-title")},init_preview(){o.library_list.on("click",".wpcode-library-preview-button",(function(e){e.preventDefault();const t=n(this).parent().find(".wpcode-item-use-button"),i=n(this).closest(".wpcode-list-item").data("id");o.show_code_preview(i,t.attr("href")),o.code_preview_use.text(t.text())})),n(".wpcode-close-modal, .wpcode-modal-overlay").on("click",(function(){n("body").removeClass("wpcode-show-modal")}))},show_code_preview(e,t){const i=o.l10n.library.snippets.find((t=>t.library_id===e));WPCodeAdminCodeEditor.switch_code_mode("wpcode-code-preview",i.code_type),WPCodeAdminCodeEditor.set_value("wpcode-code-preview",i.code),o.code_preview_use.attr("href",t),o.code_preview_title.text(i.title),o.code_preview_edit.length>0&&o.code_preview_edit.attr("href",o.l10n.cloud_edit_url+e),o.code_preview_updated&&o.code_preview_updated.text(i.updated_text),n("body").addClass("wpcode-show-modal"),WPCodeAdminCodeEditor.refresh("wpcode-code-preview")}};return o}(document,window,jQuery)).init()},5:function(){const e=window.WPCodeAdminNotices||function(e,t,n){const o={init:function(){t.WPCodeAdminNotices=o,o.notice_holder=n(e.getElementById("wpcode-notice-area")),o.document=n(e)},add_notice(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"updated";const i=n("<div />"),s=n("<p />");s.html(e),i.addClass("fade notice is-dismissible"),i.addClass(t),i.append(s),o.notice_holder.append(i),o.document.trigger("wp-updates-notice-added"),i.find("button").focus()}};return o}(document,window,jQuery);e.init()},770:function(){(window.WPCodeAdminNotifications||function(e,t,n){const o={init(){o.should_init()&&(o.find_elements(),o.init_open(),o.init_close(),o.init_dismiss(),o.init_view_switch(),o.update_count(o.active_count))},should_init:()=>(o.$drawer=n("#wpcode-notifications-drawer"),o.$drawer.length>0),find_elements(){o.$open_button=n("#wpcode-notifications-button"),o.$count=o.$drawer.find("#wpcode-notifications-count"),o.$dismissed_count=o.$drawer.find("#wpcode-notifications-dismissed-count"),o.active_count=o.$open_button.data("count")?o.$open_button.data("count"):0,o.dismissed_count=o.$open_button.data("dismissed"),o.$body=n("body"),o.$dismissed_button=n("#wpcode-notifications-show-dismissed"),o.$active_button=n("#wpcode-notifications-show-active"),o.$active_list=n(".wpcode-notifications-list .wpcode-notifications-active"),o.$dismissed_list=n(".wpcode-notifications-list .wpcode-notifications-dismissed"),o.$dismiss_all=n("#wpcode-dismiss-all")},update_count(e){o.$open_button.data("count",e).attr("data-count",e),0===e&&o.$open_button.removeAttr("data-count"),o.$count.text(e),o.dismissed_count+=Math.abs(e-o.active_count),o.active_count=e,o.$dismissed_count.text(o.dismissed_count),0===o.active_count&&o.$dismiss_all.hide()},init_open(){o.$open_button.on("click",(function(e){e.preventDefault(),o.$body.addClass("wpcode-notifications-open")}))},init_close(){o.$body.on("click",".wpcode-notifications-close, .wpcode-notifications-overlay",(function(e){e.preventDefault(),o.$body.removeClass("wpcode-notifications-open")}))},init_dismiss(){o.$drawer.on("click",".wpcode-notification-dismiss",(function(e){e.preventDefault();const t=n(this).data("id");if(o.dismiss_notification(t),"all"===t)return o.move_to_dismissed(o.$active_list.find("li")),void o.update_count(0);o.move_to_dismissed(n(this).closest("li")),o.update_count(o.active_count-1)}))},move_to_dismissed(e){e.slideUp((function(){n(this).prependTo(o.$dismissed_list).show()}))},dismiss_notification:e=>n.post(ajaxurl,{action:"wpcode_notification_dismiss",nonce:wpcode.nonce,id:e}),init_view_switch(){o.$dismissed_button.on("click",(function(e){e.preventDefault(),o.$drawer.addClass("show-dismissed")})),o.$active_button.on("click",(function(e){e.preventDefault(),o.$drawer.removeClass("show-dismissed")}))}};return o}(document,window,jQuery)).init()},124:function(){const e=window.WPCodeSpinner||function(e,t,n){const o={init(){t.WPCodeSpinner=o,o.spinner=n("#wpcode-admin-spinner")},show_button_spinner(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"right";e.prop("disabled",!0);const i=e.offset(),s=n("#adminmenuwrap").width(),r=n("#wpadminbar").height();let a={};o.spinner.show(),a="right"===t?{left:i.left-s+e.outerWidth(),top:i.top-r+e.outerHeight()/2-o.spinner.height()/2}:{left:i.left-s-o.spinner.outerWidth()-20,top:i.top-r+e.outerHeight()/2-o.spinner.height()/2},o.spinner.css(a)},hide_button_spinner(e){e.prop("disabled",!1),o.spinner.hide()}};return o}(document,window,jQuery);e.init()},801:function(){(window.WPCodeAdminTools||function(e,t,n){const o={init:function(){o.should_init()&&(o.find_elements(),o.init_importer(),o.init_ssl_verify())},should_init:()=>n("body").hasClass("wpcode-tools"),find_elements(){o.importer_button=n("#wpcode-importer-snippets-submit"),o.$import_progress=n("#wpcode-importer-process"),o.provider=n("#wpcode-importer-provider").val(),o.status_update=n("#wpcode-importer-status-update").html()},init_importer(){o.importer_button.on("click",(function(e){e.preventDefault();const t=n("#wpcode-importer-snippets input:checked");if(t.length){const e=[];t.each((function(){e.push(n(this).val())})),o.import_snippets(e)}}))},import_snippets(e){o.$import_progress.find(".snippet-total").text(e.length),o.$import_progress.find(".snippet-current").text("1"),n("#wpcode-importer-snippets").hide(),o.$import_progress.show(),o.import_queue=e,o.imported=0,o.import_snippet()},import_snippet(){const e=o.import_queue[0];n.post(ajaxurl,{action:"wpcode_import_snippet_"+o.provider,snippet_id:e,_wpnonce:wpcode.nonce}).done((function(e){if(e.success){o.import_queue.shift(),o.imported++;const t=n(o.status_update);t.find(".name span").text(e.data.name),t.find(".actions a").attr("href",e.data.edit),o.$import_progress.find(".status").prepend(t),o.$import_progress.find(".status").show(),0===o.import_queue.length?(o.$import_progress.find(".process-count").hide(),o.$import_progress.find(".snippets-completed").text(o.imported),o.$import_progress.find(".process-completed").show()):(o.$import_progress.find(".snippet-current").text(o.imported+1),o.import_snippet())}}))},init_ssl_verify(){n(e).on("click","#wpcode-ssl-verify",(function(e){e.preventDefault(),o.verify_ssl()}))},verify_ssl(){const e=n("#wpcode-ssl-verify"),t=e.text(),o=e.outerWidth(),i=e.parent(),s={action:"wpcode_verify_ssl",nonce:wpcode.nonce};e.css("width",o).prop("disabled",!0).text(wpcode.testing),n.post(ajaxurl,s,(function(n){console.log(n),i.find(".wpcode-alert, .wpcode-ssl-error").remove(),n.success&&e.before('<div class="wpcode-alert wpcode-alert-success">'+n.data.msg+"</div>"),!n.success&&n.data.msg&&e.before('<div class="wpcode-alert wpcode-alert-danger">'+n.data.msg+"</div>"),!n.success&&n.data.debug&&e.before('<div class="wpcode-ssl-error pre-error">'+n.data.debug+"</div>"),e.css("width",o).prop("disabled",!1).text(t)}))}};return o}(document,window,jQuery)).init()},868:function(){(window.WPCodeAdminWelcome||function(e,t,n){const o={init:function(){o.add_listener()},add_listener(){n("#wpbody-content").on("click",".wpcode-scroll-to",(function(e){e.preventDefault();const t=n(this).attr("href"),o=n(t);n("html, body").animate({scrollTop:o.offset().top},700)}))}};return o}(document,window,jQuery)).init()},686:function(e,t,n){var o,i,s;i=[n(567)],o=function(e){var t=function(){if(e&&e.fn&&e.fn.select2&&e.fn.select2.amd)var t=e.fn.select2.amd;var n,o,i;return t&&t.requirejs||(t?o=t:t={},function(e){var t,s,r,a,l={},c={},d={},u={},p=Object.prototype.hasOwnProperty,h=[].slice,m=/\.js$/;function f(e,t){return p.call(e,t)}function g(e,t){var n,o,i,s,r,a,l,c,u,p,h,f=t&&t.split("/"),g=d.map,w=g&&g["*"]||{};if(e){for(r=(e=e.split("/")).length-1,d.nodeIdCompat&&m.test(e[r])&&(e[r]=e[r].replace(m,"")),"."===e[0].charAt(0)&&f&&(e=f.slice(0,f.length-1).concat(e)),u=0;u<e.length;u++)if("."===(h=e[u]))e.splice(u,1),u-=1;else if(".."===h){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;u>0&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((f||w)&&g){for(u=(n=e.split("/")).length;u>0;u-=1){if(o=n.slice(0,u).join("/"),f)for(p=f.length;p>0;p-=1)if((i=g[f.slice(0,p).join("/")])&&(i=i[o])){s=i,a=u;break}if(s)break;!l&&w&&w[o]&&(l=w[o],c=u)}!s&&l&&(s=l,a=c),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function w(t,n){return function(){var o=h.call(arguments,0);return"string"!=typeof o[0]&&1===o.length&&o.push(null),s.apply(e,o.concat([t,n]))}}function y(e){return function(t){l[e]=t}}function b(n){if(f(c,n)){var o=c[n];delete c[n],u[n]=!0,t.apply(e,o)}if(!f(l,n)&&!f(u,n))throw new Error("No "+n);return l[n]}function _(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function v(e){return e?_(e):[]}function x(e){return function(){return d&&d.config&&d.config[e]||{}}}r=function(e,t){var n,o,i=_(e),s=i[0],r=t[1];return e=i[1],s&&(n=b(s=g(s,r))),s?e=n&&n.normalize?n.normalize(e,(o=r,function(e){return g(e,o)})):g(e,r):(s=(i=_(e=g(e,r)))[0],e=i[1],s&&(n=b(s))),{f:s?s+"!"+e:e,n:e,pr:s,p:n}},a={require:function(e){return w(e)},exports:function(e){var t=l[e];return void 0!==t?t:l[e]={}},module:function(e){return{id:e,uri:"",exports:l[e],config:x(e)}}},t=function(t,n,o,i){var s,d,p,h,m,g,_,x=[],k=typeof o;if(g=v(i=i||t),"undefined"===k||"function"===k){for(n=!n.length&&o.length?["require","exports","module"]:n,m=0;m<n.length;m+=1)if("require"===(d=(h=r(n[m],g)).f))x[m]=a.require(t);else if("exports"===d)x[m]=a.exports(t),_=!0;else if("module"===d)s=x[m]=a.module(t);else if(f(l,d)||f(c,d)||f(u,d))x[m]=b(d);else{if(!h.p)throw new Error(t+" missing "+d);h.p.load(h.n,w(i,!0),y(d),{}),x[m]=l[d]}p=o?o.apply(l[t],x):void 0,t&&(s&&s.exports!==e&&s.exports!==l[t]?l[t]=s.exports:p===e&&_||(l[t]=p))}else t&&(l[t]=o)},n=o=s=function(n,o,i,l,c){if("string"==typeof n)return a[n]?a[n](o):b(r(n,v(o)).f);if(!n.splice){if((d=n).deps&&s(d.deps,d.callback),!o)return;o.splice?(n=o,o=i,i=null):n=e}return o=o||function(){},"function"==typeof i&&(i=l,l=c),l?t(e,n,o,i):setTimeout((function(){t(e,n,o,i)}),4),s},s.config=function(e){return s(e)},n._defined=l,(i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),f(l,e)||f(c,e)||(c[e]=[e,t,n])}).amd={jQuery:!0}}(),t.requirejs=n,t.require=o,t.define=i),t.define("almond",(function(){})),t.define("jquery",[],(function(){var t=e||$;return null==t&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),t})),t.define("select2/utils",["jquery"],(function(e){var t={};function n(e){var t=e.prototype,n=[];for(var o in t)"function"==typeof t[o]&&"constructor"!==o&&n.push(o);return n}t.Extend=function(e,t){var n={}.hasOwnProperty;function o(){this.constructor=e}for(var i in t)n.call(t,i)&&(e[i]=t[i]);return o.prototype=t.prototype,e.prototype=new o,e.__super__=t.prototype,e},t.Decorate=function(e,t){var o=n(t),i=n(e);function s(){var n=Array.prototype.unshift,o=t.prototype.constructor.length,i=e.prototype.constructor;o>0&&(n.call(arguments,e.prototype.constructor),i=t.prototype.constructor),i.apply(this,arguments)}t.displayName=e.displayName,s.prototype=new function(){this.constructor=s};for(var r=0;r<i.length;r++){var a=i[r];s.prototype[a]=e.prototype[a]}for(var l=function(e){var n=function(){};e in s.prototype&&(n=s.prototype[e]);var o=t.prototype[e];return function(){return Array.prototype.unshift.call(arguments,n),o.apply(this,arguments)}},c=0;c<o.length;c++){var d=o[c];s.prototype[d]=l(d)}return s};var o=function(){this.listeners={}};o.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},o.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),n[0]._type=e,e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},o.prototype.invoke=function(e,t){for(var n=0,o=e.length;n<o;n++)e[n].apply(this,t)},t.Observable=o,t.generateChars=function(e){for(var t="",n=0;n<e;n++)t+=Math.floor(36*Math.random()).toString(36);return t},t.bind=function(e,t){return function(){e.apply(t,arguments)}},t._convertData=function(e){for(var t in e){var n=t.split("-"),o=e;if(1!==n.length){for(var i=0;i<n.length;i++){var s=n[i];(s=s.substring(0,1).toLowerCase()+s.substring(1))in o||(o[s]={}),i==n.length-1&&(o[s]=e[t]),o=o[s]}delete e[t]}}return e},t.hasScroll=function(t,n){var o=e(n),i=n.style.overflowX,s=n.style.overflowY;return(i!==s||"hidden"!==s&&"visible"!==s)&&("scroll"===i||"scroll"===s||o.innerHeight()<n.scrollHeight||o.innerWidth()<n.scrollWidth)},t.escapeMarkup=function(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,(function(e){return t[e]}))},t.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var o=e();e.map(n,(function(e){o=o.add(e)})),n=o}t.append(n)},t.__cache={};var i=0;return t.GetUniqueElementId=function(e){var t=e.getAttribute("data-select2-id");return null==t&&(e.id?(t=e.id,e.setAttribute("data-select2-id",t)):(e.setAttribute("data-select2-id",++i),t=i.toString())),t},t.StoreData=function(e,n,o){var i=t.GetUniqueElementId(e);t.__cache[i]||(t.__cache[i]={}),t.__cache[i][n]=o},t.GetData=function(n,o){var i=t.GetUniqueElementId(n);return o?t.__cache[i]&&null!=t.__cache[i][o]?t.__cache[i][o]:e(n).data(o):t.__cache[i]},t.RemoveData=function(e){var n=t.GetUniqueElementId(e);null!=t.__cache[n]&&delete t.__cache[n],e.removeAttribute("data-select2-id")},t})),t.define("select2/results",["jquery","./utils"],(function(e,t){function n(e,t,o){this.$element=e,this.data=o,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var o=e('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),i=this.options.get("translations").get(t.message);o.append(n(i(t.args))),o[0].className+=" select2-results__message",this.$results.append(o)},n.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var o=e.results[n],i=this.option(o);t.push(i)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},n.prototype.position=function(e,t){t.find(".select2-results").append(e)},n.prototype.sort=function(e){return this.options.get("sorter")(e)},n.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[aria-selected]"),t=e.filter("[aria-selected=true]");t.length>0?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},n.prototype.setClasses=function(){var n=this;this.data.current((function(o){var i=e.map(o,(function(e){return e.id.toString()}));n.$results.find(".select2-results__option[aria-selected]").each((function(){var n=e(this),o=t.GetData(this,"data"),s=""+o.id;null!=o.element&&o.element.selected||null==o.element&&e.inArray(s,i)>-1?n.attr("aria-selected","true"):n.attr("aria-selected","false")}))}))},n.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(n){var o=document.createElement("li");o.className="select2-results__option";var i={role:"option","aria-selected":"false"},s=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(var r in(null!=n.element&&s.call(n.element,":disabled")||null==n.element&&n.disabled)&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==n.id&&delete i["aria-selected"],null!=n._resultId&&(o.id=n._resultId),n.title&&(o.title=n.title),n.children&&(i.role="group",i["aria-label"]=n.text,delete i["aria-selected"]),i){var a=i[r];o.setAttribute(r,a)}if(n.children){var l=e(o),c=document.createElement("strong");c.className="select2-results__group",e(c),this.template(n,c);for(var d=[],u=0;u<n.children.length;u++){var p=n.children[u],h=this.option(p);d.push(h)}var m=e("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});m.append(d),l.append(c),l.append(m)}else this.template(n,o);return t.StoreData(o,"data",n),o},n.prototype.bind=function(n,o){var i=this,s=n.id+"-results";this.$results.attr("id",s),n.on("results:all",(function(e){i.clear(),i.append(e.data),n.isOpen()&&(i.setClasses(),i.highlightFirstItem())})),n.on("results:append",(function(e){i.append(e.data),n.isOpen()&&i.setClasses()})),n.on("query",(function(e){i.hideMessages(),i.showLoading(e)})),n.on("select",(function(){n.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())})),n.on("unselect",(function(){n.isOpen()&&(i.setClasses(),i.options.get("scrollAfterSelect")&&i.highlightFirstItem())})),n.on("open",(function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()})),n.on("close",(function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")})),n.on("results:toggle",(function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")})),n.on("results:select",(function(){var e=i.getHighlightedResults();if(0!==e.length){var n=t.GetData(e[0],"data");"true"==e.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:n})}})),n.on("results:previous",(function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e);if(!(n<=0)){var o=n-1;0===e.length&&(o=0);var s=t.eq(o);s.trigger("mouseenter");var r=i.$results.offset().top,a=s.offset().top,l=i.$results.scrollTop()+(a-r);0===o?i.$results.scrollTop(0):a-r<0&&i.$results.scrollTop(l)}})),n.on("results:next",(function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var o=t.eq(n);o.trigger("mouseenter");var s=i.$results.offset().top+i.$results.outerHeight(!1),r=o.offset().top+o.outerHeight(!1),a=i.$results.scrollTop()+r-s;0===n?i.$results.scrollTop(0):r>s&&i.$results.scrollTop(a)}})),n.on("results:focus",(function(e){e.element.addClass("select2-results__option--highlighted")})),n.on("results:message",(function(e){i.displayMessage(e)})),e.fn.mousewheel&&this.$results.on("mousewheel",(function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,o=e.deltaY>0&&t-e.deltaY<=0,s=e.deltaY<0&&n<=i.$results.height();o?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):s&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())})),this.$results.on("mouseup",".select2-results__option[aria-selected]",(function(n){var o=e(this),s=t.GetData(this,"data");"true"!==o.attr("aria-selected")?i.trigger("select",{originalEvent:n,data:s}):i.options.get("multiple")?i.trigger("unselect",{originalEvent:n,data:s}):i.trigger("close",{})})),this.$results.on("mouseenter",".select2-results__option[aria-selected]",(function(n){var o=t.GetData(this,"data");i.getHighlightedResults().removeClass("select2-results__option--highlighted"),i.trigger("results:focus",{data:o,element:e(this)})}))},n.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]").index(e),n=this.$results.offset().top,o=e.offset().top,i=this.$results.scrollTop()+(o-n),s=o-n;i-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(i)}},n.prototype.template=function(t,n){var o=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),s=o(t,n);null==s?n.style.display="none":"string"==typeof s?n.innerHTML=i(s):e(n).append(s)},n})),t.define("select2/keys",[],(function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}})),t.define("select2/selection/base",["jquery","../utils","../keys"],(function(e,t,n){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return t.Extend(o,t.Observable),o.prototype.render=function(){var n=e('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=t.GetData(this.$element[0],"old-tabindex")?this._tabindex=t.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),n.attr("title",this.$element.attr("title")),n.attr("tabindex",this._tabindex),n.attr("aria-disabled","false"),this.$selection=n,n},o.prototype.bind=function(e,t){var o=this,i=e.id+"-results";this.container=e,this.$selection.on("focus",(function(e){o.trigger("focus",e)})),this.$selection.on("blur",(function(e){o._handleBlur(e)})),this.$selection.on("keydown",(function(e){o.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()})),e.on("results:focus",(function(e){o.$selection.attr("aria-activedescendant",e.data._resultId)})),e.on("selection:update",(function(e){o.update(e.data)})),e.on("open",(function(){o.$selection.attr("aria-expanded","true"),o.$selection.attr("aria-owns",i),o._attachCloseHandler(e)})),e.on("close",(function(){o.$selection.attr("aria-expanded","false"),o.$selection.removeAttr("aria-activedescendant"),o.$selection.removeAttr("aria-owns"),o.$selection.trigger("focus"),o._detachCloseHandler(e)})),e.on("enable",(function(){o.$selection.attr("tabindex",o._tabindex),o.$selection.attr("aria-disabled","false")})),e.on("disable",(function(){o.$selection.attr("tabindex","-1"),o.$selection.attr("aria-disabled","true")}))},o.prototype._handleBlur=function(t){var n=this;window.setTimeout((function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)}),1)},o.prototype._attachCloseHandler=function(n){e(document.body).on("mousedown.select2."+n.id,(function(n){var o=e(n.target).closest(".select2");e(".select2.select2-container--open").each((function(){this!=o[0]&&t.GetData(this,"element").select2("close")}))}))},o.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.select2."+t.id)},o.prototype.position=function(e,t){t.find(".selection").append(e)},o.prototype.destroy=function(){this._detachCloseHandler(this.container)},o.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},o.prototype.isEnabled=function(){return!this.isDisabled()},o.prototype.isDisabled=function(){return this.options.get("disabled")},o})),t.define("select2/selection/single",["jquery","./base","../utils","../keys"],(function(e,t,n,o){function i(){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},i.prototype.bind=function(e,t){var n=this;i.__super__.bind.apply(this,arguments);var o=e.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",o).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",o),this.$selection.on("mousedown",(function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})})),this.$selection.on("focus",(function(e){})),this.$selection.on("blur",(function(e){})),e.on("focus",(function(t){e.isOpen()||n.$selection.trigger("focus")}))},i.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},i.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},i.prototype.selectionContainer=function(){return e("<span></span>")},i.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),o=this.display(t,n);n.empty().append(o);var i=t.title||t.text;i?n.attr("title",i):n.removeAttr("title")}else this.clear()},i})),t.define("select2/selection/multiple",["jquery","./base","../utils"],(function(e,t,n){function o(e,t){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered"></ul>'),e},o.prototype.bind=function(t,i){var s=this;o.__super__.bind.apply(this,arguments),this.$selection.on("click",(function(e){s.trigger("toggle",{originalEvent:e})})),this.$selection.on("click",".select2-selection__choice__remove",(function(t){if(!s.isDisabled()){var o=e(this).parent(),i=n.GetData(o[0],"data");s.trigger("unselect",{originalEvent:t,data:i})}}))},o.prototype.clear=function(){var e=this.$selection.find(".select2-selection__rendered");e.empty(),e.removeAttr("title")},o.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},o.prototype.selectionContainer=function(){return e('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>')},o.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],o=0;o<e.length;o++){var i=e[o],s=this.selectionContainer(),r=this.display(i,s);s.append(r);var a=i.title||i.text;a&&s.attr("title",a),n.StoreData(s[0],"data",i),t.push(s)}var l=this.$selection.find(".select2-selection__rendered");n.appendMany(l,t)}},o})),t.define("select2/selection/placeholder",["../utils"],(function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(t.length>1||n)return e.call(this,t);this.clear();var o=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(o)},t})),t.define("select2/selection/allowClear",["jquery","../keys","../utils"],(function(e,t,n){function o(){}return o.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",(function(e){o._handleClear(e)})),t.on("keypress",(function(e){o._handleKeyboardClear(e,t)}))},o.prototype._handleClear=function(e,t){if(!this.isDisabled()){var o=this.$selection.find(".select2-selection__clear");if(0!==o.length){t.stopPropagation();var i=n.GetData(o[0],"data"),s=this.$element.val();this.$element.val(this.placeholder.id);var r={data:i};if(this.trigger("clear",r),r.prevented)this.$element.val(s);else{for(var a=0;a<i.length;a++)if(r={data:i[a]},this.trigger("unselect",r),r.prevented)return void this.$element.val(s);this.$element.trigger("input").trigger("change"),this.trigger("toggle",{})}}}},o.prototype._handleKeyboardClear=function(e,n,o){o.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},o.prototype.update=function(t,o){if(t.call(this,o),!(this.$selection.find(".select2-selection__placeholder").length>0||0===o.length)){var i=this.options.get("translations").get("removeAllItems"),s=e('<span class="select2-selection__clear" title="'+i()+'">×</span>');n.StoreData(s[0],"data",o),this.$selection.find(".select2-selection__rendered").prepend(s)}},o})),t.define("select2/selection/search",["jquery","../utils","../keys"],(function(e,t,n){function o(e,t,n){e.call(this,t,n)}return o.prototype.render=function(t){var n=e('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var o=t.call(this);return this._transferTabIndex(),o},o.prototype.bind=function(e,o,i){var s=this,r=o.id+"-results";e.call(this,o,i),o.on("open",(function(){s.$search.attr("aria-controls",r),s.$search.trigger("focus")})),o.on("close",(function(){s.$search.val(""),s.$search.removeAttr("aria-controls"),s.$search.removeAttr("aria-activedescendant"),s.$search.trigger("focus")})),o.on("enable",(function(){s.$search.prop("disabled",!1),s._transferTabIndex()})),o.on("disable",(function(){s.$search.prop("disabled",!0)})),o.on("focus",(function(e){s.$search.trigger("focus")})),o.on("results:focus",(function(e){e.data._resultId?s.$search.attr("aria-activedescendant",e.data._resultId):s.$search.removeAttr("aria-activedescendant")})),this.$selection.on("focusin",".select2-search--inline",(function(e){s.trigger("focus",e)})),this.$selection.on("focusout",".select2-search--inline",(function(e){s._handleBlur(e)})),this.$selection.on("keydown",".select2-search--inline",(function(e){if(e.stopPropagation(),s.trigger("keypress",e),s._keyUpPrevented=e.isDefaultPrevented(),e.which===n.BACKSPACE&&""===s.$search.val()){var o=s.$searchContainer.prev(".select2-selection__choice");if(o.length>0){var i=t.GetData(o[0],"data");s.searchRemoveChoice(i),e.preventDefault()}}})),this.$selection.on("click",".select2-search--inline",(function(e){s.$search.val()&&e.stopPropagation()}));var a=document.documentMode,l=a&&a<=11;this.$selection.on("input.searchcheck",".select2-search--inline",(function(e){l?s.$selection.off("input.search input.searchcheck"):s.$selection.off("keyup.search")})),this.$selection.on("keyup.search input.search",".select2-search--inline",(function(e){if(l&&"input"===e.type)s.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&s.handleSearch(e)}}))},o.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},o.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},o.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.trigger("focus")},o.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},o.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},o.prototype.resizeSearch=function(){this.$search.css("width","25px");var e;e=""!==this.$search.attr("placeholder")?this.$selection.find(".select2-selection__rendered").width():.75*(this.$search.val().length+1)+"em",this.$search.css("width",e)},o})),t.define("select2/selection/eventRelay",["jquery"],(function(e){function t(){}return t.prototype.bind=function(t,n,o){var i=this,s=["open","opening","close","closing","select","selecting","unselect","unselecting","clear","clearing"],r=["opening","closing","selecting","unselecting","clearing"];t.call(this,n,o),n.on("*",(function(t,n){if(-1!==e.inArray(t,s)){n=n||{};var o=e.Event("select2:"+t,{params:n});i.$element.trigger(o),-1!==e.inArray(t,r)&&(n.prevented=o.isDefaultPrevented())}}))},t})),t.define("select2/translation",["jquery","require"],(function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var o=t(e);n._cache[e]=o}return new n(n._cache[e])},n})),t.define("select2/diacritics",[],(function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Œ":"OE","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","œ":"oe","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ώ":"ω","ς":"σ","’":"'"}})),t.define("select2/data/base",["../utils"],(function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var o=t.id+"-result-";return o+=e.generateChars(4),null!=n.id?o+="-"+n.id.toString():o+="-"+e.generateChars(4),o},t})),t.define("select2/data/select",["./base","../utils","jquery"],(function(e,t,n){function o(e,t){this.$element=e,this.options=t,o.__super__.constructor.call(this)}return t.Extend(o,e),o.prototype.current=function(e){var t=[],o=this;this.$element.find(":selected").each((function(){var e=n(this),i=o.item(e);t.push(i)})),e(t)},o.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("input").trigger("change");if(this.$element.prop("multiple"))this.current((function(o){var i=[];(e=[e]).push.apply(e,o);for(var s=0;s<e.length;s++){var r=e[s].id;-1===n.inArray(r,i)&&i.push(r)}t.$element.val(i),t.$element.trigger("input").trigger("change")}));else{var o=e.id;this.$element.val(o),this.$element.trigger("input").trigger("change")}},o.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple")){if(e.selected=!1,n(e.element).is("option"))return e.element.selected=!1,void this.$element.trigger("input").trigger("change");this.current((function(o){for(var i=[],s=0;s<o.length;s++){var r=o[s].id;r!==e.id&&-1===n.inArray(r,i)&&i.push(r)}t.$element.val(i),t.$element.trigger("input").trigger("change")}))}},o.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",(function(e){n.select(e.data)})),e.on("unselect",(function(e){n.unselect(e.data)}))},o.prototype.destroy=function(){this.$element.find("*").each((function(){t.RemoveData(this)}))},o.prototype.query=function(e,t){var o=[],i=this;this.$element.children().each((function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var s=i.item(t),r=i.matches(e,s);null!==r&&o.push(r)}})),t({results:o})},o.prototype.addOptions=function(e){t.appendMany(this.$element,e)},o.prototype.option=function(e){var o;e.children?(o=document.createElement("optgroup")).label=e.text:void 0!==(o=document.createElement("option")).textContent?o.textContent=e.text:o.innerText=e.text,void 0!==e.id&&(o.value=e.id),e.disabled&&(o.disabled=!0),e.selected&&(o.selected=!0),e.title&&(o.title=e.title);var i=n(o),s=this._normalizeItem(e);return s.element=o,t.StoreData(o,"data",s),i},o.prototype.item=function(e){var o={};if(null!=(o=t.GetData(e[0],"data")))return o;if(e.is("option"))o={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){o={text:e.prop("label"),children:[],title:e.prop("title")};for(var i=e.children("option"),s=[],r=0;r<i.length;r++){var a=n(i[r]),l=this.item(a);s.push(l)}o.children=s}return(o=this._normalizeItem(o)).element=e[0],t.StoreData(e[0],"data",o),o},o.prototype._normalizeItem=function(e){e!==Object(e)&&(e={id:e,text:e});return null!=(e=n.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},{selected:!1,disabled:!1},e)},o.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},o})),t.define("select2/data/array",["./select","../utils","jquery"],(function(e,t,n){function o(e,t){this._dataToConvert=t.get("data")||[],o.__super__.constructor.call(this,e,t)}return t.Extend(o,e),o.prototype.bind=function(e,t){o.__super__.bind.call(this,e,t),this.addOptions(this.convertToOptions(this._dataToConvert))},o.prototype.select=function(e){var t=this.$element.find("option").filter((function(t,n){return n.value==e.id.toString()}));0===t.length&&(t=this.option(e),this.addOptions(t)),o.__super__.select.call(this,e)},o.prototype.convertToOptions=function(e){var o=this,i=this.$element.find("option"),s=i.map((function(){return o.item(n(this)).id})).get(),r=[];function a(e){return function(){return n(this).val()==e.id}}for(var l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,s)>=0){var d=i.filter(a(c)),u=this.item(d),p=n.extend(!0,{},c,u),h=this.option(p);d.replaceWith(h)}else{var m=this.option(c);if(c.children){var f=this.convertToOptions(c.children);t.appendMany(m,f)}r.push(m)}}return r},o})),t.define("select2/data/ajax",["./array","../utils","jquery"],(function(e,t,n){function o(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),o.__super__.constructor.call(this,e,t)}return t.Extend(o,e),o.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,o){var i=n.ajax(e);return i.then(t),i.fail(o),i}};return n.extend({},t,e,!0)},o.prototype.processResults=function(e){return e},o.prototype.query=function(e,t){var o=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var i=n.extend({type:"GET"},this.ajaxOptions);function s(){var s=i.transport(i,(function(i){var s=o.processResults(i,e);o.options.get("debug")&&window.console&&console.error&&(s&&s.results&&n.isArray(s.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(s)}),(function(){(!("status"in s)||0!==s.status&&"0"!==s.status)&&o.trigger("results:message",{message:"errorLoading"})}));o._request=s}"function"==typeof i.url&&(i.url=i.url.call(this.$element,e)),"function"==typeof i.data&&(i.data=i.data.call(this.$element,e)),this.ajaxOptions.delay&&null!=e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(s,this.ajaxOptions.delay)):s()},o})),t.define("select2/data/tags",["jquery"],(function(e){function t(t,n,o){var i=o.get("tags"),s=o.get("createTag");void 0!==s&&(this.createTag=s);var r=o.get("insertTag");if(void 0!==r&&(this.insertTag=r),t.call(this,n,o),e.isArray(i))for(var a=0;a<i.length;a++){var l=i[a],c=this._normalizeItem(l),d=this.option(c);this.$element.append(d)}}return t.prototype.query=function(e,t,n){var o=this;this._removeOldTags(),null!=t.term&&null==t.page?e.call(this,t,(function e(i,s){for(var r=i.results,a=0;a<r.length;a++){var l=r[a],c=null!=l.children&&!e({results:l.children},!0);if((l.text||"").toUpperCase()===(t.term||"").toUpperCase()||c)return!s&&(i.data=r,void n(i))}if(s)return!0;var d=o.createTag(t);if(null!=d){var u=o.option(d);u.attr("data-select2-tag",!0),o.addOptions([u]),o.insertTag(r,d)}i.results=r,n(i)})):e.call(this,t,n)},t.prototype.createTag=function(t,n){var o=e.trim(n.term);return""===o?null:{id:o,text:o}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){this.$element.find("option[data-select2-tag]").each((function(){this.selected||e(this).remove()}))},t})),t.define("select2/data/tokenizer",["jquery"],(function(e){function t(e,t,n){var o=n.get("tokenizer");void 0!==o&&(this.tokenizer=o),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},t.prototype.query=function(t,n,o){var i=this;n.term=n.term||"";var s=this.tokenizer(n,this.options,(function(t){var n=i._normalizeItem(t);if(!i.$element.find("option").filter((function(){return e(this).val()===n.id})).length){var o=i.option(n);o.attr("data-select2-tag",!0),i._removeOldTags(),i.addOptions([o])}!function(e){i.trigger("select",{data:e})}(n)}));s.term!==n.term&&(this.$search.length&&(this.$search.val(s.term),this.$search.trigger("focus")),n.term=s.term),t.call(this,n,o)},t.prototype.tokenizer=function(t,n,o,i){for(var s=o.get("tokenSeparators")||[],r=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<r.length;){var c=r[a];if(-1!==e.inArray(c,s)){var d=r.substr(0,a),u=l(e.extend({},n,{term:d}));null!=u?(i(u),r=r.substr(a+1)||"",a=0):a++}else a++}return{term:r}},t})),t.define("select2/data/minimumInputLength",[],(function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumInputLength",[],(function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e})),t.define("select2/data/maximumSelectionLength",[],(function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("select",(function(){o._checkIfMaximumSelected()}))},e.prototype.query=function(e,t,n){var o=this;this._checkIfMaximumSelected((function(){e.call(o,t,n)}))},e.prototype._checkIfMaximumSelected=function(e,t){var n=this;this.current((function(e){var o=null!=e?e.length:0;n.maximumSelectionLength>0&&o>=n.maximumSelectionLength?n.trigger("results:message",{message:"maximumSelected",args:{maximum:n.maximumSelectionLength}}):t&&t()}))},e})),t.define("select2/dropdown",["jquery","./utils"],(function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="select2-dropdown"><span class="select2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n})),t.define("select2/dropdown/search",["jquery","../utils"],(function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),o=e('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=o,this.$search=o.find("input"),n.prepend(o),n},n.prototype.bind=function(t,n,o){var i=this,s=n.id+"-results";t.call(this,n,o),this.$search.on("keydown",(function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()})),this.$search.on("input",(function(t){e(this).off("keyup")})),this.$search.on("keyup input",(function(e){i.handleSearch(e)})),n.on("open",(function(){i.$search.attr("tabindex",0),i.$search.attr("aria-controls",s),i.$search.trigger("focus"),window.setTimeout((function(){i.$search.trigger("focus")}),0)})),n.on("close",(function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-controls"),i.$search.removeAttr("aria-activedescendant"),i.$search.val(""),i.$search.trigger("blur")})),n.on("focus",(function(){n.isOpen()||i.$search.trigger("focus")})),n.on("results:all",(function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))})),n.on("results:focus",(function(e){e.data._resultId?i.$search.attr("aria-activedescendant",e.data._resultId):i.$search.removeAttr("aria-activedescendant")}))},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n})),t.define("select2/dropdown/hidePlaceholder",[],(function(){function e(e,t,n,o){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,o)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),o=t.length-1;o>=0;o--){var i=t[o];this.placeholder.id===i.id&&n.splice(o,1)}return n},e})),t.define("select2/dropdown/infiniteScroll",["jquery"],(function(e){function t(e,t,n,o){this.lastParams={},e.call(this,t,n,o),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},t.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("query",(function(e){o.lastParams=e,o.loading=!0})),t.on("query:append",(function(e){o.lastParams=e,o.loading=!0})),this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},t.prototype.loadMoreIfNeeded=function(){var t=e.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&t&&this.$results.offset().top+this.$results.outerHeight(!1)+50>=this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)&&this.loadMore()},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t})),t.define("select2/dropdown/attachBody",["jquery","../utils"],(function(e,t){function n(t,n,o){this.$dropdownParent=e(o.get("dropdownParent")||document.body),t.call(this,n,o)}return n.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("open",(function(){o._showDropdown(),o._attachPositioningHandler(t),o._bindContainerResultHandlers(t)})),t.on("close",(function(){o._hideDropdown(),o._detachPositioningHandler(t)})),this.$dropdownContainer.on("mousedown",(function(e){e.stopPropagation()}))},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),o=t.call(this);return n.append(o),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._bindContainerResultHandlers=function(e,t){if(!this._containerResultsHandlersBound){var n=this;t.on("results:all",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:append",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("results:message",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("select",(function(){n._positionDropdown(),n._resizeDropdown()})),t.on("unselect",(function(){n._positionDropdown(),n._resizeDropdown()})),this._containerResultsHandlersBound=!0}},n.prototype._attachPositioningHandler=function(n,o){var i=this,s="scroll.select2."+o.id,r="resize.select2."+o.id,a="orientationchange.select2."+o.id,l=this.$container.parents().filter(t.hasScroll);l.each((function(){t.StoreData(this,"select2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})})),l.on(s,(function(n){var o=t.GetData(this,"select2-scroll-position");e(this).scrollTop(o.y)})),e(window).on(s+" "+r+" "+a,(function(e){i._positionDropdown(),i._resizeDropdown()}))},n.prototype._detachPositioningHandler=function(n,o){var i="scroll.select2."+o.id,s="resize.select2."+o.id,r="orientationchange.select2."+o.id;this.$container.parents().filter(t.hasScroll).off(i),e(window).off(i+" "+s+" "+r)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("select2-dropdown--above"),o=this.$dropdown.hasClass("select2-dropdown--below"),i=null,s=this.$container.offset();s.bottom=s.top+this.$container.outerHeight(!1);var r={height:this.$container.outerHeight(!1)};r.top=s.top,r.bottom=s.top+r.height;var a=this.$dropdown.outerHeight(!1),l=t.scrollTop(),c=t.scrollTop()+t.height(),d=l<s.top-a,u=c>s.bottom+a,p={left:s.left,top:r.bottom},h=this.$dropdownParent;"static"===h.css("position")&&(h=h.offsetParent());var m={top:0,left:0};(e.contains(document.body,h[0])||h[0].isConnected)&&(m=h.offset()),p.top-=m.top,p.left-=m.left,n||o||(i="below"),u||!d||n?!d&&u&&n&&(i="below"):i="above",("above"==i||n&&"below"!==i)&&(p.top=r.top-m.top-a),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(p)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n})),t.define("select2/dropdown/minimumResultsForSearch",[],(function(){function e(t){for(var n=0,o=0;o<t.length;o++){var i=t[o];i.children?n+=e(i.children):n++}return n}function t(e,t,n,o){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,o)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t})),t.define("select2/dropdown/selectOnClose",["../utils"],(function(e){function t(){}return t.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("close",(function(e){o._handleSelectOnClose(e)}))},t.prototype._handleSelectOnClose=function(t,n){if(n&&null!=n.originalSelect2Event){var o=n.originalSelect2Event;if("select"===o._type||"unselect"===o._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var s=e.GetData(i[0],"data");null!=s.element&&s.element.selected||null==s.element&&s.selected||this.trigger("select",{data:s})}},t})),t.define("select2/dropdown/closeOnSelect",[],(function(){function e(){}return e.prototype.bind=function(e,t,n){var o=this;e.call(this,t,n),t.on("select",(function(e){o._selectTriggered(e)})),t.on("unselect",(function(e){o._selectTriggered(e)}))},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&(n.ctrlKey||n.metaKey)||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e})),t.define("select2/i18n/en",[],(function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}})),t.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],(function(e,t,n,o,i,s,r,a,l,c,d,u,p,h,m,f,g,w,y,b,_,v,x,k,C,A,$,E,S){function P(){this.reset()}return P.prototype.apply=function(d){if(null==(d=e.extend(!0,{},this.defaults,d)).dataAdapter){if(null!=d.ajax?d.dataAdapter=m:null!=d.data?d.dataAdapter=h:d.dataAdapter=p,d.minimumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,w)),d.maximumInputLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,y)),d.maximumSelectionLength>0&&(d.dataAdapter=c.Decorate(d.dataAdapter,b)),d.tags&&(d.dataAdapter=c.Decorate(d.dataAdapter,f)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=c.Decorate(d.dataAdapter,g)),null!=d.query){var u=t(d.amdBase+"compat/query");d.dataAdapter=c.Decorate(d.dataAdapter,u)}if(null!=d.initSelection){var S=t(d.amdBase+"compat/initSelection");d.dataAdapter=c.Decorate(d.dataAdapter,S)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,k)),null!=d.placeholder&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,x)),d.selectOnClose&&(d.resultsAdapter=c.Decorate(d.resultsAdapter,$))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=_;else{var P=c.Decorate(_,v);d.dropdownAdapter=P}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,A)),d.closeOnSelect&&(d.dropdownAdapter=c.Decorate(d.dropdownAdapter,E)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var D=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=c.Decorate(d.dropdownAdapter,D)}d.dropdownAdapter=c.Decorate(d.dropdownAdapter,C)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=i:d.selectionAdapter=o,null!=d.placeholder&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,s)),d.allowClear&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,r)),d.multiple&&(d.selectionAdapter=c.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var T=t(d.amdBase+"compat/containerCss");d.selectionAdapter=c.Decorate(d.selectionAdapter,T)}d.selectionAdapter=c.Decorate(d.selectionAdapter,l)}d.language=this._resolveLanguage(d.language),d.language.push("en");for(var O=[],j=0;j<d.language.length;j++){var L=d.language[j];-1===O.indexOf(L)&&O.push(L)}return d.language=O,d.translations=this._processTranslations(d.language,d.debug),d},P.prototype.reset=function(){function t(e){return e.replace(/[^\u0000-\u007E]/g,(function(e){return u[e]||e}))}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:{},matcher:function n(o,i){if(""===e.trim(o.term))return i;if(i.children&&i.children.length>0){for(var s=e.extend(!0,{},i),r=i.children.length-1;r>=0;r--)null==n(o,i.children[r])&&s.children.splice(r,1);return s.children.length>0?s:n(o,s)}var a=t(i.text).toUpperCase(),l=t(o.term).toUpperCase();return a.indexOf(l)>-1?i:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},P.prototype.applyFromElement=function(e,t){var n=e.language,o=this.defaults.language,i=t.prop("lang"),s=t.closest("[lang]").prop("lang"),r=Array.prototype.concat.call(this._resolveLanguage(i),this._resolveLanguage(n),this._resolveLanguage(o),this._resolveLanguage(s));return e.language=r,e},P.prototype._resolveLanguage=function(t){if(!t)return[];if(e.isEmptyObject(t))return[];if(e.isPlainObject(t))return[t];var n;n=e.isArray(t)?t:[t];for(var o=[],i=0;i<n.length;i++)if(o.push(n[i]),"string"==typeof n[i]&&n[i].indexOf("-")>0){var s=n[i].split("-")[0];o.push(s)}return o},P.prototype._processTranslations=function(t,n){for(var o=new d,i=0;i<t.length;i++){var s=new d,r=t[i];if("string"==typeof r)try{s=d.loadPath(r)}catch(e){try{r=this.defaults.amdLanguageBase+r,s=d.loadPath(r)}catch(e){n&&window.console&&console.warn&&console.warn('Select2: The language file for "'+r+'" could not be automatically loaded. A fallback will be used instead.')}}else s=e.isPlainObject(r)?new d(r):r;o.extend(s)}return o},P.prototype.set=function(t,n){var o={};o[e.camelCase(t)]=n;var i=c._convertData(o);e.extend(!0,this.defaults,i)},new P})),t.define("select2/options",["require","jquery","./defaults","./utils"],(function(e,t,n,o){function i(t,i){if(this.options=t,null!=i&&this.fromElement(i),null!=i&&(this.options=n.applyFromElement(this.options,i)),this.options=n.apply(this.options),i&&i.is("input")){var s=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=o.Decorate(this.options.dataAdapter,s)}}return i.prototype.fromElement=function(e){var n=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),o.GetData(e[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),o.StoreData(e[0],"data",o.GetData(e[0],"select2Tags")),o.StoreData(e[0],"tags",!0)),o.GetData(e[0],"ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",o.GetData(e[0],"ajaxUrl")),o.StoreData(e[0],"ajax-Url",o.GetData(e[0],"ajaxUrl")));var i={};function s(e,t){return t.toUpperCase()}for(var r=0;r<e[0].attributes.length;r++){var a=e[0].attributes[r].name,l="data-";if(a.substr(0,l.length)==l){var c=a.substring(l.length),d=o.GetData(e[0],c);i[c.replace(/-([a-z])/g,s)]=d}}t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset&&(i=t.extend(!0,{},e[0].dataset,i));var u=t.extend(!0,{},o.GetData(e[0]),i);for(var p in u=o._convertData(u))t.inArray(p,n)>-1||(t.isPlainObject(this.options[p])?t.extend(this.options[p],u[p]):this.options[p]=u[p]);return this},i.prototype.get=function(e){return this.options[e]},i.prototype.set=function(e,t){this.options[e]=t},i})),t.define("select2/core",["jquery","./options","./utils","./keys"],(function(e,t,n,o){var i=function(e,o){null!=n.GetData(e[0],"select2")&&n.GetData(e[0],"select2").destroy(),this.$element=e,this.id=this._generateId(e),o=o||{},this.options=new t(o,e),i.__super__.constructor.call(this);var s=e.attr("tabindex")||0;n.StoreData(e[0],"old-tabindex",s),e.attr("tabindex","-1");var r=this.options.get("dataAdapter");this.dataAdapter=new r(e,this.options);var a=this.render();this._placeContainer(a);var l=this.options.get("selectionAdapter");this.selection=new l(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,a);var c=this.options.get("dropdownAdapter");this.dropdown=new c(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,a);var d=this.options.get("resultsAdapter");this.results=new d(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var u=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current((function(e){u.trigger("selection:update",{data:e})})),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),n.StoreData(e[0],"select2",this),e.data("select2",this)};return n.Extend(i,n.Observable),i.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},i.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},i.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var o=this._resolveWidth(e,"style");return null!=o?o:this._resolveWidth(e,"element")}if("element"==t){var i=e.outerWidth(!1);return i<=0?"auto":i+"px"}if("style"==t){var s=e.attr("style");if("string"!=typeof s)return null;for(var r=s.split(";"),a=0,l=r.length;a<l;a+=1){var c=r[a].replace(/\s/g,"").match(n);if(null!==c&&c.length>=1)return c[1]}return null}return"computedstyle"==t?window.getComputedStyle(e[0]).width:t},i.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},i.prototype._registerDomEvents=function(){var e=this;this.$element.on("change.select2",(function(){e.dataAdapter.current((function(t){e.trigger("selection:update",{data:t})}))})),this.$element.on("focus.select2",(function(t){e.trigger("focus",t)})),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var t=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=t?(this._observer=new t((function(t){e._syncA(),e._syncS(null,t)})),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",e._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",e._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",e._syncS,!1))},i.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",(function(t,n){e.trigger(t,n)}))},i.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",(function(){t.toggleDropdown()})),this.selection.on("focus",(function(e){t.focus(e)})),this.selection.on("*",(function(o,i){-1===e.inArray(o,n)&&t.trigger(o,i)}))},i.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",(function(t,n){e.trigger(t,n)}))},i.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",(function(t,n){e.trigger(t,n)}))},i.prototype._registerEvents=function(){var e=this;this.on("open",(function(){e.$container.addClass("select2-container--open")})),this.on("close",(function(){e.$container.removeClass("select2-container--open")})),this.on("enable",(function(){e.$container.removeClass("select2-container--disabled")})),this.on("disable",(function(){e.$container.addClass("select2-container--disabled")})),this.on("blur",(function(){e.$container.removeClass("select2-container--focus")})),this.on("query",(function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,(function(n){e.trigger("results:all",{data:n,query:t})}))})),this.on("query:append",(function(t){this.dataAdapter.query(t,(function(n){e.trigger("results:append",{data:n,query:t})}))})),this.on("keypress",(function(t){var n=t.which;e.isOpen()?n===o.ESC||n===o.TAB||n===o.UP&&t.altKey?(e.close(t),t.preventDefault()):n===o.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===o.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===o.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===o.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===o.ENTER||n===o.SPACE||n===o.DOWN&&t.altKey)&&(e.open(),t.preventDefault())}))},i.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},i.prototype._isChangeMutation=function(t,n){var o=!1,i=this;if(!t||!t.target||"OPTION"===t.target.nodeName||"OPTGROUP"===t.target.nodeName){if(n)if(n.addedNodes&&n.addedNodes.length>0)for(var s=0;s<n.addedNodes.length;s++)n.addedNodes[s].selected&&(o=!0);else n.removedNodes&&n.removedNodes.length>0?o=!0:e.isArray(n)&&e.each(n,(function(e,t){if(i._isChangeMutation(e,t))return o=!0,!1}));else o=!0;return o}},i.prototype._syncSubtree=function(e,t){var n=this._isChangeMutation(e,t),o=this;n&&this.dataAdapter.current((function(e){o.trigger("selection:update",{data:e})}))},i.prototype.trigger=function(e,t){var n=i.__super__.trigger,o={open:"opening",close:"closing",select:"selecting",unselect:"unselecting",clear:"clearing"};if(void 0===t&&(t={}),e in o){var s=o[e],r={prevented:!1,name:e,args:t};if(n.call(this,s,r),r.prevented)return void(t.prevented=!0)}n.call(this,e,t)},i.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},i.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},i.prototype.close=function(e){this.isOpen()&&this.trigger("close",{originalEvent:e})},i.prototype.isEnabled=function(){return!this.isDisabled()},i.prototype.isDisabled=function(){return this.options.get("disabled")},i.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},i.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},i.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},i.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},i.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current((function(t){e=t})),e},i.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,(function(e){return e.toString()}))),this.$element.val(n).trigger("input").trigger("change")},i.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",n.GetData(this.$element[0],"old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),n.RemoveData(this.$element[0]),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},i.prototype.render=function(){var t=e('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("select2-container--"+this.options.get("theme")),n.StoreData(t[0],"element",this.$element),t},i})),t.define("jquery-mousewheel",["jquery"],(function(e){return e})),t.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults","./select2/utils"],(function(e,t,n,o,i){if(null==e.fn.select2){var s=["open","close","destroy"];e.fn.select2=function(t){if("object"==typeof(t=t||{}))return this.each((function(){var o=e.extend(!0,{},t);new n(e(this),o)})),this;if("string"==typeof t){var o,r=Array.prototype.slice.call(arguments,1);return this.each((function(){var e=i.GetData(this,"select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),o=e[t].apply(e,r)})),e.inArray(t,s)>-1?this:o}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.select2.defaults&&(e.fn.select2.defaults=o),n})),{define:t.define,require:t.require}}(),n=t.require("jquery.select2");return e.fn.select2.amd=t,n},void 0===(s=o.apply(t,i))||(e.exports=s)},455:function(e){e.exports=function(){"use strict";const e="SweetAlert2:",t=e=>e.charAt(0).toUpperCase()+e.slice(1),n=t=>{console.warn("".concat(e," ").concat("object"==typeof t?t.join(" "):t))},o=t=>{console.error("".concat(e," ").concat(t))},i=[],s=(e,t)=>{var o;o='"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'),i.includes(o)||(i.push(o),n(o))},r=e=>"function"==typeof e?e():e,a=e=>e&&"function"==typeof e.toPromise,l=e=>a(e)?e.toPromise():Promise.resolve(e),c=e=>e&&Promise.resolve(e)===e,d={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},u=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],p={},h=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],m=e=>Object.prototype.hasOwnProperty.call(d,e),f=e=>-1!==u.indexOf(e),g=e=>p[e],w=e=>{m(e)||n('Unknown parameter "'.concat(e,'"'))},y=e=>{h.includes(e)&&n('The parameter "'.concat(e,'" is incompatible with toasts'))},b=e=>{g(e)&&s(e,g(e))},_=e=>{const t={};for(const n in e)t[e[n]]="swal2-"+e[n];return t},v=_(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error","no-war"]),x=_(["success","warning","info","question","error"]),k=()=>document.body.querySelector(".".concat(v.container)),C=e=>{const t=k();return t?t.querySelector(e):null},A=e=>C(".".concat(e)),$=()=>A(v.popup),E=()=>A(v.icon),S=()=>A(v.title),P=()=>A(v["html-container"]),D=()=>A(v.image),T=()=>A(v["progress-steps"]),O=()=>A(v["validation-message"]),j=()=>C(".".concat(v.actions," .").concat(v.confirm)),L=()=>C(".".concat(v.actions," .").concat(v.deny)),B=()=>C(".".concat(v.loader)),q=()=>C(".".concat(v.actions," .").concat(v.cancel)),I=()=>A(v.actions),M=()=>A(v.footer),z=()=>A(v["timer-progress-bar"]),H=()=>A(v.close),R=()=>{const e=Array.from($().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort(((e,t)=>{const n=parseInt(e.getAttribute("tabindex")),o=parseInt(t.getAttribute("tabindex"));return n>o?1:n<o?-1:0})),t=Array.from($().querySelectorAll('\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex="0"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n')).filter((e=>"-1"!==e.getAttribute("tabindex")));return(e=>{const t=[];for(let n=0;n<e.length;n++)-1===t.indexOf(e[n])&&t.push(e[n]);return t})(e.concat(t)).filter((e=>se(e)))},N=()=>G(document.body,v.shown)&&!G(document.body,v["toast-shown"])&&!G(document.body,v["no-backdrop"]),U=()=>$()&&G($(),v.toast),W={previousBodyPadding:null},V=(e,t)=>{if(e.textContent="",t){const n=(new DOMParser).parseFromString(t,"text/html");Array.from(n.querySelector("head").childNodes).forEach((t=>{e.appendChild(t)})),Array.from(n.querySelector("body").childNodes).forEach((t=>{e.appendChild(t)}))}},G=(e,t)=>{if(!t)return!1;const n=t.split(/\s+/);for(let t=0;t<n.length;t++)if(!e.classList.contains(n[t]))return!1;return!0},F=(e,t,o)=>{if(((e,t)=>{Array.from(e.classList).forEach((n=>{Object.values(v).includes(n)||Object.values(x).includes(n)||Object.values(t.showClass).includes(n)||e.classList.remove(n)}))})(e,t),t.customClass&&t.customClass[o]){if("string"!=typeof t.customClass[o]&&!t.customClass[o].forEach)return n("Invalid type of customClass.".concat(o,'! Expected string or iterable object, got "').concat(typeof t.customClass[o],'"'));Q(e,t.customClass[o])}},Y=(e,t)=>{if(!t)return null;switch(t){case"select":case"textarea":case"file":return e.querySelector(".".concat(v.popup," > .").concat(v[t]));case"checkbox":return e.querySelector(".".concat(v.popup," > .").concat(v.checkbox," input"));case"radio":return e.querySelector(".".concat(v.popup," > .").concat(v.radio," input:checked"))||e.querySelector(".".concat(v.popup," > .").concat(v.radio," input:first-child"));case"range":return e.querySelector(".".concat(v.popup," > .").concat(v.range," input"));default:return e.querySelector(".".concat(v.popup," > .").concat(v.input))}},Z=e=>{if(e.focus(),"file"!==e.type){const t=e.value;e.value="",e.value=t}},K=(e,t,n)=>{e&&t&&("string"==typeof t&&(t=t.split(/\s+/).filter(Boolean)),t.forEach((t=>{Array.isArray(e)?e.forEach((e=>{n?e.classList.add(t):e.classList.remove(t)})):n?e.classList.add(t):e.classList.remove(t)})))},Q=(e,t)=>{K(e,t,!0)},X=(e,t)=>{K(e,t,!1)},J=(e,t)=>{const n=Array.from(e.children);for(let e=0;e<n.length;e++){const o=n[e];if(o instanceof HTMLElement&&G(o,t))return o}},ee=(e,t,n)=>{n==="".concat(parseInt(n))&&(n=parseInt(n)),n||0===parseInt(n)?e.style[t]="number"==typeof n?"".concat(n,"px"):n:e.style.removeProperty(t)},te=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"flex";e.style.display=t},ne=e=>{e.style.display="none"},oe=(e,t,n,o)=>{const i=e.querySelector(t);i&&(i.style[n]=o)},ie=function(e,t){t?te(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"flex"):ne(e)},se=e=>!(!e||!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),re=e=>!!(e.scrollHeight>e.clientHeight),ae=e=>{const t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue("animation-duration")||"0"),o=parseFloat(t.getPropertyValue("transition-duration")||"0");return n>0||o>0},le=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=z();se(n)&&(t&&(n.style.transition="none",n.style.width="100%"),setTimeout((()=>{n.style.transition="width ".concat(e/1e3,"s linear"),n.style.width="0%"}),10))},ce=()=>"undefined"==typeof window||"undefined"==typeof document,de={},ue=e=>new Promise((t=>{if(!e)return t();const n=window.scrollX,o=window.scrollY;de.restoreFocusTimeout=setTimeout((()=>{de.previousActiveElement instanceof HTMLElement?(de.previousActiveElement.focus(),de.previousActiveElement=null):document.body&&document.body.focus(),t()}),100),window.scrollTo(n,o)})),pe='\n <div aria-labelledby="'.concat(v.title,'" aria-describedby="').concat(v["html-container"],'" class="').concat(v.popup,'" tabindex="-1">\n <button type="button" class="').concat(v.close,'"></button>\n <ul class="').concat(v["progress-steps"],'"></ul>\n <div class="').concat(v.icon,'"></div>\n <img class="').concat(v.image,'" />\n <h2 class="').concat(v.title,'" id="').concat(v.title,'"></h2>\n <div class="').concat(v["html-container"],'" id="').concat(v["html-container"],'"></div>\n <input class="').concat(v.input,'" />\n <input type="file" class="').concat(v.file,'" />\n <div class="').concat(v.range,'">\n <input type="range" />\n <output></output>\n </div>\n <select class="').concat(v.select,'"></select>\n <div class="').concat(v.radio,'"></div>\n <label for="').concat(v.checkbox,'" class="').concat(v.checkbox,'">\n <input type="checkbox" />\n <span class="').concat(v.label,'"></span>\n </label>\n <textarea class="').concat(v.textarea,'"></textarea>\n <div class="').concat(v["validation-message"],'" id="').concat(v["validation-message"],'"></div>\n <div class="').concat(v.actions,'">\n <div class="').concat(v.loader,'"></div>\n <button type="button" class="').concat(v.confirm,'"></button>\n <button type="button" class="').concat(v.deny,'"></button>\n <button type="button" class="').concat(v.cancel,'"></button>\n </div>\n <div class="').concat(v.footer,'"></div>\n <div class="').concat(v["timer-progress-bar-container"],'">\n <div class="').concat(v["timer-progress-bar"],'"></div>\n </div>\n </div>\n').replace(/(^|\n)\s*/g,""),he=()=>{de.currentInstance.resetValidationMessage()},me=e=>{const t=(()=>{const e=k();return!!e&&(e.remove(),X([document.documentElement,document.body],[v["no-backdrop"],v["toast-shown"],v["has-column"]]),!0)})();if(ce())return void o("SweetAlert2 requires document to initialize");const n=document.createElement("div");n.className=v.container,t&&Q(n,v["no-transition"]),V(n,pe);const i="string"==typeof(s=e.target)?document.querySelector(s):s;var s;i.appendChild(n),(e=>{const t=$();t.setAttribute("role",e.toast?"alert":"dialog"),t.setAttribute("aria-live",e.toast?"polite":"assertive"),e.toast||t.setAttribute("aria-modal","true")})(e),(e=>{"rtl"===window.getComputedStyle(e).direction&&Q(k(),v.rtl)})(i),(()=>{const e=$(),t=J(e,v.input),n=J(e,v.file),o=e.querySelector(".".concat(v.range," input")),i=e.querySelector(".".concat(v.range," output")),s=J(e,v.select),r=e.querySelector(".".concat(v.checkbox," input")),a=J(e,v.textarea);t.oninput=he,n.onchange=he,s.onchange=he,r.onchange=he,a.oninput=he,o.oninput=()=>{he(),i.value=o.value},o.onchange=()=>{he(),i.value=o.value}})()},fe=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):"object"==typeof e?ge(e,t):e&&V(t,e)},ge=(e,t)=>{e.jquery?we(t,e):V(t,e.toString())},we=(e,t)=>{if(e.textContent="",0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},ye=(()=>{if(ce())return!1;const e=document.createElement("div"),t={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&void 0!==e.style[n])return t[n];return!1})(),be=(e,t)=>{const n=I(),o=B();t.showConfirmButton||t.showDenyButton||t.showCancelButton?te(n):ne(n),F(n,t,"actions"),function(e,t,n){const o=j(),i=L(),s=q();_e(o,"confirm",n),_e(i,"deny",n),_e(s,"cancel",n),function(e,t,n,o){if(!o.buttonsStyling)return X([e,t,n],v.styled);Q([e,t,n],v.styled),o.confirmButtonColor&&(e.style.backgroundColor=o.confirmButtonColor,Q(e,v["default-outline"])),o.denyButtonColor&&(t.style.backgroundColor=o.denyButtonColor,Q(t,v["default-outline"])),o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,Q(n,v["default-outline"]))}(o,i,s,n),n.reverseButtons&&(n.toast?(e.insertBefore(s,o),e.insertBefore(i,o)):(e.insertBefore(s,t),e.insertBefore(i,t),e.insertBefore(o,t)))}(n,o,t),V(o,t.loaderHtml),F(o,t,"loader")};function _e(e,n,o){ie(e,o["show".concat(t(n),"Button")],"inline-block"),V(e,o["".concat(n,"ButtonText")]),e.setAttribute("aria-label",o["".concat(n,"ButtonAriaLabel")]),e.className=v[n],F(e,o,"".concat(n,"Button")),Q(e,o["".concat(n,"ButtonClass")])}const ve=(e,t)=>{const o=k();o&&(function(e,t){"string"==typeof t?e.style.background=t:t||Q([document.documentElement,document.body],v["no-backdrop"])}(o,t.backdrop),function(e,t){t in v?Q(e,v[t]):(n('The "position" parameter is not valid, defaulting to "center"'),Q(e,v.center))}(o,t.position),function(e,t){if(t&&"string"==typeof t){const n="grow-".concat(t);n in v&&Q(e,v[n])}}(o,t.grow),F(o,t,"container"))};var xe={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap};const ke=["input","file","range","select","radio","checkbox","textarea"],Ce=e=>{if(!Te[e.input])return o('Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "'.concat(e.input,'"'));const t=Pe(e.input),n=Te[e.input](t,e);te(t),setTimeout((()=>{Z(n)}))},Ae=(e,t)=>{const n=Y($(),e);if(n){(e=>{for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t].name;["type","value","style"].includes(n)||e.removeAttribute(n)}})(n);for(const e in t)n.setAttribute(e,t[e])}},$e=e=>{const t=Pe(e.input);"object"==typeof e.customClass&&Q(t,e.customClass.input)},Ee=(e,t)=>{e.placeholder&&!t.inputPlaceholder||(e.placeholder=t.inputPlaceholder)},Se=(e,t,n)=>{if(n.inputLabel){e.id=v.input;const o=document.createElement("label"),i=v["input-label"];o.setAttribute("for",e.id),o.className=i,"object"==typeof n.customClass&&Q(o,n.customClass.inputLabel),o.innerText=n.inputLabel,t.insertAdjacentElement("beforebegin",o)}},Pe=e=>J($(),v[e]||v.input),De=(e,t)=>{["string","number"].includes(typeof t)?e.value="".concat(t):c(t)||n('Unexpected type of inputValue! Expected "string", "number" or "Promise", got "'.concat(typeof t,'"'))},Te={};Te.text=Te.email=Te.password=Te.number=Te.tel=Te.url=(e,t)=>(De(e,t.inputValue),Se(e,e,t),Ee(e,t),e.type=t.input,e),Te.file=(e,t)=>(Se(e,e,t),Ee(e,t),e),Te.range=(e,t)=>{const n=e.querySelector("input"),o=e.querySelector("output");return De(n,t.inputValue),n.type=t.input,De(o,t.inputValue),Se(n,e,t),e},Te.select=(e,t)=>{if(e.textContent="",t.inputPlaceholder){const n=document.createElement("option");V(n,t.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,e.appendChild(n)}return Se(e,e,t),e},Te.radio=e=>(e.textContent="",e),Te.checkbox=(e,t)=>{const n=Y($(),"checkbox");n.value="1",n.id=v.checkbox,n.checked=Boolean(t.inputValue);const o=e.querySelector("span");return V(o,t.inputPlaceholder),n},Te.textarea=(e,t)=>{De(e,t.inputValue),Ee(e,t),Se(e,e,t);return setTimeout((()=>{if("MutationObserver"in window){const t=parseInt(window.getComputedStyle($()).width);new MutationObserver((()=>{const n=e.offsetWidth+(o=e,parseInt(window.getComputedStyle(o).marginLeft)+parseInt(window.getComputedStyle(o).marginRight));var o;$().style.width=n>t?"".concat(n,"px"):null})).observe(e,{attributes:!0,attributeFilter:["style"]})}})),e};const Oe=(e,t)=>{const n=P();F(n,t,"htmlContainer"),t.html?(fe(t.html,n),te(n,"block")):t.text?(n.textContent=t.text,te(n,"block")):ne(n),((e,t)=>{const n=$(),o=xe.innerParams.get(e),i=!o||t.input!==o.input;ke.forEach((e=>{const o=J(n,v[e]);Ae(e,t.inputAttributes),o.className=v[e],i&&ne(o)})),t.input&&(i&&Ce(t),$e(t))})(e,t)},je=(e,t)=>{for(const n in x)t.icon!==n&&X(e,x[n]);Q(e,x[t.icon]),qe(e,t),Le(),F(e,t,"icon")},Le=()=>{const e=$(),t=window.getComputedStyle(e).getPropertyValue("background-color"),n=e.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let e=0;e<n.length;e++)n[e].style.backgroundColor=t},Be=(e,t)=>{let n,o=e.innerHTML;t.iconHtml?n=Ie(t.iconHtml):"success"===t.icon?(n='\n <div class="swal2-success-circular-line-left"></div>\n <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>\n <div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>\n <div class="swal2-success-circular-line-right"></div>\n',o=o.replace(/ style=".*?"/g,"")):n="error"===t.icon?'\n <span class="swal2-x-mark">\n <span class="swal2-x-mark-line-left"></span>\n <span class="swal2-x-mark-line-right"></span>\n </span>\n':Ie({question:"?",warning:"!",info:"i"}[t.icon]),o.trim()!==n.trim()&&V(e,n)},qe=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])oe(e,n,"backgroundColor",t.iconColor);oe(e,".swal2-success-ring","borderColor",t.iconColor)}},Ie=e=>'<div class="'.concat(v["icon-content"],'">').concat(e,"</div>"),Me=e=>{const t=document.createElement("li");return Q(t,v["progress-step"]),V(t,e),t},ze=e=>{const t=document.createElement("li");return Q(t,v["progress-step-line"]),e.progressStepsDistance&&ee(t,"width",e.progressStepsDistance),t},He=(e,t)=>{e.className="".concat(v.popup," ").concat(se(e)?t.showClass.popup:""),t.toast?(Q([document.documentElement,document.body],v["toast-shown"]),Q(e,v.toast)):Q(e,v.modal),F(e,t,"popup"),"string"==typeof t.customClass&&Q(e,t.customClass),t.icon&&Q(e,v["icon-".concat(t.icon)])},Re=(e,t)=>{((e,t)=>{const n=k(),o=$();t.toast?(ee(n,"width",t.width),o.style.width="100%",o.insertBefore(B(),E())):ee(o,"width",t.width),ee(o,"padding",t.padding),t.color&&(o.style.color=t.color),t.background&&(o.style.background=t.background),ne(O()),He(o,t)})(0,t),ve(0,t),((e,t)=>{const o=T();if(!t.progressSteps||0===t.progressSteps.length)return ne(o);te(o),o.textContent="",t.currentProgressStep>=t.progressSteps.length&&n("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),t.progressSteps.forEach(((e,n)=>{const i=Me(e);if(o.appendChild(i),n===t.currentProgressStep&&Q(i,v["active-progress-step"]),n!==t.progressSteps.length-1){const e=ze(t);o.appendChild(e)}}))})(0,t),((e,t)=>{const n=xe.innerParams.get(e),i=E();if(n&&t.icon===n.icon)return Be(i,t),void je(i,t);if(t.icon||t.iconHtml){if(t.icon&&-1===Object.keys(x).indexOf(t.icon))return o('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.icon,'"')),void ne(i);te(i),Be(i,t),je(i,t),Q(i,t.showClass.icon)}else ne(i)})(e,t),((e,t)=>{const n=D();if(!t.imageUrl)return ne(n);te(n,""),n.setAttribute("src",t.imageUrl),n.setAttribute("alt",t.imageAlt),ee(n,"width",t.imageWidth),ee(n,"height",t.imageHeight),n.className=v.image,F(n,t,"image")})(0,t),((e,t)=>{const n=S();ie(n,t.title||t.titleText,"block"),t.title&&fe(t.title,n),t.titleText&&(n.innerText=t.titleText),F(n,t,"title")})(0,t),((e,t)=>{const n=H();V(n,t.closeButtonHtml),F(n,t,"closeButton"),ie(n,t.showCloseButton),n.setAttribute("aria-label",t.closeButtonAriaLabel)})(0,t),Oe(e,t),be(0,t),((e,t)=>{const n=M();ie(n,t.footer),t.footer&&fe(t.footer,n),F(n,t,"footer")})(0,t),"function"==typeof t.didRender&&t.didRender($())},Ne=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Ue=()=>{Array.from(document.body.children).forEach((e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")}))},We=["swal-title","swal-html","swal-footer"],Ve=e=>{const t={};return Array.from(e.querySelectorAll("swal-param")).forEach((e=>{Xe(e,["name","value"]);const n=e.getAttribute("name"),o=e.getAttribute("value");"boolean"==typeof d[n]&&"false"===o&&(t[n]=!1),"object"==typeof d[n]&&(t[n]=JSON.parse(o))})),t},Ge=e=>{const n={};return Array.from(e.querySelectorAll("swal-button")).forEach((e=>{Xe(e,["type","color","aria-label"]);const o=e.getAttribute("type");n["".concat(o,"ButtonText")]=e.innerHTML,n["show".concat(t(o),"Button")]=!0,e.hasAttribute("color")&&(n["".concat(o,"ButtonColor")]=e.getAttribute("color")),e.hasAttribute("aria-label")&&(n["".concat(o,"ButtonAriaLabel")]=e.getAttribute("aria-label"))})),n},Fe=e=>{const t={},n=e.querySelector("swal-image");return n&&(Xe(n,["src","width","height","alt"]),n.hasAttribute("src")&&(t.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(t.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(t.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(t.imageAlt=n.getAttribute("alt"))),t},Ye=e=>{const t={},n=e.querySelector("swal-icon");return n&&(Xe(n,["type","color"]),n.hasAttribute("type")&&(t.icon=n.getAttribute("type")),n.hasAttribute("color")&&(t.iconColor=n.getAttribute("color")),t.iconHtml=n.innerHTML),t},Ze=e=>{const t={},n=e.querySelector("swal-input");n&&(Xe(n,["type","label","placeholder","value"]),t.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(t.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(t.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(t.inputValue=n.getAttribute("value")));const o=Array.from(e.querySelectorAll("swal-input-option"));return o.length&&(t.inputOptions={},o.forEach((e=>{Xe(e,["value"]);const n=e.getAttribute("value"),o=e.innerHTML;t.inputOptions[n]=o}))),t},Ke=(e,t)=>{const n={};for(const o in t){const i=t[o],s=e.querySelector(i);s&&(Xe(s,[]),n[i.replace(/^swal-/,"")]=s.innerHTML.trim())}return n},Qe=e=>{const t=We.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);Array.from(e.children).forEach((e=>{const o=e.tagName.toLowerCase();-1===t.indexOf(o)&&n("Unrecognized element <".concat(o,">"))}))},Xe=(e,t)=>{Array.from(e.attributes).forEach((o=>{-1===t.indexOf(o.name)&&n(['Unrecognized attribute "'.concat(o.name,'" on <').concat(e.tagName.toLowerCase(),">."),"".concat(t.length?"Allowed attributes are: ".concat(t.join(", ")):"To set the value, use HTML within the element.")])}))};var Je={email:(e,t)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid email address"),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||"Invalid URL")};function et(e){(function(e){e.inputValidator||Object.keys(Je).forEach((t=>{e.input===t&&(e.inputValidator=Je[t])}))})(e),e.showLoaderOnConfirm&&!e.preConfirm&&n("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(e){(!e.target||"string"==typeof e.target&&!document.querySelector(e.target)||"string"!=typeof e.target&&!e.target.appendChild)&&(n('Target parameter is not valid, defaulting to "body"'),e.target="body")}(e),"string"==typeof e.title&&(e.title=e.title.split("\n").join("<br />")),me(e)}class tt{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=(new Date).getTime()-this.started.getTime()),this.remaining}increase(e){const t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const nt=()=>{null===W.previousBodyPadding&&document.body.scrollHeight>window.innerHeight&&(W.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(W.previousBodyPadding+(()=>{const e=document.createElement("div");e.className=v["scrollbar-measure"],document.body.appendChild(e);const t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t})(),"px"))},ot=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);if(t&&n&&!e.match(/CriOS/i)){const e=44;$().scrollHeight>window.innerHeight-e&&(k().style.paddingBottom="".concat(e,"px"))}},it=()=>{const e=k();let t;e.ontouchstart=e=>{t=st(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},st=e=>{const t=e.target,n=k();return!(rt(e)||at(e)||t!==n&&(re(n)||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||re(P())&&P().contains(t)))},rt=e=>e.touches&&e.touches.length&&"stylus"===e.touches[0].touchType,at=e=>e.touches&&e.touches.length>1,lt=e=>{const t=k(),n=$();"function"==typeof e.willOpen&&e.willOpen(n);const o=window.getComputedStyle(document.body).overflowY;pt(t,n,e),setTimeout((()=>{dt(t,n)}),10),N()&&(ut(t,e.scrollbarPadding,o),Array.from(document.body.children).forEach((e=>{e===k()||e.contains(k())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))}))),U()||de.previousActiveElement||(de.previousActiveElement=document.activeElement),"function"==typeof e.didOpen&&setTimeout((()=>e.didOpen(n))),X(t,v["no-transition"])},ct=e=>{const t=$();if(e.target!==t)return;const n=k();t.removeEventListener(ye,ct),n.style.overflowY="auto"},dt=(e,t)=>{ye&&ae(t)?(e.style.overflowY="hidden",t.addEventListener(ye,ct)):e.style.overflowY="auto"},ut=(e,t,n)=>{(()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!G(document.body,v.iosfix)){const e=document.body.scrollTop;document.body.style.top="".concat(-1*e,"px"),Q(document.body,v.iosfix),it(),ot()}})(),t&&"hidden"!==n&&nt(),setTimeout((()=>{e.scrollTop=0}))},pt=(e,t,n)=>{Q(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),te(t,"grid"),setTimeout((()=>{Q(t,n.showClass.popup),t.style.removeProperty("opacity")}),10),Q([document.documentElement,document.body],v.shown),n.heightAuto&&n.backdrop&&!n.toast&&Q([document.documentElement,document.body],v["height-auto"])},ht=e=>{let t=$();t||new Sn,t=$();const n=B();U()?ne(E()):mt(t,e),te(n),t.setAttribute("data-loading","true"),t.setAttribute("aria-busy","true"),t.focus()},mt=(e,t)=>{const n=I(),o=B();!t&&se(j())&&(t=j()),te(n),t&&(ne(t),o.setAttribute("data-button-to-replace",t.className)),o.parentNode.insertBefore(o,t),Q([e,n],v.loading)},ft=e=>e.checked?1:0,gt=e=>e.checked?e.value:null,wt=e=>e.files.length?null!==e.getAttribute("multiple")?e.files:e.files[0]:null,yt=(e,t)=>{const n=$(),i=e=>_t[t.input](n,vt(e),t);a(t.inputOptions)||c(t.inputOptions)?(ht(j()),l(t.inputOptions).then((t=>{e.hideLoading(),i(t)}))):"object"==typeof t.inputOptions?i(t.inputOptions):o("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},bt=(e,t)=>{const n=e.getInput();ne(n),l(t.inputValue).then((o=>{n.value="number"===t.input?parseFloat(o)||0:"".concat(o),te(n),n.focus(),e.hideLoading()})).catch((t=>{o("Error in inputValue promise: ".concat(t)),n.value="",te(n),n.focus(),e.hideLoading()}))},_t={select:(e,t,n)=>{const o=J(e,v.select),i=(e,t,o)=>{const i=document.createElement("option");i.value=o,V(i,t),i.selected=xt(o,n.inputValue),e.appendChild(i)};t.forEach((e=>{const t=e[0],n=e[1];if(Array.isArray(n)){const e=document.createElement("optgroup");e.label=t,e.disabled=!1,o.appendChild(e),n.forEach((t=>i(e,t[1],t[0])))}else i(o,n,t)})),o.focus()},radio:(e,t,n)=>{const o=J(e,v.radio);t.forEach((e=>{const t=e[0],i=e[1],s=document.createElement("input"),r=document.createElement("label");s.type="radio",s.name=v.radio,s.value=t,xt(t,n.inputValue)&&(s.checked=!0);const a=document.createElement("span");V(a,i),a.className=v.label,r.appendChild(s),r.appendChild(a),o.appendChild(r)}));const i=o.querySelectorAll("input");i.length&&i[0].focus()}},vt=e=>{const t=[];return"undefined"!=typeof Map&&e instanceof Map?e.forEach(((e,n)=>{let o=e;"object"==typeof o&&(o=vt(o)),t.push([n,o])})):Object.keys(e).forEach((n=>{let o=e[n];"object"==typeof o&&(o=vt(o)),t.push([n,o])})),t},xt=(e,t)=>t&&t.toString()===e.toString();function kt(){const e=xe.innerParams.get(this);if(!e)return;const t=xe.domCache.get(this);ne(t.loader),U()?e.icon&&te(E()):Ct(t),X([t.popup,t.actions],v.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Ct=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?te(t[0],"inline-block"):!se(j())&&!se(L())&&!se(q())&&ne(e.actions)};var At={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const $t=()=>j()&&j().click(),Et=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},St=(e,t,n)=>{const o=R();if(o.length)return(t+=n)===o.length?t=0:-1===t&&(t=o.length-1),o[t].focus();$().focus()},Pt=["ArrowRight","ArrowDown"],Dt=["ArrowLeft","ArrowUp"],Tt=(e,t,n)=>{const o=xe.innerParams.get(e);o&&(t.isComposing||229===t.keyCode||(o.stopKeydownPropagation&&t.stopPropagation(),"Enter"===t.key?Ot(e,t,o):"Tab"===t.key?jt(t,o):[...Pt,...Dt].includes(t.key)?Lt(t.key):"Escape"===t.key&&Bt(t,o,n)))},Ot=(e,t,n)=>{if(r(n.allowEnterKey)&&t.target&&e.getInput()&&t.target instanceof HTMLElement&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;$t(),t.preventDefault()}},jt=(e,t)=>{const n=e.target,o=R();let i=-1;for(let e=0;e<o.length;e++)if(n===o[e]){i=e;break}e.shiftKey?St(0,i,-1):St(0,i,1),e.stopPropagation(),e.preventDefault()},Lt=e=>{const t=j(),n=L(),o=q();if(document.activeElement instanceof HTMLElement&&![t,n,o].includes(document.activeElement))return;const i=Pt.includes(e)?"nextElementSibling":"previousElementSibling";let s=document.activeElement;for(let e=0;e<I().children.length;e++){if(s=s[i],!s)return;if(s instanceof HTMLButtonElement&&se(s))break}s instanceof HTMLButtonElement&&s.focus()},Bt=(e,t,n)=>{r(t.allowEscapeKey)&&(e.preventDefault(),n(Ne.esc))};function qt(e,t,n,o){U()?Ut(e,o):(ue(n).then((()=>Ut(e,o))),Et(de)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),N()&&(null!==W.previousBodyPadding&&(document.body.style.paddingRight="".concat(W.previousBodyPadding,"px"),W.previousBodyPadding=null),(()=>{if(G(document.body,v.iosfix)){const e=parseInt(document.body.style.top,10);X(document.body,v.iosfix),document.body.style.top="",document.body.scrollTop=-1*e}})(),Ue()),X([document.documentElement,document.body],[v.shown,v["height-auto"],v["no-backdrop"],v["toast-shown"]])}function It(e){e=Ht(e);const t=At.swalPromiseResolve.get(this),n=Mt(this);this.isAwaitingPromise()?e.isDismissed||(zt(this),t(e)):n&&t(e)}const Mt=e=>{const t=$();if(!t)return!1;const n=xe.innerParams.get(e);if(!n||G(t,n.hideClass.popup))return!1;X(t,n.showClass.popup),Q(t,n.hideClass.popup);const o=k();return X(o,n.showClass.backdrop),Q(o,n.hideClass.backdrop),Rt(e,t,n),!0};const zt=e=>{e.isAwaitingPromise()&&(xe.awaitingPromise.delete(e),xe.innerParams.get(e)||e._destroy())},Ht=e=>void 0===e?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),Rt=(e,t,n)=>{const o=k(),i=ye&&ae(t);"function"==typeof n.willClose&&n.willClose(t),i?Nt(e,t,o,n.returnFocus,n.didClose):qt(e,o,n.returnFocus,n.didClose)},Nt=(e,t,n,o,i)=>{de.swalCloseEventFinishedCallback=qt.bind(null,e,n,o,i),t.addEventListener(ye,(function(e){e.target===t&&(de.swalCloseEventFinishedCallback(),delete de.swalCloseEventFinishedCallback)}))},Ut=(e,t)=>{setTimeout((()=>{"function"==typeof t&&t.bind(e.params)(),e._destroy()}))};function Wt(e,t,n){const o=xe.domCache.get(e);t.forEach((e=>{o[e].disabled=n}))}function Vt(e,t){if(!e)return!1;if("radio"===e.type){const n=e.parentNode.parentNode.querySelectorAll("input");for(let e=0;e<n.length;e++)n[e].disabled=t}else e.disabled=t}const Gt=e=>{const t={};return Object.keys(e).forEach((o=>{f(o)?t[o]=e[o]:n("Invalid parameter to update: ".concat(o))})),t};const Ft=e=>{Yt(e),delete e.params,delete de.keydownHandler,delete de.keydownTarget,delete de.currentInstance},Yt=e=>{e.isAwaitingPromise()?(Zt(xe,e),xe.awaitingPromise.set(e,!0)):(Zt(At,e),Zt(xe,e))},Zt=(e,t)=>{for(const n in e)e[n].delete(t)};var Kt=Object.freeze({hideLoading:kt,disableLoading:kt,getInput:function(e){const t=xe.innerParams.get(e||this),n=xe.domCache.get(e||this);return n?Y(n.popup,t.input):null},close:It,isAwaitingPromise:function(){return!!xe.awaitingPromise.get(this)},rejectPromise:function(e){const t=At.swalPromiseReject.get(this);zt(this),t&&t(e)},handleAwaitingPromise:zt,closePopup:It,closeModal:It,closeToast:It,enableButtons:function(){Wt(this,["confirmButton","denyButton","cancelButton"],!1)},disableButtons:function(){Wt(this,["confirmButton","denyButton","cancelButton"],!0)},enableInput:function(){return Vt(this.getInput(),!1)},disableInput:function(){return Vt(this.getInput(),!0)},showValidationMessage:function(e){const t=xe.domCache.get(this),n=xe.innerParams.get(this);V(t.validationMessage,e),t.validationMessage.className=v["validation-message"],n.customClass&&n.customClass.validationMessage&&Q(t.validationMessage,n.customClass.validationMessage),te(t.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",v["validation-message"]),Z(o),Q(o,v.inputerror))},resetValidationMessage:function(){const e=xe.domCache.get(this);e.validationMessage&&ne(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),X(t,v.inputerror))},getProgressSteps:function(){return xe.domCache.get(this).progressSteps},update:function(e){const t=$(),o=xe.innerParams.get(this);if(!t||G(t,o.hideClass.popup))return n("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const i=Gt(e),s=Object.assign({},o,i);Re(this,s),xe.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})},_destroy:function(){const e=xe.domCache.get(this),t=xe.innerParams.get(this);t?(e.popup&&de.swalCloseEventFinishedCallback&&(de.swalCloseEventFinishedCallback(),delete de.swalCloseEventFinishedCallback),"function"==typeof t.didDestroy&&t.didDestroy(),Ft(this)):Yt(this)}});const Qt=(e,n)=>{const i=xe.innerParams.get(e);if(!i.input)return void o('The "input" parameter is needed to be set when using returnInputValueOn'.concat(t(n)));const s=((e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return ft(n);case"radio":return gt(n);case"file":return wt(n);default:return t.inputAutoTrim?n.value.trim():n.value}})(e,i);i.inputValidator?Xt(e,s,n):e.getInput().checkValidity()?"deny"===n?Jt(e,s):nn(e,s):(e.enableButtons(),e.showValidationMessage(i.validationMessage))},Xt=(e,t,n)=>{const o=xe.innerParams.get(e);e.disableInput(),Promise.resolve().then((()=>l(o.inputValidator(t,o.validationMessage)))).then((o=>{e.enableButtons(),e.enableInput(),o?e.showValidationMessage(o):"deny"===n?Jt(e,t):nn(e,t)}))},Jt=(e,t)=>{const n=xe.innerParams.get(e||void 0);n.showLoaderOnDeny&&ht(L()),n.preDeny?(xe.awaitingPromise.set(e||void 0,!0),Promise.resolve().then((()=>l(n.preDeny(t,n.validationMessage)))).then((n=>{!1===n?(e.hideLoading(),zt(e)):e.close({isDenied:!0,value:void 0===n?t:n})})).catch((t=>tn(e||void 0,t)))):e.close({isDenied:!0,value:t})},en=(e,t)=>{e.close({isConfirmed:!0,value:t})},tn=(e,t)=>{e.rejectPromise(t)},nn=(e,t)=>{const n=xe.innerParams.get(e||void 0);n.showLoaderOnConfirm&&ht(),n.preConfirm?(e.resetValidationMessage(),xe.awaitingPromise.set(e||void 0,!0),Promise.resolve().then((()=>l(n.preConfirm(t,n.validationMessage)))).then((n=>{se(O())||!1===n?(e.hideLoading(),zt(e)):en(e,void 0===n?t:n)})).catch((t=>tn(e||void 0,t)))):en(e,t)},on=(e,t,n)=>{t.popup.onclick=()=>{const t=xe.innerParams.get(e);t&&(sn(t)||t.timer||t.input)||n(Ne.close)}},sn=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let rn=!1;const an=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(rn=!0)}}},ln=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(rn=!0)}}},cn=(e,t,n)=>{t.container.onclick=o=>{const i=xe.innerParams.get(e);rn?rn=!1:o.target===t.container&&r(i.allowOutsideClick)&&n(Ne.backdrop)}},dn=e=>e instanceof Element||(e=>"object"==typeof e&&e.jquery)(e);const un=()=>{if(de.timeout)return(()=>{const e=z(),t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty("transition"),e.style.width="100%";const n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.removeProperty("transition"),e.style.width="".concat(n,"%")})(),de.timeout.stop()},pn=()=>{if(de.timeout){const e=de.timeout.start();return le(e),e}};let hn=!1;const mn={};const fn=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const e in mn){const n=t.getAttribute(e);if(n)return void mn[e].fire({template:n})}};var gn=Object.freeze({isValidParameter:m,isUpdatableParameter:f,isDeprecatedParameter:g,argsToParams:e=>{const t={};return"object"!=typeof e[0]||dn(e[0])?["title","html","icon"].forEach(((n,i)=>{const s=e[i];"string"==typeof s||dn(s)?t[n]=s:void 0!==s&&o("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof s))})):Object.assign(t,e[0]),t},isVisible:()=>se($()),clickConfirm:$t,clickDeny:()=>L()&&L().click(),clickCancel:()=>q()&&q().click(),getContainer:k,getPopup:$,getTitle:S,getHtmlContainer:P,getImage:D,getIcon:E,getInputLabel:()=>A(v["input-label"]),getCloseButton:H,getActions:I,getConfirmButton:j,getDenyButton:L,getCancelButton:q,getLoader:B,getFooter:M,getTimerProgressBar:z,getFocusableElements:R,getValidationMessage:O,isLoading:()=>$().hasAttribute("data-loading"),fire:function(){const e=this;for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return new e(...n)},mixin:function(e){return class extends(this){_main(t,n){return super._main(t,Object.assign({},e,n))}}},showLoading:ht,enableLoading:ht,getTimerLeft:()=>de.timeout&&de.timeout.getTimerLeft(),stopTimer:un,resumeTimer:pn,toggleTimer:()=>{const e=de.timeout;return e&&(e.running?un():pn())},increaseTimer:e=>{if(de.timeout){const t=de.timeout.increase(e);return le(t,!0),t}},isTimerRunning:()=>de.timeout&&de.timeout.isRunning(),bindClickHandler:function(){mn[arguments.length>0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,hn||(document.body.addEventListener("click",fn),hn=!0)}});let wn;class yn{constructor(){if("undefined"==typeof window)return;wn=this;for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=Object.freeze(this.constructor.argsToParams(t));Object.defineProperties(this,{params:{value:o,writable:!1,enumerable:!0,configurable:!0}});const i=wn._main(wn.params);xe.promise.set(this,i)}_main(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(e=>{!e.backdrop&&e.allowOutsideClick&&n('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)w(t),e.toast&&y(t),b(t)})(Object.assign({},t,e)),de.currentInstance&&(de.currentInstance._destroy(),N()&&Ue()),de.currentInstance=wn;const o=vn(e,t);et(o),Object.freeze(o),de.timeout&&(de.timeout.stop(),delete de.timeout),clearTimeout(de.restoreFocusTimeout);const i=xn(wn);return Re(wn,o),xe.innerParams.set(wn,o),bn(wn,i,o)}then(e){return xe.promise.get(this).then(e)}finally(e){return xe.promise.get(this).finally(e)}}const bn=(e,t,n)=>new Promise(((o,i)=>{const s=t=>{e.closePopup({isDismissed:!0,dismiss:t})};At.swalPromiseResolve.set(e,o),At.swalPromiseReject.set(e,i),t.confirmButton.onclick=()=>(e=>{const t=xe.innerParams.get(e);e.disableButtons(),t.input?Qt(e,"confirm"):nn(e,!0)})(e),t.denyButton.onclick=()=>(e=>{const t=xe.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Qt(e,"deny"):Jt(e,!1)})(e),t.cancelButton.onclick=()=>((e,t)=>{e.disableButtons(),t(Ne.cancel)})(e,s),t.closeButton.onclick=()=>s(Ne.close),((e,t,n)=>{xe.innerParams.get(e).toast?on(e,t,n):(an(t),ln(t),cn(e,t,n))})(e,t,s),((e,t,n,o)=>{Et(t),n.toast||(t.keydownHandler=t=>Tt(e,t,o),t.keydownTarget=n.keydownListenerCapture?window:$(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)})(e,de,n,s),((e,t)=>{"select"===t.input||"radio"===t.input?yt(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(a(t.inputValue)||c(t.inputValue))&&(ht(j()),bt(e,t))})(e,n),lt(n),kn(de,n,s),Cn(t,n),setTimeout((()=>{t.container.scrollTop=0}))})),vn=(e,t)=>{const n=(e=>{const t="string"==typeof e.template?document.querySelector(e.template):e.template;if(!t)return{};const n=t.content;return Qe(n),Object.assign(Ve(n),Ge(n),Fe(n),Ye(n),Ze(n),Ke(n,We))})(e),o=Object.assign({},d,t,n,e);return o.showClass=Object.assign({},d.showClass,o.showClass),o.hideClass=Object.assign({},d.hideClass,o.hideClass),o},xn=e=>{const t={popup:$(),container:k(),actions:I(),confirmButton:j(),denyButton:L(),cancelButton:q(),loader:B(),closeButton:H(),validationMessage:O(),progressSteps:T()};return xe.domCache.set(e,t),t},kn=(e,t,n)=>{const o=z();ne(o),t.timer&&(e.timeout=new tt((()=>{n("timer"),delete e.timeout}),t.timer),t.timerProgressBar&&(te(o),F(o,t,"timerProgressBar"),setTimeout((()=>{e.timeout&&e.timeout.running&&le(t.timer)}))))},Cn=(e,t)=>{if(!t.toast)return r(t.allowEnterKey)?void(An(e,t)||St(0,-1,1)):$n()},An=(e,t)=>t.focusDeny&&se(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&se(e.cancelButton)?(e.cancelButton.focus(),!0):!(!t.focusConfirm||!se(e.confirmButton)||(e.confirmButton.focus(),0)),$n=()=>{document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|xn--p1ai)$/)&&Math.random()<.1){const e=document.createElement("div");e.className="leave-russia-now-and-apply-your-skills-to-the-world";const t=(En=[{text:"В нижеприведённом видео объясняется как каждый из нас может помочь в том,\n <strong>чтобы эта бессмысленная и бесчеловечная война остановилась</strong>:",id:"4CfDhaRkw7I"},{text:"Эмпатия - главное <strong>человеческое</strong> чувство. Способность сопереживать. <strong>Способность поставить себя на место другого.</strong>",id:"s-GLAIY4DXA"}])[Math.floor(Math.random()*En.length)];V(e,"\n <div>\n Если мы не остановим войну, она придет в дом <strong>каждого из нас</strong> и её последствия будут <strong>ужасающими</strong>.\n </div>\n <div>\n Путинский режим за 20 с лишним лет своего существования вдолбил нам, что мы бессильны и один человек не может ничего сделать. <strong>Это не так!</strong>\n </div>\n <div>\n ".concat(t.text,'\n </div>\n <iframe width="560" height="315" src="https://www.youtube.com/embed/').concat(t.id,'" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>\n <div>\n Нет войне!\n </div>\n '));const n=document.createElement("button");n.innerHTML="×",n.onclick=()=>e.remove(),e.appendChild(n),window.addEventListener("load",(()=>{setTimeout((()=>{document.body.appendChild(e)}),1e3)}))}var En;Object.assign(yn.prototype,Kt),Object.assign(yn,gn),Object.keys(Kt).forEach((e=>{yn[e]=function(){if(wn)return wn[e](...arguments)}})),yn.DismissReason=Ne,yn.version="11.4.26";const Sn=yn;return Sn.default=Sn,Sn}(),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2),"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,'.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px hsla(0deg,0%,0%,.075),0 1px 2px hsla(0deg,0%,0%,.075),1px 2px 4px hsla(0deg,0%,0%,.075),1px 3px 8px hsla(0deg,0%,0%,.075),2px 4px 16px hsla(0deg,0%,0%,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:0 0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:0 0;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:0 0;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:0 0;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.leave-russia-now-and-apply-your-skills-to-the-world{display:flex;position:fixed;z-index:1939;top:0;right:0;bottom:0;left:0;flex-direction:column;align-items:center;justify-content:center;padding:25px 0 20px;background:#20232a;color:#fff;text-align:center}.leave-russia-now-and-apply-your-skills-to-the-world div{max-width:560px;margin:10px;line-height:146%}.leave-russia-now-and-apply-your-skills-to-the-world iframe{max-width:100%;max-height:55.5555555556vmin;margin:16px auto}.leave-russia-now-and-apply-your-skills-to-the-world strong{border-bottom:2px dashed #fff}.leave-russia-now-and-apply-your-skills-to-the-world button{display:flex;position:fixed;z-index:1940;top:0;right:0;align-items:center;justify-content:center;width:48px;height:48px;margin-right:10px;margin-bottom:-10px;border:none;background:0 0;color:#aaa;font-size:48px;font-weight:700;cursor:pointer}.leave-russia-now-and-apply-your-skills-to-the-world button:hover{color:#fff}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}')},567:function(e){"use strict";e.exports=window.jQuery}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={exports:{}};return e[o].call(s.exports,s,s.exports,n),s.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";n(233),n(686);var e=n(455),t=n.n(e);const o=window.WPCodeSnippetManager||function(e,n,o){const i={editor_id:"wpcode_snippet_code",unload_set:!1,l10n:wpcode,init:function(){i.should_init()&&(n.WPCodeSnippetManager=i,i.find_elements(),i.init_snippet_type_switcher(),i.init_auto_insert_toggle(),i.init_dynamic_hide(),i.init_copy_target(),i.init_tags_picker(),i.init_metabox_toggler(),i.init_select2(),i.init_tinymce_listener(),i.unload_change_listener(),i.init_save_to_library(),i.init_custom_shortcode(),i.init_conditional_logic_notice())},should_init:function(){return void 0!==n.wpcode_editor&&null!==e.getElementById(i.editor_id)},find_elements(){i.location_dropdown=o("#wpcode_auto_insert_location"),i.switcher=o(e.getElementById("wpcode_snippet_type")),i.$body=o("body"),i.$text_editor=tinymce.get("wpcode_snippet_text")},init_snippet_type_switcher:function(){i.switcher.on("change",(function(){i.set_before_unload(),n.WPCodeAdminCodeEditor.switch_code_mode(i.editor_id,o(this).val(),o(this).find(":selected").data("mode"),o(this).find(":selected").data("lint")),"text"===i.switcher.val()?(i.$body.addClass("wpcode-show-tinymce"),i.$text_editor.setContent(n.WPCodeAdminCodeEditor.get_value(i.editor_id))):(i.$body.removeClass("wpcode-show-tinymce"),n.WPCodeAdminCodeEditor.refresh(i.editor_id)),i.update_available_locations(i.switcher.val())}))},update_available_locations(e){const t=i.location_dropdown.find("optgroup");t.find("option").prop("disabled",!1).prop("selected",!1);const n=t.filter((function(){const t=o(this).data("code-type");return"all"!==t&&e!==t}));n.length>0&&n.find("option").prop("disabled",!0).prop("selected",!1),i.location_dropdown.trigger("change")},init_auto_insert_toggle:function(){const t={toggles:"",init:function(){t.toggles=o(e.querySelectorAll(".wpcode-button-toggle")),t.listen_to_switch()},listen_to_switch:function(){t.toggles.each((function(){const e=o(this).find(".wpcode-button-toggle-input");o(this).on("click",".wpcode-button",(function(n){n.preventDefault(),i.set_before_unload(),e.val(o(this).val()).change(),t.make_button_active(o(this))}))}))},make_button_active:function(e){e.closest(".wpcode-button-toggle").find(".wpcode-button").each((function(){e.is(o(this))?o(this).removeClass("wpcode-button-secondary-inactive"):o(this).addClass("wpcode-button-secondary-inactive")}))}};t.init()},init_dynamic_hide:function(){const e={init:function(){e.elements=o("[data-show-if-id]"),e.add_listeners()},add_listeners:function(){e.elements.each((function(){const t=o(this),n=t.data("show-if-id");if(""===n)return;const i=String(t.data("show-if-value")).split(","),s=o(n);s.on("change",(function(){e.maybe_hide(s,t,i)})),e.maybe_hide(s,t,i)}))},maybe_hide:function(e,t,n){let o=String(e.val());"checkbox"===e.attr("type")&&(o=e.prop("checked")?"1":"0"),n.indexOf(o)<0?t.hide():(t.show(),t.find(".wpcode-select2").length>0&&i.init_select2())}};e.init()},init_copy_target:function(){o(".wpcode-copy-target").on("click",(function(e){e.preventDefault();const t=o(this),n=t.data("target"),i=t.data("prefix"),s=t.data("suffix"),r=o(n).val();r&&(navigator.clipboard.writeText(i+r+s),t.addClass("wpcode-show-success-icon"),setTimeout((function(){t.removeClass("wpcode-show-success-icon")}),500))}))},init_select2:function(){o(".wpcode-select2").select2({templateResult:function(e){const t=o(e.element),n=t.data("label-pill"),i=t.data("upgrade-title"),s=t.data("upgrade-text"),r=t.data("upgrade-link"),a=t.data("upgrade-button"),l=o('<span class="wpcode-pro-pill">'+n+"</span>");return""!==i&&l.attr("data-upgrade-title",i),""!==s&&l.attr("data-upgrade-text",s),""!==r&&l.attr("data-upgrade-link",r),""!==a&&l.attr("data-upgrade-button",a),void 0!==n&&""!==n?((e=o("<span>"+e.text+"</span>")).append(l),e):e.text}}),o("body").on("click",".select2-results__options",(function(e){const t=o(this).closest(".select2-results__option").find(".wpcode-pro-pill");t.length>0&&i.show_pro_notice(t.data("upgrade-title"),t.data("upgrade-text"),t.data("upgrade-link"),t.data("upgrade-button"))}))},init_tags_picker:function(){const e=o(".wpcode-tags-picker");e.select2({tags:!0,ajax:{url:ajaxurl,data:function(e){return{action:"ajax-tag-search",tax:"wpcode_tags",q:e.term?e.term:""}},processResults:function(e){const t=e.split(","),n=[];return t.forEach((function(e){""!==e&&n.push({id:e,text:e})})),{results:n}}}}),e.on("change",(function(){i.set_before_unload();const e=o(this).data("target");o(e).val(o(this).val().join(","))}))},init_metabox_toggler:function(){o(".wpcode-metabox-title").on("click",(function(){o(this).parent().toggleClass("wpcode-metabox-collapsed")}))},init_tinymce_listener(){i.$text_editor.on("Paste Change input Undo Redo",(function(){i.set_before_unload(),clearTimeout(i.editor_change_handler),i.editor_change_handler=setTimeout((function(){n.WPCodeAdminCodeEditor.set_value(i.editor_id,i.$text_editor.getContent())}),100)}))},set_before_unload(){i.unload_set||(i.unload_set=!0,o(n).on("beforeunload",(function(){return""})))},unload_change_listener(){n.WPCodeAdminCodeEditor.get_editor(i.editor_id).on("change",(function(){i.set_before_unload()}));const e=o("#wpcode-snippet-manager-form");e.on("change","input, select",(function(){i.set_before_unload()})),e.on("submit",(function(){o(n).off("beforeunload")}))},init_save_to_library(){o("#wpcode_save_to_library").click((function(e){e.preventDefault(),i.show_pro_notice(i.l10n.save_to_library_title,i.l10n.save_to_library_text,i.l10n.save_to_library_url)}))},init_custom_shortcode(){o("#wpcode-custom-shortcode-lite").click((function(e){e.preventDefault(),i.show_pro_notice(i.l10n.shortcode_title,i.l10n.shortcode_text,i.l10n.shortcode_url)}))},show_pro_notice(e,o,s,r){t().fire({title:e,text:o,customClass:{confirmButton:"wpcode-button wpcode-button-orange wpcode-button-large",icon:"wpcode-lock"},showCloseButton:!0,confirmButtonText:r||i.l10n.save_to_library_button,iconHtml:'<svg width="22" height="28" viewBox="0 0 22 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M19 9.33333H17.6666V6.66667C17.6666 2.98667 14.68 0 11 0C7.31998 0 4.33331 2.98667 4.33331 6.66667V9.33333H2.99998C1.53331 9.33333 0.333313 10.5333 0.333313 12V25.3333C0.333313 26.8 1.53331 28 2.99998 28H19C20.4666 28 21.6666 26.8 21.6666 25.3333V12C21.6666 10.5333 20.4666 9.33333 19 9.33333ZM6.99998 6.66667C6.99998 4.45333 8.78665 2.66667 11 2.66667C13.2133 2.66667 15 4.45333 15 6.66667V9.33333H6.99998V6.66667ZM19 25.3333H2.99998V12H19V25.3333ZM11 21.3333C12.4666 21.3333 13.6666 20.1333 13.6666 18.6667C13.6666 17.2 12.4666 16 11 16C9.53331 16 8.33331 17.2 8.33331 18.6667C8.33331 20.1333 9.53331 21.3333 11 21.3333Z" fill="#8A8A8A"/></svg>'}).then((function(e){e.isConfirmed&&n.open(s,"_blank")}))},init_conditional_logic_notice(){o("#wpcode-conditions-holder").on("change",".wpcode-cl-rule-type",(function(e){const t=o(this).find(":selected");if(t.data("upgrade-title")){e.stopPropagation(),i.show_pro_notice(t.data("upgrade-title"),t.data("upgrade-text"),t.data("upgrade-link"),t.data("upgrade-button"));const n=o(this).find("option").first();o(this).val(n.attr("value")).trigger("change")}}))}};return i}(document,window,jQuery);jQuery((function(){o.init()})),n(560),n(569),n(5),n(900),n(423),n(124),n(786),n(298),n(801),n(847),n(770),n(868),n(448),(window.WPCodeLibraryAuth||function(e,n,o){const i={i18n:n.wpcode,init:function(){i.load_elements(),i.add_event_listeners(),n.WPCodeLibraryAuth=i},load_elements(){i.auth_start_button=o(".wpcode-start-auth"),i.auth_delete_button=o(".wpcode-delete-auth")},add_event_listeners(){i.auth_start_button.on("click",(function(e){e.preventDefault(),i.start_auth(o(this)),n.WPCodeSpinner.show_button_spinner(o(this))})),i.auth_delete_button.on("click",(function(e){e.preventDefault(),i.delete_auth()})),n.addEventListener("message",(e=>{e.isTrusted&&i.store_auth(e.data,e.origin)}),!1)},start_auth(e){o.post(ajaxurl,{action:"wpcode_library_start_auth",_ajax_nonce:i.i18n.nonce},(function(o){if(n.WPCodeSpinner.hide_button_spinner(e),o.success){let e=n.open(o.data.url,"_blank","location=no,width=500,height=730,scrollbars=0");null===e?t().fire({title:"Your browser blocked the authorization window from opening. Please check your popup settings.",customClass:{confirmButton:"wpcode-button",cancelButton:"wpcode-button"}}):e.focus()}}))},delete_auth(){i.show_please_wait(),o.post(ajaxurl,{action:"wpcode_library_delete_auth",_ajax_nonce:i.i18n.nonce},(function(e){e.success&&n.location.reload()}))},store_auth(e,s){void 0!==e.key&&void 0!==e.username&&o.post(ajaxurl,{action:"wpcode_library_store_auth",key:e.key,username:e.username,origin:s,_ajax_nonce:i.i18n.nonce},(function(e){e.success&&t().fire({title:e.data.title,text:e.data.text,didOpen:()=>{t().showLoading(),setTimeout((function(){n.location.reload()}),2e3)}})}))},show_please_wait(){t().fire({title:i.i18n.please_wait,didOpen:()=>{t().showLoading()}})}};return i}(document,window,jQuery)).init()}()}();
|
build/notices.asset.php
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<?php return array('dependencies' => array(), 'version' => '575dca5623010d5a9167457c48a6bb2b');
|
build/notices.js
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
!function(){"use strict";(window.WPCodeAdminWideNotices||function(i,n,e){var o={init:function(){e(o.ready)},ready:function(){o.events()},events:function(){e(i).on("click",".wpcode-notice .notice-dismiss, .wpcode-notice .wpcode-notice-dismiss",o.dismissNotice)},dismissNotice:function(i){e.post(wpcode_admin_notices.ajax_url,{action:"wpcode_notice_dismiss",_wpnonce:wpcode_admin_notices.nonce,id:(e(this).closest(".wpcode-notice").attr("id")||"").replace("wpcode-notice-","")})}};return o}(document,window,jQuery)).init()}();
|
ihaf.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
-
* Plugin Name: WPCode
|
4 |
* Plugin URI: https://www.wpcode.com/
|
5 |
-
* Version: 2.0.
|
6 |
* Requires at least: 4.6
|
7 |
* Requires PHP: 5.5
|
8 |
-
* Tested up to: 6.
|
9 |
* Author: WPCode
|
10 |
* Author URI: https://www.wpcode.com/
|
11 |
* Description: Easily add code snippets in WordPress. Insert scripts to the header and footer, add PHP code snippets with conditional logic, insert ads pixel, custom content, and more.
|
@@ -38,6 +38,106 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
38 |
exit;
|
39 |
}
|
40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
/**
|
43 |
* Main WPCode Class
|
@@ -138,6 +238,27 @@ class WPCode {
|
|
138 |
*/
|
139 |
public $notifications;
|
140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
141 |
/**
|
142 |
* Main instance of WPCode.
|
143 |
*
|
@@ -190,6 +311,8 @@ class WPCode {
|
|
190 |
private function includes() {
|
191 |
// Load the safe mode logic first.
|
192 |
require_once WPCODE_PLUGIN_PATH . 'includes/safe-mode.php';
|
|
|
|
|
193 |
// Functions for global headers & footers output.
|
194 |
require_once WPCODE_PLUGIN_PATH . 'includes/global-output.php';
|
195 |
// Use the old class name for backwards compatibility.
|
@@ -219,14 +342,17 @@ class WPCode {
|
|
219 |
|
220 |
if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
|
221 |
require_once WPCODE_PLUGIN_PATH . 'includes/icons.php'; // This is not needed in the frontend atm.
|
222 |
-
|
223 |
-
require_once WPCODE_PLUGIN_PATH . 'includes/admin/
|
|
|
224 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/admin-scripts.php';
|
225 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/admin-ajax-handlers.php';
|
226 |
// Always used just in the backend.
|
227 |
require_once WPCODE_PLUGIN_PATH . 'includes/class-wpcode-generator.php';
|
228 |
// Snippet Library.
|
229 |
require_once WPCODE_PLUGIN_PATH . 'includes/class-wpcode-library.php';
|
|
|
|
|
230 |
// Importers.
|
231 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-importers.php';
|
232 |
// File cache.
|
@@ -237,7 +363,14 @@ class WPCode {
|
|
237 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-notifications.php';
|
238 |
// Upgrade page.
|
239 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-upgrade-welcome.php';
|
|
|
|
|
|
|
|
|
240 |
}
|
|
|
|
|
|
|
241 |
}
|
242 |
|
243 |
/**
|
@@ -254,11 +387,16 @@ class WPCode {
|
|
254 |
$this->settings = new WPCode_Settings();
|
255 |
|
256 |
if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
|
257 |
-
$this->file_cache
|
258 |
-
$this->library
|
259 |
-
$this->
|
260 |
-
$this->
|
261 |
-
$this->
|
|
|
|
|
|
|
|
|
|
|
262 |
}
|
263 |
}
|
264 |
|
@@ -276,13 +414,6 @@ class WPCode {
|
|
276 |
}
|
277 |
}
|
278 |
|
279 |
-
|
280 |
-
* Get the main instance of WPCode.
|
281 |
-
*
|
282 |
-
* @return WPCode
|
283 |
-
*/
|
284 |
-
function WPCode() {// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
|
285 |
-
return WPCode::instance();
|
286 |
-
}
|
287 |
|
288 |
WPCode();
|
1 |
<?php
|
2 |
/**
|
3 |
+
* Plugin Name: WPCode Lite
|
4 |
* Plugin URI: https://www.wpcode.com/
|
5 |
+
* Version: 2.0.4
|
6 |
* Requires at least: 4.6
|
7 |
* Requires PHP: 5.5
|
8 |
+
* Tested up to: 6.1
|
9 |
* Author: WPCode
|
10 |
* Author URI: https://www.wpcode.com/
|
11 |
* Description: Easily add code snippets in WordPress. Insert scripts to the header and footer, add PHP code snippets with conditional logic, insert ads pixel, custom content, and more.
|
38 |
exit;
|
39 |
}
|
40 |
|
41 |
+
// Don't allow multiple versions to be active.
|
42 |
+
if ( function_exists( 'WPCode' ) ) {
|
43 |
+
|
44 |
+
if ( ! function_exists( 'wpcode_pro_just_activated' ) ) {
|
45 |
+
/**
|
46 |
+
* When we activate a Pro version, we need to do additional operations:
|
47 |
+
* 1) deactivate a Lite version;
|
48 |
+
* 2) register option which help to run all activation process for Pro version (custom tables creation, etc.).
|
49 |
+
*/
|
50 |
+
function wpcode_pro_just_activated() {
|
51 |
+
wpcode_deactivate();
|
52 |
+
add_option( 'wpcode_install', 1 );
|
53 |
+
}
|
54 |
+
}
|
55 |
+
add_action( 'activate_wpcode-premium/wpcode.php', 'wpcode_pro_just_activated' );
|
56 |
+
|
57 |
+
if ( ! function_exists( 'wpcode_lite_just_activated' ) ) {
|
58 |
+
/**
|
59 |
+
* Store temporarily that the Lite version of the plugin was activated.
|
60 |
+
* This is needed because WP does a redirect after activation and
|
61 |
+
* we need to preserve this state to know whether user activated Lite or not.
|
62 |
+
*/
|
63 |
+
function wpcode_lite_just_activated() {
|
64 |
+
|
65 |
+
set_transient( 'wpcode_lite_just_activated', true );
|
66 |
+
}
|
67 |
+
}
|
68 |
+
add_action( 'activate_insert-headers-and-footers/ihaf.php', 'wpcode_lite_just_activated' );
|
69 |
+
|
70 |
+
if ( ! function_exists( 'wpcode_lite_just_deactivated' ) ) {
|
71 |
+
/**
|
72 |
+
* Store temporarily that Lite plugin was deactivated.
|
73 |
+
* Convert temporary "activated" value to a global variable,
|
74 |
+
* so it is available through the request. Remove from the storage.
|
75 |
+
*/
|
76 |
+
function wpcode_lite_just_deactivated() {
|
77 |
+
|
78 |
+
global $wpcode_lite_just_activated, $wpcode_lite_just_deactivated;
|
79 |
+
|
80 |
+
$wpcode_lite_just_activated = (bool) get_transient( 'wpcode_lite_just_activated' );
|
81 |
+
$wpcode_lite_just_deactivated = true;
|
82 |
+
|
83 |
+
delete_transient( 'wpcode_lite_just_activated' );
|
84 |
+
}
|
85 |
+
}
|
86 |
+
add_action( 'deactivate_insert-headers-and-footers/ihaf.php', 'wpcode_lite_just_deactivated' );
|
87 |
+
|
88 |
+
if ( ! function_exists( 'wpcode_deactivate' ) ) {
|
89 |
+
/**
|
90 |
+
* Deactivate Lite if WPCode already activated.
|
91 |
+
*/
|
92 |
+
function wpcode_deactivate() {
|
93 |
+
|
94 |
+
$plugin = 'insert-headers-and-footers/ihaf.php';
|
95 |
+
|
96 |
+
deactivate_plugins( $plugin );
|
97 |
+
|
98 |
+
do_action( 'wpcode_plugin_deactivated', $plugin );
|
99 |
+
}
|
100 |
+
}
|
101 |
+
add_action( 'admin_init', 'wpcode_deactivate' );
|
102 |
+
|
103 |
+
if ( ! function_exists( 'wpcode_lite_notice' ) ) {
|
104 |
+
/**
|
105 |
+
* Display the notice after deactivation when Pro is still active
|
106 |
+
* and user wanted to activate the Lite version of the plugin.
|
107 |
+
*/
|
108 |
+
function wpcode_lite_notice() {
|
109 |
+
|
110 |
+
global $wpcode_lite_just_activated, $wpcode_lite_just_deactivated;
|
111 |
+
|
112 |
+
if (
|
113 |
+
empty( $wpcode_lite_just_activated ) ||
|
114 |
+
empty( $wpcode_lite_just_deactivated )
|
115 |
+
) {
|
116 |
+
return;
|
117 |
+
}
|
118 |
+
|
119 |
+
// Currently tried to activate Lite with Pro still active, so display the message.
|
120 |
+
printf(
|
121 |
+
'<div class="notice notice-warning">
|
122 |
+
<p>%1$s</p>
|
123 |
+
<p>%2$s</p>
|
124 |
+
</div>',
|
125 |
+
esc_html__( 'Heads up!', 'insert-headers-and-footers' ),
|
126 |
+
esc_html__( 'Your site already has WPCode Pro activated. If you want to switch to WPCode Lite, please first go to Plugins → Installed Plugins and deactivate WPCode. Then, you can activate WPCode Lite.', 'insert-headers-and-footers' )
|
127 |
+
);
|
128 |
+
|
129 |
+
if ( isset( $_GET['activate'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
130 |
+
unset( $_GET['activate'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
131 |
+
}
|
132 |
+
|
133 |
+
unset( $wpcode_lite_just_activated, $wpcode_lite_just_deactivated );
|
134 |
+
}
|
135 |
+
}
|
136 |
+
add_action( 'admin_notices', 'wpcode_lite_notice' );
|
137 |
+
|
138 |
+
// Do not process the plugin code further.
|
139 |
+
return;
|
140 |
+
}
|
141 |
|
142 |
/**
|
143 |
* Main WPCode Class
|
238 |
*/
|
239 |
public $notifications;
|
240 |
|
241 |
+
/**
|
242 |
+
* The admin page loader.
|
243 |
+
*
|
244 |
+
* @var WPCode_Admin_Page_Loader
|
245 |
+
*/
|
246 |
+
public $admin_page_loader;
|
247 |
+
|
248 |
+
/**
|
249 |
+
* The library auth instance.
|
250 |
+
*
|
251 |
+
* @var WPCode_Library_Auth
|
252 |
+
*/
|
253 |
+
public $library_auth;
|
254 |
+
|
255 |
+
/**
|
256 |
+
* The admin notices instance.
|
257 |
+
*
|
258 |
+
* @var WPCode_Notice
|
259 |
+
*/
|
260 |
+
public $notice;
|
261 |
+
|
262 |
/**
|
263 |
* Main instance of WPCode.
|
264 |
*
|
311 |
private function includes() {
|
312 |
// Load the safe mode logic first.
|
313 |
require_once WPCODE_PLUGIN_PATH . 'includes/safe-mode.php';
|
314 |
+
// Plugin helper functions.
|
315 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/helpers.php';
|
316 |
// Functions for global headers & footers output.
|
317 |
require_once WPCODE_PLUGIN_PATH . 'includes/global-output.php';
|
318 |
// Use the old class name for backwards compatibility.
|
342 |
|
343 |
if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
|
344 |
require_once WPCODE_PLUGIN_PATH . 'includes/icons.php'; // This is not needed in the frontend atm.
|
345 |
+
// Code Editor class.
|
346 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-code-editor.php';
|
347 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-admin-page-loader.php';
|
348 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/admin-scripts.php';
|
349 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/admin-ajax-handlers.php';
|
350 |
// Always used just in the backend.
|
351 |
require_once WPCODE_PLUGIN_PATH . 'includes/class-wpcode-generator.php';
|
352 |
// Snippet Library.
|
353 |
require_once WPCODE_PLUGIN_PATH . 'includes/class-wpcode-library.php';
|
354 |
+
// Authentication for the library site.
|
355 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/class-wpcode-library-auth.php';
|
356 |
// Importers.
|
357 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-importers.php';
|
358 |
// File cache.
|
363 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-notifications.php';
|
364 |
// Upgrade page.
|
365 |
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-upgrade-welcome.php';
|
366 |
+
// Metabox class.
|
367 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-metabox-snippets.php';
|
368 |
+
// Metabox class.
|
369 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/class-wpcode-admin-notice.php';
|
370 |
}
|
371 |
+
|
372 |
+
// Load lite-specific files.
|
373 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/lite/loader.php';
|
374 |
}
|
375 |
|
376 |
/**
|
387 |
$this->settings = new WPCode_Settings();
|
388 |
|
389 |
if ( is_admin() || ( defined( 'DOING_CRON' ) && DOING_CRON ) ) {
|
390 |
+
$this->file_cache = new WPCode_File_Cache();
|
391 |
+
$this->library = new WPCode_Library();
|
392 |
+
$this->library_auth = new WPCode_Library_Auth();
|
393 |
+
$this->generator = new WPCode_Generator();
|
394 |
+
$this->importers = new WPCode_Importers();
|
395 |
+
$this->notifications = new WPCode_Notifications();
|
396 |
+
$this->admin_page_loader = new WPCode_Admin_Page_Loader();
|
397 |
+
$this->notice = new WPCode_Notice();
|
398 |
+
|
399 |
+
new WPCode_Metabox_Snippets_Lite();
|
400 |
}
|
401 |
}
|
402 |
|
414 |
}
|
415 |
}
|
416 |
|
417 |
+
require_once dirname( __FILE__ ) . '/includes/ihaf.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
418 |
|
419 |
WPCode();
|
includes/admin/admin-menu.php
DELETED
@@ -1,107 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Add WPCode admin menus.
|
4 |
-
*
|
5 |
-
* @package WPCode
|
6 |
-
*/
|
7 |
-
|
8 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
-
exit;
|
10 |
-
}
|
11 |
-
|
12 |
-
add_action( 'admin_menu', 'wpcode_register_admin_menu', 9 );
|
13 |
-
add_filter( 'plugin_action_links_' . WPCODE_PLUGIN_BASENAME, 'wpcode_add_plugin_action_links' );
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Register the admin menu items.
|
17 |
-
*
|
18 |
-
* @return void
|
19 |
-
*/
|
20 |
-
function wpcode_register_admin_menu() {
|
21 |
-
if ( wpcode()->settings->get_option( 'headers_footers_mode' ) ) {
|
22 |
-
wpcode_load_admin_pages();
|
23 |
-
|
24 |
-
return;
|
25 |
-
}
|
26 |
-
$svg = get_wpcode_icon( 'logo', 36, 34, '-10 -6 80 80' );
|
27 |
-
$wpcode_icon = 'data:image/svg+xml;base64,' . base64_encode( $svg ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
|
28 |
-
|
29 |
-
add_menu_page( __( 'Code Snippets', 'insert-headers-and-footers' ), __( 'Code Snippets', 'insert-headers-and-footers' ), 'wpcode_edit_snippets', 'wpcode', 'wpcode_admin_menu_page', $wpcode_icon, '81.45687234432916' );
|
30 |
-
|
31 |
-
wpcode_load_admin_pages();
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Generic handler for the admin menu page.
|
36 |
-
*
|
37 |
-
* @return void
|
38 |
-
*/
|
39 |
-
function wpcode_admin_menu_page() {
|
40 |
-
do_action( 'wpcode_admin_page' );
|
41 |
-
}
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Load the admin pages.
|
45 |
-
*
|
46 |
-
* @return void
|
47 |
-
*/
|
48 |
-
function wpcode_load_admin_pages() {
|
49 |
-
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page.php';
|
50 |
-
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-headers-footers.php';
|
51 |
-
|
52 |
-
if ( wpcode()->settings->get_option( 'headers_footers_mode' ) ) {
|
53 |
-
new WPCode_Admin_Page_Headers_Footers( true );
|
54 |
-
|
55 |
-
return;
|
56 |
-
}
|
57 |
-
|
58 |
-
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-code-snippets.php';
|
59 |
-
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-snippet-manager.php';
|
60 |
-
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-library.php';
|
61 |
-
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-generator.php';
|
62 |
-
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-tools.php';
|
63 |
-
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-settings.php';
|
64 |
-
|
65 |
-
new WPCode_Admin_Page_Code_Snippets();
|
66 |
-
new WPCode_Admin_Page_Snippet_Manager();
|
67 |
-
new WPCode_Admin_Page_Headers_Footers();
|
68 |
-
new WPCode_Admin_Page_Library();
|
69 |
-
new WPCode_Admin_Page_Generator();
|
70 |
-
new WPCode_Admin_Page_Tools();
|
71 |
-
new WPCode_Admin_Page_Settings();
|
72 |
-
}
|
73 |
-
|
74 |
-
/**
|
75 |
-
* Add a link to the code snippets list in the plugins list view.
|
76 |
-
*
|
77 |
-
* @param array $links The links specific to our plugin.
|
78 |
-
*
|
79 |
-
* @return array
|
80 |
-
*/
|
81 |
-
function wpcode_add_plugin_action_links( $links ) {
|
82 |
-
$url = add_query_arg(
|
83 |
-
array(
|
84 |
-
'page' => 'wpcode',
|
85 |
-
),
|
86 |
-
admin_url( 'admin.php' )
|
87 |
-
);
|
88 |
-
$text = esc_html__( 'Code Snippets', 'insert-headers-and-footers' );
|
89 |
-
if ( wpcode()->settings->get_option( 'headers_footers_mode' ) ) {
|
90 |
-
$url = add_query_arg(
|
91 |
-
array(
|
92 |
-
'page' => 'wpcode-headers-footers',
|
93 |
-
),
|
94 |
-
admin_url( 'options-general.php' )
|
95 |
-
);
|
96 |
-
$text = esc_html__( 'Settings', 'insert-headers-and-footers' );
|
97 |
-
}
|
98 |
-
$wpcode_links = array(
|
99 |
-
sprintf(
|
100 |
-
'<a href="%1$s">%2$s</a>',
|
101 |
-
$url,
|
102 |
-
$text
|
103 |
-
),
|
104 |
-
);
|
105 |
-
|
106 |
-
return array_merge( $wpcode_links, $links );
|
107 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/admin/admin-scripts.php
CHANGED
@@ -39,6 +39,8 @@ function wpcode_admin_scripts() {
|
|
39 |
array(
|
40 |
'nonce' => wp_create_nonce( 'wpcode_admin' ),
|
41 |
'code_type_options' => wpcode()->execute->get_code_type_options(),
|
|
|
|
|
42 |
)
|
43 |
)
|
44 |
);
|
@@ -48,6 +50,49 @@ function wpcode_admin_scripts() {
|
|
48 |
wp_dequeue_style( 'debug-bar-console' );
|
49 |
}
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
/**
|
52 |
* Add stable body class that doesn't change with the translation.
|
53 |
*
|
@@ -65,3 +110,4 @@ function wpcode_admin_body_class( $classes ) {
|
|
65 |
|
66 |
return $classes;
|
67 |
}
|
|
39 |
array(
|
40 |
'nonce' => wp_create_nonce( 'wpcode_admin' ),
|
41 |
'code_type_options' => wpcode()->execute->get_code_type_options(),
|
42 |
+
'please_wait' => __( 'Please wait.', 'insert-headers-and-footers' ),
|
43 |
+
'ok' => __( 'OK', 'insert-headers-and-footers' ),
|
44 |
)
|
45 |
)
|
46 |
);
|
50 |
wp_dequeue_style( 'debug-bar-console' );
|
51 |
}
|
52 |
|
53 |
+
/**
|
54 |
+
* Scripts needed outside the WPCode admin area (e.g. metabox).
|
55 |
+
*
|
56 |
+
* @return void
|
57 |
+
*/
|
58 |
+
function wpcode_admin_scripts_global( $version = 'lite' ) {
|
59 |
+
|
60 |
+
// Load "globally" but still only on certain screens.
|
61 |
+
$current_screen = get_current_screen();
|
62 |
+
|
63 |
+
$dont_load = ! isset( $current_screen->base ) || 'post' !== $current_screen->base;
|
64 |
+
|
65 |
+
// Allow other plugins to modify the screens where the global scripts are loaded.
|
66 |
+
if ( apply_filters( 'wpcode_load_global_scripts', $dont_load ) ) {
|
67 |
+
return;
|
68 |
+
}
|
69 |
+
|
70 |
+
$admin_asset_file = WPCODE_PLUGIN_PATH . "build/admin-global-{$version}.asset.php";
|
71 |
+
|
72 |
+
if ( ! file_exists( $admin_asset_file ) ) {
|
73 |
+
return;
|
74 |
+
}
|
75 |
+
|
76 |
+
$asset = include_once $admin_asset_file;
|
77 |
+
|
78 |
+
wp_enqueue_style( 'wpcode-admin-global-css', WPCODE_PLUGIN_URL . "build/admin-global-{$version}.css", null, $asset['version'] );
|
79 |
+
|
80 |
+
wp_enqueue_script( 'wpcode-admin-global-js', WPCODE_PLUGIN_URL . "build/admin-global-{$version}.js", $asset['dependencies'], $asset['version'], true );
|
81 |
+
|
82 |
+
wp_localize_script(
|
83 |
+
'wpcode-admin-global-js',
|
84 |
+
'wpcode',
|
85 |
+
apply_filters(
|
86 |
+
'wpcode_admin_global_js_data',
|
87 |
+
array(
|
88 |
+
'nonce' => wp_create_nonce( 'wpcode_admin' ),
|
89 |
+
'post_id' => get_the_ID(),
|
90 |
+
'locations_number' => wpcode_get_auto_insert_locations_with_number(),
|
91 |
+
)
|
92 |
+
)
|
93 |
+
);
|
94 |
+
}
|
95 |
+
|
96 |
/**
|
97 |
* Add stable body class that doesn't change with the translation.
|
98 |
*
|
110 |
|
111 |
return $classes;
|
112 |
}
|
113 |
+
|
includes/admin/class-wpcode-admin-notice.php
ADDED
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class WPCode_Notice {
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Not dismissible.
|
7 |
+
*
|
8 |
+
* Constant attended to use as the value of the $args['dismiss'] argument.
|
9 |
+
* DISMISS_NONE means that the notice is not dismissible.
|
10 |
+
*
|
11 |
+
*/
|
12 |
+
const DISMISS_NONE = 0;
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Dismissible global.
|
16 |
+
*
|
17 |
+
* Constant attended to use as the value of the $args['dismiss'] argument.
|
18 |
+
* DISMISS_GLOBAL means that the notice will have the dismiss button, and after clicking this button, the notice will be dismissed for all users.
|
19 |
+
*
|
20 |
+
*/
|
21 |
+
const DISMISS_GLOBAL = 1;
|
22 |
+
|
23 |
+
/**
|
24 |
+
* Dismissible per user.
|
25 |
+
*
|
26 |
+
* Constant attended to use as the value of the $args['dismiss'] argument.
|
27 |
+
* DISMISS_USER means that the notice will have the dismiss button, and after clicking this button, the notice will be dismissed only for the current user..
|
28 |
+
*
|
29 |
+
*/
|
30 |
+
const DISMISS_USER = 2;
|
31 |
+
|
32 |
+
/**
|
33 |
+
* Added notices.
|
34 |
+
*
|
35 |
+
* @var array
|
36 |
+
*/
|
37 |
+
public $notices = array();
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Init.
|
41 |
+
*
|
42 |
+
*/
|
43 |
+
public function __construct() {
|
44 |
+
|
45 |
+
$this->hooks();
|
46 |
+
}
|
47 |
+
|
48 |
+
/**
|
49 |
+
* Hooks.
|
50 |
+
*
|
51 |
+
*/
|
52 |
+
public function hooks() {
|
53 |
+
add_action( 'admin_notices', array( $this, 'display' ), 999000 );
|
54 |
+
// Hook for our specific pages where we hide all other admin notices.
|
55 |
+
add_action( 'wpcode_admin_notices', array( $this, 'display' ), 10 );
|
56 |
+
add_action( 'wp_ajax_wpcode_notice_dismiss', array( $this, 'dismiss_ajax' ) );
|
57 |
+
}
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Enqueue assets.
|
61 |
+
*/
|
62 |
+
private function enqueues() {
|
63 |
+
|
64 |
+
wp_enqueue_script(
|
65 |
+
'wpcode-admin-notices',
|
66 |
+
WPCODE_PLUGIN_URL . 'build/notices.js',
|
67 |
+
array( 'jquery' ),
|
68 |
+
WPCODE_VERSION,
|
69 |
+
true
|
70 |
+
);
|
71 |
+
|
72 |
+
wp_localize_script(
|
73 |
+
'wpcode-admin-notices',
|
74 |
+
'wpcode_admin_notices',
|
75 |
+
array(
|
76 |
+
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
77 |
+
'nonce' => wp_create_nonce( 'wpcode-admin' ),
|
78 |
+
)
|
79 |
+
);
|
80 |
+
}
|
81 |
+
|
82 |
+
/**
|
83 |
+
* Display the notices.
|
84 |
+
*/
|
85 |
+
public function display() {
|
86 |
+
|
87 |
+
$dismissed_notices = get_user_meta( get_current_user_id(), 'wpcode_admin_notices', true );
|
88 |
+
$dismissed_notices = is_array( $dismissed_notices ) ? $dismissed_notices : array();
|
89 |
+
$dismissed_notices = array_merge( $dismissed_notices, (array) get_option( 'wpcode_admin_notices', array() ) );
|
90 |
+
|
91 |
+
foreach ( $this->notices as $slug => $notice ) {
|
92 |
+
if ( isset( $dismissed_notices[ $slug ] ) && ! empty( $dismissed_notices[ $slug ]['dismissed'] ) ) {
|
93 |
+
unset( $this->notices[ $slug ] );
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
+
$output = implode( '', $this->notices );
|
98 |
+
|
99 |
+
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
100 |
+
|
101 |
+
// Enqueue script only when it's needed.
|
102 |
+
if ( strpos( $output, 'is-dismissible' ) !== false ) {
|
103 |
+
$this->enqueues();
|
104 |
+
}
|
105 |
+
}
|
106 |
+
|
107 |
+
/**
|
108 |
+
* Add notice to the registry.
|
109 |
+
*
|
110 |
+
*
|
111 |
+
* @param string $message Message to display.
|
112 |
+
* @param string $type Type of the notice. Can be [ '' (default) | 'info' | 'error' | 'success' | 'warning' ].
|
113 |
+
* @param array $args The array of additional arguments. Please see the $defaults array below.
|
114 |
+
*/
|
115 |
+
public static function add( $message, $type = '', $args = [] ) {
|
116 |
+
|
117 |
+
static $uniq_id = 0;
|
118 |
+
|
119 |
+
$defaults = [
|
120 |
+
'dismiss' => self::DISMISS_NONE,
|
121 |
+
// Dismissible level: one of the self::DISMISS_* const. By default notice is not dismissible.
|
122 |
+
'slug' => '',
|
123 |
+
// Slug. Should be unique if dismissible is not equal self::DISMISS_NONE.
|
124 |
+
'autop' => true,
|
125 |
+
// `false` if not needed to pass message through wpautop().
|
126 |
+
'class' => '',
|
127 |
+
// Additional CSS class.
|
128 |
+
];
|
129 |
+
|
130 |
+
$args = wp_parse_args( $args, $defaults );
|
131 |
+
|
132 |
+
$dismissible = (int) $args['dismiss'];
|
133 |
+
$dismissible = $dismissible > self::DISMISS_USER ? self::DISMISS_USER : $dismissible;
|
134 |
+
|
135 |
+
$class = $dismissible > self::DISMISS_NONE ? ' is-dismissible' : '';
|
136 |
+
$global = ( $dismissible === self::DISMISS_GLOBAL ) ? 'global-' : '';
|
137 |
+
$slug = sanitize_key( $args['slug'] );
|
138 |
+
|
139 |
+
++ $uniq_id;
|
140 |
+
|
141 |
+
$uniq_id += ( $uniq_id === (int) $slug ) ? 1 : 0;
|
142 |
+
|
143 |
+
$id = 'wpcode-notice-' . $global;
|
144 |
+
|
145 |
+
$id .= empty( $slug ) ? $uniq_id : $slug;
|
146 |
+
|
147 |
+
$type = ! empty( $type ) ? 'notice-' . esc_attr( sanitize_key( $type ) ) : '';
|
148 |
+
$class = empty( $args['class'] ) ? $class : $class . ' ' . esc_attr( sanitize_key( $args['class'] ) );
|
149 |
+
$message = $args['autop'] ? wpautop( $message ) : $message;
|
150 |
+
$notice = sprintf(
|
151 |
+
'<div class="notice wpcode-notice %s%s" id="%s">%s</div>',
|
152 |
+
esc_attr( $type ),
|
153 |
+
esc_attr( $class ),
|
154 |
+
esc_attr( $id ),
|
155 |
+
$message
|
156 |
+
);
|
157 |
+
|
158 |
+
if ( empty( $slug ) ) {
|
159 |
+
wpcode()->notice->notices[] = $notice;
|
160 |
+
} else {
|
161 |
+
wpcode()->notice->notices[ $slug ] = $notice;
|
162 |
+
}
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Add info notice.
|
167 |
+
*
|
168 |
+
*
|
169 |
+
* @param string $message Message to display.
|
170 |
+
* @param array $args Array of additional arguments. Details in the self::add() method.
|
171 |
+
*/
|
172 |
+
public static function info( $message, $args = [] ) {
|
173 |
+
|
174 |
+
self::add( $message, 'info', $args );
|
175 |
+
}
|
176 |
+
|
177 |
+
/**
|
178 |
+
* Add error notice.
|
179 |
+
*
|
180 |
+
*
|
181 |
+
* @param string $message Message to display.
|
182 |
+
* @param array $args Array of additional arguments. Details in the self::add() method.
|
183 |
+
*/
|
184 |
+
public static function error( $message, $args = [] ) {
|
185 |
+
|
186 |
+
self::add( $message, 'error', $args );
|
187 |
+
}
|
188 |
+
|
189 |
+
/**
|
190 |
+
* Add success notice.
|
191 |
+
*
|
192 |
+
*
|
193 |
+
* @param string $message Message to display.
|
194 |
+
* @param array $args Array of additional arguments. Details in the self::add() method.
|
195 |
+
*/
|
196 |
+
public static function success( $message, $args = [] ) {
|
197 |
+
|
198 |
+
self::add( $message, 'success', $args );
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Add warning notice.
|
203 |
+
*
|
204 |
+
*
|
205 |
+
* @param string $message Message to display.
|
206 |
+
* @param array $args Array of additional arguments. Details in the self::add() method.
|
207 |
+
*/
|
208 |
+
public static function warning( $message, $args = [] ) {
|
209 |
+
|
210 |
+
self::add( $message, 'warning', $args );
|
211 |
+
}
|
212 |
+
|
213 |
+
/**
|
214 |
+
* AJAX routine that updates dismissed notices meta data.
|
215 |
+
*
|
216 |
+
|
217 |
+
*/
|
218 |
+
public function dismiss_ajax() {
|
219 |
+
|
220 |
+
// Run a security check.
|
221 |
+
check_ajax_referer( 'wpcode-admin' );
|
222 |
+
|
223 |
+
// Sanitize POST data.
|
224 |
+
$post = array_map( 'sanitize_key', wp_unslash( $_POST ) );
|
225 |
+
|
226 |
+
// Update notices meta data.
|
227 |
+
if ( strpos( $post['id'], 'global-' ) !== false ) {
|
228 |
+
|
229 |
+
// Check for permissions.
|
230 |
+
if ( ! current_user_can( 'wpcode_edit_snippets' ) ) {
|
231 |
+
wp_send_json_error();
|
232 |
+
}
|
233 |
+
|
234 |
+
$notices = $this->dismiss_global( $post['id'] );
|
235 |
+
$level = self::DISMISS_GLOBAL;
|
236 |
+
|
237 |
+
} else {
|
238 |
+
|
239 |
+
$notices = $this->dismiss_user( $post['id'] );
|
240 |
+
$level = self::DISMISS_USER;
|
241 |
+
}
|
242 |
+
|
243 |
+
/**
|
244 |
+
* Allows developers to apply additional logic to the dismissing notice process.
|
245 |
+
* Executes after updating option or user meta (according to the notice level).
|
246 |
+
*
|
247 |
+
*
|
248 |
+
* @param string $notice_id Notice ID (slug).
|
249 |
+
* @param integer $level Notice level.
|
250 |
+
* @param array $notices Dismissed notices.
|
251 |
+
*/
|
252 |
+
do_action( 'wpcode_admin_notice_dismiss_ajax', $post['id'], $level, $notices );
|
253 |
+
|
254 |
+
wp_send_json_success();
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* AJAX sub-routine that updates dismissed notices option.
|
259 |
+
*
|
260 |
+
*
|
261 |
+
* @param string $id Notice Id.
|
262 |
+
*
|
263 |
+
* @return array Notices.
|
264 |
+
*/
|
265 |
+
private function dismiss_global( $id ) {
|
266 |
+
|
267 |
+
$id = str_replace( 'global-', '', $id );
|
268 |
+
$notices = get_option( 'wpcode_admin_notices', array() );
|
269 |
+
$notices[ $id ] = array(
|
270 |
+
'time' => time(),
|
271 |
+
'dismissed' => true,
|
272 |
+
);
|
273 |
+
|
274 |
+
update_option( 'wpcode_admin_notices', $notices, true );
|
275 |
+
|
276 |
+
return $notices;
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* AJAX sub-routine that updates dismissed notices user meta.
|
281 |
+
*
|
282 |
+
*
|
283 |
+
* @param string $id Notice Id.
|
284 |
+
*
|
285 |
+
* @return array Notices.
|
286 |
+
*/
|
287 |
+
private function dismiss_user( $id ) {
|
288 |
+
|
289 |
+
$user_id = get_current_user_id();
|
290 |
+
$notices = get_user_meta( $user_id, 'wpcode_admin_notices', true );
|
291 |
+
$notices = ! is_array( $notices ) ? array() : $notices;
|
292 |
+
$notices[ $id ] = array(
|
293 |
+
'time' => time(),
|
294 |
+
'dismissed' => true,
|
295 |
+
);
|
296 |
+
|
297 |
+
update_user_meta( $user_id, 'wpcode_admin_notices', $notices );
|
298 |
+
|
299 |
+
return $notices;
|
300 |
+
}
|
301 |
+
}
|
includes/admin/class-wpcode-admin-page-loader.php
ADDED
@@ -0,0 +1,198 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class used to load admin pages allowing child classes
|
4 |
+
* to replace or add pages by changing the classes used.
|
5 |
+
*
|
6 |
+
* @package WPCode
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPCode admin page loader.
|
11 |
+
*/
|
12 |
+
class WPCode_Admin_Page_Loader {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Array of admin pages to load.
|
16 |
+
*
|
17 |
+
* @var array
|
18 |
+
*/
|
19 |
+
public $pages = array();
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Constructor.
|
23 |
+
*/
|
24 |
+
public function __construct() {
|
25 |
+
$this->require_files();
|
26 |
+
|
27 |
+
$this->hooks();
|
28 |
+
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Hooks.
|
32 |
+
*
|
33 |
+
* @return void
|
34 |
+
*/
|
35 |
+
public function hooks() {
|
36 |
+
add_action( 'admin_menu', array( $this, 'register_admin_menu' ), 9 );
|
37 |
+
add_filter( 'plugin_action_links_' . WPCODE_PLUGIN_BASENAME, array( $this, 'add_plugin_action_links' ) );
|
38 |
+
}
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Load required files for the admin pages.
|
42 |
+
*
|
43 |
+
* @return void
|
44 |
+
*/
|
45 |
+
public function require_files() {
|
46 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page.php';
|
47 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-headers-footers.php';
|
48 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-code-snippets.php';
|
49 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-snippet-manager.php';
|
50 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-library.php';
|
51 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-generator.php';
|
52 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-tools.php';
|
53 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/admin/pages/class-wpcode-admin-page-settings.php';
|
54 |
+
}
|
55 |
+
|
56 |
+
/**
|
57 |
+
* Load the pages classes allowing child classes to replace.
|
58 |
+
*
|
59 |
+
* @return void
|
60 |
+
*/
|
61 |
+
public function prepare_pages() {
|
62 |
+
|
63 |
+
if ( $this->is_headers_footers_mode() ) {
|
64 |
+
$this->pages['headers_footers'] = 'WPCode_Admin_Page_Headers_Footers';
|
65 |
+
|
66 |
+
return;
|
67 |
+
}
|
68 |
+
|
69 |
+
$this->pages['code_snippets'] = 'WPCode_Admin_Page_Code_Snippets';
|
70 |
+
$this->pages['snippet_manager'] = 'WPCode_Admin_Page_Snippet_Manager';
|
71 |
+
$this->pages['headers_footers'] = 'WPCode_Admin_Page_Headers_Footers';
|
72 |
+
$this->pages['library'] = 'WPCode_Admin_Page_Library';
|
73 |
+
$this->pages['generator'] = 'WPCode_Admin_Page_Generator';
|
74 |
+
$this->pages['tools'] = 'WPCode_Admin_Page_Tools';
|
75 |
+
$this->pages['settings'] = 'WPCode_Admin_Page_Settings';
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Load the pages using their specific classes.
|
80 |
+
*
|
81 |
+
* @return void
|
82 |
+
*/
|
83 |
+
public function load_pages() {
|
84 |
+
|
85 |
+
$this->prepare_pages();
|
86 |
+
|
87 |
+
foreach ( $this->pages as $page_class ) {
|
88 |
+
if ( ! class_exists( $page_class ) ) {
|
89 |
+
continue;
|
90 |
+
}
|
91 |
+
new $page_class();
|
92 |
+
}
|
93 |
+
}
|
94 |
+
|
95 |
+
/**
|
96 |
+
* Add the main menu item used for all the other admin pages.
|
97 |
+
*
|
98 |
+
* @return void
|
99 |
+
*/
|
100 |
+
public function add_main_menu_item() {
|
101 |
+
$svg = get_wpcode_icon( 'logo', 36, 34, '-10 -6 80 80' );
|
102 |
+
$wpcode_icon = 'data:image/svg+xml;base64,' . base64_encode( $svg ); // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_encode
|
103 |
+
|
104 |
+
add_menu_page(
|
105 |
+
__( 'Code Snippets', 'insert-headers-and-footers' ),
|
106 |
+
__( 'Code Snippets', 'insert-headers-and-footers' ),
|
107 |
+
'wpcode_edit_snippets',
|
108 |
+
'wpcode',
|
109 |
+
array(
|
110 |
+
$this,
|
111 |
+
'admin_menu_page',
|
112 |
+
),
|
113 |
+
$wpcode_icon,
|
114 |
+
'81.45687234432916'
|
115 |
+
);
|
116 |
+
}
|
117 |
+
|
118 |
+
/**
|
119 |
+
* Handler for registering the admin menu & loading pages.
|
120 |
+
*
|
121 |
+
* @return void
|
122 |
+
*/
|
123 |
+
public function register_admin_menu() {
|
124 |
+
if ( ! $this->is_headers_footers_mode() ) {
|
125 |
+
$this->add_main_menu_item();
|
126 |
+
}
|
127 |
+
|
128 |
+
$this->load_pages();
|
129 |
+
}
|
130 |
+
|
131 |
+
/**
|
132 |
+
* Check if the site is in headers & footers only mode.
|
133 |
+
*
|
134 |
+
* @return mixed
|
135 |
+
*/
|
136 |
+
public function is_headers_footers_mode() {
|
137 |
+
return wpcode()->settings->get_option( 'headers_footers_mode' );
|
138 |
+
}
|
139 |
+
|
140 |
+
/**
|
141 |
+
* Generic handler for the wpcode pages.
|
142 |
+
*
|
143 |
+
* @return void
|
144 |
+
*/
|
145 |
+
public function admin_menu_page() {
|
146 |
+
do_action( 'wpcode_admin_page' );
|
147 |
+
}
|
148 |
+
|
149 |
+
/**
|
150 |
+
* Add a link to the code snippets list in the plugins list view.
|
151 |
+
*
|
152 |
+
* @param array $links The links specific to our plugin.
|
153 |
+
*
|
154 |
+
* @return array
|
155 |
+
*/
|
156 |
+
public function add_plugin_action_links( $links ) {
|
157 |
+
$url = add_query_arg(
|
158 |
+
array(
|
159 |
+
'page' => 'wpcode',
|
160 |
+
),
|
161 |
+
admin_url( 'admin.php' )
|
162 |
+
);
|
163 |
+
$text = esc_html__( 'Code Snippets', 'insert-headers-and-footers' );
|
164 |
+
if ( wpcode()->settings->get_option( 'headers_footers_mode' ) ) {
|
165 |
+
$url = add_query_arg(
|
166 |
+
array(
|
167 |
+
'page' => 'wpcode-headers-footers',
|
168 |
+
),
|
169 |
+
admin_url( 'options-general.php' )
|
170 |
+
);
|
171 |
+
$text = esc_html__( 'Settings', 'insert-headers-and-footers' );
|
172 |
+
}
|
173 |
+
$custom = array();
|
174 |
+
|
175 |
+
$custom['pro'] = sprintf(
|
176 |
+
'<a href="%1$s" aria-label="%2$s" target="_blank" rel="noopener noreferrer"
|
177 |
+
style="color: #00a32a; font-weight: 700;"
|
178 |
+
onmouseover="this.style.color=\'#008a20\';"
|
179 |
+
onmouseout="this.style.color=\'#00a32a\';"
|
180 |
+
>%3$s</a>',
|
181 |
+
wpcode_utm_url(
|
182 |
+
'https://wpcode.com/lite/',
|
183 |
+
'all-plugins',
|
184 |
+
'get-wpcode-pro'
|
185 |
+
),
|
186 |
+
esc_attr__( 'Upgrade to WPCode Pro', 'insert-headers-and-footers' ),
|
187 |
+
esc_html__( 'Get WPCode Pro', 'insert-headers-and-footers' )
|
188 |
+
);
|
189 |
+
|
190 |
+
$custom['settings'] = sprintf(
|
191 |
+
'<a href="%1$s">%2$s</a>',
|
192 |
+
$url,
|
193 |
+
$text
|
194 |
+
);
|
195 |
+
|
196 |
+
return array_merge( $custom, $links );
|
197 |
+
}
|
198 |
+
}
|
includes/admin/class-wpcode-code-editor.php
ADDED
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Central place to load the Code Editor used throughout the plugin with
|
4 |
+
* similar settings.
|
5 |
+
*
|
6 |
+
* @package WPCode
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class WPCode_Code_Editor.
|
11 |
+
*/
|
12 |
+
class WPCode_Code_Editor {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Array of settings used to instantiate the editor.
|
16 |
+
*
|
17 |
+
* @var array
|
18 |
+
*/
|
19 |
+
private $settings;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Array of ids of textareas to init as code editors.
|
23 |
+
*
|
24 |
+
* @var array
|
25 |
+
*/
|
26 |
+
private $editors;
|
27 |
+
|
28 |
+
/**
|
29 |
+
* WPCode_Code_Editor Constructor.
|
30 |
+
*
|
31 |
+
* @param string $code_type The code type that will be converted to the mime type for the editor.
|
32 |
+
*/
|
33 |
+
public function __construct( $code_type = 'html' ) {
|
34 |
+
$this->load_code_mirror( $code_type );
|
35 |
+
}
|
36 |
+
|
37 |
+
/**
|
38 |
+
* If called, this loads CodeMirror on the current admin page with checks.
|
39 |
+
*
|
40 |
+
* @param string $code_type The code type that will be converted to the mime type for the editor.
|
41 |
+
*
|
42 |
+
* @return array|false
|
43 |
+
*/
|
44 |
+
public function load_code_mirror( $code_type ) {
|
45 |
+
if ( ! function_exists( 'wp_enqueue_code_editor' ) ) {
|
46 |
+
return false;
|
47 |
+
}
|
48 |
+
$editor_args = array(
|
49 |
+
'type' => wpcode()->execute->get_mime_for_code_type( $code_type ),
|
50 |
+
'showHint' => true,
|
51 |
+
);
|
52 |
+
if ( ! current_user_can( 'wpcode_edit_snippets' ) ) {
|
53 |
+
$editor_args['codemirror']['readOnly'] = true;
|
54 |
+
}
|
55 |
+
|
56 |
+
// Enqueue code editor and settings for manipulating HTML.
|
57 |
+
$this->settings = wp_enqueue_code_editor( $editor_args );
|
58 |
+
|
59 |
+
return $this->settings;
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Load hint scripts if needed.
|
64 |
+
*
|
65 |
+
* @return void
|
66 |
+
*/
|
67 |
+
public function load_hint_scripts() {
|
68 |
+
wp_enqueue_script( 'htmlhint' );
|
69 |
+
wp_enqueue_script( 'csslint' );
|
70 |
+
wp_enqueue_script( 'jshint' );
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Update a setting for the editor instance.
|
75 |
+
*
|
76 |
+
* @param string $key Key of setting to update.
|
77 |
+
* @param mixed $value Value to set the setting to, can be string, integer, array.
|
78 |
+
*
|
79 |
+
* @return void
|
80 |
+
*/
|
81 |
+
public function set_setting( $key, $value ) {
|
82 |
+
if ( ! isset( $this->settings ) ) {
|
83 |
+
return;
|
84 |
+
}
|
85 |
+
if ( ! isset( $this->settings['codemirror'] ) ) {
|
86 |
+
$this->settings['codemirror'] = array();
|
87 |
+
}
|
88 |
+
|
89 |
+
$this->settings['codemirror'][ $key ] = $value;
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Load the inline script needed to initiate the code editor using the current settings.
|
94 |
+
*
|
95 |
+
* @param string $id The textarea ID to init the editor for.
|
96 |
+
*
|
97 |
+
* @return void
|
98 |
+
*/
|
99 |
+
public function register_editor( $id ) {
|
100 |
+
$this->editors[] = $id;
|
101 |
+
}
|
102 |
+
|
103 |
+
/**
|
104 |
+
* Load the inline script needed to initiate the code editor using the current settings.
|
105 |
+
*
|
106 |
+
* @return void
|
107 |
+
*/
|
108 |
+
public function init_editor() {
|
109 |
+
wp_add_inline_script(
|
110 |
+
'code-editor',
|
111 |
+
sprintf(
|
112 |
+
'jQuery( function() {
|
113 |
+
window.wpcode_editor = window.wpcode_editor ? window.wpcode_editor : {};
|
114 |
+
var ids = %1$s;
|
115 |
+
var settings = %2$s;
|
116 |
+
for ( var i in ids ) {
|
117 |
+
window.wpcode_editor[ids[i]] = wp.codeEditor.initialize( ids[i], settings );
|
118 |
+
}
|
119 |
+
} );',
|
120 |
+
wp_json_encode( $this->editors ),
|
121 |
+
wp_json_encode( $this->get_settings() )
|
122 |
+
)
|
123 |
+
);
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Get the settings.
|
128 |
+
*
|
129 |
+
* @return array
|
130 |
+
*/
|
131 |
+
public function get_settings() {
|
132 |
+
return $this->settings;
|
133 |
+
}
|
134 |
+
}
|
includes/admin/class-wpcode-docs.php
CHANGED
@@ -144,7 +144,7 @@ class WPCode_Docs {
|
|
144 |
?>
|
145 |
<li>
|
146 |
<?php wpcode_icon( 'file-text', 16, 16 ); ?>
|
147 |
-
<a href="<?php echo esc_url( wpcode_utm_url( $doc['url'], '
|
148 |
<?php echo esc_html( $doc['title'] ); ?>
|
149 |
</a>
|
150 |
</li>
|
144 |
?>
|
145 |
<li>
|
146 |
<?php wpcode_icon( 'file-text', 16, 16 ); ?>
|
147 |
+
<a href="<?php echo esc_url( wpcode_utm_url( $doc['url'], 'help-overlay', 'view-doc', esc_attr( $doc['title'] ) ) ); ?>" rel="noopener noreferrer" target="_blank">
|
148 |
<?php echo esc_html( $doc['title'] ); ?>
|
149 |
</a>
|
150 |
</li>
|
includes/admin/class-wpcode-metabox-snippets.php
ADDED
@@ -0,0 +1,216 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Base class for the WPCode snippets metabox.
|
4 |
+
*
|
5 |
+
* @package WPCode
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* WPCode metabox snippets.
|
10 |
+
*/
|
11 |
+
abstract class WPCode_Metabox_Snippets {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Id used for registering the metabox using add_meta_box.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
public $id = 'wpcode-metabox-snippets';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Title of the metabox.
|
22 |
+
*
|
23 |
+
* @var string
|
24 |
+
*/
|
25 |
+
public $title;
|
26 |
+
|
27 |
+
/**
|
28 |
+
* Tabs for this metabox.
|
29 |
+
*
|
30 |
+
* @var array
|
31 |
+
*/
|
32 |
+
public $tabs;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Register the metabox.
|
36 |
+
*/
|
37 |
+
public function __construct() {
|
38 |
+
$this->load_strings();
|
39 |
+
$this->hooks();
|
40 |
+
}
|
41 |
+
|
42 |
+
/**
|
43 |
+
* Load the translatable strings.
|
44 |
+
*
|
45 |
+
* @return void
|
46 |
+
*/
|
47 |
+
public function load_strings() {
|
48 |
+
$this->title = __( 'WPCode Page Scripts', 'insert-headers-and-footers' );
|
49 |
+
$this->tabs = array(
|
50 |
+
'header' => __( 'Header', 'insert-headers-and-footers' ),
|
51 |
+
'footer' => __( 'Footer', 'insert-headers-and-footers' ),
|
52 |
+
);
|
53 |
+
|
54 |
+
$body_supported = function_exists( 'wp_body_open' ) && version_compare( get_bloginfo( 'version' ), '5.2', '>=' );
|
55 |
+
|
56 |
+
if ( $body_supported ) {
|
57 |
+
$this->tabs['body'] = __( 'Body', 'insert-headers-and-footers' );
|
58 |
+
}
|
59 |
+
|
60 |
+
$this->tabs['code'] = __( 'Custom Code Snippet', 'insert-headers-and-footers' );
|
61 |
+
|
62 |
+
}
|
63 |
+
|
64 |
+
/**
|
65 |
+
* Add hooks.
|
66 |
+
*
|
67 |
+
* @return void
|
68 |
+
*/
|
69 |
+
public function hooks() {
|
70 |
+
add_action( 'add_meta_boxes', array( $this, 'register_metabox' ) );
|
71 |
+
}
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Use `add_meta_box` to register the metabox for this class.
|
75 |
+
*
|
76 |
+
* @param string $post_type The post type of the screen where metaboxes are loaded.
|
77 |
+
*
|
78 |
+
* @return void
|
79 |
+
*/
|
80 |
+
public function register_metabox( $post_type ) {
|
81 |
+
// Don't show the metabox to users who aren't allowed to manage snippets.
|
82 |
+
if ( ! current_user_can( 'wpcode_activate_snippets' ) ) {
|
83 |
+
return;
|
84 |
+
}
|
85 |
+
|
86 |
+
$post_type_details = get_post_type_object( $post_type );
|
87 |
+
|
88 |
+
// Add metabox only on public post types.
|
89 |
+
if ( empty( $post_type_details->public ) ) {
|
90 |
+
return;
|
91 |
+
}
|
92 |
+
|
93 |
+
add_meta_box(
|
94 |
+
$this->id,
|
95 |
+
$this->title,
|
96 |
+
array(
|
97 |
+
$this,
|
98 |
+
'output_metabox_content',
|
99 |
+
),
|
100 |
+
$post_type,
|
101 |
+
'normal',
|
102 |
+
apply_filters( 'wpcode_post_metabox_priority', 'high' )
|
103 |
+
);
|
104 |
+
}
|
105 |
+
|
106 |
+
/**
|
107 |
+
* Metabox content output callback.
|
108 |
+
*
|
109 |
+
* @param WP_Post $post The post object.
|
110 |
+
*
|
111 |
+
* @return void
|
112 |
+
*/
|
113 |
+
public function output_metabox_content( $post ) {
|
114 |
+
$this->metabox_start();
|
115 |
+
echo '<div class="wpcode-content">';
|
116 |
+
$this->tabs_navigation();
|
117 |
+
$this->tabs_content( $post );
|
118 |
+
echo '</div>';
|
119 |
+
$this->metabox_end();
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Output the menu for switching between tabs.
|
124 |
+
*
|
125 |
+
* @return void
|
126 |
+
*/
|
127 |
+
public function tabs_navigation() {
|
128 |
+
if ( empty( $this->tabs ) ) {
|
129 |
+
return;
|
130 |
+
}
|
131 |
+
?>
|
132 |
+
<div class="wpcode-admin-tabs-navigation">
|
133 |
+
<ul class="wpcode-admin-tabs">
|
134 |
+
<?php
|
135 |
+
$class = 'active';
|
136 |
+
foreach ( $this->tabs as $tab_id => $tab_name ) {
|
137 |
+
?>
|
138 |
+
<li>
|
139 |
+
<button type="button" data-target="<?php echo esc_attr( $this->get_tab_html_id( $tab_id ) ); ?>" class="<?php echo esc_attr( $class ); ?>"><?php echo esc_html( $tab_name ); ?></button>
|
140 |
+
</li>
|
141 |
+
<?php
|
142 |
+
$class = '';
|
143 |
+
}
|
144 |
+
?>
|
145 |
+
</ul>
|
146 |
+
</div>
|
147 |
+
<?php
|
148 |
+
}
|
149 |
+
|
150 |
+
/**
|
151 |
+
* Output the tabs content using tab-specific methods by their ids.
|
152 |
+
*
|
153 |
+
* @param WP_Post $post The post object.
|
154 |
+
*
|
155 |
+
* @return void
|
156 |
+
*/
|
157 |
+
public function tabs_content( $post ) {
|
158 |
+
$tab_ids = array_keys( $this->tabs );
|
159 |
+
$active = true;
|
160 |
+
foreach ( $tab_ids as $tab_id ) {
|
161 |
+
$class = 'wpcode-admin-tab-content';
|
162 |
+
|
163 |
+
$class .= $active ? ' active' : '';
|
164 |
+
printf(
|
165 |
+
'<div class="%1$s" id="%2$s">',
|
166 |
+
esc_attr( $class ),
|
167 |
+
esc_attr( $this->get_tab_html_id( $tab_id ) )
|
168 |
+
);
|
169 |
+
if ( method_exists( $this, 'output_tab_' . $tab_id ) ) {
|
170 |
+
call_user_func( array( $this, 'output_tab_' . $tab_id ), $post );
|
171 |
+
} else {
|
172 |
+
$this->output_tab( $tab_id, $post );
|
173 |
+
}
|
174 |
+
$active = false;
|
175 |
+
echo '</div>';
|
176 |
+
}
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Generic tab content output method.
|
181 |
+
*
|
182 |
+
* @param string $tab_id The tab id.
|
183 |
+
* @param WP_Post $post The post object.
|
184 |
+
*
|
185 |
+
* @return void
|
186 |
+
*/
|
187 |
+
public function output_tab( $tab_id, $post ) {
|
188 |
+
}
|
189 |
+
|
190 |
+
/**
|
191 |
+
* Get a standard tab id from the array key.
|
192 |
+
*
|
193 |
+
* @param string $tab_id The tab id.
|
194 |
+
*
|
195 |
+
* @return string
|
196 |
+
*/
|
197 |
+
public function get_tab_html_id( $tab_id ) {
|
198 |
+
return 'wpcode-tab-' . $tab_id;
|
199 |
+
}
|
200 |
+
|
201 |
+
/**
|
202 |
+
* Method for running logic at the start of the metabox.
|
203 |
+
*
|
204 |
+
* @return void
|
205 |
+
*/
|
206 |
+
public function metabox_start() {
|
207 |
+
}
|
208 |
+
|
209 |
+
/**
|
210 |
+
* Method for running logic at the end of the metabox, loading scripts, for example.
|
211 |
+
*
|
212 |
+
* @return void
|
213 |
+
*/
|
214 |
+
public function metabox_end() {
|
215 |
+
}
|
216 |
+
}
|
includes/admin/class-wpcode-upgrade-welcome.php
CHANGED
@@ -51,17 +51,24 @@ class WPCode_Upgrade_Welcome {
|
|
51 |
}
|
52 |
|
53 |
add_action( 'admin_menu', array( $this, 'register' ) );
|
54 |
-
|
55 |
add_action( 'admin_init', array( $this, 'redirect' ), 9999 );
|
56 |
add_action( 'admin_body_class', array( $this, 'body_class' ) );
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
* Remove the dashboard page from the admin menu.
|
|
|
|
|
|
|
|
|
|
|
61 |
*/
|
62 |
-
public function hide_menu() {
|
63 |
|
64 |
remove_submenu_page( 'index.php', self::SLUG );
|
|
|
|
|
65 |
}
|
66 |
|
67 |
/**
|
51 |
}
|
52 |
|
53 |
add_action( 'admin_menu', array( $this, 'register' ) );
|
54 |
+
add_filter( 'parent_file', array( $this, 'hide_menu' ), 1020 );
|
55 |
add_action( 'admin_init', array( $this, 'redirect' ), 9999 );
|
56 |
add_action( 'admin_body_class', array( $this, 'body_class' ) );
|
57 |
}
|
58 |
|
59 |
/**
|
60 |
* Remove the dashboard page from the admin menu.
|
61 |
+
* We're using the parent_file filter to improve compatibility with admin-menu-editor.
|
62 |
+
*
|
63 |
+
* @param string $parent_file The parent file.
|
64 |
+
*
|
65 |
+
* @return string
|
66 |
*/
|
67 |
+
public function hide_menu( $parent_file ) {
|
68 |
|
69 |
remove_submenu_page( 'index.php', self::SLUG );
|
70 |
+
|
71 |
+
return $parent_file;
|
72 |
}
|
73 |
|
74 |
/**
|
includes/admin/pages/class-wpcode-admin-page-generator.php
CHANGED
@@ -103,14 +103,19 @@ class WPCode_Admin_Page_Generator extends WPCode_Admin_Page {
|
|
103 |
<ul class="wpcode-items-list-category">
|
104 |
<?php
|
105 |
foreach ( $this->generators as $generator ) {
|
106 |
-
$url
|
107 |
array(
|
108 |
'page' => $this->page_slug,
|
109 |
'generator' => $generator->get_name(),
|
110 |
),
|
111 |
admin_url( 'admin.php' )
|
112 |
);
|
113 |
-
$
|
|
|
|
|
|
|
|
|
|
|
114 |
}
|
115 |
?>
|
116 |
</ul>
|
@@ -171,7 +176,6 @@ class WPCode_Admin_Page_Generator extends WPCode_Admin_Page {
|
|
171 |
</div>
|
172 |
<textarea id="wpcode_generator_code_preview"><?php echo $generator->get_snippet_code(); ?></textarea>
|
173 |
</div>
|
174 |
-
<span class="wpcode-loading-spinner" id="wpcode-generator-spinner"></span>
|
175 |
<script type="text/template" id="wpcode-generator-repeater-row">
|
176 |
<?php $this->repeater_group_template(); ?>
|
177 |
</script>
|
@@ -213,10 +217,10 @@ class WPCode_Admin_Page_Generator extends WPCode_Admin_Page {
|
|
213 |
if ( ! $this->generator ) {
|
214 |
return;
|
215 |
}
|
216 |
-
$
|
217 |
-
|
218 |
-
$
|
219 |
-
|
220 |
|
221 |
wp_enqueue_script( 'jquery-ui-autocomplete' );
|
222 |
}
|
103 |
<ul class="wpcode-items-list-category">
|
104 |
<?php
|
105 |
foreach ( $this->generators as $generator ) {
|
106 |
+
$url = add_query_arg(
|
107 |
array(
|
108 |
'page' => $this->page_slug,
|
109 |
'generator' => $generator->get_name(),
|
110 |
),
|
111 |
admin_url( 'admin.php' )
|
112 |
);
|
113 |
+
$button_1 = array(
|
114 |
+
'tag' => 'a',
|
115 |
+
'url' => $url,
|
116 |
+
'text' => __( 'Generate', 'insert-headers-and-footers' ),
|
117 |
+
);
|
118 |
+
$this->get_list_item( $generator->get_name(), $generator->get_title(), $generator->get_description(), $button_1, array(), $generator->get_categories() );
|
119 |
}
|
120 |
?>
|
121 |
</ul>
|
176 |
</div>
|
177 |
<textarea id="wpcode_generator_code_preview"><?php echo $generator->get_snippet_code(); ?></textarea>
|
178 |
</div>
|
|
|
179 |
<script type="text/template" id="wpcode-generator-repeater-row">
|
180 |
<?php $this->repeater_group_template(); ?>
|
181 |
</script>
|
217 |
if ( ! $this->generator ) {
|
218 |
return;
|
219 |
}
|
220 |
+
$editor = new WPCode_Code_Editor( $this->code_type );
|
221 |
+
$editor->set_setting( 'readOnly', 'nocursor' );
|
222 |
+
$editor->register_editor( 'wpcode_generator_code_preview' );
|
223 |
+
$editor->init_editor();
|
224 |
|
225 |
wp_enqueue_script( 'jquery-ui-autocomplete' );
|
226 |
}
|
includes/admin/pages/class-wpcode-admin-page-headers-footers.php
CHANGED
@@ -40,11 +40,9 @@ class WPCode_Admin_Page_Headers_Footers extends WPCode_Admin_Page {
|
|
40 |
|
41 |
/**
|
42 |
* Call this just to set the page title translatable.
|
43 |
-
*
|
44 |
-
* @param bool $settings_submenu If true, the page will be added as a submenu of the Settings page.
|
45 |
*/
|
46 |
-
public function __construct(
|
47 |
-
if (
|
48 |
$this->settings_submenu = true;
|
49 |
}
|
50 |
$this->page_title = __( 'Header & Footer', 'insert-headers-and-footers' );
|
@@ -58,7 +56,10 @@ class WPCode_Admin_Page_Headers_Footers extends WPCode_Admin_Page {
|
|
58 |
*/
|
59 |
public function add_page() {
|
60 |
if ( $this->settings_submenu ) {
|
61 |
-
add_options_page( $this->menu_title, $this->page_title, 'wpcode_edit_snippets', $this->page_slug,
|
|
|
|
|
|
|
62 |
|
63 |
return;
|
64 |
}
|
@@ -130,30 +131,39 @@ class WPCode_Admin_Page_Headers_Footers extends WPCode_Admin_Page {
|
|
130 |
* @return void
|
131 |
*/
|
132 |
public function output_content() {
|
133 |
-
|
134 |
-
$header_desc
|
135 |
/* translators: %s: The `<head>` tag */
|
136 |
esc_html__( 'These scripts will be printed in the %s section.', 'insert-headers-and-footers' ),
|
137 |
'<code><head></code>'
|
138 |
);
|
139 |
-
$body_desc
|
140 |
/* translators: %s: The `<head>` tag */
|
141 |
esc_html__( 'These scripts will be printed just below the opening %s tag.', 'insert-headers-and-footers' ),
|
142 |
'<code><body></code>'
|
143 |
);
|
144 |
-
$footer_desc
|
145 |
/* translators: %s: The `</body>` tag */
|
146 |
esc_html__( 'These scripts will be printed above the closing %s tag.', 'insert-headers-and-footers' ),
|
147 |
'<code></body></code>'
|
148 |
);
|
149 |
$this->textarea_field( 'ihaf_insert_header', __( 'Header', 'insert-headers-and-footers' ), $header_desc );
|
150 |
-
if ( $body_supported ) {
|
151 |
$this->textarea_field( 'ihaf_insert_body', __( 'Body', 'insert-headers-and-footers' ), $body_desc );
|
152 |
}
|
153 |
$this->textarea_field( 'ihaf_insert_footer', __( 'Footer', 'insert-headers-and-footers' ), $footer_desc );
|
154 |
wp_nonce_field( $this->action, $this->nonce_name );
|
155 |
}
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
/**
|
158 |
* Standard output for a code input field.
|
159 |
*
|
@@ -221,14 +231,14 @@ class WPCode_Admin_Page_Headers_Footers extends WPCode_Admin_Page {
|
|
221 |
* @return void
|
222 |
*/
|
223 |
public function page_scripts() {
|
224 |
-
$
|
225 |
-
if ( false === $settings ) {
|
226 |
-
return;
|
227 |
-
}
|
228 |
|
229 |
-
|
230 |
-
|
231 |
-
|
|
|
|
|
|
|
232 |
}
|
233 |
|
234 |
/**
|
40 |
|
41 |
/**
|
42 |
* Call this just to set the page title translatable.
|
|
|
|
|
43 |
*/
|
44 |
+
public function __construct() {
|
45 |
+
if ( wpcode()->settings->get_option( 'headers_footers_mode' ) ) {
|
46 |
$this->settings_submenu = true;
|
47 |
}
|
48 |
$this->page_title = __( 'Header & Footer', 'insert-headers-and-footers' );
|
56 |
*/
|
57 |
public function add_page() {
|
58 |
if ( $this->settings_submenu ) {
|
59 |
+
add_options_page( $this->menu_title, $this->page_title, 'wpcode_edit_snippets', $this->page_slug, array(
|
60 |
+
wpcode()->admin_page_loader,
|
61 |
+
'admin_menu_page'
|
62 |
+
) );
|
63 |
|
64 |
return;
|
65 |
}
|
131 |
* @return void
|
132 |
*/
|
133 |
public function output_content() {
|
134 |
+
|
135 |
+
$header_desc = sprintf(
|
136 |
/* translators: %s: The `<head>` tag */
|
137 |
esc_html__( 'These scripts will be printed in the %s section.', 'insert-headers-and-footers' ),
|
138 |
'<code><head></code>'
|
139 |
);
|
140 |
+
$body_desc = sprintf(
|
141 |
/* translators: %s: The `<head>` tag */
|
142 |
esc_html__( 'These scripts will be printed just below the opening %s tag.', 'insert-headers-and-footers' ),
|
143 |
'<code><body></code>'
|
144 |
);
|
145 |
+
$footer_desc = sprintf(
|
146 |
/* translators: %s: The `</body>` tag */
|
147 |
esc_html__( 'These scripts will be printed above the closing %s tag.', 'insert-headers-and-footers' ),
|
148 |
'<code></body></code>'
|
149 |
);
|
150 |
$this->textarea_field( 'ihaf_insert_header', __( 'Header', 'insert-headers-and-footers' ), $header_desc );
|
151 |
+
if ( $this->body_supported() ) {
|
152 |
$this->textarea_field( 'ihaf_insert_body', __( 'Body', 'insert-headers-and-footers' ), $body_desc );
|
153 |
}
|
154 |
$this->textarea_field( 'ihaf_insert_footer', __( 'Footer', 'insert-headers-and-footers' ), $footer_desc );
|
155 |
wp_nonce_field( $this->action, $this->nonce_name );
|
156 |
}
|
157 |
|
158 |
+
/**
|
159 |
+
* Check if the website supports wp_body_open.
|
160 |
+
*
|
161 |
+
* @return bool
|
162 |
+
*/
|
163 |
+
public function body_supported() {
|
164 |
+
return function_exists( 'wp_body_open' ) && version_compare( get_bloginfo( 'version' ), '5.2', '>=' );
|
165 |
+
}
|
166 |
+
|
167 |
/**
|
168 |
* Standard output for a code input field.
|
169 |
*
|
231 |
* @return void
|
232 |
*/
|
233 |
public function page_scripts() {
|
234 |
+
$editor = new WPCode_Code_Editor();
|
|
|
|
|
|
|
235 |
|
236 |
+
$editor->register_editor( 'ihaf_insert_header' );
|
237 |
+
$editor->register_editor( 'ihaf_insert_footer' );
|
238 |
+
if ( $this->body_supported() ) {
|
239 |
+
$editor->register_editor( 'ihaf_insert_body' );
|
240 |
+
}
|
241 |
+
$editor->init_editor();
|
242 |
}
|
243 |
|
244 |
/**
|
includes/admin/pages/class-wpcode-admin-page-library.php
CHANGED
@@ -23,6 +23,20 @@ class WPCode_Admin_Page_Library extends WPCode_Admin_Page {
|
|
23 |
*/
|
24 |
protected $show_library = true;
|
25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
/**
|
27 |
* Call this just to set the page title translatable.
|
28 |
*/
|
@@ -31,6 +45,19 @@ class WPCode_Admin_Page_Library extends WPCode_Admin_Page {
|
|
31 |
parent::__construct();
|
32 |
}
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
/**
|
35 |
* Add page-specific hooks.
|
36 |
*
|
@@ -56,7 +83,7 @@ class WPCode_Admin_Page_Library extends WPCode_Admin_Page {
|
|
56 |
return;
|
57 |
}
|
58 |
|
59 |
-
$snippet =
|
60 |
|
61 |
if ( $snippet ) {
|
62 |
$url = add_query_arg(
|
@@ -90,23 +117,43 @@ class WPCode_Admin_Page_Library extends WPCode_Admin_Page {
|
|
90 |
* @return void
|
91 |
*/
|
92 |
public function output_content() {
|
93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
$categories = $library_data['categories'];
|
95 |
$snippets = $library_data['snippets'];
|
96 |
|
97 |
$this->get_library_markup( $categories, $snippets );
|
|
|
98 |
}
|
99 |
|
100 |
/**
|
101 |
-
* For this page we output
|
102 |
*
|
103 |
* @return void
|
104 |
*/
|
105 |
public function output_header_bottom() {
|
106 |
?>
|
107 |
-
<
|
108 |
-
|
109 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
<?php
|
111 |
}
|
112 |
|
@@ -134,4 +181,294 @@ class WPCode_Admin_Page_Library extends WPCode_Admin_Page {
|
|
134 |
$this->set_error_message( $messages[ $message ] );
|
135 |
|
136 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
}
|
23 |
*/
|
24 |
protected $show_library = true;
|
25 |
|
26 |
+
/**
|
27 |
+
* The default view.
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
public $view = 'library';
|
32 |
+
|
33 |
+
/**
|
34 |
+
* The object used for loading data on this page.
|
35 |
+
*
|
36 |
+
* @var WPCode_Library
|
37 |
+
*/
|
38 |
+
protected $data_handler;
|
39 |
+
|
40 |
/**
|
41 |
* Call this just to set the page title translatable.
|
42 |
*/
|
45 |
parent::__construct();
|
46 |
}
|
47 |
|
48 |
+
/**
|
49 |
+
* Setup page-specific views.
|
50 |
+
*
|
51 |
+
* @return void
|
52 |
+
*/
|
53 |
+
protected function setup_views() {
|
54 |
+
$this->views = array(
|
55 |
+
'library' => __( 'Snippets', 'insert-headers-and-footers' ),
|
56 |
+
'my_library' => __( 'My Library', 'insert-headers-and-footers' ),
|
57 |
+
'my_favorites' => __( 'My Favorites', 'insert-headers-and-footers' ),
|
58 |
+
);
|
59 |
+
}
|
60 |
+
|
61 |
/**
|
62 |
* Add page-specific hooks.
|
63 |
*
|
83 |
return;
|
84 |
}
|
85 |
|
86 |
+
$snippet = $this->get_data_handler()->create_new_snippet( $library_id );
|
87 |
|
88 |
if ( $snippet ) {
|
89 |
$url = add_query_arg(
|
117 |
* @return void
|
118 |
*/
|
119 |
public function output_content() {
|
120 |
+
|
121 |
+
if ( method_exists( $this, 'output_view_' . $this->view ) ) {
|
122 |
+
call_user_func( array( $this, 'output_view_' . $this->view ) );
|
123 |
+
}
|
124 |
+
}
|
125 |
+
|
126 |
+
/**
|
127 |
+
* Ouptut the library content (default view).
|
128 |
+
*
|
129 |
+
* @return void
|
130 |
+
*/
|
131 |
+
public function output_view_library() {
|
132 |
+
$library_data = $this->get_data_handler()->get_data();
|
133 |
$categories = $library_data['categories'];
|
134 |
$snippets = $library_data['snippets'];
|
135 |
|
136 |
$this->get_library_markup( $categories, $snippets );
|
137 |
+
$this->library_preview_modal_content();
|
138 |
}
|
139 |
|
140 |
/**
|
141 |
+
* For this page we output a menu.
|
142 |
*
|
143 |
* @return void
|
144 |
*/
|
145 |
public function output_header_bottom() {
|
146 |
?>
|
147 |
+
<ul class="wpcode-admin-tabs">
|
148 |
+
<?php
|
149 |
+
foreach ( $this->views as $slug => $label ) {
|
150 |
+
$class = $this->view === $slug ? 'active' : '';
|
151 |
+
?>
|
152 |
+
<li>
|
153 |
+
<a href="<?php echo esc_url( $this->get_view_link( $slug ) ); ?>" class="<?php echo esc_attr( $class ); ?>"><?php echo esc_html( $label ); ?></a>
|
154 |
+
</li>
|
155 |
+
<?php } ?>
|
156 |
+
</ul>
|
157 |
<?php
|
158 |
}
|
159 |
|
181 |
$this->set_error_message( $messages[ $message ] );
|
182 |
|
183 |
}
|
184 |
+
|
185 |
+
/**
|
186 |
+
* Markup for the "My Library" page.
|
187 |
+
*
|
188 |
+
* @return void
|
189 |
+
*/
|
190 |
+
public function output_view_my_library() {
|
191 |
+
$this->blurred_placeholder_items();
|
192 |
+
// Show upsell.
|
193 |
+
echo WPCode_Admin_Page::get_upsell_box(
|
194 |
+
__( 'My Library is a PRO Feature', 'insert-headers-and-footers' ),
|
195 |
+
'<p>' . __( 'Upgrade to WPCode PRO today and save your snippets in the WPCode Library directly from the plugin and import them with 1-click on other sites.', 'insert-headers-and-footers' ) . '</p>',
|
196 |
+
array(
|
197 |
+
'text' => __( 'Upgrade to PRO and Unlock "My Library"', 'insert-headers-and-footers' ),
|
198 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite/', 'library-page', 'my-library', 'upgrade-and-unlock' ),
|
199 |
+
),
|
200 |
+
array(
|
201 |
+
'text' => esc_html__( 'Learn more about all the features', 'insert-headers-and-footers' ),
|
202 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite', 'library-page', 'my-library', 'features' ),
|
203 |
+
),
|
204 |
+
array(
|
205 |
+
__( 'Save your snippets to the WPCode Library', 'insert-headers-and-footers' ),
|
206 |
+
__( 'Import snippets from the WPCode Library', 'insert-headers-and-footers' ),
|
207 |
+
__( 'Set up new websites faster', 'insert-headers-and-footers' ),
|
208 |
+
__( 'Easily implement features on multiple sites', 'insert-headers-and-footers' ),
|
209 |
+
__( 'Edit snippets in the WPCode Library', 'insert-headers-and-footers' ),
|
210 |
+
__( 'Load favorite snippets in the plugin', 'insert-headers-and-footers' ),
|
211 |
+
)
|
212 |
+
);
|
213 |
+
}
|
214 |
+
|
215 |
+
/**
|
216 |
+
* Markup for the "My Library" page.
|
217 |
+
*
|
218 |
+
* @return void
|
219 |
+
*/
|
220 |
+
public function output_view_my_favorites() {
|
221 |
+
$this->blurred_placeholder_items();
|
222 |
+
// Show upsell.
|
223 |
+
echo WPCode_Admin_Page::get_upsell_box(
|
224 |
+
__( 'My Favorites is a PRO Feature', 'insert-headers-and-footers' ),
|
225 |
+
'<p>' . __( 'Upgrade to WPCode PRO today and see the snippets you starred in the WPCode Library directly in the plugin.', 'insert-headers-and-footers' ) . '</p>',
|
226 |
+
array(
|
227 |
+
'text' => __( 'Upgrade to PRO and Unlock "My Favorites"', 'insert-headers-and-footers' ),
|
228 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite', 'library-page', 'my-favorites', 'upgrade-and-unlock' ),
|
229 |
+
),
|
230 |
+
array(
|
231 |
+
'text' => esc_html__( 'Learn more about all the features', 'insert-headers-and-footers' ),
|
232 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite', 'library-page', 'my-favorites', 'features' ),
|
233 |
+
),
|
234 |
+
array(
|
235 |
+
__( 'Load favorite snippets in the plugin', 'insert-headers-and-footers' ),
|
236 |
+
__( 'Import snippets from the WPCode Library', 'insert-headers-and-footers' ),
|
237 |
+
__( 'Save your snippets to the WPCode Library', 'insert-headers-and-footers' ),
|
238 |
+
__( 'Set up new websites faster', 'insert-headers-and-footers' ),
|
239 |
+
__( 'Easily implement features on multiple sites', 'insert-headers-and-footers' ),
|
240 |
+
__( 'Edit snippets in the WPCode Library', 'insert-headers-and-footers' ),
|
241 |
+
)
|
242 |
+
);
|
243 |
+
}
|
244 |
+
|
245 |
+
/**
|
246 |
+
* Get placeholder library items in a blurred box.
|
247 |
+
*
|
248 |
+
* @return void
|
249 |
+
*/
|
250 |
+
public function blurred_placeholder_items() {
|
251 |
+
$snippets = $this->get_placeholder_library_items();
|
252 |
+
echo '<div class="wpcode-blur-area">';
|
253 |
+
$this->get_library_markup( $snippets['categories'], $snippets['snippets'] );
|
254 |
+
echo '</div>';
|
255 |
+
}
|
256 |
+
|
257 |
+
/**
|
258 |
+
* Get an array of items for the library blurred background.
|
259 |
+
*
|
260 |
+
* @return array
|
261 |
+
*/
|
262 |
+
public function get_placeholder_library_items() {
|
263 |
+
$categories = array(
|
264 |
+
'*' => 'Most Popular',
|
265 |
+
'admin' => 'Admin',
|
266 |
+
'archive' => 'Archive',
|
267 |
+
'attachments' => 'Attachments',
|
268 |
+
'comments' => 'Comments',
|
269 |
+
'disable' => 'Disable',
|
270 |
+
'login' => 'Login',
|
271 |
+
'rss-feeds' => 'RSS Feeds',
|
272 |
+
'search' => 'Search',
|
273 |
+
);
|
274 |
+
|
275 |
+
$categories_parsed = array();
|
276 |
+
foreach ( $categories as $slug => $name ) {
|
277 |
+
$categories_parsed[] = array(
|
278 |
+
'slug' => $slug,
|
279 |
+
'name' => $name,
|
280 |
+
);
|
281 |
+
}
|
282 |
+
|
283 |
+
return array(
|
284 |
+
'categories' => $categories_parsed,
|
285 |
+
'snippets' => array(
|
286 |
+
array(
|
287 |
+
'library_id' => 0,
|
288 |
+
'title' => 'Add an Edit Post Link to Archives',
|
289 |
+
'code' => '',
|
290 |
+
'note' => 'Make it easier to edit posts when viewing archives. Or on single pages. If you...',
|
291 |
+
'categories' =>
|
292 |
+
array(
|
293 |
+
0 => 'archive',
|
294 |
+
),
|
295 |
+
'code_type' => 'php',
|
296 |
+
),
|
297 |
+
array(
|
298 |
+
'library_id' => 0,
|
299 |
+
'title' => 'Add Featured Images to RSS Feeds',
|
300 |
+
'code' => '',
|
301 |
+
'note' => 'Extend your site\'s RSS feeds by including featured images in the feed.',
|
302 |
+
'categories' =>
|
303 |
+
array(
|
304 |
+
0 => 'rss-feeds',
|
305 |
+
),
|
306 |
+
'code_type' => 'php',
|
307 |
+
),
|
308 |
+
array(
|
309 |
+
'library_id' => 0,
|
310 |
+
'title' => 'Add the Page Slug to Body Class',
|
311 |
+
'code' => '',
|
312 |
+
'note' => 'Add the page slug to the body class for better styling.',
|
313 |
+
'categories' =>
|
314 |
+
array(
|
315 |
+
0 => 'archive',
|
316 |
+
),
|
317 |
+
'code_type' => 'php',
|
318 |
+
),
|
319 |
+
array(
|
320 |
+
'library_id' => 0,
|
321 |
+
'title' => 'Allow SVG Files Upload',
|
322 |
+
'code' => '',
|
323 |
+
'note' => 'Add support for SVG files to be uploaded in WordPress media.',
|
324 |
+
'categories' =>
|
325 |
+
array(
|
326 |
+
0 => 'most-popular',
|
327 |
+
1 => 'attachments',
|
328 |
+
),
|
329 |
+
'code_type' => 'php',
|
330 |
+
),
|
331 |
+
array(
|
332 |
+
'library_id' => 0,
|
333 |
+
'title' => 'Automatically Link Featured Images to Posts',
|
334 |
+
'code' => '',
|
335 |
+
'note' => 'Wrap featured images in your theme in links to posts.',
|
336 |
+
'categories' =>
|
337 |
+
array(
|
338 |
+
0 => 'attachments',
|
339 |
+
),
|
340 |
+
'code_type' => 'php',
|
341 |
+
),
|
342 |
+
array(
|
343 |
+
'library_id' => 0,
|
344 |
+
'title' => 'Change "Howdy Admin" in Admin Bar',
|
345 |
+
'code' => '',
|
346 |
+
'note' => 'Customize the "Howdy" message in the admin bar.',
|
347 |
+
'categories' =>
|
348 |
+
array(
|
349 |
+
0 => 'admin',
|
350 |
+
),
|
351 |
+
'code_type' => 'php',
|
352 |
+
),
|
353 |
+
array(
|
354 |
+
'library_id' => 0,
|
355 |
+
'title' => 'Change Admin Panel Footer Text',
|
356 |
+
'code' => '',
|
357 |
+
'note' => 'Display custom text in the admin panel footer with this snippet.',
|
358 |
+
'categories' =>
|
359 |
+
array(
|
360 |
+
0 => 'admin',
|
361 |
+
),
|
362 |
+
'code_type' => 'php',
|
363 |
+
),
|
364 |
+
array(
|
365 |
+
'library_id' => 0,
|
366 |
+
'title' => 'Change Excerpt Length',
|
367 |
+
'code' => '',
|
368 |
+
'note' => 'Update the length of the Excerpts on your website using this snippet.',
|
369 |
+
'categories' =>
|
370 |
+
array(
|
371 |
+
0 => 'archive',
|
372 |
+
),
|
373 |
+
'code_type' => 'php',
|
374 |
+
),
|
375 |
+
array(
|
376 |
+
'library_id' => 0,
|
377 |
+
'title' => 'Change Read More Text for Excerpts',
|
378 |
+
'code' => '',
|
379 |
+
'note' => 'Customize the "Read More" text that shows up after excerpts.',
|
380 |
+
'categories' =>
|
381 |
+
array(
|
382 |
+
0 => 'archive',
|
383 |
+
),
|
384 |
+
'code_type' => 'php',
|
385 |
+
),
|
386 |
+
array(
|
387 |
+
'library_id' => 0,
|
388 |
+
'title' => 'Completely Disable Comments',
|
389 |
+
'code' => '',
|
390 |
+
'note' => 'Disable comments for all post types, in the admin and the frontend.',
|
391 |
+
'categories' =>
|
392 |
+
array(
|
393 |
+
0 => 'most-popular',
|
394 |
+
1 => 'comments',
|
395 |
+
),
|
396 |
+
'code_type' => 'php',
|
397 |
+
),
|
398 |
+
array(
|
399 |
+
'library_id' => 0,
|
400 |
+
'title' => 'Delay Posts in RSS Feeds',
|
401 |
+
'code' => '',
|
402 |
+
'note' => 'Add a delay before published posts show up in the RSS feeds.',
|
403 |
+
'categories' =>
|
404 |
+
array(
|
405 |
+
0 => 'rss-feeds',
|
406 |
+
),
|
407 |
+
'code_type' => 'php',
|
408 |
+
),
|
409 |
+
array(
|
410 |
+
'library_id' => 0,
|
411 |
+
'title' => 'Disable Attachment Pages',
|
412 |
+
'code' => '',
|
413 |
+
'note' => 'Hide the Attachment/Attachments pages on the frontend from all visitors.',
|
414 |
+
'categories' =>
|
415 |
+
array(
|
416 |
+
0 => 'most-popular',
|
417 |
+
1 => 'attachments',
|
418 |
+
),
|
419 |
+
'code_type' => 'php',
|
420 |
+
),
|
421 |
+
array(
|
422 |
+
'library_id' => 0,
|
423 |
+
'title' => 'Disable Automatic Updates',
|
424 |
+
'code' => '',
|
425 |
+
'note' => 'Use this snippet to completely disable automatic updates on your website.',
|
426 |
+
'categories' =>
|
427 |
+
array(
|
428 |
+
0 => 'most-popular',
|
429 |
+
1 => 'disable',
|
430 |
+
),
|
431 |
+
'code_type' => 'php',
|
432 |
+
),
|
433 |
+
array(
|
434 |
+
'library_id' => 0,
|
435 |
+
'title' => 'Disable Automatic Updates Emails',
|
436 |
+
'code' => '',
|
437 |
+
'note' => 'Stop getting emails about automatic updates on your WordPress site.',
|
438 |
+
'categories' =>
|
439 |
+
array(
|
440 |
+
0 => 'most-popular',
|
441 |
+
1 => 'disable',
|
442 |
+
),
|
443 |
+
'code_type' => 'php',
|
444 |
+
),
|
445 |
+
array(
|
446 |
+
'library_id' => 0,
|
447 |
+
'title' => 'Disable Gutenberg Editor (use Classic Editor)',
|
448 |
+
'code' => '',
|
449 |
+
'note' => 'Switch back to the Classic Editor by disablling the Block Editor.',
|
450 |
+
'categories' =>
|
451 |
+
array(
|
452 |
+
0 => 'most-popular',
|
453 |
+
1 => 'admin',
|
454 |
+
),
|
455 |
+
'code_type' => 'php',
|
456 |
+
),
|
457 |
+
),
|
458 |
+
);
|
459 |
+
}
|
460 |
+
|
461 |
+
/**
|
462 |
+
* Get the data handler for this page.
|
463 |
+
*
|
464 |
+
* @return WPCode_Library
|
465 |
+
*/
|
466 |
+
public function get_data_handler() {
|
467 |
+
if ( ! isset( $this->data_handler ) ) {
|
468 |
+
$this->data_handler = wpcode()->library;
|
469 |
+
}
|
470 |
+
|
471 |
+
return $this->data_handler;
|
472 |
+
}
|
473 |
+
|
474 |
}
|
includes/admin/pages/class-wpcode-admin-page-settings.php
CHANGED
@@ -22,14 +22,14 @@ class WPCode_Admin_Page_Settings extends WPCode_Admin_Page {
|
|
22 |
*
|
23 |
* @var string
|
24 |
*/
|
25 |
-
|
26 |
|
27 |
/**
|
28 |
* The nonce name field.
|
29 |
*
|
30 |
* @var string
|
31 |
*/
|
32 |
-
|
33 |
|
34 |
/**
|
35 |
* Call this just to set the page title translatable.
|
@@ -89,9 +89,37 @@ class WPCode_Admin_Page_Settings extends WPCode_Admin_Page {
|
|
89 |
'headers_footers_mode'
|
90 |
);
|
91 |
|
|
|
|
|
|
|
|
|
|
|
92 |
wp_nonce_field( $this->action, $this->nonce_name );
|
93 |
}
|
94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
|
96 |
/**
|
97 |
* For this page we output a title and the save button.
|
22 |
*
|
23 |
* @var string
|
24 |
*/
|
25 |
+
protected $action = 'wpcode-settings';
|
26 |
|
27 |
/**
|
28 |
* The nonce name field.
|
29 |
*
|
30 |
* @var string
|
31 |
*/
|
32 |
+
protected $nonce_name = 'wpcode-settings_nonce';
|
33 |
|
34 |
/**
|
35 |
* Call this just to set the page title translatable.
|
89 |
'headers_footers_mode'
|
90 |
);
|
91 |
|
92 |
+
$this->metabox_row(
|
93 |
+
__( 'WPCode Library Connection', 'insert-headers-and-footers' ),
|
94 |
+
$this->get_library_connection_input()
|
95 |
+
);
|
96 |
+
|
97 |
wp_nonce_field( $this->action, $this->nonce_name );
|
98 |
}
|
99 |
|
100 |
+
/**
|
101 |
+
* Get an input to connect or disconnect from the snippet library.
|
102 |
+
*
|
103 |
+
* @return string
|
104 |
+
*/
|
105 |
+
public function get_library_connection_input() {
|
106 |
+
$button_classes = array(
|
107 |
+
'wpcode-button',
|
108 |
+
);
|
109 |
+
$button_text = __( 'Connect to the WPCode Library', 'insert-headers-and-footers' );
|
110 |
+
if ( WPCode()->library_auth->has_auth() ) {
|
111 |
+
$button_classes[] = 'wpcode-delete-auth';
|
112 |
+
$button_text = __( 'Disconnect from the WPCode Library', 'insert-headers-and-footers' );
|
113 |
+
} else {
|
114 |
+
$button_classes[] = 'wpcode-start-auth';
|
115 |
+
}
|
116 |
+
|
117 |
+
return sprintf(
|
118 |
+
'<button type="button" class="%1$s">%2$s</button>',
|
119 |
+
esc_attr( implode( ' ', $button_classes ) ),
|
120 |
+
esc_html( $button_text )
|
121 |
+
);
|
122 |
+
}
|
123 |
|
124 |
/**
|
125 |
* For this page we output a title and the save button.
|
includes/admin/pages/class-wpcode-admin-page-snippet-manager.php
CHANGED
@@ -39,26 +39,26 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
39 |
*
|
40 |
* @var string
|
41 |
*/
|
42 |
-
|
43 |
|
44 |
/**
|
45 |
* The name of the nonce used for saving.
|
46 |
*
|
47 |
* @var string
|
48 |
*/
|
49 |
-
|
50 |
/**
|
51 |
* The snippet id.
|
52 |
*
|
53 |
* @var int
|
54 |
*/
|
55 |
-
|
56 |
/**
|
57 |
* The snippet instance.
|
58 |
*
|
59 |
* @var WPCode_Snippet
|
60 |
*/
|
61 |
-
|
62 |
|
63 |
/**
|
64 |
* Constructor.
|
@@ -215,8 +215,9 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
215 |
$this->field_title();
|
216 |
$this->field_code_editor();
|
217 |
$this->field_insert_options();
|
218 |
-
$this->field_basic_info();
|
219 |
$this->field_conditional_logic();
|
|
|
|
|
220 |
$this->hidden_fields();
|
221 |
wp_nonce_field( $this->action, $this->nonce_name );
|
222 |
}
|
@@ -260,13 +261,14 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
260 |
esc_html__( 'To speed up the process you can select from one of our pre-made library, or you can start with a %1$sblank snippet%2$s and %1$screate your own%2$s. Have a suggestion for new snippet? %3$sWe’d love to hear it!%4$s', 'insert-headers-and-footers' ),
|
261 |
'<a href="' . esc_url( $custom_url ) . '">',
|
262 |
'</a>',
|
263 |
-
'<a href="' . esc_url( wpcode_utm_url( 'https://wpcode.com/suggestions/?wpf78_8=Snippet Request', 'add-new', '
|
264 |
'</a>'
|
265 |
);
|
266 |
?>
|
267 |
</div>
|
268 |
<?php
|
269 |
$this->get_library_markup( $categories, $snippets );
|
|
|
270 |
}
|
271 |
|
272 |
/**
|
@@ -371,21 +373,14 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
371 |
) . $this->get_insert_number_descriptions(),
|
372 |
'wpcode_auto_insert_number',
|
373 |
'#wpcode_auto_insert_location',
|
374 |
-
implode(
|
375 |
-
',',
|
376 |
-
array(
|
377 |
-
'before_paragraph',
|
378 |
-
'after_paragraph',
|
379 |
-
'archive_before_post',
|
380 |
-
'archive_after_post',
|
381 |
-
)
|
382 |
-
)
|
383 |
);
|
384 |
?>
|
385 |
</div>
|
386 |
<div class="wpcode-shortcode-form-fields" data-show-if-id="#wpcode_auto_insert" data-show-if-value="0">
|
387 |
<?php
|
388 |
$this->metabox_row( __( 'Shortcode', 'insert-headers-and-footers' ), $shortcode_field, 'wpcode_shortcode' );
|
|
|
389 |
?>
|
390 |
</div>
|
391 |
</div>
|
@@ -476,9 +471,8 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
476 |
* @see WPCode_Auto_Insert
|
477 |
*/
|
478 |
public function get_input_auto_insert_options() {
|
479 |
-
$
|
480 |
-
$
|
481 |
-
$location_terms = wp_get_post_terms(
|
482 |
$this->snippet_id,
|
483 |
'wpcode_location',
|
484 |
array(
|
@@ -489,35 +483,8 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
489 |
if ( ! empty( $location_terms ) ) {
|
490 |
$location = $location_terms[0];
|
491 |
}
|
492 |
-
|
493 |
-
|
494 |
-
<select name="wpcode_auto_insert_location" id="wpcode_auto_insert_location">
|
495 |
-
<?php
|
496 |
-
foreach ( $available_types as $type ) {
|
497 |
-
$options = $type->get_locations();
|
498 |
-
if ( empty( $options ) ) {
|
499 |
-
continue;
|
500 |
-
}
|
501 |
-
?>
|
502 |
-
<optgroup label="<?php echo esc_attr( $type->get_label() ); ?>" data-code-type="<?php echo esc_attr( $type->code_type ); ?>">
|
503 |
-
<?php
|
504 |
-
foreach ( $options as $key => $label ) {
|
505 |
-
$disabled = false;
|
506 |
-
if ( 'all' !== $type->code_type && $type->code_type !== $this->code_type ) {
|
507 |
-
$disabled = true;
|
508 |
-
}
|
509 |
-
?>
|
510 |
-
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $location, $key ); ?> <?php disabled( $disabled ); ?>>
|
511 |
-
<?php echo esc_html( $label ); ?>
|
512 |
-
</option>
|
513 |
-
<?php } ?>
|
514 |
-
</optgroup>
|
515 |
-
<?php
|
516 |
-
}
|
517 |
-
?>
|
518 |
-
</select>
|
519 |
-
<?php
|
520 |
-
return ob_get_clean();
|
521 |
}
|
522 |
|
523 |
/**
|
@@ -534,12 +501,7 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
534 |
'<input type="text" value=\'%1$s\' id="wpcode-shortcode" class="wpcode-input-text" readonly />',
|
535 |
$shortcode
|
536 |
);
|
537 |
-
$button =
|
538 |
-
'<button class="wpcode-button wpcode-button-icon wpcode-button-secondary wpcode-copy-target" data-target="#wpcode-shortcode" type="button"><span class="wpcode-default-icon">%1$s</span><span class="wpcode-success-icon">%2$s</span> %3$s</button>',
|
539 |
-
get_wpcode_icon( 'copy', 16, 16 ),
|
540 |
-
get_wpcode_icon( 'check', 16, 13 ),
|
541 |
-
_x( 'Copy', 'Copy to clipboard', 'insert-headers-and-footers' )
|
542 |
-
);
|
543 |
|
544 |
return sprintf( '<div class="wpcode-input-with-button">%1$s %2$s</div>', $input, $button );
|
545 |
}
|
@@ -692,26 +654,60 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
692 |
* @return void
|
693 |
*/
|
694 |
public function output_header_bottom() {
|
695 |
-
$active = isset( $this->snippet ) && $this->snippet->is_active();
|
696 |
?>
|
697 |
<div class="wpcode-column">
|
698 |
<h1><?php echo esc_html( $this->header_title ); ?></h1>
|
699 |
</div>
|
700 |
-
<?php
|
|
|
|
|
701 |
return;
|
702 |
-
}
|
|
|
703 |
<div class="wpcode-column">
|
704 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
705 |
<span data-show-if-id="#wpcode_active" data-show-if-value="1" style="display: none">
|
706 |
<?php esc_html_e( 'Active', 'insert-headers-and-footers' ); ?>
|
707 |
</span>
|
708 |
-
|
709 |
<?php esc_html_e( 'Inactive', 'insert-headers-and-footers' ); ?>
|
710 |
</span>
|
711 |
-
</div>
|
712 |
-
<?php echo $this->get_checkbox_toggle( $active, 'wpcode_active' ); ?>
|
713 |
-
<button class="wpcode-button" type="submit" value="publish" name="button"><?php echo esc_html( $this->publish_button_text ); ?></button>
|
714 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
715 |
<?php
|
716 |
}
|
717 |
|
@@ -735,6 +731,19 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
735 |
$snippet_code = wpautop( $snippet_code );
|
736 |
}
|
737 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
738 |
$snippet = new WPCode_Snippet(
|
739 |
array(
|
740 |
'id' => empty( $_REQUEST['id'] ) ? 0 : absint( $_REQUEST['id'] ),
|
@@ -745,7 +754,7 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
745 |
'location' => isset( $_POST['wpcode_auto_insert_location'] ) ? sanitize_text_field( wp_unslash( $_POST['wpcode_auto_insert_location'] ) ) : '',
|
746 |
'insert_number' => isset( $_POST['wpcode_auto_insert_number'] ) ? absint( $_POST['wpcode_auto_insert_number'] ) : 0,
|
747 |
'auto_insert' => isset( $_POST['wpcode_auto_insert'] ) ? absint( $_POST['wpcode_auto_insert'] ) : 0,
|
748 |
-
'tags' =>
|
749 |
'use_rules' => isset( $_POST['wpcode_conditional_logic_enable'] ),
|
750 |
'rules' => isset( $_POST['wpcode_cl_rules'] ) ? json_decode( sanitize_text_field( wp_unslash( $_POST['wpcode_cl_rules'] ) ), true ) : array(),
|
751 |
'priority' => isset( $_POST['wpcode_priority'] ) ? intval( $_POST['wpcode_priority'] ) : 10,
|
@@ -765,6 +774,8 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
765 |
$message_number = 2;
|
766 |
}
|
767 |
|
|
|
|
|
768 |
$id = $snippet->save();
|
769 |
|
770 |
if ( $active_wanted !== $snippet->is_active() ) {
|
@@ -799,26 +810,14 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
799 |
if ( $this->show_library ) {
|
800 |
return;
|
801 |
}
|
802 |
-
$settings = $this->load_code_mirror();
|
803 |
|
804 |
-
|
805 |
-
|
806 |
-
|
|
|
807 |
|
808 |
-
|
809 |
-
|
810 |
-
$settings['codemirror'] = array_merge(
|
811 |
-
array(
|
812 |
-
'autoCloseTags' => true,
|
813 |
-
'matchTags' => array(
|
814 |
-
'bothTags' => true,
|
815 |
-
),
|
816 |
-
),
|
817 |
-
$settings['codemirror']
|
818 |
-
);
|
819 |
-
}
|
820 |
-
|
821 |
-
wp_add_inline_script( 'code-editor', sprintf( 'jQuery( function() { window.wpcode_editor = wp.codeEditor.initialize( "wpcode_snippet_code", %s ); } );', wp_json_encode( $settings ) ) );
|
822 |
}
|
823 |
|
824 |
/**
|
@@ -930,7 +929,7 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
930 |
case 'select':
|
931 |
$markup = '<select>';
|
932 |
foreach ( $data['options'] as $option ) {
|
933 |
-
$markup .= '<option value="' . esc_attr( $option['value'] ) . '" ' . selected( $value, $option['value'], false ) . '>' . esc_html( $option['label'] ) . '</option>';
|
934 |
}
|
935 |
$markup .= '</select>';
|
936 |
break;
|
@@ -988,7 +987,22 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
988 |
foreach ( $options as $opt_group ) {
|
989 |
$markup .= '<optgroup label="' . esc_attr( $opt_group['label'] ) . '" data-type="' . esc_attr( $opt_group['name'] ) . '">';
|
990 |
foreach ( $opt_group['options'] as $key => $option ) {
|
991 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
992 |
}
|
993 |
$markup .= '</optgroup>';
|
994 |
}
|
@@ -1010,12 +1024,7 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
1010 |
* @return string
|
1011 |
*/
|
1012 |
private function get_conditions_relation_select( $relation = '' ) {
|
1013 |
-
$options =
|
1014 |
-
'=' => __( 'Is', 'insert-headers-and-footers' ),
|
1015 |
-
'!=' => __( 'Is not', 'insert-headers-and-footers' ),
|
1016 |
-
'contains' => __( 'Contains', 'insert-headers-and-footers' ),
|
1017 |
-
'notcontains' => __( 'Doesn\'t Contain', 'insert-headers-and-footers' ),
|
1018 |
-
);
|
1019 |
$markup = '<select class="wpcode-cl-rule-relation">';
|
1020 |
foreach ( $options as $value => $label ) {
|
1021 |
$markup .= '<option value="' . esc_attr( $value ) . '" ' . selected( $relation, $value, false ) . '>' . esc_html( $label ) . '</option>';
|
@@ -1053,6 +1062,14 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
1053 |
$data['conditions'] = wpcode()->conditional_logic->get_all_admin_options();
|
1054 |
}
|
1055 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1056 |
return $data;
|
1057 |
}
|
1058 |
|
@@ -1070,4 +1087,204 @@ class WPCode_Admin_Page_Snippet_Manager extends WPCode_Admin_Page {
|
|
1070 |
|
1071 |
return $body_class;
|
1072 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1073 |
}
|
39 |
*
|
40 |
* @var string
|
41 |
*/
|
42 |
+
protected $action = 'wpcode-save-snippet';
|
43 |
|
44 |
/**
|
45 |
* The name of the nonce used for saving.
|
46 |
*
|
47 |
* @var string
|
48 |
*/
|
49 |
+
protected $nonce_name = 'wpcode-save-snippet-nonce';
|
50 |
/**
|
51 |
* The snippet id.
|
52 |
*
|
53 |
* @var int
|
54 |
*/
|
55 |
+
protected $snippet_id;
|
56 |
/**
|
57 |
* The snippet instance.
|
58 |
*
|
59 |
* @var WPCode_Snippet
|
60 |
*/
|
61 |
+
protected $snippet;
|
62 |
|
63 |
/**
|
64 |
* Constructor.
|
215 |
$this->field_title();
|
216 |
$this->field_code_editor();
|
217 |
$this->field_insert_options();
|
|
|
218 |
$this->field_conditional_logic();
|
219 |
+
$this->field_code_revisions();
|
220 |
+
$this->field_basic_info();
|
221 |
$this->hidden_fields();
|
222 |
wp_nonce_field( $this->action, $this->nonce_name );
|
223 |
}
|
261 |
esc_html__( 'To speed up the process you can select from one of our pre-made library, or you can start with a %1$sblank snippet%2$s and %1$screate your own%2$s. Have a suggestion for new snippet? %3$sWe’d love to hear it!%4$s', 'insert-headers-and-footers' ),
|
262 |
'<a href="' . esc_url( $custom_url ) . '">',
|
263 |
'</a>',
|
264 |
+
'<a href="' . esc_url( wpcode_utm_url( 'https://wpcode.com/suggestions/?wpf78_8=Snippet Request', 'add-new', 'suggestions' ) ) . '" target="_blank">',
|
265 |
'</a>'
|
266 |
);
|
267 |
?>
|
268 |
</div>
|
269 |
<?php
|
270 |
$this->get_library_markup( $categories, $snippets );
|
271 |
+
$this->library_preview_modal_content();
|
272 |
}
|
273 |
|
274 |
/**
|
373 |
) . $this->get_insert_number_descriptions(),
|
374 |
'wpcode_auto_insert_number',
|
375 |
'#wpcode_auto_insert_location',
|
376 |
+
implode( ',', wpcode_get_auto_insert_locations_with_number() )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
);
|
378 |
?>
|
379 |
</div>
|
380 |
<div class="wpcode-shortcode-form-fields" data-show-if-id="#wpcode_auto_insert" data-show-if-value="0">
|
381 |
<?php
|
382 |
$this->metabox_row( __( 'Shortcode', 'insert-headers-and-footers' ), $shortcode_field, 'wpcode_shortcode' );
|
383 |
+
$this->get_input_row_custom_shortcode();
|
384 |
?>
|
385 |
</div>
|
386 |
</div>
|
471 |
* @see WPCode_Auto_Insert
|
472 |
*/
|
473 |
public function get_input_auto_insert_options() {
|
474 |
+
$location = '';
|
475 |
+
$location_terms = wp_get_post_terms(
|
|
|
476 |
$this->snippet_id,
|
477 |
'wpcode_location',
|
478 |
array(
|
483 |
if ( ! empty( $location_terms ) ) {
|
484 |
$location = $location_terms[0];
|
485 |
}
|
486 |
+
|
487 |
+
return wpcode_get_auto_insert_location_picker( $location, $this->code_type );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
488 |
}
|
489 |
|
490 |
/**
|
501 |
'<input type="text" value=\'%1$s\' id="wpcode-shortcode" class="wpcode-input-text" readonly />',
|
502 |
$shortcode
|
503 |
);
|
504 |
+
$button = wpcode_get_copy_target_button( 'wpcode-shortcode' );
|
|
|
|
|
|
|
|
|
|
|
505 |
|
506 |
return sprintf( '<div class="wpcode-input-with-button">%1$s %2$s</div>', $input, $button );
|
507 |
}
|
654 |
* @return void
|
655 |
*/
|
656 |
public function output_header_bottom() {
|
|
|
657 |
?>
|
658 |
<div class="wpcode-column">
|
659 |
<h1><?php echo esc_html( $this->header_title ); ?></h1>
|
660 |
</div>
|
661 |
+
<?php
|
662 |
+
// If we're displaying the libray screen, return early and hide right-side buttons.
|
663 |
+
if ( $this->show_library ) {
|
664 |
return;
|
665 |
+
}
|
666 |
+
?>
|
667 |
<div class="wpcode-column">
|
668 |
+
<?php $this->header_buttons(); ?>
|
669 |
+
</div>
|
670 |
+
<?php
|
671 |
+
}
|
672 |
+
|
673 |
+
/**
|
674 |
+
* Add header buttons on the right side of the header.
|
675 |
+
*
|
676 |
+
* @return void
|
677 |
+
*/
|
678 |
+
public function header_buttons() {
|
679 |
+
$active = isset( $this->snippet ) && $this->snippet->is_active();
|
680 |
+
$this->save_to_library_button();
|
681 |
+
?>
|
682 |
+
<div class="wpcode-status-text">
|
683 |
<span data-show-if-id="#wpcode_active" data-show-if-value="1" style="display: none">
|
684 |
<?php esc_html_e( 'Active', 'insert-headers-and-footers' ); ?>
|
685 |
</span>
|
686 |
+
<span data-show-if-id="#wpcode_active" data-show-if-value="0" style="display:none;">
|
687 |
<?php esc_html_e( 'Inactive', 'insert-headers-and-footers' ); ?>
|
688 |
</span>
|
|
|
|
|
|
|
689 |
</div>
|
690 |
+
<?php echo $this->get_checkbox_toggle( $active, 'wpcode_active' ); ?>
|
691 |
+
<button class="wpcode-button" type="submit" value="publish" name="button"><?php echo esc_html( $this->publish_button_text ); ?></button>
|
692 |
+
<?php
|
693 |
+
}
|
694 |
+
|
695 |
+
/**
|
696 |
+
* Markup for the save to library button.
|
697 |
+
*
|
698 |
+
* @return void
|
699 |
+
*/
|
700 |
+
public function save_to_library_button() {
|
701 |
+
?>
|
702 |
+
<button
|
703 |
+
class="wpcode-button wpcode-button-text wpcode-button-save-to-library"
|
704 |
+
id="wpcode_save_to_library"
|
705 |
+
type="button">
|
706 |
+
<?php
|
707 |
+
wpcode_icon( 'cloud', 16, 12 );
|
708 |
+
esc_html_e( 'Save to Library', 'wpcode-premium' );
|
709 |
+
?>
|
710 |
+
</button>
|
711 |
<?php
|
712 |
}
|
713 |
|
731 |
$snippet_code = wpautop( $snippet_code );
|
732 |
}
|
733 |
|
734 |
+
$tags = array();
|
735 |
+
|
736 |
+
if ( isset( $_POST['wpcode_tags'] ) ) {
|
737 |
+
$tags = trim( sanitize_text_field( wp_unslash( $_POST['wpcode_tags'] ) ) );
|
738 |
+
if ( ! empty( $tags ) ) {
|
739 |
+
$tags = explode( ',', $tags );
|
740 |
+
}
|
741 |
+
}
|
742 |
+
|
743 |
+
if ( 'php' === $code_type ) {
|
744 |
+
$snippet_code = preg_replace( '|^\s*<\?(php)?|', '', $snippet_code );
|
745 |
+
}
|
746 |
+
|
747 |
$snippet = new WPCode_Snippet(
|
748 |
array(
|
749 |
'id' => empty( $_REQUEST['id'] ) ? 0 : absint( $_REQUEST['id'] ),
|
754 |
'location' => isset( $_POST['wpcode_auto_insert_location'] ) ? sanitize_text_field( wp_unslash( $_POST['wpcode_auto_insert_location'] ) ) : '',
|
755 |
'insert_number' => isset( $_POST['wpcode_auto_insert_number'] ) ? absint( $_POST['wpcode_auto_insert_number'] ) : 0,
|
756 |
'auto_insert' => isset( $_POST['wpcode_auto_insert'] ) ? absint( $_POST['wpcode_auto_insert'] ) : 0,
|
757 |
+
'tags' => $tags,
|
758 |
'use_rules' => isset( $_POST['wpcode_conditional_logic_enable'] ),
|
759 |
'rules' => isset( $_POST['wpcode_cl_rules'] ) ? json_decode( sanitize_text_field( wp_unslash( $_POST['wpcode_cl_rules'] ) ), true ) : array(),
|
760 |
'priority' => isset( $_POST['wpcode_priority'] ) ? intval( $_POST['wpcode_priority'] ) : 10,
|
774 |
$message_number = 2;
|
775 |
}
|
776 |
|
777 |
+
$this->add_extra_snippet_data( $snippet );
|
778 |
+
|
779 |
$id = $snippet->save();
|
780 |
|
781 |
if ( $active_wanted !== $snippet->is_active() ) {
|
810 |
if ( $this->show_library ) {
|
811 |
return;
|
812 |
}
|
|
|
813 |
|
814 |
+
$editor = new WPCode_Code_Editor( $this->code_type );
|
815 |
+
$editor->load_hint_scripts();
|
816 |
+
$editor->set_setting( 'autoCloseTags', true );
|
817 |
+
$editor->set_setting( 'matchTags', array( 'bothTags' => true ) );
|
818 |
|
819 |
+
$editor->register_editor( 'wpcode_snippet_code' );
|
820 |
+
$editor->init_editor();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
821 |
}
|
822 |
|
823 |
/**
|
929 |
case 'select':
|
930 |
$markup = '<select>';
|
931 |
foreach ( $data['options'] as $option ) {
|
932 |
+
$markup .= '<option value="' . esc_attr( $option['value'] ) . '" ' . selected( $value, $option['value'], false ) . ' ' . disabled( isset( $option['disabled'] ) && $option['disabled'], true, false ) . '>' . esc_html( $option['label'] ) . '</option>';
|
933 |
}
|
934 |
$markup .= '</select>';
|
935 |
break;
|
987 |
foreach ( $options as $opt_group ) {
|
988 |
$markup .= '<optgroup label="' . esc_attr( $opt_group['label'] ) . '" data-type="' . esc_attr( $opt_group['name'] ) . '">';
|
989 |
foreach ( $opt_group['options'] as $key => $option ) {
|
990 |
+
$data_attrs = '';
|
991 |
+
if ( isset( $option['upgrade'] ) && is_array( $option['upgrade'] ) ) {
|
992 |
+
if ( isset( $option['upgrade']['title'] ) ) {
|
993 |
+
$data_attrs = 'data-upgrade-title= "' . esc_attr( $option['upgrade']['title'] ) . '"';
|
994 |
+
}
|
995 |
+
if ( isset( $option['upgrade']['text'] ) ) {
|
996 |
+
$data_attrs .= ' data-upgrade-text="' . esc_attr( $option['upgrade']['text'] ) . '"';
|
997 |
+
}
|
998 |
+
if ( isset( $option['upgrade']['link'] ) ) {
|
999 |
+
$data_attrs .= ' data-upgrade-link="' . esc_attr( $option['upgrade']['link'] ) . '"';
|
1000 |
+
}
|
1001 |
+
if ( isset( $option['upgrade']['button'] ) ) {
|
1002 |
+
$data_attrs .= ' data-upgrade-button="' . esc_attr( $option['upgrade']['button'] ) . '"';
|
1003 |
+
}
|
1004 |
+
}
|
1005 |
+
$markup .= '<option value="' . esc_attr( $key ) . '" ' . selected( $type, $key, false ) . ' ' . disabled( isset( $option['disabled'] ) && $option['disabled'], true, false ) . $data_attrs . '>' . esc_html( $option['label'] ) . '</option>';
|
1006 |
}
|
1007 |
$markup .= '</optgroup>';
|
1008 |
}
|
1024 |
* @return string
|
1025 |
*/
|
1026 |
private function get_conditions_relation_select( $relation = '' ) {
|
1027 |
+
$options = wpcode_get_conditions_relation_labels();
|
|
|
|
|
|
|
|
|
|
|
1028 |
$markup = '<select class="wpcode-cl-rule-relation">';
|
1029 |
foreach ( $options as $value => $label ) {
|
1030 |
$markup .= '<option value="' . esc_attr( $value ) . '" ' . selected( $relation, $value, false ) . '>' . esc_html( $label ) . '</option>';
|
1062 |
$data['conditions'] = wpcode()->conditional_logic->get_all_admin_options();
|
1063 |
}
|
1064 |
|
1065 |
+
$data['save_to_library_url'] = wpcode_utm_url( 'https://wpcode.com/lite/', 'snippet-editor', 'save-to-library', 'upgrade-to-pro' );
|
1066 |
+
$data['save_to_library_title'] = __( 'Save to Library is a Pro Feature', 'insert-headers-and-footers' );
|
1067 |
+
$data['save_to_library_text'] = __( 'Upgrade to PRO today and save your private snippets to the WPCode library for easy access. You can also share your snippets with other users or load them on other sites.', 'insert-headers-and-footers' );
|
1068 |
+
$data['save_to_library_button'] = __( 'Upgrade to PRO', 'insert-headers-and-footers' );
|
1069 |
+
$data['shortcode_title'] = __( 'Custom Shortcode is a Pro Feature', 'insert-headers-and-footers' );
|
1070 |
+
$data['shortcode_text'] = __( 'Upgrade today to use a custom shortcode and nerver worry about changing snippet ids again, even when importing your snippets to another site. You\'ll also get access to a private library that makes setting up new sites a lot easier.', 'insert-headers-and-footers' );
|
1071 |
+
$data['shortcode_url'] = wpcode_utm_url( 'https://wpcode.com/lite', 'snippet-editor', 'custom-shortcode', 'modal' );
|
1072 |
+
|
1073 |
return $data;
|
1074 |
}
|
1075 |
|
1087 |
|
1088 |
return $body_class;
|
1089 |
}
|
1090 |
+
|
1091 |
+
/**
|
1092 |
+
* Get the markup of the custom shortcode row.
|
1093 |
+
*
|
1094 |
+
* @return void
|
1095 |
+
*/
|
1096 |
+
public function get_input_row_custom_shortcode() {
|
1097 |
+
$this->metabox_row(
|
1098 |
+
__( 'Custom Shortcode', 'insert-headers-and-footers' ),
|
1099 |
+
sprintf(
|
1100 |
+
'<input type="text" placeholder="%s" class="wpcode-input-text" id="wpcode-custom-shortcode-lite" readonly />',
|
1101 |
+
__( 'Shortcode name', 'insert-headers-and-footers' )
|
1102 |
+
),
|
1103 |
+
'',
|
1104 |
+
'',
|
1105 |
+
'',
|
1106 |
+
__( 'Use this field to define a custom shortcode name instead of the id-based one.', 'insert-headers-and-footers' ),
|
1107 |
+
true
|
1108 |
+
);
|
1109 |
+
}
|
1110 |
+
|
1111 |
+
/**
|
1112 |
+
* Add extra snippet data.
|
1113 |
+
*
|
1114 |
+
* @param WPCode_Snippet $snippet Snippet about to be saved, passed by reference.
|
1115 |
+
*
|
1116 |
+
* @return void
|
1117 |
+
*/
|
1118 |
+
public function add_extra_snippet_data( &$snippet ) {
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
/**
|
1122 |
+
* Markup for the code revisions metabox.
|
1123 |
+
*
|
1124 |
+
* @return void
|
1125 |
+
*/
|
1126 |
+
public function field_code_revisions() {
|
1127 |
+
if ( ! isset( $this->snippet_id ) ) {
|
1128 |
+
return;
|
1129 |
+
}
|
1130 |
+
$html = sprintf(
|
1131 |
+
'<p>%s</p><hr />',
|
1132 |
+
esc_html__( 'As you make changes to your snippet and save, you will get a list of previous versions with all the changes made in each revision. You can compare revisions to the current version or see changes as they have been saved by going through each revision. Any of the revisions can then be restored as needed.', 'wpcode-premium' )
|
1133 |
+
);
|
1134 |
+
|
1135 |
+
$html .= $this->code_revisions_list();
|
1136 |
+
$this->metabox(
|
1137 |
+
__( 'Code Revisions', 'insert-headers-and-footers' ),
|
1138 |
+
$html,
|
1139 |
+
__( 'Easily switch back to a previous version of your snippet.', 'insert-headers-and-footers' )
|
1140 |
+
);
|
1141 |
+
}
|
1142 |
+
|
1143 |
+
/**
|
1144 |
+
* Get a list of code revisions to use behind the notice.
|
1145 |
+
*
|
1146 |
+
* @return string
|
1147 |
+
*/
|
1148 |
+
public function get_code_revisions_empty_list() {
|
1149 |
+
$list = array();
|
1150 |
+
$post_modified = strtotime( $this->snippet->get_post_data()->post_modified );
|
1151 |
+
$revisions_data = array(
|
1152 |
+
$post_modified,
|
1153 |
+
$post_modified - DAY_IN_SECONDS,
|
1154 |
+
$post_modified - WEEK_IN_SECONDS,
|
1155 |
+
$post_modified - 2 * WEEK_IN_SECONDS,
|
1156 |
+
$post_modified - MONTH_IN_SECONDS,
|
1157 |
+
$post_modified - 2 * MONTH_IN_SECONDS,
|
1158 |
+
);
|
1159 |
+
|
1160 |
+
$compare = sprintf(
|
1161 |
+
'<span>%s</span>',
|
1162 |
+
esc_html__( 'Compare', 'wpcode-premium' )
|
1163 |
+
);
|
1164 |
+
$view = sprintf(
|
1165 |
+
'<span>%s</a>',
|
1166 |
+
get_wpcode_icon( 'eye', 16, 11, '0 0 16 11' )
|
1167 |
+
);
|
1168 |
+
|
1169 |
+
foreach ( $revisions_data as $revisions_date ) {
|
1170 |
+
$updated = sprintf(
|
1171 |
+
// Translators: time since the revision has been updated.
|
1172 |
+
esc_html__( 'Updated %s ago', 'wpcode-premium' ),
|
1173 |
+
human_time_diff( $revisions_date )
|
1174 |
+
);
|
1175 |
+
|
1176 |
+
$list[] = $this->get_revision_item(
|
1177 |
+
$this->snippet->get_snippet_author(),
|
1178 |
+
$updated,
|
1179 |
+
array(
|
1180 |
+
$compare,
|
1181 |
+
$view,
|
1182 |
+
)
|
1183 |
+
);
|
1184 |
+
}
|
1185 |
+
|
1186 |
+
$html = '<div class="wpcode-blur-area">';
|
1187 |
+
|
1188 |
+
$html .= sprintf(
|
1189 |
+
'<ul class="wpcode-revisions-list">%s</ul>',
|
1190 |
+
implode( '', $list )
|
1191 |
+
);
|
1192 |
+
|
1193 |
+
$button_text = sprintf(
|
1194 |
+
// Translators: The placeholder gets replaced with the extra number of revisions available.
|
1195 |
+
esc_html__( '%d Other Revisions', 'wpcode-premium' ),
|
1196 |
+
3
|
1197 |
+
);
|
1198 |
+
|
1199 |
+
$html .= sprintf(
|
1200 |
+
'<button type="button" class="wpcode-button wpcode-button-secondary wpcode-button-icon" id="wpcode-show-all-snippets">%1$s %2$s</button>',
|
1201 |
+
get_wpcode_icon( 'rewind', 16, 14 ),
|
1202 |
+
$button_text
|
1203 |
+
);
|
1204 |
+
|
1205 |
+
$html .= '</div>';// .wpcode-blur-area.
|
1206 |
+
|
1207 |
+
return $html;
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
/**
|
1211 |
+
* List of code revision items.
|
1212 |
+
*
|
1213 |
+
* @return string
|
1214 |
+
*/
|
1215 |
+
public function code_revisions_list() {
|
1216 |
+
return $this->code_revisions_list_with_notice(
|
1217 |
+
esc_html__( 'Code Revisions is a Pro Feature', 'insert-headers-and-footers' ),
|
1218 |
+
sprintf(
|
1219 |
+
'<p>%s</p>',
|
1220 |
+
esc_html__( 'Upgrade to WPCode Pro today and start tracking revisions and see exactly who, when and which changes were made to your snippet.', 'insert-headers-and-footers' )
|
1221 |
+
),
|
1222 |
+
array(
|
1223 |
+
'text' => esc_html__( 'Upgrade to Pro and Unlock Revisions', 'insert-headers-and-footers' ),
|
1224 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite', 'snippet-editor', 'revisions', 'upgrade-to-pro' ),
|
1225 |
+
),
|
1226 |
+
array(
|
1227 |
+
'text' => esc_html__( 'Learn more about all the features', 'insert-headers-and-footers' ),
|
1228 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite', 'snippet-editor', 'revisions', 'features' ),
|
1229 |
+
)
|
1230 |
+
);
|
1231 |
+
}
|
1232 |
+
|
1233 |
+
/**
|
1234 |
+
* Get a code revisions list with a notice on top.
|
1235 |
+
*
|
1236 |
+
* @param string $title The title for the notice.
|
1237 |
+
* @param string $description Description or text below the title.
|
1238 |
+
* @param array $button_1 Button 1 params for the get_upsell_box method.
|
1239 |
+
* @param array $button_2 Button 2 params for the get_upsell_box method.
|
1240 |
+
*
|
1241 |
+
* @return string
|
1242 |
+
*/
|
1243 |
+
public function code_revisions_list_with_notice( $title, $description = '', $button_1 = array(), $button_2 = array() ) {
|
1244 |
+
$html = '<div class="wpcode-revisions-list-area">';
|
1245 |
+
|
1246 |
+
$html .= $this->get_code_revisions_empty_list();
|
1247 |
+
$html .= WPCode_Admin_Page::get_upsell_box(
|
1248 |
+
$title,
|
1249 |
+
$description,
|
1250 |
+
$button_1,
|
1251 |
+
$button_2
|
1252 |
+
);
|
1253 |
+
$html .= '</div>';// .wpcode-revisions-list-area.
|
1254 |
+
|
1255 |
+
return $html;
|
1256 |
+
}
|
1257 |
+
|
1258 |
+
/**
|
1259 |
+
* Get the markup for a revision item in the list of revisions.
|
1260 |
+
*
|
1261 |
+
* @param int $author_id The author id to display the avatar and name for.
|
1262 |
+
* @param string $date The date used to display time passed.
|
1263 |
+
* @param array $actions Links specific to this row.
|
1264 |
+
*
|
1265 |
+
* @return string
|
1266 |
+
*/
|
1267 |
+
public function get_revision_item( $author_id, $date, $actions = array() ) {
|
1268 |
+
$list_item = '<li class="wpcode-revision-list-item">';
|
1269 |
+
|
1270 |
+
$list_item .= get_avatar( $author_id, 30 );
|
1271 |
+
$list_item .= sprintf(
|
1272 |
+
'<span class="wpcode-revision-list-author">%s</span>',
|
1273 |
+
get_the_author_meta( 'display_name', $author_id )
|
1274 |
+
);
|
1275 |
+
$list_item .= sprintf(
|
1276 |
+
'<span class="wpcode-revision-list-date">%s</span>',
|
1277 |
+
$date
|
1278 |
+
);
|
1279 |
+
if ( ! empty( $actions ) ) {
|
1280 |
+
$list_item .= sprintf(
|
1281 |
+
'<span class="wpcode-revision-list-item-actions">%s</span>',
|
1282 |
+
implode( '', $actions )
|
1283 |
+
);
|
1284 |
+
}
|
1285 |
+
$list_item .= '</li>';
|
1286 |
+
|
1287 |
+
return $list_item;
|
1288 |
+
}
|
1289 |
+
|
1290 |
}
|
includes/admin/pages/class-wpcode-admin-page-tools.php
CHANGED
@@ -553,13 +553,17 @@ class WPCode_Admin_Page_Tools extends WPCode_Admin_Page {
|
|
553 |
$snippets = get_posts( $query_args );
|
554 |
|
555 |
foreach ( $snippets as $snippet ) {
|
556 |
-
$snippet
|
557 |
-
$snippet_data
|
558 |
-
$snippet_data['tags']
|
559 |
-
$snippet_data['note']
|
560 |
-
$
|
|
|
|
|
561 |
}
|
562 |
|
|
|
|
|
563 |
ignore_user_abort( true );
|
564 |
|
565 |
nocache_headers();
|
553 |
$snippets = get_posts( $query_args );
|
554 |
|
555 |
foreach ( $snippets as $snippet ) {
|
556 |
+
$snippet = new WPCode_Snippet( $snippet );
|
557 |
+
$snippet_data = $snippet->get_data_for_caching();
|
558 |
+
$snippet_data['tags'] = $snippet->get_tags();
|
559 |
+
$snippet_data['note'] = $snippet->get_note();
|
560 |
+
$snippet_data['cloud_id'] = $snippet->get_cloud_id();
|
561 |
+
$snippet_data['custom_shortcode'] = $snippet->get_custom_shortcode();
|
562 |
+
$export[] = $snippet_data;
|
563 |
}
|
564 |
|
565 |
+
$export = array_reverse( $export );
|
566 |
+
|
567 |
ignore_user_abort( true );
|
568 |
|
569 |
nocache_headers();
|
includes/admin/pages/class-wpcode-admin-page.php
CHANGED
@@ -101,6 +101,7 @@ abstract class WPCode_Admin_Page {
|
|
101 |
if ( $this->page_slug !== $page ) {
|
102 |
return;
|
103 |
}
|
|
|
104 |
add_action( 'wpcode_admin_page', array( $this, 'output' ) );
|
105 |
add_action( 'wpcode_admin_page', array( $this, 'output_footer' ) );
|
106 |
add_action( 'admin_enqueue_scripts', array( $this, 'page_scripts' ) );
|
@@ -128,7 +129,17 @@ abstract class WPCode_Admin_Page {
|
|
128 |
* @return void
|
129 |
*/
|
130 |
public function add_page() {
|
131 |
-
add_submenu_page(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
}
|
133 |
|
134 |
/**
|
@@ -236,19 +247,20 @@ abstract class WPCode_Admin_Page {
|
|
236 |
<?php
|
237 |
$docs = new WPCode_Docs();
|
238 |
$docs->get_categories_accordion();
|
|
|
239 |
?>
|
240 |
<div class="wpcode-help-footer">
|
241 |
<div class="wpcode-help-footer-box">
|
242 |
<?php wpcode_icon( 'file', 48, 48 ); ?>
|
243 |
<h3><?php esc_html_e( 'View Documentation', 'insert-headers-and-footers' ); ?></h3>
|
244 |
<p><?php esc_html_e( 'Browse documentation, reference material, and tutorials for WPCode.', 'insert-headers-and-footers' ); ?></p>
|
245 |
-
<a class="wpcode-button wpcode-button-secondary" href="<?php echo esc_url( wpcode_utm_url( 'https://wpcode.com/docs', 'docs', 'footer' ) ); ?>" target="_blank"><?php esc_html_e( 'View All Documentation', 'insert-headers-and-footers' ); ?></a>
|
246 |
</div>
|
247 |
<div class="wpcode-help-footer-box">
|
248 |
<?php wpcode_icon( 'support', 48, 48 ); ?>
|
249 |
<h3><?php esc_html_e( 'Get Support', 'insert-headers-and-footers' ); ?></h3>
|
250 |
<p><?php esc_html_e( 'Submit a ticket and our world class support team will be in touch soon.', 'insert-headers-and-footers' ); ?></p>
|
251 |
-
<a class="wpcode-button wpcode-button-secondary" href="
|
252 |
</div>
|
253 |
</div>
|
254 |
</div>
|
@@ -307,6 +319,7 @@ abstract class WPCode_Admin_Page {
|
|
307 |
<button type="button" class="wpcode-button-text wpcode-notification-dismiss" id="wpcode-dismiss-all" data-id="all"><?php esc_html_e( 'Dismiss all', 'insert-headers-and-footers' ); ?></button>
|
308 |
</div>
|
309 |
</div>
|
|
|
310 |
<?php
|
311 |
}
|
312 |
|
@@ -426,7 +439,6 @@ abstract class WPCode_Admin_Page {
|
|
426 |
public function maybe_output_message() {
|
427 |
$error_message = $this->get_error_message();
|
428 |
$success_message = $this->get_success_message();
|
429 |
-
|
430 |
?>
|
431 |
<div class="wrap" id="wpcode-notice-area">
|
432 |
<?php
|
@@ -444,6 +456,7 @@ abstract class WPCode_Admin_Page {
|
|
444 |
</div>
|
445 |
<?php
|
446 |
}
|
|
|
447 |
?>
|
448 |
</div>
|
449 |
<?php
|
@@ -539,40 +552,6 @@ abstract class WPCode_Admin_Page {
|
|
539 |
return add_query_arg( $args, admin_url( 'admin.php' ) );
|
540 |
}
|
541 |
|
542 |
-
/**
|
543 |
-
* If called, this loads CodeMirror on the current admin page with checks.
|
544 |
-
*
|
545 |
-
* @return array|false
|
546 |
-
*/
|
547 |
-
public function load_code_mirror() {
|
548 |
-
if ( ! function_exists( 'wp_enqueue_code_editor' ) ) {
|
549 |
-
return false;
|
550 |
-
}
|
551 |
-
$editor_args = array( 'type' => $this->get_mime_from_code_type() );
|
552 |
-
if ( ! $this->can_edit || ! current_user_can( 'wpcode_edit_snippets' ) ) {
|
553 |
-
$editor_args['codemirror']['readOnly'] = true;
|
554 |
-
}
|
555 |
-
|
556 |
-
// Enqueue code editor and settings for manipulating HTML.
|
557 |
-
return wp_enqueue_code_editor( $editor_args );
|
558 |
-
}
|
559 |
-
|
560 |
-
/**
|
561 |
-
* Convert generic code type to MIME used by CodeMirror.
|
562 |
-
*
|
563 |
-
* @param string $code_type Optional parameter, if not passed it returns the mime for the currently set $code_type.
|
564 |
-
*
|
565 |
-
* @return string
|
566 |
-
* @see $code_type
|
567 |
-
*/
|
568 |
-
protected function get_mime_from_code_type( $code_type = '' ) {
|
569 |
-
if ( empty( $code_type ) ) {
|
570 |
-
$code_type = isset( $this->code_type ) ? $this->code_type : '';
|
571 |
-
}
|
572 |
-
|
573 |
-
return wpcode()->execute->get_mime_for_code_type( $code_type );
|
574 |
-
}
|
575 |
-
|
576 |
/**
|
577 |
* Metabox-style layout for admin pages.
|
578 |
*
|
@@ -632,10 +611,12 @@ abstract class WPCode_Admin_Page {
|
|
632 |
* @param string $id The id for the row.
|
633 |
* @param string $show_if_id Conditional logic id, automatically hide if the value of the field with this id doesn't match show if value.
|
634 |
* @param string $show_if_value Value(s) to match against, can be comma-separated string for multiple values.
|
|
|
|
|
635 |
*
|
636 |
* @return void
|
637 |
*/
|
638 |
-
public function metabox_row( $label, $input, $id = '', $show_if_id = '', $show_if_value = '' ) {
|
639 |
$show_if_rules = '';
|
640 |
if ( ! empty( $show_if_id ) ) {
|
641 |
$show_if_rules = sprintf( 'data-show-if-id="%1$s" data-show-if-value="%2$s"', $show_if_id, $show_if_value );
|
@@ -645,10 +626,18 @@ abstract class WPCode_Admin_Page {
|
|
645 |
<div class="wpcode-metabox-form-row-label">
|
646 |
<label for="<?php echo esc_attr( $id ); ?>">
|
647 |
<?php echo esc_html( $label ); ?>
|
|
|
|
|
|
|
|
|
|
|
648 |
</label>
|
649 |
</div>
|
650 |
<div class="wpcode-metabox-form-row-input">
|
651 |
<?php echo $input; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
|
|
|
|
|
|
652 |
</div>
|
653 |
</div>
|
654 |
<?php
|
@@ -664,17 +653,7 @@ abstract class WPCode_Admin_Page {
|
|
664 |
* @return string
|
665 |
*/
|
666 |
public function get_checkbox_toggle( $checked, $name, $description = '' ) {
|
667 |
-
$
|
668 |
-
|
669 |
-
$markup .= '<input type="checkbox" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $name ) . '" id="' . esc_attr( $name ) . '" />';
|
670 |
-
$markup .= '<span class="wpcode-checkbox-toggle-slider"></span>';
|
671 |
-
$markup .= '</label>';
|
672 |
-
|
673 |
-
if ( ! empty( $description ) ) {
|
674 |
-
$markup .= '<p class="description">' . wp_kses_post( $description ) . '</p>';
|
675 |
-
}
|
676 |
-
|
677 |
-
return $markup;
|
678 |
}
|
679 |
|
680 |
/**
|
@@ -692,6 +671,7 @@ abstract class WPCode_Admin_Page {
|
|
692 |
$used_library_snippets = wpcode()->library->get_used_library_snippets();
|
693 |
$button_text = __( 'Use snippet', 'insert-headers-and-footers' );
|
694 |
$pill_text = '';
|
|
|
695 |
if ( ! empty( $snippet ) ) {
|
696 |
$url = add_query_arg(
|
697 |
array(
|
@@ -734,7 +714,27 @@ abstract class WPCode_Admin_Page {
|
|
734 |
}
|
735 |
$categories = isset( $snippet['categories'] ) ? $snippet['categories'] : array();
|
736 |
|
737 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
738 |
}
|
739 |
|
740 |
/**
|
@@ -743,18 +743,16 @@ abstract class WPCode_Admin_Page {
|
|
743 |
* @param string $id The id used for the data-id param (used for filtering).
|
744 |
* @param string $title The title of the item.
|
745 |
* @param string $description The item description.
|
746 |
-
* @param
|
747 |
-
* @param
|
748 |
* @param array $categories The categories of this object (for filtering).
|
749 |
-
* @param string $button_2_text (optional) 2nd button text. If left empty, the 2nd button will not be shown.
|
750 |
-
* @param string $button_2_class (optional) 2nd button class.
|
751 |
* @param string $pill_text (optional) Display a "pill" with some text in the top right corner.
|
752 |
* @param string $pill_class (optional) Custom CSS class for the pill.
|
753 |
* @param string $selected_category (optional) Slug of the category selected by default.
|
754 |
*
|
755 |
* @return void
|
756 |
*/
|
757 |
-
public function get_list_item( $id, $title, $description, $
|
758 |
$item_class = array(
|
759 |
'wpcode-list-item',
|
760 |
);
|
@@ -765,6 +763,19 @@ abstract class WPCode_Admin_Page {
|
|
765 |
if ( '*' !== $selected_category && ! in_array( $selected_category, $categories, true ) ) {
|
766 |
$style = 'display:none;';
|
767 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
768 |
?>
|
769 |
<li class="<?php echo esc_attr( implode( ' ', $item_class ) ); ?>" data-id="<?php echo esc_attr( $id ); ?>" data-categories='<?php echo wp_json_encode( $categories ); ?>' style="<?php echo esc_attr( $style ); ?>">
|
770 |
<h3 title="<?php echo esc_attr( $title ); ?>"><?php echo esc_html( $title ); ?></h3>
|
@@ -776,29 +787,88 @@ abstract class WPCode_Admin_Page {
|
|
776 |
<p><?php echo esc_html( $description ); ?></p>
|
777 |
</div>
|
778 |
<div class="wpcode-list-item-buttons">
|
779 |
-
|
780 |
-
|
781 |
-
</a>
|
782 |
-
<?php if ( ! empty( $button_2_text ) ) { ?>
|
783 |
-
<button class="wpcode-button wpcode-button-secondary <?php echo esc_attr( $button_2_class ); ?>" type="button">
|
784 |
-
<?php echo esc_html( $button_2_text ); ?>
|
785 |
-
</button>
|
786 |
-
<?php } ?>
|
787 |
</div>
|
788 |
</div>
|
|
|
789 |
</li>
|
790 |
<?php
|
791 |
}
|
792 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
793 |
/**
|
794 |
* Output the library markup from an array of categories and an array of snippets.
|
795 |
*
|
796 |
-
* @param array
|
797 |
-
* @param array
|
|
|
798 |
*
|
799 |
* @return void
|
800 |
*/
|
801 |
-
public function get_library_markup( $categories, $snippets ) {
|
802 |
$selected_category = isset( $categories[0]['slug'] ) ? $categories[0]['slug'] : '*';
|
803 |
?>
|
804 |
<div class="wpcode-items-metabox wpcode-metabox">
|
@@ -816,14 +886,13 @@ abstract class WPCode_Admin_Page {
|
|
816 |
<ul class="wpcode-items-list-category">
|
817 |
<?php
|
818 |
foreach ( $snippets as $snippet ) {
|
819 |
-
$this
|
820 |
}
|
821 |
?>
|
822 |
</ul>
|
823 |
</div>
|
824 |
</div>
|
825 |
<?php
|
826 |
-
$this->library_preview_modal_content();
|
827 |
}
|
828 |
|
829 |
/**
|
@@ -889,11 +958,10 @@ abstract class WPCode_Admin_Page {
|
|
889 |
</div>
|
890 |
</div>
|
891 |
<?php
|
892 |
-
$
|
893 |
-
$
|
894 |
-
|
895 |
-
$
|
896 |
-
wp_add_inline_script( 'code-editor', sprintf( 'jQuery( function() { window.wpcode_editor = wp.codeEditor.initialize( "wpcode-code-preview", %s ); } );', wp_json_encode( $settings ) ) );
|
897 |
}
|
898 |
|
899 |
/**
|
@@ -927,4 +995,92 @@ abstract class WPCode_Admin_Page {
|
|
927 |
admin_url( 'admin.php' )
|
928 |
);
|
929 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
930 |
}
|
101 |
if ( $this->page_slug !== $page ) {
|
102 |
return;
|
103 |
}
|
104 |
+
remove_all_actions( 'admin_notices' );
|
105 |
add_action( 'wpcode_admin_page', array( $this, 'output' ) );
|
106 |
add_action( 'wpcode_admin_page', array( $this, 'output_footer' ) );
|
107 |
add_action( 'admin_enqueue_scripts', array( $this, 'page_scripts' ) );
|
129 |
* @return void
|
130 |
*/
|
131 |
public function add_page() {
|
132 |
+
add_submenu_page(
|
133 |
+
'wpcode',
|
134 |
+
$this->page_title,
|
135 |
+
$this->menu_title,
|
136 |
+
'wpcode_edit_snippets',
|
137 |
+
$this->page_slug,
|
138 |
+
array(
|
139 |
+
wpcode()->admin_page_loader,
|
140 |
+
'admin_menu_page',
|
141 |
+
)
|
142 |
+
);
|
143 |
}
|
144 |
|
145 |
/**
|
247 |
<?php
|
248 |
$docs = new WPCode_Docs();
|
249 |
$docs->get_categories_accordion();
|
250 |
+
$support_url = wpcode_utm_url( 'https://wpcode.com/contact/', 'help-overlay', 'support-url' );
|
251 |
?>
|
252 |
<div class="wpcode-help-footer">
|
253 |
<div class="wpcode-help-footer-box">
|
254 |
<?php wpcode_icon( 'file', 48, 48 ); ?>
|
255 |
<h3><?php esc_html_e( 'View Documentation', 'insert-headers-and-footers' ); ?></h3>
|
256 |
<p><?php esc_html_e( 'Browse documentation, reference material, and tutorials for WPCode.', 'insert-headers-and-footers' ); ?></p>
|
257 |
+
<a class="wpcode-button wpcode-button-secondary" href="<?php echo esc_url( wpcode_utm_url( 'https://wpcode.com/docs', 'help-overlay', 'docs', 'footer' ) ); ?>" target="_blank"><?php esc_html_e( 'View All Documentation', 'insert-headers-and-footers' ); ?></a>
|
258 |
</div>
|
259 |
<div class="wpcode-help-footer-box">
|
260 |
<?php wpcode_icon( 'support', 48, 48 ); ?>
|
261 |
<h3><?php esc_html_e( 'Get Support', 'insert-headers-and-footers' ); ?></h3>
|
262 |
<p><?php esc_html_e( 'Submit a ticket and our world class support team will be in touch soon.', 'insert-headers-and-footers' ); ?></p>
|
263 |
+
<a class="wpcode-button wpcode-button-secondary" href="<?php echo esc_url( $support_url ); ?>" target="_blank"><?php esc_html_e( 'Submit a Support Ticket', 'insert-headers-and-footers' ); ?></a>
|
264 |
</div>
|
265 |
</div>
|
266 |
</div>
|
319 |
<button type="button" class="wpcode-button-text wpcode-notification-dismiss" id="wpcode-dismiss-all" data-id="all"><?php esc_html_e( 'Dismiss all', 'insert-headers-and-footers' ); ?></button>
|
320 |
</div>
|
321 |
</div>
|
322 |
+
<span class="wpcode-loading-spinner" id="wpcode-admin-spinner"></span>
|
323 |
<?php
|
324 |
}
|
325 |
|
439 |
public function maybe_output_message() {
|
440 |
$error_message = $this->get_error_message();
|
441 |
$success_message = $this->get_success_message();
|
|
|
442 |
?>
|
443 |
<div class="wrap" id="wpcode-notice-area">
|
444 |
<?php
|
456 |
</div>
|
457 |
<?php
|
458 |
}
|
459 |
+
do_action( 'wpcode_admin_notices' );
|
460 |
?>
|
461 |
</div>
|
462 |
<?php
|
552 |
return add_query_arg( $args, admin_url( 'admin.php' ) );
|
553 |
}
|
554 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
555 |
/**
|
556 |
* Metabox-style layout for admin pages.
|
557 |
*
|
611 |
* @param string $id The id for the row.
|
612 |
* @param string $show_if_id Conditional logic id, automatically hide if the value of the field with this id doesn't match show if value.
|
613 |
* @param string $show_if_value Value(s) to match against, can be comma-separated string for multiple values.
|
614 |
+
* @param string $description Description to show under the input.
|
615 |
+
* @param bool $is_pro Whether this is a pro feature and the pro indicator should be shown next to the label.
|
616 |
*
|
617 |
* @return void
|
618 |
*/
|
619 |
+
public function metabox_row( $label, $input, $id = '', $show_if_id = '', $show_if_value = '', $description = '', $is_pro = false ) {
|
620 |
$show_if_rules = '';
|
621 |
if ( ! empty( $show_if_id ) ) {
|
622 |
$show_if_rules = sprintf( 'data-show-if-id="%1$s" data-show-if-value="%2$s"', $show_if_id, $show_if_value );
|
626 |
<div class="wpcode-metabox-form-row-label">
|
627 |
<label for="<?php echo esc_attr( $id ); ?>">
|
628 |
<?php echo esc_html( $label ); ?>
|
629 |
+
<?php
|
630 |
+
if ( $is_pro ) {
|
631 |
+
echo '<span class="wpcode-pro-pill">PRO</span>';
|
632 |
+
}
|
633 |
+
?>
|
634 |
</label>
|
635 |
</div>
|
636 |
<div class="wpcode-metabox-form-row-input">
|
637 |
<?php echo $input; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
638 |
+
<?php if ( ! empty( $description ) ) { ?>
|
639 |
+
<p><?php echo wp_kses_post( $description ); ?></p>
|
640 |
+
<?php } ?>
|
641 |
</div>
|
642 |
</div>
|
643 |
<?php
|
653 |
* @return string
|
654 |
*/
|
655 |
public function get_checkbox_toggle( $checked, $name, $description = '' ) {
|
656 |
+
return wpcode_get_checkbox_toggle( $checked, $name, $description );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
657 |
}
|
658 |
|
659 |
/**
|
671 |
$used_library_snippets = wpcode()->library->get_used_library_snippets();
|
672 |
$button_text = __( 'Use snippet', 'insert-headers-and-footers' );
|
673 |
$pill_text = '';
|
674 |
+
$pill_class = 'blue';
|
675 |
if ( ! empty( $snippet ) ) {
|
676 |
$url = add_query_arg(
|
677 |
array(
|
714 |
}
|
715 |
$categories = isset( $snippet['categories'] ) ? $snippet['categories'] : array();
|
716 |
|
717 |
+
|
718 |
+
$button_2 = array(
|
719 |
+
'text' => $button_2_text,
|
720 |
+
'class' => 'wpcode-button wpcode-button-secondary wpcode-library-preview-button',
|
721 |
+
);
|
722 |
+
|
723 |
+
if ( ! empty( $snippet['needs_auth'] ) ) {
|
724 |
+
$button_1 = array(
|
725 |
+
'tag' => 'button',
|
726 |
+
'text' => get_wpcode_icon( 'lock', 17, 22, '0 0 17 22' ) . __( 'Connect to library to unlock (Free)', 'insert-headers-and-footers' ),
|
727 |
+
'class' => 'wpcode-button wpcode-item-use-button wpcode-start-auth wpcode-button-icon',
|
728 |
+
);
|
729 |
+
} else {
|
730 |
+
$button_1 = array(
|
731 |
+
'tag' => 'a',
|
732 |
+
'url' => $url,
|
733 |
+
'text' => $button_text,
|
734 |
+
);
|
735 |
+
}
|
736 |
+
|
737 |
+
$this->get_list_item( $id, $title, $description, $button_1, $button_2, $categories, $pill_text, $pill_class, $category );
|
738 |
}
|
739 |
|
740 |
/**
|
743 |
* @param string $id The id used for the data-id param (used for filtering).
|
744 |
* @param string $title The title of the item.
|
745 |
* @param string $description The item description.
|
746 |
+
* @param array $button_1 The first button config (@see get_list_item_button).
|
747 |
+
* @param array $button_2 The second button config (@see get_list_item_button).
|
748 |
* @param array $categories The categories of this object (for filtering).
|
|
|
|
|
749 |
* @param string $pill_text (optional) Display a "pill" with some text in the top right corner.
|
750 |
* @param string $pill_class (optional) Custom CSS class for the pill.
|
751 |
* @param string $selected_category (optional) Slug of the category selected by default.
|
752 |
*
|
753 |
* @return void
|
754 |
*/
|
755 |
+
public function get_list_item( $id, $title, $description, $button_1, $button_2 = array(), $categories = array(), $pill_text = '', $pill_class = 'blue', $selected_category = '*' ) {
|
756 |
$item_class = array(
|
757 |
'wpcode-list-item',
|
758 |
);
|
763 |
if ( '*' !== $selected_category && ! in_array( $selected_category, $categories, true ) ) {
|
764 |
$style = 'display:none;';
|
765 |
}
|
766 |
+
$button_1 = wp_parse_args(
|
767 |
+
$button_1,
|
768 |
+
array(
|
769 |
+
'tag' => 'a',
|
770 |
+
'class' => 'wpcode-button wpcode-item-use-button',
|
771 |
+
)
|
772 |
+
);
|
773 |
+
$button_2 = wp_parse_args(
|
774 |
+
$button_2,
|
775 |
+
array(
|
776 |
+
'class' => 'wpcode-button wpcode-button-secondary',
|
777 |
+
)
|
778 |
+
);
|
779 |
?>
|
780 |
<li class="<?php echo esc_attr( implode( ' ', $item_class ) ); ?>" data-id="<?php echo esc_attr( $id ); ?>" data-categories='<?php echo wp_json_encode( $categories ); ?>' style="<?php echo esc_attr( $style ); ?>">
|
781 |
<h3 title="<?php echo esc_attr( $title ); ?>"><?php echo esc_html( $title ); ?></h3>
|
787 |
<p><?php echo esc_html( $description ); ?></p>
|
788 |
</div>
|
789 |
<div class="wpcode-list-item-buttons">
|
790 |
+
<?php self::get_list_item_button( $button_1 ); ?>
|
791 |
+
<?php self::get_list_item_button( $button_2 ); ?>
|
|
|
|
|
|
|
|
|
|
|
|
|
792 |
</div>
|
793 |
</div>
|
794 |
+
<?php $this->get_list_item_top_actions( $id ); ?>
|
795 |
</li>
|
796 |
<?php
|
797 |
}
|
798 |
|
799 |
+
/**
|
800 |
+
* Allow child classes to display additional buttons.
|
801 |
+
*
|
802 |
+
* @param string|int $id The id of the element passed for generating action urls.
|
803 |
+
*
|
804 |
+
* @return void
|
805 |
+
*/
|
806 |
+
public function get_list_item_top_actions( $id ) {
|
807 |
+
}
|
808 |
+
|
809 |
+
/**
|
810 |
+
* Get a button for the list of items.
|
811 |
+
*
|
812 |
+
* @param array $args Arguments for the button.
|
813 |
+
* @param bool $echo (optional) Whether to echo the button or return it.
|
814 |
+
*
|
815 |
+
* @return void|string
|
816 |
+
*/
|
817 |
+
public static function get_list_item_button( $args, $echo = true ) {
|
818 |
+
$button_settings = wp_parse_args(
|
819 |
+
$args,
|
820 |
+
array(
|
821 |
+
'tag' => 'button',
|
822 |
+
'url' => '',
|
823 |
+
'text' => '',
|
824 |
+
'class' => 'wpcode-button',
|
825 |
+
'attributes' => array(),
|
826 |
+
)
|
827 |
+
);
|
828 |
+
|
829 |
+
if ( empty( $button_settings['text'] ) ) {
|
830 |
+
return;
|
831 |
+
}
|
832 |
+
|
833 |
+
$button_settings['class'] = esc_attr( $button_settings['class'] );
|
834 |
+
|
835 |
+
$parsed_attributes = "class='{$button_settings['class']}' ";
|
836 |
+
if ( ! empty( $button_settings['url'] ) && 'a' === $button_settings['tag'] ) {
|
837 |
+
$parsed_attributes .= 'href="' . esc_url( $button_settings['url'] ) . '" ';
|
838 |
+
}
|
839 |
+
if ( ! empty( $button_settings['attributes'] ) ) {
|
840 |
+
foreach ( $button_settings['attributes'] as $key => $value ) {
|
841 |
+
$parsed_attributes .= esc_attr( $key ) . '="' . esc_attr( $value ) . '"';
|
842 |
+
}
|
843 |
+
}
|
844 |
+
|
845 |
+
if ( $echo ) {
|
846 |
+
printf(
|
847 |
+
'<%1$s %2$s>%3$s</%1$s>',
|
848 |
+
$button_settings['tag'], // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
849 |
+
$parsed_attributes, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
850 |
+
wp_kses( $button_settings['text'], wpcode_get_icon_allowed_tags() )
|
851 |
+
);
|
852 |
+
} else {
|
853 |
+
return sprintf(
|
854 |
+
'<%1$s %2$s>%3$s</%1$s>',
|
855 |
+
$button_settings['tag'], // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
856 |
+
$parsed_attributes, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
857 |
+
wp_kses( $button_settings['text'], wpcode_get_icon_allowed_tags() )
|
858 |
+
);
|
859 |
+
}
|
860 |
+
}
|
861 |
+
|
862 |
/**
|
863 |
* Output the library markup from an array of categories and an array of snippets.
|
864 |
*
|
865 |
+
* @param array $categories The snippet categories to show.
|
866 |
+
* @param array $snippets The snippets to show.
|
867 |
+
* @param string $item_method The method in the current class for items output.
|
868 |
*
|
869 |
* @return void
|
870 |
*/
|
871 |
+
public function get_library_markup( $categories, $snippets, $item_method = 'get_library_snippet_item' ) {
|
872 |
$selected_category = isset( $categories[0]['slug'] ) ? $categories[0]['slug'] : '*';
|
873 |
?>
|
874 |
<div class="wpcode-items-metabox wpcode-metabox">
|
886 |
<ul class="wpcode-items-list-category">
|
887 |
<?php
|
888 |
foreach ( $snippets as $snippet ) {
|
889 |
+
call_user_func( array( $this, $item_method ), $snippet, $selected_category );
|
890 |
}
|
891 |
?>
|
892 |
</ul>
|
893 |
</div>
|
894 |
</div>
|
895 |
<?php
|
|
|
896 |
}
|
897 |
|
898 |
/**
|
958 |
</div>
|
959 |
</div>
|
960 |
<?php
|
961 |
+
$editor = new WPCode_Code_Editor( 'text' );
|
962 |
+
$editor->set_setting( 'readOnly', 'nocursor' );
|
963 |
+
$editor->register_editor( 'wpcode-code-preview' );
|
964 |
+
$editor->init_editor();
|
|
|
965 |
}
|
966 |
|
967 |
/**
|
995 |
admin_url( 'admin.php' )
|
996 |
);
|
997 |
}
|
998 |
+
|
999 |
+
/**
|
1000 |
+
* Get an upsell box markup.
|
1001 |
+
*
|
1002 |
+
* @param string $title The main upsell box title.
|
1003 |
+
* @param string $text The text displayed under the title.
|
1004 |
+
* @param string $button_1 The main CTA button.
|
1005 |
+
* @param string $button_2 The text link below the main CTA.
|
1006 |
+
* @param array $features A list of features to display below the text.
|
1007 |
+
*
|
1008 |
+
* @return string
|
1009 |
+
*/
|
1010 |
+
public static function get_upsell_box( $title, $text = '', $button_1 = array(), $button_2 = array(), $features = array() ) {
|
1011 |
+
|
1012 |
+
$container_class = array(
|
1013 |
+
'wpcode-upsell-box',
|
1014 |
+
);
|
1015 |
+
|
1016 |
+
if ( ! empty( $features ) ) {
|
1017 |
+
$container_class[] = 'wpcode-upsell-box-with-features';
|
1018 |
+
}
|
1019 |
+
|
1020 |
+
$html = sprintf(
|
1021 |
+
'<div class="%s">',
|
1022 |
+
esc_attr( implode( ' ', $container_class ) )
|
1023 |
+
);
|
1024 |
+
|
1025 |
+
$html .= sprintf(
|
1026 |
+
'<h2>%s</h2>',
|
1027 |
+
wp_kses_post( $title )
|
1028 |
+
);
|
1029 |
+
|
1030 |
+
if ( ! empty( $text ) ) {
|
1031 |
+
$html .= sprintf(
|
1032 |
+
'<div class="wpcode-upsell-text">%s</div>',
|
1033 |
+
wp_kses_post( $text )
|
1034 |
+
);
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
if ( ! empty( $features ) ) {
|
1038 |
+
$html .= '<ul class="wpcode-upsell-features">';
|
1039 |
+
foreach ( $features as $feature ) {
|
1040 |
+
$html .= sprintf(
|
1041 |
+
'<li class="wpcode-upsell-feature">%s</li>',
|
1042 |
+
wp_kses_post( $feature )
|
1043 |
+
);
|
1044 |
+
}
|
1045 |
+
$html .= '</ul>';
|
1046 |
+
}
|
1047 |
+
$button_1 = wp_parse_args(
|
1048 |
+
$button_1,
|
1049 |
+
array(
|
1050 |
+
'tag' => 'a',
|
1051 |
+
'text' => '',
|
1052 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite' ),
|
1053 |
+
'class' => 'wpcode-button wpcode-button-orange wpcode-button-large',
|
1054 |
+
'attributes' => array(
|
1055 |
+
'target' => '_blank',
|
1056 |
+
),
|
1057 |
+
)
|
1058 |
+
);
|
1059 |
+
$button_2 = wp_parse_args(
|
1060 |
+
$button_2,
|
1061 |
+
array(
|
1062 |
+
'tag' => 'a',
|
1063 |
+
'text' => '',
|
1064 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite' ),
|
1065 |
+
'class' => 'wpcode-upsell-button-text',
|
1066 |
+
'attributes' => array(
|
1067 |
+
'target' => '_blank',
|
1068 |
+
),
|
1069 |
+
)
|
1070 |
+
);
|
1071 |
+
|
1072 |
+
if ( ! empty( $button_1['text'] ) ) {
|
1073 |
+
$html .= self::get_list_item_button( $button_1, false );
|
1074 |
+
}
|
1075 |
+
|
1076 |
+
if ( ! empty( $button_2['text'] ) ) {
|
1077 |
+
$html .= '<br />';
|
1078 |
+
$html .= self::get_list_item_button( $button_2, false );
|
1079 |
+
}
|
1080 |
+
|
1081 |
+
$html .= '</div>';
|
1082 |
+
|
1083 |
+
return $html;
|
1084 |
+
|
1085 |
+
}
|
1086 |
}
|
includes/auto-insert/class-wpcode-auto-insert-archive.php
CHANGED
@@ -102,11 +102,7 @@ class WPCode_Auto_Insert_Archive extends WPCode_Auto_Insert_Type {
|
|
102 |
if ( $query->post_count <= $query->current_post ) {
|
103 |
return;
|
104 |
}
|
105 |
-
$
|
106 |
-
|
107 |
-
foreach ( $snippets as $snippet ) {
|
108 |
-
echo wpcode()->execute->get_snippet_output( $snippet );
|
109 |
-
}
|
110 |
}
|
111 |
|
112 |
/**
|
@@ -137,3 +133,5 @@ class WPCode_Auto_Insert_Archive extends WPCode_Auto_Insert_Type {
|
|
137 |
}
|
138 |
}
|
139 |
}
|
|
|
|
102 |
if ( $query->post_count <= $query->current_post ) {
|
103 |
return;
|
104 |
}
|
105 |
+
$this->output_location( 'between_posts' );
|
|
|
|
|
|
|
|
|
106 |
}
|
107 |
|
108 |
/**
|
133 |
}
|
134 |
}
|
135 |
}
|
136 |
+
|
137 |
+
new WPCode_Auto_Insert_Archive();
|
includes/auto-insert/class-wpcode-auto-insert-everywhere.php
CHANGED
@@ -58,3 +58,5 @@ class WPCode_Auto_Insert_Everywhere extends WPCode_Auto_Insert_Type {
|
|
58 |
add_action( 'plugins_loaded', array( $this, 'run_snippets' ), 5 );
|
59 |
}
|
60 |
}
|
|
|
|
58 |
add_action( 'plugins_loaded', array( $this, 'run_snippets' ), 5 );
|
59 |
}
|
60 |
}
|
61 |
+
|
62 |
+
new WPCode_Auto_Insert_Everywhere();
|
includes/auto-insert/class-wpcode-auto-insert-single.php
CHANGED
@@ -68,10 +68,7 @@ class WPCode_Auto_Insert_Single extends WPCode_Auto_Insert_Type {
|
|
68 |
if ( ! did_action( 'get_header' ) || get_the_ID() !== $post_object->ID || $this->did_before_post_output ) {
|
69 |
return;
|
70 |
}
|
71 |
-
$
|
72 |
-
foreach ( $snippets as $snippet ) {
|
73 |
-
echo wpcode()->execute->get_snippet_output( $snippet );
|
74 |
-
}
|
75 |
$this->did_before_post_output = true;
|
76 |
}
|
77 |
|
@@ -220,3 +217,5 @@ class WPCode_Auto_Insert_Single extends WPCode_Auto_Insert_Type {
|
|
220 |
return $content_to_add_to;
|
221 |
}
|
222 |
}
|
|
|
|
68 |
if ( ! did_action( 'get_header' ) || get_the_ID() !== $post_object->ID || $this->did_before_post_output ) {
|
69 |
return;
|
70 |
}
|
71 |
+
$this->output_location( 'before_post' );
|
|
|
|
|
|
|
72 |
$this->did_before_post_output = true;
|
73 |
}
|
74 |
|
217 |
return $content_to_add_to;
|
218 |
}
|
219 |
}
|
220 |
+
|
221 |
+
new WPCode_Auto_Insert_Single();
|
includes/auto-insert/class-wpcode-auto-insert-site-wide.php
CHANGED
@@ -41,10 +41,7 @@ class WPCode_Auto_Insert_Site_Wide extends WPCode_Auto_Insert_Type {
|
|
41 |
* @return void
|
42 |
*/
|
43 |
public function insert_header() {
|
44 |
-
$
|
45 |
-
foreach ( $snippets as $snippet ) {
|
46 |
-
echo wpcode()->execute->get_snippet_output( $snippet );
|
47 |
-
}
|
48 |
}
|
49 |
|
50 |
/**
|
@@ -53,10 +50,7 @@ class WPCode_Auto_Insert_Site_Wide extends WPCode_Auto_Insert_Type {
|
|
53 |
* @return void
|
54 |
*/
|
55 |
public function insert_footer() {
|
56 |
-
$
|
57 |
-
foreach ( $snippets as $snippet ) {
|
58 |
-
echo wpcode()->execute->get_snippet_output( $snippet );
|
59 |
-
}
|
60 |
}
|
61 |
|
62 |
/**
|
@@ -65,9 +59,8 @@ class WPCode_Auto_Insert_Site_Wide extends WPCode_Auto_Insert_Type {
|
|
65 |
* @return void
|
66 |
*/
|
67 |
public function insert_body() {
|
68 |
-
$
|
69 |
-
foreach ( $snippets as $snippet ) {
|
70 |
-
echo wpcode()->execute->get_snippet_output( $snippet );
|
71 |
-
}
|
72 |
}
|
73 |
}
|
|
|
|
41 |
* @return void
|
42 |
*/
|
43 |
public function insert_header() {
|
44 |
+
$this->output_location( 'site_wide_header' );
|
|
|
|
|
|
|
45 |
}
|
46 |
|
47 |
/**
|
50 |
* @return void
|
51 |
*/
|
52 |
public function insert_footer() {
|
53 |
+
$this->output_location( 'site_wide_footer' );
|
|
|
|
|
|
|
54 |
}
|
55 |
|
56 |
/**
|
59 |
* @return void
|
60 |
*/
|
61 |
public function insert_body() {
|
62 |
+
$this->output_location( 'site_wide_body' );
|
|
|
|
|
|
|
63 |
}
|
64 |
}
|
65 |
+
|
66 |
+
new WPCode_Auto_Insert_Site_Wide();
|
includes/auto-insert/class-wpcode-auto-insert-type.php
CHANGED
@@ -56,12 +56,47 @@ abstract class WPCode_Auto_Insert_Type {
|
|
56 |
*/
|
57 |
protected $use_cache = true;
|
58 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
/**
|
60 |
* Start the auto insertion.
|
61 |
*/
|
62 |
public function __construct() {
|
63 |
$this->init();
|
64 |
-
|
65 |
/**
|
66 |
* Constant to enable safe mode.
|
67 |
* Filter to allow disabling auto insert.
|
@@ -76,6 +111,15 @@ abstract class WPCode_Auto_Insert_Type {
|
|
76 |
$this->add_start_hook();
|
77 |
}
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
/**
|
80 |
* Init function that is specific to each auto-insert type.
|
81 |
*
|
@@ -147,7 +191,11 @@ abstract class WPCode_Auto_Insert_Type {
|
|
147 |
|
148 |
$snippets_for_location = isset( $snippets[ $location ] ) ? $snippets[ $location ] : array();
|
149 |
|
150 |
-
return
|
|
|
|
|
|
|
|
|
151 |
}
|
152 |
|
153 |
/**
|
@@ -324,4 +372,18 @@ abstract class WPCode_Auto_Insert_Type {
|
|
324 |
public function use_cache() {
|
325 |
return boolval( apply_filters( 'wpcode_use_auto_insert_cache', $this->use_cache ) );
|
326 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
327 |
}
|
56 |
*/
|
57 |
protected $use_cache = true;
|
58 |
|
59 |
+
/**
|
60 |
+
* Display a label next to the optgroup title.
|
61 |
+
*
|
62 |
+
* @var string
|
63 |
+
*/
|
64 |
+
public $label_pill = '';
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Title of the upgrade prompt.
|
68 |
+
*
|
69 |
+
* @var string
|
70 |
+
*/
|
71 |
+
public $upgrade_title = '';
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Text of the upgrade prompt.
|
75 |
+
*
|
76 |
+
* @var string
|
77 |
+
*/
|
78 |
+
public $upgrade_text = '';
|
79 |
+
|
80 |
+
/**
|
81 |
+
* URL of the upgrade prompt (CTA) with UTM.
|
82 |
+
*
|
83 |
+
* @var string
|
84 |
+
*/
|
85 |
+
public $upgrade_link = '';
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Text for the CTA Button.
|
89 |
+
*
|
90 |
+
* @var string
|
91 |
+
*/
|
92 |
+
public $upgrade_button = '';
|
93 |
+
|
94 |
/**
|
95 |
* Start the auto insertion.
|
96 |
*/
|
97 |
public function __construct() {
|
98 |
$this->init();
|
99 |
+
$this->register_type();
|
100 |
/**
|
101 |
* Constant to enable safe mode.
|
102 |
* Filter to allow disabling auto insert.
|
111 |
$this->add_start_hook();
|
112 |
}
|
113 |
|
114 |
+
/**
|
115 |
+
* Register this instance to the global auto-insert types.
|
116 |
+
*
|
117 |
+
* @return void
|
118 |
+
*/
|
119 |
+
private function register_type() {
|
120 |
+
wpcode()->auto_insert->register_type( $this );
|
121 |
+
}
|
122 |
+
|
123 |
/**
|
124 |
* Init function that is specific to each auto-insert type.
|
125 |
*
|
191 |
|
192 |
$snippets_for_location = isset( $snippets[ $location ] ) ? $snippets[ $location ] : array();
|
193 |
|
194 |
+
return apply_filters(
|
195 |
+
'wpcode_get_snippets_for_location',
|
196 |
+
wpcode()->conditional_logic->check_snippets_conditions( $snippets_for_location ),
|
197 |
+
$location
|
198 |
+
);
|
199 |
}
|
200 |
|
201 |
/**
|
372 |
public function use_cache() {
|
373 |
return boolval( apply_filters( 'wpcode_use_auto_insert_cache', $this->use_cache ) );
|
374 |
}
|
375 |
+
|
376 |
+
/**
|
377 |
+
* Get the snippets for a location end echo them executed.
|
378 |
+
*
|
379 |
+
* @param string $location_name The location to grab snippets for.
|
380 |
+
*
|
381 |
+
* @return void
|
382 |
+
*/
|
383 |
+
public function output_location( $location_name ) {
|
384 |
+
$snippets = $this->get_snippets_for_location( $location_name );
|
385 |
+
foreach ( $snippets as $snippet ) {
|
386 |
+
echo wpcode()->execute->get_snippet_output( $snippet );
|
387 |
+
}
|
388 |
+
}
|
389 |
}
|
includes/class-wpcode-auto-insert.php
CHANGED
@@ -45,11 +45,17 @@ class WPCode_Auto_Insert {
|
|
45 |
require_once WPCODE_PLUGIN_PATH . 'includes/auto-insert/class-wpcode-auto-insert-site-wide.php';
|
46 |
require_once WPCODE_PLUGIN_PATH . 'includes/auto-insert/class-wpcode-auto-insert-single.php';
|
47 |
require_once WPCODE_PLUGIN_PATH . 'includes/auto-insert/class-wpcode-auto-insert-archive.php';
|
|
|
48 |
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
|
55 |
/**
|
45 |
require_once WPCODE_PLUGIN_PATH . 'includes/auto-insert/class-wpcode-auto-insert-site-wide.php';
|
46 |
require_once WPCODE_PLUGIN_PATH . 'includes/auto-insert/class-wpcode-auto-insert-single.php';
|
47 |
require_once WPCODE_PLUGIN_PATH . 'includes/auto-insert/class-wpcode-auto-insert-archive.php';
|
48 |
+
}
|
49 |
|
50 |
+
/**
|
51 |
+
* Register an auto-insert type.
|
52 |
+
*
|
53 |
+
* @param WPCode_Auto_Insert_Type $type The type to add to the available types.
|
54 |
+
*
|
55 |
+
* @return void
|
56 |
+
*/
|
57 |
+
public function register_type( $type ) {
|
58 |
+
$this->types[] = $type;
|
59 |
}
|
60 |
|
61 |
/**
|
includes/class-wpcode-conditional-logic.php
CHANGED
@@ -34,9 +34,17 @@ class WPCode_Conditional_Logic {
|
|
34 |
require_once WPCODE_PLUGIN_PATH . 'includes/conditional-logic/class-wpcode-conditional-type.php';
|
35 |
require_once WPCODE_PLUGIN_PATH . 'includes/conditional-logic/class-wpcode-conditional-user.php';
|
36 |
require_once WPCODE_PLUGIN_PATH . 'includes/conditional-logic/class-wpcode-conditional-page.php';
|
|
|
37 |
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
}
|
41 |
|
42 |
/**
|
34 |
require_once WPCODE_PLUGIN_PATH . 'includes/conditional-logic/class-wpcode-conditional-type.php';
|
35 |
require_once WPCODE_PLUGIN_PATH . 'includes/conditional-logic/class-wpcode-conditional-user.php';
|
36 |
require_once WPCODE_PLUGIN_PATH . 'includes/conditional-logic/class-wpcode-conditional-page.php';
|
37 |
+
}
|
38 |
|
39 |
+
/**
|
40 |
+
* Register an auto-insert type.
|
41 |
+
*
|
42 |
+
* @param WPCode_Conditional_Type $type The type to add to the available types.
|
43 |
+
*
|
44 |
+
* @return void
|
45 |
+
*/
|
46 |
+
public function register_type( $type ) {
|
47 |
+
$this->types[ $type->name ] = $type;
|
48 |
}
|
49 |
|
50 |
/**
|
includes/class-wpcode-file-cache.php
CHANGED
@@ -62,6 +62,19 @@ class WPCode_File_Cache {
|
|
62 |
return json_decode( file_get_contents( $file ), true ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
|
63 |
}
|
64 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
/**
|
66 |
* Basically just adds JSON to the end of the key but we should use this
|
67 |
* to also make sure it's a proper filename.
|
62 |
return json_decode( file_get_contents( $file ), true ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents
|
63 |
}
|
64 |
|
65 |
+
/**
|
66 |
+
* Delete a cached file by its key.
|
67 |
+
*
|
68 |
+
* @param string $key The key to find the file by.
|
69 |
+
*
|
70 |
+
* @return void
|
71 |
+
*/
|
72 |
+
public function delete( $key ) {
|
73 |
+
$file = $this->get_directory_path( $this->get_cache_filename_by_key( $key ) );
|
74 |
+
|
75 |
+
wp_delete_file( $file );
|
76 |
+
}
|
77 |
+
|
78 |
/**
|
79 |
* Basically just adds JSON to the end of the key but we should use this
|
80 |
* to also make sure it's a proper filename.
|
includes/class-wpcode-install.php
CHANGED
@@ -28,6 +28,9 @@ class WPCode_Install {
|
|
28 |
// but the option used in the `maybe_run_install` method below is not
|
29 |
// removed so the capabilities are not added back.
|
30 |
WPCode_Capabilities::add_capabilities();
|
|
|
|
|
|
|
31 |
}
|
32 |
|
33 |
/**
|
@@ -40,6 +43,10 @@ class WPCode_Install {
|
|
40 |
* @return void
|
41 |
*/
|
42 |
public function maybe_run_install() {
|
|
|
|
|
|
|
|
|
43 |
$activated = get_option( 'ihaf_activated', array() );
|
44 |
|
45 |
if ( empty( $activated['wpcode'] ) ) {
|
@@ -60,6 +67,33 @@ class WPCode_Install {
|
|
60 |
|
61 |
do_action( 'wpcode_install' );
|
62 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
}
|
64 |
|
65 |
/**
|
28 |
// but the option used in the `maybe_run_install` method below is not
|
29 |
// removed so the capabilities are not added back.
|
30 |
WPCode_Capabilities::add_capabilities();
|
31 |
+
|
32 |
+
// Use an action to have a single activation hook plugin-wide.
|
33 |
+
do_action( 'wpcode_plugin_activation' );
|
34 |
}
|
35 |
|
36 |
/**
|
43 |
* @return void
|
44 |
*/
|
45 |
public function maybe_run_install() {
|
46 |
+
if ( ! is_admin() ) {
|
47 |
+
return;
|
48 |
+
}
|
49 |
+
|
50 |
$activated = get_option( 'ihaf_activated', array() );
|
51 |
|
52 |
if ( empty( $activated['wpcode'] ) ) {
|
67 |
|
68 |
do_action( 'wpcode_install' );
|
69 |
}
|
70 |
+
|
71 |
+
// Maybe run manually just one time.
|
72 |
+
$install = get_option( 'wpcode_install', false );
|
73 |
+
|
74 |
+
if ( ! empty( $install ) ) {
|
75 |
+
$this->activate();
|
76 |
+
delete_option( 'wpcode_install' );
|
77 |
+
}
|
78 |
+
|
79 |
+
// Let's run an upgrade routine.
|
80 |
+
if ( empty( $activated['version'] ) ) {
|
81 |
+
$activated['version'] = WPCODE_VERSION;
|
82 |
+
update_option( 'ihaf_activated', $activated );
|
83 |
+
$this->update_2_1_0();
|
84 |
+
}
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Upgrade routine for 2.1.0.
|
89 |
+
* Empty the library cache to get the new snippets.
|
90 |
+
*
|
91 |
+
* @return void
|
92 |
+
*/
|
93 |
+
public function update_2_1_0() {
|
94 |
+
if ( isset( wpcode()->library ) ) {
|
95 |
+
wpcode()->library->delete_cache();
|
96 |
+
}
|
97 |
}
|
98 |
|
99 |
/**
|
includes/class-wpcode-library-auth.php
ADDED
@@ -0,0 +1,188 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class for handling the WPCode library authentication.
|
4 |
+
*
|
5 |
+
* @package WPCode
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class WPCode_Library_Auth.
|
10 |
+
*/
|
11 |
+
class WPCode_Library_Auth {
|
12 |
+
/**
|
13 |
+
* The base api URL.
|
14 |
+
*
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
public $library_url = 'https://library.wpcode.com';
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Is the current plugin authenticated with the WPCode Library?
|
21 |
+
*
|
22 |
+
* @var bool
|
23 |
+
*/
|
24 |
+
private $has_auth;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* The api key used for authenticated requests to the library.
|
28 |
+
*
|
29 |
+
* @var string
|
30 |
+
*/
|
31 |
+
private $auth_key;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* The auth data from the db.
|
35 |
+
*
|
36 |
+
* @var array
|
37 |
+
*/
|
38 |
+
private $auth_data;
|
39 |
+
|
40 |
+
/**
|
41 |
+
* Library auth constructor.
|
42 |
+
*/
|
43 |
+
public function __construct() {
|
44 |
+
add_action( 'wp_ajax_wpcode_library_start_auth', array( $this, 'ajax_auth_url' ) );
|
45 |
+
add_action( 'wp_ajax_wpcode_library_store_auth', array( $this, 'store_auth_key' ) );
|
46 |
+
add_action( 'wp_ajax_wpcode_library_delete_auth', array( $this, 'delete_auth' ) );
|
47 |
+
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Ajax handler that returns the auth url used to start the Connect process.
|
51 |
+
*
|
52 |
+
* @return void
|
53 |
+
*/
|
54 |
+
public function ajax_auth_url() {
|
55 |
+
check_ajax_referer( 'wpcode_admin' );
|
56 |
+
|
57 |
+
$auth_url = add_query_arg(
|
58 |
+
array(
|
59 |
+
'site' => get_bloginfo( 'name' ),
|
60 |
+
'version' => WPCODE_VERSION,
|
61 |
+
),
|
62 |
+
$this->get_api_url( 'connect' )
|
63 |
+
);
|
64 |
+
|
65 |
+
wp_send_json_success(
|
66 |
+
array(
|
67 |
+
'url' => $auth_url,
|
68 |
+
)
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
/**
|
73 |
+
* Get the full URL to an API endpoint by passing the path.
|
74 |
+
*
|
75 |
+
* @param string $path The path for the API endpoint.
|
76 |
+
*
|
77 |
+
* @return string
|
78 |
+
*/
|
79 |
+
public function get_api_url( $path ) {
|
80 |
+
return trailingslashit( $this->library_url ) . 'api/' . $path;
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Ajax handler to save the auth API key.
|
85 |
+
*
|
86 |
+
* @return void
|
87 |
+
*/
|
88 |
+
public function store_auth_key() {
|
89 |
+
check_ajax_referer( 'wpcode_admin' );
|
90 |
+
|
91 |
+
$key = ! empty( $_POST['key'] ) ? sanitize_key( $_POST['key'] ) : false;
|
92 |
+
$username = ! empty( $_POST['username'] ) ? sanitize_user( wp_unslash( $_POST['username'] ) ) : false;
|
93 |
+
$origin = ! empty( $_POST['origin'] ) ? esc_url_raw( wp_unslash( $_POST['origin'] ) ) : false;
|
94 |
+
|
95 |
+
if ( ! $key || $this->library_url !== $origin ) {
|
96 |
+
wp_send_json_error();
|
97 |
+
}
|
98 |
+
|
99 |
+
// Don't autoload this as we'll only need it on some pages and in specific requests.
|
100 |
+
update_option(
|
101 |
+
'wpcode_library_api_auth',
|
102 |
+
array(
|
103 |
+
'key' => $key,
|
104 |
+
'username' => $username,
|
105 |
+
'connected_at' => time(),
|
106 |
+
),
|
107 |
+
false
|
108 |
+
);
|
109 |
+
|
110 |
+
do_action( 'wpcode_library_api_auth_connected' );
|
111 |
+
|
112 |
+
wp_send_json_success(
|
113 |
+
array(
|
114 |
+
'title' => __( 'Authentication successfully completed', 'insert-headers-and-footers' ),
|
115 |
+
'text' => __( 'Reloading page, please wait.', 'insert-headers-and-footers' ),
|
116 |
+
)
|
117 |
+
);
|
118 |
+
}
|
119 |
+
|
120 |
+
/**
|
121 |
+
* Ajax handler to delete the auth data and disconnect the site from the WPCode Library.
|
122 |
+
*
|
123 |
+
* @return void
|
124 |
+
*/
|
125 |
+
public function delete_auth() {
|
126 |
+
check_ajax_referer( 'wpcode_admin' );
|
127 |
+
|
128 |
+
if ( delete_option( 'wpcode_library_api_auth' ) ) {
|
129 |
+
do_action( 'wpcode_library_api_auth_deleted' );
|
130 |
+
wp_send_json_success();
|
131 |
+
}
|
132 |
+
|
133 |
+
wp_send_json_error();
|
134 |
+
}
|
135 |
+
|
136 |
+
/**
|
137 |
+
* Check if the site is authenticated.
|
138 |
+
*
|
139 |
+
* @return bool
|
140 |
+
*/
|
141 |
+
public function has_auth() {
|
142 |
+
if ( ! isset( $this->has_auth ) ) {
|
143 |
+
$auth_key = $this->get_auth_key();
|
144 |
+
|
145 |
+
$this->has_auth = ! empty( $auth_key );
|
146 |
+
}
|
147 |
+
|
148 |
+
return $this->has_auth;
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* The auth key.
|
153 |
+
*
|
154 |
+
* @return bool|string
|
155 |
+
*/
|
156 |
+
public function get_auth_key() {
|
157 |
+
if ( ! isset( $this->auth_key ) ) {
|
158 |
+
$data = $this->get_auth_data();
|
159 |
+
$this->auth_key = isset( $data['key'] ) ? $data['key'] : false;
|
160 |
+
}
|
161 |
+
|
162 |
+
return $this->auth_key;
|
163 |
+
}
|
164 |
+
|
165 |
+
/**
|
166 |
+
* Get the auth data from the db.
|
167 |
+
*
|
168 |
+
* @return array|bool
|
169 |
+
*/
|
170 |
+
public function get_auth_data() {
|
171 |
+
if ( ! isset( $this->auth_data ) ) {
|
172 |
+
$this->auth_data = get_option( 'wpcode_library_api_auth', false );
|
173 |
+
}
|
174 |
+
|
175 |
+
return $this->auth_data;
|
176 |
+
}
|
177 |
+
|
178 |
+
/**
|
179 |
+
* The auth username.
|
180 |
+
*
|
181 |
+
* @return bool|string
|
182 |
+
*/
|
183 |
+
public function get_auth_username() {
|
184 |
+
$data = $this->get_auth_data();
|
185 |
+
|
186 |
+
return isset( $data['username'] ) ? $data['username'] : false;
|
187 |
+
}
|
188 |
+
}
|
includes/class-wpcode-library.php
CHANGED
@@ -11,53 +11,86 @@
|
|
11 |
class WPCode_Library {
|
12 |
|
13 |
/**
|
14 |
-
*
|
15 |
*
|
16 |
* @var string
|
17 |
*/
|
18 |
-
|
19 |
|
20 |
/**
|
21 |
-
*
|
22 |
*
|
23 |
* @var string
|
24 |
*/
|
25 |
-
|
26 |
|
27 |
/**
|
28 |
* The key for storing individual snippets.
|
29 |
*
|
30 |
* @var string
|
31 |
*/
|
32 |
-
|
33 |
|
34 |
/**
|
35 |
* The base cache folder for this class.
|
36 |
*
|
37 |
* @var string
|
38 |
*/
|
39 |
-
|
40 |
|
41 |
/**
|
42 |
* The data.
|
43 |
*
|
44 |
* @var array
|
45 |
*/
|
46 |
-
|
47 |
|
48 |
/**
|
49 |
* The default time to live for libary items that are cached.
|
50 |
*
|
51 |
* @var int
|
52 |
*/
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
55 |
/**
|
56 |
* Array of snippet ids that were already loaded from the library.
|
57 |
*
|
58 |
* @var array
|
59 |
*/
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
|
62 |
/**
|
63 |
* Grab all the available categories from the library.
|
@@ -121,36 +154,75 @@ class WPCode_Library {
|
|
121 |
* @return array
|
122 |
*/
|
123 |
private function get_from_server() {
|
124 |
-
$
|
125 |
|
126 |
-
if ( empty( $
|
127 |
-
|
128 |
-
return $this->get_empty_array();
|
129 |
}
|
130 |
|
131 |
-
$
|
|
|
|
|
|
|
132 |
|
133 |
-
|
134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
}
|
136 |
|
137 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
|
139 |
-
$
|
140 |
if ( $response_code > 299 ) {
|
141 |
// Temporary error so cache for just 10 minutes and then try again.
|
142 |
-
|
143 |
-
}
|
144 |
-
|
145 |
-
$data = $this->process_response( $data );
|
146 |
-
|
147 |
-
if ( empty( $data['snippets'] ) ) {
|
148 |
-
return $this->save_temporary_response_fail( $this->cache_key );
|
149 |
}
|
150 |
|
151 |
-
|
|
|
152 |
|
153 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
154 |
}
|
155 |
|
156 |
/**
|
@@ -202,7 +274,7 @@ class WPCode_Library {
|
|
202 |
*
|
203 |
* @return array
|
204 |
*/
|
205 |
-
|
206 |
$response = json_decode( $data, true );
|
207 |
if ( ! isset( $response['status'] ) || 'success' !== $response['status'] ) {
|
208 |
return $this->get_empty_array();
|
@@ -243,7 +315,7 @@ class WPCode_Library {
|
|
243 |
|
244 |
$snippet->save();
|
245 |
|
246 |
-
delete_transient(
|
247 |
|
248 |
return $snippet;
|
249 |
}
|
@@ -256,28 +328,8 @@ class WPCode_Library {
|
|
256 |
* @return array|array[]|false
|
257 |
*/
|
258 |
public function grab_snippet_from_api( $library_id ) {
|
259 |
-
$
|
260 |
-
|
261 |
-
if ( empty( $data['links']['snippet'] ) ) {
|
262 |
-
return false;
|
263 |
-
}
|
264 |
-
|
265 |
-
$url = add_query_arg(
|
266 |
-
array(
|
267 |
-
'site' => rawurlencode( site_url() ),
|
268 |
-
),
|
269 |
-
trailingslashit( esc_url( $data['links']['snippet'] ) ) . $library_id
|
270 |
-
);
|
271 |
-
|
272 |
-
$snippet_request = wp_remote_get( $url );
|
273 |
-
|
274 |
-
$response_code = wp_remote_retrieve_response_code( $snippet_request );
|
275 |
-
|
276 |
-
if ( $response_code > 299 ) {
|
277 |
-
return false;
|
278 |
-
}
|
279 |
-
|
280 |
-
$snippet_data = $this->process_response( wp_remote_retrieve_body( $snippet_request ) );
|
281 |
|
282 |
if ( empty( $snippet_data ) ) {
|
283 |
return false;
|
@@ -298,7 +350,7 @@ class WPCode_Library {
|
|
298 |
return $this->library_snippets;
|
299 |
}
|
300 |
|
301 |
-
$snippets_from_library = get_transient(
|
302 |
|
303 |
if ( false === $snippets_from_library ) {
|
304 |
$snippets_from_library = array();
|
@@ -307,7 +359,7 @@ class WPCode_Library {
|
|
307 |
'post_type' => 'wpcode',
|
308 |
'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
|
309 |
array(
|
310 |
-
'key' =>
|
311 |
'compare' => 'EXISTS',
|
312 |
),
|
313 |
),
|
@@ -318,11 +370,10 @@ class WPCode_Library {
|
|
318 |
$snippets = get_posts( $args );
|
319 |
|
320 |
foreach ( $snippets as $snippet_id ) {
|
321 |
-
$
|
322 |
-
$snippets_from_library[ $library_id ] = $snippet_id;
|
323 |
}
|
324 |
|
325 |
-
set_transient(
|
326 |
}
|
327 |
|
328 |
$this->library_snippets = $snippets_from_library;
|
@@ -330,4 +381,51 @@ class WPCode_Library {
|
|
330 |
return $this->library_snippets;
|
331 |
|
332 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
}
|
11 |
class WPCode_Library {
|
12 |
|
13 |
/**
|
14 |
+
* Key for storing snippets in the cache.
|
15 |
*
|
16 |
* @var string
|
17 |
*/
|
18 |
+
protected $cache_key = 'snippets';
|
19 |
|
20 |
/**
|
21 |
+
* Library endpoint for loading all data.
|
22 |
*
|
23 |
* @var string
|
24 |
*/
|
25 |
+
protected $all_snippets_endpoint = 'get';
|
26 |
|
27 |
/**
|
28 |
* The key for storing individual snippets.
|
29 |
*
|
30 |
* @var string
|
31 |
*/
|
32 |
+
protected $snippet_key = 'snippets/snippet';
|
33 |
|
34 |
/**
|
35 |
* The base cache folder for this class.
|
36 |
*
|
37 |
* @var string
|
38 |
*/
|
39 |
+
protected $cache_folder = 'library';
|
40 |
|
41 |
/**
|
42 |
* The data.
|
43 |
*
|
44 |
* @var array
|
45 |
*/
|
46 |
+
protected $data;
|
47 |
|
48 |
/**
|
49 |
* The default time to live for libary items that are cached.
|
50 |
*
|
51 |
* @var int
|
52 |
*/
|
53 |
+
protected $ttl = DAY_IN_SECONDS;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Key for transient used to store already installed snippets.
|
57 |
+
*
|
58 |
+
* @var string
|
59 |
+
*/
|
60 |
+
protected $used_snippets_transient_key = 'wpcode_used_library_snippets';
|
61 |
|
62 |
/**
|
63 |
* Array of snippet ids that were already loaded from the library.
|
64 |
*
|
65 |
* @var array
|
66 |
*/
|
67 |
+
protected $library_snippets;
|
68 |
+
|
69 |
+
/**
|
70 |
+
* Meta Key used for storing the library id.
|
71 |
+
*
|
72 |
+
* @var string
|
73 |
+
*/
|
74 |
+
protected $snippet_library_id_meta_key = '_wpcode_library_id';
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Constructor.
|
78 |
+
*/
|
79 |
+
public function __construct() {
|
80 |
+
$this->hooks();
|
81 |
+
}
|
82 |
+
|
83 |
+
/**
|
84 |
+
* Class-specific hooks.
|
85 |
+
*
|
86 |
+
* @return void
|
87 |
+
*/
|
88 |
+
protected function hooks() {
|
89 |
+
add_action( 'trash_wpcode', array( $this, 'clear_used_snippets' ) );
|
90 |
+
add_action( 'transition_post_status', array( $this, 'clear_used_snippets_untrash' ), 10, 3 );
|
91 |
+
add_action( 'wpcode_library_api_auth_connected', array( $this, 'delete_cache' ) );
|
92 |
+
add_action( 'wpcode_library_api_auth_deleted', array( $this, 'delete_cache' ) );
|
93 |
+
}
|
94 |
|
95 |
/**
|
96 |
* Grab all the available categories from the library.
|
154 |
* @return array
|
155 |
*/
|
156 |
private function get_from_server() {
|
157 |
+
$data = $this->process_response( $this->make_request( $this->all_snippets_endpoint ) );
|
158 |
|
159 |
+
if ( empty( $data['snippets'] ) ) {
|
160 |
+
return $this->save_temporary_response_fail( $this->cache_key );
|
|
|
161 |
}
|
162 |
|
163 |
+
$this->save_to_cache( $this->cache_key, $data );
|
164 |
+
|
165 |
+
return $data;
|
166 |
+
}
|
167 |
|
168 |
+
/**
|
169 |
+
* Generic request handler with support for authentication.
|
170 |
+
*
|
171 |
+
* @param string $endpoint The API endpoint to load data from.
|
172 |
+
* @param string $method The method used for the request (GET, POST, etc).
|
173 |
+
* @param array $data The data to pass in the body for POST-like requests.
|
174 |
+
*
|
175 |
+
* @return string
|
176 |
+
*/
|
177 |
+
public function make_request( $endpoint = '', $method = 'GET', $data = array() ) {
|
178 |
+
$args = array(
|
179 |
+
'method' => $method,
|
180 |
+
);
|
181 |
+
if ( wpcode()->library_auth->has_auth() ) {
|
182 |
+
$args['headers'] = $this->get_authenticated_headers();
|
183 |
+
}
|
184 |
+
if ( ! empty( $data ) ) {
|
185 |
+
$args['body'] = $data;
|
186 |
}
|
187 |
|
188 |
+
$url = add_query_arg(
|
189 |
+
array(
|
190 |
+
'site' => rawurlencode( site_url() ),
|
191 |
+
'version' => WPCODE_VERSION,
|
192 |
+
),
|
193 |
+
wpcode()->library_auth->get_api_url( $endpoint )
|
194 |
+
);
|
195 |
+
|
196 |
+
$response = wp_remote_request( $url, $args );
|
197 |
|
198 |
+
$response_code = wp_remote_retrieve_response_code( $response );
|
199 |
if ( $response_code > 299 ) {
|
200 |
// Temporary error so cache for just 10 minutes and then try again.
|
201 |
+
return '';
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
203 |
|
204 |
+
return wp_remote_retrieve_body( $response );
|
205 |
+
}
|
206 |
|
207 |
+
/**
|
208 |
+
* Get the headers for making an authenticated request.
|
209 |
+
*
|
210 |
+
* @return array
|
211 |
+
*/
|
212 |
+
public function get_authenticated_headers() {
|
213 |
+
// Build the headers of the request.
|
214 |
+
return array(
|
215 |
+
'Content-Type' => 'application/x-www-form-urlencoded',
|
216 |
+
'Cache-Control' => 'no-store, no-cache, must-revalidate, max-age=0, post-check=0, pre-check=0',
|
217 |
+
'Pragma' => 'no-cache',
|
218 |
+
'Expires' => 0,
|
219 |
+
'Origin' => site_url(),
|
220 |
+
'WPCode-Referer' => site_url(),
|
221 |
+
'WPCode-Sender' => 'WordPress',
|
222 |
+
'WPCode-Site' => esc_attr( get_option( 'blogname' ) ),
|
223 |
+
'WPCode-Version' => esc_attr( WPCODE_VERSION ),
|
224 |
+
'X-WPCode-ApiKey' => wpcode()->library_auth->get_auth_key(),
|
225 |
+
);
|
226 |
}
|
227 |
|
228 |
/**
|
274 |
*
|
275 |
* @return array
|
276 |
*/
|
277 |
+
public function process_response( $data ) {
|
278 |
$response = json_decode( $data, true );
|
279 |
if ( ! isset( $response['status'] ) || 'success' !== $response['status'] ) {
|
280 |
return $this->get_empty_array();
|
315 |
|
316 |
$snippet->save();
|
317 |
|
318 |
+
delete_transient( $this->used_snippets_transient_key );
|
319 |
|
320 |
return $snippet;
|
321 |
}
|
328 |
* @return array|array[]|false
|
329 |
*/
|
330 |
public function grab_snippet_from_api( $library_id ) {
|
331 |
+
$snippet_request = $this->make_request( 'get/' . $library_id );
|
332 |
+
$snippet_data = $this->process_response( $snippet_request );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
|
334 |
if ( empty( $snippet_data ) ) {
|
335 |
return false;
|
350 |
return $this->library_snippets;
|
351 |
}
|
352 |
|
353 |
+
$snippets_from_library = get_transient( $this->used_snippets_transient_key );
|
354 |
|
355 |
if ( false === $snippets_from_library ) {
|
356 |
$snippets_from_library = array();
|
359 |
'post_type' => 'wpcode',
|
360 |
'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
|
361 |
array(
|
362 |
+
'key' => $this->snippet_library_id_meta_key,
|
363 |
'compare' => 'EXISTS',
|
364 |
),
|
365 |
),
|
370 |
$snippets = get_posts( $args );
|
371 |
|
372 |
foreach ( $snippets as $snippet_id ) {
|
373 |
+
$snippets_from_library[ $this->get_snippet_library_id( $snippet_id ) ] = $snippet_id;
|
|
|
374 |
}
|
375 |
|
376 |
+
set_transient( $this->used_snippets_transient_key, $snippets_from_library );
|
377 |
}
|
378 |
|
379 |
$this->library_snippets = $snippets_from_library;
|
381 |
return $this->library_snippets;
|
382 |
|
383 |
}
|
384 |
+
|
385 |
+
/**
|
386 |
+
* Grab the library id from the snippet by snippet id.
|
387 |
+
*
|
388 |
+
* @param int $snippet_id The snippet id.
|
389 |
+
*
|
390 |
+
* @return int
|
391 |
+
*/
|
392 |
+
public function get_snippet_library_id( $snippet_id ) {
|
393 |
+
return absint( get_post_meta( $snippet_id, '_wpcode_library_id', true ) );
|
394 |
+
}
|
395 |
+
|
396 |
+
/**
|
397 |
+
* When a snippet is trashed, clear the used snippets transients
|
398 |
+
* for this class instance to avoid confusion in the library.
|
399 |
+
*
|
400 |
+
* @return void
|
401 |
+
*/
|
402 |
+
public function clear_used_snippets() {
|
403 |
+
delete_transient( $this->used_snippets_transient_key );
|
404 |
+
}
|
405 |
+
|
406 |
+
/**
|
407 |
+
* Clear used snippets also when a snippet is un-trashed.
|
408 |
+
*
|
409 |
+
* @param string $new_status
|
410 |
+
* @param string $old_status
|
411 |
+
* @param WP_Post $post
|
412 |
+
*
|
413 |
+
* @return void
|
414 |
+
*/
|
415 |
+
public function clear_used_snippets_untrash( $new_status, $old_status, $post ) {
|
416 |
+
if ( 'wpcode' !== $post->post_type || 'trash' !== $old_status ) {
|
417 |
+
return;
|
418 |
+
}
|
419 |
+
|
420 |
+
$this->clear_used_snippets();
|
421 |
+
}
|
422 |
+
|
423 |
+
/**
|
424 |
+
* Delete the file cache for the snippets library.
|
425 |
+
*
|
426 |
+
* @return void
|
427 |
+
*/
|
428 |
+
public function delete_cache() {
|
429 |
+
wpcode()->file_cache->delete( $this->cache_folder . '/' . $this->cache_key );
|
430 |
+
}
|
431 |
}
|
includes/class-wpcode-settings.php
CHANGED
@@ -28,19 +28,20 @@ class WPCode_Settings {
|
|
28 |
/**
|
29 |
* Get an option by name with an optional default value.
|
30 |
*
|
31 |
-
* @param string $
|
32 |
* @param mixed $default The default value (optional).
|
33 |
*
|
34 |
* @return mixed
|
35 |
* @see get_option
|
36 |
*/
|
37 |
-
public function get_option( $
|
38 |
$options = $this->get_options();
|
39 |
-
|
40 |
-
|
|
|
41 |
}
|
42 |
|
43 |
-
return $
|
44 |
}
|
45 |
|
46 |
/**
|
28 |
/**
|
29 |
* Get an option by name with an optional default value.
|
30 |
*
|
31 |
+
* @param string $option_name The option name.
|
32 |
* @param mixed $default The default value (optional).
|
33 |
*
|
34 |
* @return mixed
|
35 |
* @see get_option
|
36 |
*/
|
37 |
+
public function get_option( $option_name, $default = false ) {
|
38 |
$options = $this->get_options();
|
39 |
+
$value = $default;
|
40 |
+
if ( isset( $options[ $option_name ] ) ) {
|
41 |
+
$value = $options[ $option_name ];
|
42 |
}
|
43 |
|
44 |
+
return apply_filters( "wpcode_get_option_{$option_name}", $value );
|
45 |
}
|
46 |
|
47 |
/**
|
includes/class-wpcode-snippet-cache.php
CHANGED
@@ -48,6 +48,23 @@ class WPCode_Snippet_Cache {
|
|
48 |
return $this->snippets;
|
49 |
}
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
/**
|
52 |
* Used for sorting by priority.
|
53 |
*
|
48 |
return $this->snippets;
|
49 |
}
|
50 |
|
51 |
+
/**
|
52 |
+
* Get cached snippets in an array by their id.
|
53 |
+
*
|
54 |
+
* @return WPCode_Snippet[]
|
55 |
+
*/
|
56 |
+
public function get_cached_snippets_by_id() {
|
57 |
+
$snippets_by_id = array();
|
58 |
+
$cached_snippets = $this->get_cached_snippets();
|
59 |
+
foreach ( $cached_snippets as $snippets ) {
|
60 |
+
foreach ( $snippets as $snippet ) {
|
61 |
+
$snippets_by_id[ $snippet->get_id() ] = $snippet;
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
return $snippets_by_id;
|
66 |
+
}
|
67 |
+
|
68 |
/**
|
69 |
* Used for sorting by priority.
|
70 |
*
|
includes/class-wpcode-snippet-execute.php
CHANGED
@@ -70,6 +70,7 @@ class WPCode_Snippet_Execute {
|
|
70 |
require_once WPCODE_PLUGIN_PATH . 'includes/execute/class-wpcode-snippet-execute-js.php';
|
71 |
require_once WPCODE_PLUGIN_PATH . 'includes/execute/class-wpcode-snippet-execute-php.php';
|
72 |
require_once WPCODE_PLUGIN_PATH . 'includes/execute/class-wpcode-snippet-execute-universal.php';
|
|
|
73 |
|
74 |
$this->types = array(
|
75 |
'html' => array(
|
@@ -93,6 +94,10 @@ class WPCode_Snippet_Execute {
|
|
93 |
'class' => 'WPCode_Snippet_Execute_Universal',
|
94 |
'label' => __( 'Universal Snippet', 'insert-headers-and-footers' ),
|
95 |
),
|
|
|
|
|
|
|
|
|
96 |
);
|
97 |
}
|
98 |
|
@@ -212,6 +217,9 @@ class WPCode_Snippet_Execute {
|
|
212 |
case 'text':
|
213 |
$mime = 'text/x-markdown';
|
214 |
break;
|
|
|
|
|
|
|
215 |
}
|
216 |
}
|
217 |
|
@@ -259,6 +267,10 @@ class WPCode_Snippet_Execute {
|
|
259 |
try {
|
260 |
eval( $code ); // phpcs:ignore Squiz.PHP.Eval.Discouraged
|
261 |
} catch ( Error $e ) {
|
|
|
|
|
|
|
|
|
262 |
wpcode()->error->add_error( $e );
|
263 |
$error = true;
|
264 |
}
|
70 |
require_once WPCODE_PLUGIN_PATH . 'includes/execute/class-wpcode-snippet-execute-js.php';
|
71 |
require_once WPCODE_PLUGIN_PATH . 'includes/execute/class-wpcode-snippet-execute-php.php';
|
72 |
require_once WPCODE_PLUGIN_PATH . 'includes/execute/class-wpcode-snippet-execute-universal.php';
|
73 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/execute/class-wpcode-snippet-execute-css.php';
|
74 |
|
75 |
$this->types = array(
|
76 |
'html' => array(
|
94 |
'class' => 'WPCode_Snippet_Execute_Universal',
|
95 |
'label' => __( 'Universal Snippet', 'insert-headers-and-footers' ),
|
96 |
),
|
97 |
+
'css' => array(
|
98 |
+
'class' => 'WPCode_Snippet_Execute_CSS',
|
99 |
+
'label' => __( 'CSS Snippet', 'insert-headers-and-footers' ),
|
100 |
+
),
|
101 |
);
|
102 |
}
|
103 |
|
217 |
case 'text':
|
218 |
$mime = 'text/x-markdown';
|
219 |
break;
|
220 |
+
case 'css':
|
221 |
+
$mime = 'text/css';
|
222 |
+
break;
|
223 |
}
|
224 |
}
|
225 |
|
267 |
try {
|
268 |
eval( $code ); // phpcs:ignore Squiz.PHP.Eval.Discouraged
|
269 |
} catch ( Error $e ) {
|
270 |
+
// If WP_DEBUG & WP_DEBUG_LOG are on, we'll log the error.
|
271 |
+
if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
|
272 |
+
error_log( $e->getMessage() );
|
273 |
+
}
|
274 |
wpcode()->error->add_error( $e );
|
275 |
$error = true;
|
276 |
}
|
includes/class-wpcode-snippet.php
CHANGED
@@ -10,6 +10,30 @@
|
|
10 |
*/
|
11 |
class WPCode_Snippet {
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
/**
|
14 |
* The snippet id.
|
15 |
*
|
@@ -114,6 +138,20 @@ class WPCode_Snippet {
|
|
114 |
*/
|
115 |
private $library_id;
|
116 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
/**
|
118 |
* The version of the snippet from the library.
|
119 |
*
|
@@ -154,7 +192,7 @@ class WPCode_Snippet {
|
|
154 |
} elseif ( is_array( $snippet ) ) {
|
155 |
$this->load_from_array( $snippet );
|
156 |
}
|
157 |
-
if ( isset( $this->post_data ) &&
|
158 |
unset( $this->post_data );
|
159 |
}
|
160 |
}
|
@@ -168,7 +206,9 @@ class WPCode_Snippet {
|
|
168 |
*/
|
169 |
public function load_from_id( $snippet_id ) {
|
170 |
$this->post_data = get_post( $snippet_id );
|
171 |
-
|
|
|
|
|
172 |
}
|
173 |
|
174 |
/**
|
@@ -208,7 +248,7 @@ class WPCode_Snippet {
|
|
208 |
public function set_location() {
|
209 |
// If something below fails, let's not try again.
|
210 |
$this->location = '';
|
211 |
-
$this->location_term = $this->get_single_term(
|
212 |
if ( $this->location_term ) {
|
213 |
$this->location = $this->location_term->slug;
|
214 |
}
|
@@ -314,7 +354,7 @@ class WPCode_Snippet {
|
|
314 |
*/
|
315 |
public function is_active() {
|
316 |
if ( ! isset( $this->active ) ) {
|
317 |
-
$this->active = 'publish' === $this->post_data->post_status;
|
318 |
}
|
319 |
|
320 |
return $this->active;
|
@@ -351,7 +391,7 @@ class WPCode_Snippet {
|
|
351 |
*/
|
352 |
public function save() {
|
353 |
$post_args = array(
|
354 |
-
'post_type' =>
|
355 |
);
|
356 |
if ( isset( $this->id ) && 0 !== $this->id ) {
|
357 |
$post_args['ID'] = $this->id;
|
@@ -396,20 +436,20 @@ class WPCode_Snippet {
|
|
396 |
$this->id = $insert_result;
|
397 |
|
398 |
if ( isset( $this->code_type ) ) {
|
399 |
-
wp_set_post_terms( $this->id, $this->code_type,
|
400 |
}
|
401 |
if ( isset( $this->auto_insert ) ) {
|
402 |
// Save this value for reference, but we never query by it.
|
403 |
update_post_meta( $this->id, '_wpcode_auto_insert', $this->auto_insert );
|
404 |
}
|
405 |
if ( isset( $this->location ) && 1 === $this->auto_insert ) {
|
406 |
-
wp_set_post_terms( $this->id, $this->location,
|
407 |
} elseif ( isset( $this->auto_insert ) ) {
|
408 |
// If auto insert is disabled we just empty the taxonomy.
|
409 |
-
wp_set_post_terms( $this->id, array(),
|
410 |
}
|
411 |
if ( isset( $this->tags ) ) {
|
412 |
-
wp_set_post_terms( $this->id, $this->tags,
|
413 |
}
|
414 |
if ( isset( $this->insert_number ) ) {
|
415 |
update_post_meta( $this->id, '_wpcode_auto_insert_number', $this->insert_number );
|
@@ -438,6 +478,31 @@ class WPCode_Snippet {
|
|
438 |
if ( isset( $this->generator_data ) ) {
|
439 |
update_post_meta( $this->id, '_wpcode_generator_data', $this->generator_data );
|
440 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
|
442 |
/**
|
443 |
* Run extra logic after the snippet is saved.
|
@@ -515,7 +580,7 @@ class WPCode_Snippet {
|
|
515 |
public function set_code_type() {
|
516 |
// If something below fails, let's not try again.
|
517 |
$this->code_type = '';
|
518 |
-
$this->code_type_term = $this->get_single_term(
|
519 |
if ( $this->code_type_term ) {
|
520 |
$this->code_type = $this->code_type_term->slug;
|
521 |
}
|
@@ -590,7 +655,7 @@ class WPCode_Snippet {
|
|
590 |
* @return void
|
591 |
*/
|
592 |
public function set_tags() {
|
593 |
-
$tags = wp_get_post_terms( $this->get_id(),
|
594 |
$tag_slugs = array();
|
595 |
foreach ( $tags as $tag ) {
|
596 |
/**
|
@@ -687,4 +752,50 @@ class WPCode_Snippet {
|
|
687 |
'priority' => $this->get_priority(),
|
688 |
);
|
689 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
690 |
}
|
10 |
*/
|
11 |
class WPCode_Snippet {
|
12 |
|
13 |
+
/**
|
14 |
+
* Post type used to store.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
public $post_type = 'wpcode';
|
19 |
+
/**
|
20 |
+
* Location taxonomy name.
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
public $location_taxonomy = 'wpcode_location';
|
25 |
+
/**
|
26 |
+
* Code type taxonomy name.
|
27 |
+
*
|
28 |
+
* @var string
|
29 |
+
*/
|
30 |
+
public $code_type_taxonomy = 'wpcode_type';
|
31 |
+
/**
|
32 |
+
* Tags taxonomy name.
|
33 |
+
*
|
34 |
+
* @var string
|
35 |
+
*/
|
36 |
+
public $tags_taxonomy = 'wpcode_tags';
|
37 |
/**
|
38 |
* The snippet id.
|
39 |
*
|
138 |
*/
|
139 |
private $library_id;
|
140 |
|
141 |
+
/**
|
142 |
+
* The cloud id, if the snippet has been saved to the user's cloud.
|
143 |
+
*
|
144 |
+
* @var string
|
145 |
+
*/
|
146 |
+
private $cloud_id;
|
147 |
+
|
148 |
+
/**
|
149 |
+
* The custom shortcode name.
|
150 |
+
*
|
151 |
+
* @var string
|
152 |
+
*/
|
153 |
+
public $custom_shortcode;
|
154 |
+
|
155 |
/**
|
156 |
* The version of the snippet from the library.
|
157 |
*
|
192 |
} elseif ( is_array( $snippet ) ) {
|
193 |
$this->load_from_array( $snippet );
|
194 |
}
|
195 |
+
if ( isset( $this->post_data ) && $this->post_type !== $this->post_data->post_type ) {
|
196 |
unset( $this->post_data );
|
197 |
}
|
198 |
}
|
206 |
*/
|
207 |
public function load_from_id( $snippet_id ) {
|
208 |
$this->post_data = get_post( $snippet_id );
|
209 |
+
if ( $this->post_data ) {
|
210 |
+
$this->id = $this->post_data->ID;
|
211 |
+
}
|
212 |
}
|
213 |
|
214 |
/**
|
248 |
public function set_location() {
|
249 |
// If something below fails, let's not try again.
|
250 |
$this->location = '';
|
251 |
+
$this->location_term = $this->get_single_term( $this->location_taxonomy );
|
252 |
if ( $this->location_term ) {
|
253 |
$this->location = $this->location_term->slug;
|
254 |
}
|
354 |
*/
|
355 |
public function is_active() {
|
356 |
if ( ! isset( $this->active ) ) {
|
357 |
+
$this->active = isset( $this->post_data->post_status ) && 'publish' === $this->post_data->post_status;
|
358 |
}
|
359 |
|
360 |
return $this->active;
|
391 |
*/
|
392 |
public function save() {
|
393 |
$post_args = array(
|
394 |
+
'post_type' => $this->post_type,
|
395 |
);
|
396 |
if ( isset( $this->id ) && 0 !== $this->id ) {
|
397 |
$post_args['ID'] = $this->id;
|
436 |
$this->id = $insert_result;
|
437 |
|
438 |
if ( isset( $this->code_type ) ) {
|
439 |
+
wp_set_post_terms( $this->id, $this->code_type, $this->code_type_taxonomy );
|
440 |
}
|
441 |
if ( isset( $this->auto_insert ) ) {
|
442 |
// Save this value for reference, but we never query by it.
|
443 |
update_post_meta( $this->id, '_wpcode_auto_insert', $this->auto_insert );
|
444 |
}
|
445 |
if ( isset( $this->location ) && 1 === $this->auto_insert ) {
|
446 |
+
wp_set_post_terms( $this->id, $this->location, $this->location_taxonomy );
|
447 |
} elseif ( isset( $this->auto_insert ) ) {
|
448 |
// If auto insert is disabled we just empty the taxonomy.
|
449 |
+
wp_set_post_terms( $this->id, array(), $this->location_taxonomy );
|
450 |
}
|
451 |
if ( isset( $this->tags ) ) {
|
452 |
+
wp_set_post_terms( $this->id, $this->tags, $this->tags_taxonomy );
|
453 |
}
|
454 |
if ( isset( $this->insert_number ) ) {
|
455 |
update_post_meta( $this->id, '_wpcode_auto_insert_number', $this->insert_number );
|
478 |
if ( isset( $this->generator_data ) ) {
|
479 |
update_post_meta( $this->id, '_wpcode_generator_data', $this->generator_data );
|
480 |
}
|
481 |
+
if ( isset( $this->cloud_id ) ) {
|
482 |
+
$auth_username = wpcode()->library_auth->get_auth_username();
|
483 |
+
$cloud_ids = get_post_meta( $this->id, '_wpcode_cloud_id', true );
|
484 |
+
if ( empty( $cloud_ids ) || ! is_array( $cloud_ids ) ) {
|
485 |
+
$cloud_ids = array();
|
486 |
+
}
|
487 |
+
if ( empty( $this->cloud_id ) && isset( $cloud_ids[ $auth_username ] ) ) {
|
488 |
+
unset( $cloud_ids[ $auth_username ] );
|
489 |
+
} elseif ( ! empty( $this->cloud_id ) ) {
|
490 |
+
$cloud_ids[ $auth_username ] = $this->cloud_id;
|
491 |
+
}
|
492 |
+
update_post_meta(
|
493 |
+
$this->id,
|
494 |
+
'_wpcode_cloud_id',
|
495 |
+
$cloud_ids
|
496 |
+
);
|
497 |
+
}
|
498 |
+
if ( isset( $this->custom_shortcode ) ) {
|
499 |
+
if ( empty( $this->custom_shortcode ) ) {
|
500 |
+
// Delete this meta if empty because we query by it.
|
501 |
+
delete_post_meta( $this->id, '_wpcode_custom_shortcode' );
|
502 |
+
} else {
|
503 |
+
update_post_meta( $this->id, '_wpcode_custom_shortcode', $this->custom_shortcode );
|
504 |
+
}
|
505 |
+
}
|
506 |
|
507 |
/**
|
508 |
* Run extra logic after the snippet is saved.
|
580 |
public function set_code_type() {
|
581 |
// If something below fails, let's not try again.
|
582 |
$this->code_type = '';
|
583 |
+
$this->code_type_term = $this->get_single_term( $this->code_type_taxonomy );
|
584 |
if ( $this->code_type_term ) {
|
585 |
$this->code_type = $this->code_type_term->slug;
|
586 |
}
|
655 |
* @return void
|
656 |
*/
|
657 |
public function set_tags() {
|
658 |
+
$tags = wp_get_post_terms( $this->get_id(), $this->tags_taxonomy );
|
659 |
$tag_slugs = array();
|
660 |
foreach ( $tags as $tag ) {
|
661 |
/**
|
752 |
'priority' => $this->get_priority(),
|
753 |
);
|
754 |
}
|
755 |
+
|
756 |
+
/**
|
757 |
+
* Get the cloud id for this snippet.
|
758 |
+
*
|
759 |
+
* @return string
|
760 |
+
*/
|
761 |
+
public function get_cloud_id() {
|
762 |
+
if ( ! isset( $this->cloud_id ) ) {
|
763 |
+
if ( wpcode()->library_auth->has_auth() ) {
|
764 |
+
$cloud_id = get_post_meta( $this->get_id(), '_wpcode_cloud_id', true );
|
765 |
+
if ( empty( $cloud_id ) || ! is_array( $cloud_id ) ) {
|
766 |
+
$cloud_id = array();
|
767 |
+
}
|
768 |
+
$auth_username = wpcode()->library_auth->get_auth_username();
|
769 |
+
$this->cloud_id = isset( $cloud_id[ $auth_username ] ) ? $cloud_id[ $auth_username ] : false;
|
770 |
+
} else {
|
771 |
+
$this->cloud_id = false;
|
772 |
+
}
|
773 |
+
}
|
774 |
+
|
775 |
+
return $this->cloud_id;
|
776 |
+
}
|
777 |
+
|
778 |
+
/**
|
779 |
+
* Set the cloud id.
|
780 |
+
*
|
781 |
+
* @param string $cloud_id The cloud id to use.
|
782 |
+
*
|
783 |
+
* @return void
|
784 |
+
*/
|
785 |
+
public function set_cloud_id( $cloud_id ) {
|
786 |
+
$this->cloud_id = $cloud_id;
|
787 |
+
}
|
788 |
+
|
789 |
+
/**
|
790 |
+
* Get the custom shortcode value.
|
791 |
+
*
|
792 |
+
* @return string
|
793 |
+
*/
|
794 |
+
public function get_custom_shortcode() {
|
795 |
+
if ( ! isset( $this->custom_shortcode ) ) {
|
796 |
+
$this->custom_shortcode = get_post_meta( $this->get_id(), '_wpcode_custom_shortcode', true );
|
797 |
+
}
|
798 |
+
|
799 |
+
return $this->custom_shortcode;
|
800 |
+
}
|
801 |
}
|
includes/conditional-logic/class-wpcode-conditional-page.php
CHANGED
@@ -254,3 +254,5 @@ class WPCode_Conditional_Page extends WPCode_Conditional_Type {
|
|
254 |
return $labels;
|
255 |
}
|
256 |
}
|
|
|
|
254 |
return $labels;
|
255 |
}
|
256 |
}
|
257 |
+
|
258 |
+
new WPCode_Conditional_Page();
|
includes/conditional-logic/class-wpcode-conditional-type.php
CHANGED
@@ -35,19 +35,16 @@ abstract class WPCode_Conditional_Type {
|
|
35 |
* Constructor.
|
36 |
*/
|
37 |
public function __construct() {
|
38 |
-
|
39 |
-
$this->hooks();
|
40 |
}
|
41 |
|
42 |
/**
|
43 |
-
*
|
44 |
-
* Here's where we should add admin-ajax handlers that are specific
|
45 |
-
* to the conditionals.
|
46 |
*
|
47 |
* @return void
|
48 |
*/
|
49 |
-
|
50 |
-
|
51 |
}
|
52 |
|
53 |
/**
|
@@ -128,7 +125,14 @@ abstract class WPCode_Conditional_Type {
|
|
128 |
return true;
|
129 |
}
|
130 |
$option_details = $options[ $option ];
|
131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
|
133 |
return $this->get_relation_comparison( $callback(), $value, $relation );
|
134 |
}
|
@@ -179,6 +183,7 @@ abstract class WPCode_Conditional_Type {
|
|
179 |
if ( is_array( $value2 ) ) {
|
180 |
return count( array_intersect( $value1, $value2 ) ) > 0;
|
181 |
}
|
|
|
182 |
return in_array( $value2, $value1 );
|
183 |
}
|
184 |
|
@@ -199,6 +204,7 @@ abstract class WPCode_Conditional_Type {
|
|
199 |
if ( is_array( $value2 ) ) {
|
200 |
return count( array_intersect( $value1, $value2 ) ) === 0;
|
201 |
}
|
|
|
202 |
return ! in_array( $value2, $value1 );
|
203 |
}
|
204 |
|
35 |
* Constructor.
|
36 |
*/
|
37 |
public function __construct() {
|
38 |
+
$this->register_type();
|
|
|
39 |
}
|
40 |
|
41 |
/**
|
42 |
+
* Register this instance to the global auto-insert types.
|
|
|
|
|
43 |
*
|
44 |
* @return void
|
45 |
*/
|
46 |
+
private function register_type() {
|
47 |
+
wpcode()->conditional_logic->register_type( $this );
|
48 |
}
|
49 |
|
50 |
/**
|
125 |
return true;
|
126 |
}
|
127 |
$option_details = $options[ $option ];
|
128 |
+
|
129 |
+
if ( ! isset( $option_details['callback'] ) ) {
|
130 |
+
return false;
|
131 |
+
}
|
132 |
+
$callback = $option_details['callback'];
|
133 |
+
if ( ! is_callable( $callback ) ) {
|
134 |
+
return false;
|
135 |
+
}
|
136 |
|
137 |
return $this->get_relation_comparison( $callback(), $value, $relation );
|
138 |
}
|
183 |
if ( is_array( $value2 ) ) {
|
184 |
return count( array_intersect( $value1, $value2 ) ) > 0;
|
185 |
}
|
186 |
+
|
187 |
return in_array( $value2, $value1 );
|
188 |
}
|
189 |
|
204 |
if ( is_array( $value2 ) ) {
|
205 |
return count( array_intersect( $value1, $value2 ) ) === 0;
|
206 |
}
|
207 |
+
|
208 |
return ! in_array( $value2, $value1 );
|
209 |
}
|
210 |
|
includes/conditional-logic/class-wpcode-conditional-user.php
CHANGED
@@ -86,3 +86,5 @@ class WPCode_Conditional_User extends WPCode_Conditional_Type {
|
|
86 |
return $user->roles;
|
87 |
}
|
88 |
}
|
|
|
|
86 |
return $user->roles;
|
87 |
}
|
88 |
}
|
89 |
+
|
90 |
+
new WPCode_Conditional_User();
|
includes/execute/class-wpcode-snippet-execute-css.php
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Execute CSS snippets and return their output.
|
4 |
+
*
|
5 |
+
* @package wpcode
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* WPCode_Snippet_Execute_Text class.
|
10 |
+
*/
|
11 |
+
class WPCode_Snippet_Execute_CSS extends WPCode_Snippet_Execute_Type {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* The snippet type, JavaScript for this one.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
public $type = 'css';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Grab snippet code and return its output.
|
22 |
+
*
|
23 |
+
* @return string
|
24 |
+
*/
|
25 |
+
protected function prepare_snippet_output() {
|
26 |
+
$code = $this->get_snippet_code();
|
27 |
+
|
28 |
+
if ( ! empty( $code ) ) {
|
29 |
+
// Wrap our code in a style tag.
|
30 |
+
$code = '<style class="wpcode-css-snippet">' . $code . '</style>';
|
31 |
+
}
|
32 |
+
|
33 |
+
return $code;
|
34 |
+
}
|
35 |
+
}
|
includes/execute/class-wpcode-snippet-execute-php.php
CHANGED
@@ -25,7 +25,7 @@ class WPCode_Snippet_Execute_PHP extends WPCode_Snippet_Execute_Type {
|
|
25 |
protected function prepare_snippet_output() {
|
26 |
$code = $this->get_snippet_code();
|
27 |
// If we're doing the activation, unslash the code similar to how it will be unslashed before saving in wp_insert_post.
|
28 |
-
if ( wpcode()->execute->is_doing_activation() ) {
|
29 |
$code = wp_unslash( $code );
|
30 |
}
|
31 |
|
25 |
protected function prepare_snippet_output() {
|
26 |
$code = $this->get_snippet_code();
|
27 |
// If we're doing the activation, unslash the code similar to how it will be unslashed before saving in wp_insert_post.
|
28 |
+
if ( wpcode()->execute->is_doing_activation() && isset( $_POST['wpcode_snippet_code'] ) ) {
|
29 |
$code = wp_unslash( $code );
|
30 |
}
|
31 |
|
includes/execute/class-wpcode-snippet-execute-universal.php
CHANGED
@@ -27,6 +27,10 @@ class WPCode_Snippet_Execute_Universal extends WPCode_Snippet_Execute_Type {
|
|
27 |
protected function prepare_snippet_output() {
|
28 |
|
29 |
$code = $this->get_snippet_code();
|
|
|
|
|
|
|
|
|
30 |
|
31 |
// Wrap code with PHP tags, so it gets executed correctly.
|
32 |
return wpcode()->execute->safe_execute_php( '?>' . $code . '<?php ', $this->snippet );
|
27 |
protected function prepare_snippet_output() {
|
28 |
|
29 |
$code = $this->get_snippet_code();
|
30 |
+
// If we're doing the activation, unslash the code similar to how it will be unslashed before saving in wp_insert_post.
|
31 |
+
if ( wpcode()->execute->is_doing_activation() && isset( $_POST['wpcode_snippet_code'] ) ) {
|
32 |
+
$code = wp_unslash( $code );
|
33 |
+
}
|
34 |
|
35 |
// Wrap code with PHP tags, so it gets executed correctly.
|
36 |
return wpcode()->execute->safe_execute_php( '?>' . $code . '<?php ', $this->snippet );
|
includes/helpers.php
CHANGED
@@ -11,17 +11,183 @@
|
|
11 |
* @param string $url The URL to add the params to.
|
12 |
* @param string $medium The marketing medium.
|
13 |
* @param string $campaign The campaign.
|
|
|
14 |
*
|
15 |
* @return string
|
16 |
*/
|
17 |
-
function wpcode_utm_url( $url, $medium = '', $campaign = '' ) {
|
18 |
return add_query_arg(
|
19 |
array(
|
20 |
-
'utm_source' => '
|
21 |
'utm_medium' => sanitize_key( $medium ),
|
22 |
'utm_campaign' => sanitize_key( $campaign ),
|
23 |
-
'utm_content' =>
|
24 |
),
|
25 |
-
$url
|
26 |
);
|
27 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
* @param string $url The URL to add the params to.
|
12 |
* @param string $medium The marketing medium.
|
13 |
* @param string $campaign The campaign.
|
14 |
+
* @param string $content The Ad content.
|
15 |
*
|
16 |
* @return string
|
17 |
*/
|
18 |
+
function wpcode_utm_url( $url, $medium = '', $campaign = '', $ad_content = '' ) {
|
19 |
return add_query_arg(
|
20 |
array(
|
21 |
+
'utm_source' => class_exists( 'WPCode_License' ) ? 'proplugin' : 'liteplugin',
|
22 |
'utm_medium' => sanitize_key( $medium ),
|
23 |
'utm_campaign' => sanitize_key( $campaign ),
|
24 |
+
'utm_content' => sanitize_key( $ad_content ),
|
25 |
),
|
26 |
+
trailingslashit( $url )
|
27 |
);
|
28 |
}
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Get a standard auto-insert location select menu.
|
32 |
+
*
|
33 |
+
* @param string $selected_location The location currently selected.
|
34 |
+
* @param string $code_type The code type for the current snippet (disables some locations).
|
35 |
+
* @param string $name The name for the select (used in the form).
|
36 |
+
*
|
37 |
+
* @return string
|
38 |
+
*/
|
39 |
+
function wpcode_get_auto_insert_location_picker( $selected_location, $code_type = 'html', $name = 'wpcode_auto_insert_location' ) {
|
40 |
+
$available_types = wpcode()->auto_insert->get_types();
|
41 |
+
ob_start();
|
42 |
+
?>
|
43 |
+
<select name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $name ); ?>" class="wpcode-select2 wpcode-auto-insert-location-picker">
|
44 |
+
<?php
|
45 |
+
foreach ( $available_types as $type ) {
|
46 |
+
$options = $type->get_locations();
|
47 |
+
if ( empty( $options ) ) {
|
48 |
+
continue;
|
49 |
+
}
|
50 |
+
$extra_data = '';
|
51 |
+
if ( ! empty( $type->upgrade_title ) ) {
|
52 |
+
$extra_data = ' data-upgrade-title="' . esc_attr( $type->upgrade_title ) . '"';
|
53 |
+
}
|
54 |
+
if ( ! empty( $type->upgrade_text ) ) {
|
55 |
+
$extra_data .= ' data-upgrade-text="' . esc_attr( $type->upgrade_text ) . '"';
|
56 |
+
}
|
57 |
+
if ( ! empty( $type->upgrade_link ) ) {
|
58 |
+
$extra_data .= ' data-upgrade-link="' . esc_attr( $type->upgrade_link ) . '"';
|
59 |
+
}
|
60 |
+
if ( ! empty( $type->upgrade_button ) ) {
|
61 |
+
$extra_data .= ' data-upgrade-button="' . esc_attr( $type->upgrade_button ) . '"';
|
62 |
+
}
|
63 |
+
?>
|
64 |
+
<optgroup
|
65 |
+
label="<?php echo esc_attr( $type->get_label() ); ?>"
|
66 |
+
data-code-type="<?php echo esc_attr( $type->code_type ); ?>"
|
67 |
+
data-label-pill="<?php echo esc_attr( $type->label_pill ); ?>"
|
68 |
+
<?php echo $extra_data; ?>
|
69 |
+
>
|
70 |
+
<?php
|
71 |
+
foreach ( $options as $key => $label ) {
|
72 |
+
$disabled = false;
|
73 |
+
if ( 'all' !== $type->code_type && $type->code_type !== $code_type ) {
|
74 |
+
$disabled = true;
|
75 |
+
}
|
76 |
+
?>
|
77 |
+
<option value="<?php echo esc_attr( $key ); ?>" <?php selected( $selected_location, $key ); ?> <?php disabled( $disabled ); ?>>
|
78 |
+
<?php echo esc_html( $label ); ?>
|
79 |
+
</option>
|
80 |
+
<?php } ?>
|
81 |
+
</optgroup>
|
82 |
+
<?php
|
83 |
+
}
|
84 |
+
?>
|
85 |
+
</select>
|
86 |
+
<?php
|
87 |
+
return ob_get_clean();
|
88 |
+
}
|
89 |
+
|
90 |
+
/**
|
91 |
+
* Get the label for an auto-insert location.
|
92 |
+
*
|
93 |
+
* @param $location_slug
|
94 |
+
*
|
95 |
+
* @return string
|
96 |
+
*/
|
97 |
+
function wpcode_find_location_label( $location_slug ) {
|
98 |
+
$available_types = wpcode()->auto_insert->get_types();
|
99 |
+
$location_label = '';
|
100 |
+
foreach ( $available_types as $type ) {
|
101 |
+
$options = $type->get_locations();
|
102 |
+
foreach ( $options as $key => $label ) {
|
103 |
+
if ( $key === $location_slug ) {
|
104 |
+
$location_label = $label;
|
105 |
+
break 2;
|
106 |
+
}
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
return $location_label;
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Get a checkbox wrapped with markup to be displayed as a toggle.
|
115 |
+
*
|
116 |
+
* @param bool $checked Is it checked or not.
|
117 |
+
* @param string $name The name for the input.
|
118 |
+
* @param string $description Field description (optional).
|
119 |
+
* @param string|int $value Field value (optional).
|
120 |
+
*
|
121 |
+
* @return string
|
122 |
+
*/
|
123 |
+
function wpcode_get_checkbox_toggle( $checked, $name, $description = '', $value = '' ) {
|
124 |
+
$markup = '<label class="wpcode-checkbox-toggle">';
|
125 |
+
|
126 |
+
$markup .= '<input type="checkbox" ' . checked( $checked, true, false ) . ' name="' . esc_attr( $name ) . '" id="' . esc_attr( $name ) . '" value="' . esc_attr( $value ) . '" />';
|
127 |
+
$markup .= '<span class="wpcode-checkbox-toggle-slider"></span>';
|
128 |
+
$markup .= '</label>';
|
129 |
+
|
130 |
+
if ( ! empty( $description ) ) {
|
131 |
+
$markup .= '<p class="description">' . wp_kses_post( $description ) . '</p>';
|
132 |
+
}
|
133 |
+
|
134 |
+
return $markup;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Button that copies target input value to the clipboard.
|
139 |
+
*
|
140 |
+
* @param string $target The id of the input to copy from.
|
141 |
+
* @param string $prefix If you want something prepended to the copied value.
|
142 |
+
* @param string $suffix If you want something appended to the copied value.
|
143 |
+
*
|
144 |
+
* @return string
|
145 |
+
*/
|
146 |
+
function wpcode_get_copy_target_button( $target, $prefix = '', $suffix = '' ) {
|
147 |
+
return sprintf(
|
148 |
+
'<button class="wpcode-button wpcode-button-icon wpcode-button-secondary wpcode-copy-target" data-target="#%4$s" type="button" data-prefix="%5$s" data-suffix="%6$s"><span class="wpcode-default-icon">%1$s</span><span class="wpcode-success-icon">%2$s</span> %3$s</button>',
|
149 |
+
get_wpcode_icon( 'copy', 16, 16 ),
|
150 |
+
get_wpcode_icon( 'check', 16, 13 ),
|
151 |
+
_x( 'Copy', 'Copy to clipboard', 'insert-headers-and-footers' ),
|
152 |
+
esc_attr( $target ),
|
153 |
+
esc_attr( $prefix ),
|
154 |
+
esc_attr( $suffix )
|
155 |
+
);
|
156 |
+
}
|
157 |
+
|
158 |
+
/**
|
159 |
+
* Get a list of labels for the conditions used in conditional logic.
|
160 |
+
*
|
161 |
+
* @return array
|
162 |
+
*/
|
163 |
+
function wpcode_get_conditions_relation_labels() {
|
164 |
+
return array(
|
165 |
+
'=' => __( 'Is', 'insert-headers-and-footers' ),
|
166 |
+
'!=' => __( 'Is not', 'insert-headers-and-footers' ),
|
167 |
+
'contains' => __( 'Contains', 'insert-headers-and-footers' ),
|
168 |
+
'notcontains' => __( 'Doesn\'t Contain', 'insert-headers-and-footers' ),
|
169 |
+
);
|
170 |
+
}
|
171 |
+
|
172 |
+
/**
|
173 |
+
* Get an array of locations that support an insert number.
|
174 |
+
*
|
175 |
+
* @return string[]
|
176 |
+
*/
|
177 |
+
function wpcode_get_auto_insert_locations_with_number() {
|
178 |
+
return array(
|
179 |
+
'before_paragraph',
|
180 |
+
'after_paragraph',
|
181 |
+
'archive_before_post',
|
182 |
+
'archive_after_post',
|
183 |
+
);
|
184 |
+
}
|
185 |
+
|
186 |
+
/**
|
187 |
+
* Returns the site domain.
|
188 |
+
*
|
189 |
+
* @return string
|
190 |
+
*/
|
191 |
+
function wpcode_get_site_domain() {
|
192 |
+
return wp_parse_url( home_url(), PHP_URL_HOST );
|
193 |
+
}
|
includes/icons.php
CHANGED
@@ -52,45 +52,56 @@ function wpcode_icon( $name, $width = 20, $height = 20, $viewbox = '' ) {
|
|
52 |
if ( ! empty( $icon ) ) {
|
53 |
echo wp_kses(
|
54 |
$icon,
|
55 |
-
|
56 |
-
'svg' => array(
|
57 |
-
'class' => true,
|
58 |
-
'aria-hidden' => true,
|
59 |
-
'aria-labelledby' => true,
|
60 |
-
'role' => true,
|
61 |
-
'xmlns' => true,
|
62 |
-
'width' => true,
|
63 |
-
'height' => true,
|
64 |
-
'viewbox' => true,
|
65 |
-
),
|
66 |
-
'g' => array( 'fill' => true ),
|
67 |
-
'title' => array( 'title' => true ),
|
68 |
-
'path' => array(
|
69 |
-
'd' => true,
|
70 |
-
'fill' => true,
|
71 |
-
'fill-rule' => true,
|
72 |
-
'clip-rule' => true,
|
73 |
-
),
|
74 |
-
'circle' => array(
|
75 |
-
'cx' => true,
|
76 |
-
'cy' => true,
|
77 |
-
'r' => true,
|
78 |
-
'stroke' => true,
|
79 |
-
'stroke-width' => true,
|
80 |
-
'fill' => true,
|
81 |
-
),
|
82 |
-
'rect' => array(
|
83 |
-
'x' => true,
|
84 |
-
'y' => true,
|
85 |
-
'width' => true,
|
86 |
-
'height' => true,
|
87 |
-
'fill' => true,
|
88 |
-
),
|
89 |
-
)
|
90 |
);
|
91 |
}
|
92 |
}
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
/**
|
95 |
* Get the whole array of WPCode SVG icons.
|
96 |
*
|
@@ -125,6 +136,14 @@ function wpcode_icons() {
|
|
125 |
'terminal' => '<path d="M7 40Q5.8 40 4.9 39.1Q4 38.2 4 37V11Q4 9.8 4.9 8.9Q5.8 8 7 8H41Q42.2 8 43.1 8.9Q44 9.8 44 11V37Q44 38.2 43.1 39.1Q42.2 40 41 40ZM7 37H41Q41 37 41 37Q41 37 41 37V15.2H7V37Q7 37 7 37Q7 37 7 37ZM24.5 33.6V30.6H35.5V33.6ZM15 33.4 12.9 31.3 18.05 26.1 12.85 20.9 15 18.8 22.3 26.1Z"/>',
|
126 |
'error_badge' => '<path d="M22.5 24.6H25.5V14.25H22.5ZM24 31.3Q24.7 31.3 25.2 30.8Q25.7 30.3 25.7 29.6Q25.7 28.9 25.2 28.4Q24.7 27.9 24 27.9Q23.3 27.9 22.8 28.4Q22.3 28.9 22.3 29.6Q22.3 30.3 22.8 30.8Q23.3 31.3 24 31.3ZM24 43.95Q17 42.2 12.5 35.825Q8 29.45 8 21.85V9.95L24 3.95L40 9.95V21.85Q40 29.45 35.5 35.825Q31 42.2 24 43.95ZM24 24.55Q24 24.55 24 24.55Q24 24.55 24 24.55Q24 24.55 24 24.55Q24 24.55 24 24.55ZM24 40.85Q29.75 38.95 33.375 33.675Q37 28.4 37 21.85V12.05L24 7.15L11 12.05V21.85Q11 28.4 14.625 33.675Q18.25 38.95 24 40.85Z"/>',
|
127 |
'php' => '<path d="M19.2 31.25 21.35 29.1 16.3 24 21.35 18.95 19.2 16.8 12 24ZM28.8 31.25 36.05 24 28.85 16.8 26.7 18.95 31.75 24 26.65 29.1ZM9 39H39Q39 39 39 39Q39 39 39 39V9Q39 9 39 9Q39 9 39 9H9Q9 9 9 9Q9 9 9 9V39Q9 39 9 39Q9 39 9 39ZM9 9Q9 9 9 9Q9 9 9 9V39Q9 39 9 39Q9 39 9 39Q9 39 9 39Q9 39 9 39V9Q9 9 9 9Q9 9 9 9ZM9 42Q7.75 42 6.875 41.125Q6 40.25 6 39V9Q6 7.75 6.875 6.875Q7.75 6 9 6H19.25Q19.5 4.25 20.85 3.125Q22.2 2 24 2Q25.8 2 27.15 3.125Q28.5 4.25 28.75 6H39Q40.25 6 41.125 6.875Q42 7.75 42 9V39Q42 40.25 41.125 41.125Q40.25 42 39 42ZM24 8.15Q24.7 8.15 25.225 7.625Q25.75 7.1 25.75 6.4Q25.75 5.7 25.225 5.175Q24.7 4.65 24 4.65Q23.3 4.65 22.775 5.175Q22.25 5.7 22.25 6.4Q22.25 7.1 22.775 7.625Q23.3 8.15 24 8.15Z"/>',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
)
|
129 |
);
|
130 |
}
|
52 |
if ( ! empty( $icon ) ) {
|
53 |
echo wp_kses(
|
54 |
$icon,
|
55 |
+
wpcode_get_icon_allowed_tags()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
);
|
57 |
}
|
58 |
}
|
59 |
|
60 |
+
/**
|
61 |
+
* Get the allowed tags for svg icons, to be used in wp_kses.
|
62 |
+
*
|
63 |
+
* @return array
|
64 |
+
* @see wpcode_icon()
|
65 |
+
* @see wp_kses()
|
66 |
+
*/
|
67 |
+
function wpcode_get_icon_allowed_tags() {
|
68 |
+
return array(
|
69 |
+
'svg' => array(
|
70 |
+
'class' => true,
|
71 |
+
'aria-hidden' => true,
|
72 |
+
'aria-labelledby' => true,
|
73 |
+
'role' => true,
|
74 |
+
'xmlns' => true,
|
75 |
+
'width' => true,
|
76 |
+
'height' => true,
|
77 |
+
'viewbox' => true,
|
78 |
+
),
|
79 |
+
'g' => array( 'fill' => true ),
|
80 |
+
'title' => array( 'title' => true ),
|
81 |
+
'path' => array(
|
82 |
+
'd' => true,
|
83 |
+
'fill' => true,
|
84 |
+
'fill-rule' => true,
|
85 |
+
'clip-rule' => true,
|
86 |
+
),
|
87 |
+
'circle' => array(
|
88 |
+
'cx' => true,
|
89 |
+
'cy' => true,
|
90 |
+
'r' => true,
|
91 |
+
'stroke' => true,
|
92 |
+
'stroke-width' => true,
|
93 |
+
'fill' => true,
|
94 |
+
),
|
95 |
+
'rect' => array(
|
96 |
+
'x' => true,
|
97 |
+
'y' => true,
|
98 |
+
'width' => true,
|
99 |
+
'height' => true,
|
100 |
+
'fill' => true,
|
101 |
+
),
|
102 |
+
);
|
103 |
+
}
|
104 |
+
|
105 |
/**
|
106 |
* Get the whole array of WPCode SVG icons.
|
107 |
*
|
136 |
'terminal' => '<path d="M7 40Q5.8 40 4.9 39.1Q4 38.2 4 37V11Q4 9.8 4.9 8.9Q5.8 8 7 8H41Q42.2 8 43.1 8.9Q44 9.8 44 11V37Q44 38.2 43.1 39.1Q42.2 40 41 40ZM7 37H41Q41 37 41 37Q41 37 41 37V15.2H7V37Q7 37 7 37Q7 37 7 37ZM24.5 33.6V30.6H35.5V33.6ZM15 33.4 12.9 31.3 18.05 26.1 12.85 20.9 15 18.8 22.3 26.1Z"/>',
|
137 |
'error_badge' => '<path d="M22.5 24.6H25.5V14.25H22.5ZM24 31.3Q24.7 31.3 25.2 30.8Q25.7 30.3 25.7 29.6Q25.7 28.9 25.2 28.4Q24.7 27.9 24 27.9Q23.3 27.9 22.8 28.4Q22.3 28.9 22.3 29.6Q22.3 30.3 22.8 30.8Q23.3 31.3 24 31.3ZM24 43.95Q17 42.2 12.5 35.825Q8 29.45 8 21.85V9.95L24 3.95L40 9.95V21.85Q40 29.45 35.5 35.825Q31 42.2 24 43.95ZM24 24.55Q24 24.55 24 24.55Q24 24.55 24 24.55Q24 24.55 24 24.55Q24 24.55 24 24.55ZM24 40.85Q29.75 38.95 33.375 33.675Q37 28.4 37 21.85V12.05L24 7.15L11 12.05V21.85Q11 28.4 14.625 33.675Q18.25 38.95 24 40.85Z"/>',
|
138 |
'php' => '<path d="M19.2 31.25 21.35 29.1 16.3 24 21.35 18.95 19.2 16.8 12 24ZM28.8 31.25 36.05 24 28.85 16.8 26.7 18.95 31.75 24 26.65 29.1ZM9 39H39Q39 39 39 39Q39 39 39 39V9Q39 9 39 9Q39 9 39 9H9Q9 9 9 9Q9 9 9 9V39Q9 39 9 39Q9 39 9 39ZM9 9Q9 9 9 9Q9 9 9 9V39Q9 39 9 39Q9 39 9 39Q9 39 9 39Q9 39 9 39V9Q9 9 9 9Q9 9 9 9ZM9 42Q7.75 42 6.875 41.125Q6 40.25 6 39V9Q6 7.75 6.875 6.875Q7.75 6 9 6H19.25Q19.5 4.25 20.85 3.125Q22.2 2 24 2Q25.8 2 27.15 3.125Q28.5 4.25 28.75 6H39Q40.25 6 41.125 6.875Q42 7.75 42 9V39Q42 40.25 41.125 41.125Q40.25 42 39 42ZM24 8.15Q24.7 8.15 25.225 7.625Q25.75 7.1 25.75 6.4Q25.75 5.7 25.225 5.175Q24.7 4.65 24 4.65Q23.3 4.65 22.775 5.175Q22.25 5.7 22.25 6.4Q22.25 7.1 22.775 7.625Q23.3 8.15 24 8.15Z"/>',
|
139 |
+
'trash' => '<path d="M1.77365 13.8333C1.77365 14.75 2.48972 15.5 3.36491 15.5H9.72993C10.6051 15.5 11.3212 14.75 11.3212 13.8333V3.83333H1.77365V13.8333ZM3.36491 5.5H9.72993V13.8333H3.36491V5.5ZM9.33211 1.33333L8.53648 0.5H4.55835L3.76272 1.33333H0.978027V3H12.1168V1.33333H9.33211Z" fill="#777777"/>',
|
140 |
+
'tags' => '<path d="M18.4678 4.87133C20.5107 6.76412 20.5107 9.80688 18.4678 11.6997L14.0931 15.746C13.7298 16.0817 13.1361 16.0853 12.7689 15.7531C12.3978 15.421 12.3978 14.8781 12.7611 14.5389L17.132 10.4961C18.4561 9.27119 18.4561 7.29982 17.132 6.07486L12.1439 1.45966C11.7768 1.12288 11.7807 0.580398 12.1518 0.247552C12.5189 -0.0852947 13.1126 -0.0820805 13.4408 0.254694L18.4678 4.87133ZM1.17182e-05 7.0534V1.71429C1.17182e-05 0.767535 0.839412 5.96342e-05 1.87491 5.96342e-05H7.71447C8.3785 5.96342e-05 9.01128 0.240766 9.48001 0.669681L16.0422 6.6677C17.0187 7.56053 17.0187 9.01048 16.0422 9.90331L10.8315 14.6674C9.85499 15.5603 8.26913 15.5603 7.29261 14.6674L0.732386 8.66763C0.263386 8.23908 0 7.66052 0 7.0534H1.17182e-05ZM4.37479 2.85711C3.68459 2.85711 3.12485 3.36781 3.12485 3.99993C3.12485 4.63205 3.68459 5.14275 4.37479 5.14275C5.06616 5.14275 5.62473 4.63205 5.62473 3.99993C5.62473 3.36781 5.06616 2.85711 4.37479 2.85711Z" fill="#777777"/>',
|
141 |
+
'eye' => '<path d="M7.99996 1.53873C10.5266 1.53873 12.78 3.02603 13.88 5.37917C12.78 7.73231 10.5266 9.21961 7.99996 9.21961C5.47329 9.21961 3.21996 7.73231 2.11996 5.37917C3.21996 3.02603 5.47329 1.53873 7.99996 1.53873ZM7.99996 0.142212C4.66663 0.142212 1.81996 2.3138 0.666626 5.37917C1.81996 8.44454 4.66663 10.6161 7.99996 10.6161C11.3333 10.6161 14.18 8.44454 15.3333 5.37917C14.18 2.3138 11.3333 0.142212 7.99996 0.142212ZM7.99996 3.63352C8.91996 3.63352 9.66663 4.41557 9.66663 5.37917C9.66663 6.34277 8.91996 7.12482 7.99996 7.12482C7.07996 7.12482 6.33329 6.34277 6.33329 5.37917C6.33329 4.41557 7.07996 3.63352 7.99996 3.63352ZM7.99996 2.237C6.34663 2.237 4.99996 3.64748 4.99996 5.37917C4.99996 7.11086 6.34663 8.52135 7.99996 8.52135C9.65329 8.52135 11 7.11086 11 5.37917C11 3.64748 9.65329 2.237 7.99996 2.237Z" fill="#777777"/>',
|
142 |
+
'arrow-left' => '<path d="M3.99 5L16 5L16 3L3.99 3L3.99 1.04995e-06L-3.49691e-07 4L3.99 8L3.99 5Z" fill="#777777"/>',
|
143 |
+
'rewind' => '<path d="M9.125 0.25C5.3975 0.25 2.375 3.2725 2.375 7H0.125L3.125 9.9925L6.125 7H3.875C3.875 4.0975 6.2225 1.75 9.125 1.75C12.0275 1.75 14.375 4.0975 14.375 7C14.375 9.9025 12.0275 12.25 9.125 12.25C7.6775 12.25 6.365 11.6575 5.42 10.705L4.355 11.77C5.5775 12.9925 7.2575 13.75 9.125 13.75C12.8525 13.75 15.875 10.7275 15.875 7C15.875 3.2725 12.8525 0.25 9.125 0.25ZM8.375 4V7.75L11.5625 9.64L12.14 8.68L9.5 7.1125V4H8.375Z" fill="#777777"/>',
|
144 |
+
'cloud' => '<path d="M8 2.00008C9.74667 2.00008 11.2533 3.24008 11.5933 4.95341L11.7933 5.95341L12.8133 6.02675C13.8533 6.09341 14.6667 6.96675 14.6667 8.00008C14.6667 9.10008 13.7667 10.0001 12.6667 10.0001H4C2.52667 10.0001 1.33333 8.80675 1.33333 7.33341C1.33333 5.96675 2.35333 4.82675 3.70667 4.68675L4.42 4.61341L4.75333 3.98008C5.38667 2.76008 6.62667 2.00008 8 2.00008ZM8 0.666748C6.07333 0.666748 4.4 1.76008 3.56667 3.36008C1.56 3.57341 0 5.27341 0 7.33341C0 9.54008 1.79333 11.3334 4 11.3334H12.6667C14.5067 11.3334 16 9.84008 16 8.00008C16 6.24008 14.6333 4.81341 12.9 4.69341C12.4467 2.39341 10.4267 0.666748 8 0.666748Z" fill="#777777"/>',
|
145 |
+
'lock' => '<path d="M14.5 7.5H13.5V5.5C13.5 2.74 11.26 0.5 8.5 0.5C5.74 0.5 3.5 2.74 3.5 5.5V7.5H2.5C1.4 7.5 0.5 8.4 0.5 9.5V19.5C0.5 20.6 1.4 21.5 2.5 21.5H14.5C15.6 21.5 16.5 20.6 16.5 19.5V9.5C16.5 8.4 15.6 7.5 14.5 7.5ZM5.5 5.5C5.5 3.84 6.84 2.5 8.5 2.5C10.16 2.5 11.5 3.84 11.5 5.5V7.5H5.5V5.5ZM14.5 19.5H2.5V9.5H14.5V19.5ZM8.5 16.5C9.6 16.5 10.5 15.6 10.5 14.5C10.5 13.4 9.6 12.5 8.5 12.5C7.4 12.5 6.5 13.4 6.5 14.5C6.5 15.6 7.4 16.5 8.5 16.5Z" fill="white"/>',
|
146 |
+
'exclamation' => '<defs><style>.b{fill:#231f20}</style></defs><g transform="translate(-.066)"><path d="M1.6 24a1.338 1.338 0 01-1.3-2.1L11 .9c.6-1.2 1.6-1.2 2.2 0l10.7 21c.6 1.2 0 2.1-1.3 2.1z" fill="#ffce31"/><path class="b" d="M10.3 8.6l1.1 7.4a.605.605 0 001.2 0l1.1-7.4a1.738 1.738 0 10-3.4 0z"/><circle class="b" cx="1.7" cy="1.7" r="1.7" transform="translate(10.3 17.3)"/></g>',
|
147 |
)
|
148 |
);
|
149 |
}
|
includes/ihaf.php
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
/**
|
5 |
+
* Get the main instance of WPCode.
|
6 |
+
*
|
7 |
+
* @return WPCode
|
8 |
+
*/
|
9 |
+
function WPCode() {// phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
|
10 |
+
return WPCode::instance();
|
11 |
+
}
|
includes/lite/admin/admin-scripts.php
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Load lite-specific scripts here.
|
4 |
+
*
|
5 |
+
* @package WPCode
|
6 |
+
*/
|
7 |
+
|
8 |
+
add_action( 'admin_enqueue_scripts', 'wpcode_admin_scripts_global_lite' );
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Load version-specific global scripts.
|
12 |
+
*
|
13 |
+
* @return void
|
14 |
+
*/
|
15 |
+
function wpcode_admin_scripts_global_lite() {
|
16 |
+
wpcode_admin_scripts_global();
|
17 |
+
}
|
includes/lite/admin/class-wpcode-metabox-snippets-lite.php
ADDED
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class used for the lite-specific metabox.
|
4 |
+
*
|
5 |
+
* @package WPCode
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class WPCode_Metabox_Snippets_Lite.
|
10 |
+
*/
|
11 |
+
class WPCode_Metabox_Snippets_Lite extends WPCode_Metabox_Snippets {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Override the header tab content to make it specific to this class.
|
15 |
+
*
|
16 |
+
* @param WP_Post $post The post object.
|
17 |
+
*
|
18 |
+
* @return void
|
19 |
+
*/
|
20 |
+
public function output_tab_header( $post ) {
|
21 |
+
$this->form_for_scripts(
|
22 |
+
__( 'Header', 'insert-headers-and-footers' )
|
23 |
+
);
|
24 |
+
}
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Override the footer tab content to make it specific to this class.
|
28 |
+
*
|
29 |
+
* @param WP_Post $post The post object.
|
30 |
+
*
|
31 |
+
* @return void
|
32 |
+
*/
|
33 |
+
public function output_tab_footer( $post ) {
|
34 |
+
$this->form_for_scripts(
|
35 |
+
__( 'Footer', 'insert-headers-and-footers' )
|
36 |
+
);
|
37 |
+
}
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Override the body tab content to make it specific to this class.
|
41 |
+
*
|
42 |
+
* @param WP_Post $post The post object.
|
43 |
+
*
|
44 |
+
* @return void
|
45 |
+
*/
|
46 |
+
public function output_tab_body( $post ) {
|
47 |
+
$this->form_for_scripts(
|
48 |
+
__( 'Body', 'insert-headers-and-footers' )
|
49 |
+
);
|
50 |
+
}
|
51 |
+
|
52 |
+
/**
|
53 |
+
* Override the code tab content to make it specific to this class.
|
54 |
+
*
|
55 |
+
* @param WP_Post $post The post object.
|
56 |
+
*
|
57 |
+
* @return void
|
58 |
+
*/
|
59 |
+
public function output_tab_code( $post ) {
|
60 |
+
?>
|
61 |
+
<div class="wpcode-blur-area">
|
62 |
+
<p>
|
63 |
+
<?php esc_html_e( 'Choose the snippets you want to run on this page. Please note: only active snippets will be executed.', 'wpcode-premium' ); ?>
|
64 |
+
</p>
|
65 |
+
<div class="wpcode-metabox-snippets">
|
66 |
+
<div id="wpcode-snippet-chooser">
|
67 |
+
<h3>
|
68 |
+
<?php esc_html_e( 'Select snippets', 'wpcode-premium' ); ?>
|
69 |
+
<button class="wpcode-button-just-icon wpcode-drawer-toggle" id="wpcode-close-drawer">
|
70 |
+
<?php wpcode_icon( 'close' ); ?>
|
71 |
+
</button>
|
72 |
+
</h3>
|
73 |
+
<div class="wpcode-snippets-search">
|
74 |
+
<input type="text" id="wpcode-search-snippets" class="wpcode-input-text" placeholder="<?php esc_attr_e( 'Search snippets', 'wpcode-premium' ); ?>"/>
|
75 |
+
<span class="wpcode-loading-spinner" id="wpcode-chooser-spinner"></span>
|
76 |
+
</div>
|
77 |
+
<div class="wpcode-chooser-fixed-height">
|
78 |
+
<div id="wpcode-choose-snippets"></div>
|
79 |
+
<div class="wpcode-choose-actions">
|
80 |
+
<button type="button" class="wpcode-button wpcode-button-secondary" id="wpcode-metabox-load-more"><?php esc_html_e( 'Load more snippets', 'wpcode-premium' ); ?></button>
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
<div class="wpcode-picked-snippets-area">
|
85 |
+
<h3>
|
86 |
+
<button class="wpcode-button wpcode-drawer-toggle" id="wpcode-add-snippet-toggle" type="button">
|
87 |
+
<?php esc_html_e( '+ Choose Snippet', 'wpcode-premium' ); ?>
|
88 |
+
</button>
|
89 |
+
</h3>
|
90 |
+
<div id="wpcode-picked-snippets">
|
91 |
+
<div class="wpcode-list-item wpcode-selected-snippet-item wpcode-list-item-has-pill">
|
92 |
+
<h3>Show site currency</h3>
|
93 |
+
<label>Page location</label>
|
94 |
+
<select>
|
95 |
+
<option>Insert After Post</option>
|
96 |
+
</select>
|
97 |
+
</div>
|
98 |
+
<div class="wpcode-list-item wpcode-selected-snippet-item wpcode-list-item-has-pill">
|
99 |
+
<h3>Banner Ad</h3>
|
100 |
+
<label>Page location</label>
|
101 |
+
<select>
|
102 |
+
<option>Insert Before Post</option>
|
103 |
+
</select>
|
104 |
+
</div>
|
105 |
+
<div class="wpcode-list-item wpcode-selected-snippet-item wpcode-list-item-has-pill">
|
106 |
+
<h3>Subscribe Reminder</h3>
|
107 |
+
<label>Page location</label>
|
108 |
+
<select>
|
109 |
+
<option>Insert Before Content</option>
|
110 |
+
</select>
|
111 |
+
</div>
|
112 |
+
<div class="wpcode-list-item wpcode-selected-snippet-item wpcode-list-item-has-pill">
|
113 |
+
<h3>Event Countdown</h3>
|
114 |
+
<label>Page location</label>
|
115 |
+
<select>
|
116 |
+
<option>Insert After Post</option>
|
117 |
+
</select>
|
118 |
+
</div>
|
119 |
+
<div class="wpcode-list-item wpcode-selected-snippet-item wpcode-list-item-has-pill">
|
120 |
+
<h3>Banner Ad 2</h3>
|
121 |
+
<label>Page location</label>
|
122 |
+
<select>
|
123 |
+
<option>Insert After Content</option>
|
124 |
+
</select>
|
125 |
+
</div>
|
126 |
+
<div class="wpcode-list-item wpcode-selected-snippet-item wpcode-list-item-has-pill">
|
127 |
+
<h3>Free Download Button</h3>
|
128 |
+
<label>Page location</label>
|
129 |
+
<select>
|
130 |
+
<option>Insert After Post</option>
|
131 |
+
</select>
|
132 |
+
</div>
|
133 |
+
</div>
|
134 |
+
</div>
|
135 |
+
</div>
|
136 |
+
</div>
|
137 |
+
<?php
|
138 |
+
echo WPCode_Admin_Page::get_upsell_box( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
139 |
+
__( 'Page Scripts is a Pro Feature', 'insert-headers-and-footers' ),
|
140 |
+
sprintf(
|
141 |
+
'<p>%s</p>',
|
142 |
+
esc_html__( 'Upgrade to WPCode Pro and easily add page-specific scripts and snippets directly from the post edit screen.', 'insert-headers-and-footers' )
|
143 |
+
),
|
144 |
+
array(
|
145 |
+
'text' => esc_html__( 'Upgrade to Pro and Unlock Page Scripts', 'insert-headers-and-footers' ),
|
146 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite', 'post-editor-metabox', 'custom-snippets', 'upgrade-to-pro' ),
|
147 |
+
),
|
148 |
+
array(
|
149 |
+
'text' => esc_html__( 'Learn more about all the features', 'insert-headers-and-footers' ),
|
150 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite', 'post-editor-metabox', 'custom-snippets', 'features' ),
|
151 |
+
)
|
152 |
+
);
|
153 |
+
}
|
154 |
+
|
155 |
+
/**
|
156 |
+
* Get the markup for a form using a disabled CodeMirror instance (to avoid loading a script that won't be used).
|
157 |
+
*
|
158 |
+
* @param string $label The label for this tab section.
|
159 |
+
*
|
160 |
+
* @return void
|
161 |
+
*/
|
162 |
+
public function form_for_scripts( $label ) {
|
163 |
+
wp_enqueue_style( 'code-editor' );
|
164 |
+
?>
|
165 |
+
<div class="wpcode-blur-area">
|
166 |
+
<p>
|
167 |
+
<?php
|
168 |
+
printf(
|
169 |
+
// Translators: placeholder for the name of the section (header or footer).
|
170 |
+
esc_html__( 'Add scripts below to the %s section of this page.', 'insert-headers-and-footers' ),
|
171 |
+
esc_html( $label )
|
172 |
+
);
|
173 |
+
?>
|
174 |
+
</p>
|
175 |
+
<p>
|
176 |
+
<label>
|
177 |
+
<input type="checkbox"/>
|
178 |
+
<?php
|
179 |
+
printf(
|
180 |
+
// Translators: placeholder for the name of the section (header or footer).
|
181 |
+
esc_html__( 'Disable global %s scripts on this page', 'insert-headers-and-footers' ),
|
182 |
+
esc_html( $label )
|
183 |
+
);
|
184 |
+
?>
|
185 |
+
</label>
|
186 |
+
</p>
|
187 |
+
<div class="wpcode-input-row">
|
188 |
+
<label>
|
189 |
+
<?php
|
190 |
+
printf(
|
191 |
+
// Translators: placeholder for the name of the section (header or footer).
|
192 |
+
esc_html__( '%s - any device type', 'insert-headers-and-footers' ),
|
193 |
+
esc_html( $label )
|
194 |
+
);
|
195 |
+
?>
|
196 |
+
</label>
|
197 |
+
<div class="wpcode-smart-tags">
|
198 |
+
<button class="wpcode-smart-tags-toggle">
|
199 |
+
<?php wpcode_icon( 'tags', 20, 16, '0 0 20 16' ); ?>
|
200 |
+
<span class="wpcode-text-default">
|
201 |
+
<?php esc_html_e( 'Show Smart Tags', 'insert-headers-and-footers' ); ?>
|
202 |
+
</span>
|
203 |
+
</button>
|
204 |
+
</div>
|
205 |
+
<div class="CodeMirror cm-s-default CodeMirror-wrap">
|
206 |
+
<div class="CodeMirror-vscrollbar" style="width: 18px; pointer-events: none;">
|
207 |
+
<div style="min-width: 1px; height: 0;"></div>
|
208 |
+
</div>
|
209 |
+
<div class="CodeMirror-hscrollbar" style="height: 18px; pointer-events: none;">
|
210 |
+
<div style="height: 100%; min-height: 1px; width: 0;"></div>
|
211 |
+
</div>
|
212 |
+
<div class="CodeMirror-scrollbar-filler"></div>
|
213 |
+
<div class="CodeMirror-gutter-filler"></div>
|
214 |
+
<div class="CodeMirror-scroll" tabindex="-1">
|
215 |
+
<div class="CodeMirror-sizer" style="margin-left: 50px; margin-bottom: 0; border-right-width: 30px; min-height: 165px; padding-right: 0; padding-bottom: 0;">
|
216 |
+
<div style="position: relative; top: 0;">
|
217 |
+
<div class="CodeMirror-lines" role="presentation">
|
218 |
+
<div role="presentation" style="position: relative; outline: none;">
|
219 |
+
<div class="CodeMirror-measure"></div>
|
220 |
+
<div class="CodeMirror-measure"></div>
|
221 |
+
<div style="position: relative; z-index: 1;"></div>
|
222 |
+
<div class="CodeMirror-cursors"></div>
|
223 |
+
<div class="CodeMirror-code" role="presentation" tabindex="0" style="">
|
224 |
+
<div class="CodeMirror-activeline" style="position: relative;">
|
225 |
+
<div class="CodeMirror-activeline-background CodeMirror-linebackground"></div>
|
226 |
+
<div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: -46px; width: 46px;"></div>
|
227 |
+
<div class="CodeMirror-gutter-wrapper CodeMirror-activeline-gutter" style="left: -46px;">
|
228 |
+
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 16px; width: 21px;">
|
229 |
+
1
|
230 |
+
</div>
|
231 |
+
</div>
|
232 |
+
<pre class="CodeMirror-line" role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket CodeMirror-matchingtag"><</span><span class="cm-tag CodeMirror-matchingtag">script</span><span class=" CodeMirror-matchingtag"> </span><span class="cm-attribute CodeMirror-matchingtag">type</span><span class=" CodeMirror-matchingtag">=</span><span class="cm-string CodeMirror-matchingtag">"text/javascript"</span><span class="cm-tag cm-bracket CodeMirror-matchingtag">></span></span></pre>
|
233 |
+
</div>
|
234 |
+
<div style="position: relative;">
|
235 |
+
<div class="CodeMirror-gutter-wrapper" style="left: -46px;">
|
236 |
+
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 16px; width: 21px;">
|
237 |
+
2
|
238 |
+
</div>
|
239 |
+
</div>
|
240 |
+
<pre class="CodeMirror-line" role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation"> </span><span class="cm-variable">console</span>.<span class="cm-property">log</span>( <span class="cm-string">'header'</span> );</span></pre>
|
241 |
+
</div>
|
242 |
+
<div style="position: relative;">
|
243 |
+
<div class="CodeMirror-gutter-wrapper" style="left: -46px;">
|
244 |
+
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 16px; width: 21px;">
|
245 |
+
3
|
246 |
+
</div>
|
247 |
+
</div>
|
248 |
+
<pre class="CodeMirror-line" role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tag cm-bracket CodeMirror-matchingtag"></</span><span class="cm-tag CodeMirror-matchingtag">script</span><span class="cm-tag cm-bracket CodeMirror-matchingtag">></span></span></pre>
|
249 |
+
</div>
|
250 |
+
<div style="position: relative;">
|
251 |
+
<div class="CodeMirror-gutter-wrapper" style="left: -46px;">
|
252 |
+
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 16px; width: 21px;">
|
253 |
+
4
|
254 |
+
</div>
|
255 |
+
</div>
|
256 |
+
<pre class="CodeMirror-line" role="presentation"><span role="presentation" style="padding-right: 0.1px;"></pre>
|
257 |
+
</div>
|
258 |
+
<div style="position: relative;">
|
259 |
+
<div class="CodeMirror-gutter-wrapper" style="left: -46px;">
|
260 |
+
<div class="CodeMirror-linenumber CodeMirror-gutter-elt" style="left: 16px; width: 21px;">
|
261 |
+
5
|
262 |
+
</div>
|
263 |
+
</div>
|
264 |
+
<pre class="CodeMirror-line" role="presentation"><span role="presentation" style="padding-right: 0.1px;"></pre>
|
265 |
+
</div>
|
266 |
+
</div>
|
267 |
+
</div>
|
268 |
+
</div>
|
269 |
+
</div>
|
270 |
+
</div>
|
271 |
+
<div style="position: absolute; height: 30px; width: 1px; border-bottom: 0 solid transparent; top: 165px;"></div>
|
272 |
+
<div class="CodeMirror-gutters" style="height: 195px;">
|
273 |
+
<div class="CodeMirror-gutter CodeMirror-lint-markers"></div>
|
274 |
+
<div class="CodeMirror-gutter CodeMirror-linenumbers" style="width: 29px;"></div>
|
275 |
+
</div>
|
276 |
+
</div>
|
277 |
+
</div>
|
278 |
+
</div>
|
279 |
+
</div>
|
280 |
+
<?php
|
281 |
+
echo WPCode_Admin_Page::get_upsell_box( // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
282 |
+
__( 'Page Scripts is a Pro Feature', 'insert-headers-and-footers' ),
|
283 |
+
sprintf(
|
284 |
+
'<p>%s</p>',
|
285 |
+
esc_html__( 'Upgrade to WPCode Pro and easily add page-specific scripts and snippets directly from the post edit screen.', 'insert-headers-and-footers' )
|
286 |
+
),
|
287 |
+
array(
|
288 |
+
'text' => esc_html__( 'Upgrade to Pro and Unlock Page Scripts', 'insert-headers-and-footers' ),
|
289 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite', 'post-editor-metabox', 'main-' . sanitize_title( $label ), 'upgrade-to-pro' ),
|
290 |
+
),
|
291 |
+
array(
|
292 |
+
'text' => esc_html__( 'Learn more about all the features', 'insert-headers-and-footers' ),
|
293 |
+
'url' => wpcode_utm_url( 'https://wpcode.com/lite', 'post-editor-metabox', 'main-' . sanitize_title( $label ), 'features' ),
|
294 |
+
)
|
295 |
+
);
|
296 |
+
}
|
297 |
+
}
|
includes/lite/admin/notices.php
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Lite-specific admin notices.
|
4 |
+
*/
|
5 |
+
|
6 |
+
add_action( 'admin_init', 'wpcode_maybe_add_library_connect_notice' );
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Show a prompt to connect to the WPCode Library to get access to more snippets.
|
10 |
+
*
|
11 |
+
* @return void
|
12 |
+
*/
|
13 |
+
function wpcode_maybe_add_library_connect_notice() {
|
14 |
+
if ( wpcode()->library_auth->has_auth() || ! isset( $_GET['page'] ) || 0 !== strpos( $_GET['page'], 'wpcode' ) ) {
|
15 |
+
return;
|
16 |
+
}
|
17 |
+
|
18 |
+
$settings_url = add_query_arg(
|
19 |
+
array(
|
20 |
+
'page' => 'wpcode-settings',
|
21 |
+
),
|
22 |
+
admin_url( 'admin.php' )
|
23 |
+
);
|
24 |
+
|
25 |
+
WPCode_Notice::info(
|
26 |
+
sprintf(
|
27 |
+
__( '%1$sConnect to the WPCode Library%2$s for to get access to %3$smore FREE snippets%4$s!', 'insert-headers-and-footers' ),
|
28 |
+
'<a href="' . $settings_url . '" class="wpcode-start-auth">',
|
29 |
+
'</a>',
|
30 |
+
'<strong>',
|
31 |
+
'</strong>'
|
32 |
+
),
|
33 |
+
array(
|
34 |
+
'dismiss' => WPCode_Notice::DISMISS_GLOBAL,
|
35 |
+
'slug' => 'wpcode-library-connect-lite',
|
36 |
+
)
|
37 |
+
);
|
38 |
+
}
|
includes/lite/auto-insert/class-wpcode-auto-insert-edd.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Easy Digital Downloads specific auto-insert locations.
|
4 |
+
*
|
5 |
+
* @package WPCode
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class WPCode_Auto_Insert_EDD.
|
10 |
+
*/
|
11 |
+
class WPCode_Auto_Insert_EDD_Lite extends WPCode_Auto_Insert_Type {
|
12 |
+
/**
|
13 |
+
* Not available to select.
|
14 |
+
*
|
15 |
+
* @var string
|
16 |
+
*/
|
17 |
+
public $code_type = 'pro';
|
18 |
+
/**
|
19 |
+
* Text to display next to optgroup label.
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
*/
|
23 |
+
public $label_pill = 'PRO';
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Load the available options and labels.
|
27 |
+
*
|
28 |
+
* @return void
|
29 |
+
*/
|
30 |
+
public function init() {
|
31 |
+
$this->label = 'Easy Digital Downloads';
|
32 |
+
$this->locations = array(
|
33 |
+
'edd_purchase_link_top' => __( 'Before the Purchase Button', 'insert-headers-and-footers' ),
|
34 |
+
'edd_purchase_link_end' => __( 'After the Purchase Button', 'insert-headers-and-footers' ),
|
35 |
+
'edd_before_download_content' => __( 'Before the Single Download', 'insert-headers-and-footers' ),
|
36 |
+
'edd_after_download_content' => __( 'After the Single Download', 'insert-headers-and-footers' ),
|
37 |
+
'edd_before_cart' => __( 'Before the Cart', 'insert-headers-and-footers' ),
|
38 |
+
'edd_after_cart' => __( 'After the Cart', 'insert-headers-and-footers' ),
|
39 |
+
'edd_before_checkout_cart' => __( 'Before the Checkout Cart', 'insert-headers-and-footers' ),
|
40 |
+
'edd_after_checkout_cart' => __( 'After the Checkout Cart', 'insert-headers-and-footers' ),
|
41 |
+
'edd_before_purchase_form' => __( 'Before the Checkout Form', 'insert-headers-and-footers' ),
|
42 |
+
'edd_after_purchase_form' => __( 'After the Checkout Form', 'insert-headers-and-footers' ),
|
43 |
+
);
|
44 |
+
$this->upgrade_title = __( 'Easy Digital Downloads Locations are a PRO feature', 'insert-headers-and-footers' );
|
45 |
+
$this->upgrade_text = __( 'Upgrade to PRO today and get access to advanced eCommerce auto-insert locations and conditional logic rules for your needs.', 'insert-headers-and-footers' );
|
46 |
+
$this->upgrade_link = wpcode_utm_url( 'https://wpcode.com/lite/', 'edit-snippet', 'auto-insert', 'edd' );
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
new WPCode_Auto_Insert_EDD_Lite();
|
includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* WooCommerce-specific auto-insert locations.
|
4 |
+
*
|
5 |
+
* @package WPCode
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Class WPCode_Auto_Insert_WooCommerce_Lite.
|
10 |
+
*/
|
11 |
+
class WPCode_Auto_Insert_WooCommerce_Lite extends WPCode_Auto_Insert_Type {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Not available to select.
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
public $code_type = 'pro';
|
19 |
+
/**
|
20 |
+
* Text to display next to optgroup label.
|
21 |
+
*
|
22 |
+
* @var string
|
23 |
+
*/
|
24 |
+
public $label_pill = 'PRO';
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Load the available options and labels.
|
28 |
+
*
|
29 |
+
* @return void
|
30 |
+
*/
|
31 |
+
public function init() {
|
32 |
+
$this->label = 'WooCommerce';
|
33 |
+
$this->locations = array(
|
34 |
+
'wc_before_products_list' => __( 'Before the List of Products', 'insert-headers-and-footers' ),
|
35 |
+
'wc_after_products_list' => __( 'After the List of Products', 'insert-headers-and-footers' ),
|
36 |
+
'wc_before_single_product' => __( 'Before the Single Product', 'insert-headers-and-footers' ),
|
37 |
+
'wc_after_single_product' => __( 'After the Single Product', 'insert-headers-and-footers' ),
|
38 |
+
'wc_before_single_product_summary' => __( 'Before the Single Product Summary', 'insert-headers-and-footers' ),
|
39 |
+
'wc_after_single_product_summary' => __( 'After the Single Product Summary', 'insert-headers-and-footers' ),
|
40 |
+
'woocommerce_before_cart' => __( 'Before the Cart', 'insert-headers-and-footers' ),
|
41 |
+
'woocommerce_after_cart' => __( 'After the Cart', 'insert-headers-and-footers' ),
|
42 |
+
'woocommerce_before_checkout_form' => __( 'Before the Checkout Form', 'insert-headers-and-footers' ),
|
43 |
+
'woocommerce_after_checkout_form' => __( 'After the Checkout Form', 'insert-headers-and-footers' ),
|
44 |
+
'woocommerce_checkout_order_review_19' => __( 'Before Checkout Payment Methods', 'insert-headers-and-footers' ),
|
45 |
+
'woocommerce_checkout_order_review_21' => __( 'After Checkout Payment Button', 'insert-headers-and-footers' ),
|
46 |
+
'woocommerce_before_thankyou' => __( 'Before the Thank You Page Content', 'insert-headers-and-footers' ),
|
47 |
+
);
|
48 |
+
$this->upgrade_title = __( 'WooCommerce Locations are a PRO feature', 'insert-headers-and-footers' );
|
49 |
+
$this->upgrade_text = __( 'Upgrade to PRO today and get access to advanced eCommerce auto-insert locations and conditional logic rules for your needs.', 'insert-headers-and-footers' );
|
50 |
+
$this->upgrade_link = wpcode_utm_url( 'https://wpcode.com/lite/', 'edit-snippet', 'auto-insert', 'woocommerce' );
|
51 |
+
}
|
52 |
+
}
|
53 |
+
|
54 |
+
new WPCode_Auto_Insert_WooCommerce_Lite();
|
includes/lite/conditional-logic/class-wpcode-conditional-edd.php
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class that handles conditional logic related to Easy Digital Downloads.
|
4 |
+
*
|
5 |
+
* @package WPCode
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The WPCode_Conditional_EDD class.
|
10 |
+
*/
|
11 |
+
class WPCode_Conditional_EDD_Lite extends WPCode_Conditional_Type {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* The type unique name (slug).
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
public $name = 'edd';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Set the translatable label.
|
22 |
+
*
|
23 |
+
* @return void
|
24 |
+
*/
|
25 |
+
protected function set_label() {
|
26 |
+
$this->label = 'Easy Digital Downloads (PRO)';
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Set the type options for the admin mainly.
|
31 |
+
*
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
protected function load_type_options() {
|
35 |
+
$this->options = array(
|
36 |
+
'edd_page' => array(
|
37 |
+
'label' => __( 'EDD Page', 'insert-headers-and-footers' ),
|
38 |
+
'type' => 'select',
|
39 |
+
'upgrade' => array(
|
40 |
+
'title' => __( 'Easy Digital Downloads Page Rules is a Pro Feature', 'insert-headers-and-footers' ),
|
41 |
+
'text' => __( 'Get access to advanced conditional logic rules for Easy Digital Downloads by upgrading to PRO today.', 'insert-headers-and-footers' ),
|
42 |
+
'link' => wpcode_utm_url( 'https://wpcode.com/lite/', 'edit-snippet', 'conditional-logic', 'edd-page' ),
|
43 |
+
),
|
44 |
+
'options' => array(
|
45 |
+
array(
|
46 |
+
'label' => __( 'Checkout Page', 'insert-headers-and-footers' ),
|
47 |
+
'value' => '',
|
48 |
+
'disabled' => true,
|
49 |
+
),
|
50 |
+
array(
|
51 |
+
'label' => __( 'Success Page', 'insert-headers-and-footers' ),
|
52 |
+
'value' => '',
|
53 |
+
'disabled' => true,
|
54 |
+
),
|
55 |
+
array(
|
56 |
+
'label' => __( 'Single Download Page', 'insert-headers-and-footers' ),
|
57 |
+
'value' => '',
|
58 |
+
'disabled' => true,
|
59 |
+
),
|
60 |
+
array(
|
61 |
+
'label' => __( 'Download Category Page', 'insert-headers-and-footers' ),
|
62 |
+
'value' => '',
|
63 |
+
'disabled' => true,
|
64 |
+
),
|
65 |
+
array(
|
66 |
+
'label' => __( 'Download Tag Page', 'insert-headers-and-footers' ),
|
67 |
+
'value' => '',
|
68 |
+
'disabled' => true,
|
69 |
+
),
|
70 |
+
),
|
71 |
+
),
|
72 |
+
);
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
new WPCode_Conditional_EDD_Lite();
|
includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php
ADDED
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Class that handles conditional logic related to WooCommerce.
|
4 |
+
*
|
5 |
+
* @package WPCode
|
6 |
+
*/
|
7 |
+
|
8 |
+
/**
|
9 |
+
* The WPCode_Conditional_WooCommerce class.
|
10 |
+
*/
|
11 |
+
class WPCode_Conditional_WooCommerce_Lite extends WPCode_Conditional_Type {
|
12 |
+
|
13 |
+
/**
|
14 |
+
* The type unique name (slug).
|
15 |
+
*
|
16 |
+
* @var string
|
17 |
+
*/
|
18 |
+
public $name = 'woocommerce';
|
19 |
+
|
20 |
+
/**
|
21 |
+
* Set the translatable label.
|
22 |
+
*
|
23 |
+
* @return void
|
24 |
+
*/
|
25 |
+
protected function set_label() {
|
26 |
+
$this->label = 'WooCommerce (PRO)';
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Set the type options for the admin mainly.
|
31 |
+
*
|
32 |
+
* @return void
|
33 |
+
*/
|
34 |
+
protected function load_type_options() {
|
35 |
+
$this->options = array(
|
36 |
+
'wc_page' => array(
|
37 |
+
'label' => __( 'WooCommerce Page', 'insert-headers-and-footers' ),
|
38 |
+
'type' => 'select',
|
39 |
+
'upgrade' => array(
|
40 |
+
'title' => __( 'WooCommerce Page Rules is a Pro Feature', 'insert-headers-and-footers' ),
|
41 |
+
'text' => __( 'Get access to advanced conditional logic rules for WooCommerce by upgrading to PRO today.', 'insert-headers-and-footers' ),
|
42 |
+
'link' => wpcode_utm_url( 'https://wpcode.com/lite/', 'edit-snippet', 'conditional-logic', 'woocommerce-page' ),
|
43 |
+
),
|
44 |
+
'options' => array(
|
45 |
+
array(
|
46 |
+
'label' => __( 'Checkout Page', 'insert-headers-and-footers' ),
|
47 |
+
'value' => '',
|
48 |
+
'disabled' => true,
|
49 |
+
),
|
50 |
+
array(
|
51 |
+
'label' => __( 'Thank You Page', 'insert-headers-and-footers' ),
|
52 |
+
'value' => '',
|
53 |
+
'disabled' => true,
|
54 |
+
),
|
55 |
+
array(
|
56 |
+
'label' => __( 'Cart Page', 'insert-headers-and-footers' ),
|
57 |
+
'value' => '',
|
58 |
+
'disabled' => true,
|
59 |
+
),
|
60 |
+
array(
|
61 |
+
'label' => __( 'Single Product Page', 'insert-headers-and-footers' ),
|
62 |
+
'value' => '',
|
63 |
+
'disabled' => true,
|
64 |
+
),
|
65 |
+
array(
|
66 |
+
'label' => __( 'Shop Page', 'insert-headers-and-footers' ),
|
67 |
+
'value' => '',
|
68 |
+
'disabled' => true,
|
69 |
+
),
|
70 |
+
array(
|
71 |
+
'label' => __( 'Product Category Page', 'insert-headers-and-footers' ),
|
72 |
+
'value' => '',
|
73 |
+
'disabled' => true,
|
74 |
+
),
|
75 |
+
array(
|
76 |
+
'label' => __( 'Product Tag Page', 'insert-headers-and-footers' ),
|
77 |
+
'value' => '',
|
78 |
+
'disabled' => true,
|
79 |
+
),
|
80 |
+
array(
|
81 |
+
'label' => __( 'My Account Page', 'insert-headers-and-footers' ),
|
82 |
+
'value' => '',
|
83 |
+
'disabled' => true,
|
84 |
+
),
|
85 |
+
),
|
86 |
+
),
|
87 |
+
);
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
new WPCode_Conditional_WooCommerce_Lite();
|
includes/lite/loader.php
ADDED
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* File used for importing lite-only files.
|
4 |
+
*
|
5 |
+
* @package WPCode
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( is_admin() || defined( 'DOING_CRON' ) && DOING_CRON ) {
|
9 |
+
// Class used for loading the scripts metabox.
|
10 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/lite/admin/class-wpcode-metabox-snippets-lite.php';
|
11 |
+
// Load lite-specific scripts.
|
12 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/lite/admin/admin-scripts.php';
|
13 |
+
// Load lite notices.
|
14 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/lite/admin/notices.php';
|
15 |
+
}
|
16 |
+
|
17 |
+
add_action( 'plugins_loaded', 'wpcode_plugins_loaded_load_lite_files', 2 );
|
18 |
+
|
19 |
+
/**
|
20 |
+
* Require files on plugins_loaded.
|
21 |
+
*
|
22 |
+
* @return void
|
23 |
+
*/
|
24 |
+
function wpcode_plugins_loaded_load_lite_files() {
|
25 |
+
// Load WooCommerce auto-insert locations.
|
26 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php';
|
27 |
+
// Load EDD auto-insert locations.
|
28 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/lite/auto-insert/class-wpcode-auto-insert-edd.php';
|
29 |
+
// Load WooCommerce conditional logic.
|
30 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php';
|
31 |
+
// Load EDD conditional logic.
|
32 |
+
require_once WPCODE_PLUGIN_PATH . 'includes/lite/conditional-logic/class-wpcode-conditional-edd.php';
|
33 |
+
}
|
includes/post-type.php
CHANGED
@@ -10,7 +10,7 @@ add_action( 'init', 'wpcode_register_taxonomies', - 5 );
|
|
10 |
add_filter( 'update_post_term_count_statuses', 'wpcode_taxonomies_count_drafts', 10, 2 );
|
11 |
|
12 |
/**
|
13 |
-
* Register the post type for
|
14 |
*
|
15 |
* @return void
|
16 |
*/
|
@@ -18,8 +18,8 @@ function wpcode_register_post_type() {
|
|
18 |
register_post_type(
|
19 |
'wpcode',
|
20 |
array(
|
21 |
-
'public'
|
22 |
-
'show_ui'
|
23 |
)
|
24 |
);
|
25 |
}
|
10 |
add_filter( 'update_post_term_count_statuses', 'wpcode_taxonomies_count_drafts', 10, 2 );
|
11 |
|
12 |
/**
|
13 |
+
* Register the post type for snippets.
|
14 |
*
|
15 |
* @return void
|
16 |
*/
|
18 |
register_post_type(
|
19 |
'wpcode',
|
20 |
array(
|
21 |
+
'public' => false,
|
22 |
+
'show_ui' => false,
|
23 |
)
|
24 |
);
|
25 |
}
|
languages/insert-headers-and-footers.pot
CHANGED
@@ -2,20 +2,20 @@
|
|
2 |
# This file is distributed under the GPLv2 or later.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: WPCode
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/insert-headers-and-footers\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2022-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.5.0\n"
|
15 |
"X-Domain: insert-headers-and-footers\n"
|
16 |
|
17 |
#. Plugin Name of the plugin
|
18 |
-
msgid "WPCode
|
19 |
msgstr ""
|
20 |
|
21 |
#. Plugin URI of the plugin
|
@@ -31,6 +31,14 @@ msgstr ""
|
|
31 |
msgid "WPCode"
|
32 |
msgstr ""
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
#. Translators: formatted error code.
|
35 |
#: includes/admin/admin-ajax-handlers.php:38
|
36 |
msgid "Snippet not %2$s, the following error was encountered: %1$s"
|
@@ -59,23 +67,68 @@ msgstr ""
|
|
59 |
msgid "There was an error and the connection failed. Please contact your web host with the technical details below."
|
60 |
msgstr ""
|
61 |
|
62 |
-
#: includes/admin/admin-
|
63 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
#: includes/admin/pages/class-wpcode-admin-page-code-snippets.php:32
|
65 |
msgid "Code Snippets"
|
66 |
msgstr ""
|
67 |
|
68 |
-
#: includes/admin/admin-
|
69 |
#: includes/admin/pages/class-wpcode-admin-page-settings.php:38
|
70 |
-
#: includes/admin/pages/class-wpcode-admin-page-settings.php:
|
71 |
msgid "Settings"
|
72 |
msgstr ""
|
73 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
#. Translators: Placeholder for the category name.
|
75 |
#: includes/admin/class-wpcode-docs.php:164
|
76 |
msgid "View All %s Docs"
|
77 |
msgstr ""
|
78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
#. Translators: Human-Readable time to display.
|
80 |
#: includes/admin/class-wpcode-notifications.php:282
|
81 |
msgid "%1$s ago"
|
@@ -136,7 +189,7 @@ msgstr ""
|
|
136 |
|
137 |
#. Translators: This simply adds the plugin name before the logo text.
|
138 |
#: includes/admin/class-wpcode-upgrade-welcome.php:155
|
139 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
140 |
msgid "%s logo"
|
141 |
msgstr ""
|
142 |
|
@@ -261,12 +314,12 @@ msgid "The snippet you are trying to import does not exist."
|
|
261 |
msgstr ""
|
262 |
|
263 |
#: includes/admin/pages/class-wpcode-admin-page-code-snippets.php:173
|
264 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
265 |
msgid "Search Snippets"
|
266 |
msgstr ""
|
267 |
|
268 |
#: includes/admin/pages/class-wpcode-admin-page-code-snippets.php:191
|
269 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
270 |
msgid "All Snippets"
|
271 |
msgstr ""
|
272 |
|
@@ -309,110 +362,166 @@ msgstr ""
|
|
309 |
msgid "All Generators"
|
310 |
msgstr ""
|
311 |
|
312 |
-
#: includes/admin/pages/class-wpcode-admin-page-generator.php:
|
313 |
msgid "Generate"
|
314 |
msgstr ""
|
315 |
|
316 |
-
#: includes/admin/pages/class-wpcode-admin-page-generator.php:
|
317 |
msgid "Update code"
|
318 |
msgstr ""
|
319 |
|
320 |
-
#: includes/admin/pages/class-wpcode-admin-page-generator.php:
|
321 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
322 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
323 |
msgid "Code Preview"
|
324 |
msgstr ""
|
325 |
|
326 |
-
#: includes/admin/pages/class-wpcode-admin-page-generator.php:
|
327 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
328 |
msgid "Use Snippet"
|
329 |
msgstr ""
|
330 |
|
331 |
-
#: includes/admin/pages/class-wpcode-admin-page-generator.php:
|
332 |
msgctxt "Copy to clipboard"
|
333 |
msgid "Copy Code"
|
334 |
msgstr ""
|
335 |
|
336 |
-
#: includes/admin/pages/class-wpcode-admin-page-generator.php:
|
337 |
msgid "Remove Row"
|
338 |
msgstr ""
|
339 |
|
340 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
341 |
msgid "Header & Footer"
|
342 |
msgstr ""
|
343 |
|
344 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
345 |
msgid "Headers & Footers mode activated. Use the toggle next to the Save Changes button to disable it at any time."
|
346 |
msgstr ""
|
347 |
|
348 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
349 |
msgid "Headers & Footers mode deactivated, if you wish to switch back please use the option on the settings page."
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
353 |
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:135
|
354 |
msgid "Sorry, you only have read-only access to this page. Ask your administrator for assistance editing."
|
355 |
msgstr ""
|
356 |
|
357 |
#. translators: %s: The `<head>` tag
|
358 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
359 |
msgid "These scripts will be printed in the %s section."
|
360 |
msgstr ""
|
361 |
|
362 |
#. translators: %s: The `<head>` tag
|
363 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
364 |
msgid "These scripts will be printed just below the opening %s tag."
|
365 |
msgstr ""
|
366 |
|
367 |
#. translators: %s: The `</body>` tag
|
368 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
369 |
msgid "These scripts will be printed above the closing %s tag."
|
370 |
msgstr ""
|
371 |
|
372 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
373 |
-
#: includes/generator/class-wpcode-generator-script.php:193
|
374 |
-
msgid "Header"
|
375 |
-
msgstr ""
|
376 |
-
|
377 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:151
|
378 |
-
msgid "Body"
|
379 |
-
msgstr ""
|
380 |
-
|
381 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:153
|
382 |
-
#: includes/generator/class-wpcode-generator-script.php:192
|
383 |
-
msgid "Footer"
|
384 |
-
msgstr ""
|
385 |
-
|
386 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:189
|
387 |
msgid "Global Header and Footer"
|
388 |
msgstr ""
|
389 |
|
390 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
391 |
-
#: includes/admin/pages/class-wpcode-admin-page-settings.php:
|
392 |
msgid "Save Changes"
|
393 |
msgstr ""
|
394 |
|
395 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
396 |
msgid "Simple mode"
|
397 |
msgstr ""
|
398 |
|
399 |
-
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:
|
400 |
-
#: includes/admin/pages/class-wpcode-admin-page-settings.php:
|
401 |
msgid "Settings Saved."
|
402 |
msgstr ""
|
403 |
|
404 |
-
#: includes/admin/pages/class-wpcode-admin-page-library.php:
|
405 |
msgid "Library"
|
406 |
msgstr ""
|
407 |
|
408 |
-
#: includes/admin/pages/class-wpcode-admin-page-library.php:
|
409 |
-
msgid "
|
|
|
|
|
|
|
|
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: includes/admin/pages/class-wpcode-admin-page-library.php:
|
|
|
|
|
|
|
|
|
413 |
msgid "We encountered an error while trying to load the snippet data. Please try again."
|
414 |
msgstr ""
|
415 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
416 |
#: includes/admin/pages/class-wpcode-admin-page-settings.php:72
|
417 |
msgid "This allows you to disable all Code Snippets functionality and have a single \"Headers & Footers\" item under the settings menu."
|
418 |
msgstr ""
|
@@ -426,6 +535,18 @@ msgstr ""
|
|
426 |
msgid "Headers & Footers mode"
|
427 |
msgstr ""
|
428 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
429 |
#. Translators: This adds the name of the plugin "WPCode".
|
430 |
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:68
|
431 |
msgid "Add %s Snippet"
|
@@ -478,179 +599,210 @@ msgstr ""
|
|
478 |
msgid "Edit snippet \"%s\""
|
479 |
msgstr ""
|
480 |
|
481 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
482 |
msgid "Add Your Custom Code (New Snippet)"
|
483 |
msgstr ""
|
484 |
|
485 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
486 |
msgid "Choose this blank snippet to start from scratch and paste any custom code or simply write your own."
|
487 |
msgstr ""
|
488 |
|
489 |
#. Translators: The placeholders add links to create a new custom snippet or the suggest-a-snippet form.
|
490 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
491 |
msgid "To speed up the process you can select from one of our pre-made library, or you can start with a %1$sblank snippet%2$s and %1$screate your own%2$s. Have a suggestion for new snippet? %3$sWe’d love to hear it!%4$s"
|
492 |
msgstr ""
|
493 |
|
494 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
495 |
msgid "Add title for snippet"
|
496 |
msgstr ""
|
497 |
|
498 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
499 |
msgid "Code Type"
|
500 |
msgstr ""
|
501 |
|
502 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
503 |
msgid "Insertion"
|
504 |
msgstr ""
|
505 |
|
506 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
507 |
msgid "Choose \"Auto Insert\" if you want the snippet to be automatically executed in one of the locations available. In \"Shortcode\" mode, the snippet will only be executed where the shortcode is inserted."
|
508 |
msgstr ""
|
509 |
|
510 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
511 |
msgid "Insert Method"
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
515 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:459
|
516 |
msgid "Location"
|
517 |
msgstr ""
|
518 |
|
519 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
520 |
msgid "Insert Number"
|
521 |
msgstr ""
|
522 |
|
523 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
524 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
525 |
msgid "Shortcode"
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
529 |
msgid "Your snippet can be either automatically executed or only used as a shortcode. When using the \"Auto Insert\" option you can choose the location where your snippet will be placed automatically."
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
533 |
msgid "Number of paragraphs before which to insert the snippet."
|
534 |
msgstr ""
|
535 |
|
536 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
537 |
msgid "Number of paragraphs after which to insert the snippet."
|
538 |
msgstr ""
|
539 |
|
540 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
541 |
msgid "Number of posts before which to insert the snippet."
|
542 |
msgstr ""
|
543 |
|
544 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
545 |
msgid "Number of posts after which to insert the snippet."
|
546 |
msgstr ""
|
547 |
|
548 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
549 |
msgid "Auto Insert"
|
550 |
msgstr ""
|
551 |
|
552 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
553 |
msgid "Please save the snippet first"
|
554 |
msgstr ""
|
555 |
|
556 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
557 |
-
msgctxt "Copy to clipboard"
|
558 |
-
msgid "Copy"
|
559 |
-
msgstr ""
|
560 |
-
|
561 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:603
|
562 |
msgid "Tag"
|
563 |
msgstr ""
|
564 |
|
565 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
566 |
#: includes/generator/class-wpcode-generator-hooks.php:1360
|
567 |
msgid "Priority"
|
568 |
msgstr ""
|
569 |
|
570 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
571 |
msgid "Note"
|
572 |
msgstr ""
|
573 |
|
574 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
575 |
msgid "Basic info"
|
576 |
msgstr ""
|
577 |
|
578 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
579 |
msgid "Tags: Use tags to make it easier to group similar snippets together. <br />Priority: A lower priority will result in the snippet being executed before others with a higher priority. <br />Note: Add a private note related to this snippet."
|
580 |
msgstr ""
|
581 |
|
582 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
583 |
msgid "Using conditional logic you can limit the pages where you want the snippet to be auto-inserted."
|
584 |
msgstr ""
|
585 |
|
586 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
587 |
msgid "Enable Logic"
|
588 |
msgstr ""
|
589 |
|
590 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
591 |
msgid "Conditions"
|
592 |
msgstr ""
|
593 |
|
594 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
595 |
msgid "Smart Conditional Logic"
|
596 |
msgstr ""
|
597 |
|
598 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
599 |
msgid "Enable logic to add rules and limit where your snippets are inserted automatically. Use multiple groups for different sets of rules."
|
600 |
msgstr ""
|
601 |
|
602 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
603 |
#: includes/admin/pages/class-wpcode-admin-page-tools.php:358
|
604 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:695
|
605 |
msgid "Active"
|
606 |
msgstr ""
|
607 |
|
608 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
609 |
#: includes/admin/pages/class-wpcode-admin-page-tools.php:359
|
610 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:698
|
611 |
msgid "Inactive"
|
612 |
msgstr ""
|
613 |
|
614 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
615 |
msgid "+ Add new group"
|
616 |
msgstr ""
|
617 |
|
618 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
619 |
msgid "Show"
|
620 |
msgstr ""
|
621 |
|
622 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
623 |
msgid "Hide"
|
624 |
msgstr ""
|
625 |
|
626 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
627 |
msgid "This code snippet if"
|
628 |
msgstr ""
|
629 |
|
630 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
631 |
msgctxt "Conditional logic add another \"and\" rules row."
|
632 |
msgid "AND"
|
633 |
msgstr ""
|
634 |
|
635 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
636 |
-
|
|
|
637 |
msgstr ""
|
638 |
|
639 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
640 |
-
msgid "
|
641 |
msgstr ""
|
642 |
|
643 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
644 |
-
msgid "
|
645 |
msgstr ""
|
646 |
|
647 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
648 |
-
msgid "
|
649 |
msgstr ""
|
650 |
|
651 |
-
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:
|
652 |
-
|
653 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
654 |
msgstr ""
|
655 |
|
656 |
#: includes/admin/pages/class-wpcode-admin-page-tools.php:52
|
@@ -804,116 +956,120 @@ msgstr ""
|
|
804 |
msgid "Importer"
|
805 |
msgstr ""
|
806 |
|
807 |
-
#: includes/admin/pages/class-wpcode-admin-page-tools.php:
|
808 |
msgid "Please upload a valid .json snippets export file."
|
809 |
msgstr ""
|
810 |
|
811 |
-
#: includes/admin/pages/class-wpcode-admin-page-tools.php:
|
812 |
-
#: includes/admin/pages/class-wpcode-admin-page-tools.php:
|
813 |
msgid "Error"
|
814 |
msgstr ""
|
815 |
|
816 |
-
#: includes/admin/pages/class-wpcode-admin-page-tools.php:
|
817 |
msgid "Snippets data cannot be imported."
|
818 |
msgstr ""
|
819 |
|
820 |
-
#: includes/admin/pages/class-wpcode-admin-page-tools.php:
|
821 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:284
|
822 |
msgid "Edit"
|
823 |
msgstr ""
|
824 |
|
825 |
-
#: includes/admin/pages/class-wpcode-admin-page-tools.php:
|
826 |
msgid "Testing"
|
827 |
msgstr ""
|
828 |
|
829 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
830 |
msgid "Search docs"
|
831 |
msgstr ""
|
832 |
|
833 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
834 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:598
|
835 |
msgid "Clear"
|
836 |
msgstr ""
|
837 |
|
838 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
839 |
msgid "No docs found"
|
840 |
msgstr ""
|
841 |
|
842 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
843 |
msgid "View Documentation"
|
844 |
msgstr ""
|
845 |
|
846 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
847 |
msgid "Browse documentation, reference material, and tutorials for WPCode."
|
848 |
msgstr ""
|
849 |
|
850 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
851 |
msgid "View All Documentation"
|
852 |
msgstr ""
|
853 |
|
854 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
855 |
msgid "Get Support"
|
856 |
msgstr ""
|
857 |
|
858 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
859 |
msgid "Submit a ticket and our world class support team will be in touch soon."
|
860 |
msgstr ""
|
861 |
|
862 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
863 |
msgid "Submit a Support Ticket"
|
864 |
msgstr ""
|
865 |
|
866 |
#. Translators: Placeholder for the number of active notifications.
|
867 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
868 |
msgid "New Notifications (%s)"
|
869 |
msgstr ""
|
870 |
|
871 |
#. Translators: Placeholder for the number of dismissed notifications.
|
872 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
873 |
msgid "Notifications (%s)"
|
874 |
msgstr ""
|
875 |
|
876 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
877 |
msgid "Dismissed Notifications"
|
878 |
msgstr ""
|
879 |
|
880 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
881 |
msgid "Active Notifications"
|
882 |
msgstr ""
|
883 |
|
884 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
885 |
msgid "Dismiss all"
|
886 |
msgstr ""
|
887 |
|
888 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
889 |
msgid "Dismiss"
|
890 |
msgstr ""
|
891 |
|
892 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
893 |
msgid "Help"
|
894 |
msgstr ""
|
895 |
|
896 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
897 |
msgid "Use snippet"
|
898 |
msgstr ""
|
899 |
|
900 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
901 |
msgid "Edit snippet"
|
902 |
msgstr ""
|
903 |
|
904 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
905 |
msgid "Used"
|
906 |
msgstr ""
|
907 |
|
908 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
909 |
msgid "Preview"
|
910 |
msgstr ""
|
911 |
|
912 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
|
|
|
|
|
|
|
|
913 |
msgid "We encountered a problem loading the Snippet Library items, please try again later."
|
914 |
msgstr ""
|
915 |
|
916 |
-
#: includes/admin/pages/class-wpcode-admin-page.php:
|
917 |
msgid "Preview Snippet"
|
918 |
msgstr ""
|
919 |
|
@@ -1108,60 +1264,72 @@ msgstr ""
|
|
1108 |
msgid "Query"
|
1109 |
msgstr ""
|
1110 |
|
1111 |
-
#: includes/class-wpcode-install.php:
|
1112 |
msgid "Display a message after the 1st paragraph of posts"
|
1113 |
msgstr ""
|
1114 |
|
1115 |
-
#: includes/class-wpcode-install.php:
|
1116 |
msgid "Completely Disable Comments"
|
1117 |
msgstr ""
|
1118 |
|
1119 |
-
#: includes/class-wpcode-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1120 |
msgid "HTML Snippet"
|
1121 |
msgstr ""
|
1122 |
|
1123 |
-
#: includes/class-wpcode-snippet-execute.php:
|
1124 |
msgid "Text Snippet"
|
1125 |
msgstr ""
|
1126 |
|
1127 |
-
#: includes/class-wpcode-snippet-execute.php:
|
1128 |
msgid "JavaScript Snippet"
|
1129 |
msgstr ""
|
1130 |
|
1131 |
-
#: includes/class-wpcode-snippet-execute.php:
|
1132 |
msgid "PHP Snippet"
|
1133 |
msgstr ""
|
1134 |
|
1135 |
-
#: includes/class-wpcode-snippet-execute.php:
|
1136 |
msgid "Universal Snippet"
|
1137 |
msgstr ""
|
1138 |
|
1139 |
-
#: includes/class-wpcode-snippet-execute.php:
|
|
|
|
|
|
|
|
|
1140 |
msgid "Snippet has not been activated due to an error."
|
1141 |
msgstr ""
|
1142 |
|
1143 |
-
#: includes/class-wpcode-snippet-execute.php:
|
1144 |
msgid "Please click the back button in the browser to update the snippet."
|
1145 |
msgstr ""
|
1146 |
|
1147 |
-
#: includes/class-wpcode-snippet-execute.php:
|
1148 |
msgid "WPCode has detected an error in one of the snippets which has now been automatically deactivated."
|
1149 |
msgstr ""
|
1150 |
|
1151 |
#. Translators: the placeholders add a link to edit the snippet that threw the error.
|
1152 |
-
#: includes/class-wpcode-snippet-execute.php:
|
1153 |
msgid "%1$sClick here%2$s to update the snippet that threw the error."
|
1154 |
msgstr ""
|
1155 |
|
1156 |
-
#: includes/class-wpcode-snippet-execute.php:
|
1157 |
msgid "Error message:"
|
1158 |
msgstr ""
|
1159 |
|
1160 |
-
#: includes/class-wpcode-snippet.php:
|
1161 |
msgid "You are not allowed to change snippet status, please contact your webmaster."
|
1162 |
msgstr ""
|
1163 |
|
1164 |
-
#: includes/class-wpcode-snippet.php:
|
1165 |
msgid "Untitled Snippet"
|
1166 |
msgstr ""
|
1167 |
|
@@ -3541,6 +3709,231 @@ msgstr ""
|
|
3541 |
msgid "Add field"
|
3542 |
msgstr ""
|
3543 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3544 |
#: includes/safe-mode.php:70
|
3545 |
msgid "WPCode is in Safe Mode which means no snippets are getting executed. Please disable any snippets that have caused errors and when done click the button below to exit safe mode."
|
3546 |
msgstr ""
|
2 |
# This file is distributed under the GPLv2 or later.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: WPCode Lite 2.0.4\n"
|
6 |
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/insert-headers-and-footers\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2022-11-17T15:17:06+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.5.0\n"
|
15 |
"X-Domain: insert-headers-and-footers\n"
|
16 |
|
17 |
#. Plugin Name of the plugin
|
18 |
+
msgid "WPCode Lite"
|
19 |
msgstr ""
|
20 |
|
21 |
#. Plugin URI of the plugin
|
31 |
msgid "WPCode"
|
32 |
msgstr ""
|
33 |
|
34 |
+
#: ihaf.php:125
|
35 |
+
msgid "Heads up!"
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: ihaf.php:126
|
39 |
+
msgid "Your site already has WPCode Pro activated. If you want to switch to WPCode Lite, please first go to Plugins → Installed Plugins and deactivate WPCode. Then, you can activate WPCode Lite."
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
#. Translators: formatted error code.
|
43 |
#: includes/admin/admin-ajax-handlers.php:38
|
44 |
msgid "Snippet not %2$s, the following error was encountered: %1$s"
|
67 |
msgid "There was an error and the connection failed. Please contact your web host with the technical details below."
|
68 |
msgstr ""
|
69 |
|
70 |
+
#: includes/admin/admin-scripts.php:42
|
71 |
+
msgid "Please wait."
|
72 |
+
msgstr ""
|
73 |
+
|
74 |
+
#: includes/admin/admin-scripts.php:43
|
75 |
+
msgid "OK"
|
76 |
+
msgstr ""
|
77 |
+
|
78 |
+
#: includes/admin/class-wpcode-admin-page-loader.php:105
|
79 |
+
#: includes/admin/class-wpcode-admin-page-loader.php:106
|
80 |
+
#: includes/admin/class-wpcode-admin-page-loader.php:163
|
81 |
#: includes/admin/pages/class-wpcode-admin-page-code-snippets.php:32
|
82 |
msgid "Code Snippets"
|
83 |
msgstr ""
|
84 |
|
85 |
+
#: includes/admin/class-wpcode-admin-page-loader.php:171
|
86 |
#: includes/admin/pages/class-wpcode-admin-page-settings.php:38
|
87 |
+
#: includes/admin/pages/class-wpcode-admin-page-settings.php:132
|
88 |
msgid "Settings"
|
89 |
msgstr ""
|
90 |
|
91 |
+
#: includes/admin/class-wpcode-admin-page-loader.php:186
|
92 |
+
msgid "Upgrade to WPCode Pro"
|
93 |
+
msgstr ""
|
94 |
+
|
95 |
+
#: includes/admin/class-wpcode-admin-page-loader.php:187
|
96 |
+
msgid "Get WPCode Pro"
|
97 |
+
msgstr ""
|
98 |
+
|
99 |
#. Translators: Placeholder for the category name.
|
100 |
#: includes/admin/class-wpcode-docs.php:164
|
101 |
msgid "View All %s Docs"
|
102 |
msgstr ""
|
103 |
|
104 |
+
#: includes/admin/class-wpcode-metabox-snippets.php:48
|
105 |
+
msgid "WPCode Page Scripts"
|
106 |
+
msgstr ""
|
107 |
+
|
108 |
+
#: includes/admin/class-wpcode-metabox-snippets.php:50
|
109 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:150
|
110 |
+
#: includes/generator/class-wpcode-generator-script.php:193
|
111 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:22
|
112 |
+
msgid "Header"
|
113 |
+
msgstr ""
|
114 |
+
|
115 |
+
#: includes/admin/class-wpcode-metabox-snippets.php:51
|
116 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:154
|
117 |
+
#: includes/generator/class-wpcode-generator-script.php:192
|
118 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:35
|
119 |
+
msgid "Footer"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: includes/admin/class-wpcode-metabox-snippets.php:57
|
123 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:152
|
124 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:48
|
125 |
+
msgid "Body"
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: includes/admin/class-wpcode-metabox-snippets.php:60
|
129 |
+
msgid "Custom Code Snippet"
|
130 |
+
msgstr ""
|
131 |
+
|
132 |
#. Translators: Human-Readable time to display.
|
133 |
#: includes/admin/class-wpcode-notifications.php:282
|
134 |
msgid "%1$s ago"
|
189 |
|
190 |
#. Translators: This simply adds the plugin name before the logo text.
|
191 |
#: includes/admin/class-wpcode-upgrade-welcome.php:155
|
192 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:387
|
193 |
msgid "%s logo"
|
194 |
msgstr ""
|
195 |
|
314 |
msgstr ""
|
315 |
|
316 |
#: includes/admin/pages/class-wpcode-admin-page-code-snippets.php:173
|
317 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:875
|
318 |
msgid "Search Snippets"
|
319 |
msgstr ""
|
320 |
|
321 |
#: includes/admin/pages/class-wpcode-admin-page-code-snippets.php:191
|
322 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:875
|
323 |
msgid "All Snippets"
|
324 |
msgstr ""
|
325 |
|
362 |
msgid "All Generators"
|
363 |
msgstr ""
|
364 |
|
365 |
+
#: includes/admin/pages/class-wpcode-admin-page-generator.php:116
|
366 |
msgid "Generate"
|
367 |
msgstr ""
|
368 |
|
369 |
+
#: includes/admin/pages/class-wpcode-admin-page-generator.php:164
|
370 |
msgid "Update code"
|
371 |
msgstr ""
|
372 |
|
373 |
+
#: includes/admin/pages/class-wpcode-admin-page-generator.php:171
|
374 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:300
|
375 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:952
|
376 |
msgid "Code Preview"
|
377 |
msgstr ""
|
378 |
|
379 |
+
#: includes/admin/pages/class-wpcode-admin-page-generator.php:172
|
380 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:957
|
381 |
msgid "Use Snippet"
|
382 |
msgstr ""
|
383 |
|
384 |
+
#: includes/admin/pages/class-wpcode-admin-page-generator.php:174
|
385 |
msgctxt "Copy to clipboard"
|
386 |
msgid "Copy Code"
|
387 |
msgstr ""
|
388 |
|
389 |
+
#: includes/admin/pages/class-wpcode-admin-page-generator.php:206
|
390 |
msgid "Remove Row"
|
391 |
msgstr ""
|
392 |
|
393 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:48
|
394 |
msgid "Header & Footer"
|
395 |
msgstr ""
|
396 |
|
397 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:92
|
398 |
msgid "Headers & Footers mode activated. Use the toggle next to the Save Changes button to disable it at any time."
|
399 |
msgstr ""
|
400 |
|
401 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:93
|
402 |
msgid "Headers & Footers mode deactivated, if you wish to switch back please use the option on the settings page."
|
403 |
msgstr ""
|
404 |
|
405 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:111
|
406 |
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:135
|
407 |
msgid "Sorry, you only have read-only access to this page. Ask your administrator for assistance editing."
|
408 |
msgstr ""
|
409 |
|
410 |
#. translators: %s: The `<head>` tag
|
411 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:137
|
412 |
msgid "These scripts will be printed in the %s section."
|
413 |
msgstr ""
|
414 |
|
415 |
#. translators: %s: The `<head>` tag
|
416 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:142
|
417 |
msgid "These scripts will be printed just below the opening %s tag."
|
418 |
msgstr ""
|
419 |
|
420 |
#. translators: %s: The `</body>` tag
|
421 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:147
|
422 |
msgid "These scripts will be printed above the closing %s tag."
|
423 |
msgstr ""
|
424 |
|
425 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:199
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
msgid "Global Header and Footer"
|
427 |
msgstr ""
|
428 |
|
429 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:204
|
430 |
+
#: includes/admin/pages/class-wpcode-admin-page-settings.php:136
|
431 |
msgid "Save Changes"
|
432 |
msgstr ""
|
433 |
|
434 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:222
|
435 |
msgid "Simple mode"
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: includes/admin/pages/class-wpcode-admin-page-headers-footers.php:276
|
439 |
+
#: includes/admin/pages/class-wpcode-admin-page-settings.php:172
|
440 |
msgid "Settings Saved."
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:44
|
444 |
msgid "Library"
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:55
|
448 |
+
msgid "Snippets"
|
449 |
+
msgstr ""
|
450 |
+
|
451 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:56
|
452 |
+
msgid "My Library"
|
453 |
msgstr ""
|
454 |
|
455 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:57
|
456 |
+
msgid "My Favorites"
|
457 |
+
msgstr ""
|
458 |
+
|
459 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:172
|
460 |
msgid "We encountered an error while trying to load the snippet data. Please try again."
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:194
|
464 |
+
msgid "My Library is a PRO Feature"
|
465 |
+
msgstr ""
|
466 |
+
|
467 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:195
|
468 |
+
msgid "Upgrade to WPCode PRO today and save your snippets in the WPCode Library directly from the plugin and import them with 1-click on other sites."
|
469 |
+
msgstr ""
|
470 |
+
|
471 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:197
|
472 |
+
msgid "Upgrade PRO and Unlock \"My Library\""
|
473 |
+
msgstr ""
|
474 |
+
|
475 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:201
|
476 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:231
|
477 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1227
|
478 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:149
|
479 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:292
|
480 |
+
msgid "Learn more about all the features"
|
481 |
+
msgstr ""
|
482 |
+
|
483 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:205
|
484 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:237
|
485 |
+
msgid "Save your snippets to the WPCode Library"
|
486 |
+
msgstr ""
|
487 |
+
|
488 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:206
|
489 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:236
|
490 |
+
msgid "Import snippets from the WPCode Library"
|
491 |
+
msgstr ""
|
492 |
+
|
493 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:207
|
494 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:238
|
495 |
+
msgid "Set up new websites faster"
|
496 |
+
msgstr ""
|
497 |
+
|
498 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:208
|
499 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:239
|
500 |
+
msgid "Easily implement features on multiple sites"
|
501 |
+
msgstr ""
|
502 |
+
|
503 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:209
|
504 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:240
|
505 |
+
msgid "Edit snippets in the WPCode Library"
|
506 |
+
msgstr ""
|
507 |
+
|
508 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:210
|
509 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:235
|
510 |
+
msgid "Load favorite snippets in the plugin"
|
511 |
+
msgstr ""
|
512 |
+
|
513 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:224
|
514 |
+
msgid "My Favorites is a PRO Feature"
|
515 |
+
msgstr ""
|
516 |
+
|
517 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:225
|
518 |
+
msgid "Upgrade to WPCode PRO today and see the snippets you starred in the WPCode Library directly in the plugin."
|
519 |
+
msgstr ""
|
520 |
+
|
521 |
+
#: includes/admin/pages/class-wpcode-admin-page-library.php:227
|
522 |
+
msgid "Upgrade PRO and Unlock \"My Favorites\""
|
523 |
+
msgstr ""
|
524 |
+
|
525 |
#: includes/admin/pages/class-wpcode-admin-page-settings.php:72
|
526 |
msgid "This allows you to disable all Code Snippets functionality and have a single \"Headers & Footers\" item under the settings menu."
|
527 |
msgstr ""
|
535 |
msgid "Headers & Footers mode"
|
536 |
msgstr ""
|
537 |
|
538 |
+
#: includes/admin/pages/class-wpcode-admin-page-settings.php:93
|
539 |
+
msgid "WPCode Library Connection"
|
540 |
+
msgstr ""
|
541 |
+
|
542 |
+
#: includes/admin/pages/class-wpcode-admin-page-settings.php:109
|
543 |
+
msgid "Connect to the WPCode Library"
|
544 |
+
msgstr ""
|
545 |
+
|
546 |
+
#: includes/admin/pages/class-wpcode-admin-page-settings.php:112
|
547 |
+
msgid "Disconnect from the WPCode Library"
|
548 |
+
msgstr ""
|
549 |
+
|
550 |
#. Translators: This adds the name of the plugin "WPCode".
|
551 |
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:68
|
552 |
msgid "Add %s Snippet"
|
599 |
msgid "Edit snippet \"%s\""
|
600 |
msgstr ""
|
601 |
|
602 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:241
|
603 |
msgid "Add Your Custom Code (New Snippet)"
|
604 |
msgstr ""
|
605 |
|
606 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:242
|
607 |
msgid "Choose this blank snippet to start from scratch and paste any custom code or simply write your own."
|
608 |
msgstr ""
|
609 |
|
610 |
#. Translators: The placeholders add links to create a new custom snippet or the suggest-a-snippet form.
|
611 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:261
|
612 |
msgid "To speed up the process you can select from one of our pre-made library, or you can start with a %1$sblank snippet%2$s and %1$screate your own%2$s. Have a suggestion for new snippet? %3$sWe’d love to hear it!%4$s"
|
613 |
msgstr ""
|
614 |
|
615 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:283
|
616 |
msgid "Add title for snippet"
|
617 |
msgstr ""
|
618 |
|
619 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:334
|
620 |
msgid "Code Type"
|
621 |
msgstr ""
|
622 |
|
623 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:352
|
624 |
msgid "Insertion"
|
625 |
msgstr ""
|
626 |
|
627 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:359
|
628 |
msgid "Choose \"Auto Insert\" if you want the snippet to be automatically executed in one of the locations available. In \"Shortcode\" mode, the snippet will only be executed where the shortcode is inserted."
|
629 |
msgstr ""
|
630 |
|
631 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:362
|
632 |
msgid "Insert Method"
|
633 |
msgstr ""
|
634 |
|
635 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:365
|
636 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:459
|
637 |
msgid "Location"
|
638 |
msgstr ""
|
639 |
|
640 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:367
|
641 |
msgid "Insert Number"
|
642 |
msgstr ""
|
643 |
|
644 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:382
|
645 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:432
|
646 |
msgid "Shortcode"
|
647 |
msgstr ""
|
648 |
|
649 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:393
|
650 |
msgid "Your snippet can be either automatically executed or only used as a shortcode. When using the \"Auto Insert\" option you can choose the location where your snippet will be placed automatically."
|
651 |
msgstr ""
|
652 |
|
653 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:404
|
654 |
msgid "Number of paragraphs before which to insert the snippet."
|
655 |
msgstr ""
|
656 |
|
657 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:405
|
658 |
msgid "Number of paragraphs after which to insert the snippet."
|
659 |
msgstr ""
|
660 |
|
661 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:406
|
662 |
msgid "Number of posts before which to insert the snippet."
|
663 |
msgstr ""
|
664 |
|
665 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:407
|
666 |
msgid "Number of posts after which to insert the snippet."
|
667 |
msgstr ""
|
668 |
|
669 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:428
|
670 |
msgid "Auto Insert"
|
671 |
msgstr ""
|
672 |
|
673 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:496
|
674 |
msgid "Please save the snippet first"
|
675 |
msgstr ""
|
676 |
|
677 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:565
|
|
|
|
|
|
|
|
|
|
|
678 |
msgid "Tag"
|
679 |
msgstr ""
|
680 |
|
681 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:566
|
682 |
#: includes/generator/class-wpcode-generator-hooks.php:1360
|
683 |
msgid "Priority"
|
684 |
msgstr ""
|
685 |
|
686 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:567
|
687 |
msgid "Note"
|
688 |
msgstr ""
|
689 |
|
690 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:570
|
691 |
msgid "Basic info"
|
692 |
msgstr ""
|
693 |
|
694 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:572
|
695 |
msgid "Tags: Use tags to make it easier to group similar snippets together. <br />Priority: A lower priority will result in the snippet being executed before others with a higher priority. <br />Note: Add a private note related to this snippet."
|
696 |
msgstr ""
|
697 |
|
698 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:584
|
699 |
msgid "Using conditional logic you can limit the pages where you want the snippet to be auto-inserted."
|
700 |
msgstr ""
|
701 |
|
702 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:588
|
703 |
msgid "Enable Logic"
|
704 |
msgstr ""
|
705 |
|
706 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:589
|
707 |
msgid "Conditions"
|
708 |
msgstr ""
|
709 |
|
710 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:594
|
711 |
msgid "Smart Conditional Logic"
|
712 |
msgstr ""
|
713 |
|
714 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:596
|
715 |
msgid "Enable logic to add rules and limit where your snippets are inserted automatically. Use multiple groups for different sets of rules."
|
716 |
msgstr ""
|
717 |
|
718 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:684
|
719 |
#: includes/admin/pages/class-wpcode-admin-page-tools.php:358
|
720 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:695
|
721 |
msgid "Active"
|
722 |
msgstr ""
|
723 |
|
724 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:687
|
725 |
#: includes/admin/pages/class-wpcode-admin-page-tools.php:359
|
726 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:698
|
727 |
msgid "Inactive"
|
728 |
msgstr ""
|
729 |
|
730 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:848
|
731 |
msgid "+ Add new group"
|
732 |
msgstr ""
|
733 |
|
734 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:865
|
735 |
msgid "Show"
|
736 |
msgstr ""
|
737 |
|
738 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:866
|
739 |
msgid "Hide"
|
740 |
msgstr ""
|
741 |
|
742 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:881
|
743 |
msgid "This code snippet if"
|
744 |
msgstr ""
|
745 |
|
746 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:964
|
747 |
msgctxt "Conditional logic add another \"and\" rules row."
|
748 |
msgid "AND"
|
749 |
msgstr ""
|
750 |
|
751 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1046
|
752 |
+
msgctxt "Conditional logic \"or\" another rule"
|
753 |
+
msgid "OR"
|
754 |
msgstr ""
|
755 |
|
756 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1066
|
757 |
+
msgid "Save to Library is a Pro Feature"
|
758 |
msgstr ""
|
759 |
|
760 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1067
|
761 |
+
msgid "Upgrade to PRO today and save your private snippets to the WPCode library for easy access. You can also share your snippets with other users or load them on other sites."
|
762 |
msgstr ""
|
763 |
|
764 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1068
|
765 |
+
msgid "Upgrade to PRO"
|
766 |
msgstr ""
|
767 |
|
768 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1069
|
769 |
+
msgid "Custom Shortcode is a Pro Feature"
|
770 |
+
msgstr ""
|
771 |
+
|
772 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1070
|
773 |
+
msgid "Upgrade today to use a custom shortcode and nerver worry about changing snippet ids again, even when importing your snippets to another site. You'll also get access to a private library that makes setting up new sites a lot easier."
|
774 |
+
msgstr ""
|
775 |
+
|
776 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1098
|
777 |
+
msgid "Custom Shortcode"
|
778 |
+
msgstr ""
|
779 |
+
|
780 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1101
|
781 |
+
msgid "Shortcode name"
|
782 |
+
msgstr ""
|
783 |
+
|
784 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1106
|
785 |
+
msgid "Use this field to define a custom shortcode name instead of the id-based one."
|
786 |
+
msgstr ""
|
787 |
+
|
788 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1137
|
789 |
+
msgid "Code Revisions"
|
790 |
+
msgstr ""
|
791 |
+
|
792 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1139
|
793 |
+
msgid "Easily switch back to a previous version of your snippet."
|
794 |
+
msgstr ""
|
795 |
+
|
796 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1217
|
797 |
+
msgid "Code Revisions is a Pro Feature"
|
798 |
+
msgstr ""
|
799 |
+
|
800 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1220
|
801 |
+
msgid "Upgrade to WPCode Pro today and start tracking revisions and see exactly who, when and which changes were made to your snippet."
|
802 |
+
msgstr ""
|
803 |
+
|
804 |
+
#: includes/admin/pages/class-wpcode-admin-page-snippet-manager.php:1223
|
805 |
+
msgid "Upgrade to Pro and Unlock Revisions"
|
806 |
msgstr ""
|
807 |
|
808 |
#: includes/admin/pages/class-wpcode-admin-page-tools.php:52
|
956 |
msgid "Importer"
|
957 |
msgstr ""
|
958 |
|
959 |
+
#: includes/admin/pages/class-wpcode-admin-page-tools.php:593
|
960 |
msgid "Please upload a valid .json snippets export file."
|
961 |
msgstr ""
|
962 |
|
963 |
+
#: includes/admin/pages/class-wpcode-admin-page-tools.php:594
|
964 |
+
#: includes/admin/pages/class-wpcode-admin-page-tools.php:607
|
965 |
msgid "Error"
|
966 |
msgstr ""
|
967 |
|
968 |
+
#: includes/admin/pages/class-wpcode-admin-page-tools.php:606
|
969 |
msgid "Snippets data cannot be imported."
|
970 |
msgstr ""
|
971 |
|
972 |
+
#: includes/admin/pages/class-wpcode-admin-page-tools.php:664
|
973 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:284
|
974 |
msgid "Edit"
|
975 |
msgstr ""
|
976 |
|
977 |
+
#: includes/admin/pages/class-wpcode-admin-page-tools.php:680
|
978 |
msgid "Testing"
|
979 |
msgstr ""
|
980 |
|
981 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:229
|
982 |
msgid "Search docs"
|
983 |
msgstr ""
|
984 |
|
985 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:233
|
986 |
#: includes/admin/pages/class-wpcode-code-snippets-table.php:598
|
987 |
msgid "Clear"
|
988 |
msgstr ""
|
989 |
|
990 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:240
|
991 |
msgid "No docs found"
|
992 |
msgstr ""
|
993 |
|
994 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:255
|
995 |
msgid "View Documentation"
|
996 |
msgstr ""
|
997 |
|
998 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:256
|
999 |
msgid "Browse documentation, reference material, and tutorials for WPCode."
|
1000 |
msgstr ""
|
1001 |
|
1002 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:257
|
1003 |
msgid "View All Documentation"
|
1004 |
msgstr ""
|
1005 |
|
1006 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:261
|
1007 |
msgid "Get Support"
|
1008 |
msgstr ""
|
1009 |
|
1010 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:262
|
1011 |
msgid "Submit a ticket and our world class support team will be in touch soon."
|
1012 |
msgstr ""
|
1013 |
|
1014 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:263
|
1015 |
msgid "Submit a Support Ticket"
|
1016 |
msgstr ""
|
1017 |
|
1018 |
#. Translators: Placeholder for the number of active notifications.
|
1019 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:275
|
1020 |
msgid "New Notifications (%s)"
|
1021 |
msgstr ""
|
1022 |
|
1023 |
#. Translators: Placeholder for the number of dismissed notifications.
|
1024 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:286
|
1025 |
msgid "Notifications (%s)"
|
1026 |
msgstr ""
|
1027 |
|
1028 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:293
|
1029 |
msgid "Dismissed Notifications"
|
1030 |
msgstr ""
|
1031 |
|
1032 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:296
|
1033 |
msgid "Active Notifications"
|
1034 |
msgstr ""
|
1035 |
|
1036 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:319
|
1037 |
msgid "Dismiss all"
|
1038 |
msgstr ""
|
1039 |
|
1040 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:361
|
1041 |
msgid "Dismiss"
|
1042 |
msgstr ""
|
1043 |
|
1044 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:419
|
1045 |
msgid "Help"
|
1046 |
msgstr ""
|
1047 |
|
1048 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:672
|
1049 |
msgid "Use snippet"
|
1050 |
msgstr ""
|
1051 |
|
1052 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:692
|
1053 |
msgid "Edit snippet"
|
1054 |
msgstr ""
|
1055 |
|
1056 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:693
|
1057 |
msgid "Used"
|
1058 |
msgstr ""
|
1059 |
|
1060 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:713
|
1061 |
msgid "Preview"
|
1062 |
msgstr ""
|
1063 |
|
1064 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:726
|
1065 |
+
msgid "Connect to library to unlock (Free)"
|
1066 |
+
msgstr ""
|
1067 |
+
|
1068 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:881
|
1069 |
msgid "We encountered a problem loading the Snippet Library items, please try again later."
|
1070 |
msgstr ""
|
1071 |
|
1072 |
+
#: includes/admin/pages/class-wpcode-admin-page.php:948
|
1073 |
msgid "Preview Snippet"
|
1074 |
msgstr ""
|
1075 |
|
1264 |
msgid "Query"
|
1265 |
msgstr ""
|
1266 |
|
1267 |
+
#: includes/class-wpcode-install.php:107
|
1268 |
msgid "Display a message after the 1st paragraph of posts"
|
1269 |
msgstr ""
|
1270 |
|
1271 |
+
#: includes/class-wpcode-install.php:119
|
1272 |
msgid "Completely Disable Comments"
|
1273 |
msgstr ""
|
1274 |
|
1275 |
+
#: includes/class-wpcode-library-auth.php:114
|
1276 |
+
msgid "Authentication successfully completed"
|
1277 |
+
msgstr ""
|
1278 |
+
|
1279 |
+
#: includes/class-wpcode-library-auth.php:115
|
1280 |
+
msgid "Reloading page, please wait."
|
1281 |
+
msgstr ""
|
1282 |
+
|
1283 |
+
#: includes/class-wpcode-snippet-execute.php:78
|
1284 |
msgid "HTML Snippet"
|
1285 |
msgstr ""
|
1286 |
|
1287 |
+
#: includes/class-wpcode-snippet-execute.php:83
|
1288 |
msgid "Text Snippet"
|
1289 |
msgstr ""
|
1290 |
|
1291 |
+
#: includes/class-wpcode-snippet-execute.php:87
|
1292 |
msgid "JavaScript Snippet"
|
1293 |
msgstr ""
|
1294 |
|
1295 |
+
#: includes/class-wpcode-snippet-execute.php:91
|
1296 |
msgid "PHP Snippet"
|
1297 |
msgstr ""
|
1298 |
|
1299 |
+
#: includes/class-wpcode-snippet-execute.php:95
|
1300 |
msgid "Universal Snippet"
|
1301 |
msgstr ""
|
1302 |
|
1303 |
+
#: includes/class-wpcode-snippet-execute.php:99
|
1304 |
+
msgid "CSS Snippet"
|
1305 |
+
msgstr ""
|
1306 |
+
|
1307 |
+
#: includes/class-wpcode-snippet-execute.php:363
|
1308 |
msgid "Snippet has not been activated due to an error."
|
1309 |
msgstr ""
|
1310 |
|
1311 |
+
#: includes/class-wpcode-snippet-execute.php:367
|
1312 |
msgid "Please click the back button in the browser to update the snippet."
|
1313 |
msgstr ""
|
1314 |
|
1315 |
+
#: includes/class-wpcode-snippet-execute.php:370
|
1316 |
msgid "WPCode has detected an error in one of the snippets which has now been automatically deactivated."
|
1317 |
msgstr ""
|
1318 |
|
1319 |
#. Translators: the placeholders add a link to edit the snippet that threw the error.
|
1320 |
+
#: includes/class-wpcode-snippet-execute.php:382
|
1321 |
msgid "%1$sClick here%2$s to update the snippet that threw the error."
|
1322 |
msgstr ""
|
1323 |
|
1324 |
+
#: includes/class-wpcode-snippet-execute.php:385
|
1325 |
msgid "Error message:"
|
1326 |
msgstr ""
|
1327 |
|
1328 |
+
#: includes/class-wpcode-snippet.php:411
|
1329 |
msgid "You are not allowed to change snippet status, please contact your webmaster."
|
1330 |
msgstr ""
|
1331 |
|
1332 |
+
#: includes/class-wpcode-snippet.php:595
|
1333 |
msgid "Untitled Snippet"
|
1334 |
msgstr ""
|
1335 |
|
3709 |
msgid "Add field"
|
3710 |
msgstr ""
|
3711 |
|
3712 |
+
#: includes/helpers.php:151
|
3713 |
+
msgctxt "Copy to clipboard"
|
3714 |
+
msgid "Copy"
|
3715 |
+
msgstr ""
|
3716 |
+
|
3717 |
+
#: includes/helpers.php:165
|
3718 |
+
msgid "Is"
|
3719 |
+
msgstr ""
|
3720 |
+
|
3721 |
+
#: includes/helpers.php:166
|
3722 |
+
msgid "Is not"
|
3723 |
+
msgstr ""
|
3724 |
+
|
3725 |
+
#: includes/helpers.php:167
|
3726 |
+
msgid "Contains"
|
3727 |
+
msgstr ""
|
3728 |
+
|
3729 |
+
#: includes/helpers.php:168
|
3730 |
+
msgid "Doesn't Contain"
|
3731 |
+
msgstr ""
|
3732 |
+
|
3733 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:139
|
3734 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:282
|
3735 |
+
msgid "Page Scripts is a Pro Feature"
|
3736 |
+
msgstr ""
|
3737 |
+
|
3738 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:142
|
3739 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:285
|
3740 |
+
msgid "Upgrade to WPCode Pro and easily add page-specific scripts and snippets directly from the post edit screen."
|
3741 |
+
msgstr ""
|
3742 |
+
|
3743 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:145
|
3744 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:288
|
3745 |
+
msgid "Upgrade to Pro and Unlock Page Scripts"
|
3746 |
+
msgstr ""
|
3747 |
+
|
3748 |
+
#. Translators: placeholder for the name of the section (header or footer).
|
3749 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:170
|
3750 |
+
msgid "Add scripts below to the %s section of this page."
|
3751 |
+
msgstr ""
|
3752 |
+
|
3753 |
+
#. Translators: placeholder for the name of the section (header or footer).
|
3754 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:181
|
3755 |
+
msgid "Disable global %s scripts on this page"
|
3756 |
+
msgstr ""
|
3757 |
+
|
3758 |
+
#. Translators: placeholder for the name of the section (header or footer).
|
3759 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:192
|
3760 |
+
msgid "%s - any device type"
|
3761 |
+
msgstr ""
|
3762 |
+
|
3763 |
+
#: includes/lite/admin/class-wpcode-metabox-snippets-lite.php:201
|
3764 |
+
msgid "Show Smart Tags"
|
3765 |
+
msgstr ""
|
3766 |
+
|
3767 |
+
#: includes/lite/admin/notices.php:27
|
3768 |
+
msgid "%1$sConnect to the WPCode Library%2$s for to get access to %3$smore FREE snippets%4$s!"
|
3769 |
+
msgstr ""
|
3770 |
+
|
3771 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:33
|
3772 |
+
msgid "Before the Purchase Button"
|
3773 |
+
msgstr ""
|
3774 |
+
|
3775 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:34
|
3776 |
+
msgid "After the Purchase Button"
|
3777 |
+
msgstr ""
|
3778 |
+
|
3779 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:35
|
3780 |
+
msgid "Before the Single Download"
|
3781 |
+
msgstr ""
|
3782 |
+
|
3783 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:36
|
3784 |
+
msgid "After the Single Download"
|
3785 |
+
msgstr ""
|
3786 |
+
|
3787 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:37
|
3788 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:40
|
3789 |
+
msgid "Before the Cart"
|
3790 |
+
msgstr ""
|
3791 |
+
|
3792 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:38
|
3793 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:41
|
3794 |
+
msgid "After the Cart"
|
3795 |
+
msgstr ""
|
3796 |
+
|
3797 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:39
|
3798 |
+
msgid "Before the Checkout Cart"
|
3799 |
+
msgstr ""
|
3800 |
+
|
3801 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:40
|
3802 |
+
msgid "After the Checkout Cart"
|
3803 |
+
msgstr ""
|
3804 |
+
|
3805 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:41
|
3806 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:42
|
3807 |
+
msgid "Before the Checkout Form"
|
3808 |
+
msgstr ""
|
3809 |
+
|
3810 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:42
|
3811 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:43
|
3812 |
+
msgid "After the Checkout Form"
|
3813 |
+
msgstr ""
|
3814 |
+
|
3815 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:44
|
3816 |
+
msgid "Easy Digital Downloads Locations are a PRO feature"
|
3817 |
+
msgstr ""
|
3818 |
+
|
3819 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-edd.php:45
|
3820 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:49
|
3821 |
+
msgid "Upgrade to PRO today and get access to advanced eCommerce auto-insert locations and conditional logic rules for your needs."
|
3822 |
+
msgstr ""
|
3823 |
+
|
3824 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:34
|
3825 |
+
msgid "Before the List of Products"
|
3826 |
+
msgstr ""
|
3827 |
+
|
3828 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:35
|
3829 |
+
msgid "After the List of Products"
|
3830 |
+
msgstr ""
|
3831 |
+
|
3832 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:36
|
3833 |
+
msgid "Before the Single Product"
|
3834 |
+
msgstr ""
|
3835 |
+
|
3836 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:37
|
3837 |
+
msgid "After the Single Product"
|
3838 |
+
msgstr ""
|
3839 |
+
|
3840 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:38
|
3841 |
+
msgid "Before the Single Product Summary"
|
3842 |
+
msgstr ""
|
3843 |
+
|
3844 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:39
|
3845 |
+
msgid "After the Single Product Summary"
|
3846 |
+
msgstr ""
|
3847 |
+
|
3848 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:44
|
3849 |
+
msgid "Before Checkout Payment Methods"
|
3850 |
+
msgstr ""
|
3851 |
+
|
3852 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:45
|
3853 |
+
msgid "After Checkout Payment Button"
|
3854 |
+
msgstr ""
|
3855 |
+
|
3856 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:46
|
3857 |
+
msgid "Before the Thank You Page Content"
|
3858 |
+
msgstr ""
|
3859 |
+
|
3860 |
+
#: includes/lite/auto-insert/class-wpcode-auto-insert-woocommerce.php:48
|
3861 |
+
msgid "WooCommerce Locations are a PRO feature"
|
3862 |
+
msgstr ""
|
3863 |
+
|
3864 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-edd.php:37
|
3865 |
+
msgid "EDD Page"
|
3866 |
+
msgstr ""
|
3867 |
+
|
3868 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-edd.php:40
|
3869 |
+
msgid "Easy Digital Downloads Page Rules is a Pro Feature"
|
3870 |
+
msgstr ""
|
3871 |
+
|
3872 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-edd.php:41
|
3873 |
+
msgid "Get access to advanced conditional logic rules for Easy Digital Downloads by upgrading to PRO today."
|
3874 |
+
msgstr ""
|
3875 |
+
|
3876 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-edd.php:46
|
3877 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:46
|
3878 |
+
msgid "Checkout Page"
|
3879 |
+
msgstr ""
|
3880 |
+
|
3881 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-edd.php:51
|
3882 |
+
msgid "Success Page"
|
3883 |
+
msgstr ""
|
3884 |
+
|
3885 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-edd.php:56
|
3886 |
+
msgid "Single Download Page"
|
3887 |
+
msgstr ""
|
3888 |
+
|
3889 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-edd.php:61
|
3890 |
+
msgid "Download Category Page"
|
3891 |
+
msgstr ""
|
3892 |
+
|
3893 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-edd.php:66
|
3894 |
+
msgid "Download Tag Page"
|
3895 |
+
msgstr ""
|
3896 |
+
|
3897 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:37
|
3898 |
+
msgid "WooCommerce Page"
|
3899 |
+
msgstr ""
|
3900 |
+
|
3901 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:40
|
3902 |
+
msgid "WooCommerce Page Rules is a Pro Feature"
|
3903 |
+
msgstr ""
|
3904 |
+
|
3905 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:41
|
3906 |
+
msgid "Get access to advanced conditional logic rules for WooCommerce by upgrading to PRO today."
|
3907 |
+
msgstr ""
|
3908 |
+
|
3909 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:51
|
3910 |
+
msgid "Thank You Page"
|
3911 |
+
msgstr ""
|
3912 |
+
|
3913 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:56
|
3914 |
+
msgid "Cart Page"
|
3915 |
+
msgstr ""
|
3916 |
+
|
3917 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:61
|
3918 |
+
msgid "Single Product Page"
|
3919 |
+
msgstr ""
|
3920 |
+
|
3921 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:66
|
3922 |
+
msgid "Shop Page"
|
3923 |
+
msgstr ""
|
3924 |
+
|
3925 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:71
|
3926 |
+
msgid "Product Category Page"
|
3927 |
+
msgstr ""
|
3928 |
+
|
3929 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:76
|
3930 |
+
msgid "Product Tag Page"
|
3931 |
+
msgstr ""
|
3932 |
+
|
3933 |
+
#: includes/lite/conditional-logic/class-wpcode-conditional-woocommerce.php:81
|
3934 |
+
msgid "My Account Page"
|
3935 |
+
msgstr ""
|
3936 |
+
|
3937 |
#: includes/safe-mode.php:70
|
3938 |
msgid "WPCode is in Safe Mode which means no snippets are getting executed. Please disable any snippets that have caused errors and when done click the button below to exit safe mode."
|
3939 |
msgstr ""
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: code, css, php, footer, functions, content, facebook pixel, footer code, f
|
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 6.1
|
6 |
Requires PHP: 5.5
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -28,6 +28,13 @@ We took the pain out of adding custom code snippets in WordPress and made it eas
|
|
28 |
> I have been using Insert Headers and Footers and it is such a useful tool. Super helpful and the very best of its kind. Highly recommend
|
29 |
> The_Gibble - WordPress user
|
30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
= Future Proof Code Snippet Management =
|
32 |
|
33 |
Most <a href="https://www.wpbeginner.com/category/wp-tutorials/">WordPress tutorial websites</a> ask you to add code snippets to your theme's functions.php file. This makes managing code snippets messy, and it also prevents you from updating your theme.
|
@@ -40,6 +47,8 @@ Our smart code snippet validation helps you prevent common code errors to ensure
|
|
40 |
|
41 |
You can manage all your header and footer scripts as well as other custom code snippets from a single screen. We even make it easy for you to organize code snippets using Tags and add reminder notes with each code snippet.
|
42 |
|
|
|
|
|
43 |
> This plugin allows me to not only add things to my site whenever needed, but it takes me only seconds to accomplish it.
|
44 |
> David Weber - WordPress user
|
45 |
|
@@ -56,6 +65,10 @@ You will find verified PHP code snippets for popular feature requests like disab
|
|
56 |
> I was very hesitant to get into any of the code for my website. Your plugin made it easy for me to do.
|
57 |
> Conbrio75 - WordPress user
|
58 |
|
|
|
|
|
|
|
|
|
59 |
Aside from our growing code snippets library, we also have WordPress code generators to help you quickly get ready-to-use custom code using the latest WordPress coding standards and API's.
|
60 |
|
61 |
Examples of Custom Code Generators with Admin UI include:
|
@@ -96,18 +109,23 @@ Our Auto Insert feature allows you to run the code snippet everywhere or choose
|
|
96 |
* Insert PHP code snippet before or after post content
|
97 |
* Insert code snippet before or after specific paragraph
|
98 |
* Insert code snippet on specific archive pages
|
|
|
99 |
|
100 |
Aside from that, we also added a visual code snippet priority system, so you can choose the order for your custom functions to avoid code conflict.
|
101 |
|
102 |
> This is such a useful plugin! It makes it so much easier to include things on your website!
|
103 |
> Understoryliving - WordPress user
|
104 |
|
|
|
|
|
105 |
= Import and Export Code Snippets =
|
106 |
|
107 |
Managing multiple websites or developing in a staging environment?
|
108 |
|
109 |
We offer an easy way to import and export your custom code snippets, functions, and header and footer scripts to help you save time.
|
110 |
|
|
|
|
|
111 |
Switching from another code snippets plugin?
|
112 |
|
113 |
We have an automatic import feature that imports your custom code snippets from both Woody Code Snippets and Code Snippets Pro plugin.
|
@@ -157,6 +175,9 @@ Below is a full list of WPCode features:
|
|
157 |
* Manually insert PHP code snippets using shortcodes anywhere on website
|
158 |
* Add Rich Text Ads and Content Snippets automatically on posts & pages.
|
159 |
* Export / Import Code Snippets
|
|
|
|
|
|
|
160 |
* and more features coming soon.
|
161 |
|
162 |
= Credits =
|
@@ -216,6 +237,8 @@ Visit <a href="https://www.wpbeginner.com/" rel="friend" title="WPBeginner">WPBe
|
|
216 |
6. Example of Custom Post Type Generator
|
217 |
7. Insert Header and Footer Scripts Globally
|
218 |
8. Import and Export Code Snippets
|
|
|
|
|
219 |
|
220 |
== Frequently Asked Questions ==
|
221 |
|
@@ -241,7 +264,7 @@ Yes, if you don't want the advanced code snippets functionality, then you can sw
|
|
241 |
|
242 |
With WPCode, you can add any type of code snippet that you would otherwise add in your theme's functions.php file or in a site-specific plugin.
|
243 |
|
244 |
-
This includes custom PHP snippets, JavaScript snippets, HTML snippet, Text Snippets, Conversion pixels, Tracking scripts, AdSense or other banner ads code, and more.
|
245 |
|
246 |
= What are some example plugins WPCode can replace? =
|
247 |
|
@@ -285,6 +308,12 @@ Syed Balkhi
|
|
285 |
|
286 |
== Changelog ==
|
287 |
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
= 2.0.3 =
|
289 |
* Tweak: Adjusted the hook used to load "Run Everywhere" PHP snippets to "plugins_loaded" to allow running snippets on earlier hooks.
|
290 |
* Fix: Adjusted the link in the plugins list to point to the correct admin page in headers & footers mode.
|
4 |
Requires at least: 4.6
|
5 |
Tested up to: 6.1
|
6 |
Requires PHP: 5.5
|
7 |
+
Stable tag: 2.0.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
28 |
> I have been using Insert Headers and Footers and it is such a useful tool. Super helpful and the very best of its kind. Highly recommend
|
29 |
> The_Gibble - WordPress user
|
30 |
|
31 |
+
= Quick Overview of WPCode from WPBeginner =
|
32 |
+
|
33 |
+
https://www.youtube.com/watch?v=Fo-7MKRRUec
|
34 |
+
|
35 |
+
> <strong>Introducing New WPCode Pro</strong><br />
|
36 |
+
> While WPCode Lite offers tons of powerful features for free, we listened to user feedback and created WPCode Pro with even more amazing features to improve your workflow. This includes smart conditional logic, saving code snippets to cloud library, code revisions, page-specific snippets, deeper integration with popular plugins like WooCommerce, Easy Digital Downloads, and so much more. <a href="https://wpcode.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteplugin" rel="friend" title="WPCode">Click here to purchase the best premium WordPress code snippet plugin now!</a>
|
37 |
+
|
38 |
= Future Proof Code Snippet Management =
|
39 |
|
40 |
Most <a href="https://www.wpbeginner.com/category/wp-tutorials/">WordPress tutorial websites</a> ask you to add code snippets to your theme's functions.php file. This makes managing code snippets messy, and it also prevents you from updating your theme.
|
47 |
|
48 |
You can manage all your header and footer scripts as well as other custom code snippets from a single screen. We even make it easy for you to organize code snippets using Tags and add reminder notes with each code snippet.
|
49 |
|
50 |
+
<strong>New WPCode Cloud Library</strong> even allows you to store all your custom code snippets in a cloud library, so you can easily re-use code snippets across multiple website projects and save time. You can keep your code snippets completely private or <a href="https://library.wpcode.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteplugin" rel="friend" title="WPCode">share it with the community</a> to give back while boosting your social profile.
|
51 |
+
|
52 |
> This plugin allows me to not only add things to my site whenever needed, but it takes me only seconds to accomplish it.
|
53 |
> David Weber - WordPress user
|
54 |
|
65 |
> I was very hesitant to get into any of the code for my website. Your plugin made it easy for me to do.
|
66 |
> Conbrio75 - WordPress user
|
67 |
|
68 |
+
We also built the ability to save your code snippets to <a href="https://library.wpcode.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteplugin" rel="friend" title="WPCode">WPCode Cloud Library</a>, so you can easily re-use it on your other websites, client projects, or even share it with the larger community.
|
69 |
+
|
70 |
+
WPCode Cloud Library helps you better organize your code snippets in one central location, so you can save more time and speed up your workflow when managing websites. No more wasting time looking for custom notes or Github gists.
|
71 |
+
|
72 |
Aside from our growing code snippets library, we also have WordPress code generators to help you quickly get ready-to-use custom code using the latest WordPress coding standards and API's.
|
73 |
|
74 |
Examples of Custom Code Generators with Admin UI include:
|
109 |
* Insert PHP code snippet before or after post content
|
110 |
* Insert code snippet before or after specific paragraph
|
111 |
* Insert code snippet on specific archive pages
|
112 |
+
* Insert code snippets after specific WooCommerce function (<a href="https://wpcode.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteplugin" rel="friend" title="WPCode">Pro Feature</a>)
|
113 |
|
114 |
Aside from that, we also added a visual code snippet priority system, so you can choose the order for your custom functions to avoid code conflict.
|
115 |
|
116 |
> This is such a useful plugin! It makes it so much easier to include things on your website!
|
117 |
> Understoryliving - WordPress user
|
118 |
|
119 |
+
And for even more flexibility and customization, we have added the ability for you to add page-specific code snippets right from the WordPress classic editor as well as the Gutenberg editor. You can even load code snippets based on device type such as mobile only code snippets, desktop only code snippets, etc.
|
120 |
+
|
121 |
= Import and Export Code Snippets =
|
122 |
|
123 |
Managing multiple websites or developing in a staging environment?
|
124 |
|
125 |
We offer an easy way to import and export your custom code snippets, functions, and header and footer scripts to help you save time.
|
126 |
|
127 |
+
You can also save your code snippets to WPCode Cloud (Pro feature), so you can easily re-use the same code snippets across multiple websites. This also allows you to better organize your code snippets instead of wasting time searching for random Github gists.
|
128 |
+
|
129 |
Switching from another code snippets plugin?
|
130 |
|
131 |
We have an automatic import feature that imports your custom code snippets from both Woody Code Snippets and Code Snippets Pro plugin.
|
175 |
* Manually insert PHP code snippets using shortcodes anywhere on website
|
176 |
* Add Rich Text Ads and Content Snippets automatically on posts & pages.
|
177 |
* Export / Import Code Snippets
|
178 |
+
* <strong>New</strong> Save snippets to Cloud Library - no more wasting time finding Github gists or custom notes. All your snippets stored in your private code snippet cloud.
|
179 |
+
* <strong>New</strong> Deep integrations with Gutenberg, WooCommerce, and more.
|
180 |
+
* Device specific code snippets (such as load code snippets on mobile only, desktop only, etc)
|
181 |
* and more features coming soon.
|
182 |
|
183 |
= Credits =
|
237 |
6. Example of Custom Post Type Generator
|
238 |
7. Insert Header and Footer Scripts Globally
|
239 |
8. Import and Export Code Snippets
|
240 |
+
9. Private Snippets Library In Plugin
|
241 |
+
10. Page-Specific Scripts Metabox
|
242 |
|
243 |
== Frequently Asked Questions ==
|
244 |
|
264 |
|
265 |
With WPCode, you can add any type of code snippet that you would otherwise add in your theme's functions.php file or in a site-specific plugin.
|
266 |
|
267 |
+
This includes custom PHP snippets, JavaScript snippets, HTML snippet, CSS snippets, Text Snippets, Conversion pixels, Tracking scripts, AdSense or other banner ads code, and more.
|
268 |
|
269 |
= What are some example plugins WPCode can replace? =
|
270 |
|
308 |
|
309 |
== Changelog ==
|
310 |
|
311 |
+
= 2.0.4 =
|
312 |
+
* New: We added more free snippets to the snippet library, simply connect your website to the WPCode Library and load them directly from the WPCode plugin.
|
313 |
+
* New: We added a new code type for CSS Styles that many of you requested, so now it's even easier to add custom styles to your site with all the powerful WPCode features.
|
314 |
+
* Tweak: We added an extra check to make sure when you copy-paste a PHP snippet it's easier to use by removing the opening tag, if present.
|
315 |
+
* Fix: We fixed a bug where in certain scenarios a snippet's code would get changed when changing its status from the list of snippets.
|
316 |
+
|
317 |
= 2.0.3 =
|
318 |
* Tweak: Adjusted the hook used to load "Run Everywhere" PHP snippets to "plugins_loaded" to allow running snippets on earlier hooks.
|
319 |
* Fix: Adjusted the link in the plugins list to point to the correct admin page in headers & footers mode.
|
uninstall.php
CHANGED
@@ -13,6 +13,11 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
|
13 |
exit;
|
14 |
}
|
15 |
|
|
|
|
|
|
|
|
|
|
|
16 |
require_once 'ihaf.php';
|
17 |
|
18 |
if ( class_exists( 'WPCode_Capabilities' ) ) {
|
13 |
exit;
|
14 |
}
|
15 |
|
16 |
+
// If the function already exists we shouldn't run the uninstall as another version of the plugin is active.
|
17 |
+
if ( function_exists( 'WPCode' ) ) {
|
18 |
+
return;
|
19 |
+
}
|
20 |
+
|
21 |
require_once 'ihaf.php';
|
22 |
|
23 |
if ( class_exists( 'WPCode_Capabilities' ) ) {
|