Starter Templates by Kadence WP - Version 1.1.1

Version Description

  • Add: Single Page Import.
  • Add: FontPair Selection.
  • Add: Elementor Templates.
Download this release

Release Info

Developer britner
Plugin Icon 128x128 Starter Templates by Kadence WP
Version 1.1.1
Comparing to
See all releases

Code changes from version 1.0.4 to 1.1.1

assets/css/starter-templates.css CHANGED
@@ -1 +1 @@
1
- .appearance_page_kadence-starter-templates #wpcontent{padding:0}.kadence_theme_dash_head{background:#fff;padding:10px 20px;height:50px}.kadence_theme_dash_head h1{color:#2d3748;line-height:50px;padding:0;height:50px;margin:0;display:flex;align-items:center}.kadence_theme_dash_head .subtext{font-size:16px;color:#718096;display:inline-block;padding-left:10px}.kadence_theme_dash_head .kadence_theme_dash_head_container{margin:0 auto;display:flex;align-items:center}.kadence_theme_dash_head .kadence_theme_dash_logo{width:50px;height:50px;padding-right:10px}.kadence_theme_dash_head .kadence_theme_dash_logo img{width:50px}.kadence_theme_dash_head .kadence_theme_dash_version{flex-grow:1;text-align:right}.kadence_theme_dash_head .kadence_theme_dash_version span{padding:5px;background:#4a5568;color:#fff}.wrap.kadence_theme_dash{margin:20px 20px 0}.kadence_theme_dashboard{margin:0 auto}.templates-grid{display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);grid-gap:2em}.kst-template-item .components-button.kst-import-btn{height:100%;width:100%;padding:0;display:block;border:0;background:transparent;position:absolute;box-shadow:0 0px 0px 0 rgba(0,0,0,0)}.kst-template-item .components-button.kst-import-btn img{max-width:100%;height:auto}.kst-grid-single-item{max-width:800px}.kst-grid-single-item .kst-template-item{overflow:hidden}.kst-grid-single-item .kst-import-btn{height:100%;width:100%;padding:0;display:block;border:0;background:transparent;position:absolute;box-shadow:0 0px 0px 0 rgba(0,0,0,0)}.kst-grid-single-item .kst-import-btn img{max-width:100%;height:auto}.kadence_starter_templates_notice{background:#ebf8ff;margin-bottom:20px;border:1px solid #4299e1;padding:10px;color:#2b6cb0;font-weight:bold}.kst-import-modal ul.kadence-required-wrap{margin-bottom:20px}.components-modal__frame.kst-import-modal{-webkit-animation:none !important;animation:none !important}.kst-import-modal h3{font-size:16px}.kadence_starter_templates_response{background:#fffaf0;margin-bottom:20px;border:1px solid #ed8936;padding:10px;color:#c05621;font-weight:bold}.kst-template-item{position:relative;height:0;padding-bottom:65%;overflow:hidden}.sidebar-section .components-panel__body.is-opened{padding:20px}.sidebar-section h2:first-child,.tab-section h2:first-child{margin-top:0}.side-panel .components-panel+.components-panel{margin-top:1rem}.tab-section .components-panel__body.is-opened{padding:25px}.kadence-dashboard-tab-panel .components-tab-panel__tabs .components-button{border:1px solid transparent;background:transparent;border:none;box-shadow:none;border-radius:0;cursor:pointer;height:48px;padding:3px 16px;margin-left:0;font-weight:500}.kadence-dashboard-tab-panel .components-tab-panel__tabs .components-button:hover{box-shadow:none !important}.kadence-dashboard-tab-panel .components-tab-panel__tabs .components-button:not(.active-tab):hover{color:#007cba !important;background:transparent !important}.kadence-dashboard-tab-panel .components-tab-panel__tabs .components-button.active-tab{background:#fff;border:1px solid #e2e4e7;border-bottom-color:transparent}.kadence-dashboard-tab-panel .components-tab-panel__tabs{margin-bottom:-1px}.two-col-grid{display:grid;grid-gap:1rem;grid-template-columns:1fr 1fr 1fr}h3.section-sub-head{background:#edf2f7;padding:10px;color:#4a5568;font-size:14px;text-transform:uppercase;margin-bottom:1rem;margin-top:2rem}.link-item{border:1px solid #e2e8f0;padding:20px;border-radius:4px;display:flex;flex-flow:column nowrap}.link-item h4{margin:0}.dashboard-pro-settings{margin-top:2rem}.link-item .link-item-foot{margin-top:auto;display:flex;align-items:center}.link-item .link-item-foot .components-spinner{margin-top:0}.link-item .link-item-foot .components-toggle-control .components-base-control__field{margin-bottom:0}.link-item .link-item-foot .components-toggle-control .components-base-control__field .components-form-toggle{margin-right:0}.link-item .link-item-foot>*:first-child{flex-grow:2}.link-item a{display:block;background:transparent;color:#4a5568}.link-item a:hover{color:#007cba}span.kt-license-status{padding:4px;margin-left:10px;font-size:14px;text-transform:uppercase}span.kt-license-status.k-inactive{color:#c05621 !important;background:#fffaf0 !important}span.kt-license-status.k-active{color:#2b6cb0 !important;background:#ebf8ff !important}.license-section h2{display:flex;margin-top:0;align-items:center;justify-content:space-between}.license-section table.form-table{display:block}.license-section table.form-table tbody{display:block}.license-section table.form-table td,.license-section table.form-table tr{display:block;padding:0;width:100%}.license-section .form-table th{padding:0;width:100%;margin-bottom:4px;display:block;color:#4a5568}.license-section p.submit{padding:0;margin-top:10px}.license-section table.form-table input[type=text]{width:100%}.kadence-starter-templates-preview .install-theme-info .theme-name{font-size:20px}.appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions .button{width:100%;line-height:1;min-height:35px}.appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions{padding:5px}.kadence-starter-templates-preview button.components-button.kst-palette-btn{border-radius:4px !important;padding:5px 5px 5px 7px;height:auto;display:inline-flex;align-items:flex-end;justify-content:center;border:1px solid transparent;box-shadow:none !important}.kst-template-item .components-button.kst-import-btn:hover,.kst-template-item .components-button.kst-import-btn:focus{box-shadow:0 7px 15px 0 rgba(0,0,0,.15) !important}.kadence-starter-templates-preview button.components-button.kst-palette-btn:hover,.kadence-starter-templates-preview button.components-button.kst-palette-btn:focus{border:1px solid #444;box-shadow:none !important}.kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary,.kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary:hover,.kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary:focus{background:#eee;border:1px solid #aaa;box-shadow:none}.demo-title{height:30px;margin:0;padding:10px 0;box-shadow:inset 0 1px 0 rgba(0,0,0,.1);background:rgba(255,255,255,.95);position:absolute;bottom:0;left:0;width:100%}.demo-title h4{margin:0;font-size:18px;text-align:left;line-height:30px;padding:0 20px;color:#1e1e1e}.kadence-starter-templates-preview .components-button-group.kst-palette-group{display:grid;grid-template-columns:1fr 1fr;grid-gap:5px}.palette-title-wrap{display:flex;align-items:center;justify-content:space-between}@media(max-width: 1860px){.kadence-starter-templates-preview .kadence-swatche-item-wrap{width:22px !important;height:22px !important}h2.palette-title{font-size:15px}}@media(max-width: 1460px){.templates-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr)}}.kadence-starter-required-plugins{padding:10px 20px 10px}p.install-third-party-notice{max-width:540px;background:#fffaf0;padding:1em;color:#c05621;border:1px solid #c05621;font-weight:600}.plugin-install-required{display:block;font-style:oblique;font-weight:400;color:#c05621}.kadence-required-wrap{font-weight:bold;list-style:disc;padding-left:1.4em}span.plugin-status{text-transform:uppercase;color:#777}.kst-palette-btn.kst-selected-color-palette{display:flex;margin-bottom:20px}.finshed-notice-success .button-primary.button.kadence-starter-templates-finish-button{padding:10px 16px;font-size:18px}
1
+ .appearance_page_kadence-starter-templates #wpcontent{padding:0}.kadence_theme_dash_back{height:100%}.appearance_page_kadence-starter-templates .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content{bottom:70px}.kadence_theme_dash_back .components-button.kt-import-back{border-left:1px solid #e2e8f0;border-right:1px solid #e2e8f0;height:100%;width:40px;color:#4a5568;border-radius:0}.kst-import-options-title{line-height:20px;padding-top:5px;font-size:12px;text-transform:uppercase;text-align:center;margin:0;color:#4a5568}.appearance_page_kadence-starter-templates .expanded .wp-full-overlay-footer{height:70px}.kadence_theme_dash_back .components-button.kt-import-back:hover{border-left:1px solid #cbd5e0;border-right:1px solid #cbd5e0;background:#f6f9fd}.kadence_theme_dash_back .components-button.kt-import-back svg{width:30px;height:30px;margin:0}.kadence_theme_dash_head .kadence_starter_builder_type .components-button svg.kst-chev{width:16px}.components-modal__frame.kst-import-modal{min-width:460px}.kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(12),.kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(11){padding-top:20px}.kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(12) .kst-palette-bg:before,.kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(11) .kst-palette-bg:before{content:"dark";color:#111}.kst-import-selection-options{padding-bottom:90px}.kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(12) .kst-palette-bg,.kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(11) .kst-palette-bg{position:absolute;left:2px;top:-1px;right:2px;display:block;bottom:auto;opacity:.2;height:1px;border-radius:0}.components-modal__frame.kst-import-modal .components-button.is-primary{padding-left:30px;padding-top:16px;padding-right:30px;font-weight:700;padding-bottom:16px;font-size:16px;height:auto}.kst-selected-font-pair{display:flex;align-items:center;margin-bottom:20px}.kst-selected-font-pair img{max-width:50px}h3.kst-selected-font-pair-title{margin-bottom:0}.kadence-starter-templates-preview .install-theme-info p.desc-small,.kadence-starter-templates-preview .kadence-starter-required-plugins p.desc-small{color:#4a5568;font-style:italic}.kadence-starter-templates-preview .install-theme-info .theme-screenshot{width:60px;margin:15px 15px 15px 0}.kadence-starter-templates-preview .theme-info-wrap{display:flex;align-items:center}.kadence-starter-templates-preview .install-theme-info{padding-bottom:0}.kst-choose-builder-wrap{min-height:calc( 100vh - 180px );max-width:400px;margin:0 auto;display:flex;align-items:center}.kadence_starter_builder_type .components-dropdown__content .components-button.components-menu-item__button{box-shadow:none !important}.kadence_starter_builder_type .components-dropdown__content .components-button.components-menu-item__button.active-item{border:1px solid #a0aec0}.kst-choose-builder-center{width:100%;background:#fff;padding:30px;border-radius:4px;box-shadow:0px 25px 35px -10px rgba(0,0,0,.05);position:relative}.kst-choose-builder-center .kst-overlay-saving{position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;background:rgba(255,255,255,.6);border-radius:4px}.kst-choose-builder-inner{display:grid;grid-template-columns:1fr 1fr;grid-gap:30px}.kst-choose-builder-center h2.kst-choose-builder-title{margin-top:0;text-align:center;text-transform:uppercase;font-weight:300;margin-bottom:30px;font-size:20px;color:#718096}.kst-choose-builder-center .kst-choose-builder-inner .components-button.kt-import-select-type{font-size:20px;text-align:center;height:auto;padding:20px;display:flex;border:1px solid #cbd5e0;border-radius:4px;flex-direction:column;font-weight:500;text-transform:uppercase;color:#4a5568}.kst-choose-builder-center .kst-choose-builder-inner .components-button.kt-import-select-type svg{width:100px;height:100px;margin-bottom:10px;margin-right:0}.kst-choose-builder-center .kst-choose-builder-inner .components-button.kt-import-select-type:hover{color:#2d3748;border-color:#007cba}.components-button-group.kst-font-group{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;grid-gap:1em}.components-button-group.kst-font-group .components-button.kst-font-btn{display:block;height:auto;padding:5px 5px 0;border:1px solid #eee;border-radius:0;background:#fff;outline:0;box-shadow:none}.components-button-group.kst-font-group .components-button.kst-font-btn img.font-pairing{max-width:100%}.font-title-wrap,.palette-title-wrap{display:flex;align-items:center;justify-content:space-between}.font-title-wrap h2,.palette-title-wrap h2{font-size:16px;font-weight:600;color:#4a5568}.kadence-starter-required-plugins{padding:10px 20px 10px}.font-title-wrap,.kadence-starter-required-plugins{border-top:1px solid #e2e8f0;padding-top:6px;margin-top:18px}.kadence-starter-required-plugins h2.kst-required-title{font-size:16px;font-weight:600;color:#4a5568}.components-button-group.kst-font-group .components-button.kst-font-btn.active{border-color:#333}.components-button-group.kst-font-group .components-button.kst-font-btn:hover{border-color:#999}.kadence_theme_starter_dash_inner{margin:90px 20px 0}.kadence_theme_dash_head .st2{fill:#191717}.kadence_theme_dash_head{background:#fff;padding:0px 20px;height:60px;border-bottom:1px solid #ebebeb;box-shadow:0 0 6px -2px rgba(0,0,0,.1);position:fixed;top:32px;left:160px;z-index:100;right:0}.kadence_theme_dash_head h1{color:#2d3748;line-height:50px;padding:0;height:50px;margin:0;display:flex;align-items:center}.kadence_theme_dash_head .subtext{font-size:16px;color:#718096;display:inline-block;padding-left:10px}.kadence_theme_dash_head .kadence_theme_dash_head_container{margin:0 auto;display:flex;height:100%;align-items:center}.kadence_theme_dash_head .kadence_theme_dash_logo{width:50px;height:50px;padding-right:10px}.kadence_theme_dash_head .kadence_theme_dash_logo img{width:50px}.kadence_theme_dash_head .kadence_starter_builder_type{flex-grow:1;text-align:right}.kadence_theme_dash_head .kadence_theme_dash_version span{padding:5px;background:#4a5568;color:#fff}.folded .kadence_theme_dash_head{left:36px}@media only screen and (max-width: 960px){.auto-fold .kadence_theme_dash_head{left:36px}}@media screen and (max-width: 782px){.auto-fold .kadence_theme_dash_head{left:0px}}.kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown.components-dropdown-menu.components-toolbar{border-color:#888}.kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown.components-dropdown-menu.components-toolbar button.components-button{padding:0}.kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown.components-dropdown-menu.components-toolbar button.components-button svg{width:40px;height:40px}.kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown.components-dropdown-menu.components-toolbar .components-dropdown__content button.components-button svg{width:24px;height:24px;margin-left:0}.kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown__content{text-align:left}.wrap.kadence_theme_starter_dash{margin:0}.kadence_theme_dashboard{margin:0 auto}.templates-grid{display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);grid-gap:2em}.kst-template-item .components-button.kst-import-btn{height:100%;width:100%;padding:0;display:block;border:0;background:transparent;position:absolute;overflow:hidden;box-shadow:0 0px 0px 0 rgba(0,0,0,0)}.kst-template-item .components-button.kst-import-btn img{max-width:100%;height:auto}.kst-grid-single-item{max-width:800px}.kst-grid-single-item .kst-template-item{overflow:hidden}.kst-grid-single-item .kst-import-btn{height:100%;width:100%;padding:0;display:block;border:0;background:transparent;position:absolute;box-shadow:0 0px 0px 0 rgba(0,0,0,0)}.kst-grid-single-item .kst-import-btn img{max-width:100%;height:auto}.components-modal__frame.kst-import-modal{max-width:600px}.components-modal__frame.kst-import-modal .components-button.is-primary{margin-top:20px}.kadence_starter_templates_notice{background:transparent;margin-bottom:20px;border:1px solid #cbd5e0;padding:10px;color:#4a5568;font-weight:normal}.kst-import-modal ul.kadence-required-wrap{margin-bottom:20px}.components-modal__frame.kst-import-modal{-webkit-animation:none !important;animation:none !important}.kst-import-modal h3{font-size:16px}.kadence_starter_templates_response{background:#fffaf0;margin-bottom:20px;border:1px solid #ed8936;padding:20px;color:#c05621;font-weight:bold}.kst-import-selection-title .components-button.kt-import-back{border:1px solid;margin-right:10px}.kst-import-selection-title{display:flex;align-items:center;margin-bottom:10px}.kst-grid-single-item-single-page .kst-template-item{padding-bottom:90%}.kadence_starter_templates_response h2{margin-bottom:10px;margin-top:0}.kst-template-item{position:relative;height:0;box-shadow:0 1px 2px rgba(0,0,0,.15);padding-bottom:65%}.kst-template-item::after{content:"";position:absolute;z-index:-1;width:100%;height:100%;opacity:0;border-radius:5px;box-shadow:0 15px 15px -10px rgba(0,0,0,.1);transition:opacity .3s ease-in-out}.kst-template-item:hover::after{opacity:1}.sidebar-section .components-panel__body.is-opened{padding:20px}.sidebar-section h2:first-child,.tab-section h2:first-child{margin-top:0}.side-panel .components-panel+.components-panel{margin-top:1rem}.tab-section .components-panel__body.is-opened{padding:25px}.kadence-dashboard-tab-panel .components-tab-panel__tabs .components-button{border:1px solid transparent;background:transparent;border:none;box-shadow:none;border-radius:0;cursor:pointer;height:48px;padding:3px 16px;margin-left:0;font-weight:500}.kadence-dashboard-tab-panel .components-tab-panel__tabs .components-button:hover{box-shadow:none !important}.kadence-dashboard-tab-panel .components-tab-panel__tabs .components-button:not(.active-tab):hover{color:#007cba !important;background:transparent !important}.kadence-dashboard-tab-panel .components-tab-panel__tabs .components-button.active-tab{background:#fff;border:1px solid #e2e4e7;border-bottom-color:transparent}.kadence-dashboard-tab-panel .components-tab-panel__tabs{margin-bottom:-1px}.two-col-grid{display:grid;grid-gap:1rem;grid-template-columns:1fr 1fr 1fr}h3.section-sub-head{background:#edf2f7;padding:10px;color:#4a5568;font-size:14px;text-transform:uppercase;margin-bottom:1rem;margin-top:2rem}.link-item{border:1px solid #e2e8f0;padding:20px;border-radius:4px;display:flex;flex-flow:column nowrap}.link-item h4{margin:0}.dashboard-pro-settings{margin-top:2rem}.link-item .link-item-foot{margin-top:auto;display:flex;align-items:center}.link-item .link-item-foot .components-spinner{margin-top:0}.link-item .link-item-foot .components-toggle-control .components-base-control__field{margin-bottom:0}.link-item .link-item-foot .components-toggle-control .components-base-control__field .components-form-toggle{margin-right:0}.link-item .link-item-foot>*:first-child{flex-grow:2}.link-item a{display:block;background:transparent;color:#4a5568}.link-item a:hover{color:#007cba}span.kt-license-status{padding:4px;margin-left:10px;font-size:14px;text-transform:uppercase}span.kt-license-status.k-inactive{color:#c05621 !important;background:#fffaf0 !important}span.kt-license-status.k-active{color:#2b6cb0 !important;background:#ebf8ff !important}.license-section h2{display:flex;margin-top:0;align-items:center;justify-content:space-between}.license-section table.form-table{display:block}.license-section table.form-table tbody{display:block}.license-section table.form-table td,.license-section table.form-table tr{display:block;padding:0;width:100%}.license-section .form-table th{padding:0;width:100%;margin-bottom:4px;display:block;color:#4a5568}.license-section p.submit{padding:0;margin-top:10px}.license-section table.form-table input[type=text]{width:100%}.kadence-starter-templates-preview .install-theme-info .theme-name{font-size:20px}.appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions .button{width:100%;line-height:1;min-height:35px;padding:0}.appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions{padding:5px}.kadence-starter-templates-preview button.components-button.kst-palette-btn{border-radius:4px !important;padding:5px 5px 5px 7px;height:auto;display:inline-flex;align-items:flex-end;justify-content:center;border:1px solid transparent;position:relative;box-shadow:none !important}.kadence-starter-templates-preview button.components-button.kst-palette-btn .kst-palette-bg{display:none}.kst-template-item .components-button.kst-import-btn:hover,.kst-template-item .components-button.kst-import-btn:focus{box-shadow:0 7px 15px 0 rgba(0,0,0,.15) !important}.kadence-starter-templates-preview button.components-button.kst-palette-btn:hover,.kadence-starter-templates-preview button.components-button.kst-palette-btn:focus{border:1px solid #999;box-shadow:none !important}.kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary,.kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary:hover,.kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary:focus{background:#fff;border:1px solid #333;box-shadow:none}.demo-title{height:30px;margin:0;padding:10px 0;box-shadow:inset 0 1px 0 rgba(0,0,0,.1);background:#fff;position:absolute;bottom:0;left:0;width:100%}.demo-title h4{margin:0;font-size:14px;text-align:left;line-height:30px;padding:0 20px;color:#1e1e1e}.kadence-starter-templates-preview .components-button-group.kst-palette-group{display:grid;grid-template-columns:1fr 1fr;grid-gap:5px}@media(max-width: 1860px){.kadence-starter-templates-preview .kadence-swatche-item-wrap{width:22px !important;height:22px !important}h2.palette-title{font-size:15px}}@media(max-width: 1059px){.templates-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr)}}p.install-third-party-notice{max-width:540px;background:#fffaf0;padding:1em;color:#c05621;border:1px solid #c05621;font-weight:600}.plugin-install-required{display:block;font-style:oblique;font-weight:400;color:#c05621}.kadence-required-wrap{font-weight:bold;list-style:disc;padding-left:1.4em}span.plugin-status{text-transform:uppercase;color:#718096}.kst-palette-btn.kst-selected-color-palette{display:flex;margin-bottom:20px}.finshed-notice-success .button-primary.button.kadence-starter-templates-finish-button{padding:10px 16px;font-size:18px}.kst-grid-single-site{display:grid;grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);grid-gap:4em}.kst-import-selection{height:100%;max-height:calc(100vh - 140px);overflow-y:scroll}.kst-import-grid-title h2{font-size:14px;line-height:20px;margin:10px 0;color:#4a5568}.kst-import-selection-title h2{font-size:16px;line-height:26px;margin:0 0 10px 0;color:#2d3748}.kst-import-single-selection-options-wrap{background:#fff;padding:35px 35px 35px;max-width:700px;width:100%;box-sizing:border-box}.appearance_page_kadence-starter-templates #wpbody-content{padding-bottom:25px}.desc-small.note-about-colors{font-size:14px;color:#718096;margin:1.5em 0}.kst-import-selection-options .kst-template-item{padding-bottom:126%}.kst-import-selection img{max-width:100%}.kst-import-selection-title h2 span{font-weight:bold;color:#000}.appearance_page_kadence-starter-templates .update-nag.notice,.appearance_page_kadence-starter-templates #wpfooter{display:none}.kadence_theme_starter_dashboard>.notice{display:none}.demo-title h4 span{position:absolute;bottom:100%;right:0;padding:5px 15px;background:rgba(0,0,0,.7);color:#fff;font-size:14px;font-weight:400;opacity:0}.kst-import-btn:hover .demo-title h4 span{opacity:1}.kst-import-selection-options .kst-template-item .components-button.kst-import-btn .LazyLoad{overflow-y:hidden;position:absolute;top:0;left:0;right:0;bottom:40px}.kst-import-single-selection-options-wrap .components-button.is-primary{padding-left:30px;padding-top:16px;padding-right:30px;font-weight:700;padding-bottom:16px;font-size:16px;height:auto;margin-top:20px}.kst-import-selection-footer{position:fixed;padding:10px 20px;bottom:0;background:#fff;right:0;left:0;margin-left:160px;z-index:100;display:flex;justify-content:space-between;align-items:center}button.components-button.kt-import-fullsite.is-primary{padding-left:30px;padding-top:16px;padding-right:30px;font-weight:700;padding-bottom:16px;font-size:16px;height:auto}.folded .kst-import-selection-footer{margin-left:36px}@media(max-width: 1059px){.kst-import-selection-options .templates-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr)}}@media(min-width: 1060px){.kst-import-selection-options .templates-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)}}@media(min-width: 1660px){.kst-import-selection-options .templates-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)}}@media(min-width: 2360px){.kst-import-selection-options .templates-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)}}.kst-import-single-selection-options-wrap .components-base-control.components-toggle-control{margin-bottom:15px;border-top:1px solid #e2e8f0;padding-top:15px}.components-modal__frame.ksp-confirm-modal{max-width:500px}.ksp-override-model-buttons{text-align:right}.ksp-override-model-buttons .components-button{margin-left:10px}.main-panel{margin:0 auto;max-width:1260px}.main-panel .kst-grid-single-site{grid-template-columns:minmax(0, 2fr) minmax(0, 1fr);grid-gap:3em}.kst-import-selection-bottom{text-align:center;margin-top:40px}.kadence_theme_dash_head .kadence_theme_dash_head_container{margin:0 auto;max-width:1260px}.kst-template-item{padding-bottom:126%}.appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions{display:flex}.appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions .button:not(.button-primary){margin-right:10px}@media(max-width: 1059px){.kst-import-selection-options .templates-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr)}}@media(min-width: 1060px){.kst-import-selection-options .templates-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)}}@media(min-width: 1660px){.kst-import-selection-options .templates-grid{grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)}}
assets/{js → export}/src/starter-import-export.js RENAMED
File without changes
assets/{js → export}/starter-import-export.min.js RENAMED
File without changes
assets/images/fonts/antic.jpg ADDED
Binary file
assets/images/fonts/cormorant.jpg ADDED
Binary file
assets/images/fonts/gilda.jpg ADDED
Binary file
assets/images/fonts/josefin.jpg ADDED
Binary file
assets/images/fonts/libre.jpg ADDED
Binary file
assets/images/fonts/lora.jpg ADDED
Binary file
assets/images/fonts/montserrat.jpg ADDED
Binary file
assets/images/fonts/nunito.jpg ADDED
Binary file
assets/images/fonts/oswald.jpg ADDED
Binary file
assets/images/fonts/playfair.jpg ADDED
Binary file
assets/images/fonts/proza.jpg ADDED
Binary file
assets/images/fonts/rubik.jpg ADDED
Binary file
assets/images/fonts/worksans.jpg ADDED
Binary file
assets/js/starter-templates.asset.php CHANGED
@@ -1 +1 @@
1
- <?php return array('dependencies' => array('react', 'react-dom', 'wp-element', 'wp-polyfill'), 'version' => 'db30b4e39d9de07fdf23214c4498639f');
1
+ <?php return array('dependencies' => array('react', 'react-dom', 'wp-element', 'wp-polyfill', 'wp-primitives'), 'version' => '0c28f000dc7918f63a0abb6cf99dbbfa');
assets/js/starter-templates.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=46)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t,n){var r=n(28),o="object"==typeof self&&self&&self.Object===Object&&self,a=r||o||Function("return this")();e.exports=a},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(24),o=n(49),a=n(128),i=n(2);e.exports=function(e,t){return(i(e)?r:a)(e,o(t,3))}},function(e,t,n){var r=n(62),o=n(67);e.exports=function(e,t){var n=o(e,t);return r(n)?n:void 0}},function(e,t,n){var r=n(10),o=n(63),a=n(64),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?o(e):a(e)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var r=n(52),o=n(53),a=n(54),i=n(55),c=n(56);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(26);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(1).Symbol;e.exports=r},function(e,t,n){var r=n(4)(Object,"create");e.exports=r},function(e,t,n){var r=n(76);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(22);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t,n){var r=n(4)(n(1),"Map");e.exports=r},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(68),o=n(75),a=n(77),i=n(78),c=n(79);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(97),o=n(104),a=n(20);e.exports=function(e){return a(e)?r(e):o(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(27),o=n(19);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},function(e,t,n){var r=n(2),o=n(22),a=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!o(e))||(i.test(e)||!a.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(5),o=n(6);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}},function(e,t,n){var r=n(8),o=n(57),a=n(58),i=n(59),c=n(60),s=n(61);function u(e){var t=this.__data__=new r(e);this.size=t.size}u.prototype.clear=o,u.prototype.delete=a,u.prototype.get=i,u.prototype.has=c,u.prototype.set=s,e.exports=u},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(5),o=n(16);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(15))},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(80),o=n(6);e.exports=function e(t,n,a,i,c){return t===n||(null==t||null==n||!o(t)&&!o(n)?t!=t&&n!=n:r(t,n,a,i,e,c))}},function(e,t,n){var r=n(81),o=n(84),a=n(85);e.exports=function(e,t,n,i,c,s){var u=1&n,l=e.length,f=t.length;if(l!=f&&!(u&&f>l))return!1;var p=s.get(e);if(p&&s.get(t))return p==t;var d=-1,m=!0,v=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++d<l;){var b=e[d],h=t[d];if(i)var y=u?i(h,b,d,t,e,s):i(b,h,d,e,t,s);if(void 0!==y){if(y)continue;m=!1;break}if(v){if(!o(t,(function(e,t){if(!a(v,t)&&(b===e||c(b,e,n,i,s)))return v.push(t)}))){m=!1;break}}else if(b!==h&&!c(b,h,n,i,s)){m=!1;break}}return s.delete(e),s.delete(t),m}},function(e,t,n){var r=n(99),o=n(6),a=Object.prototype,i=a.hasOwnProperty,c=a.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&i.call(e,"callee")&&!c.call(e,"callee")};e.exports=s},function(e,t,n){(function(e){var r=n(1),o=n(100),a=t&&!t.nodeType&&t,i=a&&"object"==typeof e&&e&&!e.nodeType&&e,c=i&&i.exports===a?r.Buffer:void 0,s=(c?c.isBuffer:void 0)||o;e.exports=s}).call(this,n(34)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(101),o=n(102),a=n(103),i=a&&a.isTypedArray,c=i?o(i):r;e.exports=c},function(e,t,n){var r=n(16);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},function(e,t,n){var r=n(40),o=n(13);e.exports=function(e,t){for(var n=0,a=(t=r(t,e)).length;null!=e&&n<a;)e=e[o(t[n++])];return n&&n==a?e:void 0}},function(e,t,n){var r=n(2),o=n(21),a=n(116),i=n(119);e.exports=function(e,t){return r(e)?e:o(e,t)?[e]:a(i(e))}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(47);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(48),o=n(7);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(134),a=d(o),i=d(n(135)),c=n(138),s=n(139),u=d(n(140)),l=d(n(141)),f=d(n(142)),p=d(n(143));function d(e){return e&&e.__esModule?e:{default:e}}var m=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.lazyLoadHandler=n.lazyLoadHandler.bind(n),e.throttle>0&&(e.debounce?n.lazyLoadHandler=(0,u.default)(n.lazyLoadHandler,e.throttle):n.lazyLoadHandler=(0,l.default)(n.lazyLoadHandler,e.throttle)),n.state={visible:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this._mounted=!0;var e=this.getEventNode();this.lazyLoadHandler(),this.lazyLoadHandler.flush&&this.lazyLoadHandler.flush(),(0,s.add)(window,"resize",this.lazyLoadHandler),(0,s.add)(e,"scroll",this.lazyLoadHandler),e!==window&&(0,s.add)(window,"scroll",this.lazyLoadHandler)}},{key:"componentWillReceiveProps",value:function(){this.state.visible||this.lazyLoadHandler()}},{key:"shouldComponentUpdate",value:function(e,t){return t.visible}},{key:"componentWillUnmount",value:function(){this._mounted=!1,this.lazyLoadHandler.cancel&&this.lazyLoadHandler.cancel(),this.detachListeners()}},{key:"getEventNode",value:function(){return(0,f.default)((0,c.findDOMNode)(this))}},{key:"getOffset",value:function(){var e=this.props,t=e.offset,n=e.offsetVertical,r=e.offsetHorizontal,o=e.offsetTop,a=e.offsetBottom,i=e.offsetLeft,c=e.offsetRight,s=e.threshold||t,u=n||s,l=r||s;return{top:o||u,bottom:a||u,left:i||l,right:c||l}}},{key:"lazyLoadHandler",value:function(){if(this._mounted){var e=this.getOffset(),t=(0,c.findDOMNode)(this),n=this.getEventNode();if((0,p.default)(t,n,e)){var r=this.props.onContentVisible;this.setState({visible:!0},(function(){r&&r()})),this.detachListeners()}}}},{key:"detachListeners",value:function(){var e=this.getEventNode();(0,s.remove)(window,"resize",this.lazyLoadHandler),(0,s.remove)(e,"scroll",this.lazyLoadHandler),e!==window&&(0,s.remove)(window,"scroll",this.lazyLoadHandler)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.height,i=e.width,c=this.state.visible,s={height:r,width:i},u="LazyLoad"+(c?" is-visible":"")+(n?" "+n:"");return a.default.createElement(this.props.elementType,{className:u,style:s},c&&o.Children.only(t))}}]),t}(o.Component);t.default=m,m.propTypes={children:i.default.node.isRequired,className:i.default.string,debounce:i.default.bool,elementType:i.default.string,height:i.default.oneOfType([i.default.string,i.default.number]),offset:i.default.number,offsetBottom:i.default.number,offsetHorizontal:i.default.number,offsetLeft:i.default.number,offsetRight:i.default.number,offsetTop:i.default.number,offsetVertical:i.default.number,threshold:i.default.number,throttle:i.default.number,width:i.default.oneOfType([i.default.string,i.default.number]),onContentVisible:i.default.func},m.defaultProps={elementType:"div",debounce:!0,offset:0,offsetBottom:0,offsetHorizontal:0,offsetLeft:0,offsetRight:0,offsetTop:0,offsetVertical:0,throttle:250}},function(e,t,n){"use strict";n.r(t);var r=n(41),o=n.n(r),a=n(42),i=n.n(a),c=n(7),s=n.n(c),u=n(43),l=n.n(u),f=n(44),p=n.n(f),d=n(23),m=n.n(d),v=n(0),b=n(3),h=n.n(b),y=n(45),g=n.n(y);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var o=m()(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p()(this,n)}}var _=wp.i18n,x=_.__,O=(_.sprintf,wp.element),w=O.Fragment,k=O.Component,E=O.render,P=wp.components,S=P.Modal,N=P.Spinner,T=P.ButtonGroup,z=P.Button,A=P.ExternalLink,M=wp.apiFetch,L=function(e){l()(n,e);var t=j(n);function n(){var e;return o()(this,n),(e=t.apply(this,arguments)).runAjax=e.runAjax.bind(s()(e)),e.runPluginInstall=e.runPluginInstall.bind(s()(e)),e.focusMode=e.focusMode.bind(s()(e)),e.state={category:"all",activeTemplate:"",colorPalette:"",search:null,isFetching:!1,isImporting:!1,progress:"",focusMode:!1,finished:!1,templates:kadenceStarterParams.templates?kadenceStarterParams.templates:[],palettes:kadenceStarterParams.palettes?kadenceStarterParams.palettes:[]},M.setFetchHandler((function(e){var t=e.url,n=e.path,r=e.data,o=e.method;return axios({url:t||n,method:o,data:r})})),e}return i()(n,[{key:"capitalizeFirstLetter",value:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}},{key:"focusMode",value:function(e){this.setState({activeTemplate:e,focusMode:!0})}},{key:"runPluginInstall",value:function(e){this.setState({progress:"plugins",isFetching:!0});var t=new FormData;t.append("action","kadence_import_install_plugins"),t.append("security",kadenceStarterParams.ajax_nonce),t.append("selected",e),this.runAjax(t)}},{key:"runAjax",value:function(e){var t=this;jQuery.ajax({method:"POST",url:kadenceStarterParams.ajax_url,data:e,contentType:!1,processData:!1}).done((function(n,r,o){if(void 0!==n.status&&"newAJAX"===n.status)t.state.progress="contentNew",t.runAjax(e);else if(void 0!==n.status&&"customizerAJAX"===n.status){t.setState({progress:"customizer"}),(a=new FormData).append("action","kadence_import_customizer_data"),a.append("security",kadenceStarterParams.ajax_nonce),a.append("wp_customize","on"),t.runAjax(a)}else if(void 0!==n.status&&"afterAllImportAJAX"===n.status){t.setState({progress:"widgets"}),(a=new FormData).append("action","kadence_after_import_data"),a.append("security",kadenceStarterParams.ajax_nonce),t.runAjax(a)}else if(void 0!==n.status&&"pluginSuccess"===n.status){var a;t.setState({progress:"content"}),(a=new FormData).append("action","kadence_import_demo_data"),a.append("security",kadenceStarterParams.ajax_nonce),a.append("selected",t.state.activeTemplate),a.append("palette",t.state.colorPalette),t.runAjax(a)}else void 0!==n.message?(jQuery(".kadence_starter_templates_finished").append("<p>"+n.message+"</p>"),t.setState({finished:!0,isFetching:!1,activeTemplate:"",focusMode:!1,isImporting:!1,progress:""})):(jQuery(".kadence_starter_templates_error").append('<div class="notice kadence_starter_templates_response notice-error"><p>'+n+"</p></div>"),t.setState({finished:!0,isFetching:!1,activeTemplate:"",focusMode:!1,isImporting:!1,progress:""}))})).fail((function(e){jQuery(".kadence_starter_templates_error").append('<div class="notice kadence_starter_templates_response notice-error"><p>Error: '+e.statusText+" ("+e.status+")</p></div>"),t.setState({finished:!0,isFetching:!1,activeTemplate:"",focusMode:!1,isImporting:!1,progress:""})}))}},{key:"render",value:function(){for(var e=this,t=["all"],n=0;n<this.state.templates.length;n++)for(var r=0;r<this.state.templates[n].categories.length;r++)t.includes(this.state.templates[n].categories[r])||t.push(this.state.templates[n].categories[r]);t.map((function(t){return{value:t,label:e.capitalizeFirstLetter(t)}}));var o=function(){var t=e.state.templates.filter((function(t){return t.key===e.state.activeTemplate}))[0],n=!0,r=!1,o=e.state.colorPalette?t.url+"?previewcolor="+e.state.colorPalette:t.url;return Object(v.createElement)("div",{className:"kadence-starter-templates-preview theme-install-overlay wp-full-overlay expanded",style:{display:"block"}},Object(v.createElement)("div",{className:"wp-full-overlay-sidebar"},Object(v.createElement)("div",{className:"wp-full-overlay-header"},Object(v.createElement)("button",{className:"kst-close-focus-btn close-full-overlay",onClick:function(){return e.setState({activeTemplate:"",colorPalette:"",focusMode:!1})}})),Object(v.createElement)("div",{className:"wp-full-overlay-sidebar-content"},Object(v.createElement)("div",{className:"install-theme-info"},Object(v.createElement)("h3",{className:"theme-name"},t.name),Object(v.createElement)("div",{className:"theme-by"},t.categories.map((function(t){return e.capitalizeFirstLetter(t)})).join(", ")),Object(v.createElement)("img",{className:"theme-screenshot",src:t.image,alt:t.name}),Object(v.createElement)("div",{className:"palette-title-wrap"},Object(v.createElement)("h2",{className:"palette-title"},x("Optional: Choose Color Scheme","kadence-starter-templates")),Object(v.createElement)(z,{label:x("clear"),className:"kst-clear-palette",disabled:!e.state.colorPalette,icon:"image-rotate",iconSize:10,onClick:function(){return e.setState({colorPalette:""})}})),Object(v.createElement)(T,{className:"kst-palette-group","aria-label":x("Select a Palette","kadence-starter-templates")},h()(e.state.palettes,(function(t){var n=t.palette,r=t.colors;return Object(v.createElement)(z,{className:"kst-palette-btn",isPrimary:n===e.state.colorPalette,"aria-pressed":n===e.state.colorPalette,onClick:function(){return e.setState({colorPalette:n})}},h()(r,(function(e,t){return Object(v.createElement)("div",{key:t,style:{width:30,height:30,marginBottom:0,marginRight:"3px",transform:"scale(1)",transition:"100ms transform ease"},className:"kadence-swatche-item-wrap"},Object(v.createElement)("span",{className:"kadence-swatch-item",style:{height:"100%",display:"block",width:"100%",border:"1px solid rgb(218, 218, 218)",borderRadius:"50%",color:"".concat(e),boxShadow:"inset 0 0 0 ".concat(15,"px"),transition:"100ms box-shadow ease"}}))})))}))),Object(v.createElement)("p",{className:"desc-small"},x("*You can change this after import.","kadence-starter-templates"))),Object(v.createElement)("div",{className:"kadence-starter-required-plugins"},Object(v.createElement)("h3",null,x("Required Plugins","kadence-starter-templates")),Object(v.createElement)("ul",{className:"kadence-required-wrap"},h()(t.plugins,(function(e){var t=e.state,o=e.title,a=e.src;return"active"!==t&&(n=!1,"thirdparty"===a&&(r=!0)),Object(v.createElement)("li",{className:"plugin-required"},o," - ",Object(v.createElement)("span",{class:"plugin-status"},"notactive"===t?x("Not Installed","kadence-starter-templates"):t))}))),!n&&Object(v.createElement)(w,null,r&&Object(v.createElement)("p",{className:"desc-small"},x("*Install Missing/Inactive Premium plugins to import.","kadence-starter-templates")),!r&&Object(v.createElement)("p",{className:"desc-small"},x("*Missing/Inactive plugins will be installed on import.","kadence-starter-templates"))))),Object(v.createElement)("div",{class:"wp-full-overlay-footer"},Object(v.createElement)("div",{class:"kadence-starter-templates-preview-actions"},Object(v.createElement)("button",{className:"kst-import-btn button-hero button button-primary",isDisabled:void 0!==t.pro&&t.pro&&"true"!==kadenceStarterParams.pro,onClick:function(){return e.setState({isImporting:!0})}},x("Import","kadence-starter-templates"))))),Object(v.createElement)("div",{class:"wp-full-overlay-main"},Object(v.createElement)("iframe",{id:"kadence-starter-preview",src:o})))},a=function(){var t=e.state.templates.filter((function(t){return t.key===e.state.activeTemplate}))[0],n=!1;return Object(v.createElement)(w,null,Object(v.createElement)("div",{className:"kst-grid-single-item"},Object(v.createElement)("div",{className:"kst-template-item"},Object(v.createElement)("div",{className:"kst-import-btn"},Object(v.createElement)("img",{src:t.image,alt:t.name}),Object(v.createElement)("div",{className:"demo-title"},Object(v.createElement)("h4",null,t.name))))),Object(v.createElement)(S,{className:"kst-import-modal",title:x("Import Starter Template"),onRequestClose:function(){return!e.state.isFetching&&e.setState({activeTemplate:"",colorPalette:"",focusMode:!1,isImporting:!1,progress:""})}},kadenceStarterParams.has_content&&Object(v.createElement)("div",{className:"kadence_starter_templates_notice"},kadenceStarterParams.notice),Object(v.createElement)("h3",null,x("Starter Template Plugins","kadence-starter-templates")),h()(t.plugins,(function(e){var t=e.state,r=(e.title,e.src);"active"!==t&&"thirdparty"===r&&(n=!0)})),n&&Object(v.createElement)("p",{className:"desc-small install-third-party-notice"},x("*This starter template requires premium third-party plugins. Please install missing/inactive premium plugins to import.","kadence-starter-templates")),Object(v.createElement)("ul",{className:"kadence-required-wrap"},h()(t.plugins,(function(e){var t=e.state,n=e.title,r=e.src;return Object(v.createElement)("li",{className:"plugin-required"},n," ","active"!==t&&"thirdparty"===r?Object(v.createElement)("span",{class:"plugin-install-required"},x("Please install and activate this third-party premium Plugin")):"")}))),e.state.colorPalette&&Object(v.createElement)(w,null,Object(v.createElement)("h3",null,x("Selected Color Palette","kadence-starter-templates")),h()(e.state.palettes,(function(t){var n=t.palette,r=t.colors;if(n===e.state.colorPalette)return Object(v.createElement)("div",{className:"kst-palette-btn kst-selected-color-palette"},h()(r,(function(e,t){return Object(v.createElement)("div",{key:t,style:{width:22,height:22,marginBottom:0,marginRight:"3px",transform:"scale(1)",transition:"100ms transform ease"},className:"kadence-swatche-item-wrap"},Object(v.createElement)("span",{className:"kadence-swatch-item",style:{height:"100%",display:"block",width:"100%",border:"1px solid rgb(218, 218, 218)",borderRadius:"50%",color:"".concat(e),boxShadow:"inset 0 0 0 ".concat(15,"px"),transition:"100ms box-shadow ease"}}))})))}))),"plugins"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.plugin_progress),"content"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.content_progress),"contentNew"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.content_new_progress),"customizer"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.customizer_progress),"widgets"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.widgets_progress),e.state.isFetching&&Object(v.createElement)(N,null),!kadenceStarterParams.isKadence&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},Object(v.createElement)("h2",null,x("This Starter Template Requires the Kadence Theme","kadence-starter-templates")),Object(v.createElement)(A,{href:"https://kadence-theme.com/"},x("Get Free Theme","kadence-blocks"))),kadenceStarterParams.isKadence&&Object(v.createElement)(w,null,n&&Object(v.createElement)(z,{className:"kt-defaults-save",isPrimary:!0,disabled:e.state.isFetching,onClick:function(){e.runPluginInstall(t.key)}},x("Skip and Import with Partial Content")),!n&&Object(v.createElement)(z,{className:"kt-defaults-save",isPrimary:!0,disabled:e.state.isFetching,onClick:function(){e.runPluginInstall(t.key)}},x("Start Importing")))))},i=function(){return Object(v.createElement)("div",{className:"templates-grid"},h()(e.state.templates,(function(t){var n=t.name,r=t.key,o=t.image,a=(t.content,t.categories),i=t.keywords,c=t.pro;if(("all"===e.state.category||a.includes(e.state.category))&&(!e.state.search||i&&i.some((function(t){return t.toLowerCase().includes(e.state.search.toLowerCase())}))))return Object(v.createElement)("div",{className:"kst-template-item"},Object(v.createElement)(z,{key:r,className:"kst-import-btn",isSmall:!0,isDisabled:void 0!==c&&c&&"true"!==kadenceStarterParams.pro,onClick:function(){return e.focusMode(r)}},Object(v.createElement)(g.a,null,Object(v.createElement)("img",{src:o,alt:n})),Object(v.createElement)("div",{className:"demo-title"},Object(v.createElement)("h4",null,n))),void 0!==c&&c&&Object(v.createElement)(w,null,Object(v.createElement)("span",{className:"kb-pro-template"},x("Pro","kadence-blocks")),"true"!==kadenceStarterParams.pro&&Object(v.createElement)("div",{className:"kt-popover-pro-notice"},Object(v.createElement)("h2",null,x("Kadence Pro required for this item","kadence-starter-sites")," "),Object(v.createElement)(A,{href:"https://www.kadencewp.com/pro/"},x("Upgrade to Pro","kadence-blocks")))))})))};return Object(v.createElement)(w,null,Object(v.createElement)((function(){return Object(v.createElement)("div",{className:"main-panel"},e.state.focusMode&&Object(v.createElement)(w,null,e.state.isImporting&&Object(v.createElement)(a,null),!e.state.isImporting&&Object(v.createElement)(o,null)),!e.state.focusMode&&!e.state.finished&&Object(v.createElement)(i,null))}),null))}}]),n}(k);wp.domReady((function(){E(Object(v.createElement)(L,null),document.querySelector(".kadence_starter_dashboard_main"))}))},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r=n(50),o=n(114),a=n(124),i=n(2),c=n(125);e.exports=function(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?i(e)?o(e[0],e[1]):r(e):c(e)}},function(e,t,n){var r=n(51),o=n(113),a=n(38);e.exports=function(e){var t=o(e);return 1==t.length&&t[0][2]?a(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(25),o=n(30);e.exports=function(e,t,n,a){var i=n.length,c=i,s=!a;if(null==e)return!c;for(e=Object(e);i--;){var u=n[i];if(s&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++i<c;){var l=(u=n[i])[0],f=e[l],p=u[1];if(s&&u[2]){if(void 0===f&&!(l in e))return!1}else{var d=new r;if(a)var m=a(f,p,l,e,t,d);if(!(void 0===m?o(p,f,3,a,d):m))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(9),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():o.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(9);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(9);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(9);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},function(e,t,n){var r=n(8);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(8),o=n(14),a=n(17);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!o||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new a(i)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(27),o=n(65),a=n(16),i=n(29),c=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,l=s.toString,f=u.hasOwnProperty,p=RegExp("^"+l.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||o(e))&&(r(e)?p:c).test(i(e))}},function(e,t,n){var r=n(10),o=Object.prototype,a=o.hasOwnProperty,i=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=a.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=i.call(e);return r&&(t?e[c]=n:delete e[c]),o}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,o=n(66),a=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!a&&a in e}},function(e,t,n){var r=n(1)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(69),o=n(8),a=n(14);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(a||o),string:new r}}},function(e,t,n){var r=n(70),o=n(71),a=n(72),i=n(73),c=n(74);function s(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=r,s.prototype.delete=o,s.prototype.get=a,s.prototype.has=i,s.prototype.set=c,e.exports=s},function(e,t,n){var r=n(11);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(11),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return o.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(11),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:o.call(t,e)}},function(e,t,n){var r=n(11);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,n){var r=n(12);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(12);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(12);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(12);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},function(e,t,n){var r=n(25),o=n(31),a=n(86),i=n(90),c=n(108),s=n(2),u=n(33),l=n(36),f="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,d,m,v){var b=s(e),h=s(t),y=b?"[object Array]":c(e),g=h?"[object Array]":c(t),j=(y="[object Arguments]"==y?f:y)==f,_=(g="[object Arguments]"==g?f:g)==f,x=y==g;if(x&&u(e)){if(!u(t))return!1;b=!0,j=!1}if(x&&!j)return v||(v=new r),b||l(e)?o(e,t,n,d,m,v):a(e,t,y,n,d,m,v);if(!(1&n)){var O=j&&p.call(e,"__wrapped__"),w=_&&p.call(t,"__wrapped__");if(O||w){var k=O?e.value():e,E=w?t.value():t;return v||(v=new r),m(k,E,n,d,v)}}return!!x&&(v||(v=new r),i(e,t,n,d,m,v))}},function(e,t,n){var r=n(17),o=n(82),a=n(83);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=a,e.exports=i},function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(10),o=n(87),a=n(26),i=n(31),c=n(88),s=n(89),u=r?r.prototype:void 0,l=u?u.valueOf:void 0;e.exports=function(e,t,n,r,u,f,p){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!f(new o(e),new o(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return a(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var d=c;case"[object Set]":var m=1&r;if(d||(d=s),e.size!=t.size&&!m)return!1;var v=p.get(e);if(v)return v==t;r|=2,p.set(e,t);var b=i(d(e),d(t),r,u,f,p);return p.delete(e),b;case"[object Symbol]":if(l)return l.call(e)==l.call(t)}return!1}},function(e,t,n){var r=n(1).Uint8Array;e.exports=r},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(91),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,a,i,c){var s=1&n,u=r(e),l=u.length;if(l!=r(t).length&&!s)return!1;for(var f=l;f--;){var p=u[f];if(!(s?p in t:o.call(t,p)))return!1}var d=c.get(e);if(d&&c.get(t))return d==t;var m=!0;c.set(e,t),c.set(t,e);for(var v=s;++f<l;){var b=e[p=u[f]],h=t[p];if(a)var y=s?a(h,b,p,t,e,c):a(b,h,p,e,t,c);if(!(void 0===y?b===h||i(b,h,n,a,c):y)){m=!1;break}v||(v="constructor"==p)}if(m&&!v){var g=e.constructor,j=t.constructor;g==j||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof j&&j instanceof j||(m=!1)}return c.delete(e),c.delete(t),m}},function(e,t,n){var r=n(92),o=n(94),a=n(18);e.exports=function(e){return r(e,a,o)}},function(e,t,n){var r=n(93),o=n(2);e.exports=function(e,t,n){var a=t(e);return o(e)?a:r(a,n(e))}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}},function(e,t,n){var r=n(95),o=n(96),a=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,c=i?function(e){return null==e?[]:(e=Object(e),r(i(e),(function(t){return a.call(e,t)})))}:o;e.exports=c},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(98),o=n(32),a=n(2),i=n(33),c=n(35),s=n(36),u=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=a(e),l=!n&&o(e),f=!n&&!l&&i(e),p=!n&&!l&&!f&&s(e),d=n||l||f||p,m=d?r(e.length,String):[],v=m.length;for(var b in e)!t&&!u.call(e,b)||d&&("length"==b||f&&("offset"==b||"parent"==b)||p&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||c(b,v))||m.push(b);return m}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(5),o=n(6);e.exports=function(e){return o(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(5),o=n(19),a=n(6),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&o(e.length)&&!!i[r(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(28),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,c=function(){try{var e=a&&a.require&&a.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=c}).call(this,n(34)(e))},function(e,t,n){var r=n(105),o=n(106),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=[];for(var n in Object(e))a.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(107)(Object.keys,Object);e.exports=r},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(109),o=n(14),a=n(110),i=n(111),c=n(112),s=n(5),u=n(29),l=u(r),f=u(o),p=u(a),d=u(i),m=u(c),v=s;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||o&&"[object Map]"!=v(new o)||a&&"[object Promise]"!=v(a.resolve())||i&&"[object Set]"!=v(new i)||c&&"[object WeakMap]"!=v(new c))&&(v=function(e){var t=s(e),n="[object Object]"==t?e.constructor:void 0,r=n?u(n):"";if(r)switch(r){case l:return"[object DataView]";case f:return"[object Map]";case p:return"[object Promise]";case d:return"[object Set]";case m:return"[object WeakMap]"}return t}),e.exports=v},function(e,t,n){var r=n(4)(n(1),"DataView");e.exports=r},function(e,t,n){var r=n(4)(n(1),"Promise");e.exports=r},function(e,t,n){var r=n(4)(n(1),"Set");e.exports=r},function(e,t,n){var r=n(4)(n(1),"WeakMap");e.exports=r},function(e,t,n){var r=n(37),o=n(18);e.exports=function(e){for(var t=o(e),n=t.length;n--;){var a=t[n],i=e[a];t[n]=[a,i,r(i)]}return t}},function(e,t,n){var r=n(30),o=n(115),a=n(121),i=n(21),c=n(37),s=n(38),u=n(13);e.exports=function(e,t){return i(e)&&c(t)?s(u(e),t):function(n){var i=o(n,e);return void 0===i&&i===t?a(n,e):r(t,i,3)}}},function(e,t,n){var r=n(39);e.exports=function(e,t,n){var o=null==e?void 0:r(e,t);return void 0===o?n:o}},function(e,t,n){var r=n(117),o=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a=/\\(\\)?/g,i=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(o,(function(e,n,r,o){t.push(r?o.replace(a,"$1"):n||e)})),t}));e.exports=i},function(e,t,n){var r=n(118);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(17);function o(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var i=e.apply(this,r);return n.cache=a.set(o,i)||a,i};return n.cache=new(o.Cache||r),n}o.Cache=r,e.exports=o},function(e,t,n){var r=n(120);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(10),o=n(24),a=n(2),i=n(22),c=r?r.prototype:void 0,s=c?c.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(a(t))return o(t,e)+"";if(i(t))return s?s.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t,n){var r=n(122),o=n(123);e.exports=function(e,t){return null!=e&&o(e,t,r)}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(40),o=n(32),a=n(2),i=n(35),c=n(19),s=n(13);e.exports=function(e,t,n){for(var u=-1,l=(t=r(t,e)).length,f=!1;++u<l;){var p=s(t[u]);if(!(f=null!=e&&n(e,p)))break;e=e[p]}return f||++u!=l?f:!!(l=null==e?0:e.length)&&c(l)&&i(p,l)&&(a(e)||o(e))}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(126),o=n(127),a=n(21),i=n(13);e.exports=function(e){return a(e)?r(i(e)):o(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(39);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(129),o=n(20);e.exports=function(e,t){var n=-1,a=o(e)?Array(e.length):[];return r(e,(function(e,r,o){a[++n]=t(e,r,o)})),a}},function(e,t,n){var r=n(130),o=n(133)(r);e.exports=o},function(e,t,n){var r=n(131),o=n(18);e.exports=function(e,t){return e&&r(e,t,o)}},function(e,t,n){var r=n(132)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var o=-1,a=Object(t),i=r(t),c=i.length;c--;){var s=i[e?c:++o];if(!1===n(a[s],s,a))break}return t}}},function(e,t,n){var r=n(20);e.exports=function(e,t){return function(n,o){if(null==n)return n;if(!r(n))return e(n,o);for(var a=n.length,i=t?a:-1,c=Object(n);(t?i--:++i<a)&&!1!==o(c[i],i,c););return n}}},function(e,t){!function(){e.exports=this.React}()},function(e,t,n){e.exports=n(136)()},function(e,t,n){"use strict";var r=n(137);function o(){}function a(){}a.resetWarningCache=o,e.exports=function(){function e(e,t,n,o,a,i){if(i!==r){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:o};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){!function(){e.exports=this.ReactDOM}()},function(e,t,n){var r,o;void 0===(o="function"==typeof(r=function(){function e(e,t){return function(n,r,o,a){n[e]?n[e](r,o,a):n[t]&&n[t]("on"+r,o)}}return{add:e("addEventListener","attachEvent"),remove:e("removeEventListener","detachEvent")}})?r.call(t,n,t,e):r)||(e.exports=o)},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,i=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,s="object"==typeof self&&self&&self.Object===Object&&self,u=c||s||Function("return this")(),l=Object.prototype.toString,f=Math.max,p=Math.min,d=function(){return u.Date.now()};function m(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(m(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=m(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var c=o.test(e);return c||a.test(e)?i(e.slice(2),c?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,o,a,i,c,s,u=0,l=!1,b=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,a=o;return r=o=void 0,u=t,i=e.apply(a,n)}function g(e){return u=e,c=setTimeout(_,t),l?y(e):i}function j(e){var n=e-s;return void 0===s||n>=t||n<0||b&&e-u>=a}function _(){var e=d();if(j(e))return x(e);c=setTimeout(_,function(e){var n=t-(e-s);return b?p(n,a-(e-u)):n}(e))}function x(e){return c=void 0,h&&r?y(e):(r=o=void 0,i)}function O(){var e=d(),n=j(e);if(r=arguments,o=this,s=e,n){if(void 0===c)return g(s);if(b)return c=setTimeout(_,t),y(s)}return void 0===c&&(c=setTimeout(_,t)),i}return t=v(t)||0,m(n)&&(l=!!n.leading,a=(b="maxWait"in n)?f(v(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),O.cancel=function(){void 0!==c&&clearTimeout(c),u=0,r=s=o=c=void 0},O.flush=function(){return void 0===c?i:x(d())},O}}).call(this,n(15))},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,i=parseInt,c="object"==typeof t&&t&&t.Object===Object&&t,s="object"==typeof self&&self&&self.Object===Object&&self,u=c||s||Function("return this")(),l=Object.prototype.toString,f=Math.max,p=Math.min,d=function(){return u.Date.now()};function m(e,t,n){var r,o,a,i,c,s,u=0,l=!1,m=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=r,a=o;return r=o=void 0,u=t,i=e.apply(a,n)}function g(e){return u=e,c=setTimeout(_,t),l?y(e):i}function j(e){var n=e-s;return void 0===s||n>=t||n<0||m&&e-u>=a}function _(){var e=d();if(j(e))return x(e);c=setTimeout(_,function(e){var n=t-(e-s);return m?p(n,a-(e-u)):n}(e))}function x(e){return c=void 0,h&&r?y(e):(r=o=void 0,i)}function O(){var e=d(),n=j(e);if(r=arguments,o=this,s=e,n){if(void 0===c)return g(s);if(m)return c=setTimeout(_,t),y(s)}return void 0===c&&(c=setTimeout(_,t)),i}return t=b(t)||0,v(n)&&(l=!!n.leading,a=(m="maxWait"in n)?f(b(n.maxWait)||0,t):a,h="trailing"in n?!!n.trailing:h),O.cancel=function(){void 0!==c&&clearTimeout(c),u=0,r=s=o=c=void 0},O.flush=function(){return void 0===c?i:x(d())},O}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==l.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var c=o.test(e);return c||a.test(e)?i(e.slice(2),c?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r=!0,o=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return v(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),m(e,t,{leading:r,maxWait:t,trailing:o})}}).call(this,n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){return"undefined"!=typeof getComputedStyle?getComputedStyle(e,null).getPropertyValue(t):e.style[t]},o=function(e){return r(e,"overflow")+r(e,"overflow-y")+r(e,"overflow-x")};t.default=function(e){if(!(e instanceof HTMLElement))return window;for(var t=e;t&&t!==document.body&&t!==document.documentElement&&t.parentNode;){if(/(scroll|auto)/.test(o(t)))return t;t=t.parentNode}return window}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r){if(function(e){return null===e.offsetParent}(t))return!1;var o=void 0,i=void 0,c=void 0,s=void 0;if(void 0===n||n===window)o=window.pageYOffset,c=window.pageXOffset,i=o+window.innerHeight,s=c+window.innerWidth;else{if(!e(n,window,r))return!1;var u=(0,a.default)(n);o=u.top,c=u.left,i=o+n.offsetHeight,s=c+n.offsetWidth}var l=(0,a.default)(t);return o<=l.top+t.offsetHeight+r.top&&i>=l.top-r.bottom&&c<=l.left+t.offsetWidth+r.left&&s>=l.left-r.right};var r,o=n(144),a=(r=o)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}}]);
1
+ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=145)}([function(e,t){!function(){e.exports=this.wp.element}()},function(e,t,n){var r=n(30),a=n(49),c=n(128),s=n(4);e.exports=function(e,t){return(s(e)?r:c)(e,a(t,3))}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){var r=n(34),a="object"==typeof self&&self&&self.Object===Object&&self,c=r||a||Function("return this")();e.exports=c},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){var r=n(62),a=n(67);e.exports=function(e,t){var n=a(e,t);return r(n)?n:void 0}},function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},function(e,t){!function(){e.exports=this.wp.primitives}()},function(e,t,n){var r=n(12),a=n(63),c=n(64),s=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?a(e):c(e)}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,n){var r=n(52),a=n(53),c=n(54),s=n(55),o=n(56);function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}i.prototype.clear=r,i.prototype.delete=a,i.prototype.get=c,i.prototype.has=s,i.prototype.set=o,e.exports=i},function(e,t,n){var r=n(32);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},function(e,t,n){var r=n(3).Symbol;e.exports=r},function(e,t,n){var r=n(5)(Object,"create");e.exports=r},function(e,t,n){var r=n(76);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},function(e,t,n){var r=n(29);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},function(e,t,n){var r=n(47);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},function(e,t,n){var r=n(48),a=n(2);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?a(e):t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(134),c=m(a),s=m(n(135)),o=n(138),i=n(139),l=m(n(140)),u=m(n(141)),p=m(n(142)),f=m(n(143));function m(e){return e&&e.__esModule?e:{default:e}}var d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.lazyLoadHandler=n.lazyLoadHandler.bind(n),e.throttle>0&&(e.debounce?n.lazyLoadHandler=(0,l.default)(n.lazyLoadHandler,e.throttle):n.lazyLoadHandler=(0,u.default)(n.lazyLoadHandler,e.throttle)),n.state={visible:!1},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"componentDidMount",value:function(){this._mounted=!0;var e=this.getEventNode();this.lazyLoadHandler(),this.lazyLoadHandler.flush&&this.lazyLoadHandler.flush(),(0,i.add)(window,"resize",this.lazyLoadHandler),(0,i.add)(e,"scroll",this.lazyLoadHandler),e!==window&&(0,i.add)(window,"scroll",this.lazyLoadHandler)}},{key:"componentWillReceiveProps",value:function(){this.state.visible||this.lazyLoadHandler()}},{key:"shouldComponentUpdate",value:function(e,t){return t.visible}},{key:"componentWillUnmount",value:function(){this._mounted=!1,this.lazyLoadHandler.cancel&&this.lazyLoadHandler.cancel(),this.detachListeners()}},{key:"getEventNode",value:function(){return(0,p.default)((0,o.findDOMNode)(this))}},{key:"getOffset",value:function(){var e=this.props,t=e.offset,n=e.offsetVertical,r=e.offsetHorizontal,a=e.offsetTop,c=e.offsetBottom,s=e.offsetLeft,o=e.offsetRight,i=e.threshold||t,l=n||i,u=r||i;return{top:a||l,bottom:c||l,left:s||u,right:o||u}}},{key:"lazyLoadHandler",value:function(){if(this._mounted){var e=this.getOffset(),t=(0,o.findDOMNode)(this),n=this.getEventNode();if((0,f.default)(t,n,e)){var r=this.props.onContentVisible;this.setState({visible:!0},(function(){r&&r()})),this.detachListeners()}}}},{key:"detachListeners",value:function(){var e=this.getEventNode();(0,i.remove)(window,"resize",this.lazyLoadHandler),(0,i.remove)(e,"scroll",this.lazyLoadHandler),e!==window&&(0,i.remove)(window,"scroll",this.lazyLoadHandler)}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.className,r=e.height,s=e.width,o=this.state.visible,i={height:r,width:s},l="LazyLoad"+(o?" is-visible":"")+(n?" "+n:"");return c.default.createElement(this.props.elementType,{className:l,style:i},o&&a.Children.only(t))}}]),t}(a.Component);t.default=d,d.propTypes={children:s.default.node.isRequired,className:s.default.string,debounce:s.default.bool,elementType:s.default.string,height:s.default.oneOfType([s.default.string,s.default.number]),offset:s.default.number,offsetBottom:s.default.number,offsetHorizontal:s.default.number,offsetLeft:s.default.number,offsetRight:s.default.number,offsetTop:s.default.number,offsetVertical:s.default.number,threshold:s.default.number,throttle:s.default.number,width:s.default.oneOfType([s.default.string,s.default.number]),onContentVisible:s.default.func},d.defaultProps={elementType:"div",debounce:!0,offset:0,offsetBottom:0,offsetHorizontal:0,offsetLeft:0,offsetRight:0,offsetTop:0,offsetVertical:0,throttle:250}},function(e,t,n){var r=n(5)(n(3),"Map");e.exports=r},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var r=n(68),a=n(75),c=n(77),s=n(78),o=n(79);function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}i.prototype.clear=r,i.prototype.delete=a,i.prototype.get=c,i.prototype.has=s,i.prototype.set=o,e.exports=i},function(e,t,n){var r=n(97),a=n(104),c=n(27);e.exports=function(e){return c(e)?r(e):a(e)}},function(e,t){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var r=n(33),a=n(26);e.exports=function(e){return null!=e&&a(e.length)&&!r(e)}},function(e,t,n){var r=n(4),a=n(29),c=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,s=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!a(e))||(s.test(e)||!c.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var r=n(8),a=n(9);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==r(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}},function(e,t,n){var r=n(10),a=n(57),c=n(58),s=n(59),o=n(60),i=n(61);function l(e){var t=this.__data__=new r(e);this.size=t.size}l.prototype.clear=a,l.prototype.delete=c,l.prototype.get=s,l.prototype.has=o,l.prototype.set=i,e.exports=l},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,n){var r=n(8),a=n(23);e.exports=function(e){if(!a(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},function(e,t,n){(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.exports=n}).call(this,n(22))},function(e,t){var n=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return n.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,n){var r=n(80),a=n(9);e.exports=function e(t,n,c,s,o){return t===n||(null==t||null==n||!a(t)&&!a(n)?t!=t&&n!=n:r(t,n,c,s,e,o))}},function(e,t,n){var r=n(81),a=n(84),c=n(85);e.exports=function(e,t,n,s,o,i){var l=1&n,u=e.length,p=t.length;if(u!=p&&!(l&&p>u))return!1;var f=i.get(e);if(f&&i.get(t))return f==t;var m=-1,d=!0,v=2&n?new r:void 0;for(i.set(e,t),i.set(t,e);++m<u;){var b=e[m],h=t[m];if(s)var g=l?s(h,b,m,t,e,i):s(b,h,m,e,t,i);if(void 0!==g){if(g)continue;d=!1;break}if(v){if(!a(t,(function(e,t){if(!c(v,t)&&(b===e||o(b,e,n,s,i)))return v.push(t)}))){d=!1;break}}else if(b!==h&&!o(b,h,n,s,i)){d=!1;break}}return i.delete(e),i.delete(t),d}},function(e,t,n){var r=n(99),a=n(9),c=Object.prototype,s=c.hasOwnProperty,o=c.propertyIsEnumerable,i=r(function(){return arguments}())?r:function(e){return a(e)&&s.call(e,"callee")&&!o.call(e,"callee")};e.exports=i},function(e,t,n){(function(e){var r=n(3),a=n(100),c=t&&!t.nodeType&&t,s=c&&"object"==typeof e&&e&&!e.nodeType&&e,o=s&&s.exports===c?r.Buffer:void 0,i=(o?o.isBuffer:void 0)||a;e.exports=i}).call(this,n(40)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,n){var r=n(101),a=n(102),c=n(103),s=c&&c.isTypedArray,o=s?a(s):r;e.exports=o},function(e,t,n){var r=n(23);e.exports=function(e){return e==e&&!r(e)}},function(e,t){e.exports=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}},function(e,t,n){var r=n(46),a=n(15);e.exports=function(e,t){for(var n=0,c=(t=r(t,e)).length;null!=e&&n<c;)e=e[a(t[n++])];return n&&n==c?e:void 0}},function(e,t,n){var r=n(4),a=n(28),c=n(116),s=n(119);e.exports=function(e,t){return r(e)?e:a(e,t)?[e]:c(s(e))}},function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},function(e,t,n){var r=n(50),a=n(114),c=n(124),s=n(4),o=n(125);e.exports=function(e){return"function"==typeof e?e:null==e?c:"object"==typeof e?s(e)?a(e[0],e[1]):r(e):o(e)}},function(e,t,n){var r=n(51),a=n(113),c=n(44);e.exports=function(e){var t=a(e);return 1==t.length&&t[0][2]?c(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},function(e,t,n){var r=n(31),a=n(36);e.exports=function(e,t,n,c){var s=n.length,o=s,i=!c;if(null==e)return!o;for(e=Object(e);s--;){var l=n[s];if(i&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++s<o;){var u=(l=n[s])[0],p=e[u],f=l[1];if(i&&l[2]){if(void 0===p&&!(u in e))return!1}else{var m=new r;if(c)var d=c(p,f,u,e,t,m);if(!(void 0===d?a(f,p,3,c,m):d))return!1}}return!0}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(11),a=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0)&&(n==t.length-1?t.pop():a.call(t,n,1),--this.size,!0)}},function(e,t,n){var r=n(11);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},function(e,t,n){var r=n(11);e.exports=function(e){return r(this.__data__,e)>-1}},function(e,t,n){var r=n(11);e.exports=function(e,t){var n=this.__data__,a=r(n,e);return a<0?(++this.size,n.push([e,t])):n[a][1]=t,this}},function(e,t,n){var r=n(10);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,n){var r=n(10),a=n(21),c=n(24);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!a||s.length<199)return s.push([e,t]),this.size=++n.size,this;n=this.__data__=new c(s)}return n.set(e,t),this.size=n.size,this}},function(e,t,n){var r=n(33),a=n(65),c=n(23),s=n(35),o=/^\[object .+?Constructor\]$/,i=Function.prototype,l=Object.prototype,u=i.toString,p=l.hasOwnProperty,f=RegExp("^"+u.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!c(e)||a(e))&&(r(e)?f:o).test(s(e))}},function(e,t,n){var r=n(12),a=Object.prototype,c=a.hasOwnProperty,s=a.toString,o=r?r.toStringTag:void 0;e.exports=function(e){var t=c.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch(e){}var a=s.call(e);return r&&(t?e[o]=n:delete e[o]),a}},function(e,t){var n=Object.prototype.toString;e.exports=function(e){return n.call(e)}},function(e,t,n){var r,a=n(66),c=(r=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!c&&c in e}},function(e,t,n){var r=n(3)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,n){var r=n(69),a=n(10),c=n(21);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(c||a),string:new r}}},function(e,t,n){var r=n(70),a=n(71),c=n(72),s=n(73),o=n(74);function i(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}i.prototype.clear=r,i.prototype.delete=a,i.prototype.get=c,i.prototype.has=s,i.prototype.set=o,e.exports=i},function(e,t,n){var r=n(13);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,n){var r=n(13),a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return a.call(t,e)?t[e]:void 0}},function(e,t,n){var r=n(13),a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:a.call(t,e)}},function(e,t,n){var r=n(13);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,n){var r=n(14);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,n){var r=n(14);e.exports=function(e){return r(this,e).get(e)}},function(e,t,n){var r=n(14);e.exports=function(e){return r(this,e).has(e)}},function(e,t,n){var r=n(14);e.exports=function(e,t){var n=r(this,e),a=n.size;return n.set(e,t),this.size+=n.size==a?0:1,this}},function(e,t,n){var r=n(31),a=n(37),c=n(86),s=n(90),o=n(108),i=n(4),l=n(39),u=n(42),p="[object Object]",f=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,m,d,v){var b=i(e),h=i(t),g=b?"[object Array]":o(e),j=h?"[object Array]":o(t),y=(g="[object Arguments]"==g?p:g)==p,O=(j="[object Arguments]"==j?p:j)==p,k=g==j;if(k&&l(e)){if(!l(t))return!1;b=!0,y=!1}if(k&&!y)return v||(v=new r),b||u(e)?a(e,t,n,m,d,v):c(e,t,g,n,m,d,v);if(!(1&n)){var E=y&&f.call(e,"__wrapped__"),_=O&&f.call(t,"__wrapped__");if(E||_){var P=E?e.value():e,x=_?t.value():t;return v||(v=new r),d(P,x,n,m,v)}}return!!k&&(v||(v=new r),s(e,t,n,m,d,v))}},function(e,t,n){var r=n(24),a=n(82),c=n(83);function s(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}s.prototype.add=s.prototype.push=a,s.prototype.has=c,e.exports=s},function(e,t){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,n){var r=n(12),a=n(87),c=n(32),s=n(37),o=n(88),i=n(89),l=r?r.prototype:void 0,u=l?l.valueOf:void 0;e.exports=function(e,t,n,r,l,p,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!p(new a(e),new a(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return c(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var m=o;case"[object Set]":var d=1&r;if(m||(m=i),e.size!=t.size&&!d)return!1;var v=f.get(e);if(v)return v==t;r|=2,f.set(e,t);var b=s(m(e),m(t),r,l,p,f);return f.delete(e),b;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},function(e,t,n){var r=n(3).Uint8Array;e.exports=r},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},function(e,t){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},function(e,t,n){var r=n(91),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,c,s,o){var i=1&n,l=r(e),u=l.length;if(u!=r(t).length&&!i)return!1;for(var p=u;p--;){var f=l[p];if(!(i?f in t:a.call(t,f)))return!1}var m=o.get(e);if(m&&o.get(t))return m==t;var d=!0;o.set(e,t),o.set(t,e);for(var v=i;++p<u;){var b=e[f=l[p]],h=t[f];if(c)var g=i?c(h,b,f,t,e,o):c(b,h,f,e,t,o);if(!(void 0===g?b===h||s(b,h,n,c,o):g)){d=!1;break}v||(v="constructor"==f)}if(d&&!v){var j=e.constructor,y=t.constructor;j==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof j&&j instanceof j&&"function"==typeof y&&y instanceof y||(d=!1)}return o.delete(e),o.delete(t),d}},function(e,t,n){var r=n(92),a=n(94),c=n(25);e.exports=function(e){return r(e,c,a)}},function(e,t,n){var r=n(93),a=n(4);e.exports=function(e,t,n){var c=t(e);return a(e)?c:r(c,n(e))}},function(e,t){e.exports=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}},function(e,t,n){var r=n(95),a=n(96),c=Object.prototype.propertyIsEnumerable,s=Object.getOwnPropertySymbols,o=s?function(e){return null==e?[]:(e=Object(e),r(s(e),(function(t){return c.call(e,t)})))}:a;e.exports=o},function(e,t){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,c=[];++n<r;){var s=e[n];t(s,n,e)&&(c[a++]=s)}return c}},function(e,t){e.exports=function(){return[]}},function(e,t,n){var r=n(98),a=n(38),c=n(4),s=n(39),o=n(41),i=n(42),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=c(e),u=!n&&a(e),p=!n&&!u&&s(e),f=!n&&!u&&!p&&i(e),m=n||u||p||f,d=m?r(e.length,String):[],v=d.length;for(var b in e)!t&&!l.call(e,b)||m&&("length"==b||p&&("offset"==b||"parent"==b)||f&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||o(b,v))||d.push(b);return d}},function(e,t){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},function(e,t,n){var r=n(8),a=n(9);e.exports=function(e){return a(e)&&"[object Arguments]"==r(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,n){var r=n(8),a=n(26),c=n(9),s={};s["[object Float32Array]"]=s["[object Float64Array]"]=s["[object Int8Array]"]=s["[object Int16Array]"]=s["[object Int32Array]"]=s["[object Uint8Array]"]=s["[object Uint8ClampedArray]"]=s["[object Uint16Array]"]=s["[object Uint32Array]"]=!0,s["[object Arguments]"]=s["[object Array]"]=s["[object ArrayBuffer]"]=s["[object Boolean]"]=s["[object DataView]"]=s["[object Date]"]=s["[object Error]"]=s["[object Function]"]=s["[object Map]"]=s["[object Number]"]=s["[object Object]"]=s["[object RegExp]"]=s["[object Set]"]=s["[object String]"]=s["[object WeakMap]"]=!1,e.exports=function(e){return c(e)&&a(e.length)&&!!s[r(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,n){(function(e){var r=n(34),a=t&&!t.nodeType&&t,c=a&&"object"==typeof e&&e&&!e.nodeType&&e,s=c&&c.exports===a&&r.process,o=function(){try{var e=c&&c.require&&c.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=o}).call(this,n(40)(e))},function(e,t,n){var r=n(105),a=n(106),c=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return a(e);var t=[];for(var n in Object(e))c.call(e,n)&&"constructor"!=n&&t.push(n);return t}},function(e,t){var n=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||n)}},function(e,t,n){var r=n(107)(Object.keys,Object);e.exports=r},function(e,t){e.exports=function(e,t){return function(n){return e(t(n))}}},function(e,t,n){var r=n(109),a=n(21),c=n(110),s=n(111),o=n(112),i=n(8),l=n(35),u=l(r),p=l(a),f=l(c),m=l(s),d=l(o),v=i;(r&&"[object DataView]"!=v(new r(new ArrayBuffer(1)))||a&&"[object Map]"!=v(new a)||c&&"[object Promise]"!=v(c.resolve())||s&&"[object Set]"!=v(new s)||o&&"[object WeakMap]"!=v(new o))&&(v=function(e){var t=i(e),n="[object Object]"==t?e.constructor:void 0,r=n?l(n):"";if(r)switch(r){case u:return"[object DataView]";case p:return"[object Map]";case f:return"[object Promise]";case m:return"[object Set]";case d:return"[object WeakMap]"}return t}),e.exports=v},function(e,t,n){var r=n(5)(n(3),"DataView");e.exports=r},function(e,t,n){var r=n(5)(n(3),"Promise");e.exports=r},function(e,t,n){var r=n(5)(n(3),"Set");e.exports=r},function(e,t,n){var r=n(5)(n(3),"WeakMap");e.exports=r},function(e,t,n){var r=n(43),a=n(25);e.exports=function(e){for(var t=a(e),n=t.length;n--;){var c=t[n],s=e[c];t[n]=[c,s,r(s)]}return t}},function(e,t,n){var r=n(36),a=n(115),c=n(121),s=n(28),o=n(43),i=n(44),l=n(15);e.exports=function(e,t){return s(e)&&o(t)?i(l(e),t):function(n){var s=a(n,e);return void 0===s&&s===t?c(n,e):r(t,s,3)}}},function(e,t,n){var r=n(45);e.exports=function(e,t,n){var a=null==e?void 0:r(e,t);return void 0===a?n:a}},function(e,t,n){var r=n(117),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c=/\\(\\)?/g,s=r((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(a,(function(e,n,r,a){t.push(r?a.replace(c,"$1"):n||e)})),t}));e.exports=s},function(e,t,n){var r=n(118);e.exports=function(e){var t=r(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}},function(e,t,n){var r=n(24);function a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],c=n.cache;if(c.has(a))return c.get(a);var s=e.apply(this,r);return n.cache=c.set(a,s)||c,s};return n.cache=new(a.Cache||r),n}a.Cache=r,e.exports=a},function(e,t,n){var r=n(120);e.exports=function(e){return null==e?"":r(e)}},function(e,t,n){var r=n(12),a=n(30),c=n(4),s=n(29),o=r?r.prototype:void 0,i=o?o.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(c(t))return a(t,e)+"";if(s(t))return i?i.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},function(e,t,n){var r=n(122),a=n(123);e.exports=function(e,t){return null!=e&&a(e,t,r)}},function(e,t){e.exports=function(e,t){return null!=e&&t in Object(e)}},function(e,t,n){var r=n(46),a=n(38),c=n(4),s=n(41),o=n(26),i=n(15);e.exports=function(e,t,n){for(var l=-1,u=(t=r(t,e)).length,p=!1;++l<u;){var f=i(t[l]);if(!(p=null!=e&&n(e,f)))break;e=e[f]}return p||++l!=u?p:!!(u=null==e?0:e.length)&&o(u)&&s(f,u)&&(c(e)||a(e))}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var r=n(126),a=n(127),c=n(28),s=n(15);e.exports=function(e){return c(e)?r(s(e)):a(e)}},function(e,t){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},function(e,t,n){var r=n(45);e.exports=function(e){return function(t){return r(t,e)}}},function(e,t,n){var r=n(129),a=n(27);e.exports=function(e,t){var n=-1,c=a(e)?Array(e.length):[];return r(e,(function(e,r,a){c[++n]=t(e,r,a)})),c}},function(e,t,n){var r=n(130),a=n(133)(r);e.exports=a},function(e,t,n){var r=n(131),a=n(25);e.exports=function(e,t){return e&&r(e,t,a)}},function(e,t,n){var r=n(132)();e.exports=r},function(e,t){e.exports=function(e){return function(t,n,r){for(var a=-1,c=Object(t),s=r(t),o=s.length;o--;){var i=s[e?o:++a];if(!1===n(c[i],i,c))break}return t}}},function(e,t,n){var r=n(27);e.exports=function(e,t){return function(n,a){if(null==n)return n;if(!r(n))return e(n,a);for(var c=n.length,s=t?c:-1,o=Object(n);(t?s--:++s<c)&&!1!==a(o[s],s,o););return n}}},function(e,t){!function(){e.exports=this.React}()},function(e,t,n){e.exports=n(136)()},function(e,t,n){"use strict";var r=n(137);function a(){}function c(){}c.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,c,s){if(s!==r){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:c,resetWarningCache:a};return n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t){!function(){e.exports=this.ReactDOM}()},function(e,t,n){var r,a;void 0===(a="function"==typeof(r=function(){function e(e,t){return function(n,r,a,c){n[e]?n[e](r,a,c):n[t]&&n[t]("on"+r,a)}}return{add:e("addEventListener","attachEvent"),remove:e("removeEventListener","detachEvent")}})?r.call(t,n,t,e):r)||(e.exports=a)},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,o="object"==typeof t&&t&&t.Object===Object&&t,i="object"==typeof self&&self&&self.Object===Object&&self,l=o||i||Function("return this")(),u=Object.prototype.toString,p=Math.max,f=Math.min,m=function(){return l.Date.now()};function d(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function v(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(d(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=d(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var o=a.test(e);return o||c.test(e)?s(e.slice(2),o?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r,a,c,s,o,i,l=0,u=!1,b=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=r,c=a;return r=a=void 0,l=t,s=e.apply(c,n)}function j(e){return l=e,o=setTimeout(O,t),u?g(e):s}function y(e){var n=e-i;return void 0===i||n>=t||n<0||b&&e-l>=c}function O(){var e=m();if(y(e))return k(e);o=setTimeout(O,function(e){var n=t-(e-i);return b?f(n,c-(e-l)):n}(e))}function k(e){return o=void 0,h&&r?g(e):(r=a=void 0,s)}function E(){var e=m(),n=y(e);if(r=arguments,a=this,i=e,n){if(void 0===o)return j(i);if(b)return o=setTimeout(O,t),g(i)}return void 0===o&&(o=setTimeout(O,t)),s}return t=v(t)||0,d(n)&&(u=!!n.leading,c=(b="maxWait"in n)?p(v(n.maxWait)||0,t):c,h="trailing"in n?!!n.trailing:h),E.cancel=function(){void 0!==o&&clearTimeout(o),l=0,r=i=a=o=void 0},E.flush=function(){return void 0===o?s:k(m())},E}}).call(this,n(22))},function(e,t,n){(function(t){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,o="object"==typeof t&&t&&t.Object===Object&&t,i="object"==typeof self&&self&&self.Object===Object&&self,l=o||i||Function("return this")(),u=Object.prototype.toString,p=Math.max,f=Math.min,m=function(){return l.Date.now()};function d(e,t,n){var r,a,c,s,o,i,l=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=r,c=a;return r=a=void 0,l=t,s=e.apply(c,n)}function j(e){return l=e,o=setTimeout(O,t),u?g(e):s}function y(e){var n=e-i;return void 0===i||n>=t||n<0||d&&e-l>=c}function O(){var e=m();if(y(e))return k(e);o=setTimeout(O,function(e){var n=t-(e-i);return d?f(n,c-(e-l)):n}(e))}function k(e){return o=void 0,h&&r?g(e):(r=a=void 0,s)}function E(){var e=m(),n=y(e);if(r=arguments,a=this,i=e,n){if(void 0===o)return j(i);if(d)return o=setTimeout(O,t),g(i)}return void 0===o&&(o=setTimeout(O,t)),s}return t=b(t)||0,v(n)&&(u=!!n.leading,c=(d="maxWait"in n)?p(b(n.maxWait)||0,t):c,h="trailing"in n?!!n.trailing:h),E.cancel=function(){void 0!==o&&clearTimeout(o),l=0,r=i=a=o=void 0},E.flush=function(){return void 0===o?s:k(m())},E}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function b(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(v(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=v(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(n,"");var o=a.test(e);return o||c.test(e)?s(e.slice(2),o?2:8):r.test(e)?NaN:+e}e.exports=function(e,t,n){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return v(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),d(e,t,{leading:r,maxWait:t,trailing:a})}}).call(this,n(22))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t){return"undefined"!=typeof getComputedStyle?getComputedStyle(e,null).getPropertyValue(t):e.style[t]},a=function(e){return r(e,"overflow")+r(e,"overflow-y")+r(e,"overflow-x")};t.default=function(e){if(!(e instanceof HTMLElement))return window;for(var t=e;t&&t!==document.body&&t!==document.documentElement&&t.parentNode;){if(/(scroll|auto)/.test(a(t)))return t;t=t.parentNode}return window}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n,r){if(function(e){return null===e.offsetParent}(t))return!1;var a=void 0,s=void 0,o=void 0,i=void 0;if(void 0===n||n===window)a=window.pageYOffset,o=window.pageXOffset,s=a+window.innerHeight,i=o+window.innerWidth;else{if(!e(n,window,r))return!1;var l=(0,c.default)(n);a=l.top,o=l.left,s=a+n.offsetHeight,i=o+n.offsetWidth}var u=(0,c.default)(t);return a<=u.top+t.offsetHeight+r.top&&s>=u.top-r.bottom&&o<=u.left+t.offsetWidth+r.left&&i>=u.left-r.right};var r,a=n(144),c=(r=a)&&r.__esModule?r:{default:r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}},function(e,t,n){"use strict";n.r(t);var r=n(16),a=n.n(r),c=n(17),s=n.n(c),o=n(2),i=n.n(o),l=n(18),u=n.n(l),p=n(19),f=n.n(p),m=n(6),d=n.n(m),v=n(0),b=n(1),h=n.n(b),g=n(20),j=n.n(g);function y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return f()(this,n)}}var O=wp.i18n,k=O.__,E=(O.sprintf,wp.element),_=E.Fragment,P=E.Component,x=(E.render,E.PureComponent,wp.components),S=(x.Modal,x.Spinner,x.ButtonGroup),w=(x.Dropdown,x.Button),N=(x.ExternalLink,x.ToolbarGroup,x.MenuItem,x.Tooltip),z=function(e){u()(n,e);var t=y(n);function n(){var e;return a()(this,n),(e=t.apply(this,arguments)).state={colorPalette:e.props.colorPalette?e.props.colorPalette:"",fontPair:e.props.fontPair?e.props.fontPair:"",palettes:kadenceStarterParams.palettes?kadenceStarterParams.palettes:[],fonts:kadenceStarterParams.fonts?kadenceStarterParams.fonts:[]},e}return s()(n,[{key:"capitalizeFirstLetter",value:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}},{key:"render",value:function(){var e=this,t=this.props.item[0],n=!0,r=!1;return Object(v.createElement)("div",{className:"kadence-starter-templates-preview theme-install-overlay wp-full-overlay expanded",style:{display:"block"}},Object(v.createElement)("div",{className:"wp-full-overlay-sidebar"},Object(v.createElement)("div",{className:"wp-full-overlay-header"},Object(v.createElement)("button",{className:"kst-close-focus-btn close-full-overlay",onClick:function(){return e.props.onChange({activeTemplate:"",colorPalette:"",fontPair:"",focusMode:!1})}})),Object(v.createElement)("div",{className:"wp-full-overlay-sidebar-content"},Object(v.createElement)("div",{className:"install-theme-info"},Object(v.createElement)("div",{className:"theme-info-wrap"},Object(v.createElement)("img",{className:"theme-screenshot",src:t.image,alt:t.name}),Object(v.createElement)("div",{className:"theme-info-title-wrap"},Object(v.createElement)("h3",{className:"theme-name"},t.name),Object(v.createElement)("div",{className:"theme-by"},t.categories.map((function(t){return e.capitalizeFirstLetter(t)})).join(", ")))),Object(v.createElement)("div",{className:"palette-title-wrap"},Object(v.createElement)("h2",{className:"palette-title"},k("Optional: Change Color Scheme","kadence-starter-templates")),Object(v.createElement)(w,{label:k("clear"),className:"kst-clear-palette",disabled:!this.state.colorPalette,icon:"image-rotate",iconSize:10,onClick:function(){e.setState({colorPalette:""}),document.getElementById("kadence-starter-preview").contentWindow.postMessage({color:""},"*")}})),Object(v.createElement)(S,{className:"kst-palette-group","aria-label":k("Select a Palette","kadence-starter-templates")},h()(this.state.palettes,(function(t){var n=t.palette,r=t.colors;return Object(v.createElement)(w,{className:"kst-palette-btn",isPrimary:n===e.state.colorPalette,"aria-pressed":n===e.state.colorPalette,onClick:function(){document.getElementById("kadence-starter-preview").contentWindow.postMessage({color:n},"*"),e.setState({colorPalette:n})}},Object(v.createElement)("span",{className:"kst-palette-bg",style:{background:r[4]?r[4]:void 0}}),h()(r,(function(e,t){if(4!==t)return Object(v.createElement)("div",{key:t,style:{width:30,height:30,marginBottom:0,marginRight:"3px",transform:"scale(1)",transition:"100ms transform ease"},className:"kadence-swatche-item-wrap"},Object(v.createElement)("span",{className:"kadence-swatch-item",style:{height:"100%",display:"block",width:"100%",border:"1px solid rgb(218, 218, 218)",borderRadius:"50%",color:"".concat(e),boxShadow:"inset 0 0 0 ".concat(15,"px"),transition:"100ms box-shadow ease"}}))})))}))),Object(v.createElement)("p",{className:"desc-small"},k("*You can change this after import.","kadence-starter-templates")),Object(v.createElement)("div",{className:"font-title-wrap"},Object(v.createElement)("h2",{className:"font-title"},k("Optional: Change Font Family","kadence-starter-templates")),Object(v.createElement)(w,{label:k("clear"),className:"kst-clear-font",disabled:!this.state.fontPair,icon:"image-rotate",iconSize:10,onClick:function(){e.setState({fontPair:""}),document.getElementById("kadence-starter-preview").contentWindow.postMessage({font:""},"*")}})),Object(v.createElement)(S,{className:"kst-font-group","aria-label":k("Select a Font","kadence-starter-templates")},h()(this.state.fonts,(function(t){var n=t.font,r=t.img,a=t.name;return Object(v.createElement)(N,{text:a},Object(v.createElement)(w,{className:"kst-font-btn".concat(n===e.state.fontPair?" active":""),"aria-pressed":n===e.state.fontPair,onClick:function(){e.setState({fontPair:n}),document.getElementById("kadence-starter-preview").contentWindow.postMessage({font:n},"*")}},Object(v.createElement)("img",{src:r,className:"font-pairing"})))}))),Object(v.createElement)("p",{className:"desc-small"},k("*You can change this after import.","kadence-starter-templates"))),Object(v.createElement)("div",{className:"kadence-starter-required-plugins"},Object(v.createElement)("h2",{className:"kst-required-title"},k("Required Plugins","kadence-starter-templates")),Object(v.createElement)("ul",{className:"kadence-required-wrap"},h()(t.plugins,(function(e){var t=e.state,a=e.title,c=e.src;return"active"!==t&&(n=!1,"thirdparty"===c&&(r=!0)),Object(v.createElement)("li",{className:"plugin-required"},a," - ",Object(v.createElement)("span",{class:"plugin-status"},"notactive"===t?k("Not Installed","kadence-starter-templates"):t))}))),!n&&Object(v.createElement)(_,null,r&&Object(v.createElement)("p",{className:"desc-small"},k("*Install Missing/Inactive Premium plugins to import.","kadence-starter-templates")),!r&&Object(v.createElement)("p",{className:"desc-small"},k("*Missing/Inactive plugins will be installed on import.","kadence-starter-templates"))))),Object(v.createElement)("div",{class:"wp-full-overlay-footer"},Object(v.createElement)("h2",{className:"kst-import-options-title"},k("Import Options","kadence-starter-templates")),Object(v.createElement)("div",{class:"kadence-starter-templates-preview-actions"},Object(v.createElement)("button",{className:"kst-import-btn button-hero button",isDisabled:void 0!==t.pro&&t.pro&&"true"!==kadenceStarterParams.pro,onClick:function(){return e.props.onChange({isSelected:!1,fontPair:e.state.fontPair,colorPalette:e.state.colorPalette})}},k("Single Page","kadence-starter-templates")),Object(v.createElement)("button",{className:"kst-import-btn button-hero button button-primary",isDisabled:void 0!==t.pro&&t.pro&&"true"!==kadenceStarterParams.pro,onClick:function(){return e.props.onChange({isImporting:!0,fontPair:e.state.fontPair,colorPalette:e.state.colorPalette})}},k("Full Site","kadence-starter-templates"))))),Object(v.createElement)("div",{class:"wp-full-overlay-main"},Object(v.createElement)("iframe",{id:"kadence-starter-preview",src:t.url+"?cache=bust"})))}}]),n}(P),M=n(7),C=Object(v.createElement)(M.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(v.createElement)(M.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),T=Object(v.createElement)(M.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(v.createElement)(M.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));function F(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=d()(e);if(t){var a=d()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return f()(this,n)}}var I=wp.i18n,A=I.__,L=(I.sprintf,wp.element),H=L.Fragment,R=L.Component,D=L.render,B=(L.PureComponent,wp.components),V=B.Modal,q=B.Spinner,W=(B.ButtonGroup,B.Dropdown),$=B.Icon,G=B.Button,U=B.ExternalLink,Y=(B.ToolbarGroup,B.ToggleControl),J=B.MenuItem,K=B.Tooltip,X=Object(v.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 180 180"},Object(v.createElement)("circle",{cx:"90.03",cy:"89.952",r:"90",fill:"url(#_Linear1)"}),Object(v.createElement)("path",{fill:"#fff",d:"M50 50H66.003V130H50z"}),Object(v.createElement)("path",{fill:"#fff",d:"M82 50H130.011V66H82z"}),Object(v.createElement)("path",{fill:"#fff",d:"M82 82H130.011V98H82z"}),Object(v.createElement)("path",{fill:"#fff",d:"M82 114.046H130.011V130.046H82z"}),Object(v.createElement)("defs",null,Object(v.createElement)("linearGradient",{id:"_Linear1",x1:"0",x2:"1",y1:"0",y2:"0",gradientTransform:"rotate(-52.456 186.056 40.829) scale(178.658)",gradientUnits:"userSpaceOnUse"},Object(v.createElement)("stop",{offset:"0",stopColor:"#372b73"}),Object(v.createElement)("stop",{offset:"1",stopColor:"#e9335e"})))),Q=(Object(v.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2",clipRule:"evenodd",viewBox:"0 0 180 180"},Object(v.createElement)("circle",{cx:"90.03",cy:"89.952",r:"90",fill:"#93003c"}),Object(v.createElement)("path",{fill:"#ff5bd4",d:"M50 50H66.003V130H50z"}),Object(v.createElement)("path",{fill:"#ff5bd4",d:"M82 50H130.011V66H82z"}),Object(v.createElement)("path",{fill:"#ff5bd4",d:"M82 82H130.011V98H82z"}),Object(v.createElement)("path",{fill:"#ff5bd4",d:"M82 114.046H130.011V130.046H82z"})),Object(v.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0",y:"0",enableBackground:"new 0 0 720 864",viewBox:"0 0 720 864",className:"gblogo"},Object(v.createElement)("g",null,Object(v.createElement)("path",{d:"M432.4 415.6c-2.5-1.7-5.9-1-7.6 1.5-9.9 14.9-30.9 15.7-32 15.7h-.5c-25.9 0-35.8 22.1-36.2 23-1.2 2.8.1 6 2.8 7.2.7.3 1.5.5 2.2.5 2.1 0 4.1-1.2 5-3.3.1-.2 6.9-15.4 24.4-16.4v28.3c-.7 6.1-3.6 10.9-8.7 14.5-5.3 3.7-12.4 5.6-21.1 5.6-10.4 0-18.9-3.6-25.2-10.7-6.4-7.1-9.6-17.2-9.6-30.2l.1-31.2c.5-11.5 3.6-20.6 9.5-27.1 6.4-7.1 14.8-10.7 25.2-10.7 8.7 0 15.8 1.9 21.1 5.6 5.3 3.7 8.3 8.8 8.8 15.4v.7c0 3.8 3.1 6.9 6.9 6.9s6.9-3.1 6.9-6.9v-.7c-1-9.9-5.5-17.7-13.6-23.6-8.1-5.9-18.2-8.8-30.4-8.8-14.5 0-26.2 4.8-35.1 14.3-8.4 8.9-12.8 20.6-13.3 35 0 1-.1 2-.1 3l.1 28.1h-.1c0 15.9 4.5 28.6 13.4 38.1s20.6 14.3 35.1 14.3c12.2 0 22.3-2.9 30.4-8.8 7.4-5.4 11.8-12.5 13.3-21.3l.3-31.4c9.1-2.2 21.5-7.2 29.3-19 2-2.5 1.3-5.9-1.3-7.6zM528.7 94.1h76.7c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2h-76.7c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2zM117.8 94.1h76.7c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2h-76.7c-3.4 0-6.2 2.8-6.2 6.2s2.7 6.2 6.2 6.2z",className:"st2"}),Object(v.createElement)("circle",{cx:"609.3",cy:"150.1",r:"6.2",className:"st2"}),Object(v.createElement)("circle",{cx:"359.8",cy:"130.6",r:"6.2",className:"st2"}),Object(v.createElement)("path",{d:"M244.8 150.2h.3c23.3 0 33.7-14.6 41.6-28.2 2.6-4.5 12.2-19.5 25.8-23.4 16.8-4.9 34.7 2.9 41.7 18.2 1 2.2 3.2 3.5 5.4 3.6h.7c2.2-.1 4.4-1.4 5.4-3.6 7-15.3 24.9-23.1 41.7-18.2 13.6 4 23.2 18.9 25.8 23.4 7.9 13.7 18.3 28.2 41.9 28.2 14.2 0 31-10.6 35.7-30.9 3.9-16.8-3.3-32-19-39.7-3.1-1.5-6.8-.3-8.3 2.8-1.5 3.1-.3 6.8 2.8 8.3 14.9 7.4 13.6 20.5 12.4 25.8-2.4 10.4-11.6 21.4-23.7 21.4-15.5 0-22.9-7.8-31.2-22.1-4.1-7-15.5-24-33-29.1-19.1-5.6-39.3 1.1-50.9 15.8-11.6-14.7-31.8-21.4-50.9-15.8-17.5 5.1-28.9 22.1-33 29.1-8.3 14.3-15.7 22.1-30.9 22.1h-.2c-13.2-.1-21.6-9.3-24-18.4-1.2-4.3-3.7-19 13.1-29 2.9-1.7 3.9-5.5 2.1-8.5-1.8-2.9-5.5-3.9-8.5-2.1-19.3 11.5-22.3 29.7-18.7 42.9 4.4 16.3 18.9 27.3 35.9 27.4z",className:"st2"}),Object(v.createElement)("path",{d:"M360 734L360.1 734 360.1 734 360 734z",className:"st2"}),Object(v.createElement)("circle",{cx:"108.1",cy:"150.1",r:"6.2",className:"st2"}),Object(v.createElement)("circle",{cx:"90.7",cy:"88",r:"6.2",className:"st2"}),Object(v.createElement)("circle",{cx:"631.3",cy:"88",r:"6.2",className:"st2"}),Object(v.createElement)("circle",{cx:"664.5",cy:"485.3",r:"6.2",className:"st2"}),Object(v.createElement)("circle",{cx:"639.6",cy:"627.1",r:"6.2",className:"st2"}),Object(v.createElement)("circle",{cx:"599.8",cy:"644.8",r:"6.2",className:"st2"}),Object(v.createElement)("path",{d:"M231.9 111.2c0 9.2 7.5 16.7 16.7 16.7s16.7-7.5 16.7-16.7-7.5-16.7-16.7-16.7c-9.2-.1-16.7 7.4-16.7 16.7zm16.7-4.4c2.4 0 4.4 2 4.4 4.4 0 2.4-2 4.4-4.4 4.4-2.4 0-4.4-2-4.4-4.4 0-2.4 2-4.4 4.4-4.4zM473.6 127.9c9.2 0 16.7-7.5 16.7-16.7s-7.5-16.7-16.7-16.7-16.7 7.5-16.7 16.7 7.5 16.7 16.7 16.7zm0-21.1c2.4 0 4.4 2 4.4 4.4 0 2.4-2 4.4-4.4 4.4-2.4 0-4.4-2-4.4-4.4 0-2.4 2-4.4 4.4-4.4zM376.7 121.6c-3.2 1.2-4.8 4.7-3.6 7.9 1.2 3.2 4.7 4.8 7.9 3.7 1-.4 25-8.4 43.4 20.2 1.2 1.8 3.2 2.8 5.2 2.8 1.1 0 2.3-.3 3.3-1 2.9-1.8 3.7-5.7 1.9-8.5-19.2-29.7-46.4-29.4-58.1-25.1zM343.3 121.6c-.9-.3-9.1-3.2-20.3-1.5-10.4 1.5-25.3 7.4-37.7 26.7-1.8 2.9-1 6.7 1.9 8.5 1 .7 2.2 1 3.3 1 2 0 4-1 5.2-2.8 18.3-28.6 42.3-20.6 43.4-20.2 3.2 1.2 6.7-.5 7.9-3.7 1.2-3.2-.5-6.8-3.7-8zM627.8 138.5l30.1-34.2v49.3c0 3.4 2.8 6.2 6.2 6.2s6.2-2.8 6.2-6.2V88c0-2.6-1.6-4.9-4-5.8-2.4-.9-5.1-.2-6.8 1.7l-40.9 46.5c-2.3 2.6-2 6.5.6 8.7 2.4 2.3 6.3 2 8.6-.6zM56.8 159.9c3.4 0 6.2-2.8 6.2-6.2v-49.3l30.1 34.2c2.3 2.6 6.2 2.8 8.7.6 2.6-2.3 2.8-6.2.6-8.7L61.5 83.9c-1.7-1.9-4.4-2.6-6.8-1.7-2.4.9-4 3.2-4 5.8v65.7c0 3.4 2.7 6.2 6.1 6.2zM493.4 166c-2.9-.2-5.6 1.8-6.3 4.6-.7 2.9.7 5.9 3.3 7.1 9.8 4.6 18.7 6.4 26.7 6.4 15.3 0 27.5-6.7 36-13.7 13.6-11.2 20.6-25.3 20.9-25.9 1.4-2.9.4-6.4-2.4-8-6.3-3.7-17.2-6-33.8 4.1-8.3 5.1-14.7 11.2-15.8 12.3-15.2 13.4-27.9 13.1-28.6 13.1zm36.9-3.9l.3-.3c4.7-4.7 18-15.6 28.4-16.1-3 4.3-7.5 10.1-13.6 15.2-9 7.4-18.6 11-28.8 10.8 4.2-2.2 8.9-5.4 13.7-9.6zM151.4 136.5c-2.8 1.6-3.8 5.1-2.4 8 .3.6 7.3 14.7 20.9 25.9 8.5 7 20.6 13.7 36 13.7 8.1 0 17-1.8 26.7-6.4 2.7-1.3 4-4.2 3.3-7.1-.7-2.9-3.3-4.8-6.3-4.7-.5 0-13.3.4-28.5-13-1.1-1.1-7.5-7.2-15.8-12.3-16.6-10-27.6-7.7-33.9-4.1zm41.4 25.6c4.7 4.2 9.4 7.3 13.7 9.6-21.6.2-35.9-16.3-42.4-26 10.4.5 23.7 11.4 28.4 16.1l.3.3z",className:"st2"}),Object(v.createElement)("path",{d:"M671.8 664.6c-6.2-5.2-13-8.2-19.3-9.9 2.4-1.8 4.7-3.9 6.7-6.2 15.3-18 15.4-44.5.2-61.7-2.3-2.6-6.2-2.8-8.7-.5-2.6 2.3-2.8 6.2-.5 8.7 11.1 12.6 10.9 32.1-.4 45.5-9.2 10.8-26.7 13.4-31.9 14-15.7 1.7-33.3 5.3-42.8 26.8-1.5 3.3-2.4 7-2.6 11-2.2-.7-4.6-1.1-7-1.1-12.5 0-22.7 10.2-22.7 22.7 0 8.6 4.8 16.1 11.9 19.9-2.1 1.9-4.1 4-5.9 6.4-21-28.3-54.6-46.1-91.6-46.1-5.3 0-10.6.4-15.7 1.1 30.4-9.3 58.7-23.8 84.5-43 33.3-24.9 61-57.4 80-93.9 20-38.4 30.1-79.9 30.1-123.1v-.8-.2-.3c-.2-35.1-8-66.7-19.1-93.9 4.1.8 8 1.1 11.5 1.1 25.9 0 37.3-17.8 38.5-19.9 5.6-9.4 6.5-20.8 3.3-31.1.1-.3.1-.7.1-1.1V176.3c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2V271c-10.5-9.1-25.7-10.1-32-10.1-12.2.1-19.8-1.8-25.4-11.4-4.7-8.1-2-16.5 2.7-21.3 5.9-6 14.3-6.8 22.5-2.3 3 1.6 6.8.6 8.4-2.4 1.6-3 .6-6.8-2.4-8.4-13-7.2-27.6-5.4-37.3 4.4-9.6 9.8-11.4 24.3-4.6 36.1 8.9 15.3 22.4 17.5 35.7 17.5h.5c4 0 16.9.6 24.3 7.6 9.6 9.1 12.1 23.4 5.8 34 0 0-.1.1-.1.2-.5.9-12.4 21.1-45.6 10.5-10-21.2-21.6-39.2-32.4-53.6l-4.9 3.7 4.9-3.8-2-2.6c-21.3-35.7 3.3-73.7 16.1-89.8l7.2-8.2c2.2-2.6 2-6.5-.6-8.7-2.5-2.1-6.1-2-8.4.3-.2.2-1.3 1.3-3 3.2-11.1 11.3-54.5 51.3-96.6 30.4l-1.2-.8-.6-.4c-37.7-20.3-74.9-32-110.4-35-4.6-10.5-10.7-18.5-18.4-18.5-7.8 0-13.9 8.1-18.6 18.8-49.7 2.2-111.5 34.3-114.1 35.6-42.3 21.3-85.9-18.9-97-30.2-1.7-1.9-2.9-3-3-3.2-2.3-2.3-5.9-2.4-8.4-.3-2.6 2.2-2.8 6.1-.6 8.7l7.7 8.7c4.5 5.6 10.2 13.7 15 23.4 12 24.3 12.2 46.4.7 65.8-14.3 17.8-25.9 36.5-34.8 56.2-33.5 10.9-45.5-9.5-46-10.4 0-.1-.1-.1-.1-.2-6.3-10.6-3.8-24.9 5.8-34 7.4-7 20.3-7.6 24.3-7.6h.1c13.4 0 27.2-2.1 36.1-17.5 6.8-11.8 5-26.4-4.6-36.1-9.7-9.9-24.3-11.6-37.3-4.4-3 1.6-4.1 5.4-2.4 8.4 1.6 3 5.4 4.1 8.4 2.4 8.3-4.5 16.7-3.7 22.5 2.3 4.7 4.8 7.3 13.2 2.7 21.3-5.5 9.5-13 11.4-25 11.4h-.4c-5.5 0-18.3.8-28.5 7.4v-90.3c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2v104c-6.8 12.2-7.2 27.1-.2 39.1.7 1.3 5 8.5 14.6 13.9 5.5 3.1 13.4 6 23.9 6 3.8 0 8-.4 12.5-1.3-10.8 29-16.2 60.2-16.4 94.2v1.1c0 61.4 21.6 121.7 60.8 169.8 34.7 42.6 81.9 74.2 134.2 90.3-5.5-.8-11.1-1.2-16.7-1.2-36.7 0-70 17.5-91 45.4-1.7-2.2-3.6-4.3-5.7-6.1 6.6-4 11.1-11.2 11.1-19.5 0-12.5-10.2-22.7-22.7-22.7-2.3 0-4.5.4-6.6 1-.3-3.9-1.2-7.6-2.6-10.9-9.6-21.5-27.1-25.1-42.8-26.8-5.2-.6-22.7-3.2-31.9-14-11.6-13.1-11.8-32.6-.7-45.2 2.3-2.6 2-6.5-.5-8.7-2.6-2.3-6.5-2-8.7.5-15.1 17.2-15 43.7.2 61.7 2 2.4 4.3 4.4 6.7 6.2-6.3 1.7-13.1 4.8-19.3 9.9-14.7 12.1-22.2 32.3-22.4 59.8-.5 2.5.6 5.1 2.8 6.5 1 .6 2.1.9 3.2.9.4 0 .9-.1 1.3-.2h.1c.2 0 .3-.1.5-.2.3-.1.7-.2 1-.4.1 0 .1-.1.2-.1 1-.6 1.9-1.4 2.5-2.4 2.4-3.1 12.3-7 20.5-8.7 32.1-7 38.8-28.7 37.8-39.1-.3-3.4-3.3-5.9-6.7-5.6-3.4.3-5.9 3.3-5.6 6.7 0 .1.1 1.9-.5 4.6-1.5 6.2-7 16.9-27.6 21.4h-.2c-2.4.5-9.6 2.2-16.3 5.3 1.8-17.8 7.5-30.8 17.2-38.9 14.9-12.4 34.6-8.9 34.8-8.8.7.1 1.3.1 1.9 0 3.3.7 6.1 1.1 8.2 1.3 16.5 1.8 26.6 5.4 32.9 19.5 4.9 11.1-1.4 23.9-9.9 30.3-4.3 3.3-15.8 9.8-28.7-.8-2.6-2.2-6.5-1.8-8.7.8-2.2 2.6-1.8 6.5.8 8.7 5.8 4.8 12.3 7.6 19 8.4-8.6 7-14.4 15.8-17 20.4-8.4 14.5-15.2 22.3-26.5 22.4V733c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2v50.2c0 2.5 1.5 4.6 3.6 5.6 1.1.8 2.4 1.4 3.8 1.4h144c2.2 0 4-1.1 5.2-2.8.8-.8 1.5-1.8 1.8-3 5.7-22.1 25.6-37.5 48.4-37.5 20.4 0 38.5 12.4 46.2 30.9h-13.2c-5.4-13.3-18.4-22.2-33.1-22.2-16.1 0-30.3 10.9-34.6 26.4-.9 3.3 1.1 6.7 4.3 7.6 3.3.9 6.7-1.1 7.6-4.3 2.8-10.2 12.1-17.3 22.6-17.3 7.8 0 14.8 3.8 19.1 9.8h-3.6c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h12.5c.2 0 .5.1.7.1.3 0 .6 0 .8-.1h24.8c3.4 0 6.2-2.8 6.2-6.2 0-.3 0-.6-.1-.9.1-.8.1-1.7-.1-2.6-7.3-27.1-32.1-46-60.2-46-27.2 0-51.1 17.6-59.4 43.3h-32.3c2.6-8.3 6.1-16 10.5-23.2.3-.4.5-.8.8-1.2 18.3-28.7 50.3-47.1 85.8-47.1 21 0 41.2 6.4 58.3 18.4.5.3 1 .6 1.5.7 2.6 3.1 5.2 6.4 7.7 9.8.6.8 1.1 1.6 1.7 2.4-.6 12.7 6.3 26 20.6 39.6.5 1.5 1 2.8 1.3 3.8v1.3c0 3.4 2.8 6.2 6.2 6.2 2.9 0 5.2-1.9 5.9-4.6 0-.1.9-3.1 2.7-8.1 12.9-12.6 19.3-24.9 19.2-36.8.8-1.2 1.7-2.5 2.6-3.7 2.8-3.8 5.7-7.5 8.7-11 17-11.8 36.9-18 57.7-18 44.8 0 84 29.2 97 71.5h-32.3c-8.2-25.7-32.1-43.3-59.4-43.3-28.1 0-52.8 18.9-60.2 46-.3 1-.3 2 0 3v.5c0 3.4 2.8 6.2 6.2 6.2h54.2c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2h-19.7c4.3-6 11.3-9.8 19.1-9.8 10.7 0 20 7.2 22.7 17.6.7 2.8 3.2 4.6 6 4.6.5 0 1-.1 1.5-.2 3.3-.8 5.3-4.2 4.5-7.5-4.1-15.8-18.3-26.9-34.7-26.9-14.6 0-27.6 8.9-33.1 22.2h-12.5c7.6-18.5 25.8-30.9 46.2-30.9 22.8 0 42.7 15.4 48.4 37.5.1.5.4 1 .6 1.5.8 2.5 3.1 4.3 5.9 4.3H664c3.4 0 6.2-2.8 6.2-6.2v-.4-1.6c.1-.6.1-1.2.1-1.8 0-.1 0-.2-.1-.3V733c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2v42c-10.4-.8-16.9-8.5-24.9-22.3-2.6-4.4-8-12.7-16-19.5 5.5-1.2 10.8-3.8 15.7-7.9 2.6-2.2 3-6.1.8-8.7-2.2-2.6-6.1-3-8.7-.8-12.8 10.6-24.3 4.1-28.7.8-8.5-6.4-14.8-19.3-9.9-30.3 6.3-14.1 16.4-17.8 32.9-19.5 2.1-.2 4.9-.6 8.2-1.3.6.1 1.3.1 2 0 .2 0 19.7-3.6 34.7 8.8 9.8 8.1 15.6 21.1 17.3 39-6.8-3.2-14.1-4.9-16.4-5.4h-.2c-20.5-4.5-26.1-15.1-27.6-21.3-.6-2.6-.6-4.4-.5-4.6.3-3.4-2.2-6.4-5.6-6.7-3.4-.3-6.4 2.2-6.7 5.6-1 10.5 5.7 32.1 37.9 39.1 8.3 1.8 18.8 5.9 20.7 9 0 0 0 .1.1.1.3.4.6.8.9 1.1.1.1.2.1.3.2.3.2.6.5.9.6.1.1.3.2.4.2.3.2.6.3.9.4.1 0 .3.1.4.1.4.1.9.2 1.4.2.4 0 .7 0 1.1-.1.1 0 .2 0 .3-.1.3-.1.6-.2 1-.3h.1c.3-.1.5-.3.8-.4l.1-.1c.2-.1.4-.3.5-.4.1-.1.3-.2.4-.4l.4-.4c.1-.2.3-.3.4-.5.1-.2.2-.3.3-.5.1-.2.2-.3.3-.5.1-.2.1-.4.2-.6.1-.2.1-.4.2-.6 0-.2.1-.4.1-.5 0-.2.1-.4.1-.7v-.1c-.1-28.3-7.7-48.8-22.6-61.1zM152.9 777.7H87.8c5.5-5.6 9.4-12.3 12.4-17.5 2.6-4.5 12.2-19.5 25.8-23.4 16-4.7 31 .8 38.4 13.5-4.9 8.5-8.8 17.7-11.5 27.4zm1.7-53.7c-5.7 0-10.3-4.6-10.3-10.3 0-5.7 4.6-10.3 10.3-10.3s10.3 4.6 10.3 10.3c0 5.7-4.7 10.3-10.3 10.3zm366.6-78.1l.9 1.1-.9-1.1zm.2-6.2c-58.4-6.8-100.6 18.3-125.8 40.5-10.9 9.6-19.5 19.5-26 27.9-1.2-.8-2.3-1.6-3.3-2.1v-17.6c47.3-47.5 94.3-61.7 125.5-65.2 20.7-2.3 37.4-.4 47.4 1.5-5.7 5.3-11.6 10.3-17.8 15zm73.3-87.2c-6 11.5-12.9 22.5-20.5 33.1-7.9-2.5-17.8-4.8-29.7-5.9 26.5-33.6 43.3-73.7 48.7-116 8.6-1 20.5-4.7 29.6-10.6-2.4 34.7-11.8 68.1-28.1 99.4zm-42.1-111.6l7.2-.3c2.4 10.7 10.5 19.3 21.1 22.2-5.6 42.8-23.4 83.2-51.8 116.2-13.7 0-29.6 1.6-47.6 5.5 42-34.2 69.4-85.7 71.1-143.6zm-117.5 158c-4 1.6-6.8 2.9-8.2 3.5-16.6 6.6-34.4 10.9-53 12.3l165.9-165.9c-5 66.8-46.6 123.4-104.7 150.1zm188.3-164.7c-.2 5.6-15.5 14.7-29 16.9-1.9.3-3.8.5-5.6.5-2.4 0-4.7-.5-6.8-1.4-6.3-2.7-10.7-8.9-10.7-16.1 0-7.2 4.4-13.4 10.7-16.1 2.1-.9 4.4-1.4 6.8-1.4 1.8 0 3.7.2 5.6.5 13.5 2.2 28.7 11.3 29 16.8v.3zM565.5 276l2.6 3.5c22.7 30.3 49.3 77.2 54.4 135.6-9-5.8-20.8-9.5-29.3-10.5-6.4-50.6-28.9-96.3-62.2-131.6 1.4-2.9 2.2-6.2 2.2-9.6 0-4.6-1.4-8.9-3.7-12.4l28.4-32.4c-5.4 20.6-2.8 40.1 7.6 57.4zm-82.9-70.1l1.3.9.7.4c9.9 5 20.5 7.5 31.5 7.5 11.6 0 23.7-2.8 35.9-8.4l-32 36.5c-2.9-1.4-6.1-2.1-9.6-2.1-4.5 0-8.6 1.3-12.1 3.5-31.5-23-68.8-38.3-109.4-43.3-1-7.3-3-17.7-6-27.9 32.1 3.6 65.6 14.6 99.7 32.9zm38.2 57.5c0 4.5-3 8.4-7.1 9.8-1 .3-2.1.5-3.2.5h-1c-4.6-.4-8.3-3.9-9.1-8.3-.1-.6-.2-1.3-.2-1.9 0-.7.1-1.3.2-2 .9-4.5 4.7-8 9.4-8.3H511.1c4.6.3 8.5 3.6 9.5 8 .1.6.2 1.1.2 1.7-.1.1 0 .3 0 .5zm-131.4-49.9c37.2 4.9 71.6 19.1 100.7 40.1-1.5 3-2.3 6.3-2.3 9.9 0 4.5 1.3 8.6 3.6 12.2l-49.8 56.8c-2.3 2.6-2 6.5.6 8.7 1.2 1 2.6 1.5 4.1 1.5 1.7 0 3.4-.7 4.7-2.1l49.7-56.7c3 1.5 6.3 2.3 9.9 2.3 4.6 0 8.8-1.4 12.3-3.7 31 33.2 51.9 75.8 58.1 123-10.7 3-19 11.8-21.2 22.8l-7.1.3c-1.5-45.7-19.2-89.3-50.1-123.2-2.3-2.5-6.2-2.7-8.7-.4-2.5 2.3-2.7 6.2-.4 8.7 27.2 29.8 43.4 67.6 46.5 107.6L473.5 355c-2.4-2.4-6.3-2.4-8.7 0-2.4 2.4-2.4 6.3 0 8.7l71.4 71.4-176 176-176-176 70.8-70.8c2.4-2.4 2.4-6.3 0-8.7-2.4-2.4-6.3-2.4-8.7 0l-65.7 65.7c3.5-45.5 23.9-86.4 55-116.2l31 35.4c1.2 1.4 2.9 2.1 4.7 2.1 1.4 0 2.9-.5 4.1-1.5 2.6-2.3 2.8-6.2.6-8.7l-31.1-35.5c28-23.4 63.1-38.5 101.6-41.4l-52.8 52.3c-2.4 2.4-2.4 6.3 0 8.7 1.2 1.2 2.8 1.8 4.4 1.8 1.6 0 3.1-.6 4.4-1.8l58-57.4 56.3 56.3c2.4 2.4 6.3 2.4 8.7 0 2.4-2.4 2.4-6.3 0-8.7l-51.2-51.2c31.7 2.4 61.9 13 88.2 31.1 2.8 1.9 6.7 1.2 8.6-1.6 1.9-2.8 1.2-6.7-1.6-8.6-30.4-20.9-65.8-32.5-102.8-33.6v-4.4c11.6-2.8 20.9-12.7 22.7-24.9zm-180.7 74.3c3.5 0 6.8-.8 9.7-2.2l8.9 10.2c-35.3 33.7-57.8 80.6-59.6 132.7l-5-.3c-2.4-11.7-11.5-20.9-23.2-23.3 6.1-46.3 26.5-88.1 56.5-120.9 3.7 2.4 8 3.8 12.7 3.8zm-10.3-22.6c0-.5 0-.9.1-1.4 0-.3.1-.5.1-.8.9-4.4 4.7-7.8 9.3-8.1h.7c4.7 0 8.7 3.2 9.9 7.6.2.9.4 1.8.4 2.7 0 .7-.1 1.4-.2 2.1-.9 4.4-4.7 7.8-9.3 8.1h-.8c-1.3 0-2.6-.3-3.7-.7-3.7-1.4-6.5-5.2-6.5-9.5zm-35.8 175.4l5.1.3c1.7 58 29.2 109.6 71.3 143.8-18.1-4-34-5.6-47.8-5.7-28.2-32.9-46.1-73.1-51.7-115.7 11.5-2.4 20.6-11.3 23.1-22.7zm17.9 8.2l165.9 165.9C258 608 187.2 537.2 180.5 448.8zm162.7-249c2.7-18.7 11.9-43.7 16.7-45.7 5.5 2.1 14 28 16.6 45.6.5 3.5.8 6.7.8 9.3 0 1.1-.1 2.1-.3 3.1-1.5 8.1-8.6 14.3-17.2 14.3s-15.7-6.2-17.2-14.3c-.2-1-.3-2.1-.3-3.1.1-2.7.4-5.8.9-9.2zm10.8 38.5v4.3c-44.6 1.4-85.4 18.1-117.4 44.9l-8.8-10.1c2.3-3.5 3.7-7.8 3.7-12.3 0-3.8-1-7.4-2.6-10.5 29.3-21.5 64-36 101.7-41.1 1.7 12.4 11.2 22.4 23.4 24.8zm-152.7-23.6c11 0 21.6-2.5 31.6-7.5.6-.3 57.7-30 103.9-34-3 10.1-5 20.6-6 27.8-41.1 5.1-79 21-110.7 44.6-3.4-2-7.2-3.1-11.4-3.1-3.5 0-6.8.8-9.7 2.2l-33.6-38.3c12.3 5.5 24.3 8.3 35.9 8.3zm-49.9 61.9l.5-.7c10.4-17.2 13-36.8 7.8-57.4l30 34.3c-2.3 3.5-3.7 7.8-3.7 12.3 0 3.3.7 6.4 2 9.3-32.7 35.2-54.7 80.4-61 130.4-8.9 1.4-20.7 5.2-29.6 10.9 3.5-52.8 21.2-98.5 54-139.1zM96.9 434c.2-5.8 16.3-13.8 29-16.4 2.8-.6 5.4-.9 7.6-.9 1.7 0 3.2.2 4.8.7 7.3 2.1 12.7 8.8 12.7 16.8s-5.4 14.7-12.7 16.8c-1.5.4-3.1.7-4.8.7-2.3 0-4.9-.3-7.6-.9-12.7-2.7-28.8-10.7-29-16.5v-.3zm.6 18.4c8.9 5.8 20.8 9.6 29.6 11 5.3 42.4 22.1 82.6 48.7 116.2-11.9 1.1-21.8 3.3-29.8 5.8-28.7-39.4-45.3-84.9-48.5-133zM154.9 597c-.3-.4-.6-.7-.9-1.1 30.1-8.3 63-3.9 86.1 1.6 27.9 6.7 48.3 16.4 48.5 16.5l.1-.2c22.1 8.8 46.2 13.7 71.4 13.7 25.1 0 49.1-4.8 71.1-13.6l.6-.3c2.6-1.1 5.3-2.2 7.8-3.4 8.5-3.5 22.8-8.7 40-12.8 23.3-5.6 56.3-10 86.4-1.6-5.2 6.4-10.6 12.5-16.4 18.4-8.4-2.3-29.8-6.7-58.7-3.6-31.4 3.4-77.6 16.8-124.8 60.4v-10.9c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2v10.3c-46.9-43.1-92.9-56.4-124.1-59.8-29.6-3.2-51.3 1.6-59.2 3.8-5.2-5.4-10.5-11.3-15.5-17.4zm26.3 27.8c10-2 26.9-4 48-1.6 55.5 6.2 98.1 37.9 124.8 64.5v18.1c-.9.5-1.9 1.1-3 1.9-6.5-8.3-15-18-25.7-27.4-25.2-22.3-67.6-47.5-126.2-40.5v.1c-6.2-4.8-12.2-9.8-17.9-15.1zm155.3 98c-11.7-15-24.5-26.3-37.3-34.8l.1-.3c-.3-.1-.6-.2-.9-.2-21.3-13.9-42.7-20-59.9-22.5-8.1-4.2-16.1-8.9-23.8-14 37.7-1.1 71.9 11.7 102.1 38.2 10.4 9.1 18.6 18.5 24.8 26.6-1.9 2.1-3.6 4.4-5.1 7zm29.9 37.5c-1.5 1.8-3.1 3.6-4.9 5.4-.4.4-.9.9-1.4 1.3l-.1.1-.1.1v-.2c-.2-.2-.5-.4-.7-.7-2-1.9-3.7-3.8-5.3-5.7-7.3-8.7-10.5-16.8-9.4-24.2.1-.6.2-1.2.4-1.8.8-3.2 2.3-6 4.1-8.4 1.5-2 3.2-3.7 4.9-5.2 1.5-1.3 3-2.4 4.3-3.3.6-.4 1.1-.7 1.6-1 0 0 .1 0 .1-.1h.1c.7.4 1.4.9 2.3 1.5 1.2.8 2.6 1.9 4 3.1 1.8 1.6 3.6 3.5 5.1 5.6 1.8 2.6 3.3 5.5 3.9 8.8 0 .2.1.5.2.7 1.1 7.3-2 15.3-9.1 24zm24.4-45.1c-.2.2-.4.4-.5.6-2.3 2.6-4.4 5.2-6.3 7.7-1.5-2.6-3.2-5-5-7.1 6.2-8.1 14.6-17.8 25.2-27.1 30-26.4 64.1-39.2 101.5-38.3-7.8 5.1-15.8 9.9-24 14.1-42.8 6.5-72.1 28.7-90.9 50.1zm174.5-11.8c5.7 0 10.3 4.6 10.3 10.3 0 5.7-4.6 10.3-10.3 10.3s-10.3-4.6-10.3-10.3c0-5.6 4.6-10.3 10.3-10.3zm31.2 32.1c13.6 4 23.2 18.9 25.8 23.4 3.2 5.6 7.5 13 13.8 18.8H567c-2.6-9.4-6.3-18.3-11-26.5 7.6-13.6 24.6-20.4 40.5-15.7z",className:"st2"}),Object(v.createElement)("path",{d:"M69.6 301.1c0 10.1 8.2 18.4 18.4 18.4s18.4-8.2 18.4-18.4c0-10.1-8.2-18.4-18.4-18.4s-18.4 8.3-18.4 18.4zm24.4 0c0 3.3-2.7 6-6 6s-6-2.7-6-6 2.7-6 6-6 6 2.7 6 6zM648.7 301.1c0-10.1-8.2-18.4-18.4-18.4-10.1 0-18.4 8.2-18.4 18.4 0 10.1 8.2 18.4 18.4 18.4s18.4-8.2 18.4-18.4zm-24.4 0c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6c-3.3.1-6-2.6-6-6zM666.4 346.9c-2.3-.9-5-.4-6.8 1.4-8.1 8.3-21.4 8-21.6 8h-.2c-3.3 0-6 2.6-6.2 5.9-.1 3.4 2.5 6.3 5.9 6.4.6 0 10.4.3 20.4-4.3v100.9c0 3.4 2.8 6.2 6.2 6.2s6.2-2.8 6.2-6.2V352.6c-.1-2.5-1.6-4.8-3.9-5.7zM55.7 471.4c3.4 0 6.2-2.8 6.2-6.2V364.3c10 4.6 19.8 4.3 20.4 4.3 3.4-.1 6.1-3 5.9-6.4-.1-3.4-3-6.1-6.4-5.9-.1 0-13.5.3-21.6-8-1.8-1.8-4.4-2.3-6.8-1.4-2.3.9-3.8 3.2-3.8 5.7v112.7c-.1 3.4 2.7 6.1 6.1 6.1zM671.3 574.3c0-3.4-2.8-6.2-6.2-6.2h-40c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h40c3.4 0 6.2-2.7 6.2-6.2zM629.8 598c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2h-15.4c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h15.4zM644.8 609.4c0-3.4-2.8-6.2-6.2-6.2h-38.2c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h38.2c3.4 0 6.2-2.7 6.2-6.2zM620.6 627.1c0-3.4-2.8-6.2-6.2-6.2h-29.9c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h29.9c3.4 0 6.2-2.8 6.2-6.2zM565.1 638.6c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h17c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2h-17zM665.1 532.8h-22.3c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h22.3c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2zM665.1 550.5H634c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h31.1c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2zM665.1 497.5h-9.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h9.9c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2zM665.1 515.2h-15.2c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h15.2c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2z",className:"st2"}),Object(v.createElement)("circle",{cx:"55.5",cy:"485.6",r:"6.2",className:"st2"}),Object(v.createElement)("circle",{cx:"80.5",cy:"627.3",r:"6.2",className:"st2"}),Object(v.createElement)("circle",{cx:"120.3",cy:"645",r:"6.2",className:"st2"}),Object(v.createElement)("path",{d:"M54.9 580.7h40c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2h-40c-3.4 0-6.2 2.8-6.2 6.2 0 3.5 2.8 6.2 6.2 6.2zM105.6 585.9H90.2c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h15.4c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2zM119.6 603.5H81.4c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h38.2c3.4 0 6.2-2.8 6.2-6.2 0-3.5-2.8-6.2-6.2-6.2zM135.5 621.1h-29.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h29.9c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2zM131.7 645c0 3.4 2.8 6.2 6.2 6.2h17c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2h-17c-3.4 0-6.2 2.8-6.2 6.2zM54.9 545.4h22.3c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2H54.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2zM54.9 563.1H86c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2H54.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2zM54.9 510.1h9.9c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2h-9.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2zM54.9 527.7h15.2c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2H54.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.5 2.8 6.2 6.2 6.2zM360 767.1c.1-.1 0-.1 0-.2v.2zM641.2 202.7c.1 0 .1 0 0 0 2.8 0 5.3-1.9 6-4.7 2.2-8.8 1.3-16.3-2.9-22.5-6.7-10-19-11.9-20.4-12.1-3.2-.4-6.2 1.6-6.9 4.8-2.3 10.5-1 18.9 4 25.1 7.4 9 19 9.3 20.2 9.4zm-7-20.2c1.2 1.9 1.9 4.1 1.9 6.7-1.8-.7-3.8-1.8-5.2-3.6-1.6-2-2.4-4.6-2.4-7.9 2 1 4.2 2.6 5.7 4.8zM601 113.3c-6.7-10-19-11.9-20.4-12.1-3.2-.4-6.2 1.6-6.9 4.8-2.3 10.5-1 18.9 4 25.1 7.2 9 18.8 9.3 20.1 9.3 2.8 0 5.3-1.9 6-4.7 2.3-8.6 1.4-16.2-2.8-22.4zm-13.5 10.1c-1.6-2-2.4-4.6-2.4-7.9 2.1 1 4.3 2.6 5.7 4.8 1.2 1.9 1.9 4.1 1.9 6.7-1.8-.7-3.8-1.8-5.2-3.6zM97.3 163.4c-1.4.2-13.6 2.1-20.4 12.1-4.1 6.2-5.1 13.7-2.9 22.5.7 2.7 3.2 4.7 6 4.7 1.3 0 12.9-.3 20.1-9.3 5-6.2 6.3-14.7 4-25.1-.6-3.2-3.6-5.3-6.8-4.9zm-6.7 22.2c-1.4 1.8-3.4 2.9-5.3 3.6 0-2.6.7-4.9 1.9-6.7 1.5-2.2 3.7-3.8 5.7-4.8 0 3.3-.8 5.9-2.3 7.9zM139.7 101.2c-1.4.2-13.6 2.1-20.4 12.1-4.1 6.2-5.1 13.7-2.9 22.5.7 2.7 3.2 4.7 6 4.7 1.3 0 12.9-.3 20.1-9.3 5-6.2 6.3-14.7 4-25.1-.7-3.2-3.6-5.3-6.8-4.9zm-6.8 22.2c-1.4 1.8-3.4 2.9-5.3 3.6 0-2.6.7-4.9 1.9-6.7 1.5-2.2 3.7-3.8 5.7-4.8 0 3.3-.7 5.9-2.3 7.9zM555.1 392c.4 3.2 3 5.5 6.1 5.5h.7c3.4-.4 5.8-3.5 5.4-6.9-6.2-54-43.1-92.2-44.7-93.8-2.4-2.4-6.3-2.5-8.7-.1-2.4 2.4-2.5 6.3-.1 8.7.4.4 35.6 36.9 41.3 86.6zM159.1 397.4h.7c3.1 0 5.8-2.3 6.1-5.5 5.7-49.7 40.9-86.2 41.2-86.5 2.4-2.4 2.3-6.4-.1-8.7-2.4-2.4-6.4-2.4-8.7.1-1.6 1.6-38.4 39.8-44.7 93.8-.3 3.4 2.1 6.4 5.5 6.8z",className:"st2"})))),Z=function(e){u()(n,e);var t=F(n);function n(){var e;return a()(this,n),(e=t.apply(this,arguments)).runAjax=e.runAjax.bind(i()(e)),e.runPluginInstall=e.runPluginInstall.bind(i()(e)),e.focusMode=e.focusMode.bind(i()(e)),e.fullFocusMode=e.fullFocusMode.bind(i()(e)),e.selectedMode=e.selectedMode.bind(i()(e)),e.selectedFullMode=e.selectedFullMode.bind(i()(e)),e.backToDash=e.backToDash.bind(i()(e)),e.saveConfig=e.saveConfig.bind(i()(e)),e.state={category:"all",activeTemplate:"",colorPalette:"",fontPair:"",search:null,isFetching:!1,isImporting:!1,isSelected:!1,response:"",isPageSelected:!1,starterSettings:kadenceStarterParams.starterSettings?JSON.parse(kadenceStarterParams.starterSettings):{},selectedPage:"home",progress:"",focusMode:!1,finished:!1,overrideColors:!1,overrideFonts:!1,isOpenCheckColor:!1,isOpenCheckFont:!1,isOpenCheckPast:!1,removePast:!1,templates:kadenceStarterParams.templates?kadenceStarterParams.templates:[],etemplates:kadenceStarterParams.etemplates?kadenceStarterParams.etemplates:[],palettes:kadenceStarterParams.palettes?kadenceStarterParams.palettes:[],fonts:kadenceStarterParams.fonts?kadenceStarterParams.fonts:[],logo:kadenceStarterParams.logo?kadenceStarterParams.logo:"",hasContent:!!kadenceStarterParams.has_content&&kadenceStarterParams.has_content,hasPastContent:!!kadenceStarterParams.has_previous&&kadenceStarterParams.has_previous,isSaving:!1},e}return s()(n,[{key:"saveConfig",value:function(e,t){var n=this;this.setState({isSaving:!0});var r=kadenceStarterParams.starterSettings?JSON.parse(kadenceStarterParams.starterSettings):{};r[e]||(r[e]=""),r[e]=t,new wp.api.models.Settings({kadence_starter_templates_config:JSON.stringify(r)}).save().then((function(e){n.setState({starterSettings:r,isSaving:!1}),kadenceStarterParams.starterSettings=JSON.stringify(r)}))}},{key:"capitalizeFirstLetter",value:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}},{key:"focusMode",value:function(e){this.setState({activeTemplate:e,focusMode:!0,isSelected:!1})}},{key:"fullFocusMode",value:function(e){this.setState({activeTemplate:e,focusMode:!0,isSelected:!0})}},{key:"selectedFullMode",value:function(){this.setState({isSelected:!0})}},{key:"selectedMode",value:function(e){this.setState({selectedPage:e,isPageSelected:!0,isImporting:!0})}},{key:"backToDash",value:function(){this.setState({isFetching:!1,activeTemplate:"",overrideColors:!1,overrideFonts:!1,colorPalette:"",fontPair:"",focusMode:!1,finished:!1,isImporting:!1,isSelected:!1,isPageSelected:!1,progress:"",selectedPage:"home"})}},{key:"runPluginInstallSingle",value:function(e,t){this.setState({progress:"plugins",isFetching:!0});var n=new FormData;n.append("action","kadence_import_install_plugins"),n.append("security",kadenceStarterParams.ajax_nonce),n.append("selected",e),n.append("page_id",t),this.runPageAjax(n)}},{key:"runRemovePast",value:function(e){this.setState({progress:"remove",isFetching:!0});var t=new FormData;t.append("action","kadence_remove_past_import_data"),t.append("security",kadenceStarterParams.ajax_nonce),t.append("selected",e),this.runAjax(t)}},{key:"runPluginInstall",value:function(e){this.setState({progress:"plugins",isFetching:!0});var t=new FormData;t.append("action","kadence_import_install_plugins"),t.append("security",kadenceStarterParams.ajax_nonce),t.append("selected",e),this.runAjax(t)}},{key:"runPageAjax",value:function(e){var t=this;jQuery.ajax({method:"POST",url:kadenceStarterParams.ajax_url,data:e,contentType:!1,processData:!1}).done((function(n,r,a){if(void 0!==n.status&&"newAJAX"===n.status)t.state.progress="contentNew",t.runPageAjax(e);else if(void 0!==n.status&&"pluginSuccess"===n.status){t.setState({progress:"content"});var c=new FormData;c.append("action","kadence_import_single_data"),c.append("security",kadenceStarterParams.ajax_nonce),c.append("selected",t.state.activeTemplate),c.append("page_id",t.state.selectedPage),c.append("override_colors",t.state.overrideColors),c.append("override_fonts",t.state.overrideFonts),c.append("palette",t.state.colorPalette),c.append("font",t.state.fontPair),t.runPageAjax(c)}else void 0!==n.message?t.setState({finished:!0,hasContent:!0,hasPastContent:!0,isFetching:!1,colorPalette:"",fontPair:"",focusMode:!1,isImporting:!1,isSelected:!1,progress:"",response:"<p>"+n.message+"</p>"}):t.setState({finished:!0,hasContent:!0,hasPastContent:!0,isFetching:!1,colorPalette:"",fontPair:"",focusMode:!1,isImporting:!1,isSelected:!1,progress:"",response:'<div class="notice kadence_starter_templates_response notice-error"><p>'+n+"</p></div>"})})).fail((function(e){t.setState({finished:!0,hasContent:!0,hasPastContent:!0,isFetching:!1,colorPalette:"",fontPair:"",focusMode:!1,isImporting:!1,isSelected:!1,progress:"",response:'<div class="notice kadence_starter_templates_response notice-error"><p>Error: '+e.statusText+" ("+e.status+")</p></div>"})}))}},{key:"runAjax",value:function(e){var t=this;jQuery.ajax({method:"POST",url:kadenceStarterParams.ajax_url,data:e,contentType:!1,processData:!1}).done((function(n,r,a){if(void 0!==n.status&&"newAJAX"===n.status)t.state.progress="contentNew",t.runAjax(e);else if(void 0!==n.status&&"customizerAJAX"===n.status){t.setState({progress:"customizer"}),(c=new FormData).append("action","kadence_import_customizer_data"),c.append("security",kadenceStarterParams.ajax_nonce),c.append("wp_customize","on"),t.runAjax(c)}else if(void 0!==n.status&&"afterAllImportAJAX"===n.status){t.setState({progress:"widgets"}),(c=new FormData).append("action","kadence_after_import_data"),c.append("security",kadenceStarterParams.ajax_nonce),t.runAjax(c)}else if(void 0!==n.status&&"pluginSuccess"===n.status){t.setState({progress:"content"}),(c=new FormData).append("action","kadence_import_demo_data"),c.append("security",kadenceStarterParams.ajax_nonce),c.append("selected",t.state.activeTemplate),c.append("palette",t.state.colorPalette),c.append("font",t.state.fontPair),t.runAjax(c)}else if(void 0!==n.status&&"removeSuccess"===n.status){var c;t.setState({progress:"plugins"}),(c=new FormData).append("action","kadence_import_install_plugins"),c.append("security",kadenceStarterParams.ajax_nonce),c.append("selected",t.state.activeTemplate),t.runAjax(c)}else void 0!==n.message?t.setState({finished:!0,hasContent:!0,hasPastContent:!0,isFetching:!1,colorPalette:"",fontPair:"",focusMode:!1,isImporting:!1,isSelected:!1,isPageSelected:!1,progress:"",response:"<p>"+n.message+"</p>"}):t.setState({finished:!0,hasContent:!0,hasPastContent:!0,isFetching:!1,colorPalette:"",fontPair:"",focusMode:!1,isImporting:!1,isSelected:!1,isPageSelected:!1,progress:"",response:'<div class="notice kadence_starter_templates_response notice-error"><p>'+n+"</p></div>"})})).fail((function(e){t.setState({finished:!0,hasContent:!0,hasPastContent:!0,isFetching:!1,colorPalette:"",fontPair:"",focusMode:!1,isImporting:!1,isSelected:!1,isPageSelected:!1,progress:"",response:'<div class="notice kadence_starter_templates_response notice-error"><p>Error: '+e.statusText+" ("+e.status+")</p></div>"})}))}},{key:"render",value:function(){for(var e=this,t=["all"],n=0;n<this.state.templates.length;n++)for(var r=0;r<this.state.templates[n].categories.length;r++)t.includes(this.state.templates[n].categories[r])||t.push(this.state.templates[n].categories[r]);t.map((function(t){return{value:t,label:e.capitalizeFirstLetter(t)}}));var a=function(){var t=("elementor"===e.state.starterSettings.builderType?e.state.etemplates.filter((function(t){return t.slug===e.state.activeTemplate})):e.state.templates.filter((function(t){return t.slug===e.state.activeTemplate})))[0];return Object(v.createElement)("div",{className:"kst-grid-single-site"},Object(v.createElement)("div",{className:"kst-import-selection-item"},Object(v.createElement)("div",{className:"kst-import-selection"},Object(v.createElement)("img",{src:t.pages[e.state.selectedPage].image,alt:t.pages[e.state.selectedPage].title}))),Object(v.createElement)("div",{className:"kst-import-selection-options"},Object(v.createElement)("div",{className:"kst-import-single-selection-options-wrap"},Object(v.createElement)("div",{className:"kst-import-selection-title"},Object(v.createElement)("h2",null,A("Template:","kadence-starter-templates")," ",Object(v.createElement)("span",null,t.name),Object(v.createElement)("br",null)," ",A("Selected Page:","kadence-starter-templates")," ",Object(v.createElement)("span",null,t.pages[e.state.selectedPage].title))),Object(v.createElement)("div",{className:"kst-import-grid-title"},Object(v.createElement)("h2",null,A("Page Template Plugins","kadence-starter-templates"))),Object(v.createElement)("ul",{className:"kadence-required-wrap"},h()(t.plugins,(function(e){var t=e.state,n=e.title,r=e.src;return Object(v.createElement)("li",{className:"plugin-required"},n," - ",Object(v.createElement)("span",{class:"plugin-status"},"notactive"===t?A("Not Installed","kadence-starter-templates"):t)," ","active"!==t&&"thirdparty"===r?Object(v.createElement)("span",{class:"plugin-install-required"},A("Please install and activate this third-party premium plugin")):"")}))),Object(v.createElement)("p",{className:"desc-small note-about-colors"},A("*Single Page templates will follow your website current global colors and typography settings, you can import without effecting your current site. Or you can optionally override your websites global colors and typography by enabling the settings below.","kadence-starter-templates")),Object(v.createElement)(Y,{label:A("Override Your Sites Global Colors?","kadence-starter-templates"),checked:void 0!==e.state.overrideColors&&e.state.overrideColors,onChange:function(t){return e.state.overrideColors?e.setState({overrideColors:!1}):e.setState({isOpenCheckColor:!0})}}),e.state.isOpenCheckColor?Object(v.createElement)(V,{className:"ksp-confirm-modal",title:A("Override Your Sites Colors on Import?","kadence-starter-templates"),onRequestClose:function(){e.setState({isOpenCheckColor:!1})}},Object(v.createElement)("p",{className:"desc-small note-about-colors"},A("This will override the customizer settings for global colors on your current site when you import this page template.","kadence-starter-templates")),Object(v.createElement)("div",{className:"ksp-override-model-buttons"},Object(v.createElement)(G,{className:"ksp-cancel-override",onClick:function(){e.setState({isOpenCheckColor:!1,overrideColors:!1})}},A("Cancel","kadence-starter-templates")),Object(v.createElement)(G,{className:"ksp-do-override",isPrimary:!0,onClick:function(){e.setState({isOpenCheckColor:!1,overrideColors:!0})}},A("Override Colors","kadence-starter-templates")))):null,e.state.overrideColors&&e.state.colorPalette&&Object(v.createElement)(H,null,Object(v.createElement)("h3",null,A("Selected Color Palette","kadence-starter-templates")),h()(e.state.palettes,(function(t){var n=t.palette,r=t.colors;if(n===e.state.colorPalette)return Object(v.createElement)("div",{className:"kst-palette-btn kst-selected-color-palette"},h()(r,(function(e,t){return Object(v.createElement)("div",{key:t,style:{width:22,height:22,marginBottom:0,marginRight:"3px",transform:"scale(1)",transition:"100ms transform ease"},className:"kadence-swatche-item-wrap"},Object(v.createElement)("span",{className:"kadence-swatch-item",style:{height:"100%",display:"block",width:"100%",border:"1px solid rgb(218, 218, 218)",borderRadius:"50%",color:"".concat(e),boxShadow:"inset 0 0 0 ".concat(15,"px"),transition:"100ms box-shadow ease"}}))})))}))),Object(v.createElement)(Y,{label:A("Override Your Sites Fonts?","kadence-starter-templates"),checked:void 0!==e.state.overrideFonts&&e.state.overrideFonts,onChange:function(t){return e.state.overrideFonts?e.setState({overrideFonts:!1}):e.setState({isOpenCheckFont:!0})}}),e.state.isOpenCheckFont?Object(v.createElement)(V,{className:"ksp-confirm-modal",title:A("Override Your Sites Fonts on Import?","kadence-starter-templates"),onRequestClose:function(){e.setState({isOpenCheckFont:!1})}},Object(v.createElement)("p",{className:"desc-small note-about-colors"},A("This will override the customizer typography settings on your current site when you import this page template.","kadence-starter-templates")),Object(v.createElement)("div",{className:"ksp-override-model-buttons"},Object(v.createElement)(G,{className:"ksp-cancel-override",onClick:function(){e.setState({isOpenCheckFont:!1,overrideFonts:!1})}},A("Cancel","kadence-starter-templates")),Object(v.createElement)(G,{className:"ksp-do-override",isPrimary:!0,onClick:function(){e.setState({isOpenCheckFont:!1,overrideFonts:!0})}},A("Override Fonts","kadence-starter-templates")))):null,e.state.fontPair&&e.state.overrideFonts&&Object(v.createElement)(H,null,Object(v.createElement)("h3",{className:"kst-selected-font-pair-title"},A("Selected Font Pair","kadence-starter-templates")),h()(e.state.fonts,(function(t){var n=t.font,r=t.img,a=t.name;if(n===e.state.fontPair)return Object(v.createElement)("div",{className:"kst-selected-font-pair"},Object(v.createElement)("img",{src:r,className:"font-pairing"}),Object(v.createElement)("h4",null,a))}))),"plugins"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.plugin_progress),"content"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.content_progress),"contentNew"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.content_new_progress),e.state.isFetching&&Object(v.createElement)(q,null),!kadenceStarterParams.isKadence&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},Object(v.createElement)("h2",null,A("This Template Requires the Kadence Theme","kadence-starter-templates")),Object(v.createElement)(U,{href:"https://kadence-theme.com/"},A("Get Free Theme","kadence-starter-templates"))),kadenceStarterParams.isKadence&&Object(v.createElement)(H,null,Object(v.createElement)(G,{className:"kt-defaults-save",isPrimary:!0,disabled:e.state.isFetching,onClick:function(){e.runPluginInstallSingle(t.slug,e.state.selectedPage)}},A("Start Importing Page"))))))},c=function(){var t=("elementor"===e.state.starterSettings.builderType?e.state.etemplates.filter((function(t){return t.slug===e.state.activeTemplate})):e.state.templates.filter((function(t){return t.slug===e.state.activeTemplate})))[0],n=!1;return Object(v.createElement)(H,null,Object(v.createElement)("div",{className:"kst-grid-single-site"},Object(v.createElement)("div",{className:"kst-import-selection-item"},Object(v.createElement)("div",{className:"kst-import-selection"},Object(v.createElement)("img",{src:t.pages.home.image,alt:t.name}))),Object(v.createElement)("div",{className:"kst-import-selection-options"},Object(v.createElement)("div",{className:"kst-import-selection-title"},Object(v.createElement)("div",{className:"kst-import-single-selection-options-wrap"},Object(v.createElement)("h2",null,A("Template:","kadence-starter-templates")," ",Object(v.createElement)("span",null,t.name)))))),Object(v.createElement)(V,{className:"kst-import-modal",title:A("Import Starter Template"),onRequestClose:function(){return!e.state.isFetching&&e.setState({activeTemplate:"",colorPalette:"",focusMode:!1,isImporting:!1,progress:""})}},e.state.hasContent&&Object(v.createElement)("div",{className:"kadence_starter_templates_notice"},e.state.hasPastContent?Object(v.createElement)(H,null,kadenceStarterParams.notice_previous):Object(v.createElement)(H,null,kadenceStarterParams.notice)),Object(v.createElement)("h3",null,A("Starter Template Plugins","kadence-starter-templates")),h()(t.plugins,(function(e){var t=e.state,r=(e.title,e.src);"active"!==t&&"thirdparty"===r&&(n=!0)})),n&&Object(v.createElement)("p",{className:"desc-small install-third-party-notice"},A("*This starter template requires premium third-party plugins. Please install missing/inactive premium plugins to import.","kadence-starter-templates")),Object(v.createElement)("ul",{className:"kadence-required-wrap"},h()(t.plugins,(function(e){var t=e.state,n=e.title,r=e.src;return Object(v.createElement)("li",{className:"plugin-required"},n," ","active"!==t&&"thirdparty"===r?Object(v.createElement)("span",{class:"plugin-install-required"},A("Please install and activate this third-party premium Plugin")):"")}))),e.state.colorPalette&&Object(v.createElement)(H,null,Object(v.createElement)("h3",null,A("Selected Color Palette","kadence-starter-templates")),h()(e.state.palettes,(function(t){var n=t.palette,r=t.colors;if(n===e.state.colorPalette)return Object(v.createElement)("div",{className:"kst-palette-btn kst-selected-color-palette"},h()(r,(function(e,t){return Object(v.createElement)("div",{key:t,style:{width:22,height:22,marginBottom:0,marginRight:"3px",transform:"scale(1)",transition:"100ms transform ease"},className:"kadence-swatche-item-wrap"},Object(v.createElement)("span",{className:"kadence-swatch-item",style:{height:"100%",display:"block",width:"100%",border:"1px solid rgb(218, 218, 218)",borderRadius:"50%",color:"".concat(e),boxShadow:"inset 0 0 0 ".concat(15,"px"),transition:"100ms box-shadow ease"}}))})))}))),e.state.fontPair&&Object(v.createElement)(H,null,Object(v.createElement)("h3",{className:"kst-selected-font-pair-title"},A("Selected Font Pair","kadence-starter-templates")),h()(e.state.fonts,(function(t){var n=t.font,r=t.img,a=t.name;if(n===e.state.fontPair)return Object(v.createElement)("div",{className:"kst-selected-font-pair"},Object(v.createElement)("img",{src:r,className:"font-pairing"}),Object(v.createElement)("h4",null,a))}))),e.state.hasPastContent&&Object(v.createElement)(H,null,Object(v.createElement)(Y,{label:A("Delete Previously Imported Posts and Images?","kadence-starter-templates"),checked:void 0!==e.state.removePast&&e.state.removePast,onChange:function(t){return e.state.removePast?e.setState({removePast:!1}):e.setState({removePast:!0})}})),"remove"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.remove_progress),"plugins"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.plugin_progress),"content"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.content_progress),"contentNew"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.content_new_progress),"customizer"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.customizer_progress),"widgets"===e.state.progress&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},kadenceStarterParams.widgets_progress),e.state.isFetching&&Object(v.createElement)(q,null),!kadenceStarterParams.isKadence&&Object(v.createElement)("div",{class:"kadence_starter_templates_response"},Object(v.createElement)("h2",null,A("This Starter Template Requires the Kadence Theme","kadence-starter-templates")),Object(v.createElement)(U,{href:"https://kadence-theme.com/"},A("Get Free Theme","kadence-starter-templates"))),kadenceStarterParams.isKadence&&Object(v.createElement)(H,null,n&&Object(v.createElement)(G,{className:"kt-defaults-save",isPrimary:!0,disabled:e.state.isFetching,onClick:function(){e.state.removePast?e.runRemovePast(t.slug):e.runPluginInstall(t.slug)}},A("Skip and Import with Partial Content")),!n&&Object(v.createElement)(G,{className:"kt-defaults-save",isPrimary:!0,disabled:e.state.isFetching,onClick:function(){e.state.removePast?e.runRemovePast(t.slug):e.runPluginInstall(t.slug)}},A("Start Importing")))))},s=function(){var t=("elementor"===e.state.starterSettings.builderType?e.state.etemplates.filter((function(t){return t.slug===e.state.activeTemplate})):e.state.templates.filter((function(t){return t.slug===e.state.activeTemplate})))[0];return Object(v.createElement)(H,null,Object(v.createElement)("div",{className:"kst-import-selection-options"},Object(v.createElement)("div",{className:"kst-import-grid-title"},Object(v.createElement)("h2",null,A("Page Templates","kadence-starter-templates"))),Object(v.createElement)("div",{className:"templates-grid"},h()(t.pages,(function(t){var n=t.title,r=t.id,a=t.image;return Object(v.createElement)("div",{className:"kst-template-item"},Object(v.createElement)(G,{key:r,className:"kst-import-btn",isSmall:!0,onClick:function(){return e.selectedMode(r)}},Object(v.createElement)(j.a,{offsetBottom:200},Object(v.createElement)("img",{src:a.replace(r,r+"-thumb"),alt:n})),Object(v.createElement)("div",{className:"demo-title"},Object(v.createElement)("h4",null,n," ",Object(v.createElement)("span",null,A("View Details","kadence-starter-templates"))))))}))),Object(v.createElement)("div",{className:"kst-import-selection-bottom"},Object(v.createElement)(G,{className:"kt-import-fullsite",isPrimary:!0,onClick:function(){return e.selectedFullMode()}},A("Import Full Site","kadence-starter-templates")))))},o=function(){return Object(v.createElement)("div",{className:"templates-grid"},h()("elementor"===e.state.starterSettings.builderType?e.state.etemplates:e.state.templates,(function(t){var n=t.name,r=t.key,a=t.slug,c=t.image,s=(t.content,t.categories),o=t.keywords,i=t.pro,l=t.pages;if(("all"===e.state.category||s.includes(e.state.category))&&(!e.state.search||o&&o.some((function(t){return t.toLowerCase().includes(e.state.search.toLowerCase())}))))return Object(v.createElement)("div",{className:"kst-template-item"},Object(v.createElement)(G,{key:r,className:"kst-import-btn",isSmall:!0,isDisabled:void 0!==i&&i&&"true"!==kadenceStarterParams.pro,onClick:function(){return e.fullFocusMode(a)}},Object(v.createElement)(j.a,{offsetBottom:200},Object(v.createElement)("img",{src:l?l.home.image.replace("home","home-thumb"):c,alt:n})),Object(v.createElement)("div",{className:"demo-title"},Object(v.createElement)("h4",null,n))),void 0!==i&&i&&Object(v.createElement)(H,null,Object(v.createElement)("span",{className:"kb-pro-template"},A("Membership","kadence-starter-sites")),"true"!==kadenceStarterParams.pro&&Object(v.createElement)("div",{className:"kt-popover-pro-notice"},Object(v.createElement)("h2",null,A("Kadence Full Membership required for this item","kadence-starter-sites")," "),Object(v.createElement)(U,{href:"https://www.kadencewp.com/product/kadence-membership/"},A("Upgrade to Membership","kadence-starter-sites")))))})))},i=function(){var t=("elementor"===e.state.starterSettings.builderType?e.state.etemplates.filter((function(t){return t.slug===e.state.activeTemplate})):e.state.templates.filter((function(t){return t.slug===e.state.activeTemplate})))[0];return Object(v.createElement)("div",{className:"kst-grid-single-site"},Object(v.createElement)("div",{className:"kst-import-selection-item"},Object(v.createElement)("div",{className:"kst-import-selection"},Object(v.createElement)("img",{src:t.pages[e.state.selectedPage].image,alt:t.pages[e.state.selectedPage].title}))),Object(v.createElement)("div",{className:"kst-import-selection-options"},Object(v.createElement)("div",{className:"kst-import-single-selection-options-wrap"},Object(v.createElement)("div",{className:"kst-import-selection-title"},Object(v.createElement)("h2",null,A("Template:","kadence-starter-templates")," ",Object(v.createElement)("span",null,t.name),Object(v.createElement)("br",null)," ",A("Selected Page:","kadence-starter-templates")," ",Object(v.createElement)("span",null,t.pages[e.state.selectedPage].title))),Object(v.createElement)("div",{className:"kst-import-grid-title"},Object(v.createElement)("h2",null,A("Import complete!","kadence-starter-templates")),Object(v.createElement)("div",{class:"kadence_starter_templates_finished"},Object(v.createElement)("div",{dangerouslySetInnerHTML:{__html:e.state.response}}))))))},l=function(){var t=("elementor"===e.state.starterSettings.builderType?e.state.etemplates.filter((function(t){return t.slug===e.state.activeTemplate})):e.state.templates.filter((function(t){return t.slug===e.state.activeTemplate})))[0];return Object(v.createElement)("div",{className:"kst-grid-single-site"},Object(v.createElement)("div",{className:"kst-import-selection-item"},Object(v.createElement)("div",{className:"kst-import-selection"},Object(v.createElement)("img",{src:t.pages.home.image}))),Object(v.createElement)("div",{className:"kst-import-selection-options"},Object(v.createElement)("div",{className:"kst-import-single-selection-options-wrap"},Object(v.createElement)("div",{className:"kst-import-selection-title"},Object(v.createElement)("h2",null,A("Template:","kadence-starter-templates")," ",Object(v.createElement)("span",null,t.name))),Object(v.createElement)("div",{className:"kst-import-grid-title"},Object(v.createElement)("h2",null,A("Import complete!","kadence-starter-templates")),Object(v.createElement)("div",{class:"kadence_starter_templates_finished"},Object(v.createElement)("div",{dangerouslySetInnerHTML:{__html:e.state.response}}))))))};return Object(v.createElement)(H,null,Object(v.createElement)("div",{class:"kadence_theme_dash_head"},Object(v.createElement)("div",{class:"kadence_theme_dash_head_container"},Object(v.createElement)("div",{class:"kadence_theme_dash_logo"},Object(v.createElement)("img",{src:this.state.logo})),this.state.focusMode&&Object(v.createElement)("div",{class:"kadence_theme_dash_back"},this.state.isPageSelected?Object(v.createElement)(K,{text:A("Back to Individual Pages Grid")},Object(v.createElement)(G,{className:"kt-import-back",icon:C,onClick:function(){return!e.state.isFetching&&e.setState({colorPalette:"",finished:!1,selectedPage:"home",focusMode:!0,isSelected:!1,isPageSelected:!1,isImporting:!1,progress:""})}})):Object(v.createElement)(K,{text:A("Back to Starter Templates Grid")},Object(v.createElement)(G,{className:"kt-import-back",icon:C,onClick:function(){return e.backToDash()}}))),this.state.finished&&Object(v.createElement)("div",{class:"kadence_theme_dash_back"},Object(v.createElement)(K,{text:A("Back to Starter Templates Grid")},Object(v.createElement)(G,{className:"kt-import-back",icon:C,onClick:function(){return e.backToDash()}}))),Object(v.createElement)("div",{class:"kadence_starter_builder_type"},this.state.starterSettings&&this.state.starterSettings.builderType&&Object(v.createElement)(W,{className:"my-container-class-name",contentClassName:"kst-type-popover",position:"bottom left",renderToggle:function(t){var n=t.isOpen,r=t.onToggle;return Object(v.createElement)(G,{onClick:r,"aria-expanded":n,icon:"blocks"===e.state.starterSettings.builderType?Q:X},"blocks"===e.state.starterSettings.builderType?"Gutenberg":"Elementor",Object(v.createElement)($,{className:"kst-chev",icon:T}))},renderContent:function(t){t.isOpen;var n=t.onToggle;return Object(v.createElement)("div",null,Object(v.createElement)(J,{icon:Q,className:"blocks"===e.state.starterSettings.builderType?"active-item":"",isSelected:"blocks"===e.state.starterSettings.builderType,onClick:function(){e.saveConfig("builderType","blocks"),e.setState({activeTemplate:"",colorPalette:"",finished:!1,selectedPage:"home",focusMode:!1,isSelected:!1,isPageSelected:!1,isImporting:!1,progress:""}),n()}},A("Gutenberg","kadence-starter-templates")),Object(v.createElement)(J,{icon:X,className:"elementor"===e.state.starterSettings.builderType?"active-item":"",isSelected:"elementor"===e.state.starterSettings.builderType,onClick:function(){e.saveConfig("builderType","elementor"),e.setState({activeTemplate:"",colorPalette:"",finished:!1,selectedPage:"home",focusMode:!1,isSelected:!1,isPageSelected:!1,isImporting:!1,progress:""}),n()}},A("Elementor","kadence-starter-templates")))}})))),Object(v.createElement)("div",{class:"kadence_theme_starter_dash_inner"},this.state.starterSettings&&this.state.starterSettings.builderType?Object(v.createElement)((function(){return Object(v.createElement)(H,null,e.state.isSaving?Object(v.createElement)("div",{className:"kst-overlay-saving"},Object(v.createElement)(q,null)):Object(v.createElement)("div",{className:"main-panel"},e.state.focusMode&&Object(v.createElement)(H,null,e.state.isImporting&&Object(v.createElement)(H,null,e.state.isPageSelected?Object(v.createElement)(a,null):Object(v.createElement)(c,null)),!e.state.isImporting&&e.state.isSelected&&Object(v.createElement)(z,{item:"elementor"===e.state.starterSettings.builderType?e.state.etemplates.filter((function(t){return t.slug===e.state.activeTemplate})):e.state.templates.filter((function(t){return t.slug===e.state.activeTemplate})),colorPalette:e.state.colorPalette,fontPair:e.state.fontPair,onChange:function(t){e.setState(t)}}),!e.state.isImporting&&!e.state.isSelected&&Object(v.createElement)(s,null)),!e.state.focusMode&&!e.state.finished&&Object(v.createElement)(o,null),e.state.finished&&Object(v.createElement)(H,null,e.state.isPageSelected?Object(v.createElement)(i,null):Object(v.createElement)(l,null))))}),null):Object(v.createElement)((function(){return Object(v.createElement)("div",{className:"kst-choose-builder-wrap"},Object(v.createElement)("div",{className:"kst-choose-builder-center"},Object(v.createElement)("h2",{className:"kst-choose-builder-title"},A("Choose a Builder","kadence-starter-templates")),Object(v.createElement)("div",{className:"kst-choose-builder-inner"},Object(v.createElement)(G,{icon:Q,className:"kt-import-select-type",onClick:function(){return e.saveConfig("builderType","blocks")}},A("Gutenberg","kadence-starter-templates")),Object(v.createElement)(G,{icon:X,className:"kt-import-select-type",onClick:function(){return e.saveConfig("builderType","elementor")}},A("Elementor","kadence-starter-templates"))),e.state.isSaving&&Object(v.createElement)("div",{className:"kst-overlay-saving"},Object(v.createElement)(q,null))))}),null)))}}]),n}(R);wp.domReady((function(){D(Object(v.createElement)(Z,null),document.querySelector(".kadence_starter_dashboard_main"))}))}]);
class-kadence-starter-templates.php CHANGED
@@ -70,6 +70,34 @@ class Starter_Templates {
70
  */
71
  private $selected_palette;
72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  /**
74
  * The paths of the actual import files to be used in the import.
75
  *
@@ -115,14 +143,24 @@ class Starter_Templates {
115
  $this->set_plugin_constants();
116
  $this->include_plugin_files();
117
  add_action( 'init', array( $this, 'init_config' ) );
118
- add_action( 'wp_ajax_kadence_import_demo_data', array( $this, 'import_demo_data_ajax_callback' ) );
119
- add_action( 'wp_ajax_kadence_import_install_plugins', array( $this, 'install_plugins_ajax_callback' ) );
120
- add_action( 'wp_ajax_kadence_import_customizer_data', array( $this, 'import_customizer_data_ajax_callback' ) );
121
- add_action( 'wp_ajax_kadence_after_import_data', array( $this, 'after_all_import_data_ajax_callback' ) );
122
- add_action( 'after_setup_theme', array( $this, 'setup_plugin_with_filter_data' ) );
 
 
 
 
 
 
 
123
  add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
 
124
  add_filter( 'kadence-starter-templates/import_files', array( $this, 'kadence_import_kadence_theme_files' ) );
125
- add_action( 'kadence-starter-templates/after_import', array( $this, 'kadence_kadence_theme_after_import' ), 10, 2 );
 
 
126
 
127
  add_filter( 'plugin_action_links_kadence-starter-templates/kadence-starter-templates.php', array( $this, 'add_settings_link' ) );
128
  }
@@ -151,7 +189,7 @@ class Starter_Templates {
151
  *
152
  * @param array $selected_import the selected import.
153
  */
154
- public function kadence_kadence_theme_after_import( $selected_import, $selected_palette ) {
155
  if ( 'agency' === $selected_import['import_file_name'] ) {
156
 
157
  // Assign menus to their locations.
@@ -242,10 +280,10 @@ class Starter_Templates {
242
  update_option( 'page_for_posts', $blogpage->ID ); // Blog Page.
243
  }
244
 
245
- } elseif ( 'sass' === $selected_import['import_file_name'] ) {
246
  // Assign menus to their locations.
247
- $main_menu = get_term_by( 'name', 'Sass Menu', 'nav_menu' );
248
- $footer_menu = get_term_by( 'name', 'Sass Footer', 'nav_menu' );
249
 
250
  set_theme_mod(
251
  'nav_menu_locations',
@@ -301,9 +339,115 @@ class Starter_Templates {
301
  update_option( 'page_on_front', $homepage->ID ); // Front Page.
302
  }
303
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  }
305
  if ( $selected_palette && ! empty( $selected_palette ) ) {
306
- $palette_presets = json_decode( '{"basic":[{"color":"#2B6CB0"},{"color":"#265E9A"},{"color":"#222222"},{"color":"#3B3B3B"},{"color":"#515151"},{"color":"#626262"},{"color":"#E1E1E1"},{"color":"#F7F7F7"},{"color":"#ffffff"}],"bright":[{"color":"#255FDD"},{"color":"#00F2FF"},{"color":"#1A202C"},{"color":"#2D3748"},{"color":"#4A5568"},{"color":"#718096"},{"color":"#EDF2F7"},{"color":"#F7FAFC"},{"color":"#ffffff"}],"darkmode":[{"color":"#3296ff"},{"color":"#003174"},{"color":"#ffffff"},{"color":"#f7fafc"},{"color":"#edf2f7"},{"color":"#cbd2d9"},{"color":"#2d3748"},{"color":"#252c39"},{"color":"#1a202c"}],"orange":[{"color":"#e47b02"},{"color":"#ed8f0c"},{"color":"#1f2933"},{"color":"#3e4c59"},{"color":"#52606d"},{"color":"#7b8794"},{"color":"#f3f4f7"},{"color":"#f9f9fb"},{"color":"#ffffff"}],"pinkish":[{"color":"#E21E51"},{"color":"#4d40ff"},{"color":"#040037"},{"color":"#032075"},{"color":"#514d7c"},{"color":"#666699"},{"color":"#deddeb"},{"color":"#efeff5"},{"color":"#f8f9fa"}],"pinkishdark":[{"color":"#E21E51"},{"color":"#4d40ff"},{"color":"#f8f9fa"},{"color":"#efeff5"},{"color":"#deddeb"},{"color":"#c3c2d6"},{"color":"#514d7c"},{"color":"#221e5b"},{"color":"#040037"}],"green":[{"color":"#049f82"},{"color":"#008f72"},{"color":"#222222"},{"color":"#353535"},{"color":"#454545"},{"color":"#676767"},{"color":"#eeeeee"},{"color":"#f7f7f7"},{"color":"#ffffff"}],"fire":[{"color":"#dd6b20"},{"color":"#cf3033"},{"color":"#27241d"},{"color":"#423d33"},{"color":"#504a40"},{"color":"#625d52"},{"color":"#e8e6e1"},{"color":"#faf9f7"},{"color":"#ffffff"}]}', true );
307
  if ( isset( $palette_presets[ $selected_palette ] ) ) {
308
  $default = json_decode( '{"palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"second-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"third-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"active":"palette"}', true );
309
  $default['palette'][0]['color'] = $palette_presets[ $selected_palette ][0]['color'];
@@ -317,18 +461,242 @@ class Starter_Templates {
317
  $default['palette'][8]['color'] = $palette_presets[ $selected_palette ][8]['color'];
318
  update_option( 'kadence_global_palette', json_encode( $default ) );
319
  }
320
- } else if ( 'ldcourse' === $selected_import['import_file_name'] ) {
321
- $default = json_decode( '{"palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"second-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"third-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"active":"palette"}', true );
322
- $default['palette'][0]['color'] = "#2cb1bc";
323
- $default['palette'][1]['color'] = "#13919b";
324
- $default['palette'][2]['color'] = "#0f2a43";
325
- $default['palette'][3]['color'] = "#133453";
326
- $default['palette'][4]['color'] = "#587089";
327
- $default['palette'][5]['color'] = "#829ab1";
328
- $default['palette'][6]['color'] = "#e0fcff";
329
- $default['palette'][7]['color'] = "#f5f7fa";
330
- $default['palette'][8]['color'] = "#ffffff";
331
- update_option( 'kadence_global_palette', json_encode( $default ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
332
  }
333
  }
334
  /**
@@ -367,6 +735,22 @@ class Starter_Templates {
367
  'src' => 'repo',
368
  'state' => Plugin_Check::active_check( 'woocommerce/woocommerce.php' ),
369
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
  $kadence_blocks = array(
371
  'base' => 'kadence-blocks',
372
  'slug' => 'kadence-blocks',
@@ -399,105 +783,416 @@ class Starter_Templates {
399
  'src' => 'thirdparty',
400
  'state' => Plugin_Check::active_check( 'sfwd-lms/sfwd_lms.php' ),
401
  );
402
- if ( 'notactive' !== $kadence_blocks_pro['state'] ) {
403
- $agency = array(
404
  'import_file_name' => 'agency',
405
  'categories' => array( 'Kadence Blocks Pro' ),
406
- 'import_file_url' => 'https://kadence.design/importer/kadence/agency_pro/demo_content.xml',
407
  'import_widget_file_url' => '',
408
- 'import_customizer_file_url' => 'https://kadence.design/importer/kadence/agency_pro/theme_options.json',
409
  'preview_url' => 'https://demos.kadencewp.com/blocks-agency/',
410
- 'import_preview_image_url' => 'https://kadence.design/importer/kadence/agency_pro/preview-image.jpg',
411
  'import_notice' => '',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
412
  'plugins' => array(
413
  $kadence_blocks,
414
  $kadence_blocks_pro,
415
  ),
416
- );
417
- } else {
418
- $agency = array(
419
  'import_file_name' => 'agency_free',
420
  'categories' => array(),
421
- 'import_file_url' => 'https://kadence.design/importer/kadence/agency/demo_content.xml',
422
  'import_widget_file_url' => '',
423
- 'import_customizer_file_url' => 'https://kadence.design/importer/kadence/agency/theme_options.json',
424
  'preview_url' => 'https://demos.kadencewp.com/agency-free/',
425
- 'import_preview_image_url' => 'https://kadence.design/importer/kadence/agency/preview-image.jpg',
426
  'import_notice' => '',
427
  'plugins' => array(
428
  $kadence_blocks,
429
  ),
430
- );
431
- }
432
- $demos = array(
433
- $agency,
434
- array(
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  'import_file_name' => 'food',
436
  'categories' => array(),
437
- 'import_file_url' => 'https://kadence.design/importer/kadence/recipe_blog/demo_content.xml',
438
  'import_widget_file_url' => '',
439
- 'import_customizer_file_url' => 'https://kadence.design/importer/kadence/recipe_blog/theme_options.json',
440
  'preview_url' => 'https://demos.kadencewp.com/food/',
441
- 'import_preview_image_url' => 'https://kadence.design/importer/kadence/recipe_blog/preview-image.jpg',
442
  'import_notice' => '',
443
  'plugins' => array(
444
  $kadence_blocks,
445
  $wpzoom_recipe_card,
446
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
447
  ),
448
- array(
449
  'import_file_name' => 'shopping',
450
  'categories' => array( 'Woocommerce' ),
451
- 'import_file_url' => 'https://kadence.design/importer/kadence/shopping_site/demo_content.xml',
452
- 'import_widget_file_url' => 'https://kadence.design/importer/kadence/shopping_site/widget_data.json',
453
- 'import_customizer_file_url' => 'https://kadence.design/importer/kadence/shopping_site/theme_options.json',
454
  'preview_url' => 'https://demos.kadencewp.com/blocks-store/',
455
- 'import_preview_image_url' => 'https://kadence.design/importer/kadence/shopping_site/preview-image.jpg',
456
  'import_notice' => '',
457
  'plugins' => array(
458
  $kadence_blocks,
459
  $woocommerce,
460
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
  ),
462
- array(
463
  'import_file_name' => 'yoga',
464
  'categories' => array( 'Business' ),
465
- 'import_file_url' => 'https://kadence.design/importer/kadence/yoga_site/demo_content.xml',
466
- 'import_widget_file_url' => 'https://kadence.design/importer/kadence/yoga_site/widget_data.json',
467
- 'import_customizer_file_url' => 'https://kadence.design/importer/kadence/yoga_site/theme_options.json',
468
  'preview_url' => 'https://demos.kadencewp.com/blocks-active/',
469
- 'import_preview_image_url' => 'https://kadence.design/importer/kadence/yoga_site/preview-image.jpg',
470
  'import_notice' => '',
471
  'plugins' => array(
472
  $kadence_blocks,
473
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
474
  ),
475
- array(
476
- 'import_file_name' => 'sass',
477
  'categories' => array( 'Business' ),
478
- 'import_file_url' => 'https://kadence.design/importer/kadence/sass_site/demo_content.xml',
479
  'import_widget_file_url' => '',
480
- 'import_customizer_file_url' => 'https://kadence.design/importer/kadence/sass_site/theme_options.json',
481
  'preview_url' => 'https://demos.kadencewp.com/blocks-saas/',
482
- 'import_preview_image_url' => 'https://kadence.design/importer/kadence/sass_site/preview-image.jpg',
483
  'import_notice' => '',
484
  'plugins' => array(
485
  $kadence_blocks,
486
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
487
  ),
488
- array(
489
  'import_file_name' => 'ldcourse',
490
  'categories' => array( 'Business' ),
491
- 'import_file_url' => 'https://kadence.design/importer/kadence/ld_single_course/demo_content.xml',
492
- 'import_widget_file_url' => 'https://kadence.design/importer/kadence/ld_single_course/widget_data.json',
493
- 'import_customizer_file_url' => 'https://kadence.design/importer/kadence/ld_single_course/theme_options.json',
494
  'preview_url' => 'https://demos.kadencewp.com/course/',
495
- 'import_preview_image_url' => 'https://kadence.design/importer/kadence/ld_single_course/preview-image.jpg',
496
  'import_notice' => '',
497
  'plugins' => array(
498
  $kadence_blocks,
499
  $learn_dash,
500
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
  ),
502
  );
503
  return $demos;
@@ -531,7 +1226,7 @@ class Starter_Templates {
531
  define( 'KADENCE_STARTER_TEMPLATES_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
532
  }
533
  if ( ! defined( 'KADENCE_STARTER_TEMPLATES_VERSION' ) ) {
534
- define( 'KADENCE_STARTER_TEMPLATES_VERSION', '1.0.4' );
535
  }
536
  }
537
  /**
@@ -549,6 +1244,8 @@ class Starter_Templates {
549
  require_once KADENCE_STARTER_TEMPLATES_PATH . 'inc/class-importer.php';
550
  require_once KADENCE_STARTER_TEMPLATES_PATH . 'inc/class-downloader.php';
551
  require_once KADENCE_STARTER_TEMPLATES_PATH . 'inc/class-customizer-importer.php';
 
 
552
  }
553
 
554
  /**
@@ -582,29 +1279,10 @@ class Starter_Templates {
582
  */
583
  public function render_admin_page() {
584
  ?>
585
- <div class="kadence_theme_dash_head">
586
- <div class="kadence_theme_dash_head_container">
587
- <div class="kadence_theme_dash_logo">
588
- <img src="<?php echo esc_attr( KADENCE_STARTER_TEMPLATES_URL . 'assets/images/kadence_logo.png' ); ?>">
589
- </div>
590
- <div class="kadence_theme_dash_logo_title">
591
- <h1>
592
- KADENCE STARTER TEMPLATES
593
- </h1>
594
- </div>
595
- <div class="kadence_theme_dash_version">
596
- <span>
597
- <?php echo esc_html( KADENCE_STARTER_TEMPLATES_VERSION ); ?>
598
- </span>
599
- </div>
600
- </div>
601
- </div>
602
- <div class="wrap kadence_theme_dash">
603
- <div class="kadence_theme_dashboard">
604
  <h2 class="notices" style="display:none;"></h2>
605
  <?php settings_errors(); ?>
606
- <div class="kadence_starter_templates_finished"></div>
607
- <div class="kadence_starter_templates_error"></div>
608
  <div class="page-grid">
609
  <div class="kadence_starter_dashboard_main">
610
  </div>
@@ -622,6 +1300,11 @@ class Starter_Templates {
622
  'state' => Plugin_Check::active_check( 'woocommerce/woocommerce.php' ),
623
  'src' => 'repo',
624
  );
 
 
 
 
 
625
  $kadence_blocks = array(
626
  'title' => 'Kadence Blocks',
627
  'state' => Plugin_Check::active_check( 'kadence-blocks/kadence-blocks.php' ),
@@ -632,6 +1315,11 @@ class Starter_Templates {
632
  'state' => Plugin_Check::active_check( 'kadence-blocks-pro/kadence-blocks-pro.php' ),
633
  'src' => 'bundle',
634
  );
 
 
 
 
 
635
  $wpzoom_recipe_card = array(
636
  'title' => 'Recipe Card Blocks by WPZOOM',
637
  'state' => Plugin_Check::active_check( 'recipe-card-blocks-by-wpzoom/wpzoom-recipe-card.php' ),
@@ -659,7 +1347,33 @@ class Starter_Templates {
659
  $kadence_blocks,
660
  $kadence_blocks_pro,
661
  ),
662
- 'image' => 'https://kadence.design/importer/kadence/agency/preview-image.jpg',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
663
  );
664
  } else {
665
  $agency = array(
@@ -674,16 +1388,134 @@ class Starter_Templates {
674
  ),
675
  'url' => 'https://demos.kadencewp.com/agency-free/',
676
  'categories' => array( 'business' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
677
  'plugins' => array(
678
  $kadence_blocks,
679
  ),
680
- 'image' => 'https://kadence.design/importer/kadence/agency/preview-image.jpg',
681
  );
682
  }
683
  $templates = array(
684
  $agency,
685
  array(
686
  'key' => 1,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
687
  'slug' => 'food',
688
  'name' => __( 'Recipe Blog', 'kadence-starter-templates' ),
689
  'keywords' => array(
@@ -697,10 +1529,126 @@ class Starter_Templates {
697
  $kadence_blocks,
698
  $wpzoom_recipe_card,
699
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
700
  'image' => 'https://kadence.design/importer/kadence/recipe_blog/preview-image.jpg',
701
  ),
702
  array(
703
- 'key' => 2,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
704
  'slug' => 'shopping',
705
  'name' => __( 'Shopping', 'kadence-starter-templates' ),
706
  'keywords' => array(
@@ -714,56 +1662,223 @@ class Starter_Templates {
714
  $kadence_blocks,
715
  $woocommerce,
716
  ),
717
- 'image' => 'https://kadence.design/importer/kadence/shopping_site/preview-image.jpg',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
718
  ),
 
 
719
  array(
720
- 'key' => 3,
721
- 'slug' => 'yogo',
722
- 'name' => __( 'Yoga Studio', 'kadence-starter-templates' ),
723
  'keywords' => array(
724
- __( 'yoga', 'kadence-starter-templates' ),
725
- __( 'gym', 'kadence-starter-templates' ),
726
  __( 'business', 'kadence-starter-templates' ),
727
  ),
728
- 'url' => 'https://demos.kadencewp.com/blocks-active/',
729
  'categories' => array( 'business' ),
 
 
730
  'plugins' => array(
731
- $kadence_blocks,
 
732
  ),
733
- 'image' => 'https://kadence.design/importer/kadence/yoga_site/preview-image.jpg',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
734
  ),
735
  array(
736
- 'key' => 4,
737
- 'slug' => 'sass',
738
- 'name' => __( 'Sass', 'kadence-starter-templates' ),
739
  'keywords' => array(
740
- __( 'sass', 'kadence-starter-templates' ),
741
- __( 'pricing', 'kadence-starter-templates' ),
742
- __( 'business', 'kadence-starter-templates' ),
743
  ),
744
- 'url' => 'https://demos.kadencewp.com/blocks-saas/',
745
- 'categories' => array( 'business' ),
 
746
  'plugins' => array(
747
- $kadence_blocks,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
748
  ),
749
- 'image' => 'https://kadence.design/importer/kadence/sass_site/preview-image.jpg',
750
  ),
751
  array(
752
- 'key' => 5,
753
- 'slug' => 'ldcourse',
754
- 'name' => __( 'LearnDash Course', 'kadence-starter-templates' ),
755
  'keywords' => array(
 
756
  __( 'course', 'kadence-starter-templates' ),
757
- __( 'learndash', 'kadence-starter-templates' ),
758
  __( 'business', 'kadence-starter-templates' ),
759
  ),
760
- 'url' => 'https://demos.kadencewp.com/course/',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761
  'categories' => array( 'business' ),
 
762
  'plugins' => array(
763
- $kadence_blocks,
764
- $learn_dash,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
765
  ),
766
- 'image' => 'https://kadence.design/importer/kadence/ld_single_course/preview-image.jpg',
767
  ),
768
  );
769
  $palettes = array(
@@ -771,75 +1886,203 @@ class Starter_Templates {
771
  'palette' => 'base',
772
  'colors' => array(
773
  '#2B6CB0',
774
- '#265E9A',
775
- '#222222',
 
776
  '#ffffff',
777
  ),
778
  ),
779
  array(
780
- 'palette' => 'bright',
781
  'colors' => array(
782
- '#255FDD',
783
- '#00F2FF',
784
- '#1A202C',
 
785
  '#ffffff',
786
  ),
787
  ),
788
  array(
789
- 'palette' => 'darkmode',
790
  'colors' => array(
791
- '#3296ff',
792
- '#003174',
 
 
793
  '#ffffff',
794
- '#1a202c',
795
  ),
796
  ),
797
  array(
798
- 'palette' => 'orange',
799
  'colors' => array(
800
- '#e47b02',
801
- '#ed8f0c',
802
- '#1f2933',
 
803
  '#ffffff',
804
  ),
805
  ),
806
  array(
807
- 'palette' => 'pinkish',
808
  'colors' => array(
809
- '#E21E51',
810
- '#4d40ff',
811
- '#040037',
 
812
  '#ffffff',
813
  ),
814
  ),
815
  array(
816
- 'palette' => 'pinkishdark',
817
  'colors' => array(
818
- '#E21E51',
819
- '#4d40ff',
 
 
820
  '#ffffff',
821
- '#040037',
822
  ),
823
  ),
824
  array(
825
- 'palette' => 'green',
826
  'colors' => array(
827
- '#049f82',
828
- '#008f72',
829
- '#222222',
 
 
 
 
 
 
 
 
 
 
 
830
  '#ffffff',
831
  ),
832
  ),
833
  array(
834
- 'palette' => 'fire',
835
  'colors' => array(
836
- '#dd6b20',
837
- '#cf3033',
838
- '#27241d',
 
839
  '#ffffff',
840
  ),
841
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
842
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
843
  wp_enqueue_style( 'kadence-starter-templates', KADENCE_STARTER_TEMPLATES_URL . 'assets/css/starter-templates.css', array( 'wp-components' ), KADENCE_STARTER_TEMPLATES_VERSION );
844
  wp_enqueue_script( 'kadence-starter-templates', KADENCE_STARTER_TEMPLATES_URL . 'assets/js/starter-templates.js', array( 'jquery', 'wp-i18n', 'wp-element', 'wp-plugins', 'wp-components', 'wp-api', 'wp-hooks', 'wp-edit-post', 'lodash', 'wp-block-library', 'wp-block-editor', 'wp-editor' ), KADENCE_STARTER_TEMPLATES_VERSION, true );
845
  wp_localize_script(
@@ -851,17 +2094,40 @@ class Starter_Templates {
851
  'pro' => false,
852
  'isKadence' => class_exists( 'Kadence\Theme' ),
853
  'templates' => $templates,
 
854
  'palettes' => $palettes,
855
- 'has_content' => ( 1 < wp_count_posts()->publish ? true : false ),
856
- 'notice' => esc_html__( 'Please Note: This importer is designed for new/empty sites with no content.', 'kadence-starter-templates' ),
 
 
 
 
 
 
857
  'plugin_progress' => esc_html__( 'Checking/Installing/Activating Required Plugins', 'kadence-starter-templates' ),
858
  'content_progress' => esc_html__( 'Importing Demo Content...', 'kadence-starter-templates' ),
859
  'content_new_progress' => esc_html__( 'Importing Demo Content... Still Importing.', 'kadence-starter-templates' ),
860
- 'widget_progress' => esc_html__( 'Importing Menus/Widgets...', 'kadence-starter-templates' ),
861
  'customizer_progress' => esc_html__( 'Importing Customizer Settings...', 'kadence-starter-templates' ),
862
  )
863
  );
864
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
865
  /**
866
  * AJAX callback to install a plugin.
867
  */
@@ -872,7 +2138,8 @@ class Starter_Templates {
872
  wp_send_json_error();
873
  }
874
  // Get selected file index or set it to 0.
875
- $selected_index = empty( $_POST['selected'] ) ? 0 : absint( $_POST['selected'] );
 
876
  $info = $this->import_files[ $selected_index ];
877
  $install = true;
878
 
@@ -940,7 +2207,430 @@ class Starter_Templates {
940
  wp_send_json( array( 'status' => 'pluginSuccess' ) );
941
  }
942
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
943
 
 
 
 
 
 
 
 
 
 
 
944
  /**
945
  * Main AJAX callback function for:
946
  * 1). prepare import files (uploaded or predefined via filters)
@@ -962,12 +2652,17 @@ class Starter_Templates {
962
  // Create a date and time string to use for demo and log file names.
963
  Helpers::set_demo_import_start_time();
964
 
965
- // Define log file path.
966
- $this->log_file_path = Helpers::get_log_path();
 
 
 
 
967
 
968
  // Get selected file index or set it to 0.
969
- $this->selected_index = empty( $_POST['selected'] ) ? 0 : absint( $_POST['selected'] );
970
  $this->selected_palette = empty( $_POST['palette'] ) ? '' : sanitize_text_field( $_POST['palette'] );
 
971
  /**
972
  * 1). Prepare import files.
973
  * Predefined import files via filter: kadence-starter-templates/import_files
@@ -986,28 +2681,37 @@ class Starter_Templates {
986
  esc_html__( 'Downloaded files', 'kadence-starter-templates' )
987
  );
988
  }
989
-
990
- // Add this message to log file.
991
- $log_added = Helpers::append_to_file(
992
- sprintf(
993
- __( 'The import files for: %s were successfully downloaded!', 'kadence-starter-templates' ),
994
- $this->import_files[ $this->selected_index ]['import_file_name']
995
- ) . Helpers::import_file_info( $this->selected_import_files ),
996
- $this->log_file_path,
997
- esc_html__( 'Downloaded files' , 'kadence-starter-templates' )
998
- );
 
999
  } else {
1000
  // Send JSON Error response to the AJAX call.
1001
  wp_send_json( esc_html__( 'No import files specified!', 'kadence-starter-templates' ) );
1002
  }
1003
  }
1004
-
 
 
 
 
1005
  // Save the initial import data as a transient, so other import parts (in new AJAX calls) can use that data.
1006
  Helpers::set_import_data_transient( $this->get_current_importer_data() );
1007
 
1008
  if ( ! $this->before_import_executed ) {
1009
  $this->before_import_executed = true;
1010
 
 
 
 
 
1011
  /**
1012
  * 2). Execute the actions hooked to the 'kadence-starter-templates/before_content_import_execution' action:
1013
  *
@@ -1020,7 +2724,27 @@ class Starter_Templates {
1020
  wp_delete_post( 1, true ); // Hello World.
1021
  wp_delete_post( 2, true ); // Sample Page.
1022
  wp_delete_comment( 1, true ); // WordPress comment.
1023
- do_action( 'kadence-starter-templates/before_content_import_execution', $this->selected_import_files, $this->import_files, $this->selected_index, $this->selected_palette );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1024
  }
1025
 
1026
  /**
@@ -1039,11 +2763,11 @@ class Starter_Templates {
1039
  * 2 - Import widgets (with priority 20).
1040
  * 3 - Import Redux data (with priority 30).
1041
  */
1042
- do_action( 'kadence-starter-templates/after_content_import_execution', $this->selected_import_files, $this->import_files, $this->selected_index, $this->selected_palette );
1043
-
1044
  // Save the import data as a transient, so other import parts (in new AJAX calls) can use that data.
1045
  Helpers::set_import_data_transient( $this->get_current_importer_data() );
1046
-
 
1047
  // Request the customizer import AJAX call.
1048
  if ( ! empty( $this->selected_import_files['customizer'] ) ) {
1049
  wp_send_json( array( 'status' => 'customizerAJAX' ) );
@@ -1058,6 +2782,55 @@ class Starter_Templates {
1058
  $this->final_response();
1059
  }
1060
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1061
 
1062
  /**
1063
  * AJAX callback for importing the customizer data.
@@ -1105,7 +2878,7 @@ class Starter_Templates {
1105
  * Default actions:
1106
  * 1 - after_import action (with priority 10).
1107
  */
1108
- do_action( 'kadence-starter-templates/after_all_import_execution', $this->selected_import_files, $this->import_files, $this->selected_index, $this->selected_palette );
1109
  }
1110
 
1111
  // Send a JSON response with final report.
@@ -1116,31 +2889,48 @@ class Starter_Templates {
1116
  /**
1117
  * Send a JSON response with final report.
1118
  */
1119
- private function final_response() {
1120
  // Delete importer data transient for current import.
1121
  delete_transient( 'kadence_importer_data' );
1122
 
1123
  // Display final messages (success or error messages).
1124
- if ( empty( $this->frontend_error_messages ) ) {
 
 
 
 
 
 
 
 
1125
  $response['message'] = '';
1126
 
1127
  $response['message'] .= sprintf(
1128
  __( '%1$sFinished! View your site%2$s', 'kadence-starter-templates' ),
1129
- '<div class="finshed-notice-success"><p><a href="'. esc_url( home_url( '/' ) ) . '" class="button-primary button kadence-starter-templates-finish-button">',
1130
  '</a></p></div>'
1131
  );
1132
  } else {
1133
  $response['message'] = $this->frontend_error_messages_display() . '<br>';
1134
- $response['message'] .= sprintf(
1135
- __( '%1$sThe demo import has finished, but there were some import errors.%2$sMore details about the errors can be found in this %3$s%5$slog file%6$s%4$s%7$s', 'kadence-starter-templates' ),
1136
- '<div class="notice notice-warning"><p>',
1137
- '<br>',
1138
- '<strong>',
1139
- '</strong>',
1140
- '<a href="' . Helpers::get_log_url( $this->log_file_path ) .'" target="_blank">',
1141
- '</a>',
1142
- '</p></div>'
1143
- );
 
 
 
 
 
 
 
 
 
1144
  }
1145
 
1146
  wp_send_json( $response );
@@ -1158,6 +2948,7 @@ class Starter_Templates {
1158
  $this->log_file_path = empty( $data['log_file_path'] ) ? '' : $data['log_file_path'];
1159
  $this->selected_index = empty( $data['selected_index'] ) ? 0 : $data['selected_index'];
1160
  $this->selected_palette = empty( $data['selected_palette'] ) ? '' : $data['selected_palette'];
 
1161
  $this->selected_import_files = empty( $data['selected_import_files'] ) ? array() : $data['selected_import_files'];
1162
  $this->import_files = empty( $data['import_files'] ) ? array() : $data['import_files'];
1163
  $this->before_import_executed = empty( $data['before_import_executed'] ) ? false : $data['before_import_executed'];
@@ -1180,6 +2971,7 @@ class Starter_Templates {
1180
  'log_file_path' => $this->log_file_path,
1181
  'selected_index' => $this->selected_index,
1182
  'selected_palette' => $this->selected_palette,
 
1183
  'selected_import_files' => $this->selected_import_files,
1184
  'import_files' => $this->import_files,
1185
  'before_import_executed' => $this->before_import_executed,
@@ -1252,10 +3044,9 @@ class Starter_Templates {
1252
  if ( ! ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) ) {
1253
  return;
1254
  }
1255
-
1256
  // Get info of import data files and filter it.
1257
- $this->import_files = Helpers::validate_import_file_info( apply_filters( 'kadence-starter-templates/import_files', array() ) );
1258
-
1259
  /**
1260
  * Register all default actions (before content import, widget, customizer import and other actions)
1261
  * to the 'before_content_import_execution' and the 'kadence-starter-templates/after_content_import_execution' action hook.
70
  */
71
  private $selected_palette;
72
 
73
+ /**
74
+ * The font for the import.
75
+ *
76
+ * @var string
77
+ */
78
+ private $selected_font;
79
+
80
+ /**
81
+ * The page for the import.
82
+ *
83
+ * @var string
84
+ */
85
+ private $selected_page;
86
+
87
+ /**
88
+ * Import Single Override colors
89
+ *
90
+ * @var boolean
91
+ */
92
+ private $override_colors;
93
+
94
+ /**
95
+ * Import Single Override fonts
96
+ *
97
+ * @var boolean
98
+ */
99
+ private $override_fonts;
100
+
101
  /**
102
  * The paths of the actual import files to be used in the import.
103
  *
143
  $this->set_plugin_constants();
144
  $this->include_plugin_files();
145
  add_action( 'init', array( $this, 'init_config' ) );
146
+ add_action( 'init', array( $this, 'load_api_settings' ) );
147
+ if ( is_admin() ) {
148
+ // Ajax Calls.
149
+ add_action( 'wp_ajax_kadence_import_demo_data', array( $this, 'import_demo_data_ajax_callback' ) );
150
+ add_action( 'wp_ajax_kadence_import_install_plugins', array( $this, 'install_plugins_ajax_callback' ) );
151
+ add_action( 'wp_ajax_kadence_import_customizer_data', array( $this, 'import_customizer_data_ajax_callback' ) );
152
+ add_action( 'wp_ajax_kadence_after_import_data', array( $this, 'after_all_import_data_ajax_callback' ) );
153
+ add_action( 'wp_ajax_kadence_import_single_data', array( $this, 'import_demo_single_data_ajax_callback' ) );
154
+ add_action( 'wp_ajax_kadence_remove_past_import_data', array( $this, 'remove_past_data_ajax_callback' ) );
155
+ }
156
+ add_action( 'init', array( $this, 'setup_plugin_with_filter_data' ) );
157
+ // Text Domain.
158
  add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
159
+ // Filters durning Import.
160
  add_filter( 'kadence-starter-templates/import_files', array( $this, 'kadence_import_kadence_theme_files' ) );
161
+ add_action( 'kadence-starter-templates/after_import', array( $this, 'kadence_kadence_theme_after_import' ), 10, 3 );
162
+
163
+ add_action( 'kadence-starter-templates/after_import', array( $this, 'kadence_elementor_after_import' ), 20, 3 );
164
 
165
  add_filter( 'plugin_action_links_kadence-starter-templates/kadence-starter-templates.php', array( $this, 'add_settings_link' ) );
166
  }
189
  *
190
  * @param array $selected_import the selected import.
191
  */
192
+ public function kadence_kadence_theme_after_import( $selected_import, $selected_palette, $selected_font ) {
193
  if ( 'agency' === $selected_import['import_file_name'] ) {
194
 
195
  // Assign menus to their locations.
280
  update_option( 'page_for_posts', $blogpage->ID ); // Blog Page.
281
  }
282
 
283
+ } elseif ( 'saas' === $selected_import['import_file_name'] ) {
284
  // Assign menus to their locations.
285
+ $main_menu = get_term_by( 'name', 'Saas Menu', 'nav_menu' );
286
+ $footer_menu = get_term_by( 'name', 'Saas Footer', 'nav_menu' );
287
 
288
  set_theme_mod(
289
  'nav_menu_locations',
339
  update_option( 'page_on_front', $homepage->ID ); // Front Page.
340
  }
341
 
342
+ } elseif ( 'e01' === $selected_import['import_file_name'] ) {
343
+ // Assign menus to their locations.
344
+ $main_menu = get_term_by( 'name', 'Main Real Estate', 'nav_menu' );
345
+
346
+ set_theme_mod(
347
+ 'nav_menu_locations',
348
+ array(
349
+ 'primary' => $main_menu->term_id,
350
+ 'footer' => $main_menu->term_id,
351
+ )
352
+ );
353
+
354
+ // Assign front page.
355
+ $homepage = get_page_by_title( 'Home' );
356
+ if ( isset( $homepage ) && $homepage->ID ) {
357
+ update_option( 'show_on_front', 'page' );
358
+ update_option( 'page_on_front', $homepage->ID ); // Front Page.
359
+ $blogpage = get_page_by_title( 'Blog' );
360
+ update_option( 'page_for_posts', $blogpage->ID ); // Blog Page.
361
+ }
362
+
363
+ } elseif ( 'e02' === $selected_import['import_file_name'] ) {
364
+
365
+ // Assign Woo Pages.
366
+ if ( class_exists( 'woocommerce' ) ) {
367
+ $this->import_demo_woocommerce();
368
+ }
369
+ // Assign menus to their locations.
370
+ $main_menu = get_term_by( 'name', 'Store Menu', 'nav_menu' );
371
+
372
+ set_theme_mod(
373
+ 'nav_menu_locations',
374
+ array(
375
+ 'primary' => $main_menu->term_id,
376
+ )
377
+ );
378
+
379
+ // Assign front page.
380
+ $homepage = get_page_by_title( 'Home' );
381
+ if ( isset( $homepage ) && $homepage->ID ) {
382
+ update_option( 'show_on_front', 'page' );
383
+ update_option( 'page_on_front', $homepage->ID ); // Front Page.
384
+ }
385
+
386
+ } elseif ( 'e03' === $selected_import['import_file_name'] ) {
387
+ // Assign menus to their locations.
388
+ $main_menu = get_term_by( 'name', 'Course Main', 'nav_menu' );
389
+
390
+ set_theme_mod(
391
+ 'nav_menu_locations',
392
+ array(
393
+ 'primary' => $main_menu->term_id,
394
+ 'mobile' => $main_menu->term_id,
395
+ )
396
+ );
397
+
398
+ // Assign front page.
399
+ $homepage = get_page_by_title( 'Home' );
400
+ if ( isset( $homepage ) && $homepage->ID ) {
401
+ update_option( 'show_on_front', 'page' );
402
+ update_option( 'page_on_front', $homepage->ID ); // Front Page.
403
+ $blogpage = get_page_by_title( 'Blog' );
404
+ update_option( 'page_for_posts', $blogpage->ID ); // Blog Page.
405
+ }
406
+
407
+ } elseif ( 'e06' === $selected_import['import_file_name'] ) {
408
+ // Assign menus to their locations.
409
+ $main_menu = get_term_by( 'name', 'Control Menu', 'nav_menu' );
410
+
411
+ set_theme_mod(
412
+ 'nav_menu_locations',
413
+ array(
414
+ 'primary' => $main_menu->term_id,
415
+ )
416
+ );
417
+
418
+ // Assign front page.
419
+ $homepage = get_page_by_title( 'Home' );
420
+ if ( isset( $homepage ) && $homepage->ID ) {
421
+ update_option( 'show_on_front', 'page' );
422
+ update_option( 'page_on_front', $homepage->ID ); // Front Page.
423
+ $blogpage = get_page_by_title( 'Blog' );
424
+ update_option( 'page_for_posts', $blogpage->ID ); // Blog Page.
425
+ }
426
+
427
+ } elseif ( 'g01' === $selected_import['import_file_name'] ) {
428
+ // Assign menus to their locations.
429
+ $main_menu = get_term_by( 'name', 'Main Real Estate', 'nav_menu' );
430
+
431
+ set_theme_mod(
432
+ 'nav_menu_locations',
433
+ array(
434
+ 'primary' => $main_menu->term_id,
435
+ 'footer' => $main_menu->term_id,
436
+ )
437
+ );
438
+
439
+ // Assign front page.
440
+ $homepage = get_page_by_title( 'Home' );
441
+ if ( isset( $homepage ) && $homepage->ID ) {
442
+ update_option( 'show_on_front', 'page' );
443
+ update_option( 'page_on_front', $homepage->ID ); // Front Page.
444
+ $blogpage = get_page_by_title( 'Blog' );
445
+ update_option( 'page_for_posts', $blogpage->ID ); // Blog Page.
446
+ }
447
+
448
  }
449
  if ( $selected_palette && ! empty( $selected_palette ) ) {
450
+ $palette_presets = json_decode( '{"base":[{"color":"#2B6CB0"},{"color":"#265E9A"},{"color":"#222222"},{"color":"#3B3B3B"},{"color":"#515151"},{"color":"#626262"},{"color":"#E1E1E1"},{"color":"#F7F7F7"},{"color":"#ffffff"}],"bright":[{"color":"#255FDD"},{"color":"#00F2FF"},{"color":"#1A202C"},{"color":"#2D3748"},{"color":"#4A5568"},{"color":"#718096"},{"color":"#EDF2F7"},{"color":"#F7FAFC"},{"color":"#ffffff"}],"darkmode":[{"color":"#3296ff"},{"color":"#003174"},{"color":"#ffffff"},{"color":"#f7fafc"},{"color":"#edf2f7"},{"color":"#cbd2d9"},{"color":"#2d3748"},{"color":"#252c39"},{"color":"#1a202c"}],"orange":[{"color":"#e47b02"},{"color":"#ed8f0c"},{"color":"#1f2933"},{"color":"#3e4c59"},{"color":"#52606d"},{"color":"#7b8794"},{"color":"#f3f4f7"},{"color":"#f9f9fb"},{"color":"#ffffff"}],"pinkish":[{"color":"#E21E51"},{"color":"#4d40ff"},{"color":"#040037"},{"color":"#032075"},{"color":"#514d7c"},{"color":"#666699"},{"color":"#deddeb"},{"color":"#efeff5"},{"color":"#f8f9fa"}],"pinkishdark":[{"color":"#E21E51"},{"color":"#4d40ff"},{"color":"#f8f9fa"},{"color":"#efeff5"},{"color":"#deddeb"},{"color":"#c3c2d6"},{"color":"#514d7c"},{"color":"#221e5b"},{"color":"#040037"}],"green":[{"color":"#049f82"},{"color":"#008f72"},{"color":"#222222"},{"color":"#353535"},{"color":"#454545"},{"color":"#676767"},{"color":"#eeeeee"},{"color":"#f7f7f7"},{"color":"#ffffff"}],"fire":[{"color":"#dd6b20"},{"color":"#cf3033"},{"color":"#27241d"},{"color":"#423d33"},{"color":"#504a40"},{"color":"#625d52"},{"color":"#e8e6e1"},{"color":"#faf9f7"},{"color":"#ffffff"}],"mint":[{"color":"#2cb1bc"},{"color":"#13919b"},{"color":"#0f2a43"},{"color":"#133453"},{"color":"#587089"},{"color":"#829ab1"},{"color":"#e0fcff"},{"color":"#f5f7fa"},{"color":"#ffffff"}],"rich":[{"color":"#295CFF"},{"color":"#0E94FF"},{"color":"#1C0D5A"},{"color":"#3D3D3D"},{"color":"#57575D"},{"color":"#636363"},{"color":"#E1EBEE"},{"color":"#EFF7FB"},{"color":"#ffffff"}],"fem":[{"color":"#D86C97"},{"color":"#282828"},{"color":"#282828"},{"color":"#333333"},{"color":"#4d4d4d"},{"color":"#646464"},{"color":"#f7dede"},{"color":"#F6F2EF"},{"color":"#ffffff"}],"hot":[{"color":"#FF5698"},{"color":"#000000"},{"color":"#020202"},{"color":"#020202"},{"color":"#4E4E4E"},{"color":"#808080"},{"color":"#FDEDEC"},{"color":"#FDF6EE"},{"color":"#ffffff"}],"bold":[{"color":"#000000"},{"color":"#D1A155"},{"color":"#000000"},{"color":"#010101"},{"color":"#111111"},{"color":"#282828"},{"color":"#F6E7BC"},{"color":"#F9F7F7"},{"color":"#ffffff"}],"teal":[{"color":"#7ACFC4"},{"color":"#044355"},{"color":"#000000"},{"color":"#010101"},{"color":"#111111"},{"color":"#282828"},{"color":"#F5ECE5"},{"color":"#F9F7F7"},{"color":"#ffffff"}]}', true );
451
  if ( isset( $palette_presets[ $selected_palette ] ) ) {
452
  $default = json_decode( '{"palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"second-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"third-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"active":"palette"}', true );
453
  $default['palette'][0]['color'] = $palette_presets[ $selected_palette ][0]['color'];
461
  $default['palette'][8]['color'] = $palette_presets[ $selected_palette ][8]['color'];
462
  update_option( 'kadence_global_palette', json_encode( $default ) );
463
  }
464
+ }
465
+ if ( class_exists( 'Kadence\Theme' ) ) {
466
+ if ( $selected_font && ! empty( $selected_font ) ) {
467
+ switch ( $selected_font ) {
468
+ case 'montserrat':
469
+ $current = \Kadence\kadence()->option( 'heading_font' );
470
+ $current['family'] = 'Montserrat';
471
+ $current['google'] = true;
472
+ $current['variant'] = array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
473
+ set_theme_mod( 'heading_font', $current );
474
+ $body = \Kadence\kadence()->option( 'base_font' );
475
+ $body['family'] = 'Source Sans Pro';
476
+ $body['google'] = true;
477
+ set_theme_mod( 'base_font', $body );
478
+ break;
479
+ case 'playfair':
480
+ $current = \Kadence\kadence()->option( 'heading_font' );
481
+ $current['family'] = 'Playfair Display';
482
+ $current['google'] = true;
483
+ $current['variant'] = array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
484
+ set_theme_mod( 'heading_font', $current );
485
+ $h1_font = \Kadence\kadence()->option( 'h1_font' );
486
+ $h1_font['weight'] = 'normal';
487
+ $h1_font['variant'] = 'regualar';
488
+ set_theme_mod( 'h1_font', $h1_font );
489
+ $h2_font = \Kadence\kadence()->option( 'h2_font' );
490
+ $h2_font['weight'] = 'normal';
491
+ $h2_font['variant'] = 'regualar';
492
+ set_theme_mod( 'h2_font', $h2_font );
493
+ $h3_font = \Kadence\kadence()->option( 'h3_font' );
494
+ $h3_font['weight'] = 'normal';
495
+ $h3_font['variant'] = 'regualar';
496
+ set_theme_mod( 'h3_font', $h3_font );
497
+ $h4_font = \Kadence\kadence()->option( 'h4_font' );
498
+ $h4_font['weight'] = 'normal';
499
+ $h4_font['variant'] = 'regualar';
500
+ set_theme_mod( 'h4_font', $h4_font );
501
+ $h5_font = \Kadence\kadence()->option( 'h5_font' );
502
+ $h5_font['weight'] = 'normal';
503
+ $h5_font['variant'] = 'regualar';
504
+ set_theme_mod( 'h5_font', $h5_font );
505
+ $body = \Kadence\kadence()->option( 'base_font' );
506
+ $body['family'] = 'Raleway';
507
+ $body['google'] = true;
508
+ set_theme_mod( 'base_font', $body );
509
+ break;
510
+ case 'oswald':
511
+ $current = \Kadence\kadence()->option( 'heading_font' );
512
+ $current['family'] = 'Oswald';
513
+ $current['google'] = true;
514
+ $current['variant'] = array( '200', '300', 'regular', '500', '600', '700' );
515
+ set_theme_mod( 'heading_font', $current );
516
+ $body = \Kadence\kadence()->option( 'base_font' );
517
+ $body['family'] = 'Open Sans';
518
+ $body['google'] = true;
519
+ set_theme_mod( 'base_font', $body );
520
+ break;
521
+ case 'antic':
522
+ $current = \Kadence\kadence()->option( 'heading_font' );
523
+ $current['family'] = 'Antic Didone';
524
+ $current['google'] = true;
525
+ $current['variant'] = array( 'regular' );
526
+ set_theme_mod( 'heading_font', $current );
527
+ $h1_font = \Kadence\kadence()->option( 'h1_font' );
528
+ $h1_font['weight'] = 'normal';
529
+ $h1_font['variant'] = 'regualar';
530
+ set_theme_mod( 'h1_font', $h1_font );
531
+ $h2_font = \Kadence\kadence()->option( 'h2_font' );
532
+ $h2_font['weight'] = 'normal';
533
+ $h2_font['variant'] = 'regualar';
534
+ set_theme_mod( 'h2_font', $h2_font );
535
+ $h3_font = \Kadence\kadence()->option( 'h3_font' );
536
+ $h3_font['weight'] = 'normal';
537
+ $h3_font['variant'] = 'regualar';
538
+ set_theme_mod( 'h3_font', $h3_font );
539
+ $h4_font = \Kadence\kadence()->option( 'h4_font' );
540
+ $h4_font['weight'] = 'normal';
541
+ $h4_font['variant'] = 'regualar';
542
+ set_theme_mod( 'h4_font', $h4_font );
543
+ $h5_font = \Kadence\kadence()->option( 'h5_font' );
544
+ $h5_font['weight'] = 'normal';
545
+ $h5_font['variant'] = 'regualar';
546
+ set_theme_mod( 'h5_font', $h5_font );
547
+ $body = \Kadence\kadence()->option( 'base_font' );
548
+ $body['family'] = 'Raleway';
549
+ $body['google'] = true;
550
+ set_theme_mod( 'base_font', $body );
551
+ break;
552
+ case 'gilda':
553
+ $current = \Kadence\kadence()->option( 'heading_font' );
554
+ $current['family'] = 'Gilda Display';
555
+ $current['google'] = true;
556
+ $current['variant'] = array( 'regular' );
557
+ set_theme_mod( 'heading_font', $current );
558
+ $h1_font = \Kadence\kadence()->option( 'h1_font' );
559
+ $h1_font['weight'] = 'normal';
560
+ $h1_font['variant'] = 'regualar';
561
+ set_theme_mod( 'h1_font', $h1_font );
562
+ $h2_font = \Kadence\kadence()->option( 'h2_font' );
563
+ $h2_font['weight'] = 'normal';
564
+ $h2_font['variant'] = 'regualar';
565
+ set_theme_mod( 'h2_font', $h2_font );
566
+ $h3_font = \Kadence\kadence()->option( 'h3_font' );
567
+ $h3_font['weight'] = 'normal';
568
+ $h3_font['variant'] = 'regualar';
569
+ set_theme_mod( 'h3_font', $h3_font );
570
+ $h4_font = \Kadence\kadence()->option( 'h4_font' );
571
+ $h4_font['weight'] = 'normal';
572
+ $h4_font['variant'] = 'regualar';
573
+ set_theme_mod( 'h4_font', $h4_font );
574
+ $h5_font = \Kadence\kadence()->option( 'h5_font' );
575
+ $h5_font['weight'] = 'normal';
576
+ $h5_font['variant'] = 'regualar';
577
+ set_theme_mod( 'h5_font', $h5_font );
578
+ $body = \Kadence\kadence()->option( 'base_font' );
579
+ $body['family'] = 'Raleway';
580
+ $body['google'] = true;
581
+ set_theme_mod( 'base_font', $body );
582
+ break;
583
+ case 'cormorant':
584
+ $current = \Kadence\kadence()->option( 'heading_font' );
585
+ $current['family'] = 'Cormorant Garamond';
586
+ $current['google'] = true;
587
+ $current['variant'] = array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' );
588
+ set_theme_mod( 'heading_font', $current );
589
+ $body = \Kadence\kadence()->option( 'base_font' );
590
+ $body['family'] = 'Proza Libre';
591
+ $body['google'] = true;
592
+ set_theme_mod( 'base_font', $body );
593
+ break;
594
+ case 'libre':
595
+ $current = \Kadence\kadence()->option( 'heading_font' );
596
+ $current['family'] = 'Libre Franklin';
597
+ $current['google'] = true;
598
+ $current['variant'] = array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
599
+ set_theme_mod( 'heading_font', $current );
600
+ $body = \Kadence\kadence()->option( 'base_font' );
601
+ $body['family'] = 'Libre Baskerville';
602
+ $body['google'] = true;
603
+ set_theme_mod( 'base_font', $body );
604
+ break;
605
+
606
+ case 'lora':
607
+ $current = \Kadence\kadence()->option( 'heading_font' );
608
+ $current['family'] = 'Lora';
609
+ $current['google'] = true;
610
+ $current['variant'] = array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' );
611
+ set_theme_mod( 'heading_font', $current );
612
+ $h1_font = \Kadence\kadence()->option( 'h1_font' );
613
+ $h1_font['weight'] = 'normal';
614
+ $h1_font['variant'] = 'regualar';
615
+ set_theme_mod( 'h1_font', $h1_font );
616
+ $h2_font = \Kadence\kadence()->option( 'h2_font' );
617
+ $h2_font['weight'] = 'normal';
618
+ $h2_font['variant'] = 'regualar';
619
+ set_theme_mod( 'h2_font', $h2_font );
620
+ $h3_font = \Kadence\kadence()->option( 'h3_font' );
621
+ $h3_font['weight'] = 'normal';
622
+ $h3_font['variant'] = 'regualar';
623
+ set_theme_mod( 'h3_font', $h3_font );
624
+ $h4_font = \Kadence\kadence()->option( 'h4_font' );
625
+ $h4_font['weight'] = 'normal';
626
+ $h4_font['variant'] = 'regualar';
627
+ set_theme_mod( 'h4_font', $h4_font );
628
+ $h5_font = \Kadence\kadence()->option( 'h5_font' );
629
+ $h5_font['weight'] = 'normal';
630
+ $h5_font['variant'] = 'regualar';
631
+ set_theme_mod( 'h5_font', $h5_font );
632
+ $body = \Kadence\kadence()->option( 'base_font' );
633
+ $body['family'] = 'Merriweather';
634
+ $body['google'] = true;
635
+ $body['weight'] = '300';
636
+ $body['variant'] = '300';
637
+ set_theme_mod( 'base_font', $body );
638
+ break;
639
+
640
+ case 'proza':
641
+ $current = \Kadence\kadence()->option( 'heading_font' );
642
+ $current['family'] = 'Proza Libre';
643
+ $current['google'] = true;
644
+ $current['variant'] = array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' );
645
+ set_theme_mod( 'heading_font', $current );
646
+ $body = \Kadence\kadence()->option( 'base_font' );
647
+ $body['family'] = 'Open Sans';
648
+ $body['google'] = true;
649
+ set_theme_mod( 'base_font', $body );
650
+ break;
651
+
652
+ case 'worksans':
653
+ $current = \Kadence\kadence()->option( 'heading_font' );
654
+ $current['family'] = 'Work Sans';
655
+ $current['google'] = true;
656
+ $current['variant'] = array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
657
+ set_theme_mod( 'heading_font', $current );
658
+ $body = \Kadence\kadence()->option( 'base_font' );
659
+ $body['family'] = 'Work Sans';
660
+ $body['google'] = true;
661
+ set_theme_mod( 'base_font', $body );
662
+ break;
663
+
664
+ case 'josefin':
665
+ $current = \Kadence\kadence()->option( 'heading_font' );
666
+ $current['family'] = 'Josefin Sans';
667
+ $current['google'] = true;
668
+ $current['variant'] = array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' );
669
+ set_theme_mod( 'heading_font', $current );
670
+ $body = \Kadence\kadence()->option( 'base_font' );
671
+ $body['family'] = 'Lato';
672
+ $body['google'] = true;
673
+ set_theme_mod( 'base_font', $body );
674
+ break;
675
+
676
+ case 'nunito':
677
+ $current = \Kadence\kadence()->option( 'heading_font' );
678
+ $current['family'] = 'Nunito';
679
+ $current['google'] = true;
680
+ $current['variant'] = array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
681
+ set_theme_mod( 'heading_font', $current );
682
+ $body = \Kadence\kadence()->option( 'base_font' );
683
+ $body['family'] = 'Roboto';
684
+ $body['google'] = true;
685
+ set_theme_mod( 'base_font', $body );
686
+ break;
687
+ case 'rubik':
688
+ $current = \Kadence\kadence()->option( 'heading_font' );
689
+ $current['family'] = 'Rubik';
690
+ $current['google'] = true;
691
+ $current['variant'] = array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
692
+ set_theme_mod( 'heading_font', $current );
693
+ $body = \Kadence\kadence()->option( 'base_font' );
694
+ $body['family'] = 'Karla';
695
+ $body['google'] = true;
696
+ set_theme_mod( 'base_font', $body );
697
+ break;
698
+ }
699
+ }
700
  }
701
  }
702
  /**
735
  'src' => 'repo',
736
  'state' => Plugin_Check::active_check( 'woocommerce/woocommerce.php' ),
737
  );
738
+ $elementor = array(
739
+ 'base' => 'elementor',
740
+ 'slug' => 'elementor',
741
+ 'path' => 'elementor/elementor.php',
742
+ 'title' => 'Elementor',
743
+ 'src' => 'repo',
744
+ 'state' => Plugin_Check::active_check( 'elementor/elementor.php' ),
745
+ );
746
+ $fluentform = array(
747
+ 'base' => 'fluentform',
748
+ 'slug' => 'fluentform',
749
+ 'path' => 'fluentform/fluentform.php',
750
+ 'title' => 'Fluent Forms',
751
+ 'src' => 'repo',
752
+ 'state' => Plugin_Check::active_check( 'fluentform/fluentform.php' ),
753
+ );
754
  $kadence_blocks = array(
755
  'base' => 'kadence-blocks',
756
  'slug' => 'kadence-blocks',
783
  'src' => 'thirdparty',
784
  'state' => Plugin_Check::active_check( 'sfwd-lms/sfwd_lms.php' ),
785
  );
786
+ $demos = array(
787
+ 'agency' => array(
788
  'import_file_name' => 'agency',
789
  'categories' => array( 'Kadence Blocks Pro' ),
790
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/og01pro/demo_content.xml',
791
  'import_widget_file_url' => '',
792
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/og01pro/theme_options.json',
793
  'preview_url' => 'https://demos.kadencewp.com/blocks-agency/',
794
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/og01pro/imagespreview-image.jpg',
795
  'import_notice' => '',
796
+ 'pages' => array(
797
+ 'home' => array(
798
+ 'content' => 'https://startertemplatecloud.com/importer-content/og01pro/home_content.xml',
799
+ 'meta' => 'clear',
800
+ ),
801
+ 'services' => array(
802
+ 'content' => 'https://startertemplatecloud.com/importer-content/og01pro/services_content.xml',
803
+ 'meta' => 'clear',
804
+ ),
805
+ 'about' => array(
806
+ 'content' => 'https://startertemplatecloud.com/importer-content/og01pro/about_content.xml',
807
+ 'meta' => 'clear',
808
+ ),
809
+ 'contact' => array(
810
+ 'content' => 'https://startertemplatecloud.com/importer-content/og01pro/contact_content.xml',
811
+ 'meta' => 'clear',
812
+ ),
813
+ ),
814
  'plugins' => array(
815
  $kadence_blocks,
816
  $kadence_blocks_pro,
817
  ),
818
+ ),
819
+ 'agency_free' => array(
 
820
  'import_file_name' => 'agency_free',
821
  'categories' => array(),
822
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/og01/demo_content.xml',
823
  'import_widget_file_url' => '',
824
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/og01/theme_options.json',
825
  'preview_url' => 'https://demos.kadencewp.com/agency-free/',
826
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/og01/images/preview-image.jpg',
827
  'import_notice' => '',
828
  'plugins' => array(
829
  $kadence_blocks,
830
  ),
831
+ 'pages' => array(
832
+ 'home' => array(
833
+ 'content' => 'https://startertemplatecloud.com/importer-content/og01/home_content.xml',
834
+ 'meta' => 'clear',
835
+ ),
836
+ 'services' => array(
837
+ 'content' => 'https://startertemplatecloud.com/importer-content/og01/services_content.xml',
838
+ 'meta' => 'clear',
839
+ ),
840
+ 'about' => array(
841
+ 'content' => 'https://startertemplatecloud.com/importer-content/og01/about_content.xml',
842
+ 'meta' => 'clear',
843
+ ),
844
+ 'contact' => array(
845
+ 'content' => 'https://startertemplatecloud.com/importer-content/og01/contact_content.xml',
846
+ 'meta' => 'clear',
847
+ ),
848
+ ),
849
+ ),
850
+ 'food' => array(
851
  'import_file_name' => 'food',
852
  'categories' => array(),
853
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/og06/demo_content.xml',
854
  'import_widget_file_url' => '',
855
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/og06/theme_options.json',
856
  'preview_url' => 'https://demos.kadencewp.com/food/',
857
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/og06/image/preview-image.jpg',
858
  'import_notice' => '',
859
  'plugins' => array(
860
  $kadence_blocks,
861
  $wpzoom_recipe_card,
862
  ),
863
+ 'pages' => array(
864
+ 'home' => array(
865
+ 'content' => 'https://startertemplatecloud.com/importer-content/og06/home_content.xml',
866
+ 'meta' => 'clear',
867
+ ),
868
+ 'about' => array(
869
+ 'content' => 'https://startertemplatecloud.com/importer-content/og06/about_content.xml',
870
+ 'meta' => 'onherit',
871
+ ),
872
+ 'contact' => array(
873
+ 'content' => 'https://startertemplatecloud.com/importer-content/og06/contact_content.xml',
874
+ 'meta' => 'inherit',
875
+ ),
876
+ ),
877
  ),
878
+ 'shopping' => array(
879
  'import_file_name' => 'shopping',
880
  'categories' => array( 'Woocommerce' ),
881
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/og04/demo_content.xml',
882
+ 'import_widget_file_url' => 'https://startertemplatecloud.com/importer-content/og04/widget_data.json',
883
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/og04/theme_options.json',
884
  'preview_url' => 'https://demos.kadencewp.com/blocks-store/',
885
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/og04/images/preview-image.jpg',
886
  'import_notice' => '',
887
  'plugins' => array(
888
  $kadence_blocks,
889
  $woocommerce,
890
  ),
891
+ 'pages' => array(
892
+ 'home' => array(
893
+ 'content' => 'https://startertemplatecloud.com/importer-content/og04/home_content.xml',
894
+ 'meta' => 'clear',
895
+ ),
896
+ 'about' => array(
897
+ 'content' => 'https://startertemplatecloud.com/importer-content/og04/about_content.xml',
898
+ 'meta' => 'clear',
899
+ ),
900
+ 'contact' => array(
901
+ 'content' => 'https://startertemplatecloud.com/importer-content/og04/contact_content.xml',
902
+ 'meta' => 'clear',
903
+ ),
904
+ ),
905
  ),
906
+ 'yoga' => array(
907
  'import_file_name' => 'yoga',
908
  'categories' => array( 'Business' ),
909
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/og05/demo_content.xml',
910
+ 'import_widget_file_url' => 'https://startertemplatecloud.com/importer-content/og05/widget_data.json',
911
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/og05/theme_options.json',
912
  'preview_url' => 'https://demos.kadencewp.com/blocks-active/',
913
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/og05/images/preview-image.jpg',
914
  'import_notice' => '',
915
  'plugins' => array(
916
  $kadence_blocks,
917
  ),
918
+ 'pages' => array(
919
+ 'home' => array(
920
+ 'content' => 'https://startertemplatecloud.com/importer-content/og05/home_content.xml',
921
+ 'meta' => 'clear',
922
+ ),
923
+ 'gallery' => array(
924
+ 'content' => 'https://startertemplatecloud.com/importer-content/og05/gallery_content.xml',
925
+ 'meta' => 'clear',
926
+ ),
927
+ 'pricing' => array(
928
+ 'content' => 'https://startertemplatecloud.com/importer-content/og05/pricing_content.xml',
929
+ 'meta' => 'clear',
930
+ ),
931
+ 'about' => array(
932
+ 'content' => 'https://startertemplatecloud.com/importer-content/og05/about_content.xml',
933
+ 'meta' => 'clear',
934
+ ),
935
+ 'contact' => array(
936
+ 'content' => 'https://startertemplatecloud.com/importer-content/og05/contact_content.xml',
937
+ 'meta' => 'clear',
938
+ ),
939
+ ),
940
  ),
941
+ 'saas' => array(
942
+ 'import_file_name' => 'saas',
943
  'categories' => array( 'Business' ),
944
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/og03/demo_content.xml',
945
  'import_widget_file_url' => '',
946
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/og03/theme_options.json',
947
  'preview_url' => 'https://demos.kadencewp.com/blocks-saas/',
948
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/og03/images/preview-image.jpg',
949
  'import_notice' => '',
950
  'plugins' => array(
951
  $kadence_blocks,
952
  ),
953
+ 'pages' => array(
954
+ 'home' => array(
955
+ 'content' => 'https://startertemplatecloud.com/importer-content/og03/home_content.xml',
956
+ 'meta' => 'clear',
957
+ ),
958
+ 'features' => array(
959
+ 'content' => 'https://startertemplatecloud.com/importer-content/og03/features_content.xml',
960
+ 'meta' => 'clear',
961
+ ),
962
+ 'pricing' => array(
963
+ 'content' => 'https://startertemplatecloud.com/importer-content/og03/pricing_content.xml',
964
+ 'meta' => 'clear',
965
+ ),
966
+ 'about' => array(
967
+ 'content' => 'https://startertemplatecloud.com/importer-content/og03/about_content.xml',
968
+ 'meta' => 'clear',
969
+ ),
970
+ 'contact' => array(
971
+ 'content' => 'https://startertemplatecloud.com/importer-content/og03/contact_content.xml',
972
+ 'meta' => 'clear',
973
+ ),
974
+ ),
975
  ),
976
+ 'ldcourse' => array(
977
  'import_file_name' => 'ldcourse',
978
  'categories' => array( 'Business' ),
979
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/og02/demo_content.xml',
980
+ 'import_widget_file_url' => 'https://startertemplatecloud.com/importer-content/og02/widget_data.json',
981
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/og02/theme_options.json',
982
  'preview_url' => 'https://demos.kadencewp.com/course/',
983
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/og02/preview-image.jpg',
984
  'import_notice' => '',
985
  'plugins' => array(
986
  $kadence_blocks,
987
  $learn_dash,
988
  ),
989
+ 'pages' => array(
990
+ 'home' => array(
991
+ 'content' => 'https://startertemplatecloud.com/importer-content/og02/home_content.xml',
992
+ 'meta' => 'clear',
993
+ ),
994
+ 'about' => array(
995
+ 'content' => 'https://startertemplatecloud.com/importer-content/og02/about_content.xml',
996
+ 'meta' => 'clear',
997
+ ),
998
+ 'contact' => array(
999
+ 'content' => 'https://startertemplatecloud.com/importer-content/og02/contact_content.xml',
1000
+ 'meta' => 'clear',
1001
+ ),
1002
+ ),
1003
+ ),
1004
+ 'e01' => array(
1005
+ 'import_file_name' => 'e01',
1006
+ 'categories' => array(),
1007
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/e01/demo_content.xml',
1008
+ 'import_widget_file_url' => 'https://startertemplatecloud.com/importer-content/e01/widget_data.json',
1009
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/e01/theme_options.json',
1010
+ 'import_forms_file_url' => 'https://startertemplatecloud.com/importer-content/e01/form_data.json',
1011
+ 'preview_url' => 'https://startertemplatecloud.com/e01/',
1012
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/e01/preview-image.jpg',
1013
+ 'import_notice' => '',
1014
+ 'type' => 'elementor',
1015
+ 'width' => 'large',
1016
+ 'plugins' => array(
1017
+ $elementor,
1018
+ $fluentform,
1019
+ ),
1020
+ 'pages' => array(
1021
+ 'home' => array(
1022
+ 'content' => 'https://startertemplatecloud.com/importer-content/e01/home_content.xml',
1023
+ 'meta' => 'inherit',
1024
+ ),
1025
+ 'services' => array(
1026
+ 'content' => 'https://startertemplatecloud.com/importer-content/e01/services_content.xml',
1027
+ 'meta' => 'inherit',
1028
+ ),
1029
+ 'about' => array(
1030
+ 'content' => 'https://startertemplatecloud.com/importer-content/e01/about_content.xml',
1031
+ 'meta' => 'inherit',
1032
+ ),
1033
+ 'contact' => array(
1034
+ 'content' => 'https://startertemplatecloud.com/importer-content/e01/contact_content.xml',
1035
+ 'meta' => 'inherit',
1036
+ 'form' => true,
1037
+ ),
1038
+ 'brokerage' => array(
1039
+ 'content' => 'https://startertemplatecloud.com/importer-content/e01/brokerage_content.xml',
1040
+ 'meta' => 'inherit',
1041
+ ),
1042
+ 'norman' => array(
1043
+ 'content' => 'https://startertemplatecloud.com/importer-content/e01/norman_content.xml',
1044
+ 'meta' => 'inherit',
1045
+ ),
1046
+ ),
1047
+ ),
1048
+ 'e02' => array(
1049
+ 'import_file_name' => 'e02',
1050
+ 'categories' => array(),
1051
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/e02/demo_content.xml',
1052
+ 'import_widget_file_url' => 'https://startertemplatecloud.com/importer-content/e02/widget_data.json',
1053
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/e02/theme_options.json',
1054
+ 'import_forms_file_url' => 'https://startertemplatecloud.com/importer-content/e02/form_data.json',
1055
+ 'preview_url' => 'https://startertemplatecloud.com/e02/',
1056
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/e02/preview-image.jpg',
1057
+ 'import_notice' => '',
1058
+ 'type' => 'elementor',
1059
+ 'plugins' => array(
1060
+ $elementor,
1061
+ $fluentform,
1062
+ $woocommerce,
1063
+ ),
1064
+ 'pages' => array(
1065
+ 'home' => array(
1066
+ 'content' => 'https://startertemplatecloud.com/importer-content/e02/home_content.xml',
1067
+ 'meta' => 'inherit',
1068
+ ),
1069
+ 'about' => array(
1070
+ 'content' => 'https://startertemplatecloud.com/importer-content/e02/about_content.xml',
1071
+ 'meta' => 'inherit',
1072
+ ),
1073
+ 'contact' => array(
1074
+ 'content' => 'https://startertemplatecloud.com/importer-content/e02/contact_content.xml',
1075
+ 'meta' => 'inherit',
1076
+ 'form' => true,
1077
+ ),
1078
+ ),
1079
+ ),
1080
+ 'e03' => array(
1081
+ 'import_file_name' => 'e03',
1082
+ 'categories' => array(),
1083
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/e03/demo_content.xml',
1084
+ 'import_widget_file_url' => 'https://startertemplatecloud.com/importer-content/e03/widget_data.json',
1085
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/e03/theme_options.json',
1086
+ 'import_forms_file_url' => 'https://startertemplatecloud.com/importer-content/e03/form_data.json',
1087
+ 'preview_url' => 'https://startertemplatecloud.com/e03/',
1088
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/e03/images/preview-image.jpg',
1089
+ 'import_notice' => '',
1090
+ 'type' => 'elementor',
1091
+ 'width' => 'large',
1092
+ 'plugins' => array(
1093
+ $elementor,
1094
+ $fluentform,
1095
+ ),
1096
+ 'pages' => array(
1097
+ 'home' => array(
1098
+ 'content' => 'https://startertemplatecloud.com/importer-content/e03/home_content.xml',
1099
+ 'meta' => 'inherit',
1100
+ ),
1101
+ 'about' => array(
1102
+ 'content' => 'https://startertemplatecloud.com/importer-content/e03/about_content.xml',
1103
+ 'meta' => 'inherit',
1104
+ ),
1105
+ 'contact' => array(
1106
+ 'content' => 'https://startertemplatecloud.com/importer-content/e03/contact_content.xml',
1107
+ 'meta' => 'inherit',
1108
+ 'form' => true,
1109
+ ),
1110
+ 'courses' => array(
1111
+ 'content' => 'https://startertemplatecloud.com/importer-content/e03/courses_content.xml',
1112
+ 'meta' => 'inherit',
1113
+ ),
1114
+ 'course' => array(
1115
+ 'content' => 'https://startertemplatecloud.com/importer-content/e03/course_content.xml',
1116
+ 'meta' => 'inherit',
1117
+ ),
1118
+ ),
1119
+ ),
1120
+ 'e06' => array(
1121
+ 'import_file_name' => 'e06',
1122
+ 'categories' => array(),
1123
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/e06/demo_content.xml',
1124
+ 'import_widget_file_url' => 'https://startertemplatecloud.com/importer-content/e06/widget_data.json',
1125
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/e06/theme_options.json',
1126
+ 'import_forms_file_url' => '',
1127
+ 'preview_url' => 'https://startertemplatecloud.com/e06/',
1128
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/e06/images/preview-image.jpg',
1129
+ 'import_notice' => '',
1130
+ 'type' => 'elementor',
1131
+ 'plugins' => array(
1132
+ $elementor,
1133
+ ),
1134
+ 'pages' => array(
1135
+ 'home' => array(
1136
+ 'content' => 'https://startertemplatecloud.com/importer-content/e06/home_content.xml',
1137
+ 'meta' => 'inherit',
1138
+ ),
1139
+ 'features' => array(
1140
+ 'content' => 'https://startertemplatecloud.com/importer-content/e06/features_content.xml',
1141
+ 'meta' => 'inherit',
1142
+ ),
1143
+ 'pricing' => array(
1144
+ 'content' => 'https://startertemplatecloud.com/importer-content/e06/pricing_content.xml',
1145
+ 'meta' => 'inherit',
1146
+ ),
1147
+ 'support' => array(
1148
+ 'content' => 'https://startertemplatecloud.com/importer-content/e06/support_content.xml',
1149
+ 'meta' => 'inherit',
1150
+ ),
1151
+ 'templates' => array(
1152
+ 'content' => 'https://startertemplatecloud.com/importer-content/e06/templates_content.xml',
1153
+ 'meta' => 'inherit',
1154
+ ),
1155
+ ),
1156
+ ),
1157
+ 'g01' => array(
1158
+ 'import_file_name' => 'g01',
1159
+ 'categories' => array(),
1160
+ 'import_file_url' => 'https://startertemplatecloud.com/importer-content/g01/demo_content.xml',
1161
+ 'import_widget_file_url' => 'https://startertemplatecloud.com/importer-content/g01/widget_data.json',
1162
+ 'import_customizer_file_url' => 'https://startertemplatecloud.com/importer-content/g01/theme_options.json',
1163
+ 'preview_url' => 'https://startertemplatecloud.com/g01/',
1164
+ 'import_preview_image_url' => 'https://startertemplatecloud.com/importer-content/g01/preview-image.jpg',
1165
+ 'import_notice' => '',
1166
+ 'type' => 'blocks',
1167
+ 'plugins' => array(
1168
+ $kadence_blocks,
1169
+ ),
1170
+ 'pages' => array(
1171
+ 'home' => array(
1172
+ 'content' => 'https://startertemplatecloud.com/importer-content/g01/home_content.xml',
1173
+ 'meta' => 'inherit',
1174
+ ),
1175
+ 'services' => array(
1176
+ 'content' => 'https://startertemplatecloud.com/importer-content/g01/services_content.xml',
1177
+ 'meta' => 'inherit',
1178
+ ),
1179
+ 'about' => array(
1180
+ 'content' => 'https://startertemplatecloud.com/importer-content/g01/about_content.xml',
1181
+ 'meta' => 'inherit',
1182
+ ),
1183
+ 'contact' => array(
1184
+ 'content' => 'https://startertemplatecloud.com/importer-content/g01/contact_content.xml',
1185
+ 'meta' => 'inherit',
1186
+ ),
1187
+ 'brokerage' => array(
1188
+ 'content' => 'https://startertemplatecloud.com/importer-content/g01/brokerage_content.xml',
1189
+ 'meta' => 'inherit',
1190
+ ),
1191
+ 'norman' => array(
1192
+ 'content' => 'https://startertemplatecloud.com/importer-content/g01/norman_content.xml',
1193
+ 'meta' => 'inherit',
1194
+ ),
1195
+ ),
1196
  ),
1197
  );
1198
  return $demos;
1226
  define( 'KADENCE_STARTER_TEMPLATES_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
1227
  }
1228
  if ( ! defined( 'KADENCE_STARTER_TEMPLATES_VERSION' ) ) {
1229
+ define( 'KADENCE_STARTER_TEMPLATES_VERSION', '1.1.0' );
1230
  }
1231
  }
1232
  /**
1244
  require_once KADENCE_STARTER_TEMPLATES_PATH . 'inc/class-importer.php';
1245
  require_once KADENCE_STARTER_TEMPLATES_PATH . 'inc/class-downloader.php';
1246
  require_once KADENCE_STARTER_TEMPLATES_PATH . 'inc/class-customizer-importer.php';
1247
+ require_once KADENCE_STARTER_TEMPLATES_PATH . 'inc/class-import-elementor.php';
1248
+ require_once KADENCE_STARTER_TEMPLATES_PATH . 'inc/class-import-fluent.php';
1249
  }
1250
 
1251
  /**
1279
  */
1280
  public function render_admin_page() {
1281
  ?>
1282
+ <div class="wrap kadence_theme_starter_dash">
1283
+ <div class="kadence_theme_starter_dashboard">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1284
  <h2 class="notices" style="display:none;"></h2>
1285
  <?php settings_errors(); ?>
 
 
1286
  <div class="page-grid">
1287
  <div class="kadence_starter_dashboard_main">
1288
  </div>
1300
  'state' => Plugin_Check::active_check( 'woocommerce/woocommerce.php' ),
1301
  'src' => 'repo',
1302
  );
1303
+ $elementor = array(
1304
+ 'title' => 'Elementor',
1305
+ 'state' => Plugin_Check::active_check( 'elementor/elementor.php' ),
1306
+ 'src' => 'repo',
1307
+ );
1308
  $kadence_blocks = array(
1309
  'title' => 'Kadence Blocks',
1310
  'state' => Plugin_Check::active_check( 'kadence-blocks/kadence-blocks.php' ),
1315
  'state' => Plugin_Check::active_check( 'kadence-blocks-pro/kadence-blocks-pro.php' ),
1316
  'src' => 'bundle',
1317
  );
1318
+ $fluentform = array(
1319
+ 'title' => 'Fluent Forms',
1320
+ 'src' => 'repo',
1321
+ 'state' => Plugin_Check::active_check( 'fluentform/fluentform.php' ),
1322
+ );
1323
  $wpzoom_recipe_card = array(
1324
  'title' => 'Recipe Card Blocks by WPZOOM',
1325
  'state' => Plugin_Check::active_check( 'recipe-card-blocks-by-wpzoom/wpzoom-recipe-card.php' ),
1347
  $kadence_blocks,
1348
  $kadence_blocks_pro,
1349
  ),
1350
+ 'pages' => array(
1351
+ 'home' => array(
1352
+ 'id' => 'home',
1353
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1354
+ 'url' => 'https://demos.kadencewp.com/agency-free/',
1355
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/home.jpg',
1356
+ ),
1357
+ 'services' => array(
1358
+ 'id' => 'services',
1359
+ 'title' => __( 'Services', 'kadence-starter-templates' ),
1360
+ 'url' => 'https://demos.kadencewp.com/agency-free/services/',
1361
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/services.jpg',
1362
+ ),
1363
+ 'about' => array(
1364
+ 'id' => 'about',
1365
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1366
+ 'url' => 'https://demos.kadencewp.com/agency-free/about/',
1367
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/about.jpg',
1368
+ ),
1369
+ 'contact' => array(
1370
+ 'id' => 'contact',
1371
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1372
+ 'url' => 'https://demos.kadencewp.com/agency-free/contact/',
1373
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/contact.jpg',
1374
+ ),
1375
+ ),
1376
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/preview-image.jpg',
1377
  );
1378
  } else {
1379
  $agency = array(
1388
  ),
1389
  'url' => 'https://demos.kadencewp.com/agency-free/',
1390
  'categories' => array( 'business' ),
1391
+ 'pages' => array(
1392
+ 'home' => array(
1393
+ 'id' => 'home',
1394
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1395
+ 'url' => 'https://demos.kadencewp.com/agency-free/',
1396
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/home.jpg',
1397
+ ),
1398
+ 'services' => array(
1399
+ 'id' => 'services',
1400
+ 'title' => __( 'Services', 'kadence-starter-templates' ),
1401
+ 'url' => 'https://demos.kadencewp.com/agency-free/services/',
1402
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/services.jpg',
1403
+ ),
1404
+ 'about' => array(
1405
+ 'id' => 'about',
1406
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1407
+ 'url' => 'https://demos.kadencewp.com/agency-free/about/',
1408
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/about.jpg',
1409
+ ),
1410
+ 'contact' => array(
1411
+ 'id' => 'contact',
1412
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1413
+ 'url' => 'https://demos.kadencewp.com/agency-free/contact/',
1414
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/contact.jpg',
1415
+ ),
1416
+ ),
1417
+ 'image' => 'https://startertemplatecloud.com/importer-content/og01/images/preview-image.jpg',
1418
  'plugins' => array(
1419
  $kadence_blocks,
1420
  ),
 
1421
  );
1422
  }
1423
  $templates = array(
1424
  $agency,
1425
  array(
1426
  'key' => 1,
1427
+ 'slug' => 'g01',
1428
+ 'name' => __( 'Real Estate', 'kadence-starter-templates' ),
1429
+ 'keywords' => array(
1430
+ __( 'reale state', 'kadence-starter-templates' ),
1431
+ __( 'house', 'kadence-starter-templates' ),
1432
+ __( 'business', 'kadence-starter-templates' ),
1433
+ ),
1434
+ 'url' => 'https://startertemplatecloud.com/g01/',
1435
+ 'categories' => array( 'business' ),
1436
+ 'type' => 'blocks',
1437
+ 'plugins' => array(
1438
+ $kadence_blocks,
1439
+ ),
1440
+ 'pages' => array(
1441
+ 'home' => array(
1442
+ 'id' => 'home',
1443
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1444
+ 'url' => 'https://startertemplatecloud.com/g01/',
1445
+ 'image' => 'https://startertemplatecloud.com/importer-content/g01/images/home.jpg',
1446
+ ),
1447
+ 'services' => array(
1448
+ 'id' => 'services',
1449
+ 'title' => __( 'Services', 'kadence-starter-templates' ),
1450
+ 'url' => 'https://startertemplatecloud.com/g01/services/',
1451
+ 'image' => 'https://startertemplatecloud.com/importer-content/g01/images/services.jpg',
1452
+ ),
1453
+ 'about' => array(
1454
+ 'id' => 'about',
1455
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1456
+ 'url' => 'https://startertemplatecloud.com/g01/about/',
1457
+ 'image' => 'https://startertemplatecloud.com/importer-content/g01/images/about.jpg',
1458
+ ),
1459
+ 'contact' => array(
1460
+ 'id' => 'contact',
1461
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1462
+ 'url' => 'https://startertemplatecloud.com/g01/contact/',
1463
+ 'image' => 'https://startertemplatecloud.com/importer-content/g01/images/contact.jpg',
1464
+ ),
1465
+ 'brokerage' => array(
1466
+ 'id' => 'brokerage',
1467
+ 'title' => __( 'Brokerage', 'kadence-starter-templates' ),
1468
+ 'url' => 'https://startertemplatecloud.com/g01/brokerage/',
1469
+ 'image' => 'https://startertemplatecloud.com/importer-content/g01/images/brokerage.jpg',
1470
+ ),
1471
+ 'norman' => array(
1472
+ 'id' => 'norman',
1473
+ 'title' => __( '418 Norman Street', 'kadence-starter-templates' ),
1474
+ 'url' => 'https://startertemplatecloud.com/g01/418-norman-street/',
1475
+ 'image' => 'https://startertemplatecloud.com/importer-content/g01/images/norman.jpg',
1476
+ ),
1477
+ ),
1478
+ 'image' => 'https://startertemplatecloud.com/importer-content/g01/images/preview-image.jpg',
1479
+ ),
1480
+ array(
1481
+ 'key' => 2,
1482
+ 'slug' => 'ldcourse',
1483
+ 'name' => __( 'LearnDash Course', 'kadence-starter-templates' ),
1484
+ 'keywords' => array(
1485
+ __( 'course', 'kadence-starter-templates' ),
1486
+ __( 'learndash', 'kadence-starter-templates' ),
1487
+ __( 'business', 'kadence-starter-templates' ),
1488
+ ),
1489
+ 'url' => 'https://demos.kadencewp.com/course/',
1490
+ 'categories' => array( 'business' ),
1491
+ 'plugins' => array(
1492
+ $kadence_blocks,
1493
+ $learn_dash,
1494
+ ),
1495
+ 'pages' => array(
1496
+ 'home' => array(
1497
+ 'id' => 'home',
1498
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1499
+ 'url' => 'https://demos.kadencewp.com/course/',
1500
+ 'image' => 'https://startertemplatecloud.com/importer-content/og02/images/home.jpg',
1501
+ ),
1502
+ 'about' => array(
1503
+ 'id' => 'about',
1504
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1505
+ 'url' => 'https://demos.kadencewp.com/course/about/',
1506
+ 'image' => 'https://startertemplatecloud.com/importer-content/og02/images/about.jpg',
1507
+ ),
1508
+ 'contact' => array(
1509
+ 'id' => 'contact',
1510
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1511
+ 'url' => 'https://demos.kadencewp.com/course/contact/',
1512
+ 'image' => 'https://startertemplatecloud.com/importer-content/og02/images/contact.jpg',
1513
+ ),
1514
+ ),
1515
+ 'image' => 'https://startertemplatecloud.com/importer-content/og02/images/preview-image.jpg',
1516
+ ),
1517
+ array(
1518
+ 'key' => 3,
1519
  'slug' => 'food',
1520
  'name' => __( 'Recipe Blog', 'kadence-starter-templates' ),
1521
  'keywords' => array(
1529
  $kadence_blocks,
1530
  $wpzoom_recipe_card,
1531
  ),
1532
+ 'pages' => array(
1533
+ 'home' => array(
1534
+ 'id' => 'home',
1535
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1536
+ 'url' => 'https://demos.kadencewp.com/food/',
1537
+ 'image' => 'https://startertemplatecloud.com/importer-content/og06/images/home.jpg',
1538
+ ),
1539
+ 'about' => array(
1540
+ 'id' => 'about',
1541
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1542
+ 'url' => 'https://demos.kadencewp.com/food/about/',
1543
+ 'image' => 'https://startertemplatecloud.com/importer-content/og06/images/about.jpg',
1544
+ ),
1545
+ 'contact' => array(
1546
+ 'id' => 'contact',
1547
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1548
+ 'url' => 'https://demos.kadencewp.com/food/contact/',
1549
+ 'image' => 'https://startertemplatecloud.com/importer-content/og06/images/contact.jpg',
1550
+ ),
1551
+ ),
1552
  'image' => 'https://kadence.design/importer/kadence/recipe_blog/preview-image.jpg',
1553
  ),
1554
  array(
1555
+ 'key' => 4,
1556
+ 'slug' => 'yoga',
1557
+ 'name' => __( 'Yoga Studio', 'kadence-starter-templates' ),
1558
+ 'keywords' => array(
1559
+ __( 'yoga', 'kadence-starter-templates' ),
1560
+ __( 'gym', 'kadence-starter-templates' ),
1561
+ __( 'business', 'kadence-starter-templates' ),
1562
+ ),
1563
+ 'url' => 'https://demos.kadencewp.com/blocks-active/',
1564
+ 'categories' => array( 'business' ),
1565
+ 'plugins' => array(
1566
+ $kadence_blocks,
1567
+ ),
1568
+ 'pages' => array(
1569
+ 'home' => array(
1570
+ 'id' => 'home',
1571
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1572
+ 'url' => 'https://demos.kadencewp.com/blocks-active/',
1573
+ 'image' => 'https://startertemplatecloud.com/importer-content/og05/images/home.jpg',
1574
+ ),
1575
+ 'gallery' => array(
1576
+ 'id' => 'gallery',
1577
+ 'title' => __( 'Gallery', 'kadence-starter-templates' ),
1578
+ 'url' => 'https://demos.kadencewp.com/blocks-active/yoga-studio-gallery/',
1579
+ 'image' => 'https://startertemplatecloud.com/importer-content/og05/images/gallery.jpg',
1580
+ ),
1581
+ 'pricing' => array(
1582
+ 'id' => 'pricing',
1583
+ 'title' => __( 'Pricing', 'kadence-starter-templates' ),
1584
+ 'url' => 'https://demos.kadencewp.com/blocks-active/yoga-pricing/',
1585
+ 'image' => 'https://startertemplatecloud.com/importer-content/og05/images/pricing.jpg',
1586
+ ),
1587
+ 'about' => array(
1588
+ 'id' => 'about',
1589
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1590
+ 'url' => 'https://demos.kadencewp.com/blocks-active/yoga-about/',
1591
+ 'image' => 'https://startertemplatecloud.com/importer-content/og05/images/about.jpg',
1592
+ ),
1593
+ 'contact' => array(
1594
+ 'id' => 'contact',
1595
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1596
+ 'url' => 'https://demos.kadencewp.com/blocks-active/yoga-contact/',
1597
+ 'image' => 'https://startertemplatecloud.com/importer-content/og05/images/contact.jpg',
1598
+ ),
1599
+ ),
1600
+ 'image' => 'https://startertemplatecloud.com/importer-content/og05/images/preview-image.jpg',
1601
+ ),
1602
+ array(
1603
+ 'key' => 5,
1604
+ 'slug' => 'saas',
1605
+ 'name' => __( 'Saas', 'kadence-starter-templates' ),
1606
+ 'keywords' => array(
1607
+ __( 'saas', 'kadence-starter-templates' ),
1608
+ __( 'pricing', 'kadence-starter-templates' ),
1609
+ __( 'business', 'kadence-starter-templates' ),
1610
+ ),
1611
+ 'url' => 'https://demos.kadencewp.com/blocks-saas/',
1612
+ 'categories' => array( 'business' ),
1613
+ 'plugins' => array(
1614
+ $kadence_blocks,
1615
+ ),
1616
+ 'pages' => array(
1617
+ 'home' => array(
1618
+ 'id' => 'home',
1619
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1620
+ 'url' => 'https://demos.kadencewp.com/blocks-saas/',
1621
+ 'image' => 'https://startertemplatecloud.com/importer-content/og03/images/home.jpg',
1622
+ ),
1623
+ 'features' => array(
1624
+ 'id' => 'features',
1625
+ 'title' => __( 'Features', 'kadence-starter-templates' ),
1626
+ 'url' => 'https://demos.kadencewp.com/blocks-saas/features/',
1627
+ 'image' => 'https://startertemplatecloud.com/importer-content/og03/images/services.jpg',
1628
+ ),
1629
+ 'pricing' => array(
1630
+ 'id' => 'pricing',
1631
+ 'title' => __( 'Pricing', 'kadence-starter-templates' ),
1632
+ 'url' => 'https://demos.kadencewp.com/blocks-saas/pricing/',
1633
+ 'image' => 'https://startertemplatecloud.com/importer-content/og03/images/pricing.jpg',
1634
+ ),
1635
+ 'about' => array(
1636
+ 'id' => 'about',
1637
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1638
+ 'url' => 'https://demos.kadencewp.com/blocks-saas/about/',
1639
+ 'image' => 'https://startertemplatecloud.com/importer-content/og03/images/about.jpg',
1640
+ ),
1641
+ 'contact' => array(
1642
+ 'id' => 'contact',
1643
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1644
+ 'url' => 'https://demos.kadencewp.com/blocks-saas/contact/',
1645
+ 'image' => 'https://startertemplatecloud.com/importer-content/og03/images/contact.jpg',
1646
+ ),
1647
+ ),
1648
+ 'image' => 'https://startertemplatecloud.com/importer-content/og03/images/preview-image.jpg',
1649
+ ),
1650
+ array(
1651
+ 'key' => 6,
1652
  'slug' => 'shopping',
1653
  'name' => __( 'Shopping', 'kadence-starter-templates' ),
1654
  'keywords' => array(
1662
  $kadence_blocks,
1663
  $woocommerce,
1664
  ),
1665
+ 'pages' => array(
1666
+ 'home' => array(
1667
+ 'id' => 'home',
1668
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1669
+ 'url' => 'https://demos.kadencewp.com/blocks-store/',
1670
+ 'image' => 'https://startertemplatecloud.com/importer-content/og04/images/home.jpg',
1671
+ ),
1672
+ 'about' => array(
1673
+ 'id' => 'about',
1674
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1675
+ 'url' => 'https://demos.kadencewp.com/blocks-store/about/',
1676
+ 'image' => 'https://startertemplatecloud.com/importer-content/og04/images/about.jpg',
1677
+ ),
1678
+ 'contact' => array(
1679
+ 'id' => 'contact',
1680
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1681
+ 'url' => 'https://demos.kadencewp.com/blocks-store/contact/',
1682
+ 'image' => 'https://startertemplatecloud.com/importer-content/og04/images/contact.jpg',
1683
+ ),
1684
+ ),
1685
+ 'image' => 'https://startertemplatecloud.com/importer-content/og04/images/preview-image.jpg',
1686
  ),
1687
+ );
1688
+ $etemplates = array(
1689
  array(
1690
+ 'key' => 0,
1691
+ 'slug' => 'e01',
1692
+ 'name' => __( 'Real Estate', 'kadence-starter-templates' ),
1693
  'keywords' => array(
1694
+ __( 'reale state', 'kadence-starter-templates' ),
1695
+ __( 'house', 'kadence-starter-templates' ),
1696
  __( 'business', 'kadence-starter-templates' ),
1697
  ),
1698
+ 'url' => 'https://startertemplatecloud.com/e01/',
1699
  'categories' => array( 'business' ),
1700
+ 'type' => 'elementor',
1701
+ 'width' => 'large',
1702
  'plugins' => array(
1703
+ $fluentform,
1704
+ $elementor,
1705
  ),
1706
+ 'pages' => array(
1707
+ 'home' => array(
1708
+ 'id' => 'home',
1709
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1710
+ 'url' => 'https://startertemplatecloud.com/e01/',
1711
+ 'image' => 'https://startertemplatecloud.com/importer-content/e01/images/home.jpg',
1712
+ ),
1713
+ 'services' => array(
1714
+ 'id' => 'services',
1715
+ 'title' => __( 'Services', 'kadence-starter-templates' ),
1716
+ 'url' => 'https://startertemplatecloud.com/e01/services/',
1717
+ 'image' => 'https://startertemplatecloud.com/importer-content/e01/images/services.jpg',
1718
+ ),
1719
+ 'about' => array(
1720
+ 'id' => 'about',
1721
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1722
+ 'url' => 'https://startertemplatecloud.com/e01/about/',
1723
+ 'image' => 'https://startertemplatecloud.com/importer-content/e01/images/about.jpg',
1724
+ ),
1725
+ 'contact' => array(
1726
+ 'id' => 'contact',
1727
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1728
+ 'url' => 'https://startertemplatecloud.com/e01/contact/',
1729
+ 'image' => 'https://startertemplatecloud.com/importer-content/e01/images/contact.jpg',
1730
+ ),
1731
+ 'brokerage' => array(
1732
+ 'id' => 'brokerage',
1733
+ 'title' => __( 'Brokerage', 'kadence-starter-templates' ),
1734
+ 'url' => 'https://startertemplatecloud.com/e01/brokerage/',
1735
+ 'image' => 'https://startertemplatecloud.com/importer-content/e01/images/brokerage.jpg',
1736
+ ),
1737
+ 'norman' => array(
1738
+ 'id' => 'norman',
1739
+ 'title' => __( '418 Norman Street', 'kadence-starter-templates' ),
1740
+ 'url' => 'https://startertemplatecloud.com/e01/418-norman-street/',
1741
+ 'image' => 'https://startertemplatecloud.com/importer-content/e01/images/norman.jpg',
1742
+ ),
1743
+ ),
1744
+ 'image' => 'https://startertemplatecloud.com/importer-content/e01/images/preview-image.jpg',
1745
  ),
1746
  array(
1747
+ 'key' => 1,
1748
+ 'slug' => 'e02',
1749
+ 'name' => __( 'Print Shop', 'kadence-starter-templates' ),
1750
  'keywords' => array(
1751
+ __( 'store', 'kadence-starter-templates' ),
1752
+ __( 'ecommerce', 'kadence-starter-templates' ),
1753
+ __( 'woocommerce', 'kadence-starter-templates' ),
1754
  ),
1755
+ 'url' => 'https://startertemplatecloud.com/e02/',
1756
+ 'categories' => array( 'business', 'ecommerce' ),
1757
+ 'type' => 'elementor',
1758
  'plugins' => array(
1759
+ $fluentform,
1760
+ $elementor,
1761
+ ),
1762
+ 'pages' => array(
1763
+ 'home' => array(
1764
+ 'id' => 'home',
1765
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1766
+ 'url' => 'https://startertemplatecloud.com/e02/',
1767
+ 'image' => 'https://startertemplatecloud.com/importer-content/e02/images/home.jpg',
1768
+ ),
1769
+ 'about' => array(
1770
+ 'id' => 'about',
1771
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1772
+ 'url' => 'https://startertemplatecloud.com/e02/about/',
1773
+ 'image' => 'https://startertemplatecloud.com/importer-content/e02/images/about.jpg',
1774
+ ),
1775
+ 'contact' => array(
1776
+ 'id' => 'contact',
1777
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1778
+ 'url' => 'https://startertemplatecloud.com/e02/contact/',
1779
+ 'image' => 'https://startertemplatecloud.com/importer-content/e02/images/contact.jpg',
1780
+ ),
1781
  ),
1782
+ 'image' => 'https://startertemplatecloud.com/importer-content/e02/images/preview-image.jpg',
1783
  ),
1784
  array(
1785
+ 'key' => 2,
1786
+ 'slug' => 'e03',
1787
+ 'name' => __( 'Course', 'kadence-starter-templates' ),
1788
  'keywords' => array(
1789
+ __( 'lms', 'kadence-starter-templates' ),
1790
  __( 'course', 'kadence-starter-templates' ),
 
1791
  __( 'business', 'kadence-starter-templates' ),
1792
  ),
1793
+ 'url' => 'https://startertemplatecloud.com/e03/',
1794
+ 'categories' => array( 'business', 'course' ),
1795
+ 'type' => 'elementor',
1796
+ 'plugins' => array(
1797
+ $fluentform,
1798
+ $elementor,
1799
+ ),
1800
+ 'pages' => array(
1801
+ 'home' => array(
1802
+ 'id' => 'home',
1803
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1804
+ 'url' => 'https://startertemplatecloud.com/e03/',
1805
+ 'image' => 'https://startertemplatecloud.com/importer-content/e03/images/home.jpg',
1806
+ ),
1807
+ 'about' => array(
1808
+ 'id' => 'about',
1809
+ 'title' => __( 'About', 'kadence-starter-templates' ),
1810
+ 'url' => 'https://startertemplatecloud.com/e03/about/',
1811
+ 'image' => 'https://startertemplatecloud.com/importer-content/e03/images/about.jpg',
1812
+ ),
1813
+ 'courses' => array(
1814
+ 'id' => 'courses',
1815
+ 'title' => __( 'Courses', 'kadence-starter-templates' ),
1816
+ 'url' => 'https://startertemplatecloud.com/e03/courses/',
1817
+ 'image' => 'https://startertemplatecloud.com/importer-content/e03/images/courses.jpg',
1818
+ ),
1819
+ 'course' => array(
1820
+ 'id' => 'course',
1821
+ 'title' => __( 'Course', 'kadence-starter-templates' ),
1822
+ 'url' => 'https://startertemplatecloud.com/e03/course/',
1823
+ 'image' => 'https://startertemplatecloud.com/importer-content/e03/images/course.jpg',
1824
+ ),
1825
+ 'contact' => array(
1826
+ 'id' => 'contact',
1827
+ 'title' => __( 'Contact', 'kadence-starter-templates' ),
1828
+ 'url' => 'https://startertemplatecloud.com/e03/contact/',
1829
+ 'image' => 'https://startertemplatecloud.com/importer-content/e03/images/contact.jpg',
1830
+ ),
1831
+ ),
1832
+ 'image' => 'https://startertemplatecloud.com/importer-content/e03/images/preview-image.jpg',
1833
+ ),
1834
+ array(
1835
+ 'key' => 3,
1836
+ 'slug' => 'e06',
1837
+ 'name' => __( 'Control B', 'kadence-starter-templates' ),
1838
+ 'keywords' => array(
1839
+ __( 'saas', 'kadence-starter-templates' ),
1840
+ __( 'software', 'kadence-starter-templates' ),
1841
+ __( 'business', 'kadence-starter-templates' ),
1842
+ ),
1843
+ 'url' => 'https://startertemplatecloud.com/e06/',
1844
  'categories' => array( 'business' ),
1845
+ 'type' => 'elementor',
1846
  'plugins' => array(
1847
+ $elementor,
1848
+ ),
1849
+ 'pages' => array(
1850
+ 'home' => array(
1851
+ 'id' => 'home',
1852
+ 'title' => __( 'Home', 'kadence-starter-templates' ),
1853
+ 'url' => 'https://startertemplatecloud.com/e06/',
1854
+ 'image' => 'https://startertemplatecloud.com/importer-content/e06/images/home.jpg',
1855
+ ),
1856
+ 'features' => array(
1857
+ 'id' => 'features',
1858
+ 'title' => __( 'Features', 'kadence-starter-templates' ),
1859
+ 'url' => 'https://startertemplatecloud.com/e06/features/',
1860
+ 'image' => 'https://startertemplatecloud.com/importer-content/e06/images/features.jpg',
1861
+ ),
1862
+ 'pricing' => array(
1863
+ 'id' => 'pricing',
1864
+ 'title' => __( 'Pricing', 'kadence-starter-templates' ),
1865
+ 'url' => 'https://startertemplatecloud.com/e06/price/',
1866
+ 'image' => 'https://startertemplatecloud.com/importer-content/e06/images/pricing.jpg',
1867
+ ),
1868
+ 'support' => array(
1869
+ 'id' => 'support',
1870
+ 'title' => __( 'Support', 'kadence-starter-templates' ),
1871
+ 'url' => 'https://startertemplatecloud.com/e06/support/',
1872
+ 'image' => 'https://startertemplatecloud.com/importer-content/e06/images/support.jpg',
1873
+ ),
1874
+ 'templates' => array(
1875
+ 'id' => 'templates',
1876
+ 'title' => __( 'Templates', 'kadence-starter-templates' ),
1877
+ 'url' => 'https://startertemplatecloud.com/e06/templates/',
1878
+ 'image' => 'https://startertemplatecloud.com/importer-content/e06/images/templates.jpg',
1879
+ ),
1880
  ),
1881
+ 'image' => 'https://startertemplatecloud.com/importer-content/e06/images/preview-image.jpg',
1882
  ),
1883
  );
1884
  $palettes = array(
1886
  'palette' => 'base',
1887
  'colors' => array(
1888
  '#2B6CB0',
1889
+ '#3B3B3B',
1890
+ '#E1E1E1',
1891
+ '#F7F7F7',
1892
  '#ffffff',
1893
  ),
1894
  ),
1895
  array(
1896
+ 'palette' => 'orange',
1897
  'colors' => array(
1898
+ '#e47b02',
1899
+ '#3E4C59',
1900
+ '#F3F4F7',
1901
+ '#F9F9FB',
1902
  '#ffffff',
1903
  ),
1904
  ),
1905
  array(
1906
+ 'palette' => 'pinkish',
1907
  'colors' => array(
1908
+ '#E21E51',
1909
+ '#032075',
1910
+ '#DEDDEB',
1911
+ '#EFEFF5',
1912
  '#ffffff',
 
1913
  ),
1914
  ),
1915
  array(
1916
+ 'palette' => 'mint',
1917
  'colors' => array(
1918
+ '#2cb1bc',
1919
+ '#133453',
1920
+ '#e0fcff',
1921
+ '#f5f7fa',
1922
  '#ffffff',
1923
  ),
1924
  ),
1925
  array(
1926
+ 'palette' => 'green',
1927
  'colors' => array(
1928
+ '#049f82',
1929
+ '#353535',
1930
+ '#EEEEEE',
1931
+ '#F7F7F7',
1932
  '#ffffff',
1933
  ),
1934
  ),
1935
  array(
1936
+ 'palette' => 'rich',
1937
  'colors' => array(
1938
+ '#295CFF',
1939
+ '#1C0D5A',
1940
+ '#E1EBEE',
1941
+ '#EFF7FB',
1942
  '#ffffff',
 
1943
  ),
1944
  ),
1945
  array(
1946
+ 'palette' => 'fem',
1947
  'colors' => array(
1948
+ '#D86C97',
1949
+ '#282828',
1950
+ '#f7dede',
1951
+ '#F6F2EF',
1952
+ '#ffffff',
1953
+ ),
1954
+ ),
1955
+ array(
1956
+ 'palette' => 'teal',
1957
+ 'colors' => array(
1958
+ '#7ACFC4',
1959
+ '#000000',
1960
+ '#F6E7BC',
1961
+ '#F9F7F7',
1962
  '#ffffff',
1963
  ),
1964
  ),
1965
  array(
1966
+ 'palette' => 'bold',
1967
  'colors' => array(
1968
+ '#000000',
1969
+ '#000000',
1970
+ '#F6E7BC',
1971
+ '#F9F7F7',
1972
  '#ffffff',
1973
  ),
1974
  ),
1975
+ array(
1976
+ 'palette' => 'hot',
1977
+ 'colors' => array(
1978
+ '#FF5698',
1979
+ '#000000',
1980
+ '#FDEDEC',
1981
+ '#FDF6EE',
1982
+ '#ffffff',
1983
+ ),
1984
+ ),
1985
+ array(
1986
+ 'palette' => 'darkmode',
1987
+ 'colors' => array(
1988
+ '#3296ff',
1989
+ '#F7FAFC',
1990
+ '#2D3748',
1991
+ '#252C39',
1992
+ '#1a202c',
1993
+ ),
1994
+ ),
1995
+ array(
1996
+ 'palette' => 'pinkishdark',
1997
+ 'colors' => array(
1998
+ '#E21E51',
1999
+ '#EFEFF5',
2000
+ '#514D7C',
2001
+ '#221E5B',
2002
+ '#040037',
2003
+ ),
2004
+ ),
2005
  );
2006
+ $fonts = array(
2007
+ array(
2008
+ 'name' => 'Montserrat & Source Sans Pro',
2009
+ 'font' => 'montserrat',
2010
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/montserrat.jpg',
2011
+ ),
2012
+ array(
2013
+ 'name' => 'Libre Franklin & Libre Baskerville',
2014
+ 'font' => 'libre',
2015
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/libre.jpg',
2016
+ ),
2017
+ array(
2018
+ 'name' => 'Proza Libre & Open Sans',
2019
+ 'font' => 'proza',
2020
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/proza.jpg',
2021
+ ),
2022
+ array(
2023
+ 'name' => 'Work Sans & Work Sans',
2024
+ 'font' => 'worksans',
2025
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/worksans.jpg',
2026
+ ),
2027
+ array(
2028
+ 'name' => 'Josefin Sans & Lato',
2029
+ 'font' => 'josefin',
2030
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/josefin.jpg',
2031
+ ),
2032
+ array(
2033
+ 'name' => 'Oswald & Open Sans',
2034
+ 'font' => 'oswald',
2035
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/oswald.jpg',
2036
+ ),
2037
+ array(
2038
+ 'name' => 'Nunito & Roboto',
2039
+ 'font' => 'nunito',
2040
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/nunito.jpg',
2041
+ ),
2042
+ array(
2043
+ 'name' => 'Rubik & Karla',
2044
+ 'font' => 'rubik',
2045
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/rubik.jpg',
2046
+ ),
2047
+ array(
2048
+ 'name' => 'Lora & Merriweather',
2049
+ 'font' => 'lora',
2050
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/lora.jpg',
2051
+ ),
2052
+ array(
2053
+ 'name' => 'Playfair Display & Raleway',
2054
+ 'font' => 'playfair',
2055
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/playfair.jpg',
2056
+ ),
2057
+ array(
2058
+ 'name' => 'Antic Didone & Raleway',
2059
+ 'font' => 'antic',
2060
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/antic.jpg',
2061
+ ),
2062
+ array(
2063
+ 'name' => 'Gilda Display & Raleway',
2064
+ 'font' => 'gilda',
2065
+ 'img' => KADENCE_STARTER_TEMPLATES_URL . 'assets/images/fonts/gilda.jpg',
2066
+ ),
2067
+ );
2068
+ $old_data = get_option( '_kadence_starter_templates_last_import_data', array() );
2069
+ $has_content = false;
2070
+ if ( ! empty( $old_data ) ) {
2071
+ $has_content = true;
2072
+ $has_previous = true;
2073
+ }
2074
+ // Check for multiple posts.
2075
+ if ( false === $has_content ) {
2076
+ $has_content = ( 1 < wp_count_posts()->publish ? true : false );
2077
+ }
2078
+ if ( false === $has_content ) {
2079
+ // Check for multiple pages.
2080
+ $has_content = ( 1 < wp_count_posts( 'page' )->publish ? true : false );
2081
+ }
2082
+ if ( false === $has_content ) {
2083
+ // Check for multiple images.
2084
+ $has_content = ( 0 < wp_count_posts( 'attachment' )->inherit ? true : false );
2085
+ }
2086
  wp_enqueue_style( 'kadence-starter-templates', KADENCE_STARTER_TEMPLATES_URL . 'assets/css/starter-templates.css', array( 'wp-components' ), KADENCE_STARTER_TEMPLATES_VERSION );
2087
  wp_enqueue_script( 'kadence-starter-templates', KADENCE_STARTER_TEMPLATES_URL . 'assets/js/starter-templates.js', array( 'jquery', 'wp-i18n', 'wp-element', 'wp-plugins', 'wp-components', 'wp-api', 'wp-hooks', 'wp-edit-post', 'lodash', 'wp-block-library', 'wp-block-editor', 'wp-editor' ), KADENCE_STARTER_TEMPLATES_VERSION, true );
2088
  wp_localize_script(
2094
  'pro' => false,
2095
  'isKadence' => class_exists( 'Kadence\Theme' ),
2096
  'templates' => $templates,
2097
+ 'etemplates' => $etemplates,
2098
  'palettes' => $palettes,
2099
+ 'fonts' => $fonts,
2100
+ 'logo' => esc_attr( KADENCE_STARTER_TEMPLATES_URL . 'assets/images/kadence_logo.png' ),
2101
+ 'has_content' => $has_content,
2102
+ 'has_previous' => $has_previous,
2103
+ 'starterSettings' => get_option( 'kadence_starter_templates_config' ),
2104
+ 'notice' => esc_html__( 'Please Note: Full site importing is designed for new/empty sites with no content. Your site customizer settings, widgets, menus will all be overridden.', 'kadence-starter-templates' ),
2105
+ 'notice_previous' => esc_html( 'Please Note: Full site importing is designed for new/empty sites with no content. Your site customizer settings, widgets, menus will all be overridden. It is recommended that you enable "Delete Previously Imported Posts and Images" if you are testing out different starter templates.'),
2106
+ 'remove_progress' => esc_html__( 'Removing Past Imported Content', 'kadence-starter-templates' ),
2107
  'plugin_progress' => esc_html__( 'Checking/Installing/Activating Required Plugins', 'kadence-starter-templates' ),
2108
  'content_progress' => esc_html__( 'Importing Demo Content...', 'kadence-starter-templates' ),
2109
  'content_new_progress' => esc_html__( 'Importing Demo Content... Still Importing.', 'kadence-starter-templates' ),
2110
+ 'widgets_progress' => esc_html__( 'Importing Menus/Widgets...', 'kadence-starter-templates' ),
2111
  'customizer_progress' => esc_html__( 'Importing Customizer Settings...', 'kadence-starter-templates' ),
2112
  )
2113
  );
2114
  }
2115
+ /**
2116
+ * Register settings
2117
+ */
2118
+ public function load_api_settings() {
2119
+ register_setting(
2120
+ 'kadence_starter_templates_config',
2121
+ 'kadence_starter_templates_config',
2122
+ array(
2123
+ 'type' => 'string',
2124
+ 'description' => __( 'Config Kadence Starter Templates', 'kadence-blocks' ),
2125
+ 'sanitize_callback' => 'sanitize_text_field',
2126
+ 'show_in_rest' => true,
2127
+ 'default' => '',
2128
+ )
2129
+ );
2130
+ }
2131
  /**
2132
  * AJAX callback to install a plugin.
2133
  */
2138
  wp_send_json_error();
2139
  }
2140
  // Get selected file index or set it to 0.
2141
+ $selected_index = empty( $_POST['selected'] ) ? '' : sanitize_text_field( $_POST['selected'] );
2142
+ //error_log( print_r( $this->import_files[ $selected_index ], true ) );
2143
  $info = $this->import_files[ $selected_index ];
2144
  $install = true;
2145
 
2207
  wp_send_json( array( 'status' => 'pluginSuccess' ) );
2208
  }
2209
  }
2210
+ /**
2211
+ * AJAX callback to remove past content..
2212
+ */
2213
+ public function remove_past_data_ajax_callback() {
2214
+ Helpers::verify_ajax_call();
2215
+
2216
+ if ( ! current_user_can( 'customize' ) ) {
2217
+ wp_send_json_error();
2218
+ }
2219
+ global $wpdb;
2220
+
2221
+ $removed_content = true;
2222
+
2223
+ $post_ids = $wpdb->get_col( "SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key='_kadence_starter_templates_imported_post'" );
2224
+ $term_ids = $wpdb->get_col( "SELECT term_id FROM {$wpdb->termmeta} WHERE meta_key='_kadence_starter_templates_imported_term'" );
2225
+ if ( isset( $post_ids ) && is_array( $post_ids ) ) {
2226
+ foreach ( $post_ids as $post_id ) {
2227
+ $worked = wp_delete_post( $post_id, true );
2228
+ if ( false === $worked ) {
2229
+ $removed_content = false;
2230
+ }
2231
+ }
2232
+ }
2233
+ if ( isset( $term_ids ) && is_array( $term_ids ) ) {
2234
+ foreach ( $term_ids as $term_id ) {
2235
+ $term = get_term( $term_id );
2236
+ if ( ! is_wp_error( $term ) ) {
2237
+ wp_delete_term( $term_id, $term->taxonomy );
2238
+ }
2239
+ }
2240
+ }
2241
+
2242
+ if ( false === $removed_content ) {
2243
+ wp_send_json_error();
2244
+ } else {
2245
+ wp_send_json( array( 'status' => 'removeSuccess' ) );
2246
+ }
2247
+ }
2248
+ /**
2249
+ * Main AJAX callback function for:
2250
+ * 1). prepare import files (uploaded or predefined via filters)
2251
+ * 2). execute 'before content import' actions (before import WP action)
2252
+ * 3). import content
2253
+ * 4). execute 'after content import' actions (before widget import WP action, widget import, customizer import, after import WP action)
2254
+ */
2255
+ public function import_demo_single_data_ajax_callback() {
2256
+ // Try to update PHP memory limit (so that it does not run out of it).
2257
+ ini_set( 'memory_limit', apply_filters( 'kadence-starter-templates/import_memory_limit', '350M' ) );
2258
+
2259
+ // Verify if the AJAX call is valid (checks nonce and current_user_can).
2260
+ Helpers::verify_ajax_call();
2261
+ // Is this a new AJAX call to continue the previous import?
2262
+ $use_existing_importer_data = $this->use_existing_importer_data();
2263
+
2264
+ if ( ! $use_existing_importer_data ) {
2265
+
2266
+ // Create a date and time string to use for demo and log file names.
2267
+ Helpers::set_demo_import_start_time();
2268
+
2269
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
2270
+ // Define log file path.
2271
+ $this->log_file_path = Helpers::get_log_path();
2272
+ } else {
2273
+ $this->log_file_path = '';
2274
+ }
2275
+ // Get selected file index or set it to 0.
2276
+ $this->selected_index = empty( $_POST['selected'] ) ? '' : sanitize_text_field( $_POST['selected'] );
2277
+ $this->selected_page = empty( $_POST['page_id'] ) ? '' : sanitize_text_field( $_POST['page_id'] );
2278
+ $this->override_colors = 'true' === $_POST['override_colors'] ? true : false;
2279
+ $this->override_fonts = 'true' === $_POST['override_fonts'] ? true : false;
2280
+ $this->selected_palette = empty( $_POST['palette'] ) ? '' : sanitize_text_field( $_POST['palette'] );
2281
+ $this->selected_font = empty( $_POST['font'] ) ? '' : sanitize_text_field( $_POST['font'] );
2282
+ /**
2283
+ * 1). Prepare import files.
2284
+ * Predefined import files via filter: kadence-starter-templates/import_files
2285
+ */
2286
+ if ( ! empty( $this->import_files[ $this->selected_index ] ) && ! empty( $this->selected_page ) && isset( $this->import_files[ $this->selected_index ]['pages'] ) && isset( $this->import_files[ $this->selected_index ]['pages'][ $this->selected_page ] ) ) { // Use predefined import files from wp filter: kadence-starter-templates/import_files.
2287
+
2288
+ // Download the import files (content, widgets and customizer files).
2289
+ $this->selected_import_files = Helpers::download_import_file( $this->import_files[ $this->selected_index ], $this->selected_page );
2290
+
2291
+ // Check Errors.
2292
+ if ( is_wp_error( $this->selected_import_files ) ) {
2293
+ // Write error to log file and send an AJAX response with the error.
2294
+ Helpers::log_error_and_send_ajax_response(
2295
+ $this->selected_import_files->get_error_message(),
2296
+ $this->log_file_path,
2297
+ esc_html__( 'Downloaded files', 'kadence-starter-templates' )
2298
+ );
2299
+ }
2300
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
2301
+ // Add this message to log file.
2302
+ $log_added = Helpers::append_to_file(
2303
+ sprintf(
2304
+ __( 'The import files for: %s were successfully downloaded!', 'kadence-starter-templates' ),
2305
+ $this->import_files[ $this->selected_index ]['import_file_name']
2306
+ ) . Helpers::import_file_info( $this->selected_import_files ),
2307
+ $this->log_file_path,
2308
+ esc_html__( 'Downloaded files' , 'kadence-starter-templates' )
2309
+ );
2310
+ }
2311
+ } else {
2312
+ // Send JSON Error response to the AJAX call.
2313
+ wp_send_json( esc_html__( 'No import files specified!', 'kadence-starter-templates' ) );
2314
+ }
2315
+ }
2316
+
2317
+ // Save the initial import data as a transient, so other import parts (in new AJAX calls) can use that data.
2318
+ Helpers::set_import_data_transient( $this->get_current_importer_data() );
2319
+
2320
+ // If elementor make sure the defaults are off.
2321
+ if ( isset( $this->import_files[ $this->selected_index ]['type'] ) && 'elementor' === $this->import_files[ $this->selected_index ]['type'] ) {
2322
+ update_option( 'elementor_disable_color_schemes', 'yes' );
2323
+ update_option( 'elementor_disable_typography_schemes', 'yes' );
2324
+ if ( class_exists( 'Kadence\Theme' ) ) {
2325
+ $component = \Kadence\Theme::instance()->components['elementor'];
2326
+ if ( $component ) {
2327
+ $component->elementor_add_theme_colors();
2328
+ }
2329
+ }
2330
+ }
2331
+
2332
+ /**
2333
+ * 3). Import content (if the content XML file is set for this import).
2334
+ * Returns any errors greater then the "warning" logger level, that will be displayed on front page.
2335
+ */
2336
+ $new_post = '';
2337
+ if ( ! empty( $this->selected_import_files['content'] ) ) {
2338
+ $meta = ( ! empty( $this->import_files[ $this->selected_index ] ) && ! empty( $this->selected_page ) && isset( $this->import_files[ $this->selected_index ]['pages'] ) && isset( $this->import_files[ $this->selected_index ]['pages'][ $this->selected_page ] ) && isset( $this->import_files[ $this->selected_index ]['pages'][ $this->selected_page ]['meta'] ) ? $this->import_files[ $this->selected_index ]['pages'][ $this->selected_page ]['meta'] : 'inherit' );
2339
+ $logger = $this->importer->import_content( $this->selected_import_files['content'], true, $meta );
2340
+ if ( is_object( $logger ) && $logger->error_output ) {
2341
+ $this->append_to_frontend_error_messages( $logger->error_output );
2342
+ } elseif ( is_object( $logger ) && $logger->messages ) {
2343
+ $messages = $logger->messages;
2344
+ if ( isset( $messages[1] ) && isset( $messages[1]['level'] ) && 'debug' == $messages[1]['level'] && isset( $messages[1]['message'] ) && ! empty( $messages[1]['message'] ) ) {
2345
+ $pieces = explode( ' ', $messages[1]['message'] );
2346
+ $new_post = array_pop( $pieces );
2347
+ }
2348
+ }
2349
+ }
2350
+
2351
+ if ( $this->override_colors ) {
2352
+ if ( $this->selected_palette && ! empty( $this->selected_palette ) ) {
2353
+ $palette_presets = json_decode( '{"base":[{"color":"#2B6CB0"},{"color":"#265E9A"},{"color":"#222222"},{"color":"#3B3B3B"},{"color":"#515151"},{"color":"#626262"},{"color":"#E1E1E1"},{"color":"#F7F7F7"},{"color":"#ffffff"}],"bright":[{"color":"#255FDD"},{"color":"#00F2FF"},{"color":"#1A202C"},{"color":"#2D3748"},{"color":"#4A5568"},{"color":"#718096"},{"color":"#EDF2F7"},{"color":"#F7FAFC"},{"color":"#ffffff"}],"darkmode":[{"color":"#3296ff"},{"color":"#003174"},{"color":"#ffffff"},{"color":"#f7fafc"},{"color":"#edf2f7"},{"color":"#cbd2d9"},{"color":"#2d3748"},{"color":"#252c39"},{"color":"#1a202c"}],"orange":[{"color":"#e47b02"},{"color":"#ed8f0c"},{"color":"#1f2933"},{"color":"#3e4c59"},{"color":"#52606d"},{"color":"#7b8794"},{"color":"#f3f4f7"},{"color":"#f9f9fb"},{"color":"#ffffff"}],"pinkish":[{"color":"#E21E51"},{"color":"#4d40ff"},{"color":"#040037"},{"color":"#032075"},{"color":"#514d7c"},{"color":"#666699"},{"color":"#deddeb"},{"color":"#efeff5"},{"color":"#f8f9fa"}],"pinkishdark":[{"color":"#E21E51"},{"color":"#4d40ff"},{"color":"#f8f9fa"},{"color":"#efeff5"},{"color":"#deddeb"},{"color":"#c3c2d6"},{"color":"#514d7c"},{"color":"#221e5b"},{"color":"#040037"}],"green":[{"color":"#049f82"},{"color":"#008f72"},{"color":"#222222"},{"color":"#353535"},{"color":"#454545"},{"color":"#676767"},{"color":"#eeeeee"},{"color":"#f7f7f7"},{"color":"#ffffff"}],"fire":[{"color":"#dd6b20"},{"color":"#cf3033"},{"color":"#27241d"},{"color":"#423d33"},{"color":"#504a40"},{"color":"#625d52"},{"color":"#e8e6e1"},{"color":"#faf9f7"},{"color":"#ffffff"}],"mint":[{"color":"#2cb1bc"},{"color":"#13919b"},{"color":"#0f2a43"},{"color":"#133453"},{"color":"#587089"},{"color":"#829ab1"},{"color":"#e0fcff"},{"color":"#f5f7fa"},{"color":"#ffffff"}],"rich":[{"color":"#295CFF"},{"color":"#0E94FF"},{"color":"#1C0D5A"},{"color":"#3D3D3D"},{"color":"#57575D"},{"color":"#636363"},{"color":"#E1EBEE"},{"color":"#EFF7FB"},{"color":"#ffffff"}],"fem":[{"color":"#D86C97"},{"color":"#282828"},{"color":"#282828"},{"color":"#333333"},{"color":"#4d4d4d"},{"color":"#646464"},{"color":"#f7dede"},{"color":"#F6F2EF"},{"color":"#ffffff"}],"hot":[{"color":"#FF5698"},{"color":"#000000"},{"color":"#020202"},{"color":"#020202"},{"color":"#4E4E4E"},{"color":"#808080"},{"color":"#FDEDEC"},{"color":"#FDF6EE"},{"color":"#ffffff"}],"bold":[{"color":"#000000"},{"color":"#D1A155"},{"color":"#000000"},{"color":"#010101"},{"color":"#111111"},{"color":"#282828"},{"color":"#F6E7BC"},{"color":"#F9F7F7"},{"color":"#ffffff"}],"teal":[{"color":"#7ACFC4"},{"color":"#044355"},{"color":"#000000"},{"color":"#010101"},{"color":"#111111"},{"color":"#282828"},{"color":"#F5ECE5"},{"color":"#F9F7F7"},{"color":"#ffffff"}]}', true );
2354
+ if ( isset( $palette_presets[ $this->selected_palette ] ) ) {
2355
+ $default = json_decode( '{"palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"second-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"third-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"active":"palette"}', true );
2356
+ $default['palette'][0]['color'] = $palette_presets[ $this->selected_palette ][0]['color'];
2357
+ $default['palette'][1]['color'] = $palette_presets[ $this->selected_palette ][1]['color'];
2358
+ $default['palette'][2]['color'] = $palette_presets[ $this->selected_palette ][2]['color'];
2359
+ $default['palette'][3]['color'] = $palette_presets[ $this->selected_palette ][3]['color'];
2360
+ $default['palette'][4]['color'] = $palette_presets[ $this->selected_palette ][4]['color'];
2361
+ $default['palette'][5]['color'] = $palette_presets[ $this->selected_palette ][5]['color'];
2362
+ $default['palette'][6]['color'] = $palette_presets[ $this->selected_palette ][6]['color'];
2363
+ $default['palette'][7]['color'] = $palette_presets[ $this->selected_palette ][7]['color'];
2364
+ $default['palette'][8]['color'] = $palette_presets[ $this->selected_palette ][8]['color'];
2365
+ update_option( 'kadence_global_palette', json_encode( $default ) );
2366
+ }
2367
+ } else {
2368
+ /**
2369
+ * Execute the customizer import actions.
2370
+ */
2371
+ do_action( 'kadence-starter-templates/customizer_import_color_only_execution', $this->selected_import_files );
2372
+ }
2373
+ }
2374
+ if ( $this->override_fonts ) {
2375
+ if ( class_exists( 'Kadence\Theme' ) ) {
2376
+ if ( $this->selected_font && ! empty( $this->selected_font ) ) {
2377
+ switch ( $this->selected_font ) {
2378
+ case 'montserrat':
2379
+ $current = \Kadence\kadence()->option( 'heading_font' );
2380
+ $current['family'] = 'Montserrat';
2381
+ $current['google'] = true;
2382
+ $current['variant'] = array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
2383
+ set_theme_mod( 'heading_font', $current );
2384
+ $body = \Kadence\kadence()->option( 'base_font' );
2385
+ $body['family'] = 'Source Sans Pro';
2386
+ $body['google'] = true;
2387
+ set_theme_mod( 'base_font', $body );
2388
+ break;
2389
+ case 'playfair':
2390
+ $current = \Kadence\kadence()->option( 'heading_font' );
2391
+ $current['family'] = 'Playfair Display';
2392
+ $current['google'] = true;
2393
+ $current['variant'] = array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
2394
+ set_theme_mod( 'heading_font', $current );
2395
+ $h1_font = \Kadence\kadence()->option( 'h1_font' );
2396
+ $h1_font['weight'] = 'normal';
2397
+ $h1_font['variant'] = 'regualar';
2398
+ set_theme_mod( 'h1_font', $h1_font );
2399
+ $h2_font = \Kadence\kadence()->option( 'h2_font' );
2400
+ $h2_font['weight'] = 'normal';
2401
+ $h2_font['variant'] = 'regualar';
2402
+ set_theme_mod( 'h2_font', $h2_font );
2403
+ $h3_font = \Kadence\kadence()->option( 'h3_font' );
2404
+ $h3_font['weight'] = 'normal';
2405
+ $h3_font['variant'] = 'regualar';
2406
+ set_theme_mod( 'h3_font', $h3_font );
2407
+ $h4_font = \Kadence\kadence()->option( 'h4_font' );
2408
+ $h4_font['weight'] = 'normal';
2409
+ $h4_font['variant'] = 'regualar';
2410
+ set_theme_mod( 'h4_font', $h4_font );
2411
+ $h5_font = \Kadence\kadence()->option( 'h5_font' );
2412
+ $h5_font['weight'] = 'normal';
2413
+ $h5_font['variant'] = 'regualar';
2414
+ set_theme_mod( 'h5_font', $h5_font );
2415
+ $body = \Kadence\kadence()->option( 'base_font' );
2416
+ $body['family'] = 'Raleway';
2417
+ $body['google'] = true;
2418
+ set_theme_mod( 'base_font', $body );
2419
+ break;
2420
+ case 'oswald':
2421
+ $current = \Kadence\kadence()->option( 'heading_font' );
2422
+ $current['family'] = 'Oswald';
2423
+ $current['google'] = true;
2424
+ $current['variant'] = array( '200', '300', 'regular', '500', '600', '700' );
2425
+ set_theme_mod( 'heading_font', $current );
2426
+ $body = \Kadence\kadence()->option( 'base_font' );
2427
+ $body['family'] = 'Open Sans';
2428
+ $body['google'] = true;
2429
+ set_theme_mod( 'base_font', $body );
2430
+ break;
2431
+ case 'antic':
2432
+ $current = \Kadence\kadence()->option( 'heading_font' );
2433
+ $current['family'] = 'Antic Didone';
2434
+ $current['google'] = true;
2435
+ $current['variant'] = array( 'regular' );
2436
+ set_theme_mod( 'heading_font', $current );
2437
+ $h1_font = \Kadence\kadence()->option( 'h1_font' );
2438
+ $h1_font['weight'] = 'normal';
2439
+ $h1_font['variant'] = 'regualar';
2440
+ set_theme_mod( 'h1_font', $h1_font );
2441
+ $h2_font = \Kadence\kadence()->option( 'h2_font' );
2442
+ $h2_font['weight'] = 'normal';
2443
+ $h2_font['variant'] = 'regualar';
2444
+ set_theme_mod( 'h2_font', $h2_font );
2445
+ $h3_font = \Kadence\kadence()->option( 'h3_font' );
2446
+ $h3_font['weight'] = 'normal';
2447
+ $h3_font['variant'] = 'regualar';
2448
+ set_theme_mod( 'h3_font', $h3_font );
2449
+ $h4_font = \Kadence\kadence()->option( 'h4_font' );
2450
+ $h4_font['weight'] = 'normal';
2451
+ $h4_font['variant'] = 'regualar';
2452
+ set_theme_mod( 'h4_font', $h4_font );
2453
+ $h5_font = \Kadence\kadence()->option( 'h5_font' );
2454
+ $h5_font['weight'] = 'normal';
2455
+ $h5_font['variant'] = 'regualar';
2456
+ set_theme_mod( 'h5_font', $h5_font );
2457
+ $body = \Kadence\kadence()->option( 'base_font' );
2458
+ $body['family'] = 'Raleway';
2459
+ $body['google'] = true;
2460
+ set_theme_mod( 'base_font', $body );
2461
+ break;
2462
+ case 'gilda':
2463
+ $current = \Kadence\kadence()->option( 'heading_font' );
2464
+ $current['family'] = 'Gilda Display';
2465
+ $current['google'] = true;
2466
+ $current['variant'] = array( 'regular' );
2467
+ set_theme_mod( 'heading_font', $current );
2468
+ $h1_font = \Kadence\kadence()->option( 'h1_font' );
2469
+ $h1_font['weight'] = 'normal';
2470
+ $h1_font['variant'] = 'regualar';
2471
+ set_theme_mod( 'h1_font', $h1_font );
2472
+ $h2_font = \Kadence\kadence()->option( 'h2_font' );
2473
+ $h2_font['weight'] = 'normal';
2474
+ $h2_font['variant'] = 'regualar';
2475
+ set_theme_mod( 'h2_font', $h2_font );
2476
+ $h3_font = \Kadence\kadence()->option( 'h3_font' );
2477
+ $h3_font['weight'] = 'normal';
2478
+ $h3_font['variant'] = 'regualar';
2479
+ set_theme_mod( 'h3_font', $h3_font );
2480
+ $h4_font = \Kadence\kadence()->option( 'h4_font' );
2481
+ $h4_font['weight'] = 'normal';
2482
+ $h4_font['variant'] = 'regualar';
2483
+ set_theme_mod( 'h4_font', $h4_font );
2484
+ $h5_font = \Kadence\kadence()->option( 'h5_font' );
2485
+ $h5_font['weight'] = 'normal';
2486
+ $h5_font['variant'] = 'regualar';
2487
+ set_theme_mod( 'h5_font', $h5_font );
2488
+ $body = \Kadence\kadence()->option( 'base_font' );
2489
+ $body['family'] = 'Raleway';
2490
+ $body['google'] = true;
2491
+ set_theme_mod( 'base_font', $body );
2492
+ break;
2493
+ case 'cormorant':
2494
+ $current = \Kadence\kadence()->option( 'heading_font' );
2495
+ $current['family'] = 'Cormorant Garamond';
2496
+ $current['google'] = true;
2497
+ $current['variant'] = array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' );
2498
+ set_theme_mod( 'heading_font', $current );
2499
+ $body = \Kadence\kadence()->option( 'base_font' );
2500
+ $body['family'] = 'Proza Libre';
2501
+ $body['google'] = true;
2502
+ set_theme_mod( 'base_font', $body );
2503
+ break;
2504
+ case 'libre':
2505
+ $current = \Kadence\kadence()->option( 'heading_font' );
2506
+ $current['family'] = 'Libre Franklin';
2507
+ $current['google'] = true;
2508
+ $current['variant'] = array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
2509
+ set_theme_mod( 'heading_font', $current );
2510
+ $body = \Kadence\kadence()->option( 'base_font' );
2511
+ $body['family'] = 'Libre Baskerville';
2512
+ $body['google'] = true;
2513
+ set_theme_mod( 'base_font', $body );
2514
+ break;
2515
+
2516
+ case 'lora':
2517
+ $current = \Kadence\kadence()->option( 'heading_font' );
2518
+ $current['family'] = 'Lora';
2519
+ $current['google'] = true;
2520
+ $current['variant'] = array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' );
2521
+ set_theme_mod( 'heading_font', $current );
2522
+ $h1_font = \Kadence\kadence()->option( 'h1_font' );
2523
+ $h1_font['weight'] = 'normal';
2524
+ $h1_font['variant'] = 'regualar';
2525
+ set_theme_mod( 'h1_font', $h1_font );
2526
+ $h2_font = \Kadence\kadence()->option( 'h2_font' );
2527
+ $h2_font['weight'] = 'normal';
2528
+ $h2_font['variant'] = 'regualar';
2529
+ set_theme_mod( 'h2_font', $h2_font );
2530
+ $h3_font = \Kadence\kadence()->option( 'h3_font' );
2531
+ $h3_font['weight'] = 'normal';
2532
+ $h3_font['variant'] = 'regualar';
2533
+ set_theme_mod( 'h3_font', $h3_font );
2534
+ $h4_font = \Kadence\kadence()->option( 'h4_font' );
2535
+ $h4_font['weight'] = 'normal';
2536
+ $h4_font['variant'] = 'regualar';
2537
+ set_theme_mod( 'h4_font', $h4_font );
2538
+ $h5_font = \Kadence\kadence()->option( 'h5_font' );
2539
+ $h5_font['weight'] = 'normal';
2540
+ $h5_font['variant'] = 'regualar';
2541
+ set_theme_mod( 'h5_font', $h5_font );
2542
+ $body = \Kadence\kadence()->option( 'base_font' );
2543
+ $body['family'] = 'Merriweather';
2544
+ $body['google'] = true;
2545
+ $body['weight'] = '300';
2546
+ $body['variant'] = '300';
2547
+ set_theme_mod( 'base_font', $body );
2548
+ break;
2549
+
2550
+ case 'proza':
2551
+ $current = \Kadence\kadence()->option( 'heading_font' );
2552
+ $current['family'] = 'Proza Libre';
2553
+ $current['google'] = true;
2554
+ $current['variant'] = array( 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic' );
2555
+ set_theme_mod( 'heading_font', $current );
2556
+ $body = \Kadence\kadence()->option( 'base_font' );
2557
+ $body['family'] = 'Open Sans';
2558
+ $body['google'] = true;
2559
+ set_theme_mod( 'base_font', $body );
2560
+ break;
2561
+
2562
+ case 'worksans':
2563
+ $current = \Kadence\kadence()->option( 'heading_font' );
2564
+ $current['family'] = 'Work Sans';
2565
+ $current['google'] = true;
2566
+ $current['variant'] = array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
2567
+ set_theme_mod( 'heading_font', $current );
2568
+ $body = \Kadence\kadence()->option( 'base_font' );
2569
+ $body['family'] = 'Work Sans';
2570
+ $body['google'] = true;
2571
+ set_theme_mod( 'base_font', $body );
2572
+ break;
2573
+
2574
+ case 'josefin':
2575
+ $current = \Kadence\kadence()->option( 'heading_font' );
2576
+ $current['family'] = 'Josefin Sans';
2577
+ $current['google'] = true;
2578
+ $current['variant'] = array( '100', '100italic', '200', '200italic', '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic' );
2579
+ set_theme_mod( 'heading_font', $current );
2580
+ $body = \Kadence\kadence()->option( 'base_font' );
2581
+ $body['family'] = 'Lato';
2582
+ $body['google'] = true;
2583
+ set_theme_mod( 'base_font', $body );
2584
+ break;
2585
+
2586
+ case 'nunito':
2587
+ $current = \Kadence\kadence()->option( 'heading_font' );
2588
+ $current['family'] = 'Nunito';
2589
+ $current['google'] = true;
2590
+ $current['variant'] = array( '200', '200italic', '300', '300italic', 'regular', 'italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
2591
+ set_theme_mod( 'heading_font', $current );
2592
+ $body = \Kadence\kadence()->option( 'base_font' );
2593
+ $body['family'] = 'Roboto';
2594
+ $body['google'] = true;
2595
+ set_theme_mod( 'base_font', $body );
2596
+ break;
2597
+ case 'rubik':
2598
+ $current = \Kadence\kadence()->option( 'heading_font' );
2599
+ $current['family'] = 'Rubik';
2600
+ $current['google'] = true;
2601
+ $current['variant'] = array( '300', '300italic', 'regular', 'italic', '500', '500italic', '600', '600italic', '700', '700italic', '800', '800italic', '900', '900italic' );
2602
+ set_theme_mod( 'heading_font', $current );
2603
+ $body = \Kadence\kadence()->option( 'base_font' );
2604
+ $body['family'] = 'Karla';
2605
+ $body['google'] = true;
2606
+ set_theme_mod( 'base_font', $body );
2607
+ break;
2608
+ }
2609
+ } else {
2610
+ /**
2611
+ * Execute the customizer import actions.
2612
+ */
2613
+ do_action( 'kadence-starter-templates/customizer_import_font_only_execution', $this->selected_import_files );
2614
+ }
2615
+ foreach ( array( 'h1_font', 'h2_font', 'h3_font', 'h4_font', 'h5_font', 'h6_font', 'h5_font', 'title_above_font' ) as $value ) {
2616
+ $font_settings = \Kadence\kadence()->option( $value );
2617
+ $font_settings['family'] = 'inherit';
2618
+ $font_settings['google'] = false;
2619
+ set_theme_mod( $value, $font_settings );
2620
+ }
2621
+ }
2622
+ }
2623
 
2624
+ // If elementor make sure the defaults are off.
2625
+ if ( isset( $this->import_files[ $this->selected_index ]['type'] ) && 'elementor' === $this->import_files[ $this->selected_index ]['type'] ) {
2626
+ if ( class_exists( 'Elementor\Plugin' ) ) {
2627
+ \Elementor\Plugin::instance()->files_manager->clear_cache();
2628
+ }
2629
+ }
2630
+
2631
+ // Send a JSON response with final report.
2632
+ $this->final_response( $new_post );
2633
+ }
2634
  /**
2635
  * Main AJAX callback function for:
2636
  * 1). prepare import files (uploaded or predefined via filters)
2652
  // Create a date and time string to use for demo and log file names.
2653
  Helpers::set_demo_import_start_time();
2654
 
2655
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
2656
+ // Define log file path.
2657
+ $this->log_file_path = Helpers::get_log_path();
2658
+ } else {
2659
+ $this->log_file_path = '';
2660
+ }
2661
 
2662
  // Get selected file index or set it to 0.
2663
+ $this->selected_index = empty( $_POST['selected'] ) ? '' : sanitize_text_field( $_POST['selected'] );
2664
  $this->selected_palette = empty( $_POST['palette'] ) ? '' : sanitize_text_field( $_POST['palette'] );
2665
+ $this->selected_font = empty( $_POST['font'] ) ? '' : sanitize_text_field( $_POST['font'] );
2666
  /**
2667
  * 1). Prepare import files.
2668
  * Predefined import files via filter: kadence-starter-templates/import_files
2681
  esc_html__( 'Downloaded files', 'kadence-starter-templates' )
2682
  );
2683
  }
2684
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
2685
+ // Add this message to log file.
2686
+ $log_added = Helpers::append_to_file(
2687
+ sprintf(
2688
+ __( 'The import files for: %s were successfully downloaded!', 'kadence-starter-templates' ),
2689
+ $this->import_files[ $this->selected_index ]['import_file_name']
2690
+ ) . Helpers::import_file_info( $this->selected_import_files ),
2691
+ $this->log_file_path,
2692
+ esc_html__( 'Downloaded files' , 'kadence-starter-templates' )
2693
+ );
2694
+ }
2695
  } else {
2696
  // Send JSON Error response to the AJAX call.
2697
  wp_send_json( esc_html__( 'No import files specified!', 'kadence-starter-templates' ) );
2698
  }
2699
  }
2700
+ // If elementor make sure the defaults are off.
2701
+ if ( isset( $this->import_files[ $this->selected_index ]['type'] ) && 'elementor' === $this->import_files[ $this->selected_index ]['type'] ) {
2702
+ update_option( 'elementor_disable_color_schemes', 'yes' );
2703
+ update_option( 'elementor_disable_typography_schemes', 'yes' );
2704
+ }
2705
  // Save the initial import data as a transient, so other import parts (in new AJAX calls) can use that data.
2706
  Helpers::set_import_data_transient( $this->get_current_importer_data() );
2707
 
2708
  if ( ! $this->before_import_executed ) {
2709
  $this->before_import_executed = true;
2710
 
2711
+ /**
2712
+ * Save Current Theme mods for a potential undo.
2713
+ */
2714
+ update_option( '_kadence_starter_templates_old_customizer', get_option( 'theme_mods_' . get_option( 'stylesheet' ) ) );
2715
  /**
2716
  * 2). Execute the actions hooked to the 'kadence-starter-templates/before_content_import_execution' action:
2717
  *
2724
  wp_delete_post( 1, true ); // Hello World.
2725
  wp_delete_post( 2, true ); // Sample Page.
2726
  wp_delete_comment( 1, true ); // WordPress comment.
2727
+ // Move All active widgets into inactive.
2728
+ $sidebars = wp_get_sidebars_widgets();
2729
+ if ( is_array( $sidebars ) ) {
2730
+ foreach ( $sidebars as $sidebar_id => $sidebar_widgets ) {
2731
+ if ( 'wp_inactive_widgets' === $sidebar_id ) {
2732
+ continue;
2733
+ }
2734
+ if ( is_array( $sidebar_widgets ) && ! empty( $sidebar_widgets ) ) {
2735
+ foreach ( $sidebar_widgets as $i => $single_widget ) {
2736
+ $sidebars['wp_inactive_widgets'][] = $single_widget;
2737
+ unset( $sidebars[ $sidebar_id ][ $i ] );
2738
+ }
2739
+ }
2740
+ }
2741
+ }
2742
+ wp_set_sidebars_widgets( $sidebars );
2743
+ // Reset to default settings values.
2744
+ delete_option( 'theme_mods_' . get_option( 'stylesheet' ) );
2745
+ // Reset Global Palette
2746
+ update_option( 'kadence_global_palette', '{"palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"second-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"third-palette":[{"color":"#3182CE","slug":"palette1","name":"Palette Color 1"},{"color":"#2B6CB0","slug":"palette2","name":"Palette Color 2"},{"color":"#1A202C","slug":"palette3","name":"Palette Color 3"},{"color":"#2D3748","slug":"palette4","name":"Palette Color 4"},{"color":"#4A5568","slug":"palette5","name":"Palette Color 5"},{"color":"#718096","slug":"palette6","name":"Palette Color 6"},{"color":"#EDF2F7","slug":"palette7","name":"Palette Color 7"},{"color":"#F7FAFC","slug":"palette8","name":"Palette Color 8"},{"color":"#ffffff","slug":"palette9","name":"Palette Color 9"}],"active":"palette"}' );
2747
+ do_action( 'kadence-starter-templates/before_content_import_execution', $this->selected_import_files, $this->import_files, $this->selected_index, $this->selected_palette, $this->selected_font );
2748
  }
2749
 
2750
  /**
2763
  * 2 - Import widgets (with priority 20).
2764
  * 3 - Import Redux data (with priority 30).
2765
  */
2766
+ do_action( 'kadence-starter-templates/after_content_import_execution', $this->selected_import_files, $this->import_files, $this->selected_index, $this->selected_palette, $this->selected_font );
 
2767
  // Save the import data as a transient, so other import parts (in new AJAX calls) can use that data.
2768
  Helpers::set_import_data_transient( $this->get_current_importer_data() );
2769
+ // Save Import data for use if we need to reset it.
2770
+ update_option( '_kadence_starter_templates_last_import_data', $this->selected_import_files );
2771
  // Request the customizer import AJAX call.
2772
  if ( ! empty( $this->selected_import_files['customizer'] ) ) {
2773
  wp_send_json( array( 'status' => 'customizerAJAX' ) );
2782
  $this->final_response();
2783
  }
2784
 
2785
+ /**
2786
+ * After import run elementor stuff.
2787
+ */
2788
+ public function kadence_elementor_after_import( $selected_import, $selected_palette, $selected_font ) {
2789
+ // If elementor make sure we set things up and clear cache.
2790
+ if ( isset( $selected_import['type'] ) && 'elementor' === $selected_import['type'] ) {
2791
+ if ( class_exists( 'Elementor\Plugin' ) ) {
2792
+ if ( class_exists( 'Kadence\Theme' ) ) {
2793
+ $component = \Kadence\Theme::instance()->components['elementor'];
2794
+ if ( $component ) {
2795
+ $component->elementor_add_theme_colors();
2796
+ }
2797
+ }
2798
+ if ( isset( $selected_import['width'] ) && 'large' === $selected_import['width'] ) {
2799
+ $container_width = array(
2800
+ 'unit' => 'px',
2801
+ 'size' => 1242,
2802
+ 'sizes' => array(),
2803
+ );
2804
+ $container_width_tablet = array(
2805
+ 'unit' => 'px',
2806
+ 'size' => 700,
2807
+ 'sizes' => array(),
2808
+ );
2809
+ if ( method_exists( \Elementor\Plugin::$instance->kits_manager, 'update_kit_settings_based_on_option' ) ) {
2810
+ \Elementor\Plugin::$instance->kits_manager->update_kit_settings_based_on_option( 'container_width', $container_width );
2811
+ \Elementor\Plugin::$instance->kits_manager->update_kit_settings_based_on_option( 'container_width_tablet', $container_width_tablet );
2812
+ }
2813
+ } else {
2814
+ $container_width = array(
2815
+ 'unit' => 'px',
2816
+ 'size' => 1140,
2817
+ 'sizes' => array(),
2818
+ );
2819
+ $container_width_tablet = array(
2820
+ 'unit' => 'px',
2821
+ 'size' => 700,
2822
+ 'sizes' => array(),
2823
+ );
2824
+ if ( method_exists( \Elementor\Plugin::$instance->kits_manager, 'update_kit_settings_based_on_option' ) ) {
2825
+ \Elementor\Plugin::$instance->kits_manager->update_kit_settings_based_on_option( 'container_width', $container_width );
2826
+ \Elementor\Plugin::$instance->kits_manager->update_kit_settings_based_on_option( 'container_width_tablet', $container_width_tablet );
2827
+ }
2828
+ }
2829
+ \Elementor\Plugin::instance()->files_manager->clear_cache();
2830
+ }
2831
+ }
2832
+ }
2833
+
2834
 
2835
  /**
2836
  * AJAX callback for importing the customizer data.
2878
  * Default actions:
2879
  * 1 - after_import action (with priority 10).
2880
  */
2881
+ do_action( 'kadence-starter-templates/after_all_import_execution', $this->selected_import_files, $this->import_files, $this->selected_index, $this->selected_palette, $this->selected_font );
2882
  }
2883
 
2884
  // Send a JSON response with final report.
2889
  /**
2890
  * Send a JSON response with final report.
2891
  */
2892
+ private function final_response( $extra = '' ) {
2893
  // Delete importer data transient for current import.
2894
  delete_transient( 'kadence_importer_data' );
2895
 
2896
  // Display final messages (success or error messages).
2897
+ if ( empty( $this->frontend_error_messages ) && ! empty( $extra ) ) {
2898
+ $response['message'] = '';
2899
+
2900
+ $response['message'] .= sprintf(
2901
+ __( '%1$sFinished! View your page%2$s', 'kadence-starter-templates' ),
2902
+ '<div class="finshed-notice-success"><p><a href="' . esc_url( get_permalink( $extra ) ) . '" class="button-primary button kadence-starter-templates-finish-button">',
2903
+ '</a></p></div>'
2904
+ );
2905
+ } elseif ( empty( $this->frontend_error_messages ) ) {
2906
  $response['message'] = '';
2907
 
2908
  $response['message'] .= sprintf(
2909
  __( '%1$sFinished! View your site%2$s', 'kadence-starter-templates' ),
2910
+ '<div class="finshed-notice-success"><p><a href="' . esc_url( home_url( '/' ) ) . '" class="button-primary button kadence-starter-templates-finish-button">',
2911
  '</a></p></div>'
2912
  );
2913
  } else {
2914
  $response['message'] = $this->frontend_error_messages_display() . '<br>';
2915
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
2916
+ $response['message'] .= sprintf(
2917
+ __( '%1$sThe demo import has finished, but there were some import errors.%2$sMore details about the errors can be found in this %3$s%5$slog file%6$s%4$s%7$s', 'kadence-starter-templates' ),
2918
+ '<div class="notice notice-warning"><p>',
2919
+ '<br>',
2920
+ '<strong>',
2921
+ '</strong>',
2922
+ '<a href="' . Helpers::get_log_url( $this->log_file_path ) .'" target="_blank">',
2923
+ '</a>',
2924
+ '</p></div>'
2925
+ );
2926
+ } else {
2927
+ $response['message'] .= sprintf(
2928
+ __( '%1$sThe demo import has finished, but there were some import errors.%2$sPlease check your php error logs if site is incomplete.%3$s', 'kadence-starter-templates' ),
2929
+ '<div class="notice notice-warning"><p>',
2930
+ '<br>',
2931
+ '</p></div>'
2932
+ );
2933
+ }
2934
  }
2935
 
2936
  wp_send_json( $response );
2948
  $this->log_file_path = empty( $data['log_file_path'] ) ? '' : $data['log_file_path'];
2949
  $this->selected_index = empty( $data['selected_index'] ) ? 0 : $data['selected_index'];
2950
  $this->selected_palette = empty( $data['selected_palette'] ) ? '' : $data['selected_palette'];
2951
+ $this->selected_font = empty( $data['selected_font'] ) ? '' : $data['selected_font'];
2952
  $this->selected_import_files = empty( $data['selected_import_files'] ) ? array() : $data['selected_import_files'];
2953
  $this->import_files = empty( $data['import_files'] ) ? array() : $data['import_files'];
2954
  $this->before_import_executed = empty( $data['before_import_executed'] ) ? false : $data['before_import_executed'];
2971
  'log_file_path' => $this->log_file_path,
2972
  'selected_index' => $this->selected_index,
2973
  'selected_palette' => $this->selected_palette,
2974
+ 'selected_font' => $this->selected_font,
2975
  'selected_import_files' => $this->selected_import_files,
2976
  'import_files' => $this->import_files,
2977
  'before_import_executed' => $this->before_import_executed,
3044
  if ( ! ( is_admin() || ( defined( 'WP_CLI' ) && WP_CLI ) ) ) {
3045
  return;
3046
  }
 
3047
  // Get info of import data files and filter it.
3048
+ $this->import_files = apply_filters( 'kadence-starter-templates/import_files', array() );
3049
+ //$this->import_files = Helpers::validate_import_file_info( apply_filters( 'kadence-starter-templates/import_files', array() ) );
3050
  /**
3051
  * Register all default actions (before content import, widget, customizer import and other actions)
3052
  * to the 'before_content_import_execution' and the 'kadence-starter-templates/after_content_import_execution' action hook.
inc/class-customizer-importer.php CHANGED
@@ -26,23 +26,45 @@ class CustomizerImporter {
26
 
27
  // Add any error messages to the frontend_error_messages variable in starter_templates main class.
28
  $starter_templates->append_to_frontend_error_messages( $error_message );
29
-
30
- // Write error to log file.
31
- Helpers::append_to_file(
32
- $error_message,
33
- $log_file_path,
34
- esc_html__( 'Importing customizer settings', 'kadence-starter-templates' )
35
- );
 
36
  } else {
37
- // Add this message to log file.
38
- $log_added = Helpers::append_to_file(
39
- esc_html__( 'Customizer settings import finished!', 'kadence-starter-templates' ),
40
- $log_file_path,
41
- esc_html__( 'Importing customizer settings' , 'kadence-starter-templates' )
42
- );
 
 
43
  }
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
  /**
48
  * Imports uploaded mods and calls WordPress core customize_save actions so
@@ -111,16 +133,25 @@ class CustomizerImporter {
111
  }
112
 
113
  foreach ( $data['options'] as $option_key => $option_value ) {
114
- $option = new CustomizerOption( $wp_customize, $option_key, array(
115
- 'default' => '',
116
- 'type' => 'option',
117
- 'capability' => 'edit_theme_options',
118
- ) );
119
-
120
- $option->import( $option_value );
 
 
 
 
121
  }
122
  }
123
 
 
 
 
 
 
124
  // Should the customizer import use the WP customize_save* hooks?
125
  $use_wp_customize_save_hooks = apply_filters( 'kadence-starter-templates/enable_wp_customize_save_hooks', false );
126
 
@@ -140,6 +171,122 @@ class CustomizerImporter {
140
  if ( $use_wp_customize_save_hooks ) {
141
  do_action( 'customize_save_after', $wp_customize );
142
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  }
144
 
145
  /**
26
 
27
  // Add any error messages to the frontend_error_messages variable in starter_templates main class.
28
  $starter_templates->append_to_frontend_error_messages( $error_message );
29
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
30
+ // Write error to log file.
31
+ Helpers::append_to_file(
32
+ $error_message,
33
+ $log_file_path,
34
+ esc_html__( 'Importing customizer settings', 'kadence-starter-templates' )
35
+ );
36
+ }
37
  } else {
38
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
39
+ // Add this message to log file.
40
+ $log_added = Helpers::append_to_file(
41
+ esc_html__( 'Customizer settings import finished!', 'kadence-starter-templates' ),
42
+ $log_file_path,
43
+ esc_html__( 'Importing customizer settings' , 'kadence-starter-templates' )
44
+ );
45
+ }
46
  }
47
  }
48
 
49
+ /**
50
+ * Import customizer from a DAT file, generated by the Customizer Export/Import plugin.
51
+ *
52
+ * @param string $customizer_import_file_path path to the customizer import file.
53
+ */
54
+ public static function import_color( $customizer_import_file_path ) {
55
+ // Try to import the customizer settings.
56
+ $results = self::import_customizer_options_only_color( $customizer_import_file_path );
57
+ }
58
+ /**
59
+ * Import customizer from a DAT file, generated by the Customizer Export/Import plugin.
60
+ *
61
+ * @param string $customizer_import_file_path path to the customizer import file.
62
+ */
63
+ public static function import_font( $customizer_import_file_path ) {
64
+ // Try to import the customizer settings.
65
+ $results = self::import_customizer_options_fonts_only( $customizer_import_file_path );
66
+ }
67
+
68
 
69
  /**
70
  * Imports uploaded mods and calls WordPress core customize_save actions so
133
  }
134
 
135
  foreach ( $data['options'] as $option_key => $option_value ) {
136
+ if ( 'kadence_global_palette' === $option_key ) {
137
+ $palette = json_decode( $option_value, 'true' );
138
+ update_option( 'kadence_global_palette', json_encode( $palette ) );
139
+ } else {
140
+ $option = new CustomizerOption( $wp_customize, $option_key, array(
141
+ 'default' => '',
142
+ 'type' => 'option',
143
+ 'capability' => 'manage_options',
144
+ ) );
145
+ $option->import( $option_value );
146
+ }
147
  }
148
  }
149
 
150
+ // If wp_css is set then import it.
151
+ if ( function_exists( 'wp_update_custom_css_post' ) && isset( $data['wp_css'] ) && '' !== $data['wp_css'] ) {
152
+ wp_update_custom_css_post( $data['wp_css'] );
153
+ }
154
+
155
  // Should the customizer import use the WP customize_save* hooks?
156
  $use_wp_customize_save_hooks = apply_filters( 'kadence-starter-templates/enable_wp_customize_save_hooks', false );
157
 
171
  if ( $use_wp_customize_save_hooks ) {
172
  do_action( 'customize_save_after', $wp_customize );
173
  }
174
+
175
+ do_action( 'kadence-starter-templates/after_customizer_import', $data );
176
+ }
177
+
178
+ /**
179
+ * Imports uploaded mods and calls WordPress core customize_save actions so
180
+ * themes that hook into them can act before mods are saved to the database.
181
+ *
182
+ * Update: WP core customize_save actions were removed, because of some errors.
183
+ *
184
+ * @since 1.1.1
185
+ * @param string $import_file_path Path to the import file.
186
+ * @return void|WP_Error
187
+ */
188
+ public static function import_customizer_options_fonts_only( $import_file_path ) {
189
+ // Setup global vars.
190
+ global $wp_customize;
191
+
192
+ // Setup internal vars.
193
+ $template = get_template();
194
+
195
+ // Make sure we have an import file.
196
+ if ( ! file_exists( $import_file_path ) ) {
197
+ return new \WP_Error(
198
+ 'missing_cutomizer_import_file',
199
+ sprintf(
200
+ esc_html__( 'Error: The customizer import file is missing! File path: %s', 'kadence-starter-templates' ),
201
+ $import_file_path
202
+ )
203
+ );
204
+ }
205
+ // Get the upload data.
206
+ $raw = Helpers::data_from_file( $import_file_path );
207
+
208
+ // Make sure we got the data.
209
+ if ( is_wp_error( $raw ) ) {
210
+ return $raw;
211
+ }
212
+
213
+ $data = unserialize( $raw );
214
+
215
+ // Data checks.
216
+ if ( 'array' != gettype( $data ) && ( ! isset( $data['template'] ) || ! isset( $data['mods'] ) ) ) {
217
+ return new \WP_Error(
218
+ 'customizer_import_data_error',
219
+ esc_html__( 'Error: The customizer import file is not in a correct format. Please make sure to use the correct customizer import file.', 'kadence-starter-templates' )
220
+ );
221
+ }
222
+ if ( $data['template'] !== $template ) {
223
+ return new \WP_Error(
224
+ 'customizer_import_wrong_theme',
225
+ esc_html__( 'Error: The customizer import file is not suitable for current theme. You can only import customizer settings for the same theme or a child theme.', 'kadence-starter-templates' )
226
+ );
227
+ }
228
+
229
+ // Loop through the mods and save the mods.
230
+ foreach ( $data['mods'] as $key => $val ) {
231
+ if ( $key === 'heading_font' || $key === 'base_font' ) {
232
+ set_theme_mod( $key, $val );
233
+ }
234
+ }
235
+ }
236
+
237
+ /**
238
+ * Imports uploaded mods and calls WordPress core customize_save actions so
239
+ * themes that hook into them can act before mods are saved to the database.
240
+ *
241
+ * Update: WP core customize_save actions were removed, because of some errors.
242
+ *
243
+ * @since 1.1.1
244
+ * @param string $import_file_path Path to the import file.
245
+ * @return void|WP_Error
246
+ */
247
+ public static function import_customizer_options_only_color( $import_file_path ) {
248
+ // Setup global vars.
249
+ global $wp_customize;
250
+
251
+ // Setup internal vars.
252
+ $template = get_template();
253
+
254
+ // Make sure we have an import file.
255
+ if ( ! file_exists( $import_file_path ) ) {
256
+ return new \WP_Error(
257
+ 'missing_cutomizer_import_file',
258
+ sprintf(
259
+ esc_html__( 'Error: The customizer import file is missing! File path: %s', 'kadence-starter-templates' ),
260
+ $import_file_path
261
+ )
262
+ );
263
+ }
264
+ // Get the upload data.
265
+ $raw = Helpers::data_from_file( $import_file_path );
266
+
267
+ // Make sure we got the data.
268
+ if ( is_wp_error( $raw ) ) {
269
+ return $raw;
270
+ }
271
+
272
+ $data = unserialize( $raw );
273
+
274
+ // Data checks.
275
+ if ( 'array' != gettype( $data ) && ( ! isset( $data['template'] ) || ! isset( $data['mods'] ) ) ) {
276
+ return new \WP_Error(
277
+ 'customizer_import_data_error',
278
+ esc_html__( 'Error: The customizer import file is not in a correct format. Please make sure to use the correct customizer import file.', 'kadence-starter-templates' )
279
+ );
280
+ }
281
+ // Import custom options.
282
+ if ( isset( $data['options'] ) ) {
283
+ foreach ( $data['options'] as $option_key => $option_value ) {
284
+ if ( 'kadence_global_palette' === $option_key ) {
285
+ $palette = json_decode( $option_value, 'true' );
286
+ update_option( 'kadence_global_palette', json_encode( $palette ) );
287
+ }
288
+ }
289
+ }
290
  }
291
 
292
  /**
inc/class-helpers.php CHANGED
@@ -50,7 +50,47 @@ class Helpers {
50
 
51
  return true;
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
 
 
54
 
55
  /**
56
  * Download import files. Content .xml and widgets .wie|.json files.
@@ -64,6 +104,7 @@ class Helpers {
64
  'widgets' => '',
65
  'customizer' => '',
66
  'redux' => '',
 
67
  );
68
  $downloader = new Downloader();
69
 
@@ -99,8 +140,7 @@ class Helpers {
99
  if ( is_wp_error( $downloaded_files['widgets'] ) ) {
100
  return $downloaded_files['widgets'];
101
  }
102
- }
103
- else if ( ! empty( $import_file_info['local_import_widget_file'] ) ) {
104
  if ( file_exists( $import_file_info['local_import_widget_file'] ) ) {
105
  $downloaded_files['widgets'] = $import_file_info['local_import_widget_file'];
106
  }
@@ -119,51 +159,28 @@ class Helpers {
119
  if ( is_wp_error( $downloaded_files['customizer'] ) ) {
120
  return $downloaded_files['customizer'];
121
  }
122
- }
123
- else if ( ! empty( $import_file_info['local_import_customizer_file'] ) ) {
124
  if ( file_exists( $import_file_info['local_import_customizer_file'] ) ) {
125
  $downloaded_files['customizer'] = $import_file_info['local_import_customizer_file'];
126
  }
127
  }
 
 
 
 
 
128
 
129
- // ----- Set Redux file paths -----
130
- // Get Redux import file as well. If defined!
131
- if ( ! empty( $import_file_info['import_redux'] ) && is_array( $import_file_info['import_redux'] ) ) {
132
- $redux_items = array();
133
-
134
- // Setup filename paths to save the Redux content.
135
- foreach ( $import_file_info['import_redux'] as $index => $redux_item ) {
136
- $redux_filename = apply_filters( 'kaence-starter-templates/downloaded_redux_file_prefix', 'demo-redux-import-file_' ) . $index . '-' . self::$demo_import_start_time . apply_filters( 'kaence-starter-templates/downloaded_redux_file_suffix_and_file_extension', '.json' );
137
 
138
- // Download the Redux import file.
139
- $file_path = $downloader->download_file( $redux_item['file_url'], $redux_filename );
140
-
141
- // Return from this function if there was an error.
142
- if ( is_wp_error( $file_path ) ) {
143
- return $file_path;
144
- }
145
-
146
- $redux_items[] = array(
147
- 'option_name' => $redux_item['option_name'],
148
- 'file_path' => $file_path,
149
- );
150
  }
151
-
152
- // Download the Redux import file.
153
- $downloaded_files['redux'] = $redux_items;
154
- } else if ( ! empty( $import_file_info['local_import_redux'] ) ) {
155
-
156
- $redux_items = array();
157
-
158
- // Setup filename paths to save the Redux content.
159
- foreach ( $import_file_info['local_import_redux'] as $redux_item ) {
160
- if ( file_exists( $redux_item['file_path'] ) ) {
161
- $redux_items[] = $redux_item;
162
- }
163
  }
164
-
165
- // Download the Redux import file.
166
- $downloaded_files['redux'] = $redux_items;
167
  }
168
 
169
  return $downloaded_files;
@@ -456,15 +473,17 @@ class Helpers {
456
  // Set uploaded content file.
457
  $selected_import_files['content'] = $content_file_info['file'];
458
  } else {
459
- // Add this error to log file.
460
- $log_added = self::append_to_file(
461
- sprintf(
462
- __( 'Content file was not uploaded. Error: %s', 'kadence-starter-templates' ),
463
- $content_file_info['error']
464
- ),
465
- $log_file_path,
466
- esc_html__( 'Upload files' , 'kadence-starter-templates' )
467
- );
 
 
468
  }
469
 
470
  // Process widget import file.
@@ -472,15 +491,17 @@ class Helpers {
472
  // Set uploaded widget file.
473
  $selected_import_files['widgets'] = $widget_file_info['file'];
474
  } else {
475
- // Add this error to log file.
476
- $log_added = self::append_to_file(
477
- sprintf(
478
- __( 'Widget file was not uploaded. Error: %s', 'kadence-starter-templates' ),
479
- $widget_file_info['error']
480
- ),
481
- $log_file_path,
482
- esc_html__( 'Upload files' , 'kadence-starter-templates' )
483
- );
 
 
484
  }
485
 
486
  // Process Customizer import file.
@@ -488,15 +509,17 @@ class Helpers {
488
  // Set uploaded customizer file.
489
  $selected_import_files['customizer'] = $customizer_file_info['file'];
490
  } else {
491
- // Add this error to log file.
492
- $log_added = self::append_to_file(
493
- sprintf(
494
- __( 'Customizer file was not uploaded. Error: %s', 'kadence-starter-templates' ),
495
- $customizer_file_info['error']
496
- ),
497
- $log_file_path,
498
- esc_html__( 'Upload files' , 'kadence-starter-templates' )
499
- );
 
 
500
  }
501
 
502
  // Process Redux import file.
@@ -518,24 +541,27 @@ class Helpers {
518
  ),
519
  );
520
  } else {
521
- // Add this error to log file.
 
 
 
 
 
 
 
 
 
 
 
 
 
522
  $log_added = self::append_to_file(
523
- sprintf(
524
- __( 'Redux file was not uploaded. Error: %s', 'kadence-starter-templates' ),
525
- $redux_file_info['error']
526
- ),
527
  $log_file_path,
528
  esc_html__( 'Upload files' , 'kadence-starter-templates' )
529
  );
530
  }
531
 
532
- // Add this message to log file.
533
- $log_added = self::append_to_file(
534
- __( 'The import files were successfully uploaded!', 'kadence-starter-templates' ) . self::import_file_info( $selected_import_files ),
535
- $log_file_path,
536
- esc_html__( 'Upload files' , 'kadence-starter-templates' )
537
- );
538
-
539
  // Return array with paths of uploaded files.
540
  return $selected_import_files;
541
  }
@@ -547,13 +573,6 @@ class Helpers {
547
  * @param array $selected_import_files array of selected import files.
548
  */
549
  public static function import_file_info( $selected_import_files ) {
550
- $redux_file_string = '';
551
-
552
- if ( ! empty( $selected_import_files['redux'] ) ) {
553
- $redux_file_string = array_reduce( $selected_import_files['redux'], function( $string, $item ) {
554
- return sprintf( '%1$s%2$s -> %3$s %4$s', $string, $item['option_name'], $item['file_path'], PHP_EOL );
555
- }, '' );
556
- }
557
 
558
  return PHP_EOL .
559
  sprintf(
@@ -561,13 +580,13 @@ class Helpers {
561
  ini_get( 'max_execution_time' )
562
  ) . PHP_EOL .
563
  sprintf(
564
- __( 'Files info:%1$sSite URL = %2$s%1$sData file = %3$s%1$sWidget file = %4$s%1$sCustomizer file = %5$s%1$sRedux files:%1$s%6$s', 'kadence-starter-templates' ),
565
  PHP_EOL,
566
  get_site_url(),
567
  empty( $selected_import_files['content'] ) ? esc_html__( 'not defined!', 'kadence-starter-templates' ) : $selected_import_files['content'],
568
  empty( $selected_import_files['widgets'] ) ? esc_html__( 'not defined!', 'kadence-starter-templates' ) : $selected_import_files['widgets'],
569
  empty( $selected_import_files['customizer'] ) ? esc_html__( 'not defined!', 'kadence-starter-templates' ) : $selected_import_files['customizer'],
570
- empty( $redux_file_string ) ? esc_html__( 'not defined!', 'kadence-starter-templates' ) : $redux_file_string
571
  );
572
  }
573
 
@@ -580,12 +599,14 @@ class Helpers {
580
  * @param string $separator title separating the old and new content.
581
  */
582
  public static function log_error_and_send_ajax_response( $error_text, $log_file_path, $separator = '' ) {
583
- // Add this error to log file.
584
- $log_added = self::append_to_file(
585
- $error_text,
586
- $log_file_path,
587
- $separator
588
- );
 
 
589
 
590
  // Send JSON Error response to the AJAX call.
591
  wp_send_json( $error_text );
50
 
51
  return true;
52
  }
53
+ /**
54
+ * Download import files. Content .xml and widgets .wie|.json files.
55
+ *
56
+ * @param array $import_file_info array with import file details.
57
+ * @return array|WP_Error array of paths to the downloaded files or WP_Error object with error message.
58
+ */
59
+ public static function download_import_file( $import_file_info, $page_id ) {
60
+ $downloaded_files = array(
61
+ 'content' => '',
62
+ 'customizer' => '',
63
+ );
64
+ $downloader = new Downloader();
65
+
66
+ // ----- Set content file path -----
67
+ // Set the filename string for content import file.
68
+ $content_filename = apply_filters( 'kaence-starter-templates/downloaded_content_file_prefix', 'demo-content-import-file_' ) . self::$demo_import_start_time . apply_filters( 'kaence-starter-templates/downloaded_content_file_suffix_and_file_extension', '.xml' );
69
+
70
+ // Download the content import file.
71
+ $downloaded_files['content'] = $downloader->download_file( $import_file_info['pages'][ $page_id ]['content'], $content_filename );
72
+
73
+ // Return from this function if there was an error.
74
+ if ( is_wp_error( $downloaded_files['content'] ) ) {
75
+ return $downloaded_files['content'];
76
+ }
77
+ // ----- Set customizer file path -----
78
+ // Get customizer import file as well. If defined!
79
+ if ( ! empty( $import_file_info['import_customizer_file_url'] ) ) {
80
+ // Setup filename path to save the customizer content.
81
+ $customizer_filename = apply_filters( 'kaence-starter-templates/downloaded_customizer_file_prefix', 'demo-customizer-import-file_' ) . self::$demo_import_start_time . apply_filters( 'kaence-starter-templates/downloaded_customizer_file_suffix_and_file_extension', '.dat' );
82
+
83
+ // Download the customizer import file.
84
+ $downloaded_files['customizer'] = $downloader->download_file( $import_file_info['import_customizer_file_url'], $customizer_filename );
85
+
86
+ // Return from this function if there was an error.
87
+ if ( is_wp_error( $downloaded_files['customizer'] ) ) {
88
+ return $downloaded_files['customizer'];
89
+ }
90
+ }
91
 
92
+ return $downloaded_files;
93
+ }
94
 
95
  /**
96
  * Download import files. Content .xml and widgets .wie|.json files.
104
  'widgets' => '',
105
  'customizer' => '',
106
  'redux' => '',
107
+ 'forms' => '',
108
  );
109
  $downloader = new Downloader();
110
 
140
  if ( is_wp_error( $downloaded_files['widgets'] ) ) {
141
  return $downloaded_files['widgets'];
142
  }
143
+ } else if ( ! empty( $import_file_info['local_import_widget_file'] ) ) {
 
144
  if ( file_exists( $import_file_info['local_import_widget_file'] ) ) {
145
  $downloaded_files['widgets'] = $import_file_info['local_import_widget_file'];
146
  }
159
  if ( is_wp_error( $downloaded_files['customizer'] ) ) {
160
  return $downloaded_files['customizer'];
161
  }
162
+ } else if ( ! empty( $import_file_info['local_import_customizer_file'] ) ) {
 
163
  if ( file_exists( $import_file_info['local_import_customizer_file'] ) ) {
164
  $downloaded_files['customizer'] = $import_file_info['local_import_customizer_file'];
165
  }
166
  }
167
+ // ----- Set form file path -----
168
+ // Get form file as well. If defined!
169
+ if ( ! empty( $import_file_info['import_forms_file_url'] ) ) {
170
+ // Set the filename string for form import file.
171
+ $form_filename = apply_filters( 'kaence-starter-templates/downloaded_forms_file_prefix', 'demo-forms-import-file_' ) . self::$demo_import_start_time . apply_filters( 'kaence-starter-templates/downloaded_form_file_suffix_and_file_extension', '.json' );
172
 
173
+ // Download the form import file.
174
+ $downloaded_files['forms'] = $downloader->download_file( $import_file_info['import_forms_file_url'], $form_filename );
 
 
 
 
 
 
175
 
176
+ // Return from this function if there was an error.
177
+ if ( is_wp_error( $downloaded_files['forms'] ) ) {
178
+ return $downloaded_files['forms'];
 
 
 
 
 
 
 
 
 
179
  }
180
+ } else if ( ! empty( $import_file_info['local_import_forms_file'] ) ) {
181
+ if ( file_exists( $import_file_info['local_import_forms_file'] ) ) {
182
+ $downloaded_files['forms'] = $import_file_info['local_import_forms_file'];
 
 
 
 
 
 
 
 
 
183
  }
 
 
 
184
  }
185
 
186
  return $downloaded_files;
473
  // Set uploaded content file.
474
  $selected_import_files['content'] = $content_file_info['file'];
475
  } else {
476
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
477
+ // Add this error to log file.
478
+ $log_added = self::append_to_file(
479
+ sprintf(
480
+ __( 'Content file was not uploaded. Error: %s', 'kadence-starter-templates' ),
481
+ $content_file_info['error']
482
+ ),
483
+ $log_file_path,
484
+ esc_html__( 'Upload files' , 'kadence-starter-templates' )
485
+ );
486
+ }
487
  }
488
 
489
  // Process widget import file.
491
  // Set uploaded widget file.
492
  $selected_import_files['widgets'] = $widget_file_info['file'];
493
  } else {
494
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
495
+ // Add this error to log file.
496
+ $log_added = self::append_to_file(
497
+ sprintf(
498
+ __( 'Widget file was not uploaded. Error: %s', 'kadence-starter-templates' ),
499
+ $widget_file_info['error']
500
+ ),
501
+ $log_file_path,
502
+ esc_html__( 'Upload files' , 'kadence-starter-templates' )
503
+ );
504
+ }
505
  }
506
 
507
  // Process Customizer import file.
509
  // Set uploaded customizer file.
510
  $selected_import_files['customizer'] = $customizer_file_info['file'];
511
  } else {
512
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
513
+ // Add this error to log file.
514
+ $log_added = self::append_to_file(
515
+ sprintf(
516
+ __( 'Customizer file was not uploaded. Error: %s', 'kadence-starter-templates' ),
517
+ $customizer_file_info['error']
518
+ ),
519
+ $log_file_path,
520
+ esc_html__( 'Upload files' , 'kadence-starter-templates' )
521
+ );
522
+ }
523
  }
524
 
525
  // Process Redux import file.
541
  ),
542
  );
543
  } else {
544
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
545
+ // Add this error to log file.
546
+ $log_added = self::append_to_file(
547
+ sprintf(
548
+ __( 'Redux file was not uploaded. Error: %s', 'kadence-starter-templates' ),
549
+ $redux_file_info['error']
550
+ ),
551
+ $log_file_path,
552
+ esc_html__( 'Upload files' , 'kadence-starter-templates' )
553
+ );
554
+ }
555
+ }
556
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
557
+ // Add this message to log file.
558
  $log_added = self::append_to_file(
559
+ __( 'The import files were successfully uploaded!', 'kadence-starter-templates' ) . self::import_file_info( $selected_import_files ),
 
 
 
560
  $log_file_path,
561
  esc_html__( 'Upload files' , 'kadence-starter-templates' )
562
  );
563
  }
564
 
 
 
 
 
 
 
 
565
  // Return array with paths of uploaded files.
566
  return $selected_import_files;
567
  }
573
  * @param array $selected_import_files array of selected import files.
574
  */
575
  public static function import_file_info( $selected_import_files ) {
 
 
 
 
 
 
 
576
 
577
  return PHP_EOL .
578
  sprintf(
580
  ini_get( 'max_execution_time' )
581
  ) . PHP_EOL .
582
  sprintf(
583
+ __( 'Files info:%1$sSite URL = %2$s%1$sData file = %3$s%1$sWidget file = %4$s%1$sCustomizer file = %5$s%1$sForm File:%1$s%6$s', 'kadence-starter-templates' ),
584
  PHP_EOL,
585
  get_site_url(),
586
  empty( $selected_import_files['content'] ) ? esc_html__( 'not defined!', 'kadence-starter-templates' ) : $selected_import_files['content'],
587
  empty( $selected_import_files['widgets'] ) ? esc_html__( 'not defined!', 'kadence-starter-templates' ) : $selected_import_files['widgets'],
588
  empty( $selected_import_files['customizer'] ) ? esc_html__( 'not defined!', 'kadence-starter-templates' ) : $selected_import_files['customizer'],
589
+ empty( $selected_import_files['forms'] ) ? esc_html__( 'not defined!', 'kadence-starter-templates' ) : $selected_import_files['forms']
590
  );
591
  }
592
 
599
  * @param string $separator title separating the old and new content.
600
  */
601
  public static function log_error_and_send_ajax_response( $error_text, $log_file_path, $separator = '' ) {
602
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
603
+ // Add this error to log file.
604
+ $log_added = self::append_to_file(
605
+ $error_text,
606
+ $log_file_path,
607
+ $separator
608
+ );
609
+ }
610
 
611
  // Send JSON Error response to the AJAX call.
612
  wp_send_json( $error_text );
inc/class-import-actions.php CHANGED
@@ -14,17 +14,26 @@ class ImportActions {
14
  */
15
  public function register_hooks() {
16
  // Before content import.
17
- add_action( 'kadence-starter-templates/before_content_import_execution', array( $this, 'before_content_import_action' ), 10, 4 );
 
18
 
19
  // After content import.
20
- add_action( 'kadence-starter-templates/after_content_import_execution', array( $this, 'before_widget_import_action' ), 10, 4 );
21
- add_action( 'kadence-starter-templates/after_content_import_execution', array( $this, 'widgets_import' ), 20, 4 );
 
 
22
 
23
  // Customizer import.
24
  add_action( 'kadence-starter-templates/customizer_import_execution', array( $this, 'customizer_import' ), 10, 1 );
25
 
 
 
 
 
 
 
26
  // After full import action.
27
- add_action( 'kadence-starter-templates/after_all_import_execution', array( $this, 'after_import_action' ), 10, 4 );
28
 
29
  // Special widget import cases.
30
  add_action( 'kadence-starter-templates/widget_settings_array', array( $this, 'fix_custom_menu_widget_ids' ) );
@@ -55,7 +64,6 @@ class ImportActions {
55
  return $widget;
56
  }
57
 
58
-
59
  /**
60
  * Execute the widgets import.
61
  *
@@ -63,13 +71,49 @@ class ImportActions {
63
  * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
64
  * @param int $selected_index Selected index of import.
65
  */
66
- public function widgets_import( $selected_import_files, $import_files, $selected_index, $selected_palette ) {
 
 
 
 
 
 
 
 
 
 
 
 
67
  if ( ! empty( $selected_import_files['widgets'] ) ) {
68
  WidgetImporter::import( $selected_import_files['widgets'] );
69
  }
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
 
 
72
 
 
 
 
 
 
 
 
 
 
 
 
 
73
  /**
74
  * Execute the customizer import.
75
  *
@@ -83,7 +127,20 @@ class ImportActions {
83
  }
84
  }
85
 
 
 
 
 
 
 
 
 
 
 
86
 
 
 
 
87
  /**
88
  * Execute the action: 'kadence-starter-templates/before_content_import'.
89
  *
@@ -91,8 +148,8 @@ class ImportActions {
91
  * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
92
  * @param int $selected_index Selected index of import.
93
  */
94
- public function before_content_import_action( $selected_import_files, $import_files, $selected_index, $selected_palette ) {
95
- $this->do_import_action( 'kadence-starter-templates/before_content_import', $import_files[ $selected_index ], $selected_palette );
96
  }
97
 
98
 
@@ -103,8 +160,8 @@ class ImportActions {
103
  * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
104
  * @param int $selected_index Selected index of import.
105
  */
106
- public function before_widget_import_action( $selected_import_files, $import_files, $selected_index, $selected_palette ) {
107
- $this->do_import_action( 'kadence-starter-templates/before_widgets_import', $import_files[ $selected_index ], $selected_palette );
108
  }
109
 
110
 
@@ -115,8 +172,8 @@ class ImportActions {
115
  * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
116
  * @param int $selected_index Selected index of import.
117
  */
118
- public function after_import_action( $selected_import_files, $import_files, $selected_index, $selected_palette ) {
119
- $this->do_import_action( 'kadence-starter-templates/after_import', $import_files[ $selected_index ], $selected_palette );
120
  }
121
 
122
 
@@ -126,21 +183,22 @@ class ImportActions {
126
  * @param string $action The action name to be executed.
127
  * @param array $selected_import The data of selected import from `kadence-starter-templates/import_files` filter.
128
  */
129
- private function do_import_action( $action, $selected_import, $selected_palette ) {
130
  if ( false !== has_action( $action ) ) {
131
  $kadence_starter_templates = Starter_Templates::get_instance();
132
  $log_file_path = $kadence_starter_templates->get_log_file_path();
133
 
134
  ob_start();
135
- do_action( $action, $selected_import, $selected_palette );
136
  $message = ob_get_clean();
137
-
138
- // Add this message to log file.
139
- $log_added = Helpers::append_to_file(
140
- $message,
141
- $log_file_path,
142
- $action
143
- );
 
144
  }
145
  }
146
  }
14
  */
15
  public function register_hooks() {
16
  // Before content import.
17
+ add_action( 'kadence-starter-templates/before_content_import_execution', array( $this, 'before_content_import_action' ), 10, 5 );
18
+ //add_action( 'kadence-starter-templates/before_content_import_execution', array( $this, 'before_content_import_reset_setting' ), 10, 5 );
19
 
20
  // After content import.
21
+ add_action( 'kadence-starter-templates/after_content_import_execution', array( $this, 'before_widget_import_action' ), 10, 5 );
22
+ add_action( 'kadence-starter-templates/after_content_import_execution', array( $this, 'widgets_import' ), 20, 5 );
23
+
24
+ add_action( 'kadence-starter-templates/after_content_import_execution', array( $this, 'forms_import' ), 20, 5 );
25
 
26
  // Customizer import.
27
  add_action( 'kadence-starter-templates/customizer_import_execution', array( $this, 'customizer_import' ), 10, 1 );
28
 
29
+ // Customizer Color Only import.
30
+ add_action( 'kadence-starter-templates/customizer_import_color_only_execution', array( $this, 'customizer_import_color_only' ), 10, 1 );
31
+
32
+ // Customizer font Only import.
33
+ add_action( 'kadence-starter-templates/customizer_import_font_only_execution', array( $this, 'customizer_import_font_only' ), 10, 1 );
34
+
35
  // After full import action.
36
+ add_action( 'kadence-starter-templates/after_all_import_execution', array( $this, 'after_import_action' ), 10, 5 );
37
 
38
  // Special widget import cases.
39
  add_action( 'kadence-starter-templates/widget_settings_array', array( $this, 'fix_custom_menu_widget_ids' ) );
64
  return $widget;
65
  }
66
 
 
67
  /**
68
  * Execute the widgets import.
69
  *
71
  * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
72
  * @param int $selected_index Selected index of import.
73
  */
74
+ public function forms_import( $selected_import_files, $import_files, $selected_index, $selected_palette, $selected_font ) {
75
+ if ( ! empty( $selected_import_files['forms'] ) && class_exists( 'Kadence_Starter_Templates\Kadence_Starter_Templates_Fluent_Import' ) ) {
76
+ Kadence_Starter_Templates_Fluent_Import::import( $selected_import_files['forms'] );
77
+ }
78
+ }
79
+ /**
80
+ * Execute the widgets import.
81
+ *
82
+ * @param array $selected_import_files Actual selected import files (content, widgets, customizer, redux).
83
+ * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
84
+ * @param int $selected_index Selected index of import.
85
+ */
86
+ public function widgets_import( $selected_import_files, $import_files, $selected_index, $selected_palette, $selected_font ) {
87
  if ( ! empty( $selected_import_files['widgets'] ) ) {
88
  WidgetImporter::import( $selected_import_files['widgets'] );
89
  }
90
  }
91
 
92
+ /**
93
+ * Execute the customizer import.
94
+ *
95
+ * @param array $selected_import_files Actual selected import files (content, widgets, customizer, redux).
96
+ * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
97
+ * @param int $selected_index Selected index of import.
98
+ */
99
+ public function customizer_import_color_only( $selected_import_files ) {
100
+ if ( ! empty( $selected_import_files['customizer'] ) ) {
101
+ CustomizerImporter::import_color( $selected_import_files['customizer'] );
102
+ }
103
+ }
104
 
105
+ /**
106
+ * Execute the customizer import.
107
+ *
108
+ * @param array $selected_import_files Actual selected import files (content, widgets, customizer, redux).
109
+ * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
110
+ * @param int $selected_index Selected index of import.
111
+ */
112
+ public function customizer_import_font_only( $selected_import_files ) {
113
+ if ( ! empty( $selected_import_files['customizer'] ) ) {
114
+ CustomizerImporter::import_font( $selected_import_files['customizer'] );
115
+ }
116
+ }
117
  /**
118
  * Execute the customizer import.
119
  *
127
  }
128
  }
129
 
130
+ /**
131
+ * Before Content Import lets reset the theme options.
132
+ *
133
+ * @param array $selected_import_files Actual selected import files (content, widgets, customizer, redux).
134
+ * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
135
+ * @param int $selected_index Selected index of import.
136
+ */
137
+ public function before_content_import_reset_setting( $selected_import_files, $import_files, $selected_index, $selected_palette, $selected_font ) {
138
+
139
+ $old_data = get_option( '_kadence_starter_templates_last_import_data', array() );
140
 
141
+ if ( $old_data && ! empty( $old_data ) ) {
142
+ }
143
+ }
144
  /**
145
  * Execute the action: 'kadence-starter-templates/before_content_import'.
146
  *
148
  * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
149
  * @param int $selected_index Selected index of import.
150
  */
151
+ public function before_content_import_action( $selected_import_files, $import_files, $selected_index, $selected_palette, $selected_font ) {
152
+ $this->do_import_action( 'kadence-starter-templates/before_content_import', $import_files[ $selected_index ], $selected_palette, $selected_font );
153
  }
154
 
155
 
160
  * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
161
  * @param int $selected_index Selected index of import.
162
  */
163
+ public function before_widget_import_action( $selected_import_files, $import_files, $selected_index, $selected_palette, $selected_font ) {
164
+ $this->do_import_action( 'kadence-starter-templates/before_widgets_import', $import_files[ $selected_index ], $selected_palette, $selected_font );
165
  }
166
 
167
 
172
  * @param array $import_files The filtered import files defined in `kadence-starter-templates/import_files` filter.
173
  * @param int $selected_index Selected index of import.
174
  */
175
+ public function after_import_action( $selected_import_files, $import_files, $selected_index, $selected_palette, $selected_font ) {
176
+ $this->do_import_action( 'kadence-starter-templates/after_import', $import_files[ $selected_index ], $selected_palette, $selected_font );
177
  }
178
 
179
 
183
  * @param string $action The action name to be executed.
184
  * @param array $selected_import The data of selected import from `kadence-starter-templates/import_files` filter.
185
  */
186
+ private function do_import_action( $action, $selected_import, $selected_palette, $selected_font ) {
187
  if ( false !== has_action( $action ) ) {
188
  $kadence_starter_templates = Starter_Templates::get_instance();
189
  $log_file_path = $kadence_starter_templates->get_log_file_path();
190
 
191
  ob_start();
192
+ do_action( $action, $selected_import, $selected_palette, $selected_font );
193
  $message = ob_get_clean();
194
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
195
+ // Add this message to log file.
196
+ $log_added = Helpers::append_to_file(
197
+ $message,
198
+ $log_file_path,
199
+ $action
200
+ );
201
+ }
202
  }
203
  }
204
  }
inc/class-import-elementor.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class for importing elementor data.
4
+ *
5
+ * @package Kadence Starter Templates
6
+ */
7
+
8
+ namespace Elementor\TemplateLibrary;
9
+
10
+ if ( ! class_exists( '\Elementor\Plugin' ) ) {
11
+ return;
12
+ }
13
+
14
+ use Elementor\Plugin;
15
+
16
+ /**
17
+ * Class for importing elementor data.
18
+ */
19
+ class Kadence_Starter_Templates_Elementor_Import extends Source_Local {
20
+
21
+ /**
22
+ * Update the elementor meta data.
23
+ *
24
+ * @param integer $post_id the post id to update.
25
+ * @param array $data the meta data to update.
26
+ */
27
+ public function import( $post_id = 0, $data = array() ) {
28
+ if ( empty( $post_id ) || empty( $data ) ) {
29
+ return array();
30
+ }
31
+ if ( ! is_array( $data ) ) {
32
+ $data = json_decode( $data, true );
33
+ }
34
+ // Import the data.
35
+ $data = $this->replace_elements_ids( $data );
36
+ $data = $this->process_export_import_content( $data, 'on_import' );
37
+
38
+ $document = Plugin::$instance->documents->get( $post_id );
39
+ if ( $document ) {
40
+ $data = $document->get_elements_raw_data( $data, true );
41
+ }
42
+
43
+ // Update processed meta.
44
+ update_metadata( 'post', $post_id, '_elementor_data', $data );
45
+
46
+ Plugin::$instance->files_manager->clear_cache();
47
+
48
+ return $data;
49
+
50
+ }
51
+ }
inc/class-import-export-option.php CHANGED
@@ -92,7 +92,7 @@ class Customizer_Import_Export {
92
  */
93
  public function enqueue_customizer_scripts() {
94
  wp_enqueue_style( 'kadence-starter-import-export', KADENCE_STARTER_TEMPLATES_URL . 'assets/css/starter-import-export.css', array( 'wp-components' ), KADENCE_STARTER_TEMPLATES_VERSION );
95
- wp_enqueue_script( 'kadence-starter-import-export', KADENCE_STARTER_TEMPLATES_URL . 'assets/js/starter-import-export.min.js', array( 'jquery' ), KADENCE_STARTER_TEMPLATES_VERSION, true );
96
  wp_localize_script(
97
  'kadence-starter-import-export',
98
  'kadenceStarterImport',
@@ -159,7 +159,7 @@ class Customizer_Import_Export {
159
  'label' => esc_html__( 'Import/Export', 'kadence' ),
160
  );
161
  $wp_customize->add_control( new Kadence_Starter_Control_Import_Export( $wp_customize, 'kadence_starter_import_export', $control_config ) );
162
-
163
  }
164
  /**
165
  * Check to see if we need to do an export or import.
92
  */
93
  public function enqueue_customizer_scripts() {
94
  wp_enqueue_style( 'kadence-starter-import-export', KADENCE_STARTER_TEMPLATES_URL . 'assets/css/starter-import-export.css', array( 'wp-components' ), KADENCE_STARTER_TEMPLATES_VERSION );
95
+ wp_enqueue_script( 'kadence-starter-import-export', KADENCE_STARTER_TEMPLATES_URL . 'assets/export/starter-import-export.min.js', array( 'jquery' ), KADENCE_STARTER_TEMPLATES_VERSION, true );
96
  wp_localize_script(
97
  'kadence-starter-import-export',
98
  'kadenceStarterImport',
159
  'label' => esc_html__( 'Import/Export', 'kadence' ),
160
  );
161
  $wp_customize->add_control( new Kadence_Starter_Control_Import_Export( $wp_customize, 'kadence_starter_import_export', $control_config ) );
162
+
163
  }
164
  /**
165
  * Check to see if we need to do an export or import.
inc/class-import-fluent.php ADDED
@@ -0,0 +1,225 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class for importing fluent data.
4
+ *
5
+ * @package Kadence Starter Templates
6
+ */
7
+
8
+ namespace Kadence_Starter_Templates;
9
+
10
+ if ( ! defined( 'FLUENTFORM_VERSION' ) ) {
11
+ return;
12
+ }
13
+
14
+ use FluentForm\Framework\Helpers\ArrayHelper;
15
+ use FluentForm\App\Modules\Form\wpFluent;
16
+ use FluentForm\App\Databases\DatabaseMigrator;
17
+
18
+ /**
19
+ * Class for importing fluent forms.
20
+ */
21
+ class Kadence_Starter_Templates_Fluent_Import {
22
+
23
+ /**
24
+ * Import forms from JSON file.
25
+ *
26
+ * @param string $form_import_file_path path to the widget import file.
27
+ */
28
+ public static function import( $form_import_file_path ) {
29
+ $results = array();
30
+ $kadence_starter_templates = Starter_Templates::get_instance();
31
+ $log_file_path = $kadence_starter_templates->get_log_file_path();
32
+
33
+ // Import widgets and return result.
34
+ if ( ! empty( $form_import_file_path ) ) {
35
+ $results = self::import_forms( $form_import_file_path );
36
+ }
37
+
38
+ // Check for errors, else write the results to the log file.
39
+ if ( is_wp_error( $results ) ) {
40
+ $error_message = $results->get_error_message();
41
+
42
+ // Add any error messages to the frontend_error_messages variable in OCDI main class.
43
+ $kadence_starter_templates->append_to_frontend_error_messages( $error_message );
44
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
45
+ // Write error to log file.
46
+ Helpers::append_to_file(
47
+ $error_message,
48
+ $log_file_path,
49
+ esc_html__( 'Importing forms', 'kadence-starter-templates' )
50
+ );
51
+ }
52
+ } else {
53
+ ob_start();
54
+ self::format_results_for_log( $results );
55
+ $message = ob_get_clean();
56
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
57
+ // Add this message to log file.
58
+ $log_added = Helpers::append_to_file(
59
+ $message,
60
+ $log_file_path,
61
+ esc_html__( 'Importing forms' , 'kadence-starter-templates' )
62
+ );
63
+ }
64
+ }
65
+
66
+ }
67
+
68
+ /**
69
+ * Imports widgets from a json file.
70
+ *
71
+ * @param string $data_file path to json file with WordPress widget export data.
72
+ */
73
+ private static function import_forms( $data_file ) {
74
+ // Get widgets data from file.
75
+ $data = self::process_import_file( $data_file );
76
+
77
+ // Return from this function if there was an error.
78
+ if ( is_wp_error( $data ) ) {
79
+ return $data;
80
+ }
81
+
82
+ // Import the widget data and save the results.
83
+ return self::import_data( $data );
84
+ }
85
+ /**
86
+ * Process import file - this parses the widget data and returns it.
87
+ *
88
+ * @param string $file path to json file.
89
+ * @return object $data decoded JSON string
90
+ */
91
+ private static function process_import_file( $file ) {
92
+ // File exists?
93
+ if ( ! file_exists( $file ) ) {
94
+ return new \WP_Error(
95
+ 'form_import_file_not_found',
96
+ __( 'Error: Form import file could not be found.', 'kadence-starter-templates' )
97
+ );
98
+ }
99
+
100
+ // Get file contents and decode.
101
+ $data = Helpers::data_from_file( $file );
102
+
103
+ // Return from this function if there was an error.
104
+ if ( is_wp_error( $data ) ) {
105
+ return $data;
106
+ }
107
+
108
+ return \json_decode( $data, true );
109
+ }
110
+
111
+ /**
112
+ * Import fluent forms.
113
+ *
114
+ * @param string $forms the data for the forms.
115
+ */
116
+ public static function import_data( $forms ) {
117
+ // Have valid data? If no data or could not decode.
118
+ if ( empty( $forms ) ) {
119
+ return new \WP_Error(
120
+ 'corrupted_form_import_data',
121
+ __( 'Error: Form import data could not be read. Please try a different file.', 'kadence-starter-templates' )
122
+ );
123
+ }
124
+ // Make sure we can import.
125
+ DatabaseMigrator::run();
126
+ $insertedForms = [];
127
+ if ( $forms && is_array( $forms ) ) {
128
+ foreach ( $forms as $formItem ) {
129
+ // First of all make the form object.
130
+ $formFields = json_encode([]);
131
+ if ( $fields = ArrayHelper::get( $formItem, 'form', '' ) ) {
132
+ $formFields = json_encode( $fields );
133
+ } else if( $fields = ArrayHelper::get( $formItem, 'form_fields', '' ) ) {
134
+ $formFields = json_encode( $fields );
135
+ } else {
136
+ return new \WP_Error(
137
+ 'corrupted_form_import_data',
138
+ __( 'Error: Form import data could not be read. Please try a different file.', 'kadence-starter-templates' )
139
+ );
140
+ }
141
+
142
+ $form = [
143
+ 'title' => ArrayHelper::get($formItem, 'title'),
144
+ 'form_fields' => $formFields,
145
+ 'status' => ArrayHelper::get($formItem, 'status', 'published'),
146
+ 'has_payment' => ArrayHelper::get($formItem, 'has_payment', 0),
147
+ 'type' => ArrayHelper::get($formItem, 'type', 'form'),
148
+ 'created_by' => get_current_user_id()
149
+ ];
150
+
151
+ if( ArrayHelper::get($formItem, 'conditions')) {
152
+ $form['conditions'] = ArrayHelper::get($formItem, 'conditions');
153
+ }
154
+
155
+ if(isset($formItem['appearance_settings'])) {
156
+ $form['appearance_settings'] = $formItem['appearance_settings'];
157
+ }
158
+
159
+ // Insert the form to the DB.
160
+ $formId = wpFluent()->table('fluentform_forms')->insert($form);
161
+
162
+ $insertedForms[$formId] = [
163
+ 'title' => $form['title'],
164
+ 'edit_url' => admin_url('admin.php?page=fluent_forms&route=editor&form_id='.$formId)
165
+ ];
166
+
167
+ if(isset($formItem['metas'])) {
168
+
169
+ foreach ($formItem['metas'] as $metaData) {
170
+ $settings = [
171
+ 'form_id' => $formId,
172
+ 'meta_key' => $metaData['meta_key'],
173
+ 'value' => $metaData['value']
174
+ ];
175
+ wpFluent()->table('fluentform_form_meta')->insert($settings);
176
+ }
177
+
178
+ } else {
179
+ $oldKeys = [
180
+ 'formSettings',
181
+ 'notifications',
182
+ 'mailchimp_feeds',
183
+ 'slack'
184
+ ];
185
+ foreach ($oldKeys as $key) {
186
+ if(isset($formItem[$key])) {
187
+ $settings = [
188
+ 'form_id' => $formId,
189
+ 'meta_key' => $key,
190
+ 'value' => json_encode($formItem[$key])
191
+ ];
192
+ wpFluent()->table('fluentform_form_meta')->insert($settings);
193
+ }
194
+ }
195
+ }
196
+
197
+ do_action( 'fluentform_form_imported', $formId );
198
+
199
+ }
200
+ $results = array(
201
+ 'message' => __('You form has been successfully imported.', 'fluentform'),
202
+ 'inserted_forms' => $insertedForms,
203
+ );
204
+ // Return results.
205
+ return apply_filters( 'kadence-starter-templates/form_import_results', $results );
206
+ }
207
+ }
208
+ /**
209
+ * Format results for log file
210
+ *
211
+ * @param array $results widget import results.
212
+ */
213
+ private static function format_results_for_log( $results ) {
214
+ if ( empty( $results ) ) {
215
+ esc_html_e( 'No results for form import!', 'kadence-starter-templates' );
216
+ }
217
+ if ( isset( $results['inserted_forms'] ) && is_array( $results['inserted_forms'] ) ) {
218
+ // Loop forms.
219
+ foreach ( $results['inserted_forms'] as $form_id => $form ) {
220
+ echo esc_html( $form['title'] ) . ' : ' . esc_html__( 'Imported' ) . PHP_EOL . PHP_EOL;
221
+ echo PHP_EOL;
222
+ }
223
+ }
224
+ }
225
+ }
inc/class-importer.php CHANGED
@@ -35,7 +35,17 @@ class Importer {
35
  * @var object
36
  */
37
  private $kadence_starter_templates;
38
-
 
 
 
 
 
 
 
 
 
 
39
  /**
40
  * Constructor method.
41
  *
@@ -112,13 +122,26 @@ class Importer {
112
  $this->importer->set_importer_data( $data );
113
  }
114
 
 
 
 
 
 
 
 
 
 
 
 
 
 
115
 
116
  /**
117
  * Import content from an WP XML file.
118
  *
119
  * @param string $import_file_path Path to the import file.
120
  */
121
- public function import_content( $import_file_path ) {
122
  $this->microtime = microtime( true );
123
 
124
  // Increase PHP max execution time. Just in case, even though the AJAX calls are only 25 sec long.
@@ -127,10 +150,29 @@ class Importer {
127
  }
128
 
129
  // Disable import of authors.
130
- add_filter( 'wxr_importer.pre_process.user', '__return_false' );
 
 
 
 
 
131
 
132
- // Check, if we need to send another AJAX request and set the importing author to the current user.
133
- add_filter( 'wxr_importer.pre_process.post', array( $this, 'new_ajax_request_maybe' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
 
135
  // Disables generation of multiple image sizes (thumbnails) in the content import step.
136
  if ( ! apply_filters( 'kadence-starter-templates/regenerate_thumbnails_in_content_import', true ) ) {
@@ -143,19 +185,149 @@ class Importer {
143
  $this->import( $import_file_path );
144
  $message = ob_get_clean();
145
  }
146
-
 
 
147
  // Return any error messages for the front page output (errors, critical, alert and emergency level messages only).
148
  return $this->logger->error_output;
149
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
 
 
 
 
 
 
 
 
 
 
 
151
 
 
 
152
  /**
153
  * Check if we need to create a new AJAX request, so that server does not timeout.
154
  *
155
  * @param array $data current post data.
156
  * @return array
157
  */
158
- public function new_ajax_request_maybe( $data ) {
159
  $time = microtime( true ) - $this->microtime;
160
 
161
  // We should make a new ajax call, if the time is right.
@@ -172,14 +344,216 @@ class Importer {
172
  if ( ! empty( $message ) ) {
173
  $this->kadence_starter_templates->append_to_frontend_error_messages( $message );
174
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
 
176
- // Add message to log file.
177
- $log_added = Helpers::append_to_file(
178
- __( 'New AJAX call!' , 'kadence-starter-templates' ) . PHP_EOL . $message,
179
- $this->kadence_starter_templates->get_log_file_path(),
180
- ''
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  );
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  // Set the current importer stat, so it can be continued on the next AJAX call.
184
  $this->set_current_importer_data();
185
 
@@ -194,7 +568,27 @@ class Importer {
194
 
195
  return $data;
196
  }
197
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
 
199
  /**
200
  * Set current state of the content importer, so we can continue the import with new AJAX request.
35
  * @var object
36
  */
37
  private $kadence_starter_templates;
38
+ /**
39
+ * A list of allowed mimes.
40
+ *
41
+ * @var array
42
+ */
43
+ protected $extensions = array(
44
+ 'jpg|jpeg|jpe' => 'image/jpeg',
45
+ 'png' => 'image/png',
46
+ 'webp' => 'image/webp',
47
+ 'svg' => 'image/svg+xml',
48
+ );
49
  /**
50
  * Constructor method.
51
  *
122
  $this->importer->set_importer_data( $data );
123
  }
124
 
125
+ /**
126
+ * Sets all protected variables from the WXR_Importer needed for continuing the import.
127
+ *
128
+ * @param array $postdata Post data.
129
+ * @param array $data Post data.
130
+ * @return array Post data.
131
+ */
132
+ public function pre_post_data( $postdata, $data ) {
133
+ $postdata['guid'] = '';
134
+
135
+ return $postdata;
136
+ }
137
+
138
 
139
  /**
140
  * Import content from an WP XML file.
141
  *
142
  * @param string $import_file_path Path to the import file.
143
  */
144
+ public function import_content( $import_file_path, $single_page = false, $page_meta = '' ) {
145
  $this->microtime = microtime( true );
146
 
147
  // Increase PHP max execution time. Just in case, even though the AJAX calls are only 25 sec long.
150
  }
151
 
152
  // Disable import of authors.
153
+ add_filter( 'wxr_importer.pre_process.user', '__return_false', 20 );
154
+
155
+ add_filter( 'wp_import_post_data_processed', array( $this, 'pre_post_data' ), 10, 2 );
156
+ // Meta Save Tracking info so we can remove later if desired.
157
+ add_filter( 'wxr_importer.processed.term', array( $this, 'add_term_tracking' ), 10, 2 );
158
+ add_filter( 'wxr_importer.processed.post', array( $this, 'add_post_tracking' ), 10, 5 );
159
 
160
+ if ( class_exists( 'Astra_WXR_Importer' ) ) {
161
+ $astra_site_instance = \Astra_WXR_Importer::instance();
162
+ remove_filter( 'wxr_importer.pre_process.post', array( $astra_site_instance, 'pre_process_post' ), 10 );
163
+ }
164
+ if ( $single_page ) {
165
+ // Set the importing author to the current user and Import images.
166
+ add_filter( 'wxr_importer.pre_process.post', array( $this, 'check_for_content_images' ), 10, 4 );
167
+ add_filter( 'wxr_importer.processed.post', array( $this, 'process_elementor' ), 10, 5 );
168
+ if ( $page_meta && $page_meta === 'clear' ) {
169
+ add_filter( 'wxr_importer.processed.post', array( $this, 'process_single_page_clean_meta' ), 10, 5 );
170
+ }
171
+ } else {
172
+ add_filter( 'wxr_importer.pre_process.post_meta', array( $this, 'process_elementor_images' ), 10, 2 );
173
+ // Check, if we need to send another AJAX request and set the importing author to the current user.
174
+ add_filter( 'wxr_importer.pre_process.post', array( $this, 'new_ajax_request_maybe' ) );
175
+ }
176
 
177
  // Disables generation of multiple image sizes (thumbnails) in the content import step.
178
  if ( ! apply_filters( 'kadence-starter-templates/regenerate_thumbnails_in_content_import', true ) ) {
185
  $this->import( $import_file_path );
186
  $message = ob_get_clean();
187
  }
188
+ if ( $single_page ) {
189
+ return $this->logger;
190
+ }
191
  // Return any error messages for the front page output (errors, critical, alert and emergency level messages only).
192
  return $this->logger->error_output;
193
  }
194
+ /**
195
+ * Run elementor Import.
196
+ *
197
+ * @param int $post_id New post ID.
198
+ * @param array $data Raw data imported for the post.
199
+ * @param array $meta Raw meta data, already processed by {@see process_post_meta}.
200
+ * @param array $comments Raw comment data, already processed by {@see process_comments}.
201
+ * @param array $terms Raw term data, already processed.
202
+ */
203
+ public function process_elementor( $post_id, $data, $meta, $comments, $terms ) {
204
+ $meta_data = wp_list_pluck( $meta, 'key' );
205
+ if ( in_array( '_elementor_data', $meta_data, true ) ) {
206
+ if ( class_exists( '\Elementor\TemplateLibrary\Kadence_Starter_Templates_Elementor_Import' ) ) {
207
+ $el_import = new \Elementor\TemplateLibrary\Kadence_Starter_Templates_Elementor_Import();
208
+ foreach ( $meta as $key => $value ) {
209
+ if ( '_elementor_data' === $value['key'] ) {
210
+ $import_data = $el_import->import( $post_id, $value['value'] );
211
+ }
212
+ }
213
+ }
214
+ }
215
+ }
216
+
217
+ /**
218
+ * Run elementor Import.
219
+ *
220
+ * @param int $post_id New post ID.
221
+ * @param array $data Raw data imported for the post.
222
+ * @param array $meta Raw meta data, already processed by {@see process_post_meta}.
223
+ * @param array $comments Raw comment data, already processed by {@see process_comments}.
224
+ * @param array $terms Raw term data, already processed.
225
+ */
226
+ public function process_single_page_clean_meta( $post_id, $data, $meta, $comments, $terms ) {
227
+ update_post_meta( $post_id, '_kad_post_title', 'hide' );
228
+ update_post_meta( $post_id, '_kad_post_content_style', 'unboxed' );
229
+ update_post_meta( $post_id, '_kad_post_vertical_padding', 'hide' );
230
+ update_post_meta( $post_id, '_kad_post_feature', 'hide' );
231
+ update_post_meta( $post_id, '_kad_post_layout', 'fullwidth' );
232
+ }
233
+
234
+ /**
235
+ * Pre-process post meta data.
236
+ *
237
+ * @param array $meta_item Meta data. (Return empty to skip.)
238
+ * @param int $post_id Post the meta is attached to.
239
+ */
240
+ public function process_elementor_images( $meta_item, $post_id ) {
241
+ if ( $meta_item['key'] === '_elementor_data' ) {
242
+ if ( ! empty( $meta_item['value'] ) ) {
243
+ $meta_item['value'] = $this->replace_image_urls( $meta_item['value'] );
244
+ }
245
+ }
246
+ return $meta_item;
247
+ }
248
+
249
+ /**
250
+ * Replace demo urls in meta with site urls.
251
+ */
252
+ public function replace_image_urls( $markup ) {
253
+ // Get all slashed and un-slashed urls.
254
+ $old_urls = $this->get_urls_to_replace( $markup );
255
+ if ( ! is_array( $old_urls ) || empty( $old_urls ) ) {
256
+ return $markup;
257
+ }
258
+
259
+ // Create an associative array.
260
+ $urls = array_combine( $old_urls, $old_urls );
261
+ // Unslash values of associative array.
262
+ $urls = array_map( 'wp_unslash', $urls );
263
+ // Remap host and directory path.
264
+ $urls = array_map( array( $this, 'remap_host' ), $urls );
265
+ // Replace image urls in meta.
266
+ $markup = str_replace( array_keys( $urls ), array_values( $urls ), $markup );
267
+
268
+ return $markup;
269
+ }
270
+
271
+ /**
272
+ * Get url replace array.
273
+ *
274
+ * @return array
275
+ */
276
+ private function get_urls_to_replace( $markup ) {
277
+ $regex = '/(?:http(?:s?):)(?:[\/\\\\\\\\|.|\w|\s|-])*\.(?:' . implode( '|', array_keys( $this->extensions ) ) . ')/m';
278
+
279
+ if ( ! is_string( $markup ) ) {
280
+ return array();
281
+ }
282
+
283
+ preg_match_all( $regex, $markup, $urls );
284
+
285
+ $urls = array_map(
286
+ function ( $value ) {
287
+ return rtrim( html_entity_decode( $value ), '\\' );
288
+ },
289
+ $urls[0]
290
+ );
291
+
292
+ $urls = array_unique( $urls );
293
+
294
+ return array_values( $urls );
295
+ }
296
+
297
+ /**
298
+ * Remap URLs host.
299
+ *
300
+ * @param $url
301
+ *
302
+ * @return string
303
+ */
304
+ private function remap_host( $url ) {
305
+ if ( ! strpos( $url, '/uploads/' ) ) {
306
+ return $url;
307
+ }
308
+ $old_url = $url;
309
+ $url_parts = parse_url( $url );
310
 
311
+ if ( ! isset( $url_parts['host'] ) ) {
312
+ return $url;
313
+ }
314
+ $url_parts['path'] = preg_split( '/\//', $url_parts['path'] );
315
+ $url_parts['path'] = array_slice( $url_parts['path'], - 3 );
316
+
317
+ $uploads_dir = wp_get_upload_dir();
318
+ $uploads_url = $uploads_dir['baseurl'];
319
+
320
+ $new_url = esc_url( $uploads_url . '/' . join( '/', $url_parts['path'] ) );
321
 
322
+ return str_replace( $old_url, $new_url, $url );
323
+ }
324
  /**
325
  * Check if we need to create a new AJAX request, so that server does not timeout.
326
  *
327
  * @param array $data current post data.
328
  * @return array
329
  */
330
+ public function check_for_content_images( $data, $meta, $comments, $terms ) {
331
  $time = microtime( true ) - $this->microtime;
332
 
333
  // We should make a new ajax call, if the time is right.
344
  if ( ! empty( $message ) ) {
345
  $this->kadence_starter_templates->append_to_frontend_error_messages( $message );
346
  }
347
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
348
+ // Add message to log file.
349
+ $log_added = Helpers::append_to_file(
350
+ __( 'New AJAX call!' , 'kadence-starter-templates' ) . PHP_EOL . $message,
351
+ $this->kadence_starter_templates->get_log_file_path(),
352
+ ''
353
+ );
354
+ }
355
+
356
+ // Set the current importer stat, so it can be continued on the next AJAX call.
357
+ $this->set_current_importer_data();
358
+
359
+ // Send the request for a new AJAX call.
360
+ wp_send_json( $response );
361
+ }
362
+
363
+ // Set importing author to the current user.
364
+ // Fixes the [WARNING] Could not find the author for ... log warning messages.
365
+ $current_user_obj = wp_get_current_user();
366
+ $data['post_author'] = $current_user_obj->user_login;
367
+
368
+ if ( isset( $data['post_content'] ) && ! empty( $data['post_content'] ) ) {
369
+
370
+ $meta_data = wp_list_pluck( $meta, 'key' );
371
+
372
+ if ( in_array( '_elementor_data', $meta_data, true ) ) {
373
+ $data['post_content'] = '';
374
+ }
375
+ }
376
+
377
+ if ( isset( $data['post_content'] ) && ! empty( $data['post_content'] ) ) {
378
+
379
+ $images = $this->find_all_image_urls( stripslashes( $data['post_content'] ) );
380
+
381
+ if ( count( $images ) == 0 ) {
382
+ return $data;
383
+ }
384
+ foreach ( $images as $image ) {
385
+ if ( ! empty( $image['url'] ) ) {
386
+ $url_already = $this->check_for_image( $image['url'] );
387
+ if ( $url_already ) {
388
+ $data['post_content'] = preg_replace( '/' . preg_quote( $image['url'], '/' ) . '/', $url_already, $data['post_content'] );
389
+ } else {
390
+ $image_data = self::sideload_image( $image['url'] );
391
+ if ( is_object( $image_data ) ) {
392
+ $image_url = $image_data->url;
393
+ $data['post_content'] = preg_replace( '/' . preg_quote( $image['url'], '/' ) . '/', $image_url, $data['post_content'] );
394
+ }
395
+ }
396
+ }
397
+ }
398
+ }
399
+
400
+ return $data;
401
+ }
402
+ /**
403
+ * Helper function: Sideload Image import
404
+ * Taken from the core media_sideload_image function and
405
+ * modified to return an array of data instead of html.
406
+ *
407
+ * @since 1.1.1.
408
+ * @param string $file The image file path.
409
+ * @return array An array of image data.
410
+ */
411
+ private function check_for_image( $file ) {
412
+ if ( ! empty( $file ) ) {
413
+ preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
414
+ $file_name = basename( $matches[0] );
415
+ $ext = array( ".png", ".jpg", ".gif", ".jpeg" );
416
+ $clean_filename = str_replace( $ext, "", $file_name );
417
+ $clean_filename = trim( html_entity_decode( sanitize_title( $clean_filename ) ) );
418
+ if ( post_exists( $clean_filename ) ) {
419
+ $attachment = get_page_by_title( $clean_filename, OBJECT, 'attachment' );
420
+ if ( ! empty( $attachment ) ) {
421
+ return wp_get_attachment_url( $attachment->ID );
422
+ }
423
+ }
424
+ }
425
+ return false;
426
+
427
+ }
428
+
429
+ /**
430
+ * Helper function: Sideload Image import
431
+ * Taken from the core media_sideload_image function and
432
+ * modified to return an array of data instead of html.
433
+ *
434
+ * @since 1.1.1.
435
+ * @param string $file The image file path.
436
+ * @return array An array of image data.
437
+ */
438
+ private static function sideload_image( $file ) {
439
+ $data = new \stdClass();
440
+
441
+ if ( ! function_exists( 'media_handle_sideload' ) ) {
442
+ require_once( ABSPATH . 'wp-admin/includes/media.php' );
443
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
444
+ require_once( ABSPATH . 'wp-admin/includes/image.php' );
445
+ }
446
+ if ( ! empty( $file ) ) {
447
+ // Set variables for storage, fix file filename for query strings.
448
+ preg_match( '/[^\?]+\.(jpe?g|jpe|gif|png)\b/i', $file, $matches );
449
+ $file_array = array();
450
+ $file_array['name'] = basename( $matches[0] );
451
+
452
+ // Download file to temp location.
453
+ $file_array['tmp_name'] = download_url( $file );
454
+
455
+ // If error storing temporarily, return the error.
456
+ if ( is_wp_error( $file_array['tmp_name'] ) ) {
457
+ return $file_array['tmp_name'];
458
+ }
459
+
460
+ // Do the validation and storage stuff.
461
+ $id = media_handle_sideload( $file_array, 0 );
462
+
463
+ // If error storing permanently, unlink.
464
+ if ( is_wp_error( $id ) ) {
465
+ unlink( $file_array['tmp_name'] );
466
+ return $id;
467
+ }
468
+
469
+ // Build the object to return.
470
+ $meta = wp_get_attachment_metadata( $id );
471
+ $data->attachment_id = $id;
472
+ $data->url = wp_get_attachment_url( $id );
473
+ $data->thumbnail_url = wp_get_attachment_thumb_url( $id );
474
+ $data->height = $meta['height'];
475
+ $data->width = $meta['width'];
476
+ }
477
+
478
+ return $data;
479
+ }
480
+ /**
481
+ * Find image urls in content and retrieve urls by array
482
+ *
483
+ * @param string $content the post content.
484
+ * @return array
485
+ */
486
+ public function find_all_image_urls( $content ) {
487
+ $urls1 = array();
488
+ preg_match_all( '/<img[^>]*srcset=["\']([^"\']*)[^"\']*["\'][^>]*>/i', $content, $srcsets, PREG_SET_ORDER );
489
+ if ( count( $srcsets ) > 0 ) {
490
+ $count = 0;
491
+ foreach ( $srcsets as $key => $srcset ) {
492
+ preg_match_all( '/https?:\/\/[^\s,]+/i', $srcset[1], $srcsetUrls, PREG_SET_ORDER );
493
+ if ( count( $srcsetUrls ) == 0 ) {
494
+ continue;
495
+ }
496
+ foreach ( $srcsetUrls as $srcsetUrl ) {
497
+ $urls1[$count][] = $srcset[0];
498
+ $urls1[$count][] = $srcsetUrl[0];
499
+ $count++;
500
+ }
501
+ }
502
+ }
503
 
504
+ preg_match_all( '/<img[^>]*src=["\']([^"\']*)[^"\']*["\'][^>]*>/i', $content, $urls, PREG_SET_ORDER );
505
+ $urls = array_merge( $urls, $urls1 );
506
+
507
+ //preg_match_all( '/"bgImg":["]([^"]*)[^"]*["][^>]*-->/i', $content, $bg_urls, PREG_SET_ORDER );
508
+ preg_match_all( '/"bgImg":"([^"]*)["]*"/i', $content, $bg_urls, PREG_SET_ORDER );
509
+ if ( is_array( $bg_urls ) ) {
510
+ $urls = array_merge( $bg_urls, $urls );
511
+ }
512
+
513
+ if ( count( $urls ) == 0 ) {
514
+ return array();
515
+ }
516
+
517
+ foreach ( $urls as $index => &$url ) {
518
+ $images[ $index ]['url'] = $url = $url[1];
519
+ }
520
+ foreach ( array_unique( $urls ) as $index => $url ) {
521
+ $unique_array[] = $images[ $index ];
522
+ }
523
+ return $unique_array;
524
+ }
525
+ /**
526
+ * Check if we need to create a new AJAX request, so that server does not timeout.
527
+ *
528
+ * @param array $data current post data.
529
+ * @return array
530
+ */
531
+ public function new_ajax_request_maybe( $data ) {
532
+ $time = microtime( true ) - $this->microtime;
533
+
534
+ // We should make a new ajax call, if the time is right.
535
+ if ( $time > apply_filters( 'kadence-starter-templates/time_for_one_ajax_call', 25 ) ) {
536
+ $response = array(
537
+ 'status' => 'newAJAX',
538
+ 'message' => 'Time for new AJAX request!: ' . $time,
539
  );
540
 
541
+ // Add any output to the log file and clear the buffers.
542
+ $message = ob_get_clean();
543
+
544
+ // Add any error messages to the frontend_error_messages variable in OCDI main class.
545
+ if ( ! empty( $message ) ) {
546
+ $this->kadence_starter_templates->append_to_frontend_error_messages( $message );
547
+ }
548
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
549
+ // Add message to log file.
550
+ $log_added = Helpers::append_to_file(
551
+ __( 'New AJAX call!' , 'kadence-starter-templates' ) . PHP_EOL . $message,
552
+ $this->kadence_starter_templates->get_log_file_path(),
553
+ ''
554
+ );
555
+ }
556
+
557
  // Set the current importer stat, so it can be continued on the next AJAX call.
558
  $this->set_current_importer_data();
559
 
568
 
569
  return $data;
570
  }
571
+ /**
572
+ * Add Meta info so we can query this term later if needed to remove.
573
+ *
574
+ * @param int $term_id New term ID.
575
+ * @param array $data Raw data imported for the term.
576
+ */
577
+ public function add_term_tracking( $term_id, $data ) {
578
+ update_term_meta( $term_id, '_kadence_starter_templates_imported_term', true );
579
+ }
580
+ /**
581
+ * Run elementor Import.
582
+ *
583
+ * @param int $post_id New post ID.
584
+ * @param array $data Raw data imported for the post.
585
+ * @param array $meta Raw meta data, already processed by {@see process_post_meta}.
586
+ * @param array $comments Raw comment data, already processed by {@see process_comments}.
587
+ * @param array $terms Raw term data, already processed.
588
+ */
589
+ public function add_post_tracking( $post_id, $data, $meta, $comments, $terms ) {
590
+ update_post_meta( $post_id, '_kadence_starter_templates_imported_post', true );
591
+ }
592
 
593
  /**
594
  * Set current state of the content importer, so we can continue the import with new AJAX request.
inc/class-widget-importer.php CHANGED
@@ -32,24 +32,26 @@ class WidgetImporter {
32
 
33
  // Add any error messages to the frontend_error_messages variable in OCDI main class.
34
  $kadence_starter_templates->append_to_frontend_error_messages( $error_message );
35
-
36
- // Write error to log file.
37
- Helpers::append_to_file(
38
- $error_message,
39
- $log_file_path,
40
- esc_html__( 'Importing widgets', 'kadence-starter-templates' )
41
- );
 
42
  } else {
43
  ob_start();
44
  self::format_results_for_log( $results );
45
  $message = ob_get_clean();
46
-
47
- // Add this message to log file.
48
- $log_added = Helpers::append_to_file(
49
- $message,
50
- $log_file_path,
51
- esc_html__( 'Importing widgets' , 'kadence-starter-templates' )
52
- );
 
53
  }
54
 
55
  }
@@ -148,8 +150,7 @@ class WidgetImporter {
148
  $use_sidebar_id = $sidebar_id;
149
  $sidebar_message_type = 'success';
150
  $sidebar_message = '';
151
- }
152
- else {
153
  $sidebar_available = false;
154
  $use_sidebar_id = 'wp_inactive_widgets'; // Add to inactive if sidebar does not exist in theme.
155
  $sidebar_message_type = 'error';
32
 
33
  // Add any error messages to the frontend_error_messages variable in OCDI main class.
34
  $kadence_starter_templates->append_to_frontend_error_messages( $error_message );
35
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
36
+ // Write error to log file.
37
+ Helpers::append_to_file(
38
+ $error_message,
39
+ $log_file_path,
40
+ esc_html__( 'Importing widgets', 'kadence-starter-templates' )
41
+ );
42
+ }
43
  } else {
44
  ob_start();
45
  self::format_results_for_log( $results );
46
  $message = ob_get_clean();
47
+ if ( apply_filters( 'kadence_starter_templates_save_log_files', false ) ) {
48
+ // Add this message to log file.
49
+ $log_added = Helpers::append_to_file(
50
+ $message,
51
+ $log_file_path,
52
+ esc_html__( 'Importing widgets' , 'kadence-starter-templates' )
53
+ );
54
+ }
55
  }
56
 
57
  }
150
  $use_sidebar_id = $sidebar_id;
151
  $sidebar_message_type = 'success';
152
  $sidebar_message = '';
153
+ } else {
 
154
  $sidebar_available = false;
155
  $use_sidebar_id = 'wp_inactive_widgets'; // Add to inactive if sidebar does not exist in theme.
156
  $sidebar_message_type = 'error';
inc/react/src/full-preview-mode.js ADDED
@@ -0,0 +1,212 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ // import HelpTab from './help';
5
+ // import ProSettings from './pro-extension';
6
+ // import RecommendedTab from './recomended';
7
+ // import StarterTab from './starter';
8
+ // import Sidebar from './sidebar';
9
+ // import CustomizerLinks from './customizer';
10
+ // import Notices from './notices';
11
+ import map from 'lodash/map';
12
+ import LazyLoad from 'react-lazy-load';
13
+ /**
14
+ * WordPress dependencies
15
+ */
16
+ const { __, sprintf } = wp.i18n;
17
+ const { Fragment, Component, render, PureComponent } = wp.element;
18
+ const { Modal, Spinner, ButtonGroup, Dropdown, Button, ExternalLink, ToolbarGroup, MenuItem, Tooltip } = wp.components;
19
+
20
+ class KadenceImporterFullPreview extends Component {
21
+ constructor() {
22
+ super( ...arguments );
23
+ this.state = {
24
+ colorPalette: this.props.colorPalette ? this.props.colorPalette : '',
25
+ fontPair: this.props.fontPair ? this.props.fontPair : '',
26
+ palettes: ( kadenceStarterParams.palettes ? kadenceStarterParams.palettes : [] ),
27
+ fonts: ( kadenceStarterParams.fonts ? kadenceStarterParams.fonts : [] ),
28
+ };
29
+ }
30
+ capitalizeFirstLetter( string ) {
31
+ return string.charAt( 0 ).toUpperCase() + string.slice( 1 );
32
+ }
33
+ render() {
34
+ const item = this.props.item[0];
35
+ let pluginsActive = true;
36
+ let pluginsPremium = false;
37
+ return (
38
+ <div className="kadence-starter-templates-preview theme-install-overlay wp-full-overlay expanded" style={ { display:'block' } }>
39
+ <div className="wp-full-overlay-sidebar">
40
+ <div className="wp-full-overlay-header">
41
+ <button
42
+ className="kst-close-focus-btn close-full-overlay"
43
+ onClick={ () => this.props.onChange( { activeTemplate: '', colorPalette: '', fontPair: '', focusMode: false } ) }
44
+ >
45
+ </button>
46
+ </div>
47
+ <div className="wp-full-overlay-sidebar-content">
48
+ <div className="install-theme-info">
49
+ <div className="theme-info-wrap">
50
+ <img className="theme-screenshot" src={ item.image } alt={ item.name } />
51
+ <div className="theme-info-title-wrap">
52
+ <h3 className="theme-name">{ item.name }</h3>
53
+ <div className="theme-by">{ item.categories.map( category => this.capitalizeFirstLetter( category ) ).join( ', ' ) }</div>
54
+ </div>
55
+ </div>
56
+ <div className="palette-title-wrap">
57
+ <h2 className="palette-title">{__( 'Optional: Change Color Scheme', 'kadence-starter-templates' ) }</h2>
58
+ <Button
59
+ label={ __( 'clear' ) }
60
+ className="kst-clear-palette"
61
+ disabled={ this.state.colorPalette ? false : true }
62
+ icon="image-rotate"
63
+ iconSize={ 10 }
64
+ onClick={ () => {
65
+ this.setState( { colorPalette: '' } );
66
+ document.getElementById('kadence-starter-preview').contentWindow.postMessage({ color: '' }, '*' );
67
+ } }
68
+ />
69
+ </div>
70
+ <ButtonGroup className="kst-palette-group" aria-label={ __( 'Select a Palette', 'kadence-starter-templates' ) }>
71
+ { map( this.state.palettes, ( { palette, colors } ) => {
72
+ return (
73
+ <Button
74
+ className="kst-palette-btn"
75
+ isPrimary={ palette === this.state.colorPalette }
76
+ aria-pressed={ palette === this.state.colorPalette }
77
+ onClick={ () => {
78
+ document.getElementById('kadence-starter-preview').contentWindow.postMessage({ color: palette }, '*' );
79
+ this.setState( { colorPalette: palette } );
80
+ } }
81
+ >
82
+ <span className={ 'kst-palette-bg' } style={ {
83
+ background: colors[4] ? colors[4] : undefined,
84
+ } }></span>
85
+ { map( colors, ( color, index ) => {
86
+ if ( 4 === index ) {
87
+ return;
88
+ }
89
+ return (
90
+ <div key={ index } style={ {
91
+ width: 30,
92
+ height: 30,
93
+ marginBottom: 0,
94
+ marginRight:'3px',
95
+ transform: 'scale(1)',
96
+ transition: '100ms transform ease',
97
+ } } className="kadence-swatche-item-wrap">
98
+ <span
99
+ className={ 'kadence-swatch-item' }
100
+ style={ {
101
+ height: '100%',
102
+ display: 'block',
103
+ width: '100%',
104
+ border: '1px solid rgb(218, 218, 218)',
105
+ borderRadius: '50%',
106
+ color: `${ color }`,
107
+ boxShadow: `inset 0 0 0 ${ 30 / 2 }px`,
108
+ transition: '100ms box-shadow ease',
109
+ } }
110
+ >
111
+ </span>
112
+ </div>
113
+ )
114
+ } ) }
115
+ </Button>
116
+ )
117
+ } ) }
118
+ </ButtonGroup>
119
+ <p className="desc-small">{__( '*You can change this after import.', 'kadence-starter-templates' ) }</p>
120
+ <div className="font-title-wrap">
121
+ <h2 className="font-title">{__( 'Optional: Change Font Family', 'kadence-starter-templates' ) }</h2>
122
+ <Button
123
+ label={ __( 'clear' ) }
124
+ className="kst-clear-font"
125
+ disabled={ this.state.fontPair ? false : true }
126
+ icon="image-rotate"
127
+ iconSize={ 10 }
128
+ onClick={ () => {
129
+ this.setState( { fontPair: '' } );
130
+ document.getElementById('kadence-starter-preview').contentWindow.postMessage({ font: '' }, '*' );
131
+ } }
132
+ />
133
+ </div>
134
+ <ButtonGroup className="kst-font-group" aria-label={ __( 'Select a Font', 'kadence-starter-templates' ) }>
135
+ { map( this.state.fonts, ( { font, img, name } ) => {
136
+ return (
137
+ <Tooltip text={ name }>
138
+ <Button
139
+ className={ `kst-font-btn${ font === this.state.fontPair ? ' active' : '' }` }
140
+ aria-pressed={ font === this.state.fontPair }
141
+ onClick={ () => {
142
+ this.setState( { fontPair: font } );
143
+ document.getElementById('kadence-starter-preview').contentWindow.postMessage({ font: font }, '*' );
144
+ } }
145
+ >
146
+ <img src={ img } className="font-pairing" />
147
+ </Button>
148
+ </Tooltip>
149
+ )
150
+ } ) }
151
+ </ButtonGroup>
152
+ <p className="desc-small">{__( '*You can change this after import.', 'kadence-starter-templates' ) }</p>
153
+ </div>
154
+ <div className="kadence-starter-required-plugins">
155
+ <h2 className="kst-required-title">{ __( 'Required Plugins', 'kadence-starter-templates' ) }</h2>
156
+ <ul className="kadence-required-wrap">
157
+ { map( item.plugins, ( { state, title, src } ) => {
158
+ if ( 'active' !== state ) {
159
+ pluginsActive = false;
160
+ if ( 'thirdparty' === src ) {
161
+ pluginsPremium = true;
162
+ }
163
+ }
164
+ return (
165
+ <li className="plugin-required">
166
+ { title } - <span class="plugin-status">{ ( 'notactive' === state ? __( 'Not Installed', 'kadence-starter-templates' ) : state ) }</span>
167
+ </li>
168
+ );
169
+ } ) }
170
+ </ul>
171
+ { ! pluginsActive && (
172
+ <Fragment>
173
+ { pluginsPremium && (
174
+ <p className="desc-small">{__( '*Install Missing/Inactive Premium plugins to import.', 'kadence-starter-templates' ) }</p>
175
+ ) }
176
+ { !pluginsPremium && (
177
+ <p className="desc-small">{__( '*Missing/Inactive plugins will be installed on import.', 'kadence-starter-templates' ) }</p>
178
+ ) }
179
+ </Fragment>
180
+ ) }
181
+ </div>
182
+ </div>
183
+
184
+ <div class="wp-full-overlay-footer">
185
+ <h2 className="kst-import-options-title">{ __( 'Import Options', 'kadence-starter-templates' ) }</h2>
186
+ <div class="kadence-starter-templates-preview-actions">
187
+ <button
188
+ className="kst-import-btn button-hero button"
189
+ isDisabled={ undefined !== item.pro && item.pro && 'true' !== kadenceStarterParams.pro }
190
+ onClick={ () => this.props.onChange( { isSelected: false, fontPair: this.state.fontPair, colorPalette: this.state.colorPalette } ) }
191
+ >
192
+ { __( 'Single Page', 'kadence-starter-templates' ) }
193
+ </button>
194
+ <button
195
+ className="kst-import-btn button-hero button button-primary"
196
+ isDisabled={ undefined !== item.pro && item.pro && 'true' !== kadenceStarterParams.pro }
197
+ onClick={ () => this.props.onChange( { isImporting: true, fontPair: this.state.fontPair, colorPalette: this.state.colorPalette } ) }
198
+ >
199
+ { __( 'Full Site', 'kadence-starter-templates' ) }
200
+ </button>
201
+ </div>
202
+ </div>
203
+ </div>
204
+
205
+ <div class="wp-full-overlay-main">
206
+ <iframe id="kadence-starter-preview" src={ item.url + '?cache=bust' } />
207
+ </div>
208
+ </div>
209
+ );
210
+ }
211
+ }
212
+ export default KadenceImporterFullPreview;
inc/react/src/index.js CHANGED
@@ -10,13 +10,107 @@
10
  // import Notices from './notices';
11
  import map from 'lodash/map';
12
  import LazyLoad from 'react-lazy-load';
 
13
  /**
14
  * WordPress dependencies
15
  */
16
  const { __, sprintf } = wp.i18n;
17
- const { Fragment, Component, render } = wp.element;
18
- const { Modal, Spinner, ButtonGroup, Button, ExternalLink } = wp.components;
19
- const { apiFetch } = wp;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  class KadenceImporter extends Component {
22
  constructor() {
@@ -24,34 +118,90 @@ class KadenceImporter extends Component {
24
  this.runAjax = this.runAjax.bind( this );
25
  this.runPluginInstall = this.runPluginInstall.bind( this );
26
  this.focusMode = this.focusMode.bind( this );
 
 
 
 
 
27
  this.state = {
28
  category: 'all',
29
  activeTemplate: '',
30
  colorPalette: '',
 
31
  search: null,
32
  isFetching: false,
33
  isImporting: false,
 
 
 
 
 
34
  progress: '',
35
  focusMode: false,
36
  finished: false,
 
 
 
 
 
 
37
  templates: ( kadenceStarterParams.templates ? kadenceStarterParams.templates : [] ),
 
38
  palettes: ( kadenceStarterParams.palettes ? kadenceStarterParams.palettes : [] ),
 
 
 
 
 
39
  };
40
- apiFetch.setFetchHandler( ( options ) => {
41
- const { url, path, data, method } = options;
42
-
43
- return axios( {
44
- url: url || path,
45
- method,
46
- data,
47
- } );
 
 
 
 
48
  } );
49
  }
50
  capitalizeFirstLetter( string ) {
51
  return string.charAt( 0 ).toUpperCase() + string.slice( 1 );
52
  }
53
  focusMode( template_id ) {
54
- this.setState( { activeTemplate: template_id, focusMode: true } )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  }
56
  runPluginInstall( selected ) {
57
  this.setState( { progress: 'plugins', isFetching: true } );
@@ -61,6 +211,44 @@ class KadenceImporter extends Component {
61
  data.append( 'selected', selected );
62
  this.runAjax( data );
63
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  runAjax( data ) {
65
  var control = this;
66
  jQuery.ajax({
@@ -97,18 +285,26 @@ class KadenceImporter extends Component {
97
  newData.append( 'security', kadenceStarterParams.ajax_nonce );
98
  newData.append( 'selected', control.state.activeTemplate );
99
  newData.append( 'palette', control.state.colorPalette );
 
 
 
 
 
 
 
 
100
  control.runAjax( newData );
101
  } else if ( 'undefined' !== typeof response.message ) {
102
- jQuery( '.kadence_starter_templates_finished' ).append( '<p>' + response.message + '</p>' );
103
- control.setState( { finished: true, isFetching: false, activeTemplate: '', focusMode: false, isImporting: false, progress: '' } );
104
  } else {
105
- jQuery( '.kadence_starter_templates_error' ).append( '<div class="notice kadence_starter_templates_response notice-error"><p>' + response + '</p></div>' );
106
- control.setState( { finished: true, isFetching: false, activeTemplate: '', focusMode: false, isImporting: false, progress: '' } );
107
  }
108
  })
109
  .fail( function( error ) {
110
- jQuery( '.kadence_starter_templates_error' ).append( '<div class="notice kadence_starter_templates_response notice-error"><p>Error: ' + error.statusText + ' (' + error.status + ')' + '</p></div>' );
111
- control.setState( { finished: true, isFetching: false, activeTemplate: '', focusMode: false, isImporting: false, progress: '' } );
112
  });
113
  }
114
  render() {
@@ -123,141 +319,193 @@ class KadenceImporter extends Component {
123
  const catOptions = cats.map( ( item ) => {
124
  return { value: item, label: this.capitalizeFirstLetter( item ) }
125
  } );
126
- const KadenceFocusMode = () => {
127
- const itemArray = this.state.templates.filter( ( { key } ) => key === this.state.activeTemplate );
128
  const item = itemArray[0];
129
- let pluginsActive = true;
130
- let pluginsPremium = false;
131
- const url = ( this.state.colorPalette ? item.url + '?previewcolor=' + this.state.colorPalette : item.url );
132
  return (
133
- <div className="kadence-starter-templates-preview theme-install-overlay wp-full-overlay expanded" style={{ display:'block'}}>
134
- <div className="wp-full-overlay-sidebar">
135
- <div className="wp-full-overlay-header">
136
- <button
137
- className="kst-close-focus-btn close-full-overlay"
138
- onClick={ () => this.setState( { activeTemplate: '', colorPalette: '', focusMode: false } ) }
139
- >
140
- </button>
141
  </div>
142
- <div className="wp-full-overlay-sidebar-content">
143
- <div className="install-theme-info">
144
- <h3 className="theme-name">{ item.name }</h3>
145
- <div className="theme-by">{ item.categories.map( category => this.capitalizeFirstLetter( category ) ).join( ', ' ) }</div>
146
- <img className="theme-screenshot" src={ item.image } alt={ item.name } />
147
- <div className="palette-title-wrap">
148
- <h2 className="palette-title">{__( 'Optional: Choose Color Scheme', 'kadence-starter-templates' ) }</h2>
149
- <Button
150
- label={ __( 'clear' ) }
151
- className="kst-clear-palette"
152
- disabled={ this.state.colorPalette ? false : true }
153
- icon="image-rotate"
154
- iconSize={ 10 }
155
- onClick={ () => this.setState( { colorPalette: '' } ) }
156
- />
157
- </div>
158
- <ButtonGroup className="kst-palette-group" aria-label={ __( 'Select a Palette', 'kadence-starter-templates' ) }>
159
- { map( this.state.palettes, ( { palette, colors } ) => {
160
- return (
161
- <Button
162
- className="kst-palette-btn"
163
- isPrimary={ palette === this.state.colorPalette }
164
- aria-pressed={ palette === this.state.colorPalette }
165
- onClick={ () => this.setState( { colorPalette: palette } ) }
166
- >
167
- { map( colors, ( color, index ) => {
168
- return (
169
- <div key={ index } style={ {
170
- width: 30,
171
- height: 30,
172
- marginBottom: 0,
173
- marginRight:'3px',
174
- transform: 'scale(1)',
175
- transition: '100ms transform ease',
176
- } } className="kadence-swatche-item-wrap">
177
- <span
178
- className={ 'kadence-swatch-item' }
179
- style={ {
180
- height: '100%',
181
- display: 'block',
182
- width: '100%',
183
- border: '1px solid rgb(218, 218, 218)',
184
- borderRadius: '50%',
185
- color: `${ color }`,
186
- boxShadow: `inset 0 0 0 ${ 30 / 2 }px`,
187
- transition: '100ms box-shadow ease',
188
- } }
189
- >
190
- </span>
191
- </div>
192
- )
193
- } ) }
194
- </Button>
195
- )
196
- } ) }
197
- </ButtonGroup>
198
- <p className="desc-small">{__( '*You can change this after import.', 'kadence-starter-templates' ) }</p>
199
  </div>
200
- <div className="kadence-starter-required-plugins">
201
- <h3>{ __( 'Required Plugins', 'kadence-starter-templates' ) }</h3>
202
  <ul className="kadence-required-wrap">
203
  { map( item.plugins, ( { state, title, src } ) => {
204
- if ( 'active' !== state ) {
205
- pluginsActive = false;
206
- if ( 'thirdparty' === src ) {
207
- pluginsPremium = true;
208
- }
209
- }
210
  return (
211
  <li className="plugin-required">
212
- { title } - <span class="plugin-status">{ ( 'notactive' === state ? __( 'Not Installed', 'kadence-starter-templates' ) : state ) }</span>
213
  </li>
214
  );
215
  } ) }
216
  </ul>
217
- { ! pluginsActive && (
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
218
  <Fragment>
219
- { pluginsPremium && (
220
- <p className="desc-small">{__( '*Install Missing/Inactive Premium plugins to import.', 'kadence-starter-templates' ) }</p>
221
- ) }
222
- { !pluginsPremium && (
223
- <p className="desc-small">{__( '*Missing/Inactive plugins will be installed on import.', 'kadence-starter-templates' ) }</p>
224
- ) }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  </Fragment>
226
  ) }
227
- </div>
228
- </div>
229
-
230
- <div class="wp-full-overlay-footer">
231
- <div class="kadence-starter-templates-preview-actions">
232
- <button
233
- className="kst-import-btn button-hero button button-primary"
234
- isDisabled={ undefined !== item.pro && item.pro && 'true' !== kadenceStarterParams.pro }
235
- onClick={ () => this.setState( { isImporting: true } ) }
236
- >
237
- { __( 'Import', 'kadence-starter-templates' ) }
238
- </button>
239
- </div>
240
  </div>
241
  </div>
242
-
243
- <div class="wp-full-overlay-main">
244
- <iframe id="kadence-starter-preview" src={ url } ></iframe>
245
- </div>
246
  </div>
247
  );
248
  }
249
  const KadenceImportMode = () => {
250
- const itemArray = this.state.templates.filter( ( { key } ) => key === this.state.activeTemplate );
251
  const item = itemArray[0];
252
  let pluginsPremium = false;
253
  return (
254
  <Fragment>
255
- <div className="kst-grid-single-item">
256
- <div className="kst-template-item">
257
- <div className="kst-import-btn">
258
- <img src={ item.image } alt={ item.name } />
259
- <div className="demo-title">
260
- <h4>{ item.name }</h4>
 
 
 
 
261
  </div>
262
  </div>
263
  </div>
@@ -266,9 +514,13 @@ class KadenceImporter extends Component {
266
  className="kst-import-modal"
267
  title={ __( 'Import Starter Template' ) }
268
  onRequestClose={ () => this.state.isFetching ? false : this.setState( { activeTemplate: '', colorPalette: '', focusMode: false, isImporting: false, progress: '' } ) }>
269
- { kadenceStarterParams.has_content && (
270
  <div className="kadence_starter_templates_notice">
271
- { kadenceStarterParams.notice }
 
 
 
 
272
  </div>
273
  ) }
274
  <h3>{ __( 'Starter Template Plugins', 'kadence-starter-templates' ) }</h3>
@@ -332,6 +584,56 @@ class KadenceImporter extends Component {
332
  } ) }
333
  </Fragment>
334
  ) }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
335
  { this.state.progress === 'plugins' && (
336
  <div class="kadence_starter_templates_response">{ kadenceStarterParams.plugin_progress }</div>
337
  ) }
@@ -353,21 +655,29 @@ class KadenceImporter extends Component {
353
  { ! kadenceStarterParams.isKadence && (
354
  <div class="kadence_starter_templates_response">
355
  <h2>{ __( 'This Starter Template Requires the Kadence Theme', 'kadence-starter-templates' ) }</h2>
356
- <ExternalLink href={ 'https://kadence-theme.com/' }>{ __( 'Get Free Theme', 'kadence-blocks' ) }</ExternalLink>
357
  </div>
358
  ) }
359
  { kadenceStarterParams.isKadence && (
360
  <Fragment>
361
  { pluginsPremium && (
362
  <Button className="kt-defaults-save" isPrimary disabled={ this.state.isFetching } onClick={ () => {
363
- this.runPluginInstall( item.key );
 
 
 
 
364
  } }>
365
  { __( 'Skip and Import with Partial Content' ) }
366
  </Button>
367
  ) }
368
  { ! pluginsPremium && (
369
  <Button className="kt-defaults-save" isPrimary disabled={ this.state.isFetching } onClick={ () => {
370
- this.runPluginInstall( item.key );
 
 
 
 
371
  } }>
372
  { __( 'Start Importing' ) }
373
  </Button>
@@ -378,9 +688,69 @@ class KadenceImporter extends Component {
378
  </Fragment>
379
  );
380
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  const KadenceSitesGrid = () => (
382
  <div className="templates-grid">
383
- { map( this.state.templates, ( { name, key, image, content, categories, keywords, pro } ) => {
384
  if ( ( 'all' === this.state.category || categories.includes( this.state.category ) ) && ( ! this.state.search || ( keywords && keywords.some( x => x.toLowerCase().includes( this.state.search.toLowerCase() ) ) ) ) ) {
385
  return (
386
  <div className="kst-template-item">
@@ -389,10 +759,11 @@ class KadenceImporter extends Component {
389
  className="kst-import-btn"
390
  isSmall
391
  isDisabled={ undefined !== pro && pro && 'true' !== kadenceStarterParams.pro }
392
- onClick={ () => this.focusMode( key ) }
 
393
  >
394
- <LazyLoad>
395
- <img src={ image } alt={ name } />
396
  </LazyLoad>
397
  <div className="demo-title">
398
  <h4>{ name }</h4>
@@ -400,11 +771,11 @@ class KadenceImporter extends Component {
400
  </Button>
401
  { undefined !== pro && pro && (
402
  <Fragment>
403
- <span className="kb-pro-template">{ __( 'Pro', 'kadence-blocks' ) }</span>
404
  { 'true' !== kadenceStarterParams.pro && (
405
  <div className="kt-popover-pro-notice">
406
- <h2>{ __( 'Kadence Pro required for this item', 'kadence-starter-sites' ) } </h2>
407
- <ExternalLink href={ 'https://www.kadencewp.com/pro/' }>{ __( 'Upgrade to Pro', 'kadence-blocks' ) }</ExternalLink>
408
  </div>
409
  ) }
410
  </Fragment>
@@ -415,28 +786,229 @@ class KadenceImporter extends Component {
415
  } ) }
416
  </div>
417
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
418
 
419
  const MainPanel = () => (
420
- <div className="main-panel">
421
- { this.state.focusMode && (
422
- <Fragment>
423
- { this.state.isImporting && (
424
- <KadenceImportMode />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
425
  ) }
426
- { ! this.state.isImporting && (
427
- <KadenceFocusMode />
428
  ) }
429
- </Fragment>
430
- ) }
431
- { ! this.state.focusMode && ! this.state.finished && (
432
- <KadenceSitesGrid />
 
 
 
 
 
 
433
  ) }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
  </div>
435
  );
436
-
437
  return (
438
  <Fragment>
439
- <MainPanel />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
440
  </Fragment>
441
  );
442
  }
10
  // import Notices from './notices';
11
  import map from 'lodash/map';
12
  import LazyLoad from 'react-lazy-load';
13
+ import KadenceImporterFullPreview from './full-preview-mode.js'
14
  /**
15
  * WordPress dependencies
16
  */
17
  const { __, sprintf } = wp.i18n;
18
+ const { Fragment, Component, render, PureComponent } = wp.element;
19
+ const { Modal, Spinner, ButtonGroup, Dropdown, Icon, Button, ExternalLink, ToolbarGroup, ToggleControl, MenuItem, Tooltip } = wp.components;
20
+ import {
21
+ arrowLeft,
22
+ chevronLeft,
23
+ chevronDown,
24
+ } from '@wordpress/icons';
25
+ const eIcon = <svg
26
+ xmlns="http://www.w3.org/2000/svg"
27
+ fillRule="evenodd"
28
+ strokeLinejoin="round"
29
+ strokeMiterlimit="2"
30
+ clipRule="evenodd"
31
+ viewBox="0 0 180 180"
32
+ >
33
+ <circle cx="90.03" cy="89.952" r="90" fill="url(#_Linear1)"></circle>
34
+ <path fill="#fff" d="M50 50H66.003V130H50z"></path>
35
+ <path fill="#fff" d="M82 50H130.011V66H82z"></path>
36
+ <path fill="#fff" d="M82 82H130.011V98H82z"></path>
37
+ <path fill="#fff" d="M82 114.046H130.011V130.046H82z"></path>
38
+ <defs>
39
+ <linearGradient
40
+ id="_Linear1"
41
+ x1="0"
42
+ x2="1"
43
+ y1="0"
44
+ y2="0"
45
+ gradientTransform="rotate(-52.456 186.056 40.829) scale(178.658)"
46
+ gradientUnits="userSpaceOnUse"
47
+ >
48
+ <stop offset="0" stopColor="#372b73"></stop>
49
+ <stop offset="1" stopColor="#e9335e"></stop>
50
+ </linearGradient>
51
+ </defs>
52
+ </svg>;
53
+ const eIconNew = <svg
54
+ xmlns="http://www.w3.org/2000/svg"
55
+ fillRule="evenodd"
56
+ strokeLinejoin="round"
57
+ strokeMiterlimit="2"
58
+ clipRule="evenodd"
59
+ viewBox="0 0 180 180"
60
+ >
61
+ <circle cx="90.03" cy="89.952" r="90" fill="#93003c"></circle>
62
+ <path fill="#ff5bd4" d="M50 50H66.003V130H50z"></path>
63
+ <path fill="#ff5bd4" d="M82 50H130.011V66H82z"></path>
64
+ <path fill="#ff5bd4" d="M82 82H130.011V98H82z"></path>
65
+ <path fill="#ff5bd4" d="M82 114.046H130.011V130.046H82z"></path>
66
+ </svg>;
67
+ const gbIcon = <svg
68
+ xmlns="http://www.w3.org/2000/svg"
69
+ x="0"
70
+ y="0"
71
+ enableBackground="new 0 0 720 864"
72
+ viewBox="0 0 720 864"
73
+ className="gblogo"
74
+ >
75
+ <g>
76
+ <path
77
+ d="M432.4 415.6c-2.5-1.7-5.9-1-7.6 1.5-9.9 14.9-30.9 15.7-32 15.7h-.5c-25.9 0-35.8 22.1-36.2 23-1.2 2.8.1 6 2.8 7.2.7.3 1.5.5 2.2.5 2.1 0 4.1-1.2 5-3.3.1-.2 6.9-15.4 24.4-16.4v28.3c-.7 6.1-3.6 10.9-8.7 14.5-5.3 3.7-12.4 5.6-21.1 5.6-10.4 0-18.9-3.6-25.2-10.7-6.4-7.1-9.6-17.2-9.6-30.2l.1-31.2c.5-11.5 3.6-20.6 9.5-27.1 6.4-7.1 14.8-10.7 25.2-10.7 8.7 0 15.8 1.9 21.1 5.6 5.3 3.7 8.3 8.8 8.8 15.4v.7c0 3.8 3.1 6.9 6.9 6.9s6.9-3.1 6.9-6.9v-.7c-1-9.9-5.5-17.7-13.6-23.6-8.1-5.9-18.2-8.8-30.4-8.8-14.5 0-26.2 4.8-35.1 14.3-8.4 8.9-12.8 20.6-13.3 35 0 1-.1 2-.1 3l.1 28.1h-.1c0 15.9 4.5 28.6 13.4 38.1s20.6 14.3 35.1 14.3c12.2 0 22.3-2.9 30.4-8.8 7.4-5.4 11.8-12.5 13.3-21.3l.3-31.4c9.1-2.2 21.5-7.2 29.3-19 2-2.5 1.3-5.9-1.3-7.6zM528.7 94.1h76.7c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2h-76.7c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2zM117.8 94.1h76.7c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2h-76.7c-3.4 0-6.2 2.8-6.2 6.2s2.7 6.2 6.2 6.2z"
78
+ className="st2"
79
+ ></path>
80
+ <circle cx="609.3" cy="150.1" r="6.2" className="st2"></circle>
81
+ <circle cx="359.8" cy="130.6" r="6.2" className="st2"></circle>
82
+ <path
83
+ d="M244.8 150.2h.3c23.3 0 33.7-14.6 41.6-28.2 2.6-4.5 12.2-19.5 25.8-23.4 16.8-4.9 34.7 2.9 41.7 18.2 1 2.2 3.2 3.5 5.4 3.6h.7c2.2-.1 4.4-1.4 5.4-3.6 7-15.3 24.9-23.1 41.7-18.2 13.6 4 23.2 18.9 25.8 23.4 7.9 13.7 18.3 28.2 41.9 28.2 14.2 0 31-10.6 35.7-30.9 3.9-16.8-3.3-32-19-39.7-3.1-1.5-6.8-.3-8.3 2.8-1.5 3.1-.3 6.8 2.8 8.3 14.9 7.4 13.6 20.5 12.4 25.8-2.4 10.4-11.6 21.4-23.7 21.4-15.5 0-22.9-7.8-31.2-22.1-4.1-7-15.5-24-33-29.1-19.1-5.6-39.3 1.1-50.9 15.8-11.6-14.7-31.8-21.4-50.9-15.8-17.5 5.1-28.9 22.1-33 29.1-8.3 14.3-15.7 22.1-30.9 22.1h-.2c-13.2-.1-21.6-9.3-24-18.4-1.2-4.3-3.7-19 13.1-29 2.9-1.7 3.9-5.5 2.1-8.5-1.8-2.9-5.5-3.9-8.5-2.1-19.3 11.5-22.3 29.7-18.7 42.9 4.4 16.3 18.9 27.3 35.9 27.4z"
84
+ className="st2"
85
+ ></path>
86
+ <path d="M360 734L360.1 734 360.1 734 360 734z" className="st2"></path>
87
+ <circle cx="108.1" cy="150.1" r="6.2" className="st2"></circle>
88
+ <circle cx="90.7" cy="88" r="6.2" className="st2"></circle>
89
+ <circle cx="631.3" cy="88" r="6.2" className="st2"></circle>
90
+ <circle cx="664.5" cy="485.3" r="6.2" className="st2"></circle>
91
+ <circle cx="639.6" cy="627.1" r="6.2" className="st2"></circle>
92
+ <circle cx="599.8" cy="644.8" r="6.2" className="st2"></circle>
93
+ <path
94
+ d="M231.9 111.2c0 9.2 7.5 16.7 16.7 16.7s16.7-7.5 16.7-16.7-7.5-16.7-16.7-16.7c-9.2-.1-16.7 7.4-16.7 16.7zm16.7-4.4c2.4 0 4.4 2 4.4 4.4 0 2.4-2 4.4-4.4 4.4-2.4 0-4.4-2-4.4-4.4 0-2.4 2-4.4 4.4-4.4zM473.6 127.9c9.2 0 16.7-7.5 16.7-16.7s-7.5-16.7-16.7-16.7-16.7 7.5-16.7 16.7 7.5 16.7 16.7 16.7zm0-21.1c2.4 0 4.4 2 4.4 4.4 0 2.4-2 4.4-4.4 4.4-2.4 0-4.4-2-4.4-4.4 0-2.4 2-4.4 4.4-4.4zM376.7 121.6c-3.2 1.2-4.8 4.7-3.6 7.9 1.2 3.2 4.7 4.8 7.9 3.7 1-.4 25-8.4 43.4 20.2 1.2 1.8 3.2 2.8 5.2 2.8 1.1 0 2.3-.3 3.3-1 2.9-1.8 3.7-5.7 1.9-8.5-19.2-29.7-46.4-29.4-58.1-25.1zM343.3 121.6c-.9-.3-9.1-3.2-20.3-1.5-10.4 1.5-25.3 7.4-37.7 26.7-1.8 2.9-1 6.7 1.9 8.5 1 .7 2.2 1 3.3 1 2 0 4-1 5.2-2.8 18.3-28.6 42.3-20.6 43.4-20.2 3.2 1.2 6.7-.5 7.9-3.7 1.2-3.2-.5-6.8-3.7-8zM627.8 138.5l30.1-34.2v49.3c0 3.4 2.8 6.2 6.2 6.2s6.2-2.8 6.2-6.2V88c0-2.6-1.6-4.9-4-5.8-2.4-.9-5.1-.2-6.8 1.7l-40.9 46.5c-2.3 2.6-2 6.5.6 8.7 2.4 2.3 6.3 2 8.6-.6zM56.8 159.9c3.4 0 6.2-2.8 6.2-6.2v-49.3l30.1 34.2c2.3 2.6 6.2 2.8 8.7.6 2.6-2.3 2.8-6.2.6-8.7L61.5 83.9c-1.7-1.9-4.4-2.6-6.8-1.7-2.4.9-4 3.2-4 5.8v65.7c0 3.4 2.7 6.2 6.1 6.2zM493.4 166c-2.9-.2-5.6 1.8-6.3 4.6-.7 2.9.7 5.9 3.3 7.1 9.8 4.6 18.7 6.4 26.7 6.4 15.3 0 27.5-6.7 36-13.7 13.6-11.2 20.6-25.3 20.9-25.9 1.4-2.9.4-6.4-2.4-8-6.3-3.7-17.2-6-33.8 4.1-8.3 5.1-14.7 11.2-15.8 12.3-15.2 13.4-27.9 13.1-28.6 13.1zm36.9-3.9l.3-.3c4.7-4.7 18-15.6 28.4-16.1-3 4.3-7.5 10.1-13.6 15.2-9 7.4-18.6 11-28.8 10.8 4.2-2.2 8.9-5.4 13.7-9.6zM151.4 136.5c-2.8 1.6-3.8 5.1-2.4 8 .3.6 7.3 14.7 20.9 25.9 8.5 7 20.6 13.7 36 13.7 8.1 0 17-1.8 26.7-6.4 2.7-1.3 4-4.2 3.3-7.1-.7-2.9-3.3-4.8-6.3-4.7-.5 0-13.3.4-28.5-13-1.1-1.1-7.5-7.2-15.8-12.3-16.6-10-27.6-7.7-33.9-4.1zm41.4 25.6c4.7 4.2 9.4 7.3 13.7 9.6-21.6.2-35.9-16.3-42.4-26 10.4.5 23.7 11.4 28.4 16.1l.3.3z"
95
+ className="st2"
96
+ ></path>
97
+ <path
98
+ d="M671.8 664.6c-6.2-5.2-13-8.2-19.3-9.9 2.4-1.8 4.7-3.9 6.7-6.2 15.3-18 15.4-44.5.2-61.7-2.3-2.6-6.2-2.8-8.7-.5-2.6 2.3-2.8 6.2-.5 8.7 11.1 12.6 10.9 32.1-.4 45.5-9.2 10.8-26.7 13.4-31.9 14-15.7 1.7-33.3 5.3-42.8 26.8-1.5 3.3-2.4 7-2.6 11-2.2-.7-4.6-1.1-7-1.1-12.5 0-22.7 10.2-22.7 22.7 0 8.6 4.8 16.1 11.9 19.9-2.1 1.9-4.1 4-5.9 6.4-21-28.3-54.6-46.1-91.6-46.1-5.3 0-10.6.4-15.7 1.1 30.4-9.3 58.7-23.8 84.5-43 33.3-24.9 61-57.4 80-93.9 20-38.4 30.1-79.9 30.1-123.1v-.8-.2-.3c-.2-35.1-8-66.7-19.1-93.9 4.1.8 8 1.1 11.5 1.1 25.9 0 37.3-17.8 38.5-19.9 5.6-9.4 6.5-20.8 3.3-31.1.1-.3.1-.7.1-1.1V176.3c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2V271c-10.5-9.1-25.7-10.1-32-10.1-12.2.1-19.8-1.8-25.4-11.4-4.7-8.1-2-16.5 2.7-21.3 5.9-6 14.3-6.8 22.5-2.3 3 1.6 6.8.6 8.4-2.4 1.6-3 .6-6.8-2.4-8.4-13-7.2-27.6-5.4-37.3 4.4-9.6 9.8-11.4 24.3-4.6 36.1 8.9 15.3 22.4 17.5 35.7 17.5h.5c4 0 16.9.6 24.3 7.6 9.6 9.1 12.1 23.4 5.8 34 0 0-.1.1-.1.2-.5.9-12.4 21.1-45.6 10.5-10-21.2-21.6-39.2-32.4-53.6l-4.9 3.7 4.9-3.8-2-2.6c-21.3-35.7 3.3-73.7 16.1-89.8l7.2-8.2c2.2-2.6 2-6.5-.6-8.7-2.5-2.1-6.1-2-8.4.3-.2.2-1.3 1.3-3 3.2-11.1 11.3-54.5 51.3-96.6 30.4l-1.2-.8-.6-.4c-37.7-20.3-74.9-32-110.4-35-4.6-10.5-10.7-18.5-18.4-18.5-7.8 0-13.9 8.1-18.6 18.8-49.7 2.2-111.5 34.3-114.1 35.6-42.3 21.3-85.9-18.9-97-30.2-1.7-1.9-2.9-3-3-3.2-2.3-2.3-5.9-2.4-8.4-.3-2.6 2.2-2.8 6.1-.6 8.7l7.7 8.7c4.5 5.6 10.2 13.7 15 23.4 12 24.3 12.2 46.4.7 65.8-14.3 17.8-25.9 36.5-34.8 56.2-33.5 10.9-45.5-9.5-46-10.4 0-.1-.1-.1-.1-.2-6.3-10.6-3.8-24.9 5.8-34 7.4-7 20.3-7.6 24.3-7.6h.1c13.4 0 27.2-2.1 36.1-17.5 6.8-11.8 5-26.4-4.6-36.1-9.7-9.9-24.3-11.6-37.3-4.4-3 1.6-4.1 5.4-2.4 8.4 1.6 3 5.4 4.1 8.4 2.4 8.3-4.5 16.7-3.7 22.5 2.3 4.7 4.8 7.3 13.2 2.7 21.3-5.5 9.5-13 11.4-25 11.4h-.4c-5.5 0-18.3.8-28.5 7.4v-90.3c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2v104c-6.8 12.2-7.2 27.1-.2 39.1.7 1.3 5 8.5 14.6 13.9 5.5 3.1 13.4 6 23.9 6 3.8 0 8-.4 12.5-1.3-10.8 29-16.2 60.2-16.4 94.2v1.1c0 61.4 21.6 121.7 60.8 169.8 34.7 42.6 81.9 74.2 134.2 90.3-5.5-.8-11.1-1.2-16.7-1.2-36.7 0-70 17.5-91 45.4-1.7-2.2-3.6-4.3-5.7-6.1 6.6-4 11.1-11.2 11.1-19.5 0-12.5-10.2-22.7-22.7-22.7-2.3 0-4.5.4-6.6 1-.3-3.9-1.2-7.6-2.6-10.9-9.6-21.5-27.1-25.1-42.8-26.8-5.2-.6-22.7-3.2-31.9-14-11.6-13.1-11.8-32.6-.7-45.2 2.3-2.6 2-6.5-.5-8.7-2.6-2.3-6.5-2-8.7.5-15.1 17.2-15 43.7.2 61.7 2 2.4 4.3 4.4 6.7 6.2-6.3 1.7-13.1 4.8-19.3 9.9-14.7 12.1-22.2 32.3-22.4 59.8-.5 2.5.6 5.1 2.8 6.5 1 .6 2.1.9 3.2.9.4 0 .9-.1 1.3-.2h.1c.2 0 .3-.1.5-.2.3-.1.7-.2 1-.4.1 0 .1-.1.2-.1 1-.6 1.9-1.4 2.5-2.4 2.4-3.1 12.3-7 20.5-8.7 32.1-7 38.8-28.7 37.8-39.1-.3-3.4-3.3-5.9-6.7-5.6-3.4.3-5.9 3.3-5.6 6.7 0 .1.1 1.9-.5 4.6-1.5 6.2-7 16.9-27.6 21.4h-.2c-2.4.5-9.6 2.2-16.3 5.3 1.8-17.8 7.5-30.8 17.2-38.9 14.9-12.4 34.6-8.9 34.8-8.8.7.1 1.3.1 1.9 0 3.3.7 6.1 1.1 8.2 1.3 16.5 1.8 26.6 5.4 32.9 19.5 4.9 11.1-1.4 23.9-9.9 30.3-4.3 3.3-15.8 9.8-28.7-.8-2.6-2.2-6.5-1.8-8.7.8-2.2 2.6-1.8 6.5.8 8.7 5.8 4.8 12.3 7.6 19 8.4-8.6 7-14.4 15.8-17 20.4-8.4 14.5-15.2 22.3-26.5 22.4V733c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2v50.2c0 2.5 1.5 4.6 3.6 5.6 1.1.8 2.4 1.4 3.8 1.4h144c2.2 0 4-1.1 5.2-2.8.8-.8 1.5-1.8 1.8-3 5.7-22.1 25.6-37.5 48.4-37.5 20.4 0 38.5 12.4 46.2 30.9h-13.2c-5.4-13.3-18.4-22.2-33.1-22.2-16.1 0-30.3 10.9-34.6 26.4-.9 3.3 1.1 6.7 4.3 7.6 3.3.9 6.7-1.1 7.6-4.3 2.8-10.2 12.1-17.3 22.6-17.3 7.8 0 14.8 3.8 19.1 9.8h-3.6c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h12.5c.2 0 .5.1.7.1.3 0 .6 0 .8-.1h24.8c3.4 0 6.2-2.8 6.2-6.2 0-.3 0-.6-.1-.9.1-.8.1-1.7-.1-2.6-7.3-27.1-32.1-46-60.2-46-27.2 0-51.1 17.6-59.4 43.3h-32.3c2.6-8.3 6.1-16 10.5-23.2.3-.4.5-.8.8-1.2 18.3-28.7 50.3-47.1 85.8-47.1 21 0 41.2 6.4 58.3 18.4.5.3 1 .6 1.5.7 2.6 3.1 5.2 6.4 7.7 9.8.6.8 1.1 1.6 1.7 2.4-.6 12.7 6.3 26 20.6 39.6.5 1.5 1 2.8 1.3 3.8v1.3c0 3.4 2.8 6.2 6.2 6.2 2.9 0 5.2-1.9 5.9-4.6 0-.1.9-3.1 2.7-8.1 12.9-12.6 19.3-24.9 19.2-36.8.8-1.2 1.7-2.5 2.6-3.7 2.8-3.8 5.7-7.5 8.7-11 17-11.8 36.9-18 57.7-18 44.8 0 84 29.2 97 71.5h-32.3c-8.2-25.7-32.1-43.3-59.4-43.3-28.1 0-52.8 18.9-60.2 46-.3 1-.3 2 0 3v.5c0 3.4 2.8 6.2 6.2 6.2h54.2c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2h-19.7c4.3-6 11.3-9.8 19.1-9.8 10.7 0 20 7.2 22.7 17.6.7 2.8 3.2 4.6 6 4.6.5 0 1-.1 1.5-.2 3.3-.8 5.3-4.2 4.5-7.5-4.1-15.8-18.3-26.9-34.7-26.9-14.6 0-27.6 8.9-33.1 22.2h-12.5c7.6-18.5 25.8-30.9 46.2-30.9 22.8 0 42.7 15.4 48.4 37.5.1.5.4 1 .6 1.5.8 2.5 3.1 4.3 5.9 4.3H664c3.4 0 6.2-2.8 6.2-6.2v-.4-1.6c.1-.6.1-1.2.1-1.8 0-.1 0-.2-.1-.3V733c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2v42c-10.4-.8-16.9-8.5-24.9-22.3-2.6-4.4-8-12.7-16-19.5 5.5-1.2 10.8-3.8 15.7-7.9 2.6-2.2 3-6.1.8-8.7-2.2-2.6-6.1-3-8.7-.8-12.8 10.6-24.3 4.1-28.7.8-8.5-6.4-14.8-19.3-9.9-30.3 6.3-14.1 16.4-17.8 32.9-19.5 2.1-.2 4.9-.6 8.2-1.3.6.1 1.3.1 2 0 .2 0 19.7-3.6 34.7 8.8 9.8 8.1 15.6 21.1 17.3 39-6.8-3.2-14.1-4.9-16.4-5.4h-.2c-20.5-4.5-26.1-15.1-27.6-21.3-.6-2.6-.6-4.4-.5-4.6.3-3.4-2.2-6.4-5.6-6.7-3.4-.3-6.4 2.2-6.7 5.6-1 10.5 5.7 32.1 37.9 39.1 8.3 1.8 18.8 5.9 20.7 9 0 0 0 .1.1.1.3.4.6.8.9 1.1.1.1.2.1.3.2.3.2.6.5.9.6.1.1.3.2.4.2.3.2.6.3.9.4.1 0 .3.1.4.1.4.1.9.2 1.4.2.4 0 .7 0 1.1-.1.1 0 .2 0 .3-.1.3-.1.6-.2 1-.3h.1c.3-.1.5-.3.8-.4l.1-.1c.2-.1.4-.3.5-.4.1-.1.3-.2.4-.4l.4-.4c.1-.2.3-.3.4-.5.1-.2.2-.3.3-.5.1-.2.2-.3.3-.5.1-.2.1-.4.2-.6.1-.2.1-.4.2-.6 0-.2.1-.4.1-.5 0-.2.1-.4.1-.7v-.1c-.1-28.3-7.7-48.8-22.6-61.1zM152.9 777.7H87.8c5.5-5.6 9.4-12.3 12.4-17.5 2.6-4.5 12.2-19.5 25.8-23.4 16-4.7 31 .8 38.4 13.5-4.9 8.5-8.8 17.7-11.5 27.4zm1.7-53.7c-5.7 0-10.3-4.6-10.3-10.3 0-5.7 4.6-10.3 10.3-10.3s10.3 4.6 10.3 10.3c0 5.7-4.7 10.3-10.3 10.3zm366.6-78.1l.9 1.1-.9-1.1zm.2-6.2c-58.4-6.8-100.6 18.3-125.8 40.5-10.9 9.6-19.5 19.5-26 27.9-1.2-.8-2.3-1.6-3.3-2.1v-17.6c47.3-47.5 94.3-61.7 125.5-65.2 20.7-2.3 37.4-.4 47.4 1.5-5.7 5.3-11.6 10.3-17.8 15zm73.3-87.2c-6 11.5-12.9 22.5-20.5 33.1-7.9-2.5-17.8-4.8-29.7-5.9 26.5-33.6 43.3-73.7 48.7-116 8.6-1 20.5-4.7 29.6-10.6-2.4 34.7-11.8 68.1-28.1 99.4zm-42.1-111.6l7.2-.3c2.4 10.7 10.5 19.3 21.1 22.2-5.6 42.8-23.4 83.2-51.8 116.2-13.7 0-29.6 1.6-47.6 5.5 42-34.2 69.4-85.7 71.1-143.6zm-117.5 158c-4 1.6-6.8 2.9-8.2 3.5-16.6 6.6-34.4 10.9-53 12.3l165.9-165.9c-5 66.8-46.6 123.4-104.7 150.1zm188.3-164.7c-.2 5.6-15.5 14.7-29 16.9-1.9.3-3.8.5-5.6.5-2.4 0-4.7-.5-6.8-1.4-6.3-2.7-10.7-8.9-10.7-16.1 0-7.2 4.4-13.4 10.7-16.1 2.1-.9 4.4-1.4 6.8-1.4 1.8 0 3.7.2 5.6.5 13.5 2.2 28.7 11.3 29 16.8v.3zM565.5 276l2.6 3.5c22.7 30.3 49.3 77.2 54.4 135.6-9-5.8-20.8-9.5-29.3-10.5-6.4-50.6-28.9-96.3-62.2-131.6 1.4-2.9 2.2-6.2 2.2-9.6 0-4.6-1.4-8.9-3.7-12.4l28.4-32.4c-5.4 20.6-2.8 40.1 7.6 57.4zm-82.9-70.1l1.3.9.7.4c9.9 5 20.5 7.5 31.5 7.5 11.6 0 23.7-2.8 35.9-8.4l-32 36.5c-2.9-1.4-6.1-2.1-9.6-2.1-4.5 0-8.6 1.3-12.1 3.5-31.5-23-68.8-38.3-109.4-43.3-1-7.3-3-17.7-6-27.9 32.1 3.6 65.6 14.6 99.7 32.9zm38.2 57.5c0 4.5-3 8.4-7.1 9.8-1 .3-2.1.5-3.2.5h-1c-4.6-.4-8.3-3.9-9.1-8.3-.1-.6-.2-1.3-.2-1.9 0-.7.1-1.3.2-2 .9-4.5 4.7-8 9.4-8.3H511.1c4.6.3 8.5 3.6 9.5 8 .1.6.2 1.1.2 1.7-.1.1 0 .3 0 .5zm-131.4-49.9c37.2 4.9 71.6 19.1 100.7 40.1-1.5 3-2.3 6.3-2.3 9.9 0 4.5 1.3 8.6 3.6 12.2l-49.8 56.8c-2.3 2.6-2 6.5.6 8.7 1.2 1 2.6 1.5 4.1 1.5 1.7 0 3.4-.7 4.7-2.1l49.7-56.7c3 1.5 6.3 2.3 9.9 2.3 4.6 0 8.8-1.4 12.3-3.7 31 33.2 51.9 75.8 58.1 123-10.7 3-19 11.8-21.2 22.8l-7.1.3c-1.5-45.7-19.2-89.3-50.1-123.2-2.3-2.5-6.2-2.7-8.7-.4-2.5 2.3-2.7 6.2-.4 8.7 27.2 29.8 43.4 67.6 46.5 107.6L473.5 355c-2.4-2.4-6.3-2.4-8.7 0-2.4 2.4-2.4 6.3 0 8.7l71.4 71.4-176 176-176-176 70.8-70.8c2.4-2.4 2.4-6.3 0-8.7-2.4-2.4-6.3-2.4-8.7 0l-65.7 65.7c3.5-45.5 23.9-86.4 55-116.2l31 35.4c1.2 1.4 2.9 2.1 4.7 2.1 1.4 0 2.9-.5 4.1-1.5 2.6-2.3 2.8-6.2.6-8.7l-31.1-35.5c28-23.4 63.1-38.5 101.6-41.4l-52.8 52.3c-2.4 2.4-2.4 6.3 0 8.7 1.2 1.2 2.8 1.8 4.4 1.8 1.6 0 3.1-.6 4.4-1.8l58-57.4 56.3 56.3c2.4 2.4 6.3 2.4 8.7 0 2.4-2.4 2.4-6.3 0-8.7l-51.2-51.2c31.7 2.4 61.9 13 88.2 31.1 2.8 1.9 6.7 1.2 8.6-1.6 1.9-2.8 1.2-6.7-1.6-8.6-30.4-20.9-65.8-32.5-102.8-33.6v-4.4c11.6-2.8 20.9-12.7 22.7-24.9zm-180.7 74.3c3.5 0 6.8-.8 9.7-2.2l8.9 10.2c-35.3 33.7-57.8 80.6-59.6 132.7l-5-.3c-2.4-11.7-11.5-20.9-23.2-23.3 6.1-46.3 26.5-88.1 56.5-120.9 3.7 2.4 8 3.8 12.7 3.8zm-10.3-22.6c0-.5 0-.9.1-1.4 0-.3.1-.5.1-.8.9-4.4 4.7-7.8 9.3-8.1h.7c4.7 0 8.7 3.2 9.9 7.6.2.9.4 1.8.4 2.7 0 .7-.1 1.4-.2 2.1-.9 4.4-4.7 7.8-9.3 8.1h-.8c-1.3 0-2.6-.3-3.7-.7-3.7-1.4-6.5-5.2-6.5-9.5zm-35.8 175.4l5.1.3c1.7 58 29.2 109.6 71.3 143.8-18.1-4-34-5.6-47.8-5.7-28.2-32.9-46.1-73.1-51.7-115.7 11.5-2.4 20.6-11.3 23.1-22.7zm17.9 8.2l165.9 165.9C258 608 187.2 537.2 180.5 448.8zm162.7-249c2.7-18.7 11.9-43.7 16.7-45.7 5.5 2.1 14 28 16.6 45.6.5 3.5.8 6.7.8 9.3 0 1.1-.1 2.1-.3 3.1-1.5 8.1-8.6 14.3-17.2 14.3s-15.7-6.2-17.2-14.3c-.2-1-.3-2.1-.3-3.1.1-2.7.4-5.8.9-9.2zm10.8 38.5v4.3c-44.6 1.4-85.4 18.1-117.4 44.9l-8.8-10.1c2.3-3.5 3.7-7.8 3.7-12.3 0-3.8-1-7.4-2.6-10.5 29.3-21.5 64-36 101.7-41.1 1.7 12.4 11.2 22.4 23.4 24.8zm-152.7-23.6c11 0 21.6-2.5 31.6-7.5.6-.3 57.7-30 103.9-34-3 10.1-5 20.6-6 27.8-41.1 5.1-79 21-110.7 44.6-3.4-2-7.2-3.1-11.4-3.1-3.5 0-6.8.8-9.7 2.2l-33.6-38.3c12.3 5.5 24.3 8.3 35.9 8.3zm-49.9 61.9l.5-.7c10.4-17.2 13-36.8 7.8-57.4l30 34.3c-2.3 3.5-3.7 7.8-3.7 12.3 0 3.3.7 6.4 2 9.3-32.7 35.2-54.7 80.4-61 130.4-8.9 1.4-20.7 5.2-29.6 10.9 3.5-52.8 21.2-98.5 54-139.1zM96.9 434c.2-5.8 16.3-13.8 29-16.4 2.8-.6 5.4-.9 7.6-.9 1.7 0 3.2.2 4.8.7 7.3 2.1 12.7 8.8 12.7 16.8s-5.4 14.7-12.7 16.8c-1.5.4-3.1.7-4.8.7-2.3 0-4.9-.3-7.6-.9-12.7-2.7-28.8-10.7-29-16.5v-.3zm.6 18.4c8.9 5.8 20.8 9.6 29.6 11 5.3 42.4 22.1 82.6 48.7 116.2-11.9 1.1-21.8 3.3-29.8 5.8-28.7-39.4-45.3-84.9-48.5-133zM154.9 597c-.3-.4-.6-.7-.9-1.1 30.1-8.3 63-3.9 86.1 1.6 27.9 6.7 48.3 16.4 48.5 16.5l.1-.2c22.1 8.8 46.2 13.7 71.4 13.7 25.1 0 49.1-4.8 71.1-13.6l.6-.3c2.6-1.1 5.3-2.2 7.8-3.4 8.5-3.5 22.8-8.7 40-12.8 23.3-5.6 56.3-10 86.4-1.6-5.2 6.4-10.6 12.5-16.4 18.4-8.4-2.3-29.8-6.7-58.7-3.6-31.4 3.4-77.6 16.8-124.8 60.4v-10.9c0-3.4-2.8-6.2-6.2-6.2s-6.2 2.8-6.2 6.2v10.3c-46.9-43.1-92.9-56.4-124.1-59.8-29.6-3.2-51.3 1.6-59.2 3.8-5.2-5.4-10.5-11.3-15.5-17.4zm26.3 27.8c10-2 26.9-4 48-1.6 55.5 6.2 98.1 37.9 124.8 64.5v18.1c-.9.5-1.9 1.1-3 1.9-6.5-8.3-15-18-25.7-27.4-25.2-22.3-67.6-47.5-126.2-40.5v.1c-6.2-4.8-12.2-9.8-17.9-15.1zm155.3 98c-11.7-15-24.5-26.3-37.3-34.8l.1-.3c-.3-.1-.6-.2-.9-.2-21.3-13.9-42.7-20-59.9-22.5-8.1-4.2-16.1-8.9-23.8-14 37.7-1.1 71.9 11.7 102.1 38.2 10.4 9.1 18.6 18.5 24.8 26.6-1.9 2.1-3.6 4.4-5.1 7zm29.9 37.5c-1.5 1.8-3.1 3.6-4.9 5.4-.4.4-.9.9-1.4 1.3l-.1.1-.1.1v-.2c-.2-.2-.5-.4-.7-.7-2-1.9-3.7-3.8-5.3-5.7-7.3-8.7-10.5-16.8-9.4-24.2.1-.6.2-1.2.4-1.8.8-3.2 2.3-6 4.1-8.4 1.5-2 3.2-3.7 4.9-5.2 1.5-1.3 3-2.4 4.3-3.3.6-.4 1.1-.7 1.6-1 0 0 .1 0 .1-.1h.1c.7.4 1.4.9 2.3 1.5 1.2.8 2.6 1.9 4 3.1 1.8 1.6 3.6 3.5 5.1 5.6 1.8 2.6 3.3 5.5 3.9 8.8 0 .2.1.5.2.7 1.1 7.3-2 15.3-9.1 24zm24.4-45.1c-.2.2-.4.4-.5.6-2.3 2.6-4.4 5.2-6.3 7.7-1.5-2.6-3.2-5-5-7.1 6.2-8.1 14.6-17.8 25.2-27.1 30-26.4 64.1-39.2 101.5-38.3-7.8 5.1-15.8 9.9-24 14.1-42.8 6.5-72.1 28.7-90.9 50.1zm174.5-11.8c5.7 0 10.3 4.6 10.3 10.3 0 5.7-4.6 10.3-10.3 10.3s-10.3-4.6-10.3-10.3c0-5.6 4.6-10.3 10.3-10.3zm31.2 32.1c13.6 4 23.2 18.9 25.8 23.4 3.2 5.6 7.5 13 13.8 18.8H567c-2.6-9.4-6.3-18.3-11-26.5 7.6-13.6 24.6-20.4 40.5-15.7z"
99
+ className="st2"
100
+ ></path>
101
+ <path
102
+ d="M69.6 301.1c0 10.1 8.2 18.4 18.4 18.4s18.4-8.2 18.4-18.4c0-10.1-8.2-18.4-18.4-18.4s-18.4 8.3-18.4 18.4zm24.4 0c0 3.3-2.7 6-6 6s-6-2.7-6-6 2.7-6 6-6 6 2.7 6 6zM648.7 301.1c0-10.1-8.2-18.4-18.4-18.4-10.1 0-18.4 8.2-18.4 18.4 0 10.1 8.2 18.4 18.4 18.4s18.4-8.2 18.4-18.4zm-24.4 0c0-3.3 2.7-6 6-6s6 2.7 6 6-2.7 6-6 6c-3.3.1-6-2.6-6-6zM666.4 346.9c-2.3-.9-5-.4-6.8 1.4-8.1 8.3-21.4 8-21.6 8h-.2c-3.3 0-6 2.6-6.2 5.9-.1 3.4 2.5 6.3 5.9 6.4.6 0 10.4.3 20.4-4.3v100.9c0 3.4 2.8 6.2 6.2 6.2s6.2-2.8 6.2-6.2V352.6c-.1-2.5-1.6-4.8-3.9-5.7zM55.7 471.4c3.4 0 6.2-2.8 6.2-6.2V364.3c10 4.6 19.8 4.3 20.4 4.3 3.4-.1 6.1-3 5.9-6.4-.1-3.4-3-6.1-6.4-5.9-.1 0-13.5.3-21.6-8-1.8-1.8-4.4-2.3-6.8-1.4-2.3.9-3.8 3.2-3.8 5.7v112.7c-.1 3.4 2.7 6.1 6.1 6.1zM671.3 574.3c0-3.4-2.8-6.2-6.2-6.2h-40c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h40c3.4 0 6.2-2.7 6.2-6.2zM629.8 598c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2h-15.4c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h15.4zM644.8 609.4c0-3.4-2.8-6.2-6.2-6.2h-38.2c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h38.2c3.4 0 6.2-2.7 6.2-6.2zM620.6 627.1c0-3.4-2.8-6.2-6.2-6.2h-29.9c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h29.9c3.4 0 6.2-2.8 6.2-6.2zM565.1 638.6c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h17c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2h-17zM665.1 532.8h-22.3c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h22.3c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2zM665.1 550.5H634c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h31.1c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2zM665.1 497.5h-9.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h9.9c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2zM665.1 515.2h-15.2c-3.4 0-6.2 2.8-6.2 6.2s2.8 6.2 6.2 6.2h15.2c3.4 0 6.2-2.8 6.2-6.2s-2.8-6.2-6.2-6.2z"
103
+ className="st2"
104
+ ></path>
105
+ <circle cx="55.5" cy="485.6" r="6.2" className="st2"></circle>
106
+ <circle cx="80.5" cy="627.3" r="6.2" className="st2"></circle>
107
+ <circle cx="120.3" cy="645" r="6.2" className="st2"></circle>
108
+ <path
109
+ d="M54.9 580.7h40c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2h-40c-3.4 0-6.2 2.8-6.2 6.2 0 3.5 2.8 6.2 6.2 6.2zM105.6 585.9H90.2c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h15.4c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2zM119.6 603.5H81.4c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h38.2c3.4 0 6.2-2.8 6.2-6.2 0-3.5-2.8-6.2-6.2-6.2zM135.5 621.1h-29.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2h29.9c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2zM131.7 645c0 3.4 2.8 6.2 6.2 6.2h17c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2h-17c-3.4 0-6.2 2.8-6.2 6.2zM54.9 545.4h22.3c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2H54.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2zM54.9 563.1H86c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2H54.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2zM54.9 510.1h9.9c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2h-9.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.4 2.8 6.2 6.2 6.2zM54.9 527.7h15.2c3.4 0 6.2-2.8 6.2-6.2 0-3.4-2.8-6.2-6.2-6.2H54.9c-3.4 0-6.2 2.8-6.2 6.2 0 3.5 2.8 6.2 6.2 6.2zM360 767.1c.1-.1 0-.1 0-.2v.2zM641.2 202.7c.1 0 .1 0 0 0 2.8 0 5.3-1.9 6-4.7 2.2-8.8 1.3-16.3-2.9-22.5-6.7-10-19-11.9-20.4-12.1-3.2-.4-6.2 1.6-6.9 4.8-2.3 10.5-1 18.9 4 25.1 7.4 9 19 9.3 20.2 9.4zm-7-20.2c1.2 1.9 1.9 4.1 1.9 6.7-1.8-.7-3.8-1.8-5.2-3.6-1.6-2-2.4-4.6-2.4-7.9 2 1 4.2 2.6 5.7 4.8zM601 113.3c-6.7-10-19-11.9-20.4-12.1-3.2-.4-6.2 1.6-6.9 4.8-2.3 10.5-1 18.9 4 25.1 7.2 9 18.8 9.3 20.1 9.3 2.8 0 5.3-1.9 6-4.7 2.3-8.6 1.4-16.2-2.8-22.4zm-13.5 10.1c-1.6-2-2.4-4.6-2.4-7.9 2.1 1 4.3 2.6 5.7 4.8 1.2 1.9 1.9 4.1 1.9 6.7-1.8-.7-3.8-1.8-5.2-3.6zM97.3 163.4c-1.4.2-13.6 2.1-20.4 12.1-4.1 6.2-5.1 13.7-2.9 22.5.7 2.7 3.2 4.7 6 4.7 1.3 0 12.9-.3 20.1-9.3 5-6.2 6.3-14.7 4-25.1-.6-3.2-3.6-5.3-6.8-4.9zm-6.7 22.2c-1.4 1.8-3.4 2.9-5.3 3.6 0-2.6.7-4.9 1.9-6.7 1.5-2.2 3.7-3.8 5.7-4.8 0 3.3-.8 5.9-2.3 7.9zM139.7 101.2c-1.4.2-13.6 2.1-20.4 12.1-4.1 6.2-5.1 13.7-2.9 22.5.7 2.7 3.2 4.7 6 4.7 1.3 0 12.9-.3 20.1-9.3 5-6.2 6.3-14.7 4-25.1-.7-3.2-3.6-5.3-6.8-4.9zm-6.8 22.2c-1.4 1.8-3.4 2.9-5.3 3.6 0-2.6.7-4.9 1.9-6.7 1.5-2.2 3.7-3.8 5.7-4.8 0 3.3-.7 5.9-2.3 7.9zM555.1 392c.4 3.2 3 5.5 6.1 5.5h.7c3.4-.4 5.8-3.5 5.4-6.9-6.2-54-43.1-92.2-44.7-93.8-2.4-2.4-6.3-2.5-8.7-.1-2.4 2.4-2.5 6.3-.1 8.7.4.4 35.6 36.9 41.3 86.6zM159.1 397.4h.7c3.1 0 5.8-2.3 6.1-5.5 5.7-49.7 40.9-86.2 41.2-86.5 2.4-2.4 2.3-6.4-.1-8.7-2.4-2.4-6.4-2.4-8.7.1-1.6 1.6-38.4 39.8-44.7 93.8-.3 3.4 2.1 6.4 5.5 6.8z"
110
+ className="st2"
111
+ ></path>
112
+ </g>
113
+ </svg>;
114
 
115
  class KadenceImporter extends Component {
116
  constructor() {
118
  this.runAjax = this.runAjax.bind( this );
119
  this.runPluginInstall = this.runPluginInstall.bind( this );
120
  this.focusMode = this.focusMode.bind( this );
121
+ this.fullFocusMode = this.fullFocusMode.bind( this );
122
+ this.selectedMode = this.selectedMode.bind( this );
123
+ this.selectedFullMode = this.selectedFullMode.bind( this );
124
+ this.backToDash = this.backToDash.bind( this );
125
+ this.saveConfig = this.saveConfig.bind( this );
126
  this.state = {
127
  category: 'all',
128
  activeTemplate: '',
129
  colorPalette: '',
130
+ fontPair: '',
131
  search: null,
132
  isFetching: false,
133
  isImporting: false,
134
+ isSelected: false,
135
+ response:'',
136
+ isPageSelected: false,
137
+ starterSettings: ( kadenceStarterParams.starterSettings ? JSON.parse( kadenceStarterParams.starterSettings ) : {} ),
138
+ selectedPage: 'home',
139
  progress: '',
140
  focusMode: false,
141
  finished: false,
142
+ overrideColors: false,
143
+ overrideFonts: false,
144
+ isOpenCheckColor: false,
145
+ isOpenCheckFont: false,
146
+ isOpenCheckPast: false,
147
+ removePast: false,
148
  templates: ( kadenceStarterParams.templates ? kadenceStarterParams.templates : [] ),
149
+ etemplates: ( kadenceStarterParams.etemplates ? kadenceStarterParams.etemplates : [] ),
150
  palettes: ( kadenceStarterParams.palettes ? kadenceStarterParams.palettes : [] ),
151
+ fonts: ( kadenceStarterParams.fonts ? kadenceStarterParams.fonts : [] ),
152
+ logo: ( kadenceStarterParams.logo ? kadenceStarterParams.logo : '' ),
153
+ hasContent: ( kadenceStarterParams.has_content ? kadenceStarterParams.has_content : false ),
154
+ hasPastContent: ( kadenceStarterParams.has_previous ? kadenceStarterParams.has_previous : false ),
155
+ isSaving: false,
156
  };
157
+ }
158
+ saveConfig( setting, settingValue ) {
159
+ this.setState( { isSaving: true } );
160
+ const config = ( kadenceStarterParams.starterSettings ? JSON.parse( kadenceStarterParams.starterSettings ) : {} );
161
+ if ( ! config[ setting ] ) {
162
+ config[ setting ] = '';
163
+ }
164
+ config[ setting ] = settingValue;
165
+ const settingModel = new wp.api.models.Settings( { kadence_starter_templates_config: JSON.stringify( config ) } );
166
+ settingModel.save().then( response => {
167
+ this.setState( { starterSettings: config, isSaving: false } );
168
+ kadenceStarterParams.starterSettings = JSON.stringify( config );
169
  } );
170
  }
171
  capitalizeFirstLetter( string ) {
172
  return string.charAt( 0 ).toUpperCase() + string.slice( 1 );
173
  }
174
  focusMode( template_id ) {
175
+ this.setState( { activeTemplate: template_id, focusMode: true, isSelected: false } )
176
+ }
177
+ fullFocusMode( template_id ) {
178
+ this.setState( { activeTemplate: template_id, focusMode: true, isSelected: true } )
179
+ }
180
+ selectedFullMode() {
181
+ this.setState( { isSelected: true } );
182
+ }
183
+ selectedMode( page_id ) {
184
+ this.setState( { selectedPage: page_id, isPageSelected: true, isImporting: true } );
185
+ }
186
+ backToDash() {
187
+ this.setState( { isFetching: false, activeTemplate: '', overrideColors:false, overrideFonts:false, colorPalette: '', fontPair: '', focusMode: false, finished: false, isImporting: false, isSelected:false, isPageSelected:false, progress: '', selectedPage: 'home' } );
188
+ }
189
+ runPluginInstallSingle( selected, page_id ) {
190
+ this.setState( { progress: 'plugins', isFetching: true } );
191
+ var data = new FormData();
192
+ data.append( 'action', 'kadence_import_install_plugins' );
193
+ data.append( 'security', kadenceStarterParams.ajax_nonce );
194
+ data.append( 'selected', selected );
195
+ data.append( 'page_id', page_id );
196
+ this.runPageAjax( data );
197
+ }
198
+ runRemovePast( selected ) {
199
+ this.setState( { progress: 'remove', isFetching: true } );
200
+ var data = new FormData();
201
+ data.append( 'action', 'kadence_remove_past_import_data' );
202
+ data.append( 'security', kadenceStarterParams.ajax_nonce );
203
+ data.append( 'selected', selected );
204
+ this.runAjax( data );
205
  }
206
  runPluginInstall( selected ) {
207
  this.setState( { progress: 'plugins', isFetching: true } );
211
  data.append( 'selected', selected );
212
  this.runAjax( data );
213
  }
214
+ runPageAjax( data ) {
215
+ var control = this;
216
+ jQuery.ajax({
217
+ method: 'POST',
218
+ url: kadenceStarterParams.ajax_url,
219
+ data: data,
220
+ contentType: false,
221
+ processData: false,
222
+ })
223
+ .done( function( response, status, stately ) {
224
+ if ( 'undefined' !== typeof response.status && 'newAJAX' === response.status ) {
225
+ control.state.progress = 'contentNew';
226
+ control.runPageAjax( data );
227
+ } else if ( 'undefined' !== typeof response.status && 'pluginSuccess' === response.status ) {
228
+ control.setState( { progress: 'content' } );
229
+ var newData = new FormData();
230
+ newData.append( 'action', 'kadence_import_single_data' );
231
+ newData.append( 'security', kadenceStarterParams.ajax_nonce );
232
+ newData.append( 'selected', control.state.activeTemplate );
233
+ newData.append( 'page_id', control.state.selectedPage );
234
+ newData.append( 'override_colors', control.state.overrideColors );
235
+ newData.append( 'override_fonts', control.state.overrideFonts );
236
+ newData.append( 'palette', control.state.colorPalette );
237
+ newData.append( 'font', control.state.fontPair );
238
+ control.runPageAjax( newData );
239
+ } else if ( 'undefined' !== typeof response.message ) {
240
+ //jQuery( '.kadence_starter_templates_finished' ).append( '<p>' + response.message + '</p>' );
241
+ control.setState( { finished: true, hasContent:true, hasPastContent:true, isFetching: false, colorPalette: '', fontPair: '', focusMode: false, isImporting: false, isSelected:false, progress: '', response: '<p>' + response.message + '</p>' } );
242
+ } else {
243
+ //jQuery( '.kadence_starter_templates_error' ).append( '<div class="notice kadence_starter_templates_response notice-error"><p>' + response + '</p></div>' );
244
+ control.setState( { finished: true, hasContent:true, hasPastContent:true, isFetching: false, colorPalette: '', fontPair: '', focusMode: false, isImporting: false, isSelected:false, progress: '', response: '<div class="notice kadence_starter_templates_response notice-error"><p>' + response + '</p></div>' } );
245
+ }
246
+ })
247
+ .fail( function( error ) {
248
+ //jQuery( '.kadence_starter_templates_error' ).append( '<div class="notice kadence_starter_templates_response notice-error"><p>Error: ' + error.statusText + ' (' + error.status + ')' + '</p></div>' );
249
+ control.setState( { finished: true, hasContent:true, hasPastContent:true, isFetching: false, colorPalette: '', fontPair: '', focusMode: false, isImporting: false, isSelected:false, progress: '', response: '<div class="notice kadence_starter_templates_response notice-error"><p>Error: ' + error.statusText + ' (' + error.status + ')' + '</p></div>' } );
250
+ });
251
+ }
252
  runAjax( data ) {
253
  var control = this;
254
  jQuery.ajax({
285
  newData.append( 'security', kadenceStarterParams.ajax_nonce );
286
  newData.append( 'selected', control.state.activeTemplate );
287
  newData.append( 'palette', control.state.colorPalette );
288
+ newData.append( 'font', control.state.fontPair );
289
+ control.runAjax( newData );
290
+ } else if ( 'undefined' !== typeof response.status && 'removeSuccess' === response.status ) {
291
+ control.setState( { progress: 'plugins' } );
292
+ var newData = new FormData();
293
+ newData.append( 'action', 'kadence_import_install_plugins' );
294
+ newData.append( 'security', kadenceStarterParams.ajax_nonce );
295
+ newData.append( 'selected', control.state.activeTemplate );
296
  control.runAjax( newData );
297
  } else if ( 'undefined' !== typeof response.message ) {
298
+ //jQuery( '.kadence_starter_templates_finished' ).append( '<p>' + response.message + '</p>' );
299
+ control.setState( { finished: true, hasContent:true, hasPastContent:true, isFetching: false, colorPalette: '', fontPair: '', focusMode: false, isImporting: false, isSelected:false, isPageSelected:false, progress: '', response: '<p>' + response.message + '</p>' } );
300
  } else {
301
+ //jQuery( '.kadence_starter_templates_error' ).append( '<div class="notice kadence_starter_templates_response notice-error"><p>' + response + '</p></div>' );
302
+ control.setState( { finished: true, hasContent:true, hasPastContent:true, isFetching: false, colorPalette: '', fontPair: '', focusMode: false, isImporting: false, isSelected:false, isPageSelected:false, progress: '', response: '<div class="notice kadence_starter_templates_response notice-error"><p>' + response + '</p></div>' } );
303
  }
304
  })
305
  .fail( function( error ) {
306
+ //jQuery( '.kadence_starter_templates_error' ).append( '<div class="notice kadence_starter_templates_response notice-error"><p>Error: ' + error.statusText + ' (' + error.status + ')' + '</p></div>' );
307
+ control.setState( { finished: true, hasContent:true, hasPastContent:true, isFetching: false, colorPalette: '', fontPair: '', focusMode: false, isImporting: false, isSelected:false, isPageSelected:false, progress: '', response: '<div class="notice kadence_starter_templates_response notice-error"><p>Error: ' + error.statusText + ' (' + error.status + ')' + '</p></div>' } );
308
  });
309
  }
310
  render() {
319
  const catOptions = cats.map( ( item ) => {
320
  return { value: item, label: this.capitalizeFirstLetter( item ) }
321
  } );
322
+ const KadenceImportSingleMode = () => {
323
+ const itemArray = ( this.state.starterSettings['builderType'] === 'elementor' ? this.state.etemplates.filter( ( { slug } ) => slug === this.state.activeTemplate ) : this.state.templates.filter( ( { slug } ) => slug === this.state.activeTemplate ) );
324
  const item = itemArray[0];
 
 
 
325
  return (
326
+ <div className="kst-grid-single-site">
327
+ <div className="kst-import-selection-item">
328
+ <div className="kst-import-selection">
329
+ <img src={ item.pages[this.state.selectedPage].image } alt={ item.pages[this.state.selectedPage].title } />
 
 
 
 
330
  </div>
331
+ </div>
332
+ <div className="kst-import-selection-options">
333
+ <div className="kst-import-single-selection-options-wrap">
334
+ <div className="kst-import-selection-title">
335
+ <h2>{ __( 'Template:', 'kadence-starter-templates' ) } <span>{ item.name }</span><br></br> { __( 'Selected Page:', 'kadence-starter-templates' ) } <span>{ item.pages[this.state.selectedPage].title }</span></h2>
336
+ </div>
337
+ <div className="kst-import-grid-title">
338
+ <h2>{ __( 'Page Template Plugins', 'kadence-starter-templates' ) }</h2>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  </div>
 
 
340
  <ul className="kadence-required-wrap">
341
  { map( item.plugins, ( { state, title, src } ) => {
 
 
 
 
 
 
342
  return (
343
  <li className="plugin-required">
344
+ { title } - <span class="plugin-status">{ ( 'notactive' === state ? __( 'Not Installed', 'kadence-starter-templates' ) : state ) }</span> { ( 'active' !== state && 'thirdparty' === src ? <span class="plugin-install-required">{ __( 'Please install and activate this third-party premium plugin' ) }</span> : '' ) }
345
  </li>
346
  );
347
  } ) }
348
  </ul>
349
+ <p className="desc-small note-about-colors">{ __( '*Single Page templates will follow your website current global colors and typography settings, you can import without effecting your current site. Or you can optionally override your websites global colors and typography by enabling the settings below.', 'kadence-starter-templates' ) }</p>
350
+ <ToggleControl
351
+ label={ __( 'Override Your Sites Global Colors?', 'kadence-starter-templates' ) }
352
+ checked={ ( undefined !== this.state.overrideColors ? this.state.overrideColors : false ) }
353
+ onChange={ value => ( this.state.overrideColors ? this.setState( { overrideColors: false } ) : this.setState( { isOpenCheckColor: true } ) ) }
354
+ />
355
+ { this.state.isOpenCheckColor ?
356
+ <Modal
357
+ className="ksp-confirm-modal"
358
+ title={ __( 'Override Your Sites Colors on Import?', 'kadence-starter-templates' ) }
359
+ onRequestClose={ () => {
360
+ this.setState( { isOpenCheckColor: false } )
361
+ } }>
362
+ <p className="desc-small note-about-colors">{ __( 'This will override the customizer settings for global colors on your current site when you import this page template.', 'kadence-starter-templates' ) }</p>
363
+ <div className="ksp-override-model-buttons">
364
+ <Button className="ksp-cancel-override" onClick={ () => {
365
+ this.setState( { isOpenCheckColor: false, overrideColors: false } );
366
+ } }>
367
+ { __( 'Cancel', 'kadence-starter-templates' ) }
368
+ </Button>
369
+ <Button className="ksp-do-override" isPrimary onClick={ () => {
370
+ this.setState( { isOpenCheckColor: false, overrideColors: true } );
371
+ } }>
372
+ { __( 'Override Colors', 'kadence-starter-templates' ) }
373
+ </Button>
374
+ </div>
375
+ </Modal>
376
+ : null }
377
+ { this.state.overrideColors && this.state.colorPalette && (
378
  <Fragment>
379
+ <h3>{ __( 'Selected Color Palette', 'kadence-starter-templates' ) }</h3>
380
+ { map( this.state.palettes, ( { palette, colors } ) => {
381
+ if ( palette !== this.state.colorPalette ) {
382
+ return;
383
+ }
384
+ return (
385
+ <div className="kst-palette-btn kst-selected-color-palette">
386
+ { map( colors, ( color, index ) => {
387
+ return (
388
+ <div key={ index } style={ {
389
+ width: 22,
390
+ height: 22,
391
+ marginBottom: 0,
392
+ marginRight:'3px',
393
+ transform: 'scale(1)',
394
+ transition: '100ms transform ease',
395
+ } } className="kadence-swatche-item-wrap">
396
+ <span
397
+ className={ 'kadence-swatch-item' }
398
+ style={ {
399
+ height: '100%',
400
+ display: 'block',
401
+ width: '100%',
402
+ border: '1px solid rgb(218, 218, 218)',
403
+ borderRadius: '50%',
404
+ color: `${ color }`,
405
+ boxShadow: `inset 0 0 0 ${ 30 / 2 }px`,
406
+ transition: '100ms box-shadow ease',
407
+ } }
408
+ >
409
+ </span>
410
+ </div>
411
+ )
412
+ } ) }
413
+ </div>
414
+ )
415
+ } ) }
416
+ </Fragment>
417
+ ) }
418
+ <ToggleControl
419
+ label={ __( 'Override Your Sites Fonts?', 'kadence-starter-templates' ) }
420
+ checked={ ( undefined !== this.state.overrideFonts ? this.state.overrideFonts : false ) }
421
+ onChange={ value => ( this.state.overrideFonts ? this.setState( { overrideFonts: false } ) : this.setState( { isOpenCheckFont: true } ) ) }
422
+ />
423
+ { this.state.isOpenCheckFont ?
424
+ <Modal
425
+ className="ksp-confirm-modal"
426
+ title={ __( 'Override Your Sites Fonts on Import?', 'kadence-starter-templates' ) }
427
+ onRequestClose={ () => {
428
+ this.setState( { isOpenCheckFont: false } )
429
+ } }>
430
+ <p className="desc-small note-about-colors">{ __( 'This will override the customizer typography settings on your current site when you import this page template.', 'kadence-starter-templates' ) }</p>
431
+ <div className="ksp-override-model-buttons">
432
+ <Button className="ksp-cancel-override" onClick={ () => {
433
+ this.setState( { isOpenCheckFont: false, overrideFonts: false } );
434
+ } }>
435
+ { __( 'Cancel', 'kadence-starter-templates' ) }
436
+ </Button>
437
+ <Button className="ksp-do-override" isPrimary onClick={ () => {
438
+ this.setState( { isOpenCheckFont: false, overrideFonts: true } );
439
+ } }>
440
+ { __( 'Override Fonts', 'kadence-starter-templates' ) }
441
+ </Button>
442
+ </div>
443
+ </Modal>
444
+ : null }
445
+ { this.state.fontPair && this.state.overrideFonts && (
446
+ <Fragment>
447
+ <h3 className="kst-selected-font-pair-title">{ __( 'Selected Font Pair', 'kadence-starter-templates' ) }</h3>
448
+ { map( this.state.fonts, ( { font, img, name } ) => {
449
+ if ( font !== this.state.fontPair ) {
450
+ return;
451
+ }
452
+ return (
453
+ <div className="kst-selected-font-pair">
454
+ <img src={ img } className="font-pairing" />
455
+ <h4>{ name }</h4>
456
+ </div>
457
+ )
458
+ } ) }
459
+ </Fragment>
460
+ ) }
461
+ { this.state.progress === 'plugins' && (
462
+ <div class="kadence_starter_templates_response">{ kadenceStarterParams.plugin_progress }</div>
463
+ ) }
464
+ { this.state.progress === 'content' && (
465
+ <div class="kadence_starter_templates_response">{ kadenceStarterParams.content_progress }</div>
466
+ ) }
467
+ { this.state.progress === 'contentNew' && (
468
+ <div class="kadence_starter_templates_response">{ kadenceStarterParams.content_new_progress }</div>
469
+ ) }
470
+ { this.state.isFetching && (
471
+ <Spinner />
472
+ ) }
473
+ { ! kadenceStarterParams.isKadence && (
474
+ <div class="kadence_starter_templates_response">
475
+ <h2>{ __( 'This Template Requires the Kadence Theme', 'kadence-starter-templates' ) }</h2>
476
+ <ExternalLink href={ 'https://kadence-theme.com/' }>{ __( 'Get Free Theme', 'kadence-starter-templates' ) }</ExternalLink>
477
+ </div>
478
+ ) }
479
+ { kadenceStarterParams.isKadence && (
480
+ <Fragment>
481
+ <Button className="kt-defaults-save" isPrimary disabled={ this.state.isFetching } onClick={ () => {
482
+ this.runPluginInstallSingle( item.slug, this.state.selectedPage );
483
+ } }>
484
+ { __( 'Start Importing Page' ) }
485
+ </Button>
486
  </Fragment>
487
  ) }
 
 
 
 
 
 
 
 
 
 
 
 
 
488
  </div>
489
  </div>
 
 
 
 
490
  </div>
491
  );
492
  }
493
  const KadenceImportMode = () => {
494
+ const itemArray = ( this.state.starterSettings['builderType'] === 'elementor' ? this.state.etemplates.filter( ( { slug } ) => slug === this.state.activeTemplate ) : this.state.templates.filter( ( { slug } ) => slug === this.state.activeTemplate ) );
495
  const item = itemArray[0];
496
  let pluginsPremium = false;
497
  return (
498
  <Fragment>
499
+ <div className="kst-grid-single-site">
500
+ <div className="kst-import-selection-item">
501
+ <div className="kst-import-selection">
502
+ <img src={ item.pages['home'].image } alt={ item.name } />
503
+ </div>
504
+ </div>
505
+ <div className="kst-import-selection-options">
506
+ <div className="kst-import-selection-title">
507
+ <div className="kst-import-single-selection-options-wrap">
508
+ <h2>{ __( 'Template:', 'kadence-starter-templates' ) } <span>{ item.name }</span></h2>
509
  </div>
510
  </div>
511
  </div>
514
  className="kst-import-modal"
515
  title={ __( 'Import Starter Template' ) }
516
  onRequestClose={ () => this.state.isFetching ? false : this.setState( { activeTemplate: '', colorPalette: '', focusMode: false, isImporting: false, progress: '' } ) }>
517
+ { this.state.hasContent && (
518
  <div className="kadence_starter_templates_notice">
519
+ { this.state.hasPastContent ? (
520
+ <Fragment>{ kadenceStarterParams.notice_previous }</Fragment>
521
+ ) : (
522
+ <Fragment>{ kadenceStarterParams.notice }</Fragment>
523
+ ) }
524
  </div>
525
  ) }
526
  <h3>{ __( 'Starter Template Plugins', 'kadence-starter-templates' ) }</h3>
584
  } ) }
585
  </Fragment>
586
  ) }
587
+ { this.state.fontPair && (
588
+ <Fragment>
589
+ <h3 className="kst-selected-font-pair-title">{ __( 'Selected Font Pair', 'kadence-starter-templates' ) }</h3>
590
+ { map( this.state.fonts, ( { font, img, name } ) => {
591
+ if ( font !== this.state.fontPair ) {
592
+ return;
593
+ }
594
+ return (
595
+ <div className="kst-selected-font-pair">
596
+ <img src={ img } className="font-pairing" />
597
+ <h4>{ name }</h4>
598
+ </div>
599
+ )
600
+ } ) }
601
+ </Fragment>
602
+ ) }
603
+ { this.state.hasPastContent && (
604
+ <Fragment>
605
+ <ToggleControl
606
+ label={ __( 'Delete Previously Imported Posts and Images?', 'kadence-starter-templates' ) }
607
+ checked={ ( undefined !== this.state.removePast ? this.state.removePast : false ) }
608
+ onChange={ value => ( this.state.removePast ? this.setState( { removePast: false } ) : this.setState( { removePast: true } ) ) }
609
+ />
610
+ {/* { this.state.isOpenCheckPast ?
611
+ <Modal
612
+ className="ksp-confirm-modal"
613
+ title={ __( 'Delete Previously Imported Posts and Images?', 'kadence-starter-templates' ) }
614
+ onRequestClose={ () => {
615
+ this.setState( { isOpenCheckPast: false } )
616
+ } }>
617
+ <p className="desc-small note-about-colors">{ __( 'This will delete pages, posts, and images previously imported through Kadence Starter Templates. If you are testing out different starter templates this is recommended.', 'kadence-starter-templates' ) }</p>
618
+ <div className="ksp-override-model-buttons">
619
+ <Button className="ksp-cancel-override" onClick={ () => {
620
+ this.setState( { isOpenCheckPast: false, removePast: false } );
621
+ } }>
622
+ { __( 'Cancel', 'kadence-starter-templates' ) }
623
+ </Button>
624
+ <Button className="ksp-do-override" isPrimary onClick={ () => {
625
+ this.setState( { isOpenCheckPast: false, removePast: true } );
626
+ } }>
627
+ { __( 'Override Colors', 'kadence-starter-templates' ) }
628
+ </Button>
629
+ </div>
630
+ </Modal>
631
+ : null } */}
632
+ </Fragment>
633
+ ) }
634
+ { this.state.progress === 'remove' && (
635
+ <div class="kadence_starter_templates_response">{ kadenceStarterParams.remove_progress }</div>
636
+ ) }
637
  { this.state.progress === 'plugins' && (
638
  <div class="kadence_starter_templates_response">{ kadenceStarterParams.plugin_progress }</div>
639
  ) }
655
  { ! kadenceStarterParams.isKadence && (
656
  <div class="kadence_starter_templates_response">
657
  <h2>{ __( 'This Starter Template Requires the Kadence Theme', 'kadence-starter-templates' ) }</h2>
658
+ <ExternalLink href={ 'https://kadence-theme.com/' }>{ __( 'Get Free Theme', 'kadence-starter-templates' ) }</ExternalLink>
659
  </div>
660
  ) }
661
  { kadenceStarterParams.isKadence && (
662
  <Fragment>
663
  { pluginsPremium && (
664
  <Button className="kt-defaults-save" isPrimary disabled={ this.state.isFetching } onClick={ () => {
665
+ if ( this.state.removePast ) {
666
+ this.runRemovePast( item.slug );
667
+ } else {
668
+ this.runPluginInstall( item.slug );
669
+ }
670
  } }>
671
  { __( 'Skip and Import with Partial Content' ) }
672
  </Button>
673
  ) }
674
  { ! pluginsPremium && (
675
  <Button className="kt-defaults-save" isPrimary disabled={ this.state.isFetching } onClick={ () => {
676
+ if ( this.state.removePast ) {
677
+ this.runRemovePast( item.slug );
678
+ } else {
679
+ this.runPluginInstall( item.slug );
680
+ }
681
  } }>
682
  { __( 'Start Importing' ) }
683
  </Button>
688
  </Fragment>
689
  );
690
  }
691
+ const KadencesSiteMode = () => {
692
+ const itemArray = ( this.state.starterSettings['builderType'] === 'elementor' ? this.state.etemplates.filter( ( { slug } ) => slug === this.state.activeTemplate ) : this.state.templates.filter( ( { slug } ) => slug === this.state.activeTemplate ) );
693
+ const item = itemArray[0];
694
+ return (
695
+ // <div className="kst-grid-single-site">
696
+ // <div className="kst-import-selection-item">
697
+ // <div className="kst-import-selection-title">
698
+ // <h2>{ __( 'Selected Page:', 'kadence-starter-templates' ) } <span>{ item.pages[this.state.selectedPage].title }</span></h2>
699
+ // </div>
700
+ // <div className="kst-import-selection">
701
+ // <img src={ item.pages[this.state.selectedPage].image } alt={ item.pages[this.state.selectedPage].title } />
702
+ // </div>
703
+ // </div>
704
+ <Fragment>
705
+ <div className="kst-import-selection-options">
706
+ <div className="kst-import-grid-title">
707
+ <h2>{ __( 'Page Templates', 'kadence-starter-templates' ) }</h2>
708
+ </div>
709
+ <div className="templates-grid">
710
+ { map( item.pages, ( { title, id, image } ) => {
711
+ return (
712
+ <div className="kst-template-item">
713
+ <Button
714
+ key={ id }
715
+ className="kst-import-btn"
716
+ isSmall
717
+ onClick={ () => this.selectedMode( id ) }
718
+ >
719
+ <LazyLoad offsetBottom={200}>
720
+ <img src={ image.replace( id, id + '-thumb' ) } alt={ title } />
721
+ </LazyLoad>
722
+ <div className="demo-title">
723
+ <h4>{ title } <span>{ __( 'View Details', 'kadence-starter-templates' ) }</span></h4>
724
+ </div>
725
+ </Button>
726
+ </div>
727
+ );
728
+ } ) }
729
+ </div>
730
+ <div className="kst-import-selection-bottom">
731
+ <Button className="kt-import-fullsite" isPrimary onClick={ () => this.selectedFullMode() }>
732
+ { __( 'Import Full Site', 'kadence-starter-templates' ) }
733
+ </Button>
734
+ </div>
735
+ </div>
736
+ {/* <div className="kst-import-selection-footer">
737
+ <Button
738
+ className="kt-import-back"
739
+ icon={ arrowLeft }
740
+ onClick={ () => this.backToDash() }>
741
+ { __( 'Back', 'kadence-starter-templates' ) }
742
+ </Button>
743
+ <Button className="kt-import-fullsite" isPrimary onClick={ () => this.selectedFullMode() }>
744
+ { __( 'Import Full Site', 'kadence-starter-templates' ) }
745
+ </Button>
746
+ <ExternalLink className="components-button" href={ item.url }>{ __( 'Preview Site', 'kadence-starter-templates' ) }</ExternalLink>
747
+ </div> */}
748
+ </Fragment>
749
+ );
750
+ }
751
  const KadenceSitesGrid = () => (
752
  <div className="templates-grid">
753
+ { map( ( this.state.starterSettings['builderType'] === 'elementor' ? this.state.etemplates : this.state.templates ), ( { name, key, slug, image, content, categories, keywords, pro, pages } ) => {
754
  if ( ( 'all' === this.state.category || categories.includes( this.state.category ) ) && ( ! this.state.search || ( keywords && keywords.some( x => x.toLowerCase().includes( this.state.search.toLowerCase() ) ) ) ) ) {
755
  return (
756
  <div className="kst-template-item">
759
  className="kst-import-btn"
760
  isSmall
761
  isDisabled={ undefined !== pro && pro && 'true' !== kadenceStarterParams.pro }
762
+ //onClick={ () => ( pages ? this.focusMode( slug ) : this.fullFocusMode( slug ) ) }
763
+ onClick={ () => this.fullFocusMode( slug ) }
764
  >
765
+ <LazyLoad offsetBottom={200}>
766
+ <img src={ pages ? pages.home.image.replace( 'home', 'home-thumb' ) : image } alt={ name } />
767
  </LazyLoad>
768
  <div className="demo-title">
769
  <h4>{ name }</h4>
771
  </Button>
772
  { undefined !== pro && pro && (
773
  <Fragment>
774
+ <span className="kb-pro-template">{ __( 'Membership', 'kadence-starter-sites' ) }</span>
775
  { 'true' !== kadenceStarterParams.pro && (
776
  <div className="kt-popover-pro-notice">
777
+ <h2>{ __( 'Kadence Full Membership required for this item', 'kadence-starter-sites' ) } </h2>
778
+ <ExternalLink href={ 'https://www.kadencewp.com/product/kadence-membership/' }>{ __( 'Upgrade to Membership', 'kadence-starter-sites' ) }</ExternalLink>
779
  </div>
780
  ) }
781
  </Fragment>
786
  } ) }
787
  </div>
788
  );
789
+ const KadenceFinishedPage = () => {
790
+ const itemArray = ( this.state.starterSettings['builderType'] === 'elementor' ? this.state.etemplates.filter( ( { slug } ) => slug === this.state.activeTemplate ) : this.state.templates.filter( ( { slug } ) => slug === this.state.activeTemplate ) );
791
+ const item = itemArray[0];
792
+ return (
793
+ <div className="kst-grid-single-site">
794
+ <div className="kst-import-selection-item">
795
+ <div className="kst-import-selection">
796
+ <img src={ item.pages[this.state.selectedPage].image } alt={ item.pages[this.state.selectedPage].title } />
797
+ </div>
798
+ </div>
799
+ <div className="kst-import-selection-options">
800
+ <div className="kst-import-single-selection-options-wrap">
801
+ <div className="kst-import-selection-title">
802
+ <h2>{ __( 'Template:', 'kadence-starter-templates' ) } <span>{ item.name }</span><br></br> { __( 'Selected Page:', 'kadence-starter-templates' ) } <span>{ item.pages[this.state.selectedPage].title }</span></h2>
803
+ </div>
804
+ <div className="kst-import-grid-title">
805
+ <h2>{ __( 'Import complete!', 'kadence-starter-templates' ) }</h2>
806
+ <div class="kadence_starter_templates_finished">
807
+ <div dangerouslySetInnerHTML={ { __html: this.state.response } } />
808
+ </div>
809
+ </div>
810
+ </div>
811
+ </div>
812
+ </div>
813
+ );
814
+ }
815
+ const KadenceFinished = () => {
816
+ const itemArray = ( this.state.starterSettings['builderType'] === 'elementor' ? this.state.etemplates.filter( ( { slug } ) => slug === this.state.activeTemplate ) : this.state.templates.filter( ( { slug } ) => slug === this.state.activeTemplate ) );
817
+ const item = itemArray[0];
818
+ return (
819
+ <div className="kst-grid-single-site">
820
+ <div className="kst-import-selection-item">
821
+ <div className="kst-import-selection">
822
+ <img src={ item.pages['home'].image } />
823
+ </div>
824
+ </div>
825
+ <div className="kst-import-selection-options">
826
+ <div className="kst-import-single-selection-options-wrap">
827
+ <div className="kst-import-selection-title">
828
+ <h2>{ __( 'Template:', 'kadence-starter-templates' ) } <span>{ item.name }</span></h2>
829
+ </div>
830
+ <div className="kst-import-grid-title">
831
+ <h2>{ __( 'Import complete!', 'kadence-starter-templates' ) }</h2>
832
+ <div class="kadence_starter_templates_finished">
833
+ <div dangerouslySetInnerHTML={ { __html: this.state.response } } />
834
+ </div>
835
+ </div>
836
+ </div>
837
+ </div>
838
+ </div>
839
+ );
840
+ }
841
 
842
  const MainPanel = () => (
843
+ <Fragment>
844
+ { this.state.isSaving ? (
845
+ <div className="kst-overlay-saving">
846
+ <Spinner />
847
+ </div>
848
+ ) : (
849
+ <div className="main-panel">
850
+ { this.state.focusMode && (
851
+ <Fragment>
852
+ { this.state.isImporting && (
853
+ <Fragment>
854
+ { ! this.state.isPageSelected ? (
855
+ <KadenceImportMode />
856
+ ) : (
857
+ <KadenceImportSingleMode />
858
+ ) }
859
+ </Fragment>
860
+ ) }
861
+ { ! this.state.isImporting && this.state.isSelected && (
862
+ <KadenceImporterFullPreview
863
+ item={ ( this.state.starterSettings['builderType'] === 'elementor' ? this.state.etemplates.filter( ( { slug } ) => slug === this.state.activeTemplate ) : this.state.templates.filter( ( { slug } ) => slug === this.state.activeTemplate ) ) }
864
+ colorPalette={ this.state.colorPalette }
865
+ fontPair={ this.state.fontPair }
866
+ onChange={ ( value ) => {
867
+ this.setState( value );
868
+ } }
869
+ />
870
+ ) }
871
+ { ! this.state.isImporting && ! this.state.isSelected && (
872
+ <KadencesSiteMode />
873
+ ) }
874
+ </Fragment>
875
  ) }
876
+ { ! this.state.focusMode && ! this.state.finished && (
877
+ <KadenceSitesGrid />
878
  ) }
879
+ { this.state.finished && (
880
+ <Fragment>
881
+ { ! this.state.isPageSelected ? (
882
+ <KadenceFinished />
883
+ ) : (
884
+ <KadenceFinishedPage />
885
+ ) }
886
+ </Fragment>
887
+ ) }
888
+ </div>
889
  ) }
890
+ </Fragment>
891
+ );
892
+ const ChooseBuilder = () => (
893
+ <div className="kst-choose-builder-wrap">
894
+ <div className="kst-choose-builder-center">
895
+ <h2 className="kst-choose-builder-title">{ __( 'Choose a Builder', 'kadence-starter-templates' ) }</h2>
896
+ <div className="kst-choose-builder-inner">
897
+ <Button
898
+ icon={ gbIcon }
899
+ className="kt-import-select-type"
900
+ onClick={ () => this.saveConfig( 'builderType', 'blocks' ) }
901
+ >
902
+ { __( 'Gutenberg', 'kadence-starter-templates' ) }
903
+ </Button>
904
+ <Button
905
+ icon={ eIcon }
906
+ className="kt-import-select-type"
907
+ onClick={ () => this.saveConfig( 'builderType', 'elementor' ) }
908
+ >
909
+ { __( 'Elementor', 'kadence-starter-templates' ) }
910
+ </Button>
911
+ </div>
912
+ { this.state.isSaving && (
913
+ <div className="kst-overlay-saving">
914
+ <Spinner />
915
+ </div>
916
+ ) }
917
+ </div>
918
  </div>
919
  );
 
920
  return (
921
  <Fragment>
922
+ <div class="kadence_theme_dash_head">
923
+ <div class="kadence_theme_dash_head_container">
924
+ <div class="kadence_theme_dash_logo">
925
+ <img src={ this.state.logo }/>
926
+ </div>
927
+ { this.state.focusMode && (
928
+ <div class="kadence_theme_dash_back">
929
+ { this.state.isPageSelected ? (
930
+ <Tooltip text={ __( 'Back to Individual Pages Grid' ) }>
931
+ <Button
932
+ className="kt-import-back"
933
+ icon={ chevronLeft }
934
+ onClick={ () => this.state.isFetching ? false : this.setState( { colorPalette: '', finished:false, selectedPage: 'home', focusMode: true, isSelected: false, isPageSelected:false, isImporting: false, progress: '' } ) }
935
+ >
936
+ </Button>
937
+ </Tooltip>
938
+ ) : (
939
+ <Tooltip text={ __( 'Back to Starter Templates Grid' ) }>
940
+ <Button
941
+ className="kt-import-back"
942
+ icon={ chevronLeft }
943
+ onClick={ () => this.backToDash() }
944
+ />
945
+ </Tooltip>
946
+ ) }
947
+ </div>
948
+ ) }
949
+ { this.state.finished && (
950
+ <div class="kadence_theme_dash_back">
951
+ <Tooltip text={ __( 'Back to Starter Templates Grid' ) }>
952
+ <Button
953
+ className="kt-import-back"
954
+ icon={ chevronLeft }
955
+ onClick={ () => this.backToDash() }
956
+ />
957
+ </Tooltip>
958
+ </div>
959
+ ) }
960
+ <div class="kadence_starter_builder_type">
961
+ { this.state.starterSettings && this.state.starterSettings['builderType'] && (
962
+ <Dropdown
963
+ className="my-container-class-name"
964
+ contentClassName="kst-type-popover"
965
+ position="bottom left"
966
+ renderToggle={ ( { isOpen, onToggle } ) => (
967
+ <Button onClick={ onToggle } aria-expanded={ isOpen } icon={ ( this.state.starterSettings['builderType'] === 'blocks' ? gbIcon : eIcon ) } >
968
+ { ( this.state.starterSettings['builderType'] === 'blocks' ? 'Gutenberg' : 'Elementor' ) }
969
+ <Icon className="kst-chev" icon={ chevronDown } />
970
+ </Button>
971
+ ) }
972
+ renderContent={ ( { isOpen, onToggle } ) => (
973
+ <div>
974
+ <MenuItem
975
+ icon={ gbIcon }
976
+ className={ ( 'blocks' === this.state.starterSettings['builderType'] ? 'active-item' : '' ) }
977
+ isSelected={ ( 'blocks' === this.state.starterSettings['builderType'] ? true : false ) }
978
+ onClick={ () => {
979
+ this.saveConfig( 'builderType', 'blocks' );
980
+ this.setState( { activeTemplate: '', colorPalette: '', finished:false, selectedPage: 'home', focusMode: false, isSelected: false, isPageSelected:false, isImporting: false, progress: '' } );
981
+ onToggle();
982
+ } }
983
+ >
984
+ { __( 'Gutenberg', 'kadence-starter-templates' ) }
985
+ </MenuItem>
986
+ <MenuItem
987
+ icon={ eIcon }
988
+ className={ ( 'elementor' === this.state.starterSettings['builderType'] ? 'active-item' : '' ) }
989
+ isSelected={ ( 'elementor' === this.state.starterSettings['builderType'] ? true : false ) }
990
+ onClick={ () => {
991
+ this.saveConfig( 'builderType', 'elementor' );
992
+ this.setState( { activeTemplate: '', colorPalette: '', finished:false, selectedPage: 'home', focusMode: false, isSelected: false, isPageSelected:false, isImporting: false, progress: '' } );
993
+ onToggle();
994
+ } }
995
+ >
996
+ { __( 'Elementor', 'kadence-starter-templates' ) }
997
+ </MenuItem>
998
+ </div>
999
+ ) }
1000
+ />
1001
+ ) }
1002
+ </div>
1003
+ </div>
1004
+ </div>
1005
+ <div class="kadence_theme_starter_dash_inner">
1006
+ { this.state.starterSettings && this.state.starterSettings['builderType'] ? (
1007
+ <MainPanel />
1008
+ ) : (
1009
+ <ChooseBuilder />
1010
+ ) }
1011
+ </div>
1012
  </Fragment>
1013
  );
1014
  }
inc/react/src/single-template-import.js ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Internal dependencies
3
+ */
4
+ // import HelpTab from './help';
5
+ // import ProSettings from './pro-extension';
6
+ // import RecommendedTab from './recomended';
7
+ // import StarterTab from './starter';
8
+ // import Sidebar from './sidebar';
9
+ // import CustomizerLinks from './customizer';
10
+ // import Notices from './notices';
11
+ import map from 'lodash/map';
12
+ import LazyLoad from 'react-lazy-load';
13
+ /**
14
+ * WordPress dependencies
15
+ */
16
+ const { __, sprintf } = wp.i18n;
17
+ const { Fragment, Component, render, PureComponent } = wp.element;
18
+ const { Modal, Spinner, ButtonGroup, Dropdown, Icon, Button, ExternalLink, ToolbarGroup, ToggleControl, MenuItem, Tooltip } = wp.components;
19
+
20
+ class KadenceSingleTemplateImport extends Component {
21
+ constructor() {
22
+ super( ...arguments );
23
+ this.state = {
24
+ colorPalette: this.props.colorPalette ? this.props.colorPalette : '',
25
+ fontPair: this.props.fontPair ? this.props.fontPair : '',
26
+ palettes: ( kadenceStarterParams.palettes ? kadenceStarterParams.palettes : [] ),
27
+ fonts: ( kadenceStarterParams.fonts ? kadenceStarterParams.fonts : [] ),
28
+ overrideColors: false,
29
+ overrideFonts: false,
30
+ isOpenCheckColor: false,
31
+ isOpenCheckFont: false,
32
+ };
33
+ }
34
+ capitalizeFirstLetter( string ) {
35
+ return string.charAt( 0 ).toUpperCase() + string.slice( 1 );
36
+ }
37
+ render() {
38
+ const item = this.props.item[0];
39
+ let pluginsActive = true;
40
+ let pluginsPremium = false;
41
+ return (
42
+ <div className="kst-grid-single-site">
43
+ <div className="kst-import-selection-item">
44
+ <div className="kst-import-selection">
45
+ <img src={ item.pages[this.state.selectedPage].image } alt={ item.pages[this.state.selectedPage].title } />
46
+ </div>
47
+ </div>
48
+ <div className="kst-import-selection-options">
49
+ <div className="kst-import-single-selection-options-wrap">
50
+ <div className="kst-import-selection-title">
51
+ <h2>{ __( 'Template:', 'kadence-starter-templates' ) } <span>{ item.name }</span><br></br> { __( 'Selected Page:', 'kadence-starter-templates' ) } <span>{ item.pages[this.state.selectedPage].title }</span></h2>
52
+ </div>
53
+ <div className="kst-import-grid-title">
54
+ <h2>{ __( 'Page Template Plugins', 'kadence-starter-templates' ) }</h2>
55
+ </div>
56
+ <ul className="kadence-required-wrap">
57
+ { map( item.plugins, ( { state, title, src } ) => {
58
+ return (
59
+ <li className="plugin-required">
60
+ { title } - <span class="plugin-status">{ ( 'notactive' === state ? __( 'Not Installed', 'kadence-starter-templates' ) : state ) }</span> { ( 'active' !== state && 'thirdparty' === src ? <span class="plugin-install-required">{ __( 'Please install and activate this third-party premium plugin' ) }</span> : '' ) }
61
+ </li>
62
+ );
63
+ } ) }
64
+ </ul>
65
+ <p className="desc-small note-about-colors">{ __( '*Single Page templates will follow your website current global colors and typography settings, you can import without effecting your current site. Or you can optionally override your websites global colors and typography by enabling the settings below.', 'kadence-starter-templates' ) }</p>
66
+ <ToggleControl
67
+ label={ __( 'Override Your Sites Global Colors?', 'kadence-starter-templates' ) }
68
+ checked={ ( undefined !== this.state.overrideColors ? this.state.overrideColors : false ) }
69
+ onChange={ value => ( this.state.overrideColors ? this.setState( { overrideColors: false } ) : this.setState( { isOpenCheckColor: true } ) ) }
70
+ />
71
+ { this.state.isOpenCheckColor ?
72
+ <Modal
73
+ className="ksp-confirm-modal"
74
+ title={ __( 'Override Your Sites Colors on Import?', 'kadence-starter-templates' ) }
75
+ onRequestClose={ () => {
76
+ this.setState( { isOpenCheckColor: false } )
77
+ } }>
78
+ <p className="desc-small note-about-colors">{ __( 'This will override the customizer settings for global colors on your current site when you import this page template.', 'kadence-starter-templates' ) }</p>
79
+ <div className="ksp-override-model-buttons">
80
+ <Button className="ksp-cancel-override" onClick={ () => {
81
+ this.setState( { isOpenCheckColor: false, overrideColors: false } );
82
+ } }>
83
+ { __( 'Cancel', 'kadence-starter-templates' ) }
84
+ </Button>
85
+ <Button className="ksp-do-override" isPrimary onClick={ () => {
86
+ this.setState( { isOpenCheckColor: false, overrideColors: true } );
87
+ } }>
88
+ { __( 'Override Colors', 'kadence-starter-templates' ) }
89
+ </Button>
90
+ </div>
91
+ </Modal>
92
+ : null }
93
+ { this.state.overrideColors && this.state.colorPalette && (
94
+ <Fragment>
95
+ <h3>{ __( 'Selected Color Palette', 'kadence-starter-templates' ) }</h3>
96
+ { map( this.state.palettes, ( { palette, colors } ) => {
97
+ if ( palette !== this.state.colorPalette ) {
98
+ return;
99
+ }
100
+ return (
101
+ <div className="kst-palette-btn kst-selected-color-palette">
102
+ { map( colors, ( color, index ) => {
103
+ return (
104
+ <div key={ index } style={ {
105
+ width: 22,
106
+ height: 22,
107
+ marginBottom: 0,
108
+ marginRight:'3px',
109
+ transform: 'scale(1)',
110
+ transition: '100ms transform ease',
111
+ } } className="kadence-swatche-item-wrap">
112
+ <span
113
+ className={ 'kadence-swatch-item' }
114
+ style={ {
115
+ height: '100%',
116
+ display: 'block',
117
+ width: '100%',
118
+ border: '1px solid rgb(218, 218, 218)',
119
+ borderRadius: '50%',
120
+ color: `${ color }`,
121
+ boxShadow: `inset 0 0 0 ${ 30 / 2 }px`,
122
+ transition: '100ms box-shadow ease',
123
+ } }
124
+ >
125
+ </span>
126
+ </div>
127
+ )
128
+ } ) }
129
+ </div>
130
+ )
131
+ } ) }
132
+ </Fragment>
133
+ ) }
134
+ <ToggleControl
135
+ label={ __( 'Override Your Sites Fonts?', 'kadence-starter-templates' ) }
136
+ checked={ ( undefined !== this.state.overrideFonts ? this.state.overrideFonts : false ) }
137
+ onChange={ value => ( this.state.overrideFonts ? this.setState( { overrideFonts: false } ) : this.setState( { isOpenCheckFont: true } ) ) }
138
+ />
139
+ { this.state.isOpenCheckFont ?
140
+ <Modal
141
+ className="ksp-confirm-modal"
142
+ title={ __( 'Override Your Sites Fonts on Import?', 'kadence-starter-templates' ) }
143
+ onRequestClose={ () => {
144
+ this.setState( { isOpenCheckFont: false } )
145
+ } }>
146
+ <p className="desc-small note-about-colors">{ __( 'This will override the customizer typography settings on your current site when you import this page template.', 'kadence-starter-templates' ) }</p>
147
+ <div className="ksp-override-model-buttons">
148
+ <Button className="ksp-cancel-override" onClick={ () => {
149
+ this.setState( { isOpenCheckFont: false, overrideFonts: false } );
150
+ } }>
151
+ { __( 'Cancel', 'kadence-starter-templates' ) }
152
+ </Button>
153
+ <Button className="ksp-do-override" isPrimary onClick={ () => {
154
+ this.setState( { isOpenCheckFont: false, overrideFonts: true } );
155
+ } }>
156
+ { __( 'Override Colors', 'kadence-starter-templates' ) }
157
+ </Button>
158
+ </div>
159
+ </Modal>
160
+ : null }
161
+ { this.state.fontPair && this.state.overrideFonts && (
162
+ <Fragment>
163
+ <h3 className="kst-selected-font-pair-title">{ __( 'Selected Font Pair', 'kadence-starter-templates' ) }</h3>
164
+ { map( this.state.fonts, ( { font, img, name } ) => {
165
+ if ( font !== this.state.fontPair ) {
166
+ return;
167
+ }
168
+ return (
169
+ <div className="kst-selected-font-pair">
170
+ <img src={ img } className="font-pairing" />
171
+ <h4>{ name }</h4>
172
+ </div>
173
+ )
174
+ } ) }
175
+ </Fragment>
176
+ ) }
177
+ { this.state.progress === 'plugins' && (
178
+ <div class="kadence_starter_templates_response">{ kadenceStarterParams.plugin_progress }</div>
179
+ ) }
180
+ { this.state.progress === 'content' && (
181
+ <div class="kadence_starter_templates_response">{ kadenceStarterParams.content_progress }</div>
182
+ ) }
183
+ { this.state.progress === 'contentNew' && (
184
+ <div class="kadence_starter_templates_response">{ kadenceStarterParams.content_new_progress }</div>
185
+ ) }
186
+ { this.state.isFetching && (
187
+ <Spinner />
188
+ ) }
189
+ { ! kadenceStarterParams.isKadence && (
190
+ <div class="kadence_starter_templates_response">
191
+ <h2>{ __( 'This Template Requires the Kadence Theme', 'kadence-starter-templates' ) }</h2>
192
+ <ExternalLink href={ 'https://kadence-theme.com/' }>{ __( 'Get Free Theme', 'kadence-starter-templates' ) }</ExternalLink>
193
+ </div>
194
+ ) }
195
+ { kadenceStarterParams.isKadence && (
196
+ <Fragment>
197
+ <Button className="kt-defaults-save" isPrimary disabled={ this.state.isFetching } onClick={ () => {
198
+ this.props.onChange( { isImporting: true, overrideColors: this.state.overrideColors, overrideFonts: this.state.overrideFonts } );
199
+ this.props.runInstallSingle( item.slug, this.props.selectedPage );
200
+ } }>
201
+ { __( 'Start Importing Page' ) }
202
+ </Button>
203
+ </Fragment>
204
+ ) }
205
+ </div>
206
+ </div>
207
+ </div>
208
+ );
209
+ }
210
+ }
211
+ export default KadenceSingleTemplateImport;
inc/react/src/starter-templates.scss CHANGED
@@ -9,10 +9,241 @@ $color-gray-800: #2D3748;
9
  .appearance_page_kadence-starter-templates #wpcontent {
10
  padding: 0;
11
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  .kadence_theme_dash_head {
13
  background: white;
14
- padding: 10px 20px;
15
- height: 50px;
 
 
 
 
 
 
 
16
  h1 {
17
  color: $color-gray-800;
18
  line-height: 50px;
@@ -30,7 +261,8 @@ $color-gray-800: #2D3748;
30
  }
31
  .kadence_theme_dash_head_container {
32
  margin: 0 auto;
33
- display: flex;
 
34
  align-items: center;
35
  }
36
  .kadence_theme_dash_logo{
@@ -41,7 +273,7 @@ $color-gray-800: #2D3748;
41
  width: 50px;
42
  }
43
  }
44
- .kadence_theme_dash_version {
45
  flex-grow: 1;
46
  text-align: right;
47
  }
@@ -51,8 +283,40 @@ $color-gray-800: #2D3748;
51
  color: white;
52
  }
53
  }
54
- .wrap.kadence_theme_dash {
55
- margin: 20px 20px 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  }
57
  .kadence_theme_dashboard {
58
  margin: 0 auto;
@@ -69,7 +333,8 @@ $color-gray-800: #2D3748;
69
  display: block;
70
  border: 0;
71
  background: transparent;
72
- position: absolute;
 
73
  box-shadow: 0 0px 0px 0 rgba(0,0,0,0);
74
  }
75
  .kst-template-item .components-button.kst-import-btn img {
@@ -96,13 +361,19 @@ $color-gray-800: #2D3748;
96
  }
97
  }
98
  }
 
 
 
 
 
 
99
  .kadence_starter_templates_notice {
100
- background: #ebf8ff;
101
  margin-bottom: 20px;
102
- border: 1px solid #4299e1;
103
  padding: 10px;
104
- color: #2b6cb0;
105
- font-weight: bold;
106
  }
107
  .kst-import-modal ul.kadence-required-wrap {
108
  margin-bottom: 20px;
@@ -117,16 +388,47 @@ $color-gray-800: #2D3748;
117
  background: #fffaf0;
118
  margin-bottom: 20px;
119
  border: 1px solid #ed8936;
120
- padding: 10px;
121
  color: #c05621;
122
  font-weight: bold;
123
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  .kst-template-item {
125
  position: relative;
126
  height: 0;
 
127
  padding-bottom: 65%;
128
- overflow: hidden;
129
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  .sidebar-section .components-panel__body.is-opened {
131
  padding: 20px;
132
  }
@@ -274,7 +576,8 @@ span.kt-license-status.k-active {
274
  .appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions .button {
275
  width: 100%;
276
  line-height: 1;
277
- min-height: 35px;
 
278
  }
279
  .appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions {
280
  padding:5px
@@ -286,19 +589,23 @@ span.kt-license-status.k-active {
286
  display: inline-flex;
287
  align-items: flex-end;
288
  justify-content: center;
289
- border:1px solid transparent;
290
- box-shadow: none !important;
 
 
 
 
291
  }
292
  .kst-template-item .components-button.kst-import-btn:hover, .kst-template-item .components-button.kst-import-btn:focus {
293
  box-shadow: 0 7px 15px 0 rgba(0,0,0,.15) !important;
294
  }
295
  .kadence-starter-templates-preview button.components-button.kst-palette-btn:hover, .kadence-starter-templates-preview button.components-button.kst-palette-btn:focus {
296
- border:1px solid #444;
297
  box-shadow:none !important;
298
  }
299
  .kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary, .kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary:hover, .kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary:focus {
300
- background: #eee;
301
- border:1px solid #aaa;
302
  box-shadow:none;
303
  }
304
  .demo-title {
@@ -306,7 +613,7 @@ span.kt-license-status.k-active {
306
  margin: 0;
307
  padding: 10px 0;
308
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
309
- background: rgba(255,255,255,0.95);
310
  position: absolute;
311
  bottom: 0;
312
  left: 0;
@@ -314,7 +621,7 @@ span.kt-license-status.k-active {
314
  }
315
  .demo-title h4 {
316
  margin: 0;
317
- font-size: 18px;
318
  text-align: left;
319
  line-height: 30px;
320
  padding: 0 20px;
@@ -325,11 +632,6 @@ span.kt-license-status.k-active {
325
  grid-template-columns: 1fr 1fr;
326
  grid-gap: 5px;
327
  }
328
- .palette-title-wrap {
329
- display: flex;
330
- align-items: center;
331
- justify-content: space-between;
332
- }
333
  @media ( max-width: 1860px ) {
334
  .kadence-starter-templates-preview .kadence-swatche-item-wrap {
335
  width: 22px !important;
@@ -339,14 +641,11 @@ h2.palette-title {
339
  font-size: 15px;
340
  }
341
  }
342
- @media ( max-width: 1460px ) {
343
  .templates-grid {
344
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
345
  }
346
  }
347
- .kadence-starter-required-plugins {
348
- padding: 10px 20px 10px;
349
- }
350
  p.install-third-party-notice {
351
  max-width: 540px;
352
  background: #fffaf0;
@@ -368,7 +667,7 @@ p.install-third-party-notice {
368
  }
369
  span.plugin-status {
370
  text-transform: uppercase;
371
- color: #777;
372
  }
373
  .kst-palette-btn.kst-selected-color-palette {
374
  display: flex;
@@ -377,4 +676,190 @@ span.plugin-status {
377
  .finshed-notice-success .button-primary.button.kadence-starter-templates-finish-button {
378
  padding: 10px 16px;
379
  font-size: 18px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  }
9
  .appearance_page_kadence-starter-templates #wpcontent {
10
  padding: 0;
11
  }
12
+ .kadence_theme_dash_back {
13
+ height: 100%;
14
+ }
15
+ .appearance_page_kadence-starter-templates .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content {
16
+ bottom: 70px;
17
+ }
18
+ .kadence_theme_dash_back .components-button.kt-import-back {
19
+ border-left: 1px solid #E2E8F0;
20
+ border-right: 1px solid #E2E8F0;
21
+ height: 100%;
22
+ width: 40px;
23
+ color: #4A5568;
24
+ border-radius:0;
25
+ }
26
+ .kst-import-options-title {
27
+ line-height: 20px;
28
+ padding-top: 5px;
29
+ font-size: 12px;
30
+ text-transform: uppercase;
31
+ text-align: center;
32
+ margin: 0;
33
+ color: #4A5568;
34
+ }
35
+ .appearance_page_kadence-starter-templates .expanded .wp-full-overlay-footer {
36
+ height: 70px;
37
+ }
38
+ .kadence_theme_dash_back .components-button.kt-import-back:hover {
39
+ border-left: 1px solid #cbd5e0;
40
+ border-right: 1px solid #cbd5e0;
41
+ background:#f6f9fd;
42
+ }
43
+ .kadence_theme_dash_back .components-button.kt-import-back svg {
44
+ width:30px;
45
+ height:30px;
46
+ margin:0;
47
+ }
48
+ .kadence_theme_dash_head .kadence_starter_builder_type .components-button svg.kst-chev {
49
+ width:16px
50
+ }
51
+ .components-modal__frame.kst-import-modal {
52
+ min-width: 460px;
53
+ }
54
+ .kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(12), .kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(11) {
55
+ padding-top: 20px;
56
+ }
57
+ .kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(12) .kst-palette-bg:before, .kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(11) .kst-palette-bg:before {content: 'dark';color: #111;}
58
+ .kst-import-selection-options {
59
+ padding-bottom: 90px;
60
+ }
61
+ .kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(12) .kst-palette-bg, .kadence-starter-templates-preview button.components-button.kst-palette-btn:nth-child(11) .kst-palette-bg {
62
+ position: absolute;
63
+ left: 2px;
64
+ top: -1px;
65
+ right: 2px;
66
+ display:block;
67
+ bottom: auto;
68
+ opacity: 0.2;
69
+ height: 1px;
70
+ border-radius: 0;
71
+ }
72
+ .components-modal__frame.kst-import-modal .components-button.is-primary {
73
+ padding-left: 30px;
74
+ padding-top: 16px;
75
+ padding-right: 30px;
76
+ font-weight: 700;
77
+ padding-bottom: 16px;
78
+ font-size: 16px;
79
+ height: auto;
80
+ }
81
+ .kst-selected-font-pair {
82
+ display: flex;
83
+ align-items: center;
84
+ margin-bottom: 20px;
85
+ img {
86
+ max-width: 50px;
87
+ }
88
+ }
89
+ h3.kst-selected-font-pair-title {
90
+ margin-bottom: 0;
91
+ }
92
+ .kadence-starter-templates-preview {
93
+ .install-theme-info p.desc-small, .kadence-starter-required-plugins p.desc-small {
94
+ color: $color-gray-700;
95
+ font-style: italic;
96
+ }
97
+ .install-theme-info .theme-screenshot {
98
+ width: 60px;
99
+ margin: 15px 15px 15px 0;
100
+ }
101
+ .theme-info-wrap {
102
+ display:flex;
103
+ align-items: center;
104
+ }
105
+ .install-theme-info {
106
+ padding-bottom: 0;
107
+ }
108
+ }
109
+ .kst-choose-builder-wrap {
110
+ min-height: calc( 100vh - 180px );
111
+ max-width: 400px;
112
+ margin: 0 auto;
113
+ display: flex;
114
+ align-items: center;
115
+ }
116
+ .kadence_starter_builder_type .components-dropdown__content .components-button.components-menu-item__button {
117
+ box-shadow: none !important;
118
+ }
119
+ .kadence_starter_builder_type .components-dropdown__content .components-button.components-menu-item__button.active-item {
120
+ border:1px solid $color-gray-500;
121
+ }
122
+ .kst-choose-builder-center {
123
+ width: 100%;
124
+ background: white;
125
+ padding: 30px;
126
+ border-radius: 4px;
127
+ box-shadow: 0px 25px 35px -10px rgba(0,0,0,0.05);
128
+ position: relative;
129
+ }
130
+ .kst-choose-builder-center .kst-overlay-saving {
131
+ position: absolute;
132
+ top: 0;
133
+ left: 0;
134
+ right: 0;
135
+ bottom: 0;
136
+ display: flex;
137
+ align-items: center;
138
+ justify-content: center;
139
+ background: rgba( 255,255,255, 0.6);
140
+ border-radius: 4px;
141
+ }
142
+ .kst-choose-builder-inner {
143
+ display: grid;
144
+ grid-template-columns: 1fr 1fr;
145
+ grid-gap: 30px;
146
+ }
147
+ .kst-choose-builder-center h2.kst-choose-builder-title {
148
+ margin-top: 0;
149
+ text-align: center;
150
+ text-transform: uppercase;
151
+ font-weight: 300;
152
+ margin-bottom: 30px;
153
+ font-size: 20px;
154
+ color: #718096;
155
+ }
156
+ .kst-choose-builder-center .kst-choose-builder-inner .components-button.kt-import-select-type {
157
+ font-size:20px;
158
+ text-align: center;
159
+ height: auto;
160
+ padding: 20px;
161
+ display: flex;
162
+ border: 1px solid $color-gray-400;
163
+ border-radius: 4px;
164
+ flex-direction: column;
165
+ font-weight: 500;
166
+ text-transform: uppercase;
167
+ color: $color-gray-700;
168
+ }
169
+
170
+ .kst-choose-builder-center .kst-choose-builder-inner .components-button.kt-import-select-type svg {
171
+ width: 100px;
172
+ height: 100px;
173
+ margin-bottom: 10px;
174
+ margin-right: 0;
175
+ }
176
+
177
+ .kst-choose-builder-center .kst-choose-builder-inner .components-button.kt-import-select-type:hover {
178
+ color: $color-gray-800;
179
+ border-color:$color-primary;
180
+ }
181
+ .components-button-group.kst-font-group {
182
+ display: grid;
183
+ grid-template-columns: 1fr 1fr 1fr 1fr;
184
+ grid-gap: 1em;
185
+ }
186
+
187
+ .components-button-group.kst-font-group .components-button.kst-font-btn {
188
+ display: block;
189
+ height: auto;
190
+ padding: 5px 5px 0;
191
+ border: 1px solid #eee;
192
+ border-radius: 0;
193
+ background: white;
194
+ outline: 0;
195
+ box-shadow: none;
196
+ }
197
+ .components-button-group.kst-font-group .components-button.kst-font-btn img.font-pairing {
198
+ max-width: 100%;
199
+ }
200
+ .font-title-wrap, .palette-title-wrap {
201
+ display: flex;
202
+ align-items: center;
203
+ justify-content: space-between;
204
+ h2 {
205
+ font-size: 16px;
206
+ font-weight: 600;
207
+ color: $color-gray-700;
208
+ }
209
+ }
210
+ .kadence-starter-required-plugins {
211
+ padding: 10px 20px 10px;
212
+ }
213
+ .font-title-wrap, .kadence-starter-required-plugins {
214
+ border-top: 1px solid $color-gray-300;
215
+ padding-top: 6px;
216
+ margin-top: 18px;
217
+ }
218
+ .kadence-starter-required-plugins h2.kst-required-title {
219
+ font-size: 16px;
220
+ font-weight: 600;
221
+ color: $color-gray-700;
222
+ }
223
+ .components-button-group.kst-font-group .components-button.kst-font-btn.active{
224
+ border-color: #333;
225
+ }
226
+
227
+ .components-button-group.kst-font-group .components-button.kst-font-btn:hover {
228
+ border-color: #999;
229
+ }
230
+ .kadence_theme_starter_dash_inner {
231
+ margin: 90px 20px 0;
232
+ }
233
+ .kadence_theme_dash_head .st2 {
234
+ fill:#191717;
235
+ }
236
  .kadence_theme_dash_head {
237
  background: white;
238
+ padding: 0px 20px;
239
+ height: 60px;
240
+ border-bottom: 1px solid #ebebeb;
241
+ box-shadow: 0 0 6px -2px rgba(0,0,0,.1);
242
+ position: fixed;
243
+ top: 32px;
244
+ left: 160px;
245
+ z-index: 100;
246
+ right: 0;
247
  h1 {
248
  color: $color-gray-800;
249
  line-height: 50px;
261
  }
262
  .kadence_theme_dash_head_container {
263
  margin: 0 auto;
264
+ display: flex;
265
+ height: 100%;
266
  align-items: center;
267
  }
268
  .kadence_theme_dash_logo{
273
  width: 50px;
274
  }
275
  }
276
+ .kadence_starter_builder_type {
277
  flex-grow: 1;
278
  text-align: right;
279
  }
283
  color: white;
284
  }
285
  }
286
+ .folded .kadence_theme_dash_head {
287
+ left: 36px;
288
+ }
289
+ @media only screen and (max-width: 960px) {
290
+ .auto-fold .kadence_theme_dash_head {
291
+ left: 36px;
292
+ }
293
+ }
294
+ @media screen and (max-width: 782px) {
295
+ .auto-fold .kadence_theme_dash_head {
296
+ left: 0px;
297
+ }
298
+ }
299
+ .kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown.components-dropdown-menu.components-toolbar {
300
+ border-color: #888;
301
+ }
302
+
303
+ .kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown.components-dropdown-menu.components-toolbar button.components-button {
304
+ padding: 0;
305
+ }
306
+ .kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown.components-dropdown-menu.components-toolbar button.components-button svg {
307
+ width: 40px;
308
+ height:40px;
309
+ }
310
+ .kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown.components-dropdown-menu.components-toolbar .components-dropdown__content button.components-button svg {
311
+ width: 24px;
312
+ height:24px;
313
+ margin-left:0;
314
+ }
315
+ .kadence_theme_dash_head .kadence_starter_builder_type .components-dropdown__content {
316
+ text-align: left;
317
+ }
318
+ .wrap.kadence_theme_starter_dash {
319
+ margin: 0;
320
  }
321
  .kadence_theme_dashboard {
322
  margin: 0 auto;
333
  display: block;
334
  border: 0;
335
  background: transparent;
336
+ position: absolute;
337
+ overflow: hidden;
338
  box-shadow: 0 0px 0px 0 rgba(0,0,0,0);
339
  }
340
  .kst-template-item .components-button.kst-import-btn img {
361
  }
362
  }
363
  }
364
+ .components-modal__frame.kst-import-modal {
365
+ max-width: 600px;
366
+ }
367
+ .components-modal__frame.kst-import-modal .components-button.is-primary {
368
+ margin-top: 20px;
369
+ }
370
  .kadence_starter_templates_notice {
371
+ background: transparent;
372
  margin-bottom: 20px;
373
+ border: 1px solid #cbd5e0;
374
  padding: 10px;
375
+ color: #4A5568;
376
+ font-weight: normal;
377
  }
378
  .kst-import-modal ul.kadence-required-wrap {
379
  margin-bottom: 20px;
388
  background: #fffaf0;
389
  margin-bottom: 20px;
390
  border: 1px solid #ed8936;
391
+ padding: 20px;
392
  color: #c05621;
393
  font-weight: bold;
394
  }
395
+ .kst-import-selection-title .components-button.kt-import-back {
396
+ border: 1px solid;
397
+ margin-right: 10px;
398
+ }
399
+ .kst-import-selection-title {
400
+ display: flex;
401
+ align-items: center;
402
+ margin-bottom:10px;
403
+ }
404
+ .kst-grid-single-item-single-page .kst-template-item {
405
+ padding-bottom: 90%;
406
+ }
407
+ .kadence_starter_templates_response h2 {
408
+ margin-bottom: 10px;
409
+ margin-top: 0;
410
+ }
411
  .kst-template-item {
412
  position: relative;
413
  height: 0;
414
+ box-shadow: 0 1px 2px rgba(0,0,0,0.15);
415
  padding-bottom: 65%;
 
416
  }
417
+ .kst-template-item::after {
418
+ content: '';
419
+ position: absolute;
420
+ z-index: -1;
421
+ width: 100%;
422
+ height: 100%;
423
+ opacity: 0;
424
+ border-radius: 5px;
425
+ box-shadow: 0 15px 15px -10px rgba(0,0,0,0.1);
426
+ transition: opacity 0.3s ease-in-out;
427
+ }
428
+ .kst-template-item:hover::after {
429
+ opacity: 1;
430
+ }
431
+
432
  .sidebar-section .components-panel__body.is-opened {
433
  padding: 20px;
434
  }
576
  .appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions .button {
577
  width: 100%;
578
  line-height: 1;
579
+ min-height: 35px;
580
+ padding:0;
581
  }
582
  .appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions {
583
  padding:5px
589
  display: inline-flex;
590
  align-items: flex-end;
591
  justify-content: center;
592
+ border:1px solid transparent;
593
+ position: relative;
594
+ box-shadow: none !important;
595
+ .kst-palette-bg {
596
+ display:none;
597
+ }
598
  }
599
  .kst-template-item .components-button.kst-import-btn:hover, .kst-template-item .components-button.kst-import-btn:focus {
600
  box-shadow: 0 7px 15px 0 rgba(0,0,0,.15) !important;
601
  }
602
  .kadence-starter-templates-preview button.components-button.kst-palette-btn:hover, .kadence-starter-templates-preview button.components-button.kst-palette-btn:focus {
603
+ border:1px solid #999;
604
  box-shadow:none !important;
605
  }
606
  .kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary, .kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary:hover, .kadence-starter-templates-preview button.components-button.kst-palette-btn.is-primary:focus {
607
+ background: #fff;
608
+ border:1px solid #333;
609
  box-shadow:none;
610
  }
611
  .demo-title {
613
  margin: 0;
614
  padding: 10px 0;
615
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.1);
616
+ background: rgba(255,255,255,1);
617
  position: absolute;
618
  bottom: 0;
619
  left: 0;
621
  }
622
  .demo-title h4 {
623
  margin: 0;
624
+ font-size: 14px;
625
  text-align: left;
626
  line-height: 30px;
627
  padding: 0 20px;
632
  grid-template-columns: 1fr 1fr;
633
  grid-gap: 5px;
634
  }
 
 
 
 
 
635
  @media ( max-width: 1860px ) {
636
  .kadence-starter-templates-preview .kadence-swatche-item-wrap {
637
  width: 22px !important;
641
  font-size: 15px;
642
  }
643
  }
644
+ @media ( max-width: 1059px ) {
645
  .templates-grid {
646
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
647
  }
648
  }
 
 
 
649
  p.install-third-party-notice {
650
  max-width: 540px;
651
  background: #fffaf0;
667
  }
668
  span.plugin-status {
669
  text-transform: uppercase;
670
+ color: $color-gray-600;
671
  }
672
  .kst-palette-btn.kst-selected-color-palette {
673
  display: flex;
676
  .finshed-notice-success .button-primary.button.kadence-starter-templates-finish-button {
677
  padding: 10px 16px;
678
  font-size: 18px;
679
+ }
680
+ .kst-grid-single-site {
681
+ display: grid;
682
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
683
+ grid-gap: 4em;
684
+ }
685
+ .kst-import-selection {
686
+ height: 100%;
687
+ max-height: calc(100vh - 140px);
688
+ overflow-y: scroll;
689
+ }
690
+ .kst-import-grid-title h2 {
691
+ font-size: 14px;
692
+ line-height: 20px;
693
+ margin: 10px 0;
694
+ color:$color-gray-700;
695
+ }
696
+ .kst-import-selection-title h2 {
697
+ font-size: 16px;
698
+ line-height: 26px;
699
+ margin: 0 0 10px 0;
700
+ color: $color-gray-800;
701
+ }
702
+ .kst-import-single-selection-options-wrap {
703
+ background:white;
704
+ padding:35px 35px 35px;
705
+ max-width: 700px;
706
+ width: 100%;
707
+ box-sizing: border-box;
708
+ }
709
+ .appearance_page_kadence-starter-templates #wpbody-content {
710
+ padding-bottom: 25px;
711
+ }
712
+ .desc-small.note-about-colors {
713
+ font-size: 14px;
714
+ color: $color-gray-600;
715
+ margin: 1.5em 0;
716
+ }
717
+ .kst-import-selection-options .kst-template-item {
718
+ padding-bottom: 126%;
719
+ }
720
+ .kst-import-selection img {
721
+ max-width: 100%;
722
+ }
723
+ .kst-import-selection-title h2 span {
724
+ font-weight: bold;
725
+ color: black;
726
+ }
727
+ .appearance_page_kadence-starter-templates .update-nag.notice, .appearance_page_kadence-starter-templates #wpfooter {
728
+ display: none;
729
+ }
730
+ .kadence_theme_starter_dashboard > .notice {
731
+ display: none;
732
+ }
733
+ .demo-title h4 span {
734
+ position: absolute;
735
+ bottom: 100%;
736
+ right: 0;
737
+ padding: 5px 15px;
738
+ background: rgba(0,0,0,0.7);
739
+ color: white;
740
+ font-size: 14px;
741
+ font-weight: 400;
742
+ opacity: 0;
743
+ }
744
+ .kst-import-btn:hover .demo-title h4 span {
745
+ opacity: 1;
746
+ }
747
+ .kst-import-selection-options .kst-template-item .components-button.kst-import-btn .LazyLoad {
748
+ overflow-y: hidden;
749
+ position:absolute;
750
+ top:0;
751
+ left:0;
752
+ right: 0;
753
+ bottom: 40px;
754
+ }
755
+ .kst-import-single-selection-options-wrap .components-button.is-primary {
756
+ padding-left: 30px;
757
+ padding-top: 16px;
758
+ padding-right: 30px;
759
+ font-weight: 700;
760
+ padding-bottom: 16px;
761
+ font-size: 16px;
762
+ height: auto;
763
+ margin-top: 20px;
764
+ }
765
+ .kst-import-selection-footer {
766
+ position: fixed;
767
+ padding: 10px 20px;
768
+ bottom: 0;
769
+ background: white;
770
+ right: 0;
771
+ left: 0;
772
+ margin-left: 160px;
773
+ z-index: 100;
774
+ display: flex;
775
+ justify-content: space-between;
776
+ align-items: center;
777
+ }
778
+ button.components-button.kt-import-fullsite.is-primary {
779
+ padding-left: 30px;
780
+ padding-top: 16px;
781
+ padding-right: 30px;
782
+ font-weight: 700;
783
+ padding-bottom: 16px;
784
+ font-size: 16px;
785
+ height: auto;
786
+ }
787
+ .folded .kst-import-selection-footer {
788
+ margin-left: 36px;
789
+ }
790
+ @media ( max-width: 1059px ) {
791
+ .kst-import-selection-options .templates-grid {
792
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
793
+ }
794
+ }
795
+ @media ( min-width: 1060px ) {
796
+ .kst-import-selection-options .templates-grid {
797
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
798
+ }
799
+ }
800
+ @media ( min-width: 1660px ) {
801
+ .kst-import-selection-options .templates-grid {
802
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
803
+ }
804
+ }
805
+ @media ( min-width: 2360px ) {
806
+ .kst-import-selection-options .templates-grid {
807
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
808
+ }
809
+ }
810
+ .kst-import-single-selection-options-wrap .components-base-control.components-toggle-control {
811
+ margin-bottom: 15px;
812
+ border-top: 1px solid $color-gray-300;
813
+ padding-top: 15px;
814
+ }
815
+ // Import Confirm.
816
+ .components-modal__frame.ksp-confirm-modal {
817
+ max-width: 500px;
818
+ }
819
+ .ksp-override-model-buttons {
820
+ text-align: right;
821
+ }
822
+ .ksp-override-model-buttons .components-button {
823
+ margin-left: 10px;
824
+ }
825
+ // Center
826
+ .main-panel {
827
+ margin: 0 auto;
828
+ max-width: 1260px;
829
+ }
830
+ .main-panel .kst-grid-single-site {
831
+ grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
832
+ grid-gap: 3em;
833
+ }
834
+ .kst-import-selection-bottom {
835
+ text-align: center;
836
+ margin-top: 40px;
837
+ }
838
+ .kadence_theme_dash_head .kadence_theme_dash_head_container {
839
+ margin: 0 auto;
840
+ max-width: 1260px;
841
+ }
842
+ .kst-template-item {
843
+ padding-bottom: 126%;
844
+ }
845
+ .appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions {
846
+ display: flex;
847
+ }
848
+ .appearance_page_kadence-starter-templates .kadence-starter-templates-preview-actions .button:not(.button-primary) {
849
+ margin-right: 10px;
850
+ }
851
+ @media ( max-width: 1059px ) {
852
+ .kst-import-selection-options .templates-grid {
853
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
854
+ }
855
+ }
856
+ @media ( min-width: 1060px ) {
857
+ .kst-import-selection-options .templates-grid {
858
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
859
+ }
860
+ }
861
+ @media ( min-width: 1660px ) {
862
+ .kst-import-selection-options .templates-grid {
863
+ grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
864
+ }
865
  }
kadence-starter-templates.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: Kadence Starter Templates
4
  * Description: Choose the prebuilt website and click to import.
5
- * Version: 1.0.4
6
  * Author: Kadence WP
7
  * Author URI: https://kadencewp.com/
8
  * License: GPLv2 or later
2
  /**
3
  * Plugin Name: Kadence Starter Templates
4
  * Description: Choose the prebuilt website and click to import.
5
+ * Version: 1.1.1
6
  * Author: Kadence WP
7
  * Author URI: https://kadencewp.com/
8
  * License: GPLv2 or later
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: britner
3
  Tags: templates, gutenberg
4
  Requires at least: 5.0
5
- Tested up to: 5.5.1
6
- Stable tag: 1.0.4
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -108,6 +108,11 @@ Absolutely not.
108
 
109
  == Changelog ==
110
 
 
 
 
 
 
111
  = 1.0.4 =
112
  * Add: Customizer import/export (can't be part of Kadence Theme per WordPress review).
113
  * Add: New Learn Dash Demo.
2
  Contributors: britner
3
  Tags: templates, gutenberg
4
  Requires at least: 5.0
5
+ Tested up to: 5.5
6
+ Stable tag: 1.1.1
7
  Requires PHP: 7.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
108
 
109
  == Changelog ==
110
 
111
+ = 1.1.1 =
112
+ * Add: Single Page Import.
113
+ * Add: FontPair Selection.
114
+ * Add: Elementor Templates.
115
+
116
  = 1.0.4 =
117
  * Add: Customizer import/export (can't be part of Kadence Theme per WordPress review).
118
  * Add: New Learn Dash Demo.