/*! For license information please see template-library.js.LICENSE.txt */
(()=>{"use strict";var e={1020(e,t,n){var r=n(6540),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:a,type:e,key:c,ref:u,props:o,_owner:s.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},2361(e,t,n){n.d(t,{A:()=>s});var r=n(4991),a=n.n(r),o=n(6314),i=n.n(o)()(a());i.push([e.id,'.jltma-page-import-modal{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%;z-index:1000}.jltma-page-import-modal .modal-overlay{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#fbfbfb;height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.jltma-page-import-modal .modal-content{-webkit-animation:modalFadeIn .3s ease;animation:modalFadeIn .3s ease;background:#fff;border-radius:12px;-webkit-box-shadow:0 16px 32px -10px rgba(10,13,20,.1),0 3px 8px -5px rgba(10,13,20,.04);box-shadow:0 16px 32px -10px rgba(10,13,20,.1),0 3px 8px -5px rgba(10,13,20,.04);position:relative;text-align:center;z-index:2}.jltma-page-import-modal .confetti-container{height:100%;left:0;overflow:hidden;pointer-events:none;position:absolute;top:0;width:100%;z-index:10}.jltma-page-import-modal .confetti-piece{-webkit-animation:confettiFall 3s linear infinite;animation:confettiFall 3s linear infinite;height:10px;opacity:0;position:absolute;top:-10px;width:10px}@-webkit-keyframes confettiFall{0%{opacity:1;-webkit-transform:translateY(0) rotate(0deg);transform:translateY(0) rotate(0deg)}to{opacity:0;-webkit-transform:translateY(100vh) rotate(2turn);transform:translateY(100vh) rotate(2turn)}}@keyframes confettiFall{0%{opacity:1;-webkit-transform:translateY(0) rotate(0deg);transform:translateY(0) rotate(0deg)}to{opacity:0;-webkit-transform:translateY(100vh) rotate(2turn);transform:translateY(100vh) rotate(2turn)}}.jltma-page-import-modal .import-plugins-container{padding:30px}.jltma-page-import-modal .import-plugins-container .plugins-header{margin-bottom:30px;text-align:center}.jltma-page-import-modal .import-plugins-container .plugins-header .header-icon{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background:linear-gradient(135deg,#6814cd,#f50a7f);border-radius:50%;display:-webkit-box;display:-ms-flexbox;display:flex;height:80px;justify-content:center;margin:0 auto 20px;width:80px}.jltma-page-import-modal .import-plugins-container .plugins-header .header-icon .dashicons{color:#fff;font-size:40px;height:40px;width:40px}.jltma-page-import-modal .import-plugins-container .plugins-header h2{color:#1d2327;font-size:24px;font-weight:600;margin:0 0 10px}.jltma-page-import-modal .import-plugins-container .plugins-header p{color:#6d7882;font-size:14px;line-height:1.6;margin:0}.jltma-page-import-modal .import-plugins-container .required-plugins-list{margin-bottom:30px}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;background:#f8fafc;border:1px solid #e2e8f0;border-radius:6px;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between;margin-bottom:10px;padding:15px;-webkit-transition:all .2s ease;transition:all .2s ease}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item:hover{background:#f1f5f9;border-color:#cbd5e0}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item.active{background:#f0fdf4;border-color:#86efac}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-flex:1;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;gap:12px}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-checkbox-label input[type=checkbox]{accent-color:#6814cd;cursor:pointer;height:18px;width:18px}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-checkbox-label input[type=checkbox]:disabled{cursor:not-allowed;opacity:.5}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-checkbox-label .plugin-info{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:4px}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-checkbox-label .plugin-info .plugin-name{color:#1d2327;font-size:14px;font-weight:500}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-checkbox-label .plugin-info .plugin-version{color:#8c8f94;font-size:12px}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-status{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;font-size:13px}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-status .status-active{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#22c55e;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:500;gap:4px}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-status .status-active .dashicons{font-size:16px;height:16px;width:16px}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-status .status-installed{color:#f59e0b;font-weight:500}.jltma-page-import-modal .import-plugins-container .required-plugins-list .required-plugin-item .plugin-status .status-not-installed{color:#8c8f94;font-weight:500}.jltma-page-import-modal .import-plugins-container .plugins-actions{-webkit-box-pack:end;-ms-flex-pack:end;border-top:1px solid #e2e8f0;display:-webkit-box;display:-ms-flexbox;display:flex;gap:12px;justify-content:flex-end;padding-top:20px}.jltma-page-import-modal .import-plugins-container .plugins-actions .button{border:none;border-radius:6px;cursor:pointer;font-size:14px;font-weight:500;padding:10px 20px;-webkit-transition:all .2s ease;transition:all .2s ease}.jltma-page-import-modal .import-plugins-container .plugins-actions .button.button-primary{background:linear-gradient(135deg,#f50a7f,#6814cd);color:#fff}.jltma-page-import-modal .import-plugins-container .plugins-actions .button.button-primary:hover:not(:disabled){opacity:.9;-webkit-transform:translateY(-1px);-ms-transform:translateY(-1px);transform:translateY(-1px)}.jltma-page-import-modal .import-plugins-container .plugins-actions .button.button-primary:disabled{cursor:not-allowed;opacity:.6}.jltma-page-import-modal .import-plugins-container .plugins-actions .button.button-secondary{background:#fff;border:1px solid #dcdcde;color:#6d7882}.jltma-page-import-modal .import-plugins-container .plugins-actions .button.button-secondary:hover:not(:disabled){border-color:#6814cd;color:#6814cd}.jltma-page-import-modal .import-plugins-container .plugins-actions .button.button-secondary:disabled{cursor:not-allowed;opacity:.6}.jltma-page-import-modal .import-step-container{padding:20px 0}.jltma-page-import-modal .import-step-container .step-icon{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background:linear-gradient(135deg,#f50a7f,#6814cd);border-radius:50%;display:-webkit-box;display:-ms-flexbox;display:flex;height:80px;justify-content:center;margin:0 auto 30px;width:80px}.jltma-page-import-modal .import-step-container .step-icon .dashicons{color:#fff;font-size:40px;height:40px;width:40px}.jltma-page-import-modal .import-step-container .step-icon .dashicons.spinning{-webkit-animation:spin 1.5s linear infinite;animation:spin 1.5s linear infinite}.jltma-page-import-modal .import-step-container h2{color:#1d2327;font-size:24px;font-weight:600;margin:0 0 15px}.jltma-page-import-modal .import-step-container p{color:#6d7882;font-size:15px;line-height:1.6;margin:0 0 30px}.jltma-page-import-modal .import-step-container .progress-bar{background:#e0e0e0;border-radius:3px;height:6px;margin-bottom:15px;overflow:hidden;width:100%}.jltma-page-import-modal .import-step-container .progress-bar .progress-fill{background:linear-gradient(135deg,#f50a7f,#6814cd);height:100%;-webkit-transition:width .5s ease;transition:width .5s ease}.jltma-page-import-modal .import-step-container .step-indicator{color:#8c8f94;font-size:13px;font-weight:500}.jltma-page-import-modal .import-success-container{text-align:center}.jltma-page-import-modal .import-success-container p{color:#6d7882;font-size:16px;line-height:1.5;margin:0 0 40px}.jltma-page-import-modal .import-success-container .success-illustration svg{display:block;height:auto;margin:0 auto;max-width:200px;width:100%}.jltma-page-import-modal .import-success-container .success-illustration:after,.jltma-page-import-modal .import-success-container .success-illustration:before{background:hsla(0,0%,100%,.6);border-radius:50%;content:"";position:absolute}.jltma-page-import-modal .import-success-container .success-illustration:before{-webkit-box-shadow:30px 0 0 hsla(0,0%,100%,.4);box-shadow:30px 0 0 hsla(0,0%,100%,.4);height:25px;left:40px;top:30px;width:60px}.jltma-page-import-modal .import-success-container .success-illustration:after{bottom:40px;-webkit-box-shadow:-40px 0 0 hsla(0,0%,100%,.4);box-shadow:-40px 0 0 hsla(0,0%,100%,.4);height:30px;right:30px;width:80px}.jltma-page-import-modal .import-success-container .success-actions{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;gap:16px;width:100%}.jltma-page-import-modal .import-success-container .success-actions .button{border:none;cursor:pointer;font-size:16px;font-weight:500;outline:none;text-decoration:none;-webkit-transition:all .2s ease;transition:all .2s ease}.jltma-page-import-modal .import-success-container .success-actions .button.button-go-page{background:#e57458;border-radius:8px;-webkit-box-shadow:0 2px 8px rgba(229,116,88,.3);box-shadow:0 2px 8px rgba(229,116,88,.3);color:#fff;max-width:100%;padding:16px 24px;width:100%}.jltma-page-import-modal .import-success-container .success-actions .button.button-go-page:hover{background:#d65d45;-webkit-box-shadow:0 4px 12px rgba(229,116,88,.4);box-shadow:0 4px 12px rgba(229,116,88,.4);-webkit-transform:translateY(-2px);-ms-transform:translateY(-2px);transform:translateY(-2px)}.jltma-page-import-modal .import-success-container .success-actions .button.button-go-page:active{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.jltma-page-import-modal .import-success-container .success-actions .button.button-link{background:rgba(0,0,0,0);color:#1d2327;font-weight:400;padding:8px 16px}.jltma-page-import-modal .import-success-container .success-actions .button.button-link:hover{color:#e57458;text-decoration:underline}.jltma-page-import-modal .import-error-container{padding:20px 0}.jltma-page-import-modal .import-error-container .error-icon{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background:linear-gradient(135deg,#f44336,#e91e63);border-radius:50%;display:-webkit-box;display:-ms-flexbox;display:flex;height:100px;justify-content:center;margin:0 auto 30px;width:100px}.jltma-page-import-modal .import-error-container .error-icon .dashicons{color:#fff;font-size:50px;height:50px;width:50px}.jltma-page-import-modal .import-error-container h2{color:#1d2327;font-size:24px;font-weight:600;margin:0 0 15px}.jltma-page-import-modal .import-error-container p{color:#6d7882;font-size:15px;margin:0 0 30px}.jltma-page-import-modal .import-error-container .error-actions{-webkit-box-pack:center;-ms-flex-pack:center;display:-webkit-box;display:-ms-flexbox;display:flex;gap:12px;justify-content:center}.jltma-page-import-modal .import-error-container .error-actions .button{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background:linear-gradient(135deg,#6814cd,#f50a7f);border:none;border-radius:8px;-webkit-box-shadow:0 4px 15px rgba(104,20,205,.3);box-shadow:0 4px 15px rgba(104,20,205,.3);color:#fff;cursor:pointer;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-size:14px;font-weight:500;gap:8px;outline:none;padding:12px 24px;-webkit-transition:all .3s ease;transition:all .3s ease}.jltma-page-import-modal .import-error-container .error-actions .button .dashicons{font-size:18px;height:18px;width:18px}.jltma-page-import-modal .import-error-container .error-actions .button:hover{-webkit-box-shadow:0 6px 20px rgba(104,20,205,.4);box-shadow:0 6px 20px rgba(104,20,205,.4);-webkit-transform:translateY(-2px);-ms-transform:translateY(-2px);transform:translateY(-2px)}.jltma-page-import-modal .import-error-container .error-actions .button:active{-webkit-transform:translateY(0);-ms-transform:translateY(0);transform:translateY(0)}.jltma-page-import-modal .import-error-container .error-actions .button.button-primary{background:linear-gradient(135deg,#f50a7f,#6814cd)}@-webkit-keyframes modalFadeIn{0%{opacity:0;-webkit-transform:scale(.95) translateY(-10px);transform:scale(.95) translateY(-10px)}to{opacity:1;-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@keyframes modalFadeIn{0%{opacity:0;-webkit-transform:scale(.95) translateY(-10px);transform:scale(.95) translateY(-10px)}to{opacity:1;-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@-webkit-keyframes successPulse{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);transform:scale(1.1)}}@keyframes successPulse{0%,to{-webkit-transform:scale(1);transform:scale(1)}50%{-webkit-transform:scale(1.1);transform:scale(1.1)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.template-library-react-app .wp-components-button.is-primary{background-color:#6a4bff;border-color:#6a4bff}.template-library-react-app .wp-components-button.is-primary:hover:not(:disabled){background-color:#5130ef;border-color:#5130ef}.template-library-react-app .components-search-control .components-search-control__input{border-color:#ddd}.template-library-react-app .components-search-control .components-search-control__input:focus{border-color:#6a4bff;-webkit-box-shadow:0 0 0 2px rgba(106,75,255,.1);box-shadow:0 0 0 2px rgba(106,75,255,.1)}.template-importer-modal{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:999999}.template-importer-modal .modal-overlay{background:rgba(0,0,0,.8);bottom:0;left:0;position:absolute;right:0;top:0}.template-importer-modal .modal-content{max-height:80vh;max-width:600px;overflow:hidden;position:relative;width:90%;z-index:10001}.template-importer-modal .modal-content .modal-header{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:justify;-ms-flex-pack:justify;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:space-between;padding:22px 32px}.template-importer-modal .modal-content .modal-header h3{font-size:18px;font-weight:600;margin:0}.template-importer-modal .modal-content .modal-header .modal-close{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background:none;background:rgba(0,0,0,0);border:none;border-radius:4px;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;padding:8px;-webkit-transition:background-color .2s;transition:background-color .2s}.template-importer-modal .modal-content .modal-header .modal-close .dashicons{font-size:20px;height:20px;width:20px}.template-importer-modal .modal-content .modal-body{padding:32px}.template-importer-modal.template-kit .modal-content{background:#1e1e1e;border-radius:12px;-webkit-box-shadow:0 20px 60px rgba(0,0,0,.5);box-shadow:0 20px 60px rgba(0,0,0,.5)}.template-importer-modal.template-kit .modal-content .modal-header{border-bottom:1px solid #2c2c2c}.template-importer-modal.template-kit .modal-content .modal-header h3{color:#fff}.template-importer-modal.template-kit .modal-content .modal-header .modal-close{color:#64748b}.template-importer-modal.template-kit .modal-content .modal-header .modal-close:hover{background:#2c2c2c;color:#fff}.template-importer-modal.required-plugins-modal .modal-content{background:#fff;border-radius:12px;-webkit-box-shadow:0 4px 20px rgba(0,0,0,.15);box-shadow:0 4px 20px rgba(0,0,0,.15)}.template-importer-modal.required-plugins-modal .modal-content .modal-header{background:#f8fafc;border-bottom:1px solid #e2e8f0}.template-importer-modal.required-plugins-modal .modal-content .modal-header h3{color:#1a202c}.template-importer-modal.required-plugins-modal .modal-content .modal-header .modal-close{color:#64748b}.template-importer-modal.required-plugins-modal .modal-content .modal-header .modal-close:hover{background:#e2e8f0}.template-importer-modal.required-plugins-modal .modal-body p{margin-top:0}.template-importer-modal.required-plugins-modal .modal-body .required-plugins-list .required-plugin-item{background:-webkit-gradient(linear,left top,left bottom,from(rgba(217,83,79,.06)),to(rgba(217,83,79,.03)));background:linear-gradient(180deg,rgba(217,83,79,.06),rgba(217,83,79,.03));border:1px solid rgba(217,83,79,.15);color:#d9534f}.template-importer-modal.required-plugins-modal .modal-body .required-plugins-list .required-plugin-item .plugin-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;gap:12px}.template-importer-modal.required-plugins-modal .modal-body .required-plugins-list .required-plugin-item .plugin-checkbox-label .plugin-info{margin:0}.template-importer-modal.required-plugins-modal .modal-body .required-plugins-list .required-plugin-item .plugin-checkbox-label input[type=checkbox]{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:#fff;border:1.5px solid #cbd5e1;border-radius:50px;cursor:pointer;height:16px;margin:0;outline:none;position:relative;-webkit-transition:all .2s ease;transition:all .2s ease;width:16px}.template-importer-modal.required-plugins-modal .modal-body .required-plugins-list .required-plugin-item .plugin-checkbox-label input[type=checkbox]:focus{-webkit-box-shadow:none;box-shadow:none}.template-importer-modal.required-plugins-modal .modal-body .required-plugins-list .required-plugin-item .plugin-checkbox-label input[type=checkbox]:checked{background-color:#4caf50;border-color:#4caf50}.template-importer-modal.required-plugins-modal .modal-body .required-plugins-list .required-plugin-item .plugin-checkbox-label input[type=checkbox]:checked:after{border:solid #fff;border-width:0 2px 2px 0;content:"";height:7px;left:5px;position:absolute;top:2px;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);width:3px}.template-importer-modal.required-plugins-modal .modal-body .required-plugins-list .required-plugin-item:has(input[type=checkbox]:checked){background:#f0f8ff;border-color:#2271b1}.template-importer-modal.required-plugins-modal .modal-body .install-selected-btn{-webkit-transition:all .5s ease-in;transition:all .5s ease-in}',"",{version:3,sources:["webpack://./dev/admin/template-library/styles/page-import-modal.scss","webpack://./dev/admin/template-library/styles/index.scss"],names:[],mappings:"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",sourcesContent:['// Page Import Modal Styles\n.jltma-page-import-modal {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1000;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .modal-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: #fbfbfb;\n backdrop-filter: blur(2px);\n z-index: 1;\n }\n\n .modal-content {\n position: relative;\n background: #ffffff;\n border-radius: 12px;\n z-index: 2;\n box-shadow: 0px 16px 32px -10px rgba(10, 13, 20, 0.1),\n 0px 3px 8px -5px rgba(10, 13, 20, 0.04);\n text-align: center;\n animation: modalFadeIn 0.3s ease;\n }\n\n // Confetti Animation\n .confetti-container {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n overflow: hidden;\n pointer-events: none;\n z-index: 10;\n }\n\n .confetti-piece {\n position: absolute;\n width: 10px;\n height: 10px;\n top: -10px;\n opacity: 0;\n animation: confettiFall 3s linear infinite;\n }\n\n @keyframes confettiFall {\n 0% {\n transform: translateY(0) rotate(0deg);\n opacity: 1;\n }\n 100% {\n transform: translateY(100vh) rotate(720deg);\n opacity: 0;\n }\n }\n\n // Plugin Requirements Container (Step 0)\n .import-plugins-container {\n padding: 30px;\n\n .plugins-header {\n text-align: center;\n margin-bottom: 30px;\n\n .header-icon {\n width: 80px;\n height: 80px;\n margin: 0 auto 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: linear-gradient(135deg, #6814cd 0%, #f50a7f 100%);\n border-radius: 50%;\n\n .dashicons {\n font-size: 40px;\n width: 40px;\n height: 40px;\n color: #fff;\n }\n }\n\n h2 {\n font-size: 24px;\n font-weight: 600;\n color: #1d2327;\n margin: 0 0 10px;\n }\n\n p {\n font-size: 14px;\n color: #6d7882;\n margin: 0;\n line-height: 1.6;\n }\n }\n\n .required-plugins-list {\n margin-bottom: 30px;\n\n .required-plugin-item {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 15px;\n margin-bottom: 10px;\n background: #f8fafc;\n border: 1px solid #e2e8f0;\n border-radius: 6px;\n transition: all 0.2s ease;\n\n &:hover {\n background: #f1f5f9;\n border-color: #cbd5e0;\n }\n\n &.active {\n background: #f0fdf4;\n border-color: #86efac;\n }\n\n .plugin-checkbox-label {\n display: flex;\n align-items: center;\n gap: 12px;\n cursor: pointer;\n flex: 1;\n\n input[type="checkbox"] {\n width: 18px;\n height: 18px;\n cursor: pointer;\n accent-color: #6814cd;\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n }\n\n .plugin-info {\n display: flex;\n flex-direction: column;\n gap: 4px;\n\n .plugin-name {\n font-size: 14px;\n font-weight: 500;\n color: #1d2327;\n }\n\n .plugin-version {\n font-size: 12px;\n color: #8c8f94;\n }\n }\n }\n\n .plugin-status {\n display: flex;\n align-items: center;\n font-size: 13px;\n\n .status-active {\n display: flex;\n align-items: center;\n gap: 4px;\n color: #22c55e;\n font-weight: 500;\n\n .dashicons {\n font-size: 16px;\n width: 16px;\n height: 16px;\n }\n }\n\n .status-installed {\n color: #f59e0b;\n font-weight: 500;\n }\n\n .status-not-installed {\n color: #8c8f94;\n font-weight: 500;\n }\n }\n }\n }\n\n .plugins-actions {\n display: flex;\n gap: 12px;\n justify-content: flex-end;\n padding-top: 20px;\n border-top: 1px solid #e2e8f0;\n\n .button {\n padding: 10px 20px;\n font-size: 14px;\n font-weight: 500;\n border-radius: 6px;\n cursor: pointer;\n transition: all 0.2s ease;\n border: none;\n\n &.button-primary {\n background: linear-gradient(135deg, #f50a7f 0%, #6814cd 100%);\n color: #fff;\n\n &:hover:not(:disabled) {\n opacity: 0.9;\n transform: translateY(-1px);\n }\n\n &:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n }\n\n &.button-secondary {\n background: #fff;\n border: 1px solid #dcdcde;\n color: #6d7882;\n\n &:hover:not(:disabled) {\n border-color: #6814cd;\n color: #6814cd;\n }\n\n &:disabled {\n opacity: 0.6;\n cursor: not-allowed;\n }\n }\n }\n }\n }\n\n // Import Steps Container\n .import-step-container {\n padding: 20px 0;\n\n .step-icon {\n width: 80px;\n height: 80px;\n margin: 0 auto 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: linear-gradient(135deg, #f50a7f 0%, #6814cd 100%);\n border-radius: 50%;\n\n .dashicons {\n font-size: 40px;\n width: 40px;\n height: 40px;\n color: #fff;\n\n &.spinning {\n animation: spin 1.5s linear infinite;\n }\n }\n }\n\n h2 {\n font-size: 24px;\n font-weight: 600;\n color: #1d2327;\n margin: 0 0 15px;\n }\n\n p {\n font-size: 15px;\n color: #6d7882;\n line-height: 1.6;\n margin: 0 0 30px;\n }\n\n .progress-bar {\n width: 100%;\n height: 6px;\n background: #e0e0e0;\n border-radius: 3px;\n overflow: hidden;\n margin-bottom: 15px;\n\n .progress-fill {\n height: 100%;\n background: linear-gradient(135deg, #f50a7f 0%, #6814cd 100%);\n transition: width 0.5s ease;\n }\n }\n\n .step-indicator {\n font-size: 13px;\n color: #8c8f94;\n font-weight: 500;\n }\n }\n\n // Success Container\n .import-success-container {\n text-align: center;\n\n p {\n font-size: 16px;\n color: #6d7882;\n margin: 0 0 40px;\n line-height: 1.5;\n }\n\n .success-illustration {\n svg {\n width: 100%;\n max-width: 200px;\n height: auto;\n display: block;\n margin: 0 auto;\n }\n\n // Clouds decoration\n &::before,\n &::after {\n content: "";\n position: absolute;\n background: rgba(255, 255, 255, 0.6);\n border-radius: 50%;\n }\n\n &::before {\n width: 60px;\n height: 25px;\n top: 30px;\n left: 40px;\n box-shadow: 30px 0 0 rgba(255, 255, 255, 0.4);\n }\n\n &::after {\n width: 80px;\n height: 30px;\n bottom: 40px;\n right: 30px;\n box-shadow: -40px 0 0 rgba(255, 255, 255, 0.4);\n }\n }\n\n .success-actions {\n display: flex;\n gap: 16px;\n align-items: center;\n width: 100%;\n\n .button {\n font-size: 16px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s ease;\n border: none;\n outline: none;\n text-decoration: none;\n\n &.button-go-page {\n width: 100%;\n max-width: 100%;\n padding: 16px 24px;\n background: #e57458;\n color: #fff;\n border-radius: 8px;\n box-shadow: 0 2px 8px rgba(229, 116, 88, 0.3);\n\n &:hover {\n background: #d65d45;\n transform: translateY(-2px);\n box-shadow: 0 4px 12px rgba(229, 116, 88, 0.4);\n }\n\n &:active {\n transform: translateY(0);\n }\n }\n\n &.button-link {\n background: transparent;\n color: #1d2327;\n padding: 8px 16px;\n font-weight: 400;\n\n &:hover {\n color: #e57458;\n text-decoration: underline;\n }\n }\n }\n }\n }\n\n // Error Container\n .import-error-container {\n padding: 20px 0;\n\n .error-icon {\n width: 100px;\n height: 100px;\n margin: 0 auto 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n background: linear-gradient(135deg, #f44336 0%, #e91e63 100%);\n border-radius: 50%;\n\n .dashicons {\n font-size: 50px;\n width: 50px;\n height: 50px;\n color: #fff;\n }\n }\n\n h2 {\n font-size: 24px;\n font-weight: 600;\n color: #1d2327;\n margin: 0 0 15px;\n }\n\n p {\n font-size: 15px;\n color: #6d7882;\n margin: 0 0 30px;\n }\n\n .error-actions {\n display: flex;\n gap: 12px;\n justify-content: center;\n\n .button {\n padding: 12px 24px;\n font-size: 14px;\n font-weight: 500;\n border-radius: 8px;\n cursor: pointer;\n transition: all 0.3s ease;\n display: inline-flex;\n align-items: center;\n gap: 8px;\n border: none;\n outline: none;\n background: linear-gradient(135deg, #6814cd 0%, #f50a7f 100%);\n color: #fff;\n box-shadow: 0 4px 15px rgba(104, 20, 205, 0.3);\n\n .dashicons {\n font-size: 18px;\n width: 18px;\n height: 18px;\n }\n\n &:hover {\n transform: translateY(-2px);\n box-shadow: 0 6px 20px rgba(104, 20, 205, 0.4);\n }\n\n &:active {\n transform: translateY(0);\n }\n\n &.button-primary {\n background: linear-gradient(135deg, #f50a7f 0%, #6814cd 100%);\n }\n }\n }\n }\n\n @keyframes modalFadeIn {\n from {\n opacity: 0;\n transform: scale(0.95) translateY(-10px);\n }\n to {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n }\n\n @keyframes successPulse {\n 0%,\n 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.1);\n }\n }\n\n @keyframes spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n }\n}\n','// Template Library React App Styles\n// Additional component-specific styles that complement the main SCSS\n\n// Import Page Import Modal styles\n@use "./page-import-modal.scss";\n\n.template-library-react-app {\n // Component-specific overrides can go here\n // The main styles are in assets/scss/templates/library/template-library.scss\n\n .wp-components-button {\n &.is-primary {\n background-color: #6a4bff;\n border-color: #6a4bff;\n\n &:hover:not(:disabled) {\n background-color: #5130ef;\n border-color: #5130ef;\n }\n }\n }\n\n .components-search-control {\n .components-search-control__input {\n border-color: #ddd;\n\n &:focus {\n border-color: #6a4bff;\n box-shadow: 0 0 0 2px rgba(106, 75, 255, 0.1);\n }\n }\n }\n}\n\n// Template Importer Modal Styles\n.template-importer-modal {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 999999;\n display: flex;\n justify-content: center;\n align-items: center;\n\n .modal-overlay {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.8);\n }\n\n .modal-content {\n position: relative;\n max-width: 600px;\n width: 90%;\n max-height: 80vh;\n overflow: hidden;\n z-index: 10001;\n\n .modal-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 22px 32px;\n\n h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n }\n\n .modal-close {\n background: none;\n border: none;\n padding: 8px;\n cursor: pointer;\n border-radius: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background-color 0.2s;\n background: transparent;\n\n .dashicons {\n font-size: 20px;\n width: 20px;\n height: 20px;\n }\n }\n }\n\n .modal-body {\n padding: 32px;\n }\n }\n\n &.template-kit {\n .modal-content {\n background: #1e1e1e;\n border-radius: 12px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n .modal-header {\n border-bottom: 1px solid #2c2c2c;\n h3 {\n color: #ffffff;\n }\n\n .modal-close {\n color: #64748b;\n\n &:hover {\n background: #2c2c2c;\n color: #ffffff;\n }\n }\n }\n }\n }\n &.required-plugins-modal {\n .modal-content {\n border-radius: 12px;\n background: #fff;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n\n .modal-header {\n border-bottom: 1px solid #e2e8f0;\n background: #f8fafc;\n\n h3 {\n color: #1a202c;\n }\n\n .modal-close {\n color: #64748b;\n &:hover {\n background: #e2e8f0;\n }\n }\n }\n }\n\n .modal-body {\n p {\n margin-top: 0;\n }\n\n .required-plugins-list {\n .required-plugin-item {\n color: #d9534f;\n background: linear-gradient(\n 180deg,\n rgba(217, 83, 79, 0.06),\n rgba(217, 83, 79, 0.03)\n );\n border: 1px solid rgba(217, 83, 79, 0.15);\n\n .plugin-checkbox-label {\n display: flex;\n align-items: center;\n gap: 12px;\n\n .plugin-info {\n margin: 0;\n }\n\n input[type="checkbox"] {\n margin: 0;\n appearance: none;\n width: 16px;\n height: 16px;\n border: 1.5px solid #cbd5e1;\n border-radius: 50px;\n position: relative;\n cursor: pointer;\n outline: none;\n transition: all 0.2s ease;\n background: #fff;\n outline: none;\n\n &:focus {\n box-shadow: none;\n }\n }\n\n input[type="checkbox"]:checked {\n border-color: #4caf50;\n background-color: #4caf50;\n &::after {\n content: "";\n position: absolute;\n top: 2px;\n left: 5px;\n width: 3px;\n height: 7px;\n border: solid white;\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n }\n }\n }\n\n &:has(input[type="checkbox"]:checked) {\n background: #f0f8ff;\n border-color: #2271b1;\n }\n }\n }\n\n .install-selected-btn {\n transition: all 0.5s ease-in;\n }\n }\n }\n}\n'],sourceRoot:""}]);const s=i},4848(e,t,n){e.exports=n(1020)},4991(e){function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,a,o=[],i=!0,s=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){s=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(s)throw a}}return o}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=function(e){var n=t(e,4),r=n[1],a=n[3];if(!a)return r;if("function"==typeof btoa){var o=btoa(unescape(encodeURIComponent(JSON.stringify(a)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(o),s="/*# ".concat(i," */"),l=a.sources.map(function(e){return"/*# sourceURL=".concat(a.sourceRoot||"").concat(e," */")});return[r].concat(l).concat([s]).join("\n")}return[r].join("\n")}},5072(e,t,n){var r,a=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),i=[];function s(e){for(var t=-1,n=0;n<i.length;n++)if(i[n].identifier===e){t=n;break}return t}function l(e,t){for(var n={},r=[],a=0;a<e.length;a++){var o=e[a],l=t.base?o[0]+t.base:o[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var A=s(u),d={css:o[1],media:o[2],sourceMap:o[3]};-1!==A?(i[A].references++,i[A].updater(d)):i.push({identifier:u,updater:g(d,t),references:1}),r.push(u)}return r}function c(e){var t=document.createElement("style"),r=e.attributes||{};if(void 0===r.nonce){var a=n.nc;a&&(r.nonce=a)}if(Object.keys(r).forEach(function(e){t.setAttribute(e,r[e])}),"function"==typeof e.insert)e.insert(t);else{var i=o(e.insert||"head");if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(t)}return t}var u,A=(u=[],function(e,t){return u[e]=t,u.filter(Boolean).join("\n")});function d(e,t,n,r){var a=n?"":r.media?"@media ".concat(r.media," {").concat(r.css,"}"):r.css;if(e.styleSheet)e.styleSheet.cssText=A(t,a);else{var o=document.createTextNode(a),i=e.childNodes;i[t]&&e.removeChild(i[t]),i.length?e.insertBefore(o,i[t]):e.appendChild(o)}}function p(e,t,n){var r=n.css,a=n.media,o=n.sourceMap;if(a?e.setAttribute("media",a):e.removeAttribute("media"),o&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(o))))," */")),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}var m=null,f=0;function g(e,t){var n,r,a;if(t.singleton){var o=f++;n=m||(m=c(t)),r=d.bind(null,n,o,!1),a=d.bind(null,n,o,!0)}else n=c(t),r=p.bind(null,n,t),a=function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(n)};return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else a()}}e.exports=function(e,t){(t=t||{}).singleton||"boolean"==typeof t.singleton||(t.singleton=a());var n=l(e=e||[],t);return function(e){if(e=e||[],"[object Array]"===Object.prototype.toString.call(e)){for(var r=0;r<n.length;r++){var a=s(n[r]);i[a].references--}for(var o=l(e,t),c=0;c<n.length;c++){var u=s(n[c]);0===i[u].references&&(i[u].updater(),i.splice(u,1))}n=o}}}},5287(e,t){var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),A=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function h(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}function b(){}function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}h.prototype.isReactComponent={},h.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},h.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},b.prototype=h.prototype;var x=v.prototype=new b;x.constructor=v,f(x,h.prototype),x.isPureReactComponent=!0;var y=Array.isArray,C=Object.prototype.hasOwnProperty,w={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function k(e,t,r){var a,o={},i=null,s=null;if(null!=t)for(a in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(i=""+t.key),t)C.call(t,a)&&!j.hasOwnProperty(a)&&(o[a]=t[a]);var l=arguments.length-2;if(1===l)o.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(a in l=e.defaultProps)void 0===o[a]&&(o[a]=l[a]);return{$$typeof:n,type:e,key:i,ref:s,props:o,_owner:w.current}}function _(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var E=/\/+/g;function N(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function S(e,t,a,o,i){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var l=!1;if(null===e)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case n:case r:l=!0}}if(l)return i=i(l=e),e=""===o?"."+N(l,0):o,y(i)?(a="",null!=e&&(a=e.replace(E,"$&/")+"/"),S(i,t,a,"",function(e){return e})):null!=i&&(_(i)&&(i=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(i,a+(!i.key||l&&l.key===i.key?"":(""+i.key).replace(E,"$&/")+"/")+e)),t.push(i)),1;if(l=0,o=""===o?".":o+":",y(e))for(var c=0;c<e.length;c++){var u=o+N(s=e[c],c);l+=S(s,t,a,u,i)}else if(u=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof u)for(e=u.call(e),c=0;!(s=e.next()).done;)l+=S(s=s.value,t,a,u=o+N(s,c++),i);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function B(e,t,n){if(null==e)return e;var r=[],a=0;return S(e,r,"","",function(e){return t.call(n,e,a++)}),r}function O(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var T={current:null},P={transition:null},F={ReactCurrentDispatcher:T,ReactCurrentBatchConfig:P,ReactCurrentOwner:w};function I(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:B,forEach:function(e,t,n){B(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return B(e,function(){t++}),t},toArray:function(e){return B(e,function(e){return e})||[]},only:function(e){if(!_(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=h,t.Fragment=a,t.Profiler=i,t.PureComponent=v,t.StrictMode=o,t.Suspense=u,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,t.act=I,t.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var a=f({},e.props),o=e.key,i=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(i=t.ref,s=w.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)C.call(t,c)&&!j.hasOwnProperty(c)&&(a[c]=void 0===t[c]&&void 0!==l?l[c]:t[c])}var c=arguments.length-2;if(1===c)a.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}return{$$typeof:n,type:e.type,key:o,ref:i,props:a,_owner:s}},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=k,t.createFactory=function(e){var t=k.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=_,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:O}},t.memo=function(e,t){return{$$typeof:A,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=P.transition;P.transition={};try{e()}finally{P.transition=t}},t.unstable_act=I,t.useCallback=function(e,t){return T.current.useCallback(e,t)},t.useContext=function(e){return T.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return T.current.useDeferredValue(e)},t.useEffect=function(e,t){return T.current.useEffect(e,t)},t.useId=function(){return T.current.useId()},t.useImperativeHandle=function(e,t,n){return T.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return T.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return T.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return T.current.useMemo(e,t)},t.useReducer=function(e,t,n){return T.current.useReducer(e,t,n)},t.useRef=function(e){return T.current.useRef(e)},t.useState=function(e){return T.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return T.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return T.current.useTransition()},t.version="18.3.1"},6314(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n}).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var a={};if(r)for(var o=0;o<this.length;o++){var i=this[o][0];null!=i&&(a[i]=!0)}for(var s=0;s<e.length;s++){var l=[].concat(e[s]);r&&a[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),t.push(l))}},t}},6540(e,t,n){e.exports=n(5287)}},t={};function n(r){var a=t[r];if(void 0!==a)return a.exports;var o=t[r]={id:r,exports:{}};return e[r](o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.nc=void 0;const r=wp.element,a=wp.i18n;var o=n(4848);function i(){return(0,o.jsx)("div",{className:"scroll-icon",animate:{rotate:[0,-5,5,-5,0]},transition:{duration:1.5,repeat:1/0},children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 66 124",fillRule:"nonzero",strokeLinejoin:"round",strokeMiterlimit:"2",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",children:(0,o.jsx)("path",{d:"M7 49v25.6c0 14 11.5 25.6 25.6 25.6s25.6-11.5 25.6-25.6V49c0-14-11.5-25.6-25.6-25.6S7 35 7 49zm25.6-20a20 20 0 0 1 19.9 20v25.6a20 20 0 0 1-19.9 19.9 20 20 0 0 1-19.9-19.9V49a20 20 0 0 1 19.9-19.9zm0 24.3c1.6 0 2.8-1.3 2.8-2.8V42c0-1.6-1.3-2.8-2.8-2.8s-2.8 1.3-2.8 2.8v8.5c0 1.6 1.3 2.8 2.8 2.8zm-2 68.7c.6.6 1.3 1 2 1s1.4-.3 2-1l7-7c1-1 1-2.8 0-4s-2.8-1-4 0l-5 5-5-5c-1-1-2.8-1-4 0s-1 2.8 0 4l7 7zm0-120.5l-7 7c-1 1-1 2.8 0 4 .6.6 1.3 1 2 1s1.4-.3 2-1l5-5 5 5c.6.6 1.3 1 2 1s1.4-.3 2-1c1-1 1-2.8 0-4l-7-7c-1-1-2.8-1-4 0z"})})})}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const c=function(e){var t=e.thumbnail,n=e.title,a=e.onPreview,l=(0,r.useRef)(null),c=(0,r.useRef)(null),u=s((0,r.useState)(0),2),A=u[0],d=u[1],p=s((0,r.useState)(!1),2),m=p[0],f=p[1],g=function(){var e;return(null===(e=window.JLTMATemplateLibrary)||void 0===e?void 0:e.pluginUrl)+"/assets/images/placeholder.png"};(0,r.useEffect)(function(){if(c.current){var e=function(){d(c.current.offsetHeight)};return c.current.addEventListener("load",e),window.addEventListener("resize",e),function(){c.current&&c.current.removeEventListener("load",e),window.removeEventListener("resize",e)}}},[]);var h=Math.max(0,A-200);return(0,o.jsxs)("div",{className:"template-preview",ref:l,onMouseEnter:function(){return f(!0)},onMouseLeave:function(){return f(!1)},onTouchStart:function(){return f(!0)},onTouchEnd:function(){return f(!1)},onClick:a,style:{cursor:"pointer"},children:[(0,o.jsx)("img",{ref:c,src:t||g(),alt:n,onError:function(e){e.target.src=g()},className:"template-image ".concat(m?"image-hovering":""),style:{"--translate-y":"".concat(-h,"px")}}),(0,o.jsx)(i,{})]})};n(6540);const u=function(e){var t=e.template,n=e.parentTemplate||t;return n?n.purchasable?(0,o.jsx)("span",{className:"purchase-badge",children:"PURCHASE"}):n.is_pro?(0,o.jsx)("span",{className:"pro-badge",children:"PRO"}):(0,o.jsx)("span",{className:"free-badge",children:"FREE"}):null};var A="jltma_favorites",d=function(){try{!function(){try{var e=localStorage.getItem(A);if(!e)return;var t=JSON.parse(e);if(Array.isArray(t)){var n={library:t,kits:[]};localStorage.setItem(A,JSON.stringify(n))}}catch(e){console.error("Error migrating favorites:",e)}}();var e=localStorage.getItem(A);return e?JSON.parse(e):{library:[],kits:[]}}catch(e){return console.error("Error getting favorites:",e),{library:[],kits:[]}}},p=function(e){return d()[e]||[]},m=function(e,t){try{var n=d(),r=n[t]||[];return!r.includes(e)&&(r.push(e),n[t]=r,localStorage.setItem(A,JSON.stringify(n)),window.dispatchEvent(new CustomEvent("jltma-favorites-updated",{detail:{templateType:t,action:"add",templateId:e}})),!0)}catch(e){return console.error("Error adding favorite:",e),!1}},f=function(e,t){try{var n=d(),r=(n[t]||[]).filter(function(t){return t!==e});return n[t]=r,localStorage.setItem(A,JSON.stringify(n)),window.dispatchEvent(new CustomEvent("jltma-favorites-updated",{detail:{templateType:t,action:"remove",templateId:e}})),!0}catch(e){return console.error("Error removing favorite:",e),!1}};function g(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return h(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],A=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,l=e,d.n=n,i}};function p(n,r){for(s=n,l=r,t=0;!A&&c&&!a&&t<u.length;t++){var a,o=u[t],p=d.p,m=o[2];n>3?(a=m===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((a=n<2&&p<o[1])?(s=0,d.v=r,d.n=o[1]):p<m&&(a=n<3||o[0]>r||r>m)&&(o[4]=n,o[5]=r,d.n=m,s=0))}if(a||n>1)return i;throw A=!0,r}return function(a,u,m){if(c>1)throw TypeError("Generator is already running");for(A&&1===u&&p(u,m),s=u,l=m;(t=s<2?e:l)||!A;){o||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(A=d.n<0)?l:n.call(r,d))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:A}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(h(t={},r,function(){return this}),t),A=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,h(e,a,"GeneratorFunction")),e.prototype=Object.create(A),e}return l.prototype=c,h(A,"constructor",c),h(c,"constructor",l),l.displayName="GeneratorFunction",h(c,a,"GeneratorFunction"),h(A),h(A,a,"Generator"),h(A,r,function(){return this}),h(A,"toString",function(){return"[object Generator]"}),(g=function(){return{w:o,m:d}})()}function h(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}h=function(e,t,n,r){function o(t,n){h(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},h(e,t,n,r)}function b(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function v(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){b(o,r,a,i,s,"next",e)}function s(e){b(o,r,a,i,s,"throw",e)}i(void 0)})}}function x(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const C=function(e){var t=e.templateId,n=e.templateType,i=void 0===n?"library":n,s=x((0,r.useState)(!1),2),l=s[0],c=s[1],u=x((0,r.useState)(0),2),A=u[0],d=u[1];(0,r.useEffect)(function(){var e=function(e,t){return p(t).includes(e)}(t,i);c(e)},[t,i]),(0,r.useEffect)(function(){var e=function(){var e=v(g().m(function e(){var n,r,a;return g().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fetch("https://el.master-addons.com/wp-json/jltma/v1/favorites/counts?template_ids=".concat(t));case 1:if(!(n=e.v).ok){e.n=3;break}return e.n=2,n.json();case 2:(r=e.v).success&&r.counts&&r.counts[t]&&d(r.counts[t]);case 3:e.n=5;break;case 4:e.p=4,a=e.v,console.error("Error fetching favorite count:",a);case 5:return e.a(2)}},e,null,[[0,4]])}));return function(){return e.apply(this,arguments)}}();e()},[t]);var h=function(){var e=v(g().m(function e(){return g().w(function(e){for(;;)switch(e.n){case 0:if(!l){e.n=2;break}if(!f(t,i)){e.n=1;break}return c(!1),d(function(e){return Math.max(0,e-1)}),e.n=1,b(t,!1,i);case 1:e.n=3;break;case 2:if(!m(t,i)){e.n=3;break}return c(!0),d(function(e){return e+1}),e.n=3,b(t,!0,i);case 3:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}(),b=function(){var e=v(g().m(function e(t,n,r){var a,o;return g().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,fetch("https://el.master-addons.com/wp-json/jltma/v1/favorites",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({template_id:t,action:n?"add":"remove",template_type:r,user_id:(null===(a=window.JLTMATemplateLibrary)||void 0===a?void 0:a.userId)||"guest",site_url:window.location.hostname})});case 1:e.v.ok||console.warn("Failed to sync favorite to API"),e.n=3;break;case 2:e.p=2,o=e.v,console.error("Error syncing favorite to API:",o);case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t,n,r){return e.apply(this,arguments)}}();return(0,o.jsx)("button",{className:"template-favorite-btn ".concat(l?"is-favorite":""," has-tooltip"),onClick:h,title:l?(0,a.__)("Remove from favorites","master-addons"):(0,a.__)("Add to favorites","master-addons"),"aria-label":l?(0,a.__)("Remove from favorites","master-addons"):(0,a.__)("Add to favorites","master-addons"),"data-tooltip":A>0?"Loved by ".concat(A," ").concat(1===A?"user":"users"):l?"Click to remove from favorites":"Click to add to favorites",children:(0,o.jsx)("span",{className:l?"eicon-heart":"eicon-heart-o"})})};const w=function(e){var t,n=e.template,r=e.parentTemplate,i=e.mode,s=e.isProUser,l=e.isImporting,c=e.onPreview,u=e.onImport,A=e.onOpenKit,d=e.onPageImportModeImport,p="kits"===i&&!(null!=n&&n.type),m="kits"===i&&(null==n?void 0:n.type),f=m?null==r?void 0:r.purchasable:null==n?void 0:n.purchasable,g=m?null==r?void 0:r.purchase_url:null==n?void 0:n.purchase_url,h=(null==r?void 0:r.is_pro)||(null==n?void 0:n.is_pro),b=!0===window.JLTMA_IS_PAGE_IMPORTER_MODE;t="library"===i?!!l:"kits"===i&&(!!m&&!!l[n.template_id]);var v=[];if(p&&!b&&v.push((0,o.jsxs)("button",{className:"template-view-btn",onClick:function(){return A(n,n.categories[0])},children:[(0,o.jsx)("span",{className:"dashicons dashicons-plus-alt"}),(0,a.__)("View Kit","master-addons")]},"view-kit")),!b&&null!=n&&n.preview_url&&v.push((0,o.jsxs)("button",{className:"template-preview-btn",onClick:c,children:[(0,o.jsx)("span",{className:"eicon-preview-medium"}),(0,a.__)("Preview","master-addons")]},"preview")),p&&b&&v.push((0,o.jsx)("button",{className:"template-view-btn",onClick:function(){return A(n,n.categories[0])},children:(0,a.__)("View & Insert Kit","master-addons")},"view-kit")),!p)if(f)v.push((0,o.jsxs)("button",{className:"template-purchase-btn",onClick:function(){return window.open(g||"#","_blank")},children:[(0,o.jsx)("span",{className:"eicon-product-add-to-cart"}),(0,a.__)("Purchase","master-addons")]},"purchase"));else if(h&&!s)v.push((0,o.jsx)("button",{className:"upgrade-to-pro",onClick:function(){return window.open("https://master-addons.com/pricing","_blank")},children:(0,a.__)("Upgrade to PRO","master-addons")},"upgrade"));else if(b){var x=(0,a.__)("View & Insert","master-addons"),y=(0,a.__)("Inserting...","master-addons");v.push((0,o.jsx)("button",{className:"template-import-btn",onClick:function(){return d()},disabled:t,title:x,children:t?y:x},"import"))}else{var C=(0,a.__)((0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"dashicons dashicons-plus-alt"}),(0,a.__)("Import","master-addons")]})),w=(0,a.__)((0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"dashicons dashicons-plus-alt"}),(0,a.__)("Importing...","master-addons")]}));v.push((0,o.jsx)("button",{className:"template-import-btn",onClick:u,disabled:t,title:C,children:t?w:C},"import"))}return(0,o.jsx)("div",{className:"template-actions",children:v})};function j(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return k(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],A=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,l=e,d.n=n,i}};function p(n,r){for(s=n,l=r,t=0;!A&&c&&!a&&t<u.length;t++){var a,o=u[t],p=d.p,m=o[2];n>3?(a=m===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((a=n<2&&p<o[1])?(s=0,d.v=r,d.n=o[1]):p<m&&(a=n<3||o[0]>r||r>m)&&(o[4]=n,o[5]=r,d.n=m,s=0))}if(a||n>1)return i;throw A=!0,r}return function(a,u,m){if(c>1)throw TypeError("Generator is already running");for(A&&1===u&&p(u,m),s=u,l=m;(t=s<2?e:l)||!A;){o||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(A=d.n<0)?l:n.call(r,d))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:A}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(k(t={},r,function(){return this}),t),A=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,k(e,a,"GeneratorFunction")),e.prototype=Object.create(A),e}return l.prototype=c,k(A,"constructor",c),k(c,"constructor",l),l.displayName="GeneratorFunction",k(c,a,"GeneratorFunction"),k(A),k(A,a,"Generator"),k(A,r,function(){return this}),k(A,"toString",function(){return"[object Generator]"}),(j=function(){return{w:o,m:d}})()}function k(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}k=function(e,t,n,r){function o(t,n){k(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},k(e,t,n,r)}function _(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_(Object(n),!0).forEach(function(t){N(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function N(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=S(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==S(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function B(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function O(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){B(o,r,a,i,s,"next",e)}function s(e){B(o,r,a,i,s,"throw",e)}i(void 0)})}}const T=function(e){var t,n,r,i,s=e.template,l=e.onImport,A=e.onPreview,d=e.onOpenKit,p=e.mode,m=e.parentTemplate,f=e.isImporting,g=(e.setIsImporting,e.isProUser),h=(e.requiredPlugins,e.pluginStatuses,"kits"===p?"kits":"library");m&&(s.is_pro=m.is_pro);var b;m||(s.thumbnail&&""!==s.thumbnail||(s.thumbnail=null===(b=s.manifest)||void 0===b?void 0:b.templates[0].screenshot));var v=m&&m.categories&&m.categories.includes("purchased"),x=!m&&s.categories&&s.categories.includes("purchased"),y=function(){return!0},k=function(){var e=O(j().m(function e(){var t,n,r,o=arguments;return j().w(function(e){for(;;)switch(e.p=e.n){case 0:if("object"===S(t=o.length>0&&void 0!==o[0]?o[0]:null)&&(t=s.title),"kits"!==p||y()){e.n=1;break}return alert((0,a.__)("Please install and activate all required plugins before importing this template.","master-addons")),e.a(2);case 1:return e.p=1,n=t?E(E({},s),{},{page_name:t}):s,e.n=2,l(n);case 2:e.n=4;break;case 3:e.p=3,r=e.v,window.swal({title:"Import Failed",text:"An error occurred during template import: ".concat(r.message),icon:"error",confirmButtonColor:"#d33",confirmButtonText:"OK"});case 4:return e.a(2)}},e,null,[[1,3]])}));return function(){return e.apply(this,arguments)}}(),_=function(){var e=O(j().m(function e(){var t;return j().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,l(s,m.kit_id.split("-").slice(-1)[0]);case 1:e.n=3;break;case 2:e.p=2,t=e.v,window.swal({title:"Import Failed",text:"An error occurred during kit import: ".concat(t.message),icon:"error",confirmButtonColor:"#d33",confirmButtonText:"OK"});case 3:return e.a(2)}},e,null,[[0,2]])}));return function(){return e.apply(this,arguments)}}(),N=function(){"kits"===p?x||v?x&&s.preview_url?window.open(s.preview_url,"_blank"):v&&m.preview_url&&window.open(m.preview_url,"_blank"):A(m?m.kit_id:s.kit_id):A(s)};return(0,o.jsxs)("div",{className:"template-item item-".concat(null!==(t=null==s?void 0:s.template_id)&&void 0!==t?t:s.kit_id),"data-key":null!==(r=null==s?void 0:s.template_id)&&void 0!==r?r:s.kit_id,children:[(0,o.jsx)(c,{thumbnail:s.thumbnail,title:s.title||s.kit_name,onPreview:N}),(0,o.jsxs)("div",{className:"template-info",children:[(0,o.jsxs)("div",{className:"template-title",children:[(0,o.jsxs)("h3",{children:[null!==(i=s.title)&&void 0!==i?i:s.kit_name,!x&&(0,o.jsx)(C,{templateId:s.id||s.template_id||s.kit_id,templateType:h})]}),(0,o.jsx)(u,{template:s,parentTemplate:m})]}),(0,o.jsx)(w,{template:s,parentTemplate:m,mode:p,isProUser:g,isImporting:f,onPreview:N,onImport:"kits"===p&&null!=s&&s.type?_:k,onOpenKit:d,onPageImportModeImport:function(){A(s)}})]})]},null!==(n=null==s?void 0:s.template_id)&&void 0!==n?n:s.kit_id)};const P=function(e){var t=e.currentPage,n=e.totalPages,r=e.totalItems,i=e.perPage,s=e.onPageChange,l=e.loading,c=void 0!==l&&l;if(n<=1)return null;var u=function(e){e===t||"..."===e||c||s(e)},A={start:(t-1)*i+1,end:Math.min(t*i,r)},d=A.start,p=A.end,m=function(){var e=[];if(n<=7)for(var r=1;r<=n;r++)e.push(r);else if(t<=4){for(var a=1;a<=5;a++)e.push(a);e.push("..."),e.push(n)}else if(t>=n-3){e.push(1),e.push("...");for(var o=n-4;o<=n;o++)e.push(o)}else e.push(1),e.push("..."),e.push(t-1),e.push(t),e.push(t+1),e.push("..."),e.push(n);return e}();return(0,o.jsxs)("div",{className:"template-pagination",children:[(0,o.jsxs)("div",{className:"pagination-controls",children:[(0,o.jsxs)("button",{className:"pagination-btn pagination-prev ".concat(1===t?"disabled":""),onClick:function(){return u(t-1)},disabled:1===t||c,title:(0,a.__)("Previous Page","master-addons"),children:[(0,o.jsx)("span",{className:"dashicons dashicons-arrow-left-alt2"}),(0,a.__)("Previous","master-addons")]}),(0,o.jsx)("div",{className:"pagination-numbers",children:m.map(function(e,n){return"..."===e?(0,o.jsx)("span",{className:"pagination-ellipsis",children:"..."},"ellipsis-".concat(n)):(0,o.jsx)("button",{className:"pagination-number ".concat(e===t?"active":""),onClick:function(){return u(e)},disabled:c,children:e},e)})}),(0,o.jsxs)("button",{className:"pagination-btn pagination-next ".concat(t===n?"disabled":""),onClick:function(){return u(t+1)},disabled:t===n||c,title:(0,a.__)("Next Page","master-addons"),children:[(0,a.__)("Next","master-addons"),(0,o.jsx)("span",{className:"dashicons dashicons-arrow-right-alt2"})]})]}),(0,o.jsx)("div",{className:"pagination-info",children:(0,o.jsxs)("span",{className:"pagination-text",children:[(0,a.__)("Showing","master-addons")," ",d,"-",p," ",(0,a.__)("of","master-addons")," ",r," ",(0,a.__)("templates","master-addons")]})}),c&&(0,o.jsx)("div",{className:"pagination-loading",children:(0,o.jsxs)("div",{className:"pagination-spinner",children:[(0,o.jsx)("span",{className:"dashicons dashicons-update spinning"}),(0,o.jsx)("span",{className:"loading-text",children:(0,a.__)("Loading templates...","master-addons")})]})})]})};const F=function(e){var t=e.className,n=void 0===t?"":t,a=e.open,i=e.setIsOpen,s=e.children,l=(0,r.useRef)(null),c=(0,r.useRef)(null);return(0,r.useEffect)(function(){var e=l.current;e&&(a?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;e.style.display="flex",e.style.pointerEvents="auto";var n=0,r=16/t,a=function(){(n+=r)>=1&&(n=1),e.style.opacity=n,n<1&&requestAnimationFrame(a)};requestAnimationFrame(a)}(e):function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200,n=1;e.style.pointerEvents="none";var r=16/t,a=function(){(n-=r)<=0&&(n=0,e.style.display="none"),e.style.opacity=n,n>0&&requestAnimationFrame(a)};requestAnimationFrame(a)}(e))},[a]),(0,r.useEffect)(function(){var e=function(e){if(a){var t=l.current,n=c.current,r=document.querySelector(".swal2-container.fade.in");t&&n&&!n.contains(e.target)&&!r&&i(!1)}};return document.addEventListener("mousedown",e),function(){return document.removeEventListener("mousedown",e)}},[a,i]),(0,r.useEffect)(function(){var e=function(e){"Escape"===e.key&&a&&(document.querySelector(".swal2-container.fade.in")||i(!1))};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[a,i]),(0,r.useEffect)(function(){var e=function(e){e.target.matches(".swal2-confirm.styled")&&i(!1)};return document.addEventListener("click",e),function(){return document.removeEventListener("click",e)}},[i]),(0,o.jsxs)("div",{ref:l,className:"template-importer-modal ".concat(n),style:{display:"none",opacity:0},children:[(0,o.jsx)("div",{className:"modal-overlay"}),(0,o.jsx)("div",{ref:c,className:"modal-content",children:s})]})};function I(e){return I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I(e)}function D(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(I(e)+" is not iterable")}function q(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return L(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],A=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,l=e,d.n=n,i}};function p(n,r){for(s=n,l=r,t=0;!A&&c&&!a&&t<u.length;t++){var a,o=u[t],p=d.p,m=o[2];n>3?(a=m===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((a=n<2&&p<o[1])?(s=0,d.v=r,d.n=o[1]):p<m&&(a=n<3||o[0]>r||r>m)&&(o[4]=n,o[5]=r,d.n=m,s=0))}if(a||n>1)return i;throw A=!0,r}return function(a,u,m){if(c>1)throw TypeError("Generator is already running");for(A&&1===u&&p(u,m),s=u,l=m;(t=s<2?e:l)||!A;){o||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(A=d.n<0)?l:n.call(r,d))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:A}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(L(t={},r,function(){return this}),t),A=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,L(e,a,"GeneratorFunction")),e.prototype=Object.create(A),e}return l.prototype=c,L(A,"constructor",c),L(c,"constructor",l),l.displayName="GeneratorFunction",L(c,a,"GeneratorFunction"),L(A),L(A,a,"Generator"),L(A,r,function(){return this}),L(A,"toString",function(){return"[object Generator]"}),(q=function(){return{w:o,m:d}})()}function L(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}L=function(e,t,n,r){function o(t,n){L(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},L(e,t,n,r)}function G(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=U(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function M(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function J(e){return function(e){if(Array.isArray(e))return z(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||U(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||U(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(e,t){if(e){if("string"==typeof e)return z(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?z(e,t):void 0}}function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const Y=function(e){var t=e.templates,n=e.loading,i=e.onImport,s=e.onPreview,l=e.onOpenKit,c=e.pagination,u=e.onPageChange,A=e.loadingPage,d=e.mode,p=e.parentTemplate,m=e.isImporting,f=e.setIsImporting,g=e.isProUser,h=e.pluginStatuses,b=e.setPluginStatuses,v=e.onInstallPlugin,x=e.onActivatePlugin,y=e.requiredPlugins,C=void 0===y?[]:y,w=!0===window.JLTMA_IS_PAGE_IMPORTER_MODE,j="kits"===d&&(null==t?void 0:t.required_plugins),k=R((0,r.useState)(!1),2),_=k[0],E=k[1],N=R((0,r.useState)([]),2),S=N[0],B=N[1],O=R((0,r.useState)(!1),2),I=O[0],L=O[1],U=(0,r.useRef)(null),z=t;(0,r.useEffect)(function(){if(j&&b&&C.length>0){var e={};C.forEach(function(t){e[t.slug]={is_installed:t.is_installed,is_active:t.is_active}}),b(e);var t=C.filter(function(e){return!e.is_active}).map(function(e){return e.slug});B(t)}},[t,b,j]);var Y=function(){var e,t=(e=q().m(function e(){var t,n,r,a;return q().w(function(e){for(;;)switch(e.p=e.n){case 0:if(0!==S.length){e.n=1;break}return e.a(2);case 1:L(!0),t=G(S),e.p=2,r=q().m(function e(){var t,r,a;return q().w(function(e){for(;;)switch(e.n){case 0:if(t=n.value,r=C.find(function(e){return e.slug===t}),(a=h[t]||r).is_active){e.n=3;break}if(a.is_installed){e.n=2;break}return e.n=1,v(r);case 1:e.n=3;break;case 2:return e.n=3,x(r);case 3:return e.a(2)}},e)}),t.s();case 3:if((n=t.n()).done){e.n=5;break}return e.d(D(r()),4);case 4:e.n=3;break;case 5:e.n=7;break;case 6:e.p=6,a=e.v,t.e(a);case 7:return e.p=7,t.f(),e.f(7);case 8:L(!1),E(!1);case 9:return e.a(2)}},e,null,[[2,6,7,8]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){M(o,r,a,i,s,"next",e)}function s(e){M(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}();return(0,r.useEffect)(function(){if(w&&p&&!n&&z&&z.length>0){var e=setTimeout(function(){var e=document.querySelector(".templates-grid");if(e&&window.Macy){U.current&&U.current.remove(),U.current=window.Macy({container:".templates-grid",columns:3,margin:{x:20,y:20},breakAt:{1200:3,940:2,520:1},waitForImages:!0,trueOrder:!1});var t=function(){U.current&&U.current.recalculate(!0)};setTimeout(t,100),setTimeout(t,300),setTimeout(t,500),setTimeout(t,1e3);var n=e.querySelectorAll("img");n.length>0&&n.forEach(function(e){e.complete||e.addEventListener("load",t)})}},300);return function(){clearTimeout(e),U.current&&(U.current.remove(),U.current=null)}}},[w,n,z,p]),n?(0,o.jsx)("div",{className:"templates-grid-container",children:(0,o.jsxs)("div",{className:"loading-templates",children:[(0,o.jsx)("div",{className:"loading-templates-logo",children:(0,o.jsx)("img",{src:"".concat(window.JLTMATemplateLibrary.pluginUrl,"/assets/images/logo.svg"),alt:"Master Addons",className:"ma-el-loading-logo"})}),(0,o.jsxs)("div",{className:"loading-templates-title",children:["Loading Template ","kits"===d?"Kits..":"Library..","."]})]})}):n||z&&(!Array.isArray(z)||0!==z.length)?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"templates-grid-container",children:[(null==C?void 0:C.length)>0&&p&&C.some(function(e){var t;return!(null!==(t=h[e.slug])&&void 0!==t&&t.is_active||e.is_active)})&&(0,o.jsx)("div",{className:"required-plugins",children:(0,o.jsxs)("div",{className:"required-plugins-header",children:[(0,o.jsx)("div",{className:"header-left",children:(0,a.__)((0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("strong",{children:"Attention!"})," There are"," ",C.filter(function(e){var t;return!(null!==(t=h[e.slug])&&void 0!==t&&t.is_active||e.is_active)}).length," ","requirements that need installing for this Template Kit to work correctly."]}),"master-addons")}),(0,o.jsx)("div",{className:"header-right",children:(0,o.jsxs)("button",{className:"install_missing_requirement",onClick:function(){return E(!0)},children:[(0,o.jsx)("span",{className:"dashicons dashicons-info"}),(0,a.__)("Install Requirements","master-addons")]})})]})}),(0,o.jsxs)(F,{open:_,setIsOpen:E,className:"required-plugins-modal",children:[(0,o.jsxs)("div",{className:"modal-header",children:[(0,o.jsx)("h3",{children:(0,a.__)("Required Plugins","master-addons")}),(0,o.jsx)("button",{className:"modal-close",onClick:function(){return E(!1)},disabled:I,"aria-label":(0,a.__)("Close","master-addons"),children:(0,o.jsx)("span",{className:"dashicons dashicons-no-alt"})})]}),(0,o.jsxs)("div",{className:"modal-body",children:[(0,o.jsx)("p",{className:"modal-description",children:(0,a.__)("Please install and activate these required plugins for this Template Kit to work perfectly","master-addons")}),(0,o.jsx)("div",{className:"required-plugins-list",children:null==C?void 0:C.map(function(e){var t=h[null==e?void 0:e.slug]||e,n=null==t?void 0:t.is_active,r=S.includes(null==e?void 0:e.slug);return(0,o.jsxs)("label",{className:"required-plugin-item ".concat(n?"active":""),children:[(0,o.jsxs)("div",{className:"plugin-checkbox-label",children:[n?(0,o.jsx)("span",{className:"active-plugin-checkmark",children:(0,o.jsx)("span",{className:"dashicons dashicons-yes-alt",style:{color:"#4CAF50"}})}):(0,o.jsx)("input",{type:"checkbox",checked:r,onChange:function(){return t=null==e?void 0:e.slug,void B(function(e){return e.includes(t)?e.filter(function(e){return e!==t}):[].concat(J(e),[t])});var t},disabled:I}),(0,o.jsxs)("div",{className:"plugin-info",children:[(0,o.jsx)("span",{className:"plugin-name",children:null==e?void 0:e.name}),(null==e?void 0:e.version)&&(0,o.jsx)("span",{className:"plugin-version",children:null==e?void 0:e.version})]})]}),(0,o.jsxs)("div",{className:"plugin-status",children:[n&&(0,o.jsxs)("span",{className:"status-active",children:[(0,o.jsx)("span",{className:"dashicons dashicons-yes-alt"}),(0,a.__)("Active","master-addons")]}),!n&&(null==t?void 0:t.is_installed)&&(0,o.jsx)("span",{className:"status-installed",children:(0,a.__)("Installed but not activated ","master-addons")}),!n&&!(null!=t&&t.is_installed)&&(0,o.jsx)("span",{className:"status-not-installed",children:(0,a.__)("Not installed","master-addons")})]})]},null==e?void 0:e.slug)})}),(0,o.jsx)("div",{className:"modal-footer",children:(0,o.jsxs)("button",{className:"button button-primary install-selected-btn",onClick:Y,disabled:0===S.length||I,children:[(0,o.jsx)("span",{className:"dashicons dashicons-download"}),I?(0,a.__)("Installing...","master-addons"):0===S.length?(0,a.__)("Select plugins to install","master-addons"):(0,a.__)("Install Above Selected Requirements","master-addons")]})})]})]}),(0,o.jsx)("div",{className:"templates-grid",children:z.map(function(e){var t;return(0,o.jsx)(T,{template:e,onImport:i,onPreview:s,onOpenKit:l,mode:d,isProUser:g,parentTemplate:p,isImporting:m,setIsImporting:f,requiredPlugins:C,pluginStatuses:h},null!==(t=null==e?void 0:e.template_id)&&void 0!==t?t:null==e?void 0:e.kit_id)})})]}),c&&!p&&!w&&(0,o.jsx)(P,{currentPage:c.current_page,totalPages:c.total_pages,totalItems:c.total_items,perPage:12,onPageChange:u,loading:A||!1})]}):(0,o.jsx)("div",{className:"templates-grid-container",children:(0,o.jsxs)("div",{className:"no-templates",children:[(0,o.jsx)("h3",{children:(0,a.__)("No Templates Found","master-addons")}),(0,o.jsx)("p",{children:(0,a.__)("Try adjusting your search or selecting a different category.","master-addons")})]})})};const K=function(e){var t=e.activeTab,n=e.onTabChange,r=e.templateCounts,i=e.tabs,s=void 0===i?[]:i,l=[{id:"master_pages",label:(0,a.__)("Pages","master-addons"),icon:"dashicons-admin-page"},{id:"master_section",label:(0,a.__)("Sections","master-addons"),icon:"dashicons-layout"},{id:"master_footers",label:(0,a.__)("Footer","master-addons"),icon:"dashicons-table-row-after"},{id:"master_headers",label:(0,a.__)("Headers","master-addons"),icon:"dashicons-table-row-before"}],c=s.length>0?s:l;return(0,o.jsx)("div",{className:"template-tabs",children:c.map(function(e){return(0,o.jsxs)("button",{className:"template-tab ".concat(t===e.id?"active":""),onClick:function(){return n(e.id)},children:[(0,o.jsx)("span",{className:"dashicons ".concat(e.icon)}),(0,o.jsx)("span",{className:"tab-label",children:e.label}),void 0!==r[e.id]&&(0,o.jsxs)("span",{className:"tab-count",children:["(",r[e.id],")"]})]},e.id)})})};function W(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const H=function(e){var t=e.categoryName,n=e.categories,a=e.activeCategory,i=e.onCategoryChange,s=W((0,r.useState)(!1),2),l=s[0],c=s[1],u=(0,r.useRef)(null);return(0,r.useEffect)(function(){document.addEventListener("mousedown",function(e){u.current&&!u.current.contains(e.target)&&c(!1)})},[l,c]),(0,o.jsxs)("div",{className:"template-library-categories",ref:u,children:[(0,o.jsxs)("button",{type:"button",className:"template-library-select-category",onClick:function(){return c(!l)},children:[t||"Categories",(0,o.jsx)("i",{className:"dashicons dashicons-arrow-down-alt2"})]}),(0,o.jsx)("div",{className:"categories-list ".concat(l?"active":""),children:(0,o.jsx)("ul",{children:n.map(function(e){return(0,o.jsx)("li",{children:(0,o.jsx)("button",{className:a===e.id?"active":"",onClick:function(){i(e.id),c(!1)},children:(0,o.jsxs)("span",{className:"category-name",children:[e.name," (",e.count,")"]})})},e.id)})})})]})};wp.icons;function Q(e){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q(e)}function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach(function(t){Z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Z(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Q(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Q(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Q(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ee(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return te(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const ne=function(e){var t=e.categories,n=e.activeCategory,i=e.onCategoryChange,s=e.activePlanFilter,l=e.onPlanFilterChange,c=e.onFavoritesFilterChange,u=e.mode,A=e.templates,d=void 0===A?[]:A,p=e.onTemplateSelect,m=e.onImport,f=e.parentTemplate,g=e.parentTemplateCategory,h=e.requiredPlugins,b=void 0===h?[]:h,v=e.pluginStatuses,x=void 0===v?{}:v,y=ee((0,r.useState)(0),2),C=y[0],w=y[1],j=ee((0,r.useState)(!1),2),k=j[0],_=j[1],E=Array.isArray(d)?d:null!=d&&d.templates&&Array.isArray(d.templates)?d.templates:[],N=ee((0,r.useState)(""),2),S=N[0],B=N[1],O=ee((0,r.useState)(""),2),T=O[0],P=O[1],F=ee((0,r.useState)(function(){return b.reduce(function(e,t){return(x[t.slug]||t).is_active||(e[t.plugin_file]=!0),e},{})}),2),I=F[0],D=F[1],q=(E.find(function(e){return e.template_id===S}),ee((0,r.useState)(!1),2)),L=q[0],G=q[1];(0,r.useEffect)(function(){b||(b=[]),!L&&b.length>0&&(D(b.reduce(function(e,t){return(x[t.slug]||t).is_active||(e[t.plugin_file]=!0),e},{})),G(!0))},[b,x,L]),(0,r.useEffect)(function(){if(E.length>0){if(!E.find(function(e){return e.template_id==S})){var e=E[0];B(e.template_id),P(e.title||""),p&&p(e)}}else B(""),P("")},[E]);(0,r.useEffect)(function(){var e=function(){try{var e="kits"===u?"kits":"library",t=JSON.parse(localStorage.getItem("jltma_favorites")||"{}")[e]||[];w(t.length)}catch(e){w(0)}};return e(),window.addEventListener("jltma-favorites-updated",e),function(){window.removeEventListener("jltma-favorites-updated",e)}},[u]);var M=f?g:n,J=t.find(function(e){return e.id===M}),R=J&&"all"!==J.id?J.name:"",U=(null==f?void 0:f.title)||(null==f?void 0:f.kit_name)||(null==f?void 0:f.name)||"",z=R||U;return(0,o.jsx)("div",{className:"vertical-filter-sidebar",children:E.length>0?(0,o.jsxs)("div",{className:"template-info-section",children:[z&&(0,o.jsxs)("div",{className:"template-breadcrumbs",children:[R&&(0,o.jsxs)(o.Fragment,{children:["Kits ",(0,o.jsx)("i",{className:"eicon-chevron-right breadcrumb-separator"})," ",(0,o.jsx)("span",{className:"breadcrumb-item",children:R}),U&&(0,o.jsx)("i",{className:"eicon-chevron-right breadcrumb-separator"})]}),U&&(0,o.jsx)("span",{className:"breadcrumb-item breadcrumb-current",children:U})]}),(0,o.jsx)("p",{className:"template-description",children:"Import professionally designed Elementor Templates with just one click. Our template kits include everything you need to create stunning websites quickly and efficiently."}),E.length>1&&(0,o.jsxs)("div",{className:"template-selector-wrapper",children:[(0,o.jsx)("label",{htmlFor:"template-select",className:"template-selector-label",children:(0,a.__)("Select a Page","master-addons")}),(0,o.jsx)("select",{id:"template-select",value:S,onChange:function(e){var t=e.target.value;B(t);var n=E.find(function(e){return e.template_id==t});n?(P(n.title||""),p&&p(n)):console.warn("Template not found for ID:",t)},className:"kit-template-selector",children:E.map(function(e){return(0,o.jsx)("option",{value:e.template_id,children:e.title},e.template_id)})})]}),(0,o.jsxs)("div",{className:"page-title-input-wrapper",children:[(0,o.jsx)("label",{htmlFor:"page-title",className:"page-title-label",children:(0,a.__)("Page Title","master-addons")}),(0,o.jsx)("input",{type:"text",id:"page-title",name:"page-title",className:"page-title-input",value:T,onChange:function(e){return P(e.target.value)},placeholder:(0,a.__)("Enter page title...","master-addons")})]}),b&&b.length>0?(0,o.jsxs)("div",{className:"required-plugins",children:[(0,o.jsx)("h4",{className:"section-title",children:"Required Plugins"}),(0,o.jsx)("ul",{children:b.map(function(e,t){var n=x[e.slug]||e,r=n.is_active,a=n.is_installed;return(0,o.jsx)("li",{className:r?"plugin-active":"",children:r?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{className:"dashicons dashicons-yes-alt",style:{color:"#4CAF50",marginRight:"8px"}}),(0,o.jsxs)("span",{children:[e.name," ",(0,o.jsx)("span",{style:{fontSize:"12px",color:"#4CAF50"},children:"(Active)"})]})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("input",{type:"checkbox",id:"plugin-".concat(e.slug),name:"plugins[]",value:"".concat(e.plugin_file),checked:I[e.plugin_file]||!1,onChange:function(t){D(function(n){return X(X({},n),{},Z({},e.plugin_file,t.target.checked))})}}),(0,o.jsxs)("label",{htmlFor:"plugin-".concat(e.slug),children:[e.name,a&&!r&&(0,o.jsx)("span",{style:{fontSize:"12px",color:"#666",marginLeft:"5px"},children:"(Installed but inactive)"})]})]})},e.plugin_file||t)})})]}):null,(0,o.jsxs)("button",{className:"insert-button",onClick:function(){if(S&&m){var e=E.find(function(e){return e.template_id==S});if(e){var t=b.filter(function(e){return!0===I[e.plugin_file]}),n=X(X({},e),{},{page_name:T||e.title,required_plugins:t});m(n,f)}else console.warn("Selected template not found in list")}else console.warn("No template selected or onImport not provided")},disabled:!S,title:Object.values(I).some(function(e){return e})?(0,a.__)("Install & Insert","master-addons"):(0,a.__)("Insert Page","master-addons"),children:[(0,o.jsx)("span",{className:"dashicons dashicons-plus-alt"}),Object.values(I).some(function(e){return e})?(0,a.__)("Install & Insert","master-addons"):(0,a.__)("Insert Page","master-addons")]})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"filter-section favorites-section",children:(0,o.jsxs)("button",{className:"favorites-filter-btn ".concat(k?"active":""),onClick:function(){var e=!k;_(e),c?c(e):console.warn("onFavoritesFilterChange is not provided")},children:[(0,o.jsx)("span",{className:"eicon-heart-o"}),(0,o.jsxs)("span",{className:"favorites-label",children:[(0,a.__)("Favorites","master-addons"),C>0&&(0,o.jsxs)("span",{className:"favorites-count",children:["(",C,")"]})]})]})}),(0,o.jsxs)("div",{className:"filter-section",children:[(0,o.jsx)("h3",{className:"filter-title",children:(0,a.__)("Filter by Plan","master-addons")}),(0,o.jsxs)("div",{className:"plan-filters",children:[(0,o.jsx)("button",{className:"plan-filter-btn ".concat("all"===s?"active":""),onClick:function(){return l("all")},children:(0,a.__)("All","master-addons")}),(0,o.jsx)("button",{className:"plan-filter-btn free ".concat("free"===s?"active":""),onClick:function(){return l("free")},children:(0,a.__)("Free","master-addons")}),(0,o.jsx)("button",{className:"plan-filter-btn pro ".concat("pro"===s?"active":""),onClick:function(){return l("pro")},children:(0,a.__)("Pro","master-addons")})]})]}),(0,o.jsxs)("div",{className:"filter-section",children:[(0,o.jsx)("h3",{className:"filter-title",children:(0,a.__)("Filter by Category","master-addons")}),(0,o.jsx)("div",{className:"category-filters-pills",children:t.map(function(e){return(0,o.jsx)("button",{className:"category-pill-btn ".concat(n===e.id?"active":""),onClick:function(){return i(e.id)},children:e.name},e.id)})})]})]})})};function re(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return ae(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],A=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,l=e,d.n=n,i}};function p(n,r){for(s=n,l=r,t=0;!A&&c&&!a&&t<u.length;t++){var a,o=u[t],p=d.p,m=o[2];n>3?(a=m===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((a=n<2&&p<o[1])?(s=0,d.v=r,d.n=o[1]):p<m&&(a=n<3||o[0]>r||r>m)&&(o[4]=n,o[5]=r,d.n=m,s=0))}if(a||n>1)return i;throw A=!0,r}return function(a,u,m){if(c>1)throw TypeError("Generator is already running");for(A&&1===u&&p(u,m),s=u,l=m;(t=s<2?e:l)||!A;){o||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(A=d.n<0)?l:n.call(r,d))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:A}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ae(t={},r,function(){return this}),t),A=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ae(e,a,"GeneratorFunction")),e.prototype=Object.create(A),e}return l.prototype=c,ae(A,"constructor",c),ae(c,"constructor",l),l.displayName="GeneratorFunction",ae(c,a,"GeneratorFunction"),ae(A),ae(A,a,"Generator"),ae(A,r,function(){return this}),ae(A,"toString",function(){return"[object Generator]"}),(re=function(){return{w:o,m:d}})()}function ae(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}ae=function(e,t,n,r){function o(t,n){ae(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},ae(e,t,n,r)}function oe(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return se(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?se(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const le=function(e){var t=e.categoryName,n=e.templateCount,i=e.searchTerm,s=e.onSearchChange,l=e.onRefresh,c=e.refreshing,u=e.activeTab,A=e.onTabChange,d=e.templateCounts,p=e.showTabs,m=void 0===p||p,f=e.tabs,g=void 0===f?[]:f,h=e.strings,b=void 0===h?{}:h,v=e.mode,x=e.parentTemplate,y=e.backButtonClick,C=e.setIsUploaderOpen,w=e.categories,j=e.activeCategory,k=e.onCategoryChange,_=e.hideFilters,E=void 0!==_&&_,N=e.isPageImporterMode,S=void 0!==N&&N,B=(e.activePlanFilter,e.onPlanFilterChange,e.activeDevice),O=e.onDeviceChange,T=e.nonce,P=e.ajaxurl,F=ie((0,r.useState)(i),2),I=F[0],D=F[1],q=ie((0,r.useState)(!1),2),L=q[0],G=q[1],M=ie((0,r.useState)(!1),2),J=M[0],R=M[1],U=ie((0,r.useState)(!1),2),z=U[0],Y=U[1],W=(0,r.useRef)(null),$=(0,r.useRef)(null),Q=(0,r.useRef)(null),V="https://www.youtube.com/embed/dQw4w9WgXcQ",X=function(e){var t=e.target.value;D(t),Q.current&&clearTimeout(Q.current),Q.current=setTimeout(function(){s(t),Q.current=null},300)},Z=function(){var e=!L;G(e),e&&setTimeout(function(){$.current&&$.current.focus()},100)},ee=function(){D(""),s(""),Q.current&&clearTimeout(Q.current)};(0,r.useEffect)(function(){var e=function(e){W.current&&!W.current.contains(e.target)&&L&&G(!1)};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[L]),(0,r.useEffect)(function(){return function(){Q.current&&clearTimeout(Q.current)}},[]),(0,r.useEffect)(function(){D(i)},[i]);var te=x&&x.categories&&(x.categories.includes("purchased")||"purchased"===x.categories),ne=function(){var e,t=(e=re().m(function e(){var t,n,r;return re().w(function(e){for(;;)switch(e.p=e.n){case 0:if(x&&x.kit_id){e.n=1;break}return e.a(2);case 1:if(te){e.n=2;break}return window.swal({title:(0,a.__)("Failed","master-addons"),text:(0,a.__)("Only purchased kits can be deleted.","master-addons"),icon:"error",confirmButtonColor:"#d33",confirmButtonText:"OK"}),e.a(2);case 2:return e.n=3,window.swal({title:"Delete Template Kit !!!",text:(0,a.__)('Are you sure you want to delete "'.concat(x.kit_name||x.title,'"? This action cannot be undone.'),"master-addons"),icon:"question",showCancelButton:!0,confirmButtonColor:"#3085d6",cancelButtonColor:"#d33",confirmButtonText:"Yes, delete it!",cancelButtonText:"Cancel",reverseButtons:!0});case 3:if(e.v){e.n=4;break}return e.a(2);case 4:return R(!0),e.p=5,(t=new FormData).append("action","jltma_delete_purchased_kit"),t.append("_wpnonce",T),t.append("kit_id",x.kit_id.split("-").slice(-1)[0]),e.n=6,fetch(P,{method:"POST",body:t});case 6:return n=e.v,e.n=7,n.json();case 7:e.v.success?(window.swal({title:(0,a.__)("Success","master-addons"),text:(0,a.__)("Kit deleted successfully!","master-addons"),icon:"success",confirmButtonColor:"#3085d6",confirmButtonText:"Great!"}),y&&"function"==typeof y&&y()):window.swal({title:(0,a.__)("Failed","master-addons"),text:(0,a.__)("Kit delation failed","master-addons"),icon:"error",confirmButtonColor:"#d33",confirmButtonText:"OK"}),e.n=9;break;case 8:e.p=8,r=e.v,window.swal({title:"Delete Error",text:"An error occurred while deleting the kit: ".concat(r.message),icon:"error",confirmButtonColor:"#d33",confirmButtonText:"OK"});case 9:return e.p=9,R(!1),e.f(9);case 10:return e.a(2)}},e,null,[[5,8,9,10]])}),function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){oe(o,r,a,i,s,"next",e)}function s(e){oe(o,r,a,i,s,"throw",e)}i(void 0)})});return function(){return t.apply(this,arguments)}}();return(0,o.jsxs)("div",{className:"content-header",children:[m&&(0,o.jsxs)("div",{className:"template-library-header",children:[(0,o.jsxs)("div",{className:"template-library-tabs-wrapper ".concat(S?"page-importer-mode":""," ").concat("kits"===v&&S?"kits-mode":""," ").concat(x?"has-parent-template":""),children:[!x&&(0,o.jsx)("div",{className:"template-library-header-logo",children:(0,o.jsx)("img",{src:"".concat(window.JLTMATemplateLibrary.pluginUrl,"/assets/images/logo.svg"),alt:"master-addons"})}),x&&"kits"===v&&S||x&&"library"===v&&S?(0,o.jsxs)("div",{className:"back-btn",onClick:y,children:[(0,o.jsx)("span",{className:"dashicons dashicons-arrow-left-alt2"}),(0,a.__)("Back to ".concat("kits"===v?"kits":"Library"),"master-addons")]}):null,x&&("kits"===v||"library"===v)&&S&&O&&(0,o.jsx)("div",{className:"template-preview-toolbar-center",children:(0,o.jsxs)("div",{className:"template-preview-devices",children:[(0,o.jsx)("button",{type:"button",className:"template-preview-device-btn ".concat("desktop"===B?"active":""),onClick:function(){return O("desktop")},title:(0,a.__)("Desktop","master-addons"),children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,o.jsx)("rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",ry:"2"}),(0,o.jsx)("line",{x1:"8",y1:"21",x2:"16",y2:"21"}),(0,o.jsx)("line",{x1:"12",y1:"17",x2:"12",y2:"21"})]})}),(0,o.jsx)("button",{type:"button",className:"template-preview-device-btn ".concat("tablet"===B?"active":""),onClick:function(){return O("tablet")},title:(0,a.__)("Tablet","master-addons"),children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,o.jsx)("rect",{x:"5",y:"2",width:"14",height:"20",rx:"2",ry:"2"}),(0,o.jsx)("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})]})}),(0,o.jsx)("button",{type:"button",className:"template-preview-device-btn ".concat("mobile"===B?"active":""),onClick:function(){return O("mobile")},title:(0,a.__)("Mobile","master-addons"),children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,o.jsx)("rect",{x:"7",y:"2",width:"10",height:"20",rx:"2",ry:"2"}),(0,o.jsx)("line",{x1:"12",y1:"18",x2:"12.01",y2:"18"})]})})]})}),"kits"===v||x?null:(0,o.jsx)(K,{activeTab:u,onTabChange:A,templateCounts:d||{},tabs:function(){if(S){var e=[{id:"master_pages",label:(0,a.__)("Pages","master-addons"),icon:"dashicons-admin-page"},{id:"master_section",label:(0,a.__)("Sections","master-addons"),icon:"dashicons-layout"}];return g.length>0?g.filter(function(e){return"master_footers"!==e.id&&"master_headers"!==e.id}):e}return g}()}),"kits"===v&&S&&!x&&(0,o.jsx)("div",{className:"template-kits-title",children:(0,o.jsx)("h2",{children:(0,a.__)("Template Kits","master-addons")})}),S&&(0,o.jsxs)("div",{ref:W,className:"header-search-collapsible ".concat(L?"expanded":""," ").concat(I?"has-value":""),children:[(0,o.jsx)("input",{ref:$,type:"text",placeholder:b.searchPlaceholder||(0,a.__)("Search templates...","master-addons"),value:I,onChange:X,className:"search-input"}),I&&L&&(0,o.jsx)("button",{className:"clear-search-btn",onClick:ee,title:(0,a.__)("Clear search","master-addons"),children:(0,o.jsx)("span",{className:"dashicons dashicons-no-alt"})}),(0,o.jsx)("button",{className:"search-toggle-btn",onClick:Z,title:(0,a.__)("Search templates","master-addons"),children:(0,o.jsx)("span",{className:"dashicons dashicons-search"})})]}),(0,o.jsxs)("button",{className:"refresh-btn",onClick:l,disabled:c,title:(0,a.__)("Refresh templates from server","master-addons"),children:[(0,o.jsx)("span",{className:"dashicons dashicons-update ".concat(c?"spinning":"")}),(0,a.__)("","master-addons")]})]}),!E&&!S&&(0,o.jsxs)("div",{className:"template-library-categories-wrapper",children:[(0,o.jsxs)("div",{className:"template-library-categories-count",children:[(0,o.jsx)(H,{categoryName:t,categories:w,activeCategory:j,onCategoryChange:k}),(0,o.jsxs)("div",{className:"template-count",children:[n," ",1===n?(0,a.__)("template","master-addons"):(0,a.__)("templates","master-addons")]})]}),(0,o.jsxs)("div",{className:"search-container",children:[(0,o.jsx)("input",{type:"text",placeholder:b.searchPlaceholder||(0,a.__)("Search templates...","master-addons"),value:I,onChange:X}),(0,o.jsx)("span",{className:"search-icon dashicons dashicons-search"})]})]})]}),"kits"===v&&!S&&(0,o.jsxs)("div",{className:"template-kit-header",children:[x?(0,o.jsxs)("div",{className:"back-btn",onClick:y,children:[(0,o.jsx)("span",{className:"dashicons dashicons-arrow-left-alt2"}),(0,a.__)("Back to Library","master-addons")]}):(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(H,{categoryName:t,categories:w,activeCategory:j,onCategoryChange:k,mode:v})}),(0,o.jsx)("div",{className:"template-kit-header-logo",children:(0,o.jsx)("img",{src:"".concat(window.JLTMATemplateLibrary.pluginUrl,"/assets/images/logo.svg"),alt:"master-addons"})}),(0,o.jsxs)("div",{className:"template-kit-upload-wrapper",children:[!x&&(0,o.jsxs)(o.Fragment,{children:[V?(0,o.jsx)("button",{className:"tutorial-btn has-tooltip",onClick:function(){return Y(!0)},"data-tooltip":(0,a.__)("Watch tutorial","master-addons"),"aria-label":(0,a.__)("Watch tutorial","master-addons"),children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-youtube-icon lucide-youtube",children:[(0,o.jsx)("path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17"}),(0,o.jsx)("path",{d:"m10 15 5-3-5-3z"})]})}):null,(0,o.jsxs)("div",{ref:W,className:"search-container ".concat(L?"search-expanded":""," ").concat(I?"has-value":""),children:[(0,o.jsx)("input",{ref:$,type:"text",placeholder:b.searchPlaceholder||(0,a.__)("Search templates...","master-addons"),value:I,onChange:X,className:"search-input"}),I&&L&&(0,o.jsx)("button",{className:"clear-search-btn has-tooltip",onClick:ee,title:(0,a.__)("Clear search","master-addons"),"data-tooltip":(0,a.__)("Clear search","master-addons"),"aria-label":(0,a.__)("Clear search","master-addons"),children:(0,o.jsx)("span",{className:"dashicons dashicons-no-alt"})}),(0,o.jsx)("button",{className:"search-toggle-btn has-tooltip",onClick:Z,title:(0,a.__)("Search templates","master-addons"),"data-tooltip":(0,a.__)("Search templates","master-addons"),"aria-label":(0,a.__)("Search templates","master-addons"),children:(0,o.jsx)("span",{className:"dashicons dashicons-search"})})]}),(0,o.jsx)("div",{className:"upload-kit has-tooltip","data-tooltip":(0,a.__)("Upload Kit","master-addons"),"aria-label":(0,a.__)("Upload Kit","master-addons"),children:(0,o.jsx)("span",{className:"import-kit-btn ",onClick:function(){C(function(e){return!e})},children:(0,o.jsx)("span",{className:"upload-icon",children:(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-cloud-upload-icon lucide-cloud-upload",children:[(0,o.jsx)("path",{d:"M12 13v8"}),(0,o.jsx)("path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242"}),(0,o.jsx)("path",{d:"m8 17 4-4 4 4"})]})})})})]}),te&&(0,o.jsx)("div",{className:"template-kit-extra",children:(0,o.jsx)("button",{className:"delete-kit-btn",onClick:function(e){e.stopPropagation(),ne()},disabled:J,title:(0,a.__)("Delete this kits","master-addons"),children:(0,o.jsx)("span",{className:"dashicons dashicons-trash"})})}),(0,o.jsxs)("button",{className:"refresh-btn",onClick:l,disabled:c,title:(0,a.__)("Refresh templates from server","master-addons"),children:[(0,o.jsx)("span",{className:"dashicons dashicons-update ".concat(c?"spinning":"")}),(0,a.__)("","master-addons")]})]})]}),z&&(0,o.jsx)("div",{className:"jltma-video-modal-overlay",onClick:function(){return Y(!1)},children:(0,o.jsxs)("div",{className:"jltma-video-modal-content",onClick:function(e){return e.stopPropagation()},children:[(0,o.jsx)("button",{className:"jltma-video-modal-close",onClick:function(){return Y(!1)},title:(0,a.__)("Close","master-addons"),children:(0,o.jsx)("span",{className:"dashicons dashicons-no-alt"})}),(0,o.jsx)("div",{className:"jltma-video-wrapper",children:(0,o.jsx)("iframe",{width:"100%",height:"100%",src:V,title:(0,a.__)("Tutorial Video","master-addons"),frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})]})})]})};function ce(e){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ce(e)}function ue(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(ce(e)+" is not iterable")}function Ae(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return de(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],A=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,l=e,d.n=n,i}};function p(n,r){for(s=n,l=r,t=0;!A&&c&&!a&&t<u.length;t++){var a,o=u[t],p=d.p,m=o[2];n>3?(a=m===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((a=n<2&&p<o[1])?(s=0,d.v=r,d.n=o[1]):p<m&&(a=n<3||o[0]>r||r>m)&&(o[4]=n,o[5]=r,d.n=m,s=0))}if(a||n>1)return i;throw A=!0,r}return function(a,u,m){if(c>1)throw TypeError("Generator is already running");for(A&&1===u&&p(u,m),s=u,l=m;(t=s<2?e:l)||!A;){o||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(A=d.n<0)?l:n.call(r,d))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:A}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(de(t={},r,function(){return this}),t),A=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,de(e,a,"GeneratorFunction")),e.prototype=Object.create(A),e}return l.prototype=c,de(A,"constructor",c),de(c,"constructor",l),l.displayName="GeneratorFunction",de(c,a,"GeneratorFunction"),de(A),de(A,a,"Generator"),de(A,r,function(){return this}),de(A,"toString",function(){return"[object Generator]"}),(Ae=function(){return{w:o,m:d}})()}function de(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}de=function(e,t,n,r){function o(t,n){de(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},de(e,t,n,r)}function pe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function me(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pe(Object(n),!0).forEach(function(t){fe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fe(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=ce(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ce(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ce(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ge(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ye(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw o}}}}function he(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function be(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){he(o,r,a,i,s,"next",e)}function s(e){he(o,r,a,i,s,"throw",e)}i(void 0)})}}function ve(e){return function(e){if(Array.isArray(e))return Ce(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ye(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||ye(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ye(e,t){if(e){if("string"==typeof e)return Ce(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(e,t):void 0}}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const we=function(e){var t=e.isOpen,n=e.onClose,i=e.templateData,s=e.onImportComplete,l=e.requiredPlugins,c=void 0===l?[]:l,u=(e.pluginStatuses,e.isTemplateLibraryMode),A=void 0!==u&&u,d=e.onInstallPlugin,p=e.onActivatePlugin,m=xe((0,r.useState)(0),2),f=m[0],g=m[1],h=xe((0,r.useState)(!1),2),b=h[0],v=h[1],x=xe((0,r.useState)(""),2),y=x[0],C=x[1],w=xe((0,r.useState)(null),2),j=w[0],k=w[1],_=xe((0,r.useState)(""),2),E=_[0],N=_[1],S=xe((0,r.useState)(null),2),B=S[0],O=S[1],T=xe((0,r.useState)([]),2),P=T[0],F=T[1],I=xe((0,r.useState)(!1),2),D=I[0],q=I[1],L=xe((0,r.useState)({}),2),G=L[0],M=L[1],J=c.length>0&&c.some(function(e){return!e.is_active}),R=[{id:2,title:(0,a.__)("Creating page","master-addons"),shortTitle:(0,a.__)("Creating page","master-addons"),icon:"dashicons-admin-page"},{id:3,title:(0,a.__)("Importing content","master-addons"),shortTitle:(0,a.__)("Importing content","master-addons"),icon:"dashicons-text-page"},{id:4,title:(0,a.__)("Importing images","master-addons"),shortTitle:(0,a.__)("Importing images","master-addons"),icon:"dashicons-format-image"},{id:5,title:(0,a.__)("Importing widgets","master-addons"),shortTitle:(0,a.__)("Importing widgets","master-addons"),icon:"dashicons-screenoptions"},{id:6,title:(0,a.__)("Finalizing","master-addons"),shortTitle:(0,a.__)("Finalizing","master-addons"),icon:"dashicons-yes-alt"}],U=J?[{id:1,title:(0,a.__)("Installing plugins","master-addons"),shortTitle:(0,a.__)("Plugins","master-addons"),icon:"dashicons-admin-plugins"}].concat(R):R;(0,r.useEffect)(function(){if(t){var e={};c.forEach(function(t){e[t.slug]={is_installed:t.is_installed||!1,is_active:t.is_active||!1}}),M(e),0===c.length||c.every(function(e){return e.is_active})?(g(2),Y()):(g(1),z())}},[t]);var z=function(){var e=be(Ae().m(function e(){var t,n,r,o,i;return Ae().w(function(e){for(;;)switch(e.p=e.n){case 0:if(0!==c.length){e.n=1;break}return Y(),e.a(2);case 1:q(!0),e.p=2,t=ge(c),e.p=3,r=Ae().m(function e(){var t,r,a,o,i,s,l,c,u,A;return Ae().w(function(e){for(;;)switch(e.n){case 0:if(t=n.value,(r=G[t.slug]||t).is_active){e.n=12;break}if(r.is_installed){e.n=6;break}if(!d){e.n=2;break}return e.n=1,d(t,!0);case 1:e.n=5;break;case 2:return(a=new FormData).append("action","jltma_install_plugin"),a.append("_wpnonce",window.JLTMATemplateLibrary.nonce),a.append("slug",t.slug),e.n=3,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:a});case 3:return o=e.v,e.n=4,o.json();case 4:if((i=e.v).success){e.n=5;break}throw new Error((null===(s=i.data)||void 0===s?void 0:s.message)||"Failed to install ".concat(t.name));case 5:M(function(e){return me(me({},e),{},fe({},t.slug,me(me({},e[t.slug]),{},{is_installed:!0,is_active:!0})))}),e.n=12;break;case 6:if(!p&&r.is_installed){e.n=12;break}if(!p){e.n=8;break}return e.n=7,p(t,!0);case 7:e.n=11;break;case 8:return(l=new FormData).append("action","jltma_activate_plugin"),l.append("_wpnonce",window.JLTMATemplateLibrary.nonce),l.append("slug",t.slug),e.n=9,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:l});case 9:return c=e.v,e.n=10,c.json();case 10:if((u=e.v).success){e.n=11;break}throw new Error((null===(A=u.data)||void 0===A?void 0:A.message)||"Failed to activate ".concat(t.name));case 11:M(function(e){return me(me({},e),{},fe({},t.slug,me(me({},e[t.slug]),{},{is_active:!0})))});case 12:return e.a(2)}},e)}),t.s();case 4:if((n=t.n()).done){e.n=6;break}return e.d(ue(r()),5);case 5:e.n=4;break;case 6:e.n=8;break;case 7:e.p=7,o=e.v,t.e(o);case 8:return e.p=8,t.f(),e.f(8);case 9:Y(),e.n=11;break;case 10:e.p=10,i=e.v,console.error("Error installing plugins:",i),O((0,a.__)("Failed to install required plugins. Please try again.","master-addons")),g(7);case 11:return e.p=11,q(!1),e.f(11);case 12:return e.a(2)}},e,null,[[3,7,8,9],[2,10,11,12]])}));return function(){return e.apply(this,arguments)}}(),Y=function(){var e=be(Ae().m(function e(){var t,n,r;return Ae().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,g(t=2),e.n=1,new Promise(function(e){return setTimeout(e,1500)});case 1:return g(t+1),e.n=2,new Promise(function(e){return setTimeout(e,1e3)});case 2:return g(t+2),e.n=3,new Promise(function(e){return setTimeout(e,1200)});case 3:return g(t+3),e.n=4,K();case 4:return n=e.v,g(t+4),e.n=5,new Promise(function(e){return setTimeout(e,800)});case 5:C(n.edit_url),N(n.view_url||"/?p=".concat(n.page_id)),k(n.page_id||null),g(7),v(!0),setTimeout(function(){v(!1)},5e3),s&&s(n),e.n=7;break;case 6:e.p=6,r=e.v,O(r.message||(0,a.__)("Failed to import page","master-addons")),g(8);case 7:return e.a(2)}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),K=function(){var e=be(Ae().m(function e(){var t,n,r,o,s;return Ae().w(function(e){for(;;)switch(e.n){case 0:return t=i.template_id.template_id?i.template_id.template_id:i.template_id,(n=new FormData).append("action","jltma_import_template"),n.append("_wpnonce",window.JLTMATemplateLibrary.nonce),n.append("template_id",t),n.append("tab","master_pages"),i.page_name&&n.append("page_name",i.page_name),e.n=1,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:n});case 1:return r=e.v,e.n=2,r.json();case 2:if((o=e.v).success){e.n=3;break}throw new Error((null===(s=o.data)||void 0===s?void 0:s.message)||(0,a.__)("Import failed","master-addons"));case 3:return e.a(2,o.data)}},e)}));return function(){return e.apply(this,arguments)}}(),W=function(){f>=1&&f<=6||(g(0),v(!1),O(null),C(""),N(""),k(null),F([]),M({}),n())},$=function(){E&&(window.open(E,"_blank"),W())};return t?(0,o.jsxs)("div",{className:"jltma-page-import-modal ".concat(A?"template-library-mode":"fullscreen-mode"),children:[(0,o.jsx)("div",{className:"modal-overlay",onClick:0===f||f>=7?W:null}),(0,o.jsxs)("div",{className:"modal-content",children:[b&&7===f&&(0,o.jsx)("div",{className:"confetti-container",children:ve(Array(50)).map(function(e,t){return(0,o.jsx)("div",{className:"confetti-piece",style:{left:"".concat(100*Math.random(),"%"),animationDelay:"".concat(3*Math.random(),"s"),backgroundColor:["#6814cd","#F50A7F","#4CAF50","#FFC107","#2196F3"][Math.floor(5*Math.random())]}},t)})}),0===f&&(0,o.jsxs)("div",{className:"import-plugins-container",children:[(0,o.jsxs)("div",{className:"plugins-header",children:[(0,o.jsx)("div",{className:"header-icon",children:(0,o.jsx)("span",{className:"dashicons dashicons-admin-plugins"})}),(0,o.jsx)("h2",{children:(0,a.__)("Required Plugins","master-addons")}),(0,o.jsx)("p",{children:(0,a.__)("Please install and activate these required plugins for this template to work perfectly","master-addons")})]}),(0,o.jsx)("div",{className:"required-plugins-list",children:c.map(function(e){var t=G[e.slug]||e,n=t.is_active,r=P.includes(e.slug);return(0,o.jsxs)("div",{className:"required-plugin-item ".concat(n?"active":""),children:[(0,o.jsxs)("label",{className:"plugin-checkbox-label",children:[(0,o.jsx)("input",{type:"checkbox",checked:r,onChange:function(){return t=e.slug,void F(function(e){return e.includes(t)?e.filter(function(e){return e!==t}):[].concat(ve(e),[t])});var t},disabled:n||D}),(0,o.jsxs)("div",{className:"plugin-info",children:[(0,o.jsx)("span",{className:"plugin-name",children:e.name}),e.version&&(0,o.jsxs)("span",{className:"plugin-version",children:["v",e.version]})]})]}),(0,o.jsxs)("div",{className:"plugin-status",children:[n&&(0,o.jsxs)("span",{className:"status-active",children:[(0,o.jsx)("span",{className:"dashicons dashicons-yes-alt"}),(0,a.__)("Active","master-addons")]}),!n&&t.is_installed&&(0,o.jsx)("span",{className:"status-installed",children:(0,a.__)("Not activated","master-addons")}),!n&&!t.is_installed&&(0,o.jsx)("span",{className:"status-not-installed",children:(0,a.__)("Not installed","master-addons")})]})]},e.slug)})}),(0,o.jsxs)("div",{className:"plugins-actions",children:[(0,o.jsx)("button",{className:"button button-secondary",onClick:W,disabled:D,children:(0,a.__)("Cancel","master-addons")}),(0,o.jsx)("button",{className:"button button-primary",onClick:z,disabled:D,children:D?(0,a.__)("Installing...","master-addons"):(0,a.__)("Install & Continue","master-addons")})]})]}),f>=1&&f<=6&&(0,o.jsxs)("div",{className:"import-progress-container",children:[(0,o.jsx)("h2",{children:(0,a.__)("We're setting up your page, please wait...","master-addons")}),(0,o.jsx)("p",{className:"import-progress-description",children:(0,a.__)("Please wait while we set up your page. This may take a few moments.","master-addons")}),(0,o.jsx)("div",{className:"vertical-progress-steps",children:U.map(function(e,t){var n=t+1,r=f>n,i=f===n,s=f<n;return(0,o.jsxs)("div",{className:"progress-step ".concat(r?"completed":""," ").concat(i?"current":""," ").concat(s?"pending":""),children:[(0,o.jsxs)("div",{className:"step-indicator-icon",children:[r&&(0,o.jsx)("span",{className:"dashicons dashicons-yes-alt checkmark"}),i&&(0,o.jsx)("span",{className:"dashicons ".concat(e.icon," spinning")}),s&&(0,o.jsx)("span",{className:"step-number",children:n})]}),(0,o.jsxs)("div",{className:"step-content",children:[(0,o.jsx)("div",{className:"step-title",children:e.shortTitle}),i&&(0,o.jsx)("div",{className:"step-status",children:(0,a.__)("In progress...","master-addons")}),r&&(0,o.jsx)("div",{className:"step-status completed",children:(0,a.__)("Completed","master-addons")})]})]},e.id)})}),(0,o.jsxs)("div",{className:"import-warning",children:[(0,o.jsx)("span",{className:"dashicons dashicons-info"}),(0,a.__)("Please do not close this window or refresh the page.","master-addons")]})]}),7===f&&(0,o.jsxs)("div",{className:"jltma-import-success-container import-success-container",children:[(0,o.jsx)("button",{className:"modal-close-btn",onClick:W,"aria-label":(0,a.__)("Close","master-addons"),children:(0,o.jsx)("span",{className:"dashicons dashicons-no-alt"})}),(0,o.jsxs)("h2",{children:[(0,a.__)("Congrats, it's Party Time !!!","master-addons")," 🎉"]}),(0,o.jsx)("p",{children:(0,a.__)("Your page is successfully imported and ready to use.","master-addons")}),(0,o.jsx)("div",{className:"jltma-success-illustration success-illustration",children:(0,o.jsxs)("svg",{viewBox:"0 0 200 240",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsxs)("defs",{children:[(0,o.jsxs)("linearGradient",{id:"rocketGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,o.jsx)("stop",{offset:"0%",style:{stopColor:"#6814cd",stopOpacity:1}}),(0,o.jsx)("stop",{offset:"100%",style:{stopColor:"#9d4edd",stopOpacity:1}})]}),(0,o.jsxs)("linearGradient",{id:"flameGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,o.jsx)("stop",{offset:"0%",style:{stopColor:"#F50A7F",stopOpacity:1}}),(0,o.jsx)("stop",{offset:"100%",style:{stopColor:"#ff6b9d",stopOpacity:1}})]})]}),(0,o.jsx)("circle",{cx:"40",cy:"30",r:"2",fill:"#c4b5fd",opacity:"0.5",children:(0,o.jsx)("animate",{attributeName:"opacity",values:"0.3;1;0.3",dur:"2s",repeatCount:"indefinite"})}),(0,o.jsx)("circle",{cx:"160",cy:"50",r:"2",fill:"#c4b5fd",opacity:"0.5",children:(0,o.jsx)("animate",{attributeName:"opacity",values:"0.6;1;0.6",dur:"2.5s",repeatCount:"indefinite"})}),(0,o.jsx)("circle",{cx:"30",cy:"90",r:"2",fill:"#c4b5fd",opacity:"0.5",children:(0,o.jsx)("animate",{attributeName:"opacity",values:"0.4;1;0.4",dur:"3s",repeatCount:"indefinite"})}),(0,o.jsx)("circle",{cx:"170",cy:"100",r:"2",fill:"#c4b5fd",opacity:"0.5",children:(0,o.jsx)("animate",{attributeName:"opacity",values:"0.5;1;0.5",dur:"2.2s",repeatCount:"indefinite"})}),(0,o.jsx)("ellipse",{cx:"100",cy:"228",rx:"45",ry:"8",fill:"#e9d5ff",opacity:"0.4"}),(0,o.jsxs)("g",{children:[(0,o.jsx)("ellipse",{cx:"90",cy:"195",rx:"6",ry:"12",fill:"url(#flameGradient)",opacity:"0.8",children:(0,o.jsx)("animate",{attributeName:"ry",values:"12;16;12",dur:"0.3s",repeatCount:"indefinite"})}),(0,o.jsx)("ellipse",{cx:"100",cy:"195",rx:"8",ry:"15",fill:"url(#flameGradient)",opacity:"0.9",children:(0,o.jsx)("animate",{attributeName:"ry",values:"15;20;15",dur:"0.3s",repeatCount:"indefinite"})}),(0,o.jsx)("ellipse",{cx:"110",cy:"195",rx:"6",ry:"12",fill:"url(#flameGradient)",opacity:"0.8",children:(0,o.jsx)("animate",{attributeName:"ry",values:"12;16;12",dur:"0.3s",repeatCount:"indefinite"})}),(0,o.jsx)("path",{d:"M 100 40 L 88 160 L 88 180 L 112 180 L 112 160 Z",fill:"url(#rocketGradient)",stroke:"#4c1d95",strokeWidth:"2"}),(0,o.jsx)("path",{d:"M 100 40 L 88 95 L 112 95 Z",fill:"#F50A7F",stroke:"#c2185b",strokeWidth:"2"}),(0,o.jsx)("circle",{cx:"100",cy:"110",r:"14",fill:"#ffffff",opacity:"0.9"}),(0,o.jsx)("circle",{cx:"100",cy:"110",r:"11",fill:"#e0f2fe",opacity:"0.8"}),(0,o.jsx)("circle",{cx:"103",cy:"107",r:"4",fill:"#ffffff",opacity:"0.6"}),(0,o.jsx)("path",{d:"M 88 160 L 72 185 L 88 178 Z",fill:"#9d4edd",stroke:"#7c3aed",strokeWidth:"1.5"}),(0,o.jsx)("path",{d:"M 112 160 L 128 185 L 112 178 Z",fill:"#9d4edd",stroke:"#7c3aed",strokeWidth:"1.5"}),(0,o.jsx)("rect",{x:"92",y:"135",width:"16",height:"2.5",fill:"#c4b5fd",rx:"1"}),(0,o.jsx)("rect",{x:"92",y:"145",width:"16",height:"2.5",fill:"#c4b5fd",rx:"1"})]}),(0,o.jsxs)("ellipse",{cx:"90",cy:"210",rx:"18",ry:"8",fill:"#e9d5ff",opacity:"0.3",children:[(0,o.jsx)("animate",{attributeName:"rx",values:"18;22;18",dur:"1s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"opacity",values:"0.3;0.1;0.3",dur:"1s",repeatCount:"indefinite"})]}),(0,o.jsxs)("ellipse",{cx:"110",cy:"210",rx:"18",ry:"8",fill:"#e9d5ff",opacity:"0.3",children:[(0,o.jsx)("animate",{attributeName:"rx",values:"18;22;18",dur:"1.2s",repeatCount:"indefinite"}),(0,o.jsx)("animate",{attributeName:"opacity",values:"0.3;0.1;0.3",dur:"1.2s",repeatCount:"indefinite"})]})]})}),(0,o.jsxs)("div",{className:"jltma-success-actions success-actions",children:[(0,o.jsxs)("div",{className:"success-actions-wrap",children:[y&&(0,o.jsxs)("button",{className:"button button-primary button-edit-elementor",onClick:function(){y&&(window.open(y,"_blank"),W())},children:[(0,o.jsx)("span",{className:"ma-icon-wrapper",children:(0,o.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,o.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#6814cd"}),(0,o.jsx)("text",{x:"12",y:"17",fontSize:"14",fontWeight:"700",fill:"white",textAnchor:"middle",fontFamily:"system-ui, -apple-system, sans-serif",children:"M"})]})}),(0,a.__)("EDIT WITH ELEMENTOR","master-addons")]}),E&&(0,o.jsx)("button",{className:"button button-primary button-go-page",onClick:$,children:(0,a.__)("VIEW PAGE","master-addons")})]}),(0,o.jsx)("button",{className:"button button-link",onClick:W,children:(0,a.__)("Go to Template Library","master-addons")})]})]}),8===f&&(0,o.jsxs)("div",{className:"jltma-import-error-container import-error-container",children:[(0,o.jsx)("div",{className:"jltma-error-icon error-icon",children:(0,o.jsx)("span",{className:"dashicons dashicons-warning"})}),(0,o.jsx)("h2",{children:(0,a.__)("Import Failed","master-addons")}),(0,o.jsx)("p",{children:B}),(0,o.jsxs)("div",{className:"jltma-error-actions error-actions",children:[(0,o.jsxs)("button",{className:"button",onClick:W,children:[(0,o.jsx)("span",{className:"dashicons dashicons-arrow-left-alt2"}),(0,a.__)("Back to Library","master-addons")]}),j&&(0,o.jsx)("button",{className:"button button-primary",onClick:$,children:(0,a.__)("View Page","master-addons")})]})]})]})]}):null};const je=function(e){e.templates;var t,n,r=e.loading,i=e.selectedTemplate,s=e.activeDevice,l=void 0===s?"desktop":s,c=(null==i||null===(t=i.template)||void 0===t?void 0:t.preview_url)||(null==i?void 0:i.preview_url)||null;return(0,o.jsx)("div",{className:"template-preview-container",style:function(e){var t={};switch(e){case"tablet":case"mobile":t.height="calc(100vh - 101px)",t.margin="20px",t.overflowY="auto";break;default:t.height="calc(100vh - 61px)",t.margin="0",t.overflowY="hidden"}return t}(l),children:r?(0,o.jsxs)("div",{className:"template-preview-loading",children:[(0,o.jsx)("span",{className:"spinner is-active"}),(0,o.jsx)("p",{children:(0,a.__)("Loading preview...","master-addons")})]}):(0,o.jsx)(o.Fragment,{children:c?(0,o.jsxs)("div",{className:"template-preview-iframe-wrapper",style:{position:"relative",width:{desktop:"100%",tablet:"768px",mobile:"375px"}[l],margin:"0 auto",transition:"width 0.3s ease"},children:[(0,o.jsxs)("div",{className:"jltma-template-viewport",children:["tablet"===l&&(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 430 595",className:"devices-elementor-svg",children:[(0,o.jsx)("rect",{className:"back-shape frame",fill:"#000000",x:"0",y:"0",width:"430",height:"595",rx:"20",ry:"20","vector-effect":"non-scaling-stroke"}),(0,o.jsx)("circle",{className:"overlay-shape home-button",fill:"#242424",cx:"215",cy:"574",r:"10","vector-effect":"non-scaling-stroke"}),(0,o.jsx)("circle",{className:"overlay-shape camera",fill:"#242424",cx:"211",cy:"20",r:"4","vector-effect":"non-scaling-stroke"})]}),"mobile"===l&&(0,o.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 277 574",className:"devices-elementor-svg",children:[(0,o.jsx)("rect",{className:"back-shape frame",fill:"#000000",x:"3",y:"0",width:"271",height:"574",rx:"35",ry:"35","vector-effect":"non-scaling-stroke"}),(0,o.jsx)("circle",{className:"overlay-shape home-button",fill:"#242424",cx:"139",cy:"538",r:"20","vector-effect":"non-scaling-stroke"}),(0,o.jsx)("circle",{className:"overlay-shape camera",fill:"#242424",cx:"95",cy:"37",r:"4","vector-effect":"non-scaling-stroke"}),(0,o.jsx)("rect",{className:"overlay-shape speaker",fill:"#242424",x:"116",y:"35",width:"45",height:"5",rx:"4.5","vector-effect":"non-scaling-stroke"}),(0,o.jsx)("rect",{className:"side-shape button-sound",fill:"#000000",x:"1",y:"71",width:"2",height:"18","vector-effect":"non-scaling-stroke"}),(0,o.jsx)("rect",{className:"side-shape button-plus",fill:"#000000",x:"0",y:"120",width:"3",height:"32","vector-effect":"non-scaling-stroke"}),(0,o.jsx)("rect",{className:"side-shape button-minus",fill:"#000000",x:"0",y:"163",width:"3",height:"32","vector-effect":"non-scaling-stroke"}),(0,o.jsx)("rect",{className:"side-shape color-normal button-on",fill:"#000000",x:"274",y:"120",width:"3",height:"32","vector-effect":"non-scaling-stroke"})]})]}),(0,o.jsx)("iframe",{src:c,width:"100%",height:"100%",style:function(e){var t={};switch(e){case"tablet":t={position:"absolute",top:"70px",left:"50%",transform:"translateX(-50%)",width:"96%",height:"920px",borderRadius:"8px"};break;case"mobile":t={position:"absolute",top:"72px",left:"50%",transform:"translateX(-50%)",width:"92%",height:"620px",borderRadius:"8px"};break;default:t={position:"relative",top:"0",left:"0",transform:"translateX(0)",width:"100%",height:"100%",borderRadius:"0"}}return t}(l),title:(0,a.__)("Template Preview","master-addons")})]}):(0,o.jsx)(o.Fragment,{children:i&&null!=i&&i.thumbnail?(0,o.jsx)("img",{src:i.thumbnail,alt:i.title}):(0,o.jsx)("img",{src:(null===(n=window.JLTMATemplateLibrary)||void 0===n?void 0:n.pluginUrl)+"/assets/images/placeholder.png",alt:"preview image"})})})})};function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach(function(t){Ee(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ee(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Ne(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Ne(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ne(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ne(e){return Ne="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(e)}function Se(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Be(c,"_invoke",function(n,r,a){var o,s,l,c=0,u=a||[],A=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return o=t,s=0,l=e,d.n=n,i}};function p(n,r){for(s=n,l=r,t=0;!A&&c&&!a&&t<u.length;t++){var a,o=u[t],p=d.p,m=o[2];n>3?(a=m===r)&&(l=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((a=n<2&&p<o[1])?(s=0,d.v=r,d.n=o[1]):p<m&&(a=n<3||o[0]>r||r>m)&&(o[4]=n,o[5]=r,d.n=m,s=0))}if(a||n>1)return i;throw A=!0,r}return function(a,u,m){if(c>1)throw TypeError("Generator is already running");for(A&&1===u&&p(u,m),s=u,l=m;(t=s<2?e:l)||!A;){o||(s?s<3?(s>1&&(d.n=-1),p(s,l)):d.n=l:d.v=l);try{if(c=2,o){if(s||(a="next"),t=o[a]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=o.return)&&t.call(o),s<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),s=1);o=e}else if((t=(A=d.n<0)?l:n.call(r,d))!==i)break}catch(t){o=e,s=1,l=t}finally{c=1}}return{value:t,done:A}}}(n,a,o),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Be(t={},r,function(){return this}),t),A=c.prototype=s.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Be(e,a,"GeneratorFunction")),e.prototype=Object.create(A),e}return l.prototype=c,Be(A,"constructor",c),Be(c,"constructor",l),l.displayName="GeneratorFunction",Be(c,a,"GeneratorFunction"),Be(A),Be(A,a,"Generator"),Be(A,r,function(){return this}),Be(A,"toString",function(){return"[object Generator]"}),(Se=function(){return{w:o,m:d}})()}function Be(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Be=function(e,t,n,r){function o(t,n){Be(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},Be(e,t,n,r)}function Oe(e,t,n,r,a,o,i){try{var s=e[o](i),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,a)}function Te(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){Oe(o,r,a,i,s,"next",e)}function s(e){Oe(o,r,a,i,s,"throw",e)}i(void 0)})}}function Pe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Fe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}const Ie=function(){var e=Pe((0,r.useState)([]),2),t=e[0],n=e[1],i=Pe((0,r.useState)([]),2),s=i[0],l=i[1],c=Pe((0,r.useState)(!0),2),u=c[0],A=c[1],d=Pe((0,r.useState)("all"),2),p=d[0],m=d[1],f=Pe((0,r.useState)(""),2),g=f[0],h=f[1],b=Pe((0,r.useState)(1),2),v=b[0],x=b[1],y=Pe((0,r.useState)(!1),2),C=y[0],w=y[1],j=Pe((0,r.useState)(0),2),k=j[0],_=j[1],E=Pe((0,r.useState)("master_section"),2),N=E[0],S=E[1],B=Pe((0,r.useState)({}),2),O=B[0],T=B[1],P=Pe((0,r.useState)(null),2),F=P[0],I=P[1],D=Pe((0,r.useState)(!1),2),q=D[0],L=D[1],G=Pe((0,r.useState)({isOpen:!1,templateData:null,requiredPlugins:[]}),2),M=G[0],J=G[1],R=Pe((0,r.useState)(!1),2),U=R[0],z=R[1],K=Pe((0,r.useState)(!1),2),W=K[0],$=K[1],H=Pe((0,r.useState)("all"),2),Q=H[0],V=H[1],X=Pe((0,r.useState)(!1),2),Z=X[0],ee=X[1],te=Pe((0,r.useState)("desktop"),2),re=te[0],ae=te[1],oe=Pe((0,r.useState)(null),2),ie=oe[0],se=oe[1],ce=Pe((0,r.useState)(null),2),ue=ce[0],Ae=ce[1],de=Pe((0,r.useState)(null),2),pe=de[0],me=de[1],fe=Pe((0,r.useState)({}),2),ge=fe[0],he=fe[1],be="library";(0,r.useEffect)(function(){var e=function(){var e=Te(Se().m(function e(){return Se().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Promise.all([ye()]);case 1:return e.a(2)}},e)}));return function(){return e.apply(this,arguments)}}();e()},[]),(0,r.useEffect)(function(){xe()},[N,p,g,v]),(0,r.useEffect)(function(){ve(),m("all"),x(1)},[N]);var ve=function(){var e=Te(Se().m(function e(){var t,r,a,o;return Se().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,(t=new FormData).append("action","jltma_get_categories"),t.append("_wpnonce",window.JLTMATemplateLibrary.nonce),t.append("tab",N),e.n=1,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:t});case 1:return r=e.v,e.n=2,r.json();case 2:(a=e.v).success&&n(a.data),e.n=4;break;case 3:e.p=3,o=e.v,console.error("Error loading categories:",o);case 4:return e.a(2)}},e,null,[[0,3]])}));return function(){return e.apply(this,arguments)}}(),xe=function(){var e=Te(Se().m(function e(){var t,n,r,a,o,i;return Se().w(function(e){for(;;)switch(e.p=e.n){case 0:return A(!0),e.p=1,(t=new FormData).append("action","jltma_get_templates"),t.append("_wpnonce",window.JLTMATemplateLibrary.nonce),t.append("tab",N),t.append("category",p),t.append("search",g),t.append("page",v),e.n=2,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:t});case 2:return n=e.v,e.n=3,n.json();case 3:(r=e.v).success&&(l(r.data.templates||[]),_((null===(a=r.data.pagination)||void 0===a?void 0:a.total_items)||(null===(o=r.data.templates)||void 0===o?void 0:o.length)||0),I(r.data.pagination||null)),e.n=5;break;case 4:e.p=4,i=e.v,console.error("Error loading templates:",i);case 5:return e.p=5,A(!1),L(!1),e.f(5);case 6:return e.a(2)}},e,null,[[1,4,5,6]])}));return function(){return e.apply(this,arguments)}}(),ye=function(){var e=Te(Se().m(function e(){var t,n,r,a,o,i,s,l,c,u;return Se().w(function(e){for(;;)switch(e.p=e.n){case 0:t={},n=0,r=["master_pages","master_section","master_footers","master_headers"];case 1:if(!(n<r.length)){e.n=7;break}return a=r[n],e.p=2,(o=new FormData).append("action","jltma_get_templates"),o.append("_wpnonce",window.JLTMATemplateLibrary.nonce),o.append("tab",a),o.append("page",1),o.append("category","all"),e.n=3,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:o});case 3:return i=e.v,e.n=4,i.json();case 4:(s=e.v).success&&(t[a]=(null===(l=s.data.pagination)||void 0===l?void 0:l.total_items)||(null===(c=s.data.templates)||void 0===c?void 0:c.length)||0),e.n=6;break;case 5:e.p=5,u=e.v,console.error("Error loading count for tab ".concat(a,":"),u),t[a]=0;case 6:n++,e.n=1;break;case 7:T(t);case 8:return e.a(2)}},e,null,[[2,5]])}));return function(){return e.apply(this,arguments)}}(),Ce=function(e){m(e),x(1),h("")},ke=function(e){V(e),x(1)},Be=function(e){e!==v&&(L(!0),x(e))},Oe=function(){var e=Te(Se().m(function e(t){var n,r,a,o,i,l,c,u,A,d,p,m,f;return Se().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=!0===window.JLTMA_IS_PAGE_IMPORTER_MODE,"object"===Ne(t)&&null!==t?(a=t.template_id||t.id,o=t.page_name):a=t,i=s.find(function(e){return e.template_id===a}),!((l=(null==i?void 0:i.required_plugins)||[]).length>0)||null!==(n=l[0])&&void 0!==n&&n.slug){e.n=5;break}return e.p=1,(u=new FormData).append("action","jltma_get_plugins_status"),u.append("_wpnonce",window.JLTMATemplateLibrary.nonce),u.append("required_plugins",JSON.stringify(l)),e.n=2,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:u});case 2:return A=e.v,e.n=3,A.json();case 3:(d=e.v).success&&null!==(c=d.data)&&void 0!==c&&c.plugins&&(l=d.data.plugins,i.required_plugins=l,Ae(l||[]),p={},l.forEach(function(e){p[e.slug]={is_installed:e.is_installed,is_active:e.is_active}}),he(p)),e.n=5;break;case 4:e.p=4,f=e.v,console.error("Error fetching plugin status:",f);case 5:r&&z(!0),m={template_id:a,tab:N},o&&(m.page_name=o),J({isOpen:!0,templateData:m,requiredPlugins:l});case 6:return e.a(2)}},e,null,[[1,4]])}));return function(t){return e.apply(this,arguments)}}(),Fe=function(e){console.log("Page import completed:",e)},Ie=function(){J({isOpen:!1,templateData:null,requiredPlugins:[]}),z(!1)},De=function(){var e=Te(Se().m(function e(t){var n,r,a,o,i,s,c,u,A,d,p;return Se().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=t.template_id,!(t.required_plugins&&t.required_plugins.length>0)){e.n=5;break}return e.p=1,(a=new FormData).append("action","jltma_get_plugins_status"),a.append("_wpnonce",window.JLTMATemplateLibrary.nonce),a.append("required_plugins",JSON.stringify(t.required_plugins)),e.n=2,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:a});case 2:return o=e.v,e.n=3,o.json();case 3:(i=e.v).success&&null!==(r=i.data)&&void 0!==r&&r.plugins&&(t.required_plugins=i.data.plugins,Ae(i.data.plugins||[]),s={},i.data.plugins.forEach(function(e){s[e.slug]={is_installed:e.is_installed,is_active:e.is_active}}),he(s)),e.n=5;break;case 4:e.p=4,d=e.v,console.error("Error fetching plugin status:",d);case 5:return e.p=5,(c=new FormData).append("action","jltma_preview_template"),c.append("_wpnonce",window.JLTMATemplateLibrary.nonce),c.append("template_id",n),e.n=6,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:c});case 6:return u=e.v,e.n=7,u.json();case 7:(A=e.v).success&&A.data.preview_url&&(t.preview_url=A.data.preview_url,window.JLTMA_IS_PAGE_IMPORTER_MODE?(t.preview_url=t.url,l([t]),se(t),$(!0)):window.open(A.data.preview_url,"_blank")),e.n=9;break;case 8:e.p=8,p=e.v,console.error("Error previewing template:",p);case 9:return e.a(2)}},e,null,[[5,8],[1,4]])}));return function(t){return e.apply(this,arguments)}}(),qe=function(){var e=Te(Se().m(function e(){var t,n,r,o;return Se().w(function(e){for(;;)switch(e.p=e.n){case 0:return w(!0),e.p=1,(t=new FormData).append("action","jltma_refresh_templates_cache"),t.append("_wpnonce",window.JLTMATemplateLibrary.nonce),e.n=2,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:t});case 2:return n=e.v,e.n=3,n.json();case 3:if(!(r=e.v).success){e.n=6;break}return e.n=4,ve();case 4:return e.n=5,xe();case 5:alert((0,a.__)("Templates cache refreshed successfully!","master-addons")),e.n=7;break;case 6:alert(r.data.message||(0,a.__)("Failed to refresh cache","master-addons"));case 7:e.n=9;break;case 8:e.p=8,o=e.v,console.error("Error refreshing cache:",o),alert((0,a.__)("Error refreshing cache","master-addons"));case 9:return e.p=9,w(!1),e.f(9);case 10:return e.a(2)}},e,null,[[1,8,9,10]])}));return function(){return e.apply(this,arguments)}}(),Le=function(){return t.find(function(e){return e.id===p})||t[0]||{name:"All Types"}},Ge=function(){var e=s;if("all"!==Q&&(e=e.filter(function(e){return"free"===Q?!e.is_pro:"pro"!==Q||e.is_pro})),Z)try{var t=JSON.parse(localStorage.getItem("jltma_favorites")||"{}").library||[];e=e.filter(function(e){var n=e.id||e.template_id;return t.includes(n)})}catch(e){console.error("Error loading favorites:",e)}return e},Me=function(e){ee(e)},Je=function(){var e=Te(Se().m(function e(t){var n,r,a,o,i,s,l,c,u=arguments;return Se().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=u.length>1&&void 0!==u[1]&&u[1],me(t.slug),e.p=1,(r=new FormData).append("action","jltma_install_required_plugin"),r.append("_wpnonce",window.JLTMATemplateLibrary.nonce),r.append("plugin_slug",t.slug),r.append("plugin_file",t.plugin_file),r.append("plugin_name",t.name),e.n=2,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:r});case 2:return a=e.v,e.n=3,a.json();case 3:if(!(o=e.v).success){e.n=4;break}he(function(e){var n;return _e(_e({},e),{},Ee({},t.slug,{is_installed:!0,is_active:(null===(n=o.data)||void 0===n?void 0:n.is_active)||!1}))}),!n&&window.swal&&window.swal({title:"Installation Successful",text:(null===(i=o.data)||void 0===i?void 0:i.message)||"".concat(t.name," installed successfully!"),icon:"success",confirmButtonColor:"#3085d6",confirmButtonText:"Great!"}),e.n=5;break;case 4:if(n||alert((null===(s=o.data)||void 0===s?void 0:s.message)||"Failed to install ".concat(t.name)),!n){e.n=5;break}throw new Error((null===(l=o.data)||void 0===l?void 0:l.message)||"Failed to install ".concat(t.name));case 5:e.n=8;break;case 6:if(e.p=6,c=e.v,n){e.n=7;break}alert("An error occurred during plugin installation: ".concat(c.message)),e.n=8;break;case 7:throw c;case 8:return e.p=8,me(null),e.f(8);case 9:return e.a(2)}},e,null,[[1,6,8,9]])}));return function(t){return e.apply(this,arguments)}}(),Re=function(){var e=Te(Se().m(function e(t){var n,r,a,o,i,s,l,c,u=arguments;return Se().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=u.length>1&&void 0!==u[1]&&u[1],me(t.slug),e.p=1,(r=new FormData).append("action","jltma_activate_required_plugin"),r.append("_wpnonce",window.JLTMATemplateLibrary.nonce),r.append("plugin_slug",t.slug),r.append("plugin_file",t.plugin_file),r.append("plugin_name",t.name),e.n=2,fetch(window.JLTMATemplateLibrary.ajaxurl,{method:"POST",body:r});case 2:return a=e.v,e.n=3,a.json();case 3:if(!(o=e.v).success){e.n=4;break}he(function(e){return _e(_e({},e),{},Ee({},t.slug,_e(_e({},e[t.slug]),{},{is_active:!0})))}),!n&&window.swal&&window.swal({title:"Activation Successful",text:(null===(i=o.data)||void 0===i?void 0:i.message)||"".concat(t.name," activated successfully!"),icon:"success",confirmButtonColor:"#3085d6",confirmButtonText:"Great!"}),e.n=5;break;case 4:if(n||alert((null===(s=o.data)||void 0===s?void 0:s.message)||"Failed to activate ".concat(t.name)),!n){e.n=5;break}throw new Error((null===(l=o.data)||void 0===l?void 0:l.message)||"Failed to activate ".concat(t.name));case 5:e.n=8;break;case 6:if(e.p=6,c=e.v,n){e.n=7;break}alert("An error occurred during plugin activation: ".concat(c.message)),e.n=8;break;case 7:throw c;case 8:return e.p=8,me(null),e.f(8);case 9:return e.a(2)}},e,null,[[1,6,8,9]])}));return function(t){return e.apply(this,arguments)}}(),Ue=!0===window.JLTMA_IS_PAGE_IMPORTER_MODE,ze=(0,r.useCallback)(function(){xe(),se(null),ae("desktop"),$(!1),Ae([])},[xe]),Ye=(0,r.useCallback)(function(e){ae(e)},[]);return(0,o.jsx)("div",{className:"jltma-templates",children:(0,o.jsxs)("div",{className:"template-library-content",children:[(0,o.jsx)(le,{categoryName:Le().name,templateCount:function(){if(g)return k;var e=Le();return e?e.count:k}(),searchTerm:g,onSearchChange:function(e){h(e),x(1)},onRefresh:qe,refreshing:C,activeTab:N,onTabChange:function(e){S(e),h("")},templateCounts:O,strings:window.JLTMATemplateLibrary.strings||{},mode:be,backButtonClick:ze,categories:t,activeCategory:p,onCategoryChange:Ce,hideFilters:U,isPageImporterMode:Ue,activePlanFilter:Q,onPlanFilterChange:ke,activeDevice:re,onDeviceChange:Ye,parentTemplate:W}),Ue?(0,o.jsxs)(o.Fragment,{children:[!U&&(0,o.jsxs)("div",{className:"page-importer-layout",children:[(0,o.jsx)("div",{className:"page-importer-sidebar",children:W?(0,o.jsx)(ne,{categories:t,activeCategory:p,onCategoryChange:Ce,activePlanFilter:Q,onPlanFilterChange:ke,onFavoritesFilterChange:Me,templates:s,requiredPlugins:ue,mode:be,onImport:Oe}):(0,o.jsx)(ne,{categories:t,activeCategory:p,onCategoryChange:Ce,activePlanFilter:Q,onPlanFilterChange:ke,onFavoritesFilterChange:Me,mode:be})}),W?(0,o.jsx)("div",{className:"page-importer-content",children:(0,o.jsx)(je,{templates:s,loading:u,selectedTemplate:ie,activeDevice:re})}):(0,o.jsx)("div",{className:"page-importer-content",children:(0,o.jsx)(Y,{templates:Ge(),loading:u,onImport:Oe,onPreview:De,pagination:F,onPageChange:Be,loadingPage:q})})]}),U&&M.isOpen&&(0,o.jsx)(we,{isOpen:M.isOpen,templateData:M.templateData,requiredPlugins:M.requiredPlugins||[],onClose:Ie,onImportComplete:Fe,onInstallPlugin:Je,onActivatePlugin:Re,pluginStatuses:ge,installingPlugin:pe})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Y,{templates:Ge(),loading:u,onImport:Oe,onPreview:De,pagination:F,onPageChange:Be,loadingPage:q}),M.isOpen&&(0,o.jsx)(we,{isOpen:M.isOpen,templateData:M.templateData,requiredPlugins:M.requiredPlugins||[],onClose:Ie,onImportComplete:Fe,isTemplateLibraryMode:!0,onInstallPlugin:Je,onActivatePlugin:Re,pluginStatuses:ge,installingPlugin:pe})]})]})})};var De=n(5072),qe=n.n(De),Le=n(2361),Ge={insert:"head",singleton:!1};qe()(Le.A,Ge);Le.A.locals;var Me=null;function Je(){var e=document.getElementById("jltma-template-library-root");return e?(delete e.dataset.mounted,(Me=(0,r.createRoot)(e)).render((0,o.jsx)(Ie,{})),e.dataset.mounted="true",Me):null}document.addEventListener("DOMContentLoaded",function(){Je()}),document.addEventListener("jltma-mount-template-library",function(){Je()}),window.JLTMAMountTemplateLibrary=Je})();
//# sourceMappingURL=template-library.js.map