@emailmaker/emailmaker 1.1.85-dev.6 → 1.1.85-dev.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -92,9 +92,9 @@ ${l}`}function R(t,e=!0){const i=f.decodeFileNameFromPath(t);return e?T(i):i}fun
92
92
  `).trim()}catch{return""}}Object.defineProperty(b,"changeHtml",{enumerable:!0,get:function(){return D}}),Object.defineProperty(b,"extractDocumentTextContent",{enumerable:!0,get:function(){return nt}}),Object.defineProperty(b,"getEML",{enumerable:!0,get:function(){return C}}),Object.defineProperty(b,"getFileNameAndExt",{enumerable:!0,get:function(){return j}}),Object.defineProperty(b,"getFileNameWithExt",{enumerable:!0,get:function(){return R}}),Object.defineProperty(b,"getImageByUrl",{enumerable:!0,get:function(){return O}}),Object.defineProperty(b,"htmlFilesToZip",{enumerable:!0,get:function(){return tt}}),Object.defineProperty(b,"htmlToFilesData",{enumerable:!0,get:function(){return k}}),Object.defineProperty(b,"imageToBlob",{enumerable:!0,get:function(){return _}}),Object.defineProperty(b,"prepareHTML",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(b,"replaceImagesInDocument",{enumerable:!0,get:function(){return N}}),Object.defineProperty(b,"sanitizeFileName",{enumerable:!0,get:function(){return T}})});
93
93
 
94
94
  (function(){try{if(typeof document<"u"){var t='html,body{width:100%;height:100%}.blocks-app input::-ms-clear{display:none}.blocks-app input::-ms-reveal{display:none}.blocks-app *,.blocks-app :before,.blocks-app :after{box-sizing:border-box}html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:#0000;font-family:sans-serif;line-height:1.15}.blocks-app [tabindex="-1"]:focus{outline:none}.blocks-app hr{box-sizing:content-box;height:0;overflow:visible}.blocks-app h1,.blocks-app h2,.blocks-app h3,.blocks-app h4,.blocks-app h5,.blocks-app h6{margin-top:0;margin-bottom:.5em;font-weight:500}.blocks-app p{margin-top:0;margin-bottom:1em}.blocks-app abbr[title],.blocks-app abbr[data-original-title]{cursor:help;border-bottom:0;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.blocks-app address{font-style:normal;line-height:inherit;margin-bottom:1em}.blocks-app input[type=text],.blocks-app input[type=password],.blocks-app input[type=number],.blocks-app textarea{-webkit-appearance:none}.blocks-app ol,.blocks-app ul,.blocks-app dl{margin-top:0;margin-bottom:1em}.blocks-app ol ol,.blocks-app ul ul,.blocks-app ol ul,.blocks-app ul ol{margin-bottom:0}.blocks-app dt{font-weight:500}.blocks-app dd{margin-bottom:.5em;margin-left:0}.blocks-app blockquote{margin:0 0 1em}.blocks-app dfn{font-style:italic}.blocks-app b,.blocks-app strong{font-weight:bolder}.blocks-app small{font-size:80%}.blocks-app sub,.blocks-app sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.blocks-app sub{bottom:-.25em}.blocks-app sup{top:-.5em}.blocks-app pre,.blocks-app code,.blocks-app kbd,.blocks-app samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}.blocks-app pre{margin-top:0;margin-bottom:1em;overflow:auto}.blocks-app figure{margin:0 0 1em}.blocks-app img{vertical-align:middle;border-style:none}.blocks-app a,.blocks-app area,.blocks-app button,.blocks-app [role=button],.blocks-app input:not([type=range]),.blocks-app label,.blocks-app select,.blocks-app summary,.blocks-app textarea{touch-action:manipulation}.blocks-app table{border-collapse:collapse}.blocks-app caption{text-align:left;caption-side:bottom;padding-top:.75em;padding-bottom:.3em}.blocks-app input,.blocks-app button,.blocks-app select,.blocks-app optgroup,.blocks-app textarea{color:inherit;font-size:inherit;font-family:inherit;line-height:inherit;margin:0}.blocks-app button,.blocks-app input{overflow:visible}.blocks-app button,.blocks-app select{text-transform:none}.blocks-app button,html [type=button],.blocks-app [type=reset],.blocks-app [type=submit]{-webkit-appearance:button}.blocks-app button::-moz-focus-inner{border-style:none;padding:0}.blocks-app [type=button]::-moz-focus-inner{border-style:none;padding:0}.blocks-app [type=reset]::-moz-focus-inner{border-style:none;padding:0}.blocks-app [type=submit]::-moz-focus-inner{border-style:none;padding:0}.blocks-app input[type=radio],.blocks-app input[type=checkbox]{box-sizing:border-box;padding:0}.blocks-app input[type=date],.blocks-app input[type=time],.blocks-app input[type=datetime-local],.blocks-app input[type=month]{-webkit-appearance:listbox}.blocks-app textarea{resize:vertical;overflow:auto}.blocks-app fieldset{border:0;min-width:0;margin:0;padding:0}.blocks-app legend{width:100%;max-width:100%;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal;margin-bottom:.5em;padding:0;display:block}.blocks-app progress{vertical-align:baseline}.blocks-app [type=number]::-webkit-inner-spin-button{height:auto}.blocks-app [type=number]::-webkit-outer-spin-button{height:auto}.blocks-app [type=search]{outline-offset:-2px;-webkit-appearance:none}.blocks-app [type=search]::-webkit-search-cancel-button{-webkit-appearance:none}.blocks-app [type=search]::-webkit-search-decoration{-webkit-appearance:none}.blocks-app ::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}.blocks-app output{display:inline-block}.blocks-app summary{display:list-item}.blocks-app template{display:none}.blocks-app [hidden]{display:none!important}.blocks-app .blocks-plugin{zoom:var(--em-appZoom)}.blocks-app .blocks-plugin .ant-layout-sider-children{display:none}.blocks-app *,.blocks-app ul.ai-roles-list *,.blocks-app .ai-response-variant[class*=ai-response] *,.blocks-app ul.buttons-variants [class*=ai-response]{-webkit-user-select:none;user-select:none}.codicon[class*=codicon-]{font:16px/1 codicon!important}.blocks-app .element-card__title,.blocks-app [class*=ai-response],.blocks-app [class*=ai-response] *,.blocks-app .ant-comment-content-detail{-webkit-user-select:text;user-select:text}.blocks-app .code-mode__pane *{-webkit-user-select:auto;user-select:auto}.blocks-app,.blocks-app .ant-app,.blocks-app .ant-app .main,.blocks-app .ant-app .main__pane-content{height:100%}@media (width<=1300px){.blocks-app .ant-app .main{min-width:1270px}}.blocks-app .ant-app [role=button],.blocks-app .ant-app a,.blocks-app .ant-app area,.blocks-app .ant-app button,.blocks-app .ant-app input:not([type=range]),.blocks-app .ant-app label,.blocks-app .ant-app select,.blocks-app .ant-app summary,.blocks-app .ant-app textarea{touch-action:manipulation}.blocks-app .ant-app ::-webkit-scrollbar{width:10px;height:10px}.blocks-app .ant-app ::-webkit-scrollbar-corner{background:0 0}.blocks-app .ant-app ::-webkit-scrollbar-track{background:0 0}.blocks-app .ant-app ::-webkit-scrollbar-thumb{min-height:20px;box-shadow:inset 0 0 0 10px var(--em-colorFillSecondaryDarken);background-clip:content-box;border:3px solid #0000;border-radius:8px;transition:all .2s}.blocks-app .ant-app ::-webkit-scrollbar-thumb:hover{box-shadow:inset 0 0 0 10px var(--em-colorTextDisabled)}.blocks-app .ant-app textarea::-webkit-scrollbar-track{margin:10px}.blocks-app .ant-app .ant-btn.ant-btn-icon-only .free-mode-firewall-icon,.blocks-app .ant-app .email-pane .ant-tabs-tab .free-mode-firewall-icon,.blocks-app .ant-app .free-mode-firewall-icon{background-color:var(--em-colorBgLayout);border-radius:100%;justify-content:center;display:flex;position:absolute;bottom:0;right:0}.blocks-app .ant-app .email-pane .ant-tabs-tab .free-mode-firewall-icon_emailpane{background-color:var(--em-colorBgContainer);bottom:13px;right:13px}.blocks-app .ant-app .ant-table-wrapper .ant-table{border-radius:calc(var(--em-borderRadiusXL) * 1px);overflow:hidden;background:0 0!important}.blocks-app .ant-app .ant-table-wrapper .ant-table .ant-table-thead>tr,.blocks-app .ant-app .ant-table-wrapper .ant-table .ant-table-thead>tr>th,.blocks-app .ant-app .ant-table-wrapper .ant-table .ant-table-thead>tr>td{background:0 0!important}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper,.blocks-app .ant-app .email-pane__content-col .selected-td-form__button:not(.ant-btn-text),.blocks-app .ant-app .email-pane__content-col .ant-btn-default{background:var(--em-colorFillSecondary);border:1px solid #0000!important}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){color:var(--em-colorPrimary);background:var(--em-colorFillSecondary);border-color:#0000}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button{min-height:calc(var(--em-formControlHeight) * 1px);min-width:calc(var(--em-formControlHeight) * 1px);padding:0 8px;line-height:1;position:relative}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button.ant-btn-icon-only .ant-btn-icon{justify-content:center;align-items:center;width:100%;height:100%;display:inline-flex}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button.ant-btn-icon-only .anticon{vertical-align:0;justify-content:center;align-items:center;line-height:1;display:inline-flex}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button.ghost-button:before{content:"";z-index:1;cursor:pointer;background-color:#0000;width:385px;height:50px;position:absolute;top:-9px;left:-338px}.blocks-app .ant-app .email-pane__content-col .ant-btn-default:not(:disabled,.ant-btn-disabled,.email-pane__content-col .selected-td-form__button--active):hover{background:var(--em-colorFillSecondaryDarken);color:inherit;border-color:#0000}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button--active,.blocks-app .ant-app .email-pane__content-col .ant-btn-default.selected-td-form__button--active{background:var(--em-colorPrimaryBg);color:var(--em-colorPrimary);border-color:#0000}.blocks-app .ant-app .email-pane__content-col .selected-td-form__button--active:hover{background:var(--em-colorPrimaryBgHover);color:var(--em-colorPrimaryTextHover)}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper,.blocks-app .ant-app .email-page .ant-btn{min-width:calc(var(--em-formControlHeight) * 1px);height:calc(var(--em-formControlHeight) * 1px);line-height:calc((var(--em-formControlHeight) - 2) * 1px);text-align:center;padding:0 9px}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper{justify-content:center;align-items:center;padding:0 7px;display:flex}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper>span{display:inline-flex}.blocks-app .ant-app .ant-btn.ant-btn-icon-only.project-page__add-folder{margin-top:26px}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked):hover{color:inherit;background:var(--em-colorFillSecondaryDarken)}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper.ant-radio-button-wrapper-checked{background:var(--em-colorPrimaryBg)}.blocks-app .ant-app .email-pane__content-col .ant-radio-button-wrapper.ant-radio-button-wrapper-checked:hover{background:var(--em-colorPrimaryBgHover);color:var(--em-colorPrimaryTextHover)}.blocks-app .ant-app .email-pane__content-col .ant-form-item{margin-bottom:calc(var(--em-formItemMarginBottomMD) * 1px)}.blocks-app .ant-app .email-pane__content-col .ant-form-item.form-item-margin-xs{margin-bottom:calc(var(--em-formItemMarginBottomXS) * 1px)}.blocks-app .ant-app .selected-td-form__br-input{margin-bottom:8px!important}.blocks-app .ant-app .addon-text-content{font-size:11px;font-weight:600}.blocks-app .ant-app .addon-text-content--icon{align-items:center;font-size:0;line-height:0;display:inline-flex}.blocks-app .ant-app .ant-btn.ant-btn-lg.project-page__folder_menu{text-align:center;width:32px;height:32px;padding:0;line-height:32px}.blocks-app .ant-app .editor .main__pane{overflow:hidden}.blocks-app .ant-app .element-card_block.ant-card-bordered .ant-card-cover .element-card__img-wrapper{background-color:#0000;background-image:linear-gradient(45deg,#0000001a 25%,#0000 0 75%,#0000001a 0),linear-gradient(45deg,#0000001a 25%,#0000 0 75%,#0000001a 0);background-position:0 0,4px 4px;background-repeat:repeat,repeat;background-size:8px 8px;background-attachment:scroll,scroll;background-origin:padding-box,padding-box;background-clip:border-box,border-box}.blocks-app .ant-app .ant-tabs-tabpane{width:100%}.blocks-app .ant-app .ant-tabs-large>.ant-tabs-nav .ant-tabs-tab{padding:18px 0}.blocks-app .ant-app .ant-tabs-content-holder{position:relative}.blocks-app .ant-app #filerobot-editor ::-webkit-scrollbar-thumb{border:none}.blocks-app .ant-app .email-pane__bottom .code-mode__pane{border-top:1px solid var(--em-colorBorder)}.blocks-app .ant-app .container{width:100%;margin:0 auto;padding:0 65px}@media (width<=1550px){.blocks-app .ant-app .container{gap:10px;padding:0 10px}}.blocks-app .ant-app .projects-page__container .container{padding-top:30px}.blocks-app .ant-app .container.email-pane__col-wrapper_pinch{padding-right:0}.blocks-app .ant-app body,.blocks-app .ant-app .ant-layout{transition:background-color .2s ease-in-out}.blocks-app .ant-app p{margin-top:0}.blocks-app .ant-app .ant-layout-content.container{padding-bottom:40px}.blocks-app .ant-app .ant-table-wrapper{width:100%}.blocks-app .ant-app .ant-table{border-radius:16px;overflow:hidden}.blocks-app .ant-app .verticalColorpicker.ant-color-picker .ant-color-picker-inner-content{width:340px}.blocks-app .ant-app .ant-color-picker .ant-color-picker-inner-content .ant-color-picker-panel .ant-color-picker-select .ant-color-picker-palette{min-height:160px}.blocks-app .ant-app .easylogic-colorpicker{border-radius:8px}.blocks-app .ant-app .easylogic-colorpicker .colorpicker-body .color{border-radius:8px 8px 0 0}.blocks-app .ant-app .ant-page-header-heading-title{max-width:700px;white-space:unset;box-shadow:none;align-items:baseline;padding:0;font-size:18px;line-height:24px}.blocks-app .ant-app .ant-page-header-heading-title.ant-typography-edit-content{overflow:unset;margin-top:0}.blocks-app .ant-app .ant-page-header-heading-title textarea{background:0 0;font-size:16px;font-weight:500;line-height:20px}.blocks-app .ant-app .ant-page-header-heading-preheader:disabled,.blocks-app .ant-app .ant-page-header-heading-title:disabled{cursor:not-allowed;-webkit-user-select:none;user-select:none;pointer-events:none}.blocks-app .ant-app .ant-menu{background:inherit}.blocks-app .ant-app .ant-page-header{background:inherit;margin-bottom:20px;padding:20px 0}@media (width<=1450px){.blocks-app .ant-app .ant-page-header{padding:10px 0}}.blocks-app .ant-app .ant-page-header-heading-left{margin:0;overflow:visible}.blocks-app .ant-app .ant-page-header-heading-extra{margin:0}.blocks-app .ant-app .ant-page-header-heading-sub-title{display:block;overflow:visible}.blocks-app .ant-app .ant-progress-inner{background-color:#fff}.blocks-app .ant-app .dark .ant-progress-inner{background-color:#ffffff14}.blocks-app .ant-app .ant-collapse>.ant-collapse-item>.ant-collapse-header{flex-direction:row-reverse}.blocks-app .ant-app .ant-tabs-tab{justify-content:center}.blocks-app .ant-app .nobr{white-space:nowrap}.blocks-app .ant-app .checkbox-horizontal .ant-row{flex-direction:row-reverse;justify-content:flex-end;align-items:center}.blocks-app .ant-app .checkbox-horizontal .ant-form-item-control{margin-right:10px;flex-grow:0!important;width:auto!important}.blocks-app .ant-app .checkbox-horizontal .ant-form-item-label{padding:0!important}.blocks-app .ant-app .ant-comment .ant-comment-nested{margin-left:24px}.blocks-app .ant-app .ant-comment .ant-comment-avatar{margin-top:-2px;margin-right:8px;position:relative}.blocks-app .ant-app .ant-comment .ant-comment-avatar img{width:24px;height:24px}.blocks-app .ant-app .ant-comment .ant-comment-inner{background:var(--em-colorBgLayout);border-radius:8px;margin-bottom:12px;padding:12px;display:flex}.blocks-app .ant-app img:not([srcset*=\\.],[src*=\\.],[src*=data\\:image]){display:none}.blocks-app .ant-app .dark .targetted-comment-item>.ant-comment-inner{background:#7030d43b}.blocks-app .ant-app .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before,.blocks-app .blocks-modal .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before{background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);border-top:1px solid var(--em-colorBorderSecondary);z-index:1;background-position:0 -2px;background-repeat:no-repeat;border-bottom:none;height:20px;bottom:-20px}.blocks-app .ant-app .ant-tabs-top[style*=vh]>.ant-tabs-nav:before,.blocks-app .blocks-modal .ant-tabs-top[style*=vh]>.ant-tabs-nav:before{background:0 0}.dark .blocks-app .ant-app .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before,.dark .blocks-app .blocks-modal .ant-tabs-top:not(.secondary-tabs_unset_scroll)>.ant-tabs-nav:before{background:linear-gradient(180deg, var(--em-colorBgBase) -100%, transparent 50%)}.blocks-app .ant-app .ant-tabs-top>.ant-tabs-nav,.blocks-app .blocks-modal .ant-tabs-top>.ant-tabs-nav{margin-bottom:20px}.blocks-app .ant-app .ant-tabs.email-pane__col_settings-inner>.ant-tabs-nav .ant-tabs-nav-operations,.blocks-app .ant-app .ant-tabs.email-pane__col_settings-inner>div>.ant-tabs-nav .ant-tabs-nav-operations,.blocks-app .blocks-modal .ant-tabs.email-pane__col_settings-inner>.ant-tabs-nav .ant-tabs-nav-operations,.blocks-app .blocks-modal .ant-tabs.email-pane__col_settings-inner>div>.ant-tabs-nav .ant-tabs-nav-operations{visibility:hidden;pointer-events:none;position:absolute}.blocks-app .transition-enter{opacity:0}.blocks-app .transition-enter-active{opacity:1;transition:opacity .3s ease-in}.blocks-app .transition-exit{opacity:1}.blocks-app .transition-exit-active{opacity:0;transition:opacity .3s ease-in}.blocks-app #carrotquest-messenger-collapsed-container{z-index:10!important}.blocks-app .carrot-messenger-frame-container{z-index:11!important}.blocks-app .default-mode__pane_editor,.blocks-app .code-mode{z-index:20}@media (height<=700px){.blocks-app .ant-color-picker-presets .ant-collapse-item:last-child{display:none}}@media only screen and (device-width<=480px),only screen and (width<=480px){.blocks-app .email-pane_only_code_mode_mobile .email-pane__row .ant-col:first-child{display:none}.blocks-app .email-pane_only_code_mode_mobile .email-pane__row .ant-col:last-child{width:100%!important}}.blocks-app .em-filemanager .uploadProgress{right:105px!important}body{margin:0}.blocks-app .ant-menu-submenu-placement-rightTop:before,.blocks-app .ant-menu-submenu-placement-rightTop:after{display:none!important}.blocks-app .main{overflow:hidden}.blocks-app .main__pane-layout{height:100%;min-height:100%}.blocks-app .main__pane{height:100%;transition:height .2s cubic-bezier(0,0,.2,1);position:relative}.blocks-app .main__pane_editor{z-index:2;box-shadow:0 10px 60px #2223}.blocks-app .main__pane .ant-layout-sider-trigger{flex-direction:column;justify-content:center;display:flex;overflow:hidden}.blocks-app .main__pane-trigger{box-sizing:border-box;justify-content:space-between;align-items:center;gap:8px;width:100%;min-width:0;max-width:100%;display:flex}.blocks-app .main__pane-trigger .anticon{flex-shrink:0}.blocks-app .main__pane-trigger .theme-switcher{flex:auto;min-width:0}.blocks-app .main__pane-trigger_compact{justify-content:center;gap:0}.blocks-app .main__pane-trigger .anticon-menu-unfold,.blocks-app .main__pane-trigger:hover .anticon-menu{display:none}.blocks-app .main__pane-trigger:hover .anticon-menu-unfold,.blocks-app .main__pane-trigger .anticon-menu{display:inline-flex}.blocks-app .main__panes-resizer{position:relative}.blocks-app .main__panes-resizer:before{content:"";background-color:#0000;border-bottom:2px solid #0000;width:100%;height:10px;transition:border-color .2s;position:absolute;bottom:0;left:0;right:0}.blocks-app .main__panes-resizer:hover{cursor:row-resize}.blocks-app .main__panes-resizer:hover:before{border-color:var(--em-colorPrimary)}.blocks-app .main__pane-close-btn{z-index:21;bottom:0;left:50%;transform:translate(-50%)}.blocks-app .main__pane-close-btn.ant-btn{border:0;border-radius:25px 25px 0 0;width:50px;height:25px;padding:0;position:absolute}.blocks-app .main__pane-close-btn .anticon{border-radius:50px 50px 0 0;outline:0 solid #188fff40;align-items:flex-end;height:100%;transition:all .1s cubic-bezier(0,0,.2,1)}.blocks-app .main__pane-close-btn .anticon.show-halo{outline-width:12px}.blocks-app .main__pane-close-btn .anticon.opened{align-items:flex-start;transform:rotate(180deg)}.blocks-app .main__pane-trigger .anticon.anticon-menu-fold{display:inline-flex}.blocks-app .main__pane-trigger.ant-btn{z-index:1;width:100%;height:70px;box-shadow:none;background:0 0;border:0;display:block;position:absolute;top:0;left:0;right:0}.blocks-app .main__pane-trigger.ant-btn:hover,.blocks-app .main__pane-trigger.ant-btn:focus{background:0 0}.blocks-app .main__pane-trigger.ant-btn:empty{visibility:visible;width:100%;display:block}.blocks-app .main__menu{z-index:11;height:100%;position:sticky;top:0}.blocks-app .main__menu .ant-layout-sider-children{box-sizing:border-box;max-height:100vh;overflow:hidden auto}.blocks-app .main__menu>div{border-right:1px solid;border-color:inherit}.blocks-app .main__menu:not(.ant-layout-sider-collapsed){margin-right:-180px;top:0;left:0;box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d}.blocks-app body.dark .main__menu:not(.ant-layout-sider-collapsed){box-shadow:0 3px 6px -4px #0000007a,0 6px 16px #00000052,0 9px 28px 8px #0003}.blocks-app .main__menu.main__menu_lock{box-shadow:none;margin-right:0}.blocks-app body.dark .main__menu.main__menu_lock{box-shadow:none}.blocks-app .main__menu *{text-overflow:unset!important}@media (width<=1400px){.blocks-app .main__menu .ant-layout-sider-zero-width-trigger{z-index:100000;top:50%;text-align:center;visibility:visible;width:20px;height:60px;font-size:16px;inset-inline-start:0;transform:translateY(-30px);box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #0000000f}.blocks-app .main__menu .ant-layout-sider-zero-width-trigger-right{visibility:hidden}}.blocks-app .main__content-wrapper{position:relative}@media (width<=1550px){.blocks-app .main__header{padding:0 20px 0 40px!important}}.blocks-app .ant-layout .ant-layout-sider-trigger{text-align:left;border-bottom:none;padding:0 30px}.blocks-app .ant-app .main__menu:not(.ant-layout-sider-collapsed) .ant-layout-sider-trigger{padding:0 30px}.blocks-app .ant-app .main__menu.ant-layout-sider-collapsed .ant-layout-sider-trigger{padding:0 10px}.blocks-app .ant-layout-sider-light .ant-layout-sider-trigger{background:0 0}.blocks-app .ant-btn.project-menu__block-button{padding:0!important}.blocks-app .selected-element-panel__columns-settings__controls__field{background:var(--em-colorBgElevated);border:calc(var(--em-borderWidth) * 1px) solid var(--em-colorFillSecondaryDarken);transition:all .2s linear .2s}.blocks-app .selected-element-panel__columns-settings__controls__field:hover{border-color:var(--em-borderColorHover)}.blocks-app .selected-element-panel__columns-settings__controls__field:focus,.blocks-app .selected-element-panel__columns-settings__controls__field:focus-within{border-color:var(--em-colorPrimaryBorder);box-shadow:0 0 0 2px #0591ff1a}.blocks-app .selected-element-panel__columns-settings__controls__column.current .selected-element-panel__columns-settings__controls__field{background:var(--em-colorPrimaryBg);border-color:var(--em-colorPrimaryBorder)}.blocks-app .structures{margin-left:-3px;margin-right:-3px;overflow:visible}.blocks-app .structures__list{margin-bottom:-10px}.blocks-app .structures__item{box-sizing:border-box;cursor:grab;flex-direction:row;justify-content:center;align-items:center;width:100%;min-width:100%;height:50px;margin-bottom:20px;padding:0;display:flex}.blocks-app .structures__item:hover .structures__item-row{background:var(--em-colorFillTertiary);border:#0000;box-shadow:0 1px 2px -2px #00000029,0 3px 6px #0000001f,0 5px 12px 4px #00000017}.dark .blocks-app .structures__item:hover .structures__item-row{background:var(--em-colorBgSpotlight)}.blocks-app .structures__item-row{background:var(--em-colorFillSecondary);border-radius:calc(var(--em-borderRadius) * 1.2px);width:97%;height:100%;padding:6px 3px;transition:box-shadow .3s,border-color .3s,background-color .3s}.blocks-app .structures__item-col{border-radius:calc(var(--em-borderRadius) * 1px);border:1px solid var(--em-controlItemBgActiveHover);background:var(--em-controlItemBgActive);width:100%;height:100%}.dark .blocks-app .structures__item-col{border-color:var(--em-colorBgElevated);background:var(--em-colorFillTertiary)}.blocks-app .em-dragging-element .structures__item .structures__item-row{background-color:var(--em-controlTmpOutline);box-shadow:none}.dark .blocks-app .em-dragging-element .structures__item .structures__item-row{background:var(--em-controlTmpOutline)}.blocks-app .em-dragging-element .structures__item .structures__item-row .structures__item-col{opacity:0;border-radius:calc(var(--em-borderRadius) * 1px)}.blocks-app .em-ghost-element{background-color:var(--em-colorBgContainer);border-radius:calc(var(--em-borderRadiusXL) * 1px)}.blocks-app .em-ghost-element .structures__item-col{opacity:1!important}.dark .blocks-app .em-ghost-element{background:var(--em-colorBgSpotlight)}@media (width<=1550px){.blocks-app .structures__item{margin-bottom:16px}.blocks-app .structures__item:last-child{margin-bottom:20px}}.blocks-app .atoms{overflow:visible}.blocks-app .atoms__list{margin-bottom:20px;transition:opacity .2s}.blocks-app .atoms__item{font:inherit;text-align:center;appearance:none;box-sizing:border-box;border-radius:calc(var(--em-borderRadius) * 1px);width:109px;height:70px;color:var(--em-colorTextSecondary);background:var(--em-colorFillSecondary);border:0;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:5px;display:flex;position:relative}.blocks-app .atoms__item.ant-card-hoverable{cursor:grab!important}.blocks-app .atoms__item:hover{border-color:var(--em-colorBgElevated)}.dark .blocks-app .atoms__item:hover{border-color:var(--em-colorTextDisabled);background:var(--em-colorBorder)}.blocks-app .atoms__item_inactive{opacity:.5;cursor:default}.blocks-app .atoms__item_inactive:hover{border-color:var(--em-colorBorder)}.blocks-app .atoms__item_locked .atom-image{opacity:.55;margin-bottom:6px;display:inline-flex;position:relative}.blocks-app .atoms__item_locked .atom-image__lock{opacity:1;background-color:var(--em-colorBgContainer);border-radius:100%;position:absolute;bottom:-2px;right:-6px}.blocks-app .atoms__item_locked .atom-title{opacity:.55}.blocks-app .atoms__item.ai:before{content:"AI";color:#fff;background-color:var(--em-colorInfo);text-align:center;border-radius:0 calc(var(--em-borderRadius) * 1px) 0 calc(var(--em-borderRadiusSM) * 1px);width:36px;padding:1px 5px;font-size:12px;line-height:1.2;display:inline-block;position:absolute;top:0;right:0}.blocks-app .atoms__item.amp:before{content:"AMP";color:#fff;background-color:var(--em-colorPrimary);text-align:center;border-radius:0 8px 0 5px;width:36px;padding:1px 5px;font-size:12px;line-height:1.2;display:inline-block;position:absolute;top:0;right:0}.blocks-app .atoms .anticon{color:var(--em-colorTextSecondary);font-size:28px}.blocks-app .atoms .em-dragging-element .atoms__item{background-color:var(--em-controlTmpOutline)}.blocks-app .atoms .em-ghost-element{background-color:var(--em-colorBgContainer)!important;border:1px solid var(--em-colorBorder)!important}.blocks-app .atoms .atom-title{color:var(--em-colorTextTertiary);text-align:center;font-size:13px;line-height:1}.blocks-app #email_iframe{vertical-align:top;background-color:#f8f8f8;border:0;width:1px;min-width:100%}.blocks-app .iframe-provider+#email_iframe_slot{pointer-events:none}.blocks-app .iframe-provider{width:100%;height:100%;position:absolute;top:0;left:0}.blocks-app .browser-extension-warning-modal__footer,.blocks-app .browser-translate-warning-modal__footer{justify-content:center;margin-top:24px;display:flex}.blocks-app .email-pane{position:relative}.blocks-app .email-pane__loader{z-index:10;background-color:#fff6;width:100%;height:100%;position:fixed;top:0;left:0}.dark .blocks-app .email-pane__loader{background-color:#0006}.blocks-app .email-pane__paths{border-top:1px solid var(--em-colorBorder);z-index:10;background-color:var(--em-colorBgContainer);justify-content:space-between;align-items:center;width:100%;transition:all .5s;display:flex;position:sticky;bottom:0;left:0}.blocks-app .email-pane__paths>div{color:var(--em-colorTextTertiary);padding:3px 15px}.blocks-app .email-pane__paths .ant-breadcrumb{white-space:nowrap;overflow:auto hidden}.blocks-app .email-pane__paths .ant-breadcrumb ol{flex-wrap:nowrap;padding-right:10px}.blocks-app .email-pane__paths .ant-breadcrumb li{position:relative}.blocks-app .email-pane__paths .ant-breadcrumb li:hover>span{color:var(--em-colorPrimary)}.blocks-app .email-pane__paths .ant-breadcrumb li>span{color:var(--em-colorTextSecondary);cursor:pointer;padding:3px 15px;display:block}.blocks-app .email-pane__paths .ant-breadcrumb li>span span{align-items:center;gap:4px;display:flex}.blocks-app .email-pane__paths .ant-breadcrumb li:after{content:"";border-style:solid;border-width:15px 0 15px 10px;border-color:transparent transparent transparent var(--em-colorBgContainer);width:0;height:0;transition:all .5s;position:absolute;top:50%;right:-5px;transform:translateY(-50%)}.blocks-app .email-pane__paths .ant-breadcrumb li:before{content:"";border-style:solid;border-width:15px 0 15px 10px;border-color:transparent transparent transparent var(--em-colorBorder);width:0;height:0;transition:all .5s;position:absolute;top:50%;right:-6px;transform:translateY(-50%)}.blocks-app .email-pane__code-size{white-space:nowrap;margin-left:auto;padding:3px 15px;font-size:14px}.blocks-app .email-pane__code-size_exceeded{color:var(--em-colorError)}.blocks-app .email-pane .ant-btn-primary.mobile_view{background-color:var(--em-colorInfo)}.blocks-app .email-pane .ant-btn-primary.mobile_view:hover{background-color:var(--em-colorInfoHover)}.blocks-app .email-pane .ant-tabs .ant-tabs-tab-btn{transition:none}.blocks-app .email-pane .ant-tabs-extra-content{justify-content:center;align-items:center;display:flex}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode{margin-top:22px;transform:rotate(90deg)}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode .ant-segmented-item-label{min-height:40px;padding:0;line-height:40px}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode .ant-segmented-item-icon{width:28px;height:40px;display:inline-block;transform:rotate(-90deg)}.blocks-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode .ant-segmented-item-icon .anticon{position:relative}.blocks-app .email-pane .email-pane_code-mode .email-pane__col-wrapper{transition:all .5s;padding-top:0!important}.blocks-app .blocks-plugin .email-pane .email-pane_code-mode .email-pane__resizable{padding-top:60px;transition:all .5s}.blocks-app .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__col-wrapper{padding-top:0!important}.blocks-app .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__left .email-pane__content-col_main{border-width:0;border-radius:0;margin-left:0;margin-right:0;border-top-width:0!important;border-bottom-width:0!important;border-right-width:0!important}.blocks-app .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__right .email-pane__content-col_main{border-width:0;border-radius:0;margin-left:0;margin-right:0;border-top-width:0!important;border-bottom-width:0!important;border-left-width:0!important}.blocks-app .blocks-plugin .email-pane .email-pane_code-mode:not(.email-pane_is-mobile,.email-pane_code-mode-bottom) .email-pane__resizable{max-width:calc(100% - 2px);margin-bottom:0;padding-top:0}.blocks-app .email-pane .selected-td-form__padding-input .ant-input-number-focused input{text-align:left}.blocks-app .email-pane .selected-td-form__padding-input input{text-align:center}.blocks-app .email-pane .email-pane__comment-counter{background-color:var(--em-colorInfo);color:var(--em-colorWhite);border:none}.blocks-app .email-pane .element-controls{width:100%;height:100%}.blocks-app .email-pane #selected_element_form_desktop_props{height:100%}.blocks-app .email-pane .ant-tabs .ant-divider-horizontal.selected-td-form__divider{border-top:1px solid var(--em-colorBorderSecondary);background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);width:calc(100% + 50px);margin:26px -23px}.dark .blocks-app .email-pane .ant-tabs .ant-divider-horizontal.selected-td-form__divider{background:linear-gradient(180deg, var(--em-colorBgBase), transparent 40%)}.blocks-app .email-pane .ant-tabs .element-controls .selected-td-form__divider{margin-top:0;margin-bottom:0}.blocks-app .email-pane .ant-tabs .blocks-search__divider{pointer-events:none;width:auto;height:20px;margin:24px 0 0;position:absolute;bottom:-20px;left:-24px;right:-13px}.blocks-app .email-pane .ant-tabs ::-webkit-scrollbar-thumb{box-shadow:inset 0 0 0 10px var(--em-colorFillSecondary)}.blocks-app .email-pane .ant-tabs ::-webkit-scrollbar-thumb:hover{box-shadow:inset 0 0 0 10px var(--em-colorFill)}.blocks-app .email-pane .ant-tabs .blocks-search__empty-shadow{height:100%;position:relative}.blocks-app .email-pane .ant-tabs .blocks-search__empty-shadow:after{content:"";background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);z-index:1;width:calc(100% + 48px);height:20px;margin-left:-24px;position:absolute;top:0;left:0}.blocks-app .email-pane .ant-tabs .blocks-search__empty-wrapper{height:calc(100% + 10px);margin:0 -24px;padding:24px 14px 0 24px;position:relative;overflow:scroll}.blocks-app .email-pane__container{scroll-behavior:smooth;min-height:100%;padding-top:0}.blocks-app .email-pane_code-mode .email-pane__container{overflow:unset;height:unset;padding-bottom:0;position:relative}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel{z-index:101;pointer-events:none;height:0;position:absolute;inset:0 0 auto}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel>div{pointer-events:auto}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel .selected-element-panel-content.selected-element-panel__content_abs{width:fit-content;max-width:calc(100% - 24px);min-height:auto;display:block}.blocks-app .email-pane_code-mode:not(.email-pane_code-mode-bottom) .email-pane__container>.selected-element-panel .selected-element-panel-content.selected-element-panel__content_abs form.element-controls{height:auto;min-height:auto}.blocks-app .email-pane__col-wrapper{flex-wrap:nowrap;gap:30px;display:flex;position:relative}.blocks-app .email-pane__col-wrapper .email-pane__col_settings{margin-top:30px}.blocks-app .email-pane__col-wrapper .email-pane__col_settings-inner{border-radius:8px;position:sticky;top:30px;left:0}.blocks-app .ant-app .email-pane__col-wrapper_reverse{flex-direction:row-reverse}.blocks-app .email-pane .email-pane__sizeSwitcher:not(.email-pane__pinch,.email-pane__right) .email-pane__col-wrapper{top:-114px}.blocks-app .email-pane_code-mode .email-pane__code-divider{opacity:0;cursor:ew-resize;background-color:var(--em-colorPrimary);width:5px;height:100%;transition:opacity .4s;position:absolute}.blocks-app .email-pane_code-mode .email-pane__code-divider:hover,.blocks-app .email-pane_code-mode .email-pane__code-divider:active{opacity:1;background-color:var(--em-colorPrimary)}.blocks-app .email-pane_code-mode.email-pane .email-pane__row:not(.email-pane__bottom,.email-pane__sizeSwitcher) .email-pane__content-col_main{border-radius:0;border:0 solid var(--em-colorBorder)!important;margin:0!important}.blocks-app .email-pane_code-mode.email-pane .email-pane__row:not(.email-pane__bottom,.email-pane__sizeSwitcher) [class^=device-width__] button{display:none}.blocks-app .email-pane_code-mode .email-pane__left{flex-direction:row}.blocks-app .email-pane_code-mode .email-pane__left>div:first-child{border-right:1px solid var(--em-colorBorder);overflow-y:auto!important}.blocks-app .email-pane_code-mode .email-pane__left .email-pane__handle.left{display:none}.blocks-app .email-pane_code-mode .email-pane__left .email-pane__code-divider{left:-2px}.blocks-app .email-pane_code-mode .email-pane__right{flex-direction:row-reverse}.blocks-app .email-pane_code-mode .email-pane__right>div:first-child{border-left:1px solid var(--em-colorBorder);overflow-y:auto!important}.blocks-app .email-pane_code-mode .email-pane__right .email-pane__handle.right{display:none}.blocks-app .email-pane_code-mode .email-pane__right .email-pane__code-divider{right:-2px}.blocks-app .email-pane_code-mode .email-pane__bottom{max-width:unset;flex-direction:column;margin:0}.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__col-wrapper{width:100%;margin:0 auto}.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__code-divider{opacity:0;cursor:ns-resize;z-index:10;width:100%;height:2px;top:-2px}.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__code-divider:hover,.blocks-app .email-pane_code-mode .email-pane__bottom .email-pane__code-divider:active{opacity:1;background-color:var(--em-colorPrimary)}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper{gap:0;height:100%;padding-left:3px}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col.email-pane__col_preview{overflow-y:scroll;height:100%!important}@media (width<=1590px){.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col.email-pane__col_preview{overflow-x:hidden}}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .ant-tabs-content-holder{border-radius:0}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper.email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-left:10px;padding-right:0}.blocks-app .email-pane__left .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper.email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-left:65px;padding-right:0}.blocks-app .email-pane .email-pane__col-wrapper_pinch.email-pane__col-wrapper .ant-tabs-right>.ant-tabs-nav .ant-tabs-tab{height:53px;padding-top:6px;padding-left:6px;padding-right:6px}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-right:0}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0}.blocks-app .email-pane .email-pane__right.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-left:0;padding-right:35px;overflow:visible}.blocks-app .email-pane .email-pane__right.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview .email-pane__content-col.email-pane__content-col_main{border-width:1px}.blocks-app .email-pane .email-pane__left.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-left:65px!important;padding-right:0!important}.blocks-app .email-pane .email-pane__right .email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview,.blocks-app .email-pane .email-pane__left.email-pane__sizeSwitcher .email-pane__col-wrapper_reverse .email-pane__col.email-pane__col_preview{padding-left:0!important;padding-right:0!important}.blocks-app .email-pane .email-pane__right:not(.email-pane__pinch) .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0;padding-right:65px}.blocks-app .email-pane .email-pane__right.email-pane__pinch.email-pane__sizeSwitcher .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0}.blocks-app .email-pane .email-pane__right.email-pane__pinch.email-pane__sizeSwitcher .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col_preview{padding-left:0;padding-right:65px}.blocks-app .email-pane .email-pane__reverse .email-pane__col-wrapper_pinch.email-pane__col-wrapper{padding-left:0}.blocks-app .email-pane .email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-top:30px}.blocks-app .email-pane .email-pane__sizeSwitcher .email-pane__col-wrapper_pinch .email-pane__col.email-pane__col_preview{padding:60px 2px 0}.blocks-app .email-pane .email-pane__reverse.email-pane__sizeSwitcher .email-pane__col.email-pane__col_preview{padding-right:65px}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__right .email-pane__col.email-pane__col_preview,.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__left .email-pane__col.email-pane__col_preview{padding-top:0}.blocks-app .email-pane .email-pane__right .email-pane__col_preview,.blocks-app .email-pane .email-pane__left .email-pane__col_preview{padding-left:0;padding-right:0}.blocks-app .email-pane .email-pane.email-pane_code-mode .email-pane__col-wrapper_pinch.email-pane__col-wrapper .email-pane__col.email-pane__col_preview{height:100%!important}.blocks-app .email-pane .email-pane__sizes-panel-wrapper{z-index:5;position:sticky;top:30px;left:15px}.blocks-app .email-pane .email-pane__right .email-pane__sizes-panel-wrapper{left:auto;right:15px}.blocks-app .email-pane .email-pane__right.email-pane__sizeSwitcher .email-pane__sizes-panel-wrapper{display:none}.blocks-app .email-pane .email-pane__pinch .email-pane__sizes-panel-wrapper{position:absolute;top:12px;left:calc(50% - 266px)}.blocks-app .email-pane .email-pane__reverse .email-pane__sizes-panel-wrapper{left:auto;right:calc(50% - 266px)}.blocks-app .email-pane .email-pane__reverse.email-pane__left.email-pane__pinch .email-pane__sizes-panel-wrapper{display:none;left:15px;right:auto}.blocks-app .email-pane .email-pane__sizes-panel{background-color:var(--em-colorBgElevated);border:1px solid var(--em-colorBorder);border-radius:34px}.blocks-app .email-pane__header{padding-right:10px}.blocks-app .email-pane__header .header__left{margin-left:0}.blocks-app .email-pane__header .header__logo{float:left;height:auto;margin-top:5px;margin-right:26px;padding-right:0;font-size:22px!important}.blocks-app .email-pane__header__title{align-items:center;width:100%;display:flex}.blocks-app .email-pane__header__title__project a{white-space:nowrap;text-overflow:ellipsis;flex:1;max-width:190px;display:flex;overflow:hidden}.blocks-app .email-pane__header__title__project{float:left;margin-top:10px}.blocks-app .email-pane__header__title__project a:hover{color:var(--em-colorPrimary)}.blocks-app .email-pane__header__title .ant-typography{white-space:nowrap;text-overflow:ellipsis;flex:1;margin:10px 0 10px 20px;padding:0;display:flex;overflow:hidden}.blocks-app .email-pane__row{flex-wrap:nowrap;justify-content:space-between;gap:30px;height:100%;position:relative}.blocks-app .email-pane_path-enabled .email-pane__row{height:calc(100% - 29px)}.blocks-app .email-pane_code-mode .email-pane__row{gap:0;height:calc(100% - 29px);padding:0}.blocks-app .email-pane__col_settings{border-color:var(--em-colorBorder);height:100%;margin-right:50px;position:sticky;top:0;bottom:60px;overflow:visible}.blocks-app .email-pane__col_disabled.email-pane__content-col_tabs.email-pane__content-col{width:68px;min-width:68px;margin-right:0}.blocks-app .email-pane__col_settings-inner{height:100%;max-height:100%;margin-right:0}.blocks-app .email-pane__col_settings-inner_reverse{flex-direction:row-reverse}.blocks-app .email-pane__col_settings-inner_reverse .email-pane__tab-bar.ant-tabs-nav{margin-left:0;margin-right:8px}.blocks-app .email-pane__col_settings-inner_reverse .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab-btn>span{line-height:1}.blocks-app .email-pane__col .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab-btn>span{height:24px;margin-right:0;font-size:20px}.blocks-app .email-pane__col-wrapper_pinch .email-pane__col .email-pane__tab-bar.ant-tabs-nav{border-left:1px solid var(--em-colorBorderSecondary);background:var(--em-colorBgContainer)}.blocks-app .email-pane__reverse .email-pane__col-wrapper_pinch .email-pane__col .email-pane__tab-bar.ant-tabs-nav{border-left:none}.blocks-app .email-pane__col .email-pane__col_settings-inner_reverse{border-right:1px solid var(--em-colorBorder)}.blocks-app .email-pane_view .email-pane__col{height:calc(100vh - 48px);top:0;bottom:0;overflow:auto}.blocks-app .email-pane__col_settings{height:calc(100vh - 76px);position:sticky;top:10px;bottom:60px;overflow:auto}.blocks-app .email-pane_view .email-pane__col_settings{height:calc(100vh - 48px)}.blocks-app .email-pane__col_settings-collapsed{flex:0 0;max-width:0}.blocks-app .email-pane__col_preview{scroll-behavior:smooth}.blocks-app .email-pane_code-mode .email-pane__row:not(.email-pane__bottom) .email-pane__col_preview{overflow:auto;width:100%!important}.blocks-app .email-pane__col_preview-collapsed{flex:0 0 100%;width:100%;max-width:100%}.blocks-app .email-pane__col_settings{z-index:11;height:100%;position:sticky;top:20px;bottom:60px;overflow:visible}.blocks-app .email-pane__col_settings-inner{height:100%;max-height:100%}.blocks-app .email-pane__col_menu{margin-left:20px}.blocks-app .email-pane__col .ant-modal-close{top:14px;width:34px;height:34px;font-size:16px;position:absolute;inset-inline-end:12px;padding:0!important}.blocks-app .email-pane__col_code-mode .ant-menu-vertical.element-preview-menu__list_discuss li.ant-menu-item{text-align:center}.blocks-app .email-pane__col__alert{z-index:100;width:40%;max-width:400px;bottom:40px;left:10px;position:absolute!important}.blocks-app .email-pane__collapse-wrapper{background-color:var(--em-colorBgContainer);border:1px solid var(--em-colorBgContainer);border-radius:calc(var(--em-borderRadiusXL) * 1px);flex-direction:column;align-self:flex-start;height:auto;min-height:0;max-height:100%;display:flex;overflow:hidden}.dark .blocks-app .email-pane__collapse-wrapper{border:1px solid var(--em-colorBorderSecondary)}.blocks-app .email-pane__collapse-wrapper_disabled{display:none}.blocks-app .email-pane__collapse-wrapper>*{min-height:0;max-height:100%}.blocks-app .email-pane__collapse-wrapper .ant-tabs-content-holder{border-radius:0 0 calc(var(--em-borderRadiusXL) * 1px) calc(var(--em-borderRadiusXL) * 1px);border:none;margin:0 -1px -1px;transition:all .3s;overflow:hidden}.blocks-app .email-pane__collapse-wrapper .selected_form-mobile-props-title,.blocks-app .email-pane__collapse-wrapper .selected_form-desktop-props-title{opacity:0;will-change:transform, height;padding-top:0;transition:height .45s cubic-bezier(.16,1,.3,1),margin-top .45s cubic-bezier(.16,1,.3,1),transform .45s cubic-bezier(.16,1,.3,1),opacity .3s ease-out;transform:translateY(-100%)}@keyframes em-mobile-props-title-slide-in{0%{opacity:0;height:0;transform:translateY(-100%)}to{opacity:1;height:32px;transform:translateY(0)}}.blocks-app .email-pane__collapse-wrapper #selected_element_form_desktop_props{transition:all .1s}.blocks-app .email-pane__collapse-wrapper .selected_form-props-wrapper_optimize{padding-top:0}.blocks-app .ant-app .email-pane__collapse-wrapper .selected_form-mobile-props-title,.blocks-app .ant-app .email-pane__collapse-wrapper .selected_form-desktop-props-title{background-color:var(--em-colorInfoBg);border:none;border-radius:0;height:0;padding:0 24px;top:0;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .panel-form__body{border:1px solid var(--em-colorInfo);border-radius:0 0 calc(var(--em-borderRadius) * 2px) calc(var(--em-borderRadius) * 2px);scrollbar-gutter:auto;flex-direction:column;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .panel-form__body-content{flex-direction:column;flex:1;min-height:0;padding:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .panel-form__body-content>div{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .ant-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{color:var(--em-colorInfo)}.blocks-app .email-pane__collapse-wrapper.mobile-properties .ant-tabs .ant-tabs-ink-bar{background:var(--em-colorInfo)}.blocks-app .email-pane__collapse-wrapper.mobile-properties .email-properties__collapse:after{display:none}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel-content{flex-direction:column;flex:1;min-height:0;padding:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel{flex-direction:column;flex:1;min-height:0;padding-left:0;padding-right:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel>div{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties form.element-controls{flex-direction:column;height:100%;min-height:0;display:flex}.blocks-app .email-pane__collapse-wrapper.mobile-properties #selected_element_form_desktop_props{min-height:0;padding:24px var(--em-panel-form-padding-x,24px) 0;flex:1;overflow:hidden auto}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props-wrapper{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props-header{flex-shrink:0}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props{scrollbar-gutter:stable;flex:1;min-height:0;overflow:hidden auto}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected-element-panel__float-blocks-settings{display:none}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-desktop-props-title{opacity:1;height:32px;animation:.45s cubic-bezier(.16,1,.3,1) both em-mobile-props-title-slide-in;transform:translateY(0)}.blocks-app .email-pane__collapse-wrapper.mobile-properties .selected_form-mobile-props-title{z-index:1;border:none;border-bottom:1px solid var(--em-colorBorderSecondary);background-color:var(--em-colorInfoBg);padding:5px 24px;transform:translateY(0)}.blocks-app .email-pane__collapse-wrapper.mobile-view .ant-tabs-tab:first-child:hover{color:var(--em-colorInfo)}.blocks-app .email-pane__collapse-wrapper.mobile-view .selected_form-mobile-props-title{opacity:1;height:32px;animation:.45s cubic-bezier(.16,1,.3,1) both em-mobile-props-title-slide-in;transform:translateY(0)}.blocks-app .email-pane__collapse-wrapper.mobile-view .selected_form-mobile-props-title .ant-alert-title{color:var(--em-colorInfoText)}.blocks-app .email-pane__collapse-wrapper_build{flex:1;align-self:stretch;height:100%}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse{flex:1;min-height:0}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse>.ant-tabs-content-holder{flex:1;min-height:0;display:flex}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse>.ant-tabs-content-holder>.ant-tabs-content{height:100%;min-height:0}.blocks-app .email-pane__collapse-wrapper_build>.email-pane__collapse>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane-active{flex-direction:column;flex:1;min-height:0;display:flex}.blocks-app .email-pane__col-wrapper_pinch .email-pane__collapse-wrapper{border:none;border-left:1px solid var(--em-colorBorder);border-radius:0;height:100%}.blocks-app .email-pane__collapse{flex-direction:column;flex:1;width:100%;height:100%;min-height:0;max-height:100%;display:flex;overflow:hidden}.blocks-app .email-pane__collapse.ant-collapse{border:0}.blocks-app .email-pane__collapse-panel.ant-collapse-item{min-height:50px;overflow:hidden}.blocks-app .email-pane__comment-counter{border-radius:10px;width:27px;height:16px;margin:5px;padding:0 6px;font-size:12px}.blocks-app .email-pane__add-new-element-btn{width:100%;margin-bottom:60px}.blocks-app .email-pane__tab-bar.ant-tabs-nav{z-index:1;width:60px;margin-bottom:0;margin-left:8px;margin-right:0;top:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab-active{border-radius:8px;border-right:none!important}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tabpane,.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab{padding-left:0}.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-top:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list{background:var(--em-colorBgContainer);border-radius:8px;flex:none;padding:0 0 4px;box-shadow:0 2px 10px #0500380a}.blocks-app .email-pane__col-wrapper_pinch .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list{box-shadow:none;border-radius:0;height:100%}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-wrap{overflow:unset;flex:none}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder{border-left:none;margin-left:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder .ant-tabs-content>.ant-tabs-tabpane{padding-left:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:first-child,.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:nth-child(2),.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:nth-child(3){display:none}.blocks-app .email-pane__col-wrapper_pinch .email-pane__tab-bar.ant-tabs-nav{margin-left:0;margin-right:0}.blocks-app .email-pane .ant-tabs-right>.ant-tabs-content-holder,.blocks-app .email-pane .ant-tabs-right>div>.ant-tabs-content-holder{border-right:none;margin-right:0}.blocks-app .email-pane .ant-tabs-left>.ant-tabs-nav .ant-tabs-tab{border:1px solid #0000;height:60px;padding:14px 24px}@media (width<=1550px){.blocks-app .email-pane .ant-tabs-left>.ant-tabs-nav .ant-tabs-tab{height:50px}}.blocks-app .email-pane .ant-collapse-panel{box-sizing:content-box;height:calc(100% - 50px);margin-top:-1px;overflow:auto}.blocks-app .email-pane .ant-tabs-content{height:100%;max-height:100%}.blocks-app .email-pane .ant-collapse-body,.blocks-app .email-pane .secondary-tabs .ant-tabs-content{height:100%;padding-bottom:0;position:relative;overflow:hidden scroll}.blocks-app .email-pane__comment-counter{position:absolute;top:-4px;right:0}@media (width<=1550px){.blocks-app .email-pane__comment-counter{right:-5px}}.blocks-app .email-pane__content-col_disable{pointer-events:none}.blocks-app .email-pane .header__project{vertical-align:middle;align-items:center;height:28px;padding-top:0;display:inline-flex}.blocks-app .email-pane .header__project .ant-avatar.ant-avatar-circle{min-width:28px}.blocks-app .email-pane_view .header__project{pointer-events:none}.blocks-app .email-pane__pane{height:100%;transition:height .2s cubic-bezier(0,0,.2,1);position:relative}.blocks-app .email-pane__panes{height:calc(100vh - 48px);display:flex;overflow:auto}.blocks-app .email-pane__panes-resizer{z-index:2;position:relative}.blocks-app .email-pane__panes-resizer:before{content:"";background-color:#0000;border-left:2px solid #0000;width:10px;height:100%;transition:border-color .2s;position:absolute;inset:0}.blocks-app .email-pane__panes-resizer:hover{cursor:col-resize}.blocks-app .email-pane__panes-resizer:hover:before{border-color:var(--em-colorPrimary)}.blocks-app .email-pane__footer{z-index:2;border-top:1px solid #d9d9d9;height:28px;display:none;position:relative}.blocks-app .email-pane:not(.email-pane_view) .email-pane__pane-content{height:100%;position:absolute;inset:0;overflow:hidden}.blocks-app .email-pane__pane_main .email-pane:not(.email-pane_view) .email-pane__pane-content{overflow:auto}.blocks-app .email-pane:not(.email-pane_view) .email-pane__pane-content .email-pane__pane_editor{height:100%;overflow:visible}.blocks-app .email-pane:not(.email-pane_view) .email-pane__pane-content .email-pane__pane_editor .email-pane__pane-content{height:100%}.blocks-app .email-pane__buttons{text-align:right}.blocks-app .email-pane__buttons .ant-space.ant-space-horizontal.ant-space-align-center{display:flex}.blocks-app .email-pane__buttons button{width:46px;height:24px;margin-left:8px;padding:0}.blocks-app .email-pane__iframe-scroll-bottom,.blocks-app .email-pane__iframe-scroll-top{z-index:10;width:100%;height:50px;display:none;position:sticky;left:0;right:0}.blocks-app .email-pane__iframe-scroll-top{margin-bottom:-50px;top:0}.blocks-app .email-pane__iframe-scroll-bottom{margin-top:-50px;bottom:0}.blocks-app .email-pane__list{border:none;line-height:20px}.blocks-app .email-pane__list.ant-menu-horizontal>.ant-menu-item{padding:0 14px}.blocks-app .email-pane__list.ant-menu-horizontal>.ant-menu-item:after{content:none}.blocks-app .email-pane__list-item_active{color:var(--em-colorPrimaryTextHover)}.blocks-app .ant-menu-item .email-pane__list-item-icon.anticon{font-size:20px}.blocks-app .email-pane__list-item:hover .email-pane__list-item-icon.anticon,.blocks-app .email-pane__list-item_active.ant-menu-item .email-pane__list-item-icon.anticon{color:var(--em-colorPrimaryTextHover)}.blocks-app .email-pane__list-item.ant-menu-item.ant-menu-item-selected,.blocks-app .email-pane__list-item.ant-menu-item-disabled:hover .email-pane__list-item-icon.anticon{color:inherit}.blocks-app .email-pane__content-col.email-pane__content-col_menu{min-width:462px;margin-left:0}.blocks-app .email-pane__content-col_menu-left{margin-right:10px}.blocks-app .email-pane__code-mode{margin-top:10px;display:flex}.blocks-app .email-pane__code-mode .email-pane__panes{width:100%}.blocks-app .email-pane__code-mode .email-pane__panes+.email-pane__content-col.email-pane__content-col_menu,.blocks-app .email-pane__code-mode .email-pane__content-col.email-pane__content-col_menu:not(.email-pane__content-col_menu-right){width:60px;min-width:60px;margin-top:5px;margin-left:10px;margin-right:10px}.blocks-app .email-pane__code-mode .email-pane__content-col.email-pane__content-col_menu.email-pane__content-col_menu-right{width:50px;min-width:50px;margin-top:5px;margin-left:10px;margin-right:10px}.blocks-app .email-pane__col_code-mode{top:0}.blocks-app .email-pane__comments-icon-wrapper{text-align:center;cursor:pointer;width:50px;height:60px;margin-right:5px;padding:13px 21px;position:relative}.blocks-app .email-pane__comments-icon-wrapper:hover{color:#999da0}.blocks-app .email-pane__comment-counter{color:#000000d9;width:auto;min-width:28px;height:18px;text-shadow:none;border:1px solid #fff;border-radius:10px;margin:5px;padding:0 6px;font-size:12px;position:absolute;top:-8px;right:-10px}.blocks-app body.dark .email-pane__comment-counter{color:#f0f0f0;border-color:#1f1f1f}.blocks-app .email-pane__col-wrapper_pinch .email-pane__comment-counter{right:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tabpane,.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab{padding-left:0}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab{padding-right:0}.blocks-app .ant-tabs-left>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-top:0}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{z-index:1;margin-top:0}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab .ant-tabs-tab-btn{background:0 0;border-radius:6px;justify-content:center;align-items:center;width:100%;height:100%;display:flex}.blocks-app .ant-tabs-right>.email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{background:var(--em-controlItemBgActive)}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-nav-list .ant-tabs-ink-bar{box-sizing:border-box;background:#fff;border:none;border-radius:6px;width:60px;margin:0 2px;display:none;box-shadow:0 2px 8px -2px #0000000d,0 1px 4px -1px #00000012,0 0 1px #00000014}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder{border-left:none;width:397px;margin-left:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav+.ant-tabs-content-holder .ant-tabs-content>.ant-tabs-tabpane{padding-left:0;padding-right:0}.blocks-app .email-pane__tab-bar.ant-tabs-nav .ant-tabs-tab:first-child{display:none}.blocks-app .email-pane .ant-tabs-left>.ant-tabs-nav .ant-tabs-tab,.blocks-app .email-pane .ant-tabs-right>.ant-tabs-nav .ant-tabs-tab{border:none;height:56px;padding:4px 4px 0}.blocks-app .email-pane .ant-tabs-tab .anticon{margin-right:0;font-size:20px}.blocks-app .email-pane__code-mode:not(.email-pane__col_preview-collapsed){padding-left:60px}.blocks-app .email-pane__content-col_tabs.email-pane__content-col{margin-left:0;margin-right:0;transition:all .3s cubic-bezier(.075,.82,.165,1);top:30px}@media (width<=1350px){.blocks-app .email-pane__content-col_tabs.email-pane__content-col{transform-origin:0 0;transform:scale(.83)}}.blocks-app .email-pane__col-wrapper_pinch .email-pane__content-col_tabs.email-pane__content-col{margin-top:0;top:0;height:100%!important}.blocks-app .email-pane .email-pane__col-wrapper_pinch .blocks-search__empty-wrapper{height:calc(100% - 30px)}.blocks-app .email-pane__col_preview-collapsed{margin-left:70px}.blocks-app .email-pane .email-pane__content-col_main{border:1px solid var(--em-colorBorder);border-radius:calc(var(--em-borderRadiusXL) * 1px);margin-left:-2px;margin-right:-2px;transition:border-color .4s;overflow:hidden auto}.blocks-app .email-pane .secondary-tabs.secondary-tabs_unset_scroll .ant-tabs-nav:after{display:none}.blocks-app .email-pane .secondary-tabs.secondary-tabs_unset_scroll .ant-tabs-content{overflow-y:hidden;padding-top:0!important;padding-right:24px!important}.blocks-app .email-pane__col.email-pane__col_preview{flex-direction:column;justify-content:flex-start;align-items:center;max-width:1600px;margin:0;padding:0 2px;display:flex}.blocks-app .email-pane__sizes{border:1px solid var(--em-colorBorder);z-index:10;opacity:.9;border-top:none;border-radius:0 0 8px 8px;justify-content:center;width:100%;height:15px;min-height:15px;margin-bottom:15px;transition:all .5s;display:flex;position:sticky;top:0;left:0}.blocks-app .email-pane__sizes:hover{opacity:1}.blocks-app .email-pane_code-mode .email-pane__row:not(.email-pane__bottom) .email-pane__sizes{border-width:0;height:0;min-height:0;margin-bottom:0}.blocks-app .email-pane__sizes .email-pane__width-selectors-wrapper{justify-content:center;width:100%;display:flex}.blocks-app .email-pane__sizes .device-width__theme{border-right:1px solid var(--em-colorBorder);background-color:var(--em-colorBgElevated);flex-shrink:0;width:36px;transition:all .3s;position:relative}.blocks-app .email-pane__sizes .device-width__theme .email-pane__theme-toggle{margin:0}.blocks-app .email-pane__sizes .device-width__theme-placeholder{flex-shrink:0;width:36px;cursor:default!important}.blocks-app .email-pane__sizes [class^=device-width__]{border-right:1px solid var(--em-colorBorder);background-color:var(--em-colorBgElevated);cursor:pointer;transition:all .3s;position:relative}.blocks-app .email-pane__sizes [class^=device-width__]:first-child{border-bottom-left-radius:calc(var(--em-borderRadius) * 1px)}.blocks-app .email-pane__sizes [class^=device-width__]:last-child{border-bottom-right-radius:calc(var(--em-borderRadius) * 1px);border:none}.blocks-app .ant-app .email-pane__sizes [class^=device-width__] button{color:var(--em-colorTextDescription);width:24px;min-width:24px;height:24px;line-height:1}.blocks-app .ant-app .email-pane__sizes [class^=device-width__] button:hover{background:var(--em-colorPrimaryBg)}.blocks-app .email-pane__sizes .device-width__320{text-align:center;color:var(--em-colorText);font-size:12px;line-height:15px}.blocks-app .email-pane__sizes.device-width__full-hovered [class^=device-width__],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__768],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__425],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__375],.blocks-app .email-pane__sizes.device-width__768-hovered [class*=__320],.blocks-app .email-pane__sizes.device-width__425-hovered [class*=__425],.blocks-app .email-pane__sizes.device-width__425-hovered [class*=__375],.blocks-app .email-pane__sizes.device-width__425-hovered [class*=__320],.blocks-app .email-pane__sizes.device-width__375-hovered [class*=__375],.blocks-app .email-pane__sizes.device-width__375-hovered [class*=__320],.blocks-app .email-pane__sizes.device-width__320-hovered [class*=__320]{background:var(--em-colorPrimaryBg)}.blocks-app .email-pane__resizable{width:100%;margin-bottom:29px;transition:max-width .5s;position:relative}.blocks-app .blocks-plugin .email-pane__resizable{padding:0 2px}.blocks-app .email-pane__resizable_drag{transition:none}.blocks-app .email-pane__resizable .email-pane__handle{box-sizing:border-box;opacity:0;cursor:ew-resize;width:5px;height:100%;transition:opacity .4s;position:absolute}.blocks-app .email-pane_code-mode .email-pane__row:not(.email-pane__bottom) .email-pane__resizable .email-pane__handle{pointer-events:none}.blocks-app .email-pane__resizable .email-pane__handle:hover,.blocks-app .email-pane__resizable .email-pane__handle:active{opacity:1}.blocks-app .email-pane__resizable .email-pane__handle.left{left:0}.blocks-app .email-pane__resizable .email-pane__handle.right{right:0}.blocks-app .email-pane__left .email-pane__resizable,.blocks-app .email-pane__right .email-pane__resizable{margin-bottom:0}.blocks-app .email-pane__tooltip{margin-right:20px}.blocks-app .email-pane .ant-layout-content.container.email-pane__container{padding-bottom:0}.blocks-app .email-pane .ant-tabs-tabpane.ant-tabs-tabpane-active.em-analytics__email-tab-build{border-top-left-radius:0}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-nav-list{padding-left:24px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-nav{margin-bottom:0}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-tab .ant-tabs-tab-btn{font-size:14px;font-weight:400}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-tab+.ant-tabs-tab{margin:0 0 0 20px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs .ant-tabs-content{padding:24px 13px 4px 24px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs.secondary-tabs_optimise .ant-tabs-content{padding:0 25px}.blocks-app .email-pane .ant-tabs-large.secondary-tabs.email-properties__collapse .ant-tabs-content{padding-bottom:0}.blocks-app .email-pane.email-pane_no-element-navigation .ant-tabs-large.secondary-tabs.email-properties__collapse .ant-tabs-content{padding-top:0}.blocks-app .email-pane .email-properties__collapse{position:relative}.blocks-app .email-pane .email-properties__collapse:after{content:"";background:linear-gradient(180deg, var(--em-colorBgContainerDisabled), transparent 40%);border-top:1px solid var(--em-colorBorderSecondary);z-index:1;width:100%;height:20px;position:absolute;top:58px;left:0}.dark .blocks-app .email-pane .email-properties__collapse:after{background:linear-gradient(180deg, var(--em-colorBgBase) -100%, transparent 50%)}.blocks-app .email-pane .ant-tooltip{pointer-events:none}.blocks-app .email-pane__blocks-search{overflow-clip-margin:40px;flex-direction:column;height:calc(100% - 44px);min-height:0;display:flex;overflow:clip}.blocks-app .email-pane__blocks-search label.ant-segmented-item{margin-top:0}.blocks-app .email-pane__blocks-panel,.blocks-app .email-pane__blocks-panel-body{height:100%}.blocks-app .email-pane__blocks-panel-header{flex-shrink:0}.blocks-app .email-pane__blocks-panel-results{display:none}.blocks-app .email-pane__blocks-panel-results_visible{flex-direction:column;flex:1;min-height:0;display:flex;overflow:hidden}.blocks-app .email-pane__blocks-panel_scrollable,.blocks-app .email-pane__blocks-panel_scrollable{overflow-clip-margin:40px;flex-direction:column;flex:1;min-height:0;display:flex;overflow:clip}.blocks-app .email-pane__blocks-panel_scrollable .email-pane__blocks-panel-body{flex-direction:column;flex:1;min-height:0;margin-left:-24px;margin-right:-24px;display:flex;overflow:hidden}.blocks-app .email-pane__blocks-panel_scrollable .blocks-search__empty-shadow{padding-left:24px;padding-right:24px}.blocks-app .email-pane .email-pane__blocks-search .ant-segmented{position:relative;top:-7px}@media screen and (width<=700px){.blocks-app .email-pane_view .email-pane__buttons{display:none}.blocks-app .email-pane__content{margin:0;padding-right:0}.blocks-app .email-pane__content .email-pane__content-col_main{min-width:100%}.blocks-app .email-pane__content .email-pane__content-col_menu{display:none}.blocks-app .email-pane__content .email-pane__content-col_menu+.email-pane__resizer{border-left:none;border-right:2px solid #0000}.blocks-app .email-pane__content .email-pane__content-col_menu+.email-pane__resizer:hover{border-color:var(--em-colorPrimary)}}.blocks-app .ant-menu-vertical.element-preview-menu__list_discuss li.ant-menu-item{text-align:right;padding:0 10px}.blocks-app .ant-tooltip{pointer-events:none}@media (width<=1550px){.blocks-app .email-pane .ant-tabs .secondary-tabs.email-pane__collapse:not(.secondary-tabs_unset_scroll):after{margin-top:44px}}.dark .blocks-app .email-pane .ant-tabs .blocks-search__empty-shadow:after{background:linear-gradient(180deg, var(--em-colorBgBase) -100%, transparent 50%)}.dark .blocks-app .ant-app .email-pane .ant-tabs-extra-content .ant-segmented_editor-mode{background-color:#121212}.blocks-app .collaborator-list{position:absolute;bottom:30px}.blocks-app .ant-app .email-pane__col-wrapper_pinch .ant-switch.ant-switch_editor-mode{width:48px}.blocks-app .ant-app .email-pane__col-wrapper_pinch .ant-switch.ant-switch_editor-mode.ant-switch-checked{background:var(--em-controlItemBgActive)}.blocks-app .ant-app .email-pane__col-wrapper_pinch .ant-switch.ant-switch_editor-mode.ant-switch-checked .ant-switch-inner-checked{color:var(--em-colorPrimary)}.blocks-app .email-preview-menu__versions .ant-btn,.blocks-app .email-preview-menu__code .ant-btn,.blocks-app .email-preview-menu__preview .ant-btn,.blocks-app .email-preview-menu__test{justify-content:center;align-items:center;display:inline-flex}.blocks-app .email-preview-menu__list-item-icon{align-items:center;display:inline-flex}.blocks-app .email-preview-menu_right{margin-left:auto}.blocks-app .email-preview-menu_new{align-items:center;padding-right:22px;display:flex}.blocks-app .email-preview-menu .email-preview-menu__history *{pointer-events:none}.blocks-app .ant-menu.email-preview-menu__list{border:0}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item{margin-top:0;padding:0 10px}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item_disabled{cursor:not-allowed}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item:hover .ant-menu-item.email-preview-menu__list-item_disabled .anticon.email-preview-menu__list-item-icon{color:inherit}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item a{width:40px;height:40px;margin-left:-10px;display:block}.blocks-app .ant-menu-vertical .ant-menu-item.email-preview-menu__list-item a .email-preview-menu__list-item-icon{margin-left:10px}.blocks-app .ant-menu-item .anticon.email-preview-menu__list-item-icon{font-size:20px}.blocks-app .ant-menu-item .anticon.email-preview-menu__list-item-icon_revert{transform:scaleX(-1)}.blocks-app .email-preview-menu__list-item:hover .anticon.email-preview-menu__list-item-icon,.blocks-app .ant-menu-item.email-preview-menu__list-item_active .anticon.email-preview-menu__list-item-icon{color:var(--em-colorPrimaryHover)}.blocks-app .ant-menu-item.ant-menu-item-selected.email-preview-menu__list-item,.blocks-app .ant-menu-item-disabled.email-preview-menu__list-item:hover .anticon.email-preview-menu__list-item-icon{color:inherit}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons{cursor:default;text-align:center;height:auto;margin:0;padding:0}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons .ant-space{display:block}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons button{width:40px;height:40px;box-shadow:none;text-shadow:none;background:0 0;border:none;margin-bottom:8px;padding:0;display:block}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons button .anticon{font-size:20px;transition:color .3s}.blocks-app .ant-menu-vertical>.email-preview-menu__list__scroll-buttons button .anticon :hover{color:var(--em-colorPrimaryHover)}.blocks-app .ant-menu-vertical .email-preview-menu__list__divider{border-top:2px solid var(--em-colorBorder);width:20px;min-width:auto;margin:20px 0}.blocks-app .ant-menu-vertical .email-preview-menu__list__divider.second-devider{margin-left:10px}.blocks-app .code-size-warning-modal .ant-modal-container{padding:32px}.blocks-app .code-size-warning-modal__content{flex-direction:column;display:flex}.blocks-app .code-size-warning-modal__icon{color:var(--em-colorWarning);margin-bottom:16px;font-size:64px}.blocks-app .code-size-warning-modal__icon .anticon{display:block}.blocks-app .code-size-warning-modal__title{color:var(--em-colorText);margin:0 0 12px;font-size:18px;font-weight:600}.blocks-app .code-size-warning-modal__message{color:var(--em-colorTextSecondary);margin-bottom:24px;font-size:14px;line-height:1.6}.blocks-app .code-size-warning-modal__message p{margin:0 0 12px}.blocks-app .code-size-warning-modal__message p:last-child{margin-bottom:0}.blocks-app .code-size-warning-modal__message strong{color:var(--em-colorError);font-weight:600}.blocks-app .code-size-warning-modal__image{width:100%;margin-bottom:24px}.blocks-app .code-size-warning-modal__image-placeholder{border-radius:8px;width:100%;height:200px;display:flex}.blocks-app .code-size-warning-modal__image-placeholder img{object-fit:contain;max-width:100%;max-height:100%}.blocks-app .code-size-warning-modal__actions{width:100%;display:flex}.blocks-app .code-size-warning-modal__actions .ant-btn{min-width:140px}.blocks-app .integration-tile{border:1px solid var(--em-colorBorderSecondary);background:var(--em-colorBgContainer);border-radius:8px;flex-direction:column;min-height:254px;padding:16px;transition:border-color .2s;display:flex}.blocks-app .integration-tile--error{border-color:var(--em-colorError)}.blocks-app .integration-tile__body{flex:1;min-height:0}.blocks-app .integration-tile__icon{object-fit:contain;width:48px;height:48px;margin-bottom:12px}.blocks-app .integration-tile__icon-svg{margin-bottom:12px;font-size:48px;line-height:1}.blocks-app .integration-tile__title{color:var(--em-colorText);margin:0 0 4px;font-size:14px;font-weight:500;line-height:1.3;display:block}.blocks-app .integration-tile__description{color:var(--em-colorTextSecondary);margin:0;font-size:12px;font-weight:300;line-height:1.4;display:block}.blocks-app .integration-tile__footer{justify-content:space-between;align-items:flex-end;gap:8px;min-height:40px;margin-top:16px;display:flex}.blocks-app .integration-tile__badge{white-space:nowrap;border-radius:11px;align-items:center;height:22px;padding:0 8px;font-size:12px;font-weight:400;line-height:1;display:inline-flex}.blocks-app .integration-tile__badge--connected{color:var(--em-colorSuccess);background:var(--em-colorSuccessBg)}.blocks-app .integration-tile__badge--not_connected{color:var(--em-colorTextSecondary);background:var(--em-colorFillTertiary)}.blocks-app .integration-tile__badge--error{color:var(--em-colorError);background:var(--em-colorErrorBg)}.blocks-app .integration-tile__badge--coming_soon{color:var(--em-colorPrimary);background:var(--em-colorPrimaryBg)}.blocks-app .integration-tile__configure.ant-btn{box-sizing:border-box;width:40px;min-width:40px;height:40px;box-shadow:none;background:var(--em-colorFillQuaternary);color:var(--em-colorTextSecondary);border:none;border-radius:6px;flex-direction:row;flex:none;justify-content:center;align-items:center;gap:0;padding:0;display:inline-flex}.blocks-app .integration-tile__configure.ant-btn.ant-btn-icon-only{width:40px;min-width:40px;height:40px;padding:0}.blocks-app .integration-tile__configure.ant-btn .ant-btn-icon{justify-content:center;align-items:center;width:16px;height:16px;margin:0;line-height:0;display:inline-flex}.blocks-app .integration-tile__configure.ant-btn:not(:disabled):hover,.blocks-app .integration-tile__configure.ant-btn:not(:disabled):focus-visible{box-shadow:none;background:var(--em-colorFillTertiary);color:var(--em-colorTextSecondary);border:none}.blocks-app .integration-tile__configure.ant-btn:disabled,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled{cursor:not-allowed;box-shadow:none;opacity:1;background:var(--em-colorFillQuaternary);color:var(--em-colorTextQuaternary);border:none}.blocks-app .integration-tile__configure.ant-btn:disabled .ant-btn-icon,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled .ant-btn-icon{color:var(--em-colorTextQuaternary)}.blocks-app .integration-tile__configure.ant-btn:disabled:hover,.blocks-app .integration-tile__configure.ant-btn:disabled:focus-visible,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled:hover,.blocks-app .integration-tile__configure.ant-btn.ant-btn-disabled:focus-visible{box-shadow:none;background:var(--em-colorFillQuaternary);color:var(--em-colorTextQuaternary);border:none}.blocks-app .ant-app .integration-tile__configure.ant-btn.ant-btn-icon-only{width:40px;min-width:40px;height:40px;padding:0}.blocks-app .ant-app .integration-tile__configure.ant-btn.ant-btn-icon-only:disabled,.blocks-app .ant-app .integration-tile__configure.ant-btn.ant-btn-icon-only.ant-btn-disabled{opacity:1;background:var(--em-colorFillQuaternary);color:var(--em-colorTextQuaternary)}.blocks-app .em-export-platforms-submenu .ant-dropdown-menu{max-height:420px;overflow-y:auto}.blocks-app .app-logo{color:#000;line-height:1.35;display:inline-block}.blocks-app .app-logo:hover{color:#000}.blocks-app .em-analytics__email-save .ant-btn-loading-icon .anticon,.blocks-app .em-analytics__block-save .ant-btn-loading-icon .anticon{font-size:16px}.blocks-app .main__ribbon{background:var(--em-colorInfo);min-height:43px;color:var(--em-colorTextLightSolid);flex-direction:row;justify-content:center;align-items:center;font-size:16px;display:flex}.blocks-app .main__ribbon button{background:var(--em-colorInfoTextHover)}.blocks-app .main__ribbon button:hover{background:var(--em-colorInfoHover)!important}.blocks-app .main__ribbon .main__ribbon-resend.ant-btn.ant-btn-sm{padding-block:5px;padding-inline:14px}.blocks-app .header{box-sizing:content-box;border-bottom:1px solid;height:70px;min-height:70px}.blocks-app .header_blocks{padding-right:10px}.blocks-app .header_main{z-index:1}.blocks-app .header__container{justify-content:space-between;align-items:center;gap:30px;min-height:70px;transition:opacity .3s;display:flex}.blocks-app .header__logo,.blocks-app .header__project{white-space:nowrap;text-overflow:ellipsis;max-width:220px;display:block;overflow:hidden}.blocks-app .header__logo{padding-top:10px}.blocks-app .header h2,.blocks-app .header h3{margin:0}.blocks-app .header__right{max-height:40px}.blocks-app .header__right .header__action-btn.ant-btn{align-items:center;height:34px;min-height:34px;padding-block:0;display:inline-flex}.blocks-app .header__right .ant-space.ant-space-horizontal.ant-space-align-center{align-items:center;display:flex}.blocks-app .header__right,.blocks-app .header__left{display:flex}.blocks-app .header__left .ant-space,.blocks-app .header__left .ant-space .ant-space-item:last-child{flex-grow:1}.blocks-app .header .project-menu__list-item{cursor:pointer;transition:color .3s}.blocks-app .header .project-menu__list-item:hover{color:#40a9ff}.blocks-app .header .project-menu__list-item svg{width:1.2em;height:1.2em;vertical-align:inherit}.blocks-app .header .project-menu__list-item .anticon-bell svg{width:1.4em;height:1.4em}.blocks-app .header .ant-typography{margin-bottom:0}.blocks-app .foo-title{color:#fff;letter-spacing:1px;background:#9254de;border-radius:3px;margin-top:-10px;margin-left:-4px;padding:0 7px;font-size:13px;font-weight:500;position:absolute}.blocks-app .email-page-header__dropdown-menu{top:10px}.blocks-app .email-page-header__email-id{color:var(--em-colorTextTertiary)}.blocks-app .email-page-header .button{cursor:pointer}.blocks-app .anticon.anticon-edit.email-page-header__icon-edit{color:#8c8c8c;margin-left:6px;font-size:16px}.blocks-app .ant-typography-edit:hover .anticon.anticon-edit.email-page-header__icon-edit{color:var(--em-colorPrimaryHover)}.blocks-app .ant-page-header-heading{max-width:700px;transition:all .2s;position:relative}.blocks-app .ant-page-header-heading svg{cursor:pointer;opacity:0;justify-content:center;width:0;height:0;transition:all .2s .2s;position:absolute;top:0;right:3px}.blocks-app .ant-page-header-heading svg:hover{color:var(--em-colorPrimaryHover)}.blocks-app .ant-page-header-heading.focus{background-color:var(--em-colorFillSecondary);border-radius:calc(var(--em-borderRadiusSM) * 1px);padding:0 8px}.blocks-app .ant-page-header-heading.focus svg{opacity:1;width:20px;height:20px;top:3px}.blocks-app .ant-page-header-heading.ant-page-header-heading_preheader.focus svg{top:3px}.blocks-app .ant-page-header-heading_preheader .anticon{top:-2px}.blocks-app .email-page-header .ant-page-header-heading-left{flex-grow:1;overflow:visible}.blocks-app .email-page-header .ant-page-header-back{align-self:flex-start;margin-right:0;padding-top:8px}.blocks-app div.ant-typography-edit-content.ant-page-header-heading-preheader,.blocks-app div.ant-typography-edit-content.ant-page-header-heading-title{margin-top:0;margin-bottom:0;inset-inline-start:0}.blocks-app .header__left .ant-form-item-control-input,.blocks-app .header__left .ant-form-item-control-input-content{line-height:normal;min-height:auto!important}.blocks-app .header__left .ant-page-header-heading-title{white-space:pre-wrap;text-overflow:ellipsis;border-radius:0;flex-grow:1;min-height:auto;font-weight:500;line-height:1;overflow:visible;height:auto!important;padding:3px 20px 3px 0!important}.blocks-app .header__left .ant-page-header-heading-preheader{max-width:700px;min-height:auto;box-shadow:none;text-overflow:ellipsis;white-space:nowrap;border-radius:0;display:block;overflow:hidden;height:auto!important;padding:3px 20px 3px 0!important;line-height:20px!important}.blocks-app .header__left .ant-skeleton.ant-skeleton-element{width:100%;display:block}.blocks-app .ant-page-header-heading-title,.blocks-app .ant-page-header-heading-preheader{background:0 0;padding:0;box-shadow:none!important;border:none!important;transition:none!important}.blocks-app .ant-page-header-heading-preheader{color:var(--em-colorTextSecondary);min-height:auto}.blocks-app .subject_preheader_form__title{width:80px;color:var(--em-colorTextTertiary);white-space:nowrap}.blocks-app .ant-page-header-heading-title{line-height:22px!important}.blocks-app .email-page-header .ant-typography{align-items:center;margin-bottom:0;padding:0 12px;display:flex}.blocks-app .email-page-header .ant-typography-edit-content{margin-top:-10px;padding:0;top:5px;left:auto}.blocks-app .email-page-header .ant-input{font-size:inherit;font-weight:inherit}.blocks-app .email-page-header .ant-page-header-heading-extra>*{margin-left:8px}.blocks-app header .ant-btn.email-page-header__btn_extra{width:32px;padding:0}.blocks-app .update-global-blocks-modal__hint{color:#000000a6;margin-bottom:16px}.blocks-app .update-global-blocks-modal__list{flex-direction:column;gap:12px;max-height:320px;display:flex;overflow-y:auto}.blocks-app .update-global-blocks-modal__row{align-items:center;gap:12px;display:flex}.blocks-app .update-global-blocks-modal__title{flex-direction:column;flex:auto;display:flex;overflow:hidden}.blocks-app .update-global-blocks-modal__version{color:#00000073;font-size:12px}.blocks-app .update-global-blocks-modal__count{color:#00000073;flex:none;font-size:12px}.blocks-app .update-global-blocks-modal__footer{justify-content:flex-end;gap:8px;display:flex}.blocks-app .convert-layout-modal .ant-modal-header{text-align:center;margin-top:16px;margin-bottom:8px}.blocks-app .convert-layout-modal .ant-modal-footer{margin-top:16px;padding:0 8px}.blocks-app .convert-layout-modal__title{color:var(--em-colorText);font-size:20px;font-weight:600}.blocks-app .convert-layout-modal__content{flex-direction:column;align-items:center;gap:24px;display:flex;overflow:hidden}.blocks-app .convert-layout-modal__text{font-size:14px;line-height:1.5}.blocks-app .convert-layout-modal__intro-text{text-align:center;color:var(--em-colorTextSecondary);padding:0 16px}.blocks-app .convert-layout-modal__image{border-radius:8px;width:100%;max-width:100%;height:auto;display:block}.blocks-app .convert-layout-modal__footer{justify-content:flex-end;gap:8px;margin-top:8px;display:flex}.blocks-app .convert-layout-modal__footer--between{justify-content:space-between}.blocks-app .convert-layout-modal__error-details{background-color:var(--em-colorErrorBg,#ff00000f);color:var(--em-colorTextSecondary);word-break:break-word;border-radius:8px;margin-top:12px;padding:8px 12px;font-size:12px}.blocks-app .conversion-overlay{z-index:2000;background-color:var(--em-colorBgMask,#00000073);justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.blocks-app .conversion-overlay__content{background-color:var(--em-colorBgElevated);width:360px;max-width:80vw;box-shadow:var(--em-boxShadowSecondary);text-align:center;border-radius:12px;flex-direction:column;align-items:center;gap:16px;padding:32px;display:flex}.blocks-app .conversion-overlay__title{color:var(--em-colorText);font-size:16px;font-weight:600}.blocks-app .conversion-overlay__hint{color:var(--em-colorTextSecondary);font-size:13px}.blocks-app .conversion-overlay__progress{width:100%}@media (width<=1550px){.blocks-app .email-pane__col_settings{margin-left:48px;margin-right:32px}}.blocks-app .em-dragging-element{border-radius:8px}.blocks-app .em-dragging-element>div{box-shadow:none!important}.blocks-app .em-dragging-element .blocks-search__result-html,.blocks-app .em-dragging-element span,.blocks-app .em-dragging-element .atoms__item:before{visibility:hidden}.blocks-app .em-ghost-element.blocks-search__result-html,.blocks-app .em-ghost-element span,.blocks-app .em-ghost-element.atoms__item:before{visibility:visible!important}.blocks-app .em-ghost-element table{border-collapse:initial}',e=window.__emailmaker_styles__||(window.__emailmaker_styles__={sheets:{},order:[]}),a=t;if(!e.sheets[a]){var p=!1;try{if(typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&document.adoptedStyleSheets){var n=new CSSStyleSheet;n.replaceSync(t),document.adoptedStyleSheets=document.adoptedStyleSheets.concat([n]),e.sheets[a]=n,e.order.push(a),p=!0}}catch{p=!1}if(!p){var o=document.createElement("style");o.setAttribute("data-emailmaker","true"),o.appendChild(document.createTextNode(t)),document.head.appendChild(o),e.sheets[a]=o,e.order.push(a)}}}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
95
- __emailmaker__.define("core",["require","exports","module","static/core/5dc34752.js","static/core/af34343f.js","static/core/5f7f72e9.js","static/core/92c24b83.js","static/core/639e22b1.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper","react-dom/client","classnames","dayjs"],function(be,nn,Wb){Object.defineProperties(nn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const zt=be("./static/core/5dc34752.js"),g=be("./static/core/af34343f.js"),o=be("./static/core/5f7f72e9.js"),xt=be("./static/core/92c24b83.js"),_t=be("./static/core/639e22b1.js");let l=be("react");l=zt.__toESM(l);let s=be("react/jsx-runtime"),y=be("__delivery__/libs"),Ye=be("vite/preload-helper"),rl=be("react-dom/client"),ot=be("classnames");ot=zt.__toESM(ot);let En=be("dayjs");En=zt.__toESM(En);var il="Editor mount element was removed from the document. Call instance.destroy() on host unmount.";function al(){return g.createAbortError(il)}function sl(e,t,n){if(typeof document>"u")return;let r=!1,i;const a=()=>{r=!0,i?.disconnect(),i=void 0},c=()=>{r||(a(),t())};if(n.addDispose(a),!e.isConnected){queueMicrotask(c);return}i=new MutationObserver(()=>{e.isConnected||c()});let d=e.parentNode;for(;d;)i.observe(d,{childList:!0}),d=d.parentNode}var ll="-host-mount";function cl(){return`data-emailmaker${ll}`}function dl(e,t){Array.from(e.children).forEach(n=>{n.nodeType===Node.ELEMENT_NODE&&n.hasAttribute(t)&&n.remove()})}function ul(e){const t=cl();dl(e,t);const n=document.createElement("div");n.setAttribute(t,"true"),n.setAttribute("translate","no"),n.classList.add("notranslate"),n.style.display="block",n.style.width="100%",n.style.height="100%",n.style.minHeight="100%";const r=e.querySelector(":scope > [data-canvas-host]");return r?e.insertBefore(n,r):e.appendChild(n),n}function ml(e,t,n){n.addDispose(()=>{t.parentNode===e&&t.remove()})}function zn(e){return t=>{let n=null,r=!1;return{async setOptions(i){if(!n&&!r){n=await e(t);const a=await t.getInstanceAsync(g.INSTANCE_ID);Object.assign(a,n.instance||{})}n.setOptions&&await n.setOptions(i)},instance:{},dispose(){n?.dispose&&n?.dispose(),r=!0}}}}var pl=class{shadowRoot;markerAttr;observer;addedKeys=new Set;constructor({shadowRoot:e,markerAttr:t="data-emailmaker"}){this.shadowRoot=e,this.markerAttr=t,this.observer=new MutationObserver(this.handleMutations),this.observer.observe(document.head,{childList:!0,subtree:!1}),this.syncExistingStyles()}syncExistingStyles(){const e=document.querySelectorAll(`style[${this.markerAttr}], link[${this.markerAttr}]`);for(let t=e.length-1;t>=0;t--)this.cloneAndInjectNode(e[t])}getNodeKey(e){return e.tagName==="STYLE"?(e.textContent||"").trim():e.tagName==="LINK"?e.href:null}cloneAndInjectNode(e){const t=this.getNodeKey(e);if(!t||this.addedKeys.has(t))return;const n=e.cloneNode(!0);this.shadowRoot.insertBefore(n,this.shadowRoot.firstChild),this.addedKeys.add(t)}handleMutations=e=>{for(const t of e)for(const n of t.addedNodes)n.nodeType===1&&(n instanceof HTMLStyleElement||n instanceof HTMLLinkElement)&&n.hasAttribute(this.markerAttr)&&this.cloneAndInjectNode(n)};dispose(){this.observer.disconnect(),this.addedKeys.clear()}};function fl({children:e}){return(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)("div",{className:"config-gate-fallback"}),children:e})}var hl=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=dark]"),gl=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=light]"),yl=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&!/\s/.test(t)},_l=e=>{let t,n;e==="system"?(t=o.PREFERS_COLOR_SCHEME_LIGHT,n=o.PREFERS_COLOR_SCHEME_DARK):(t=e==="light"?"all":o.NOT_ALL,n=e==="dark"?"all":o.NOT_ALL),[...gl].forEach(r=>{r.media=t}),[...hl].forEach(r=>{r.media=n})},bl=(e={})=>{const t=document.querySelector("head"),n=document.createElement("style");if(n.type="text/css",n.dataset.themeVaribalse=!0,n.setAttribute("data-emailmaker","true"),Object.entries(e).length){let r="";Object.entries(e).forEach(([a,c])=>{typeof c!="object"&&(r+=` ${o.themeTokenCssVarName(a)}: ${c};
95
+ __emailmaker__.define("core",["require","exports","module","static/core/5dc34752.js","static/core/af34343f.js","static/core/5f7f72e9.js","static/core/92c24b83.js","static/core/639e22b1.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper","react-dom/client","classnames","dayjs"],function(be,nn,Vb){Object.defineProperties(nn,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const zt=be("./static/core/5dc34752.js"),h=be("./static/core/af34343f.js"),o=be("./static/core/5f7f72e9.js"),xt=be("./static/core/92c24b83.js"),_t=be("./static/core/639e22b1.js");let l=be("react");l=zt.__toESM(l);let s=be("react/jsx-runtime"),y=be("__delivery__/libs"),Ye=be("vite/preload-helper"),rl=be("react-dom/client"),ot=be("classnames");ot=zt.__toESM(ot);let En=be("dayjs");En=zt.__toESM(En);var il="Editor mount element was removed from the document. Call instance.destroy() on host unmount.";function al(){return h.createAbortError(il)}function sl(e,t,n){if(typeof document>"u")return;let r=!1,i;const a=()=>{r=!0,i?.disconnect(),i=void 0},c=()=>{r||(a(),t())};if(n.addDispose(a),!e.isConnected){queueMicrotask(c);return}i=new MutationObserver(()=>{e.isConnected||c()});let d=e.parentNode;for(;d;)i.observe(d,{childList:!0}),d=d.parentNode}var ll="-host-mount";function cl(){return`data-emailmaker${ll}`}function dl(e,t){Array.from(e.children).forEach(n=>{n.nodeType===Node.ELEMENT_NODE&&n.hasAttribute(t)&&n.remove()})}function ul(e){const t=cl();dl(e,t);const n=document.createElement("div");n.setAttribute(t,"true"),n.setAttribute("translate","no"),n.classList.add("notranslate"),n.style.display="block",n.style.width="100%",n.style.height="100%",n.style.minHeight="100%";const r=e.querySelector(":scope > [data-canvas-host]");return r?e.insertBefore(n,r):e.appendChild(n),n}function ml(e,t,n){n.addDispose(()=>{t.parentNode===e&&t.remove()})}function zn(e){return t=>{let n=null,r=!1;return{async setOptions(i){if(!n&&!r){n=await e(t);const a=await t.getInstanceAsync(h.INSTANCE_ID);Object.assign(a,n.instance||{})}n.setOptions&&await n.setOptions(i)},instance:{},dispose(){n?.dispose&&n?.dispose(),r=!0}}}}var pl=class{shadowRoot;markerAttr;observer;addedKeys=new Set;constructor({shadowRoot:e,markerAttr:t="data-emailmaker"}){this.shadowRoot=e,this.markerAttr=t,this.observer=new MutationObserver(this.handleMutations),this.observer.observe(document.head,{childList:!0,subtree:!1}),this.syncExistingStyles()}syncExistingStyles(){const e=document.querySelectorAll(`style[${this.markerAttr}], link[${this.markerAttr}]`);for(let t=e.length-1;t>=0;t--)this.cloneAndInjectNode(e[t])}getNodeKey(e){return e.tagName==="STYLE"?(e.textContent||"").trim():e.tagName==="LINK"?e.href:null}cloneAndInjectNode(e){const t=this.getNodeKey(e);if(!t||this.addedKeys.has(t))return;const n=e.cloneNode(!0);this.shadowRoot.insertBefore(n,this.shadowRoot.firstChild),this.addedKeys.add(t)}handleMutations=e=>{for(const t of e)for(const n of t.addedNodes)n.nodeType===1&&(n instanceof HTMLStyleElement||n instanceof HTMLLinkElement)&&n.hasAttribute(this.markerAttr)&&this.cloneAndInjectNode(n)};dispose(){this.observer.disconnect(),this.addedKeys.clear()}};function fl(){let e,t,n=!1;const r=()=>{const i=e;!n||!i||i===t||(t=i,i.handleChunkLoaded?.())};return{use:i=>{e=i,r()},loaded:()=>{n=!0,r()}}}function hl({children:e}){return(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)("div",{className:"config-gate-fallback"}),children:e})}var gl=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=dark]"),yl=document.querySelectorAll("link[rel=stylesheet][media*=prefers-color-scheme][media*=light]"),_l=e=>{if(typeof e!="string")return!1;const t=e.trim();return t.length>0&&!/\s/.test(t)},bl=e=>{let t,n;e==="system"?(t=o.PREFERS_COLOR_SCHEME_LIGHT,n=o.PREFERS_COLOR_SCHEME_DARK):(t=e==="light"?"all":o.NOT_ALL,n=e==="dark"?"all":o.NOT_ALL),[...yl].forEach(r=>{r.media=t}),[...gl].forEach(r=>{r.media=n})},vl=(e={})=>{const t=document.querySelector("head"),n=document.createElement("style");if(n.type="text/css",n.dataset.themeVaribalse=!0,n.setAttribute("data-emailmaker","true"),Object.entries(e).length){let r="";Object.entries(e).forEach(([a,c])=>{typeof c!="object"&&(r+=` ${o.themeTokenCssVarName(a)}: ${c};
96
96
  `)}),r=`.blocks-body, .blocks-app, .ant-modal-root, .ant-tooltip, .ant-notification {
97
- ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-theme-varibalse="true"]');i?t.replaceChild(n,i):t.insertBefore(n,t.firstChild)}},vl=e=>{if(!yl(e))return;const t=e.trim(),n=document.body;n.classList.contains(t)||setTimeout(()=>{n.classList.remove(t==="dark"?o.LIGHT:o.DARK),n.classList.add(t)},200)},El=()=>{const e=o.useSendPostMessage();return(0,l.useCallback)(()=>{const t=window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme),n=matchMedia("(prefers-color-scheme: dark)").matches?o.DARK:o.LIGHT,r=t||n;e({operation:o.EVENT_TYPES.UPDATE_PREVIEW,theme:r})},[e])},Gt={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},Hb={defaultMerge:Gt.defaultMerge};function Sl(e,t){return t}function Zr(e){return typeof e!="object"||e===null?0:Array.isArray(e)?2:Cl(e)?1:e instanceof Set?3:e instanceof Map?4:5}function wl(e){const t=new Set;for(const n of e)for(const r of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(r);return t}function kl(e,t){return typeof e=="object"&&Object.prototype.propertyIsEnumerable.call(e,t)}function ei(e){return{*[Symbol.iterator](){for(const t of e)for(const n of t)yield n}}}var ti=new Set(["[object Object]","[object Module]"]);function Cl(e){if(!ti.has(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(t===void 0)return!0;const n=t.prototype;return!(n===null||typeof n!="object"||!ti.has(Object.prototype.toString.call(n))||!n.hasOwnProperty("isPrototypeOf"))}function Tl(e,t,n){const r={};for(const i of wl(e)){const a=[];for(const d of e)kl(d,i)&&a.push(d[i]);if(a.length===0)continue;const c=oi(a,t,t.metaDataUpdater(n,{key:i,parents:e}));c!==Gt.skip&&(i==="__proto__"?Object.defineProperty(r,i,{value:c,configurable:!0,enumerable:!0,writable:!0}):r[i]=c)}return r}function Il(e){return e.flat()}function Al(e){return new Set(ei(e))}function xl(e){return new Map(ei(e))}function ni(e){return e.at(-1)}var Wo=Object.freeze({__proto__:null,mergeArrays:Il,mergeMaps:xl,mergeOthers:ni,mergeRecords:Tl,mergeSets:Al});function Ho(...e){return Pl({})(...e)}function Pl(e,t){const n=Rl(e,r);function r(...i){return oi(i,n,t)}return r}function Rl(e,t){return{defaultMergeFunctions:Wo,mergeFunctions:{...Wo,...Object.fromEntries(Object.entries(e).filter(([n,r])=>Object.hasOwn(Wo,n)).map(([n,r])=>r===!1?[n,ni]:[n,r]))},metaDataUpdater:e.metaDataUpdater??Sl,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,actions:Gt}}function oi(e,t,n){if(e.length===0)return;if(e.length===1)return qo(e,t,n);const r=Zr(e[0]);if(r!==0&&r!==5){for(let i=1;i<e.length;i++)if(Zr(e[i])!==r)return qo(e,t,n)}switch(r){case 1:return jl(e,t,n);case 2:return Ll(e,t,n);case 3:return Ol(e,t,n);case 4:return Ml(e,t,n);default:return qo(e,t,n)}}function jl(e,t,n){const r=t.mergeFunctions.mergeRecords(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):r}function Ll(e,t,n){const r=t.mergeFunctions.mergeArrays(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):r}function Ol(e,t,n){const r=t.mergeFunctions.mergeSets(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):r}function Ml(e,t,n){const r=t.mergeFunctions.mergeMaps(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):r}function qo(e,t,n){const r=t.mergeFunctions.mergeOthers(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):r}function Nl(e){o.requiredArgs(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||o._typeof(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):new Date(NaN)}function Dl(e){const t=new Map,n=new Set;let r=null,i=null;const a=(d,u)=>{const m={participantId:d.participant.id,acknowledgedVersion:d.acknowledged,documentVersion:e.get().version,error:u};n.forEach(f=>f(m))},c=d=>{if(d.detached)return;const u=e.get().version;if(d.acknowledged===u||d.skipVersion===u)return;if(d.pushing){d.stale=!0;return}d.pushing=!0;const{attributes:m}=e.get(),f=d.participant.applyChanges&&i?.version===u&&d.acknowledged===u-1?i:null;(f?d.participant.applyChanges(f.changes,u,m):d.participant.apply(e.getContent(),u,m)).then(()=>{d.acknowledged=u}).catch(h=>{a(d,h)}).finally(()=>{d.pushing=!1,d.stale&&(d.stale=!1,c(d))})};return e.subscribe(({version:d,changes:u})=>{i=u?.length?{version:d,changes:u}:null,t.forEach(c)}),{attach(d){const u={participant:d,acknowledged:null,pushing:!1,stale:!1,detached:!1,skipVersion:null};return t.set(d.id,u),c(u),{acknowledgedVersion:()=>u.acknowledged,reset(){u.acknowledged=null,u.skipVersion=null,c(u)},detach(){u.detached=!0,t.delete(d.id)}}},setPrimacy(d){r=d},getPrimacy:()=>r,mutateFrom(d,u,m){const f=t.get(d);if(m.echo!==!0&&r!==null&&r!==d)return f?.participant.dropUnsent?.(),null;const h=e.get().version;f&&(f.skipVersion=h+1);const _=e.mutate(u,{source:m.source});return f&&_===h?f.skipVersion=null:f&&(f.acknowledged=_),_},onOutOfSync(d){return n.add(d),()=>n.delete(d)}}}var Fl=({children:e})=>{const[t,n]=(0,l.useState)([]),r=o.useEvent(g.MODAL_SHOW_EVENT),i=o.useEvent(g.MODAL_CLOSE_EVENT),a=o.useEvent(g.MODAL_UPDATE_EVENT),c=o.useModalRootElement(),d=(0,l.useCallback)(h=>{n(_=>h===void 0?[]:_.filter(p=>p.id!==h))},[n]),u=(0,l.useCallback)(h=>{n(_=>{const p=_.find(S=>S.id===h.id);return p?_.map(S=>S===p?{...S,...p}:S):[..._,{...h,visible:!0}]})},[n]),m=(0,l.useCallback)(h=>{n(_=>{const p=_.find(S=>S.id===h.id);return p?_.map(S=>S===p?{...S,...p}:S):_})},[n]),f=(0,l.useCallback)(()=>c,[c]);return(0,l.useEffect)(()=>{const h=new g.Disposable;return h.addDisposable(r(u)),h.addDisposable(a(m)),h.addDisposable(i(d)),()=>h.dispose()},[r,i,a,u,d,m]),(0,s.jsxs)(s.Fragment,{children:[t.map(({id:h,content:_,props:p,visible:S,onOk:k,onClose:w,modalProps:v,...A})=>{const x=()=>d(h),K=async()=>{k&&await k(),d(h)};return(0,s.jsx)(y.ui_kit$Modal,{open:S,onCancel:x,onOk:K,afterClose:w,getContainer:f,...v,...A,children:typeof _!="function"?_:l.default.createElement(_,p)},h)}),e]})},Bl=new Set;function ri(e){const t=typeof e=="string"&&e?e:void 0;t?window.localStorage.setItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme,t):window.localStorage.removeItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme);for(const n of Bl)n(t)}var Ul=[(0,y.ui_kit$createTransformer)()],$l={colorDarken1:"rgba(0, 0, 0, 0.08)",colorFillSecondaryDarken:"rgba(0, 0, 0, 0.1)",formControlHeight:34,borderWidth:1,borderColorHover:"#C5C5C5",formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:"63.92%",colorSecondaryL:"50%",colorSecondaryBgH:273,colorSecondaryBgS:"100%",colorSecondaryBgL:"93%",appZoom:1},zl={colorDarken1:"rgba(0, 0, 0, 0.9)",colorFillSecondaryDarken:"rgba(255, 255, 255, 0.16)",formControlHeight:34,borderWidth:1,borderColorHover:"rgba(255, 255, 255, 0.3)",formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},Gl=Ho(y.ui_kit$lightThemePreset,{token:$l}),Wl=Ho(y.ui_kit$darkThemePreset,{token:zl});function Hl({children:e}){const t=o.useSelector(o.selectEditorThemeColor$1),n=(0,l.useMemo)(()=>matchMedia("(prefers-color-scheme: dark)").matches?o.DARK:o.LIGHT,[]),r=o.useAppConfig(),[i,a]=(0,l.useState)(r.theme||n),c=o.useDispatch(),d=El();(0,l.useEffect)(()=>{const k=r.theme||n;a(k),vl(k),c(o.setEditorThemeColor$1(k==="dark"?`vs-${k}`:o.LIGHT)),d()},[t,n,r.theme,r.pathEnabled,c,d]);const u=(0,l.useCallback)(k=>{k&&k!=="system"?(_l(k),ri(k)):ri(void 0)},[]);(0,l.useEffect)(()=>{const k=r.theme,w=localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme);k&&k!==w&&u(k)},[r.theme,u]);const m=(0,l.useCallback)(()=>{const k=localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme);u(k)},[u]);(0,l.useEffect)(()=>{m()},[m]);const f=r.themes,[h]=(0,l.useState)(1),_=(0,l.useMemo)(()=>{const k=i==="light"?Gl:Wl,w=f[i],v=w?Ho(k,w):k;return{...v,token:{...v.token,appZoom:h}}},[i,f,h]),p=o.useModalRootElement(),S=(0,l.useCallback)(()=>p,[p]);return(0,s.jsx)(y.ui_kit$ThemeProvider,{theme:_,getPopupContainer:S,children:(0,s.jsx)(y.ui_kit$StyleProvider,{transformers:Ul,children:(0,s.jsx)(Fl,{children:(0,s.jsx)(y.ui_kit$App,{children:(0,s.jsx)(o.ImagePickerProvider,{children:e})})})})})}var ql=({onLoad:e,children:t})=>{(0,l.useEffect)(()=>{e&&e()},[e]);const n=o.useAppDispatch();return(0,l.useEffect)(()=>{n(o.authorizationApi.endpoints.getMe.initiate(""))},[n]),t};function ii({title:e,content:t,acf:{seen:n,type:r,event:i,data:a},...c}){return{...c,seen:n,type:r,event:i,data:a,title:o.getRendererString(e),content:t}}var Sn="Notifications",Gn=o.createApi({reducerPath:"notificationsApi",tagTypes:[Sn],baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn(t,n){return o.clientFromApi(n).wp.notification_list({author:[Number(t)]}).then(o.transformListResponseFn(ii))},providesTags:t=>t?[...t.map(({id:n})=>({type:Sn,id:n})),{type:Sn,id:"LIST"}]:[{type:Sn,id:"LIST"}]}),notificationShown:e.mutation({queryFn({id:t,datetime:n},r){return o.clientFromApi(r).wp.notification_create2({id:t},{},{type:g.ContentType.Json,extraQuery:{"acf[seen]":n}}).then(o.transformResponseFn(ii))},invalidatesTags:[{type:Sn,id:"LIST"}]})})}),{useGetNotificationsQuery:Vl,useNotificationShownMutation:Yl}=Gn,Kl=()=>{const e=o.useCookieManager(),t=o.useContainer(),n=o.useRoutePathname();(0,l.useEffect)(()=>{n.endsWith("/new")||e.remove(o.APP_COOKIES.em_new_email)},[n,e,t])},Ql=()=>{const e=o.useCookieManager(),t=o.useRoutePathname();(0,l.useEffect)(()=>{t.endsWith("/new")||e.remove(o.APP_COOKIES.em_new_block)},[t,e])},ai="em_notification_mark_seen_skipped_ids";function si(){try{const e=sessionStorage.getItem(ai),t=e?JSON.parse(e):[];return Array.isArray(t)?t.map(String):[]}catch{return[]}}function Xl(e){try{const t=String(e),n=new Set(si());n.has(t)||(n.add(t),sessionStorage.setItem(ai,JSON.stringify([...n])))}catch{}}var Jl=({children:e=void 0,sider:t=null,modals:n=null,hasEmail:r=!1,hasBlock:i=!1})=>{const{token:a}=(0,y.ui_kit$useToken)(),c=o.useDispatch(),d=o.useSelector(o.selectActiveModal$1),u=o.useCurrentUser();o.useSelector(o.selectIsCodeMode);const m=o.usePushToDataLayer(),[f]=Yl(),h=o.useNotification();(0,l.useEffect)(()=>{bl(a)},[a]);const{data:_=[],isSuccess:p}=Vl(u?.id??"",{pollingInterval:3e5,skip:!!d||!u?.id});return(0,l.useEffect)(()=>{const S=_.filter(k=>k.seen===""||k.seen===null);setTimeout(()=>{if(S.length&&p){const k=new Set(si());S.forEach(w=>{if(k.has(String(w.id)))return;w.event==="subscription_payment"&&m({event:"payment",data:w.data}),h[w.type]({title:w.title?.rendered||w.title||"",description:w.content?.rendered||""});const v=new Date().toLocaleString();f({id:w.id,datetime:v}).unwrap().catch(A=>{const x=A&&typeof A=="object"?A:{};(x.data&&typeof x.data=="object"&&x.data!==null&&"code"in x.data?String(x.data.code):void 0)==="em_rest_notification_403"&&Xl(w.id)})})}},5e3)},[p,f,_,h]),Kl(),Ql(),(0,l.useEffect)(()=>{i||c(o.resetBlockSlice()),r||c(o.resetEmailSlice())},[i,r,c]),(0,s.jsx)("div",{className:"main",children:(0,s.jsx)("div",{className:"main__pane main__pane_main",children:(0,s.jsx)("div",{className:"main__pane-content",id:"pane-content-iframe","data-scroll-area":"page",children:(0,s.jsxs)(y.ui_kit$Layout,{className:"main__pane-layout",hasSider:!!t,children:[t,n,e??(0,s.jsx)(o.RouteOutlet,{})]})})})})},Zl={toggle:()=>{},set:()=>{},setDirection:()=>{}};function Vo(){const e=o.useContainer();return(0,l.useMemo)(()=>e?{toggle:()=>o.toggleCodeMode(e),set:t=>o.setCodeMode$1(e,t),setDirection:t=>o.setCodeModeDirection(e,t)}:Zl,[e])}var ec=`
97
+ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-theme-varibalse="true"]');i?t.replaceChild(n,i):t.insertBefore(n,t.firstChild)}},El=e=>{if(!_l(e))return;const t=e.trim(),n=document.body;n.classList.contains(t)||setTimeout(()=>{n.classList.remove(t==="dark"?o.LIGHT:o.DARK),n.classList.add(t)},200)},Sl=()=>{const e=o.useSendPostMessage();return(0,l.useCallback)(()=>{const t=window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme),n=matchMedia("(prefers-color-scheme: dark)").matches?o.DARK:o.LIGHT,r=t||n;e({operation:o.EVENT_TYPES.UPDATE_PREVIEW,theme:r})},[e])},Gt={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")},Yb={defaultMerge:Gt.defaultMerge};function wl(e,t){return t}function ei(e){return typeof e!="object"||e===null?0:Array.isArray(e)?2:Tl(e)?1:e instanceof Set?3:e instanceof Map?4:5}function kl(e){const t=new Set;for(const n of e)for(const r of[...Object.keys(n),...Object.getOwnPropertySymbols(n)])t.add(r);return t}function Cl(e,t){return typeof e=="object"&&Object.prototype.propertyIsEnumerable.call(e,t)}function ti(e){return{*[Symbol.iterator](){for(const t of e)for(const n of t)yield n}}}var ni=new Set(["[object Object]","[object Module]"]);function Tl(e){if(!ni.has(Object.prototype.toString.call(e)))return!1;const{constructor:t}=e;if(t===void 0)return!0;const n=t.prototype;return!(n===null||typeof n!="object"||!ni.has(Object.prototype.toString.call(n))||!n.hasOwnProperty("isPrototypeOf"))}function Il(e,t,n){const r={};for(const i of kl(e)){const a=[];for(const d of e)Cl(d,i)&&a.push(d[i]);if(a.length===0)continue;const c=ri(a,t,t.metaDataUpdater(n,{key:i,parents:e}));c!==Gt.skip&&(i==="__proto__"?Object.defineProperty(r,i,{value:c,configurable:!0,enumerable:!0,writable:!0}):r[i]=c)}return r}function Al(e){return e.flat()}function xl(e){return new Set(ti(e))}function Pl(e){return new Map(ti(e))}function oi(e){return e.at(-1)}var Wo=Object.freeze({__proto__:null,mergeArrays:Al,mergeMaps:Pl,mergeOthers:oi,mergeRecords:Il,mergeSets:xl});function Ho(...e){return Rl({})(...e)}function Rl(e,t){const n=jl(e,r);function r(...i){return ri(i,n,t)}return r}function jl(e,t){return{defaultMergeFunctions:Wo,mergeFunctions:{...Wo,...Object.fromEntries(Object.entries(e).filter(([n,r])=>Object.hasOwn(Wo,n)).map(([n,r])=>r===!1?[n,oi]:[n,r]))},metaDataUpdater:e.metaDataUpdater??wl,deepmerge:t,useImplicitDefaultMerging:e.enableImplicitDefaultMerging??!1,actions:Gt}}function ri(e,t,n){if(e.length===0)return;if(e.length===1)return qo(e,t,n);const r=ei(e[0]);if(r!==0&&r!==5){for(let i=1;i<e.length;i++)if(ei(e[i])!==r)return qo(e,t,n)}switch(r){case 1:return Ll(e,t,n);case 2:return Ol(e,t,n);case 3:return Ml(e,t,n);case 4:return Nl(e,t,n);default:return qo(e,t,n)}}function Ll(e,t,n){const r=t.mergeFunctions.mergeRecords(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeRecords!==t.defaultMergeFunctions.mergeRecords?t.defaultMergeFunctions.mergeRecords(e,t,n):r}function Ol(e,t,n){const r=t.mergeFunctions.mergeArrays(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeArrays!==t.defaultMergeFunctions.mergeArrays?t.defaultMergeFunctions.mergeArrays(e):r}function Ml(e,t,n){const r=t.mergeFunctions.mergeSets(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeSets!==t.defaultMergeFunctions.mergeSets?t.defaultMergeFunctions.mergeSets(e):r}function Nl(e,t,n){const r=t.mergeFunctions.mergeMaps(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeMaps!==t.defaultMergeFunctions.mergeMaps?t.defaultMergeFunctions.mergeMaps(e):r}function qo(e,t,n){const r=t.mergeFunctions.mergeOthers(e,t,n);return r===Gt.defaultMerge||t.useImplicitDefaultMerging&&r===void 0&&t.mergeFunctions.mergeOthers!==t.defaultMergeFunctions.mergeOthers?t.defaultMergeFunctions.mergeOthers(e):r}function Dl(e){o.requiredArgs(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||o._typeof(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):new Date(NaN)}function Fl(e){const t=new Map,n=new Set;let r=null,i=null;const a=(d,u)=>{const m={participantId:d.participant.id,acknowledgedVersion:d.acknowledged,documentVersion:e.get().version,error:u};n.forEach(f=>f(m))},c=d=>{if(d.detached)return;const u=e.get().version;if(d.acknowledged===u||d.skipVersion===u)return;if(d.pushing){d.stale=!0;return}d.pushing=!0;const{attributes:m}=e.get(),f=d.participant.applyChanges&&i?.version===u&&d.acknowledged===u-1?i:null;(f?d.participant.applyChanges(f.changes,u,m):d.participant.apply(e.getContent(),u,m)).then(()=>{d.acknowledged=u}).catch(g=>{a(d,g)}).finally(()=>{d.pushing=!1,d.stale&&(d.stale=!1,c(d))})};return e.subscribe(({version:d,changes:u})=>{i=u?.length?{version:d,changes:u}:null,t.forEach(c)}),{attach(d){const u={participant:d,acknowledged:null,pushing:!1,stale:!1,detached:!1,skipVersion:null};return t.set(d.id,u),c(u),{acknowledgedVersion:()=>u.acknowledged,reset(){u.acknowledged=null,u.skipVersion=null,c(u)},detach(){u.detached=!0,t.delete(d.id)}}},setPrimacy(d){r=d},getPrimacy:()=>r,mutateFrom(d,u,m){const f=t.get(d);if(m.echo!==!0&&r!==null&&r!==d)return f?.participant.dropUnsent?.(),null;const g=e.get().version;f&&(f.skipVersion=g+1);const _=e.mutate(u,{source:m.source});return f&&_===g?f.skipVersion=null:f&&(f.acknowledged=_),_},onOutOfSync(d){return n.add(d),()=>n.delete(d)}}}var Bl=({children:e})=>{const[t,n]=(0,l.useState)([]),r=o.useEvent(h.MODAL_SHOW_EVENT),i=o.useEvent(h.MODAL_CLOSE_EVENT),a=o.useEvent(h.MODAL_UPDATE_EVENT),c=o.useModalRootElement(),d=(0,l.useCallback)(g=>{n(_=>g===void 0?[]:_.filter(p=>p.id!==g))},[n]),u=(0,l.useCallback)(g=>{n(_=>{const p=_.find(E=>E.id===g.id);return p?_.map(E=>E===p?{...E,...p}:E):[..._,{...g,visible:!0}]})},[n]),m=(0,l.useCallback)(g=>{n(_=>{const p=_.find(E=>E.id===g.id);return p?_.map(E=>E===p?{...E,...p}:E):_})},[n]),f=(0,l.useCallback)(()=>c,[c]);return(0,l.useEffect)(()=>{const g=new h.Disposable;return g.addDisposable(r(u)),g.addDisposable(a(m)),g.addDisposable(i(d)),()=>g.dispose()},[r,i,a,u,d,m]),(0,s.jsxs)(s.Fragment,{children:[t.map(({id:g,content:_,props:p,visible:E,onOk:C,onClose:w,modalProps:S,...I})=>{const x=()=>d(g),Y=async()=>{C&&await C(),d(g)};return(0,s.jsx)(y.ui_kit$Modal,{open:E,onCancel:x,onOk:Y,afterClose:w,getContainer:f,...S,...I,children:typeof _!="function"?_:l.default.createElement(_,p)},g)}),e]})},Ul=new Set;function ii(e){const t=typeof e=="string"&&e?e:void 0;t?window.localStorage.setItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme,t):window.localStorage.removeItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme);for(const n of Ul)n(t)}var $l=[(0,y.ui_kit$createTransformer)()],zl={colorDarken1:"rgba(0, 0, 0, 0.08)",colorFillSecondaryDarken:"rgba(0, 0, 0, 0.1)",formControlHeight:34,borderWidth:1,borderColorHover:"#C5C5C5",formItemMarginBottomMD:20,formItemMarginBottomXS:8,colorSecondaryH:265.03,colorSecondaryS:"63.92%",colorSecondaryL:"50%",colorSecondaryBgH:273,colorSecondaryBgS:"100%",colorSecondaryBgL:"93%",appZoom:1},Gl={colorDarken1:"rgba(0, 0, 0, 0.9)",colorFillSecondaryDarken:"rgba(255, 255, 255, 0.16)",formControlHeight:34,borderWidth:1,borderColorHover:"rgba(255, 255, 255, 0.3)",formItemMarginBottomMD:20,formItemMarginBottomXS:8,appZoom:1},Wl=Ho(y.ui_kit$lightThemePreset,{token:zl}),Hl=Ho(y.ui_kit$darkThemePreset,{token:Gl});function ql({children:e}){const t=o.useSelector(o.selectEditorThemeColor$1),n=(0,l.useMemo)(()=>matchMedia("(prefers-color-scheme: dark)").matches?o.DARK:o.LIGHT,[]),r=o.useAppConfig(),[i,a]=(0,l.useState)(r.theme||n),c=o.useDispatch(),d=Sl();(0,l.useEffect)(()=>{const C=r.theme||n;a(C),El(C),c(o.setEditorThemeColor$1(C==="dark"?`vs-${C}`:o.LIGHT)),d()},[t,n,r.theme,r.pathEnabled,c,d]);const u=(0,l.useCallback)(C=>{C&&C!=="system"?(bl(C),ii(C)):ii(void 0)},[]);(0,l.useEffect)(()=>{const C=r.theme,w=localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme);C&&C!==w&&u(C)},[r.theme,u]);const m=(0,l.useCallback)(()=>{const C=localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_color_scheme);u(C)},[u]);(0,l.useEffect)(()=>{m()},[m]);const f=r.themes,[g]=(0,l.useState)(1),_=(0,l.useMemo)(()=>{const C=i==="light"?Wl:Hl,w=f[i],S=w?Ho(C,w):C;return{...S,token:{...S.token,appZoom:g}}},[i,f,g]),p=o.useModalRootElement(),E=(0,l.useCallback)(()=>p,[p]);return(0,s.jsx)(y.ui_kit$ThemeProvider,{theme:_,getPopupContainer:E,children:(0,s.jsx)(y.ui_kit$StyleProvider,{transformers:$l,children:(0,s.jsx)(Bl,{children:(0,s.jsx)(y.ui_kit$App,{children:(0,s.jsx)(o.ImagePickerProvider,{children:e})})})})})}var Vl=({onLoad:e,children:t})=>{(0,l.useEffect)(()=>{e&&e()},[e]);const n=o.useAppDispatch();return(0,l.useEffect)(()=>{n(o.authorizationApi.endpoints.getMe.initiate(""))},[n]),t};function ai({title:e,content:t,acf:{seen:n,type:r,event:i,data:a},...c}){return{...c,seen:n,type:r,event:i,data:a,title:o.getRendererString(e),content:t}}var Sn="Notifications",Gn=o.createApi({reducerPath:"notificationsApi",tagTypes:[Sn],baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getNotifications:e.query({queryFn(t,n){return o.clientFromApi(n).wp.notification_list({author:[Number(t)]}).then(o.transformListResponseFn(ai))},providesTags:t=>t?[...t.map(({id:n})=>({type:Sn,id:n})),{type:Sn,id:"LIST"}]:[{type:Sn,id:"LIST"}]}),notificationShown:e.mutation({queryFn({id:t,datetime:n},r){return o.clientFromApi(r).wp.notification_create2({id:t},{},{type:h.ContentType.Json,extraQuery:{"acf[seen]":n}}).then(o.transformResponseFn(ai))},invalidatesTags:[{type:Sn,id:"LIST"}]})})}),{useGetNotificationsQuery:Yl,useNotificationShownMutation:Kl}=Gn,Ql=()=>{const e=o.useCookieManager(),t=o.useContainer(),n=o.useRoutePathname();(0,l.useEffect)(()=>{n.endsWith("/new")||e.remove(o.APP_COOKIES.em_new_email)},[n,e,t])},Xl=()=>{const e=o.useCookieManager(),t=o.useRoutePathname();(0,l.useEffect)(()=>{t.endsWith("/new")||e.remove(o.APP_COOKIES.em_new_block)},[t,e])},si="em_notification_mark_seen_skipped_ids";function li(){try{const e=sessionStorage.getItem(si),t=e?JSON.parse(e):[];return Array.isArray(t)?t.map(String):[]}catch{return[]}}function Jl(e){try{const t=String(e),n=new Set(li());n.has(t)||(n.add(t),sessionStorage.setItem(si,JSON.stringify([...n])))}catch{}}var Zl=({children:e=void 0,sider:t=null,modals:n=null,hasEmail:r=!1,hasBlock:i=!1})=>{const{token:a}=(0,y.ui_kit$useToken)(),c=o.useDispatch(),d=o.useSelector(o.selectActiveModal$1),u=o.useCurrentUser();o.useSelector(o.selectIsCodeMode);const m=o.usePushToDataLayer(),[f]=Kl(),g=o.useNotification();(0,l.useEffect)(()=>{vl(a)},[a]);const{data:_=[],isSuccess:p}=Yl(u?.id??"",{pollingInterval:3e5,skip:!!d||!u?.id});return(0,l.useEffect)(()=>{const E=_.filter(C=>C.seen===""||C.seen===null);setTimeout(()=>{if(E.length&&p){const C=new Set(li());E.forEach(w=>{if(C.has(String(w.id)))return;w.event==="subscription_payment"&&m({event:"payment",data:w.data}),g[w.type]({title:w.title?.rendered||w.title||"",description:w.content?.rendered||""});const S=new Date().toLocaleString();f({id:w.id,datetime:S}).unwrap().catch(I=>{const x=I&&typeof I=="object"?I:{};(x.data&&typeof x.data=="object"&&x.data!==null&&"code"in x.data?String(x.data.code):void 0)==="em_rest_notification_403"&&Jl(w.id)})})}},5e3)},[p,f,_,g]),Ql(),Xl(),(0,l.useEffect)(()=>{i||c(o.resetBlockSlice()),r||c(o.resetEmailSlice())},[i,r,c]),(0,s.jsx)("div",{className:"main",children:(0,s.jsx)("div",{className:"main__pane main__pane_main",children:(0,s.jsx)("div",{className:"main__pane-content",id:"pane-content-iframe","data-scroll-area":"page",children:(0,s.jsxs)(y.ui_kit$Layout,{className:"main__pane-layout",hasSider:!!t,children:[t,n,e??(0,s.jsx)(o.RouteOutlet,{})]})})})})},ec={toggle:()=>{},set:()=>{},setDirection:()=>{}};function Vo(){const e=o.useContainer();return(0,l.useMemo)(()=>e?{toggle:()=>o.toggleCodeMode(e),set:t=>o.setCodeMode$1(e,t),setDirection:t=>o.setCodeModeDirection(e,t)}:ec,[e])}var tc=`
98
98
  <style>
99
99
  @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
100
100
  .em-mob-width-100perc {
@@ -141,7 +141,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
141
141
  </td>
142
142
  </tr>
143
143
 
144
- `,tc=`
144
+ `,nc=`
145
145
  <style>
146
146
  @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
147
147
  .em-mob-width-100perc {
@@ -197,7 +197,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
197
197
  </td>
198
198
  </tr>
199
199
 
200
- `,nc=`
200
+ `,oc=`
201
201
  <style>
202
202
  @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
203
203
  .em-mob-width-100perc {
@@ -253,7 +253,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
253
253
  </td>
254
254
  </tr>
255
255
 
256
- `,oc=`
256
+ `,rc=`
257
257
  <style>
258
258
  @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
259
259
  .em-mob-width-100perc {
@@ -309,7 +309,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
309
309
  </td>
310
310
  </tr>
311
311
 
312
- `,rc=`
312
+ `,ic=`
313
313
  <style>
314
314
  @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
315
315
  .em-mob-width-100perc {
@@ -374,7 +374,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
374
374
  </td>
375
375
  </tr>
376
376
 
377
- `,ic=`
377
+ `,ac=`
378
378
  <style>
379
379
  @media only screen and (max-device-width: 660px), only screen and (max-width: 660px) {
380
380
  .em-mob-width-100perc {
@@ -434,7 +434,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
434
434
  </td>
435
435
  </tr>
436
436
 
437
- `,li=[{sizeArray:[24],name:"column-one",html:ec},{sizeArray:[12,12],name:"column-two-50",html:oc},{sizeArray:[8,8,8],name:"column-three",html:rc},{sizeArray:[6,6,6,6],name:"column-four",html:ic},{sizeArray:[8,16],name:"column-two-33",html:tc},{sizeArray:[16,8],name:"column-two-66",html:nc}],ci=()=>{const e=xt.useSetHtmlElementInIframeHandler(),t=xt.useDragStartBlockToIframeHandler();return(0,s.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,s.jsx)("div",{className:"structures__list",children:(0,s.jsx)("div",{children:li&&li.map(n=>(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"structures__item",draggable:!0,onClick:r=>e(r,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),onDragStart:r=>t(r,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),children:(0,s.jsx)(y.ui_kit$Row,{gutter:[6,6],className:"structures__item-row",children:n.sizeArray.map((r,i)=>(0,s.jsx)(y.ui_kit$Col,{span:r,children:(0,s.jsx)("div",{className:"structures__item-col"})},n.name+i))})})},n.name))})})})};ci.propTypes={};var ac=`<style em="styles">
437
+ `,ci=[{sizeArray:[24],name:"column-one",html:tc},{sizeArray:[12,12],name:"column-two-50",html:rc},{sizeArray:[8,8,8],name:"column-three",html:ic},{sizeArray:[6,6,6,6],name:"column-four",html:ac},{sizeArray:[8,16],name:"column-two-33",html:nc},{sizeArray:[16,8],name:"column-two-66",html:oc}],di=()=>{const e=xt.useSetHtmlElementInIframeHandler(),t=xt.useDragStartBlockToIframeHandler();return(0,s.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,s.jsx)("div",{className:"structures__list",children:(0,s.jsx)("div",{children:ci&&ci.map(n=>(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"structures__item",draggable:!0,onClick:r=>e(r,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),onDragStart:r=>t(r,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),children:(0,s.jsx)(y.ui_kit$Row,{gutter:[6,6],className:"structures__item-row",children:n.sizeArray.map((r,i)=>(0,s.jsx)(y.ui_kit$Col,{span:r,children:(0,s.jsx)("div",{className:"structures__item-col"})},n.name+i))})})},n.name))})})})};di.propTypes={};var sc=`<style em="styles">
438
438
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
439
439
  .em-mob-width-100perc {
440
440
  width: 100%!important;
@@ -462,7 +462,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
462
462
  </tr>
463
463
  </table>
464
464
  </td>
465
- </tr>`,sc=`<style em="styles">
465
+ </tr>`,lc=`<style em="styles">
466
466
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
467
467
  .em-mob-width-100perc {
468
468
  width: 100%!important;
@@ -496,7 +496,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
496
496
  </tr>
497
497
  </table>
498
498
  </td>
499
- </tr>`,lc=`<style em="styles">
499
+ </tr>`,cc=`<style em="styles">
500
500
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
501
501
  .em-mob-width-100perc {
502
502
  width: 100%!important;
@@ -530,7 +530,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
530
530
  </tr>
531
531
  </table>
532
532
  </td>
533
- </tr>`,cc=`<style em="styles">
533
+ </tr>`,dc=`<style em="styles">
534
534
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
535
535
  .em-mob-width-100perc {
536
536
  width: 100%!important;
@@ -564,7 +564,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
564
564
  </tr>
565
565
  </table>
566
566
  </td>
567
- </tr>`,dc=`<style em="styles">
567
+ </tr>`,uc=`<style em="styles">
568
568
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
569
569
  .em-mob-width-100perc {
570
570
  width: 100%!important;
@@ -600,7 +600,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
600
600
  </tr>
601
601
  </table>
602
602
  </td>
603
- </tr>`,uc=`<style em="styles">
603
+ </tr>`,mc=`<style em="styles">
604
604
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
605
605
  .em-mob-width-100perc {
606
606
  width: 100%!important;
@@ -638,7 +638,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
638
638
  </tr>
639
639
  </table>
640
640
  </td>
641
- </tr>`,di=[{sizeArray:[24],name:"column-one",html:ac},{sizeArray:[12,12],name:"column-two-50",html:cc},{sizeArray:[8,8,8],name:"column-three",html:dc},{sizeArray:[6,6,6,6],name:"column-four",html:uc},{sizeArray:[8,16],name:"column-two-33",html:sc},{sizeArray:[16,8],name:"column-two-66",html:lc}],ui=()=>{const e=xt.useSetHtmlElementInIframeHandler(),t=xt.useDragStartBlockToIframeHandler();return(0,s.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,s.jsx)("div",{className:"structures__list",children:(0,s.jsx)("div",{children:di&&di.map(n=>(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"structures__item",draggable:!0,onClick:r=>e(r,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),onDragStart:r=>t(r,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),children:(0,s.jsx)(y.ui_kit$Row,{gutter:[6,6],className:"structures__item-row",children:n.sizeArray.map((r,i)=>(0,s.jsx)(y.ui_kit$Col,{span:r,children:(0,s.jsx)("div",{className:"structures__item-col"})},n.name+i))})})},n.name))})})})};ui.propTypes={};var mc=`<style em="styles">
641
+ </tr>`,ui=[{sizeArray:[24],name:"column-one",html:sc},{sizeArray:[12,12],name:"column-two-50",html:dc},{sizeArray:[8,8,8],name:"column-three",html:uc},{sizeArray:[6,6,6,6],name:"column-four",html:mc},{sizeArray:[8,16],name:"column-two-33",html:lc},{sizeArray:[16,8],name:"column-two-66",html:cc}],mi=()=>{const e=xt.useSetHtmlElementInIframeHandler(),t=xt.useDragStartBlockToIframeHandler();return(0,s.jsx)("div",{className:"structures blocks-search__empty-wrapper",children:(0,s.jsx)("div",{className:"structures__list",children:(0,s.jsx)("div",{children:ui&&ui.map(n=>(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"structures__item",draggable:!0,onClick:r=>e(r,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),onDragStart:r=>t(r,n.html,void 0,n.name,{id:n.name,title:n.name,type:"structure"}),children:(0,s.jsx)(y.ui_kit$Row,{gutter:[6,6],className:"structures__item-row",children:n.sizeArray.map((r,i)=>(0,s.jsx)(y.ui_kit$Col,{span:r,children:(0,s.jsx)("div",{className:"structures__item-col"})},n.name+i))})})},n.name))})})})};mi.propTypes={};var pc=`<style em="styles">
642
642
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
643
643
  .em-mob-width-100perc {
644
644
  width: 100%!important;
@@ -648,7 +648,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
648
648
  </style>
649
649
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
650
650
  <img src=${__emailmaker__.assetUrl("empty-image.png")} width="150" border="0" alt="" style="display: block; width: 100%; max-width: 150px;" />
651
- </td></tr></table>`,pc=`<style em="styles">
651
+ </td></tr></table>`,fc=`<style em="styles">
652
652
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
653
653
  .em-mob-width-100perc {
654
654
  width: 100%!important;
@@ -658,7 +658,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
658
658
  </style>
659
659
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
660
660
  <img class="em-ai-img em-just-inserted" src="${__emailmaker__.assetUrl("ai-image.png")}" width="150" border="0" alt="" style="display: block; width: 100%; max-width: 150px;" />
661
- </td></tr></table>`,fc=({__:e})=>`<style em="styles">
661
+ </td></tr></table>`,hc=({__:e})=>`<style em="styles">
662
662
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
663
663
  .em-mob-width-100perc {
664
664
  width: 100%!important;
@@ -668,7 +668,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
668
668
  </style>
669
669
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding-bottom: 10px;">
670
670
  <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")}</div>
671
- </td></tr></table>`,hc=({__:e})=>`<style em="styles">
671
+ </td></tr></table>`,gc=({__:e})=>`<style em="styles">
672
672
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
673
673
  .em-mob-width-100perc {
674
674
  width: 100%!important;
@@ -678,7 +678,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
678
678
  </style>
679
679
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td style="padding: 20px 0 10px;">
680
680
  <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 24px; line-height: 32px; color: #333333;"><strong>${e("Header text")}</strong></div>
681
- </td></tr></table>`,gc=({__:e})=>`<style em="styles">
681
+ </td></tr></table>`,yc=({__:e})=>`<style em="styles">
682
682
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
683
683
  .em-mob-width-100perc {
684
684
  width: 100%!important;
@@ -696,7 +696,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
696
696
  </td>
697
697
  </tr>
698
698
  </table>
699
- </td></tr></table>`,yc=({__:e})=>`<style em="styles">
699
+ </td></tr></table>`,_c=({__:e})=>`<style em="styles">
700
700
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
701
701
  .em-mob-width-100perc {
702
702
  width: 100%!important;
@@ -715,7 +715,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
715
715
  </td>
716
716
  </tr>
717
717
  </table>
718
- </td></tr></table>`,_c=({__:e})=>`<style em="styles">
718
+ </td></tr></table>`,bc=({__:e})=>`<style em="styles">
719
719
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
720
720
  .em-mob-width-100perc {
721
721
  width: 100%!important;
@@ -734,7 +734,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
734
734
  </td>
735
735
  </tr>
736
736
  </table>
737
- </td></tr></table>`,bc=`<style em="styles">
737
+ </td></tr></table>`,vc=`<style em="styles">
738
738
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
739
739
  .em-mob-width-100perc {
740
740
  width: 100%!important;
@@ -742,7 +742,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
742
742
  }
743
743
  }
744
744
  </style>
745
- <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="0" style="padding: 20px 0 0; border-top: 1px solid #BFBFBF;">&nbsp;</td></tr></table>`,vc=`<style em="styles">
745
+ <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="0" style="padding: 20px 0 0; border-top: 1px solid #BFBFBF;">&nbsp;</td></tr></table>`,Ec=`<style em="styles">
746
746
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
747
747
  .em-mob-width-100perc {
748
748
  width: 100%!important;
@@ -750,7 +750,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
750
750
  }
751
751
  }
752
752
  </style>
753
- <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>`,Ec="https://cdn.useblocks.io/socnets";function Sc(e){let t=String(e??"");for(;t.endsWith("/");)t=t.slice(0,-1);return t}function wc(e){let t=String(e??"");for(;t.startsWith("/");)t=t.slice(1);return t}function kc(e){return`${Sc(Ec)}/${wc(e)}`}var Cc={telegram:"tg",youtube:"yt",vk:"vk",yandex_zen:"yd",x:"xa",twitter:"tw",instagram:"ig",facebook:"fb",pinterest:"pi",tiktok:"tt",ok:"ok",max:"max",rutube:"rutube",whatsapp:"whatsapp",linkedin:"linkedin",viber:"viber",apple:"apple",dis:"dis",drbl:"drbl",fig:"fig",gh:"gh",ggl:"ggl",mdm:"mdm",rdt:"rdt",sgnl:"sgnl",sc:"sc",sptf:"sptf",tmblr:"tmblr",twitch:"twitch",thrds:"thrds",msngr:"msngr",bs:"bs"};function mi(e,t){return kc(`${e}${t?"-negative":""}.png`)}function pi(e){return Object.fromEntries(Object.entries(Cc).map(([t,n])=>[t,mi(n,e)]))}var qb=pi(!1),Vb=pi(!0),Yb=["tg","yt","vk","yd","xa","ig","fb"].map(e=>mi(e,!1)),Tc=o.SOCIAL_ICON_BY_PLATFORM;function fi(e){return String(e??"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function hi(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=typeof window<"u"&&window.location?.origin?window.location.origin:"";if(!n)return t;try{return new URL(t,n).href}catch{return t}}function Ic(e){return e>0?`<td width="${e}">&nbsp;</td>`:""}var Ac={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function gi(e){const{iconSize:t,gap:n,align:r}=Ac,i=Math.max(0,Math.round(Number(n)||0)),a=e.length>1;return`<style em="styles">
753
+ <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td height="20"></td></tr></table>`,Sc="https://cdn.useblocks.io/socnets";function wc(e){let t=String(e??"");for(;t.endsWith("/");)t=t.slice(0,-1);return t}function kc(e){let t=String(e??"");for(;t.startsWith("/");)t=t.slice(1);return t}function Cc(e){return`${wc(Sc)}/${kc(e)}`}var Tc={telegram:"tg",youtube:"yt",vk:"vk",yandex_zen:"yd",x:"xa",twitter:"tw",instagram:"ig",facebook:"fb",pinterest:"pi",tiktok:"tt",ok:"ok",max:"max",rutube:"rutube",whatsapp:"whatsapp",linkedin:"linkedin",viber:"viber",apple:"apple",dis:"dis",drbl:"drbl",fig:"fig",gh:"gh",ggl:"ggl",mdm:"mdm",rdt:"rdt",sgnl:"sgnl",sc:"sc",sptf:"sptf",tmblr:"tmblr",twitch:"twitch",thrds:"thrds",msngr:"msngr",bs:"bs"};function pi(e,t){return Cc(`${e}${t?"-negative":""}.png`)}function fi(e){return Object.fromEntries(Object.entries(Tc).map(([t,n])=>[t,pi(n,e)]))}var Kb=fi(!1),Qb=fi(!0),Xb=["tg","yt","vk","yd","xa","ig","fb"].map(e=>pi(e,!1)),Ic=o.SOCIAL_ICON_BY_PLATFORM;function hi(e){return String(e??"").replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;")}function gi(e){const t=String(e??"").trim();if(!t)return"";if(/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i.test(t))return t;const n=typeof window<"u"&&window.location?.origin?window.location.origin:"";if(!n)return t;try{return new URL(t,n).href}catch{return t}}function Ac(e){return e>0?`<td width="${e}">&nbsp;</td>`:""}var xc={align:"center",iconSize:40,borderRadius:0,gap:8,bgEnabled:!1,bgColor:"",borderWidth:0,borderColor:"",buttonBorderColor:"",buttonBorderWidth:0,showLabel:!1};function yi(e){const{iconSize:t,gap:n,align:r}=xc,i=Math.max(0,Math.round(Number(n)||0)),a=e.length>1;return`<style em="styles">
754
754
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
755
755
  .em-mob-width-100perc {
756
756
  width: 100%!important;
@@ -760,10 +760,10 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
760
760
  </style>
761
761
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom" em-type="social"><tr><td align="${r}">
762
762
  <table border="0" cellspacing="0" cellpadding="0">
763
- <tr>${e.map(c=>{const d=hi(c.iconSrc),u=d||hi(Tc[c.platform]);if(!u)return"";const m=fi(c.label),f=fi(c.href||""),h=a?' draggable="true"':"",_=d?" em-custom-icon":"";return`<td em-platform="${c.platform}"${_}${h}><a href="${f}" target="_blank" draggable="false"><img src="${u}" width="${t}" height="${t}" border="0" alt="${m}" draggable="false" style="display:block;" /></a></td>`}).filter(Boolean).reduce((c,d,u)=>(u>0&&c.push(Ic(i)),c.push(d),c),[]).join("")}
763
+ <tr>${e.map(c=>{const d=gi(c.iconSrc),u=d||gi(Ic[c.platform]);if(!u)return"";const m=hi(c.label),f=hi(c.href||""),g=a?' draggable="true"':"",_=d?" em-custom-icon":"";return`<td em-platform="${c.platform}"${_}${g}><a href="${f}" target="_blank" draggable="false"><img src="${u}" width="${t}" height="${t}" border="0" alt="${m}" draggable="false" style="display:block;" /></a></td>`}).filter(Boolean).reduce((c,d,u)=>(u>0&&c.push(Ac(i)),c.push(d),c),[]).join("")}
764
764
  </tr>
765
765
  </table>
766
- </td></tr></table>`}var xc=gi(o.getDefaultSocialItems()),Pc=({__:e})=>`<style em="styles">
766
+ </td></tr></table>`}var Pc=yi(o.getDefaultSocialItems()),Rc=({__:e})=>`<style em="styles">
767
767
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
768
768
  .em-mob-width-100perc {
769
769
  width: 100%!important;
@@ -783,7 +783,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
783
783
  <div style="font-family: -apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 21px; color: #5A5A5A;">${e("Column")} 3</div>
784
784
  </td>
785
785
  </tr>
786
- </table>`,Rc="https://cdt3.emcdn.ru/rndt",yi=new Date(+new Date+432e6).toISOString(),_i=-new Date().getTimezoneOffset()/60,jc=e=>`${Rc}?locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${yi}&timezone=${_i}&frames=20`,Lc=e=>`<style em="styles">
786
+ </table>`,jc="https://cdt3.emcdn.ru/rndt",_i=new Date(+new Date+432e6).toISOString(),bi=-new Date().getTimezoneOffset()/60,Lc=e=>`${jc}?locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${_i}&timezone=${bi}&frames=20`,Oc=e=>`<style em="styles">
787
787
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
788
788
  .em-mob-width-100perc {
789
789
  width: 100%!important;
@@ -791,7 +791,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
791
791
  }
792
792
  }
793
793
  </style>
794
- <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td align="center"><img class="em-countdown" em-cd-settings="locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${yi}&timezone=${_i}&frames=20" src="${jc(e)}" border="0" alt="" style="display: block;" /></td></tr></table>`,Oc=`<style em="styles">
794
+ <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td align="center"><img class="em-countdown" em-cd-settings="locale=${e.replace("_","-")}&bg=FFFFFF&tp=false&color1=000000&color2=959595&size1=72&size2=28&font1=roboto&font2=roboto&border=10&delimiter=:&spacing=10&time=${_i}&timezone=${bi}&frames=20" src="${Lc(e)}" border="0" alt="" style="display: block;" /></td></tr></table>`,Mc=`<style em="styles">
795
795
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
796
796
  .em-mob-width-100perc {
797
797
  width: 100%!important;
@@ -801,7 +801,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
801
801
  </style>
802
802
  <table cellpadding="0" cellspacing="0" border="0" width="100%" class="em-mob-width-100perc" em="atom"><tr><td>
803
803
  <img class="em-video" src="${__emailmaker__.assetUrl("video.png")}" width="150" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;" />
804
- </td></tr></table>`,Mc=({__:e})=>`<style em="styles">
804
+ </td></tr></table>`,Nc=({__:e})=>`<style em="styles">
805
805
  @media only screen and (max-device-width:660px),only screen and (max-width:660px) {
806
806
  .em-mob-width-100perc {
807
807
  width: 100%!important;
@@ -815,7 +815,7 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
815
815
  <amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>
816
816
  <amp-img src="${e("https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png")}" width="800" height="600" layout="responsive" alt=""></amp-img>
817
817
  </amp-carousel>
818
- </td></tr></table>`,Nc=({__:e})=>`<style em="styles">
818
+ </td></tr></table>`,Dc=({__:e})=>`<style em="styles">
819
819
  amp-accordion > section > * {
820
820
  background: none !important;
821
821
  padding: 0 !important;
@@ -852,6 +852,6 @@ ${r}}`,n.appendChild(document.createTextNode(r));const i=t.querySelector('[data-
852
852
  </div>
853
853
  </section>
854
854
  </amp-accordion>
855
- </td></tr></table>`,Dc={image:"element_image","ai-image":"element_ai_image",text:"element_text",header:"element_heading",button:"element_button",spacer:"element_spacer","list-ul":"element_lists","list-ol":"element_lists",divider:"element_divider",social:"element_social",table:"element_table",countdown:"element_timer",video:"element_video","amp-carousel":"element_amp_carousel","amp-accordion":"element_amp_accordion","amp-form":"element_amp_form"};function bi(e){return Dc[e]??null}var vi=e=>Number(e)||void 0,Fc={colors:[],fonts:[],socials:[]},Yo=(e="entity")=>{const t=typeof globalThis<"u"?globalThis.crypto:void 0;if(t?.randomUUID)return t.randomUUID();const n=typeof performance<"u"?performance.now().toString(36).replace(".",""):String(Date.now());return`${e}-${Date.now().toString(36)}-${n}`},Bc=()=>Yo("soc"),Uc=/^[a-z][a-z0-9+.-]*:/i,Ei=e=>{const t=String(e??"").trim();return t?Uc.test(t)?t:`https://${t}`:""},$c=e=>{const t=Ei(e);if(!t)return!1;try{const n=new URL(t);return n.protocol==="https:"&&!!n.hostname}catch{return!1}},zc=e=>[...e].filter(t=>t.url.trim()!=="").sort((t,n)=>t.order-n.order),Gc=e=>zc(e).map(t=>({platform:t.icon_key,href:t.url,label:t.name,...t.icon_url?{iconSrc:t.icon_url}:{}})),Wc=/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,Hc=/^#?([0-9a-f]{6})$/i,Ko=e=>{if(!e)return null;const t=String(e).trim().toLowerCase(),n=Hc.exec(t);if(n)return`#${n[1]}`;const r=Wc.exec(t);if(r){const[,i,a,c]=r;return`#${i}${i}${a}${a}${c}${c}`}return null},Si=()=>Yo("bc"),qc=/\.(woff2|woff|ttf|otf)$/i,Vc=e=>{const t=qc.exec(e.trim().toLowerCase());return t?`.${t[1]}`:null},Yc={".woff":"application/x-font-woff",".woff2":"application/font-woff2",".ttf":"font/sfnt",".otf":"font/sfnt"},Kc={".woff":["application/x-font-woff","font/woff","application/font-woff"],".woff2":["application/font-woff2","font/woff2"],".ttf":["font/sfnt","application/font-sfnt","application/x-font-ttf","font/ttf","application/x-font-truetype"],".otf":["font/sfnt","application/font-sfnt","application/vnd.ms-opentype","application/x-font-opentype","font/otf","font/opentype"]},Qc=new Set(["","application/octet-stream","binary/octet-stream"]),Xc=e=>{const t=Vc(e.name);if(!t)return e;const n=e.type.trim().toLowerCase();return Kc[t].includes(n)||!Qc.has(n)?e:new File([e],e.name,{type:Yc[t],lastModified:e.lastModified})},Jc=()=>Yo("fnt"),Zc=e=>e.family?.trim()||e.name.trim(),ed=e=>e.filter(t=>t.source_url?.trim()).map(t=>({family:t.family?.trim()||t.name.trim(),source_url:t.source_url?.trim()??"",weight:t.weight?.trim()||"400",style:t.style??"normal"})),td=(e,t={})=>{const n=t.srcOverride?.trim()||e.source_url?.trim();if(!n||!t.srcOverride&&wi(e)||t.srcOverride&&o.isGoogleFontsCssUrl(n))return null;const r=t.familyOverride?.trim()||Zc(e),i=e.weight?.trim()||"400",a=e.style??"normal";return`@font-face{font-family:${JSON.stringify(r)};src:url(${JSON.stringify(n)});font-weight:${i};font-style:${a};font-display:swap;}`},nd=e=>e.source_kind?e.source_kind:o.isGoogleFontsCssUrl(e.source_url)?"google_stylesheet":e.file_name?.trim()?"uploaded":"remote_file",wi=e=>e.source_kind?e.source_kind==="google_stylesheet"||e.source_kind==="remote_stylesheet":o.isGoogleFontsCssUrl(e.source_url),ki="data-em-project-fonts-face",Ci="data-em-project-font-link",od=e=>{const t=e.filter(n=>wi(n)).map(n=>n.source_url?.trim()??"").filter(Boolean);return[...new Set(t)]},rd=e=>e.map(t=>td(t)).filter(t=>!!t).join(""),id=(e,t=document)=>{const n=rd(e),{head:r}=t;let i=r.querySelector(`style[${ki}]`);if(!n){i?.remove();return}i||(i=t.createElement("style"),i.setAttribute(ki,""),r.appendChild(i)),i.textContent=n},ad=(e,t=document)=>{const n=new Set(od(e)),{head:r}=t;r.querySelectorAll(`link[${Ci}]`).forEach(i=>{const a=i.getAttribute("href")??"";n.has(a)?n.delete(a):i.remove()}),n.forEach(i=>{const a=t.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("href",i),a.setAttribute(Ci,""),r.appendChild(a)})},sd=(e,t=document)=>{id(e,t),ad(e,t)},ld=new Set(["normal","italic","oblique"]),Kb="[emailmaker] projectStyles:",Wt=e=>{},bt=e=>typeof e=="string"?e.trim():"",Ti=e=>!e||e.startsWith("//")?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")?!0:e.toLowerCase().startsWith("https://"),cd=e=>o.isGoogleFontsCssUrl(e)?"google_stylesheet":(e.split(/[?#]/)[0]??"").toLowerCase().endsWith(".css")?"remote_stylesheet":"remote_file",Qo=(e,t,n)=>e.length<=t?e:(Wt(`${n} list is capped at ${t} entries, ${e.length-t} dropped`),e.slice(0,t)),dd=(e,t)=>{const n=Ko(e?.hex);if(!n){Wt(`colors[${t}] skipped: "${String(e?.hex)}" is not a hex color`);return}return{id:bt(e.id)||Si(),name:bt(e.name),hex:n,order:0}},ud=(e,t)=>{const n=bt(e?.family),r=bt(e?.source_url);if(!n){Wt(`fonts[${t}] skipped: family is required`);return}if(!r){Wt(`fonts[${t}] skipped: source_url is required`);return}if(!Ti(r)){Wt(`fonts[${t}] skipped: source_url must be https or relative, got "${r}"`);return}const i=bt(e.style);return{id:bt(e.id)||Jc(),name:bt(e.name)||n,family:n,source_url:r,source_kind:cd(r),weight:bt(e.weight)||"400",style:ld.has(i)?i:"normal",order:0}},md=(e,t)=>{const n=Ei(e?.url);if(!n||!$c(n)){Wt(`socials[${t}] skipped: url must be https, got "${String(e?.url)}"`);return}const r=bt(e.icon_key),i=bt(e.icon_url);let a;if(i&&Ti(i)?a=i:i&&Wt(`socials[${t}]: icon_url must be https or relative, got "${i}" — icon dropped`),!r&&!a){Wt(`socials[${t}] skipped: icon_key or icon_url is required`);return}return{id:bt(e.id)||Bc(),name:bt(e.name),url:n,icon_key:r,...a?{icon_url:a}:{},enabled:!0,order:0}},Xo=e=>e.map((t,n)=>({...t,order:n})),pd=e=>({colors:Xo(Qo(e?.colors??[],32,"colors").map(dd).filter(t=>t!==void 0)),fonts:Xo(Qo(e?.fonts??[],20,"fonts").map(ud).filter(t=>t!==void 0)),socials:Xo(Qo(e?.socials??[],20,"socials").map(md).filter(t=>t!==void 0))}),fd={tg:"telegram",yt:"youtube",yd:"yandex_zen",tt:"tiktok",pi:"pinterest",ig:"instagram",fb:"facebook",xa:"x",tw:"twitter"},Ii="vk",hd=new Set(o.EM_SOCIAL_SELECT_ORDER),gd=e=>hd.has(e),Ai=e=>{const t=String(e??"").trim().toLowerCase();return t?gd(t)?t:fd[t]??Ii:Ii},yd=e=>Ai(e),_d=new Set(["normal","italic","oblique"]),bd=new Set(["uploaded","remote_file","google_stylesheet"]),Pt=e=>(e??"").trim(),wn=e=>Pt(e)||void 0,xi=e=>typeof e=="number"&&e>0?e:void 0,vd=e=>_d.has(e)?e:void 0,Ed=e=>bd.has(e)?e:void 0,Sd=(e,t)=>{const n=Ko(Pt(e.hex));return n?{id:Pt(e.id)||Si(),name:Pt(e.name),hex:n,order:e.order??t}:null},Pi=(e,t=0)=>({id:Pt(e.id),name:Pt(e.name),source_url:wn(e.source_url),source_kind:Ed(e.source_kind),file_name:wn(e.file_name),family:wn(e.family),weight:wn(e.weight),style:vd(e.style),preview_url:wn(e.preview_url),storage_fallback:e.storage_fallback||void 0,font_size_px:xi(e.font_size_px),line_height_px:xi(e.line_height_px),order:e.order??t}),wd=(e,t)=>{const n=Pt(e.url);return n?{id:Pt(e.id),name:Pt(e.name),url:n,icon_key:Ai(Pt(e.icon_key)),enabled:e.enabled??!0,order:e.order??t}:null},on=e=>[...e].sort((t,n)=>t.order-n.order),Ri=e=>e?{colors:on((e.colors??[]).map(Sd).filter(t=>t!==null)),fonts:on((e.fonts??[]).map(Pi)),socials:on((e.socials??[]).map(wd).filter(t=>t!==null))}:Fc,kd=e=>e==="remote_stylesheet"?"remote_file":e,Cd=e=>{const t={};return e.colors&&(t.colors=on(e.colors).map(n=>({id:n.id,name:n.name.trim(),hex:Ko(n.hex)||n.hex}))),e.fonts&&(t.fonts=on(e.fonts).map(n=>({id:n.id,name:n.name.trim(),source_url:n.source_url??"",source_kind:kd(nd(n)),file_name:n.file_name??"",family:n.family??"",weight:n.weight??"",style:n.style??"",preview_url:n.preview_url??"",storage_fallback:n.storage_fallback??!1,font_size_px:n.font_size_px??0,line_height_px:n.line_height_px??0}))),e.socials&&(t.socials=on(e.socials).map(n=>({id:n.id,name:n.name.trim(),url:n.url,icon_key:yd(n.icon_key),enabled:n.enabled}))),t},ji="ProjectBrandStyles",Qt=o.createApi({reducerPath:"projectSettingsStylesApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[ji],endpoints:e=>({getProjectStyles:e.query({async queryFn({projectId:t},n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.stylesList({id:String(t)}));return"error"in r?{error:r.error}:{data:Ri(r.data)}},providesTags:(t,n,{projectId:r})=>[{type:ji,id:String(r)}]}),updateProjectStyles:e.mutation({async queryFn({projectId:t,patch:n},r){const i=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).projects.stylesPartialUpdate({id:String(t)},Cd(n)));return"error"in i?{error:i.error}:{data:Ri(i.data)}},async onQueryStarted({projectId:t,patch:n},{dispatch:r,queryFulfilled:i}){const a=r(Qt.util.updateQueryData("getProjectStyles",{projectId:t},c=>Object.assign(c,n)));try{const{data:c}=await i;r(Qt.util.upsertQueryData("getProjectStyles",{projectId:t},c))}catch{a.undo()}}}),uploadProjectFont:e.mutation({async queryFn({projectId:t,file:n},r){const i=new FormData;i.append("file",Xc(n));const a=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).request({path:`/projects/${String(t)}/styles/fonts`,method:"POST",body:i,secure:!0,type:o.ContentType.FormData,format:"json"}));return"error"in a?{error:a.error}:{data:Pi(a.data)}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;n(Qt.util.updateQueryData("getProjectStyles",{projectId:t},a=>{a.fonts=a.fonts.some(c=>c.id===i.id)?a.fonts.map(c=>c.id===i.id?i:c):[...a.fonts,i],a.fonts.sort((c,d)=>c.order-d.order)}))}catch{}}})})}),{useGetProjectStylesQuery:Td,useUpdateProjectStylesMutation:Qb,useUploadProjectFontMutation:Xb}=Qt,Li=e=>{const t=o.useIntegratorConfigValue("projectStyles"),{data:n}=Td({projectId:e},{skip:!0});return(0,l.useMemo)(()=>pd(t),[t])},Id=2.5,Ad=({atom:e,onSelect:t,onDragStart:n,isDroppedAtom:r})=>{const i=(0,l.useCallback)(d=>t(d,e),[t,e]),a=(0,l.useCallback)(d=>n(d,e,r),[n,e,r]),c=(0,l.useCallback)(d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t(d,e))},[t,e]);return(0,s.jsxs)("button",{type:"button",className:"ant-card-hoverable atoms__item "+e.className+(e.isLockedByPlan?" atoms__item_locked":""),draggable:!0,onClick:i,onKeyDown:c,onDragStart:a,"data-test-name":e.name,children:[(0,s.jsxs)("span",{className:"atom-image",children:[e.icon,e.isLockedByPlan&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:12,strokeWidth:Id,className:"atom-image__lock"})]}),(0,s.jsx)("span",{className:"atom-title",children:e.title})]})},Oi=()=>{const e=o.useI18n(),{__:t}=e,n=o.useAppConfig(),r=o.useProjectData(),i=o.useCurrentUserLocale()||"ru_RU",a=xt.useSetHtmlAtomInIframeHandler(),c=xt.useDragStartAtomToIframeHandler(),[d,u]=(0,l.useState)(!1),[m,f]=(0,l.useState)(0),h=o.useMessageService(),_=o.useServices(g.ATOMS_HANDLERS_ID),p=o.useEventEmitter(g.HANDLE_ATOM_INSERT_ID),S=o.usePlanFeatureLocks(),k=vi(r?.id),w=Li(k),v=w?Gc(w.socials):[],A=v.length>0?gi(v):xc;let x=[];if(n.elementImageEnabled&&x.push({title:t("Image"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementImage",component:y.icons$ElementImage,size:24,strokeWidth:n.iconStrokeWidth}),html:mc,className:"",name:"image"}),n.elementAIimageEnabled&&x.push({title:t("AI image"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementImageAI",component:y.icons$ElementImageAI,size:24,strokeWidth:n.iconStrokeWidth}),html:pc,className:"ai",name:"ai-image"}),n.elementTextEnabled&&x.push({title:t("Text"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementText",component:y.icons$ElementText,size:24,strokeWidth:n.iconStrokeWidth}),html:fc(e),className:"",name:"text"}),n.elementHeaderEnabled&&x.push({title:t("Header"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementTitle",component:y.icons$ElementTitle,size:24,strokeWidth:n.iconStrokeWidth}),html:hc(e),className:"",name:"header"}),n.elementButtonEnabled&&x.push({title:t("Button"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementButton",component:y.icons$ElementButton,size:24,strokeWidth:n.iconStrokeWidth}),html:gc(e),className:"",name:"button"}),n.elementSpacerEnabled&&x.push({title:t("Spacer"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementSpacer",component:y.icons$ElementSpacer,size:24,strokeWidth:n.iconStrokeWidth}),html:vc,className:"",name:"spacer"}),n.elementListULEnabled&&x.push({title:t("List UL"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementListUL",component:y.icons$ElementListUL,size:24,strokeWidth:n.iconStrokeWidth}),html:yc(e),className:"",name:"list-ul"}),n.elementListOLEnabled&&x.push({title:t("List OL"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementListOL",component:y.icons$ElementListOL,size:24,strokeWidth:n.iconStrokeWidth}),html:_c(e),className:"",name:"list-ol"}),n.elementDividerEnabled&&x.push({title:t("Divider"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementDivider",component:y.icons$ElementDivider,size:24,strokeWidth:n.iconStrokeWidth}),html:bc,className:"",name:"divider"}),n.elementSocialEnabled&&x.push({title:t("Social media"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementSocial",component:y.icons$ElementSocial,size:24,strokeWidth:n.iconStrokeWidth}),html:A,className:"",name:"social"}),n.elementTableEnabled&&x.push({title:t("Table"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementTable",component:y.icons$ElementTable,size:24,strokeWidth:n.iconStrokeWidth}),html:Pc(e),className:"",name:"table"}),n.elementCountdownEnabled&&x.push({title:t("Countdown"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementCountdown",component:y.icons$ElementCountdown,size:24,strokeWidth:n.iconStrokeWidth}),html:Lc(i),className:"",name:"countdown"}),n.elementVideoEnabled&&x.push({title:t("Video"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementVideo",component:y.icons$ElementVideo,size:24,strokeWidth:n.iconStrokeWidth}),html:Oc,className:"",name:"video"}),n.elementCarouselEnabled&&x.push({title:t("Carousel"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementCarousel",component:y.icons$ElementCarousel,size:24,strokeWidth:n.iconStrokeWidth}),html:Mc(e),className:"amp",name:"amp-carousel"}),n.elementAccordionEnabled&&x.push({title:t("Accordion"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementAccordion",component:y.icons$ElementAccordion,size:24,strokeWidth:n.iconStrokeWidth}),html:Nc(e),className:"amp",name:"amp-accordion"}),n.elementFormEnabled&&x.push({title:t("Form"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementForm",component:y.icons$ElementForm,size:24,strokeWidth:n.iconStrokeWidth}),html:null,className:"amp",name:"amp-form"}),x=x.map(I=>({...I,fallbackTooltip:t("Coming soon"),planFeature:bi(I.name),isLockedByPlan:S(bi(I.name))})),_){const I={value:x};for(const j of _)j.execute(I);x=I.value}(0,l.useEffect)(()=>{const{dispose:I}=h.addListener(o.EVENT_TYPES.APPLICATION_ATOM_INSERTED,j=>{const z=x.find(B=>B.name===j);z&&p.fire(z)});return()=>I()},[h,x,p]);const K=(0,l.useCallback)(I=>{u(!0),f(I.planFeature?o.FEATURE_UPSELL_SLIDE[I.planFeature]:1)},[]),Z=(0,l.useCallback)(I=>I.isLockedByPlan?(setTimeout(()=>K(I),1e3),!1):!0,[K]),M=(0,l.useCallback)((I,j)=>{if(j.isLockedByPlan){K(j);return}a(I,j)},[K,a]),L=(0,l.useCallback)((I,j,z)=>{c(I,j,z)},[c]);return(0,s.jsxs)("div",{className:"atoms",children:[(0,s.jsx)("div",{className:"atoms__list",children:(0,s.jsx)(y.ui_kit$Space,{wrap:!0,style:{justifyContent:"space-between",rowGap:10},children:x&&x.map((I,j)=>I.html?(0,s.jsx)(Ad,{atom:I,onSelect:M,onDragStart:L,isDroppedAtom:Z},I.title+j.toString()):(0,s.jsx)(y.ui_kit$Tooltip,{title:I.fallbackTooltip||t("Coming soon"),placement:"top",children:(0,s.jsxs)("div",{className:"atoms__item atoms__item_inactive "+I.className,"data-test-name":I.name,children:[(0,s.jsx)("span",{className:"atom-image",children:I.icon}),(0,s.jsx)("span",{className:"atom-title",children:I.title})]},I.title+j.toString())},I.title+j.toString()))})}),(0,s.jsx)(o.PlanUpgradePrompt,{open:d,onCancel:()=>u(!1),initialSlide:m})]})};Oi.propTypes={};var xd={full:{flexGrow:1},768:{width:171},425:{width:25},375:{width:28},320:{width:320}},Mi={right:-12,top:4,zIndex:999,padding:0,position:"absolute"},Pd=[{kind:"full",width:1200},{kind:"768",width:768},{kind:"425",width:425},{kind:"375",width:375},{kind:"320",width:320,showLabel:!0},{kind:"375",width:375},{kind:"425",width:425,control:"mobile"},{kind:"768",width:768,control:"desktop"},{kind:"full",width:1200}];function Rd({kind:e,width:t,label:n,onSelect:r,onHover:i,children:a}){const c=(0,l.useCallback)(()=>i(e,n),[i,e,n]),d=(0,l.useCallback)(()=>i(null,""),[i]),u=(0,l.useCallback)(()=>r(t),[r,t]),m=(0,l.useCallback)(f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),r(t))},[r,t]);return(0,s.jsx)("div",{className:`device-width__${e}`,style:xd[e],role:"button",tabIndex:0,"aria-label":n,onMouseEnter:c,onMouseLeave:d,onClick:u,onKeyDown:m,children:a})}function jd({onSelectWidth:e,themeToggle:t}){const{__:n}=o.useI18n(),[r,i]=(0,l.useState)(""),[a,c]=(0,l.useState)(""),d={full:n("Desktop"),768:n("Small desktop – 768px"),425:n("Mobile L – 425px"),375:n("Mobile M – 375px"),320:n("Mobile S – 320px")},u=(0,l.useCallback)((m,f)=>{i(m?`device-width__${m}-hovered`:""),c(f)},[]);return(0,s.jsx)("div",{className:`email-pane__sizes ${r}`,children:(0,s.jsxs)("div",{className:"email-pane__width-selectors-wrapper",children:[(0,s.jsx)("div",{className:"device-width__theme",children:t}),Pd.map((m,f)=>(0,s.jsxs)(Rd,{kind:m.kind,width:m.width,label:d[m.kind],onSelect:e,onHover:u,children:[m.showLabel?a:null,m.control==="mobile"&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Mobile view"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"MobileOutlined",component:y.icons$MobileOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Mi})}),m.control==="desktop"&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Desktop view"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"DesktopOutlined",component:y.icons$DesktopOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Mi})})]},`${m.kind}-${f}`)),(0,s.jsx)("div",{className:"device-width__theme-placeholder"})]})})}var $e=zt.__toESM(o.require_prop_types()),Ni=g.createIdentifier$1("canvas.resizerBinder"),Ld=g.createIdentifier$1("canvas.service"),Jb={created:o.PHASES.canvasCreated,loaded:o.PHASES.canvasLoaded};function Od(e){return e.getInstance(Ld)}function Di(e){return{undo:()=>e.undo(),redo:()=>e.redo(),clear:()=>e.clear(),canUndo:()=>e.canUndo(),canRedo:()=>e.canRedo(),createSnapshot:()=>e.createSnapshot(),restoreSnapshot:t=>{e.restoreSnapshot(t)},getPast:t=>e.getPast(t).map(n=>({changes:n})),getFuture:t=>e.getFuture(t).map(n=>({changes:n}))}}var Md={canUndo:!1,canRedo:!1},Nd={undo:()=>{},redo:()=>{},clear:()=>{},canUndo:()=>!1,canRedo:()=>!1,createSnapshot:()=>{},restoreSnapshot:()=>{},getPast:()=>[],getFuture:()=>[]};function Jo(e){const t=o.useDocumentSessionContext(),{history:n}=e??t;return(0,l.useMemo)(()=>n?Di(n):Nd,[n])}function Dd(){const{history:e}=o.useDocumentSessionContext(),t=(0,l.useCallback)(i=>e?e.subscribe(i):()=>{},[e]),n=(0,l.useRef)(null),r=(0,l.useCallback)(()=>{if(!e)return Md;const i={canUndo:e.canUndo(),canRedo:e.canRedo()},a=n.current;return a&&a.canUndo===i.canUndo&&a.canRedo===i.canRedo?a:(n.current=i,i)},[e]);return(0,l.useSyncExternalStore)(t,r)}var Fi=2e3,Fd=10,Bd="iframe_errors",Ud=5;function $d(e){const{__:t}=o.useI18n(),n=o.useMessageService(),r=Jo(),{error:i}=o.useNotification(),{document:a}=o.useDocumentSessionContext(),c=(0,l.useCallback)(()=>a?.getContent()??"",[a]),d=(0,l.useRef)(0),u=(0,l.useRef)(void 0),m=(0,l.useRef)(!1),f=o.useCurrentUser(),h=(0,l.useCallback)(p=>new Promise((S,k)=>{const w=n.addListener(o.EVENT_TYPES.SANDBOX_READY,()=>{w.dispose(),S()});p&&setTimeout(()=>{w.dispose(),k("timeout")})}),[n]),_=(0,l.useCallback)(p=>{h(Fi).catch(S=>{}).finally(()=>{Promise.resolve().then(()=>{if(!m.current){if(++d.current){if(u.current){if(d.current<Ud){r.restoreSnapshot(u.current);for(let S=0;S<d.current;S++)r.undo()}}else u.current=r.createSnapshot();n.send(o.EVENT_TYPES.RELOAD)}setTimeout(()=>{if(--d.current===0){u.current=null;const S=new Error(p.message);p.stack&&(S.stack=p.stack);const k=o.reportError(S,{origin:"iframe"}),w={past:r.getPast(Fd),future:r.getFuture(),errorResolved:!m.current,text:c(),message:p.message,stack:p.stack,userId:f?.id,entityId:e?.id,entityType:document.location.pathname.indexOf("emails")>0?"email":"block",sentryEventId:k};i({id:"IFRAME_ERROR",data:w,title:t("Something went wrong")}),g.RACS.post(Bd,w).catch(v=>{}),m.current=!1}},Fi)}})})},[r,c,i,f?.id,e?.id,t,h,n]);o.useListenPostMessage(o.EVENT_TYPES.APPLICATION_DOMPARSER_ERROR,_)}function zd(e,t){const n=JSON.stringify(t??{});Gd(e?.get().attributes.common_styles,n)||o.writeEmailAttributes(e,{common_styles:n})}function Gd(e,t){if(e===t)return!0;try{return g.deepEqual(JSON.parse(e||"{}"),JSON.parse(t||"{}"))}catch{return!1}}var Wn=Symbol("isIframeEvent");function Wd({children:e}){const[t,n]=(0,l.useState)(),[r,i]=(0,l.useState)(),[a,c]=(0,l.useState)(!1),d=o.useMessageService();return(0,l.useEffect)(()=>{if(t){const u=d.addListener(o.EVENT_TYPES.APPLICATION_IFRAME_DRAG_EVENT,m=>{if(m.type!=="drageleave"&&m.type!=="dragenter"){const f=t.getBoundingClientRect(),h=m.clientX+f.x+window.scrollX,_=m.clientY+f.y+window.scrollY,p=document.elementFromPoint(h,_);if(p){const S=new DataTransfer,k=new DragEvent(m.type,{clientX:h,clientY:_,cancelable:!0,bubbles:!0,dataTransfer:S});k[Wn]=!0,p.dispatchEvent(k)}}});return()=>u.dispose()}},[d,t]),(0,l.useEffect)(()=>{const u=f=>{f[Wn]||c(!0)},m=f=>{f[Wn]||c(!1)};return window.addEventListener("dragstart",u),window.addEventListener("dragend",m),()=>{window.removeEventListener("dragstart",u),window.removeEventListener("dragend",m)}},[r]),(0,l.useEffect)(()=>{const u=m=>{if(!m[Wn]){const f=r.getBoundingClientRect();d.send(o.EVENT_TYPES.SANDBOX_DRAG_EVENT,{value:m.dataTransfer?.getData("Text")||"",type:m.type,clientX:m.pageX-f.x-window.scrollX,clientY:m.pageY-f.y-window.scrollY})}};if(r)return r.addEventListener("dragenter",u),r.addEventListener("dragover",u),r.addEventListener("dragleave",u),r.addEventListener("drop",u),r.addEventListener("dragend",u),()=>{r.removeEventListener("dragenter",u),r.removeEventListener("dragover",u),r.removeEventListener("dragleave",u),r.removeEventListener("drop",u),r.removeEventListener("dragend",u)}},[r,d]),(0,s.jsxs)("div",{ref:n,children:[a&&(0,s.jsx)("div",{ref:i,className:"iframe-provider"}),e]})}var Hd=["colorBgBase","colorBgElevated","colorError","colorInfo","colorInfoBg","colorInfoBgHover","colorInfoBorder","colorInfoBorderHover","colorLink","colorPrimary","colorPrimaryBg","colorPrimaryBgHover","colorPrimaryBorder","colorPrimaryBorderHover"];function qd(e){const t={};for(const n of Hd){const r=e[n];typeof r=="string"&&(t[n]=r)}return t}function Zo(e,t){const n=o.useMessageService(),r=t?.async??!1;(0,l.useEffect)(()=>{const i=r?n.addListenerAsync(o.EVENT_TYPES.RELOAD,e):n.addListener(o.EVENT_TYPES.RELOAD,e);return()=>i.dispose()},[n,e,r]),(0,l.useEffect)(()=>{},[e])}function Vd(){const e=o.useMessageService(),{token:t}=(0,y.ui_kit$useToken)(),[n,r]=(0,l.useState)();(0,l.useEffect)(()=>{if(!g.deepEqual(n,t)){const a=e.onInit(()=>{e.send(o.EVENT_TYPES.SANDBOX_SET_THEME_VARIABLES,qd(t)),r(t)});return()=>a.dispose()}},[t,n,r,e]);const i=(0,l.useCallback)(()=>{r(void 0)},[]);Zo(i)}var Yd={minHeight:600},Kd="#pane-content-wrapper, .email-pane__col_preview, .preview-mode__pane-content";function Bi(e){e?.current?.resize?.()}var Ui=(0,l.forwardRef)(({className:e=null,email:t=null,handlerSendPosition:n=()=>{},surface:r,clip:i=null},a)=>{const c=o.useAppConfig(),d=o.useContainer(),u=r??(t?.hasOwnProperty("type")?"block":"email"),m=(0,l.useMemo)(()=>Od(d),[d]),f=(0,l.useMemo)(()=>m?.current(u),[m,u]),h=(0,l.useRef)(null),_=(0,l.useCallback)(()=>{o.mark(o.PHASES.canvasLoaded),Bi(a),n()},[n,a]);(0,l.useImperativeHandle)(a,()=>({getIframeElement:()=>m?.current(u)?.element,resize:()=>m?.current(u)?.resize()}),[m,u]),(0,l.useEffect)(()=>{if(!m)return;const w=h.current,v=i??w?.closest(Kd)??null;return m.alignSurface(u,w,v),()=>m.alignSurface(u,null)},[m,u,i,c.sidePanelFloating]);const p=(0,l.useRef)(_);p.current=_,(0,l.useEffect)(()=>{if(!f)return;let w=!1;const v=()=>{w||p.current({target:f.element})};return f.ready().then(v).catch(()=>{window.requestAnimationFrame(()=>{w||f.ready().then(v).catch(()=>{})})}),()=>{w=!0}},[f]),Vd(),$d(t);const{document:S}=o.useDocumentSessionContext();(0,l.useEffect)(()=>{const w=o.subscribeToContent(S,()=>{Bi(a)});return()=>w.dispose()},[S,a]);const k=(0,l.useCallback)(w=>{const{operation:v,settings:A}=w.data;v===o.EVENT_TYPES.APPLICATION_COMMON_STYLES_UPDATE&&zd(S,A?.commonStyles)},[S]);return o.useListenPostMessage(k),(0,s.jsx)(Wd,{children:(0,s.jsx)("div",{ref:h,className:(0,ot.default)("email-preview",e),id:"email_iframe_slot",style:Yd})})});Ui.propTypes={className:$e.default.string,surface:$e.default.oneOf(["email","block","preview"]),email:$e.default.shape({html:$e.default.string}),handlerSendPosition:$e.default.func,clip:$e.default.object};var er=new Map,Qd=new Map;function Xd(e,t){e.set(t,(e.get(t)??0)+1)}function Jd(e,t){const n=e.get(t)??0;n<=1?e.delete(t):e.set(t,n-1)}function $i(e,t){return(e.get(t)??0)>0}function Zd(e){return $i(er,e)||$i(Qd,e)}function eu(e){Xd(er,e);let t=!1;return{dispose(){t||(t=!0,tu(e))}}}function tu(e){Jd(er,e)}function nu(e,t){return ru([...e.changes].sort((n,r)=>n.rangeOffset-r.rangeOffset).map(n=>({start:n.rangeOffset,end:n.rangeOffset+n.rangeLength,text:n.text})),t)}function ou(e,t){return e.map(n=>{const r=t.getPositionAt(n.oldPosition),i=t.getPositionAt(n.oldEnd);return{text:n.newText,range:{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:i.lineNumber,endColumn:i.column}}})}function ru(e,t){let n=0;return e.map(({start:r,end:i,text:a})=>{const c=new o.TextChange(r,t.slice(r,i),r+n,a);return n+=a.length-(i-r),c})}var zi=new WeakMap;function iu(e){const t=zi.get(e);if(t)return t;const n=Dl(e);return zi.set(e,n),n}var Gi="monaco";function au(e,t){(0,l.useEffect)(()=>{if(!e||!t)return;const n=iu(e);let r=!1;const i=d=>{r=!0;const u=eu(t);try{d()}finally{u.dispose(),r=!1}},a=n.attach({id:Gi,apply(d){return t.getValue()!==d&&i(()=>t.setValue(d)),Promise.resolve()},applyChanges(d){return i(()=>t.applyEdits(ou(d,t))),Promise.resolve()}}),c=t.onDidChangeContent(d=>{if(r)return;const u=Zd(t)?"remote":"user";n.mutateFrom(Gi,{changes:nu(d,e.getContent())},{source:u})});return()=>{a.detach(),c.dispose()}},[e,t])}function su(e,t){const[n,r]=(0,l.useState)(void 0),i=(0,l.useRef)(!1),{error:a}=o.useNotification(),{__:c}=o.useI18n(),d=(0,l.useRef)(t);d.current=t;const u=(0,l.useRef)({error:a,__:c});u.current={error:a,__:c},(0,l.useEffect)(()=>{if(!e||n||i.current)return;i.current=!0;let f=!1;return d.current().then(h=>{if(f){h.dispose();return}r(h)}).catch(()=>{const{error:h,__:_}=u.current;h({id:"CODE_EDITOR_LOAD_FAILED",title:_("Failed to load the code editor")})}).finally(()=>{i.current=!1}),()=>{f=!0}},[e,n]);const m=(0,l.useRef)(void 0);return m.current=n,(0,l.useEffect)(()=>()=>{m.current?.dispose()},[]),n}var Hn;function tr(){return Hn===void 0&&(Hn=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/9bc03055.js")),void 0,{}.url).catch(e=>{throw Hn=void 0,e})),Hn}function lu(){return tr().then(e=>e.ensureMonaco())}var cu=o.lazyRoute(()=>tr().then(e=>({default:e.MonacoEditor}))),du=()=>tr().then(e=>e.loadEditorModel()),uu={height:"100%"};function mu(e){const t=su(!0,du),{document:n}=o.useDocumentSessionContext();return(0,l.useEffect)(()=>{},[]),(0,l.useEffect)(()=>{},[t]),au(n,t),(0,s.jsx)(o.EditorModelContext.Provider,{value:t,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$Flex,{justify:"center",align:"center",style:uu,children:(0,s.jsx)(y.ui_kit$Spin,{size:"large"})}),children:(0,s.jsx)(cu,{...e})})})}var pu=({elementPath:e})=>{const{_x:t}=o.useI18n(),n=o.useDispatch(),r=o.useMessageService(),i=o.useAppConfig(),{blockId:a}=o.useRouteParams(),c=o.useEditorProjectId(),d=o.useRouteEmailId(),u=o.useProjectData(),m=o.usePushToDataLayer(),f=(0,l.useCallback)(A=>{r.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_SET,index:A})},[r]),h=(0,l.useCallback)(A=>{let x="element";A?.target?.closest("svg")||A?.target?.closest(".anticon")||A?.target?.closest('[class*="icon"]')?x="icon":A?.target?.textContent&&!A?.target?.closest("svg")&&!A?.target?.closest(".anticon")&&(x="text"),n(o.setActiveSettingsTab(o.STYLES)),r.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),r.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),m({event:"click",action:"click_breadcrumb_email",email_id:d||a,project_id:u?.id||c,click_target:x})},[r,n,m,d,a,c,u]),_={title:(0,s.jsxs)("span",{onClick:h,children:[(0,s.jsx)(o.EmIcons,{icon:"Email",component:y.icons$Email,size:16,strokeWidth:i.iconStrokeWidth})," ",t("Email","letter")]})},[p,S]=(0,l.useState)([_]),k=(0,l.useCallback)(A=>{r.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_HOVER_SET,index:A})},[r]),w=A=>{if(A.includes("em-element-path-item-text"))return(0,s.jsx)(o.EmIcons,{icon:"ElementText",component:y.icons$ElementText,size:16,strokeWidth:i.iconStrokeWidth});if(A.includes("em-element-path-item-image"))return(0,s.jsx)(o.EmIcons,{icon:"ElementImage",component:y.icons$ElementImage,size:16,strokeWidth:i.iconStrokeWidth});if(A.includes("em-element-path-item-link"))return(0,s.jsx)(o.EmIcons,{icon:"LinkOutlined",component:y.icons$LinkOutlined,size:16,strokeWidth:i.iconStrokeWidth});if(A.includes("em-element-path-item-atom"))return(0,s.jsx)(o.EmIcons,{icon:"Atom",component:y.icons$Atom,size:16,strokeWidth:i.iconStrokeWidth});if(A.includes("em-element-path-item-column"))return(0,s.jsx)(o.EmIcons,{icon:"Column",component:y.icons$Column,size:16,strokeWidth:i.iconStrokeWidth});if(A.includes("em-element-path-item-block"))return(0,s.jsx)(o.EmIcons,{icon:"Block",component:y.icons$Block,size:16,strokeWidth:i.iconStrokeWidth});if(A.includes("em-element-path-item-group"))return(0,s.jsx)(o.EmIcons,{icon:"Group",component:y.icons$Group,size:16,strokeWidth:i.iconStrokeWidth});if(A.includes("em-element-path-item-button"))return(0,s.jsx)(o.EmIcons,{icon:"ElementButton",component:y.icons$ElementButton,size:16,strokeWidth:i.iconStrokeWidth});if(A.includes("em-element-path-item-table"))return(0,s.jsx)(o.EmIcons,{icon:"ElementTable",component:y.icons$ElementTable,size:16,strokeWidth:i.iconStrokeWidth});if(A.includes("em-element-path-item-amp"))return(0,s.jsx)(o.EmIcons,{icon:"AMP",component:y.icons$AMP,size:16,strokeWidth:i.iconStrokeWidth})},v=(0,l.useCallback)((A,x)=>{const K=Z=>{let M="element";Z.target.closest("svg")||Z.target.closest(".anticon")||Z.target.closest('[class*="icon"]')?M="icon":Z.target.textContent&&!Z.target.closest("svg")&&!Z.target.closest(".anticon")&&(M="text");const L=e?.[x],I=L?.className?.replace("em-element-path-item-","")||"unknown";m({event:"click",action:"click_breadcrumb_element",email_id:d||a,project_id:u?.id||c,element_type:I,element_index:x,element_title:L?.title||"",click_target:M}),f(x)};return(0,s.jsxs)("span",{className:A.className,onClick:K,onMouseOver:()=>{k(x)},children:[w(A.className)," ",A.title]})},[f,k,e,m,d,a,c,u]);return(0,l.useEffect)(()=>{if(e){const A=e.map((x,K)=>({title:v(x,K)}));S([{title:(0,s.jsxs)("span",{onClick:h,children:[(0,s.jsx)(o.EmIcons,{icon:"Email",component:y.icons$Email,size:16,strokeWidth:i.iconStrokeWidth})," ",t("Email","letter")]})},...A])}},[e,v,h,t]),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(y.ui_kit$Breadcrumb,{items:p,type:"separator",separator:""})})};function fu(){const{document:e}=o.useDocumentSessionContext(),t=(0,l.useCallback)(r=>e?e.subscribe(r):()=>{},[e]),n=(0,l.useCallback)(()=>e?.getContent()??"",[e]);return(0,l.useSyncExternalStore)(t,n)}var hu=({fallbackHtml:e})=>{const{__:t}=o.useI18n(),n=fu(),r=(0,l.useMemo)(()=>o.getCodeSize(n||e||""),[e,n]),i=o.formatCodeSize(r),a=o.isCodeSizeExceeded(r);return(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:t(a?"The code size exceeds the recommended value 90kB":"Code size"),children:(0,s.jsx)("span",{className:(0,ot.default)("email-pane__code-size",{"email-pane__code-size_exceeded":a}),children:i})})};function Wi(e){const{limits:t,isLoaded:n}=o.useProjectPlanLimits();return o.useProjectData(),(0,l.useMemo)(()=>({isLocked:!1,state:{state:"allowed"},isPlanDataReady:n,exceeded:null}),[!1,e,t,n])}var gu=({open:e,onClose:t})=>{const{__:n}=o.useI18n();return(0,s.jsxs)(y.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:{closable:!1},footer:null,width:520,className:"browser-extension-warning-modal",title:n("Browser extension detected"),onCancel:t,children:[(0,s.jsx)("p",{children:n("A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.")}),(0,s.jsx)("p",{children:n("We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.")}),(0,s.jsx)("div",{className:"browser-extension-warning-modal__footer",children:(0,s.jsxs)(y.ui_kit$Button,{type:"primary",onClick:t,children:[n("Got it")," "]})})]})},yu={closable:!1},_u=({open:e,onClose:t})=>{const{__:n}=o.useI18n();return(0,s.jsxs)(y.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:yu,footer:null,width:520,className:"browser-translate-warning-modal",title:n("Browser translation detected"),children:[(0,s.jsx)("p",{children:n("Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.")}),(0,s.jsx)("p",{children:n("To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.")}),(0,s.jsx)("div",{className:"browser-translate-warning-modal__footer",children:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:t,children:n("Got it")})})]})},bu=g.createIdentifier$1("prewarm.editorVisible");function vu(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Eu(e={}){const t=e.paint??vu;let n=!1,r=!1,i=!1,a=!1,c=!1;const d=[],u=()=>{c||a||!n||!r||!i||(a=!0,t(()=>{c=!0,o.mark(o.PHASES.editorVisible);for(const m of d.splice(0))m()}))};return{noteShellVisible(){n=!0,u()},notePagePainted(){r=!0,u()},noteContentShown(){i=!0,u()},whenVisible(m){if(c){m();return}d.push(m)},contentShown:()=>i}}function Ht(e){return e.getOrCreateInstance(bu,()=>Eu())}function kn(e){const t=(0,l.useRef)(!1);return e&&(t.current=!0),t.current}var Hi=4e3;function Xt(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:Hi});return}window.setTimeout(e,Hi)}var qn,nr;function or(){return qn===void 0&&(qn=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/ad7afbf4.js")).then(e=>e.panels_exports).then(e=>(nr=e,e),e=>{throw qn=void 0,e}),void 0,{}.url)),qn}function Su(e){(0,l.useEffect)(()=>{Ht(e).whenVisible(()=>{Xt(()=>{or().catch(()=>{})})})},[e])}function ut(e){const t=o.lazyRoute(()=>or().then(r=>({default:r[e]})),"panels");function n(r){const[i]=(0,l.useState)(()=>nr?nr[e]:t);return(0,l.createElement)(i,r)}return n.displayName=`PanelDoor(${String(e)})`,n}var qi=ut("EmailProperties"),wu=ut("SelectedElementPanel"),ku=ut("EmailSettings"),Cu=ut("EmailStyles"),Tu=ut("DiscussAi"),Iu=ut("Optimise"),Au=ut("FileManagerDataLayer"),xu=ut("BlocksSearch"),Pu=ut("Discuss"),Ru=ut("HistoryPanel"),ju=ut("AddNewBlockModal"),Lu=ut("AddAllBlocksModal"),Ou=ut("SendTestEmailModal"),Mu=ut("SaveBlockBtn"),rr=ut("LimitUpgradeModal"),Nu={height:"100%"},Du=()=>{const e=o.useContainer(),t=o.isImageCenterModal(o.useSelector(o.selectActiveModal$1)),[n,r]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{e&&Ht(e).whenVisible(()=>r(!0))},[e]),kn(n||t)?(0,s.jsx)(l.Suspense,{fallback:t?(0,s.jsx)(y.ui_kit$PageLoader,{style:Nu}):null,children:(0,s.jsx)(Au,{})}):null},Vn;function Fu(){return Vn===void 0&&(Vn=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/49caf02a.js")),void 0,{}.url).catch(e=>{throw Vn=void 0,e})),Vn}function Cn(e){return o.lazyRoute(()=>Fu().then(t=>({default:t[e]})),"form-panels")}var Zb=Cn("FormEditorCalendarPanel"),ev=Cn("FormEditorCheckboxPanel"),tv=Cn("FormEditorDropdownListPanel"),nv=Cn("FormEditorInputPanel"),ov=Cn("FormEditorRadioPanel");function Bu(){try{const e=new URLSearchParams(window.location.search).get("deferChrome");return e===null?void 0:e!=="0"&&e!=="false"}catch{return}}function Uu(e,t){const n=Bu()??o.readLocalToggle(o.LOCAL_STORAGE_ITEMS.em_defer_chrome);if(n!==void 0)return n;const r=t?.deferEditorChrome;return typeof r=="boolean"?r:r&&typeof r=="object"?r[e]??!0:{}.REACT_APP_DEFER_EDITOR_CHROME_DEFAULT!=="false"}function Vi(e){const t=o.useAppConfig(),[n,r]=(0,l.useState)(()=>!Uu(e,t));return(0,l.useEffect)(()=>{if(n)return;let i=0;const a=window.requestAnimationFrame(()=>{i=window.requestAnimationFrame(()=>(0,l.startTransition)(()=>r(!0)))});return()=>{window.cancelAnimationFrame(a),window.cancelAnimationFrame(i)}},[n]),n}var Yi=o.createState({blocksTotal:null,blocksTotalPages:null,parentEmailBlocksTotal:null,parentEmailBlocksTotalPages:null,templateBlocks:[],templateBlocksTotal:null,templateBlocksTotalPages:null,elementsView:o.CARDS,elementsList:[],customFolders:{},blocksTrashTotal:0,elementsTrashList:[]}),Yn="blocksPageSlice",ir=o.createSlice({name:Yn,initialState:Yi,reducers:{resetPagesAndTotal:()=>Yi,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeBlockFromList:(e,{payload:t})=>{const n=e.customFolders;t.folder!=="all"&&n[t.folder]?.list&&(n[t.folder]={...n[t.folder],list:n[t.folder].list.filter(r=>r.id!==t.emailId),total:n[t.folder].total-1},e.customFolders=n)}},extraReducers:e=>{e.addMatcher(o.blocksApi.endpoints.getBlocks.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||r?.length,a=n.arg.originalArgs?.status==="trash",c=!!n.arg.originalArgs?.name?.length,d=n.arg.originalArgs?.page,u=n.arg.originalArgs?.folderTag||n.arg.originalArgs?.tags?.[0];a?(c||(t.blocksTrashTotal=i),t.elementsTrashList=r):u?t.customFolders={...t.customFolders,[u]:{list:r,page:d,total:i}}:(t.blocksTotal=i,t.elementsList=r)}),e.addMatcher(o.blocksApi.endpoints.getParentEmailBlocks.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||r?.length||null,a=n.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.parentEmailBlocksTotal=i,t.parentEmailBlocksTotalPages=a}),e.addMatcher(o.blocksApi.endpoints.getTemplateBlocks.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||r?.length||null,a=n.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.templateBlocks=r,t.templateBlocksTotal=i,t.templateBlocksTotalPages=a}),e.addMatcher(o.blocksApi.endpoints.editBlock.matchFulfilled,(t,{payload:n})=>{t.elementsList.map(r=>r.id?.toString()===n.id?.toString()?Object.assign(r,{lock:n.lock,title:n.title,blocktags:n.blocktags}):r)})}}),{resetPagesAndTotal:rv,resetElementsList:iv,toggleElementsView:av,removeBlockFromList:sv}=ir.actions,$u=e=>e[Yn].blocksTotal,zu=e=>e[Yn].templateBlocksTotal,Gu=e=>e[Yn].parentEmailBlocksTotal,Wu=class extends Error{label;timeoutMs;constructor(e){super(`[sandbox:ready] iframe handshake timed out after ${e}ms`),this.name="SandboxReadyTimeoutError",this.label="sandbox:ready",this.timeoutMs=e}};function Ki(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.isInited=="function"&&typeof t.getTarget=="function"&&typeof t.onInit=="function"}function Qi(e,t,n){return e.isInited()&&e.getTarget()?Promise.resolve():(g.throwIfAborted(n),new Promise((r,i)=>{let a=!1,c,d;const u=f=>{a||(a=!0,c!==void 0&&(clearTimeout(c),c=void 0),d?.dispose(),n?.removeEventListener("abort",m),f())},m=()=>{u(()=>i(g.createAbortError(n?.reason)))};if(d=e.onInit(()=>{e.isInited()&&e.getTarget()&&u(()=>r())}),e.isInited()&&e.getTarget()){u(()=>r());return}t>0&&(c=setTimeout(()=>{u(()=>i(new Wu(t)))},t)),n?.addEventListener("abort",m)}))}var Hu=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Tn=(e,t)=>{Hu()},qu=e=>[...e].sort((t,n)=>t.order-n.order).map(t=>t.hex.toUpperCase()),Vu=(e,t)=>{const n=Array.isArray(e?.usedColors)?e.usedColors:[],r=new Set,i=[];for(const a of[...n,...qu(t)]){const c=String(a??"").trim().toUpperCase();!c||r.has(c)||(r.add(c),i.push(a))}return{...e,usedColors:i}},Xi,Yu=e=>{Xi=e},Kn=e=>Vu(e,Xi?.colors??[]),Ku=e=>{const t=o.useMessageService(),n=Li(e),[r,i]=(0,l.useState)("");(0,l.useEffect)(()=>{Yu(n);const c=n?.fonts??[];o.setCachedProjectFonts(c),sd(c),Tn("parent: cache + host @font-face synced",{projectId:e,fontsCount:c.length,families:c.map(d=>d.family?.trim()||d.name)})},[n,e]),(0,l.useEffect)(()=>{const c=n?.fonts??[],d=ed(c),u=JSON.stringify(d);if(u===r){Tn("parent: iframe send skipped (unchanged)",{entriesCount:d.length});return}Tn("parent: scheduling SANDBOX_SET_PROJECT_FONTS",{entriesCount:d.length,entries:d});const m=()=>{t.send(o.EVENT_TYPES.SANDBOX_SET_PROJECT_FONTS,d),i(u),Tn("parent: SANDBOX_SET_PROJECT_FONTS sent",{entriesCount:d.length})};if(t.inited){m();return}const f=t.onInit(()=>{m()});return()=>f.dispose()},[t,n,r]);const a=(0,l.useCallback)(()=>{Tn("parent: iframe reload — will resend project fonts map"),i("")},[]);Zo(a)};function Qu(e,t){const n=e,r=n?.data?.operation!==void 0?n.data:n;if(r?.operation===t)return r.file instanceof File?r.file:void 0}async function Xu(e,t){const{userId:n,folderId:r}=t.readContext();if(n==null||r==null||r==="")return{status:"skipped"};try{const i=await t.prepare(e),a=await t.upload({user_id:n,folder:String(r),file:i});if(a.error)return{status:"failed",error:a.error};const{extractUploadResult:c}=await(0,Ye.__vitePreload)(async()=>{const{extractUploadResult:u}=await Promise.resolve().then(()=>be("./static/core/de7377ec.js")).then(m=>m.import_exports);return{extractUploadResult:u}},void 0,{}.url),d=c(a.data);return d.error||!d.file_url?{status:"skipped"}:{status:"uploaded",url:d.file_url}}catch(i){return{status:"failed",error:i}}}function Ju(){const[e,t]=(0,l.useState)(!1),n=o.useHeadless(),r=o.useEventEmitter(g.events.ON_BROWSER_EXTENSION_DETECTED_ID),i=(0,l.useCallback)(()=>{t(!1)},[]);return(0,l.useEffect)(()=>{const a=r.event(()=>{n||t(!0)});return()=>a.dispose()},[r,n]),{open:e,close:i}}function Zu(){const[e,t]=(0,l.useState)(!1),n=o.useHeadless(),r=o.useEventEmitter(g.events.ON_BROWSER_TRANSLATE_DETECTED_ID),i=(0,l.useCallback)(()=>{t(!1)},[]);return(0,l.useEffect)(()=>{const a=r.event(()=>{n||t(!0)});return()=>a.dispose()},[r,n]),{open:e,close:i}}var em=["translated-ltr","translated-rtl"],tm=".goog-te-banner-frame",ar=!1;function nm(e){if(e)return e;if(!(typeof document>"u"))return document}function om(e){const t=nm(e);if(!t?.documentElement)return!1;const n=t.documentElement.classList;return em.some(r=>n.contains(r))?!0:t.querySelector(tm)!=null}function rm(){ar=!1}function im(e){const t=om();return t&&!ar&&e(),ar=t,t}var am=500;function sm(){const e=o.useEventEmitter(g.events.ON_BROWSER_TRANSLATE_DETECTED_ID),t=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(typeof window>"u")return;const n=()=>{im(()=>{e.fire()})},r=()=>{t.current!=null&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,n()},am)};n();const i=()=>{r()},a=()=>{document.visibilityState==="visible"&&r()},c=new MutationObserver(()=>{r()});return c.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("focus",i),document.addEventListener("visibilitychange",a),()=>{t.current!=null&&clearTimeout(t.current),rm(),c.disconnect(),window.removeEventListener("focus",i),document.removeEventListener("visibilitychange",a)}},[e])}var sr={},Ji=(0,l.createContext)(sr),Zi=(0,l.createContext)({current:sr}),ea=(0,l.createContext)(()=>{});function lm({children:e}){const t=o.useDispatch(),n=o.useSelector(o.selectActiveSettingsTab),r=o.useEvent(g.SETTINGS_PANEL_EVENT),[i,a]=(0,l.useState)(sr),c=(0,l.useRef)(i);return c.current=i,(0,l.useEffect)(()=>{const d=r(u=>{const m=u?.type===g.ADVANCED_SETTINGS_PANEL;if((!u||!u.type&&!u.content&&!u.advancedTabs?.length)&&n==="Properties")a({}),t(o.resetToLastActiveSettingsTab());else if(n!=="Properties"&&t(o.setActiveSettingsTab(o.PROPERTIES)),u.advancedTabs?.length&&!m&&!u.content){const f=u.advancedTabs.map(h=>({content:h.content,label:h.label,key:h.key,className:h.className}));a(h=>({settings:{},extraTabs:f}))}else if(m&&u.content){const f=u.advancedTabs?.map(h=>({content:h.content,label:h.label,key:h.key,className:h.className}));a(h=>({settings:{},type:u.type,content:u.content,instanceKey:u.instanceKey,parent:u.parent,caption:u.caption,extraTabs:f,deletable:u.deletable}))}});return()=>d.dispose()},[r,a,t,n]),(0,s.jsx)(ea.Provider,{value:a,children:(0,s.jsx)(Zi.Provider,{value:c,children:(0,s.jsx)(Ji.Provider,{value:i,children:e})})})}function lr(){return(0,l.useContext)(Ji)}function cm(){return(0,l.useContext)(Zi)}function dm(){return(0,l.useContext)(ea)}var ta={widthCodeSplit:50,isResizing:!1,currentSide:null},na=(0,l.createContext)({current:ta}),oa=(0,l.createContext)(ta.widthCodeSplit),ra=(0,l.createContext)({isResizing:!1,currentSide:null}),ia=(0,l.createContext)({setWidthCodeSplit:()=>{},setIsResizing:()=>{},setCurrentSide:()=>{},setBlockMaxHeight:()=>{}}),aa=(0,l.createContext)("unset");function um({children:e}){const[t,n]=(0,l.useState)(()=>+window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_code_mode_pane_sizes)||50),[r,i]=(0,l.useState)(!1),[a,c]=(0,l.useState)(null),[d,u]=(0,l.useState)("unset"),m=(0,l.useMemo)(()=>({widthCodeSplit:t,isResizing:r,currentSide:a}),[t,r,a]),f=(0,l.useMemo)(()=>({isResizing:r,currentSide:a}),[r,a]),h=(0,l.useRef)(m);h.current=m;const _=(0,l.useMemo)(()=>({setWidthCodeSplit:n,setIsResizing:i,setCurrentSide:c,setBlockMaxHeight:u}),[]);return(0,s.jsx)(ia.Provider,{value:_,children:(0,s.jsx)(na.Provider,{value:h,children:(0,s.jsx)(ra.Provider,{value:f,children:(0,s.jsx)(oa.Provider,{value:t,children:(0,s.jsx)(aa.Provider,{value:d,children:e})})})})})}function sa(){return(0,l.useContext)(ra)}function la(){return(0,l.useContext)(oa)}function mm(){return(0,l.useContext)(na)}function pm(){return(0,l.useContext)(aa)}function fm(){return(0,l.useContext)(ia)}var ca=(0,l.createContext)({previewAlertShow:!1,templateNotEmAlertShow:!1}),da=(0,l.createContext)({setPreviewAlertShow:()=>{},setTemplateNotEmAlertShow:()=>{}});function hm({children:e}){const[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)(!1),a=(0,l.useMemo)(()=>({previewAlertShow:t,templateNotEmAlertShow:r}),[t,r]),c=(0,l.useMemo)(()=>({setPreviewAlertShow:n,setTemplateNotEmAlertShow:i}),[]);return(0,s.jsx)(da.Provider,{value:c,children:(0,s.jsx)(ca.Provider,{value:a,children:e})})}function gm(){return(0,l.useContext)(ca)}function ym(){return(0,l.useContext)(da)}function _m({className:e,sidePanelFloating:t,isCodeMode:n,codeModeDirection:r,children:i}){const a=pm(),c=(0,l.useMemo)(()=>{const d=Number.isFinite(a)?`${a}px`:"unset";return{"--em-pane-block-height":t?n&&r==="bottom"?d:"calc(100% - 30px)":"100%"}},[t,n,r,a]);return(0,s.jsx)(y.ui_kit$Layout,{className:e,style:c,children:i})}function bm({maxPaneWidth:e,isCodeMode:t,codeModeDirection:n,isShowMobileSettings:r,desktopMobileSwitchPanel:i,children:a}){const c=o.useSelector(o.selectEmailWidth),{isResizing:d,currentSide:u}=sa(),m=t&&n!=="bottom"&&!r&&i?"100%":c,f=(0,l.useMemo)(()=>({maxWidth:typeof m=="number"?Math.min(m,e):e}),[m,e]);return(0,s.jsx)("div",{className:(0,ot.default)("email-pane__resizable",{"email-pane__resizable_drag":u||d}),style:f,children:a})}function vm({isCodeMode:e,codeModeDirection:t,sidePanelFloating:n,contentWrapperRef:r,children:i}){const a=la(),c=(0,l.useMemo)(()=>({flexGrow:1,overflowY:n?"scroll":"hidden",overflowX:"hidden",height:e&&t==="bottom"?`calc(${a}%)`:"100%",width:`${t==="left"?100-a:t==="bottom"?100:a}%`}),[e,t,n,a]);return(0,s.jsx)(y.ui_kit$Col,{style:c,id:"pane-content-wrapper",ref:r,children:i})}function Em({isCodeMode:e,codeModeDirection:t,children:n}){const r=la(),i=(0,l.useMemo)(()=>({width:`${t==="right"?100-r:t==="bottom"?100:r}%`,position:"relative",height:t==="bottom"?`calc(${100-r}%)`:"unset",display:e?"initial":"none"}),[e,t,r]);return(0,s.jsx)(y.ui_kit$Col,{style:i,children:n})}function Sm({wrapperRef:e,children:t}){const{isResizing:n,currentSide:r}=sa();return(0,s.jsx)("div",{className:(0,ot.default)("email-pane__content-col email-pane__content-col_main",{"email-pane__content-col_disable":r||n}),ref:e,children:t})}function wm({isShowMobileSettings:e,headless:t,templateNotEmAlertEnabled:n}){const{__:r}=o.useI18n(),{previewAlertShow:i,templateNotEmAlertShow:a}=gm();return(0,s.jsxs)(s.Fragment,{children:[i&&e&&(0,s.jsx)(y.ui_kit$Alert,{title:r("Template is not mobile-friendly"),description:r("While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices."),type:"warning",className:"email-pane__col__alert",closable:!0}),a&&!t&&n&&(0,s.jsx)(y.ui_kit$Alert,{title:r("Template from another editor"),description:r("This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control."),type:"warning",className:"email-pane__col__alert",closable:!0})]})}function ua(){const e=o.useElementEntityKind(),t=o.useSelector(o.selectElementSettings$1),n=o.useSelector(o.selectElementSettings);return e==="email"?t:n}function km({isShowMobileSettings:e,propertiesPanelKey:t,onMouseLeave:n,email:r,onClosePanel:i}){const a=ua(),c=lr();return a?.type||c?.type||c?.content||c?.extraTabs?.length?(0,s.jsx)("div",{className:(0,ot.default)("email-pane__collapse-wrapper",{"mobile-view":e,"mobile-properties":e&&t!=="Structure"}),onMouseLeave:n,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(qi,{email:r,formSettings:c,onClosePanel:i})})}):null}function Cm({className:e,emailElementType:t}){return(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(wu,{className:e,emailElementType:t,formSettings:lr()})})}function Tm({isCodeMode:e,codeModeDirection:t}){const n=o.useElementEntityKind(),r=ua()?.type;return!(r===o.ELEMENT_TYPES.TEXT||r===o.ELEMENT_TYPES.LINK||r===o.ELEMENT_TYPES.IMG||r===o.ELEMENT_TYPES.BUTTON)||!e||t==="bottom"?null:(0,s.jsx)(Cm,{className:(0,ot.default)("selected-element-panel__content selected-element-panel__content_abs",{"selected-element-panel__hidden":r===o.ELEMENT_TYPES.IMG}),emailElementType:n})}function Im({isCodeMode:e,codeModeDirection:t,email:n,onClosePanel:r}){const i=lr();return i?.type!=="img"||!e||t==="bottom"?null:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper email-pane__collapse-wrapper_disabled",children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(qi,{email:n,formSettings:i,onClosePanel:r})})})}var Am="code",xm=(e,t)=>(0,s.jsx)(t,{className:"email-pane__tab-bar",...e}),{Content:Pm}=y.ui_kit$Layout,Rm=()=>{or().catch(()=>{})},Jt=e=>(0,l.memo)(t=>(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(e,{...t})})),jm=Jt(Tu),Lm=Jt(Cu),Om=Jt(Iu),Mm=Jt(xu),Nm=(0,l.memo)(e=>(0,s.jsx)(mu,{...e})),Dm=(0,l.memo)((0,l.forwardRef)((e,t)=>(0,s.jsx)(Ui,{...e,ref:t}))),Fm=(0,l.memo)(e=>(0,s.jsx)(Oi,{...e})),Bm=Jt(ku),Um=Jt(Ru),$m=Jt(Pu),ma=({emailElement:e,isSuccess:t,setIsCollaborationEditor:n,isShowAddAllBlocksModal:r,triggerOpenSavedBlocksTab:i,setIsShowAddAllBlocksModal:a})=>{const{__:d,_x:u}=o.useI18n(),m=o.useMessageService(),{blockId:f}=o.useRouteParams(),h=o.useEditorProjectId(),_=o.useRouteEmailId(),p=o.useDispatch(),S=Vo(),k=o.useOpenPlanCatalog(),{modal:w}=y.ui_kit$App.useApp(),v=o.useAppConfig(),A=o.useConfigSource(),x=o.useHeadless(),K=o.useContainer(),Z=Vi("panel");Su(K),(0,l.useEffect)(()=>{Ht(K).notePagePainted()},[K]);const{token:M}=(0,y.ui_kit$useToken)(),L=o.useNotification(),I=o.usePushToDataLayer(),j=o.useProjectData(),z=vi(j?.id||h);Ku(z);const B=o.useCookieManager(),$=o.useSelector(o.selectActiveSettingsTab),de=o.useCurrentUser(),pe=o.toLanguageCode(o.useInterfaceLocale()),q=o.useStore(),ee=mm(),{setWidthCodeSplit:Fe,setIsResizing:ve,setCurrentSide:et,setBlockMaxHeight:Ee}=fm(),fe=o.useSelector(o.selectActiveModal$1),Q=o.useSelector(o.selectIsCodeMode),me=o.useSelector(o.selectCodeModeDirection),[ae,se]=(0,l.useState)(Q);(0,l.useEffect)(()=>{Q&&se(!0)},[Q]);const Ie=o.useSelector($u),Ce=o.useSelector(zu),Be=o.useSelector(Gu),J=o.useSelector(o.selectPropertiesPanelKey),[ye]=o.useLazyClearAiChatQuery(),[Te]=o.useUploadImageMutation(),he=o.useSelector(o.selectEmailViewType)===o.MOBILE,[je,ze]=(0,l.useState)(o.LIGHT),[C,T]=(0,l.useState)(),[P,N]=(0,l.useState)(v.defaultBuildPanel||"empty"),[D,b]=(0,l.useState)("empty"),[W,Pe]=(0,l.useState)(!1),[Ae,Qe]=(0,l.useState)([]),[Ge,Ze]=(0,l.useState)([]),{setPreviewAlertShow:mt,setTemplateNotEmAlertShow:vt}=ym(),{open:ft,close:lt}=Ju(),{open:G,close:Y}=Zu();sm();const ne=o.useRootElement(),ue=o.isEditorLockedByPlan(j,{isPlugin:!0}),ge=o.usePlanFeatureGate("discussion"),We=o.usePlanFeatureGate("code_editor"),Ve=Wi("ai"),at=Ve.exceeded?o.getLimitUpgradePresetDefinition(Ve.exceeded.presetId):null,Bt=v?.configSwither||!1;(0,l.useEffect)(()=>{p(o.resetParentBlocks())},[p]),(0,l.useEffect)(()=>{const E=window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_active_tab);E&&p(o.setActiveSettingsTab(E))},[B,p]);const Me=_||f,Xe=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,ie=dm(),te=cm(),U=(0,l.useRef)(null),le=(0,l.useRef)(null),xe=(0,l.useRef)(),Se=(0,l.useRef)(),Ne=(0,l.useRef)(null),He=(0,l.useRef)(),Ue=(0,l.useRef)(),rt=(0,l.useRef)(null),fn=(0,l.useRef)(!1),Lt=(0,l.useRef)(!1),ct=(0,l.useCallback)(()=>{Lt.current=!1},[]),Et=(0,l.useCallback)(()=>{Lt.current=!0},[]),Ot=(0,l.useCallback)(E=>{E?.type===o.ELEMENT_TYPES.SOCIAL&&Et()},[Et]),[jn,Ln]=(0,l.useState)(!1),[hn,On]=(0,l.useState)(!1),[Mn]=o.useEditMeMutation(),[ht,St]=(0,l.useState)(!1),[ce,we]=(0,l.useState)(0),[De,nt]=(0,l.useState)(!1),Le=(0,l.useCallback)(()=>nt(!1),[]),Kt=(0,l.useCallback)(()=>{nt(!1),k()},[k]),[Ut,dt]=(0,l.useState)(!1),Nn=v.configSwither?localStorage.getItem("configSwither")==="pro"?!0:localStorage.getItem("configSwither")==="editor"?!1:v.mode==="pro":!1,$t=(0,l.useCallback)(()=>{clearTimeout(rt.current);const E=".blocks-search__result-holder";ne.querySelector(E)&&(Ie||Ce||Be)&&(ne.querySelector(E).style.removeProperty("transition"),ne.querySelector(E).style.opacity=0,rt.current=setTimeout(()=>{o.measureBlockPreviews(ne,207/660),ne.querySelector(E)&&(ne.querySelector(E).style.transition="opacity 0.2s",ne.querySelectorAll(E).forEach(R=>R.style.opacity=1))},200))},[Ce,Ie,Be]),Tt=(0,l.useRef)(void 0),It=(0,l.useCallback)(E=>{const R=E.target;R&&(window.clearTimeout(Tt.current),Tt.current=window.setTimeout(()=>{Ln(!!R.closest(".desktop_view")),On(!!R.closest(".mobile_view"))},100))},[]);(0,l.useEffect)(()=>()=>{window.clearTimeout(Tt.current)},[]),(0,l.useEffect)(()=>{const E=o.addDocumentListenerFromShadow(ne,"mouseover",It);return()=>{E.dispose()}},[ne,It]),(0,l.useEffect)(()=>{typeof n=="function"&&(Ge.length>0?n(!0):n(!1))},[Ge]);const[Fo]=o.useSendMessageMutation(),{data:gt={},refetch:O,status:V}=o.useGetDialogQuery({entity_id:Me},{skip:!Me||v.aiAssistentEnabled===!1||ue}),X=o.useEventEmitter(g.events.AI_TEXT_REQUEST_ID).hasListeners(),re=o.useIsStandalone(),oe=!X&&!re,H=(0,l.useMemo)(()=>oe?[{data:{role:"assistant",message:d("Typing..."),isLoading:!0}}]:[],[oe,d]),[ke,_e]=(0,l.useState)([]),[qe,gn]=(0,l.useState)(v.defaultBuildPanel!==""?o.BLOCKS:o.ATOMS),Dn=(0,l.useRef)(null),pt=(0,l.useCallback)(()=>{const E=Se.current?.getBoundingClientRect(),R=C?.getBoundingClientRect();m.send({operation:o.EVENT_TYPES.SANDBOX_WINDOW_CHARACTERISTIC,settings:{iframeOffsetTop:Q&&me!=="bottom"?0:30,scrollTop:-E?.top+R?.top+30,innerHeight:window.innerHeight,previewHeight:R?.height,mode:Q&&me!=="bottom"?Am:"default"}})},[me,Q,C,m]),Bo=t&&e,yn=(0,l.useCallback)(E=>{const R=window.navigator.platform.match("Mac");v.codeEnabled&&v.codeSideEnabled&&E.altKey&&E.keyCode===88&&(S.toggle(),We.isLocked&&(St(!0),we(o.FEATURE_UPSELL_SLIDE.code_editor))),((R?E.metaKey:E.ctrlKey)&&E.shiftKey&&E.keyCode===76||(R?E.metaKey:E.ctrlKey)&&E.shiftKey&&E.keyCode===69||(R?E.metaKey:E.ctrlKey)&&E.shiftKey&&E.keyCode===82)&&E.preventDefault()},[v.codeEnabled,We.isLocked,v.codeSideEnabled,S]),wt=fe.includes("UPLOAD_IMAGE_")||fe.includes("UPLOAD_BACKGROUND_"),_n=(0,l.useRef)(!1),yt=(0,l.useCallback)(E=>{const R=E.target,F=R.closest(".email-pane__content-col")||R.closest(".email-pane__collapse-wrapper")||R.closest(".selected-element-panel-content")||R.closest(".selected-element-panel")||R.closest(".em-analytics__email-tab-properties")||R.closest(".em-analytics__email-tab-styles")||R.closest(".em-analytics__email-tab-history")||R.closest(".blocks-modal-container")||R.closest(".email-pane__sizes")||R.closest(".email-preview-menu")||R.closest(".monaco-editor")||R.closest(".ant-modal-wrap");_n.current=!!F},[]),Hs=(0,l.useCallback)(E=>{const R=_n.current,F=window.getSelection().toString().length>0||document.activeElement&&document.activeElement.tagName==="INPUT"&&document.activeElement.selectionStart!==document.activeElement.selectionEnd;_n.current=!1,!(R||F)&&(!document.querySelector(".easylogic-colorpicker")&&!ne.querySelector(".easylogic-colorpicker")&&!E.target.closest(".email-pane__content-col")&&!E.target.closest(".blocks-modal-container")&&!E.target.closest(".email-pane__collapse-wrapper")&&!E.target.closest(".selected-element-panel__columns-settings__controls__column__remove")&&!E.target.closest(".email-preview__content-col_main")&&!E.target.closest(".email-preview-menu")&&!E.target.closest(".monaco-editor")&&!E.target.closest(".main__pane-close-btn")&&!E.target.closest(".main__pane-trigger")&&!E.target.closest(".ant-modal-wrap")&&!E.target.closest(".email-pane__sizes")&&!E.target.closest(".ant-input-clear-icon")&&!E.target.closest(".ant-color-picker")&&!E.target.closest(".control-font-family-dropdown")&&!Dn.current&&!E.target.closest(".email-preview-menu__history")&&!E.target.closest(".selected-element-panel-content")&&!E.target.closest(".ant-select-dropdown")&&!E.target.closest(".ant-picker-dropdown")&&!E.target.closest(".toggle_view")&&!E.target.closest(".upload-bg-image__menu")&&!E.target.closest(".email-pane__paths")&&!E.target.closest(".ant-tabs-extra-content")&&!E.target.closest(".anticon-delete")&&!wt&&fe!==o.MODALS.IMAGE_EDITOR_MODAL&&($==="Properties"&&(Et(),p(o.resetToLastActiveSettingsTab()),m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Qe([])),$==="History"&&p(o.setActiveSettingsTab(o.BUILD)),p(o.switchIsPanelHistoryCollapsed(!0)),m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),setTimeout(()=>{e.type?p(o.setElementSettings({type:null})):p(o.setElementSettings$1({type:null}))},300)),Dn.current=null)},[p,e.type,fe,$,m,wt]),[Sb,qs]=(0,l.useState)(!0),{data:Hr=[],refetch:Uo}=o.useGetCommentsQuery(Me,{skip:!Me||ue});(0,l.useEffect)(()=>{Me&&!ue&&Uo()},[$,Me,ue,Uo]),(0,l.useEffect)(()=>{Me&&!Object.keys(gt).length&&V==="fulfilled"&&O()},[$,Me,O,gt,V]),(0,l.useEffect)(()=>{const E=new g.Disposable,R=window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_active_tab);if(gt?.totalCount===0&&V!=="pending"){const Re={project_id:h,connection:"chat",entity_id:Me,context:"default",locale:pe};!R&&oe&&o.runOnceInFlight(`email-default-context:${Me}`,()=>{o.swallowPromiseRejection(Fo({body:Re}).then(()=>{E.isDisposed()||V==="fulfilled"&&O()}))})}const F={data:{role:"assistant",message:d("Typing..."),isLoading:!0}};return gt?.documents?.length>0?(window.localStorage.removeItem(o.LOCAL_STORAGE_ITEMS.em_active_tab),_e(gt?.documents),oe&&gt?.documents[gt?.documents?.length-1].data?.userInfo&&_e([...gt?.documents,F])):R||_e(oe?[F]:[]),()=>E.dispose()},[Me,pe,gt?.totalCount,gt?.documents,oe,h,O,Fo,V]),(0,l.useEffect)(()=>{ie({}),p(Xe==="email"?o.setElementSettings$1({}):o.setElementSettings({}))},[p,Xe]);const Vs=(0,l.useCallback)(E=>{p(o.setEmailSettings(Kn(E)))},[p]),Ys=(0,l.useCallback)(E=>{p(o.setBlockSettings(Kn(E)))},[p]),Fn=(0,l.useCallback)(E=>{p(Xe==="email"?o.setElementSettings$1(Kn(E)):o.setElementSettings(Kn(E)))},[p,Xe]);(0,l.useEffect)(()=>{const E=He.current,R=Ne.current;T(Q?R??E:E)},[Q,me]);const[wb,kb]=(0,l.useState)(null),Cb=(0,l.useCallback)(E=>{v.sidePanelFloating&&(Ne.current=E),kb(E)},[v.sidePanelFloating]),Bn=(0,l.useCallback)(E=>{N(E),E==="search"?Pe(!0):(Pe(!1),b(E)),setTimeout($t,50)},[$t]),Tb=(0,l.useCallback)(E=>{const R=E.data.operation,F=E.data,Re=E.data.action;if(R==="application_block_inserted"||E.data.operationId==="application_block_inserted"){const Oe=E.data.operationId?E.data.data:F||{},Nt=Oe.type==="project"||Oe.type==="template"||Oe.type==="common"?"block":"structure",vn=Oe.name||Oe.type||(Nt==="block"?"block":"structure");I({event:"add",action:"add_element_to_email",element_type:Nt,element_name:vn,entity_id:e?.id||_||f,project_id:j?.id||h})}if(R===o.EVENT_TYPES.APPLICATION_SCROLL_TO&&setTimeout(()=>{Ne.current?.scrollTo({top:E.data.settings.value,behavior:"smooth"})},100),R===o.EVENT_TYPES.APPLICATION_PREVIEW_ALERT_SHOW&&mt(F.settings.show),R===o.EVENT_TYPES.APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW&&vt(!0),R===o.EVENT_TYPES.APPLICATION_ACTION&&Re==="toggle_editor"&&S.toggle(),R===o.EVENT_TYPES.APPLICATION_IFRAME_SET_HEIGHT&&(ne.querySelector(".email-pane__iframe").style.height=F.settings.height+"px"),R===o.EVENT_TYPES.APPLICATION_EMAIL_SETTINGS_SET){let Oe=Object.assign({},F.settings);delete Oe.preheader,Object.values(Oe).every(Nt=>!Nt)?(p(o.setEmailSettingsDisable(!0)),p(o.resetToLastActiveSettingsTab())):Vs(F.settings),F.settings.noBlocks,p(o.setMobileViewActive(F.settings.responsive)),qs(Oe.structuresMedia)}if(R===o.EVENT_TYPES.APPLICATION_BLOCK_SETTINGS_SET&&(Object.values(F.settings).every(Oe=>!Oe)?(p(o.setBlockSettingsDisable(!0)),p(o.resetToLastActiveSettingsTab())):(Ys(F.settings),qs(F.settings.structuresMedia))),R===o.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_SET){const Oe=Object.values(o.ELEMENT_TYPES).includes(F.type),Nt=te.current,vn=Nt?.type==="advanced"&&!!Nt.content,At=F.tab?!0:!Oe&&!vn,{type:Ub,caption:$b,settings:zb}=F,ol=JSON.stringify([Ub,$b,zb]),Gb=ol!==U.current;if(U.current=ol,At&&$==="Properties"&&p(o.resetToLastActiveSettingsTab()),F.type===o.ELEMENT_TYPES.EMPTY_TABLE||F.type===o.ELEMENT_TYPES.EMPTY_TD?(p(o.setActiveSettingsTab(o.BUILD)),F.type===o.ELEMENT_TYPES.EMPTY_TABLE?(gn(o.BLOCKS),F.tab?Bn(F.tab):Bn("common")):F.type===o.ELEMENT_TYPES.EMPTY_TD&&gn(o.ATOMS)):F.type&&$!=="Properties"?F.type===o.ELEMENT_TYPES.SOCIAL&&Lt.current?ct():(ct(),p(o.setActiveSettingsTab(o.PROPERTIES))):F.type!==o.ELEMENT_TYPES.SOCIAL&&ct(),!Gb)return;F.type===o.ELEMENT_TYPES.CAROUSEL||F.type===o.ELEMENT_TYPES.ACCORDION||F.type===o.ELEMENT_TYPES.SOCIAL?(ie(tn=>({settings:{...F.settings,type:At?null:F.type,caption:F.caption,parent:At?null:F.settings.parent},type:At?null:F.type,parent:At?null:F.settings.parent,caption:F.caption,extraTabs:tn.extraTabs})),Fn({})):(Fn({...F.settings,type:At?null:F.type,parent:At?null:F.settings.parent,caption:F.caption}),ie(tn=>!Oe&&tn.type==="advanced"&&tn.content?{...tn,settings:{...F.settings,type:F.type,parent:F.settings?.parent,caption:F.caption}}:tn.extraTabs?.length?{extraTabs:tn.extraTabs}:{})),F.settings?.path?.length>0&&Qe(F.settings?.path)}R===o.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_CLOSE&&(U.current=null,te.current?.type===o.ELEMENT_TYPES.SOCIAL&&Et(),p(o.resetToLastActiveSettingsTab()))},[p,Vs,Ys,Fn,$,Bn,ne,I,e,_,f,j,ct,Et,S,h,te,ie,mt,vt]);(0,l.useEffect)(()=>{o.identifyUser({id:de?.id,email:de?.email,username:de?.name})},[de]),(0,l.useEffect)(()=>{const E=de.email_builder_config,R=!ue,F=A.get()?.mode;if(!E||typeof E!="string")return;const Re=R&&E==="simple"?"pro":E;Re!==F&&p(o.changeConfig(Re))},[ue,de.email_builder_config,de.id,p,q,A]),(0,l.useEffect)(()=>{if(Q&&We.isLocked&&S.toggle(),v.configSwither){let E=localStorage.getItem("configSwither")||v.mode||"editor";localStorage.setItem("configSwither",E),p(o.changeConfig(E))}},[]);const Ks=E=>{setTimeout(()=>{if(ue)p(o.changeConfig("pro")),dt(!0),St(!0),I({event:"change",action:"change_config_mode",config_mode:"pro",entity_id:e?.id||_||f,project_id:j?.id||h});else{let R=E?"pro":"editor";localStorage.setItem("configSwither",R),p(o.changeConfig(R)),I({event:"change",action:"change_config_mode",config_mode:R,entity_id:e?.id||_||f,project_id:j?.id||h})}},200)},Ib=()=>{Q&&S.toggle(),p(o.resetToLastActiveSettingsTab()),p(o.changeConfig("simple")),dt(!1),St(!1),I({event:"change",action:"change_config_mode",config_mode:"simple",entity_id:e?.id||_||f,project_id:j?.id||h})},Ab=(0,l.useCallback)(()=>{St(!1)},[]);o.useListenPostMessage(Tb),(0,l.useEffect)(()=>{const E=m.addListener(R=>{const F=Qu(R,o.EVENT_TYPES.APPLICATION_NATIVE_IMAGE_DROP);if(!F)return;const Re=()=>m.send({operation:o.EVENT_TYPES.SANDBOX_NATIVE_IMAGE_DROP_CLEAR});(async()=>{const Oe=await Xu(F,{readContext:()=>({userId:de?.id,folderId:j?.id??h}),prepare:At=>o.prepareImageForEditorUpload(At,v),upload:At=>Te(At)});if(Oe.status==="failed"&&L.fromError("IMAGE_UPLOAD_ERROR",F,Oe.error,!0),Oe.status!=="uploaded"){Re();return}m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:o.ELEMENT_TYPES.IMG,settings:{src:Oe.url}});const Nt=q.getState(),vn=Xe==="email"?o.selectElementSettings$1(Nt):o.selectElementSettings(Nt);vn?.type===o.ELEMENT_TYPES.IMG&&Fn({...vn,src:Oe.url,changeKey:"src"})})()});return()=>E.dispose()},[m,Te,de,h,j?.id,v,L,Fn,q,Xe]),(0,l.useEffect)(()=>{const E=m.addListener("application_atom_inserted",F=>{I({event:"add",action:"add_element_to_email",element_type:"atom",element_name:F||"atom",entity_id:e?.id||_||f,project_id:j?.id||h})}),R=m.addListener("application_block_inserted",F=>{const Re=F?.type==="project"||F?.type==="template"||F?.type==="common"?"block":"structure",Oe=F?.name||F?.type||(Re==="block"?"block":"structure");I({event:"add",action:"add_element_to_email",element_type:Re,element_name:Oe,entity_id:e?.id||_||f,project_id:j?.id||h})});return()=>{E?.dispose(),R?.dispose()}},[m,I,e?.id,_,f,h,j?.id]);const xb=E=>{let R=ne.querySelector(".atoms__list");v.toggleSidePanel&&E===$?p(o.setActiveSettingsTab(o.DISABLED_TAB)):E==="Optimize"?xt.comingSoonHandler(d,w):E!=="Properties"&&E!=="History"?(p(o.setActiveSettingsTab(E)),I({event:"navigate",action:"navigate_email_pane_tab",tab_name:E==="Disabled_tab"?"DISABLED_TAB":E,entity_id:e?.id||_||f,project_id:j?.id||h}),m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Qe([])):(E==="Properties"||E==="History")&&I({event:"navigate",action:"navigate_email_pane_tab",tab_name:E,entity_id:e?.id||_||f,project_id:j?.id||h}),ge.isLocked&&E==="Discuss"&&(St(!0),we(o.FEATURE_UPSELL_SLIDE.discussion)),ue&&E==="Optimise"&&(St(!0),we(6)),Ve.isLocked&&E==="AiChat"&&(Ve.state.state==="locked_by_limit"&&Ve.exceeded?nt(!0):(St(!0),we(9)))},qr=(0,l.useRef)(null),$o=(0,l.useRef)(void 0),Mt=(0,l.useCallback)(()=>{const E=Ne.current?.getBoundingClientRect();if(qr?.current?.getBoundingClientRect().top>=0&&E){const R=Math.round(E.height-30);qr.current.style.height=`${R}px`,Ee(R-30)}$o.current&&window.clearTimeout($o.current),$o.current=window.setTimeout(function(){m.isInited()&&pt()},100)},[pt,m,Ee]);(0,l.useEffect)(()=>()=>{window.clearTimeout($o.current)},[]),(0,l.useEffect)(()=>($==="AiChat"&&!ue?le.current=setInterval(()=>{O({entity_id:Me})},5e3):clearInterval(le.current),clearInterval(le.current)),[Me,ue,O,$]);const Pb=E=>gn(E||""),Rb=()=>{Pe(!1),N(D)},Vr=()=>{let E=ne.querySelector(".block-search__preview");E&&(E.style.opacity="0",E.style.transform="translateX(-99%)",setTimeout(function(){E.remove()},300))};let bn=[];const Un={display:"flex",alignItems:"center",justifyContent:"center"};v.blocksEmptyEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Empty blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"BorderOuterOutlined",component:y.icons$BorderOuterOutlined,style:{fontSize:18}})})}),value:"empty"}),v.blocksSavedEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Saved blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"AppstoreAddOutlined",component:y.icons$AppstoreAddOutlined,style:{fontSize:18}})})}),value:"project"}),v.blocksCommonEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Common blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"AppstoreOutlined",component:y.icons$AppstoreOutlined,style:{fontSize:18}})})}),value:"common"}),v.blocksTemplateEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Template blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"BuildOutlined",component:y.icons$BuildOutlined,style:{fontSize:18}})})}),value:"template"}),v.blocksSearchEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Blocks search"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"SearchOutlined",component:y.icons$SearchOutlined,style:{fontSize:18}})})}),value:"search"});const zo=P!=="empty"||W,jb=!v.blocksSectionsShow||zo?"100%":"calc(100% - 44px)";let Lb=[{label:(0,s.jsx)("div",{className:"email-pane__tab",children:d("Elements")}),key:o.ATOMS,className:"email-pane__collapse-panel email-pane__atoms",children:(0,s.jsx)(Fm,{})},{label:(0,s.jsx)("div",{className:"email-pane__tab",children:d("Blocks")}),key:o.BLOCKS,className:"email-pane__collapse-panel email-pane__blocks-search",style:{height:jb},children:(0,s.jsxs)("div",{className:(0,ot.default)("email-pane__blocks-panel",{"email-pane__blocks-panel_scrollable":zo}),children:[v.blocksSectionsShow&&(0,s.jsxs)("div",{className:"email-pane__blocks-panel-header",children:[(0,s.jsxs)(y.ui_kit$Space.Compact,{block:!0,children:[!W&&(0,s.jsx)(y.ui_kit$Segmented,{block:!0,style:{width:"100%",marginTop:24},onChange:Bn,value:P,options:bn}),W&&(0,s.jsx)("div",{style:{width:"100%",height:36}}),W&&(0,s.jsx)("div",{style:{width:36,textAlign:"right",marginTop:22},children:(0,s.jsx)(o.EmIcons,{icon:"CloseOutlined",component:y.icons$CloseOutlined,style:{padding:"0 2px 0",cursor:"pointer"},onClick:Rb})})]}),(0,s.jsx)("div",{className:"blocks-search__divider-wrapper",style:{marginTop:W?28:12},children:(0,s.jsx)(y.ui_kit$Divider,{className:"blocks-search__divider"})})]}),(0,s.jsxs)("div",{className:"email-pane__blocks-panel-body",children:[(0,s.jsx)("div",{className:"blocks-search__empty-shadow",style:{display:P==="empty"&&!W?"block":"none"},children:Sb?(0,s.jsx)(ui,{}):(0,s.jsx)(ci,{})}),(0,s.jsx)("div",{className:(0,ot.default)("email-pane__blocks-panel-results",{"email-pane__blocks-panel-results_visible":zo}),children:(0,s.jsx)(Mm,{parentEmailId:e?.parent_email,blocksTab:P,search:W,reloadBlockScreens:$t,setIsShowAddAllBlocksModal:a})})]})]})}];const $n=[{disabled:ht,key:o.PROPERTIES,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-properties",children:(0,s.jsx)(km,{isShowMobileSettings:he,propertiesPanelKey:J,onMouseLeave:Vr,email:e,onClosePanel:Ot})},{disabled:ht,key:o.HISTORY,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-history",children:Bo&&(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",onMouseLeave:Vr,children:(0,s.jsx)(Um,{setCollapsedHistory:()=>p(o.switchIsPanelHistoryCollapsed(!0)),emailElement:Bo})})},{key:o.DISABLED_TAB,className:"em-analytics__email-tab-properties"},{disabled:ht,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Build","tab"),children:(0,s.jsx)(o.EmIcons,{"data-testid":"contentIcon",icon:"PlusCircleOutlined",component:y.icons$PlusCircleOutlined,size:24,strokeWidth:v.iconStrokeWidth})}),key:o.BUILD,className:"em-analytics__email-tab-build",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:(0,ot.default)("email-pane__collapse-wrapper",{"email-pane__collapse-wrapper_no-topleft-radius":$==="Build"||!$,"email-pane__collapse-wrapper_build":qe==="Blocks"&&zo}),onMouseLeave:Vr,children:(0,s.jsx)(y.ui_kit$Tabs,{className:(0,ot.default)("secondary-tabs email-pane__collapse",{"secondary-tabs_unset_scroll":qe===o.BLOCKS}),size:"large",activeKey:qe,onChange:Pb,items:Lb})})},{disabled:ht,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Styles","tab"),children:(0,s.jsx)(o.EmIcons,{"data-testid":"stylesIcon",icon:"Styles",component:y.icons$Styles,size:24,strokeWidth:v.iconStrokeWidth})}),key:o.STYLES,className:"em-analytics__email-tab-styles",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(Lm,{email:e})})}];v.commentsEnabled&&$n.push({disabled:ht,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("Discuss","tab"),children:[(0,s.jsx)(o.EmIcons,{"data-testid":"commentsIcon",icon:"CommentOutlined",component:y.icons$CommentOutlined,size:24,strokeWidth:v.iconStrokeWidth}),ge.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:v.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),!!Hr.length&&(0,s.jsx)("span",{className:"email-pane__comment-counter",children:Hr.filter(E=>E.comment_status!=="deleted").length})]}),key:"Discuss",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-wrapper",size:"large",activeKey:"Discuss",items:[{label:(0,s.jsx)(s.Fragment,{children:d("Discuss")}),key:"Discuss",forceRender:!0,className:"email-settings__collapse-panel",children:Me?(0,s.jsx)($m,{email:e,comments:Hr,subjectId:Me,isLoggedIn:!0,emailElementType:Xe}):(0,s.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})});const Ob=()=>{ye({entity_id:Me}).then(E=>{E.error?L.error({title:E.error.data.code,description:E.error.data.message}):E.data.success&&L.success({title:d("Success"),description:E.data.success}),ue||O()})};v.aiAssistentEnabled&&$n.push({disabled:ht,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("AI assistant","tab"),children:[(0,s.jsx)(o.EmIcons,{"data-testid":"aiAssistentIcon",icon:"AI",component:y.icons$AI,size:24,strokeWidth:v.iconStrokeWidth}),Ve.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:v.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),gt?.totalCount>0&&Me&&(0,s.jsx)("span",{className:"email-pane__comment-counter",children:gt?.totalCount})]}),key:"AiChat",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-ai-wrapper",size:"large",activeKey:"AiChat",tabBarExtraContent:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Clear chat"),children:(0,s.jsx)(y.ui_kit$Popconfirm,{description:d("Clear chat history?"),onConfirm:Ob,okText:d("Yes"),cancelText:d("No"),icon:"",placement:"leftTop",title:!1,children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"ClearChat",component:y.icons$ClearChat,style:{fontSize:16}}),style:{marginRight:16}})})}),items:[{label:(0,s.jsx)(s.Fragment,{children:d("AI assistant")}),key:"AiChat",forceRender:!0,className:"email-settings__collapse-panel",children:Me||window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_active_tab)?(0,s.jsx)(jm,{messages:ke.length>0?ke:H,newEmailAiGeneratorRef:fn}):(0,s.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})})}),v.optimizeEnabled&&$n.push({disabled:ht,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("Optimize","tab"),children:[(0,s.jsx)(o.EmIcons,{"data-testid":"optimizeIcon",icon:"Speed",component:y.icons$Speed,size:24,strokeWidth:v.iconStrokeWidth}),ue&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:v.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"})]}),key:"Optimise",className:"em-analytics__email-tab-optimise",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs secondary-tabs_optimise email-settings__collapse optimise-wrapper",size:"large",activeKey:"Optimise",items:[{label:(0,s.jsx)(s.Fragment,{children:d("Optimize")}),key:"Optimise",forceRender:!0,className:"email-settings__collapse-panel",children:(0,s.jsx)(Om,{})}]})})}),v.settingsEnabled&&$n.push({disabled:ht,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Settings","tab"),children:(0,s.jsx)(o.EmIcons,{"data-testid":"settingsIcon",icon:"SettingOutlined",component:y.icons$SettingOutlined,size:24,strokeWidth:v.iconStrokeWidth})}),key:"Edit",className:"em-analytics__email-tab-edit",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(Bm,{email:e})})});const Qs=$===o.DISCUSS,Xs=(0,l.useRef)(0),Js=(0,l.useRef)(0),Zs=(0,l.useRef)(0),Mb=(0,l.useCallback)(()=>(ne.querySelector(".email-pane__col_preview")?.getBoundingClientRect().width??0)-(v.sidePanelFloating?0:38),[ne,v.sidePanelFloating]);(0,l.useEffect)(()=>{Me&&!ue&&Uo()},[Me,ue,Uo]),(0,l.useEffect)(()=>{const E=m.onInit(()=>{m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_DISCUSS,value:Qs})});return()=>E.dispose()},[Qs,m]),(0,l.useEffect)(()=>{if(!C||!Ki(m))return;const E=new AbortController;return Qi(m,o.DEFAULT_SANDBOX_READY_TIMEOUT_MS,E.signal).then(()=>pt()).catch(()=>{}),()=>E.abort()},[C,pt,m]);const Yr=(0,l.useCallback)(E=>{const R=E??o.selectEmailWidth(q.getState());m.send({operation:o.EVENT_TYPES.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:typeof R=="number"?R+2:R}}),xe.current?.resize()},[q,m]);(0,l.useEffect)(()=>{if(!he&&$!=="Disabled_tab"){const E=ne.querySelector(".email-pane__row")?.getBoundingClientRect().width;Se?.current?.getBoundingClientRect().width+540>E&&p(o.setEmailWidth("100%"))}},[p,$,ne,he]);const Kr=(0,l.useCallback)(()=>{const E=Se.current;E&&(E.style.borderWidth="1px",v.sidePanelFloating||(E.style.marginLeft="-1px",E.style.marginRight="-1px"),E.style.borderLeftColor=null,E.style.borderRightColor=null)},[v.sidePanelFloating]),el=(0,l.useCallback)(E=>{const R=ee.current.widthCodeSplit;ve(!1),ee.current.currentSide&&(setTimeout(()=>Yr(),50),et(null)),E.target.classList.contains("email-pane__handle")||Kr(),window.localStorage.setItem(o.LOCAL_STORAGE_ITEMS.em_code_mode_pane_sizes,JSON.stringify(R))},[Yr,ee,ve,et,Kr]),tl=E=>R=>{R.target.classList.contains("email-pane__handle")&&(R.preventDefault(),Xs.current=R.target.parentNode.offsetWidth,Js.current=R.pageX,Zs.current=Mb(),et(E),Dn.current=E)},Go=E=>{const R=Se.current,{currentSide:F}=ee.current;typeof E=="string"&&(!F||F===E)?(ne.querySelector(".email-pane__iframe").style.width="calc(100% + 1px)",E==="right"?(R.style.borderRightColor=M.colorPrimary,R.style.borderRightWidth="2px"):(R.style.borderLeftColor=M.colorPrimary,R.style.borderLeftWidth="2px",ne.querySelector(".email-pane__iframe").style.marginLeft="-1px")):F||(Kr(),ne.querySelector(".email-pane__iframe").style.width="1px",ne.querySelector(".email-pane__iframe").style.removeProperty("margin-left"))},Nb=(0,l.useCallback)(()=>{ve(!0)},[ve]),Qr=(0,l.useCallback)(E=>{const{currentSide:R}=ee.current;if(!R)return;const F=(E.pageX-Js.current)*2,Re=Xs.current+(R==="left"?-F:F),Oe=Math.min(Zs.current,1200);Re>318&&Re<Oe&&(p(o.setEmailWidth(Math.min(Re,1200))),xe.current?.resize())},[p,ee]),Xr=(0,l.useCallback)(E=>{if(ee.current.isResizing)if(me==="bottom"){const R=Ue.current.getBoundingClientRect().height,F=Ue.current.getBoundingClientRect().top,Re=(E.clientY-F)/R*100;if(Re<20||Re>80)return;Fe(Re),Mt()}else{const R=Ue.current.getBoundingClientRect().width,F=Ue.current.getBoundingClientRect().left,Re=(E.clientX-F)/R*100,Oe=Se.current.getBoundingClientRect().width;if(v.desktopMobileSwitchPanel&&typeof Oe=="number"&&Oe<=425&&p(o.setEmailWidth(425)),Re<20||Re>80)return;Fe(Re)}},[ee,Fe,me,Mt,p,v.desktopMobileSwitchPanel]);(0,l.useEffect)(()=>{Mt()},[Q,Mt]);const Db=E=>{E?.stopPropagation?.();const R=je==="light"?o.DARK:o.LIGHT;m.send({operation:o.EVENT_TYPES.SANDBOX_SWITCH_THEME,data:{theme:R}}),ze(R)},nl=(E="panel")=>{const R=E==="panel",F=je===o.DARK,Re={size:R?18:16,strokeWidth:R?v.iconStrokeWidth:2};return(0,s.jsx)(y.ui_kit$Tooltip,{title:d(F?"Light theme":"Dark theme"),placement:R?"top":"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:R?F?"primary":"text":"default",icon:F?(0,s.jsx)(o.EmIcons,{icon:"LightMode",component:y.icons$LightMode,...Re}):(0,s.jsx)(o.EmIcons,{icon:"DarkMode",component:y.icons$DarkMode,...Re}),shape:"circle",size:R?void 0:"small",onClick:Db,className:"toggle_view theme_view email-pane__theme-toggle",style:R?void 0:{left:4,top:4,zIndex:999,padding:0,position:"absolute"}})})},Jr=E=>{const R=typeof E=="number"?Math.min(E,1200):E;p(o.setEmailWidth(R)),setTimeout(()=>Yr(R),700);const F=typeof R=="number"?R:R==="100%"?"full":R,Re=typeof R=="number"&&R<=425?"mobile":"desktop";I({event:"change",action:"change_email_size",email_id:e?.id||_||f,project_id:j?.id||h,width:F,view_type:Re})};(0,l.useEffect)(()=>{const E=new g.Disposable;return E.addDisposable(o.addWindowListenerFromShadow(ne,"mousedown",yt,!0)),E.addDisposable(o.addWindowListenerFromShadow(ne,"click",Hs)),E.addDisposable(o.addWindowListenerFromShadow(ne,"mouseup",R=>el(R),!0)),()=>{E.dispose()}},[ne,Hs,yt,el]),(0,l.useEffect)(()=>{const E=Ne.current;if(!E||typeof ResizeObserver!="function")return;const R=new ResizeObserver(Mt);return R.observe(E),()=>R.disconnect()},[Mt,v.sidePanelFloating]),(0,l.useEffect)(()=>(window.addEventListener("scroll",Mt,!0),window.addEventListener("mousemove",Qr,!0),window.addEventListener("mousemove",Xr),window.addEventListener("keydown",yn),()=>{window.removeEventListener("mousemove",Qr,!0),window.removeEventListener("mousemove",Xr),window.removeEventListener("scroll",Mt,!0),window.removeEventListener("keydown",yn)}),[Mt,Qr,Xr,yn]);const Fb=E=>{const R=Q?"visual":"code",F=!Q;if(Q?S.toggle():typeof E=="string"?(S.setDirection(E),!Q&&S.toggle()):S.toggle(),F){const Re=Xe==="block"?"block":"email",Oe=typeof E=="string"?E:me||"toggle";I({event:"activate",action:"activate_code_mode",entity_type:Re,entity_id:e?.id||_||f,project_id:j?.id||h,code_mode_direction:Oe})}I({event:"change",action:"change_editor_mode",editor_mode:R,entity_id:e?.id||_||f,project_id:j?.id||h}),p(o.resetToLastActiveSettingsTab()),setTimeout(()=>{p(Xe==="block"?o.setElementSettings({type:null}):o.setElementSettings$1({type:null}))},300),m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),p(o.resetPanes())};(0,l.useEffect)(()=>{v.emailPaneDesktopSize&&p(o.setEmailWidth(v.emailPaneDesktopSize))},[p,v.emailPaneDesktopSize]);const Bb=()=>{gn(o.BLOCKS),Bn("project")};return(0,l.useEffect)(()=>{i&&Bb()},[i]),(0,s.jsx)(o.ElementEntityKindProvider,{kind:Xe,children:(0,s.jsxs)(_m,{className:(0,ot.default)("email-pane",{"email-pane_code-mode":Q,"email-pane_only_code_mode_mobile":v.onlyCodeModeInMobile,"email-pane_code-mode-bottom":Q&&me==="bottom","email-pane_no-element-navigation":!v.switchDesktopMobilePropsEnabled&&!v.stepToOtherElementEnabled&&!v.deleteButtonEnabled,"email-pane_is-mobile":he,"email-pane_path-enabled":v.pathEnabled}),sidePanelFloating:!!v.sidePanelFloating,isCodeMode:!!Q,codeModeDirection:String(me),children:[(0,s.jsxs)(Pm,{className:"email-pane__container",ref:He,children:[(0,s.jsx)(Tm,{isCodeMode:Q,codeModeDirection:me}),(0,s.jsx)(wm,{isShowMobileSettings:he,headless:!!x,templateNotEmAlertEnabled:!!v.templateNotEmAlertShow}),(0,s.jsxs)(y.ui_kit$Row,{ref:Ue,className:(0,ot.default)("email-pane__row",{"email-pane__left":Q&&me==="right","email-pane__right":Q&&me==="left","email-pane__bottom":Q&&me==="bottom","email-pane__sizeSwitcher":v.desktopMobileSwitchPanel,"email-pane__reverse":v.menuDirection==="left","email-pane__pinch":!v.sidePanelFloating}),children:[(0,s.jsxs)(vm,{isCodeMode:Q,codeModeDirection:me,sidePanelFloating:v.sidePanelFloating,contentWrapperRef:Cb,children:[(0,s.jsx)("div",{className:"email-pane__iframe-scroll-top",id:"iframe-scroll-top"}),v.desktopMobileSwitchPanel&&(0,s.jsxs)(y.ui_kit$Space,{className:"email-pane__sizes-panel-wrapper",orientation:"vertical",size:10,children:[(0,s.jsxs)(y.ui_kit$Space,{className:"email-pane__sizes-panel",size:0,children:[nl("panel"),(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Desktop view"),placement:"top",open:jn,children:(0,s.jsx)(y.ui_kit$Button,{type:he?"text":"primary",icon:(0,s.jsx)(o.EmIcons,{icon:"DesktopOutlined",component:y.icons$DesktopOutlined,size:18,strokeWidth:v.iconStrokeWidth}),shape:"circle",onClick:()=>Jr(v.emailPaneDesktopSize||1e3),className:"toggle_view desktop_view"})}),(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Mobile view"),placement:"top",open:hn,children:(0,s.jsx)(y.ui_kit$Button,{type:he?"primary":"text",icon:(0,s.jsx)(o.EmIcons,{icon:"MobileOutlined",component:y.icons$MobileOutlined,size:18,strokeWidth:v.iconStrokeWidth}),shape:"circle",onClick:()=>Jr(425),className:"toggle_view mobile_view"})})]}),v.codeSideEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Code mode"),placement:"right",children:(0,s.jsx)(y.ui_kit$Button,{type:Q?"primary":"default",icon:(0,s.jsx)(o.EmIcons,{icon:"Code",component:y.icons$Code}),shape:"circle",onClick:()=>Fb("right")})})]}),(0,s.jsxs)(y.ui_kit$Row,{className:(0,ot.default)("email-pane__col-wrapper",{container:Q&&me==="bottom"||!Q,"email-pane__col-wrapper_reverse":v.menuDirection==="left","email-pane__col-wrapper_pinch":!v.sidePanelFloating}),style:{flexGrow:1,maxWidth:"unset",paddingTop:v.desktopMobileSwitchPanel&&Q&&me!=="bottom"?"60px":""},children:[(0,s.jsxs)(y.ui_kit$Col,{className:"email-pane__col email-pane__col_preview",style:{flexGrow:1,maxWidth:"unset"},ref:v.sidePanelFloating?null:Ne,children:[v.desktopMobileSwitchRule&&(0,s.jsx)(jd,{onSelectWidth:Jr,themeToggle:nl("rule")}),(0,s.jsxs)(bm,{maxPaneWidth:1200,isCodeMode:Q,codeModeDirection:me,isShowMobileSettings:he,desktopMobileSwitchPanel:v.desktopMobileSwitchPanel,children:[(0,s.jsx)("div",{className:"email-pane__handle left",onMouseDown:tl("left"),onMouseEnter:()=>Go("left"),onMouseLeave:Go}),(0,s.jsx)("div",{className:"email-pane__handle right",onMouseDown:tl("right"),onMouseEnter:()=>Go("right"),onMouseLeave:Go}),(0,s.jsx)(Sm,{wrapperRef:Se,children:(0,s.jsx)(Dm,{ref:xe,className:"email-pane__iframe",email:e,handlerSendPosition:Mt,clip:wb})})]})]}),(0,s.jsx)(y.ui_kit$Col,{style:{display:Q&&me!=="bottom"||v.disableSideMenu?"none":"initial"},ref:qr,onPointerEnter:Rm,className:(0,ot.default)("email-pane__content-col email-pane__content-col_menu email-pane__content-col_tabs email-pane__col email-pane__col_settings",{"email-pane__col_disabled":$===o.DISABLED_TAB}),children:(!Q||me==="bottom")&&Z&&(0,s.jsx)(y.ui_kit$Tabs,{className:(0,ot.default)("email-pane__col_settings-inner",{"email-pane__col_settings-inner_reverse":v.menuDirection==="left"}),size:"medium",activeKey:$,onTabClick:xb,renderTabBar:xm,tabPlacement:"right",items:$n,tabBarExtraContent:Bt&&(0,s.jsx)("div",{style:{paddingTop:15,textAlign:"center"},children:ue?(0,s.jsx)(y.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:Ks,checked:Ut}):(0,s.jsx)(y.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:Ks,defaultChecked:Nn})})})})]}),(0,s.jsx)("div",{className:"email-pane__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]}),(0,s.jsxs)(Em,{isCodeMode:Q,codeModeDirection:me,children:[(0,s.jsx)("div",{className:"email-pane__code-divider",onMouseDown:Nb}),(0,s.jsx)("div",{className:"code-mode__pane code-mode__pane_editor email-pane__pane email-pane__pane_editor",children:(0,s.jsx)("div",{className:"code-mode__pane-content email-pane__pane-content",children:ae&&(0,s.jsx)(Nm,{email:e,setOtherUsers:Ze,readOnly:v.lockEditor,newEmailAiGeneratorRef:fn})})})]})]}),v.pathEnabled&&(0,s.jsxs)("div",{className:"email-pane__paths",children:[(0,s.jsx)(pu,{elementPath:Ae}),(0,s.jsx)(hu,{fallbackHtml:e?.html})]}),(0,s.jsx)("div",{className:"collaborator-list",children:(0,s.jsx)(o.CollaboratorList,{users:Ge,isEditor:!1,isPlugin:!0,token:M})})]}),(0,s.jsx)(Im,{isCodeMode:Q,codeModeDirection:me,email:e,onClosePanel:Ot}),(0,s.jsx)(Du,{}),(0,s.jsx)(o.PlanUpgradePrompt,{open:ht,onCancel:Ib,onTrialActivated:Ab,initialSlide:ce}),at&&Ve.exceeded?(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(rr,{open:De,onClose:Le,title:d(at.titleKey),subtitle:d(at.subtitleKey),usageResource:at.usageResource,previousDisplay:o.presetLimitDisplay(Ve.exceeded.previousLimit),nextDisplay:o.presetLimitDisplay(Ve.exceeded.nextLimit),onChangePlan:Kt})}):null,(0,s.jsx)(gu,{open:ft,onClose:lt}),(0,s.jsx)(_u,{open:G,onClose:Y})]})})};ma.propTypes={};var zm=e=>(0,s.jsx)(lm,{children:(0,s.jsx)(um,{children:(0,s.jsx)(hm,{children:(0,s.jsx)(ma,{...e})})})}),Gm=(0,l.memo)(zm),Wm=({open:e,onClose:t})=>{const{__:n}=o.useI18n(),r=o.getSupportEmail(),[i,a=""]=n("To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.").split("{supportEmail}");return(0,s.jsx)(y.ui_kit$Modal,{width:440,open:e,onCancel:t,title:(0,s.jsxs)("div",{style:{paddingBottom:8},children:[(0,s.jsx)(o.EmIcons,{icon:"EmailConfirmation",component:y.icons$EmailConfirmation,size:20,strokeWidth:2})," ",n("Email confirmation required")]}),footer:[(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:n("Got it")},"ok")],children:(0,s.jsxs)("p",{children:[i,(0,s.jsx)("a",{href:`mailto:${r}`,children:r}),a]})})},Qn=e=>{const t=o.useCurrentUser(),[n,r]=(0,l.useState)({owner:!1,admin:!1,user:!1}),i=o.useProjectData(),{data:a}=o.useGetProjectQuery(e,{skip:!e||!t.id||!!i}),c=i||a;return(0,l.useEffect)(()=>{if(c){const d=o.getMyProjectRole(c,t);r({owner:d==="owner",admin:d==="admin",user:d==="user"})}},[c,t]),n},cr=o.getLimitUpgradePresetDefinition("preview_exceeded"),pa=({emailElement:e,isCollaborationEditor:t})=>{const{__:n}=o.useI18n(),r=o.useDispatch(),i=Vo(),a=o.useOpenPlanCatalog(),c=o.useSendPostMessage(),{blockId:d}=o.useRouteParams(),u=o.useRouteEmailId(),m=o.useSelector(o.selectActiveModal$1)===o.MODALS.SEND_TEST_EMAIL,f=kn(m),[h,_]=(0,l.useState)(!1),[p,S]=o.useSendLivePreviewMutation(),k=o.useCurrentUser(),w=o.useDocumentHistoryReader(),v=o.useProjectPlanLimitPreflight(),{owner:A}=Qn(),x=Jo(),K=Dd(),Z=o.useContentReader(),M=o.useSelector(o.selectIsPanelHistoryCollapsed),L=o.useSelector(o.selectIsCodeMode),I=o.useSelector(o.selectCodeModeDirection),{token:j}=(0,y.ui_kit$useToken)(),z=o.useNotification(),B=o.useAppConfig(),$=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,de=o.useEventEmitter(g.events.ON_SHARE_ID),pe=o.useEventEmitter(g.events.ON_SHOW_PREVIEW_ID),[q,ee]=(0,l.useState)(!1),[Fe,ve]=(0,l.useState)(0),[et,Ee]=(0,l.useState)(!1),fe=kn(et),Q=(0,l.useCallback)(()=>Ee(!1),[]),me=(0,l.useCallback)(()=>{Ee(!1),a()},[a]),[ae,se]=(0,l.useState)(n("—")),[Ie,Ce]=(0,l.useState)(!1),Be=o.useProjectData(),J=o.usePlanFeatureGate("version_history"),ye=o.usePlanFeatureGate("code_editor"),Te=o.usePlanFeatureGate("preview_service"),he=o.usePlanFeatureGate("undo_redo"),je=o.isEditorLockedByPlan(Be,{isPlugin:!0}),ze=o.usePushToDataLayer(),C=e?.project,T=ge=>{const We=$==="block"?"block":"email";typeof ge=="string"?(i.setDirection(ge),!L&&i.toggle()):i.toggle(),ze({event:"activate",action:"activate_code_mode",entity_type:We,entity_id:e?.id||u||d,project_id:e?.project||C}),setTimeout(()=>{r($==="block"?o.setElementSettings({type:null}):o.setElementSettings$1({type:null}))},300),c({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),ye.isLocked&&(ee(!0),ve(o.FEATURE_UPSELL_SLIDE.code_editor))},P=(0,l.useCallback)(async()=>!0,[v]),N=async()=>{if(je){ee(!0),ve(8);return}await P()&&(r(o.openModal$1(o.MODALS.SEND_TEST_EMAIL)),ze({event:"open",action:"open_test_email_modal",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C}))},D=()=>{ee(!0),ve(o.FEATURE_UPSELL_SLIDE.undo_redo)},b=()=>{x.undo()},W=()=>{x.redo()},Pe=async()=>{const ge=(await de.fire({project:C,id:u})).find(We=>We===!1||typeof We=="string");ge!==!1&&navigator.clipboard.writeText(ge||o.buildEmailRawShareUrl(u,C)).then(()=>{z.success(n("A shareable link to this page has been copied to the clipboard.")),ze({event:"click",action:"share_email",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C})})},Ae=async()=>{if(!h){if(!await P())return;const ge={email:u,subject:encodeURIComponent("#"+e.project+" "+e.title).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A"),content:encodeURIComponent(Z()).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A")};p(ge),_(!0),ze({event:"click",action:"open_email_inbox_tests",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C})}},Qe=(0,l.useCallback)(async()=>{await P()&&(se(n("—")),Ee(!0))},[n,P]);(0,l.useEffect)(()=>{S.isError&&(z.error(S),_(!1))},[S]),(0,l.useEffect)(()=>{if(S.isSuccess&&h){if(S.data?.status===401)z.error({title:S.data.code,description:S.data.message});else if(S.data){let ge=document.createElement("A");ge.setAttribute("target","_blank"),ge.setAttribute("href",S.data.message),ge.click()}_(!1)}},[S,h,z]);const[Ge,Ze]=(0,l.useState)(!1),mt=()=>{c({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:M}),r(o.switchIsPanelHistoryCollapsed(!M))},vt=()=>w(e?.id),ft=()=>{M?(Ze(!0),vt().then(ge=>{ge.isSuccess?ge.data.data.length:ge.isError&&z.error(ge),mt(),r(o.setActiveSettingsTab(o.HISTORY)),Ze(!1),ze({event:"open",action:"open_version_control",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C}),J.isLocked&&(ee(!0),ve(o.FEATURE_UPSELL_SLIDE.version_history))})):(r(o.resetToLastActiveSettingsTab()),mt())},lt=()=>{M||(mt(),r(o.resetToLastActiveSettingsTab())),L&&i.toggle(),ee(!1)};let G=[];const Y=(0,l.useCallback)(async()=>{const ge=await pe.fire({project:C,id:u});ge.find(We=>We===!1||typeof We=="string")!==!1&&(window.open(ge.find(We=>We)||o.buildEmailRawSharePath(u,C)),ze({event:"click",action:"open_email_preview",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C}))},[pe,C,u,ze,$,e,d]),ne=(0,l.useCallback)(async()=>{window.open(o.buildGetElementPreviewPath(o.EMAIL,u,C)),ze({event:"click",action:"open_web_version",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||C})},[C,u,ze,$,e,d]);B.previewModeEnabled&&G.push({key:"Preview_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Preview mode"),onClick:Y}),B.livePreviewEnabled&&G.push({key:"Live_preview",icon:h?(0,s.jsx)(o.EmIcons,{icon:"LoadingOutlined",component:y.icons$LoadingOutlined,style:{fontSize:16}}):(0,s.jsx)(o.EmIcons,{icon:"CheckCircleVerified",component:y.icons$CheckCircleVerified,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Live preview"),onClick:k.id?.toString()===e.project_author?.toString()&&k?.subscription?.post_name==="community"&&A?Qe:Ae}),B.webversionEnabled&&G.push({key:"Web version",icon:(0,s.jsx)(o.EmIcons,{icon:"Web",component:y.icons$Web,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Web version"),onClick:ne}),B.sharePreviewEnabled&&G.push({key:"Share",icon:(0,s.jsx)(o.EmIcons,{icon:"ShareAltOutlined",component:y.icons$ShareAltOutlined,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Share"),onClick:Pe,className:"em-analytics__email-share"});const ue=[{key:"Left_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:B.iconStrokeWidth,style:{color:I==="left"&&L?j.colorPrimary:"inherit"}}),label:n("Left Code panel"),onClick:()=>T("left")},{key:"Right_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:B.iconStrokeWidth,style:{transform:"rotate(180deg)",color:I==="right"&&L?j.colorPrimary:"inherit"}}),label:n("Right Code panel"),onClick:()=>T("right")},{key:"Bottom_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:B.iconStrokeWidth,style:{transform:"rotate(-90deg)",color:I==="bottom"&&L?j.colorPrimary:"inherit"}}),label:n("Bottom Code panel"),onClick:()=>T("bottom")}];return(0,s.jsxs)("div",{className:"email-preview-menu email-preview-menu_new",children:[(0,s.jsxs)(y.ui_kit$Space,{size:32,children:[(0,s.jsxs)(y.ui_kit$Space,{className:"email-preview-menu__versions",size:8,style:{borderRadius:`calc(${o.emCssVar("borderRadius")} * 1px)`},children:[(0,s.jsx)(y.ui_kit$Tooltip,{title:n(t?o.COLLABORATION_EDITOR_WARNING_TEXT:"Undo (Ctrl+Z)"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"UndoOutlined",component:y.icons$UndoOutlined,size:22,strokeWidth:B.iconStrokeWidth}),he.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:he.isLocked?D:b,disabled:!he.isLocked&&!K.canUndo})}),(0,s.jsx)(y.ui_kit$Tooltip,{title:n(t?o.COLLABORATION_EDITOR_WARNING_TEXT:"Redo (Ctrl+Shift+Z)"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"RedoOutlined",component:y.icons$RedoOutlined,size:22,strokeWidth:B.iconStrokeWidth}),he.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:he.isLocked?D:W,disabled:!he.isLocked&&!K.canRedo})}),B.historyEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Version history"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:M?"text":"primary",ghost:!M,onClick:ft,disabled:e.isNew||Ge,className:"email-preview-menu__history",icon:Ge?(0,s.jsx)(y.ui_kit$Spin,{size:"small"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"HistoryOutlined",component:y.icons$HistoryOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon email-preview-menu__list-item-icon_revert"}),J.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]})})})]}),(0,s.jsxs)(y.ui_kit$Space,{size:8,style:{borderRadius:`calc(${o.emCssVar("borderRadius")} * 1px)`},children:[B.codeEnabled&&(0,s.jsx)(y.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:ue},trigger:"hover",mouseEnterDelay:0,className:"email-preview-menu__code",children:(0,s.jsx)(y.ui_kit$Button,{type:L?"primary":"text",ghost:L,icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"Code",component:y.icons$Code,size:22,strokeWidth:B.iconStrokeWidth}),ye.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:T})},"Code mode"),B.previewIconEnabled&&(Te.isLocked?(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Preview mode"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:()=>{ee(!0),ve(o.FEATURE_UPSELL_SLIDE.preview_service)}})}):(0,s.jsx)(y.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:G},className:"email-preview-menu__preview",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",target:"_blank",rel:"noreferrer",icon:(0,s.jsx)(o.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),onClick:B.previewModeEnabled?Y:void 0})},"Preview")),B.sendTestEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Send a test email"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__email-open-test email-preview-menu__test",type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"SendOutlined",component:y.icons$SendOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),je&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:N})})]})]}),f&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Ou,{isModalVisible:m,email:e})}),(0,s.jsx)(Wm,{open:Ie,onClose:()=>Ce(!1)}),(0,s.jsx)(o.PlanUpgradePrompt,{open:q,onCancel:lt,initialSlide:Fe}),fe&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(rr,{open:et,onClose:Q,title:n(cr.titleKey),subtitle:n(cr.subtitleKey),usageResource:cr.usageResource,previousDisplay:ae,nextDisplay:o.presetLimitDisplay("infinity"),onChangePlan:me})})]})};pa.propTypes={};var Hm=[["brace-percent",/<!--\{%/],["brace-hash",/<!--\{#/],["proscript",/<!--\[%/],["getresponse",/<!--\[\[(?:if|else\]\]|endif\]\])/i],["mailchimp",/<!--\*\|/],["expert-sender",/<!--<\/?(?:if|else|var)/i]],qm=200;function fa(e=new Set){const t=new Set;return(n,r)=>{if(!Hm.some(([a,c])=>!e.has(a)&&c.test(n)))return;const i=r??`new:${n.length}:${n.slice(0,200)}`;t.has(i)||(t.size>=qm&&t.clear(),t.add(i))}}function ha(){return{isConfigured:()=>!1,toEditorForm:e=>e,toOutputForm:e=>e,keepWrappedOnOutput:new Set,editorPolicy:{},warnAboutUnconfiguredInput:fa()}}var Vm=ha();function rn(e){return e?.getInstance(g.TEMPLATE_DIRECTIVES_ID)??Vm}function Ym({html:e,renderGuid:t,showToken:n,showId:r,...i},a){const{requested:c}=o.getCurrentProject(a),d=o.getAppConfig(a);return o.filterUndefined({...i,code:rn(a).toOutputForm(e),project:c===void 0?i.project:c,utm_parameters:d.UTMEnabled?i.utm_parameters:void 0,tags:void 0,template:void 0,guid:void 0,emailtags:void 0,project_title:void 0,project_author:void 0,is_template:void 0,is_inited:void 0})}var Km=zt.__commonJSMin(((e,t)=>{o.init__polyfill_node_global(),(function(n,r){typeof define=="function"&&define.amd?define([],r):typeof e<"u"?r():(r(),n.FileSaver={})})(e,function(){"use strict";function n(m,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(f={autoBom:!f}),f.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(m.type)?new Blob(["\uFEFF",m],{type:m.type}):m}function r(m,f,h){var _=new XMLHttpRequest;_.open("GET",m),_.responseType="blob",_.onload=function(){u(_.response,f,h)},_.onerror=function(){},_.send()}function i(m){var f=new XMLHttpRequest;f.open("HEAD",m,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function a(m){try{m.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),m.dispatchEvent(f)}}var c=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof o._polyfill_node_global_default=="object"&&o._polyfill_node_global_default.global===o._polyfill_node_global_default?o._polyfill_node_global_default:void 0,d=c.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=c.saveAs||(typeof window!="object"||window!==c?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(m,f,h){var _=c.URL||c.webkitURL,p=document.createElement("a");f=f||m.name||"download",p.download=f,p.rel="noopener",typeof m=="string"?(p.href=m,p.origin===location.origin?a(p):i(p.href)?r(m,f,h):a(p,p.target="_blank")):(p.href=_.createObjectURL(m),setTimeout(function(){_.revokeObjectURL(p.href)},4e4),setTimeout(function(){a(p)},0))}:"msSaveOrOpenBlob"in navigator?function(m,f,h){if(f=f||m.name||"download",typeof m!="string")navigator.msSaveOrOpenBlob(n(m,h),f);else if(i(m))r(m,f,h);else{var _=document.createElement("a");_.href=m,_.target="_blank",setTimeout(function(){a(_)})}}:function(m,f,h,_){if(_=_||open("","_blank"),_&&(_.document.title=_.document.body.innerText="downloading..."),typeof m=="string")return r(m,f,h);var p=m.type==="application/octet-stream",S=/constructor/i.test(c.HTMLElement)||c.safari,k=/CriOS\/[\d]+/.test(navigator.userAgent);if((k||p&&S||d)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var x=w.result;x=k?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),_?_.location.href=x:location=x,_=null},w.readAsDataURL(m)}else{var v=c.URL||c.webkitURL,A=v.createObjectURL(m);_?_.location=A:location.href=A,_=null,setTimeout(function(){v.revokeObjectURL(A)},4e4)}});c.saveAs=u.saveAs=u,typeof t<"u"&&(t.exports=u)})})),an=Km(),In="NEXT_BUTTON",dr="SAVE_BUTTON",ur="KEYBOARD",Qm="EXTERNAL",Xm=new Set([dr,In,ur]);function Jm(e){return e!=null&&e!==""&&Xm.has(e)}function ga(e){if(!e||e==="all")return;const t=Number(e);return Number.isFinite(t)?[t]:void 0}var ya=(0,l.createContext)(null);function Zm(){const e=(0,l.useContext)(ya);if(!e)throw new Error("useEmailSaveController must be used within EmailSaveContext.Provider");return e}var ep=2;function tp({email:e,documentSession:t,save:n,saveState:r}){const i=o.useDispatch(),{__:a}=o.useI18n(),c=o.useEditorProjectId();o.useRouteEmailId();const d=+c,u=Number.isFinite(d)&&d>0?d:e?.project,m=o.useCookieManager(),f=o.useContainer(),h=o.useNotification(),_=o.useAppConfig(),p=o.useConfigSource(),[S,k]=(0,l.useState)(0),w=(0,l.useRef)(""),[v,A]=(0,l.useState)(!1),x=o.useEventEmitter(g.events.ON_NEXTBUTTON_CLICK_ID),K=o.useEventEmitter(g.events.ON_SAVEBUTTON_CLICK_ID);o.useEvent(g.events.ON_EMAIL_INIT_ID);const Z=_.activeNextButton===!1,M=_.disableDoubleClickNextButton!==!1,L=(0,l.useRef)(!1),I=(0,l.useRef)(void 0),j=(0,l.useRef)(null),z=(0,l.useRef)(null),B=(0,l.useRef)(e);B.current=e;const $=(0,l.useCallback)(()=>{I.current=void 0},[]),de=(0,l.useCallback)(J=>{p.merge({activeNextButton:!J},"user")},[p]),pe=(0,l.useCallback)((J,ye)=>{const Te=o.saveRefusalReason(ye);if(Te==="locked"){h.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:o.getEmailDesc(J),message:a("No access to edit the letter.")});return}if(Te==="too-many-tags"){h.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:o.getEmailDesc(J),message:a("Maximum 10 tags available.")});return}const he=o.failedTerms(ye);if(he){he.failed.forEach(je=>{if(he.kind==="group"){h.fromError("GROUP_CREATING_ERROR",{id:je.id??0,name:je.name,parent:je.parent??0},ye);return}h.fromError("TAG_CREATING_ERROR",je.name,ye)});return}h.fromError(J.isNew?"EMAIL_CREATING_ERROR":"EMAIL_EDITING_ERROR",o.getEmailDesc(J),ye)},[h,a]),q=(0,l.useCallback)(J=>{const ye=Jm(J),Te=()=>{A(!1),J===In&&(L.current=!1,de(!1))};if(!e){Te();return}const he=async()=>{(ze=>{n("publish",{project:ze.isNew?u:ze.project,folder:ga(m.get(o.APP_COOKIES.em_folder)),source:J}).then(C=>{if(A(!1),L.current=!1,!C){J===In&&de(!1),ye&&(pe(ze,r().error),$());return}ye&&(h.success({id:"EMAIL_SAVING_SUCCESS",message:a("The email was successfully saved."),data:o.getEmailDesc(ze)}),$())})})(e)};A(!0),he()},[e,i,c,a,t,m,u,h,pe,n,r,de,$]);o.useCommand(o.SAVE_COMMAND_ID,(0,l.useCallback)(J=>q(J||Qm),[q]));const ee=(0,l.useRef)(void 0),Fe=(0,l.useRef)(q);Fe.current=q;const ve=(0,l.useCallback)(J=>{w.current=J,k(ye=>ye+1)},[]);(0,l.useEffect)(()=>()=>{ee.current!==void 0&&clearTimeout(ee.current)},[]),(0,l.useEffect)(()=>{if(S===0)return;const J=w.current;B.current?.isNew&&(I.current=J),ee.current!==void 0&&clearTimeout(ee.current),ee.current=setTimeout(()=>{ee.current=void 0,Fe.current(J)})},[S]);const et=(0,l.useCallback)(J=>{(J.ctrlKey||J.metaKey)&&J.keyCode===83&&(J.preventDefault(),ve(ur))},[ve]);(0,l.useEffect)(()=>(document.addEventListener("keydown",et),()=>{document.removeEventListener("keydown",et)}),[et]);const Ee=(0,l.useCallback)(J=>{const ye=J.data.operation,Te=J.data.action;ye===o.EVENT_TYPES.APPLICATION_ACTION&&Te==="save_email"&&ve(ur)},[ve]);o.useListenPostMessage(Ee),(0,l.useEffect)(()=>{e?.isNew&&(z.current=null,j.current=null)},[e?.isNew,e?.renderGuid]),(0,l.useEffect)(()=>{L.current=!1},[e?.id]);const fe=m.get(o.APP_COOKIES.em_folder),Q=f?o.provideAutosaveUiFacts(f):void 0;(0,l.useEffect)(()=>{Q?.set({...Q?.get()??{isUserBusy:!1,saveContext:{}},saveContext:{project:u,folder:ga(fe)}})},[Q,u,fe]);const me=(0,l.useRef)(!1),ae=r().failures;(0,l.useEffect)(()=>{ae>=ep&&!me.current&&(me.current=!0,h.warning({message:a("Changes are not being saved. Check your connection.")})),ae===0&&(me.current=!1)},[ae,h,a]);const se=v,Ie=r().saving,Ce=(0,l.useCallback)(J=>{ve(J||dr)},[ve]),Be=(0,l.useCallback)(async(J,ye)=>{if(J===In){if(L.current)return;L.current=!0;try{M&&de(!0),(await x.fire(ye)).every(Te=>Te!==!1)?ve(In):(de(!1),L.current=!1)}catch(Te){h.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",o.getEmailDesc(ye),Te,!0),de(!1),L.current=!1}return}try{(await K.fire(ye)).every(Te=>Te!==!1)&&ve(J||dr)}catch(Te){h.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",o.getEmailDesc(ye),Te,!0)}},[M,x,K,h,de,ve]);return(0,l.useMemo)(()=>({requestSave:Ce,requestSaveWithEvents:Be,isLoading:se,isAutosaveLoading:Ie,nextButtonDisabled:Z}),[Ce,Be,se,Ie,Z])}var np="NEXT_BUTTON",op="SAVE_BUTTON",_a=({email:e=null,disabled:t})=>{const{__:n}=o.useI18n(),r=o.useAppConfig(),i=o.useContentReader(),a=o.useNotification(),{requestSaveWithEvents:c,isLoading:d,isAutosaveLoading:u,nextButtonDisabled:m}=Zm(),f=d||u,[h,_]=(0,l.useState)(null);(0,l.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&_(!0)},[]);const p=r.saveButtonEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n(h?"Save by ⌘S":"Save by Ctrl+S"),placement:"bottom",children:(0,s.jsx)("span",{className:"em-analytics__email-save-tooltip-target",children:(0,s.jsx)(y.ui_kit$Button,{disabled:t||u,type:r.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:f,icon:(0,s.jsx)(o.EmIcons,{icon:"SaveOutlined",component:y.icons$SaveOutlined,size:16,strokeWidth:r.iconStrokeWidth}),onClick:async k=>{const w=k.currentTarget,v={...e,html:i()};try{await c(op,v)}catch(A){a.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",o.getEmailDesc(v),A,!0)}finally{try{w?.blur?.()}catch{}}},children:r.saveButtonText||n("Save")})})},"save-button"),S=r.nextButtonEnabled&&(0,s.jsx)(y.ui_kit$Button,{disabled:t||m,type:"primary",block:"false",className:"em-analytics__email-save",icon:r.primaryCommandButtonIcon,loading:d,onClick:async()=>{const k={...e,html:i()};await c(np,k)},children:r.nextButtonText||n("Continue")},"next-button");return(0,s.jsx)(s.Fragment,{children:r.saveButtonEnabled&&r.nextButtonEnabled?(0,s.jsx)(y.ui_kit$Space,{children:[p,S]}):[p,S]})};_a.propTypes={email:$e.default.shape({id:$e.default.string,isNew:$e.default.bool,title:$e.default.string,lock:$e.default.bool,subject:$e.default.string,html:$e.default.string,description:$e.default.string,utm_parameters:$e.default.shape({utm_source:$e.default.string,utm_medium:$e.default.string,utm_campaign:$e.default.string,utm_term:$e.default.string,utm_content:$e.default.string}),project:$e.default.number,is_template:$e.default.bool}),disabled:$e.default.bool};var ba=({element:e,context:t="list"})=>{const{__:n,_x:r}=o.useI18n(),[i]=o.useEditEmailMutation(),[a]=o.useEditBlockMutation(),c=o.useNotification(),d=o.usePushToDataLayer();e.hasOwnProperty("type");const u=(f,h)=>{if(f.error)return c.error(f),!1;c.success(n("The ")+(h.hasOwnProperty("type")?n("block"):r("email","letter"))+" "+n("“")+f.data.title+n("”")+n("was successfully")+" "+(h.lock?h.hasOwnProperty("type")?r("unlocked.","block"):r("unlocked.","email"):h.hasOwnProperty("type")?r("locked.","block"):r("locked.","email")))},m=()=>{const f=!e.lock,h=f?"lock_email":"unlock_email";e.hasOwnProperty("type")?a({blockId:e.id,lock:f}).then(_=>{u(_,e),_.error||d({event:f?"lock":"unlock",action:f?"lock_block":"unlock_block",entity_type:"block",entity_id:e.id,project_id:e.project,context:t})}):i({emailId:e.id,lock:f}).then(_=>{u(_,e),_.error||d({event:f?"lock":"unlock",action:h,entity_type:"email",entity_id:e.id,project_id:e.project,context:t})})};return(0,s.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:m,children:e.lock?n("Unlock"):n("Lock")})};ba.propTypes={element:$e.default.shape({lock:$e.default.bool,id:$e.default.string})};var rp=({open:e,codeSize:t,onMinimize:n,onDownloadAsIs:r,onCancel:i})=>{const{__:a}=o.useI18n(),c=o.formatCodeSize(t);return(0,s.jsx)(y.ui_kit$Modal,{open:e,onCancel:i,footer:null,className:"code-size-warning-modal",width:480,children:(0,s.jsxs)("div",{className:"code-size-warning-modal__content",children:[(0,s.jsx)("h3",{className:"code-size-warning-modal__title",children:a("Code Size Warning")}),(0,s.jsxs)("div",{className:"code-size-warning-modal__message",children:[(0,s.jsxs)("p",{children:[a("The current code size is")," ",(0,s.jsx)("strong",{children:c}),","," ",a("which exceeds the recommended 90 KB limit.")]}),(0,s.jsx)("p",{children:a("Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.")})]}),(0,s.jsxs)(y.ui_kit$Space,{className:"code-size-warning-modal__actions",size:"medium",children:[(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:n,size:"large",children:a("Minimize code")}),(0,s.jsx)(y.ui_kit$Button,{onClick:r,size:"large",children:a("Download as is")})]})]})})};function ip(e){return e.includes("em-narrow-table")}function ap(e){if(!e||ip(e))return!1;const t=e.includes("nl-container"),n=/row-content\s+stack/.test(e)||/stack\s+row-content/.test(e),r=/\brow-\d/.test(e),i=/_block\s+block-\d/.test(e),a=e.includes('role="presentation"');return t&&n&&(r||i)&&a}function sp(e){return e?e.includes("em-narrow-table"):!1}function lp(e){return e.includes("em-narrow-table")}function cp(e){return e.includes("i-amphtml")||e.includes("amp-runtime")||e.includes("amp-version")}function dp(e){if(!e||lp(e)||cp(e))return!1;const t=e.includes("es-wrapper"),n=/es-(?:header|content|footer)-body/.test(e);return t||n}function va(){o.useAppConfig();const e=o.useIntegratorConfigValue("beeFreeConverterEnabled"),t=o.useIntegratorConfigValue("stripoConverterEnabled"),n=o.useIntegratorConfigValue("aiLayoutConverterEnabled"),r=e===!0,i=t===!0,a=n===!0;return{beeFreeConverterEnabled:r,stripoConverterEnabled:i,aiLayoutConverterEnabled:a,anyConverterEnabled:r||i||a}}function Ea(e,t){return!e||sp(e)?null:ap(e)?t.beeFreeConverterEnabled?"beefree":null:dp(e)?t.stripoConverterEnabled?"stripo":null:t.aiLayoutConverterEnabled?"ai":null}var up=()=>"emailmaker",mp={unisender:{id:"unisender",name:"Unisender",icon:"/images/integrations/unisender.svg",description:"Export emails to Unisender",cardDescription:"Mass mailing automation, audience segmentation, and campaign performance analytics.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Unisender API key",helpUrl:"https://app.unisender.com/ru/v5/cp/user/info/api"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Unisender"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"number",label:"Contact List ID",required:!0,placeholder:"e.g., 123456"}]},mailganer:{id:"mailganer",name:"Mailganer",icon:"/images/integrations/mailganer.svg",description:"Export emails to Mailganer",cardDescription:"Contact sync, content personalization, and real-time campaign results tracking.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Mailganer API key",helpUrl:"https://mailganer.com/app/profile/"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Mailganer"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Mailing Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"theme",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},sendsay:{id:"sendsay",name:"Sendsay",icon:"/images/integrations/sendsay.svg",description:"Export emails to Sendsay",cardDescription:"Mailing automation, audience segmentation, and email personalization.",apps:["emailmaker"],settingsFields:[{name:"login",type:"text",label:"Account Login",required:!0,placeholder:"e.g., myaccount or myaccount/sublogin",extra:"Your Sendsay account login (not email). For sublogin use format: account/sublogin",fullWidth:!0},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Sendsay API key",helpUrl:"https://docs.sendsay.ru/sendsay-api/how-to-get-apikey"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Sendsay"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Draft Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]},klaviyo:{id:"klaviyo",name:"Klaviyo",icon:"/images/integrations/klaviyo.svg",description:"Export emails to Klaviyo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., pk_xxxxxxxx",helpUrl:"https://help.klaviyo.com/hc/en-us/articles/7423954176283-How-to-create-a-private-API-key",extra:"Use a custom key with templates:write and campaigns:write (or Full access). Campaigns-only is not enough — export creates a template first."},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Klaviyo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., ABC123",helpText:"Find your List ID in Klaviyo: Lists & Segments → List → Settings"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},campaign_monitor:{id:"campaign_monitor",name:"Campaign Monitor",icon:"/images/integrations/campaign_monitor.svg",description:"Export emails to Campaign Monitor",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.campaignmonitor.com/s/article/api-keys"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"e.g., 4a397ccaaa55eb4e6aa1221e1e2d7122",helpText:"Find in Account Settings → API Keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Campaign Monitor"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",helpText:"Find in Lists → List ID"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},constant_contact:{id:"constant_contact",name:"Constant Contact",icon:"/images/integrations/constant_contact.svg",description:"Export emails to Constant Contact",apps:["useblocks"],settingsFields:[{name:"access_token",type:"password",label:"Access Token",required:!0,placeholder:"OAuth2 Bearer token",fullWidth:!0,helpText:"Get from Constant Contact Developer Portal. Token expires in 24 hours.",helpUrl:"https://developer.constantcontact.com/api_guide/getting_started.html"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be confirmed in Constant Contact"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"Contact List ID",required:!0,placeholder:"e.g., fa32f620-6d82-11e8-8b59-fa163e56c9b0",helpText:"Find via GET /contact_lists API"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},bento:{id:"bento",name:"Bento",icon:"/images/integrations/bento.svg",description:"Export emails to Bento",apps:["useblocks"],settingsFields:[{name:"publishable_key",type:"password",label:"Publishable Key",required:!0,placeholder:"Enter Publishable Key",fullWidth:!0,helpUrl:"https://app.bentonow.com/account/teams"},{name:"secret_key",type:"password",label:"Secret Key",required:!0,placeholder:"Enter Secret Key",fullWidth:!0},{name:"site_uuid",type:"text",label:"Site UUID",required:!0,placeholder:"Your site UUID",helpText:"Find in Bento dashboard"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be an author in your Bento account"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Broadcast Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"},{name:"inclusive_tags",type:"text",label:"Tags (inclusive)",required:!1,placeholder:"e.g., subscribers,newsletter",helpText:"Comma-separated tags to send to. Default: subscribers"}]},dotdigital:{id:"dotdigital",name:"Dotdigital",icon:"/images/integrations/dotdigital.svg",description:"Export emails to Dotdigital",apps:["useblocks"],settingsFields:[{name:"username",type:"text",label:"API Username",required:!0,placeholder:"API user email",helpText:"API user email from Settings → Access → API users",helpUrl:"https://developer.dotdigital.com/docs/setting-up-an-api-user"},{name:"password",type:"password",label:"API Password",required:!0,placeholder:"API user password",fullWidth:!0},{name:"region",type:"text",label:"Region",required:!0,placeholder:"r1, r2, or r3",helpText:"r1=Europe, r2=North America, r3=Asia Pacific"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",fullWidth:!0,extra:"Use an email registered as a Custom from address in Dotdigital (see support.dotdigital.com — “Create a custom from address”). If it does not match, export uses your account default sender."},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},getresponse:{id:"getresponse",name:"GetResponse",icon:"/images/integrations/getresponse.svg",description:"Export emails to GetResponse",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://app.getresponse.com/api"},{name:"from_field_id",type:"text",label:"From Field ID",required:!0,placeholder:"e.g., V",helpText:"Find via GET /from-fields API"}],exportFields:[{name:"name",type:"text",label:"Newsletter Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"campaign_id",type:"text",label:"Campaign ID",required:!0,placeholder:"e.g., C",helpText:"List/campaign ID from GET /campaigns"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},brevo:{id:"brevo",name:"Brevo",icon:"/images/integrations/brevo.svg",description:"Export emails to Brevo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.brevo.com/hc/en-us/articles/209467485-Create-and-manage-your-API-keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Brevo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"number",label:"List ID",required:!0,placeholder:"e.g., 2",helpText:"Find in Contacts → Lists"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},activecampaign:{id:"activecampaign",name:"ActiveCampaign",icon:"/images/integrations/activecampaign.svg",description:"Export emails as draft campaigns to ActiveCampaign",apps:["useblocks"],settingsFields:[{name:"api_url",type:"text",label:"API URL",required:!0,placeholder:"e.g., https://youraccount.api-us1.com",helpText:"Find in Settings → Developer → API Access",helpUrl:"https://help.activecampaign.com/hc/en-us/articles/207317590-Getting-started-with-the-API"},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., 1",extra:"Find in Lists → Click your list → The ID is in the URL (e.g., /app/contacts?listid=1)"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in ActiveCampaign"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},salesforce_mc:{id:"salesforce_mc",name:"Salesforce",icon:"/images/integrations/salesforce.svg",description:"Export emails to Salesforce",apps:["useblocks"],settingsFields:[{name:"subdomain",type:"text",label:"Tenant Subdomain",required:!0,placeholder:"e.g., mc563885gzs27c5t9-63k636ttgm",helpText:"Find in Installed Packages → API Integration → REST Base URI",helpUrl:"https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/your-subdomain-tenant-specific-endpoints.html"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"From Installed Package"},{name:"client_secret",type:"password",label:"Client Secret",required:!0,placeholder:"From Installed Package"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Marketing Cloud"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},hubspot:{id:"hubspot",name:"HubSpot Email",icon:"/images/integrations/hubspot.svg",description:"Export emails to HubSpot",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"Private App Access Token",required:!0,placeholder:"e.g., pat-na1-xxxx",helpUrl:"https://developers.hubspot.com/docs/api/private-apps"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in HubSpot"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},mailchimp:{id:"mailchimp",name:"Mailchimp",icon:"/images/integrations/mailchimp.svg",description:"Export emails to Mailchimp",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., xxxxxxxx-us1",helpUrl:"https://mailchimp.com/help/about-api-keys/"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Mailchimp"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"Audience ID",required:!0,placeholder:"e.g., a1b2c3d4e5",helpText:"Find your Audience ID in Audience settings → Audience name and defaults"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},enkod:{id:"enkod",name:"enKod",icon:"/images/integrations/enkod.svg",description:"Export emails to enKod",cardDescription:"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter enKod API key",helpUrl:"https://help.enkod.io/doku.php/api:start"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]}},pp=(e,t)=>!e.apps||e.apps.length===0?!0:e.apps.includes(t),mr=e=>{const t=mp[e];if(t&&pp(t,up()))return t},fp=(e,t)=>{const n={placeholder:e.placeholder?t(e.placeholder):void 0,style:{width:"100%"}};switch(e.type){case"number":return(0,s.jsx)(y.ui_kit$InputNumber,{...n,min:1});case"email":return(0,s.jsx)(y.ui_kit$Input,{...n,type:"email"});default:return(0,s.jsx)(y.ui_kit$Input,{...n})}},hp=({integration:e,visible:t,loading:n=!1,onConfirm:r,onCancel:i,__:a})=>{const[c]=y.ui_kit$Form.useForm(),d=e.exportFields||[];(0,l.useEffect)(()=>{t||c.resetFields()},[t,c]);const u=()=>{n||c.validateFields().then(h=>{r(h)})},m=()=>{c.resetFields(),i()};if(d.length===0)return null;const f=d.find(h=>h.helpText);return(0,s.jsxs)(y.ui_kit$Modal,{title:a(`Export to ${e.name}`),open:t,onOk:u,onCancel:m,okText:a("Export"),cancelText:a("Cancel"),confirmLoading:n,cancelButtonProps:{disabled:n},children:[f&&(0,s.jsx)(y.ui_kit$Alert,{title:a(f.label),description:a(f.helpText),type:"info",showIcon:!0,style:{marginBottom:16}}),(0,s.jsx)(y.ui_kit$Form,{form:c,layout:"vertical",children:d.map(h=>(0,s.jsx)(y.ui_kit$Form.Item,{label:a(h.label),name:h.name,rules:[...h.required?[{required:!0,message:a(`Please enter ${h.label.toLowerCase()}`)}]:[],...h.type==="number"?[{type:"number",message:a(`${h.label} must be a number`)}]:[]],children:fp(h,a)},h.name))})]})},Xn=o.createApi({reducerPath:"unisenderApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmailMessage:e.mutation({query:t=>{const n="https://api.unisender.com/ru/api/createEmailMessage",r=new URLSearchParams;return r.append("format","json"),Object.entries(t).forEach(([i,a])=>{r.append(i,String(a))}),{url:`?proxy_url=${encodeURIComponent(n)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()}}})})}),{useCreateEmailMessageMutation:gp}=Xn,Jn=o.createApi({reducerPath:"mailganerApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://mailganer.com"}),endpoints:e=>({createMailing:e.mutation({query:t=>{const n=new URLSearchParams;return n.append("api_key",t.api_key),n.append("name",t.name),n.append("html-content",t.html_content),t.theme&&n.append("theme",t.theme),t.from_name&&n.append("from_name",t.from_name),t.from_email&&n.append("from_email",t.from_email),t.segment_id&&n.append("segment_id",String(t.segment_id)),t.utm_campaign&&n.append("utm_campaign",t.utm_campaign),t.utm_source&&n.append("utm_source",t.utm_source),t.utm_medium&&n.append("utm_medium",t.utm_medium),{url:"/api/v1/mailing/create/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()}}})})}),{useCreateMailingMutation:yp}=Jn,Zn=o.createApi({reducerPath:"sendsayApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://api.sendsay.ru"}),endpoints:e=>({createDraft:e.mutation({query:t=>{const n={action:"issue.draft.set",apikey:t.api_key,return_fresh_obj:1,obj:{name:t.name,letter:{subject:t.subject,"from.name":t.from_name||void 0,"from.email":t.from_email||void 0,message:{html:t.html_content}}}};return{url:`/general/api/v100/json/${t.login.split("/").map(r=>encodeURIComponent(r)).join("/")}`,method:"POST",headers:{"Content-Type":"application/json"},body:n}}})})}),{useCreateDraftMutation:_p}=Zn,eo=o.createApi({reducerPath:"altcraftApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({addTemplate:e.mutation({query:t=>{const n=`${t.api_url}/api/v1.1/templates/add`,r={token:t.api_key,name:t.name,channels:[{sid:"email",fields:{html:t.html_content,text:"",subject:t.subject||t.name,from_email:t.from_email||"",from_name:t.from_name||"",replyto_email:"",replyto_name:"",is_not_inline:!0}}],is_draft:t.is_draft??!1};return{url:`?proxy_url=${encodeURIComponent(n)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}}})})}),{useAddTemplateMutation:bp}=eo,vp=e=>e.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/\s+/g," ").trim(),to=o.createApi({reducerPath:"enkodApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://api.enkod.ru"}),endpoints:e=>({createMessage:e.mutation({query:t=>{const n=vp(t.html_content)||t.subject,r={message:{subject:t.subject,fromEmail:t.sender_email||"",fromName:t.sender_name||"",html:t.html_content,plainText:n},isDraft:!0};return{url:"/v1/message/onetime/",method:"POST",headers:{"Content-Type":"application/json",Apikey:t.api_key},body:r}}})})}),{useCreateMessageMutation:Ep}=to,Sp=e=>{const t=e.split("-");return t.length>1?t[1]:"us1"},wp=e=>`https://${Sp(e)}.api.mailchimp.com/3.0`,no=o.createApi({reducerPath:"mailchimpApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=wp(t.api_key),c=btoa(`anystring:${t.api_key}`),d={type:"regular",recipients:{list_id:t.list_id},settings:{subject_line:t.subject,from_name:t.from_name,reply_to:t.from_email}},u=await i({url:`?proxy_url=${encodeURIComponent(`${a}/campaigns`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(d)});if(u.error){const _=u.error,p=_?.data?.detail||_?.error||String(u.error),S=_?.data?.errors;return{error:{status:"CUSTOM_ERROR",error:S?.length?S.map(k=>k.detail||k.title).join("; "):p}}}const m=u.data;if(!m?.id)return{error:{status:"CUSTOM_ERROR",error:u.data?.errors?.map(_=>_.detail||_.title).join("; ")||"Failed to create campaign"}};const f={html:t.html},h=await i({url:`?proxy_url=${encodeURIComponent(`${a}/campaigns/${m.id}/content`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(f)});if(h.error){const _=h.error;return{error:{status:"CUSTOM_ERROR",error:_?.data?.detail||_?.error||String(h.error)}}}return{data:{id:m.id,status:m.status,web_id:m.web_id}}}})})}),{useCreateCampaignMutation:kp}=no,pr="https://a.klaviyo.com/api",Cp="2025-04-15",Tp=e=>({"Content-Type":"application/json",Accept:"application/json",Authorization:`Klaviyo-API-Key ${e}`,revision:Cp}),oo=o.createApi({reducerPath:"klaviyoApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=Tp(t.api_key),c={data:{type:"template",attributes:{name:`Email ${Date.now()}`,editor_type:"CODE",html:t.html}}},d=await i({url:`?proxy_url=${encodeURIComponent(`${pr}/templates`)}`,method:"POST",headers:a,body:JSON.stringify(c)});if(d.error){const w=d.error,v=w?.data?.errors,A=w?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:v?.length?v.map(x=>x.detail||x.status).join("; "):A||w?.error||String(d.error)}}}const u=d.data?.data?.id;if(!u)return{error:{status:"CUSTOM_ERROR",error:"Failed to create template"}};const m={data:{type:"campaign",attributes:{name:`Campaign ${Date.now()}`,audiences:{included:[t.list_id],excluded:[]},send_strategy:{method:"immediate"},"campaign-messages":{data:[{type:"campaign-message",attributes:{definition:{channel:"email",label:t.subject,content:{subject:t.subject,from_email:t.from_email,from_label:t.from_name,reply_to_email:t.from_email}}}}]}}}},f=await i({url:`?proxy_url=${encodeURIComponent(`${pr}/campaigns`)}`,method:"POST",headers:a,body:JSON.stringify(m)});if(f.error){const w=f.error,v=w?.data?.errors,A=w?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:v?.length?v.map(x=>x.detail||x.status).join("; "):A||w?.error||String(f.error)}}}const h=f.data,_=h?.data?.relationships?.["campaign-messages"]?.data?.[0]?.id,p=h?.data?.id;if(!_)return{error:{status:"CUSTOM_ERROR",error:"Failed to get campaign message from campaign"}};const S={data:{type:"campaign-message",id:_,relationships:{template:{data:{type:"template",id:u}}}}},k=await i({url:`?proxy_url=${encodeURIComponent(`${pr}/campaign-message-assign-template`)}`,method:"POST",headers:a,body:JSON.stringify(S)});if(k.error){const w=k.error,v=w?.data?.errors,A=w?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:v?.length?v.map(x=>x.detail||x.status).join("; "):A||w?.error||String(k.error)}}}return{data:{id:p,campaign_message_id:_}}}})})}),{useCreateCampaignMutation:Ip}=oo,Ap="https://api.hubapi.com",xp=e=>({"Content-Type":"application/json",Authorization:`Bearer ${e}`}),ro=o.createApi({reducerPath:"hubspotApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,n,r,i)=>{const a=xp(t.api_key),c={name:t.name,subject:t.subject,from:{fromName:t.from_name,replyTo:t.from_email},content:{templatePath:"@hubspot/email/dnd/plain_text.html",widgets:{"module-0-1-1":{body:{html:t.html,path:"@hubspot/rich_text",schema_version:2},child_css:{},css:{},id:"module-0-1-1",name:"module-0-1-1",order:2,styles:{},type:"module"},"module-1-1-1":{body:{align:"center",path:"@hubspot/email_footer",schema_version:2,unsubscribe_link_type:"both"},child_css:{},css:{},id:"module-1-1-1",name:"module-1-1-1",order:3,styles:{},type:"module"}}}},d=await i({url:`?proxy_url=${encodeURIComponent(`${Ap}/marketing/v3/emails/`)}`,method:"POST",headers:a,body:JSON.stringify(c)});if(d.error){const m=d.error,f=m?.data?.errors,h=m?.data?.message;return{error:{status:"CUSTOM_ERROR",error:f?.length?f.map(_=>_.message||_.errorType).join("; "):h||m?.error||String(d.error)}}}const u=d.data;return u?.id?{data:{id:u.id}}:{error:{status:"CUSTOM_ERROR",error:d.data?.errors?.map(m=>m.message||m.errorType).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:Pp}=ro,io=o.createApi({reducerPath:"salesforceMcApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,n,r,i)=>{const a=`https://${t.subdomain}.auth.marketingcloudapis.com/v2/token`,c=await i({url:`?proxy_url=${encodeURIComponent(a)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:t.client_id,client_secret:t.client_secret})});if(c.error){const p=c.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_description||p?.data?.error||p?.error||String(c.error)}}}const d=c.data,u=d?.access_token,m=d?.rest_instance_url;if(!u||!m)return{error:{status:"CUSTOM_ERROR",error:d?.error_description||d?.error||"Failed to get access token"}};const f={name:t.name,assetType:{id:208,name:"htmlemail"},views:{html:{content:t.html},text:{},subjectline:{content:t.subject},preheader:{}},data:{email:{options:{characterEncoding:"utf-8"}}}},h=await i({url:`?proxy_url=${encodeURIComponent(`${m.replace(/\/$/,"")}/asset/v1/content/assets`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify(f)});if(h.error){const p=h.error,S=p?.data?.errors,k=p?.data?.message;return{error:{status:"CUSTOM_ERROR",error:S?.length?S.map(w=>w.message||w.documentation).join("; "):k||p?.error||String(h.error)}}}const _=h.data;return _?.id?{data:{id:_.id}}:{error:{status:"CUSTOM_ERROR",error:h.data?.errors?.map(p=>p.message).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:Rp}=io,jp=e=>e.replace(/\/$/,""),Lp=e=>e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim()||" ",ao=o.createApi({reducerPath:"activecampaignApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=jp(t.api_url),c=t.api_key,d={"Content-Type":"application/json","Api-Token":c},u=await i({url:`?proxy_url=${encodeURIComponent(`${a}/api/3/addresses`)}`,method:"GET",headers:{"Api-Token":c}});if(u.error)return{error:{status:"CUSTOM_ERROR",error:"Failed to load mailing addresses. Check your API URL and Key."}};const m=u.data?.addresses??[],f=m.find(x=>x.isDefault==="1")??m[0];if(!f?.id)return{error:{status:"CUSTOM_ERROR",error:"NO_MAILING_ADDRESS"}};const h={message:{name:t.name,fromname:t.from_name,fromemail:t.from_email,email:t.from_email,reply2:t.from_email,subject:t.subject,html:t.html,text:Lp(t.html),preheader_text:"",format:"mime"}},_=await i({url:`?proxy_url=${encodeURIComponent(`${a}/api/3/messages`)}`,method:"POST",headers:d,body:JSON.stringify(h)});if(_.error){const x=_.error;return{error:{status:"CUSTOM_ERROR",error:x?.data?.message||x?.error||"Failed to create message."}}}const p=_.data?.message?.id;if(!p)return{error:{status:"CUSTOM_ERROR",error:"Message created but no ID returned."}};const S=`${a}/admin/api.php?api_action=campaign_create&api_output=json`,k=new URLSearchParams;k.append("type","single"),k.append("name",t.name),k.append("sdate","2099-12-31 12:00:00"),k.append("status","0"),k.append("public","1"),k.append("trackreads","1"),k.append("tracklinks","all"),k.append("htmlunsub","1"),k.append("textunsub","1"),k.append("addressid",String(f.id)),k.append(`p[${t.list_id}]`,t.list_id),k.append(`m[${p}]`,"100");const w=await i({url:`?proxy_url=${encodeURIComponent(S)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","Api-Token":c},body:k.toString()});if(w.error){const x=w.error;return{error:{status:"CUSTOM_ERROR",error:x?.data?.result_message||x?.error||"Message created, but campaign creation failed."}}}const v=w.data;if(Number(v?.result_code)===0)return{error:{status:"CUSTOM_ERROR",error:v?.result_message||"Campaign creation failed (v1 API)."}};const A=v?.id;return A?{data:{campaignId:String(A)}}:{error:{status:"CUSTOM_ERROR",error:v?.result_message||"Campaign created but no ID returned."}}}})})}),{useCreateCampaignMutation:Op}=ao,Mp="https://api.brevo.com/v3",so=o.createApi({reducerPath:"brevoApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a={name:t.name,subject:t.subject,sender:{name:t.from_name,email:t.from_email},htmlContent:t.html,recipients:{listIds:[t.list_id]}},c=await i({url:`?proxy_url=${encodeURIComponent(`${Mp}/emailCampaigns`)}`,method:"POST",headers:{"Content-Type":"application/json","api-key":t.api_key},body:JSON.stringify(a)});if(c.error){const u=c.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.data?.code||u?.error||String(c.error)}}}const d=c.data;return d?.id?{data:{id:d.id}}:{error:{status:"CUSTOM_ERROR",error:c.data?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:Np}=so,Dp="https://api.createsend.com/api/v3.3",Fp=e=>`Basic ${btoa(`${e}:x`)}`,lo=o.createApi({reducerPath:"campaignMonitorApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a={Name:t.name,Subject:t.subject,FromName:t.from_name,FromEmail:t.from_email,ReplyTo:t.from_email,HtmlUrl:t.html_url,ListIDs:[t.list_id],InlineCss:!0},c=await i({url:`?proxy_url=${encodeURIComponent(`${Dp}/campaigns/${t.client_id}.json`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:Fp(t.api_key)},body:JSON.stringify(a)});if(c.error){const m=c.error;return{error:{status:"CUSTOM_ERROR",error:m?.data?.Message||m?.error||String(c.error)}}}const d=c.data,u=typeof d=="string"?d:d?.id;return!u||typeof u!="string"?{error:{status:"CUSTOM_ERROR",error:d?.Message||"Failed to create campaign"}}:{data:{id:u}}}})})}),{useCreateCampaignMutation:Bp}=lo,Sa="https://api.cc.email/v3",Up=e=>e.includes("[[trackingImage]]")?e:e.replace(/<body([^>]*)>/i,"<body$1>[[trackingImage]]"),co=o.createApi({reducerPath:"constantContactApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=Up(t.html),c={name:t.name,email_campaign_activities:[{format_type:5,from_email:t.from_email,reply_to_email:t.from_email,from_name:t.from_name,subject:t.subject,html_content:a}]},d=await i({url:`?proxy_url=${encodeURIComponent(`${Sa}/emails`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(c)});if(d.error){const p=d.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_message||p?.data?.error_key||p?.error||String(d.error)}}}const u=d.data,m=u?.campaign_activities?.find(p=>p.role==="primary_email")?.campaign_activity_id,f=u?.campaign_id;if(!m||!f)return{error:{status:"CUSTOM_ERROR",error:"Failed to create campaign"}};const h={campaign_activity_id:m,campaign_id:f,role:"primary_email",contact_list_ids:[t.list_id],segment_ids:[],current_status:"DRAFT",format_type:5,from_email:t.from_email,from_name:t.from_name,reply_to_email:t.from_email,subject:t.subject,html_content:a},_=await i({url:`?proxy_url=${encodeURIComponent(`${Sa}/emails/activities/${m}`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(h)});if(_.error){const p=_.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_message||p?.data?.error_key||p?.error||String(_.error)}}}return{data:{campaign_id:f}}}})})}),{useCreateCampaignMutation:$p}=co,zp="https://api.getresponse.com/v3",Gp=e=>`api-key ${e}`,uo=o.createApi({reducerPath:"getresponseApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createNewsletter:e.mutation({queryFn:async(t,n,r,i)=>{const a=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),c={name:t.name,type:"draft",subject:t.subject,fromField:{fromFieldId:t.from_field_id},replyTo:{fromFieldId:t.from_field_id},campaign:{campaignId:t.campaign_id},content:{html:t.html,plain:a||"Newsletter"},flags:["openrate","clicktrack"],sendSettings:{selectedCampaigns:[t.campaign_id]}},d=await i({url:`?proxy_url=${encodeURIComponent(`${zp}/newsletters`)}`,method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":Gp(t.api_key)},body:JSON.stringify(c)});if(d.error){const m=d.error;return{error:{status:"CUSTOM_ERROR",error:m?.data?.message||m?.data?.code||m?.error||String(d.error)}}}const u=d.data;return u?.newsletterId?{data:{newsletterId:u.newsletterId}}:{error:{status:"CUSTOM_ERROR",error:d.data?.message||"Failed to create newsletter"}}}})})}),{useCreateNewsletterMutation:Wp}=uo,Hp=e=>`https://${e||"r1"}-api.dotdigital.com/v2`,wa=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,ka=e=>e&&typeof e=="object"&&"data"in e&&e.data!==void 0?e.data:e,Ca=e=>e.trim().toLowerCase(),mo=o.createApi({reducerPath:"dotdigitalApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),c=Hp(t.region),d={"Content-Type":"application/json",Authorization:wa(t.username,t.password)},u=await i({url:`?proxy_url=${encodeURIComponent(`${c}/custom-from-addresses`)}`,method:"GET",headers:{Authorization:wa(t.username,t.password)}});let m=[];if(!u.error){const w=ka(u.data);Array.isArray(w)?m=w:w&&typeof w=="object"&&Array.isArray(w.items)&&(m=w.items)}const f=Ca(t.from_email),h=m.find(w=>w.email&&Ca(w.email)===f),_={name:t.name,subject:t.subject,fromName:t.from_name,htmlContent:t.html,plainTextContent:a||"Newsletter"},p=!h?.id;h?.id!=null&&(_.fromAddress={id:h.id});const S=await i({url:`?proxy_url=${encodeURIComponent(`${c}/campaigns`)}`,method:"POST",headers:d,body:JSON.stringify(_)});if(S.error){const w=S.error;return{error:{status:"CUSTOM_ERROR",error:w?.data?.message||w?.error||String(S.error)}}}const k=ka(S.data);return k?.id?{data:{id:k.id,usedAccountDefaultFromAddress:p}}:{error:{status:"CUSTOM_ERROR",error:S.data?.message||k?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:qp}=mo,Vp="https://app.bentonow.com/api/v1",Yp=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,po=o.createApi({reducerPath:"bentoApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createBroadcast:e.mutation({queryFn:async(t,n,r,i)=>{const a={broadcasts:[{name:t.name,subject:t.subject,content:t.html,type:"raw",from:{email:t.from_email,name:t.from_name},inclusive_tags:t.inclusive_tags||"subscribers",exclusive_tags:"",segment_id:t.segment_id||"",batch_size_per_hour:500,approved:!1}]},c=`${Vp}/batch/broadcasts?site_uuid=${encodeURIComponent(t.site_uuid)}`,d=await i({url:`?proxy_url=${encodeURIComponent(c)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:Yp(t.publishable_key,t.secret_key),"User-Agent":"EmailMaker/1.0"},body:JSON.stringify(a)});if(d.error){const u=d.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.error||String(d.error)}}}return{data:{count:d.data?.count??1}}}})})}),{useCreateBroadcastMutation:Kp}=po,Qp=()=>{const{__:e}=o.useI18n(),[t,{isLoading:n}]=gp(),[r,{isLoading:i}]=yp(),[a,{isLoading:c}]=_p(),[d,{isLoading:u}]=bp(),[m,{isLoading:f}]=Ep(),[h,{isLoading:_}]=kp(),[p,{isLoading:S}]=Ip(),[k,{isLoading:w}]=Pp(),[v,{isLoading:A}]=Rp(),[x,{isLoading:K}]=Op(),[Z,{isLoading:M}]=Np(),[L,{isLoading:I}]=Bp(),[j,{isLoading:z}]=$p(),[B,{isLoading:$}]=Wp(),[de,{isLoading:pe}]=qp(),[q,{isLoading:ee}]=Kp(),Fe=n||i||c||u||f||_||S||w||A||K||M||I||z||$||pe||ee,ze={unisender:async(T,P,N,D)=>{try{const b=await t({api_key:T.api_key,sender_name:T.sender_name,sender_email:T.sender_email,subject:D,body:N,list_id:P.list_id,generate_text:1,lang:"ru"}).unwrap();return b.result?.message_id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.unisender.com/ru/v5/spa/email-campaign/editor/${b.result.message_id}?step=send`,text:e("Open in Unisender")}}:b.error?{success:!1,error:b.error+(b.code?` (${b.code})`:"")}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create email")}}},mailganer:async(T,P,N,D)=>{try{const b=await r({api_key:T.api_key,name:P.name,html_content:N,theme:P.theme||D,from_name:T.from_name,from_email:T.from_email}).unwrap();return b.status===1&&b.public_id?{success:!0,message:e("Mailing successfully created!"),link:b.step1_url?{url:b.step1_url,text:e("Open in Mailganer")}:void 0}:b.error?{success:!1,error:b.error}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create mailing")}}},sendsay:async(T,P,N,D)=>{try{const b=await a({login:T.login,api_key:T.api_key,name:P.name,subject:P.subject,html_content:N,from_name:T.from_name,from_email:T.from_email}).unwrap();return b.obj?.id?{success:!0,message:e("Draft successfully created!"),link:{url:`https://app.sendsay.ru/content/drafts/email/${b.obj.id}/settings`,text:e("Open in Sendsay")}}:b.errors&&b.errors.length>0?{success:!1,error:b.errors.map(W=>W.explain).join(", ")}:b.error?{success:!1,error:b.explain||b.error}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create draft")}}},altcraft:async(T,P,N,D)=>{try{const b=await d({api_url:T.api_url,api_key:T.api_key,name:P.name,html_content:N,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email}).unwrap();return b.error===0?{success:!0,message:e("Template successfully created!")}:{success:!1,error:b.error_text||e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create template")}}},enkod:async(T,P,N,D)=>{try{const b=await m({api_key:T.api_key,subject:P.subject,html_content:N,sender_name:T.sender_name,sender_email:T.sender_email}).unwrap();if(b.success||b.messageId||b.id){const W=b.messageId||b.id;return{success:!0,message:e("Draft successfully created!"),link:W?{url:`https://app.enkod.ru/ensend/messages/detail/${W}/preview`,text:e("Open in enKod")}:void 0}}else if(b.error||b.message)return{success:!1,error:b.error||b.message||e("Unknown error")};return{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create draft")}}},mailchimp:async(T,P,N,D)=>{try{const b=await h({api_key:T.api_key,list_id:P.list_id,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();if(b.id){const W=T.api_key?.split("-")[1]||"us1";return{success:!0,message:e("Campaign successfully created!"),link:{url:`https://${W}.admin.mailchimp.com/campaigns/#r:campaignId=${b.id}`,text:e("Open in Mailchimp")}}}return{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},klaviyo:async(T,P,N,D)=>{try{const b=await p({api_key:T.api_key,list_id:P.list_id,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://www.klaviyo.com/campaign/${b.id}/wizard/1`,text:e("Open in Klaviyo")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},hubspot:async(T,P,N,D)=>{try{const b=await k({api_key:T.api_key,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.hubspot.com/email/0/edit/${b.id}`,text:e("Open in HubSpot")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create email")}}},salesforce_mc:async(T,P,N,D)=>{try{const b=await v({subdomain:T.subdomain,client_id:T.client_id,client_secret:T.client_secret,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.s7.exacttarget.com/ContentBuilder?app=contentbuilder&id=${b.id}`,text:e("Open in Marketing Cloud")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create email")}}},activecampaign:async(T,P,N,D)=>{try{const b=await x({api_url:T.api_url,api_key:T.api_key,list_id:T.list_id,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();if(b.campaignId){const W=(T.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),Pe=W?W[1]:"",Ae=Pe?`https://${Pe}.activehosted.com/app/campaigns/${b.campaignId}`:"https://www.activecampaign.com/app/campaigns";return{success:!0,message:e("Draft campaign created! Open it to review and schedule."),link:{url:Ae,text:e("Open draft campaign")}}}return{success:!1,error:e("Unknown error")}}catch(b){const W=b.message||b.error||"";if(W==="NO_MAILING_ADDRESS"){const Pe=(T.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),Ae=Pe?Pe[1]:"",Qe=Ae?`https://${Ae}.activehosted.com/app/settings/addresses`:"https://www.activecampaign.com/app/settings/addresses";return{success:!1,error:e("No mailing address found. Add one in ActiveCampaign: ")+Qe}}return{success:!1,error:W||e("Failed to create campaign")}}},brevo:async(T,P,N,D)=>{try{const b=await Z({api_key:T.api_key,list_id:Number(P.list_id),name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.brevo.com/marketing-campaign/edit/${b.id}`,text:e("Open in Brevo")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},campaign_monitor:async(T,P,N,D)=>{try{const b=P.html_url?.trim();if(!b)return{success:!1,error:e("HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.")};const W=await L({api_key:T.api_key,client_id:T.client_id,list_id:P.list_id,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html_url:b.trim()}).unwrap();return W.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.createsend.com/campaigns/#/${W.id}`,text:e("Open in Campaign Monitor")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},constant_contact:async(T,P,N,D)=>{try{return(await j({access_token:T.access_token,list_id:P.list_id,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap()).campaign_id?{success:!0,message:e("Campaign successfully created!"),link:{url:"https://app.constantcontact.com/pages/email/campaigns",text:e("Open in Constant Contact")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},getresponse:async(T,P,N,D)=>{try{const b=await B({api_key:T.api_key,from_field_id:T.from_field_id,campaign_id:P.campaign_id,name:P.name,subject:P.subject||D,html:N}).unwrap();return b.newsletterId?{success:!0,message:e("Newsletter successfully created!"),link:{url:`https://app.getresponse.com/letter/${b.newsletterId}`,text:e("Open in GetResponse")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create newsletter")}}},dotdigital:async(T,P,N,D)=>{try{const b=await de({username:T.username,password:T.password,region:T.region||"r1",name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:b.usedAccountDefaultFromAddress?e("Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it."):e("Campaign successfully created!"),link:{url:"https://login.dotdigital.com/",text:e("Open in Dotdigital")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},bento:async(T,P,N,D)=>{try{return await q({publishable_key:T.publishable_key,secret_key:T.secret_key,site_uuid:T.site_uuid,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N,inclusive_tags:P.inclusive_tags}).unwrap(),{success:!0,message:e("Broadcast successfully created!"),link:{url:"https://app.bentonow.com/",text:e("Open in Bento")}}}catch(b){return{success:!1,error:b.message||e("Failed to create broadcast")}}}};return{exportToIntegration:async(T,P,N,D,b)=>{const W=ze[T];return W?W(P,N,D,b):{success:!1,error:e("Unknown integration")}},isLoading:Fe}},Rt={INFO:"info",STORAGE:"storage",STYLES:"styles",MEMBERS:"members",INTEGRATIONS:"integrations",PLUGIN:"plugin"},lv=Rt.INFO,cv=[Rt.INFO,Rt.STORAGE,Rt.STYLES,Rt.MEMBERS,Rt.INTEGRATIONS,Rt.PLUGIN],dv={mainsettings:Rt.INFO,ftpsettings:Rt.STORAGE,webhooksettings:Rt.INTEGRATIONS},Xp=async(e,t,n)=>{try{const{notification:r,...i}=e,a=await o.fetchBaseQuery({baseUrl:"https://racs.emcdn.ru/v3"})(i,t,n);if(a.error)throw new Error;return a}catch(r){return(e?.notification).error(r),{error:r}}},fo=o.createApi({reducerPath:"exportPngApi",baseQuery:Xp,endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:t,title:n,notification:r})=>{const i=new Blob([t],{type:"text/html"}),a=new FormData;return a.append("file",i,"base.html"),a.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:a,notification:r}}}),deleteTemporaryMail:e.mutation({query:({id:t,notification:n})=>({url:`/${t}?resource=exportPngApi`,method:"DELETE",notification:n})})})}),{useMakeTemporaryMailForPngMutation:Jp,useDeleteTemporaryMailMutation:Zp}=fo,ho=o.createApi({reducerPath:"webHookApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:t,body:n})=>({url:`?proxy_url=${encodeURIComponent(t)}`,method:"POST",body:n})})})}),{usePostDataByWebHookMutation:ef}=ho,tf=async(e,t,n)=>{try{const{notification:r,...i}=e,a=await o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"})(i,t,n);if(a.error)throw new Error;return a}catch(r){return(e?.notification).error(r),{error:r}}},go=o.createApi({reducerPath:"htmlToPdfPlusApi",baseQuery:tf,endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:t,notification:n})=>({url:"emails/pdf",method:"POST",body:t,notification:n,responseHandler:r=>r.blob()})})})}),{useGenerateHtmlToPdfMutation:nf}=go,yo=o.createApi({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:t,tryFetch:n=!0,type:r},i){const a=o.clientFromApi(i),c=n?fetch(t):Promise.reject(),d=m=>{switch(r){case"json":return m.json();case"text":return m.text();default:return m.blob()}},u=m=>d(m).then(f=>({data:f}));return c.then(m=>u(m)).catch(()=>a.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(t)}}))}})})}),{useGetFileQuery:uv,useLazyGetFileQuery:of}=yo,mv="email",pv=100;function rf(e){return _t.sanitizeFileName(String(e??"").trim()).slice(0,100).trimEnd()||"email"}function Ta(e){const t=rf(e);return{archive:`${t}.zip`,desktop:`${t}-desktop.png`,mobile:`${t}-mobile.png`}}function af(e,t){const n=Ta(e);return{[n.desktop]:t.desktop,[n.mobile]:t.mobile}}var fr=()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/de7377ec.js")).then(e=>e.import_exports),void 0,{}.url),sf=1,lf=2,cf=375,Dt={fontSize:"16px"},df={position:"absolute",bottom:-4,right:-4,borderRadius:"100%",backgroundColor:o.emCssVar("colorBgContainer")},uf={position:"relative",display:"inline-flex"},qt=({icon:e,locked:t,strokeWidth:n,className:r})=>(0,s.jsxs)("span",{className:r,style:uf,children:[e,t&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:12,strokeWidth:n,style:df})]}),mf=({email:e,autoSaveBlockResult:t})=>{const{__:n,_x:r}=o.useI18n(),i=o.useDispatch(),a=o.useEmailAttributesWriter(),[c]=of(),[d]=o.useUploadImageMutation(),u=o.useAppNavigate(),{owner:m,admin:f}=Qn(),h=o.useCurrentUser(),_=o.useProjectData(),{modal:p}=y.ui_kit$App.useApp(),S=o.useNotification(),{confirm:k}=p,w=o.useAppStore(),v=()=>rn(g.getContainer(w)).keepWrappedOnOutput,A=(O,V,X,re)=>_t.prepareHTML(O,V,X,re,v()),x=(O,V,X,re,oe,H)=>_t.getEML(O,V,X,re,oe,H,v()),K=(O,V,X,re,oe)=>_t.htmlToFilesData(O,V,X,re,oe,v()),Z=o.useCookieManager(),M=o.useAppConfig(),L=va(),{beeFreeConverterEnabled:I,aiLayoutConverterEnabled:j}=L,z=o.useEditorProjectId(),B=o.useEventEmitter(g.events.ON_EMAIL_CLONE_ID),$=o.useEventEmitter(g.events.ON_BROWSER_EXTENSION_DETECTED_ID),[de]=ef(),pe=!0,{data:q}=o.useGetProjectIntegrationsQuery(_?.id??0,{skip:pe}),{data:ee}=o.useGetProjectWebhookQuery(_?.id??0,{skip:pe}),[Fe]=o.useLazyGetIntegrationCredentialsQuery(),{exportToIntegration:ve,isLoading:et}=Qp(),Ee=o.usePushToDataLayer(),[fe,Q]=(0,l.useState)(()=>!Ht(g.getContainer(w)).contentShown()),[me,ae]=(0,l.useState)(!1),[se,Ie]=(0,l.useState)(null),[Ce,Be]=(0,l.useState)(""),[J,ye]=(0,l.useState)(!1),[Te,he]=(0,l.useState)(0),[je,ze]=(0,l.useState)(null),[C,T]=(0,l.useState)(""),[P,N]=(0,l.useState)(!1),D=o.usePlanFeatureGate("export_html"),b=o.usePlanFeatureGate("export_pdf"),W=o.usePlanFeatureGate("export_png");o.usePlanFeatureGate("export_webhook");const Pe=o.usePlanFeatureGate("export_platforms"),Ae=o.usePlanFeatureGate("export_amp"),Qe=o.usePlanFeatureGate("template_import"),Ge=o.usePlanFeatureGate("code_minify"),Ze=O=>{ye(!0),he(o.FEATURE_UPSELL_SLIDE[O])},[mt]=o.emailsApi.useDeleteEmailMutation(),vt=async(O,V)=>{try{const X=await mt(O.id).unwrap();O.project,S.success(n('The email "')+X.title+r('" was successfully removed.',"email")),Ee({event:"delete",action:"delete_email",entity_type:"email",entity_id:O.id,project_id:O.project,context:"editor"})}catch(X){S.error(X)}},[ft,lt]=o.useAddEmailMutation(),[G]=Jp(),[Y]=Zp(),[ne]=nf(),ue=o.useProjectData(),ge=o.useInvalidateTerms(),We=o.useSelector(o.selectIsHeaderCodeMenuOpen);(0,l.useEffect)(()=>{We.switched&&Q(!1)},[We]);const Ve=()=>{const{title:O}=e;return O===null?n("New email title"):O},at=(O,V,X=!1)=>{const re=o.getCodeSize(O);X&&o.isCodeSizeExceeded(re)?(Be(O),Ie(()=>V),ae(!0)):V(O)},Bt=()=>{if(ae(!1),Ge.isLocked){Ze("code_minify");return}if(se&&Ce){o.getCodeSize(Ce);const O=o.minifyHtml(Ce);o.getCodeSize(O),se(O),Ie(null),Be("")}},Me=()=>{ae(!1),se&&Ce&&(se(Ce),Ie(null),Be(""))},Xe=()=>{ae(!1),Ie(null),Be("")},ie=o.useContentReader(),te=o.useContentReplacer(),U=o.useEvent(g.events.ON_EMAIL_INIT_ID),le=o.useEventEmitter(g.events.ON_LAYOUT_CONVERT_REQUEST_ID);(0,l.useEffect)(()=>{const O=U(()=>{Q(!1)});return()=>O.dispose()},[U]);const xe=async(O,V=ie())=>{const X=document.querySelector(".email-preview"),re=getComputedStyle(X);return V=await A(V,[re.width],e.utm_parameters,async oe=>{rt(oe)}),G({file:V,title:Ve(),notification:S}).unwrap().then(oe=>{const H={id:oe._id,...oe};return O(H,()=>Y({id:H.id,notification:S}))}).catch(oe=>{S.error({title:oe.data?.code,description:oe.data?.message})})},Se=(O,V=1)=>xe((X,re)=>({hrefs:O.map(oe=>o.previewHrefForRacs(X.id,void 0,!1,V,void 0,void 0,oe)),dispose:re})),Ne=(O,V,X=2)=>xe((re,oe)=>({data:O.map(H=>({selector:H,href:o.previewHrefForRacs(re.id,void 0,!1,X,H)})),dispose:oe}),V),He=async(O,V)=>{const X=typeof O=="string"?(await c({url:O}))?.data:O;if(!X)return typeof O=="string"?O:"";let re=o.decodeFileNameFromPath(V);if(typeof O=="string"&&/^https?:\/\//i.test(O)){const qe=o.decodeFileNameFromUrl(O);qe&&(re=qe)}const oe=X,{ensureFileExtension:H,extractUploadResult:ke}=await fr();re=await H(re,oe.type||"");const _e=new File([oe],re.toLowerCase(),{type:oe.type||""});try{const qe=ke(await d({user_id:h.id,folder:String(ue.id),file:_e}).unwrap());if(qe.error)return typeof O=="string"?O:"";if(qe.file_url)return qe.file_url}catch{}return typeof O=="string"?O:""},Ue=async O=>{const V=O.document.querySelectorAll("[em-operation=exportAsPicture]"),X=new Map;for(let re=0,oe=V.length;re<oe;re++){const H=V[re];H.setAttribute("em-export-id",String(re)),X.set(`[em-export-id='${re}']`,H)}X.size&&O.handleRender(async({contentDocument:re,managedNodeController:oe})=>{try{const{data:H,dispose:ke}=await Ne([...X.keys()],o.getOuterHtml(re),lf);try{const _e=H.map(async({href:qe,selector:gn},Dn)=>{const pt=X.get(gn);if(pt.tagName==="TD"){pt.removeAttribute("style");for(const yt of[...pt.classList])yt.startsWith("em-mob-")&&pt.classList.remove(yt)}oe.commit();const Bo=await He(qe,`${Dn}-${pt.tagName.toLowerCase()}.png`),yn=parseInt(getComputedStyle(pt).width);let wt=new Image(yn);wt.setAttribute("border","0"),wt.setAttribute("style",`display: block; width: 100%; max-width: ${yn}px;`),wt.alt="",wt.src=Bo;const _n=pt.querySelector("a");if(_n){const yt=document.createElement("a");yt.setAttribute("target","_blank"),yt.setAttribute("href",_n.getAttribute("href")),yt.appendChild(wt),wt=yt}if(pt.tagName==="TD"){const yt=pt.cloneNode();yt.removeAttribute("em-operation"),yt.appendChild(wt),wt=yt}pt.replaceWith(wt),oe.commit()});await Promise.all(_e)}catch{}finally{ke()}}catch{}})},rt=O=>{const V=O.document;if(ue?.limits?.preview_limit==="0"&&z&&h?.counters?.emails_counter>2&&!V.querySelector(".em-powered-logo")){const X=`<a href="${`https://https://racs.emcdn.ru/v3/v3/link?app=emailmaker&project=${z}&email=${e.id}&link=https%3A%2F%2Femailmaker.ru`}" target="_blank"><img src="https://https://racs.emcdn.ru/v3/v3/pixel/123.png?image=https://emcdn.ru/emailmaker/powered.png&project=${z}&email=${e.id}" width="150" height="50" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;"></a>`;V.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child")&&V.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child").insertAdjacentHTML("afterend",`<tr em="block" class="em-powered-logo">
855
+ </td></tr></table>`,Fc={image:"element_image","ai-image":"element_ai_image",text:"element_text",header:"element_heading",button:"element_button",spacer:"element_spacer","list-ul":"element_lists","list-ol":"element_lists",divider:"element_divider",social:"element_social",table:"element_table",countdown:"element_timer",video:"element_video","amp-carousel":"element_amp_carousel","amp-accordion":"element_amp_accordion","amp-form":"element_amp_form"};function vi(e){return Fc[e]??null}var Ei=e=>Number(e)||void 0,Bc={colors:[],fonts:[],socials:[]},Yo=(e="entity")=>{const t=typeof globalThis<"u"?globalThis.crypto:void 0;if(t?.randomUUID)return t.randomUUID();const n=typeof performance<"u"?performance.now().toString(36).replace(".",""):String(Date.now());return`${e}-${Date.now().toString(36)}-${n}`},Uc=()=>Yo("soc"),$c=/^[a-z][a-z0-9+.-]*:/i,Si=e=>{const t=String(e??"").trim();return t?$c.test(t)?t:`https://${t}`:""},zc=e=>{const t=Si(e);if(!t)return!1;try{const n=new URL(t);return n.protocol==="https:"&&!!n.hostname}catch{return!1}},Gc=e=>[...e].filter(t=>t.url.trim()!=="").sort((t,n)=>t.order-n.order),Wc=e=>Gc(e).map(t=>({platform:t.icon_key,href:t.url,label:t.name,...t.icon_url?{iconSrc:t.icon_url}:{}})),Hc=/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i,qc=/^#?([0-9a-f]{6})$/i,Ko=e=>{if(!e)return null;const t=String(e).trim().toLowerCase(),n=qc.exec(t);if(n)return`#${n[1]}`;const r=Hc.exec(t);if(r){const[,i,a,c]=r;return`#${i}${i}${a}${a}${c}${c}`}return null},wi=()=>Yo("bc"),Vc=/\.(woff2|woff|ttf|otf)$/i,Yc=e=>{const t=Vc.exec(e.trim().toLowerCase());return t?`.${t[1]}`:null},Kc={".woff":"application/x-font-woff",".woff2":"application/font-woff2",".ttf":"font/sfnt",".otf":"font/sfnt"},Qc={".woff":["application/x-font-woff","font/woff","application/font-woff"],".woff2":["application/font-woff2","font/woff2"],".ttf":["font/sfnt","application/font-sfnt","application/x-font-ttf","font/ttf","application/x-font-truetype"],".otf":["font/sfnt","application/font-sfnt","application/vnd.ms-opentype","application/x-font-opentype","font/otf","font/opentype"]},Xc=new Set(["","application/octet-stream","binary/octet-stream"]),Jc=e=>{const t=Yc(e.name);if(!t)return e;const n=e.type.trim().toLowerCase();return Qc[t].includes(n)||!Xc.has(n)?e:new File([e],e.name,{type:Kc[t],lastModified:e.lastModified})},Zc=()=>Yo("fnt"),ed=e=>e.family?.trim()||e.name.trim(),td=e=>e.filter(t=>t.source_url?.trim()).map(t=>({family:t.family?.trim()||t.name.trim(),source_url:t.source_url?.trim()??"",weight:t.weight?.trim()||"400",style:t.style??"normal"})),nd=(e,t={})=>{const n=t.srcOverride?.trim()||e.source_url?.trim();if(!n||!t.srcOverride&&ki(e)||t.srcOverride&&o.isGoogleFontsCssUrl(n))return null;const r=t.familyOverride?.trim()||ed(e),i=e.weight?.trim()||"400",a=e.style??"normal";return`@font-face{font-family:${JSON.stringify(r)};src:url(${JSON.stringify(n)});font-weight:${i};font-style:${a};font-display:swap;}`},od=e=>e.source_kind?e.source_kind:o.isGoogleFontsCssUrl(e.source_url)?"google_stylesheet":e.file_name?.trim()?"uploaded":"remote_file",ki=e=>e.source_kind?e.source_kind==="google_stylesheet"||e.source_kind==="remote_stylesheet":o.isGoogleFontsCssUrl(e.source_url),Ci="data-em-project-fonts-face",Ti="data-em-project-font-link",rd=e=>{const t=e.filter(n=>ki(n)).map(n=>n.source_url?.trim()??"").filter(Boolean);return[...new Set(t)]},id=e=>e.map(t=>nd(t)).filter(t=>!!t).join(""),ad=(e,t=document)=>{const n=id(e),{head:r}=t;let i=r.querySelector(`style[${Ci}]`);if(!n){i?.remove();return}i||(i=t.createElement("style"),i.setAttribute(Ci,""),r.appendChild(i)),i.textContent=n},sd=(e,t=document)=>{const n=new Set(rd(e)),{head:r}=t;r.querySelectorAll(`link[${Ti}]`).forEach(i=>{const a=i.getAttribute("href")??"";n.has(a)?n.delete(a):i.remove()}),n.forEach(i=>{const a=t.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("href",i),a.setAttribute(Ti,""),r.appendChild(a)})},ld=(e,t=document)=>{ad(e,t),sd(e,t)},cd=new Set(["normal","italic","oblique"]),Jb="[emailmaker] projectStyles:",Wt=e=>{},bt=e=>typeof e=="string"?e.trim():"",Ii=e=>!e||e.startsWith("//")?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")?!0:e.toLowerCase().startsWith("https://"),dd=e=>o.isGoogleFontsCssUrl(e)?"google_stylesheet":(e.split(/[?#]/)[0]??"").toLowerCase().endsWith(".css")?"remote_stylesheet":"remote_file",Qo=(e,t,n)=>e.length<=t?e:(Wt(`${n} list is capped at ${t} entries, ${e.length-t} dropped`),e.slice(0,t)),ud=(e,t)=>{const n=Ko(e?.hex);if(!n){Wt(`colors[${t}] skipped: "${String(e?.hex)}" is not a hex color`);return}return{id:bt(e.id)||wi(),name:bt(e.name),hex:n,order:0}},md=(e,t)=>{const n=bt(e?.family),r=bt(e?.source_url);if(!n){Wt(`fonts[${t}] skipped: family is required`);return}if(!r){Wt(`fonts[${t}] skipped: source_url is required`);return}if(!Ii(r)){Wt(`fonts[${t}] skipped: source_url must be https or relative, got "${r}"`);return}const i=bt(e.style);return{id:bt(e.id)||Zc(),name:bt(e.name)||n,family:n,source_url:r,source_kind:dd(r),weight:bt(e.weight)||"400",style:cd.has(i)?i:"normal",order:0}},pd=(e,t)=>{const n=Si(e?.url);if(!n||!zc(n)){Wt(`socials[${t}] skipped: url must be https, got "${String(e?.url)}"`);return}const r=bt(e.icon_key),i=bt(e.icon_url);let a;if(i&&Ii(i)?a=i:i&&Wt(`socials[${t}]: icon_url must be https or relative, got "${i}" — icon dropped`),!r&&!a){Wt(`socials[${t}] skipped: icon_key or icon_url is required`);return}return{id:bt(e.id)||Uc(),name:bt(e.name),url:n,icon_key:r,...a?{icon_url:a}:{},enabled:!0,order:0}},Xo=e=>e.map((t,n)=>({...t,order:n})),fd=e=>({colors:Xo(Qo(e?.colors??[],32,"colors").map(ud).filter(t=>t!==void 0)),fonts:Xo(Qo(e?.fonts??[],20,"fonts").map(md).filter(t=>t!==void 0)),socials:Xo(Qo(e?.socials??[],20,"socials").map(pd).filter(t=>t!==void 0))}),hd={tg:"telegram",yt:"youtube",yd:"yandex_zen",tt:"tiktok",pi:"pinterest",ig:"instagram",fb:"facebook",xa:"x",tw:"twitter"},Ai="vk",gd=new Set(o.EM_SOCIAL_SELECT_ORDER),yd=e=>gd.has(e),xi=e=>{const t=String(e??"").trim().toLowerCase();return t?yd(t)?t:hd[t]??Ai:Ai},_d=e=>xi(e),bd=new Set(["normal","italic","oblique"]),vd=new Set(["uploaded","remote_file","google_stylesheet"]),Pt=e=>(e??"").trim(),wn=e=>Pt(e)||void 0,Pi=e=>typeof e=="number"&&e>0?e:void 0,Ed=e=>bd.has(e)?e:void 0,Sd=e=>vd.has(e)?e:void 0,wd=(e,t)=>{const n=Ko(Pt(e.hex));return n?{id:Pt(e.id)||wi(),name:Pt(e.name),hex:n,order:e.order??t}:null},Ri=(e,t=0)=>({id:Pt(e.id),name:Pt(e.name),source_url:wn(e.source_url),source_kind:Sd(e.source_kind),file_name:wn(e.file_name),family:wn(e.family),weight:wn(e.weight),style:Ed(e.style),preview_url:wn(e.preview_url),storage_fallback:e.storage_fallback||void 0,font_size_px:Pi(e.font_size_px),line_height_px:Pi(e.line_height_px),order:e.order??t}),kd=(e,t)=>{const n=Pt(e.url);return n?{id:Pt(e.id),name:Pt(e.name),url:n,icon_key:xi(Pt(e.icon_key)),enabled:e.enabled??!0,order:e.order??t}:null},on=e=>[...e].sort((t,n)=>t.order-n.order),ji=e=>e?{colors:on((e.colors??[]).map(wd).filter(t=>t!==null)),fonts:on((e.fonts??[]).map(Ri)),socials:on((e.socials??[]).map(kd).filter(t=>t!==null))}:Bc,Cd=e=>e==="remote_stylesheet"?"remote_file":e,Td=e=>{const t={};return e.colors&&(t.colors=on(e.colors).map(n=>({id:n.id,name:n.name.trim(),hex:Ko(n.hex)||n.hex}))),e.fonts&&(t.fonts=on(e.fonts).map(n=>({id:n.id,name:n.name.trim(),source_url:n.source_url??"",source_kind:Cd(od(n)),file_name:n.file_name??"",family:n.family??"",weight:n.weight??"",style:n.style??"",preview_url:n.preview_url??"",storage_fallback:n.storage_fallback??!1,font_size_px:n.font_size_px??0,line_height_px:n.line_height_px??0}))),e.socials&&(t.socials=on(e.socials).map(n=>({id:n.id,name:n.name.trim(),url:n.url,icon_key:_d(n.icon_key),enabled:n.enabled}))),t},Li="ProjectBrandStyles",Qt=o.createApi({reducerPath:"projectSettingsStylesApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Li],endpoints:e=>({getProjectStyles:e.query({async queryFn({projectId:t},n){const r=o.v2ResultOf(await o.getClientV2(h.getContainer(n)).projects.stylesList({id:String(t)}));return"error"in r?{error:r.error}:{data:ji(r.data)}},providesTags:(t,n,{projectId:r})=>[{type:Li,id:String(r)}]}),updateProjectStyles:e.mutation({async queryFn({projectId:t,patch:n},r){const i=o.v2ResultOf(await o.getClientV2(h.getContainer(r)).projects.stylesPartialUpdate({id:String(t)},Td(n)));return"error"in i?{error:i.error}:{data:ji(i.data)}},async onQueryStarted({projectId:t,patch:n},{dispatch:r,queryFulfilled:i}){const a=r(Qt.util.updateQueryData("getProjectStyles",{projectId:t},c=>Object.assign(c,n)));try{const{data:c}=await i;r(Qt.util.upsertQueryData("getProjectStyles",{projectId:t},c))}catch{a.undo()}}}),uploadProjectFont:e.mutation({async queryFn({projectId:t,file:n},r){const i=new FormData;i.append("file",Jc(n));const a=o.v2ResultOf(await o.getClientV2(h.getContainer(r)).request({path:`/projects/${String(t)}/styles/fonts`,method:"POST",body:i,secure:!0,type:o.ContentType.FormData,format:"json"}));return"error"in a?{error:a.error}:{data:Ri(a.data)}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;n(Qt.util.updateQueryData("getProjectStyles",{projectId:t},a=>{a.fonts=a.fonts.some(c=>c.id===i.id)?a.fonts.map(c=>c.id===i.id?i:c):[...a.fonts,i],a.fonts.sort((c,d)=>c.order-d.order)}))}catch{}}})})}),{useGetProjectStylesQuery:Id,useUpdateProjectStylesMutation:Zb,useUploadProjectFontMutation:ev}=Qt,Oi=e=>{const t=o.useIntegratorConfigValue("projectStyles"),{data:n}=Id({projectId:e},{skip:!0});return(0,l.useMemo)(()=>fd(t),[t])},Ad=2.5,xd=({atom:e,onSelect:t,onDragStart:n,isDroppedAtom:r})=>{const i=(0,l.useCallback)(d=>t(d,e),[t,e]),a=(0,l.useCallback)(d=>n(d,e,r),[n,e,r]),c=(0,l.useCallback)(d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),t(d,e))},[t,e]);return(0,s.jsxs)("button",{type:"button",className:"ant-card-hoverable atoms__item "+e.className+(e.isLockedByPlan?" atoms__item_locked":""),draggable:!0,onClick:i,onKeyDown:c,onDragStart:a,"data-test-name":e.name,children:[(0,s.jsxs)("span",{className:"atom-image",children:[e.icon,e.isLockedByPlan&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:12,strokeWidth:Ad,className:"atom-image__lock"})]}),(0,s.jsx)("span",{className:"atom-title",children:e.title})]})},Mi=()=>{const e=o.useI18n(),{__:t}=e,n=o.useAppConfig(),r=o.useProjectData(),i=o.useCurrentUserLocale()||"ru_RU",a=xt.useSetHtmlAtomInIframeHandler(),c=xt.useDragStartAtomToIframeHandler(),[d,u]=(0,l.useState)(!1),[m,f]=(0,l.useState)(0),g=o.useMessageService(),_=o.useServices(h.ATOMS_HANDLERS_ID),p=o.useEventEmitter(h.HANDLE_ATOM_INSERT_ID),E=o.usePlanFeatureLocks(),C=Ei(r?.id),w=Oi(C),S=w?Wc(w.socials):[],I=S.length>0?yi(S):Pc;let x=[];if(n.elementImageEnabled&&x.push({title:t("Image"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementImage",component:y.icons$ElementImage,size:24,strokeWidth:n.iconStrokeWidth}),html:pc,className:"",name:"image"}),n.elementAIimageEnabled&&x.push({title:t("AI image"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementImageAI",component:y.icons$ElementImageAI,size:24,strokeWidth:n.iconStrokeWidth}),html:fc,className:"ai",name:"ai-image"}),n.elementTextEnabled&&x.push({title:t("Text"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementText",component:y.icons$ElementText,size:24,strokeWidth:n.iconStrokeWidth}),html:hc(e),className:"",name:"text"}),n.elementHeaderEnabled&&x.push({title:t("Header"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementTitle",component:y.icons$ElementTitle,size:24,strokeWidth:n.iconStrokeWidth}),html:gc(e),className:"",name:"header"}),n.elementButtonEnabled&&x.push({title:t("Button"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementButton",component:y.icons$ElementButton,size:24,strokeWidth:n.iconStrokeWidth}),html:yc(e),className:"",name:"button"}),n.elementSpacerEnabled&&x.push({title:t("Spacer"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementSpacer",component:y.icons$ElementSpacer,size:24,strokeWidth:n.iconStrokeWidth}),html:Ec,className:"",name:"spacer"}),n.elementListULEnabled&&x.push({title:t("List UL"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementListUL",component:y.icons$ElementListUL,size:24,strokeWidth:n.iconStrokeWidth}),html:_c(e),className:"",name:"list-ul"}),n.elementListOLEnabled&&x.push({title:t("List OL"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementListOL",component:y.icons$ElementListOL,size:24,strokeWidth:n.iconStrokeWidth}),html:bc(e),className:"",name:"list-ol"}),n.elementDividerEnabled&&x.push({title:t("Divider"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementDivider",component:y.icons$ElementDivider,size:24,strokeWidth:n.iconStrokeWidth}),html:vc,className:"",name:"divider"}),n.elementSocialEnabled&&x.push({title:t("Social media"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementSocial",component:y.icons$ElementSocial,size:24,strokeWidth:n.iconStrokeWidth}),html:I,className:"",name:"social"}),n.elementTableEnabled&&x.push({title:t("Table"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementTable",component:y.icons$ElementTable,size:24,strokeWidth:n.iconStrokeWidth}),html:Rc(e),className:"",name:"table"}),n.elementCountdownEnabled&&x.push({title:t("Countdown"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementCountdown",component:y.icons$ElementCountdown,size:24,strokeWidth:n.iconStrokeWidth}),html:Oc(i),className:"",name:"countdown"}),n.elementVideoEnabled&&x.push({title:t("Video"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementVideo",component:y.icons$ElementVideo,size:24,strokeWidth:n.iconStrokeWidth}),html:Mc,className:"",name:"video"}),n.elementCarouselEnabled&&x.push({title:t("Carousel"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementCarousel",component:y.icons$ElementCarousel,size:24,strokeWidth:n.iconStrokeWidth}),html:Nc(e),className:"amp",name:"amp-carousel"}),n.elementAccordionEnabled&&x.push({title:t("Accordion"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementAccordion",component:y.icons$ElementAccordion,size:24,strokeWidth:n.iconStrokeWidth}),html:Dc(e),className:"amp",name:"amp-accordion"}),n.elementFormEnabled&&x.push({title:t("Form"),icon:(0,s.jsx)(o.EmIcons,{icon:"ElementForm",component:y.icons$ElementForm,size:24,strokeWidth:n.iconStrokeWidth}),html:null,className:"amp",name:"amp-form"}),x=x.map(A=>({...A,fallbackTooltip:t("Coming soon"),planFeature:vi(A.name),isLockedByPlan:E(vi(A.name))})),_){const A={value:x};for(const j of _)j.execute(A);x=A.value}(0,l.useEffect)(()=>{const{dispose:A}=g.addListener(o.EVENT_TYPES.APPLICATION_ATOM_INSERTED,j=>{const z=x.find(B=>B.name===j);z&&p.fire(z)});return()=>A()},[g,x,p]);const Y=(0,l.useCallback)(A=>{u(!0),f(A.planFeature?o.FEATURE_UPSELL_SLIDE[A.planFeature]:1)},[]),Z=(0,l.useCallback)(A=>A.isLockedByPlan?(setTimeout(()=>Y(A),1e3),!1):!0,[Y]),M=(0,l.useCallback)((A,j)=>{if(j.isLockedByPlan){Y(j);return}a(A,j)},[Y,a]),L=(0,l.useCallback)((A,j,z)=>{c(A,j,z)},[c]);return(0,s.jsxs)("div",{className:"atoms",children:[(0,s.jsx)("div",{className:"atoms__list",children:(0,s.jsx)(y.ui_kit$Space,{wrap:!0,style:{justifyContent:"space-between",rowGap:10},children:x&&x.map((A,j)=>A.html?(0,s.jsx)(xd,{atom:A,onSelect:M,onDragStart:L,isDroppedAtom:Z},A.title+j.toString()):(0,s.jsx)(y.ui_kit$Tooltip,{title:A.fallbackTooltip||t("Coming soon"),placement:"top",children:(0,s.jsxs)("div",{className:"atoms__item atoms__item_inactive "+A.className,"data-test-name":A.name,children:[(0,s.jsx)("span",{className:"atom-image",children:A.icon}),(0,s.jsx)("span",{className:"atom-title",children:A.title})]},A.title+j.toString())},A.title+j.toString()))})}),(0,s.jsx)(o.PlanUpgradePrompt,{open:d,onCancel:()=>u(!1),initialSlide:m})]})};Mi.propTypes={};var Pd={full:{flexGrow:1},768:{width:171},425:{width:25},375:{width:28},320:{width:320}},Ni={right:-12,top:4,zIndex:999,padding:0,position:"absolute"},Rd=[{kind:"full",width:1200},{kind:"768",width:768},{kind:"425",width:425},{kind:"375",width:375},{kind:"320",width:320,showLabel:!0},{kind:"375",width:375},{kind:"425",width:425,control:"mobile"},{kind:"768",width:768,control:"desktop"},{kind:"full",width:1200}];function jd({kind:e,width:t,label:n,onSelect:r,onHover:i,children:a}){const c=(0,l.useCallback)(()=>i(e,n),[i,e,n]),d=(0,l.useCallback)(()=>i(null,""),[i]),u=(0,l.useCallback)(()=>r(t),[r,t]),m=(0,l.useCallback)(f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),r(t))},[r,t]);return(0,s.jsx)("div",{className:`device-width__${e}`,style:Pd[e],role:"button",tabIndex:0,"aria-label":n,onMouseEnter:c,onMouseLeave:d,onClick:u,onKeyDown:m,children:a})}function Ld({onSelectWidth:e,themeToggle:t}){const{__:n}=o.useI18n(),[r,i]=(0,l.useState)(""),[a,c]=(0,l.useState)(""),d={full:n("Desktop"),768:n("Small desktop – 768px"),425:n("Mobile L – 425px"),375:n("Mobile M – 375px"),320:n("Mobile S – 320px")},u=(0,l.useCallback)((m,f)=>{i(m?`device-width__${m}-hovered`:""),c(f)},[]);return(0,s.jsx)("div",{className:`email-pane__sizes ${r}`,children:(0,s.jsxs)("div",{className:"email-pane__width-selectors-wrapper",children:[(0,s.jsx)("div",{className:"device-width__theme",children:t}),Rd.map((m,f)=>(0,s.jsxs)(jd,{kind:m.kind,width:m.width,label:d[m.kind],onSelect:e,onHover:u,children:[m.showLabel?a:null,m.control==="mobile"&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Mobile view"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"MobileOutlined",component:y.icons$MobileOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Ni})}),m.control==="desktop"&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Desktop view"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"DesktopOutlined",component:y.icons$DesktopOutlined,size:16,strokeWidth:2}),size:"small",shape:"circle",style:Ni})})]},`${m.kind}-${f}`)),(0,s.jsx)("div",{className:"device-width__theme-placeholder"})]})})}var $e=zt.__toESM(o.require_prop_types()),Di=h.createIdentifier$1("canvas.resizerBinder"),Od=h.createIdentifier$1("canvas.service"),tv={created:o.PHASES.canvasCreated,loaded:o.PHASES.canvasLoaded};function Md(e){return e.getInstance(Od)}function Fi(e){return{undo:()=>e.undo(),redo:()=>e.redo(),clear:()=>e.clear(),canUndo:()=>e.canUndo(),canRedo:()=>e.canRedo(),createSnapshot:()=>e.createSnapshot(),restoreSnapshot:t=>{e.restoreSnapshot(t)},getPast:t=>e.getPast(t).map(n=>({changes:n})),getFuture:t=>e.getFuture(t).map(n=>({changes:n}))}}var Nd={canUndo:!1,canRedo:!1},Dd={undo:()=>{},redo:()=>{},clear:()=>{},canUndo:()=>!1,canRedo:()=>!1,createSnapshot:()=>{},restoreSnapshot:()=>{},getPast:()=>[],getFuture:()=>[]};function Jo(e){const t=o.useDocumentSessionContext(),{history:n}=e??t;return(0,l.useMemo)(()=>n?Fi(n):Dd,[n])}function Fd(){const{history:e}=o.useDocumentSessionContext(),t=(0,l.useCallback)(i=>e?e.subscribe(i):()=>{},[e]),n=(0,l.useRef)(null),r=(0,l.useCallback)(()=>{if(!e)return Nd;const i={canUndo:e.canUndo(),canRedo:e.canRedo()},a=n.current;return a&&a.canUndo===i.canUndo&&a.canRedo===i.canRedo?a:(n.current=i,i)},[e]);return(0,l.useSyncExternalStore)(t,r)}var Bi=2e3,Bd=10,Ud="iframe_errors",$d=5;function zd(e){const{__:t}=o.useI18n(),n=o.useMessageService(),r=Jo(),{error:i}=o.useNotification(),{document:a}=o.useDocumentSessionContext(),c=(0,l.useCallback)(()=>a?.getContent()??"",[a]),d=(0,l.useRef)(0),u=(0,l.useRef)(void 0),m=(0,l.useRef)(!1),f=o.useCurrentUser(),g=(0,l.useCallback)(p=>new Promise((E,C)=>{const w=n.addListener(o.EVENT_TYPES.SANDBOX_READY,()=>{w.dispose(),E()});p&&setTimeout(()=>{w.dispose(),C("timeout")})}),[n]),_=(0,l.useCallback)(p=>{g(Bi).catch(E=>{}).finally(()=>{Promise.resolve().then(()=>{if(!m.current){if(++d.current){if(u.current){if(d.current<$d){r.restoreSnapshot(u.current);for(let E=0;E<d.current;E++)r.undo()}}else u.current=r.createSnapshot();n.send(o.EVENT_TYPES.RELOAD)}setTimeout(()=>{if(--d.current===0){u.current=null;const E=new Error(p.message);p.stack&&(E.stack=p.stack);const C=o.reportError(E,{origin:"iframe"}),w={past:r.getPast(Bd),future:r.getFuture(),errorResolved:!m.current,text:c(),message:p.message,stack:p.stack,userId:f?.id,entityId:e?.id,entityType:document.location.pathname.indexOf("emails")>0?"email":"block",sentryEventId:C};i({id:"IFRAME_ERROR",data:w,title:t("Something went wrong")}),h.RACS.post(Ud,w).catch(S=>{}),m.current=!1}},Bi)}})})},[r,c,i,f?.id,e?.id,t,g,n]);o.useListenPostMessage(o.EVENT_TYPES.APPLICATION_DOMPARSER_ERROR,_)}function Gd(e,t){const n=JSON.stringify(t??{});Wd(e?.get().attributes.common_styles,n)||o.writeEmailAttributes(e,{common_styles:n})}function Wd(e,t){if(e===t)return!0;try{return h.deepEqual(JSON.parse(e||"{}"),JSON.parse(t||"{}"))}catch{return!1}}var Wn=Symbol("isIframeEvent");function Hd({children:e}){const[t,n]=(0,l.useState)(),[r,i]=(0,l.useState)(),[a,c]=(0,l.useState)(!1),d=o.useMessageService();return(0,l.useEffect)(()=>{if(t){const u=d.addListener(o.EVENT_TYPES.APPLICATION_IFRAME_DRAG_EVENT,m=>{if(m.type!=="drageleave"&&m.type!=="dragenter"){const f=t.getBoundingClientRect(),g=m.clientX+f.x+window.scrollX,_=m.clientY+f.y+window.scrollY,p=document.elementFromPoint(g,_);if(p){const E=new DataTransfer,C=new DragEvent(m.type,{clientX:g,clientY:_,cancelable:!0,bubbles:!0,dataTransfer:E});C[Wn]=!0,p.dispatchEvent(C)}}});return()=>u.dispose()}},[d,t]),(0,l.useEffect)(()=>{const u=f=>{f[Wn]||c(!0)},m=f=>{f[Wn]||c(!1)};return window.addEventListener("dragstart",u),window.addEventListener("dragend",m),()=>{window.removeEventListener("dragstart",u),window.removeEventListener("dragend",m)}},[r]),(0,l.useEffect)(()=>{const u=m=>{if(!m[Wn]){const f=r.getBoundingClientRect();d.send(o.EVENT_TYPES.SANDBOX_DRAG_EVENT,{value:m.dataTransfer?.getData("Text")||"",type:m.type,clientX:m.pageX-f.x-window.scrollX,clientY:m.pageY-f.y-window.scrollY})}};if(r)return r.addEventListener("dragenter",u),r.addEventListener("dragover",u),r.addEventListener("dragleave",u),r.addEventListener("drop",u),r.addEventListener("dragend",u),()=>{r.removeEventListener("dragenter",u),r.removeEventListener("dragover",u),r.removeEventListener("dragleave",u),r.removeEventListener("drop",u),r.removeEventListener("dragend",u)}},[r,d]),(0,s.jsxs)("div",{ref:n,children:[a&&(0,s.jsx)("div",{ref:i,className:"iframe-provider"}),e]})}var qd=["colorBgBase","colorBgElevated","colorError","colorInfo","colorInfoBg","colorInfoBgHover","colorInfoBorder","colorInfoBorderHover","colorLink","colorPrimary","colorPrimaryBg","colorPrimaryBgHover","colorPrimaryBorder","colorPrimaryBorderHover"];function Vd(e){const t={};for(const n of qd){const r=e[n];typeof r=="string"&&(t[n]=r)}return t}function Zo(e,t){const n=o.useMessageService(),r=t?.async??!1;(0,l.useEffect)(()=>{const i=r?n.addListenerAsync(o.EVENT_TYPES.RELOAD,e):n.addListener(o.EVENT_TYPES.RELOAD,e);return()=>i.dispose()},[n,e,r]),(0,l.useEffect)(()=>{},[e])}function Yd(){const e=o.useMessageService(),{token:t}=(0,y.ui_kit$useToken)(),[n,r]=(0,l.useState)();(0,l.useEffect)(()=>{if(!h.deepEqual(n,t)){const a=e.onInit(()=>{e.send(o.EVENT_TYPES.SANDBOX_SET_THEME_VARIABLES,Vd(t)),r(t)});return()=>a.dispose()}},[t,n,r,e]);const i=(0,l.useCallback)(()=>{r(void 0)},[]);Zo(i)}var Kd={minHeight:600},Qd="#pane-content-wrapper, .email-pane__col_preview, .preview-mode__pane-content";function Ui(e){e?.current?.resize?.()}var $i=(0,l.forwardRef)(({className:e=null,email:t=null,handlerSendPosition:n=()=>{},surface:r,clip:i=null},a)=>{const c=o.useAppConfig(),d=o.useContainer(),u=r??(t?.hasOwnProperty("type")?"block":"email"),m=(0,l.useMemo)(()=>Md(d),[d]),f=(0,l.useMemo)(()=>m?.current(u),[m,u]),g=(0,l.useRef)(null),_=(0,l.useCallback)(()=>{o.mark(o.PHASES.canvasLoaded),Ui(a),n()},[n,a]);(0,l.useImperativeHandle)(a,()=>({getIframeElement:()=>m?.current(u)?.element,resize:()=>m?.current(u)?.resize()}),[m,u]),(0,l.useEffect)(()=>{if(!m)return;const w=g.current,S=i??w?.closest(Qd)??null;return m.alignSurface(u,w,S),()=>m.alignSurface(u,null)},[m,u,i,c.sidePanelFloating]);const p=(0,l.useRef)(_);p.current=_,(0,l.useEffect)(()=>{if(!f)return;let w=!1;const S=()=>{w||p.current({target:f.element})};return f.ready().then(S).catch(()=>{window.requestAnimationFrame(()=>{w||f.ready().then(S).catch(()=>{})})}),()=>{w=!0}},[f]),Yd(),zd(t);const{document:E}=o.useDocumentSessionContext();(0,l.useEffect)(()=>{const w=o.subscribeToContent(E,()=>{Ui(a)});return()=>w.dispose()},[E,a]);const C=(0,l.useCallback)(w=>{const{operation:S,settings:I}=w.data;S===o.EVENT_TYPES.APPLICATION_COMMON_STYLES_UPDATE&&Gd(E,I?.commonStyles)},[E]);return o.useListenPostMessage(C),(0,s.jsx)(Hd,{children:(0,s.jsx)("div",{ref:g,className:(0,ot.default)("email-preview",e),id:"email_iframe_slot",style:Kd})})});$i.propTypes={className:$e.default.string,surface:$e.default.oneOf(["email","block","preview"]),email:$e.default.shape({html:$e.default.string}),handlerSendPosition:$e.default.func,clip:$e.default.object};var er=new Map,Xd=new Map;function Jd(e,t){e.set(t,(e.get(t)??0)+1)}function Zd(e,t){const n=e.get(t)??0;n<=1?e.delete(t):e.set(t,n-1)}function zi(e,t){return(e.get(t)??0)>0}function eu(e){return zi(er,e)||zi(Xd,e)}function tu(e){Jd(er,e);let t=!1;return{dispose(){t||(t=!0,nu(e))}}}function nu(e){Zd(er,e)}function ou(e,t){return iu([...e.changes].sort((n,r)=>n.rangeOffset-r.rangeOffset).map(n=>({start:n.rangeOffset,end:n.rangeOffset+n.rangeLength,text:n.text})),t)}function ru(e,t){return e.map(n=>{const r=t.getPositionAt(n.oldPosition),i=t.getPositionAt(n.oldEnd);return{text:n.newText,range:{startLineNumber:r.lineNumber,startColumn:r.column,endLineNumber:i.lineNumber,endColumn:i.column}}})}function iu(e,t){let n=0;return e.map(({start:r,end:i,text:a})=>{const c=new o.TextChange(r,t.slice(r,i),r+n,a);return n+=a.length-(i-r),c})}var Gi=new WeakMap;function au(e){const t=Gi.get(e);if(t)return t;const n=Fl(e);return Gi.set(e,n),n}var Wi="monaco";function su(e,t){(0,l.useEffect)(()=>{if(!e||!t)return;const n=au(e);let r=!1;const i=d=>{r=!0;const u=tu(t);try{d()}finally{u.dispose(),r=!1}},a=n.attach({id:Wi,apply(d){return t.getValue()!==d&&i(()=>t.setValue(d)),Promise.resolve()},applyChanges(d){return i(()=>t.applyEdits(ru(d,t))),Promise.resolve()}}),c=t.onDidChangeContent(d=>{if(r)return;const u=eu(t)?"remote":"user";n.mutateFrom(Wi,{changes:ou(d,e.getContent())},{source:u})});return()=>{a.detach(),c.dispose()}},[e,t])}function lu(e,t){const[n,r]=(0,l.useState)(void 0),i=(0,l.useRef)(!1),{error:a}=o.useNotification(),{__:c}=o.useI18n(),d=(0,l.useRef)(t);d.current=t;const u=(0,l.useRef)({error:a,__:c});u.current={error:a,__:c},(0,l.useEffect)(()=>{if(!e||n||i.current)return;i.current=!0;let f=!1;return d.current().then(g=>{if(f){g.dispose();return}r(g)}).catch(()=>{const{error:g,__:_}=u.current;g({id:"CODE_EDITOR_LOAD_FAILED",title:_("Failed to load the code editor")})}).finally(()=>{i.current=!1}),()=>{f=!0}},[e,n]);const m=(0,l.useRef)(void 0);return m.current=n,(0,l.useEffect)(()=>()=>{m.current?.dispose()},[]),n}var Hn;function tr(){return Hn===void 0&&(Hn=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/9bc03055.js")),void 0,{}.url).catch(e=>{throw Hn=void 0,e})),Hn}function cu(){return tr().then(e=>e.ensureMonaco())}var du=o.lazyRoute(()=>tr().then(e=>({default:e.MonacoEditor}))),uu=()=>tr().then(e=>e.loadEditorModel()),mu={height:"100%"};function pu(e){const t=lu(!0,uu),{document:n}=o.useDocumentSessionContext();return(0,l.useEffect)(()=>{},[]),(0,l.useEffect)(()=>{},[t]),su(n,t),(0,s.jsx)(o.EditorModelContext.Provider,{value:t,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$Flex,{justify:"center",align:"center",style:mu,children:(0,s.jsx)(y.ui_kit$Spin,{size:"large"})}),children:(0,s.jsx)(du,{...e})})})}var fu=({elementPath:e})=>{const{_x:t}=o.useI18n(),n=o.useDispatch(),r=o.useMessageService(),i=o.useAppConfig(),{blockId:a}=o.useRouteParams(),c=o.useEditorProjectId(),d=o.useRouteEmailId(),u=o.useProjectData(),m=o.usePushToDataLayer(),f=(0,l.useCallback)(I=>{r.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_SET,index:I})},[r]),g=(0,l.useCallback)(I=>{let x="element";I?.target?.closest("svg")||I?.target?.closest(".anticon")||I?.target?.closest('[class*="icon"]')?x="icon":I?.target?.textContent&&!I?.target?.closest("svg")&&!I?.target?.closest(".anticon")&&(x="text"),n(o.setActiveSettingsTab(o.STYLES)),r.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),r.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),m({event:"click",action:"click_breadcrumb_email",email_id:d||a,project_id:u?.id||c,click_target:x})},[r,n,m,d,a,c,u]),_={title:(0,s.jsxs)("span",{onClick:g,children:[(0,s.jsx)(o.EmIcons,{icon:"Email",component:y.icons$Email,size:16,strokeWidth:i.iconStrokeWidth})," ",t("Email","letter")]})},[p,E]=(0,l.useState)([_]),C=(0,l.useCallback)(I=>{r.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_HOVER_SET,index:I})},[r]),w=I=>{if(I.includes("em-element-path-item-text"))return(0,s.jsx)(o.EmIcons,{icon:"ElementText",component:y.icons$ElementText,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-image"))return(0,s.jsx)(o.EmIcons,{icon:"ElementImage",component:y.icons$ElementImage,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-link"))return(0,s.jsx)(o.EmIcons,{icon:"LinkOutlined",component:y.icons$LinkOutlined,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-atom"))return(0,s.jsx)(o.EmIcons,{icon:"Atom",component:y.icons$Atom,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-column"))return(0,s.jsx)(o.EmIcons,{icon:"Column",component:y.icons$Column,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-block"))return(0,s.jsx)(o.EmIcons,{icon:"Block",component:y.icons$Block,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-group"))return(0,s.jsx)(o.EmIcons,{icon:"Group",component:y.icons$Group,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-button"))return(0,s.jsx)(o.EmIcons,{icon:"ElementButton",component:y.icons$ElementButton,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-table"))return(0,s.jsx)(o.EmIcons,{icon:"ElementTable",component:y.icons$ElementTable,size:16,strokeWidth:i.iconStrokeWidth});if(I.includes("em-element-path-item-amp"))return(0,s.jsx)(o.EmIcons,{icon:"AMP",component:y.icons$AMP,size:16,strokeWidth:i.iconStrokeWidth})},S=(0,l.useCallback)((I,x)=>{const Y=Z=>{let M="element";Z.target.closest("svg")||Z.target.closest(".anticon")||Z.target.closest('[class*="icon"]')?M="icon":Z.target.textContent&&!Z.target.closest("svg")&&!Z.target.closest(".anticon")&&(M="text");const L=e?.[x],A=L?.className?.replace("em-element-path-item-","")||"unknown";m({event:"click",action:"click_breadcrumb_element",email_id:d||a,project_id:u?.id||c,element_type:A,element_index:x,element_title:L?.title||"",click_target:M}),f(x)};return(0,s.jsxs)("span",{className:I.className,onClick:Y,onMouseOver:()=>{C(x)},children:[w(I.className)," ",I.title]})},[f,C,e,m,d,a,c,u]);return(0,l.useEffect)(()=>{if(e){const I=e.map((x,Y)=>({title:S(x,Y)}));E([{title:(0,s.jsxs)("span",{onClick:g,children:[(0,s.jsx)(o.EmIcons,{icon:"Email",component:y.icons$Email,size:16,strokeWidth:i.iconStrokeWidth})," ",t("Email","letter")]})},...I])}},[e,S,g,t]),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(y.ui_kit$Breadcrumb,{items:p,type:"separator",separator:""})})};function hu(){const{document:e}=o.useDocumentSessionContext(),t=(0,l.useCallback)(r=>e?e.subscribe(r):()=>{},[e]),n=(0,l.useCallback)(()=>e?.getContent()??"",[e]);return(0,l.useSyncExternalStore)(t,n)}var gu=({fallbackHtml:e})=>{const{__:t}=o.useI18n(),n=hu(),r=(0,l.useMemo)(()=>o.getCodeSize(n||e||""),[e,n]),i=o.formatCodeSize(r),a=o.isCodeSizeExceeded(r);return(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:t(a?"The code size exceeds the recommended value 90kB":"Code size"),children:(0,s.jsx)("span",{className:(0,ot.default)("email-pane__code-size",{"email-pane__code-size_exceeded":a}),children:i})})};function Hi(e){const{limits:t,isLoaded:n}=o.useProjectPlanLimits();return o.useProjectData(),(0,l.useMemo)(()=>({isLocked:!1,state:{state:"allowed"},isPlanDataReady:n,exceeded:null}),[!1,e,t,n])}var yu=({open:e,onClose:t})=>{const{__:n}=o.useI18n();return(0,s.jsxs)(y.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:{closable:!1},footer:null,width:520,className:"browser-extension-warning-modal",title:n("Browser extension detected"),onCancel:t,children:[(0,s.jsx)("p",{children:n("A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.")}),(0,s.jsx)("p",{children:n("We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.")}),(0,s.jsx)("div",{className:"browser-extension-warning-modal__footer",children:(0,s.jsxs)(y.ui_kit$Button,{type:"primary",onClick:t,children:[n("Got it")," "]})})]})},_u={closable:!1},bu=({open:e,onClose:t})=>{const{__:n}=o.useI18n();return(0,s.jsxs)(y.ui_kit$Modal,{open:e,centered:!0,closable:!1,mask:_u,footer:null,width:520,className:"browser-translate-warning-modal",title:n("Browser translation detected"),children:[(0,s.jsx)("p",{children:n("Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.")}),(0,s.jsx)("p",{children:n("To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.")}),(0,s.jsx)("div",{className:"browser-translate-warning-modal__footer",children:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:t,children:n("Got it")})})]})},vu=h.createIdentifier$1("prewarm.editorVisible");function Eu(e){if(typeof requestAnimationFrame!="function"){setTimeout(e,0);return}requestAnimationFrame(()=>requestAnimationFrame(e))}function Su(e={}){const t=e.paint??Eu;let n=!1,r=!1,i=!1,a=!1,c=!1;const d=[],u=()=>{c||a||!n||!r||!i||(a=!0,t(()=>{c=!0,o.mark(o.PHASES.editorVisible);for(const m of d.splice(0))m()}))};return{noteShellVisible(){n=!0,u()},notePagePainted(){r=!0,u()},noteContentShown(){i=!0,u()},whenVisible(m){if(c){m();return}d.push(m)},contentShown:()=>i}}function Ht(e){return e.getOrCreateInstance(vu,()=>Su())}function kn(e){const t=(0,l.useRef)(!1);return e&&(t.current=!0),t.current}var qi=4e3;function Xt(e){const t=window.requestIdleCallback;if(typeof t=="function"){t(e,{timeout:qi});return}window.setTimeout(e,qi)}var qn,nr;function or(){return qn===void 0&&(qn=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/48cd36c4.js")).then(e=>e.panels_exports).then(e=>(nr=e,e),e=>{throw qn=void 0,e}),void 0,{}.url)),qn}function wu(e){(0,l.useEffect)(()=>{Ht(e).whenVisible(()=>{Xt(()=>{or().catch(()=>{})})})},[e])}function ut(e){const t=o.lazyRoute(()=>or().then(r=>({default:r[e]})),"panels");function n(r){const[i]=(0,l.useState)(()=>nr?nr[e]:t);return(0,l.createElement)(i,r)}return n.displayName=`PanelDoor(${String(e)})`,n}var Vi=ut("EmailProperties"),ku=ut("SelectedElementPanel"),Cu=ut("EmailSettings"),Tu=ut("EmailStyles"),Iu=ut("DiscussAi"),Au=ut("Optimise"),xu=ut("FileManagerDataLayer"),Pu=ut("BlocksSearch"),Ru=ut("Discuss"),ju=ut("HistoryPanel"),Lu=ut("AddNewBlockModal"),Ou=ut("AddAllBlocksModal"),Mu=ut("SendTestEmailModal"),Nu=ut("SaveBlockBtn"),rr=ut("LimitUpgradeModal"),Du={height:"100%"},Fu=()=>{const e=o.useContainer(),t=o.isImageCenterModal(o.useSelector(o.selectActiveModal$1)),[n,r]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{e&&Ht(e).whenVisible(()=>r(!0))},[e]),kn(n||t)?(0,s.jsx)(l.Suspense,{fallback:t?(0,s.jsx)(y.ui_kit$PageLoader,{style:Du}):null,children:(0,s.jsx)(xu,{})}):null},Vn;function Bu(){return Vn===void 0&&(Vn=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/49caf02a.js")),void 0,{}.url).catch(e=>{throw Vn=void 0,e})),Vn}function Cn(e){return o.lazyRoute(()=>Bu().then(t=>({default:t[e]})),"form-panels")}var nv=Cn("FormEditorCalendarPanel"),ov=Cn("FormEditorCheckboxPanel"),rv=Cn("FormEditorDropdownListPanel"),iv=Cn("FormEditorInputPanel"),av=Cn("FormEditorRadioPanel");function Uu(){try{const e=new URLSearchParams(window.location.search).get("deferChrome");return e===null?void 0:e!=="0"&&e!=="false"}catch{return}}function $u(e,t){const n=Uu()??o.readLocalToggle(o.LOCAL_STORAGE_ITEMS.em_defer_chrome);if(n!==void 0)return n;const r=t?.deferEditorChrome;return typeof r=="boolean"?r:r&&typeof r=="object"?r[e]??!0:{}.REACT_APP_DEFER_EDITOR_CHROME_DEFAULT!=="false"}function Yi(e){const t=o.useAppConfig(),[n,r]=(0,l.useState)(()=>!$u(e,t));return(0,l.useEffect)(()=>{if(n)return;let i=0;const a=window.requestAnimationFrame(()=>{i=window.requestAnimationFrame(()=>(0,l.startTransition)(()=>r(!0)))});return()=>{window.cancelAnimationFrame(a),window.cancelAnimationFrame(i)}},[n]),n}var Ki=o.createState({blocksTotal:null,blocksTotalPages:null,parentEmailBlocksTotal:null,parentEmailBlocksTotalPages:null,templateBlocks:[],templateBlocksTotal:null,templateBlocksTotalPages:null,elementsView:o.CARDS,elementsList:[],customFolders:{},blocksTrashTotal:0,elementsTrashList:[]}),Yn="blocksPageSlice",ir=o.createSlice({name:Yn,initialState:Ki,reducers:{resetPagesAndTotal:()=>Ki,resetElementsList:e=>{e.elementsList=[]},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeBlockFromList:(e,{payload:t})=>{const n=e.customFolders;t.folder!=="all"&&n[t.folder]?.list&&(n[t.folder]={...n[t.folder],list:n[t.folder].list.filter(r=>r.id!==t.emailId),total:n[t.folder].total-1},e.customFolders=n)}},extraReducers:e=>{e.addMatcher(o.blocksApi.endpoints.getBlocks.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||r?.length,a=n.arg.originalArgs?.status==="trash",c=!!n.arg.originalArgs?.name?.length,d=n.arg.originalArgs?.page,u=n.arg.originalArgs?.folderTag||n.arg.originalArgs?.tags?.[0];a?(c||(t.blocksTrashTotal=i),t.elementsTrashList=r):u?t.customFolders={...t.customFolders,[u]:{list:r,page:d,total:i}}:(t.blocksTotal=i,t.elementsList=r)}),e.addMatcher(o.blocksApi.endpoints.getParentEmailBlocks.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||r?.length||null,a=n.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.parentEmailBlocksTotal=i,t.parentEmailBlocksTotalPages=a}),e.addMatcher(o.blocksApi.endpoints.getTemplateBlocks.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.baseQueryMeta?.response.headers.get("X-WP-Total")||r?.length||null,a=n.baseQueryMeta?.response.headers.get("X-WP-TotalPages");t.templateBlocks=r,t.templateBlocksTotal=i,t.templateBlocksTotalPages=a}),e.addMatcher(o.blocksApi.endpoints.editBlock.matchFulfilled,(t,{payload:n})=>{t.elementsList.map(r=>r.id?.toString()===n.id?.toString()?Object.assign(r,{lock:n.lock,title:n.title,blocktags:n.blocktags}):r)})}}),{resetPagesAndTotal:sv,resetElementsList:lv,toggleElementsView:cv,removeBlockFromList:dv}=ir.actions,zu=e=>e[Yn].blocksTotal,Gu=e=>e[Yn].templateBlocksTotal,Wu=e=>e[Yn].parentEmailBlocksTotal,Hu=class extends Error{label;timeoutMs;constructor(e){super(`[sandbox:ready] iframe handshake timed out after ${e}ms`),this.name="SandboxReadyTimeoutError",this.label="sandbox:ready",this.timeoutMs=e}};function Qi(e){if(!e||typeof e!="object")return!1;const t=e;return typeof t.isInited=="function"&&typeof t.getTarget=="function"&&typeof t.onInit=="function"}function Xi(e,t,n){return e.isInited()&&e.getTarget()?Promise.resolve():(h.throwIfAborted(n),new Promise((r,i)=>{let a=!1,c,d;const u=f=>{a||(a=!0,c!==void 0&&(clearTimeout(c),c=void 0),d?.dispose(),n?.removeEventListener("abort",m),f())},m=()=>{u(()=>i(h.createAbortError(n?.reason)))};if(d=e.onInit(()=>{e.isInited()&&e.getTarget()&&u(()=>r())}),e.isInited()&&e.getTarget()){u(()=>r());return}t>0&&(c=setTimeout(()=>{u(()=>i(new Hu(t)))},t)),n?.addEventListener("abort",m)}))}var qu=()=>{try{return localStorage.getItem("em-debug-project-fonts")==="1"}catch{return!1}},Tn=(e,t)=>{qu()},Vu=e=>[...e].sort((t,n)=>t.order-n.order).map(t=>t.hex.toUpperCase()),Yu=(e,t)=>{const n=Array.isArray(e?.usedColors)?e.usedColors:[],r=new Set,i=[];for(const a of[...n,...Vu(t)]){const c=String(a??"").trim().toUpperCase();!c||r.has(c)||(r.add(c),i.push(a))}return{...e,usedColors:i}},Ji,Ku=e=>{Ji=e},Kn=e=>Yu(e,Ji?.colors??[]),Qu=e=>{const t=o.useMessageService(),n=Oi(e),[r,i]=(0,l.useState)("");(0,l.useEffect)(()=>{Ku(n);const c=n?.fonts??[];o.setCachedProjectFonts(c),ld(c),Tn("parent: cache + host @font-face synced",{projectId:e,fontsCount:c.length,families:c.map(d=>d.family?.trim()||d.name)})},[n,e]),(0,l.useEffect)(()=>{const c=n?.fonts??[],d=td(c),u=JSON.stringify(d);if(u===r){Tn("parent: iframe send skipped (unchanged)",{entriesCount:d.length});return}Tn("parent: scheduling SANDBOX_SET_PROJECT_FONTS",{entriesCount:d.length,entries:d});const m=()=>{t.send(o.EVENT_TYPES.SANDBOX_SET_PROJECT_FONTS,d),i(u),Tn("parent: SANDBOX_SET_PROJECT_FONTS sent",{entriesCount:d.length})};if(t.inited){m();return}const f=t.onInit(()=>{m()});return()=>f.dispose()},[t,n,r]);const a=(0,l.useCallback)(()=>{Tn("parent: iframe reload — will resend project fonts map"),i("")},[]);Zo(a)};function Xu(e,t){const n=e,r=n?.data?.operation!==void 0?n.data:n;if(r?.operation===t)return r.file instanceof File?r.file:void 0}async function Ju(e,t){const{userId:n,folderId:r}=t.readContext();if(n==null||r==null||r==="")return{status:"skipped"};try{const i=await t.prepare(e),a=await t.upload({user_id:n,folder:String(r),file:i});if(a.error)return{status:"failed",error:a.error};const{extractUploadResult:c}=await(0,Ye.__vitePreload)(async()=>{const{extractUploadResult:u}=await Promise.resolve().then(()=>be("./static/core/de7377ec.js")).then(m=>m.import_exports);return{extractUploadResult:u}},void 0,{}.url),d=c(a.data);return d.error||!d.file_url?{status:"skipped"}:{status:"uploaded",url:d.file_url}}catch(i){return{status:"failed",error:i}}}function Zu(){const[e,t]=(0,l.useState)(!1),n=o.useHeadless(),r=o.useEventEmitter(h.events.ON_BROWSER_EXTENSION_DETECTED_ID),i=(0,l.useCallback)(()=>{t(!1)},[]);return(0,l.useEffect)(()=>{const a=r.event(()=>{n||t(!0)});return()=>a.dispose()},[r,n]),{open:e,close:i}}function em(){const[e,t]=(0,l.useState)(!1),n=o.useHeadless(),r=o.useEventEmitter(h.events.ON_BROWSER_TRANSLATE_DETECTED_ID),i=(0,l.useCallback)(()=>{t(!1)},[]);return(0,l.useEffect)(()=>{const a=r.event(()=>{n||t(!0)});return()=>a.dispose()},[r,n]),{open:e,close:i}}var tm=["translated-ltr","translated-rtl"],nm=".goog-te-banner-frame",ar=!1;function om(e){if(e)return e;if(!(typeof document>"u"))return document}function rm(e){const t=om(e);if(!t?.documentElement)return!1;const n=t.documentElement.classList;return tm.some(r=>n.contains(r))?!0:t.querySelector(nm)!=null}function im(){ar=!1}function am(e){const t=rm();return t&&!ar&&e(),ar=t,t}var sm=500;function lm(){const e=o.useEventEmitter(h.events.ON_BROWSER_TRANSLATE_DETECTED_ID),t=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(typeof window>"u")return;const n=()=>{am(()=>{e.fire()})},r=()=>{t.current!=null&&clearTimeout(t.current),t.current=setTimeout(()=>{t.current=null,n()},sm)};n();const i=()=>{r()},a=()=>{document.visibilityState==="visible"&&r()},c=new MutationObserver(()=>{r()});return c.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("focus",i),document.addEventListener("visibilitychange",a),()=>{t.current!=null&&clearTimeout(t.current),im(),c.disconnect(),window.removeEventListener("focus",i),document.removeEventListener("visibilitychange",a)}},[e])}var sr={},Zi=(0,l.createContext)(sr),ea=(0,l.createContext)({current:sr}),ta=(0,l.createContext)(()=>{});function cm({children:e}){const t=o.useDispatch(),n=o.useSelector(o.selectActiveSettingsTab),r=o.useEvent(h.SETTINGS_PANEL_EVENT),[i,a]=(0,l.useState)(sr),c=(0,l.useRef)(i);return c.current=i,(0,l.useEffect)(()=>{const d=r(u=>{const m=u?.type===h.ADVANCED_SETTINGS_PANEL;if((!u||!u.type&&!u.content&&!u.advancedTabs?.length)&&n==="Properties")a({}),t(o.resetToLastActiveSettingsTab());else if(n!=="Properties"&&t(o.setActiveSettingsTab(o.PROPERTIES)),u.advancedTabs?.length&&!m&&!u.content){const f=u.advancedTabs.map(g=>({content:g.content,label:g.label,key:g.key,className:g.className}));a(g=>({settings:{},extraTabs:f}))}else if(m&&u.content){const f=u.advancedTabs?.map(g=>({content:g.content,label:g.label,key:g.key,className:g.className}));a(g=>({settings:{},type:u.type,content:u.content,instanceKey:u.instanceKey,parent:u.parent,caption:u.caption,extraTabs:f,deletable:u.deletable}))}});return()=>d.dispose()},[r,a,t,n]),(0,s.jsx)(ta.Provider,{value:a,children:(0,s.jsx)(ea.Provider,{value:c,children:(0,s.jsx)(Zi.Provider,{value:i,children:e})})})}function lr(){return(0,l.useContext)(Zi)}function dm(){return(0,l.useContext)(ea)}function um(){return(0,l.useContext)(ta)}var na={widthCodeSplit:50,isResizing:!1,currentSide:null},oa=(0,l.createContext)({current:na}),ra=(0,l.createContext)(na.widthCodeSplit),ia=(0,l.createContext)({isResizing:!1,currentSide:null}),aa=(0,l.createContext)({setWidthCodeSplit:()=>{},setIsResizing:()=>{},setCurrentSide:()=>{},setBlockMaxHeight:()=>{}}),sa=(0,l.createContext)("unset");function mm({children:e}){const[t,n]=(0,l.useState)(()=>+window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_code_mode_pane_sizes)||50),[r,i]=(0,l.useState)(!1),[a,c]=(0,l.useState)(null),[d,u]=(0,l.useState)("unset"),m=(0,l.useMemo)(()=>({widthCodeSplit:t,isResizing:r,currentSide:a}),[t,r,a]),f=(0,l.useMemo)(()=>({isResizing:r,currentSide:a}),[r,a]),g=(0,l.useRef)(m);g.current=m;const _=(0,l.useMemo)(()=>({setWidthCodeSplit:n,setIsResizing:i,setCurrentSide:c,setBlockMaxHeight:u}),[]);return(0,s.jsx)(aa.Provider,{value:_,children:(0,s.jsx)(oa.Provider,{value:g,children:(0,s.jsx)(ia.Provider,{value:f,children:(0,s.jsx)(ra.Provider,{value:t,children:(0,s.jsx)(sa.Provider,{value:d,children:e})})})})})}function la(){return(0,l.useContext)(ia)}function ca(){return(0,l.useContext)(ra)}function pm(){return(0,l.useContext)(oa)}function fm(){return(0,l.useContext)(sa)}function hm(){return(0,l.useContext)(aa)}var da=(0,l.createContext)({previewAlertShow:!1,templateNotEmAlertShow:!1}),ua=(0,l.createContext)({setPreviewAlertShow:()=>{},setTemplateNotEmAlertShow:()=>{}});function gm({children:e}){const[t,n]=(0,l.useState)(!1),[r,i]=(0,l.useState)(!1),a=(0,l.useMemo)(()=>({previewAlertShow:t,templateNotEmAlertShow:r}),[t,r]),c=(0,l.useMemo)(()=>({setPreviewAlertShow:n,setTemplateNotEmAlertShow:i}),[]);return(0,s.jsx)(ua.Provider,{value:c,children:(0,s.jsx)(da.Provider,{value:a,children:e})})}function ym(){return(0,l.useContext)(da)}function _m(){return(0,l.useContext)(ua)}function bm({className:e,sidePanelFloating:t,isCodeMode:n,codeModeDirection:r,children:i}){const a=fm(),c=(0,l.useMemo)(()=>{const d=Number.isFinite(a)?`${a}px`:"unset";return{"--em-pane-block-height":t?n&&r==="bottom"?d:"calc(100% - 30px)":"100%"}},[t,n,r,a]);return(0,s.jsx)(y.ui_kit$Layout,{className:e,style:c,children:i})}function vm(){const[e,t]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{let n=0;const r=window.requestAnimationFrame(()=>{n=window.requestAnimationFrame(()=>t(!0))});return()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[]),e}function Em({maxPaneWidth:e,isCodeMode:t,codeModeDirection:n,isShowMobileSettings:r,desktopMobileSwitchPanel:i,children:a}){const c=o.useSelector(o.selectEmailWidth),{isResizing:d,currentSide:u}=la(),m=t&&n!=="bottom"&&!r&&i?"100%":c,f=vm(),g=(0,l.useMemo)(()=>({maxWidth:typeof m=="number"?Math.min(m,e):e,...f?{}:{transition:"none"}}),[m,e,f]);return(0,s.jsx)("div",{className:(0,ot.default)("email-pane__resizable",{"email-pane__resizable_drag":u||d}),style:g,children:a})}function Sm({isCodeMode:e,codeModeDirection:t,sidePanelFloating:n,contentWrapperRef:r,children:i}){const a=ca(),c=(0,l.useMemo)(()=>({flexGrow:1,overflowY:n?"scroll":"hidden",overflowX:"hidden",height:e&&t==="bottom"?`calc(${a}%)`:"100%",width:`${t==="left"?100-a:t==="bottom"?100:a}%`}),[e,t,n,a]);return(0,s.jsx)(y.ui_kit$Col,{style:c,id:"pane-content-wrapper",ref:r,children:i})}function wm({isCodeMode:e,codeModeDirection:t,children:n}){const r=ca(),i=(0,l.useMemo)(()=>({width:`${t==="right"?100-r:t==="bottom"?100:r}%`,position:"relative",height:t==="bottom"?`calc(${100-r}%)`:"unset",display:e?"initial":"none"}),[e,t,r]);return(0,s.jsx)(y.ui_kit$Col,{style:i,children:n})}function km({wrapperRef:e,children:t}){const{isResizing:n,currentSide:r}=la();return(0,s.jsx)("div",{className:(0,ot.default)("email-pane__content-col email-pane__content-col_main",{"email-pane__content-col_disable":r||n}),ref:e,children:t})}function Cm({isShowMobileSettings:e,headless:t,templateNotEmAlertEnabled:n}){const{__:r}=o.useI18n(),{previewAlertShow:i,templateNotEmAlertShow:a}=ym();return(0,s.jsxs)(s.Fragment,{children:[i&&e&&(0,s.jsx)(y.ui_kit$Alert,{title:r("Template is not mobile-friendly"),description:r("While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices."),type:"warning",className:"email-pane__col__alert",closable:!0}),a&&!t&&n&&(0,s.jsx)(y.ui_kit$Alert,{title:r("Template from another editor"),description:r("This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control."),type:"warning",className:"email-pane__col__alert",closable:!0})]})}function ma(){const e=o.useElementEntityKind(),t=o.useSelector(o.selectElementSettings$1),n=o.useSelector(o.selectElementSettings);return e==="email"?t:n}function Tm({isShowMobileSettings:e,propertiesPanelKey:t,onMouseLeave:n,email:r,onClosePanel:i}){const a=ma(),c=lr();return a?.type||c?.type||c?.content||c?.extraTabs?.length?(0,s.jsx)("div",{className:(0,ot.default)("email-pane__collapse-wrapper",{"mobile-view":e,"mobile-properties":e&&t!=="Structure"}),onMouseLeave:n,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Vi,{email:r,formSettings:c,onClosePanel:i})})}):null}function Im({className:e,emailElementType:t}){return(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(ku,{className:e,emailElementType:t,formSettings:lr()})})}function Am({isCodeMode:e,codeModeDirection:t}){const n=o.useElementEntityKind(),r=ma()?.type;return!(r===o.ELEMENT_TYPES.TEXT||r===o.ELEMENT_TYPES.LINK||r===o.ELEMENT_TYPES.IMG||r===o.ELEMENT_TYPES.BUTTON)||!e||t==="bottom"?null:(0,s.jsx)(Im,{className:(0,ot.default)("selected-element-panel__content selected-element-panel__content_abs",{"selected-element-panel__hidden":r===o.ELEMENT_TYPES.IMG}),emailElementType:n})}function xm({isCodeMode:e,codeModeDirection:t,email:n,onClosePanel:r}){const i=lr();return i?.type!=="img"||!e||t==="bottom"?null:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper email-pane__collapse-wrapper_disabled",children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Vi,{email:n,formSettings:i,onClosePanel:r})})})}var Pm="code",Rm=(e,t)=>(0,s.jsx)(t,{className:"email-pane__tab-bar",...e}),{Content:jm}=y.ui_kit$Layout,Lm=()=>{or().catch(()=>{})},Jt=e=>(0,l.memo)(t=>(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(e,{...t})})),Om=Jt(Iu),Mm=Jt(Tu),Nm=Jt(Au),Dm=Jt(Pu),Fm=(0,l.memo)(e=>(0,s.jsx)(pu,{...e})),Bm=(0,l.memo)((0,l.forwardRef)((e,t)=>(0,s.jsx)($i,{...e,ref:t}))),Um=(0,l.memo)(e=>(0,s.jsx)(Mi,{...e})),$m=Jt(Cu),zm=Jt(ju),Gm=Jt(Ru),pa=({emailElement:e,isSuccess:t,setIsCollaborationEditor:n,isShowAddAllBlocksModal:r,triggerOpenSavedBlocksTab:i,setIsShowAddAllBlocksModal:a})=>{const{__:d,_x:u}=o.useI18n(),m=o.useMessageService(),{blockId:f}=o.useRouteParams(),g=o.useEditorProjectId(),_=o.useRouteEmailId(),p=o.useDispatch(),E=Vo(),C=o.useOpenPlanCatalog(),{modal:w}=y.ui_kit$App.useApp(),S=o.useAppConfig(),I=o.useConfigSource(),x=o.useHeadless(),Y=o.useContainer(),Z=Yi("panel");wu(Y),(0,l.useEffect)(()=>{Ht(Y).notePagePainted()},[Y]);const{token:M}=(0,y.ui_kit$useToken)(),L=o.useNotification(),A=o.usePushToDataLayer(),j=o.useProjectData(),z=Ei(j?.id||g);Qu(z);const B=o.useCookieManager(),$=o.useSelector(o.selectActiveSettingsTab),de=o.useCurrentUser(),pe=o.toLanguageCode(o.useInterfaceLocale()),q=o.useStore(),ee=pm(),{setWidthCodeSplit:Fe,setIsResizing:ve,setCurrentSide:et,setBlockMaxHeight:Ee}=hm(),fe=o.useSelector(o.selectActiveModal$1),Q=o.useSelector(o.selectIsCodeMode),me=o.useSelector(o.selectCodeModeDirection),[ae,se]=(0,l.useState)(Q);(0,l.useEffect)(()=>{Q&&se(!0)},[Q]);const Ie=o.useSelector(zu),Ce=o.useSelector(Gu),Be=o.useSelector(Wu),J=o.useSelector(o.selectPropertiesPanelKey),[ye]=o.useLazyClearAiChatQuery(),[Te]=o.useUploadImageMutation(),he=o.useSelector(o.selectEmailViewType)===o.MOBILE,[je,ze]=(0,l.useState)(o.LIGHT),[k,T]=(0,l.useState)(),[P,N]=(0,l.useState)(S.defaultBuildPanel||"empty"),[D,b]=(0,l.useState)("empty"),[W,Pe]=(0,l.useState)(!1),[Ae,Qe]=(0,l.useState)([]),[Ge,Ze]=(0,l.useState)([]),{setPreviewAlertShow:mt,setTemplateNotEmAlertShow:vt}=_m(),{open:ft,close:lt}=Zu(),{open:G,close:K}=em();lm();const ne=o.useRootElement(),ue=o.isEditorLockedByPlan(j,{isPlugin:!0}),ge=o.usePlanFeatureGate("discussion"),We=o.usePlanFeatureGate("code_editor"),Ve=Hi("ai"),at=Ve.exceeded?o.getLimitUpgradePresetDefinition(Ve.exceeded.presetId):null,Bt=S?.configSwither||!1;(0,l.useEffect)(()=>{p(o.resetParentBlocks())},[p]),(0,l.useEffect)(()=>{const v=window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_active_tab);v&&p(o.setActiveSettingsTab(v))},[B,p]);const Me=_||f,Xe=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,ie=um(),te=dm(),U=(0,l.useRef)(null),le=(0,l.useRef)(null),xe=(0,l.useRef)(),Se=(0,l.useRef)(),Ne=(0,l.useRef)(null),He=(0,l.useRef)(),Ue=(0,l.useRef)(),rt=(0,l.useRef)(null),fn=(0,l.useRef)(!1),Lt=(0,l.useRef)(!1),ct=(0,l.useCallback)(()=>{Lt.current=!1},[]),Et=(0,l.useCallback)(()=>{Lt.current=!0},[]),Ot=(0,l.useCallback)(v=>{v?.type===o.ELEMENT_TYPES.SOCIAL&&Et()},[Et]),[jn,Ln]=(0,l.useState)(!1),[hn,On]=(0,l.useState)(!1),[Mn]=o.useEditMeMutation(),[ht,St]=(0,l.useState)(!1),[ce,we]=(0,l.useState)(0),[De,nt]=(0,l.useState)(!1),Le=(0,l.useCallback)(()=>nt(!1),[]),Kt=(0,l.useCallback)(()=>{nt(!1),C()},[C]),[Ut,dt]=(0,l.useState)(!1),Nn=S.configSwither?localStorage.getItem("configSwither")==="pro"?!0:localStorage.getItem("configSwither")==="editor"?!1:S.mode==="pro":!1,$t=(0,l.useCallback)(()=>{clearTimeout(rt.current);const v=".blocks-search__result-holder";ne.querySelector(v)&&(Ie||Ce||Be)&&(ne.querySelector(v).style.removeProperty("transition"),ne.querySelector(v).style.opacity=0,rt.current=setTimeout(()=>{o.measureBlockPreviews(ne,207/660),ne.querySelector(v)&&(ne.querySelector(v).style.transition="opacity 0.2s",ne.querySelectorAll(v).forEach(R=>R.style.opacity=1))},200))},[Ce,Ie,Be]),Tt=(0,l.useRef)(void 0),It=(0,l.useCallback)(v=>{const R=v.target;R&&(window.clearTimeout(Tt.current),Tt.current=window.setTimeout(()=>{Ln(!!R.closest(".desktop_view")),On(!!R.closest(".mobile_view"))},100))},[]);(0,l.useEffect)(()=>()=>{window.clearTimeout(Tt.current)},[]),(0,l.useEffect)(()=>{const v=o.addDocumentListenerFromShadow(ne,"mouseover",It);return()=>{v.dispose()}},[ne,It]),(0,l.useEffect)(()=>{typeof n=="function"&&(Ge.length>0?n(!0):n(!1))},[Ge]);const[Fo]=o.useSendMessageMutation(),{data:gt={},refetch:O,status:V}=o.useGetDialogQuery({entity_id:Me},{skip:!Me||S.aiAssistentEnabled===!1||ue}),X=o.useEventEmitter(h.events.AI_TEXT_REQUEST_ID).hasListeners(),re=o.useIsStandalone(),oe=!X&&!re,H=(0,l.useMemo)(()=>oe?[{data:{role:"assistant",message:d("Typing..."),isLoading:!0}}]:[],[oe,d]),[ke,_e]=(0,l.useState)([]),[qe,gn]=(0,l.useState)(S.defaultBuildPanel!==""?o.BLOCKS:o.ATOMS),Dn=(0,l.useRef)(null),pt=(0,l.useCallback)(()=>{const v=Se.current?.getBoundingClientRect(),R=k?.getBoundingClientRect();m.send({operation:o.EVENT_TYPES.SANDBOX_WINDOW_CHARACTERISTIC,settings:{iframeOffsetTop:Q&&me!=="bottom"?0:30,scrollTop:-v?.top+R?.top+30,innerHeight:window.innerHeight,previewHeight:R?.height,mode:Q&&me!=="bottom"?Pm:"default"}})},[me,Q,k,m]),Bo=t&&e,yn=(0,l.useCallback)(v=>{const R=window.navigator.platform.match("Mac");S.codeEnabled&&S.codeSideEnabled&&v.altKey&&v.keyCode===88&&(E.toggle(),We.isLocked&&(St(!0),we(o.FEATURE_UPSELL_SLIDE.code_editor))),((R?v.metaKey:v.ctrlKey)&&v.shiftKey&&v.keyCode===76||(R?v.metaKey:v.ctrlKey)&&v.shiftKey&&v.keyCode===69||(R?v.metaKey:v.ctrlKey)&&v.shiftKey&&v.keyCode===82)&&v.preventDefault()},[S.codeEnabled,We.isLocked,S.codeSideEnabled,E]),wt=fe.includes("UPLOAD_IMAGE_")||fe.includes("UPLOAD_BACKGROUND_"),_n=(0,l.useRef)(!1),yt=(0,l.useCallback)(v=>{const R=v.target,F=R.closest(".email-pane__content-col")||R.closest(".email-pane__collapse-wrapper")||R.closest(".selected-element-panel-content")||R.closest(".selected-element-panel")||R.closest(".em-analytics__email-tab-properties")||R.closest(".em-analytics__email-tab-styles")||R.closest(".em-analytics__email-tab-history")||R.closest(".blocks-modal-container")||R.closest(".email-pane__sizes")||R.closest(".email-preview-menu")||R.closest(".monaco-editor")||R.closest(".ant-modal-wrap");_n.current=!!F},[]),Hs=(0,l.useCallback)(v=>{const R=_n.current,F=window.getSelection().toString().length>0||document.activeElement&&document.activeElement.tagName==="INPUT"&&document.activeElement.selectionStart!==document.activeElement.selectionEnd;_n.current=!1,!(R||F)&&(!document.querySelector(".easylogic-colorpicker")&&!ne.querySelector(".easylogic-colorpicker")&&!v.target.closest(".email-pane__content-col")&&!v.target.closest(".blocks-modal-container")&&!v.target.closest(".email-pane__collapse-wrapper")&&!v.target.closest(".selected-element-panel__columns-settings__controls__column__remove")&&!v.target.closest(".email-preview__content-col_main")&&!v.target.closest(".email-preview-menu")&&!v.target.closest(".monaco-editor")&&!v.target.closest(".main__pane-close-btn")&&!v.target.closest(".main__pane-trigger")&&!v.target.closest(".ant-modal-wrap")&&!v.target.closest(".email-pane__sizes")&&!v.target.closest(".ant-input-clear-icon")&&!v.target.closest(".ant-color-picker")&&!v.target.closest(".control-font-family-dropdown")&&!Dn.current&&!v.target.closest(".email-preview-menu__history")&&!v.target.closest(".selected-element-panel-content")&&!v.target.closest(".ant-select-dropdown")&&!v.target.closest(".ant-picker-dropdown")&&!v.target.closest(".toggle_view")&&!v.target.closest(".upload-bg-image__menu")&&!v.target.closest(".email-pane__paths")&&!v.target.closest(".ant-tabs-extra-content")&&!v.target.closest(".anticon-delete")&&!wt&&fe!==o.MODALS.IMAGE_EDITOR_MODAL&&($==="Properties"&&(Et(),p(o.resetToLastActiveSettingsTab()),m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Qe([])),$==="History"&&p(o.setActiveSettingsTab(o.BUILD)),p(o.switchIsPanelHistoryCollapsed(!0)),m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),setTimeout(()=>{e.type?p(o.setElementSettings({type:null})):p(o.setElementSettings$1({type:null}))},300)),Dn.current=null)},[p,e.type,fe,$,m,wt]),[Cb,qs]=(0,l.useState)(!0),{data:qr=[],refetch:Uo}=o.useGetCommentsQuery(Me,{skip:!Me||ue});(0,l.useEffect)(()=>{Me&&!ue&&Uo()},[$,Me,ue,Uo]),(0,l.useEffect)(()=>{Me&&!Object.keys(gt).length&&V==="fulfilled"&&O()},[$,Me,O,gt,V]),(0,l.useEffect)(()=>{const v=new h.Disposable,R=window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_active_tab);if(gt?.totalCount===0&&V!=="pending"){const Re={project_id:g,connection:"chat",entity_id:Me,context:"default",locale:pe};!R&&oe&&o.runOnceInFlight(`email-default-context:${Me}`,()=>{o.swallowPromiseRejection(Fo({body:Re}).then(()=>{v.isDisposed()||V==="fulfilled"&&O()}))})}const F={data:{role:"assistant",message:d("Typing..."),isLoading:!0}};return gt?.documents?.length>0?(window.localStorage.removeItem(o.LOCAL_STORAGE_ITEMS.em_active_tab),_e(gt?.documents),oe&&gt?.documents[gt?.documents?.length-1].data?.userInfo&&_e([...gt?.documents,F])):R||_e(oe?[F]:[]),()=>v.dispose()},[Me,pe,gt?.totalCount,gt?.documents,oe,g,O,Fo,V]),(0,l.useEffect)(()=>{ie({}),p(Xe==="email"?o.setElementSettings$1({}):o.setElementSettings({}))},[p,Xe]);const Vs=(0,l.useCallback)(v=>{p(o.setEmailSettings(Kn(v)))},[p]),Ys=(0,l.useCallback)(v=>{p(o.setBlockSettings(Kn(v)))},[p]),Fn=(0,l.useCallback)(v=>{p(Xe==="email"?o.setElementSettings$1(Kn(v)):o.setElementSettings(Kn(v)))},[p,Xe]);(0,l.useEffect)(()=>{const v=He.current,R=Ne.current;T(Q?R??v:v)},[Q,me]);const[Tb,Ib]=(0,l.useState)(null),Ab=(0,l.useCallback)(v=>{S.sidePanelFloating&&(Ne.current=v),Ib(v)},[S.sidePanelFloating]),Bn=(0,l.useCallback)(v=>{N(v),v==="search"?Pe(!0):(Pe(!1),b(v)),setTimeout($t,50)},[$t]),xb=(0,l.useCallback)(v=>{const R=v.data.operation,F=v.data,Re=v.data.action;if(R==="application_block_inserted"||v.data.operationId==="application_block_inserted"){const Oe=v.data.operationId?v.data.data:F||{},Nt=Oe.type==="project"||Oe.type==="template"||Oe.type==="common"?"block":"structure",vn=Oe.name||Oe.type||(Nt==="block"?"block":"structure");A({event:"add",action:"add_element_to_email",element_type:Nt,element_name:vn,entity_id:e?.id||_||f,project_id:j?.id||g})}if(R===o.EVENT_TYPES.APPLICATION_SCROLL_TO&&setTimeout(()=>{Ne.current?.scrollTo({top:v.data.settings.value,behavior:"smooth"})},100),R===o.EVENT_TYPES.APPLICATION_PREVIEW_ALERT_SHOW&&mt(F.settings.show),R===o.EVENT_TYPES.APPLICATION_TEMPLATE_NOT_EM_ALERT_SHOW&&vt(!0),R===o.EVENT_TYPES.APPLICATION_ACTION&&Re==="toggle_editor"&&E.toggle(),R===o.EVENT_TYPES.APPLICATION_IFRAME_SET_HEIGHT&&(ne.querySelector(".email-pane__iframe").style.height=F.settings.height+"px"),R===o.EVENT_TYPES.APPLICATION_EMAIL_SETTINGS_SET){let Oe=Object.assign({},F.settings);delete Oe.preheader,Object.values(Oe).every(Nt=>!Nt)?(p(o.setEmailSettingsDisable(!0)),p(o.resetToLastActiveSettingsTab())):Vs(F.settings),F.settings.noBlocks,p(o.setMobileViewActive(F.settings.responsive)),qs(Oe.structuresMedia)}if(R===o.EVENT_TYPES.APPLICATION_BLOCK_SETTINGS_SET&&(Object.values(F.settings).every(Oe=>!Oe)?(p(o.setBlockSettingsDisable(!0)),p(o.resetToLastActiveSettingsTab())):(Ys(F.settings),qs(F.settings.structuresMedia))),R===o.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_SET){const Oe=Object.values(o.ELEMENT_TYPES).includes(F.type),Nt=te.current,vn=Nt?.type==="advanced"&&!!Nt.content,At=F.tab?!0:!Oe&&!vn,{type:Gb,caption:Wb,settings:Hb}=F,ol=JSON.stringify([Gb,Wb,Hb]),qb=ol!==U.current;if(U.current=ol,At&&$==="Properties"&&p(o.resetToLastActiveSettingsTab()),F.type===o.ELEMENT_TYPES.EMPTY_TABLE||F.type===o.ELEMENT_TYPES.EMPTY_TD?(p(o.setActiveSettingsTab(o.BUILD)),F.type===o.ELEMENT_TYPES.EMPTY_TABLE?(gn(o.BLOCKS),F.tab?Bn(F.tab):Bn("common")):F.type===o.ELEMENT_TYPES.EMPTY_TD&&gn(o.ATOMS)):F.type&&$!=="Properties"?F.type===o.ELEMENT_TYPES.SOCIAL&&Lt.current?ct():(ct(),p(o.setActiveSettingsTab(o.PROPERTIES))):F.type!==o.ELEMENT_TYPES.SOCIAL&&ct(),!qb)return;F.type===o.ELEMENT_TYPES.CAROUSEL||F.type===o.ELEMENT_TYPES.ACCORDION||F.type===o.ELEMENT_TYPES.SOCIAL?(ie(tn=>({settings:{...F.settings,type:At?null:F.type,caption:F.caption,parent:At?null:F.settings.parent},type:At?null:F.type,parent:At?null:F.settings.parent,caption:F.caption,extraTabs:tn.extraTabs})),Fn({})):(Fn({...F.settings,type:At?null:F.type,parent:At?null:F.settings.parent,caption:F.caption}),ie(tn=>!Oe&&tn.type==="advanced"&&tn.content?{...tn,settings:{...F.settings,type:F.type,parent:F.settings?.parent,caption:F.caption}}:tn.extraTabs?.length?{extraTabs:tn.extraTabs}:{})),F.settings?.path?.length>0&&Qe(F.settings?.path)}R===o.EVENT_TYPES.APPLICATION_ELEMENT_SETTINGS_CLOSE&&(U.current=null,te.current?.type===o.ELEMENT_TYPES.SOCIAL&&Et(),p(o.resetToLastActiveSettingsTab()))},[p,Vs,Ys,Fn,$,Bn,ne,A,e,_,f,j,ct,Et,E,g,te,ie,mt,vt]);(0,l.useEffect)(()=>{o.identifyUser({id:de?.id,email:de?.email,username:de?.name})},[de]),(0,l.useEffect)(()=>{const v=de.email_builder_config,R=!ue,F=I.get()?.mode;if(!v||typeof v!="string")return;const Re=R&&v==="simple"?"pro":v;Re!==F&&p(o.changeConfig(Re))},[ue,de.email_builder_config,de.id,p,q,I]),(0,l.useEffect)(()=>{if(Q&&We.isLocked&&E.toggle(),S.configSwither){let v=localStorage.getItem("configSwither")||S.mode||"editor";localStorage.setItem("configSwither",v),p(o.changeConfig(v))}},[]);const Ks=v=>{setTimeout(()=>{if(ue)p(o.changeConfig("pro")),dt(!0),St(!0),A({event:"change",action:"change_config_mode",config_mode:"pro",entity_id:e?.id||_||f,project_id:j?.id||g});else{let R=v?"pro":"editor";localStorage.setItem("configSwither",R),p(o.changeConfig(R)),A({event:"change",action:"change_config_mode",config_mode:R,entity_id:e?.id||_||f,project_id:j?.id||g})}},200)},Pb=()=>{Q&&E.toggle(),p(o.resetToLastActiveSettingsTab()),p(o.changeConfig("simple")),dt(!1),St(!1),A({event:"change",action:"change_config_mode",config_mode:"simple",entity_id:e?.id||_||f,project_id:j?.id||g})},Rb=(0,l.useCallback)(()=>{St(!1)},[]);o.useListenPostMessage(xb),(0,l.useEffect)(()=>{const v=m.addListener(R=>{const F=Xu(R,o.EVENT_TYPES.APPLICATION_NATIVE_IMAGE_DROP);if(!F)return;const Re=()=>m.send({operation:o.EVENT_TYPES.SANDBOX_NATIVE_IMAGE_DROP_CLEAR});(async()=>{const Oe=await Ju(F,{readContext:()=>({userId:de?.id,folderId:j?.id??g}),prepare:At=>o.prepareImageForEditorUpload(At,S),upload:At=>Te(At)});if(Oe.status==="failed"&&L.fromError("IMAGE_UPLOAD_ERROR",F,Oe.error,!0),Oe.status!=="uploaded"){Re();return}m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_SETTINGS_SET,type:o.ELEMENT_TYPES.IMG,settings:{src:Oe.url}});const Nt=q.getState(),vn=Xe==="email"?o.selectElementSettings$1(Nt):o.selectElementSettings(Nt);vn?.type===o.ELEMENT_TYPES.IMG&&Fn({...vn,src:Oe.url,changeKey:"src"})})()});return()=>v.dispose()},[m,Te,de,g,j?.id,S,L,Fn,q,Xe]),(0,l.useEffect)(()=>{const v=m.addListener("application_atom_inserted",F=>{A({event:"add",action:"add_element_to_email",element_type:"atom",element_name:F||"atom",entity_id:e?.id||_||f,project_id:j?.id||g})}),R=m.addListener("application_block_inserted",F=>{const Re=F?.type==="project"||F?.type==="template"||F?.type==="common"?"block":"structure",Oe=F?.name||F?.type||(Re==="block"?"block":"structure");A({event:"add",action:"add_element_to_email",element_type:Re,element_name:Oe,entity_id:e?.id||_||f,project_id:j?.id||g})});return()=>{v?.dispose(),R?.dispose()}},[m,A,e?.id,_,f,g,j?.id]);const jb=v=>{let R=ne.querySelector(".atoms__list");S.toggleSidePanel&&v===$?p(o.setActiveSettingsTab(o.DISABLED_TAB)):v==="Optimize"?xt.comingSoonHandler(d,w):v!=="Properties"&&v!=="History"?(p(o.setActiveSettingsTab(v)),A({event:"navigate",action:"navigate_email_pane_tab",tab_name:v==="Disabled_tab"?"DISABLED_TAB":v,entity_id:e?.id||_||f,project_id:j?.id||g}),m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),Qe([])):(v==="Properties"||v==="History")&&A({event:"navigate",action:"navigate_email_pane_tab",tab_name:v,entity_id:e?.id||_||f,project_id:j?.id||g}),ge.isLocked&&v==="Discuss"&&(St(!0),we(o.FEATURE_UPSELL_SLIDE.discussion)),ue&&v==="Optimise"&&(St(!0),we(6)),Ve.isLocked&&v==="AiChat"&&(Ve.state.state==="locked_by_limit"&&Ve.exceeded?nt(!0):(St(!0),we(9)))},Vr=(0,l.useRef)(null),$o=(0,l.useRef)(void 0),Mt=(0,l.useCallback)(()=>{const v=Ne.current?.getBoundingClientRect();if(Vr?.current?.getBoundingClientRect().top>=0&&v){const R=Math.round(v.height-30);Vr.current.style.height=`${R}px`,Ee(R-30)}$o.current&&window.clearTimeout($o.current),$o.current=window.setTimeout(function(){m.isInited()&&pt()},100)},[pt,m,Ee]);(0,l.useEffect)(()=>()=>{window.clearTimeout($o.current)},[]),(0,l.useEffect)(()=>($==="AiChat"&&!ue?le.current=setInterval(()=>{O({entity_id:Me})},5e3):clearInterval(le.current),clearInterval(le.current)),[Me,ue,O,$]);const Lb=v=>gn(v||""),Ob=()=>{Pe(!1),N(D)},Yr=()=>{let v=ne.querySelector(".block-search__preview");v&&(v.style.opacity="0",v.style.transform="translateX(-99%)",setTimeout(function(){v.remove()},300))};let bn=[];const Un={display:"flex",alignItems:"center",justifyContent:"center"};S.blocksEmptyEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Empty blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"BorderOuterOutlined",component:y.icons$BorderOuterOutlined,style:{fontSize:18}})})}),value:"empty"}),S.blocksSavedEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Saved blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"AppstoreAddOutlined",component:y.icons$AppstoreAddOutlined,style:{fontSize:18}})})}),value:"project"}),S.blocksCommonEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Common blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"AppstoreOutlined",component:y.icons$AppstoreOutlined,style:{fontSize:18}})})}),value:"common"}),S.blocksTemplateEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Template blocks"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"BuildOutlined",component:y.icons$BuildOutlined,style:{fontSize:18}})})}),value:"template"}),S.blocksSearchEnabled&&bn.push({label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Blocks search"),children:(0,s.jsx)("div",{style:Un,children:(0,s.jsx)(o.EmIcons,{icon:"SearchOutlined",component:y.icons$SearchOutlined,style:{fontSize:18}})})}),value:"search"});const zo=P!=="empty"||W,Mb=!S.blocksSectionsShow||zo?"100%":"calc(100% - 44px)";let Nb=[{label:(0,s.jsx)("div",{className:"email-pane__tab",children:d("Elements")}),key:o.ATOMS,className:"email-pane__collapse-panel email-pane__atoms",children:(0,s.jsx)(Um,{})},{label:(0,s.jsx)("div",{className:"email-pane__tab",children:d("Blocks")}),key:o.BLOCKS,className:"email-pane__collapse-panel email-pane__blocks-search",style:{height:Mb},children:(0,s.jsxs)("div",{className:(0,ot.default)("email-pane__blocks-panel",{"email-pane__blocks-panel_scrollable":zo}),children:[S.blocksSectionsShow&&(0,s.jsxs)("div",{className:"email-pane__blocks-panel-header",children:[(0,s.jsxs)(y.ui_kit$Space.Compact,{block:!0,children:[!W&&(0,s.jsx)(y.ui_kit$Segmented,{block:!0,style:{width:"100%",marginTop:24},onChange:Bn,value:P,options:bn}),W&&(0,s.jsx)("div",{style:{width:"100%",height:36}}),W&&(0,s.jsx)("div",{style:{width:36,textAlign:"right",marginTop:22},children:(0,s.jsx)(o.EmIcons,{icon:"CloseOutlined",component:y.icons$CloseOutlined,style:{padding:"0 2px 0",cursor:"pointer"},onClick:Ob})})]}),(0,s.jsx)("div",{className:"blocks-search__divider-wrapper",style:{marginTop:W?28:12},children:(0,s.jsx)(y.ui_kit$Divider,{className:"blocks-search__divider"})})]}),(0,s.jsxs)("div",{className:"email-pane__blocks-panel-body",children:[(0,s.jsx)("div",{className:"blocks-search__empty-shadow",style:{display:P==="empty"&&!W?"block":"none"},children:Cb?(0,s.jsx)(mi,{}):(0,s.jsx)(di,{})}),(0,s.jsx)("div",{className:(0,ot.default)("email-pane__blocks-panel-results",{"email-pane__blocks-panel-results_visible":zo}),children:(0,s.jsx)(Dm,{parentEmailId:e?.parent_email,blocksTab:P,search:W,reloadBlockScreens:$t,setIsShowAddAllBlocksModal:a})})]})]})}];const $n=[{disabled:ht,key:o.PROPERTIES,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-properties",children:(0,s.jsx)(Tm,{isShowMobileSettings:he,propertiesPanelKey:J,onMouseLeave:Yr,email:e,onClosePanel:Ot})},{disabled:ht,key:o.HISTORY,style:{height:"var(--em-pane-block-height)"},className:"em-analytics__email-tab-history",children:Bo&&(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",onMouseLeave:Yr,children:(0,s.jsx)(zm,{setCollapsedHistory:()=>p(o.switchIsPanelHistoryCollapsed(!0)),emailElement:Bo})})},{key:o.DISABLED_TAB,className:"em-analytics__email-tab-properties"},{disabled:ht,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Build","tab"),children:(0,s.jsx)(o.EmIcons,{"data-testid":"contentIcon",icon:"PlusCircleOutlined",component:y.icons$PlusCircleOutlined,size:24,strokeWidth:S.iconStrokeWidth})}),key:o.BUILD,className:"em-analytics__email-tab-build",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:(0,ot.default)("email-pane__collapse-wrapper",{"email-pane__collapse-wrapper_no-topleft-radius":$==="Build"||!$,"email-pane__collapse-wrapper_build":qe==="Blocks"&&zo}),onMouseLeave:Yr,children:(0,s.jsx)(y.ui_kit$Tabs,{className:(0,ot.default)("secondary-tabs email-pane__collapse",{"secondary-tabs_unset_scroll":qe===o.BLOCKS}),size:"large",activeKey:qe,onChange:Lb,items:Nb})})},{disabled:ht,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Styles","tab"),children:(0,s.jsx)(o.EmIcons,{"data-testid":"stylesIcon",icon:"Styles",component:y.icons$Styles,size:24,strokeWidth:S.iconStrokeWidth})}),key:o.STYLES,className:"em-analytics__email-tab-styles",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(Mm,{email:e})})}];S.commentsEnabled&&$n.push({disabled:ht,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("Discuss","tab"),children:[(0,s.jsx)(o.EmIcons,{"data-testid":"commentsIcon",icon:"CommentOutlined",component:y.icons$CommentOutlined,size:24,strokeWidth:S.iconStrokeWidth}),ge.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:S.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),!!qr.length&&(0,s.jsx)("span",{className:"email-pane__comment-counter",children:qr.filter(v=>v.comment_status!=="deleted").length})]}),key:"Discuss",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-wrapper",size:"large",activeKey:"Discuss",items:[{label:(0,s.jsx)(s.Fragment,{children:d("Discuss")}),key:"Discuss",forceRender:!0,className:"email-settings__collapse-panel",children:Me?(0,s.jsx)(Gm,{email:e,comments:qr,subjectId:Me,isLoggedIn:!0,emailElementType:Xe}):(0,s.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})});const Db=()=>{ye({entity_id:Me}).then(v=>{v.error?L.error({title:v.error.data.code,description:v.error.data.message}):v.data.success&&L.success({title:d("Success"),description:v.data.success}),ue||O()})};S.aiAssistentEnabled&&$n.push({disabled:ht,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("AI assistant","tab"),children:[(0,s.jsx)(o.EmIcons,{"data-testid":"aiAssistentIcon",icon:"AI",component:y.icons$AI,size:24,strokeWidth:S.iconStrokeWidth}),Ve.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:S.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"}),gt?.totalCount>0&&Me&&(0,s.jsx)("span",{className:"email-pane__comment-counter",children:gt?.totalCount})]}),key:"AiChat",className:"email-pane__tab-discuss em-analytics__email-tab-discuss",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs email-settings__collapse discuss-ai-wrapper",size:"large",activeKey:"AiChat",tabBarExtraContent:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"top",title:d("Clear chat"),children:(0,s.jsx)(y.ui_kit$Popconfirm,{description:d("Clear chat history?"),onConfirm:Db,okText:d("Yes"),cancelText:d("No"),icon:"",placement:"leftTop",title:!1,children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"ClearChat",component:y.icons$ClearChat,style:{fontSize:16}}),style:{marginRight:16}})})}),items:[{label:(0,s.jsx)(s.Fragment,{children:d("AI assistant")}),key:"AiChat",forceRender:!0,className:"email-settings__collapse-panel",children:Me||window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_active_tab)?(0,s.jsx)(Om,{messages:ke.length>0?ke:H,newEmailAiGeneratorRef:fn}):(0,s.jsx)("div",{className:"aside-content-wrapper",children:e.hasOwnProperty("type")?(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the block before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}}):(0,s.jsx)(y.ui_kit$Alert,{description:d("Save the email before commenting."),type:"info",showIcon:!0,style:{marginBottom:20}})})}]})})})}),S.optimizeEnabled&&$n.push({disabled:ht,label:(0,s.jsxs)(y.ui_kit$Tooltip,{placement:"left",title:u("Optimize","tab"),children:[(0,s.jsx)(o.EmIcons,{"data-testid":"optimizeIcon",icon:"Speed",component:y.icons$Speed,size:24,strokeWidth:S.iconStrokeWidth}),ue&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:S.iconStrokeWidth,className:"free-mode-firewall-icon free-mode-firewall-icon_emailpane"})]}),key:"Optimise",className:"em-analytics__email-tab-optimise",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)(y.ui_kit$Tabs,{className:"secondary-tabs secondary-tabs_optimise email-settings__collapse optimise-wrapper",size:"large",activeKey:"Optimise",items:[{label:(0,s.jsx)(s.Fragment,{children:d("Optimize")}),key:"Optimise",forceRender:!0,className:"email-settings__collapse-panel",children:(0,s.jsx)(Nm,{})}]})})}),S.settingsEnabled&&$n.push({disabled:ht,label:(0,s.jsx)(y.ui_kit$Tooltip,{placement:"left",title:u("Settings","tab"),children:(0,s.jsx)(o.EmIcons,{"data-testid":"settingsIcon",icon:"SettingOutlined",component:y.icons$SettingOutlined,size:24,strokeWidth:S.iconStrokeWidth})}),key:"Edit",className:"em-analytics__email-tab-edit",style:{height:"var(--em-pane-block-height)",overflow:"hidden"},children:(0,s.jsx)("div",{className:"email-pane__collapse-wrapper",children:(0,s.jsx)($m,{email:e})})});const Qs=$===o.DISCUSS,Xs=(0,l.useRef)(0),Js=(0,l.useRef)(0),Zs=(0,l.useRef)(0),Fb=(0,l.useCallback)(()=>(ne.querySelector(".email-pane__col_preview")?.getBoundingClientRect().width??0)-(S.sidePanelFloating?0:38),[ne,S.sidePanelFloating]);(0,l.useEffect)(()=>{Me&&!ue&&Uo()},[Me,ue,Uo]),(0,l.useEffect)(()=>{const v=m.onInit(()=>{m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1}),m.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_DISCUSS,value:Qs})});return()=>v.dispose()},[Qs,m]),(0,l.useEffect)(()=>{if(!k||!Qi(m))return;const v=new AbortController;return Xi(m,o.DEFAULT_SANDBOX_READY_TIMEOUT_MS,v.signal).then(()=>pt()).catch(()=>{}),()=>v.abort()},[k,pt,m]);const Kr=(0,l.useCallback)(v=>{const R=v??o.selectEmailWidth(q.getState());m.send({operation:o.EVENT_TYPES.SANDBOX_IFRAME_SETSIZE,settings:{iframeWidth:typeof R=="number"?R+2:R}}),xe.current?.resize()},[q,m]);(0,l.useEffect)(()=>{if(!he&&$!=="Disabled_tab"){const v=ne.querySelector(".email-pane__row")?.getBoundingClientRect().width;Se?.current?.getBoundingClientRect().width+540>v&&p(o.setEmailWidth("100%"))}},[p,$,ne,he]);const Qr=(0,l.useCallback)(()=>{const v=Se.current;v&&(v.style.borderWidth="1px",S.sidePanelFloating||(v.style.marginLeft="-1px",v.style.marginRight="-1px"),v.style.borderLeftColor=null,v.style.borderRightColor=null)},[S.sidePanelFloating]),el=(0,l.useCallback)(v=>{const R=ee.current.widthCodeSplit;ve(!1),ee.current.currentSide&&(setTimeout(()=>Kr(),50),et(null)),v.target.classList.contains("email-pane__handle")||Qr(),window.localStorage.setItem(o.LOCAL_STORAGE_ITEMS.em_code_mode_pane_sizes,JSON.stringify(R))},[Kr,ee,ve,et,Qr]),tl=v=>R=>{R.target.classList.contains("email-pane__handle")&&(R.preventDefault(),Xs.current=R.target.parentNode.offsetWidth,Js.current=R.pageX,Zs.current=Fb(),et(v),Dn.current=v)},Go=v=>{const R=Se.current,{currentSide:F}=ee.current;typeof v=="string"&&(!F||F===v)?(ne.querySelector(".email-pane__iframe").style.width="calc(100% + 1px)",v==="right"?(R.style.borderRightColor=M.colorPrimary,R.style.borderRightWidth="2px"):(R.style.borderLeftColor=M.colorPrimary,R.style.borderLeftWidth="2px",ne.querySelector(".email-pane__iframe").style.marginLeft="-1px")):F||(Qr(),ne.querySelector(".email-pane__iframe").style.width="1px",ne.querySelector(".email-pane__iframe").style.removeProperty("margin-left"))},Bb=(0,l.useCallback)(()=>{ve(!0)},[ve]),Xr=(0,l.useCallback)(v=>{const{currentSide:R}=ee.current;if(!R)return;const F=(v.pageX-Js.current)*2,Re=Xs.current+(R==="left"?-F:F),Oe=Math.min(Zs.current,1200);Re>318&&Re<Oe&&(p(o.setEmailWidth(Math.min(Re,1200))),xe.current?.resize())},[p,ee]),Jr=(0,l.useCallback)(v=>{if(ee.current.isResizing)if(me==="bottom"){const R=Ue.current.getBoundingClientRect().height,F=Ue.current.getBoundingClientRect().top,Re=(v.clientY-F)/R*100;if(Re<20||Re>80)return;Fe(Re),Mt()}else{const R=Ue.current.getBoundingClientRect().width,F=Ue.current.getBoundingClientRect().left,Re=(v.clientX-F)/R*100,Oe=Se.current.getBoundingClientRect().width;if(S.desktopMobileSwitchPanel&&typeof Oe=="number"&&Oe<=425&&p(o.setEmailWidth(425)),Re<20||Re>80)return;Fe(Re)}},[ee,Fe,me,Mt,p,S.desktopMobileSwitchPanel]);(0,l.useEffect)(()=>{Mt()},[Q,Mt]);const Ub=v=>{v?.stopPropagation?.();const R=je==="light"?o.DARK:o.LIGHT;m.send({operation:o.EVENT_TYPES.SANDBOX_SWITCH_THEME,data:{theme:R}}),ze(R)},nl=(v="panel")=>{const R=v==="panel",F=je===o.DARK,Re={size:R?18:16,strokeWidth:R?S.iconStrokeWidth:2};return(0,s.jsx)(y.ui_kit$Tooltip,{title:d(F?"Light theme":"Dark theme"),placement:R?"top":"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:R?F?"primary":"text":"default",icon:F?(0,s.jsx)(o.EmIcons,{icon:"LightMode",component:y.icons$LightMode,...Re}):(0,s.jsx)(o.EmIcons,{icon:"DarkMode",component:y.icons$DarkMode,...Re}),shape:"circle",size:R?void 0:"small",onClick:Ub,className:"toggle_view theme_view email-pane__theme-toggle",style:R?void 0:{left:4,top:4,zIndex:999,padding:0,position:"absolute"}})})},Zr=v=>{const R=typeof v=="number"?Math.min(v,1200):v;p(o.setEmailWidth(R)),setTimeout(()=>Kr(R),700);const F=typeof R=="number"?R:R==="100%"?"full":R,Re=typeof R=="number"&&R<=425?"mobile":"desktop";A({event:"change",action:"change_email_size",email_id:e?.id||_||f,project_id:j?.id||g,width:F,view_type:Re})};(0,l.useEffect)(()=>{const v=new h.Disposable;return v.addDisposable(o.addWindowListenerFromShadow(ne,"mousedown",yt,!0)),v.addDisposable(o.addWindowListenerFromShadow(ne,"click",Hs)),v.addDisposable(o.addWindowListenerFromShadow(ne,"mouseup",R=>el(R),!0)),()=>{v.dispose()}},[ne,Hs,yt,el]),(0,l.useEffect)(()=>{const v=Ne.current;if(!v||typeof ResizeObserver!="function")return;const R=new ResizeObserver(Mt);return R.observe(v),()=>R.disconnect()},[Mt,S.sidePanelFloating]),(0,l.useEffect)(()=>(window.addEventListener("scroll",Mt,!0),window.addEventListener("mousemove",Xr,!0),window.addEventListener("mousemove",Jr),window.addEventListener("keydown",yn),()=>{window.removeEventListener("mousemove",Xr,!0),window.removeEventListener("mousemove",Jr),window.removeEventListener("scroll",Mt,!0),window.removeEventListener("keydown",yn)}),[Mt,Xr,Jr,yn]);const $b=v=>{const R=Q?"visual":"code",F=!Q;if(Q?E.toggle():typeof v=="string"?(E.setDirection(v),!Q&&E.toggle()):E.toggle(),F){const Re=Xe==="block"?"block":"email",Oe=typeof v=="string"?v:me||"toggle";A({event:"activate",action:"activate_code_mode",entity_type:Re,entity_id:e?.id||_||f,project_id:j?.id||g,code_mode_direction:Oe})}A({event:"change",action:"change_editor_mode",editor_mode:R,entity_id:e?.id||_||f,project_id:j?.id||g}),p(o.resetToLastActiveSettingsTab()),setTimeout(()=>{p(Xe==="block"?o.setElementSettings({type:null}):o.setElementSettings$1({type:null}))},300),m.send({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),p(o.resetPanes())};(0,l.useEffect)(()=>{S.emailPaneDesktopSize&&p(o.setEmailWidth(S.emailPaneDesktopSize))},[p,S.emailPaneDesktopSize]);const zb=()=>{gn(o.BLOCKS),Bn("project")};return(0,l.useEffect)(()=>{i&&zb()},[i]),(0,s.jsx)(o.ElementEntityKindProvider,{kind:Xe,children:(0,s.jsxs)(bm,{className:(0,ot.default)("email-pane",{"email-pane_code-mode":Q,"email-pane_only_code_mode_mobile":S.onlyCodeModeInMobile,"email-pane_code-mode-bottom":Q&&me==="bottom","email-pane_no-element-navigation":!S.switchDesktopMobilePropsEnabled&&!S.stepToOtherElementEnabled&&!S.deleteButtonEnabled,"email-pane_is-mobile":he,"email-pane_path-enabled":S.pathEnabled}),sidePanelFloating:!!S.sidePanelFloating,isCodeMode:!!Q,codeModeDirection:String(me),children:[(0,s.jsxs)(jm,{className:"email-pane__container",ref:He,children:[(0,s.jsx)(Am,{isCodeMode:Q,codeModeDirection:me}),(0,s.jsx)(Cm,{isShowMobileSettings:he,headless:!!x,templateNotEmAlertEnabled:!!S.templateNotEmAlertShow}),(0,s.jsxs)(y.ui_kit$Row,{ref:Ue,className:(0,ot.default)("email-pane__row",{"email-pane__left":Q&&me==="right","email-pane__right":Q&&me==="left","email-pane__bottom":Q&&me==="bottom","email-pane__sizeSwitcher":S.desktopMobileSwitchPanel,"email-pane__reverse":S.menuDirection==="left","email-pane__pinch":!S.sidePanelFloating}),children:[(0,s.jsxs)(Sm,{isCodeMode:Q,codeModeDirection:me,sidePanelFloating:S.sidePanelFloating,contentWrapperRef:Ab,children:[(0,s.jsx)("div",{className:"email-pane__iframe-scroll-top",id:"iframe-scroll-top"}),S.desktopMobileSwitchPanel&&(0,s.jsxs)(y.ui_kit$Space,{className:"email-pane__sizes-panel-wrapper",orientation:"vertical",size:10,children:[(0,s.jsxs)(y.ui_kit$Space,{className:"email-pane__sizes-panel",size:0,children:[nl("panel"),(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Desktop view"),placement:"top",open:jn,children:(0,s.jsx)(y.ui_kit$Button,{type:he?"text":"primary",icon:(0,s.jsx)(o.EmIcons,{icon:"DesktopOutlined",component:y.icons$DesktopOutlined,size:18,strokeWidth:S.iconStrokeWidth}),shape:"circle",onClick:()=>Zr(S.emailPaneDesktopSize||1e3),className:"toggle_view desktop_view"})}),(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Mobile view"),placement:"top",open:hn,children:(0,s.jsx)(y.ui_kit$Button,{type:he?"primary":"text",icon:(0,s.jsx)(o.EmIcons,{icon:"MobileOutlined",component:y.icons$MobileOutlined,size:18,strokeWidth:S.iconStrokeWidth}),shape:"circle",onClick:()=>Zr(425),className:"toggle_view mobile_view"})})]}),S.codeSideEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:d("Code mode"),placement:"right",children:(0,s.jsx)(y.ui_kit$Button,{type:Q?"primary":"default",icon:(0,s.jsx)(o.EmIcons,{icon:"Code",component:y.icons$Code}),shape:"circle",onClick:()=>$b("right")})})]}),(0,s.jsxs)(y.ui_kit$Row,{className:(0,ot.default)("email-pane__col-wrapper",{container:Q&&me==="bottom"||!Q,"email-pane__col-wrapper_reverse":S.menuDirection==="left","email-pane__col-wrapper_pinch":!S.sidePanelFloating}),style:{flexGrow:1,maxWidth:"unset",paddingTop:S.desktopMobileSwitchPanel&&Q&&me!=="bottom"?"60px":""},children:[(0,s.jsxs)(y.ui_kit$Col,{className:"email-pane__col email-pane__col_preview",style:{flexGrow:1,maxWidth:"unset"},ref:S.sidePanelFloating?null:Ne,children:[S.desktopMobileSwitchRule&&(0,s.jsx)(Ld,{onSelectWidth:Zr,themeToggle:nl("rule")}),(0,s.jsxs)(Em,{maxPaneWidth:1200,isCodeMode:Q,codeModeDirection:me,isShowMobileSettings:he,desktopMobileSwitchPanel:S.desktopMobileSwitchPanel,children:[(0,s.jsx)("div",{className:"email-pane__handle left",onMouseDown:tl("left"),onMouseEnter:()=>Go("left"),onMouseLeave:Go}),(0,s.jsx)("div",{className:"email-pane__handle right",onMouseDown:tl("right"),onMouseEnter:()=>Go("right"),onMouseLeave:Go}),(0,s.jsx)(km,{wrapperRef:Se,children:(0,s.jsx)(Bm,{ref:xe,className:"email-pane__iframe",email:e,handlerSendPosition:Mt,clip:Tb})})]})]}),(0,s.jsx)(y.ui_kit$Col,{style:{display:Q&&me!=="bottom"||S.disableSideMenu?"none":"initial"},ref:Vr,onPointerEnter:Lm,className:(0,ot.default)("email-pane__content-col email-pane__content-col_menu email-pane__content-col_tabs email-pane__col email-pane__col_settings",{"email-pane__col_disabled":$===o.DISABLED_TAB}),children:(!Q||me==="bottom")&&Z&&(0,s.jsx)(y.ui_kit$Tabs,{className:(0,ot.default)("email-pane__col_settings-inner",{"email-pane__col_settings-inner_reverse":S.menuDirection==="left"}),size:"medium",activeKey:$,onTabClick:jb,renderTabBar:Rm,tabPlacement:"right",items:$n,tabBarExtraContent:Bt&&(0,s.jsx)("div",{style:{paddingTop:15,textAlign:"center"},children:ue?(0,s.jsx)(y.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:Ks,checked:Ut}):(0,s.jsx)(y.ui_kit$Switch,{variant:"editorMode",checkedChildren:"Pro",unCheckedChildren:"Pro",onChange:Ks,defaultChecked:Nn})})})})]}),(0,s.jsx)("div",{className:"email-pane__iframe-scroll-bottom",id:"iframe-scroll-bottom"})]}),(0,s.jsxs)(wm,{isCodeMode:Q,codeModeDirection:me,children:[(0,s.jsx)("div",{className:"email-pane__code-divider",onMouseDown:Bb}),(0,s.jsx)("div",{className:"code-mode__pane code-mode__pane_editor email-pane__pane email-pane__pane_editor",children:(0,s.jsx)("div",{className:"code-mode__pane-content email-pane__pane-content",children:ae&&(0,s.jsx)(Fm,{email:e,setOtherUsers:Ze,readOnly:S.lockEditor,newEmailAiGeneratorRef:fn})})})]})]}),S.pathEnabled&&(0,s.jsxs)("div",{className:"email-pane__paths",children:[(0,s.jsx)(fu,{elementPath:Ae}),(0,s.jsx)(gu,{fallbackHtml:e?.html})]}),(0,s.jsx)("div",{className:"collaborator-list",children:(0,s.jsx)(o.CollaboratorList,{users:Ge,isEditor:!1,isPlugin:!0,token:M})})]}),(0,s.jsx)(xm,{isCodeMode:Q,codeModeDirection:me,email:e,onClosePanel:Ot}),(0,s.jsx)(Fu,{}),(0,s.jsx)(o.PlanUpgradePrompt,{open:ht,onCancel:Pb,onTrialActivated:Rb,initialSlide:ce}),at&&Ve.exceeded?(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(rr,{open:De,onClose:Le,title:d(at.titleKey),subtitle:d(at.subtitleKey),usageResource:at.usageResource,previousDisplay:o.presetLimitDisplay(Ve.exceeded.previousLimit),nextDisplay:o.presetLimitDisplay(Ve.exceeded.nextLimit),onChangePlan:Kt})}):null,(0,s.jsx)(yu,{open:ft,onClose:lt}),(0,s.jsx)(bu,{open:G,onClose:K})]})})};pa.propTypes={};var Wm=e=>(0,s.jsx)(cm,{children:(0,s.jsx)(mm,{children:(0,s.jsx)(gm,{children:(0,s.jsx)(pa,{...e})})})}),Hm=(0,l.memo)(Wm),qm=({open:e,onClose:t})=>{const{__:n}=o.useI18n(),r=o.getSupportEmail(),[i,a=""]=n("To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.").split("{supportEmail}");return(0,s.jsx)(y.ui_kit$Modal,{width:440,open:e,onCancel:t,title:(0,s.jsxs)("div",{style:{paddingBottom:8},children:[(0,s.jsx)(o.EmIcons,{icon:"EmailConfirmation",component:y.icons$EmailConfirmation,size:20,strokeWidth:2})," ",n("Email confirmation required")]}),footer:[(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:n("Got it")},"ok")],children:(0,s.jsxs)("p",{children:[i,(0,s.jsx)("a",{href:`mailto:${r}`,children:r}),a]})})},Qn=e=>{const t=o.useCurrentUser(),[n,r]=(0,l.useState)({owner:!1,admin:!1,user:!1}),i=o.useProjectData(),{data:a}=o.useGetProjectQuery(e,{skip:!e||!t.id||!!i}),c=i||a;return(0,l.useEffect)(()=>{if(c){const d=o.getMyProjectRole(c,t);r({owner:d==="owner",admin:d==="admin",user:d==="user"})}},[c,t]),n},cr=o.getLimitUpgradePresetDefinition("preview_exceeded"),fa=({emailElement:e,isCollaborationEditor:t})=>{const{__:n}=o.useI18n(),r=o.useDispatch(),i=Vo(),a=o.useOpenPlanCatalog(),c=o.useSendPostMessage(),{blockId:d}=o.useRouteParams(),u=o.useRouteEmailId(),m=o.useSelector(o.selectActiveModal$1)===o.MODALS.SEND_TEST_EMAIL,f=kn(m),[g,_]=(0,l.useState)(!1),[p,E]=o.useSendLivePreviewMutation(),C=o.useCurrentUser(),w=o.useDocumentHistoryReader(),S=o.useProjectPlanLimitPreflight(),{owner:I}=Qn(),x=Jo(),Y=Fd(),Z=o.useContentReader(),M=o.useSelector(o.selectIsPanelHistoryCollapsed),L=o.useSelector(o.selectIsCodeMode),A=o.useSelector(o.selectCodeModeDirection),{token:j}=(0,y.ui_kit$useToken)(),z=o.useNotification(),B=o.useAppConfig(),$=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,de=o.useEventEmitter(h.events.ON_SHARE_ID),pe=o.useEventEmitter(h.events.ON_SHOW_PREVIEW_ID),[q,ee]=(0,l.useState)(!1),[Fe,ve]=(0,l.useState)(0),[et,Ee]=(0,l.useState)(!1),fe=kn(et),Q=(0,l.useCallback)(()=>Ee(!1),[]),me=(0,l.useCallback)(()=>{Ee(!1),a()},[a]),[ae,se]=(0,l.useState)(n("—")),[Ie,Ce]=(0,l.useState)(!1),Be=o.useProjectData(),J=o.usePlanFeatureGate("version_history"),ye=o.usePlanFeatureGate("code_editor"),Te=o.usePlanFeatureGate("preview_service"),he=o.usePlanFeatureGate("undo_redo"),je=o.isEditorLockedByPlan(Be,{isPlugin:!0}),ze=o.usePushToDataLayer(),k=e?.project,T=ge=>{const We=$==="block"?"block":"email";typeof ge=="string"?(i.setDirection(ge),!L&&i.toggle()):i.toggle(),ze({event:"activate",action:"activate_code_mode",entity_type:We,entity_id:e?.id||u||d,project_id:e?.project||k}),setTimeout(()=>{r($==="block"?o.setElementSettings({type:null}):o.setElementSettings$1({type:null}))},300),c({operation:o.EVENT_TYPES.SANDBOX_ELEMENT_ACTIVE_RESET}),ye.isLocked&&(ee(!0),ve(o.FEATURE_UPSELL_SLIDE.code_editor))},P=(0,l.useCallback)(async()=>!0,[S]),N=async()=>{if(je){ee(!0),ve(8);return}await P()&&(r(o.openModal$1(o.MODALS.SEND_TEST_EMAIL)),ze({event:"open",action:"open_test_email_modal",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||k}))},D=()=>{ee(!0),ve(o.FEATURE_UPSELL_SLIDE.undo_redo)},b=()=>{x.undo()},W=()=>{x.redo()},Pe=async()=>{const ge=(await de.fire({project:k,id:u})).find(We=>We===!1||typeof We=="string");ge!==!1&&navigator.clipboard.writeText(ge||o.buildEmailRawShareUrl(u,k)).then(()=>{z.success(n("A shareable link to this page has been copied to the clipboard.")),ze({event:"click",action:"share_email",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||k})})},Ae=async()=>{if(!g){if(!await P())return;const ge={email:u,subject:encodeURIComponent("#"+e.project+" "+e.title).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A"),content:encodeURIComponent(Z()).replaceAll(/%20/gi,"+").replaceAll(/%0A/gi,"%0D%0A")};p(ge),_(!0),ze({event:"click",action:"open_email_inbox_tests",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||k})}},Qe=(0,l.useCallback)(async()=>{await P()&&(se(n("—")),Ee(!0))},[n,P]);(0,l.useEffect)(()=>{E.isError&&(z.error(E),_(!1))},[E]),(0,l.useEffect)(()=>{if(E.isSuccess&&g){if(E.data?.status===401)z.error({title:E.data.code,description:E.data.message});else if(E.data){let ge=document.createElement("A");ge.setAttribute("target","_blank"),ge.setAttribute("href",E.data.message),ge.click()}_(!1)}},[E,g,z]);const[Ge,Ze]=(0,l.useState)(!1),mt=()=>{c({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:M}),r(o.switchIsPanelHistoryCollapsed(!M))},vt=()=>w(e?.id),ft=()=>{M?(Ze(!0),vt().then(ge=>{ge.isSuccess?ge.data.data.length:ge.isError&&z.error(ge),mt(),r(o.setActiveSettingsTab(o.HISTORY)),Ze(!1),ze({event:"open",action:"open_version_control",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||k}),J.isLocked&&(ee(!0),ve(o.FEATURE_UPSELL_SLIDE.version_history))})):(r(o.resetToLastActiveSettingsTab()),mt())},lt=()=>{M||(mt(),r(o.resetToLastActiveSettingsTab())),L&&i.toggle(),ee(!1)};let G=[];const K=(0,l.useCallback)(async()=>{const ge=await pe.fire({project:k,id:u});ge.find(We=>We===!1||typeof We=="string")!==!1&&(window.open(ge.find(We=>We)||o.buildEmailRawSharePath(u,k)),ze({event:"click",action:"open_email_preview",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||k}))},[pe,k,u,ze,$,e,d]),ne=(0,l.useCallback)(async()=>{window.open(o.buildGetElementPreviewPath(o.EMAIL,u,k)),ze({event:"click",action:"open_web_version",entity_type:$==="block"?"block":"email",entity_id:e?.id||u||d,project_id:e?.project||k})},[k,u,ze,$,e,d]);B.previewModeEnabled&&G.push({key:"Preview_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Preview mode"),onClick:K}),B.livePreviewEnabled&&G.push({key:"Live_preview",icon:g?(0,s.jsx)(o.EmIcons,{icon:"LoadingOutlined",component:y.icons$LoadingOutlined,style:{fontSize:16}}):(0,s.jsx)(o.EmIcons,{icon:"CheckCircleVerified",component:y.icons$CheckCircleVerified,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Live preview"),onClick:C.id?.toString()===e.project_author?.toString()&&C?.subscription?.post_name==="community"&&I?Qe:Ae}),B.webversionEnabled&&G.push({key:"Web version",icon:(0,s.jsx)(o.EmIcons,{icon:"Web",component:y.icons$Web,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Web version"),onClick:ne}),B.sharePreviewEnabled&&G.push({key:"Share",icon:(0,s.jsx)(o.EmIcons,{icon:"ShareAltOutlined",component:y.icons$ShareAltOutlined,size:18,strokeWidth:B.iconStrokeWidth}),label:n("Share"),onClick:Pe,className:"em-analytics__email-share"});const ue=[{key:"Left_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:B.iconStrokeWidth,style:{color:A==="left"&&L?j.colorPrimary:"inherit"}}),label:n("Left Code panel"),onClick:()=>T("left")},{key:"Right_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:B.iconStrokeWidth,style:{transform:"rotate(180deg)",color:A==="right"&&L?j.colorPrimary:"inherit"}}),label:n("Right Code panel"),onClick:()=>T("right")},{key:"Bottom_mode",icon:(0,s.jsx)(o.EmIcons,{icon:"PanelLeft",component:y.icons$PanelLeft,size:18,strokeWidth:B.iconStrokeWidth,style:{transform:"rotate(-90deg)",color:A==="bottom"&&L?j.colorPrimary:"inherit"}}),label:n("Bottom Code panel"),onClick:()=>T("bottom")}];return(0,s.jsxs)("div",{className:"email-preview-menu email-preview-menu_new",children:[(0,s.jsxs)(y.ui_kit$Space,{size:32,children:[(0,s.jsxs)(y.ui_kit$Space,{className:"email-preview-menu__versions",size:8,style:{borderRadius:`calc(${o.emCssVar("borderRadius")} * 1px)`},children:[(0,s.jsx)(y.ui_kit$Tooltip,{title:n(t?o.COLLABORATION_EDITOR_WARNING_TEXT:"Undo (Ctrl+Z)"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"UndoOutlined",component:y.icons$UndoOutlined,size:22,strokeWidth:B.iconStrokeWidth}),he.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:he.isLocked?D:b,disabled:!he.isLocked&&!Y.canUndo})}),(0,s.jsx)(y.ui_kit$Tooltip,{title:n(t?o.COLLABORATION_EDITOR_WARNING_TEXT:"Redo (Ctrl+Shift+Z)"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"RedoOutlined",component:y.icons$RedoOutlined,size:22,strokeWidth:B.iconStrokeWidth}),he.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:he.isLocked?D:W,disabled:!he.isLocked&&!Y.canRedo})}),B.historyEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Version history"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:M?"text":"primary",ghost:!M,onClick:ft,disabled:e.isNew||Ge,className:"email-preview-menu__history",icon:Ge?(0,s.jsx)(y.ui_kit$Spin,{size:"small"}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"HistoryOutlined",component:y.icons$HistoryOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon email-preview-menu__list-item-icon_revert"}),J.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]})})})]}),(0,s.jsxs)(y.ui_kit$Space,{size:8,style:{borderRadius:`calc(${o.emCssVar("borderRadius")} * 1px)`},children:[B.codeEnabled&&(0,s.jsx)(y.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:ue},trigger:"hover",mouseEnterDelay:0,className:"email-preview-menu__code",children:(0,s.jsx)(y.ui_kit$Button,{type:L?"primary":"text",ghost:L,icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"Code",component:y.icons$Code,size:22,strokeWidth:B.iconStrokeWidth}),ye.isLocked&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:T})},"Code mode"),B.previewIconEnabled&&(Te.isLocked?(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Preview mode"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:()=>{ee(!0),ve(o.FEATURE_UPSELL_SLIDE.preview_service)}})}):(0,s.jsx)(y.ui_kit$Dropdown,{arrow:!0,placement:"bottom",menu:{items:G},className:"email-preview-menu__preview",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",target:"_blank",rel:"noreferrer",icon:(0,s.jsx)(o.EmIcons,{icon:"EyeOutlined",component:y.icons$EyeOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),onClick:B.previewModeEnabled?K:void 0})},"Preview")),B.sendTestEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n("Send a test email"),placement:"bottom",children:(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__email-open-test email-preview-menu__test",type:"text",icon:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.EmIcons,{icon:"SendOutlined",component:y.icons$SendOutlined,size:22,strokeWidth:B.iconStrokeWidth,className:"email-preview-menu__list-item-icon"}),je&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:14,strokeWidth:B.iconStrokeWidth,className:"free-mode-firewall-icon"})]}),onClick:N})})]})]}),f&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Mu,{isModalVisible:m,email:e})}),(0,s.jsx)(qm,{open:Ie,onClose:()=>Ce(!1)}),(0,s.jsx)(o.PlanUpgradePrompt,{open:q,onCancel:lt,initialSlide:Fe}),fe&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(rr,{open:et,onClose:Q,title:n(cr.titleKey),subtitle:n(cr.subtitleKey),usageResource:cr.usageResource,previousDisplay:ae,nextDisplay:o.presetLimitDisplay("infinity"),onChangePlan:me})})]})};fa.propTypes={};var Vm=[["brace-percent",/<!--\{%/],["brace-hash",/<!--\{#/],["proscript",/<!--\[%/],["getresponse",/<!--\[\[(?:if|else\]\]|endif\]\])/i],["mailchimp",/<!--\*\|/],["expert-sender",/<!--<\/?(?:if|else|var)/i]],Ym=200;function ha(e=new Set){const t=new Set;return(n,r)=>{if(!Vm.some(([a,c])=>!e.has(a)&&c.test(n)))return;const i=r??`new:${n.length}:${n.slice(0,200)}`;t.has(i)||(t.size>=Ym&&t.clear(),t.add(i))}}function ga(){return{isConfigured:()=>!1,toEditorForm:e=>e,toOutputForm:e=>e,keepWrappedOnOutput:new Set,editorPolicy:{},warnAboutUnconfiguredInput:ha()}}var Km=ga();function rn(e){return e?.getInstance(h.TEMPLATE_DIRECTIVES_ID)??Km}function Qm({html:e,renderGuid:t,showToken:n,showId:r,...i},a){const{requested:c}=o.getCurrentProject(a),d=o.getAppConfig(a);return o.filterUndefined({...i,code:rn(a).toOutputForm(e),project:c===void 0?i.project:c,utm_parameters:d.UTMEnabled?i.utm_parameters:void 0,tags:void 0,template:void 0,guid:void 0,emailtags:void 0,project_title:void 0,project_author:void 0,is_template:void 0,is_inited:void 0})}var Xm=zt.__commonJSMin(((e,t)=>{o.init__polyfill_node_global(),(function(n,r){typeof define=="function"&&define.amd?define([],r):typeof e<"u"?r():(r(),n.FileSaver={})})(e,function(){"use strict";function n(m,f){return typeof f>"u"?f={autoBom:!1}:typeof f!="object"&&(f={autoBom:!f}),f.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(m.type)?new Blob(["\uFEFF",m],{type:m.type}):m}function r(m,f,g){var _=new XMLHttpRequest;_.open("GET",m),_.responseType="blob",_.onload=function(){u(_.response,f,g)},_.onerror=function(){},_.send()}function i(m){var f=new XMLHttpRequest;f.open("HEAD",m,!1);try{f.send()}catch{}return 200<=f.status&&299>=f.status}function a(m){try{m.dispatchEvent(new MouseEvent("click"))}catch{var f=document.createEvent("MouseEvents");f.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),m.dispatchEvent(f)}}var c=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof o._polyfill_node_global_default=="object"&&o._polyfill_node_global_default.global===o._polyfill_node_global_default?o._polyfill_node_global_default:void 0,d=c.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=c.saveAs||(typeof window!="object"||window!==c?function(){}:"download"in HTMLAnchorElement.prototype&&!d?function(m,f,g){var _=c.URL||c.webkitURL,p=document.createElement("a");f=f||m.name||"download",p.download=f,p.rel="noopener",typeof m=="string"?(p.href=m,p.origin===location.origin?a(p):i(p.href)?r(m,f,g):a(p,p.target="_blank")):(p.href=_.createObjectURL(m),setTimeout(function(){_.revokeObjectURL(p.href)},4e4),setTimeout(function(){a(p)},0))}:"msSaveOrOpenBlob"in navigator?function(m,f,g){if(f=f||m.name||"download",typeof m!="string")navigator.msSaveOrOpenBlob(n(m,g),f);else if(i(m))r(m,f,g);else{var _=document.createElement("a");_.href=m,_.target="_blank",setTimeout(function(){a(_)})}}:function(m,f,g,_){if(_=_||open("","_blank"),_&&(_.document.title=_.document.body.innerText="downloading..."),typeof m=="string")return r(m,f,g);var p=m.type==="application/octet-stream",E=/constructor/i.test(c.HTMLElement)||c.safari,C=/CriOS\/[\d]+/.test(navigator.userAgent);if((C||p&&E||d)&&typeof FileReader<"u"){var w=new FileReader;w.onloadend=function(){var x=w.result;x=C?x:x.replace(/^data:[^;]*;/,"data:attachment/file;"),_?_.location.href=x:location=x,_=null},w.readAsDataURL(m)}else{var S=c.URL||c.webkitURL,I=S.createObjectURL(m);_?_.location=I:location.href=I,_=null,setTimeout(function(){S.revokeObjectURL(I)},4e4)}});c.saveAs=u.saveAs=u,typeof t<"u"&&(t.exports=u)})})),an=Xm(),In="NEXT_BUTTON",dr="SAVE_BUTTON",ur="KEYBOARD",Jm="EXTERNAL",Zm=new Set([dr,In,ur]);function ep(e){return e!=null&&e!==""&&Zm.has(e)}function ya(e){if(!e||e==="all")return;const t=Number(e);return Number.isFinite(t)?[t]:void 0}var _a=(0,l.createContext)(null);function tp(){const e=(0,l.useContext)(_a);if(!e)throw new Error("useEmailSaveController must be used within EmailSaveContext.Provider");return e}var np=2;function op({email:e,documentSession:t,save:n,saveState:r}){const i=o.useDispatch(),{__:a}=o.useI18n(),c=o.useEditorProjectId();o.useRouteEmailId();const d=+c,u=Number.isFinite(d)&&d>0?d:e?.project,m=o.useCookieManager(),f=o.useContainer(),g=o.useNotification(),_=o.useAppConfig(),p=o.useConfigSource(),[E,C]=(0,l.useState)(0),w=(0,l.useRef)(""),[S,I]=(0,l.useState)(!1),x=o.useEventEmitter(h.events.ON_NEXTBUTTON_CLICK_ID),Y=o.useEventEmitter(h.events.ON_SAVEBUTTON_CLICK_ID);o.useEvent(h.events.ON_EMAIL_INIT_ID);const Z=_.activeNextButton===!1,M=_.disableDoubleClickNextButton!==!1,L=(0,l.useRef)(!1),A=(0,l.useRef)(void 0),j=(0,l.useRef)(null),z=(0,l.useRef)(null),B=(0,l.useRef)(e);B.current=e;const $=(0,l.useCallback)(()=>{A.current=void 0},[]),de=(0,l.useCallback)(J=>{p.merge({activeNextButton:!J},"user")},[p]),pe=(0,l.useCallback)((J,ye)=>{const Te=o.saveRefusalReason(ye);if(Te==="locked"){g.error({id:"EMAIL_ACCESS_TO_LOCKED_ERROR",data:o.getEmailDesc(J),message:a("No access to edit the letter.")});return}if(Te==="too-many-tags"){g.error({id:"EMAIL_TOO_MANY_TAGS_ERROR",data:o.getEmailDesc(J),message:a("Maximum 10 tags available.")});return}const he=o.failedTerms(ye);if(he){he.failed.forEach(je=>{if(he.kind==="group"){g.fromError("GROUP_CREATING_ERROR",{id:je.id??0,name:je.name,parent:je.parent??0},ye);return}g.fromError("TAG_CREATING_ERROR",je.name,ye)});return}g.fromError(J.isNew?"EMAIL_CREATING_ERROR":"EMAIL_EDITING_ERROR",o.getEmailDesc(J),ye)},[g,a]),q=(0,l.useCallback)(J=>{const ye=ep(J),Te=()=>{I(!1),J===In&&(L.current=!1,de(!1))};if(!e){Te();return}const he=async()=>{(ze=>{n("publish",{project:ze.isNew?u:ze.project,folder:ya(m.get(o.APP_COOKIES.em_folder)),source:J}).then(k=>{if(I(!1),L.current=!1,!k){J===In&&de(!1),ye&&(pe(ze,r().error),$());return}ye&&(g.success({id:"EMAIL_SAVING_SUCCESS",message:a("The email was successfully saved."),data:o.getEmailDesc(ze)}),$())})})(e)};I(!0),he()},[e,i,c,a,t,m,u,g,pe,n,r,de,$]);o.useCommand(o.SAVE_COMMAND_ID,(0,l.useCallback)(J=>q(J||Jm),[q]));const ee=(0,l.useRef)(void 0),Fe=(0,l.useRef)(q);Fe.current=q;const ve=(0,l.useCallback)(J=>{w.current=J,C(ye=>ye+1)},[]);(0,l.useEffect)(()=>()=>{ee.current!==void 0&&clearTimeout(ee.current)},[]),(0,l.useEffect)(()=>{if(E===0)return;const J=w.current;B.current?.isNew&&(A.current=J),ee.current!==void 0&&clearTimeout(ee.current),ee.current=setTimeout(()=>{ee.current=void 0,Fe.current(J)})},[E]);const et=(0,l.useCallback)(J=>{(J.ctrlKey||J.metaKey)&&J.keyCode===83&&(J.preventDefault(),ve(ur))},[ve]);(0,l.useEffect)(()=>(document.addEventListener("keydown",et),()=>{document.removeEventListener("keydown",et)}),[et]);const Ee=(0,l.useCallback)(J=>{const ye=J.data.operation,Te=J.data.action;ye===o.EVENT_TYPES.APPLICATION_ACTION&&Te==="save_email"&&ve(ur)},[ve]);o.useListenPostMessage(Ee),(0,l.useEffect)(()=>{e?.isNew&&(z.current=null,j.current=null)},[e?.isNew,e?.renderGuid]),(0,l.useEffect)(()=>{L.current=!1},[e?.id]);const fe=m.get(o.APP_COOKIES.em_folder),Q=f?o.provideAutosaveUiFacts(f):void 0;(0,l.useEffect)(()=>{Q?.set({...Q?.get()??{isUserBusy:!1,saveContext:{}},saveContext:{project:u,folder:ya(fe)}})},[Q,u,fe]);const me=(0,l.useRef)(!1),ae=r().failures;(0,l.useEffect)(()=>{ae>=np&&!me.current&&(me.current=!0,g.warning({message:a("Changes are not being saved. Check your connection.")})),ae===0&&(me.current=!1)},[ae,g,a]);const se=S,Ie=r().saving,Ce=(0,l.useCallback)(J=>{ve(J||dr)},[ve]),Be=(0,l.useCallback)(async(J,ye)=>{if(J===In){if(L.current)return;L.current=!0;try{M&&de(!0),(await x.fire(ye)).every(Te=>Te!==!1)?ve(In):(de(!1),L.current=!1)}catch(Te){g.fromError("NEXT_BUTTON_CLICK_EVENT_ERROR",o.getEmailDesc(ye),Te,!0),de(!1),L.current=!1}return}try{(await Y.fire(ye)).every(Te=>Te!==!1)&&ve(J||dr)}catch(Te){g.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",o.getEmailDesc(ye),Te,!0)}},[M,x,Y,g,de,ve]);return(0,l.useMemo)(()=>({requestSave:Ce,requestSaveWithEvents:Be,isLoading:se,isAutosaveLoading:Ie,nextButtonDisabled:Z}),[Ce,Be,se,Ie,Z])}var rp="NEXT_BUTTON",ip="SAVE_BUTTON",ba=({email:e=null,disabled:t})=>{const{__:n}=o.useI18n(),r=o.useAppConfig(),i=o.useContentReader(),a=o.useNotification(),{requestSaveWithEvents:c,isLoading:d,isAutosaveLoading:u,nextButtonDisabled:m}=tp(),f=d||u,[g,_]=(0,l.useState)(null);(0,l.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&_(!0)},[]);const p=r.saveButtonEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:n(g?"Save by ⌘S":"Save by Ctrl+S"),placement:"bottom",children:(0,s.jsx)("span",{className:"em-analytics__email-save-tooltip-target",children:(0,s.jsx)(y.ui_kit$Button,{disabled:t||u,type:r.nextButtonEnabled?"default":"primary",block:"false",className:"em-analytics__email-save",loading:f,icon:(0,s.jsx)(o.EmIcons,{icon:"SaveOutlined",component:y.icons$SaveOutlined,size:16,strokeWidth:r.iconStrokeWidth}),onClick:async C=>{const w=C.currentTarget,S={...e,html:i()};try{await c(ip,S)}catch(I){a.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",o.getEmailDesc(S),I,!0)}finally{try{w?.blur?.()}catch{}}},children:r.saveButtonText||n("Save")})})},"save-button"),E=r.nextButtonEnabled&&(0,s.jsx)(y.ui_kit$Button,{disabled:t||m,type:"primary",block:"false",className:"em-analytics__email-save",icon:r.primaryCommandButtonIcon,loading:d,onClick:async()=>{const C={...e,html:i()};await c(rp,C)},children:r.nextButtonText||n("Continue")},"next-button");return(0,s.jsx)(s.Fragment,{children:r.saveButtonEnabled&&r.nextButtonEnabled?(0,s.jsx)(y.ui_kit$Space,{children:[p,E]}):[p,E]})};ba.propTypes={email:$e.default.shape({id:$e.default.string,isNew:$e.default.bool,title:$e.default.string,lock:$e.default.bool,subject:$e.default.string,html:$e.default.string,description:$e.default.string,utm_parameters:$e.default.shape({utm_source:$e.default.string,utm_medium:$e.default.string,utm_campaign:$e.default.string,utm_term:$e.default.string,utm_content:$e.default.string}),project:$e.default.number,is_template:$e.default.bool}),disabled:$e.default.bool};var va=({element:e,context:t="list"})=>{const{__:n,_x:r}=o.useI18n(),[i]=o.useEditEmailMutation(),[a]=o.useEditBlockMutation(),c=o.useNotification(),d=o.usePushToDataLayer();e.hasOwnProperty("type");const u=(f,g)=>{if(f.error)return c.error(f),!1;c.success(n("The ")+(g.hasOwnProperty("type")?n("block"):r("email","letter"))+" "+n("“")+f.data.title+n("”")+n("was successfully")+" "+(g.lock?g.hasOwnProperty("type")?r("unlocked.","block"):r("unlocked.","email"):g.hasOwnProperty("type")?r("locked.","block"):r("locked.","email")))},m=()=>{const f=!e.lock,g=f?"lock_email":"unlock_email";e.hasOwnProperty("type")?a({blockId:e.id,lock:f}).then(_=>{u(_,e),_.error||d({event:f?"lock":"unlock",action:f?"lock_block":"unlock_block",entity_type:"block",entity_id:e.id,project_id:e.project,context:t})}):i({emailId:e.id,lock:f}).then(_=>{u(_,e),_.error||d({event:f?"lock":"unlock",action:g,entity_type:"email",entity_id:e.id,project_id:e.project,context:t})})};return(0,s.jsx)("div",{className:e.hasOwnProperty("type")?"em-analytics__block-lock":"em-analytics__email-lock",onClick:m,children:e.lock?n("Unlock"):n("Lock")})};va.propTypes={element:$e.default.shape({lock:$e.default.bool,id:$e.default.string})};var ap=({open:e,codeSize:t,onMinimize:n,onDownloadAsIs:r,onCancel:i})=>{const{__:a}=o.useI18n(),c=o.formatCodeSize(t);return(0,s.jsx)(y.ui_kit$Modal,{open:e,onCancel:i,footer:null,className:"code-size-warning-modal",width:480,children:(0,s.jsxs)("div",{className:"code-size-warning-modal__content",children:[(0,s.jsx)("h3",{className:"code-size-warning-modal__title",children:a("Code Size Warning")}),(0,s.jsxs)("div",{className:"code-size-warning-modal__message",children:[(0,s.jsxs)("p",{children:[a("The current code size is")," ",(0,s.jsx)("strong",{children:c}),","," ",a("which exceeds the recommended 90 KB limit.")]}),(0,s.jsx)("p",{children:a("Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.")})]}),(0,s.jsxs)(y.ui_kit$Space,{className:"code-size-warning-modal__actions",size:"medium",children:[(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:n,size:"large",children:a("Minimize code")}),(0,s.jsx)(y.ui_kit$Button,{onClick:r,size:"large",children:a("Download as is")})]})]})})};function sp(e){return e.includes("em-narrow-table")}function lp(e){if(!e||sp(e))return!1;const t=e.includes("nl-container"),n=/row-content\s+stack/.test(e)||/stack\s+row-content/.test(e),r=/\brow-\d/.test(e),i=/_block\s+block-\d/.test(e),a=e.includes('role="presentation"');return t&&n&&(r||i)&&a}function cp(e){return e?e.includes("em-narrow-table"):!1}function dp(e){return e.includes("em-narrow-table")}function up(e){return e.includes("i-amphtml")||e.includes("amp-runtime")||e.includes("amp-version")}function mp(e){if(!e||dp(e)||up(e))return!1;const t=e.includes("es-wrapper"),n=/es-(?:header|content|footer)-body/.test(e);return t||n}function Ea(){o.useAppConfig();const e=o.useIntegratorConfigValue("beeFreeConverterEnabled"),t=o.useIntegratorConfigValue("stripoConverterEnabled"),n=o.useIntegratorConfigValue("aiLayoutConverterEnabled"),r=e===!0,i=t===!0,a=n===!0;return{beeFreeConverterEnabled:r,stripoConverterEnabled:i,aiLayoutConverterEnabled:a,anyConverterEnabled:r||i||a}}function Sa(e,t){return!e||cp(e)?null:lp(e)?t.beeFreeConverterEnabled?"beefree":null:mp(e)?t.stripoConverterEnabled?"stripo":null:t.aiLayoutConverterEnabled?"ai":null}var pp=()=>"emailmaker",fp={unisender:{id:"unisender",name:"Unisender",icon:"/images/integrations/unisender.svg",description:"Export emails to Unisender",cardDescription:"Mass mailing automation, audience segmentation, and campaign performance analytics.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Unisender API key",helpUrl:"https://app.unisender.com/ru/v5/cp/user/info/api"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Unisender"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"number",label:"Contact List ID",required:!0,placeholder:"e.g., 123456"}]},mailganer:{id:"mailganer",name:"Mailganer",icon:"/images/integrations/mailganer.svg",description:"Export emails to Mailganer",cardDescription:"Contact sync, content personalization, and real-time campaign results tracking.",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Mailganer API key",helpUrl:"https://mailganer.com/app/profile/"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Mailganer"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Mailing Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"theme",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},sendsay:{id:"sendsay",name:"Sendsay",icon:"/images/integrations/sendsay.svg",description:"Export emails to Sendsay",cardDescription:"Mailing automation, audience segmentation, and email personalization.",apps:["emailmaker"],settingsFields:[{name:"login",type:"text",label:"Account Login",required:!0,placeholder:"e.g., myaccount or myaccount/sublogin",extra:"Your Sendsay account login (not email). For sublogin use format: account/sublogin",fullWidth:!0},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter Sendsay API key",helpUrl:"https://docs.sendsay.ru/sendsay-api/how-to-get-apikey"},{name:"from_email",type:"email",label:"Sender Email",required:!1,placeholder:"sender@example.com",extra:"This email must be verified in Sendsay"},{name:"from_name",type:"text",label:"Sender Name",required:!1,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Draft Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]},klaviyo:{id:"klaviyo",name:"Klaviyo",icon:"/images/integrations/klaviyo.svg",description:"Export emails to Klaviyo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., pk_xxxxxxxx",helpUrl:"https://help.klaviyo.com/hc/en-us/articles/7423954176283-How-to-create-a-private-API-key",extra:"Use a custom key with templates:write and campaigns:write (or Full access). Campaigns-only is not enough — export creates a template first."},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Klaviyo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., ABC123",helpText:"Find your List ID in Klaviyo: Lists & Segments → List → Settings"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},campaign_monitor:{id:"campaign_monitor",name:"Campaign Monitor",icon:"/images/integrations/campaign_monitor.svg",description:"Export emails to Campaign Monitor",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.campaignmonitor.com/s/article/api-keys"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"e.g., 4a397ccaaa55eb4e6aa1221e1e2d7122",helpText:"Find in Account Settings → API Keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Campaign Monitor"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",helpText:"Find in Lists → List ID"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},constant_contact:{id:"constant_contact",name:"Constant Contact",icon:"/images/integrations/constant_contact.svg",description:"Export emails to Constant Contact",apps:["useblocks"],settingsFields:[{name:"access_token",type:"password",label:"Access Token",required:!0,placeholder:"OAuth2 Bearer token",fullWidth:!0,helpText:"Get from Constant Contact Developer Portal. Token expires in 24 hours.",helpUrl:"https://developer.constantcontact.com/api_guide/getting_started.html"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be confirmed in Constant Contact"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"text",label:"Contact List ID",required:!0,placeholder:"e.g., fa32f620-6d82-11e8-8b59-fa163e56c9b0",helpText:"Find via GET /contact_lists API"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},bento:{id:"bento",name:"Bento",icon:"/images/integrations/bento.svg",description:"Export emails to Bento",apps:["useblocks"],settingsFields:[{name:"publishable_key",type:"password",label:"Publishable Key",required:!0,placeholder:"Enter Publishable Key",fullWidth:!0,helpUrl:"https://app.bentonow.com/account/teams"},{name:"secret_key",type:"password",label:"Secret Key",required:!0,placeholder:"Enter Secret Key",fullWidth:!0},{name:"site_uuid",type:"text",label:"Site UUID",required:!0,placeholder:"Your site UUID",helpText:"Find in Bento dashboard"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be an author in your Bento account"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Broadcast Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"},{name:"inclusive_tags",type:"text",label:"Tags (inclusive)",required:!1,placeholder:"e.g., subscribers,newsletter",helpText:"Comma-separated tags to send to. Default: subscribers"}]},dotdigital:{id:"dotdigital",name:"Dotdigital",icon:"/images/integrations/dotdigital.svg",description:"Export emails to Dotdigital",apps:["useblocks"],settingsFields:[{name:"username",type:"text",label:"API Username",required:!0,placeholder:"API user email",helpText:"API user email from Settings → Access → API users",helpUrl:"https://developer.dotdigital.com/docs/setting-up-an-api-user"},{name:"password",type:"password",label:"API Password",required:!0,placeholder:"API user password",fullWidth:!0},{name:"region",type:"text",label:"Region",required:!0,placeholder:"r1, r2, or r3",helpText:"r1=Europe, r2=North America, r3=Asia Pacific"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",fullWidth:!0,extra:"Use an email registered as a Custom from address in Dotdigital (see support.dotdigital.com — “Create a custom from address”). If it does not match, export uses your account default sender."},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},getresponse:{id:"getresponse",name:"GetResponse",icon:"/images/integrations/getresponse.svg",description:"Export emails to GetResponse",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://app.getresponse.com/api"},{name:"from_field_id",type:"text",label:"From Field ID",required:!0,placeholder:"e.g., V",helpText:"Find via GET /from-fields API"}],exportFields:[{name:"name",type:"text",label:"Newsletter Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"campaign_id",type:"text",label:"Campaign ID",required:!0,placeholder:"e.g., C",helpText:"List/campaign ID from GET /campaigns"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},brevo:{id:"brevo",name:"Brevo",icon:"/images/integrations/brevo.svg",description:"Export emails to Brevo",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0,helpUrl:"https://help.brevo.com/hc/en-us/articles/209467485-Create-and-manage-your-API-keys"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Brevo"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"list_id",type:"number",label:"List ID",required:!0,placeholder:"e.g., 2",helpText:"Find in Contacts → Lists"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},activecampaign:{id:"activecampaign",name:"ActiveCampaign",icon:"/images/integrations/activecampaign.svg",description:"Export emails as draft campaigns to ActiveCampaign",apps:["useblocks"],settingsFields:[{name:"api_url",type:"text",label:"API URL",required:!0,placeholder:"e.g., https://youraccount.api-us1.com",helpText:"Find in Settings → Developer → API Access",helpUrl:"https://help.activecampaign.com/hc/en-us/articles/207317590-Getting-started-with-the-API"},{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter API Key",fullWidth:!0},{name:"list_id",type:"text",label:"List ID",required:!0,placeholder:"e.g., 1",extra:"Find in Lists → Click your list → The ID is in the URL (e.g., /app/contacts?listid=1)"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in ActiveCampaign"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Campaign Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},salesforce_mc:{id:"salesforce_mc",name:"Salesforce",icon:"/images/integrations/salesforce.svg",description:"Export emails to Salesforce",apps:["useblocks"],settingsFields:[{name:"subdomain",type:"text",label:"Tenant Subdomain",required:!0,placeholder:"e.g., mc563885gzs27c5t9-63k636ttgm",helpText:"Find in Installed Packages → API Integration → REST Base URI",helpUrl:"https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/your-subdomain-tenant-specific-endpoints.html"},{name:"client_id",type:"text",label:"Client ID",required:!0,placeholder:"From Installed Package"},{name:"client_secret",type:"password",label:"Client Secret",required:!0,placeholder:"From Installed Package"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"Must be verified in Marketing Cloud"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},hubspot:{id:"hubspot",name:"HubSpot Email",icon:"/images/integrations/hubspot.svg",description:"Export emails to HubSpot",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"Private App Access Token",required:!0,placeholder:"e.g., pat-na1-xxxx",helpUrl:"https://developers.hubspot.com/docs/api/private-apps"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in HubSpot"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"name",type:"text",label:"Email Name",required:!0,placeholder:"e.g., Newsletter June 2026"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},mailchimp:{id:"mailchimp",name:"Mailchimp",icon:"/images/integrations/mailchimp.svg",description:"Export emails to Mailchimp",apps:["useblocks"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"e.g., xxxxxxxx-us1",helpUrl:"https://mailchimp.com/help/about-api-keys/"},{name:"from_email",type:"email",label:"From Email",required:!0,placeholder:"sender@example.com",extra:"This email must be verified in Mailchimp"},{name:"from_name",type:"text",label:"From Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"list_id",type:"text",label:"Audience ID",required:!0,placeholder:"e.g., a1b2c3d4e5",helpText:"Find your Audience ID in Audience settings → Audience name and defaults"},{name:"subject",type:"text",label:"Email Subject",required:!1,placeholder:"e.g., Special offer for you!"}]},enkod:{id:"enkod",name:"enKod",icon:"/images/integrations/enkod.svg",description:"Export emails to enKod",cardDescription:"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).",apps:["emailmaker"],settingsFields:[{name:"api_key",type:"password",label:"API Key",required:!0,placeholder:"Enter enKod API key",helpUrl:"https://help.enkod.io/doku.php/api:start"},{name:"sender_email",type:"email",label:"Sender Email",required:!0,placeholder:"sender@example.com"},{name:"sender_name",type:"text",label:"Sender Name",required:!0,placeholder:"e.g., Your Company"}],exportFields:[{name:"subject",type:"text",label:"Email Subject",required:!0,placeholder:"e.g., Special offer for you!"}]}},hp=(e,t)=>!e.apps||e.apps.length===0?!0:e.apps.includes(t),mr=e=>{const t=fp[e];if(t&&hp(t,pp()))return t},gp=(e,t)=>{const n={placeholder:e.placeholder?t(e.placeholder):void 0,style:{width:"100%"}};switch(e.type){case"number":return(0,s.jsx)(y.ui_kit$InputNumber,{...n,min:1});case"email":return(0,s.jsx)(y.ui_kit$Input,{...n,type:"email"});default:return(0,s.jsx)(y.ui_kit$Input,{...n})}},yp=({integration:e,visible:t,loading:n=!1,onConfirm:r,onCancel:i,__:a})=>{const[c]=y.ui_kit$Form.useForm(),d=e.exportFields||[];(0,l.useEffect)(()=>{t||c.resetFields()},[t,c]);const u=()=>{n||c.validateFields().then(g=>{r(g)})},m=()=>{c.resetFields(),i()};if(d.length===0)return null;const f=d.find(g=>g.helpText);return(0,s.jsxs)(y.ui_kit$Modal,{title:a(`Export to ${e.name}`),open:t,onOk:u,onCancel:m,okText:a("Export"),cancelText:a("Cancel"),confirmLoading:n,cancelButtonProps:{disabled:n},children:[f&&(0,s.jsx)(y.ui_kit$Alert,{title:a(f.label),description:a(f.helpText),type:"info",showIcon:!0,style:{marginBottom:16}}),(0,s.jsx)(y.ui_kit$Form,{form:c,layout:"vertical",children:d.map(g=>(0,s.jsx)(y.ui_kit$Form.Item,{label:a(g.label),name:g.name,rules:[...g.required?[{required:!0,message:a(`Please enter ${g.label.toLowerCase()}`)}]:[],...g.type==="number"?[{type:"number",message:a(`${g.label} must be a number`)}]:[]],children:gp(g,a)},g.name))})]})},Xn=o.createApi({reducerPath:"unisenderApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmailMessage:e.mutation({query:t=>{const n="https://api.unisender.com/ru/api/createEmailMessage",r=new URLSearchParams;return r.append("format","json"),Object.entries(t).forEach(([i,a])=>{r.append(i,String(a))}),{url:`?proxy_url=${encodeURIComponent(n)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()}}})})}),{useCreateEmailMessageMutation:_p}=Xn,Jn=o.createApi({reducerPath:"mailganerApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://mailganer.com"}),endpoints:e=>({createMailing:e.mutation({query:t=>{const n=new URLSearchParams;return n.append("api_key",t.api_key),n.append("name",t.name),n.append("html-content",t.html_content),t.theme&&n.append("theme",t.theme),t.from_name&&n.append("from_name",t.from_name),t.from_email&&n.append("from_email",t.from_email),t.segment_id&&n.append("segment_id",String(t.segment_id)),t.utm_campaign&&n.append("utm_campaign",t.utm_campaign),t.utm_source&&n.append("utm_source",t.utm_source),t.utm_medium&&n.append("utm_medium",t.utm_medium),{url:"/api/v1/mailing/create/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()}}})})}),{useCreateMailingMutation:bp}=Jn,Zn=o.createApi({reducerPath:"sendsayApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://api.sendsay.ru"}),endpoints:e=>({createDraft:e.mutation({query:t=>{const n={action:"issue.draft.set",apikey:t.api_key,return_fresh_obj:1,obj:{name:t.name,letter:{subject:t.subject,"from.name":t.from_name||void 0,"from.email":t.from_email||void 0,message:{html:t.html_content}}}};return{url:`/general/api/v100/json/${t.login.split("/").map(r=>encodeURIComponent(r)).join("/")}`,method:"POST",headers:{"Content-Type":"application/json"},body:n}}})})}),{useCreateDraftMutation:vp}=Zn,eo=o.createApi({reducerPath:"altcraftApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({addTemplate:e.mutation({query:t=>{const n=`${t.api_url}/api/v1.1/templates/add`,r={token:t.api_key,name:t.name,channels:[{sid:"email",fields:{html:t.html_content,text:"",subject:t.subject||t.name,from_email:t.from_email||"",from_name:t.from_name||"",replyto_email:"",replyto_name:"",is_not_inline:!0}}],is_draft:t.is_draft??!1};return{url:`?proxy_url=${encodeURIComponent(n)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}}})})}),{useAddTemplateMutation:Ep}=eo,Sp=e=>e.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,"").replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"").replace(/<[^>]+>/g," ").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/\s+/g," ").trim(),to=o.createApi({reducerPath:"enkodApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://api.enkod.ru"}),endpoints:e=>({createMessage:e.mutation({query:t=>{const n=Sp(t.html_content)||t.subject,r={message:{subject:t.subject,fromEmail:t.sender_email||"",fromName:t.sender_name||"",html:t.html_content,plainText:n},isDraft:!0};return{url:"/v1/message/onetime/",method:"POST",headers:{"Content-Type":"application/json",Apikey:t.api_key},body:r}}})})}),{useCreateMessageMutation:wp}=to,kp=e=>{const t=e.split("-");return t.length>1?t[1]:"us1"},Cp=e=>`https://${kp(e)}.api.mailchimp.com/3.0`,no=o.createApi({reducerPath:"mailchimpApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=Cp(t.api_key),c=btoa(`anystring:${t.api_key}`),d={type:"regular",recipients:{list_id:t.list_id},settings:{subject_line:t.subject,from_name:t.from_name,reply_to:t.from_email}},u=await i({url:`?proxy_url=${encodeURIComponent(`${a}/campaigns`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(d)});if(u.error){const _=u.error,p=_?.data?.detail||_?.error||String(u.error),E=_?.data?.errors;return{error:{status:"CUSTOM_ERROR",error:E?.length?E.map(C=>C.detail||C.title).join("; "):p}}}const m=u.data;if(!m?.id)return{error:{status:"CUSTOM_ERROR",error:u.data?.errors?.map(_=>_.detail||_.title).join("; ")||"Failed to create campaign"}};const f={html:t.html},g=await i({url:`?proxy_url=${encodeURIComponent(`${a}/campaigns/${m.id}/content`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Basic ${c}`},body:JSON.stringify(f)});if(g.error){const _=g.error;return{error:{status:"CUSTOM_ERROR",error:_?.data?.detail||_?.error||String(g.error)}}}return{data:{id:m.id,status:m.status,web_id:m.web_id}}}})})}),{useCreateCampaignMutation:Tp}=no,pr="https://a.klaviyo.com/api",Ip="2025-04-15",Ap=e=>({"Content-Type":"application/json",Accept:"application/json",Authorization:`Klaviyo-API-Key ${e}`,revision:Ip}),oo=o.createApi({reducerPath:"klaviyoApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=Ap(t.api_key),c={data:{type:"template",attributes:{name:`Email ${Date.now()}`,editor_type:"CODE",html:t.html}}},d=await i({url:`?proxy_url=${encodeURIComponent(`${pr}/templates`)}`,method:"POST",headers:a,body:JSON.stringify(c)});if(d.error){const w=d.error,S=w?.data?.errors,I=w?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:S?.length?S.map(x=>x.detail||x.status).join("; "):I||w?.error||String(d.error)}}}const u=d.data?.data?.id;if(!u)return{error:{status:"CUSTOM_ERROR",error:"Failed to create template"}};const m={data:{type:"campaign",attributes:{name:`Campaign ${Date.now()}`,audiences:{included:[t.list_id],excluded:[]},send_strategy:{method:"immediate"},"campaign-messages":{data:[{type:"campaign-message",attributes:{definition:{channel:"email",label:t.subject,content:{subject:t.subject,from_email:t.from_email,from_label:t.from_name,reply_to_email:t.from_email}}}}]}}}},f=await i({url:`?proxy_url=${encodeURIComponent(`${pr}/campaigns`)}`,method:"POST",headers:a,body:JSON.stringify(m)});if(f.error){const w=f.error,S=w?.data?.errors,I=w?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:S?.length?S.map(x=>x.detail||x.status).join("; "):I||w?.error||String(f.error)}}}const g=f.data,_=g?.data?.relationships?.["campaign-messages"]?.data?.[0]?.id,p=g?.data?.id;if(!_)return{error:{status:"CUSTOM_ERROR",error:"Failed to get campaign message from campaign"}};const E={data:{type:"campaign-message",id:_,relationships:{template:{data:{type:"template",id:u}}}}},C=await i({url:`?proxy_url=${encodeURIComponent(`${pr}/campaign-message-assign-template`)}`,method:"POST",headers:a,body:JSON.stringify(E)});if(C.error){const w=C.error,S=w?.data?.errors,I=w?.data?.detail;return{error:{status:"CUSTOM_ERROR",error:S?.length?S.map(x=>x.detail||x.status).join("; "):I||w?.error||String(C.error)}}}return{data:{id:p,campaign_message_id:_}}}})})}),{useCreateCampaignMutation:xp}=oo,Pp="https://api.hubapi.com",Rp=e=>({"Content-Type":"application/json",Authorization:`Bearer ${e}`}),ro=o.createApi({reducerPath:"hubspotApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,n,r,i)=>{const a=Rp(t.api_key),c={name:t.name,subject:t.subject,from:{fromName:t.from_name,replyTo:t.from_email},content:{templatePath:"@hubspot/email/dnd/plain_text.html",widgets:{"module-0-1-1":{body:{html:t.html,path:"@hubspot/rich_text",schema_version:2},child_css:{},css:{},id:"module-0-1-1",name:"module-0-1-1",order:2,styles:{},type:"module"},"module-1-1-1":{body:{align:"center",path:"@hubspot/email_footer",schema_version:2,unsubscribe_link_type:"both"},child_css:{},css:{},id:"module-1-1-1",name:"module-1-1-1",order:3,styles:{},type:"module"}}}},d=await i({url:`?proxy_url=${encodeURIComponent(`${Pp}/marketing/v3/emails/`)}`,method:"POST",headers:a,body:JSON.stringify(c)});if(d.error){const m=d.error,f=m?.data?.errors,g=m?.data?.message;return{error:{status:"CUSTOM_ERROR",error:f?.length?f.map(_=>_.message||_.errorType).join("; "):g||m?.error||String(d.error)}}}const u=d.data;return u?.id?{data:{id:u.id}}:{error:{status:"CUSTOM_ERROR",error:d.data?.errors?.map(m=>m.message||m.errorType).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:jp}=ro,io=o.createApi({reducerPath:"salesforceMcApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createEmail:e.mutation({queryFn:async(t,n,r,i)=>{const a=`https://${t.subdomain}.auth.marketingcloudapis.com/v2/token`,c=await i({url:`?proxy_url=${encodeURIComponent(a)}`,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({grant_type:"client_credentials",client_id:t.client_id,client_secret:t.client_secret})});if(c.error){const p=c.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_description||p?.data?.error||p?.error||String(c.error)}}}const d=c.data,u=d?.access_token,m=d?.rest_instance_url;if(!u||!m)return{error:{status:"CUSTOM_ERROR",error:d?.error_description||d?.error||"Failed to get access token"}};const f={name:t.name,assetType:{id:208,name:"htmlemail"},views:{html:{content:t.html},text:{},subjectline:{content:t.subject},preheader:{}},data:{email:{options:{characterEncoding:"utf-8"}}}},g=await i({url:`?proxy_url=${encodeURIComponent(`${m.replace(/\/$/,"")}/asset/v1/content/assets`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${u}`},body:JSON.stringify(f)});if(g.error){const p=g.error,E=p?.data?.errors,C=p?.data?.message;return{error:{status:"CUSTOM_ERROR",error:E?.length?E.map(w=>w.message||w.documentation).join("; "):C||p?.error||String(g.error)}}}const _=g.data;return _?.id?{data:{id:_.id}}:{error:{status:"CUSTOM_ERROR",error:g.data?.errors?.map(p=>p.message).join("; ")||"Failed to create email"}}}})})}),{useCreateEmailMutation:Lp}=io,Op=e=>e.replace(/\/$/,""),Mp=e=>e.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim()||" ",ao=o.createApi({reducerPath:"activecampaignApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=Op(t.api_url),c=t.api_key,d={"Content-Type":"application/json","Api-Token":c},u=await i({url:`?proxy_url=${encodeURIComponent(`${a}/api/3/addresses`)}`,method:"GET",headers:{"Api-Token":c}});if(u.error)return{error:{status:"CUSTOM_ERROR",error:"Failed to load mailing addresses. Check your API URL and Key."}};const m=u.data?.addresses??[],f=m.find(x=>x.isDefault==="1")??m[0];if(!f?.id)return{error:{status:"CUSTOM_ERROR",error:"NO_MAILING_ADDRESS"}};const g={message:{name:t.name,fromname:t.from_name,fromemail:t.from_email,email:t.from_email,reply2:t.from_email,subject:t.subject,html:t.html,text:Mp(t.html),preheader_text:"",format:"mime"}},_=await i({url:`?proxy_url=${encodeURIComponent(`${a}/api/3/messages`)}`,method:"POST",headers:d,body:JSON.stringify(g)});if(_.error){const x=_.error;return{error:{status:"CUSTOM_ERROR",error:x?.data?.message||x?.error||"Failed to create message."}}}const p=_.data?.message?.id;if(!p)return{error:{status:"CUSTOM_ERROR",error:"Message created but no ID returned."}};const E=`${a}/admin/api.php?api_action=campaign_create&api_output=json`,C=new URLSearchParams;C.append("type","single"),C.append("name",t.name),C.append("sdate","2099-12-31 12:00:00"),C.append("status","0"),C.append("public","1"),C.append("trackreads","1"),C.append("tracklinks","all"),C.append("htmlunsub","1"),C.append("textunsub","1"),C.append("addressid",String(f.id)),C.append(`p[${t.list_id}]`,t.list_id),C.append(`m[${p}]`,"100");const w=await i({url:`?proxy_url=${encodeURIComponent(E)}`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded","Api-Token":c},body:C.toString()});if(w.error){const x=w.error;return{error:{status:"CUSTOM_ERROR",error:x?.data?.result_message||x?.error||"Message created, but campaign creation failed."}}}const S=w.data;if(Number(S?.result_code)===0)return{error:{status:"CUSTOM_ERROR",error:S?.result_message||"Campaign creation failed (v1 API)."}};const I=S?.id;return I?{data:{campaignId:String(I)}}:{error:{status:"CUSTOM_ERROR",error:S?.result_message||"Campaign created but no ID returned."}}}})})}),{useCreateCampaignMutation:Np}=ao,Dp="https://api.brevo.com/v3",so=o.createApi({reducerPath:"brevoApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a={name:t.name,subject:t.subject,sender:{name:t.from_name,email:t.from_email},htmlContent:t.html,recipients:{listIds:[t.list_id]}},c=await i({url:`?proxy_url=${encodeURIComponent(`${Dp}/emailCampaigns`)}`,method:"POST",headers:{"Content-Type":"application/json","api-key":t.api_key},body:JSON.stringify(a)});if(c.error){const u=c.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.data?.code||u?.error||String(c.error)}}}const d=c.data;return d?.id?{data:{id:d.id}}:{error:{status:"CUSTOM_ERROR",error:c.data?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:Fp}=so,Bp="https://api.createsend.com/api/v3.3",Up=e=>`Basic ${btoa(`${e}:x`)}`,lo=o.createApi({reducerPath:"campaignMonitorApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a={Name:t.name,Subject:t.subject,FromName:t.from_name,FromEmail:t.from_email,ReplyTo:t.from_email,HtmlUrl:t.html_url,ListIDs:[t.list_id],InlineCss:!0},c=await i({url:`?proxy_url=${encodeURIComponent(`${Bp}/campaigns/${t.client_id}.json`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:Up(t.api_key)},body:JSON.stringify(a)});if(c.error){const m=c.error;return{error:{status:"CUSTOM_ERROR",error:m?.data?.Message||m?.error||String(c.error)}}}const d=c.data,u=typeof d=="string"?d:d?.id;return!u||typeof u!="string"?{error:{status:"CUSTOM_ERROR",error:d?.Message||"Failed to create campaign"}}:{data:{id:u}}}})})}),{useCreateCampaignMutation:$p}=lo,wa="https://api.cc.email/v3",zp=e=>e.includes("[[trackingImage]]")?e:e.replace(/<body([^>]*)>/i,"<body$1>[[trackingImage]]"),co=o.createApi({reducerPath:"constantContactApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=zp(t.html),c={name:t.name,email_campaign_activities:[{format_type:5,from_email:t.from_email,reply_to_email:t.from_email,from_name:t.from_name,subject:t.subject,html_content:a}]},d=await i({url:`?proxy_url=${encodeURIComponent(`${wa}/emails`)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(c)});if(d.error){const p=d.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_message||p?.data?.error_key||p?.error||String(d.error)}}}const u=d.data,m=u?.campaign_activities?.find(p=>p.role==="primary_email")?.campaign_activity_id,f=u?.campaign_id;if(!m||!f)return{error:{status:"CUSTOM_ERROR",error:"Failed to create campaign"}};const g={campaign_activity_id:m,campaign_id:f,role:"primary_email",contact_list_ids:[t.list_id],segment_ids:[],current_status:"DRAFT",format_type:5,from_email:t.from_email,from_name:t.from_name,reply_to_email:t.from_email,subject:t.subject,html_content:a},_=await i({url:`?proxy_url=${encodeURIComponent(`${wa}/emails/activities/${m}`)}`,method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.access_token}`},body:JSON.stringify(g)});if(_.error){const p=_.error;return{error:{status:"CUSTOM_ERROR",error:p?.data?.error_message||p?.data?.error_key||p?.error||String(_.error)}}}return{data:{campaign_id:f}}}})})}),{useCreateCampaignMutation:Gp}=co,Wp="https://api.getresponse.com/v3",Hp=e=>`api-key ${e}`,uo=o.createApi({reducerPath:"getresponseApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createNewsletter:e.mutation({queryFn:async(t,n,r,i)=>{const a=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),c={name:t.name,type:"draft",subject:t.subject,fromField:{fromFieldId:t.from_field_id},replyTo:{fromFieldId:t.from_field_id},campaign:{campaignId:t.campaign_id},content:{html:t.html,plain:a||"Newsletter"},flags:["openrate","clicktrack"],sendSettings:{selectedCampaigns:[t.campaign_id]}},d=await i({url:`?proxy_url=${encodeURIComponent(`${Wp}/newsletters`)}`,method:"POST",headers:{"Content-Type":"application/json","X-Auth-Token":Hp(t.api_key)},body:JSON.stringify(c)});if(d.error){const m=d.error;return{error:{status:"CUSTOM_ERROR",error:m?.data?.message||m?.data?.code||m?.error||String(d.error)}}}const u=d.data;return u?.newsletterId?{data:{newsletterId:u.newsletterId}}:{error:{status:"CUSTOM_ERROR",error:d.data?.message||"Failed to create newsletter"}}}})})}),{useCreateNewsletterMutation:qp}=uo,Vp=e=>`https://${e||"r1"}-api.dotdigital.com/v2`,ka=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,Ca=e=>e&&typeof e=="object"&&"data"in e&&e.data!==void 0?e.data:e,Ta=e=>e.trim().toLowerCase(),mo=o.createApi({reducerPath:"dotdigitalApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createCampaign:e.mutation({queryFn:async(t,n,r,i)=>{const a=t.html.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim(),c=Vp(t.region),d={"Content-Type":"application/json",Authorization:ka(t.username,t.password)},u=await i({url:`?proxy_url=${encodeURIComponent(`${c}/custom-from-addresses`)}`,method:"GET",headers:{Authorization:ka(t.username,t.password)}});let m=[];if(!u.error){const w=Ca(u.data);Array.isArray(w)?m=w:w&&typeof w=="object"&&Array.isArray(w.items)&&(m=w.items)}const f=Ta(t.from_email),g=m.find(w=>w.email&&Ta(w.email)===f),_={name:t.name,subject:t.subject,fromName:t.from_name,htmlContent:t.html,plainTextContent:a||"Newsletter"},p=!g?.id;g?.id!=null&&(_.fromAddress={id:g.id});const E=await i({url:`?proxy_url=${encodeURIComponent(`${c}/campaigns`)}`,method:"POST",headers:d,body:JSON.stringify(_)});if(E.error){const w=E.error;return{error:{status:"CUSTOM_ERROR",error:w?.data?.message||w?.error||String(E.error)}}}const C=Ca(E.data);return C?.id?{data:{id:C.id,usedAccountDefaultFromAddress:p}}:{error:{status:"CUSTOM_ERROR",error:E.data?.message||C?.message||"Failed to create campaign"}}}})})}),{useCreateCampaignMutation:Yp}=mo,Kp="https://app.bentonow.com/api/v1",Qp=(e,t)=>`Basic ${btoa(`${e}:${t}`)}`,po=o.createApi({reducerPath:"bentoApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({createBroadcast:e.mutation({queryFn:async(t,n,r,i)=>{const a={broadcasts:[{name:t.name,subject:t.subject,content:t.html,type:"raw",from:{email:t.from_email,name:t.from_name},inclusive_tags:t.inclusive_tags||"subscribers",exclusive_tags:"",segment_id:t.segment_id||"",batch_size_per_hour:500,approved:!1}]},c=`${Kp}/batch/broadcasts?site_uuid=${encodeURIComponent(t.site_uuid)}`,d=await i({url:`?proxy_url=${encodeURIComponent(c)}`,method:"POST",headers:{"Content-Type":"application/json",Authorization:Qp(t.publishable_key,t.secret_key),"User-Agent":"EmailMaker/1.0"},body:JSON.stringify(a)});if(d.error){const u=d.error;return{error:{status:"CUSTOM_ERROR",error:u?.data?.message||u?.error||String(d.error)}}}return{data:{count:d.data?.count??1}}}})})}),{useCreateBroadcastMutation:Xp}=po,Jp=()=>{const{__:e}=o.useI18n(),[t,{isLoading:n}]=_p(),[r,{isLoading:i}]=bp(),[a,{isLoading:c}]=vp(),[d,{isLoading:u}]=Ep(),[m,{isLoading:f}]=wp(),[g,{isLoading:_}]=Tp(),[p,{isLoading:E}]=xp(),[C,{isLoading:w}]=jp(),[S,{isLoading:I}]=Lp(),[x,{isLoading:Y}]=Np(),[Z,{isLoading:M}]=Fp(),[L,{isLoading:A}]=$p(),[j,{isLoading:z}]=Gp(),[B,{isLoading:$}]=qp(),[de,{isLoading:pe}]=Yp(),[q,{isLoading:ee}]=Xp(),Fe=n||i||c||u||f||_||E||w||I||Y||M||A||z||$||pe||ee,ze={unisender:async(T,P,N,D)=>{try{const b=await t({api_key:T.api_key,sender_name:T.sender_name,sender_email:T.sender_email,subject:D,body:N,list_id:P.list_id,generate_text:1,lang:"ru"}).unwrap();return b.result?.message_id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.unisender.com/ru/v5/spa/email-campaign/editor/${b.result.message_id}?step=send`,text:e("Open in Unisender")}}:b.error?{success:!1,error:b.error+(b.code?` (${b.code})`:"")}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create email")}}},mailganer:async(T,P,N,D)=>{try{const b=await r({api_key:T.api_key,name:P.name,html_content:N,theme:P.theme||D,from_name:T.from_name,from_email:T.from_email}).unwrap();return b.status===1&&b.public_id?{success:!0,message:e("Mailing successfully created!"),link:b.step1_url?{url:b.step1_url,text:e("Open in Mailganer")}:void 0}:b.error?{success:!1,error:b.error}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create mailing")}}},sendsay:async(T,P,N,D)=>{try{const b=await a({login:T.login,api_key:T.api_key,name:P.name,subject:P.subject,html_content:N,from_name:T.from_name,from_email:T.from_email}).unwrap();return b.obj?.id?{success:!0,message:e("Draft successfully created!"),link:{url:`https://app.sendsay.ru/content/drafts/email/${b.obj.id}/settings`,text:e("Open in Sendsay")}}:b.errors&&b.errors.length>0?{success:!1,error:b.errors.map(W=>W.explain).join(", ")}:b.error?{success:!1,error:b.explain||b.error}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create draft")}}},altcraft:async(T,P,N,D)=>{try{const b=await d({api_url:T.api_url,api_key:T.api_key,name:P.name,html_content:N,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email}).unwrap();return b.error===0?{success:!0,message:e("Template successfully created!")}:{success:!1,error:b.error_text||e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create template")}}},enkod:async(T,P,N,D)=>{try{const b=await m({api_key:T.api_key,subject:P.subject,html_content:N,sender_name:T.sender_name,sender_email:T.sender_email}).unwrap();if(b.success||b.messageId||b.id){const W=b.messageId||b.id;return{success:!0,message:e("Draft successfully created!"),link:W?{url:`https://app.enkod.ru/ensend/messages/detail/${W}/preview`,text:e("Open in enKod")}:void 0}}else if(b.error||b.message)return{success:!1,error:b.error||b.message||e("Unknown error")};return{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create draft")}}},mailchimp:async(T,P,N,D)=>{try{const b=await g({api_key:T.api_key,list_id:P.list_id,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();if(b.id){const W=T.api_key?.split("-")[1]||"us1";return{success:!0,message:e("Campaign successfully created!"),link:{url:`https://${W}.admin.mailchimp.com/campaigns/#r:campaignId=${b.id}`,text:e("Open in Mailchimp")}}}return{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},klaviyo:async(T,P,N,D)=>{try{const b=await p({api_key:T.api_key,list_id:P.list_id,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://www.klaviyo.com/campaign/${b.id}/wizard/1`,text:e("Open in Klaviyo")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},hubspot:async(T,P,N,D)=>{try{const b=await C({api_key:T.api_key,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.hubspot.com/email/0/edit/${b.id}`,text:e("Open in HubSpot")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create email")}}},salesforce_mc:async(T,P,N,D)=>{try{const b=await S({subdomain:T.subdomain,client_id:T.client_id,client_secret:T.client_secret,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:e("Email successfully created!"),link:{url:`https://app.s7.exacttarget.com/ContentBuilder?app=contentbuilder&id=${b.id}`,text:e("Open in Marketing Cloud")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create email")}}},activecampaign:async(T,P,N,D)=>{try{const b=await x({api_url:T.api_url,api_key:T.api_key,list_id:T.list_id,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();if(b.campaignId){const W=(T.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),Pe=W?W[1]:"",Ae=Pe?`https://${Pe}.activehosted.com/app/campaigns/${b.campaignId}`:"https://www.activecampaign.com/app/campaigns";return{success:!0,message:e("Draft campaign created! Open it to review and schedule."),link:{url:Ae,text:e("Open draft campaign")}}}return{success:!1,error:e("Unknown error")}}catch(b){const W=b.message||b.error||"";if(W==="NO_MAILING_ADDRESS"){const Pe=(T.api_url||"").replace(/\/$/,"").match(/https?:\/\/([^.]+)\.api-/),Ae=Pe?Pe[1]:"",Qe=Ae?`https://${Ae}.activehosted.com/app/settings/addresses`:"https://www.activecampaign.com/app/settings/addresses";return{success:!1,error:e("No mailing address found. Add one in ActiveCampaign: ")+Qe}}return{success:!1,error:W||e("Failed to create campaign")}}},brevo:async(T,P,N,D)=>{try{const b=await Z({api_key:T.api_key,list_id:Number(P.list_id),name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.brevo.com/marketing-campaign/edit/${b.id}`,text:e("Open in Brevo")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},campaign_monitor:async(T,P,N,D)=>{try{const b=P.html_url?.trim();if(!b)return{success:!1,error:e("HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.")};const W=await L({api_key:T.api_key,client_id:T.client_id,list_id:P.list_id,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html_url:b.trim()}).unwrap();return W.id?{success:!0,message:e("Campaign successfully created!"),link:{url:`https://app.createsend.com/campaigns/#/${W.id}`,text:e("Open in Campaign Monitor")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},constant_contact:async(T,P,N,D)=>{try{return(await j({access_token:T.access_token,list_id:P.list_id,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap()).campaign_id?{success:!0,message:e("Campaign successfully created!"),link:{url:"https://app.constantcontact.com/pages/email/campaigns",text:e("Open in Constant Contact")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},getresponse:async(T,P,N,D)=>{try{const b=await B({api_key:T.api_key,from_field_id:T.from_field_id,campaign_id:P.campaign_id,name:P.name,subject:P.subject||D,html:N}).unwrap();return b.newsletterId?{success:!0,message:e("Newsletter successfully created!"),link:{url:`https://app.getresponse.com/letter/${b.newsletterId}`,text:e("Open in GetResponse")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create newsletter")}}},dotdigital:async(T,P,N,D)=>{try{const b=await de({username:T.username,password:T.password,region:T.region||"r1",name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N}).unwrap();return b.id?{success:!0,message:b.usedAccountDefaultFromAddress?e("Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it."):e("Campaign successfully created!"),link:{url:"https://login.dotdigital.com/",text:e("Open in Dotdigital")}}:{success:!1,error:e("Unknown error")}}catch(b){return{success:!1,error:b.message||e("Failed to create campaign")}}},bento:async(T,P,N,D)=>{try{return await q({publishable_key:T.publishable_key,secret_key:T.secret_key,site_uuid:T.site_uuid,name:P.name,subject:P.subject||D,from_name:T.from_name,from_email:T.from_email,html:N,inclusive_tags:P.inclusive_tags}).unwrap(),{success:!0,message:e("Broadcast successfully created!"),link:{url:"https://app.bentonow.com/",text:e("Open in Bento")}}}catch(b){return{success:!1,error:b.message||e("Failed to create broadcast")}}}};return{exportToIntegration:async(T,P,N,D,b)=>{const W=ze[T];return W?W(P,N,D,b):{success:!1,error:e("Unknown integration")}},isLoading:Fe}},Rt={INFO:"info",STORAGE:"storage",STYLES:"styles",MEMBERS:"members",INTEGRATIONS:"integrations",PLUGIN:"plugin"},uv=Rt.INFO,mv=[Rt.INFO,Rt.STORAGE,Rt.STYLES,Rt.MEMBERS,Rt.INTEGRATIONS,Rt.PLUGIN],pv={mainsettings:Rt.INFO,ftpsettings:Rt.STORAGE,webhooksettings:Rt.INTEGRATIONS},Zp=async(e,t,n)=>{try{const{notification:r,...i}=e,a=await o.fetchBaseQuery({baseUrl:"https://racs.emcdn.ru/v3"})(i,t,n);if(a.error)throw new Error;return a}catch(r){return(e?.notification).error(r),{error:r}}},fo=o.createApi({reducerPath:"exportPngApi",baseQuery:Zp,endpoints:e=>({makeTemporaryMailForPng:e.mutation({query:({file:t,title:n,notification:r})=>{const i=new Blob([t],{type:"text/html"}),a=new FormData;return a.append("file",i,"base.html"),a.append("contentType","text/html"),{url:"?resource=exportPngApi",method:"POST",body:a,notification:r}}}),deleteTemporaryMail:e.mutation({query:({id:t,notification:n})=>({url:`/${t}?resource=exportPngApi`,method:"DELETE",notification:n})})})}),{useMakeTemporaryMailForPngMutation:ef,useDeleteTemporaryMailMutation:tf}=fo,ho=o.createApi({reducerPath:"webHookApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({postDataByWebHook:e.mutation({query:({url:t,body:n})=>({url:`?proxy_url=${encodeURIComponent(t)}`,method:"POST",body:n})})})}),{usePostDataByWebHookMutation:nf}=ho,of=async(e,t,n)=>{try{const{notification:r,...i}=e,a=await o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"})(i,t,n);if(a.error)throw new Error;return a}catch(r){return(e?.notification).error(r),{error:r}}},go=o.createApi({reducerPath:"htmlToPdfPlusApi",baseQuery:of,endpoints:e=>({generateHtmlToPdf:e.mutation({query:({htmlContent:t,notification:n})=>({url:"emails/pdf",method:"POST",body:t,notification:n,responseHandler:r=>r.blob()})})})}),{useGenerateHtmlToPdfMutation:rf}=go,yo=o.createApi({reducerPath:"proxyApi",tagTypes:["Proxy"],baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get"}),endpoints:e=>({getFile:e.query({queryFn({url:t,tryFetch:n=!0,type:r},i){const a=o.clientFromApi(i),c=n?fetch(t):Promise.reject(),d=m=>{switch(r){case"json":return m.json();case"text":return m.text();default:return m.blob()}},u=m=>d(m).then(f=>({data:f}));return c.then(m=>u(m)).catch(()=>a.corsProxy.get_list({format:"blob",extraQuery:{url:encodeURIComponent(t)}}))}})})}),{useGetFileQuery:fv,useLazyGetFileQuery:af}=yo,hv="email",gv=100;function sf(e){return _t.sanitizeFileName(String(e??"").trim()).slice(0,100).trimEnd()||"email"}function Ia(e){const t=sf(e);return{archive:`${t}.zip`,desktop:`${t}-desktop.png`,mobile:`${t}-mobile.png`}}function lf(e,t){const n=Ia(e);return{[n.desktop]:t.desktop,[n.mobile]:t.mobile}}var fr=()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/de7377ec.js")).then(e=>e.import_exports),void 0,{}.url),cf=1,df=2,uf=375,Dt={fontSize:"16px"},mf={position:"absolute",bottom:-4,right:-4,borderRadius:"100%",backgroundColor:o.emCssVar("colorBgContainer")},pf={position:"relative",display:"inline-flex"},qt=({icon:e,locked:t,strokeWidth:n,className:r})=>(0,s.jsxs)("span",{className:r,style:pf,children:[e,t&&(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:12,strokeWidth:n,style:mf})]}),ff=({email:e,autoSaveBlockResult:t})=>{const{__:n,_x:r}=o.useI18n(),i=o.useDispatch(),a=o.useEmailAttributesWriter(),[c]=af(),[d]=o.useUploadImageMutation(),u=o.useAppNavigate(),{owner:m,admin:f}=Qn(),g=o.useCurrentUser(),_=o.useProjectData(),{modal:p}=y.ui_kit$App.useApp(),E=o.useNotification(),{confirm:C}=p,w=o.useAppStore(),S=()=>rn(h.getContainer(w)).keepWrappedOnOutput,I=(O,V,X,re)=>_t.prepareHTML(O,V,X,re,S()),x=(O,V,X,re,oe,H)=>_t.getEML(O,V,X,re,oe,H,S()),Y=(O,V,X,re,oe)=>_t.htmlToFilesData(O,V,X,re,oe,S()),Z=o.useCookieManager(),M=o.useAppConfig(),L=Ea(),{beeFreeConverterEnabled:A,aiLayoutConverterEnabled:j}=L,z=o.useEditorProjectId(),B=o.useEventEmitter(h.events.ON_EMAIL_CLONE_ID),$=o.useEventEmitter(h.events.ON_BROWSER_EXTENSION_DETECTED_ID),[de]=nf(),pe=!0,{data:q}=o.useGetProjectIntegrationsQuery(_?.id??0,{skip:pe}),{data:ee}=o.useGetProjectWebhookQuery(_?.id??0,{skip:pe}),[Fe]=o.useLazyGetIntegrationCredentialsQuery(),{exportToIntegration:ve,isLoading:et}=Jp(),Ee=o.usePushToDataLayer(),[fe,Q]=(0,l.useState)(()=>!Ht(h.getContainer(w)).contentShown()),[me,ae]=(0,l.useState)(!1),[se,Ie]=(0,l.useState)(null),[Ce,Be]=(0,l.useState)(""),[J,ye]=(0,l.useState)(!1),[Te,he]=(0,l.useState)(0),[je,ze]=(0,l.useState)(null),[k,T]=(0,l.useState)(""),[P,N]=(0,l.useState)(!1),D=o.usePlanFeatureGate("export_html"),b=o.usePlanFeatureGate("export_pdf"),W=o.usePlanFeatureGate("export_png");o.usePlanFeatureGate("export_webhook");const Pe=o.usePlanFeatureGate("export_platforms"),Ae=o.usePlanFeatureGate("export_amp"),Qe=o.usePlanFeatureGate("template_import"),Ge=o.usePlanFeatureGate("code_minify"),Ze=O=>{ye(!0),he(o.FEATURE_UPSELL_SLIDE[O])},[mt]=o.emailsApi.useDeleteEmailMutation(),vt=async(O,V)=>{try{const X=await mt(O.id).unwrap();O.project,E.success(n('The email "')+X.title+r('" was successfully removed.',"email")),Ee({event:"delete",action:"delete_email",entity_type:"email",entity_id:O.id,project_id:O.project,context:"editor"})}catch(X){E.error(X)}},[ft,lt]=o.useAddEmailMutation(),[G]=ef(),[K]=tf(),[ne]=rf(),ue=o.useProjectData(),ge=o.useInvalidateTerms(),We=o.useSelector(o.selectIsHeaderCodeMenuOpen);(0,l.useEffect)(()=>{We.switched&&Q(!1)},[We]);const Ve=()=>{const{title:O}=e;return O===null?n("New email title"):O},at=(O,V,X=!1)=>{const re=o.getCodeSize(O);X&&o.isCodeSizeExceeded(re)?(Be(O),Ie(()=>V),ae(!0)):V(O)},Bt=()=>{if(ae(!1),Ge.isLocked){Ze("code_minify");return}if(se&&Ce){o.getCodeSize(Ce);const O=o.minifyHtml(Ce);o.getCodeSize(O),se(O),Ie(null),Be("")}},Me=()=>{ae(!1),se&&Ce&&(se(Ce),Ie(null),Be(""))},Xe=()=>{ae(!1),Ie(null),Be("")},ie=o.useContentReader(),te=o.useContentReplacer(),U=o.useEvent(h.events.ON_EMAIL_INIT_ID),le=o.useEventEmitter(h.events.ON_LAYOUT_CONVERT_REQUEST_ID);(0,l.useEffect)(()=>{const O=U(()=>{Q(!1)});return()=>O.dispose()},[U]);const xe=async(O,V=ie())=>{const X=document.querySelector(".email-preview"),re=getComputedStyle(X);return V=await I(V,[re.width],e.utm_parameters,async oe=>{rt(oe)}),G({file:V,title:Ve(),notification:E}).unwrap().then(oe=>{const H={id:oe._id,...oe};return O(H,()=>K({id:H.id,notification:E}))}).catch(oe=>{E.error({title:oe.data?.code,description:oe.data?.message})})},Se=(O,V=1)=>xe((X,re)=>({hrefs:O.map(oe=>o.previewHrefForRacs(X.id,void 0,!1,V,void 0,void 0,oe)),dispose:re})),Ne=(O,V,X=2)=>xe((re,oe)=>({data:O.map(H=>({selector:H,href:o.previewHrefForRacs(re.id,void 0,!1,X,H)})),dispose:oe}),V),He=async(O,V)=>{const X=typeof O=="string"?(await c({url:O}))?.data:O;if(!X)return typeof O=="string"?O:"";let re=o.decodeFileNameFromPath(V);if(typeof O=="string"&&/^https?:\/\//i.test(O)){const qe=o.decodeFileNameFromUrl(O);qe&&(re=qe)}const oe=X,{ensureFileExtension:H,extractUploadResult:ke}=await fr();re=await H(re,oe.type||"");const _e=new File([oe],re.toLowerCase(),{type:oe.type||""});try{const qe=ke(await d({user_id:g.id,folder:String(ue.id),file:_e}).unwrap());if(qe.error)return typeof O=="string"?O:"";if(qe.file_url)return qe.file_url}catch{}return typeof O=="string"?O:""},Ue=async O=>{const V=O.document.querySelectorAll("[em-operation=exportAsPicture]"),X=new Map;for(let re=0,oe=V.length;re<oe;re++){const H=V[re];H.setAttribute("em-export-id",String(re)),X.set(`[em-export-id='${re}']`,H)}X.size&&O.handleRender(async({contentDocument:re,managedNodeController:oe})=>{try{const{data:H,dispose:ke}=await Ne([...X.keys()],o.getOuterHtml(re),df);try{const _e=H.map(async({href:qe,selector:gn},Dn)=>{const pt=X.get(gn);if(pt.tagName==="TD"){pt.removeAttribute("style");for(const yt of[...pt.classList])yt.startsWith("em-mob-")&&pt.classList.remove(yt)}oe.commit();const Bo=await He(qe,`${Dn}-${pt.tagName.toLowerCase()}.png`),yn=parseInt(getComputedStyle(pt).width);let wt=new Image(yn);wt.setAttribute("border","0"),wt.setAttribute("style",`display: block; width: 100%; max-width: ${yn}px;`),wt.alt="",wt.src=Bo;const _n=pt.querySelector("a");if(_n){const yt=document.createElement("a");yt.setAttribute("target","_blank"),yt.setAttribute("href",_n.getAttribute("href")),yt.appendChild(wt),wt=yt}if(pt.tagName==="TD"){const yt=pt.cloneNode();yt.removeAttribute("em-operation"),yt.appendChild(wt),wt=yt}pt.replaceWith(wt),oe.commit()});await Promise.all(_e)}catch{}finally{ke()}}catch{}})},rt=O=>{const V=O.document;if(ue?.limits?.preview_limit==="0"&&z&&g?.counters?.emails_counter>2&&!V.querySelector(".em-powered-logo")){const X=`<a href="${`https://https://racs.emcdn.ru/v3/v3/link?app=emailmaker&project=${z}&email=${e.id}&link=https%3A%2F%2Femailmaker.ru`}" target="_blank"><img src="https://https://racs.emcdn.ru/v3/v3/pixel/123.png?image=https://emcdn.ru/emailmaker/powered.png&project=${z}&email=${e.id}" width="150" height="50" border="0" alt="" style="display: inline-block; width: 100%; max-width: 150px;"></a>`;V.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child")&&V.querySelector("body > table:last-child > tbody:last-child > tr:last-child, body > div > table:last-child > tbody:last-child > tr:last-child").insertAdjacentHTML("afterend",`<tr em="block" class="em-powered-logo">
856
856
  <td align="center" bgcolor="#FFFFFF">${X}</td>
857
- </tr>`)}},fn=async()=>{const O=ie();at(O,async V=>{try{const X=document.querySelector(".email-preview"),re=getComputedStyle(X),oe=await A(V,[re.width],e.utm_parameters,async qe=>{rt(qe)}),H=await ne({htmlContent:oe,notification:S}).unwrap(),ke=window.URL.createObjectURL(new Blob([H],{type:"application/pdf"})),_e=document.createElement("a");_e.href=ke,_e.setAttribute("download",`${Ve()}.pdf`),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),window.URL.revokeObjectURL(ke)}catch{}})},Lt=O=>{const V=ie();at(V,X=>{Ee({event:"click",action:"export_email",export_type:"HTML"});const re=document.querySelector(".email-preview"),oe=getComputedStyle(re);A(X,[oe.width],e.utm_parameters,async H=>{await Ue(H),rt(H),await o.processAmp(H,O)}).then(H=>{const ke=new Blob([H],{type:"text/html;charset=utf-8"});(0,an.saveAs)(ke,`${Ve()}.html`)}).catch(H=>{})},!0)},ct=O=>{const V=ie();at(V,X=>{Ee({event:"click",action:"export_email",export_type:"TEXT"});const re=document.querySelector(".email-preview"),oe=getComputedStyle(re);A(X,[oe.width],e.utm_parameters,async H=>{await Ue(H),rt(H),await o.processAmp(H,O);const[{htmlToText:ke},{EmailTextPlainConvertOptions:_e}]=await Promise.all([(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/8130abb3.js")),void 0,{}.url),(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/422d6166.js")),void 0,{}.url)]);H.handleReadHtml(qe=>{qe.html=ke(qe.contentDocument,_e)})}).then(H=>{const ke=new Blob([H],{type:"text/plain;charset=utf-8"});(0,an.saveAs)(ke,`${Ve()}.txt`)}).catch(H=>{})})},Et=()=>{const O=ie();at(O,V=>{Ee({event:"click",action:"export_email",export_type:"MARKDOWN"});const X=document.querySelector(".email-preview"),re=getComputedStyle(X),{utm_parameters:oe}=e;A(V,[re.width],oe,async H=>{rt(H),await o.processAmp(H,"html");const{htmlToMarkdown:ke}=await(0,Ye.__vitePreload)(async()=>{const{htmlToMarkdown:_e}=await Promise.resolve().then(()=>be("./static/core/c54e9dcb.js"));return{htmlToMarkdown:_e}},void 0,{}.url);H.handleReadHtml(_e=>{_e.html=ke(_e.contentDocument)})}).then(H=>{const ke=new Blob([H],{type:"text/markdown;charset=utf-8"});(0,an.saveAs)(ke,`${Ve()}.md`)}).catch(H=>o.reportError(H,{origin:"markdown-export"}))})},Ot=O=>{const V=ie();at(V,X=>{Ee({event:"click",action:"export_email",export_type:"Clipboard"});const re=document.querySelector(".email-preview"),oe=getComputedStyle(re);A(X,[oe.width],e.utm_parameters,async H=>{await Ue(H),rt(H),await o.processAmp(H,O)}).then(H=>navigator.clipboard.writeText(H).then(function(){S.success(n("The email has been copied to the clipboard."))})).catch(H=>{})},!0)},jn=async O=>{je&&mr(je)},Ln=()=>{ze(null),T("")},hn=async()=>{if(!P){N(!0);try{const O=await Se([800,cf],sf);if(!O)return;const{hrefs:V,dispose:X}=O;try{const[re,oe]=await Promise.all(V.map(_e=>_t.getImageByUrl(_e).then(qe=>_t.imageToBlob(qe)))),H=Ve(),ke=await _t.htmlFilesToZip(af(H,{desktop:re,mobile:oe}));(0,an.saveAs)(ke,Ta(H).archive),Ee({event:"click",action:"export_email",export_type:"Image"})}finally{X()}}catch{S.error({title:n("Error"),description:n("Failed to export the email as images. Please try again.")})}finally{N(!1)}}},On=O=>{const V=Z.get(o.APP_COOKIES.em_token);return fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(O)}`,{headers:{authorization:`Bearer ${V}`}}).then(X=>X.blob())},Mn=O=>new Promise((V,X)=>{const re=()=>On(O).then(V,X);fetch(O).then(oe=>V(oe.blob()),re).catch(()=>{})}),ht=(O,V)=>{const X=ie();at(X,re=>{Ee({event:"click",action:"export_email",export_type:"Outlook"});const oe=document.querySelector(".email-preview"),H=getComputedStyle(oe),ke=async(_e,qe)=>{_e.document,await o.processAmp(_e,qe),await Ue(_e),rt(_e)};x(e.title,re,[H.width,H.height],e.utm_parameters,O?_e=>ke(_e,"html"):_e=>ke(_e),V?{embedImagesAsBase64:!0,getImageBlob:Mn}:void 0).then(_e=>{const qe=new Blob([_e],{type:"text/html;charset=utf-8"});(0,an.saveAs)(qe,`${Ve()}.eml`)}).catch(_e=>{})})},St=O=>{k({centered:!0,mask:{closable:!0},title:n("Embed images in the file?"),content:n('If "Yes", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If "No", images will be loaded from external links.'),okText:n("Yes"),cancelText:n("No"),onOk:()=>ht(O,!0),onCancel:()=>ht(O,!1)})},ce=async()=>{const O=ie();at(O,async V=>{Ee({event:"click",action:"export_email",export_type:"ZIP"});const X=document.querySelector(".email-preview"),re=getComputedStyle(X),oe=await K(V,[re.width,void 0],e.utm_parameters,Mn,async ke=>{await Ue(ke),rt(ke),Tt&&await o.processAmp(ke,"html")});Tt&&(oe["amp.html"]=await A(V,[re.width],e.utm_parameters,async ke=>{await Ue(ke),rt(ke),await o.processAmp(ke,"amp")}));const H=await _t.htmlFilesToZip(oe);(0,an.saveAs)(H,`${Ve()}.zip`)},!0)},we=async()=>{if(Ee({event:"click",action:"duplicate_email",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew)S.warning({title:n("To create a copy, you need to save the email.")});else{if((await B.fire(e)).some(O=>O===!1))return;ft({title:xt.generateCopyTitle(e.title),...e.meta!==void 0?{meta:e.meta}:{},project:Number(ue?.id),description:e.description,html:xt.generateCopyHtml(ie()||"",String(e.title)),parent_email:e.parent_email||127017,common_styles:e.common_styles||"",utm_parameters:{utm_source:e.utm_parameters?.utm_source,utm_medium:e.utm_parameters?.utm_medium,utm_campaign:e.utm_parameters?.utm_campaign,utm_term:e.utm_parameters?.utm_term,utm_content:e.utm_parameters?.utm_content},emailtags:e.emailtags,folder:e.folder}).unwrap().then(O=>{u(`/projects/${ue.id}/emails/${O.id}`),S.success({title:n('The copy of email "')+e.title+n('" was successfully created.')}),Ee({event:"duplicate",action:"duplicate_email_success",entity_type:"email",entity_id:e.id,cloned_entity_id:O.id,project_id:e.project,context:"editor"}),ge("folder")}).catch(O=>{S.error({title:O.data.code,description:O.data.message})})}},De=()=>{Ee({event:"click",action:"click_delete_email_menu_item",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew?S.success(n("The draft of the email has been deleted.")):nt(e,u)},nt=(O,V)=>{Ee({event:"open",action:"open_delete_email_modal",entity_type:"email",entity_id:O.id,project_id:O.project,context:"editor"}),k({mask:{closable:!0},centered:!0,title:r('Are you sure to delete "',"email")+O.title+n('" email?'),icon:(0,s.jsx)(o.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:22,style:{color:y.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:n("Yes"),cancelText:n("No"),onOk:()=>vt(O,V)})},Le=()=>{fr().catch(()=>{}),o.uploadFile("application/zip, message/rfc822, text/html",Kt)},Kt=async O=>{const V=O[0];try{i(o.setIsGlobalLoading(!0));const{createDocumentProcessor:X,createFileProcessor:re,importEmail:oe}=await fr(),{html:H,hasBrowserExtensionArtifacts:ke}=await oe(V,re(c,d,h,ue,M),X(V))??{html:"",hasBrowserExtensionArtifacts:!1};ke&&$.fire();const[_e]=_t.getFileNameAndExt(V.name.replaceAll("&nbsp;"," ")),qe=_e||xt.getTitleFromHtml(H)||"";te(H,{undoable:!0}),a({title:qe}),i(o.setIsGlobalLoading(!1)),le.fire({html:H})}catch(X){i(o.setIsGlobalLoading(!1));const re=X instanceof Error?X.message:X;S.error({title:re})}Ee({event:"upload_file",action:"import_email"})},Ut=()=>{const O=ie();O&&(Ee({event:"click",action:"convert_layout"}),le.fire({html:O}))},dt=[];M.emailDropdownMenuClone&&dt.push({label:n("Clone"),icon:(0,s.jsx)(o.EmIcons,{icon:"CopyOutlined",component:y.icons$CopyOutlined,size:16,strokeWidth:M.iconStrokeWidth}),key:"Clone",className:"em-analytics__email-clone",disabled:lt.isLoading,onClick:we}),M.emailDropdownMenuImport&&dt.push({label:r("Import","verb"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,style:Dt}),locked:Qe.isLocked,strokeWidth:M.iconStrokeWidth}),key:"Import",className:"em-analytics__editor-page__import",onClick:()=>{if(Qe.isLocked){Ze("template_import");return}Ee({event:"click",action:"import_email"}),Le()}});const Nn=ie(),$t=!e.hasOwnProperty("type")&&Ea(Nn,L)!==null;M.emailDropdownMenuConvert&&$t&&dt.push({label:n("Convert"),icon:(0,s.jsx)(o.EmIcons,{icon:"SwapOutlined",component:y.icons$SwapOutlined,size:16,strokeWidth:M.iconStrokeWidth}),key:"ConvertLayout",className:"em-analytics__email-convert",onClick:Ut}),(m||f||h.id?.toString()===e.author?.toString())&&(M.emailDropdownMenuLock&&dt.push({label:(0,s.jsx)(ba,{element:e,context:"editor"},"Lock"),icon:e.lock?(0,s.jsx)(o.EmIcons,{icon:"UnLock",component:y.icons$UnLock,size:16,strokeWidth:M.iconStrokeWidth}):(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:16,strokeWidth:M.iconStrokeWidth}),disabled:e.isNew}),M.emailDropdownMenuRemove&&dt.push({label:n("Remove"),icon:(0,s.jsx)(o.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:16,strokeWidth:M.iconStrokeWidth}),key:"Remove",className:"em-analytics__email-remove",style:{color:"#ff4d4f"},onClick:De}));const Tt=e.isAmp,It=[],Fo=()=>[...Tt?[{key:"html_txt",label:`${n("Plain text")} (HTML)`,onClick:()=>ct("html")},{key:"сode_txt",label:`${n("Plain text")} (AMP)`,onClick:()=>ct("amp")}]:[{key:"plain_txt",label:n("Plain text"),onClick:()=>ct()}],{key:"markdown",label:n("Markdown"),onClick:()=>Et()}];M.exportHtmlEnabled&&It.push({key:"html",label:n("Code"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileTextOutlined",component:y.icons$FileTextOutlined,style:Dt}),locked:D.isLocked,strokeWidth:M.iconStrokeWidth}),...D.isLocked?{onClick:()=>Ze("export_html")}:Tt?{children:[{key:"сode_html",label:n("AMP"),onClick:()=>Ae.isLocked?Ze("export_amp"):Lt("amp")},{key:"html_amp",label:n("HTML"),onClick:()=>Lt("html")}]}:{onClick:()=>Lt()}}),M.exportZipEnabled&&It.push({key:"zip",label:n("ZIP"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileZipOutlined",component:y.icons$FileZipOutlined,style:Dt}),locked:D.isLocked,strokeWidth:M.iconStrokeWidth}),...D.isLocked?{onClick:()=>Ze("export_html")}:{onClick:()=>ce().catch(O=>{})}}),M.exportClipboardEnabled&&It.push({key:"clipboard",label:n("Clipboard"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"SnippetsOutlined",component:y.icons$SnippetsOutlined,style:Dt}),locked:D.isLocked,strokeWidth:M.iconStrokeWidth}),...D.isLocked?{onClick:()=>Ze("export_html")}:Tt?{children:[{key:"clipboard_html",label:n("AMP"),onClick:()=>Ae.isLocked?Ze("export_amp"):Ot("amp")},{key:"clipboard_amp",label:n("HTML"),onClick:()=>Ot("html")}]}:{onClick:()=>Ot()}}),M.exportTextEnabled&&It.push({key:"text",label:n("Text"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileOutlined",component:y.icons$FileOutlined,style:Dt}),locked:D.isLocked,strokeWidth:M.iconStrokeWidth}),...D.isLocked?{onClick:()=>Ze("export_html")}:M.exportMarkdownEnabled?{children:Fo()}:Tt?{children:[{key:"сode_txt",label:n("AMP"),onClick:()=>Ae.isLocked?Ze("export_amp"):ct("amp")},{key:"html_txt",label:n("HTML"),onClick:()=>ct("html")}]}:{onClick:()=>ct()}}),M.exportOutlookEnabled&&It.push({key:"outlook",icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileWordOutlined",component:y.icons$FileWordOutlined,style:Dt}),locked:Pe.isLocked,strokeWidth:M.iconStrokeWidth}),label:n("Outlook"),onClick:()=>Pe.isLocked?Ze("export_platforms"):St(!!Tt)}),M.exportPdfEnabled&&It.push({key:"pdf",icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FilePdfOutlined",component:y.icons$FilePdfOutlined,style:Dt}),locked:b.isLocked,strokeWidth:M.iconStrokeWidth}),label:n("PDF"),onClick:()=>b.isLocked?Ze("export_pdf"):fn()}),M.exportPngEnabled&&It.push({key:"img",icon:(0,s.jsx)(qt,{icon:P?(0,s.jsx)(o.EmIcons,{icon:"LoadingOutlined",component:y.icons$LoadingOutlined,spin:!0,style:Dt}):(0,s.jsx)(o.EmIcons,{icon:"FileImageOutlined",component:y.icons$FileImageOutlined,style:Dt}),locked:W.isLocked,strokeWidth:M.iconStrokeWidth}),label:n("PNG"),disabled:!W.isLocked&&P,onClick:()=>W.isLocked?Ze("export_png"):hn()});const gt=e.author;return(0,s.jsxs)(y.ui_kit$Space,{children:[M.emailDropdownMenuEnabled?(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:dt},children:(0,s.jsx)(y.ui_kit$Button,{type:"default",block:!1,className:"email-page-header__btn email-page-header__btn_extra",onClick:()=>{},children:(0,s.jsx)(o.EmIcons,{icon:"DotsHoriz",component:y.icons$DotsHoriz,size:18,strokeWidth:M.iconStrokeWidth})})},"Actions"):M.emailDropdownMenuImport&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Import","verb"),placement:"bottom",children:M.emailDropdownMenuImportButton?(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:16,strokeWidth:M.iconStrokeWidth}),onClick:()=>{Ee({event:"click",action:"import_email"}),Le()},children:n("Import")}):(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:22,strokeWidth:M.iconStrokeWidth}),onClick:()=>{Ee({event:"click",action:"import_email"}),Le()}})}),M.emailExportEnabled&&(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:It},children:(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__email-page__export",type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudDownloadOutlined",component:y.icons$CloudDownloadOutlined,size:16,strokeWidth:M.iconStrokeWidth}),children:n("Export")},"Export")},"Export"),!e.hasOwnProperty("type")&&(0,s.jsx)(_a,{disabled:fe,email:e},"Save"),!!e.hasOwnProperty("type")&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Mu,{disabled:fe,rightCol:void 0,block:e,isEditableRights:m||f||h.id?.toString()===gt?.toString(),autoSaveBlockResult:t})},"Save"),(0,s.jsx)(rp,{open:me,codeSize:o.getCodeSize(Ce),onMinimize:Bt,onDownloadAsIs:Me,onCancel:Xe}),je&&mr(je)&&(0,s.jsx)(hp,{integration:mr(je),visible:!!je,loading:et,onConfirm:jn,onCancel:Ln,__:n}),(0,s.jsx)(o.PlanUpgradePrompt,{open:J,sideOnOk:void 0,onCancel:()=>ye(!1),initialSlide:Te})]})},_o=o.createApi({reducerPath:"confirmationMailApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:t,email:n})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${t}&user_email=${n}`)}`})})})}),{useLazyGetConfirmationMailQuery:pf}=_o,ff=()=>{const{__:e}=o.useI18n(),t=o.useNotification(),n=o.useCurrentUser(),[r]=pf(),[i,a]=(0,l.useState)(!1),c=o.usePushToDataLayer();(0,l.useEffect)(()=>{n.hasOwnProperty("email_confirmation")&&a(n.email_confirmation)},[n,i]);const d=()=>{c({event:"click",action:"click_resend_confirmation_email",user_email:n.email,user_id:n.id}),r({userId:n.id,email:n.email}).then(({data:u,error:m})=>{u?t.success(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",n.email)):m&&t.error(m)})};return n?.email_confirmation||!n?.privacy_policy_agreement?null:(0,s.jsx)("div",{className:"main__ribbon",children:(0,s.jsxs)("span",{children:[(0,s.jsx)(o.EmIcons,{icon:"EmailConfirmation",component:y.icons$EmailConfirmation,size:16,style:{marginRight:10,verticalAlign:"-0.15em"}}),e("Confirmation email was sent to")," ",(0,s.jsx)("em",{children:n.email}),". ",e("Didn't receive an email?")," ",(0,s.jsxs)(y.ui_kit$Button,{type:"primary",size:"small",className:"main__ribbon-resend",style:{fontSize:16,lineHeight:1,display:"inline-flex",alignItems:"center",gap:8},onClick:d,children:[e("Resend"),(0,s.jsx)(o.EmIcons,{icon:"SendOutlined",component:y.icons$SendOutlined,size:16,style:{flexShrink:0}})]})]})})},hf=({className:e,leftBlock:t,rightBlock:n,isHeaderCodeMenuOpen:r=!1})=>{const{token:i}=(0,y.ui_kit$useToken)(),a=(0,l.useRef)(),c=o.useAppConfig();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ff,{}),c.headerShow&&(0,s.jsx)("header",{className:(0,ot.default)("header",{[e]:e}),style:{borderColor:i.colorBorder},children:!r&&(0,s.jsx)(o.CSSTransition,{nodeRef:a,in:!r,timeout:300,classNames:"transition",children:(0,s.jsxs)("div",{className:"header__container container",children:[(0,s.jsx)("div",{className:"header__left",style:{flexGrow:1},children:t}),(0,s.jsx)("div",{className:"header__right",children:(0,s.jsx)(y.ui_kit$Space,{size:10,children:n})})]})})})]})},gf=e=>{},Ia=g.createIdentifier$1("canvas.headerFlow");function yf(e){const t=(0,l.useCallback)(n=>e?e.subscribe(n):()=>{},[e]);return(0,l.useSyncExternalStore)(t,()=>e?.isReady()===!0)}var Aa=({email:e,isCollaborationEditor:t})=>{const[n]=y.ui_kit$Form.useForm(),{__:r}=o.useI18n();let i=o.useDispatch();const a=o.useEmailAttributesWriter(),c=o.useAppNavigate(),d=o.useOpenPlanCatalog(),u=Vi("header"),m=o.useCurrentUser(),f=o.useContainer().getInstance(Ia),h=o.useProjectData(),{owner:_,admin:p}=Qn(),{token:S}=(0,y.ui_kit$useToken)(),k=o.useAppConfig(),w=o.usePushToDataLayer(),v=(0,l.useRef)(),A=(0,l.useRef)(),x=(0,l.useRef)(),K=o.useEventEmitter(g.events.ON_PREVIOUSBUTTON_CLICK_ID),Z=o.useEventEmitter(g.events.ON_PREHEADER_CHANGED_ID),M=o.useEventEmitter(g.events.ON_SUBJECT_CHANGED_ID),L=o.useSelector(o.selectCodeModeDirection),I=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,j=o.useSelector(o.selectElementSettings$1),z=o.useSelector(o.selectElementSettings),B=I==="email"?j:z,$=o.useSelector(o.selectIsCodeMode),[de,pe]=(0,l.useState)(!1),[q,ee]=(0,l.useState)(!1),[Fe,ve]=(0,l.useState)(!1),et=(0,l.useCallback)(()=>ve(!1),[]),Ee=(0,l.useCallback)(()=>{ve(!1),d()},[d]),fe=Wi("email_generate"),Q=fe.exceeded?o.getLimitUpgradePresetDefinition(fe.exceeded.presetId):null;(0,l.useEffect)(()=>{const b=!!B?.type&&(B?.type===o.ELEMENT_TYPES.TEXT||B?.type===o.ELEMENT_TYPES.LINK||B.type===o.ELEMENT_TYPES.BUTTON)&&$&&L!=="bottom";pe(b),i(o.setHeaderCodeMenuOpen(b))},[B,L,$]);const me=(0,l.useCallback)(()=>{w({event:"click",action:"click_back_button",entity_type:I==="block"?"block":"email",entity_id:e?.id,project_id:e?.project||h?.id,context:"editor"}),K.fire(e)},[c,K,e,h?.id,w,I]),{document:ae}=o.useCurrentSession(),se=yf(ae);o.usePrevious(([b])=>{se&&b!==e.subject&&M.fire(e.subject)},[e.subject,se]);const Ie=(0,l.useCallback)(b=>{const W=b.target.value;M.fire(W)},[M]),Ce=(0,l.useCallback)(b=>{const W=b.target.value;Z.fire(W)},[Z]);o.usePrevious(([b])=>{se&&b!==e.preheader&&Z.fire(e.preheader)},[e.preheader,se]);const Be=(0,l.useCallback)((b,W="?")=>{b.subject?.length,b.preheader?.length,n.setFieldValue("subject",b.subject??""),n.setFieldValue("preheader",b.preheader??"")},[n]),J=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{const b=e?.renderGuid??(e?.id!=null?String(e.id):void 0);!se||!b||J.current===b||(J.current=b,Be(e,"identity"))},[se,e,Be]);const ye=(0,l.useCallback)(b=>{const W=o.stripSubjectTags(b.value).trim();return W!==b.value&&n.setFieldValue("subject",W),W},[n]),Te=(0,l.useCallback)(b=>{const W=ye(b.target);a({subject:W})},[a,ye]),he=o.useEvent(g.events.BEFORE_SAVE_EMAIL),je=(0,l.useCallback)(async b=>{const W=A.current?.input;if(document.activeElement===W){const Ae=ye(W);Ae!==b.subject&&(b.subject=Ae,a({subject:Ae}))}const Pe=x.current?.input;if(document.activeElement===Pe){const Ae=Pe.value.trim();Ae!==b.preheader&&(b.preheader=Ae,a({preheader:Ae}))}await f?.whenDelivered()},[f,a,ye]);(0,l.useEffect)(()=>{const b=he(je);return()=>b.dispose()},[he,je]);const ze=(0,l.useCallback)(b=>{const W=b.target.value.trim();a({preheader:W})},[a]),C=o.useEvent(g.events.ON_HEADER_APPLIED_ID);(0,l.useEffect)(()=>{const b=C(({field:W,value:Pe})=>{n.setFieldValue(W,Pe)});return()=>b.dispose()},[C,n]),gf(e.title===null?r("New email title"):e.title);const T=(0,l.useCallback)(()=>{i(o.setActiveSettingsTab(o.AICHAT)),setTimeout(()=>{const b=document.querySelector('li.ai-response-change-context[role="theme-and-preheader-generator"]');b&&b.click()},100)},[i]),P=(0,l.useCallback)(()=>{fe.isLocked?fe.state.state==="locked_by_limit"&&fe.exceeded?ve(!0):ee(!0):T()},[fe,T]),N=(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(y.ui_kit$Space,{ref:v,size:10,children:[k.headerArrowBackVisible&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Back"),placement:"left",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"ArrowLeftOutlined",component:y.icons$ArrowLeftOutlined,size:22,strokeWidth:k.iconStrokeWidth}),onClick:me,shape:"circle"})}),(0,s.jsx)("div",{children:(k.headerTitleVisible||k.headerPreheaderVisible)&&(0,s.jsxs)(y.ui_kit$Form,{form:n,layout:"vertical",name:"subject_preheader_form",autoComplete:"off",initialValues:{subject:"",preheader:""},children:[k.headerTitleVisible&&(0,s.jsx)("div",{style:{marginTop:se?-3:0},children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:r("Subject")}),se?(0,s.jsxs)("div",{className:"ant-page-header-heading",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"subject",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-title",ref:A,placeholder:r("Enter subject line here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Ie,onPressEnter:Te,onBlur:b=>{Te(b),document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.add("focus")},disabled:k.lockPreheaderAndTitle})}),k.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Generate with AI"),children:(0,s.jsx)(o.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:k.iconStrokeWidth,onClick:P})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"40%",marginTop:3}})]})}),k.headerPreheaderVisible&&(0,s.jsx)("div",{children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:r("Preheader")}),se?(0,s.jsxs)("div",{className:"ant-page-header-heading ant-page-header-heading_preheader",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"preheader",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-preheader",ref:x,placeholder:r("Enter preheader here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Ce,onPressEnter:ze,onBlur:b=>{ze(b),document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.add("focus")},disabled:k.lockPreheaderAndTitle})}),k.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Generate with AI"),children:(0,s.jsx)(o.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:k.iconStrokeWidth,onClick:P})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"80%",marginTop:2}})]})})]})})]})}),D=(0,s.jsxs)(s.Fragment,{children:[k.emailIdShow&&!!e.id&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"email-page-header__email-id",children:"ID"+e.id}),(0,s.jsx)(y.ui_kit$Divider,{orientation:"vertical"})]}),(0,s.jsx)(pa,{emailElement:e,isCollaborationEditor:t}),k.commandButtonsEnabled&&(0,s.jsxs)(s.Fragment,{children:[e.lock?(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:18,strokeWidth:k.iconStrokeWidth,className:(0,ot.default)("lock-icon",{"lock-icon__disabled":!(_||p||m.id?.toString()===e.author?.toString())}),style:{color:S.colorPrimary,verticalAlign:"sub"}},"Lock"):null,(0,s.jsx)(mf,{email:e,isHeaderCodeMenuOpen:de},"Buttons")]})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(hf,{className:"email-pane__header",leftBlock:u?N:null,rightBlock:u?D:null,isHeaderCodeMenuOpen:de}),(0,s.jsx)(o.PlanUpgradePrompt,{open:q,onCancel:()=>ee(!1),initialSlide:9}),Q&&fe.exceeded?(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(rr,{open:Fe,onClose:et,title:r(Q.titleKey),subtitle:r(Q.subtitleKey),usageResource:Q.usageResource,previousDisplay:o.presetLimitDisplay(fe.exceeded.previousLimit),nextDisplay:o.presetLimitDisplay(fe.exceeded.nextLimit),onChangePlan:Ee})}):null]})};Aa.propTypes={};function _f(e){const t=o.parseEmBlockVersion(e);if(!t)return e;const n=r=>String(r).padStart(2,"0");return`${n(t.getDate())}.${n(t.getMonth()+1)}.${t.getFullYear()} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var bf=({open:e,blocks:t,projectId:n,onClose:r})=>{const{__:i,_n:a}=o.useI18n(),c=o.useSendPostMessage(),d=o.useNotification(),[u,m]=(0,l.useState)({});(0,l.useEffect)(()=>{e&&m(Object.fromEntries(t.map(p=>[p.emBlockId,!0])))},[e,t]);const f=(0,l.useMemo)(()=>Object.values(u).filter(Boolean).length,[u]),h=(p,S)=>{m(k=>({...k,[p]:S}))},_=()=>{const p=t.filter(S=>u[S.emBlockId]);p.length&&(p.forEach(S=>{c({operation:o.EVENT_TYPES.SANDBOX_GLOBAL_BLOCK_REPLACE,settings:{emBlockId:S.emBlockId,blockHTML:S.savedHtml,type:"project",...n?{project:String(n)}:{}}})}),d.success({message:i("Updated")+" "+p.length+" "+a("block","blocks",p.length),placement:"bottomRight"}),r())};return(0,s.jsxs)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Update global blocks")}),open:e,onOk:_,onCancel:r,footer:(0,s.jsxs)("div",{className:"update-global-blocks-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:r,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",disabled:f===0,onClick:_,children:i("Update")})]}),children:[(0,s.jsx)("div",{className:"update-global-blocks-modal__hint",children:i("These global blocks have a newer saved version. Select the ones to update in the template.")}),(0,s.jsx)("div",{className:"update-global-blocks-modal__list",children:t.map(p=>(0,s.jsxs)("div",{className:"update-global-blocks-modal__row",children:[(0,s.jsx)(y.ui_kit$Switch,{checked:!!u[p.emBlockId],onChange:S=>h(p.emBlockId,S)}),(0,s.jsxs)("span",{className:"update-global-blocks-modal__title",title:p.title,children:[p.title,(0,s.jsxs)("span",{className:"update-global-blocks-modal__version",children:[i("Version of")," ",_f(p.savedVersion)]})]}),p.instances>1&&(0,s.jsxs)("span",{className:"update-global-blocks-modal__count",children:[p.instances," ",a("instance","instances",p.instances)]})]},p.emBlockId))})]})};function vf(e){const t=new Map;return e?.trim()&&new DOMParser().parseFromString(e,"text/html").querySelectorAll('[em="block"][em-block-id]').forEach(n=>{const r=n.getAttribute("em-block-id");if(!r)return;const i=n.getAttribute("em-block-version")??void 0,a=t.get(r);a?(a.versions.add(i),a.count+=1):t.set(r,{versions:new Set([i]),count:1})}),t}function Ef(e,t){const n=vf(e);if(!n.size||!t?.length)return[];const r=[];for(const i of t){if(!i.global_block||!i.id||!i.html)continue;const a=String(i.id),c=n.get(a);if(!c)continue;const d=o.readRootEmBlockAttrs(i.html).emBlockVersion;d&&[...c.versions].some(u=>u!==d)&&r.push({emBlockId:a,title:i.title?.trim()||a,savedHtml:i.html,savedVersion:d,templateVersion:[...c.versions][0],instances:c.count})}return r}var xa="em-block-id";function Sf({projectId:e,document:t}){const n=o.useEvent(g.events.ON_EMAIL_INIT_ID),r=o.useHeadless(),[i,a]=(0,l.useState)([]),[c,d]=(0,l.useState)(!1),[u,m]=(0,l.useState)(null),f=(0,l.useCallback)(S=>t?.subscribe(S)??(()=>{}),[t]),h=(0,l.useSyncExternalStore)(f,()=>!!t?.getContent().includes(xa)),{data:_}=o.blocksApi.endpoints.getBlocks.useQuery(o.projectBlocksArgs(e),{skip:!e||!h}),p=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{h&&p.current&&t&&(p.current=!1,m(t.getContent()))},[h,t]),(0,l.useEffect)(()=>{const S=new g.Disposable;return S.addDisposable(n(k=>{if(k?.reset)return;const w=k?.html??"",v=w.includes(xa);p.current=!v,m(v?w:null)})),()=>S.dispose()},[n]),(0,l.useEffect)(()=>{if(u==null||!_)return;if(r){m(null);return}const S=Ef(u,_);S.length&&(a(S),d(!0)),m(null)},[u,_,r]),{outdatedBlocks:i,isOpen:c,close:(0,l.useCallback)(()=>d(!1),[])}}var wf=({open:e,html:t,emBlockId:n,onSaveAsNew:r,onClose:i})=>{const{__:a}=o.useI18n(),c=o.useSendPostMessage(),d=o.useNotification(),[u]=o.useEditBlockMutation(),[m,f]=(0,l.useState)(!1),h=async()=>{if(!n||!t){i();return}f(!0);const _=new Date,p=o.formatEmBlockVersion(_),S=o.injectEmBlockIdIntoBlockHtml(t,String(n),_),k=await u({blockId:String(n),html:S});if(f(!1),"error"in k&&k.error){d.error({message:a("Failed to update the global block."),placement:"bottomRight"});return}c({operation:o.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:String(n),emBlockVersion:p}}),d.success({message:a("The global block was updated."),placement:"bottomRight"}),i()};return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:a("Saving changes in the block")}),open:e,onCancel:i,footer:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",disabled:m,onClick:r,children:a("Create new block")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",loading:m,onClick:h,children:a("Update current block")})]}),children:(0,s.jsx)("div",{children:a("This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.")})})},kf=(function(){var e=window.__emailmaker__;if(e&&e.assetUrl)return e.assetUrl("converter-intro.bf4ee74d750b35ae2c10.png");if(e&&e.publicPath)try{return new URL("static/media/converter-intro.bf4ee74d750b35ae2c10.png",e.publicPath).href}catch{}try{return new URL("/static/media/converter-intro.bf4ee74d750b35ae2c10.png",typeof document<"u"&&document.baseURI?document.baseURI:typeof window<"u"&&window.location?window.location.href:"").href}catch{return"/static/media/converter-intro.bf4ee74d750b35ae2c10.png"}})(),Cf={closable:!1},Tf=kf,If=({open:e,onConfirm:t,onCancel:n,neverSuggestAgain:r,onNeverSuggestAgainChange:i})=>{const{__:a}=o.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{className:"convert-layout-modal",title:(0,s.jsx)("div",{className:"convert-layout-modal__title",children:a("Template conversion")}),open:e,onOk:t,onCancel:n,mask:Cf,width:480,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",style:{display:"flex",flexDirection:"column",gap:16},children:[(0,s.jsx)(y.ui_kit$Switch,{size:"small",checked:r,onChange:i,label:a("Don't suggest again"),labelSize:"small"}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:n,children:a("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:a("Convert")})]})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__content",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:24,padding:"0 8px",overflow:"hidden"},children:[(0,s.jsx)("div",{className:"convert-layout-modal__text convert-layout-modal__intro-text",style:{textAlign:"center"},children:a("This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.")}),(0,s.jsx)("img",{src:Tf,alt:"Converter Intro",className:"convert-layout-modal__image",style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",borderRadius:8}})]})})},Af={closable:!1},xf=({open:e,message:t,onRetry:n,onCancel:r})=>{const{__:i}=o.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Conversion failed")}),open:e,onOk:n,onCancel:r,mask:Af,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:r,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:n,children:i("Try again")})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__text",children:[i("Something went wrong during layout conversion. You can try running the conversion again."),t?(0,s.jsx)("div",{className:"convert-layout-modal__error-details",children:t}):null]})})},Pf=({open:e,progress:t})=>{const{__:n}=o.useI18n();return e?(0,s.jsx)("div",{className:"conversion-overlay",children:(0,s.jsxs)("div",{className:"conversion-overlay__content",children:[(0,s.jsx)(y.ui_kit$Spin,{size:"large"}),(0,s.jsx)("div",{className:"conversion-overlay__title",children:n("Converting layout…")}),(0,s.jsx)("div",{className:"conversion-overlay__hint",children:n("This may take several minutes. Please keep this tab open.")}),(0,s.jsx)(y.ui_kit$Progress,{className:"conversion-overlay__progress",percent:Math.round(t),status:"active",strokeColor:o.emCssVar("colorPrimary")})]})}):null},bo=o.createApi({reducerPath:"layoutConverterApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({createConvertJob:e.mutation({query:({html:t})=>({url:"/ai/converter/jobs",method:"POST",body:{html:t}})}),getConvertJobStatus:e.query({query:t=>({url:`/ai/converter/jobs/${t}`,method:"GET"})})})}),{useCreateConvertJobMutation:Rf,useLazyGetConvertJobStatusQuery:jf}=bo;function Lf(){try{return window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)==="true"}catch{return!1}}function Of(e){try{e?window.localStorage.setItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest,"true"):window.localStorage.removeItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)}catch{}}function Pa(e){return e==="beefree"?(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/0cb54b92.js")).then(t=>t.convertBeeFreeToEmailMaker),void 0,{}.url):(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/918c30e2.js")).then(t=>t.convertStripoToEmailMaker),void 0,{}.url)}var Mf=5,Ra=95,Nf=35e3,Df=1e3,Ff=e=>new Promise(t=>setTimeout(t,e));function Bf(e,t){if(e&&typeof e=="object"){const n=e,r=n.data;if(r&&typeof r=="object"){const i=r.error;if(typeof i=="object"&&i?.message)return i.message;if(typeof i=="string"&&i)return i;if(r.message)return r.message}if(typeof r=="string"&&r)return r;if(n.error)return n.error;if(n.message)return n.message}return t}function Uf(){const{__:e}=o.useI18n(),t=o.useContentReplacer(),n=o.useNotification(),r=va(),{aiLayoutConverterEnabled:i,anyConverterEnabled:a}=r,c=o.useHeadless(),d=o.useEvent(g.events.ON_EMAIL_INIT_ID),u=o.useEvent(g.events.ON_LAYOUT_CONVERT_REQUEST_ID),[m]=Rf(),[f]=jf(),[h,_]=(0,l.useState)(Lf),p=(0,l.useRef)(h),S=(0,l.useCallback)(ae=>{p.current=ae,_(ae),Of(ae)},[]),[k,w]=(0,l.useState)(!1),[v,A]=(0,l.useState)(!1),[x,K]=(0,l.useState)(0),[Z,M]=(0,l.useState)(!1),[L,I]=(0,l.useState)(""),j=(0,l.useRef)(""),z=(0,l.useRef)(null),B=(0,l.useRef)(null),$=(0,l.useRef)(!1),de=(0,l.useRef)({cancelled:!0}),pe=(0,l.useRef)(null);(0,l.useEffect)(()=>{$.current=v},[v]);const q=(0,l.useCallback)(()=>{pe.current!==null&&(clearInterval(pe.current),pe.current=null)},[]),ee=(0,l.useCallback)(()=>{q();const ae=Date.now();pe.current=setInterval(()=>{const se=Date.now()-ae,Ie=Ra*(1-Math.exp(-se/Nf));K(Ce=>Math.max(Ce,Math.min(Ra,Ie)))},Df)},[q]),Fe=(0,l.useCallback)(ae=>{ae&&(t(ae,{undoable:!0}),B.current=ae)},[t]),ve=(0,l.useCallback)(async ae=>{const se={cancelled:!1};de.current=se,M(!1);const Ie=z.current;if(Ie==="beefree"||Ie==="stripo"){try{const Ce=await Pa(Ie),Be=se.cancelled?"":Ce(ae);if(Be&&!se.cancelled){Fe(Be),n.success({message:o.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"});return}}catch{}if(!i){se.cancelled||(I(e("Layout conversion failed")),M(!0));return}}if(i){A(!0),K(0),ee();try{const Ce=await m({html:ae}).unwrap();if(se.cancelled)return;let Be=Ce.retry_after>0?Ce.retry_after:Mf;for(;!se.cancelled;){if(await Ff(Be*1e3),se.cancelled)return;const J=await f(Ce.job_id).unwrap();if(se.cancelled)return;if(J.retry_after&&J.retry_after>0&&(Be=J.retry_after),J.status==="completed"){q(),K(100),Fe(J.html??""),n.success({message:o.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"}),setTimeout(()=>{se.cancelled||(A(!1),K(0))},400);return}if(J.status==="failed")throw new Error(J.error?.message||e("Layout conversion failed"))}}catch(Ce){if(se.cancelled)return;q(),A(!1),K(0),I(Bf(Ce,e("Layout conversion failed"))),M(!0)}}},[e,i,Fe,m,n,f,ee,q]),et=(0,l.useCallback)(()=>{w(!1);const ae=j.current;ae&&ve(ae)},[ve]),Ee=(0,l.useCallback)(()=>{w(!1),B.current=j.current},[]),fe=(0,l.useCallback)(()=>{M(!1);const ae=j.current;ae&&ve(ae)},[ve]),Q=(0,l.useCallback)(()=>{M(!1),B.current=j.current},[]),me=(0,l.useCallback)((ae,se=!1)=>{const Ie=Ea(ae,r);if(a&&!c&&Ie&&!$.current){if(se)B.current=null;else{if(p.current)return;if(B.current===ae)return}j.current=ae,z.current=Ie,Ie!=="ai"&&Pa(Ie).catch(()=>{}),w(!0)}},[a,r,c]);return(0,l.useEffect)(()=>{if(!a)return;const ae=new g.Disposable;return ae.addDisposable(d(se=>{se?.reset||me(se?.html??"")})),()=>ae.dispose()},[a,d,me]),(0,l.useEffect)(()=>{if(!a)return;const ae=new g.Disposable;return ae.addDisposable(u(se=>{me(se?.html??"",!0)})),()=>ae.dispose()},[a,u,me]),(0,l.useEffect)(()=>()=>{de.current.cancelled=!0,q()},[q]),{isPromptOpen:k,isConverting:v,progress:x,isErrorOpen:Z,errorMessage:L,confirmConversion:et,cancelPrompt:Ee,retryConversion:fe,closeError:Q,neverSuggestAgain:h,setNeverSuggestAgain:S}}var $f=6e4,ja=new Map;function zf(e){const t=e?String(e):"",n=ja.get(t);if(n&&(ja.delete(t),!(Date.now()-n.at>$f)))return n.promise}var hr={data:void 0,isSuccess:!1,isError:!1,error:void 0,isLoading:!1};function Gf(e){const t=o.useStore(),n=(0,l.useRef)(t);n.current=t;const[r,i]=(0,l.useState)(hr),a=e?String(e):void 0;return(0,l.useEffect)(()=>{if(!a){i(hr);return}let c=!1;return i({...hr,isLoading:!0}),(zf(a)??o.resolveEmailPort(g.getContainer(n.current)).readEmail(a)).then(d=>{c||i({data:d??void 0,isSuccess:!0,isError:!1,error:void 0,isLoading:!1})}).catch(d=>{c||i({data:void 0,isSuccess:!1,isError:!0,error:d,isLoading:!1})}),()=>{c=!0}},[a]),r}var fv=2;function Wf(){const e=o.useProjectData()?.id,t=!0,{data:n,isError:r,isFetching:i,refetch:a}=o.useGetProjectPlanQuery(e,{skip:t}),[c,d]=(0,l.useState)(0),u=(0,l.useRef)(!1),m=!!r,f=c>=2,h=(0,l.useCallback)(()=>{u.current=!1,d(0),a()},[a]);(0,l.useEffect)(()=>{},[m,i,a,c,t]),(0,l.useEffect)(()=>{},[m,e,f,t]);const _="ready";return(0,l.useMemo)(()=>({status:_,retry:h}),[_,h])}var hv=300,Hf=g.createIdentifier$1("prewarm.queue");function qf(e){const t=[];let n=!1,r=!1,i;const a=()=>{i&&(i.unwatch(),e.clearTimer(i.timer),i=void 0)},c=()=>{const m=t.shift();if(!m)return;r=!0;const f=()=>{r=!1,u()};m.start().then(f,f)},d=()=>{a(),e.idle(()=>{if(!(r||t.length===0)){if(e.activity.inFlight()>0){u();return}c()}})};function u(){if(!n||r||i||t.length===0)return;const m=()=>e.setTimer(d,300),f={timer:e.activity.inFlight()===0?m():void 0,unwatch:e.activity.watch(()=>{e.clearTimer(f.timer),f.timer=e.activity.inFlight()===0?m():void 0})};i=f}return e.whenVisible(()=>{n=!0,u()}),{add(m){t.some(f=>f.name===m.name)||(t.push(m),u())},remove(m){const f=t.findIndex(h=>h.name===m);f>=0&&t.splice(f,1),t.length===0&&a()}}}function Vf(e){return e.getOrCreateInstance(Hf,()=>qf({activity:g.getNetworkActivity(e),whenVisible:t=>Ht(e).whenVisible(t),idle:Xt,setTimer:(t,n)=>window.setTimeout(t,n),clearTimer:t=>window.clearTimeout(t)}))}function Yf({projectId:e,project:t,emailProjectId:n,parentEmailId:r}){const i=o.useContainer(),a=o.useAppDispatch(),d=!!o.useCookieManager().get(o.APP_COOKIES.em_token);(0,l.useEffect)(()=>{const u=Vf(i),m=[],f=[],h=(p,S)=>{f.push(p),u.add({name:p,start:()=>{const k=S();return m.push(k),Promise.resolve(k)}})},_=o.parentEmailSource(r);return _&&h("blocks.parentEmail",()=>a(o.blocksApi.endpoints.getParentEmailBlocks.initiate(o.parentEmailBlocksArgs(_)))),h("blocks.template",()=>a(o.blocksApi.endpoints.getTemplateBlocks.initiate(o.templateBlocksArgs()))),e&&h("blocks.list",()=>a(o.blocksApi.endpoints.getBlocks.initiate(o.projectBlocksArgs(e)))),h("blocks.schema",()=>a(o.blocksApi.endpoints.getBlocksSchema.initiate(void 0))),t?.id&&h("blocks.tags",()=>a(o.taxonomiesApi.endpoints.getTerms.initiate({project:t,kind:o.BLOCK_TAGS}))),()=>{f.forEach(p=>u.remove(p)),m.forEach(p=>p.unsubscribe())}},[i,a,e,t,n,r,d])}var gr="AUTOSAVE_RECOVERY";function Kf(e,t,n=!1,r){const i=t?.get().serverId??void 0,{__:a}=o.useI18n(),c=o.useNotification(),d=o.useAppConfig(),u=o.useSelector(o.selectMonacoFocusing),m=o.useContainer(),f=m?.getInstance(Ia),h=(0,l.useRef)(0),_=o.useSelector(o.selectIsPanelHistoryCollapsed),p=o.useSelector(o.selectActiveSettingsTab),S=o.useDispatch(),k=(0,l.useSyncExternalStore)((0,l.useCallback)(L=>r?.subscribe(L)??(()=>{}),[r]),()=>r?.recoveryFacts()),w=d?.revisionService===!0,v=k?.isRecovering===!0,A=k?.applied,x=(0,l.useCallback)(()=>{S(o.markAppearanceNeedsUpdate());const L=e?.renderGuid,I=e?.preheader,j=e?.subject;L&&(I||j)&&f?.reassert({...I?{preheader:I}:{},...j?{subject:j}:{}})},[S,f,e?.preheader,e?.subject,e?.title,e?.common_styles,e?.renderGuid,t,r]);(0,l.useEffect)(()=>()=>{clearTimeout(h.current),r?.endForcedHeaders()},[i,r]),(0,l.useEffect)(()=>{w&&v&&c.info({key:gr,title:a("Loading latest changes..."),duration:0})},[w,v,c,a]);const K=(0,l.useRef)({emailId:void 0,seq:0});(0,l.useEffect)(()=>{if(!A||k?.emailId!==i||(K.current.emailId!==i&&(K.current={emailId:i,seq:0}),A.seq<=K.current.seq))return;K.current={emailId:i,seq:A.seq},x();const{phase:L}=A;!w||L==="normal"||(L==="found"?c.success({key:gr,title:a("Changes loaded"),duration:3}):L==="timeout"?c.warning({key:gr,title:a("Locally saved version applied"),description:a("Syncing with the server in the background..."),duration:5}):L==="bg"&&c.info({key:"AUTOSAVE_BG_SYNCED",title:a("Email synced with the server"),duration:3}))},[w,A,k?.emailId,i,x,c,a]),(0,l.useEffect)(()=>{if(!n)return;const L=I=>{I.preventDefault()};return window.addEventListener("beforeunload",L),()=>window.removeEventListener("beforeunload",L)},[n]);const Z=!_||u||p==="Discuss",M=m?o.provideAutosaveUiFacts(m):void 0;(0,l.useEffect)(()=>{M?.set({...M.get()??{isUserBusy:!1,saveContext:{}},isUserBusy:Z})},[M,Z])}var Qf=class extends Error{label;timeoutMs;constructor(e,t){super(`[${e}] timed out after ${t}ms`),this.name="OperationTimeoutError",this.label=e,this.timeoutMs=t}};function Xf(e,t,n){return t<=0?e:new Promise((r,i)=>{let a=!1,c;const d=u=>{a||(a=!0,c!==void 0&&(clearTimeout(c),c=void 0),u())};c=setTimeout(()=>{d(()=>i(new Qf(n,t)))},t),e.then(u=>{d(()=>r(u))},u=>{d(()=>i(u))})})}var Jf=2,vo=Symbol("sandbox:frame-replaced");function sn(e,t,n,r,i,a,c){const d=`sandbox:${t}`,u=a?.getSandboxTimeoutMs(t)??o.DEFAULT_SANDBOX_OP_TIMEOUT_MS[t],m=()=>{let S=Xf(e.sendAsync(n,r),u,d);return S=g.raceWithAbortSignal(S,a?.signal),o.logShowPipelineWait(d,S,i)};if(t==="INIT_START"&&Ki(e)){const S=a?.getSandboxReadyTimeoutMs()??2e4,k=e,w=v=>{const A=Qi(k,S,a?.signal);return o.logShowPipelineWait("sandbox:INIT_START:ready-wait",A,i).then(()=>{if(!c||v<=0)return m();const x=c.getGeneration();let K;const Z=new Promise((L,I)=>{K=c.onChange(()=>{c.getGeneration()!==x&&I(vo)})}),M=m();return M.catch(()=>{}),Promise.race([M,Z]).finally(()=>K?.()).catch(L=>{if(L!==vo)throw L;return{...i},w(v-1)})})};return w(Jf)}if(!c)return m();const f=c.getGeneration();let h;const _=new Promise((S,k)=>{h=c.onChange(()=>{c.getGeneration()!==f&&k(vo)})}),p=m();return p.catch(()=>{}),Promise.race([p,_]).finally(()=>h?.()).catch(S=>{throw S===vo&&{...i},S})}function La(e,t,n,r){return{html:e,guid:t,...Object.keys(n).length>0?{templateDirectivesPolicy:n}:{},...r!==void 0?{rev:r}:{}}}var Oa="self-init:";function Zf(e){return e.startsWith(Oa)}function Ma(e,t){const n=e.getActiveShowRequest();return Zf(t)?n===null:n?.showId===t&&e.hasPendingShow(t)}function eh(e){const t=()=>e.initPipeline(),n=e.messageService,r=()=>e.waitScope?.()??t();let i="";const a=()=>e.readDocument()?o.readDocumentContent(e.readDocument()):i,c=()=>rn(e.container).editorPolicy,d=()=>e.readEmail(),u=()=>{const m=d();return{...m,id:e.isTemplate()||m.isNew?void 0:m.id,html:a()}};return{readContent:a,publicEmail:u,sendInitStart:()=>sn(n,"INIT_START",o.EVENT_TYPES.SANDBOX_INIT_START,{guid:d().renderGuid},void 0,r()),sendInited:()=>sn(n,"INITED",o.EVENT_TYPES.SANDBOX_INITED,{guid:d().renderGuid},void 0,r()),async sendContent(){const m=d(),{html:f,hasBrowserExtensionArtifacts:h}=o.prepareEmailHtmlForEditor(m?.html||"");h&&e.events.browserExtensionDetected(),o.loadDocumentContent(e.readDocument(),f),i=f,await sn(n,"SET_ENTITY",o.EVENT_TYPES.SANDBOX_SET_ENTITY,La(a(),m.renderGuid,c(),e.readDocument()?.get().version),{guid:m.renderGuid,emailId:m.id??null},r())},refreshContent:()=>sn(n,"SET_ENTITY",o.EVENT_TYPES.SANDBOX_SET_ENTITY,La(a(),d().renderGuid,c(),e.readDocument()?.get().version),void 0,r()),sendPreheader:async()=>{const m=d();if(m.preheader!==void 0)return sn(n,"PREHEADER",o.EVENT_TYPES.SANDBOX_PREHEADER_UPDATE,{value:m.preheader,guid:m.renderGuid,force:!0},void 0,r())},sendSubject:async()=>{const m=d();if(m.subject!==void 0)return sn(n,"SUBJECT",o.EVENT_TYPES.SANDBOX_SUBJECT_UPDATE,{value:m.subject,guid:m.renderGuid,force:!0},void 0,r())},revealFilled:()=>e.revealFilled?.()??Promise.resolve(),showFilled:m=>e.showFilled?.(m),readTarget:()=>e.readTarget?.(),fireWillInit:()=>e.events.willInit(u()),fireInit(m,f){if(!Ma(t(),m)){t().getActiveShowRequest()?.showId;return}const h=d();h.id,h.renderGuid,t().completeShow(m),o.writeEmailAttributes(e.readDocument(),{is_inited:!0},{source:"system"});const _=u();return f&&(_.reset=!0),e.events.inited(_)},fireEmailChanged(){e.events.emailChanged(u())},fireContentChanged(){e.events.contentChanged(a())}}}function th(e){const t=()=>e.initPipeline();let n=!1,r,i,a,c=0,d;const u=eh({...e,waitScope:()=>({getSandboxTimeoutMs:w=>t().getSandboxTimeoutMs(w),getSandboxReadyTimeoutMs:()=>t().getSandboxReadyTimeoutMs(),signal:d?.signal??t().signal})});let m;const f=(w,v)=>{if(m===w)return;m=w;const A=c;setTimeout(()=>{c!==A||t().signal.aborted||S(w,v).catch(()=>{})},0)},h=()=>{d?.abort(),d=void 0};let _;const p=()=>{const w=t().signal;w!==_&&(_?.removeEventListener("abort",h),_=w,w.addEventListener("abort",h))};async function S(w,v){const A=++c;h(),d=new AbortController,p();const x=()=>c!==A,K=u.readTarget(),Z=t().generation,M=()=>Z===t().generation&&!t().signal.aborted,L=v?"init:reset-":"init:";if(!v){const z=u.publicEmail();z?.id,z?.renderGuid,z?.preheader}let I=!1,j=!1;try{n=!0,await u.sendInitStart(),u.fireWillInit(),await(v?u.refreshContent():u.sendContent()),I=!0,v||u.publicEmail()?.id;try{await u.sendPreheader()}catch(z){o.logShowPipelineError(`${L}preheader-failed`,{showId:w,error:String(z)})}try{await u.sendSubject()}catch(z){o.logShowPipelineError(`${L}subject-failed`,{showId:w,error:String(z)})}if(x()||u.showFilled(K),await u.sendInited(),j=!0,i===w){const z=e.readSandboxGeneration?.()??a;z!==void 0&&(r=z)}await u.revealFilled()}catch(z){throw x()||o.logShowPipelineError(`${L}failed`,{showId:w,contentApplied:I,sandboxInitedAcked:j,superseded:!1,...e.describeSurface?.(),error:String(z)}),!x()&&Ma(t(),w)&&t().failShow(w,z),z}finally{k(w,v,L,{superseded:x(),sessionGeneration:Z,contentApplied:I,sandboxInitedAcked:j,commit:M()})}}function k(w,v,A,x){const{superseded:K,contentApplied:Z,sandboxInitedAcked:M}=x;if(K){`${A}`;return}M&&x.commit?u.fireInit(w,v||void 0):M?o.logShowPipelineError(`${A}aborted (stale session or signal)`,{showId:w,sessionGeneration:x.sessionGeneration,currentGeneration:t().generation,aborted:t().signal.aborted}):Z?o.logShowPipelineError(`${A}aborted (sandbox INITED ack missing)`,{showId:w}):o.logShowPipelineError(`${A}aborted (content not applied)`,{showId:w}),n=!1,d=void 0,!M&&i===w&&(i=void 0,r===a&&(r=void 0)),!M&&Z&&f(w,v)}return{channel:u,isEventsLocked:()=>n,filledGeneration:()=>r,markFilled:w=>{r=w},lastCorrelation:()=>i,markCorrelation:w=>{i=w},bumpRunSeq:()=>{c+=1},noteSandboxGeneration:w=>{a=w},fill:w=>S(w,!1),refill:w=>S(w,!0),stop:()=>{c+=1,h(),n=!1,_?.removeEventListener("abort",h),_=void 0}}}function nh(e,t,n){if(!e?.renderGuid||!e.showId||e.showId!==t.showId)return!1;if(t.isNew)return e.id==null;const r=t.emailId??t.navId;return r!=null&&String(e.id??"")!==String(r)?!1:Na(e,n)}function Na(e,t){return t?e?.id==null?!1:String(e.id)===String(t):!0}function oh(e){const{pipeline:t,readEmail:n,readDocument:r,readRouteEmailId:i,readSandboxGeneration:a}=e,c=f=>{const h=n(),_=i();if(!nh(h,f,_)){f.showId,f.navId,f.emailId,h?.id,h?.showId,h?.renderGuid;return}f.showId,h?.id,h?.renderGuid,t.markFilled(a()),t.markCorrelation(f.showId),t.fill(f.showId).catch(()=>{})};return{showRequested:f=>{c(f)},showRequestIdentityChanged:()=>{const f=e.initPipeline().getActiveShowRequest();f&&c(f)},selfInitChanged:()=>{if(e.initPipeline().getActiveShowRequest())return;const f=a();if(t.filledGeneration()===f)return;const h=n(),_=i();if(!h?.renderGuid||!Na(h,_))return;const p=`${Oa}${h.renderGuid}`;t.markFilled(f),t.markCorrelation(p);const S=r()?.isReady()===!0;h.id,h.renderGuid,(S?k=>t.refill(k):k=>t.fill(k))(p).catch(()=>{t.lastCorrelation()===p&&t.markFilled(void 0)})},saasChanged:()=>{const f=n();f?.renderGuid,f?.showToken,f?.id}}}var Da=g.createIdentifier$1("canvas.sandboxFill"),rh=class extends Error{showId;constructor(e,t){super(`[emailmaker] show() timed out after ${t}ms waiting for editor init (showId=${e}). Check earlier console errors: wrong host-plugin publicPath (chunks return HTML), mount element removed without destroy(), or sandbox init never completed. Search for [show-pipeline] and [AMD] messages.`),this.name="ShowPipelineTimeoutError",this.showId=e}},ih=class{_activeRequest=null;_pending=new Map;_listeners=new Set;getActiveShowRequest(){return this._activeRequest}onShowRequested(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}requestShow(e,t,n){return this._rejectPending(g.createAbortError("Superseded by newer show()")),n.aborted?Promise.reject(g.createAbortError(n.reason)):(this._activeRequest=e,new Promise((r,i)=>{const a=setTimeout(()=>{this._settle(e.showId,()=>{i(new rh(e.showId,t))})},t);a.unref?.();const c=()=>{this._settle(e.showId,()=>{i(g.createAbortError(n.reason))})};n.addEventListener("abort",c,{once:!0});const d=()=>{clearTimeout(a),n.removeEventListener("abort",c)};this._pending.set(e.showId,{request:e,resolve:r,reject:i,timeoutId:a,dispose:d});for(const u of this._listeners)u(e)}))}completeShow(e){this._settle(e,t=>{t.resolve()})}hasPendingShow(e){return this._pending.has(e)}failShow(e,t){this._settle(e,n=>{n.reject(t)})}rejectAll(e){this._rejectPending(e),this._activeRequest=null}_settle(e,t){const n=this._pending.get(e);n&&(n.dispose(),this._pending.delete(e),this._activeRequest?.showId===e&&(this._activeRequest=null),t(n))}_rejectPending(e){for(const[,t]of this._pending)t.dispose(),t.reject(e);this._pending.clear()}};function ah(e,t){return{contentReady:t.contentReady??e?.contentReady,sandboxReady:t.sandboxReady??e?.sandboxReady,sandbox:t.sandbox?{...e?.sandbox,...t.sandbox}:e?.sandbox}}function sh(e){if(!e||!(e.contentReady!==void 0||e.sandboxReady!==void 0||e.sandbox!==void 0))return;const t=o.resolveContentReadyTimeoutMs(e),n=o.resolveSandboxReadyTimeoutMs(e),r=o.resolveSequentialSandboxOpBudgetMs(e.sandbox);t<n+r}var lh=class{_controller=new AbortController;_externalSignalDisposable=new g.Disposable;_sessionChangeListeners=new Set;_showRegistry=new ih;_timeouts;_generation=0;_sessionStarted=!1;get signal(){return this._controller.signal}get generation(){return this._generation}get contentReadyTimeoutMs(){return o.resolveContentReadyTimeoutMs(this._timeouts)}getSandboxTimeoutMs(e){return o.resolveSandboxOpTimeoutMs(e,this._timeouts?.sandbox)}getSandboxReadyTimeoutMs(){return o.resolveSandboxReadyTimeoutMs(this._timeouts)}bumpGeneration(){this._generation+=1}getActiveShowRequest(){return this._showRegistry.getActiveShowRequest()}onShowRequested(e){return this._showRegistry.onShowRequested(e)}requestShow(e){return this._showRegistry.requestShow(e,this.contentReadyTimeoutMs,this._controller.signal)}completeShow(e){this._showRegistry.completeShow(e)}hasPendingShow(e){return this._showRegistry.hasPendingShow(e)}failShow(e,t){this._showRegistry.failShow(e,t)}rejectAllPendingShows(e){this._showRegistry.rejectAll(e)}onSessionReplaced(e){return this._sessionChangeListeners.add(e),()=>{this._sessionChangeListeners.delete(e)}}configure(e){e.timeouts!==void 0&&(this._timeouts=ah(this._timeouts,e.timeouts),sh(this._timeouts));const t=e.replaceSession===!0||!this._sessionStarted||e.timeouts!==void 0||e.signal!==void 0;this._sessionStarted=!0,t&&(this._replaceSessionController(),this.bumpGeneration()),(e.signal!==void 0||t)&&this._linkExternalSignal(e.signal)}abort(e){const t=e??g.createAbortError("Editor instance destroyed");this._showRegistry.rejectAll(t),this._controller.signal.aborted||(this._controller.abort(t),this.bumpGeneration()),this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new g.Disposable}_replaceSessionController(){this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new g.Disposable,this._showRegistry.rejectAll(g.createAbortError("Init session replaced")),this._controller.signal.aborted||this._controller.abort(g.createAbortError("Init session replaced")),this._controller=new AbortController,this._emitSessionReplaced()}_emitSessionReplaced(){for(const e of this._sessionChangeListeners)e()}_linkExternalSignal(e){if(!e)return;if(e.aborted){this._controller.signal.aborted||(this._controller.abort(e.reason??g.createAbortError()),this.bumpGeneration());return}const t=()=>{this._controller.signal.aborted||(this._controller.abort(e.reason??g.createAbortError()),this.bumpGeneration())};e.addEventListener("abort",t),this._externalSignalDisposable.addDispose(()=>{e.removeEventListener("abort",t)})}},ch=(()=>{const e=new lh;return e.configure({}),e})();function yr(){const e=o.useStore();return(0,l.useMemo)(()=>g.getContainer(e)?.getInstance(g.INIT_PIPELINE_ID)??ch,[e])}function dh(e){const t=yr(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>{let r;const i=()=>{r?.();const c=t.signal;if(c.aborted){n.current();return}const d=()=>n.current();c.addEventListener("abort",d),r=()=>c.removeEventListener("abort",d)};i();const a=t.onSessionReplaced(i);return()=>{a(),r?.()}},[t])}function uh(e){const t=yr(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>t.onShowRequested(r=>n.current(r)),[t])}var mh=(e,t,n,r,i)=>{const a=o.useStore(),c=o.useMessageService(),d=yr(),u=(0,l.useRef)(d);u.current=d;const m=o.useEventEmitter(g.events.WILL_EMAIL_INIT_ID),f=o.useEventEmitter(g.events.ON_EMAIL_INIT_ID),h=o.useEventEmitter(g.events.ON_CONTENT_CHANGED_ID),_=o.useEventEmitter(g.events.ON_EMAIL_CHANGED_ID),p=o.useEventEmitter(g.events.ON_BROWSER_EXTENSION_DETECTED_ID),S=e?.id!==void 0,k=e?.showToken??0,w=k,v=(0,l.useRef)(w);v.current=w;const A=(0,l.useRef)(void 0);A.current=e;const[x,K]=(0,l.useState)(()=>o.getSandboxGeneration(c)),Z=(0,l.useRef)(x);Z.current=x,(0,l.useEffect)(()=>(K(o.getSandboxGeneration(c)),o.onSandboxGenerationChange(c,()=>{K(o.getSandboxGeneration(c))})),[c]);const M=(0,l.useRef)(r);M.current=r;const L=(0,l.useRef)(t);L.current=t;const I=i?.standalone?void 0:g.getContainer(a)?.getInstance(Da),j=!I,z=(0,l.useRef)(I?.pipeline);z.current||(z.current=th({container:g.getContainer(a),messageService:c,initPipeline:()=>u.current,readDocument:()=>M.current,readEmail:()=>A.current,isTemplate:()=>!!L.current,readSandboxGeneration:()=>Z.current,events:{willInit:q=>m.fire(q),inited:q=>f.fire(q),contentChanged:q=>h.fire(q),emailChanged:q=>_.fire(q),browserExtensionDetected:()=>p.fire()}}));const B=z.current,$=(0,l.useRef)(n);$.current=n;const de=(0,l.useRef)(void 0);j&&!de.current&&(de.current=oh({pipeline:B,initPipeline:()=>u.current,readEmail:()=>A.current,readDocument:()=>M.current,readRouteEmailId:()=>$.current,readSandboxGeneration:()=>Z.current}));const pe=de.current;B.noteSandboxGeneration(Z.current),(0,l.useEffect)(()=>{if(j)return()=>z.current?.stop()},[j]),(0,l.useEffect)(()=>{I?.setRoute({emailId:n,isTemplate:t})},[I,n,t]),(0,l.useEffect)(()=>{const q=A.current;if(j&&!B.isEventsLocked()&&e?.renderGuid===q?.renderGuid&&q?.is_inited&&q){const ee=B.channel.readContent();_.fire({...q,id:t||q.isNew?void 0:q.id,html:ee})}},[B,e?.renderGuid,e?.preheader,e?.common_styles,e?.meta,e?.subject,e?.utm_parameters?.utm_campaign||"",e?.utm_parameters?.utm_content||"",e?.utm_parameters?.utm_medium||"",e?.utm_parameters?.utm_source||"",e?.utm_parameters?.utm_term||"",_,t,j]),(0,l.useEffect)(()=>{if(j){const q=o.subscribeToContent(r,()=>{const ee=A.current;if(!B.isEventsLocked()&&e?.renderGuid===ee?.renderGuid&&ee){const Fe=B.channel.readContent();h.fire(Fe),_.fire({...ee,id:t||ee.isNew?void 0:ee.id,html:Fe})}});return()=>q.dispose()}},[r,B,h,_,e,t,j]),dh(()=>{j&&B.stop()}),uh(q=>{pe?.showRequested(q)}),(0,l.useEffect)(()=>{pe?.showRequestIdentityChanged()},[pe,d,e?.renderGuid,e?.showId,e?.id,n]),(0,l.useEffect)(()=>{pe?.selfInitChanged()},[pe,d,e?.renderGuid,e?.showId,e?.id,n,r,x]),o.usePrevious(()=>{pe?.saasChanged()},[e?.renderGuid,k,S,pe]),Zo(async()=>{if(!j)return;const q=d.getActiveShowRequest()?.showId;q&&(B.markFilled(Z.current),await B.refill(q))},{async:!0})};function ph(e){const t=o.useEvent(g.events.ON_EMAIL_INIT_ID);(0,l.useEffect)(()=>{if(!e)return;const n=t(()=>e.clear());return()=>n.dispose()},[e,t])}function fh(e,t){const n=o.useEventEmitter(g.events.ON_DOCUMENT_SESSION_CHANGE);(0,l.useEffect)(()=>{n.fire({document:e,history:t})},[e,t,n])}function hh({templateEmailId:e,templateEmail:t,newEmail:n}){return e?t:n}function gh({routeEmailId:e,draft:t}){const n=o.useStore();(0,l.useRef)(0),(0,l.useEffect)(()=>{},[n,e,t])}function yh(e,t){return t}function _h(e){return!1}function bh({documents:e,push:t,projectId:n,subscription:r}){(0,l.useEffect)(()=>e.onSaved(i=>{i.intent==="publish"&&t({event:"save",action:"save_email",email_id:i.serverId??void 0,project_id:n,subscription:r})}),[e,t,n,r])}function vh(e){const t=o.useStore();(0,l.useEffect)(()=>{},[t,e])}function Eh(e,t,n){const r=o.useAppNavigate(),i=o.useContainer();(0,l.useEffect)(()=>{},[r,e,t,n,i])}function Sh(e){if(!e)return{status:"unknown"};if("status"in e){const t=e.data,n=t&&typeof t=="object"?t.message:void 0,r=typeof n=="string"?n:typeof t=="string"?t:void 0;return{status:String(e.status),message:r}}return{status:e.name??"unknown",message:e.message}}function Fa(e,t,n){const{status:r,message:i}=Sh(n);o.reportMessage(`Failed to load ${e} ${t??"?"}: ${r}`,{origin:"entity-load-error",tags:{mechanism:"entity-load-error",entity_type:e,http_status:r},level:"error",contexts:{entity_load_error:{entityType:e,entityId:t,status:r,message:i,url:window.location.href}}})}var{Content:wh}=y.ui_kit$Layout,kh={paddingTop:"40px"},Ch=()=>{const{__:e}=o.useI18n(),{owner:t,admin:n}=Qn(),r=o.useDispatch(),i=Vo(),a=o.useAppNavigate(),{modal:c}=y.ui_kit$App.useApp(),d=o.useAppConfig(),u=o.useRootElement(),m=o.useCookieManager(),f=o.useMessageService(),{emailId:h,preview:_}=o.useRouteParams(),p=o.useEditorProjectId(),S=o.useAppSearchParams(),k=o.useSelector(o.selectIsCodeMode),w=o.useSelector(o.selectActiveModal),v=o.useCurrentUser(),A=o.useProjectData(),x=(0,l.useMemo)(()=>o.createNewEmailDraft(A?{id:Number(A.id),title:A.name}:void 0),[A]),K=o.useSelector(o.selectIsGlobalLoading),[Z]=o.useLazyGetMeQuery(),{isSuccess:M,data:L}=o.useGetSubscriptionsQuery(),I=Wf(),[j,z]=(0,l.useState)(!1),[B,$]=(0,l.useState)(!1),[de,pe]=(0,l.useState)(),[q,ee]=(0,l.useState)(null),[Fe,ve]=(0,l.useState)(!1),[et,Ee]=(0,l.useState)(!1),[fe,Q]=(0,l.useState)(!1),[me,ae]=(0,l.useState)(!1),[se,Ie]=(0,l.useState)(!1),Ce=(0,l.useRef)(),{confirm:Be}=c,{counters:J,subscription:ye}=v,Te=J?.emails_counter;m.get(o.APP_COOKIES.em_template_email);const he=S.get("template")||!B&&!h&&m.get(o.APP_COOKIES.em_new_email),{isSuccess:je,isLoading:ze,isError:C,error:T,data:P}=Gf(h?void 0:he),N=hh({templateEmailId:he,templateEmail:P,newEmail:x});gh({routeEmailId:h,draft:N});const{document:D,email:b,error:W}=o.useOpenEmail(),Pe=b?.id!=null?String(b.id):void 0,Ae=yh(h,Pe);(0,l.useEffect)(()=>{},[h,Pe,D,he]),Eh(h,b?.id,p);const Qe=o.useStore(),Ge=o.getEmailDocuments(g.getContainer(Qe)),Ze=(0,l.useCallback)((ce,we)=>Ge.save(ce,we),[Ge]),mt=(0,l.useCallback)(()=>Ge.saveState(),[Ge]),vt=o.usePushToDataLayer();bh({documents:Ge,push:vt,projectId:p,subscription:ye?.post_title}),(0,l.useEffect)(()=>{!B&&b?.id&&$(!0)},[$,B,b?.id]);const ft=Ge.history();fh(D,ft),ph(ft),mh(b,_h(h),Ae,D);const lt=Jo({document:D,history:ft});Kf(b,D,Ge.saveState().saving,Ge),vh(p),(0,l.useEffect)(()=>{o.injectEmailRightsResolver(g.getContainer(Qe),ce=>!!(t||n||v.id?.toString()===ce?.author?.toString()))},[Qe,t,n,v.id]);const G=tp({email:b,save:Ze,saveState:mt,documentSession:D}),{outdatedBlocks:Y,isOpen:ne,close:ue}=Sf({projectId:p,document:D});Yf({projectId:p,project:A,emailProjectId:b?.project,parentEmailId:b?.parent_email});const ge=w===o.MODALS.ADD_NEW_EBLOCK_MODAL,We=kn(ge),Ve=kn(fe),{isPromptOpen:at,isConverting:Bt,progress:Me,isErrorOpen:Xe,errorMessage:ie,confirmConversion:te,cancelPrompt:U,retryConversion:le,closeError:xe,neverSuggestAgain:Se,setNeverSuggestAgain:Ne}=Uf(),He=W??(he?T:void 0),Ue=!!He,rt=!b&&!Ue,fn=!!b;(0,l.useEffect)(()=>{Ue&&He&&Fa("email",h||he,He)},[Ue,He,h,he]),(0,l.useEffect)(()=>{he&&je&&($(!0),S.set({}))},[he,je,S]),(0,l.useEffect)(()=>(r(o.switchIsPanelHistoryCollapsed(!0)),()=>r(o.switchIsPanelHistoryCollapsed(!0))),[r]);const Lt=(0,l.useCallback)(()=>{i.toggle(),r(o.resetPanes())},[r,i]);(0,l.useEffect)(()=>{_&&!k&&Lt()},[k,_,Lt]),(0,l.useEffect)(()=>{document.body.classList.add("editor"),r(o.setActiveSettingsTab(o.BUILD))},[r]),(0,l.useEffect)(()=>{!j&&Te<3&&(Z(),z(!0))},[Z,Te,j]);const ct=(0,l.useCallback)(()=>{lt.undo()},[lt]),Et=(0,l.useCallback)(()=>{lt.redo()},[lt]);(0,l.useEffect)(()=>{Ce.current!==b?.id&&(lt.clear(),Ce.current=b?.id)},[b,lt]);const Ot=(0,l.useCallback)(ce=>{(window.navigator.appVersion.indexOf("Mac")&&ce.metaKey||ce.ctrlKey)&&ce.code==="KeyZ"&&(ce.preventDefault(),ce.shiftKey?Et():ct())},[ct,Et]);(0,l.useEffect)(()=>()=>{r(o.resetPanes()),r(o.closeModal()),r(o.closeModal$1()),r(o.resetElementHistorySlice())},[r]);const jn=(0,l.useCallback)(ce=>{const we=()=>{r(o.openModal(o.MODALS.ADD_NEW_EBLOCK_MODAL))},De=ce.data.operation,nt=ce.data,Le=ce.data.action,Kt=u.querySelector("#iframe-scroll-top"),Ut=u.querySelector("#iframe-scroll-bottom");if(De===o.EVENT_TYPES.APPLICATION_EBLOCK_ADD){const dt=nt.settings?.emBlockId;dt?ee({html:nt.data,emBlockId:String(dt)}):(pe(nt.data),we())}if(De===o.EVENT_TYPES.APPLICATION_ACTION&&(Le==="undo"?ct():Le==="redo"&&Et()),De===o.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_SHOW){const dt=u.querySelector("#email_iframe_slot"),Nn=document.body.getBoundingClientRect().height,$t=dt.getClientRects()[0];$t.top<0&&(Kt.style.display="block"),$t.top+$t.height>Nn&&(Ut.style.display="block")}De===o.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_HIDE&&(Kt.style.display="none",Ut.style.display="none")},[r,ct,Et,u]);o.useListenPostMessage(jn);const Ln=ce=>{if(ce.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const we=ce.dataTransfer,De=(we?Array.from(we.types||[]):[]).includes(o.DND_SOCIAL_LIST_REORDER_MIME),nt=typeof ce.composedPath=="function"?ce.composedPath():[];ce.target?.closest?.(".selected-social-form")||nt.some(Le=>Le&&Le.nodeType===1&&typeof Le.classList?.contains=="function"&&Le.classList.contains("selected-social-form"))||De||(ce.preventDefault(),ce.target&&f.send({operation:o.EVENT_TYPES.SANDBOX_DRAG_CANCEL}),u.querySelectorAll(".em-dragging-element").forEach(Le=>{Le.classList.remove("em-dragging-element")}))},hn=(0,l.useRef)({});(0,l.useEffect)(()=>{const ce=new g.Disposable,we=De=>nt=>hn.current[De]?.(nt);return ce.addDisposable(o.addWindowListenerFromShadow(u,"drop",we("drop"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragover",we("dragover"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragstart",we("dragstart"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragend",we("dragend"))),()=>{ce.dispose()}},[u]),(0,l.useEffect)(()=>(window.addEventListener("keydown",Ot),()=>{window.removeEventListener("keydown",Ot)}),[Ot]);const On=ce=>{if(ce.preventDefault(),ce.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const we=u.querySelector("#iframe-scroll-top"),De=u.querySelector("#iframe-scroll-bottom"),nt=d.sidePanelFloating?u.querySelector("#pane-content-wrapper"):u.querySelector(".email-pane__col_preview"),Le=u.querySelector(".blocks-app").getBoundingClientRect().top,{height:Kt,top:Ut}=u.querySelector("#email_iframe_slot").getBoundingClientRect(),dt=nt.getBoundingClientRect().height;Ut>96?we.style.display==="block"&&(we.style.display="none"):(we.style.display==="none"||we.style.display==="")&&(we.style.display="block"),Kt-dt+Ut-Le<44?De.style.display==="block"&&(De.style.display="none"):De.style.display==="none"&&(De.style.display="block"),ce.target===we&&nt.scrollBy(0,-15),ce.target===De&&nt.scrollBy(0,15)},Mn=()=>{const ce=u.querySelector("#iframe-scroll-top"),we=u.querySelector("#iframe-scroll-bottom");ce&&we&&(ce.style.display="none",we.style.display="none"),u.querySelectorAll(".em-dragging-element").forEach(De=>{De.classList.remove("em-dragging-element")})},ht=ce=>{const we=ce.target,De=we instanceof Element?we:we.parentElement;if(!(De instanceof Element)||De.closest(".selected-social-form"))return;De.parentElement?.classList.add("em-dragging-element");const nt=!!De.closest(".blocks-search__result-wrapper");var Le=nt?o.cloneBlockPreviewForDrag(De.querySelector(".blocks-search__result-html")):De.cloneNode(!0);Le.classList.add("em-ghost-element"),Le.style.height=nt?"auto":"70px",Le.style.width=nt?"600px":"109px",Le.style.position="absolute",Le.style.top="0",Le.style.left="0",Le.style.zIndex="-1",De.appendChild(Le),ce.dataTransfer.setDragImage(Le,0,0),window.setTimeout(function(){Le.parentNode.removeChild(Le)},1e3)};hn.current={drop:Ln,dragover:On,dragstart:ht,dragend:Mn};const St=(0,l.useCallback)(()=>{Be({title:e("You reached the plan limit"),icon:(0,s.jsx)(o.EmIcons,{icon:"ExclamationCircleOutlined",component:y.icons$ExclamationCircleOutlined}),content:(0,s.jsx)("div",{style:{maxWidth:"330px"},children:e("Switch to a different plan to save more emails.")}),centered:!0,okText:e("Choose a plan"),cancelText:e("Continue without saving"),width:"unset",onOk(){a("/billing")},onCancel(){}})},[a,e,Be]);return(0,l.useEffect)(()=>{if(M&&L){const ce=L?.find(we=>we.id?.toString()===ye?.ID?.toString())?.limits?.emails_limit;ce&&Te>=ce&&!Fe&&!h&&t&&(St(),ve(!0))}},[L,M,ye,Te,Fe,St,h,t]),(0,l.useEffect)(()=>{const ce=f.onInit(()=>{f.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1})});return()=>ce.dispose()},[f]),(0,s.jsx)(o.DocumentSessionProvider,{document:D,history:ft,children:(0,s.jsx)(ya.Provider,{value:G,children:(0,s.jsxs)(y.ui_kit$Layout,{className:"email-page",children:[rt&&(0,s.jsx)(y.ui_kit$PageLoader,{}),!rt&&I.status==="pending"&&(0,s.jsx)(y.ui_kit$PageLoader,{}),I.status==="error"&&(0,s.jsx)(wh,{style:kh,children:(0,s.jsx)("div",{className:"container",children:(0,s.jsx)(y.ui_kit$Result,{status:"warning",title:e("Failed to load plan data"),subTitle:e("Editor features depend on your plan. Check your connection and try again."),extra:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:I.retry,children:e("Try again")})})})}),Ue&&He&&!1,b&&!rt&&I.status==="ready"&&(0,s.jsxs)(y.ui_kit$Layout,{className:"email-pane",children:[K&&(0,s.jsx)("div",{className:"email-pane__loader",children:(0,s.jsx)(y.ui_kit$PageLoader,{small:!0})}),(0,s.jsx)(Aa,{email:b,isCollaborationEditor:et}),(0,s.jsx)(Gm,{emailElement:b,isSuccess:fn,setIsCollaborationEditor:Ee,setIsShowAddAllBlocksModal:Q,triggerOpenSavedBlocksTab:me})]}),We&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(ju,{isModalVisible:ge,htmlContent:de,projectId:p,setIsShowAddAllBlocksModal:Q,setIsShowAddAllBlocksModalForNewEmail:Ie,currentEmail:b})}),(0,s.jsx)(bf,{open:ne,blocks:Y,projectId:p,onClose:ue}),(0,s.jsx)(wf,{open:!!q,html:q?.html,emBlockId:q?.emBlockId,onSaveAsNew:()=>{pe(q?.html),ee(null),r(o.openModal(o.MODALS.ADD_NEW_EBLOCK_MODAL))},onClose:()=>ee(null)}),Ve&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Lu,{isModalVisible:fe,currentEmail:b,setIsShowAddAllBlocksModal:Q,setTriggerOpenSavedBlocksTab:ae,autoStart:!se,projectId:p})}),(0,s.jsx)(If,{open:at,onConfirm:te,onCancel:U,neverSuggestAgain:Se,onNeverSuggestAgainChange:Ne}),(0,s.jsx)(Pf,{open:Bt,progress:Me}),(0,s.jsx)(xf,{open:Xe,message:ie,onRetry:le,onCancel:xe})]})})})};function Th(){const e=o.useStore(),t=o.getEmailDocuments(g.getContainer(e)),n=(0,l.useCallback)(r=>t.subscribe(r),[t]);return(0,l.useSyncExternalStore)(n,()=>!!t.current())}function Ih(e,t){const n=o.useStore(),r=o.useAppConfig(),i=o.useStorageProvider();(0,l.useRef)(new Set),(0,l.useEffect)(()=>{},[e,t,r,n,i])}var Ah=30;function xh(e){const t=o.useContainer(),n=o.useGetProjectQuery(+e,{skip:!e,refetchOnMountOrArgChange:Ah}),{isSuccess:r,isError:i,error:a,data:c,isFetching:d}=n;Ih(e,r),(0,l.useEffect)(()=>{t&&o.setCurrentProjectRefreshing(t,d)},[t,d]),(0,l.useEffect)(()=>{t&&r&&c&&String(c.id)===String(e)&&o.setCurrentProjectCard(t,c)},[r,c,t,e]),(0,l.useEffect)(()=>{i&&a&&Fa("project",e,a)},[i,a,e]);const u=o.useProjectData(),m=!!u&&String(u.id)===String(e);return{...n,projectReady:m}}var An=o.createApi({reducerPath:"promoApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:t,type:n},r)=>o.clientFromApi(r).promo.set_code_create({code:t,type:n})}),getPromoInfo:e.query({queryFn({code:t},n){return o.clientFromApi(n).promo.get_code_info_list({code:t})}})})}),{useCheckPromoMutation:gv,useGetPromoInfoQuery:yv}=An;function Ph(){const e=o.useContainer(),[t,n]=(0,l.useState)();return(0,l.useEffect)(()=>{if(!e)return;let r=!0;return o.getAppProject(e).then(i=>{r&&i!=null&&n(String(i))},()=>{}),()=>{r=!1}},[e]),t}var Rh=()=>{const e=o.useDispatch(),t=o.useCookieManager(),n=o.useCurrentUser(),r=o.useContainer();(0,l.useEffect)(()=>{const a=n?.code_editor;a&&r&&o.applyEditorOptions(r,a)},[n,r]),(0,l.useEffect)(()=>{const a=t.get(o.APP_COOKIES.em_token),c=t.get(o.APP_COOKIES.promocode);a&&c&&(e(An.endpoints.checkPromo.initiate({code:c,type:"by_link"})),t.remove(o.APP_COOKIES.promocode))},[e,t]),o.useNotifyCommand();const i=Th();return xh(Ph()),i?(0,s.jsx)(Jl,{hasEmail:!0,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Ch,{})})}):null};function jh(e,t){const n=(0,l.useRef)(!1);(0,l.useEffect)(()=>{!e||n.current||(n.current=!0,o.mark(o.PHASES.appVisible),t&&Ht(t).noteShellVisible())},[e,t])}var xn=new WeakMap,Lh="data-emailmaker-config-styles";function Oh(e){return typeof e=="string"?e.trim():""}function Ba(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function Mh(e,t,n){if(!e||typeof document>"u")return null;const r=Oh(t),i=xn.get(e),a=n||e;if(!r)return i&&(i.remove(),xn.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&Ba(a,i),i;const c=document.createElement("style");return c.setAttribute(Lh,"true"),c.textContent=r,Ba(a,c),xn.set(e,c),c}function _r(e){if(!e)return;const t=xn.get(e);t&&(t.remove(),xn.delete(e))}var Nh={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},Dh=({children:e,handleBeforeRender:t})=>{const[n,r]=(0,l.useState)(),i=o.useIsLocaleInited();jh(i,o.useContainer());const a=o.useAppConfig().styles,c=(0,l.useRef)(null),d=(0,l.useRef)(!1),u=(0,l.useRef)(void 0),m=o.useRootElement();return(0,l.useLayoutEffect)(()=>{d.current||(d.current=!0,t&&t())},[]),(0,l.useLayoutEffect)(()=>{if(!m){u.current&&(_r(u.current),u.current=void 0);return}u.current&&u.current!==m&&_r(u.current),Mh(m,a,c.current||void 0),u.current=m},[m,a]),(0,l.useLayoutEffect)(()=>()=>{u.current&&(_r(u.current),u.current=void 0)},[]),(0,s.jsxs)(y.ui_kit$StyleProvider,{container:o.findShadowRoot(m)||document.head,children:[(0,s.jsxs)("div",{ref:c,className:"App blocks-app blocks-plugin",style:i?{}:{visibility:"hidden"},children:[(0,s.jsx)(o.ModalRootContext.Provider,{value:n,children:e}),(0,s.jsx)("div",{ref:r,className:"blocks-modal-container"})]}),!i&&(0,s.jsx)(y.ui_kit$Space,{size:"large",style:Nh,children:(0,s.jsx)(y.ui_kit$Spin,{size:"large"})})]})};async function Fh({container:e,renderTarget:t,mapKey:n,disposable:r,chunkLoadedFire:i}){const a=await e.getInstanceAsync(g.STORE_ID);return new Promise(c=>{if(r.isDisposed()){c();return}const d=(0,rl.createRoot)(t),u=(0,s.jsx)(o.Provider,{store:a,children:(0,s.jsx)(ql,{onLoad:c,children:(0,s.jsx)(o.RootContext.Provider,{value:{element:n},children:(0,s.jsx)(y.ui_kit$StyleProvider,{container:o.isDocumentFragment(n)?document.head:n,children:(0,s.jsx)(o.LocaleProvider,{children:(0,s.jsx)(Dh,{handleBeforeRender:i,children:(0,s.jsx)(fl,{children:(0,s.jsx)(Hl,{children:(0,s.jsx)(Rh,{})})})})})})})})});d.render(u),r.addDispose(c),r.addDispose(()=>{try{d.unmount()}catch(m){if(m instanceof DOMException&&m.name==="NotFoundError"||m instanceof Error&&m.name==="NotFoundError"&&/removeChild/i.test(m.message)){o.logShowPipelineError("mount:unmount-dom-mismatch (host container was already removed)",{hint:"Usually harmless during host React StrictMode teardown. Ensure instance.destroy() runs before the host removes the mount container."});return}throw m}}),r.addDispose(()=>{g.ELEMENT_MAP.delete(n)})})}var _v="multiple init call on single HTMLELEMENT",Bh=zn(async e=>{let t=null,n=!1;const r=g.getEmitter(e,g.events.ON_CHUNKS_LOADED),i=e.getInstance(g.DISPOSABLE_ID);let a,c=!1;const d=()=>{c||(c=!0,o.mark(o.PHASES.chunksLoaded),r.fire())},u=(m,f)=>Fh({container:e,renderTarget:m,mapKey:f,disposable:a,chunkLoadedFire:d});return{instance:{getElement(){return t}},async setOptions(m){const f=e.getInstance(g.INIT_PIPELINE_ID),h=await g.waitForElement(m.element,i,f.signal),_=e.getInstance(g.INSTANCE_ID),p=!!m.hidden&&!!h;if(t===h&&n===p)return;const S=t===h&&n&&!p;n=p,i.addDisposable(r.event(()=>{m.handleChunkLoaded&&m.handleChunkLoaded()})),t&&g.ELEMENT_MAP.delete(t),h&&g.ELEMENT_MAP.has(h),a&&a.dispose(),a=i.addDisposable(new g.Disposable);const k=m.element!==void 0;if(o.setHeadlessMode(e,!h||p),o.setHiddenMount(e,p),!h){o.mark(o.MOUNT_HEADLESS_MARK);const v=document.createElement("div");v.style.position="absolute",v.style.left="-10000px",v.style.top="-10000px",v.style.width="1600px",v.style.height="1000px",document.body.appendChild(v),t=v,d(),a.addDispose(()=>{v.parentNode===document.body&&v.remove()});return}const w=o.findShadowRoot(h);if(w&&a.addDisposable(new pl({shadowRoot:w})),k&&h instanceof Element){const v=h;sl(v,()=>{i.isDisposed()||a?.isDisposed()||(o.logShowPipelineError("mount:detached (host removed element without destroy)",{elementId:v.id||null}),f.abort(al()))},a)}if(p){o.mark(o.MOUNT_HEADLESS_MARK),t=h,d();return}if(k&&h instanceof Element){const v=h,A=ul(v);t=v;const x=u(A,v);return ml(v,A,a),x}return t=h,u(h,h)},dispose(){a&&!a.isDisposed()&&a.dispose()}}});function br(e){return zn(async t=>(await t.getInstanceAsync(g.STORE_ID),await e(t)))}function Uh({html:e,renderGuid:t,...n},r){const{requested:i}=o.getCurrentProject(r);return o.filterUndefined({...n,code:rn(r).toOutputForm(e),project:i===void 0?n.project:i,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}function $h(e,t){return o.filterUndefined({...e,link:void 0,comment_status:void 0})}function zh({html:e,...t},n){return o.filterUndefined({...t,code:e,guid:void 0,compiled:o.filterUndefined({html:e,ampHtml:e&&""})})}var Ua=e=>{const t={current:Promise.resolve(),state:e,decorate:(n,r)=>(r&&(n=n.bind(r)),function(...i){const a=t.current.then(()=>n(...i));return t.current=a.then(c=>{t.state=c},c=>{}),a})};return t},Gh=g.createIdentifier$1("emailTemplate.reads");async function Wh(e,t){try{return await o.getRestEmailPortFactories(e).email(e).readEmail(t)??void 0}catch(n){o.logShowPipelineError("show:template-read-failed",{templateId:t,error:n instanceof Error?n.message:"неизвестная ошибка"});return}}function Hh(e,t){const n=e.getOrCreateInstance(Gh,()=>new Map),r=n.get(t);if(r!==void 0)return r;const i=Wh(e,t).then(a=>(a===void 0&&n.delete(t),a));return n.set(t,i),i}var kt=class extends g.Disposable{_event;_listener;_disposeEvent;constructor(e){super(),this._event=e}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),e?this._disposeEvent=this._event(e):this._disposeEvent=void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}};function Ct(e,t,n){const r=g.snapshot(e);return(i,a,c)=>{const d=r(async u=>{const m=t?t(u):u;c&&i.bind(c);const f=await i(m);return n?n(f):f},a,c);return()=>d.dispose()}}var bv=g.createIdentifier("application_block_inserted"),vv=g.createIdentifier$1("DataController"),Ev=g.createIdentifier$1("DataEvents"),qh=g.createIdentifier$1("plugin.startupShow");function Vh(e){return e.getInstance(qh)?.current??Promise.resolve()}var $a=br(async()=>({instance:{}})),za=br(async e=>({instance:{},async setOptions(){await Vh(e)}})),Sv=g.combineMixins([$a,za]),Ga=()=>({title:"",description:"",website:"",company_size:"",industry:"",email:"",phone:"",logo_url:""}),Yh={title:"title",description:"description",website:"website",company_size:"company_size",industry:"industry",email:"email",phone:"phone",logo_url:"logo"},Wa=e=>({...Ga(),title:e?.title??"",description:e?.description??"",website:e?.website??"",company_size:e?.company_size??"",industry:e?.industry??"",email:e?.email??"",phone:e?.phone??"",logo_url:e?.logo??""}),Ha=e=>(e??[]).filter(t=>!!t?.code).map(({code:t,label:n})=>({value:t,label:n??t})),Kh=e=>({company_sizes:Ha(e?.company_sizes),industries:Ha(e?.industries)}),wv=Object.keys(Ga()),qa="ProjectProfile",Pn=o.createApi({reducerPath:"projectSettingsProfileApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[qa],endpoints:e=>({getProjectProfile:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.profileList({id:String(t)}));return"error"in r?{error:r.error}:{data:Wa(r.data)}},providesTags:(t,n,r)=>[{type:qa,id:String(r)}]}),getProjectProfileOptions:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.profileOptionsList());return"error"in r?{error:r.error}:{data:Kh(r.data)}}}),updateProjectProfileField:e.mutation({async queryFn({projectId:t,field:n,value:r},i){const a={[Yh[n]]:r},c=o.v2ResultOf(await o.getClientV2(g.getContainer(i)).projects.profilePartialUpdate({id:String(t)},a));return"error"in c?{error:c.error}:{data:Wa(c.data)}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;n(Pn.util.updateQueryData("getProjectProfile",t,()=>i))}catch{}}})})}),{useGetProjectProfileQuery:kv,useGetProjectProfileOptionsQuery:Cv,useUpdateProjectProfileFieldMutation:Tv}=Pn,Va="ProjectStorage",Rn=o.createApi({reducerPath:"projectSettingsStorageApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Va],endpoints:e=>({getProjectStorage:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(g.getContainer(n)).projects.storageList({id:String(t)}));return"error"in r?{error:r.error}:{data:r.data}},providesTags:(t,n,r)=>[{type:Va,id:String(r)}]}),updateProjectStorage:e.mutation({async queryFn({projectId:t,body:n},r){const i=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).projects.storageUpdate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){const{data:i}=await r;n(Rn.util.upsertQueryData("getProjectStorage",t,i))}}),testProjectStorageConnection:e.mutation({async queryFn({projectId:t,body:n},r){const i=o.v2ResultOf(await o.getClientV2(g.getContainer(r)).projects.storageTestCreate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}}})})}),{useGetProjectStorageQuery:Iv,useUpdateProjectStorageMutation:Av,useTestProjectStorageConnectionMutation:xv}=Rn,Qh=class{http;constructor(e){this.http=e}settings_summary_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/settings-summary/${e}`,method:"GET",...n})},Ya=class{http;constructor(e){this.http=e}developer_credentials_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"GET",...n});developer_credentials_partial_update=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"PATCH",...n});developer_credentials_rotate_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/rotate-secret`,method:"POST",...n});developer_credentials_verify_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/verify-secret`,method:"POST",...n})},Xh=class{http;constructor(e){this.http=e}developer_kit_postman_collection_list=(e={})=>this.http.request({path:"/projects/v1/developer-kit/postman-collection",method:"GET",...e})},Jh=class{http;constructor(e){this.http=e}billing_context_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}`,method:"GET",...n});billing_context_payments_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}/payments`,method:"GET",query:t,...n})},Zh=class{http;constructor(e){this.http=e}usage_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}`,method:"GET",...n});usage_timeseries_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}/timeseries`,method:"GET",query:t,...n})},Ke={PLUGIN_INIT:"plugin_init",LINK_CHECK:"link_check",IMAGE_CHECK:"image_check",SPAM_ASSASSIN:"spam_assassin",AI_IMAGE:"ai_image",AI_WRITE:"ai_write",AI_REPHRASE:"ai_rephrase"},Zt={TODAY:"today",WEEK:"week",MONTH:"month",CUSTOM:"custom"},Pv=[Ke.PLUGIN_INIT,Ke.LINK_CHECK,Ke.IMAGE_CHECK,Ke.SPAM_ASSASSIN,Ke.AI_IMAGE,Ke.AI_WRITE],ln={current:0,limit:null},eg=()=>({pluginInit:{...ln},aiAssistant:{...ln},aiImage:{...ln},linkCheck:{...ln},imageCheck:{...ln},spamAssassin:{...ln}}),tt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Je=(e,t,n="")=>{for(const r of t){const i=e[r];if(typeof i=="string")return i;if(typeof i=="number"&&Number.isFinite(i))return String(i)}return n},Ft=(e,t,n=0)=>{for(const r of t){const i=e[r];if(typeof i=="number"&&Number.isFinite(i))return i;if(typeof i=="string"&&i.trim()&&Number.isFinite(Number(i)))return Number(i)}return n},vr=(e,t,n=!1)=>{for(const r of t){const i=e[r];if(typeof i=="boolean")return i}return n},Eo=(e,t)=>{for(const n of t){const r=e[n];if(r===null)return null;if(typeof r=="number"&&Number.isFinite(r))return r;if(typeof r=="string"&&r.trim()&&Number.isFinite(Number(r)))return Number(r)}return null},tg=new Set(Object.values(Ke)),ng=e=>tg.has(e)?e:null,en=e=>tt(e)&&"data"in e&&(e.ok===!0||typeof e.success=="boolean"||e.success===void 0)?e.data:e,cn=(e,t)=>{for(const n of t){const r=e[n];if(tt(r))return r}return null},og=(e,t)=>{for(const n of t){const r=e[n];if(!Array.isArray(r))continue;const i=r.filter(a=>typeof a=="string");if(i.length>0)return i}},rg=e=>tt(e)?{clientId:Je(e,["clientId","client_id"]),clientSecretConfigured:vr(e,["clientSecretConfigured","client_secret_configured"]),rotatedAt:Je(e,["rotatedAt","rotated_at"])||void 0,scopesSuggested:og(e,["scopesSuggested","scopes_suggested"])}:{clientId:"",clientSecretConfigured:!1},Ka=(e,t)=>{for(const n of t){const r=e[n];if(typeof r=="boolean")return r}},ig=e=>{const t=Ka(e,["pluginConnected","plugin_connected","connected","is_connected"]);if(t!==void 0)return t;for(const n of["plugin","developer_credentials","developerCredentials"]){const r=cn(e,[n]);if(!r)continue;const i=Ka(r,["connected","plugin_connected","is_connected"]);if(i!==void 0)return i;const a=Je(r,["clientId","client_id"]),c=vr(r,["clientSecretConfigured","client_secret_configured"]);if(a)return c}},ag=e=>{const t=en(e);if(!tt(t))return{};const n=cn(t,["members"]);return{myRole:Je(t,["myRole","my_role","role"])||(n?Je(n,["myRole","my_role","role"]):"")||void 0,pluginConnected:ig(t)}},sg=e=>tt(e)?{clientId:Je(e,["clientId","client_id"]),secret:Je(e,["secret","clientSecret","client_secret"])}:{clientId:"",secret:""},lg=e=>{if(!tt(e))return null;const t=Je(e,["event","type","key"]),n=ng(t);if(!n)return null;const r=e.delta??e.change??e.trend,i=r==null?null:typeof r=="number"&&Number.isFinite(r)?r:Number.isFinite(Number(r))?Number(r):null;return{event:n,total:Ft(e,["total","count","value"],0),delta:i}},Qa=e=>{if(!tt(e))return null;const t=Je(e,["date","day","x"]);if(!t)return null;const n={date:t},r=e.event_counts??e.eventCounts;if(tt(r)){for(const[i,a]of Object.entries(r))typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n}for(const[i,a]of Object.entries(e))i==="date"||i==="day"||i==="x"||i==="event_counts"||i==="eventCounts"||typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n},cg=e=>{const t=en(e);return tt(t)?(Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:Array.isArray(t.time_series)?t.time_series:Array.isArray(t.history)?t.history:[]).map(Qa).filter(n=>n!==null):[]},dg=e=>{if(!tt(e))return{current:0,limit:null};const t=Ft(e,["current","count","used","value","total"],0),n=Eo(e,["limit","max","quota","cap"]);return{current:t,limit:n===null?null:n}},dn=(e,t)=>{for(const n of t)if(n in e)return dg(e[n]);return{current:0,limit:null}},un={pluginInit:[Ke.PLUGIN_INIT,"plugin_init","pluginInit"],aiAssistant:["ai_assistant","aiAssistant","ai"],aiImage:[Ke.AI_IMAGE,"ai_image","ai_img","aiImg"],linkCheck:[Ke.LINK_CHECK,"link_check","linkCheck"],imageCheck:[Ke.IMAGE_CHECK,"image_check","imageCheck"],spamAssassin:[Ke.SPAM_ASSASSIN,"spam_assassin","spamAssassin","spam_check","spamCheck"]},Er=e=>{const t=eg(),n=en(e),r=tt(n)&&tt(n.usage)?n.usage:n;if(!tt(r))return t;const i=Ft(r,["operationsTotal","operations_total"],0),a=Ft(r,["operationsLast30d","operations_last_30d"],0),c=cn(r,["metrics","counters","limits","events","usage_by_event","usageByEvent"])??r;return{pluginInit:dn(c,un.pluginInit),aiAssistant:dn(c,un.aiAssistant),aiImage:dn(c,un.aiImage),linkCheck:dn(c,un.linkCheck),imageCheck:dn(c,un.imageCheck),spamAssassin:dn(c,un.spamAssassin),lastActivityAt:Je(r,["lastActivityAt","last_activity_at"])||void 0,operationsTotal:i>0?i:void 0,operationsLast30d:a>0?a:void 0}},Xa=(e,t)=>{const n=[{event:Ke.LINK_CHECK,total:e.linkCheck.current,delta:null},{event:Ke.IMAGE_CHECK,total:e.imageCheck.current,delta:null},{event:Ke.SPAM_ASSASSIN,total:e.spamAssassin.current,delta:null},{event:Ke.AI_IMAGE,total:e.aiImage.current,delta:null}],r=t?cg(t):[];return r.length>0?{cards:n,chart:r}:{cards:n,chart:[]}},ug=e=>{const t=en(e);if(!tt(t))return Xa(Er(e),e);const n=Array.isArray(t.cards)?t.cards:Array.isArray(t.summary)?t.summary:[],r=Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:[];return n.length>0||r.length>0?{cards:n.map(lg).filter(i=>i!==null),chart:r.map(Qa).filter(i=>i!==null)}:Xa(Er(t),t)},mg=e=>{if(!tt(e))return null;const t=Je(e,["id","payment_id"]);return t?{id:t,date:Je(e,["date","created_at","paid_at"]),amount:Ft(e,["amount","sum"],0),currency:Je(e,["currency"],"RUB"),status:Je(e,["status"],"unknown"),receiptUrl:Je(e,["receiptUrl","receipt_url","pdf_url"])||void 0}:null},pg=e=>{const t=en(e),n=tt(t)&&Array.isArray(t.payments)?t.payments:[];return{payments:n.map(mg).filter(r=>r!==null),page:tt(t)?Ft(t,["page"],1):1,perPage:tt(t)?Ft(t,["perPage","per_page"],20):20,total:tt(t)?Ft(t,["total"],n.length):n.length,totalPages:tt(t)?Ft(t,["totalPages","total_pages"],1):1}},fg=e=>{const t=en(e);if(!tt(t))return{viewerSeesBilling:!1};const n=cn(t,["endpoints"])??{},r=cn(t,["documentLinks","document_links"]),i=r?Object.fromEntries(Object.entries(r).filter(f=>typeof f[1]=="string")):void 0,a=Eo(t,["ownerUserId","owner_user_id"]),c=cn(t,["tariff","plan","subscription"]),d=Je(t,["planDescription","plan_description"])||(c?Je(c,["description","about","plan_description"]):"")||void 0,u=Eo(t,["planPrice","plan_price","price","amount"])??(c?Eo(c,["price","amount"]):null),m=Je(t,["planCurrency","plan_currency","currency"])||(c?Je(c,["currency"]):"")||void 0;return{viewerSeesBilling:vr(t,["viewerSeesBilling","viewer_sees_billing"]),ownerUserId:a??void 0,planName:Je(t,["planName","plan_name"])||void 0,planDescription:d,planPrice:u??void 0,planCurrency:m||void 0,endpoints:{limitsStats:Je(n,["limitsStats","limits_stats"])||void 0,subscriptionMe:Je(n,["subscriptionMe","subscription_me"])||void 0,payments:Je(n,["payments"])||void 0},documentLinks:i&&Object.keys(i).length>0?i:void 0}},hg={myRole:"owner"},gg=()=>({...hg}),yg={clientId:"rust-awkward-bear",clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"},Ja=()=>({...yg,clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"}),Za=Object.values(Ke),_g={[Ke.PLUGIN_INIT]:42,[Ke.LINK_CHECK]:-15,[Ke.IMAGE_CHECK]:28,[Ke.SPAM_ASSASSIN]:9,[Ke.AI_IMAGE]:6,[Ke.AI_WRITE]:-11,[Ke.AI_REPHRASE]:4},bg=(e,t)=>{const n={date:e};return Za.forEach((r,i)=>{const a=Math.sin(t*.65+i*.9),c=t*(i%2===0?.35:.2),d=2+i;n[r]=Math.max(0,Math.round(d+a*4+c))}),n},vg=e=>Za.map(t=>({event:t,total:e.reduce((n,r)=>n+(typeof r[t]=="number"?r[t]:0),0),delta:_g[t]})),Eg=({period:e,dateFrom:t,dateTo:n})=>{const r=(0,En.default)().startOf("day");if(e===Zt.WEEK)return{startDate:r.subtract(6,"day"),days:7};if(e===Zt.MONTH)return{startDate:r.subtract(29,"day"),days:30};if(e===Zt.CUSTOM&&t&&n){const i=(0,En.default)(t),a=(0,En.default)(n);return{startDate:i,days:Math.max(1,a.diff(i,"day")+1)}}return{startDate:r,days:1}},Sr=(e={period:Zt.TODAY})=>{const{startDate:t,days:n}=Eg(e),r=Array.from({length:n},(i,a)=>bg(t.add(a,"day").format("YYYY-MM-DD"),a));return{cards:vg(r),chart:r}},Rv=Sr({period:Zt.WEEK}),Sg={pluginInit:{current:0,limit:null},aiAssistant:{current:0,limit:null},aiImage:{current:42,limit:100},linkCheck:{current:128,limit:500},imageCheck:{current:64,limit:200},spamAssassin:{current:31,limit:150},lastActivityAt:"2026-05-02T12:00:00Z"},es={payments:[{id:"98765",date:"2026-05-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success",receiptUrl:"https://receipts.example/98765.pdf"},{id:"98764",date:"2026-04-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success"},{id:"98763",date:"2026-03-12T10:15:00+00:00",amount:990,currency:"RUB",status:"failed"}],page:1,perPage:20,total:3,totalPages:1},wg={viewerSeesBilling:!0,ownerUserId:1,planName:"Corporate",planDescription:"For fully addressing all necessary tasks in any field.",planPrice:3200,planCurrency:"RUB",endpoints:{limitsStats:"/wp-json/limits/v1/stats",subscriptionMe:"/wp-json/subscription/v2/me",payments:"/wp-json/projects/v1/billing-context/2581/payments"}},kg={info:{name:"EmailMaker Plugin Requests",schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:[]},Cg=e=>e,Tg=()=>!1,Ig=()=>!1,Ag=e=>e,mn="ProjectPlugin",xg=()=>({}).REACT_APP_PLUGIN_SETTINGS_USE_MOCK==="true",Vt=(e,t,n)=>e.error&&xg()?{data:n(t)}:o.transformResponseFn(n)(e),Pg=e=>Cg(rg(e)),Rg=e=>Ag(fg(e)),jg=({period:e,dateFrom:t,dateTo:n})=>{if(e===Zt.CUSTOM){const r={};return t&&(r.date_from=t),n&&(r.date_to=n),r}return{period:e??Zt.TODAY}},So=o.createApi({reducerPath:"projectSettingsPluginApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}),tagTypes:[mn],endpoints:e=>({getPluginSummary:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Qh]).settings_summary_detail({projectId:t}).then(r=>Vt(r,gg(),ag))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:r}]}),getPluginCredentials:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Ya]).developer_credentials_detail({projectId:t}).then(r=>Vt(r,Ja(),Pg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`credentials-${r}`}]}),rotatePluginSecret:e.mutation({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Ya]).developer_credentials_rotate_secret_create({projectId:t}).then(r=>Vt(r,{clientId:Ja().clientId,secret:"mock-rotated-secret"},sg))},invalidatesTags:(t,n,{projectId:r})=>[{type:mn,id:`credentials-${r}`}]}),getPostmanCollection:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Xh]).developer_kit_postman_collection_list({extraQuery:{project_id:String(t)}}).then(r=>Vt(r,kg,i=>en(i)??i))}}),getPluginAnalytics:e.query({queryFn({projectId:t,period:n,dateFrom:r,dateTo:i},a){const c={period:n,dateFrom:r,dateTo:i};return Tg()?Promise.resolve({data:Sr(c)}):o.getClient(g.getContainer(a)).request({path:`/projects/v1/usage/${t}/timeseries`,method:"GET",query:jg(c)}).then(d=>Vt(d,Sr(c),ug))}}),getPluginBillingContext:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Jh]).billing_context_detail({projectId:t}).then(r=>Vt(r,wg,Rg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`billing-${r}`}]}),getPluginUsage:e.query({queryFn({projectId:t},n){return g.getApi(g.getContainer(n),[Zh]).usage_detail({projectId:t}).then(r=>Vt(r,Sg,Er))}}),getPluginPayments:e.query({queryFn({projectId:t,page:n=1,perPage:r=20},i){return Ig()?Promise.resolve({data:es}):o.getClient(g.getContainer(i)).request({path:`/projects/v1/billing-context/${t}/payments`,method:"GET",query:{page:String(n),per_page:String(r)}}).then(a=>Vt(a,es,pg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`payments-${r}`}]})})}),{useGetPluginSummaryQuery:jv,useGetPluginCredentialsQuery:Lv,useRotatePluginSecretMutation:Ov,useLazyGetPostmanCollectionQuery:Mv,useGetPluginAnalyticsQuery:Nv,useGetPluginBillingContextQuery:Dv,useGetPluginPaymentsQuery:Fv,useGetPluginUsageQuery:Bv}=So,ts="EmailRaw",wo=o.createApi({reducerPath:"emailRawApi",tagTypes:[ts],baseQuery:o.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmailRaw:e.query({queryFn:function({emailId:t,secret_hash:n},r){return g.getApi(g.getContainer(r),[g.WpEmailApi]).email_detail({id:t},{extraQuery:{secret_hash:n}}).then(o.transformResponseFn(o.WpEmailToEmail))},providesTags:(t,n,r)=>[{type:ts,id:r}]})})}),{useGetEmailRawQuery:Uv}=wo,ko=o.createApi({reducerPath:"yandexAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateYandexToken:e.mutation({query:t=>({url:"/auth/yandex",method:"POST",body:t})})})}),{useValidateYandexTokenMutation:$v}=ko,Co=o.createApi({reducerPath:"elamaAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateElamaCode:e.mutation({query:t=>({url:"/auth/elama",method:"POST",body:t})})})}),{useValidateElamaCodeMutation:zv}=Co,To=o.createApi({reducerPath:"googleAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateGoogleToken:e.mutation({query:t=>({url:"/auth/google",method:"POST",body:t})})})}),{useValidateGoogleTokenMutation:Gv}=To,ns=async e=>{const t=await e.text();let n=t;try{n=JSON.parse(t)}catch{n=t}return n},Lg=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",headers:{"Content-Type":"application/json"},body:t,responseHandler:ns}},Og=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t,responseHandler:ns}},Io=o.createApi({reducerPath:"requestPlaneApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRequest:e.mutation({query:t=>Og("https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8",t,"REACT_APP_PIPEDREAM_REQUEST_PLANE_SRC")}),getInvoiceRequest:e.mutation({query:t=>Lg("https://webhook.latenode.com/5868/prod/6e2d04a8-6cd9-4ec3-b884-ee2fd67267a3",t,"REACT_APP_REQUEST_PLANE_WEBHOOK_URL")})})}),{useGetRequestMutation:Wv,useGetInvoiceRequestMutation:Hv}=Io,Ao=o.createApi({reducerPath:"getCheckoutUrlApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({GetCheckoutUrl:e.mutation({query:t=>({url:`?proxy_url=${encodeURIComponent({}.REACT_APP_PIPEDREAM_GET_CHECKOUT_URL)}`,method:"POST",body:t})})})}),{useGetCheckoutUrlMutation:qv}=Ao,wr=o.createApi({reducerPath:"recoverPasswordApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/"}),endpoints:()=>({})}),xo=o.createApi({reducerPath:"addUserToProjectApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user"}),endpoints:e=>({addUserToProject:e.mutation({queryFn(t,n){return o.clientFromApi(n).userToProject.add_user_create(t,{type:g.ContentType.FormData})}})})}),{useAddUserToProjectMutation:Vv}=xo,Po=o.createApi({reducerPath:"recurrenceSubscriptionsOffApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getCanselRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetCanselRecurrenceQuery:Yv,useGetCanselRecurrenceQuery:Kv}=Po,Ro=o.createApi({reducerPath:"recurrenceSubscriptionsOnApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetRecurrenceQuery:Qv,useGetRecurrenceQuery:Xv}=Ro,Mg="https://app.emailmaker.ru/api/v2",jo=o.createApi({reducerPath:"authApi",baseQuery:o.fetchBaseQueryApp({baseUrl:Mg,prepareHeaders:e=>{const t=o.api.get(o.APP_COOKIES.em_token);return t&&!e.has("authorization")&&e.set("authorization",`Bearer ${t}`),e}}),endpoints:e=>({login:e.mutation({query:t=>({url:"/auth/token",method:"POST",body:t})}),register:e.mutation({query:t=>({url:"/auth/register",method:"POST",body:t})}),refreshToken:e.mutation({query:t=>({url:"/auth/token/refresh",method:"POST",body:t})}),logout:e.mutation({query:()=>({url:"/auth/token",method:"DELETE"})}),getUser:e.query({query:()=>"/auth/user",transformResponse:t=>{const n=Array.isArray(t)?t[0]:t;return o.WpUserToUser(n)}}),changePassword:e.mutation({query:t=>({url:"/auth/password/change",method:"POST",body:t})}),resetPassword:e.mutation({query:t=>({url:"/auth/password/reset",method:"POST",body:t})}),resetPasswordConfirm:e.mutation({query:t=>({url:"/auth/password/reset/confirm",method:"POST",body:t})})})}),{useLoginMutation:Jv,useRegisterMutation:Zv,useRefreshTokenMutation:e0,useLogoutMutation:t0,useGetUserQuery:n0,useLazyGetUserQuery:o0,useChangePasswordMutation:r0,useResetPasswordMutation:i0,useResetPasswordConfirmMutation:a0}=jo;function os(e){return{id:e.id??0,name:e.name??"",children:(e.children??[]).map(os)}}function Ng(e){return(e?.folders??[]).map(os)}function Dg(e){return{items:(e?.items??[]).flatMap(t=>t.id?[{kind:t.kind??"email",id:t.id,name:t.name??"",title:t.title??"",preheader:t.preheader??"",folderId:t.folder_id??0,hasAmp:t.has_amp??!1,previewImage:t.preview_image??"",updatedAt:t.updated_at??"",imported:t.imported??!1}]:[]),total:e?.total??0}}function kr(e){const t=e.status??"pending";return{id:e.id??"",status:t,outcome:e.outcome,total:e.total??0,imported:e.imported??0,warnings:e.warnings??0,failed:e.failed??0,finished:t==="done"||t==="failed",items:(e.items??[]).map(n=>({kind:n.kind??"email",stripoId:n.stripo_id??0,name:n.name??"",status:n.status??"failed",reason:n.reason,emailId:n.email_id})),createdAt:e.created_at??"",finishedAt:e.finished_at}}function Fg(e){return{selectors:e.map(t=>({kind:t.kind,...t.ids?.length?{ids:t.ids}:{},...t.all?{all:!0}:{},...t.folderId?{folder_id:t.folderId}:{},...t.rootOnly?{root_only:!0}:{},...t.search?{search:t.search}:{}}))}}var Cr="StripoItems",Tr="StripoFolders",Lo="StripoImportJob",pn=(e,t)=>{const n=o.v2ResultOf(e);return"error"in n?{error:n.error}:{data:t(n.data)}},Oo=o.createApi({reducerPath:"stripoImportApi",tagTypes:[Cr,Tr,Lo],baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({saveStripoKey:e.mutation({async queryFn({projectId:t,apiKey:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoKeyUpdate({id:String(t)},{api_key:n}),()=>{})},invalidatesTags:[Cr,Tr]}),getStripoFolders:e.query({async queryFn({projectId:t,kind:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoFoldersList({id:String(t),kind:n}),Ng)},providesTags:[Tr]}),getStripoItems:e.query({async queryFn({projectId:t,kind:n,folderId:r,rootOnly:i,search:a,page:c,limit:d},u){return pn(await o.getClientV2(g.getContainer(u)).projects.stripoItemsList({id:String(t),kind:n,...r?{folder_id:r}:{},...i?{root_only:!0}:{},...a?{search:a}:{},page:c,limit:d}),Dg)},providesTags:[Cr]}),startStripoImport:e.mutation({async queryFn({projectId:t,selectors:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoImportsCreate({id:String(t)},Fg(n)),kr)},invalidatesTags:[Lo]}),getCurrentStripoImport:e.query({async queryFn(t,n){const r=await o.getClientV2(g.getContainer(n)).projects.stripoImportsCurrentList({id:String(t)});return r.status===204?{data:null}:pn(r,kr)},providesTags:[Lo]}),getStripoImport:e.query({async queryFn({projectId:t,jobId:n},r){return pn(await o.getClientV2(g.getContainer(r)).projects.stripoImportsDetail({id:String(t),jobId:n}),kr)},providesTags:[Lo]})})}),{useSaveStripoKeyMutation:s0,useGetStripoFoldersQuery:l0,useGetStripoItemsQuery:c0,useLazyGetStripoItemsQuery:d0,useStartStripoImportMutation:u0,useGetCurrentStripoImportQuery:m0,useGetStripoImportQuery:p0}=Oo,Bg=o.createState({activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),Ug="projectSlice",Ir=o.createSlice({name:Ug,initialState:Bg,reducers:{setActiveGroupsTags:(e,{payload:t})=>{e.activeGroupsTags=t,t.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:t})=>{e.activeProjectGroupsTags=t,t.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(o.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{payload:n,meta:r})=>{const{projectId:i}=r.arg.originalArgs;i?(t.groupsTemplateProjectTotal=+r.baseQueryMeta?.response.headers.get("X-WP-Total"),t.groupsTemplateProjectTotalPages=+r.baseQueryMeta?.response.headers.get("X-WP-TotalPages")):t.groupsTemplateTotal=+r.baseQueryMeta?.response.headers.get("X-WP-Total")})}}),{setActiveGroupsTags:f0,setActiveProjectGroupsTags:h0,resetAllTags:g0}=Ir.actions,$g=o.createState({emailsTotal:0,elementsList:[],emailsTrashTotal:0,elementsTrashList:[],customFolders:{},elementsView:o.CARDS}),zg="emailsPageSlice";function Gg(e){const t=e?.baseQueryMeta?.response;return Number(t?.headers?.get("X-WP-Total"))||0}function rs(e,t){const{emails:n,total:r,isSearch:i,page:a,tagOrFolderId:c}=t;if(t.status==="trash")!i&&r!==void 0&&(e.emailsTrashTotal=r),e.elementsTrashList=n;else if(c){const d=e.customFolders[c];e.customFolders={...e.customFolders,[c]:{list:n,page:a,total:r??d?.total??0}}}else r!==void 0&&(e.emailsTotal=r),e.elementsList=n}var Ar=o.createSlice({name:zg,initialState:$g,reducers:{resetElementsList:e=>{e.elementsList=[]},syncElementsList:(e,{payload:t})=>{rs(e,t)},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeEmailFromList:(e,{payload:t})=>{const n=e.customFolders;t.folder!=="all"&&n[t.folder]?.list&&(n[t.folder]={...n[t.folder],list:n[t.folder].list.filter(r=>r.id!==t.emailId),total:n[t.folder].total-1},e.customFolders=n)}},extraReducers:e=>{e.addMatcher(o.emailsApi.endpoints.getEmails.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.arg.originalArgs;rs(t,{emails:r,total:Gg(n),status:i?.status,page:i?.page,isSearch:!!i?.name?.length,tagOrFolderId:i?.folderTag||i?.tags?.[0]})}),e.addMatcher(o.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{meta:n,payload:r})=>{const i=+n.baseQueryMeta?.response.headers.get("X-WP-Total")||0;t.elementsList=r,t.emailsTotal=i;const{projectGroup:a,projectId:c,tags:d}=n.arg.originalArgs;(a?.length&&c||d?.length||!d?.length&&!a?.length)&&(t.emailsTotal=i)}),e.addMatcher(o.emailsApi.endpoints.editEmail.matchFulfilled,(t,{payload:n})=>{t.elementsList.map(r=>r.id?.toString()===n.id?.toString()?Object.assign(r,{lock:n.lock,title:n.title,emailtags:n.emailtags}):r)})}}),{toggleElementsView:y0,resetElementsList:_0,syncElementsList:b0,removeEmailFromList:v0}=Ar.actions,is=o.combineReducers({[o.di.reducerPath]:o.di.reducer,[o.AiApi.reducerPath]:o.AiApi.reducer,[o.userSlice.name]:o.userSlice.reducer,[o.emailSlice.name]:o.emailSlice.reducer,[o.blockSlice.name]:o.blockSlice.reducer,[o.imageApi.reducerPath]:o.imageApi.reducer,[An.reducerPath]:An.reducer,[yo.reducerPath]:yo.reducer,[Ir.name]:Ir.reducer,[o.blocksApi.reducerPath]:o.blocksApi.reducer,[o.emailsApi.reducerPath]:o.emailsApi.reducer,[ho.reducerPath]:ho.reducer,[Xn.reducerPath]:Xn.reducer,[Jn.reducerPath]:Jn.reducer,[Zn.reducerPath]:Zn.reducer,[eo.reducerPath]:eo.reducer,[to.reducerPath]:to.reducer,[no.reducerPath]:no.reducer,[oo.reducerPath]:oo.reducer,[ro.reducerPath]:ro.reducer,[io.reducerPath]:io.reducer,[ao.reducerPath]:ao.reducer,[so.reducerPath]:so.reducer,[lo.reducerPath]:lo.reducer,[co.reducerPath]:co.reducer,[uo.reducerPath]:uo.reducer,[mo.reducerPath]:mo.reducer,[po.reducerPath]:po.reducer,[o.emailPageSlice.name]:o.emailPageSlice.reducer,[o.projectsApi.reducerPath]:o.projectsApi.reducer,[Pn.reducerPath]:Pn.reducer,[Qt.reducerPath]:Qt.reducer,[Rn.reducerPath]:Rn.reducer,[So.reducerPath]:So.reducer,[o.saveFileApi.reducerPath]:o.saveFileApi.reducer,[wo.reducerPath]:wo.reducer,[o.commentsApi.reducerPath]:o.commentsApi.reducer,[o.optimiseApi.reducerPath]:o.optimiseApi.reducer,[ir.name]:ir.reducer,[Ar.name]:Ar.reducer,[fo.reducerPath]:fo.reducer,[To.reducerPath]:To.reducer,[ko.reducerPath]:ko.reducer,[Co.reducerPath]:Co.reducer,[o.taxonomiesApi.reducerPath]:o.taxonomiesApi.reducer,[o.projectsPageSlice.name]:o.projectsPageSlice.reducer,[o.AiApiGenerator.reducerPath]:o.AiApiGenerator.reducer,[Io.reducerPath]:Io.reducer,[go.reducerPath]:go.reducer,[bo.reducerPath]:bo.reducer,[Gn.reducerPath]:Gn.reducer,[o.authorizationApi.reducerPath]:o.authorizationApi.reducer,[o.limitsApi.reducerPath]:o.limitsApi.reducer,[o.revisionHistorySlice.name]:o.revisionHistorySlice.reducer,[Ao.reducerPath]:Ao.reducer,[o.defaultModePanesSlice.name]:o.defaultModePanesSlice.reducer,[wr.reducerPath]:wr.reducer,[xo.reducerPath]:xo.reducer,[_o.reducerPath]:_o.reducer,[Ro.reducerPath]:Ro.reducer,[Po.reducerPath]:Po.reducer,[jo.reducerPath]:jo.reducer,[o.projectSettingsV2Api.reducerPath]:o.projectSettingsV2Api.reducer,[Oo.reducerPath]:Oo.reducer}),Wg=(e,t)=>t.type==="authorizationApi/resetApiState"?is({[o.reducerPath]:e[o.reducerPath]},t):is(e,t),as=[o.AiApi,o.imageApi,yo,o.emailsApi,An,o.blocksApi,ho,Xn,Jn,Zn,eo,to,no,oo,ro,io,ao,so,lo,co,uo,mo,po,wo,o.projectsApi,Pn,Qt,Rn,So,o.commentsApi,o.optimiseApi,o.saveFileApi,fo,To,o.taxonomiesApi,ko,Co,o.AiApiGenerator,Io,o.authorizationApi,o.limitsApi,go,bo,Gn,Ao,wr,jo,o.projectSettingsV2Api,Oo,xo,_o,Ro,Po];function Hg(e){let t={};if(e){const r=g.createIdentifier$1();g.DependencyResolver.inject(r,e),t={INJECTION:r}}const n=o.configureStore({reducer:Wg,middleware:r=>r({serializableCheck:!1}).concat(as.map(i=>i.middleware)),preloadedState:t});return o.setupListeners(n.dispatch),n}var ss=g.createIdentifier$1("RtkApiRegistry");function qg(e,t){e.inject(ss,new Map(t.map(n=>[n.reducerPath,n])))}function st(e,t){const n=e?.getInstance(ss)?.get(t);if(!n)throw new Error(`RTK api "${t}" is not in the container registry (provideRtkApiRegistry did not run)`);return n}function Vg(e,t){let n={isCodeMode:void 0,direction:void 0};return o.provideCodeMode(e).watch(r=>{n.isCodeMode!==r.isCodeMode&&t.dispatch(o.setCodeMode(r.isCodeMode)),n.direction!==r.direction&&t.dispatch(o.switchCodeModeDirection(r.direction)),n={isCodeMode:r.isCodeMode,direction:r.direction}})}function Yg(e,t){const n=o.provideCurrentUser(e),r=o.authorizationApi.endpoints.getMe.select("");let i=n.get()?.profile;const a=()=>{const c=r(t.getState()).data;!c||c===i||(i=c,n.set({profile:c}))};return a(),{dispose:t.subscribe(a)}}var Kg=g.createIdentifier$1("EmailSettingsPort");function Qg(e,t){e.inject(Kg,{read:()=>o.selectEmailSettings(t.getState())??{},write:n=>{t.dispatch(o.setEmailSettings(n))},markAppearanceChanged:()=>{t.dispatch(o.markAppearanceNeedsUpdate())}})}var Xg="Invalid standaloneKey.",Jg="not implemented",E0=1,Zg=g.createIdentifier$1("StandaloneMockGuard");function xr(){const e=new Error(Xg);return e.name="InvalidStandaloneKeyError",e}function Pr(e){return o.isStandaloneRuntime(g.getContainer(e))}function ey(e){return e instanceof Error?e.name==="InvalidStandaloneKeyError"||e.message==="Invalid standaloneKey."||e.message==="not implemented":e===Jg}function ls(e){if(Pr(e))throw xr()}function ty(e,t,n){return n instanceof Error&&n.name==="InvalidStandaloneKeyError"?n:xr()}var ny=()=>()=>{throw xr()};function oy(e){if(!e)throw new Error("DI container not found for standalone mock guard");e.inject(Zg,1)}function ry(e){return typeof e!="function"}var S0="[plugin-api-mock]";function cs(){return!0}function iy(e){try{if(e===null||typeof e!="object")return e;const t={};for(const n of Object.keys(e).slice(0,12)){const r=e[n];t[n]=typeof r=="string"&&r.length>120?`${r.slice(0,120)}…(${r.length})`:r}return t}catch{return"(unserializable arg)"}}function ay(e,t){return n=>{const r=n.query,i=n.queryFn||((a,c,d,u)=>{if(!r)throw new Error("query not found EndpointDefinition");return u(r(a))});i&&(n.query=void 0,n.queryFn=async(a,c,d,u)=>{try{let m;const f=g.getContainer(c).getServices(e);for(let h=f.length-1;h>=0;h--){const _=f[h];if(m=m?await m(async p=>await _.execute(p),c):await _.execute(a),ry(m))return{data:m,error:null}}if(m)m=await m(async(h,_=c,p=d,S=u)=>{ls(c);const k=await i(h,_,p,S);if(k.error)throw k.error;return k.data},c);else{ls(c),cs();const h=await i(a,c,d,u);if(h.error)throw h.error;m=h.data}return{data:m,error:null}}catch(m){return Pr(c)&&ey(m)?{error:ty(t,iy(a),m)}:(cs(),{error:m})}})}}var ds=new Set;function it(e){return(t,n)=>{const r=Object.create(null),i=Object.keys(n),a=new g.Disposable;for(const c of i){const d=`api_listeners_flag_${t.reducerPath}/${c.toString()}`,u=g.createIdentifier$1(`api_listeners_${t.reducerPath}/${c.toString()}`);ds.has(d)||(r[c]=ay(u,`${t.reducerPath}/${c.toString()}`),ds.add(d)),a.addDisposable(e.addService(u,{execute:n[c]}))}return Object.keys(r).length&&t.enhanceEndpoints({endpoints:r}),o.getDisposable(e).addDisposable(a),a}}function us(e,t){for(const n of Object.keys(t))try{t[n](e)}catch{}}function w0(e){return e}function ms(e,t){return e({body:t}).catch(()=>new Promise(n=>setTimeout(n,1e3)))}function sy(e){it(e)(st(e,"AiApi"),{sendMessage:({body:t})=>async(n,r)=>{const i=o.getEmitter(e,g.events.AI_TEXT_REQUEST_ID);if(!i.hasListeners())return ms(n,t);const a=t,c={message:a.message??a.context,locale:a.locale,entityId:a.entity_id,projectId:a.project_id!=null?String(a.project_id):void 0,subject:a.subject,preheader:a.preheader,textContent:a.textContent,context:a.context??a.connection,connection:a.connection,onProgress:(d,u)=>{o.getEmitter(e,g.events.AI_TEXT_PROGRESS_ID).fire({progress:Number.isFinite(d)?d:0,status:typeof u=="string"?u:void 0})},onStreamChunk:d=>{typeof d!="string"||!d||o.getEmitter(e,g.events.AI_TEXT_STREAM_ID).fire({partialHtml:d})},signal:r.signal};for(const d of i.getListeners([c])){const u=await d(c);if(u)return{status:200,_eventResult:!0,aiMessage:typeof u.message=="string"?u.message:"",aiHtml:typeof u.html=="string"?u.html:void 0}}return ms(n,t)},getDialog:t=>(n,r)=>Pr(r)?Promise.resolve({documents:[],totalCount:0}):n(t)})}function ly(e){const t=it(e),n=o.getEmitter(e,g.events.FILE_PROXY_EVENT_ID);t(st(e,"proxyApi"),{async getFile({url:r,tryFetch:i=!0,type:a}){return async c=>{const{requested:d}=o.getCurrentProject(e),u=(await n.fire({url:r,project:d})).filter(m=>m instanceof Blob)[0];if(u)switch(a){case"json":return JSON.parse(await u.text());case"text":return u.text();default:return u}else return c({url:r,tryFetch:i,type:a})}}})}function cy(e){it(e)(st(e,"tokenApi"),{tokenCreate(t){return n=>n(t)},tokenValidate(){return t=>t({})}})}function k0(e){return e}function dy(e){it(e)(st(e,"imageApi"),{sendAiImageRequest:function({body:t}){return async(n,r)=>{const i=o.getEmitter(e,g.events.AI_IMAGE_REQUEST_ID);if(!i.hasListeners()||t.request!=="create-image")return n({body:t});const a={prompt:t.message??"",size:t.size,entityId:t.entity_id,projectId:t.project_id!=null?String(t.project_id):void 0,onProgress:(c,d)=>{o.getEmitter(e,g.events.AI_IMAGE_PROGRESS_ID).fire({progress:Number.isFinite(c)?c:0,status:typeof d=="string"?d:void 0})},signal:r.signal};for(const c of i.getListeners([a])){const d=await c(a);if(d&&d.images?.length)return{data:{status:200,_eventResult:!0,task:{images:d.images}}}}return n({body:t})}},getAiImage(t){return n=>n(t)}})}async function ps(e,t,n,r,i){try{const a=(await e.fire({project:String(t),emailId:n})).filter(c=>c!=null);if(a.length)return a.flat()}catch{}return r(i)}function uy(e){const t=it(e),n=st(e,"blocksApi"),r=o.blocksDataSourceProvider(e),i=r.byForeignKey("project"),a=o.blockRevisionsDataSourceProvider(e);a.byForeignKey("parent");const{dispatch:c}=o.getStore(e),d=o.getDisposable(e);d.addDisposable(r.onChange(()=>c(n.util.invalidateTags(["Blocks"])))),d.addDisposable(r.onSave(({prev:f,patch:h,value:_})=>{const p=f?{...f,...h}:h;let S=o.mergeEntityPreservingMeta(f,h,_);return p&&S.html===p.html&&S.title===p.title&&(S={...S,renderGuid:p.renderGuid}),S},Number.MIN_VALUE));const u=o.getEmitter(e,o.READ_COMMON_BLOCKS_EVENT_ID),m=o.getEmitter(e,o.READ_TEMPLATE_BLOCKS_EVENT_ID);t(n,{async getBlocks(f){const h={};f.name&&(h.title=f.name),f.type&&(h.type=f.type);const _=f.projectId??await o.getBlocksProject(e);return await i.get(_,{filter:h,page:f.page,pageSize:f.pageSize,order:f.order,orderBy:f.orderby}).then(({data:p})=>p)},getBlocksSchema(){return f=>f(void 0)},getParentEmailBlocks(f){return async h=>{const _=o.getCurrentProject(e).requested||"";return ps(m,_,f.emailId||"",h,f)}},getTemplateBlocks(f){return async h=>{const _=o.getCurrentProject(e).requested||"";return ps(u,_,f.emailId||"",h,f)}},async getBlock(f){const h=o.getCurrentProject(e).card?.id;if(h!==void 0)return i.first(Number(h),{filter:{id:f}})},addBlock(f){return async h=>{const _=await r.create(f);return o.getAppConfig(e).preventSendDataToEM||h(_).catch(p=>{}),_}},editBlock({blockId:f,...h}){return r.update(f,h)},deleteBlock(f){return r.remove(typeof f=="object"?f.id:f)},addTag(f){return f},getDeletableTag([f,h]){return[]},autoSaveBlock({blockId:f,body:h}){return a.create({...h,parent:f})}})}function my(e){const{emails:t,emailRevisions:n}=o.provideEmailDocuments(e),{dispatch:r}=o.getStore(e),i=o.getDisposable(e),a=it(e),c=st(e,"emailsApi");i.addDisposable(t.onChange(async()=>{r(c.util.invalidateTags(["Email"]))})),a(c,{getEmails:d=>[],getTemplateEmails:d=>[],async addEmail({source:d,...u}){const m=await t.create(u,{source:d});return m.renderGuid||(m.renderGuid=g.generateUUID()),m},editEmail(d){return async u=>{const{emailId:m,source:f,...h}=d;return o.isRevisionServiceEnabled(e)&&await u(d),t.update(m,h,{source:f})}},deleteEmail(d){return t.remove(typeof d=="object"?d.id:d)},addTag(){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},getDeletableTag([d,u]){return[]},autoSaveEmail({emailId:d,body:u}){return async m=>{o.isRevisionServiceEnabled(e)&&await m({emailId:d,body:u});const f=await n.create({...u,parent:d,modified:new Date().toString()});return f&&!f.html&&u.html?{...f,html:u.html}:f}}})}var py="tmp",C0=g.createIdentifier$1();function fy(e){const t=it(e);if(!e.getInstance(g.DISPOSABLE_ID))throw new Error("Something was wrong");const n=o.getEmitter(e,g.events.UPLOAD_EVENT_ID),r=o.getEmitter(e,g.events.ON_SEND_TESTEMAIL_ID),i=o.getEmitter(e,g.events.ON_SEND_LIVEPREVIEW_ID);t(st(e,"saveFileApi"),{uploadImage(a){return async c=>{const{requested:d}=o.getCurrentProject(e),u=async()=>c({...a,user_id:String((await e.getInstanceAsync(g.APP_ID)).app_id)});if(a.folder===py)return u();const m=await o.fireUploadImageEvent(n,{file:a.file,project:d});if(m.url)return[{file_url:m.url,project:d}];if(!o.shouldFallbackToBuiltInUpload(m,{isStandalone:o.isStandaloneRuntime(e)}))throw o.toUploadImageError(m);return u()}},sendTestEmail(a){return async c=>{const{requested:d}=o.getCurrentProject(e);(await r.fire({project:d,email_id:a.email_id,subject:a.subject,email:a.email,html:a.html,from_name:a.from_name})).some(u=>u===!1)&&await c({...a,user_id:String((await e.getInstanceAsync(g.APP_ID)).app_id)})}},async sendLivePreview(a){const{requested:c}=o.getCurrentProject(e);(await i.fire({project:c,id:a.email,subject:a.subject,html:a.content})).some(d=>d===!1)},sendShortLink(a){return c=>c(a)}})}function hy(e){it(e)(st(e,"emailRawApi"),{getEmailRaw({emailId:t,secret_hash:n}){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Yt(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}function gy(e,t){var n,r;o.requiredArgs(1,arguments);var i=Nl(e);if(isNaN(i.getTime()))throw new RangeError("Invalid time value");var a=String((n=t?.format)!==null&&n!==void 0?n:"extended"),c=String((r=t?.representation)!==null&&r!==void 0?r:"complete");if(a!=="extended"&&a!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(c!=="date"&&c!=="time"&&c!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var d="",u="",m=a==="extended"?"-":"",f=a==="extended"?":":"";if(c!=="time"){var h=Yt(i.getDate(),2),_=Yt(i.getMonth()+1,2),p=Yt(i.getFullYear(),4);d="".concat(p).concat(m).concat(_).concat(m).concat(h)}if(c!=="date"){var S=i.getTimezoneOffset();if(S!==0){var k=Math.abs(S),w=Yt(Math.floor(k/60),2),v=Yt(k%60,2),A=S<0?"+":"-";u="".concat(A).concat(w,":").concat(v)}else u="Z";var x=Yt(i.getHours(),2),K=Yt(i.getMinutes(),2),Z=Yt(i.getSeconds(),2),M=d===""?"":"T",L=[x,K,Z].join(f);d="".concat(d).concat(M).concat(L).concat(u)}return d}function yy(e){const t=it(e),n=st(e,"commentsApi"),r=o.commentsDataSourceProvider(e),i=r.byForeignKey("post"),{dispatch:a}=o.getStore(e);o.getDisposable(e).addDisposable(r.onChange(()=>a(n.util.invalidateTags(["Comments"])))),t(n,{getComments(c){return i.get(c).then(({data:d})=>d)},addComment({subjectId:c,author:d,parent:u,content:m,author_name:f,author_email:h,targetId:_}){const p={post:c,author:d,author_name:f,author_email:h,content:m,parent:u,target_id:_,date:gy(new Date),author_avatar_urls:{}};return r.create(p)},deleteComment(c){return r.remove(c)},editComment({commentId:c,...d}){return r.update(c,d)},deleteTarget(c){return r.update(c,{target_id:""})}})}function Rr(e){return{id:String(e),name:"",myRole:"",members:[],invites:[],emailsCount:0,blocksCount:0,title:"",group:[],folder:[],blockfolder:[]}}function fs(e,t){return{project:Number(e),app_id:t?.app_id||0,app_config:t?.app_config||{},user:t?.user}}function _y(e,t){const n=Rr(String(t)),r=o.getCurrentProject(e).card;return r&&String(r.id)===String(t)?Promise.resolve({...n,...r,id:String(t)}):Promise.resolve({...n,id:String(t)})}function by(e){let t,n;const r=i=>((t!==i||!n)&&(t=i,n=_y(e,i)),n);it(e)(st(e,"projectsApi"),{getProjects(i={page:1}){return[]},getProject(i){return async a=>o.isStandaloneRuntime(e)?a(i):{...await r(i),id:String(i)}},addProject(i){throw new Error},async editProject({projectId:i,...a}){const c={...await r(i),...a,id:String(i)};return t=i,n=Promise.resolve(c),c},deleteProject(i){throw new Error},mutateProjectMembers(){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},addProjectMember(){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},getFrequentProjects(){return[]}})}function vy(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:o.getCurrentUser(e).profile?.locale,counters:{},avatar_urls:{},autosaves:!0};it(e)(st(e,"authorizationApi"),{getSchema:()=>n=>n({}),getMe:()=>t,editMe:n=>t={...t,...n},getSubscriptions:()=>[]})}function Ey(e){it(e)(st(e,"notificationsApi"),{getNotifications(t){return[]},notificationShown({id:t,datetime:n}){throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Sy(e){it(e)(st(e,"addUserToProjectApi"),{addUserToProject:()=>{}})}function wy(e){o.injectEmailTermsResolver(e,{resolve:async()=>{}}),it(e)(st(e,"taxonomiesApi"),{getTerms:()=>[],getStandardGroups:()=>[],addTerm:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},editTerm:t=>({id:t.id,name:t.name,parent:0,count:0}),deleteTerm:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function ky(e){it(e)(st(e,"projectSettingsV2Api"),{getProjectIntegrations:()=>({}),getProjectWebhook:()=>"",getProjectStorage:()=>({}),getProjectTestRecipients:()=>[],getIntegrationCredentials:()=>({}),putProjectIntegration:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},deleteProjectIntegration:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectWebhook:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectSettings:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectTestRecipients:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Cy(e){it(e)(st(e,"stripoImportApi"),{getStripoFolders:()=>[],getStripoItems:()=>({items:[],total:0}),getCurrentStripoImport:()=>null,getStripoImport:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},saveStripoKey:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)},startStripoImport:()=>{throw new Error(g.NOT_IMPLEMENTED_IN_PLUGIN)}})}var hs={addUserToProjectApiMock:Sy,AiApiMock:sy,authorizationApiMock:vy,blocksApiMock:uy,commentsApiMock:yy,emailsApiMock:my,emailRawApiMock:hy,imageApiMock:dy,notificationsApiMock:Ey,projectsApiMock:by,projectSettingsV2ApiMock:ky,proxyApiMock:ly,saveFileApiMock:fy,stripoImportApiMock:Cy,taxonomiesApiMock:wy,tokenApiMock:cy},jr=o.createApi({reducerPath:"tokenApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/"}),endpoints:e=>({tokenCreate:e.mutation({queryFn(t,n){return o.clientFromApi(n).jwtAuth.token_create({body:t,type:g.ContentType.Json})}}),tokenValidate:e.mutation({queryFn(t,n){return o.clientFromApi(n).jwtAuth.token_validate_create({type:g.ContentType.Json})}})})}),{useTokenCreateMutation:T0,useTokenValidateMutation:I0}=jr;function Lr(){const e=new Map;for(const t of as)e.set(t.reducerPath,t);return e.set(jr.reducerPath,jr),[...e.values()]}function Ty(e,t){const n=Object.keys(t.endpoints);n.length&&e(t,Object.fromEntries(n.map(r=>[r,ny])))}function Iy(e){oy(e);const t=it(e);for(const n of Lr())Ty(t,n)}function Ay(e){if(!e)return;const t=g.decodeJwt(e)?.data,n=t?.data?.scope??t?.scope;return(Array.isArray(n)?n.flatMap(r=>typeof r=="string"?r.split(/\s+/):[]):typeof n=="string"?n.split(/\s+/):[]).find(r=>/^project_\d+$/.test(r))?.replace(/^project_/,"")||void 0}var xy={AiApi:new Set(["sendMessage","getDialog"]),imageApi:new Set(["sendAiImageRequest","getAiImage","getAiImageSSE"])};function Py(e){return o.getAppConfig(g.getContainer(e))}function Ry(e){return e?.backendProxy!==void 0&&e?.backendProxyPolicy?.proxyAi===!0}function jy(e){return Ry(Py(e))}function Ly(e,t,n,r){return xy[t]?.has(n)?i=>jy(e)?a=>a(i):r(i):r}function Oy(e){const t=it(e);return((n,r)=>{if(!n||typeof n.reducerPath!="string")return new g.Disposable;const i=Object.fromEntries(Object.entries(r??{}).map(([a,c])=>[a,typeof c=="function"?Ly(e,n.reducerPath,a,c):c]));return t(n,i)})}function My(e){const t=`blocks_${g.generateUUID().replaceAll("-","")}`,n=document.createElement("script");return n.type="text/javascript",n.text=`window.${t}(function(module, exports, require) { ${e}; })`,new Promise((r,i)=>{window[t]=function(a){const c={exports:{}},d=()=>{};a(c,c.exports,d),r(c.exports)},document.head.appendChild(n)}).finally(()=>{n.remove(),delete window[t]})}async function gs(e){const t=g.getContainer(e),n=t?.getInstance(g.STANDALONE_PROJECT_ID),r=n?void 0:await t?.getInstanceAsync(g.APP_ID).catch(()=>{}),i=n||(r?.project!==void 0?String(r.project):void 0);i&&t&&o.setCurrentProjectCard(t,Rr(i))}async function Ny(e,t){try{const n=function(d){const u=e.getInstance(g.STANDALONE_PROJECT_ID),m=u?fs(u,d):d;e.injectFactory(g.APP_ID,async()=>m)},r=Oy(e),i=await o.readZipFromBase64(t),a=i.key&&o.zipEntryToText(i.key);if(typeof a!="string")return;const c=await My(a);if(typeof c!="object"||c===null||typeof c.execute!="function")return;c.execute(n,r,Lr())}catch{}}async function ys(e,t){Iy(g.getContainer(e)),await Ny(g.getContainer(e),t),us(g.getContainer(e),hs)}var Dy=zn(async e=>{const t=Hg(e);e.inject(g.STORE_ID,t),qg(e,Lr()),Qg(e,t),o.getDisposable(e).addDisposable(Yg(e,t)),o.getDisposable(e).addDisposable(Vg(e,t));const n=g.getContainer(t);n&&(e.inject(g.MESSAGE_SERVICE_ID,o.getMessageService(n)),e.inject(o.CURRENT_PROJECT_ID,o.provideCurrentProject(n)));const r=e.getInstance(g.SECURITY_MODULE_ID);return r?(await ys(t,r),await gs(t)):us(g.getContainer(t),hs),{instance:{}}}),_s=["historyEnabled","commentsEnabled","aiAssistentEnabled","livePreviewEnabled","sendTestEnabled","sharePreviewEnabled","webversionEnabled","optimizeSpamAssassinEnabled","exportWebHookEnabled","aiLayoutConverterEnabled","elementAIimageEnabled","elementAItextEnabled","revisionService"];function Fy(e){const t={...e};for(const n of _s)t[n]=!1;return t}function By(e){const t={...e};for(const n of _s)n in t&&typeof t[n]=="boolean"&&(t[n]=!1);return t}function Uy(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[n,r]of Object.entries(e))!r||typeof r!="object"||Array.isArray(r)||(t[n]=By(r));return Object.keys(t).length>0?t:void 0}function Or(e){const t=Fy(e),n=Uy(e.advancedConfigs),r={...t};return n?r.advancedConfigs=n:delete r.advancedConfigs,r}var A0=1,$y=2592e6;function bs(){return"emailmaker".trim()||void 0}function zy(e){return{schemaVersion:1,savedAt:Date.now(),project:e.project,app_id:e.app_id,app_config:Or(Es(e.app_config))}}function vs(e){return{...e,app_config:Es(e.app_config)}}function Es(e){if(!e||typeof e!="object"||Array.isArray(e))return{};try{if(typeof structuredClone=="function")return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return{}}}async function Gy(e){const t=bs();t&&await Qy(t,zy(e))}async function Wy(e=Date.now()){const t=bs();if(t)return Xy(t,e)}function Hy(e,t=Date.now()){return e.savedAt>t?!1:t-e.savedAt<=$y}function Ss(e){if(!e||typeof e!="object")return!1;const t=e,n=typeof t.project=="number"&&Number.isFinite(t.project)||typeof t.project=="string"&&t.project.trim()!=="";return t.schemaVersion===1&&typeof t.savedAt=="number"&&Number.isFinite(t.savedAt)&&n&&typeof t.app_id=="number"&&Number.isFinite(t.app_id)&&t.app_config!=null&&typeof t.app_config=="object"&&!Array.isArray(t.app_config)}var jt="snapshots",qy=1;function Vy(){return`${"emailmaker".trim()||"plugin"}-plugin-deferred-config`}function Mo(){return new Promise((e,t)=>{if(typeof indexedDB>"u"){t(new Error("indexedDB is not available"));return}const n=indexedDB.open(Vy(),qy);n.onerror=()=>t(n.error||new Error("indexedDB open failed")),n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(jt)||r.createObjectStore(jt)},n.onsuccess=()=>e(n.result)})}function Yy(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error||new Error("indexedDB request failed"))})}function Ky(){return{async get(e){const t=await Mo();try{const n=await Yy(t.transaction(jt,"readonly").objectStore(jt).get(e));return n===void 0?void 0:n}finally{t.close()}},async put(e,t){const n=await Mo();try{const r=n.transaction(jt,"readwrite");r.objectStore(jt).put(t,e),await new Promise((i,a)=>{r.oncomplete=()=>i(),r.onerror=()=>a(r.error||new Error("indexedDB write failed")),r.onabort=()=>a(r.error||new Error("indexedDB write aborted"))})}finally{n.close()}},async delete(e){const t=await Mo();try{const n=t.transaction(jt,"readwrite");n.objectStore(jt).delete(e),await new Promise((r,i)=>{n.oncomplete=()=>r(),n.onerror=()=>i(n.error||new Error("indexedDB delete failed")),n.onabort=()=>i(n.error||new Error("indexedDB delete aborted"))})}finally{t.close()}},async clear(){const e=await Mo();try{const t=e.transaction(jt,"readwrite");t.objectStore(jt).clear(),await new Promise((n,r)=>{t.oncomplete=()=>n(),t.onerror=()=>r(t.error||new Error("indexedDB clear failed")),t.onabort=()=>r(t.error||new Error("indexedDB clear aborted"))})}finally{e.close()}}}}var ws,Mr;function Nr(){return ws||(Mr||(Mr=Ky()),Mr)}function ks(e){Nr().delete(e).catch(()=>{})}async function Qy(e,t){if(Ss(t))try{await Nr().put(e,vs(t))}catch{}}async function Xy(e,t=Date.now()){try{const n=await Nr().get(e);if(n===void 0)return;if(!Ss(n)){ks(e);return}if(!Hy(n,t)){ks(e);return}return vs(n)}catch{return}}function Jy(e,t){if(e.getInstance(g.STANDALONE_FILE_PROXY_REGISTERED_ID))return;e.inject(g.STANDALONE_FILE_PROXY_REGISTERED_ID,!0);const n=g.getEvent(e,g.events.FILE_PROXY_EVENT_ID);t.addDisposable(n(async({url:r})=>(await fetch(r)).blob(),Number.MIN_VALUE))}function Cs(e){try{return Ay(e)||void 0}catch{return}}async function Zy(e,t,n){if(!e)return;let r;try{const i=await e(t,n,void 0);r=String(i||"").trim()}catch{return}if(r)return{token:r,serverProjectId:Cs(r)}}function e_(e){if(e==null)return;const t=String(e).trim();return/^\d+$/.test(t)?t:void 0}function t_(e){const t=String(e.getInstance(g.JWT_TOKEN_ID)||"").trim();if(t)return Cs(t)}function Ts(e,t,n){e.inject(g.APP_ID,void 0),e.inject(g.APP_ID,Promise.resolve(fs(t,n)))}function n_(e){return{app_id:e.app_id,app_config:Or(e.app_config)}}async function Is(){const e=await Wy();return e?n_(e):{app_config:Or({})}}function o_(e,t){e.getInstance(g.STANDALONE_ACTIVATED_ID)||(e.inject(g.SECURITY_MODULE_ID,void 0),e.inject(g.STANDALONE_BOOTSTRAP_TOKEN_ID,void 0),e.inject(g.STANDALONE_PROJECT_ID,void 0),t&&e.inject(g.APP_ID,void 0),e.inject(g.STANDALONE_FILE_PROXY_REGISTERED_ID,void 0))}async function As(e){const{container:t,store:n,standaloneKey:r,project:i,reason:a,getAuthToken:c,user:d}=e,u=e.disposable||t.getInstance(g.DISPOSABLE_ID);if(t.getInstance(g.STANDALONE_ACTIVATED_ID))return;const m=await Zy(c,d,i),f=e_(i),h=m?.serverProjectId??t_(t)??(m?void 0:f);t.inject(g.SECURITY_MODULE_ID,r);let _=!1;try{if(m&&(t.inject(g.STANDALONE_BOOTSTRAP_TOKEN_ID,Promise.resolve(m.token)),c&&g.recreateTokenProvider(t,c,d,i)),h){const p=await Is();t.inject(g.STANDALONE_PROJECT_ID,h),Ts(t,h,p),_=!0,o.setCurrentProjectCard(t,Rr(h))}if(await ys(n,r),_=!0,!h){await gs(n);const p=t.getInstance(g.STANDALONE_PROJECT_ID);if(p)Ts(t,p,await Is()),_=!0;else if(t.getInstance(g.APP_ID)!==void 0)try{(await t.getInstanceAsync(g.APP_ID))?.project==null}catch{}}u&&Jy(t,u),t.inject(g.STANDALONE_ACTIVATED_ID,!0)}catch(p){throw o_(t,_),p}}async function r_(e,t,n,r){const i=r?.attemptTimeout??g.isFailoverEnabled(n),a=g.isFailoverEnabled(n)?g.getOrderedOriginCandidates(n):g.getOriginChain(n).length>0?[g.getActiveBaseUrl(n)]:[];if(a.length===0)throw new Error("[apiOriginFailover] no API base URL configured");const c=e.startsWith("/")?e:`/${e}`;let d,u;for(let m=0;m<a.length;m++){const f=a[m],h=m===a.length-1,_=i?g.beginFailoverAttempt(t.signal):void 0;try{const p=await fetch(`${f}${c}`,{...t,..._?{signal:_.signal}:{}});if(!p.ok&&g.shouldFailoverResponse(p.status)){if(d=p,!h){g.reportOriginFailure(f,n);continue}break}return p.ok&&g.reportOriginSuccess(f,n),p}catch(p){const S=_?.timeoutError();if(!S&&!g.shouldFailoverError(p))throw p;u=S||p,h||g.reportOriginFailure(f,n)}finally{_?.done()}}if(g.isFailoverEnabled(n)&&g.abandonStickyOrigin(),d)return d;throw u instanceof Error?u:new Error("[apiOriginFailover] fetch chain failed")}function i_(e,t){const n=String(t.baseUrl||"").trim();if(n)return g.resolveExplicitApiBaseUrl(n);const r=e.getInstance(g.REST_CLIENT_FACTORY_ID),i=String(r?.getOptions()?.baseUrl||"").trim();return g.resolveExplicitApiBaseUrl(i||void 0)}async function a_(e,t){if(t.getAuthToken)try{const n=await t.getAuthToken(t.user,t.project,void 0);if(String(n||"").trim())return!0}catch{if(!t.jwtAuth)return!1}if(t.jwtAuth)try{if(String(e.getInstance(g.JWT_TOKEN_ID)||"").trim())return!0;const n=i_(e,t);if(!n)return!1;const r=await r_("/jwt-auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.jwtAuth)},n,{attemptTimeout:!0});if(!r.ok)return!1;const i=await r.json();return i.token?(e.inject(g.JWT_ERROR_ID,void 0),e.inject(g.JWT_TOKEN_ID,i.token),!0):!1}catch{return!1}return!1}async function s_(e){try{if(e.getInstance(g.APP_ID)===void 0)return!1;const t=await c_(e.getInstanceAsync(g.APP_ID));return t!=null&&t.project!=null?t:!1}catch{return!1}}function l_(){return g.getFailoverAttemptTimeoutMs()*Math.max(1,g.getOriginChain().length)}function c_(e){const t=l_();return new Promise((n,r)=>{const i=setTimeout(()=>{n(void 0)},t);e.then(a=>{clearTimeout(i),n(a)},a=>{clearTimeout(i),r(a)})})}function xs(e){return String(e.standaloneKey||"").trim()||void 0}function d_(e){return e.standaloneOnAuthFailure===!0?!0:e.config?.standaloneOnAuthFailure===!0}function u_(e){return d_(e)?!!xs(e):!1}var m_=zn(async e=>{const t=e.getInstance(g.DISPOSABLE_ID),n=()=>e.getInstanceAsync(g.STORE_ID);return{async setOptions(r){if(!u_(r)){e.getInstance(g.STANDALONE_ACTIVATED_ID);return}const i=xs(r);if(!i||e.getInstance(g.STANDALONE_ACTIVATED_ID))return;const a=await n(),c=!!(r.getAuthToken||r.jwtAuth),d=c?await a_(e,r):!0;if(c&&!d){await As({container:e,store:a,standaloneKey:i,project:r.project,getAuthToken:r.getAuthToken,user:r.user,disposable:t,reason:"auth pipeline failed"});return}const u=await s_(e);if(u){await Gy(u).catch(()=>{});return}await As({container:e,store:a,standaloneKey:i,project:r.project,getAuthToken:r.getAuthToken,user:r.user,disposable:t,reason:"app_init failed"})}}}),p_=g.defineMixin(e=>{let t;const n=o.getDisposable(e),r=g.getEvent(e,g.events.ON_DOCUMENT_SESSION_CHANGE);n.addDisposable(r(({history:a})=>{t=a}));const i=()=>t?Di(t):void 0;return{instance:{undoRedoService:{undo:()=>i()?.undo(),redo:()=>i()?.redo(),clear:()=>i()?.clear(),getPast:a=>i()?.getPast(a)??[],getFuture:a=>i()?.getFuture(a)??[],canUndo:()=>i()?.canUndo()??!1,canRedo:()=>i()?.canRedo()??!1,createSnapshot:()=>i()?.createSnapshot(),restoreSnapshot:a=>i()?.restoreSnapshot(a)}}}});function f_(e){return{font_size:e.fontSize,font_family:e.fontFamily,tab_size:e.tabSize,word_wrap:e.wordWrap,minimap:e.minimap,insert_spaces:e.insertSpaces}}function h_(e){return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:e.wordWrap!=="off",minimap:e.minimap?.enabled,insertSpaces:e.insertSpaces}}async function Ps(e){const t=o.getCurrentUser(e).profile;if(t)return t;const n=e.getInstance(g.STORE_ID);if(n)return(await n.dispatch(o.authorizationApi.endpoints.getMe.initiate("",{forceRefetch:!0}))).data}function g_(e){const t=o.resolveTemplateDirectivesConfig(e);if(!(Object.keys(t.output).length>0||Object.keys(t.editor).length>0))return ha();const n=new Set(Object.keys(t.output).filter(i=>t.output[i]==="html-comment")),r=new Set(Object.keys(t.output));return{isConfigured:()=>!0,toEditorForm:i=>o.mapper.normalizeToPolicy(i,t.editor),toOutputForm:i=>o.mapper.normalizeToPolicy(i,t.output),keepWrappedOnOutput:n,editorPolicy:t.editor,warnAboutUnconfiguredInput:fa(r)}}function Rs(e){const t=o.getCodeMode(e);return{...No(e),editor:h_(o.getEditorOptions(e)),codeModeDirection:t.isCodeMode?t.direction:"none"}}function No(e){return e.getInstance(g.CONFIG_SOURCE_ID)?.get()??{}}function Dr(e){return e.getInstance(g.CONFIG_SOURCE_ID)?.layers()??{base:{},profile:{},serverSide:{},user:{},local:{},advancedConfigs:{}}}var y_=br(e=>{const t=o.getDisposable(e),n=Ct(o.getEvent(e,g.events.ON_LIMIT_ID)),r=t.addDisposable(new kt(n)),i=Ct(o.getEvent(e,g.events.READ_LOCALE)),a=t.addDisposable(new kt(i)),c=Ct(o.getEvent(e,g.events.ON_TRANSLATE_ID)),d=t.addDisposable(new kt(c)),u=o.getEmitter(e,g.CONFIG_CHANGED_EVENT_ID),m=async()=>{try{return e.getInstance(g.APP_ID)===void 0?{}:(await e.getInstanceAsync(g.APP_ID))?.app_config||{}}catch{return{}}},f=Ua(),h=Ua();let _,p=!1,S;const k=async()=>{const I=Rs(e);if(!p){S=g.deepClone(I),p=!0;return}S!==void 0&&g.deepEqual(S,I)||(S=g.deepClone(I),await u.fire(I))},w=I=>{if(typeof I=="number")return String(I);if(typeof I=="string")return I},v=I=>{if(I!==void 0){const j=o.provideCurrentProject(e);j.set({...j.get(),requested:String(I)})}},A=async(I,j)=>{if(!I){const ee=await Ps(e);return _=w(ee?.id),{didReset:!1}}const z=await Ps(e),B=I.id!==void 0?w(I.id):w(z?.id),$=_!==void 0?String(_):void 0,de=B!==void 0?String(B):void 0,pe=$!==void 0&&de!==void 0&&$!==de,q={...z,...o.filterUndefined(I),id:B};if(I.id===void 0&&!z?.id&&delete q.id,o.provideCurrentUser(e).set({profile:q}),pe&&j){const ee=e.getInstance(g.INSTANCE_ID);if(ee?.reset)return await ee.reset(j),{didReset:!0}}return _=de,{didReset:!1}},x=I=>{const j=e.getInstance(g.CONFIG_SOURCE_ID);j?.setAdvancedConfigs({...I.advancedConfigs,...I.user?.advancedConfigs}),j?.replace(I.user,"user"),j?.replace(I.serverSide,"server")},K=async()=>{await e.getInstance(g.CONFIG_SOURCE_ID)?.ready(),o.getRevisionServiceFlag(e).set(No(e).revisionService===!0);const{codeModeDirection:I,editor:j}=No(e);j&&o.applyEditorOptions(e,f_(j)),I!==void 0&&(I==="none"?o.setCodeMode$1(e,!1):(o.setCodeMode$1(e,!0),o.setCodeModeDirection(e,I)))},Z=async I=>{x(I),await K()};let M;const L=f.decorate(async({config:I={},project:j,user:z,advancedConfigs:B},$)=>{e.getInstance(g.CONFIG_SOURCE_ID)?.replace(await m(),"server"),await K(),e.inject(g.TEMPLATE_DIRECTIVES_ID,g_(No(e).templateDirectives)),v(j),$&&"commonStyles"in $&&o.setDefaultCommonStyles(e,$.commonStyles===void 0?void 0:$.commonStyles);const{didReset:de}=await A(z,$)});return{setOptions:h.decorate(async I=>{const{config:j={},project:z,user:B,advancedConfigs:$,handleReadLocale:de,handleLimitUsage:pe,handleTranslate:q,storageProvider:ee}=I;e.inject(g.STORAGE_PROVIDER_ID,ee),a.setListener(de),r.setListener(pe),d.setListener(q),await L({config:j,project:z,user:B,advancedConfigs:$},I).catch(Fe=>{}),await k(),M&&M.dispose(),M=new g.Disposable}),instance:{setConfig:h.decorate(async I=>{const j=I,{commonStyles:z,...B}=j;"commonStyles"in j&&o.setDefaultCommonStyles(e,z===void 0?void 0:z),await Z({advancedConfigs:Dr(e).advancedConfigs,serverSide:await m(),user:B}),await k()}),getConfig:()=>Rs(e),updateConfig:h.decorate(async I=>{const j=I,{commonStyles:z,...B}=j;"commonStyles"in j&&o.setDefaultCommonStyles(e,z===void 0?void 0:z),await Z({advancedConfigs:Dr(e).advancedConfigs,serverSide:await m(),user:{...Dr(e).user,...B}}),await k()}),handleReadLocale:i,handleLimitUsage:n,handleTranslate:c}}}),Do;function Fr(){return Do===void 0&&(Do=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/1c31ec91.js")),void 0,{}.url).catch(e=>{throw Do=void 0,e})),Do}var js;function __(){return js??=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/370f04c3.js")).then(e=>zt.__toESM(e.require_core())),void 0,{}.url),js}function b_(e){const t=[0],n=[];let r=0;for(;r<e.length;){const i=e.charCodeAt(r);i===10||i===13?(n.push(r-t[t.length-1]),r+=i===13&&e.charCodeAt(r+1)===10?2:1,t.push(r)):r+=1}return n.push(e.length-t[t.length-1]),{starts:t,lengths:n}}function Ls({starts:e,lengths:t},n,r){const i=Math.min(Math.max(n,1),e.length)-1;return e[i]+Math.min(Math.max(r,1),t[i]+1)-1}var v_={error:8,warning:4,info:2};function E_(e,t){const n=e.evidence!==""?e.col+e.evidence.length:t.lengths[e.line-1]??e.col+1;return{severity:v_[e.type]??8,message:e.message,startLineNumber:e.line,startColumn:e.col,endLineNumber:e.line,endColumn:n,startOffset:Ls(t,e.line,e.col),endOffset:Ls(t,e.line,n)}}async function S_(e){const{HTMLHint:t}=await __(),n=b_(e);return t.verify(e,o.EMAIL_CODE_RULESET).map(r=>E_(r,n))}var w_=class extends g.Disposable{_container;_dataSources;_currentEmail;_blockMetaWrites=Promise.resolve();constructor(e){super(),this._container=e,this._dataSources=o.getDataSources(e),this.addDisposable(g.getEvent(e,g.events.ON_EMAIL_CHANGED_ID)(t=>{this._currentEmail=t}))}async getBlocks(){const e=await this._readProjectBlocks();return await this._blockMetaWrites,(await this._dataSources.blocks.cache.values()).filter(t=>t.project===e).map(t=>Uh(t,this._container))}async _readProjectBlocks(){const e=await o.getBlocksProject(this._container);return await this._dataSources.blocks.byForeignKey("project").get(e),e}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.post===t.id).map(n=>$h(n,this._container))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.parent===t.id).map(n=>zh(n,this._container))}async getEmailSnapshot(){return Ym(o.getOpenEmail(this._container,this._currentEmail),this._container)}async getEmail(e=!0){return this.compile(e)}async compileEmail(e=!0){return this.compile(e)}async compile(e){const{compileEmail:t}=await Fr();return t(await this.getEmailSnapshot(),e,rn(this._container).keepWrappedOnOutput)}setEmailMeta(e){const t=o.getOpenDocument(this._container);if(!t)return;const n=t.get().attributes.meta;o.writeEmailAttributes(t,{meta:o.applyMetaPatch({meta:n},e).meta});const r=t.get().serverId;r!=null&&this._dataSources.emails.cache.addOrUpdate(r,i=>i&&o.applyMetaPatch(i,e))}setBlockMeta(e,t){const n=async()=>{await this._readProjectBlocks();const{cache:r}=this._dataSources.blocks;await r.getIfPresent(e)&&await r.addOrUpdate(e,i=>i&&o.applyMetaPatch(i,t))};this._blockMetaWrites=this._blockMetaWrites.then(n).catch(()=>{})}getCodeErrors(){const e=o.getCodeErrors(this._container);return e.length>0?e:void 0}validateCode(){return Promise.resolve(S_(o.getOpenEmail(this._container,this._currentEmail).html??""))}};function Os(){Fr().catch(()=>{})}function k_(e){const t=o.provideHeadlessMode(e).watch(n=>{n&&Os()});e.getInstance(g.DISPOSABLE_ID)?.addDisposable(t),Ht(e).whenVisible(()=>{Xt(Os)})}var C_=g.createIdentifier$1("EmailOperationsController");function Ms(e){return e.getOrCreateInstance(C_,()=>{const t=new w_(e);return e.getInstance(g.DISPOSABLE_ID)?.addDisposable(t),t})}function T_(e){Ms(e),k_(e)}function I_(e){const t=Ms(e);return{getEmailSnapshot:()=>t.getEmailSnapshot(),getEmail:()=>t.getEmail(),async compileEmail(n,r=!0){if(!n)return t.compileEmail(r);const{compileEmail:i}=await Fr();return i(n,r,rn(e).keepWrappedOnOutput)},validateCode:()=>t.validateCode(),getCodeErrors:()=>t.getCodeErrors(),getBlocks:()=>t.getBlocks(),getComments:()=>t.getComments(),getEmailRevisions:()=>t.getEmailRevisions(),setEmailMeta:n=>t.setEmailMeta(n),setBlockMeta:(n,r)=>t.setBlockMeta(n,r)}}var A_=g.defineMixin(e=>{const t=e.getInstance(g.DISPOSABLE_ID),n=g.getEvent(e,g.events.UPLOAD_EVENT_ID),r=g.getEvent(e,g.events.FILE_PROXY_EVENT_ID),i=g.getEmitter(e,g.events.PROXY_URL_EVENT_ID).event,a=Ct(n),c=Ct(i),d=Ct(r),u=t.addDisposable(new kt(a)),m=t.addDisposable(new kt(d)),f=t.addDisposable(new kt(c));return{setOptions(h){u.setListener(h.handleLoadImage),m.setListener(h.handleFileProxy),f.setListener(h.handleUrlProxy)},instance:{handleLoadImage:a,handleFileProxy:d,handleUrlProxy:c}}}),x_=g.defineMixin(e=>{const t=e.getInstance(g.DISPOSABLE_ID),n=g.getEvent(e,g.events.AI_TEXT_REQUEST_ID),r=g.getEvent(e,g.events.AI_IMAGE_REQUEST_ID),i=Ct(n),a=Ct(r),c=t.addDisposable(new kt(i)),d=t.addDisposable(new kt(a));return{setOptions(u){c.setListener(u.handleAITextRequest),d.setListener(u.handleAIImageRequest)},instance:{handleAITextRequest:i,handleAIImageRequest:a}}}),P_=class extends Error{cycle;constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),this.cycle=e}};function R_(e){const t=new Map;for(const n of e)for(const r of n.provides??[]){const i=t.get(r)??[];i.push(n),t.set(r,i)}return t}function j_(e,t){const n=[];for(const r of e.awaits?.services??[])for(const i of t.get(r)??[])i!==e&&n.push(i);return n}function L_(e){const t=R_(e),n=[],r=new Set,i=[],a=new Set,c=d=>{if(!r.has(d)){if(a.has(d)){const u=i.indexOf(d);throw new P_([...i.slice(u),d].map(m=>m.name))}a.add(d),i.push(d);for(const u of j_(d,t))c(u);i.pop(),a.delete(d),r.add(d),n.push(d)}};for(const d of e)c(d);return n}var O_="author,slug,date,modified,title,acf.html,id,parent,date_gmt",M_="author,slug,date,modified,modified_gmt,title,acf.html,id,parent",N_=20,Br=[g.WpEblockApi];function Ns(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}function D_(e){return{async readRevisions(t,n=1){const r=await g.getApi(e,Br).eblock_revisions_list({parent:t,per_page:N_,page:n},{extraQuery:{_fields:O_}}),i=(r?.data??[]).map(c=>o.WpBlockRevisionToBlockRevision(c)),a=Number(r?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=g.getApi(e,Br),[r,i]=await Promise.all([n.eblock_autosaves_list({id:t},{extraQuery:{_fields:M_}}),n.eblock_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(r?.data??[]).map(d=>{const u=d,m=o.WpBlockRevisionToBlockRevision(u),f=Ns(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse(Ns(i?.data?.modified_gmt)??"");return o.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const r=n,i=r.global_block&&r.html?o.injectEmBlockIdIntoBlockHtml(r.html,t):r.html??"";o.writePendingData(t,{sentAt:Date.now(),html:i,common_styles:""});const a=await g.getApi(e,Br).eblock_autosaves_create({id:t},o.BlockAutoSaveToWpBlockAutoSave({title:r.title,html:i,project:r.project,excerpt:new Date().toISOString()}),{type:g.ContentType.FormData});return o.WpBlockRevisionToBlockRevision(a?.data)}}}var F_="author,slug,date,modified,title,meta,acf.html,acf.common_styles,id,parent,date_gmt",B_="author,slug,date,modified,modified_gmt,title,meta,acf.html,acf.common_styles,id,parent";function Ds(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}var U_=20,Ur=[g.WpEmailApi];function $_(e){return{async readRevisions(t,n=1){const r=await g.getApi(e,Ur).email_revisions_list({parent:t,per_page:U_,page:n},{extraQuery:{_fields:F_}}),i=(r?.data??[]).map(c=>o.WpEmailRevisionToEmailRevision(c)),a=Number(r?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=g.getApi(e,Ur),[r,i]=await Promise.all([n.email_autosaves_list({id:t},{extraQuery:{_fields:B_}}),n.email_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(r?.data??[]).map(d=>{const u=d,m=o.WpEmailRevisionToEmailRevision(u),f=Ds(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse(Ds(i?.data?.modified_gmt)??"");return o.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const r=await g.getApi(e,Ur).email_autosaves_create({id:t},o.EmailAutoSaveToWpEmailAutoSave({...n,excerpt:new Date().toISOString()}),{type:g.ContentType.FormData});return o.WpEmailRevisionToEmailRevision(r?.data)}}}var Fs=["_embedded","id","author","title","meta","emailtags","folder","group","modified","date","type","parent","date_gmt","acf.description","acf.html","acf.common_styles","acf.is_template","acf.lock","acf.parent_email","acf.project","acf.secret_hash","acf.subject","acf.utm_parameters"].join(","),$r=[g.WpEmailApi],Bs=e=>o.EmailToWpEmail(e);function z_(e){return{async readEmail(t){const n=await g.getApi(e,$r).email_detail({id:o.toNumberSafe(t)},{extraQuery:{_embed:"wp:term",_fields:Fs}});if(!n)throw new o.EmailOpenFailedError("unavailable");if(n.ok===!1)throw o.openFailureFromResponse(n);return n.data?o.WpEmailToEmail(n.data):null},async createEmail(t){const n={status:"publish",...Bs(t)},r=await g.getApi(e,$r).email_create(n,{type:g.ContentType.Json});return o.WpEmailToEmail(r?.data)},async updateEmail(t,n){const r=await g.getApi(e,$r).email_partial_update({id:t},Bs(n),{type:g.ContentType.Json,extraQuery:{_embed:"wp:term",_fields:Fs}});return o.WpEmailToEmail(r?.data)}}}function G_(e){o.injectRestEmailPortFactories(e,{email:z_,history:$_,blockHistory:D_})}var zr=20,W_=({source:e,emailtags:t,group:n,tags:r,...i})=>i;function H_({revisions:e,revisionsByBlock:t}){const n=async(r,i)=>(t.clear(),await t.get(r,{page:i}),(await e.cache.values()??[]).filter(a=>String(a?.parent)===String(r)));return{async readRevisions(r,i=1){const a=await n(r,i);return{revisions:a.slice(zr*(i-1),zr*i),page:i,hasMore:a.length>zr*i}},async readAutosave(r){return o.autosaveStateFromRevisions(await n(r,1))},async saveAutosave(r,i){const a=W_(i);return await e.create({...a,parent:r,modified:new Date().toString()})}}}var Us=g.createIdentifier$1("blockDocuments.provided");function q_(e){if(e.getInstance(Us))return;e.inject(Us,!0);const t=o.blockRevisionsDataSourceProvider(e);o.injectBlockHistoryPort(e,H_({revisions:t,revisionsByBlock:t.byForeignKey("parent")}))}var V_=zt.__commonJSMin(((e,t)=>{(function(n){if(typeof window>"u")return;var r=0,i,a=!1,c=!1,d=7,u="[iFrameSizer]",m=u.length,f=null,h=window.requestAnimationFrame,_=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),p={},S=null,k=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){j("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function v(C,T,P){C.addEventListener(T,P,!1)}function A(C,T,P){C.removeEventListener(T,P,!1)}function x(){for(var C=["moz","webkit","o","ms"],T=0;T<C.length&&!h;T+=1)h=window[C[T]+"RequestAnimationFrame"];h?h=h.bind(window):L("setup","RequestAnimationFrame not supported")}function K(C){var T="Host page: "+C;return window.top!==window.self&&(T=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+C:"Nested host page: "+C),T}function Z(C){return u+"["+K(C)+"]"}function M(C){return p[C]?p[C].log:a}function L(C,T){z("log",C,T,M(C))}function I(C,T){z("info",C,T,M(C))}function j(C,T){z("warn",C,T,!0)}function z(C,T,P,N){N===!0&&window.console}function B(C){function T(){function U(){et(ie),ee(te),We("onResized",ie)}b("Height"),b("Width"),Ee(U,ie,"init")}function P(){var U=Xe.slice(m).split(":"),le=U[1]?parseInt(U[1],10):0,xe=p[U[0]]&&p[U[0]].iframe,Se=getComputedStyle(xe);return{iframe:xe,id:U[0],height:le+N(Se)+D(Se),width:U[2],type:U[3]}}function N(U){return U.boxSizing!=="border-box"?0:(U.paddingTop?parseInt(U.paddingTop,10):0)+(U.paddingBottom?parseInt(U.paddingBottom,10):0)}function D(U){return U.boxSizing!=="border-box"?0:(U.borderTopWidth?parseInt(U.borderTopWidth,10):0)+(U.borderBottomWidth?parseInt(U.borderBottomWidth,10):0)}function b(U){var le=Number(p[te]["max"+U]),xe=Number(p[te]["min"+U]),Se=U.toLowerCase(),Ne=Number(ie[Se]);L(te,"Checking "+Se+" is in range "+xe+"-"+le),Ne<xe&&(Ne=xe,L(te,"Set "+Se+" to min value")),Ne>le&&(Ne=le,L(te,"Set "+Se+" to max value")),ie[Se]=""+Ne}function W(){function U(){function Se(){var He=0,Ue=!1;for(L(te,"Checking connection is from allowed list of origins: "+xe);He<xe.length;He++)if(xe[He]===le){Ue=!0;break}return Ue}function Ne(){var He=p[te]&&p[te].remoteHost;return L(te,"Checking connection is from: "+He),le===He}return xe.constructor===Array?Se():Ne()}var le=C.origin,xe=p[te]&&p[te].checkOrigin;if(xe&&""+le!="null"&&!U())throw new Error("Unexpected message received from: "+le+" for "+ie.iframe.id+". Message was: "+C.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Pe(){return u===(""+Xe).slice(0,m)&&Xe.slice(m).split(":")[0]in p}function Ae(){var U=ie.type in{true:1,false:1,undefined:1};return U&&L(te,"Ignoring init message from meta parent page"),U}function Qe(U){return Xe.slice(Xe.indexOf(":")+d+U)}function Ge(U){L(te,"onMessage passed: {iframe: "+ie.iframe.id+", message: "+U+"}"),We("onMessage",{iframe:ie.iframe,message:JSON.parse(U)}),L(te,"--")}function Ze(){var U=document.body.getBoundingClientRect(),le=ie.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:le.height,iframeWidth:le.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(le.top-U.top,10),offsetLeft:parseInt(le.left-U.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function mt(U,le){function xe(){fe("Send Page Info","pageInfo:"+Ze(),U,le)}Ce(xe,32,le)}function vt(){function U(Ne,He){function Ue(){p[Se]?mt(p[Se].iframe,Se):le()}["scroll","resize"].forEach(function(rt){L(Se,Ne+rt+" listener for sendPageInfo"),He(window,rt,Ue)})}function le(){U("Remove ",A)}function xe(){U("Add ",v)}var Se=te;xe(),p[Se]&&(p[Se].stopPageInfo=le)}function ft(){p[te]&&p[te].stopPageInfo&&(p[te].stopPageInfo(),delete p[te].stopPageInfo)}function lt(){var U=!0;return ie.iframe===null&&(j(te,"IFrame ("+ie.id+") not found"),U=!1),U}function G(U){var le=U.getBoundingClientRect();return q(te),{x:Math.floor(Number(le.left)+Number(f.x)),y:Math.floor(Number(le.top)+Number(f.y))}}function Y(U){function le(){f=He,ne(),L(te,"--")}function xe(){return{x:Number(ie.width)+Ne.x,y:Number(ie.height)+Ne.y}}function Se(){window.parentIFrame?window.parentIFrame["scrollTo"+(U?"Offset":"")](He.x,He.y):j(te,"Unable to scroll to requested position, window.parentIFrame not found")}var Ne=U?G(ie.iframe):{x:0,y:0},He=xe();L(te,"Reposition requested from iFrame (offset x:"+Ne.x+" y:"+Ne.y+")"),window.top===window.self?le():Se()}function ne(){We("onScroll",f)===!1?Fe():ee(te)}function ue(U){function le(){var Ue=G(He);L(te,"Moving to in page link (#"+Se+") at x: "+Ue.x+" y: "+Ue.y),f={x:Ue.x,y:Ue.y},ne(),L(te,"--")}function xe(){window.parentIFrame?window.parentIFrame.moveToAnchor(Se):L(te,"In page link #"+Se+" not found and window.parentIFrame not found")}var Se=U.split("#")[1]||"",Ne=decodeURIComponent(Se),He=document.getElementById(Ne)||document.getElementsByName(Ne)[0];He?le():window.top===window.self?L(te,"In page link #"+Se+" not found"):xe()}function ge(U){var le={};if(Number(ie.width)===0&&Number(ie.height)===0){var xe=Qe(9).split(":");le={x:xe[1],y:xe[0]}}else le={x:ie.width,y:ie.height};We(U,{iframe:ie.iframe,screenX:Number(le.x),screenY:Number(le.y),type:ie.type})}function We(U,le){return $(te,U,le)}function Ve(){switch(p[te]&&p[te].firstRun&&Me(),ie.type){case"close":pe(ie.iframe);break;case"message":Ge(Qe(6));break;case"mouseenter":ge("onMouseEnter");break;case"mouseleave":ge("onMouseLeave");break;case"autoResize":p[te].autoResize=JSON.parse(Qe(9));break;case"scrollTo":Y(!1);break;case"scrollToOffset":Y(!0);break;case"pageInfo":mt(p[te]&&p[te].iframe,te),vt();break;case"pageInfoStop":ft();break;case"inPageLink":ue(Qe(9));break;case"reset":ve(ie);break;case"init":T(),We("onInit",ie.iframe);break;default:Number(ie.width)===0&&Number(ie.height)===0?j("Unsupported message received ("+ie.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):T()}}function at(U){var le=!0;return p[U]||(le=!1,j(ie.type+" No settings for "+U+". Message was: "+Xe)),le}function Bt(){for(var U in p)fe("iFrame requested init",Q(U),p[U].iframe,U)}function Me(){p[te]&&(p[te].firstRun=!1)}var Xe=C.data,ie={},te=null;Xe==="[iFrameResizerChild]Ready"?Bt():Pe()?(ie=P(),te=ie.id,p[te]&&(p[te].loaded=!0),!Ae()&&at(te)&&(L(te,"Received: "+Xe),lt()&&W()&&Ve())):I(te,"Ignored: "+Xe)}function $(C,T,P){var N=null,D=null;if(p[C])if(N=p[C][T],typeof N=="function")D=N(P);else throw new TypeError(T+" on iFrame["+C+"] is not a function");return D}function de(C){var T=C.id;delete p[T]}function pe(C){var T=C.id;if($(T,"onClose",T)===!1){L(T,"Close iframe cancelled by onClose event");return}L(T,"Removing iFrame: "+T);try{C.parentNode&&C.parentNode.removeChild(C)}catch(P){j(P)}$(T,"onClosed",T),L(T,"--"),de(C),i&&(i.disconnect(),i=null)}function q(C){f===null&&(f={x:window.pageXOffset===n?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===n?document.documentElement.scrollTop:window.pageYOffset},L(C,"Get page position: "+f.x+","+f.y))}function ee(C){f!==null&&(window.scrollTo(f.x,f.y),L(C,"Set page position: "+f.x+","+f.y),Fe())}function Fe(){f=null}function ve(C){function T(){et(C),fe("reset","reset",C.iframe,C.id)}L(C.id,"Size reset requested by "+(C.type==="init"?"host page":"iFrame")),q(C.id),Ee(T,C,"reset")}function et(C){function T(b){if(!C.id){L("undefined","messageData id not set");return}C.iframe.style[b]=C[b]+"px",L(C.id,"IFrame ("+D+") "+b+" set to "+C[b]+"px")}function P(b){!c&&C[b]==="0"&&(c=!0,L(D,"Hidden iFrame detected, creating visibility listener"),Be())}function N(b){T(b),P(b)}var D=C.iframe.id;p[D]&&(p[D].sizeHeight&&N("height"),p[D].sizeWidth&&N("width"))}function Ee(C,T,P){P!==T.type&&h&&!window.jasmine?(L(T.id,"Requesting animation frame"),h(C)):C()}function fe(C,T,P,N,D){function b(){var Ge=p[N]&&p[N].targetOrigin;L(N,"["+C+"] Sending msg to iframe["+N+"] ("+T+") targetOrigin: "+Ge),P.contentWindow.postMessage(u+T,Ge)}function W(){j(N,"["+C+"] IFrame("+N+") not found")}function Pe(){P&&"contentWindow"in P&&P.contentWindow!==null?b():W()}function Ae(){function Ge(){p[N]&&!p[N].loaded&&!Qe&&(Qe=!0,j(N,"IFrame has not responded within "+p[N].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}D&&p[N]&&p[N].warningTimeout&&(p[N].msgTimeout=setTimeout(Ge,p[N].warningTimeout))}var Qe=!1;N=N||P.id,p[N]&&(Pe(),Ae())}function Q(C){return C+":"+p[C].bodyMarginV1+":"+p[C].sizeWidth+":"+p[C].log+":"+p[C].interval+":"+p[C].enablePublicMethods+":"+p[C].autoResize+":"+p[C].bodyMargin+":"+p[C].heightCalculationMethod+":"+p[C].bodyBackground+":"+p[C].bodyPadding+":"+p[C].tolerance+":"+p[C].inPageLinks+":"+p[C].resizeFrom+":"+p[C].widthCalculationMethod+":"+p[C].mouseEvents}function me(C){return typeof C=="number"}function ae(C,T){function P(){function Y(ue){var ge=p[G][ue];ge!==1/0&&ge!==0&&(C.style[ue]=me(ge)?ge+"px":ge,L(G,"Set "+ue+" = "+C.style[ue]))}function ne(ue){if(p[G]["min"+ue]>p[G]["max"+ue])throw new Error("Value for min"+ue+" can not be greater than max"+ue)}ne("Height"),ne("Width"),Y("maxHeight"),Y("minHeight"),Y("maxWidth"),Y("minWidth")}function N(){var Y=T&&T.id||k.id+r++;return document.getElementById(Y)!==null&&(Y+=r++),Y}function D(Y){if(typeof Y!="string")throw new TypeError("Invaild id for iFrame. Expected String");return Y===""&&(C.id=Y=N(),a=(T||{}).log,L(Y,"Added missing iframe ID: "+Y+" ("+C.src+")")),Y}function b(){switch(L(G,"IFrame scrolling "+(p[G]&&p[G].scrolling?"enabled":"disabled")+" for "+G),C.style.overflow=(p[G]&&p[G].scrolling)===!1?"hidden":"auto",p[G]&&p[G].scrolling){case"omit":break;case!0:C.scrolling="yes";break;case!1:C.scrolling="no";break;default:C.scrolling=p[G]?p[G].scrolling:"no"}}function W(){(typeof(p[G]&&p[G].bodyMargin)=="number"||(p[G]&&p[G].bodyMargin)==="0")&&(p[G].bodyMarginV1=p[G].bodyMargin,p[G].bodyMargin=""+p[G].bodyMargin+"px")}function Pe(){var Y=p[G]&&p[G].firstRun,ne=p[G]&&p[G].heightCalculationMethod in _;!Y&&ne&&ve({iframe:C,height:0,width:0,type:"init"})}function Ae(){p[G]&&(p[G].iframe.iFrameResizer={close:pe.bind(null,p[G].iframe),removeListeners:de.bind(null,p[G].iframe),resize:fe.bind(null,"Window resize","resize",p[G].iframe),moveToAnchor:function(Y){fe("Move to anchor","moveToAnchor:"+Y,p[G].iframe,G)},sendMessage:function(Y){Y=JSON.stringify(Y),fe("Send Message","message:"+Y,p[G].iframe,G)}})}function Qe(Y){function ne(){fe("iFrame.onload",Y,C,n,!0),Pe()}function ue(We){if(!C.parentNode)return null;var Ve=new We(function(at){at.forEach(function(Bt){Array.prototype.slice.call(Bt.removedNodes).forEach(function(Me){Me===C&&pe(C)})})});return Ve.observe(C.parentNode,{childList:!0}),Ve}var ge=w();ge&&(i=ue(ge)),v(C,"load",ne),fe("init",Y,C,n,!0)}function Ge(Y){if(typeof Y!="object")throw new TypeError("Options is not an object")}function Ze(Y){for(var ne in k)Object.prototype.hasOwnProperty.call(k,ne)&&(p[G][ne]=Object.prototype.hasOwnProperty.call(Y,ne)?Y[ne]:k[ne])}function mt(Y){return Y===""||Y.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":Y}function vt(Y){var ne=Y.split("Callback");if(ne.length===2){var ue="on"+ne[0].charAt(0).toUpperCase()+ne[0].slice(1);this[ue]=this[Y],delete this[Y],j(G,"Deprecated: '"+Y+"' has been renamed '"+ue+"'. The old method will be removed in the next major version.")}}function ft(Y){Y=Y||{},p[G]=Object.create(null),p[G].iframe=C,p[G].firstRun=!0,p[G].remoteHost=C.src&&C.src.split("/").slice(0,3).join("/"),Ge(Y),Object.keys(Y).forEach(vt,Y),Ze(Y),p[G]&&(p[G].targetOrigin=p[G].checkOrigin===!0?mt(p[G].remoteHost):"*")}function lt(){return G in p&&"iFrameResizer"in C}var G=D(C.id);lt()?j(G,"Ignored iFrame, already setup."):(ft(T),b(),P(),W(),Qe(Q(G)),Ae())}function se(C,T){S===null&&(S=setTimeout(function(){S=null,C()},T))}var Ie={};function Ce(C,T,P){Ie[P]||(Ie[P]=setTimeout(function(){Ie[P]=null,C()},T))}function Be(){function C(){function D(b){function W(Ae){return(p[b]&&p[b].iframe.style[Ae])==="0px"}function Pe(Ae){return Ae.offsetParent!==null}p[b]&&Pe(p[b].iframe)&&(W("height")||W("width"))&&fe("Visibility change","resize",p[b].iframe,b)}Object.keys(p).forEach(function(b){D(b)})}function T(D){L("window","Mutation observed: "+D[0].target+" "+D[0].type),se(C,16)}function P(){var D=document.querySelector("body");new N(T).observe(D,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0})}var N=w();N&&P()}function J(C){function T(){Te("Window "+C,"resize")}L("window","Trigger event: "+C),se(T,16)}function ye(){function C(){Te("Tab Visible","resize")}document.visibilityState!=="hidden"&&(L("document","Trigger event: Visibility change"),se(C,16))}function Te(C,T){function P(N){return p[N]&&p[N].resizeFrom==="parent"&&p[N].autoResize&&!p[N].firstRun}Object.keys(p).forEach(function(N){P(N)&&fe(C,T,p[N].iframe,N)})}function he(){v(window,"message",B),v(window,"resize",function(){J("resize")}),v(document,"visibilitychange",ye),v(document,"-webkit-visibilitychange",ye)}function je(){function C(N,D){function b(){if(D.tagName){if(D.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+D.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}D&&(b(),ae(D,N),P.push(D))}function T(N){N&&N.enablePublicMethods&&j("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var P;return x(),he(),function(D,b){switch(P=[],T(D),typeof b){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(b||"iframe"),C.bind(n,D));break;case"object":C(D,b);break;default:throw new TypeError("Unexpected data type ("+typeof b+")")}return P}}function ze(C){C.fn?C.fn.iFrameResize||(C.fn.iFrameResize=function(P){function N(D,b){ae(b,P)}return this.filter("iframe").each(N).end()}):I("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==n&&ze(window.jQuery),typeof define=="function"&&define.amd?define([],je):typeof t=="object"&&typeof t.exports=="object"&&(t.exports=je()),window.iFrameResize=window.iFrameResize||je()})()})),Y_=zt.__toESM(V_()),K_={checkOrigin:!1,minHeight:600,scrolling:!1};function Q_(e){const t=()=>e.iFrameResizer;return(0,Y_.default)(K_,e),{resize:()=>t()?.resize?.(),dispose:()=>t()?.removeListeners?.()}}function X_(e){e.inject(Ni,Q_)}function J_(e){const t=o.getMessageService(e),n=e.getInstance(o.LOCALE_SERVICE_ID);if(!n)return;let r="";const i=()=>{const d=n.snapshot(),u=d.id??"";if(!t.isInited()||u===r)return;const m=o.createI18n(d.catalog),f=_=>m.__(_),h=o.SANDBOX_TRANSLATIONS_MAP(f);r=u,t.send(o.EVENT_TYPES.SANDBOX_TRANSLATIONS,{name:u,data:h})},a=t.onInit(()=>{r="",i()}),c=n.state.watch(i);e.getInstance(g.DISPOSABLE_ID)?.addDispose(()=>{a.dispose(),c.dispose()})}function Z_(e){const t=e?.content?.templateId;return t==null||t===""?void 0:String(t)}function eb(e){e.getInstance(g.OPTIONS_SOURCE_ID)?.watch(t=>{const n=Z_(t);n!==void 0&&Hh(e,n)})}var Gr={en_US:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/7b8ce310.js")),void 0,{}.url),ru_RU:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/5f7f72e9.js")).then(e=>e.ru_RU_exports),void 0,{}.url),uk_UA:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/afb434bd.js")),void 0,{}.url),es_ES:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/dbb931dd.js")),void 0,{}.url),pt_BR:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/7cc4b0e9.js")),void 0,{}.url),de_DE:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/1cb0ff80.js")),void 0,{}.url),fr_FR:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/adf163ad.js")),void 0,{}.url),it_IT:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/6a5804ca.js")),void 0,{}.url),pl_PL:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/9ce867fe.js")),void 0,{}.url)};async function tb(e){const t=Gr[e];if(!t){const n=Gr.en_US;return n?(await n()).default:void 0}return(await t()).default}var x0=Object.keys(Gr),nb=e=>e==="uk"?"uk_UA":e;function ob(e){e.getInstance(o.LOCALE_SERVICE_ID)?.useAntdLoader(t=>tb(nb(t)))}var $s={id:"ru_RU",time:1790612299,hash:"12de8d6a5e2f68343bd8b4f78da589e3b0af7c67ec27bfe1cc93b975c014c332",catalog:JSON.parse(`{"":{"domain":"default","lang":"ru_RU","plural_forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2);"}," Add section":["Добавить раздел"]," email was":["письмо","письма","писем"]," from the project successfully.":["из проекта."]," successfully imported.":["импортировано."],"\\" email?":["»?"],"\\" was successfully created.":["\\" создано."],"\\" was successfully removed.":["» удалён."],"%d day":["%d день","%d дня","%d дней"],"%d day left":["%d день остался","%d дня осталось","%d дней осталось"],"%s plan":["Тариф %s"],"+0:00 London, Lisbon, Dublin":["+0:00 Лондон, Лиссабон, Дублин"],"+10:00 Sydney, Melbourne, Port Moresby":["+10:00 Сидней, Мельбурн, Порт-Морсби"],"+11:00 Honiara, Nuku'alofa, Apia":["+11:00 Хониара, Нукуалофа, Апиа"],"+1:00 Paris, Berlin, Rome":["+1:00 Париж, Берлин, Рим"],"+2:00 Athens, Kiev, Istanbul":["+2:00 Афины, Киев, Стамбул"],"+3:00 Istanbul, Doha, Baghdad":["+3:00 Москва, Санкт-Петербург, Киев"],"+4:00 Baku, Dubai, Tbilisi":["+4:00 Баку, Дубай, Тбилиси"],"+5:00 Karachi, Tashkent, Islamabad":["+5:00 Екатеринбург, Ташкент, Исламабад"],"+6:00 Almaty, Dhaka, Bishkek":["+6:00 Алматы, Дакка, Омск"],"+7:00 Bangkok, Ho Chi Minh City, Jakarta":["+7:00 Бангкок, Хошимин, Джакарта"],"+8:00 Beijing, Hong Kong, Singapore":["+8:00 Пекин, Гонконг, Сингапур"],"+9:00 Tokyo, Seoul, Jayapura":["+9:00 Токио, Сеул, Якутск"],"-10:00 Honolulu, Anchorage":["-10:00 Гонолулу, Анкоридж"],"-11:00 Pago Pago, Midway Atoll":["- 11:00 Паго-Паго, атолл Мидуэй"],"-12:00 Apia":["-12:00 Апиа"],"-1:00 Azores, Cape Verde":["-1:00 Азорские острова, Кабо-Верде"],"-2:00 South Georgia, Saint Helena":["-2:00 Южная Джорджия, остров Святой Елены"],"-3:00 Buenos Aires, Santiago, Montevideo":["-3:00 Буэнос-Айрес, Сантьяго, Монтевидео"],"-4:00 Caracas, Santo Domingo":["-4:00 Каракас, Санто-Доминго"],"-5:00 New York, Toronto, Havana":["-5:00 Нью-Йорк, Торонто, Гавана"],"-6:00 Mexico City, Guadalajara":["-6:00 Мехико, Гвадалахара"],"-7:00 Denver, Phoenix":["-7:00 Денвер, Феникс"],"-8:00 Los Angeles, Vancouver":["-8:00 Лос-Анджелес, Ванкувер"],"-9:00 Anchorage, Yukon":["-9:00 Анкоридж, Юкон"],"/ month":["/ месяц"],"1000+":["1000+"],"11–50":["11–50"],"12 hours":["12 часов"],"123456, City, 1 Example St.":["123456, Город, ул. Пример, 1"],"14 days free":["14 дней бесплатно"],"1–10":["1–10"],"20 s":["20 s"],"201–500":["201–500"],"24 hours":["24 часа"],"40 s":["40 s"],"501–1000":["501–1000"],"51–200":["51–200"],"60 s":["60 s"],"<1>Upload your own templates</1> or use <2>ready-made ones</2> to create emails from blocks.":["<1>Загружайте свои шаблоны</1> или используйте <2>готовые</2> для создания писем из блоков."],"A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.":["Расширение браузера (например, Urban VPN Proxy или аналогичные блокировщики рекламы/VPN-сервисы) вставляет код в окно предварительного просмотра письма. Это может привести к повреждению шаблона при сохранении."],"A flexible plan tailored to your needs":["Гибкий план, разработанный с учетом ваших потребностей"],"A shareable link to this page has been copied to the clipboard.":["Ссылка на страницу предпросмотра скопирована в буфер обмена."],"A test email can be sent to a maximum of 10 addresses.":["Тестовое письмо можно отправить максимум на 10 адресов."],"A-Z":["А-Я"],"AI":["AI"],"AI Assistant":["AI Ассистент"],"AI assistant":["AI Ассистент"],"AI email generation":["AI генерация письма"],"AI image":["AI картинка"],"AI image generation":["AI генерация изображений"],"AI requests":["Запросы к ИИ"],"AMP":["AMP"],"AMP visibility":["Видимость в AMP"],"API Key":["Ключ API"],"API Token":["Токен API"],"API URL":["URL API"],"Above":["Сверху"],"Accepted formats: PNG, JPG, WEBP, SVG or GIF.":["Доступные форматы: PNG, JPG, SVG или GIF."],"Access Key ID":["Идентификатор ключа доступа"],"Access keys and integration":["Ключи доступа и интеграция"],"Accessibility":["Доступность"],"Accessibility text":["Текст для людей с ограниченными возможностями"],"Accordion":["Аккордеон"],"Account Login":["Логин"],"Account settings":["Настройки аккаунта"],"Actions with the chosen text":["Действия с выбранным текстом"],"Active date background color":["Цвет фона активной даты"],"Active date font":["Шрифт активной даты"],"Add a common block":["Добавить общий блок"],"Add a font file or a link to the font.":["Добавьте файл шрифта или ссылку на него."],"Add a new folder":["Добавить новую папку"],"Add a new group":["Добавить группу"],"Add a new project":["Создать проект"],"Add a note":["Добавить метку"],"Add a saved block":["Добавить сохранённый блок"],"Add a template block":["Добавить шаблонный блок"],"Add an empty block":["Добавить пустой блок"],"Add block":["Добавить блок"],"Add button":["Добавить кнопку"],"Add card":["Добавить карточку"],"Add color":["Добавить цвет"],"Add column":["Добавить колонку"],"Add first color":["Добавить первый цвет"],"Add first link":["Добавить первую ссылку"],"Add group":["Добавить группу"],"Add image":["Изображение"],"Add inline image":["Вставить картинку"],"Add paragraph":["Добавить абзац"],"Add slide":["Добавить слайд"],"Add social network":["Добавить соцсеть"],"Add social network links to use in your email templates.":["Добавьте ссылки на соцсети, чтобы использовать их в шаблонах писем."],"Add some tags":["Укажите несколько тегов"],"Add up to 10 recipients":["Добавьте до 10 получателей"],"Add value":["Добавить значение"],"Add your brand palette and reuse it in the email editor.":["Добавьте палитру бренда и используйте её в редакторе писем."],"Add your first block to the folder...":["Добавьте свой первый блок в папку..."],"Added Drawing":["Добавление рисунка"],"Added Frame":["Добавление рамки"],"Added Image":["Добавление изображения"],"Added Shape":["Добавление фигуры"],"Added Sticker":["Добавление стикера"],"Added Text":["Добавление текста"],"Address of any S3-compatible storage, for example https://storage.example.com":["Адрес любого S3-совместимого хранилища, например https://storage.example.com"],"Adds VML markup so the background image is visible in Outlook.":["Добавляет разметку VML, чтобы фоновое изображение отображалось в Outlook."],"Adds bulletproof VML markup so the button keeps rounded corners in Outlook.":["Добавляет разметку VML, благодаря чему кнопка сохраняет закругленные углы в Outlook."],"Administrator":["Администратор"],"Align bottom":["По нижнему краю"],"Align center":["По центру"],"Align left":["Влево"],"Align middle":["Посередине"],"Align right":["Вправо"],"Align top":["По верхнему краю"],"Alignments":["Выравнивание"],"All":["Все"],"All EmailMaker features are available for 14 days":["Все функции EmailMaker доступны в течение 14 дней."],"All blocks saved at this point can be found in the “Saved Blocks” section in the sidebar.":["Все сохраненные на данный момент блоки можно найти в разделе «Сохраненные блоки» на боковой панели."],"All blocks saved successfully.":["Все блоки сохранены."],"All emails sent to this address will be added to your project as a template.":["Все письма, которые придут на этот адрес, будут добавлены в ваш проект в виде шаблона"],"All folders":["Все папки"],"All roles":["Все роли"],"Allow multiple selection":["Разрешить множественный выбор"],"Allowed protocols":["Допустимые протоколы"],"Already imported":["Уже импортировано"],"Altcraft":["Altcraft"],"Alternative text":["Альтернативный текст"],"Always":["Всегда"],"Amount":["Сумма"],"An unexpected error has occurred. Our team has already been notified. Please try reloading the page.":["Произошла непредвиденная ошибка. Наша команда уже получила уведомление. Попробуйте перезагрузить страницу."],"Anchor":["Якорь"],"Anchor links do not work in Outlook, Gmail, and several other email clients.":["Якорные ссылки не работают в Outlook, Gmail и ряде других почтовых клиентов."],"Anchor name":["Имя якоря"],"Animate":["Анимация"],"Annotation type":["Тип аннотации"],"Annotations":["Аннотации"],"Any additional details":["Любые дополнительные сведения"],"Appearance":["Внешний вид"],"Appearance on mobile devices":["Внешний вид на мобильных устройствах"],"Applied Filters":["Применение фильтров"],"Apply":["Применить"],"Apply horizontal padding to height":["Применить горизонтальный отступ к высоте"],"Approaching usage limit. Remaining":["Приближается предел использования. Остаток"],"Apps":["Приложения"],"Are you sure you want to delete project ":["Вы уверены, что хотите удалить проект "],"Are you sure you want to disable this integration?":["Вы уверены, что хотите отключить эту интеграцию?"],"Are you sure you want to leave the project ":["Вы уверены, что хотите покинуть проект "],"Are you sure?":["Вы уверены"],"Around":["Вокруг"],"Arrow":["Стрелка"],"Arrow color":["Цвет стрелки"],"Article":["Статьи"],"At least 8 characters in both cases, including letters, numbers, and special characters.":["Минимум 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters.":["Не менее 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least one card needs an image and a link starting with https://":["Нужна хотя бы одна карточка с изображением и ссылкой, начинающейся с https://"],"Author":["Автор"],"Authorization error via Yandex":["Ошибка авторизации через Яндекс"],"Authorization keys":["Ключи авторизации"],"Auto":["Авто"],"Auto-payment enabled":["Автоплатёж включён"],"Auto-payment will be available once the subscription is linked in the payment system.":["Автоматическая оплата станет доступна после привязки подписки в платежной системе."],"Auto-prepend protocol on blur":["Автоматически добавлять протокол при потере фокуса"],"Autoplay":["Автозапуск"],"Autosave in editor":["Автосохранение в редакторе"],"Available formats: HTML, EML, ZIP":["Доступные форматы: HTML, EML, ZIP"],"Available until:":["Оплачен до:"],"BIK (bank ID)":["БИК"],"BIK must be 9 digits":["БИК должен состоять из 9 цифр"],"Back":["Назад"],"Back Home":["Вернуться"],"Back To Project":["Вернуться в проект"],"Back To Projects":["Вернуться к проектам"],"Back to Log In":["Вернуться к авторизации"],"Back to integrations":["К интеграциям"],"Background":["Фон"],"Background color":["Цвет фона"],"Background color of the contrast blocks":["Цвет фона контрастных блоков"],"Background image":["Фоновое изображение"],"Background image in Outlook (VML)":["Фоновое изображение в Outlook (VML)"],"Background image link/route":["Ссылка на фоновое изображение"],"Background image repeat":["Повтор фона"],"Background image size":["Размер фона"],"Bank account (RUB)":["Банковский счет (рубли)"],"Bank name":["Название банка"],"Banners":["Баннеры"],"Base URL for public access to files":["Базовый адрес для публичного доступа к файлам"],"Base background color":["Базовый цвет фона"],"Base colors":["Базовые цвета"],"Base path for uploading files":["Базовый путь для загрузки файлов"],"Base text color":["Базовый цвет текста"],"Beach":["Пляж"],"Before exporting the project, make sure to provide the URL where the webhook request will be sent":["Перед экспортом проекта необходимо заполнить url, на который будет отправляться запрос webHook"],"Below":["Снизу"],"Between bullets and text":["Между буллетами и текстом"],"Between list items":["Между пунктами списка"],"Billing":["Тарифы и оплата"],"Billing period":["Расчетный период"],"Black":["Чёрный"],"Black and White":["Чёрно-белые"],"Black circle":["Чёрный круг"],"Black circle outlined":["Чёрный круг обводка"],"Blank template":["Пустой шаблон"],"Block":["Блок"],"Block name":["Название блока"],"Block not yet loaded or global container not found.":["Код блока не загружен или глобальный контейнер не найден."],"Block styles":["Стили блока"],"Blocks":["Блоки"],"Blocks background color":["Цвет фона блоков"],"Blocks not found":["Блоки не найдены."],"Blocks search":["Поиск блоков"],"Blocks storage":["Хранилище Blocks"],"Blue":["Синий"],"Blur radius":["Размытие"],"Body":["Сообщение"],"Border":["Рамка"],"Border color":["Цвет рамки"],"Border radius":["Скругление"],"Borders":["Рамка"],"Both":["Всегда"],"Bottom":["Снизу"],"Bottom Code panel":["Панель кода снизу"],"Bottom left corner":["Нижний левый угол"],"Bottom margin":["Отступ снизу"],"Bottom padding":["Отступ снизу"],"Bottom padding of the general text":["Нижний отступ у текста"],"Bottom right corner":["Нижний правый угол"],"Box shadow":["Тень"],"Broadcast successfully created!":["Выпуск успешно создан!"],"Browser extension detected":["Обнаружено расширение для браузера"],"Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.":["Включена функция перевода страницы в браузере (например, Google Translate). Это может привести к сбоям в работе редактора и вызывать ошибки при сохранении."],"Browser translation detected":["Обнаружен перевод с помощью браузера"],"Brush Color":["Цвет кисти"],"Brush Size":["Размер кисти"],"Brush Type":["Тип кисти"],"Bubbles":["Пузыри"],"Bucket name":["Имя бакета"],"Build newsletters from scratch with <1>structures and elements</1>.":["Собирайте рассылки с нуля с помощью <1>структур и элементов</1>."],"Bulk saving of blocks":["Массовое сохранение блоков"],"Bullet":["Буллет"],"Bullets color":["Цвет буллетов"],"Bullets font":["Шрифт буллетов"],"Bullets size":["Размер буллетов"],"Bullets type":["Тип буллетов"],"Button":["Кнопка"],"Button background color in contrasting blocks":["Цвет фона кнопок в контрастных блоках"],"Button size":["Размер кнопки"],"Button text color in contrasting blocks":["Цвет текста кнопок в контрастных блоках"],"Buttons":["Кнопки"],"Buttons background color":["Цвет фона кнопки"],"Buttons font":["Шрифт кнопки"],"Buttons font size":["Размер текста кнопки"],"Buttons letter spacing":["Межбуквенный интервал кнопки"],"Buttons text color":["Цвет текста кнопки"],"Buy":["Купить"],"Buy generations":["Купить генерации"],"Buy image check package":["Купить пакет проверки изображений"],"Buy link check package":["Купить пакет проверки ссылок"],"Buy optimization package":["Купить пакет оптимизации"],"Buy package":["Купить пакет"],"Buy spam check package":["Купить пакет проверки на спам"],"Buy test sends package":["Купить пакет тестов"],"By card":["Картой"],"Calendar":["Календарь"],"Call to Action":["Призыв к действию"],"Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it.":["Кампания создана. Dotdigital использовал отправителя по умолчанию вашей учетной записи, поскольку этот адрес электронной почты в поле «От» не зарегистрирован в качестве настраиваемого адреса отправителя. Добавьте адрес в Dotdigital и повторно экспортируйте данные, чтобы использовать его."],"Campaign successfully created!":["Кампания успешно создана!"],"Cancel":["Отмена"],"Cannot disable recurring payments":["Не удается отключить автоплатёж"],"Cannot enable recurring payments":["Не удается включить автоплатёж"],"Captcha required":["Требуется ввести капчу"],"Captcha verification failed":["Ошибка при проверке капчи"],"Caption next to checkbox":["Подпись рядом с чекбоксом"],"Caption next to options":["Подпись рядом с пунктами"],"Card":["Карточка"],"Card payment is not available for this change.":["Для данной операции оплата картой недоступна."],"Card payment is not available for this change. Use an invoice for a legal entity.":["Для данного изменения оплата картой недоступна. Для юридического лица воспользуйтесь счётом-фактурой."],"Card payment is not available for this plan change. Please contact support.":["Оплата картой недоступна при изменении тарифного плана. Пожалуйста, обратитесь в службу поддержки."],"Card payment is not available for this plan change. Use an invoice for a legal entity or contact support.":["Для данного изменения тарифного плана оплата картой недоступна. Для юридических лиц воспользуйтесь счетом-фактурой или обратитесь в службу поддержки."],"Cards":["Карточки"],"Cards view":["Карточки"],"Carousel":["Карусель"],"Case Change":["Изменение ситуации"],"Cell":["Ячейка"],"Center horizontally":["По центру"],"Center vertically":["По центру"],"Change":["Изменить"],"Change Stripo key":["Сменить ключ Stripo"],"Change folder name":["Переименовать папку"],"Change group name":["Переименовать группу"],"Change image":["Сменить изображение"],"Change name":["Переименовать"],"Change plan":["Изменить тариф"],"Change role":["Изменить роль"],"Change role to Administrator":["Изменить роль на Администратор"],"Change tariff":["Сменить тариф"],"Changed Style":["Изменение стиля"],"Changes loaded":["Изменения загружены"],"Character limit":["Ограничение по количеству символов"],"Characters":["Символы"],"Chat support":["Чат поддержки"],"Check how your email appears across various devices and email clients.":["Проверьте, как будет выглядеть ваше письмо на разных устройствах и в разных почтовых клиентах."],"Check who and when made changes to the email template and, if necessary, restore one of the previous versions.":["Проверьте, кто и когда вносил изменения в шаблон, и при необходимости восстановите одну из предыдущих версий."],"Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.":["Проверьте письмо на наличие неработающих ссылок, отсутствующих alt-текстов, тяжелых изображений и других препятствий, которые могут помешать вашим письмам попасть в почтовые ящики."],"Check your network connection and try again.":["Проверьте подключение к сети и попробуйте ещё раз."],"Checkbox":["Чекбокс"],"Checked":["Отмечено"],"Checked fill color":["Цвет заливки отмеченного"],"Checked icon URL":["URL иконки отмеченного"],"Choose":["Выбрать"],"Choose a payment method":["Выберите способ оплаты"],"Choose a plan":["Выбрать тариф"],"Choose allowed protocols":["Выберите разрешенные протоколы"],"Choose block type":["Выберите тип блока"],"Choose complexity rules":["Выберите правила сложности"],"Choose input type":["Выберите тип ввода"],"Choose plan":["Выберите тариф"],"CircleBrush":["Круги"],"Clear":["Очистить"],"Clear all":["Очистить"],"Clear border":["Очистить рамку"],"Clear chat":["Очистить чат"],"Clear chat history?":["Очистить чат?"],"Clear selection":["Очистить выбор"],"Click or drag a block":["Нажмите или перетащите блок"],"Click the Add a new project button to add your first project.":["Нажмите кнопку «Добавить проект», чтобы создать свой первый проект."],"Click to select, paste from the clipboard, or drag and drop":["Перетащите изображения сюда или вставьте из буфера"],"Client ID":["Client ID"],"Client ID copied to clipboard.":["Client ID скопирован."],"Client Secret":["Client Secret"],"Client secret copied to clipboard.":["Client Secret скопирован."],"Client secret rotated successfully.":["Client Secret перевыпущен."],"Clipboard":["Буфер обмена"],"Clone":["Дублировать"],"Clone block":["Клонировать блок"],"Clone element":["Клонировать элемент"],"Clone group":["Клонировать группу"],"Close":["Закрыть"],"Closed field background":["Фон закрытого поля"],"Code":["Код"],"Code Size Warning":["Предупреждение о размере кода"],"Code editor":["Редактор кода"],"Code mode":["Режим кода"],"Code size":["Размер кода"],"Code that will replace the image \`src\`":["Код, который заменит путь к изображению"],"Collapse section":["Свернуть раздел"],"Collection of all HTTP requests used by the plugin (Postman Collection v2.1 format).":["Коллекция всех HTTP-запросов, которые использует плагин (формат Postman Collection v2.1)."],"Color":["Цвет"],"Color of the general text":["Цвет текста"],"Color settings":["Настройки цвета"],"Colors":["Цвета"],"Column":["Колонка"],"Column gap":["Отступ между колонками"],"Columns":["Колонки"],"Come up with a hint":["Придумайте подсказку"],"Coming soon":["В разработке"],"Comment":["Комментарий"],"Comment was removed.":["Комментарий удалён."],"Common blocks":["Общие блоки"],"Company size":["Размер компании"],"Complexity rules":["Правила сложности"],"Configure":["Настроить"],"Configure %s":["Настройка %s"],"Configure integration":["Настроить интеграцию"],"Configure social network link":["Настройка ссылки на соцсеть"],"Confirmation":["Подтверждение"],"Confirmation email has been sent to {confirmedEmail}.":["На адрес {confirmedEmail} отправлено письмо с подтверждением."],"Confirmation email was sent to":["Подтверждение было отправлено на"],"Connect":["Подключить"],"Connect plugin":["Подключить плагин"],"Connected":["Подключено"],"Connection established":["Соединение установлено"],"Connection test failed.":["Не удалось проверить соединение."],"Contact":["Связаться"],"Contact List ID":["ID списка контактов"],"Contact Us":["Связаться с нами"],"Contact person (full name)":["Контактное лицо (полное имя)"],"Contact sync, content personalization, and real-time campaign results tracking.":["Синхронизация контактов, персонализация содержимого и отслеживание результатов кампаний в реальном времени."],"Contacts":["Контакты"],"Contain":["Contain"],"Container":["Контейнер"],"Container width":["Ширина блока"],"Content":["Контент"],"Content styles":["Стили контента"],"Continue":["Продолжить"],"Continue (%d)":["Продолжить (%d)"],"Continue without saving":["Продолжить без сохранения"],"Contract":["Договор"],"Contract / invoice / public offer":["Договор / счёт-фактура / публичная оферта"],"Contract date":["Дата заключения договора"],"Contract number":["Номер договора"],"Contrast block":["Контрастный блок"],"Contrast block header color":["Цвет заголовка контрастного блока"],"Contrast block text color":["Цвет текста контрастного блока"],"Contrasting background color":["Контрастный цвет фона"],"Contrasting colors":["Контрастные цвета"],"Contrasting text color":["Контрастный цвет текста"],"Conversion failed":["Конвертация не удалась"],"Convert":["Конвертировать"],"Convert into an image":["Преобразовать в изображение"],"Converting layout…":["Конвертация шаблона..."],"Copy":["Копировать"],"Copy block to clipboard":["Скопировать блок в буфер обмена"],"Copy client ID":["Скопировать Client ID"],"Copy client secret":["Скопировать Client Secret"],"Copy code":["Скопировать код"],"Copy column":["Скопировать колонку"],"Copy hex":["Копировать HEX"],"Copy to clipboard":["Скопировать в буфер обмена"],"Copywriter":["Писатель"],"Corner radius":["Скругление"],"Corners":["Углы"],"Correspondent account":["Корреспондентский счёт"],"Could not activate the trial. Please try again later or contact support.":["Не удалось активировать пробную версию. Попробуйте позже или обратитесь в службу поддержки."],"Could not move files from old storage":["Не удалось переместить файлы со старого хранилища"],"Could not reach the server. Please try again later.":["Не удалось установить соединение с сервером. Пожалуйста, попробуйте позже."],"Could not save the email":["Не удалось сохранить письмо"],"Couldn\`t determine the email width":["Не удалось определить ширину письма."],"Countdown":["Таймер"],"Countdown font settings":["Шрифт таймера"],"Country selector (flag+code)":["Выбор страны (флаг + код)"],"Cover":["Cover"],"Create":["Создать"],"Create a new email":["Создать письмо"],"Create a password":["Создайте пароль"],"Create email":["Создать письмо"],"Create folder":["Создать папку"],"Create group":["Создать группу"],"Create new block":["Создать новый блок"],"Create new email":["Создать письмо"],"Create project":["Создать проект"],"Creating an email on request":["Создание письма по запросу"],"Creation date":["Дата создания"],"Crop":["Обрезать"],"Cropped Image":["Обрезка картинки"],"Cross":["Крест"],"Current password":["Текущий пароль"],"Custom":["Пользовательский"],"Custom icon":["Пользовательская иконка"],"Customized solutions for large-scale operations with high productivity":["Индивидуальные решения для крупных компаний с высокой производительностью"],"Dark":["Тёмная"],"Dark theme":["Тёмная тема"],"Dash":["Тире"],"Dashed":["Пунктир"],"Date":["Дата"],"Date format":["Формат даты"],"Days":["Дни"],"Deal Annotation":["Аннотация акции"],"Deal Card":["Карточка акции"],"Default or bound value for the field":["Значение по умолчанию или заданное значение для поля"],"Default value":["Значение по умолчанию"],"Delete":["Удалить"],"Delete column":["Удалить колонку"],"Delete from palette":["Удалить из палитры"],"Delete from styles":["Удалить из стилей"],"Delete permanently":["Удалить навсегда"],"Delete this color from the palette?":["Удалить этот цвет из палитры?"],"Delete this font from styles?":["Удалить этот шрифт из стилей?"],"Delete this social network?":["Удалить эту соцсеть?"],"Deleted":["Удалённые"],"Deleted object":["Удаление объекта"],"Describe your project":["Опишите свой проект"],"Description":["Описание"],"Description is used in other sections of the service.":["Описание используется в других разделах сервиса."],"Description must be at most 500 characters.":["Описание не длиннее 500 символов."],"Desktop":["Десктоп"],"Desktop view":["Десктопный вид"],"Details":["Подробнее"],"Developer files":["Файлы для разработчика"],"Diamond":["Ромб"],"DiamondBrush":["Алмаз"],"Didn't receive an email?":["Не получили письмо?"],"Digits (0-9)":["Цифры (0–9)"],"Disable":["Отключить"],"Disable integration":["Отключить интеграцию"],"Disabled":["Отключенный"],"Disconnect Stripo":["Отключить Stripo"],"Discount code":["Промокод"],"Discount description":["Описание скидки"],"Discount description is required":["Нужно описание скидки"],"Discount value":["Размер скидки"],"Discount with promo code: ":["Скидка по промокоду: "],"Discuss":["Обсуждение"],"Display control":["Видимость"],"Display control & Direction":["Видимость и направление"],"Display the minimap.":["Показывать миникарту кода."],"Divider":["Разделитель"],"Do not repeat background (no-repeat)":["Не повторять фон (no-repeat)"],"Domain that serves this folder: it goes into image links in emails":["Домен, который отдаёт эту папку: он попадает в ссылки на изображения в письмах"],"Don't suggest again":["Больше не предлагать"],"Done":["Готово"],"Doodles":["Цветные"],"Dot color":["Цвет точки"],"Dotted":["Точки"],"Double arrow":["Двойная стрелка"],"Double quotation":["Двойная кавычка"],"Download":["Скачать"],"Download as is":["Скачать как есть"],"Draft Name":["Имя черновика"],"Draft campaign created! Open it to review and schedule.":["Проект кампании создан! Откройте его для проверки и планирования."],"Draft successfully created!":["Черновик создан!"],"Drag file here or upload from device":["Перетащите файл сюда или загрузите с устройства"],"Drag to reorder":["Можно перемещать"],"Draw":["Рисунок"],"Drop here":["Вставить сюда"],"Dropdown list":["Выпадающий список"],"Duration":["Длительность"],"During export, the element is converted into an image.":["При экспорте элемент преобразуется в изображение."],"E-Commerce":["Электронная коммерция"],"E-mail":["E-mail"],"Edit":["Редактировать"],"Edit block":["Свойства блока"],"Edit element":["Редактировать элемент"],"Edit group":["Свойства группы"],"Edit icon":["Редактировать иконку"],"Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!":["Редактируйте HTML-версию шаблона письма в режиме кода и наблюдайте за изменениями в реальном времени. В EmailMaker нет ограничений на код: вы можете создавать шаблоны любой сложности!"],"Editing comments":["Редактирование комментариев"],"Education":["Образование"],"Element":["Элемент"],"Elements":["Элементы"],"Email":["Email"],"Email Subject":["Тема письма"],"Email background color":["Цвет фона письма"],"Email builder for your teamwork":["Редактор писем для совместной работы"],"Email confirmation required":["Требуется подтверждение email"],"Email generation":["Генерация писем"],"Email generator":["Генератор Email"],"Email layout width":["Ширина письма"],"Email name":["Название письма"],"Email not yet loaded or global container not found.":["Код письма не загружен или глобальный контейнер не найден."],"Email optimization":["Оптимизация шаблона"],"Email platforms":["Платформы"],"Email successfully copied to clipboard.":["Адрес скопирован в буфер обмена."],"Email successfully created!":["Письмо создано!"],"Email synced with the server":["Email синхронизирован с сервером"],"Email testing":["Тестирование шаблона"],"EmailMaker storage":["Хранилище EmailMaker"],"Emails":["Письма"],"Emails not found":["По данному запросу ничего не найдено."],"Embed images in the file?":["Включить изображения в файл?"],"Emoticons":["Смайлики"],"Empty blocks":["Пустые блоки"],"Enable auto-payment":["Включить автоплатёж"],"Enabled":["Включено"],"End date":["Дата окончания"],"End time":["Время окончания"],"Endpoint":["Адрес хранилища"],"Ends":["Окончание"],"Ends in":["Заканчивается через"],"Enter Altcraft API token":["Введите токен API Altcraft"],"Enter Mailganer API key":["Введите ключ API Mailganer"],"Enter Sendsay API key":["Введите ключ API Sendsay"],"Enter URL":["Введите адрес"],"Enter Unisender API key":["Введите ключ API Unisender"],"Enter a URL starting with http:// or https://":["Адрес должен начинаться с http:// или https://"],"Enter a direct link to a font file (.woff2, .woff, .ttf, .otf) or a Google Fonts stylesheet.":["Укажите прямую ссылку на файл шрифта (.woff2, .woff, .ttf, .otf) или на стили Google Fonts."],"Enter a font name.":["Введите название шрифта."],"Enter a port between 1 and 65535":["Укажите порт от 1 до 65535"],"Enter a valid HEX color (e.g. #1F1F1F).":["Введите корректный HEX-цвет (например, #1F1F1F)."],"Enter a valid HEX color.":["Введите корректный HEX-цвет."],"Enter a valid URL (https://example.com or example.com).":["Введите корректный адрес (https://example.com или example.com)."],"Enter block name":["Укажите название блока"],"Enter color name":["Введите название цвета"],"Enter enKod API key":["Введите ключ API enKod"],"Enter font name":["Введите название шрифта"],"Enter heading":["Введите заголовок"],"Enter link":["Введите ссылку"],"Enter name":["Введите название"],"Enter path":["Введите путь"],"Enter preheader here":["Введите прехедер"],"Enter promo code":["Введите промокод"],"Enter subject line here":["Введите тему письма"],"Enter the access key":["Введите ключ доступа"],"Enter the block name":["Введите название блока"],"Enter the bucket name":["Введите имя бакета"],"Enter the confirmation code from the email and set a new password.":["Введите код подтверждения из письма и установите новый пароль."],"Enter the connection login":["Введите логин для подключения"],"Enter the connection password":["Введите пароль для подключения"],"Enter the email name":["Введите название письма"],"Enter the folder name":["Введите имя папки"],"Enter the group name":["Введите имя группы"],"Enter the project name":["Введите название проекта"],"Enter the secret key":["Введите секретный ключ"],"Enter the server host":["Введите имя хоста"],"Enter the storage endpoint":["Введите адрес хранилища"],"Enter the title of the image":["Введите название изображения"],"Enter value":["Введите значение"],"Enter your contact details":["Укажите свои контакты"],"Enter your current password":["Введите текущий пароль"],"Enter your email":["Укажите ваш email"],"Enter your email address and we will send you password reset instructions.":["Введите свой адрес электронной почты, и мы вышлем вам инструкции по сбросу пароля."],"Enter your first name":["Укажите ваше имя"],"Enter your last name":["Укажите вашу фамилию"],"Enter your new password":["Введите новый пароль"],"Enter your password":["Введите ваш пароль"],"Enter your phone or email":["Введите телефон или email"],"Equalize":["Сравнять"],"Error":["Ошибка"],"Error when initializing file manager":["Ошибка инициализации файлового менеджера"],"Error when receiving data. Try again (reload page) or contact support.":["Ошибка при получении данных. Попробуйте еще раз (перезагрузите страницу) или обратитесь в службу поддержки."],"Errors":["Ошибки"],"Evaluating the task":["Обдумываю задачу"],"Example:":["Например:"],"Expand only one section":["Раскрывать только один раздел"],"Expand section":["Развернуть раздел"],"Expires":["Действует до"],"Export":["Экспорт"],"Export emails as draft campaigns to ActiveCampaign":["Экспорт писем в ActiveCampaign в виде черновиков кампаний"],"Export emails to Altcraft":["Экспорт писем в Altcraft"],"Export emails to Bento":["Экспорт писем в Bento"],"Export emails to Brevo":["Экспорт писем в Brevo"],"Export emails to Campaign Monitor":["Экспорт писем в Campaign Monitor"],"Export emails to Constant Contact":["Экспорт писем в Constant Contact"],"Export emails to Dotdigital":["Экспорт писем в Dotdigital"],"Export emails to GetResponse":["Экспорт писем в GetResponse"],"Export emails to HubSpot":["Экспорт писем в HubSpot"],"Export emails to Klaviyo":["Экспорт писем в Klaviyo"],"Export emails to Mailchimp":["Экспорт писем в Mailchimp"],"Export emails to Mailganer":["Экспорт писем в Mailganer"],"Export emails to Salesforce":["Экспорт писем в Salesforce"],"Export emails to Sendsay":["Экспорт писем в Sendsay"],"Export emails to Unisender":["Экспорт писем в Unisender"],"Export emails to enKod":["Экспорт писем в enKod"],"Export settings":["Настройки экспорта"],"Extend plan":["Продлить тариф"],"Extra limit package":["Расширенный пакет"],"Extra package is not configured for this limit.":["Для этого ограничения дополнительный пакет не настроен."],"Extra packages are only available with CloudPayments at the moment.":["На данный момент дополнительные пакеты доступны только в CloudPayments."],"Eyedropper":["Пипетка"],"Failed to clean trash":["Не удалось очистить корзину"],"Failed to complete Yandex authorization":["Не удалось пройти авторизацию в «Яндексе»"],"Failed to copy.":["Не удалось скопировать."],"Failed to create broadcast":["Не удалось создать выпуск"],"Failed to create campaign":["Не удалось создать кампанию"],"Failed to create draft":["Не удалось создать черновик"],"Failed to create email":["Не удалось создать письмо"],"Failed to create mailing":["Не удалось создать рассылку"],"Failed to create newsletter":["Не удалось создать рассылку"],"Failed to create template":["Не удалось создать шаблон"],"Failed to download file.":["Не удалось скачать файл."],"Failed to download image from URL.":["Не удалось загрузить изображение по URL-адресу."],"Failed to export the email as images. Please try again.":["Не удалось экспортировать письмо в виде изображений. Попробуйте ещё раз."],"Failed to get file: %s":["Не удалось получить файл: %s"],"Failed to load":["Не удалось загрузить"],"Failed to load GIFs":["Не удалось загрузить GIF-файлы"],"Failed to load GIFs through the configured proxy chain.":["Не удалось загрузить GIF-файлы через настроенную цепочку прокси-серверов."],"Failed to load YaSendSuggestToken script":["Не удалось загрузить скрипт YaSendSuggestToken"],"Failed to load Yandex authorization script":["Не удалось загрузить скрипт авторизации Яндекс"],"Failed to load integrations.":["Не удалось загрузить интеграции."],"Failed to load payments.":["Не удалось загрузить платежи."],"Failed to load plugin analytics.":["Не удалось загрузить аналитику плагина."],"Failed to load plugin settings.":["Не удалось загрузить настройки плагина."],"Failed to load plugin usage.":["Не удалось загрузить статистику использования плагина."],"Failed to load project styles.":["Не удалось загрузить стили проекта."],"Failed to load stock images":["Не удалось загрузить стоковые изображения"],"Failed to load stock images through the configured proxy chain.":["Не удалось загрузить стоковые изображения через настроенную цепочку прокси-серверов."],"Failed to load storage settings.":["Не удалось загрузить настройки хранилища."],"Failed to process image URL.":["Не удалось обработать URL-адрес изображения."],"Failed to rotate client secret.":["Не удалось перевыпустить Client Secret."],"Failed to save blocks.":["Не удалось сохранить блоки."],"Failed to save integration settings.":["Не удалось сохранить настройки интеграции."],"Failed to save project settings.":["Не удалось сохранить настройки проекта."],"Failed to save project styles.":["Не удалось сохранить стили проекта."],"Failed to save storage settings.":["Не удалось сохранить настройки хранилища."],"Failed to save the image. Check the file storage settings.":["Не удалось сохранить изображение. Проверьте настройки хранилища файлов."],"Failed to update the global block.":["Не удалось обновить глобальный блок."],"Failed to update the inbox.":["Не удалось обновить папку «Входящие»."],"Features":["Возможности"],"Fewer settings":["Меньше настроек"],"Field heading":["Заголовок поля"],"Field required":["Обязательное поле"],"Field state appearance":["Внешний вид поля"],"File":["Файл"],"File upload failed":["Не удалось загрузить файл"],"Files ready: %s":["Файлы готовы: %s"],"Fill in at least one offer field":["Заполните хотя бы одно поле акции"],"Filter":["Фильтр"],"Filter by type":["Фильтр по типу"],"Finance & Banking":["Финансы и банки"],"First name":["Имя"],"Float block width":["Ширина плавающего блока"],"Folder (Prefix)":["Папка (префикс)"],"Folder name is required":["Имя папки обязательно"],"Folder path":["Путь к папке"],"Folders":["Папки"],"Font":["Шрифт"],"Font Size":["Размер шрифта"],"Font family":["Шрифт"],"Font file":["Файл шрифта"],"Font of the general text":["Шрифта текста"],"Font settings":["Настройки шрифта"],"Font size":["Размер текста"],"Font size of the general text":["Размер текста"],"Fonts":["Шрифты"],"Footers":["Подвалы"],"For basic tasks in business or personal projects":["Для выполнения основных задач в рамках деловых или личных проектов"],"Forgot the password?":["Забыли пароль?"],"Forgot your password?":["Забыли пароль?"],"Form":["Форма"],"Found so far: %s":["Найдено на данный момент: %s"],"Frame":["Рамка"],"Free trial":["Пробная версия"],"From scratch":["С чистого листа"],"Full legal company name":["Полное юридическое название компании"],"GIF":["GIF"],"General settings":["Общие настройки"],"General text":["Текст"],"Generate":["Сгенерировать"],"Generate Email":["Создать письмо"],"Generate image":["Сгенерировать изображение"],"Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.":["С легкостью создавайте потрясающие визуальные эффекты. Мы обучили нашу модель искусственного интеллекта, чтобы обеспечить высочайшее качество изображений."],"Generate with AI":["Генерация с помощью ИИ"],"Generated images":["Генерация картинок"],"Get a discount":["получить со скидкой"],"Get started":["Начать работу"],"Give your users the ability to build beautiful emails without development costs":["Дайте пользователям возможность собирать красивые письма без затрат на разработку"],"Global block":["Глобальный блок"],"Global styles":["Стили письма"],"Gmail annotation was successfully applied to the template code.":["Аннотация Gmail добавлена в код письма."],"Gmail annotations":["аннотаций в Gmail"],"Gmail annotations were removed from the template code.":["Аннотации Gmail удалены из кода письма."],"Go to project settings?":["Перейти в настройки проекта?"],"Go to projects":["Перейти к проектам"],"Google Fonts":["Шрифты Google"],"Got it":["Понятно"],"Gradient":["Градиент"],"Green":["Зелёный"],"Grid":["Сетка"],"Group":["Группа"],"HLineBrush":["Н-образная"],"HTML":["HTML"],"HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.":["Требуется URL-адрес HTML-страницы. Сначала сохраните письмо или вставьте собственный URL-адрес размещенной у вас HTML-страницы."],"Half year":["Полгода"],"Header":["Заголовок"],"Header text":["Текст заголовка"],"Headers":["Шапки"],"Heading":["Заголовок"],"Heading color":["Цвет заголовка"],"Heading font":["Шрифт заголовка"],"Heading font size":["Размер заголовка"],"Heading letter spacing":["Межбуквенный интервал заголовка"],"Heading line height":["Высота строки заголовка"],"Headings":["Заголовки"],"Headline":["Заголовок"],"Healthcare":["Здравоохранение"],"Height":["Высота"],"Hello":["Привет"],"Help":["Справка"],"Help menu":["Помощь"],"Helper text":["Подсказка"],"Helper text / tooltip":["Подсказка / всплывающая подсказка"],"Hide payment history":["Скрыть историю платежей"],"High contrast mode":["Режим высокой контрастности"],"Hint text":["Подсказка"],"History":["История"],"Horizontal":["Горизонтальный"],"Horizontal alignment":["Горизонтальное выравнивание"],"Horizontal offset":["Гориз. смещение"],"Horizontal padding":["Горизонтальный отступ"],"Horizontal position":["Гориз. смещение"],"Horizontal position of the background image":["Горизонтальное смещение фонового изображения"],"Hospitality & Travel":["Гостиничный бизнес и туризм"],"Host":["Имя хоста"],"Hostname or server IP address":["Имя хоста или IP-адрес сервера"],"How to get an API key?":["Как получить ключ API?"],"Hyperlink URL":["Адрес ссылки"],"I agree to the":["Я согласен с"],"I would like to receive updates from Blocks.":["Я хочу получать новости от Blocks"],"I would like to receive updates from EmailMaker.":["Я хочу получать новости от EmailMaker."],"I'd be happy to create an email for you! ":["Я с удовольствием создам для вас электронное письмо! "],"Icon":["Иконка"],"Icon URL":["URL иконки"],"Icon description":["Описание иконки"],"Identifies search terms. For example: utm_term=running+shoes":["Определяет условия поиска. Например: utm_term=running+shoes"],"Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc":["Определяет, какой тип ссылки использовался, например, цена за клик или электронная почта. Например: utm_medium=cpc"],"If \\"Yes\\", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If \\"No\\", images will be loaded from external links.":["Если «Да», изображения будут включены в сам файл. Это полезно для просмотра без интернета или если внешние изображения заблокированы, но увеличивает размер файла. Если «Нет», изображения будут загружаться по внешним ссылкам."],"If different from the legal address":["Если отличается от юридического адреса"],"If you do not pay, you will be switched to the free plan automatically.":["Если вы не оплатите, вы будете автоматически переведены на бесплатный тарифный план."],"If you have problems connecting the plugin — contact us, our specialists will definitely help you.":["Если возникли сложности с подключением плагина — напишите нам, наши специалисты обязательно помогут."],"If you turn the switch off, lines of code will not wrap. If you turn the switch on, lines of code will wrap at the viewport.":["Если параметр отключен, строки никогда не будут переноситься. Если параметр включен, строки будут переноситься по ширине области просмотра."],"Image":["Картинка"],"Image Center":["Центр изображений"],"Image checks":["Проверка картинок"],"Image editor":["Редактор изображений"],"Image path":["Путь к изображению"],"Image replacer":["Замена картинки"],"Image src":["Картинка"],"Images validation":["Проверка изображений"],"Images validation was successfully completed":["Проверка изображений завершена"],"Import":["Импорт"],"Import email":["Импортировать письмо"],"Import finished":["Импорт завершён"],"Import first %d":["Импортировать первые %d"],"Import from Stripo":["Импорт из Stripo"],"Import problems":["Проблемы импорта"],"Import templates and emails from your Stripo project.":["Импорт шаблонов и писем из вашего проекта Stripo."],"Imported":["Импортировано"],"Imported %1$d of %2$d":["Импортировано %1$d из %2$d"],"Imported: %1$d, failed: %2$d.":["Импортировано: %1$d, не удалось: %2$d."],"Importing from Stripo":["Импорт из Stripo"],"Improves visibility by automatically tuning the form for accessibility. Turn off to restore the previous look.":["Улучшает читаемость за счет автоматической настройки формы с учетом требований доступности. Отключите эту функцию, чтобы вернуть прежний вид."],"Inactive date background color":["Цвет фона неактивной даты"],"Inactive date font":["Шрифт неактивной даты"],"Indent":["Отступ"],"Indent between columns":["Горизонтальный отступ"],"Indent height":["Высота"],"Indent in mobile":["Вертикальный отступ"],"Indexing files…":["Индексация файлов…"],"Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale":["Определяет продвижение конкретного продукта или стратегическую кампанию. Например: utm_campaign=spring_sale"],"Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink":["Определяет, что именно было нажато, чтобы привести пользователя на сайт, например, рекламный баннер или текстовая ссылка. Он часто используется для A/B-тестирования и рекламы, ориентированной на контент. Например: utm_content=logolink или utm_content=textlink."],"Individual corner radii":["Радиусы отдельных углов"],"Individual padding":["Отдельные отступы"],"Industry":["Отрасль"],"Initial":["Начальный"],"Input":["Поле ввода"],"Input field text":["Текст поля ввода"],"Insert column after":["Вставить столбец справа"],"Insert column before":["Вставить столбец слева"],"Insert row after":["Вставить строку после"],"Insert row before":["Вставить строку перед"],"Insert spaces":["Отступы пробелами"],"Inside":["Внутри"],"Integration settings saved.":["Настройки интеграции сохранены."],"Integrations":["Интеграции"],"Integrations are set up in the project settings. Unsaved changes in the email may be lost.":["Интеграции настраиваются в настройках проекта. Несохранённые изменения в письме могут потеряться."],"Internal padding":["Внутренний отступ"],"Invalid file data":["Неверные данные файла"],"Invite members":["Пригласить участников"],"Invited %s":["Приглашён %s"],"Invoice":["Счёт-фактура"],"Invoice for legal entity":["Счёт для юр. лица"],"Invoice request for a legal entity":["Запрос на выставление счета для юридического лица"],"Is a template":["Шаблон"],"It looks like the email was not created in our service, so the content styles won\`t work. Read more about content styles in the help.":["Похоже, письмо создано не в нашем сервисе, поэтому стили контента работать не будут. Подробнее о стилях содержимого читайте в справке."],"It\`s done!":["Готово!"],"Italic":["Курсив"],"Italic ( Ctrl+I )":["Курсив ( Ctrl+I )"],"Italic ( ⌘I )":["Курсив ( ⌘I )"],"Items to import: %d.":["Элементов к импорту: %d."],"Ivan Ivanov":["Иван Иванов"],"Joined the project":["Присоединился к проекту"],"Just now":["Только что"],"KB":["KB"],"KPP":["КПП"],"KPP must be 9 digits":["КПП должен состоять из 9 цифр"],"LLC \\"Example\\"":["ООО «Пример»"],"Label next to checkbox":["Надпись рядом с чекбоксом"],"Label text style":["Стиль текста подписи"],"Landmarks":["Достопримечательности"],"Landscape":["Горизонтальная"],"Language":["Язык"],"Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.":["Большие электронные письма могут иметь проблемы с доставкой и медленно загружаться. Мы рекомендуем минимизировать код перед экспортом."],"Last login":["Последний вход"],"Last name":["Фамилия"],"Last update: ":["Обновлено:"],"Layout conversion failed":["Ошибка при преобразовании шаблона"],"Layout converted to Blocks format":["Шаблон преобразован в формат Blocks"],"Layout converted to EmailMaker format":["Шаблон преобразован в формат EmailMaker"],"Learn more about %s":["Подробнее о работе %s"],"Leave":["Уйти"],"Leave your comment":["Оставьте ваш комментарий"],"Left":["Слева"],"Left Code panel":["Панель кода слева"],"Left padding":["Отступ слева"],"Left to right":["Слева направо"],"Legal address":["Юридический адрес"],"Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!":["Позвольте нашему помощнику с ИИ улучшить ваше письмо! От создания темы и прехедеров на основе письма до генерации всего письма с учетом особенностей вашего сайта!"],"Letter spacing":["Межбуквенный интервал"],"Light":["Светлая"],"Light theme":["Светлая тема"],"Line break on mobile devices":["Переносить колонки друг под друга"],"Line height":["Высота строки"],"Line height of the general text":["Высота строки текста"],"Line wrap":["Перенос строк"],"Link":["Ссылка"],"Link checks":["Проверка ссылок"],"Link color":["Цвет ссылки"],"Link color in contrasting blocks":["Цвет ссылок в контрастных блоках"],"Link for all slides":["Общая ссылка"],"Link to web version of the font":["Ссылка на веб-версию шрифта"],"Links":["Ссылки"],"Links validation":["Проверка ссылок"],"Links validation was successfully completed":["Проверка ссылок завершена"],"List OL":["Список OL"],"List UL":["Список UL"],"List item appearance":["Внешний вид элемента списка"],"List of projects":["Список проектов"],"List panel background":["Фон панели списка"],"List settings":["Настройки списка"],"List text style":["Стиль текста списка"],"Lists":["Списки"],"Live preview":["Тест в почтовиках"],"Loaded State":["Загрузка состояния"],"Loading Canvas":["Загрузка"],"Loading Image":["Загрузка"],"Loading State":["Загрузка"],"Loading latest changes...":["Загрузка последних изменений..."],"Locally saved version applied":["Применена локально сохраненная версия"],"Lock":["Заблокировать"],"Login for connection":["Логин для подключения"],"Logo must be 2 MB or smaller.":["Логотип должен быть не больше 2 МБ."],"Loop":["Зациклить"],"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.":["С другой стороны, разбавленное изрядной долей эмпатии, рациональное мышление выявляет срочную потребность как самодостаточных, так и внешне зависимых концептуальных решений."],"Lower scores are better. Aim for a score less than ":["Чем ниже балл, тем лучше. Старайтесь набрать как можно меньше."],"Lowercase":["Строчные"],"Lowercase letters (a-z)":["Строчные буквы (a–z)"],"MB":["MB"],"Magenta":["Пурпурный"],"Mailganer":["Mailganer"],"Mailing Name":["Имя рассылки"],"Mailing address":["Почтовый адрес"],"Mailing automation, audience segmentation, and email personalization.":["Автоматизация рассылок, сегментация аудитории и персонализация писем."],"Mailing successfully created!":["Письмо создано!"],"Maintain aspect ratio":["Сохранить соотношение сторон"],"Make columns the same width.":["Сделать колонки одинаковой ширины."],"Managed in billing settings":["Управляется в настройках оплаты"],"Mandatory. Indicates the traffic source. Example: utm_source=google":["Указывает, какой сайт отправил трафик, и является обязательным параметром. Например: utm_source=google"],"Manufacturing":["Производство"],"Margins":["Отступы"],"Markdown":["Markdown"],"Marker shape":["Форма маркера"],"Marketer":["Маркетолог"],"Mass mailing automation, audience segmentation, and campaign performance analytics.":["Автоматизация массовых рассылок, сегментация аудитории и аналитика по кампаниям."],"Max width":["Ширина изображения"],"Maximum 10 tags available.":["Максимум доступно 10 тегов."],"Maximum 64 characters.":["Не длиннее 64 символов."],"Maximum length":["Максимальная длина"],"Maximum width":["Макс. ширина"],"Maximum {0} colors in the palette.":["В палитре не больше {0} цветов."],"Maximum {0} fonts in the project.":["В проекте не больше {0} шрифтов."],"Maximum {0} social networks.":["Не больше {0} соцсетей."],"Media & Marketing":["Медиа и маркетинг"],"Members":["Участники"],"Menus":["Меню"],"Merchant homepage URL":["Ссылка на сайт магазина"],"Merge":["Объединение"],"Merge bottom cell":["Объединить нижнюю ячейку"],"Merge left cell":["Объединить левую ячейку"],"Merge right cell":["Объединить правую ячейку"],"Merge tags":["Переменные"],"Merge top cell":["Объединить верхнюю ячейку"],"Merge with the chosen block":["Объединить с выделенным блоком"],"Merged Objects":["Объединение объектов"],"Message when validation fails":["Сообщение в случае сбоя проверки"],"Minimap":["Миникарта"],"Minimize code":["Минимизировать код"],"Minimum length 8 characters":["Минимальная длина — 8 символов"],"Minimum width":["Мин. ширина"],"Minus":["Минус"],"Mobile":["На мобильном"],"Mobile L – 425px":["Смартфон L – 425px"],"Mobile M – 375px":["Смартфон M – 375px"],"Mobile S – 320px":["Смартфон S – 320px"],"Mobile view":["Мобильный вид"],"Month":["Месяц"],"More editing features":["Больше возможностей редактирования"],"More options":["Больше настроек"],"More settings":["Больше настроек"],"Move %1$d block to folder “%2$s”?":["Переместить %1$d блок в папку «%2$s»?","Переместить %1$d блока в папку «%2$s»?","Переместить %1$d блоков в папку «%2$s»?"],"Move %1$d template to folder “%2$s”?":["Переместить %1$d шаблон в папку «%2$s»?","Переместить %1$d шаблона в папку «%2$s»?","Переместить %1$d шаблонов в папку «%2$s»?"],"Move block “%1$s” to folder “%2$s”?":["Переместить блок «%1$s» в папку «%2$s»?"],"Move down":["Переместить вниз"],"Move stopped":["Перемещение остановлено"],"Move template “%1$s” to folder “%2$s”?":["Переместить шаблон «%1$s» в папку «%2$s»?"],"Move up":["Переместить вверх"],"Moving files from old storage…":["Перенос файлов со старого хранилища…"],"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).":["Автоматизация мультиканальных кампаний (email, SMS, push, WhatsApp и другие)."],"Name":["Имя"],"Name must be at most 64 characters.":["Название не длиннее 64 символов."],"Need more?":["Нужно больше?"],"New Text":["Новая надпись"],"New block title":["Название нового блока"],"New blocks":["Новые блоки"],"New email title":["Новое письмо"],"New emails":["Новые письма"],"New file name is required":["Требуется новое имя файла"],"New folder":["Новая папка"],"New folder name is required":["Требуется название новой папки"],"New password":["Новый пароль"],"New project":["Новый проект"],"Newest first":["Сначала новые"],"Newsletter Subscription":["Подписка на новости"],"Newsletter successfully created!":["Рассылка успешно создана!"],"No":["Нет"],"No access to edit the letter.":["Нет доступа к редактированию письма."],"No analytics data for the selected period.":["За выбранный период данных нет."],"No brand colors yet":["Пока нет цветов бренда"],"No card required: we ask for no payment or personal details.":["Карту привязывать не нужно: ни платёжных, ни персональных данных мы не спросим."],"No emails match the search.":["По запросу не найдено ни одного письма."],"No history records available.":["Записи истории отсутствуют."],"No images found.":["Нет изображений."],"No internet connection":["Нет подключения к Интернету"],"No links found.":["Нет ссылок."],"No logo":["Без логотипа"],"No mailing address found. Add one in ActiveCampaign: ":["Почтовый адрес не найден. Добавьте его в ActiveCampaign: "],"No name":["Без названия"],"No one found":["Никого не нашлось"],"No payments yet.":["Платежей пока нет."],"No problems found.":["Проблем не найдено."],"No project fonts yet":["Пока нет шрифтов проекта"],"No projects match the search.":["По запросу не найдено ни одного проекта."],"No properties to edit.":["Нет свойств для редактирования."],"No related blocks found.":["У этого письма нет привязанных шаблонов."],"No social networks yet":["Пока нет соцсетей"],"Non-profit":["Некоммерческая организация"],"None":["Нет"],"Not available for the current payment settings":["Недоступно при текущих настройках оплаты"],"Not available in this context":["Недоступно в данном контексте"],"Not connected":["Не подключено"],"Not defined":["Не определено"],"Not found in Stripo":["Не найдено в Stripo"],"Not imported":["Не импортировано"],"Not now":["Не сейчас"],"Not set":["Не указано"],"Nothing found in Stripo":["В Stripo ничего не найдено"],"Now":["Сейчас"],"Now create an email":["Теперь создайте письмо"],"OGRN / PSRN":["ОГРН / ПСРН"],"OGRN/PSRN must be 13 or 15 digits":["ОГРН / ПСРН должно состоять из 13 или 15 цифр"],"Objects":["Объект"],"Offer page URL":["Ссылка на страницу акции"],"Offer page or merchant homepage link starting with https:// is required":["Нужна ссылка на страницу акции или на сайт магазина, начинающаяся с https://"],"Ok. I'll be waiting":["Хорошо. Я подожду"],"Okay. I'll log in.":["Хорошо, я авторизуюсь."],"Oldest first":["Сначала старые"],"On request":["По запросу"],"On the left":["Слева"],"On the right":["Справа"],"Onboarding":["Тур по редактору"],"Only a-z, 0-9, hyphen, dot":["Только a-z, 0-9, дефис, точка"],"Oops! Something went wrong":["Ой! Что-то пошло не так"],"Opacity":["Прозрачность"],"Open draft campaign":["Открыть черновик кампании "],"Open in Bento":["Открыть в Bento"],"Open in Brevo":["Открыть в Brevo"],"Open in Campaign Monitor":["Открыть в Campaign Monitor"],"Open in Constant Contact":["Открыть в Constant Contact"],"Open in Dotdigital":["Открыть в Dotdigital"],"Open in GetResponse":["Открыть в GetResponse"],"Open in HubSpot":["Открыть в HubSpot"],"Open in Klaviyo":["Открыть в Klaviyo"],"Open in Mailchimp":["Открыть в Mailchimp"],"Open in Mailganer":["Открыть в Mailganer"],"Open in Marketing Cloud":["Открыть в Marketing Cloud"],"Open in Sendsay":["Открыть в Sendsay"],"Open in Unisender":["Открыть в Unisender"],"Open in enKod":["Открыть в enKod"],"Optimize":["Оптимизация"],"Optional fields":["Необязательные поля"],"Orange":["Оранжевый"],"Ordered list":["Нумерованный список"],"Organization logo":["Логотип компании"],"Other":["Другое"],"Others":["Другие"],"Outline":["Контур"],"Outline Color":["Цвет контура"],"Outlook":["Outlook"],"Outside":["Снаружи"],"PDF":["PDF"],"PJSC Sberbank":["ПАО «Сбербанк»"],"PNG":["PNG"],"Padding":["Внутренний отступ"],"Paid until: ":["Оплачен до: "],"Palette":["Палитра"],"Password":["Пароль"],"Password for connection":["Пароль для подключения"],"Paste block from clipboard":["Вставить блок из буфера обмена"],"Paste image URL here":["Вставьте URL изображения"],"Pay":["Оплата"],"Payment":["Оплата"],"Payment basis":["Условия оплаты"],"Payment history":["История платежей"],"Payment was successful. Limits will update in a few seconds.":["Оплата прошла успешно. Лимиты обновятся через несколько секунд."],"Payment was successful. New AI generations are now available.":["Оплата прошла успешно. Теперь доступны новые генерации с помощью ИИ."],"Payment was successful. Your plan features are now available.":["Оплата прошла успешно. Теперь вы можете пользоваться всеми возможностями вашего тарифного плана."],"PencilBrush":["Карандаш"],"Phone":["Телефон"],"Phone must be 3 to 40 characters and contain digits and separators only.":["Телефон — от 3 до 40 символов, только цифры и разделители."],"Phone number":["Телефон"],"Phone or email":["Телефон или email"],"Pick a color.":["Выберите цвет."],"Picture":["Изображение"],"Placeholder":["Плейсхолдер"],"Placeholder text":["Текст плейсхолдера"],"Plain text":["Простой текст"],"Plan":["Тариф"],"Plan usage statistics":["Статистика использования тарифа"],"Play button":["Кнопка воспроизведения"],"Please accept the agreement":["Пожалуйста, примите соглашение"],"Please add a comment to your request":["Введите комментарий к запросу"],"Please choose":["Пожалуйста, выберите"],"Please choose block type":["Пожалуйста, выберите тип блока"],"Please choose the block type":["Пожалуйста, укажите тип блока"],"Please complete payment on the Billing page.":["Пожалуйста, произведите оплату на странице «Тарифы и оплата»."],"Please complete the captcha":["Пожалуйста, пройдите капчу"],"Please complete the captcha to continue.":["Пожалуйста, пройдите капчу, чтобы продолжить."],"Please enter a URL.":["Пожалуйста, введите адрес."],"Please enter a color name.":["Пожалуйста, введите название цвета."],"Please enter a name.":["Пожалуйста, введите название."],"Please enter a valid email address.":["Введите действительный адрес электронной почты."],"Please enter a valid email.":["Пожалуйста, введите корректный email."],"Please enter the URL.":["Пожалуйста, введите адрес"],"Please enter the block name":["Введите название блока"],"Please enter the correct URL.":["Пожалуйста, введите правильный адрес."],"Please enter the correct email address.":["Пожалуйста, введите корректный адрес почты."],"Please enter the correct email.":["Пожалуйста, введите корректную эл. почту"],"Please enter the description":["Введите описание"],"Please enter the email name":["Введите имя письма"],"Please enter the folder name":["Введите имя папки "],"Please enter the group name":["Введите название группы"],"Please enter the project name":["Пожалуйста, введите название проекта"],"Please enter valid email":["Введите действительный адрес электронной почты"],"Please enter your email address":["Пожалуйста, укажите свой адрес эл. почты"],"Please enter your password":["Пожалуйста, введите свой пароль"],"Please input block name":["Пожалуйста укажите название блока"],"Please input container width":["Пожалуйста, укажите ширину блока"],"Please input tags!":["Пожалуйста, введите теги!"],"Please input type!":["Пожалуйста, введите тип!"],"Please log in":["Необходим вход в систему"],"Please select":["Пожалуйста, выберите"],"Please set the 'Type' field in the Settings section.":["Пожалуйста, заполните поле «Тип» в настройках блока."],"Please set the background color":["Пожалуйста, установите цвет фона"],"Please set the font color":["Установите цвет текста"],"Please type correct emails":["Пожалуйста, введите верные адреса получателей"],"Please type emails":["Пожалуйста, введите адреса получателей"],"Please type subject":["Укажите тему письма"],"Please type the project name.":["Пожалуйста, укажите название проекта."],"Please type the webhook URL.":["Пожалуйста, введите адрес вебхука."],"Please type your email address.":["Пожалуйста, укажите свой адрес электронной почты."],"Please type your password confirmation code.":["Пожалуйста, укажите код подтверждения."],"Please type your password.":["Пожалуйста, введите свой пароль."],"Please upgrade your plan.":["Пожалуйста, обновите тарифный план.\\n"],"Please upload a JPG, PNG, or WebP image.":["Загрузите изображение в формате JPG, PNG или WebP."],"Plugin":["Плагин"],"Plugin connected":["Плагин подключён"],"Plugin connection request":["Заявка на подключение плагина"],"Plugin is not connected":["Плагин не подключён"],"Plus":["Плюс"],"Pointer":["Треугольник"],"Polls":["Опросы"],"Port":["Порт"],"Portrait":["Вертикальная"],"Position in cell":["Положение в ячейке"],"Prefer spaces over tabs.":["Делать табуляцию пробелами."],"Prefix path inside the bucket for project files":["Префикс — путь внутри бакета для файлов проекта"],"Preheader":["Прехедер"],"Preheader copied to email settings":["Прехедер скопирован в настройки письма"],"Preparing countdown preview…":["Готовим превью таймера..."],"Preparing video preview…":["Готовим превью видео..."],"Preview":["Предпросмотр"],"Preview mode":["Предпросмотр"],"Price":["Цена"],"Price currency":["Валюта"],"Price currency must be a three-letter ISO 4217 code, for example USD":["Валюта указывается трёхбуквенным кодом ISO 4217, например USD"],"Privacy Policy.":["Политикой конфиденциальности."],"Processing Image":["Загрузка"],"Product carousel":["Карусель товаров"],"Profile":["Профиль"],"Project":["Проект"],"Project files are stored on the built-in Blocks CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN Blocks. Дополнительно настраивать подключение не нужно."],"Project files are stored on the built-in EmailMaker CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN EmailMaker. Дополнительно настраивать подключение не нужно."],"Project information":["Информация о проекте"],"Project name":["Название проекта"],"Project name must be at most 100 characters.":["Название проекта не длиннее 100 символов."],"Project not found.":["Проект не найден."],"Project settings":["Настройки проекта"],"Project styles":["Стили проекта"],"Project styles saved.":["Стили проекта сохранены."],"Project switched to the built-in storage.":["Проект переключён на встроенное хранилище."],"Projects":["Проекты"],"Promo code applied.":["Промокод применен."],"Promocodes":["Промокоды"],"Promotion cards":["Промокарточки"],"Proofreader":["Корректор "],"Psychologist":["Психолог"],"Public URL":["Публичный адрес"],"Public access key":["Публичный ключ доступа"],"Public offer":["Публичная оферта"],"Purple":["Фиолетовый"],"Push block update to all templates":["Применить обновление блока ко всем шаблонам"],"Quality":["Качество"],"Quarter":["Квартал"],"Radio button":["Радиокнопка"],"Radius":["Радиус"],"Ready-made HTML template for testing the plugin locally.":["Готовый HTML-шаблон, чтобы проверить плагин локально."],"Real Estate":["Недвижимость"],"Real-time notifications about email-related events.":["Уведомления о событиях с письмами в реальном времени."],"Receipt":["Чек"],"Recipients":["Получатели"],"Recommended":["Рекомендуемые"],"Recover":["Восстановить"],"Recover password":["Восстановить пароль"],"Recurring payments disabled":["Автоплатёж отключён"],"Recurring payments enabled":["Автоплатёж включён"],"Red":["Красный"],"Redo (Ctrl+Shift+Z)":["Повторить (Ctrl+Shift+Z)"],"Refresh":["Обновить"],"Refresh inbox":["Обновить почтовый ящик"],"Reload page":["Перезагрузить страницу"],"Remaining:":["Осталось:"],"Remember me":["Запомнить меня"],"Remove":["Удалить"],"Remove annotations":["Удалить аннотации"],"Remove block":["Удалить блок"],"Remove column":["Удалить столбец"],"Remove element":["Удалить элемент"],"Remove element by Delete Key":["Удалить элемент (Delete)"],"Remove file":["Удалить файл"],"Remove group":["Удалить группу"],"Remove logo":["Удалить логотип"],"Remove member":["Удалить участника"],"Remove row":["Удалить строку"],"Remove slide":["Удалить слайд"],"Rename":["Переименовать"],"Rename block":["Переименовать блок"],"Rename email":["Переименовать письмо"],"Reorder block":["Переместить блок"],"Reorder element":["Переместить элемент"],"Reorder group":["Переместить группу"],"Repeat background (repeat)":["Повторять фон (repeat)"],"Repeat background horizontally (repeat-x)":["Горизонтальное повторение фона (repeat-x)"],"Repeat background vertically (repeat-y)":["Вертикальное повторение фона (repeat-y)"],"Repeat the new password":["Повторите новый пароль"],"Replace Image":["Заменить изображение"],"Replace the preheader":["Вставить в прехедер письма"],"Replace the title":["Вставить в заголовок письма"],"Replaced Background Image":["Удаление фонового изображения"],"Reply":["Ответить"],"Reply to the comment":["Ответить на комментарий"],"Request for changing the pricing plan":["Запрос на смену тарифа"],"Request sent successfully.":["Запрос отправлен."],"Requests JSON":["JSON с запросами"],"Required field":["Обязательное поле"],"Resend":["Отправить повторно"],"Resize":["Размер"],"Resized Image":["Изменение размера"],"Responsive email":["Адаптировать письмо в моб. устройствах"],"Restore %1$d block to folder “%2$s”?":["Восстановить %1$d блок в папку «%2$s»?","Восстановить %1$d блока в папку «%2$s»?","Восстановить %1$d блоков в папку «%2$s»?"],"Restore %1$d template to folder “%2$s”?":["Восстановить %1$d шаблон в папку «%2$s»?","Восстановить %1$d шаблона в папку «%2$s»?","Восстановить %1$d шаблонов в папку «%2$s»?"],"Restore block “%1$s” to folder “%2$s”?":["Восстановить блок «%1$s» в папку «%2$s»?"],"Restore template “%1$s” to folder “%2$s”?":["Восстановить шаблон «%1$s» в папку «%2$s»?"],"Resume":["Резюме"],"Retail & E-commerce":["Розница и e-commerce"],"Retry":["Повторить"],"Retry failed":["Повторить неудавшиеся"],"Reverse order on desktop":["Изменить порядок в десктопе"],"Revoke the invite":["Отозвать приглашение"],"Right":["Справа"],"Right Code panel":["Панель кода справа"],"Right padding":["Отступ справа"],"Right to left":["Справа налево"],"Role":["Роль"],"Rotate":["Перевыпустить"],"Rotate client secret?":["Перевыпустить Client Secret?"],"Rotate secret":["Перевыпустить секрет"],"Round":["Круглый"],"Rounded Corner":["Загругление углов"],"Rounded corners in Outlook (VML)":["Закругленные углы в Outlook (VML)"],"SMS":["СМС"],"Safe Fonts":["Безопасные шрифты"],"Sandbox HTML file":["HTML-файл песочницы"],"Sans Serif":["Sans Serif"],"Save":["Сохранить"],"Save %d block":["Сохранить %d блок","Сохранить %d блока","Сохранить %d блоков"],"Save all blocks":["Сохранить все блоки"],"Save and continue":["Сохранить и продолжить"],"Save block":["Сохранить блок"],"Save by Ctrl+S":["Ctrl+S"],"Save by ⌘S":["Сохранить ( ⌘S )"],"Save email first.":["Сначала сохраните письмо."],"Save the block before commenting.":["Сохраните блок перед комментированием."],"Save the email before commenting.":["Сохраните письмо перед комментированием."],"Save to Blocks":["Сохранить в Блоки"],"Save to Blocks button.":["Сохранить в Блоки"],"Saved blocks":["Сохранённые блоки"],"Saving changes in the block":["Сохранение изменений в блоке"],"Search":["Поиск"],"Search GIFs":["Поиск GIF"],"Search a block":["Найти блок"],"Search by name":["Поиск по названию"],"Search by title":["Поиск по названию"],"Search image":["Поиск изображения"],"Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.":["В обширной галерее стоковых фотографий и GIF-файлов вы найдете изображения для любого случая. Вы можете отфильтровать результаты по ориентации изображения, цветовой гамме и т. д."],"Secret Access Key":["Секретный ключ доступа"],"Secret access key":["Секретный ключ доступа"],"Secret is masked. Use Rotate to get a new secret once.":["Секрет скрыт. Нажмите «Перевыпустить», чтобы один раз увидеть новый."],"Section":["Раздел"],"Section ":["Раздел"],"Section title":["Заголовок раздела"],"Security":["Безопасность"],"Select a font family":["Выберите шрифт"],"Select a theme":["Выберите тему"],"Select all %d":["Выбрать все: %d"],"Select company size":["Выберите размер компании"],"Select email template":["Выберите шаблон письма"],"Select industry":["Выберите отрасль"],"Select period":["Выберите период"],"Select plan":["Выбрать тариф"],"Select the block type to find any block on the list faster.":["Выберите тип блока, чтобы быстрее найти любой блок в списке."],"Select the time zone":["Выберите часовой пояс"],"Selected %1$d, your plan allows %2$d more emails.":["Выбрано: %1$d, по тарифу можно создать ещё писем: %2$d."],"Send":["Отправить"],"Send a test email":["Отправить тест"],"Send again":["Повторить"],"Sender Email":["Email отправителя"],"Sender Name":["Имя отправителя"],"Sendsay":["Sendsay"],"Separators":["Разделители"],"Serif":["Serif"],"Server is unavailable":["Сервер недоступен"],"Set":["Установить"],"Set new password":["Установить новый пароль"],"Set the type":["Укажите тип"],"Settings":["Настройки"],"Shadow":["Тень"],"Shadow Color":["Цвет тени"],"Shadow inside or outside of the element":["Если включено, то тень будет внутри элемента."],"Shapes":["Фигуры"],"Share":["Поделиться"],"Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.":["Поделитесь проектом со своей командой и сотрудничайте в режиме реального времени. Добавляйте комментарии к отдельным блокам писем и обсуждайте необходимые правки прямо в конструкторе."],"Short company name":["Краткое название компании"],"Show eye icon":["Показать иконку глаза"],"Show more":["Показать ещё"],"Shuffle options":["Параметры перемешивания"],"Sign In":["Войти"],"Sign Up":["Зарегистрироваться"],"Sign in to your account to activate the trial period.":["Войдите в свою учетную запись, чтобы активировать пробный период."],"Sign in with eLama":["Войти через eLama"],"Sign out":["Выйти"],"Single image preview":["Одно изображение"],"Single quotation":["Кавычка"],"Site":["Сайт"],"Size":["Размер"],"Small desktop – 768px":["Небольшой десктоп – 768px"],"Social buttons":["Кнопки соцсетей"],"Social media":["Соцсети"],"Social network name":["Название соцсети"],"Social network settings":["Настройки соцсети"],"Social networks":["Соцсети"],"Solid":["Сплошная"],"Some blocks were not saved successfully.":["Некоторые блоки не были сохранены."],"Some images were left as links to Stripo":["Часть картинок осталась ссылками на Stripo"],"Something went wrong":["Ошибка редактирования. Обратитесь в техподдержку."],"Something went wrong during layout conversion. You can try running the conversion again.":["При конвертации шаблона произошла ошибка. Вы можете повторить конвертацию."],"Something went wrong, please try again":["Что-то пошло не так. Попробуйте ещё раз."],"Something went wrong.":["Что-то пошло не так."],"Something went wrong. Try again later.":["Что-то пошло не так. Попробуйте позже."],"Soon":["Скоро"],"Sorry, the page you visited does not exist.":["Извините, страница, которую вы посетили, не существует."],"Source code validation":["Проверка кода"],"Spacer":["Отступ"],"Spacing":["Интервал"],"Spam checks":["Проверка на спам"],"Spam validation was successfully completed":["Проверка на спам завершена"],"SpamAssassin":["SpamAssassin"],"Special characters":["Специальные символы"],"Specifies the block width.":["Задаёт ширину блока."],"Split blocks":["Разделить блоки"],"Split cell":["Разделить ячейку"],"SprayBrush":["Спрей"],"Spread radius":["Распространение"],"Square":["Квадрат"],"SquareBrush":["Квадрат"],"Squarish":["Квадратная"],"Star":["Звезда"],"Start Trial":["Начать Триал"],"Start date":["Дата начала"],"Start from scratch":["Начать с чистого листа"],"Start the trial":["Включить пробный период"],"Start typing the title":["Начните писать название"],"Start with a detailed description of your email.":["Начните с подробного описания вашего письма."],"Starts":["Начало"],"Status":["Статус"],"Stay":["Остаться"],"Stickers":["Стикеры"],"Stock":["Фотосток"],"Stock photos and GIFs":["Стоковые изображения"],"Stopping…":["Остановка…"],"Storage settings":["Настройки хранилища"],"Storage type":["Тип хранилища"],"Stored or bound value for this field":["Сохраненное или заданное значение для этого поля"],"Stored or bound value for this option":["Сохраненное или заданное значение для этого параметра"],"Strikethrough ( Alt+Shift+5 )":["Зачёркнутый ( Alt+Shift+5 )"],"Strikethrough ( ⌘+Shift+X )":["Зачёркнутый ( ⌘+Shift+X )"],"Stripo API key":["API-ключ Stripo"],"Stripo did not accept this key. Check that it is the REST API key of your Stripo project.":["Stripo не принял этот ключ. Проверьте, что это ключ REST API вашего проекта Stripo."],"Stripo did not respond":["Stripo не ответил"],"Stripo is not responding. Try again later.":["Stripo не отвечает. Попробуйте позже."],"Stripo stopped accepting the API key. Update the key and repeat the import.":["Stripo перестал принимать API-ключ. Обновите ключ и повторите импорт."],"Stripo templates become project templates, emails become emails. Folders are recreated, images are copied to the project storage. Items already imported are skipped when you select all.":["Шаблоны Stripo станут шаблонами проекта, письма — письмами. Папки будут воссозданы, картинки скопированы в хранилище проекта. При выборе всех уже импортированные элементы пропускаются."],"Stroke color":["Цвет контура"],"Strong":["Полужирный"],"Strong ( Ctrl+B )":["Полужирный ( Ctrl+B )"],"Strong ( ⌘B )":["Полужирный ( ⌘B )"],"Subject":["Тема"],"Subject line & preheader generator":["Генератор темы и прехедера"],"Subscription ID is missing":["Отсутствует идентификатор подписки"],"Subscription summary":["Сведения о подписке"],"Success":["Готово"],"Success!":["Готово!"],"Supported formats: .woff, .woff2, .ttf, .otf. Maximum file size is 5 MB.":["Поддерживаемые форматы: .woff, .woff2, .ttf, .otf. Файл не больше 5 МБ."],"Supported: .woff, .woff2, .ttf, .otf — up to {0} MB.":["Поддерживаются .woff, .woff2, .ttf, .otf — до {0} МБ."],"Swap columns":["Поменять местами"],"Switch to a different plan to save more emails.":["Перейдите на другой тариф, чтобы иметь возможность сохранять новые шаблоны."],"Syncing with the server in the background...":["Происходит синхронизация с сервером в фоновом режиме..."],"System":["Системная"],"System theme":["Системная тема"],"TIN (INN)":["ИНН"],"TIN (INN) must be 10 or 12 digits":["ИНН должен состоять из 10 или 12 цифр"],"Tab size":["Величина отступа"],"Table":["Таблица"],"Table view":["Таблица"],"Table width":["Ширина таблицы"],"Tags":["Теги"],"Tags help you find the block in the list.":["Теги помогают найти блок в списке."],"Tariff and payment":["Тариф и оплата"],"Teal":["Бирюзовый"],"Team collaboration":["Командная работа"],"Technical support":["Техническая поддержка"],"Technology & Software":["Технологии и ПО"],"Template":[" Шаблон"],"Template Name":["Название шаблона"],"Template blocks":["Блоки шаблона"],"Template conversion":["Конвертация шаблона"],"Template from another editor":["Шаблон из другого редактора"],"Template is not mobile-friendly":["Шаблон может некорректно отображаться в телефоне"],"Template successfully created!":["Шаблон создан!"],"Templates":["Шаблоны"],"Terms":["Условиями использования"],"Test sends":["Тесты отображения"],"Text":["Текст"],"Text & background":["Текст и фон"],"Text align center":["Текст по центру"],"Text align center ( Ctrl+Shift+E )":["По центру ( Ctrl+Shift+E )"],"Text align center ( ⌘+Shift+E )":["По центру ( ⌘+Shift+E )"],"Text align justify":["Текст по ширине"],"Text align justify ( Ctrl+Shift+J )":["По ширине ( Ctrl+Shift+J )"],"Text align justify ( ⌘+Shift+J )":["По ширине ( ⌘+Shift+J )"],"Text align left":["Текст слева"],"Text align left ( Ctrl+Shift+L )":["По левому краю ( Ctrl+Shift+L )"],"Text align left ( ⌘+Shift+L )":["По левому краю ( ⌘+Shift+L )"],"Text align right":["Текст справа"],"Text align right ( Ctrl+Shift+R )":["По правому краю ( Ctrl+Shift+R )"],"Text align right ( ⌘+Shift+R )":["По правому краю ( ⌘+Shift+R )"],"Text background":["Фон текста"],"Text beside the box":["Текст рядом с полем"],"Text color":["Цвет текста"],"Text copied to clipboard":["Скопировано в буфер обмена"],"Text font":["Шрифт текста"],"Text replacer":["Замена текста"],"Text size":["Размер текста"],"Text subscript":["Подстрочный текст"],"Text superscript":["Надстрочный текст"],"Text visible at the start":["Текст, отображаемый в начале"],"Texture":["Текстура"],"That\`s all we could find.":["Это все, что мы смогли найти."],"The ":[" "],"The Pro plan is not available.":["Тариф «Pro» недоступен."],"The URL that the hyperlink directs to.":["URL, на который указывает ссылка."],"The account number must be 20 digits":["Номер счета должен состоять из 20 цифр"],"The align attribute sets the horizontal alignment of the table.":["Атрибут align устанавливает горизонтальное выравнивание таблицы."],"The block \\"":["Блок «"],"The block was successfully renamed.":["Блок переименован."],"The block was successfully saved.":["Блок сохранен."],"The block will change its colors to contrasting colors. You can change them in the Content Styles section.":["Блок изменит свои цвета на контрастные. Вы можете изменить их в разделе «Стили контента»."],"The block “":["Блок «"],"The captcha is invalid or expired. Please try again.":["Капча неверна или срок её действия истек. Пожалуйста, попробуйте ещё раз."],"The code size exceeds the recommended value 90kB":["Размер кода превышает рекомендуемое значение 90 кБ."],"The code that will replace this text":["Код, который заменит этот текст"],"The copies were successfully created.":["Копии созданы."],"The copy of block “":["Копия блока «"],"The copy of email \\"":["Копия письма \\""],"The current code size is":["Текущий размер кода составляет"],"The current template will be changed to the generated one, are you sure about this?":["Текущий шаблон будет заменен на сгенерированный, вы уверены в этом?"],"The draft of the block has been deleted.":["Черновик блока удалён."],"The draft of the email has been deleted.":["Черновик письма удалён."],"The email \\"":["Письмо \\""],"The email has been copied to the clipboard.":["Код письма скопирован в буфер обмена."],"The email limit of your plan has been reached.":["Лимит писем вашего тарифа исчерпан."],"The email was successfully renamed.":["Письмо переименованно."],"The email was successfully saved.":["Письмо сохранено."],"The email “":["Письмо «"],"The feature is under development.":["Функционал находится в разработке."],"The folder \\"":["Папка «"],"The folder “":["Папка «"],"The font-size CSS property sets the size of the font.":["Свойство font-size устанавливает размер шрифта."],"The global block was updated.":["Глобальный блок был обновлён."],"The group “":["Группа «"],"The image could not be uploaded.":["Не удалось загрузить изображение."],"The image was successfully uploaded.":["Изображение загружено."],"The import failed. Try again later.":["Импорт не удался. Попробуйте позже."],"The inbox has been updated.":["Почтовый ящик обновлён."],"The invitation has been sent":["Приглашение отправлено"],"The maximum number of requests for the current subscription period has been reached.\\nSelect the appropriate plan to fulfil more requests":["Максимальное количество запросов для текущего периода подписки достигнуто.\\nВыберите соответствующий тариф для выполнения большего количества запросов."],"The password does not meet the requirements:":["Пароль не соответствует требованиям безопасности:"],"The password is too simple.":["Слишком простой пароль."],"The payment widget failed to load. Refresh the page and try again.":["Не удалось загрузить виджет оплаты. Обновите страницу и попробуйте ещё раз."],"The previous secret will stop working immediately.":["Прежний секрет перестанет работать сразу."],"The project \\"":["Проект «"],"The saved key no longer works. Enter a new one.":["Сохранённый ключ больше не работает. Введите новый."],"The selected element is in the block that supports a multicolumn structure. To add a new column, click the \\"Add a column\\" button.":["Выделенный элемент находится в блоке, в котором можно организовать многоколоночную структуру. Для добавления новой колонки нажмите кнопку «Добавить колонку»."],"The server returned an unexpected response. Please try again or contact support.":["Сервер вернул неожиданный ответ. Попробуйте ещё раз или обратитесь в службу поддержки."],"The specified parameters will be added to all links when exporting the email.":["Специальные параметры будут добавлены во все ссылки при экспорте."],"The test email will be sent to the specified addresses.":["Тестовое письмо будет отправлено на указанные адреса."],"The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it.":["Название отображается в списке шаблонов и зачастую совпадает с темой письма, но вы можете его изменить."],"The trash is empty.":["Корзина пуста."],"The trial has ended. You are on the Free plan.":["Пробный период закончился. Вы пользуетесь тарифом «Free»."],"The two passwords that you entered do not match!":["Два введенных вами пароля не совпадают!"],"The usage limit has been exceeded":["Превышен лимит использования"],"The whole email":["Всё письмо"],"Theme":["Тема"],"There are no blocks for this request.":["По данному запросу ничего не найдено."],"There are no members yet":["Участников пока нет"],"There's no such comment.":["Нет такого комментария."],"There's no such element in the email.":["В письме нет такой метки."],"These global blocks have a newer saved version. Select the ones to update in the template.":["Для этих глобальных блоков имеется более новая сохраненная версия. Выберите в шаблоне те из них, которые необходимо обновить."],"This action cannot be undone.":["Это действие нельзя отменить."],"This and other features are available for you on a higher plan.":["Эти и другие функции доступны для вас на более старшем тарифном плане."],"This can be the name of your company, department, website, project, marketing campaign, or other activity.":["Это может быть название вашей компании, отдела, веб-сайта, проекта или сферы деятельности, для которой вы планируете создать рассылку."],"This element":["Этот элемент"],"This email must be verified in Mailganer":["Адрес необходимо подтвердить в Mailganer"],"This email must be verified in Sendsay":["Адрес необходимо подтвердить в Sendsay"],"This email must be verified in Unisender":["Адрес необходимо подтвердить в Unisender"],"This field is required":["Это обязательное поле"],"This field sets the width of the email.":["Это поле выставляет ширину письма."],"This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.":["Это глобальный блок. Вы можете создать новый блок, чтобы изменения вступили в силу только в этом письме, или обновить текущий — в этом случае изменения будут применены везде, где используется этот блок."],"This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.":["Этот шаблон не был создан в нашем редакторе. Преобразуйте его, чтобы получить доступ ко всем возможностям редактирования: легко изменяйте тексты, заменяйте изображения и управляйте блоками."],"This link cannot be used as a font source.":["Эту ссылку нельзя использовать как источник шрифта."],"This may take several minutes. Please keep this tab open.":["Это может занять несколько минут. Пожалуйста, не закрывайте эту вкладку."],"This promo code is already applied.":["Промокод уже применен."],"This section will be implemented in a separate task.":["Раздел пока в разработке."],"This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control.":["Этот шаблон создан в другом редакторе. Пересоберите его из наших компонентов и получите стабильное отображение, редактирование без ошибок и полный контроль над дизайном."],"Time":["Время"],"Time units font settings":["Шрифт единиц времени"],"Time zone":["Часовой пояс"],"Title":["Название"],"Title copied to email settings":["Заголовок скопирован в настройки письма"],"Title should not be empty":["Заголовок не должен быть пустым"],"Title shown above the control":["Название, отображаемое над элементом управления"],"To add a block from the dashboard click the":["Чтобы добавить блок, нажмите в визуальном редакторе письма кнопку"],"To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.":["Чтобы избежать этой проблемы, отключите перевод данного сайта в настройках браузера или отключите функцию автоматического перевода."],"To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version.":["Для изменения внешнего вида элемента в мобильном устройстве, внесите правки в поля ниже. Если поле пустое, то в мобильной версии применятся стили для десктопа."],"To create a copy, you need to save the block.":["Чтобы создать копию, вы должны сохранить блок."],"To create a copy, you need to save the email.":["Чтобы создать копию, вы должны сохранить письмо."],"To emails":["В письма"],"To fully address all necessary tasks in any field":["Чтобы в полной мере решить все необходимые задачи в любой области"],"To get started quickly":["Чтобы быстро приступить к работе"],"To import from Stripo, add the REST API key of your Stripo project: <1>open the project settings in Stripo</1>, find “Access the REST API” and generate a key.":["Чтобы импортировать из Stripo, добавьте ключ REST API вашего проекта Stripo: <1>откройте настройки проекта в Stripo</1>, найдите «Access the REST API» и сгенерируйте ключ."],"To leave comments you must be logged into Blocks and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To leave comments you must be logged into EmailMaker and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To preview and edit the uploaded image":["Предварительный просмотр и редактирование загруженного изображения"],"To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.":["Чтобы отправить тестовое письмо, вам необходимо подтвердить свой адрес электронной почты. Если вы не получили ссылку для подтверждения, обратитесь в службу поддержки через чат или по электронной почте {supportEmail}."],"Today":["Сегодня"],"Too many items selected. One import takes up to 1000 items.":["Выбрано слишком много. Один импорт берёт до 1000 элементов."],"Tooltip or hint text":["Всплывающая подсказка или текст подсказки"],"Tooltip text":["Текст всплывающей подсказки"],"Top":["Сверху"],"Top left corner":["Верхний левый угол"],"Top margin":["Отступ сверху"],"Top padding":["Отступ сверху"],"Top right corner":["Верхний правый угол"],"Top up balance":["Пополнить баланс"],"Transfer to folder":["Переместить"],"Translator":["Переводчик"],"Transparency":["Прозрачность"],"Transportation":["Транспорт"],"Trial":["Триал"],"Trial activated":["Пробная версия активирована"],"Trial active":["Пробная версия активна"],"Trial period activated.":["Пробный период активирован."],"Try again":["Попробовать ещё раз"],"Try every editor feature — free":["Попробуйте все возможности редактора — бесплатно"],"Try for free":["Попробуйте бесплатно"],"Try reloading the page.":["Попробуйте перезагрузить страницу."],"Try sign in with your new password.":["Попробуйте войти с новым паролем."],"Turn on a 14-day trial and the whole editor opens up:":["Включим пробный период на 14 дней — и редактор откроется целиком:"],"Type":["Тип"],"Type category here":["Укажите категорию"],"Type in the project's webhook":["Введите проект webHook"],"Type subject":["Укажите тему письма"],"Type the output parameters of your platform. E.g., ":["Указывайте символы вывода параметра вашей платформы. Например, "],"Type title here":["Введите название"],"Type your description here":["Введите описание"],"Type your request":["Введите ваш запрос"],"Type your tags here":["Укажите теги"],"Typing...":["Ввод текста..."],"Typograf":["Типограф"],"Typography":["Типограф"],"URL":["URL"],"URL must start with https://":["Адрес должен начинаться с https://"],"URL of the video clip.":["URL-адрес видеоклипа."],"USD":["USD"],"UTM parameters":["UTM-метки"],"Unavailable":["Недоступно"],"Underline":["Подчёркнутый"],"Underline ( Ctrl+U )":["Подчёркнутый ( Ctrl+U )"],"Underline ( ⌘U )":["Подчёркнутый ( ⌘U )"],"Undo (Ctrl+Z)":["Отменить (Ctrl+Z)"],"Unisender":["Unisender"],"Unknown error":["Неизвестная ошибка"],"Unknown integration":["Неизвестная интеграция"],"Unlimited possibilities with the PRO plan":["Безграничные возможности с тарифом PRO"],"Unlock":["Разблокировать"],"Unordered list":["Ненумерованный список"],"Unsaved changes":["Несохранённые изменения"],"Up to parent element":["Перейти к контейнеру"],"Update":["Обновить"],"Update current block":["Обновить текущий блок"],"Update date":["Дата обновления"],"Update global blocks":["Обновить глобальные блоки"],"Updated":["Обновлено"],"Upload":["Загрузить"],"Upload .woff, .woff2, .ttf or .otf files for use in the email editor.":["Загрузите файлы .woff, .woff2, .ttf или .otf, чтобы использовать их в редакторе писем."],"Upload Image":["Загрузить изображение"],"Upload failed":["Загрузка не удалась"],"Upload first font":["Загрузить первый шрифт"],"Upload font":["Загрузить шрифт"],"Upload logo":["Загрузить логотип"],"Upload your email":["Загрузить своё письмо"],"Uppercase":["Заглавные"],"Uppercase letters (A-Z)":["Заглавные буквы (A–Z)"],"Usage analytics":["Аналитика использования"],"Use custom icon for checked state":["Использовать пользовательскую иконку для отмеченного состояния"],"Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.":["Используйте наш визуальный редактор, чтобы настроить каждый элемент под свои нужды: изменить рамки и их радиус, тени, отступы, фон и многое другое."],"Use this email as a template for creating future emails.":["Используйте это письмо в качестве шаблона для создания будущих писем."],"Use this one":["Использовать эту"],"Use your own styles instead of defaults for states such as error, focus, and success.":["Используйте собственные стили вместо стандартных для таких состояний, как «ошибка», «фокус» и «успех»."],"Used":["Используемые"],"User":["Пользователь"],"Username":["Логин"],"VAT":["НДС"],"VLineBrush":["V-образная"],"Valid":["Верно"],"Valid until":["Оплачен до"],"Validation error message":["Сообщение об ошибке проверки"],"Value":["Значение"],"Variable value":["Значение переменной"],"Version history":["Контроль версий"],"Version of":["Версия от"],"Vertical":["Вертикальный"],"Vertical alignment":["Верт. выравнивание"],"Vertical offset":["Верт. смещение"],"Vertical padding":["Вертикальный отступ"],"Vertical position":["Верт. смещение"],"Vertical position of the background image":["Вертикальное смещение фонового изображения"],"Video":["Видео"],"Video URL":["URL-адрес видео"],"View only — you cannot edit settings in this section.":["Только просмотр — настройки в этом разделе менять нельзя."],"Vimeo":["Vimeo"],"Visibility":["Видимость"],"Visibility in AMP":["Видимость в AMP"],"Visit site":["Перейти на сайт"],"Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.":["Хотите изменить размер изображения, добавить текст или применить фильтр? Не нужно покидать EmailMaker! Все основные изменения вы можете сделать в нашем редакторе изображений."],"Warning":["Предупреждение"],"Warnings":["Предупреждения"],"We are always in touch":["Мы всегда на связи"],"We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.":["Мы автоматически удалили внедренный код. Чтобы избежать этой проблемы, отключите расширение для этого сайта или воспользуйтесь редактором в окне инкогнито без расширений."],"Web version":["Веб-версия"],"Webhook":["WebHook"],"Webhook URL":["Вебхук"],"Webhook settings":["Настройки вебхука"],"Webhook successfully sent!":["WebHook отправлен!"],"Website link":["Ссылка на сайт"],"Week":["Неделя"],"What's new":["Что нового"],"When the trial ends, the service switches to the free plan.":["Когда триал закончится, сервис перейдёт в бесплатный режим."],"When the trial ends, you will return to the Free plan.":["По окончании пробного периода вы вернётесь к тарифу «Free»."],"When you need more letters, additional projects and participants":["Если вам понадобится больше писем, дополнительных проектов и участников"],"While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices.":["Похоже, при редактировании шаблона, некоторые элементы перестали помещаться в экран мобильного устройства. Попробуйте уменьшить их ширину."],"White":["Белый"],"White circle":["Белый круг"],"White circle outlined":["Белый круг обводка"],"Width":["Ширина"],"With VAT":["С НДС"],"With VAT / without VAT":["С НДС / без НДС"],"With warnings":["С предупреждениями"],"Without VAT":["Без НДС"],"Without background color":["Без цвета фона"],"Without background image":["Без фоновой картинки"],"Without button":["Без кнопки"],"Without folder":["Без папки"],"Without shadow":["Без тени"],"Work with the HTML code":["Работа с HTML-кодом"],"Work with your markup":["Работайте со своей вёрсткой"],"Year":["Год"],"Yes":["Да"],"You are buying a set of AI generation requests:":["Вы приобретаете набор запросов на генерацию с помощью ИИ:"],"You are buying an extra email generation package:":["Вы приобретаете дополнительный пакет для создания писем:"],"You are buying an extra image check package:":["Вы приобретаете дополнительный пакет проверки изображений:"],"You are buying an extra image generation package:":["Вы приобретаете дополнительный пакет для генерации изображений:"],"You are buying an extra link check package:":["Вы приобретаете дополнительный пакет проверки ссылок:"],"You are buying an extra optimization package:":["Вы приобретаете дополнительный пакет оптимизации:"],"You are buying an extra preview/test sends package:":["Вы приобретаете дополнительный пакет тестов:"],"You are buying an extra spam check package:":["Вы приобретаете дополнительный пакет проверки на спам:"],"You are paying for the plan:":["Вы оплачиваете тарифный план:"],"You are running out of AI tool usage.":["Ваш лимит использования инструментов ИИ подходит к концу."],"You can activate a 2-week trial version that includes access to all features.":["Вы можете активировать 2-недельную пробную версию, которая включает доступ ко всем функциям."],"You can add more generations right now; they are billed separately from the generations included in your plan.":["Вы можете добавить дополнительные генерации прямо сейчас; их стоимость оплачивается отдельно от генераций, включенных в ваш тарифный план."],"You can also save all blocks at once. The AI assistant will automatically determine the type and create a name for each block when saving.":["Вы также можете сохранить все блоки сразу. ИИ ассистент автоматически определит тип и создаст имя для каждого блока при сохранении."],"You can close this window: the import continues in the background.":["Окно можно закрыть: импорт продолжится в фоне."],"You can get more emails and access to all features.":["Вы сможете создавать больше писем и получить доступ ко всем функциям."],"You can increase the limit by changing your plan or buying an extra package.":["Вы можете увеличить лимит, сменив тарифный план."],"You can increase the number of emails right now.":["Вы можете увеличить количество писем прямо сейчас."],"You can save blocks from the email template.":["Вы можете сохранить блоки из шаблона письма."],"You cannot switch plans because a limit has been exceeded.":["Вы не можете сменить тарифный план, так как превышен лимит."],"You changed the role of ":["Вы поменяли роль "],"You deleted ":["Вы исключили пользователя "],"You deleted yourself from the project successfully.":["Вы исключили себя из проекта."],"You do not have permission to edit project styles.":["У вас нет прав на редактирование стилей проекта."],"You do not have permission to view this section.":["У вас нет прав на просмотр этого раздела."],"You don't have any blocks in this folder.":["У вас нет блоков в этой папке."],"You don't have any blocks yet.":["У вас еще нет сохранённых блоков."],"You don't have any emails in this folder.":["В папке пока нет писем."],"You don't have any emails yet.":["У вас еще нет сохранённых писем."],"You don't have any projects yet.":["У вас пока нет проектов."],"You don\`t have any saved blocks yet.":["У вас ещё нет сохранённых блоков."],"You have reached the limit of AI chat usage.":["Вы достигли предела использования чата ИИ.\\n"],"You have reached the limit of AI generator usage.":["Вы достигли предела использования генератора ИИ.\\n"],"You have unsaved changes. Leave this page without saving?":["У вас есть несохранённые изменения. Покинуть страницу без сохранения?"],"You have used up the number of emails you can create on your current plan":["Вы исчерпали лимит на количество писем, которое можно создать в рамках вашего текущего тарифа"],"You have used up your AI generations":["Вы исчерпали лимит генераций ИИ"],"You have used up your image check limit":["Вы исчерпали лимит проверки изображений"],"You have used up your image generation limit":["Вы исчерпали лимит на генерацию изображений"],"You have used up your link check limit":["Вы исчерпали лимит проверок ссылок"],"You have used up your optimisation limit":["Вы исчерпали лимит оптимизаций"],"You have used up your preview (test send) limit":["Вы исчерпали лимит на просмотр в почтовиках"],"You have used up your spam check limit":["Вы исчерпали лимит проверок на спам"],"You reached the plan limit":["Достигнут лимит тарифа"],"You revoke invite for ":["Вы отзываете приглашение для "],"Your Altcraft Platform URL (Cloud: ru.altkraft.com or your On-Premises URL)":["URL вашей платформы Altcraft (облачная версия: ru.altkraft.com или URL вашей локальной версии)"],"Your Sendsay account login (not email). For sublogin use format: account/sublogin":["Ваш логин в Sendsay (не email). Для ввода дополнительного логина используйте формат: account/sublogin"],"Your company":["Ваша компания"],"Your current plan":["Ваш текущий тариф"],"Your email doesn't look like spam.":["Ваше письмо не похоже на спам."],"Your generations are running out soon":["Генерации с помощью ИИ скоро закончатся"],"Your letter contains %d block that can be saved for future use.":["Ваше письмо содержит %d блок, который можно сохранить для использования в будущем.","Ваше письмо содержит %d блока, которые можно сохранить для использования в будущем.","Ваше письмо содержит %d блоков, которые можно сохранить для использования в будущем."],"Your package is activated":["Пакет активирован"],"Your password successfully reset.":["Ваш пароль успешно сброшен."],"Your password was successfully changed.":["Ваш пароль успешно изменен."],"Your plan is activated":["Тариф активирован"],"Your plan will expire soon":["Ваш тариф скоро закончится"],"Your profile was successfully updated.":["Настройки сохранены."],"Your project has incoming email":["У вашего проекта есть входящая почта"],"Your templates and emails":["Ваши шаблоны и письма"],"Youtube Black":["Youtube Чёрный"],"Youtube Red":["Youtube Красный"],"Youtube White":["Youtube Белый"],"Z-A":["Я-А"],"ZIP":["ZIP-архив"],"accordion":["аккордеон"],"and":["и"],"before %s":["до %s"],"block":["Блок","",""],"block\\u0004\\" was successfully removed.":["» удалён."],"block\\u0004Are you sure to delete selected blocks?":["Вы уверены, что хотите удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete selected blocks?":["Вы уверены, что хотите безвозвратно удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete the “":["Вы уверены, что хотите удалить «"],"block\\u0004Are you sure you want to delete the “":["Вы уверены, что хотите удалить блок «"],"block\\u0004locked.":["заблокирован."],"block\\u0004unlocked.":["разблокирован."],"block\\u0004” was successfully created.":["» создана."],"block\\u0004” was successfully removed.":["» удалён."],"border\\u0004Width":["Толщина"],"button":["кнопка"],"carousel":["карусель"],"cell":["ячейка"],"column":["колонка"],"confirmation code":["код подтверждения"],"container":["контейнер"],"copy\\u0004\\" was successfully created.":["» создана."],"corners":["углы"],"countdown":["таймер"],"cpc":["cpc"],"day":["день","дня","дней"],"e.g., 123456":["Например, 123456"],"e.g., Newsletter June 2026":["Например, дайджест за июнь"],"e.g., Special offer for you!":["Например: Специальное предложение!"],"e.g., Your Company":["Например, Ваша компания"],"e.g., https://ru.altkraft.com":["Например, https://ru.altkraft.com"],"e.g., myaccount or myaccount/sublogin":["Например, myaccount или myaccount/sublogin"],"element":["элемент"],"email":["эл. почта"],"email\\u0004\\" was successfully removed.":["\\" удалено."],"email\\u0004Are you sure to delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to delete selected emails?":["Вы уверены, что хотите удалить выбранные письма?"],"email\\u0004Are you sure to irrevocably delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to irrevocably delete selected emails?":["Вы уверены, что хотите безвозвратно удалить выбранные письма?"],"email\\u0004locked.":["заблокировано."],"email\\u0004unlocked.":["разблокировано."],"empty link":["пустая ссылка"],"empty src":["нет картинки"],"enKod":["enKod"],"expanded":["Раскрыт"],"filter":["фильтр"],"folder\\u0004\\" was successfully created.":["» создана."],"folder\\u0004Are you sure to delete “":["Вы уверены, что хотите удалить папку «"],"folder\\u0004” was successfully changed to “":["» переименована в «"],"google":["google"],"group":["группа"],"group\\u0004All":["Все"],"group\\u0004Are you sure to delete “":["Вы уверенны, что хотите удалить группу «"],"group\\u0004Project":["Проектные"],"group\\u0004Standard":["Стандартные"],"group\\u0004” was successfully changed to “":["» переименована в «"],"height":["высота"],"hour":["час","часа","часов"],"https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png":["https://emcdn.ru/384263/241017_18_K3O0sad.png"],"https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png":["https://emcdn.ru/644755/241021_5149_MtX8mBz.png"],"https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png":["https://emcdn.ru/384263/241017_18_fsshqsL.png"],"https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png":["https://emcdn.ru/384263/241017_18_I98a6kp.png"],"https://cdn.useblocks.io/1351/241017_18_NDYloAO.png":["https://emcdn.ru/384263/241017_18_QFBYtv0.png"],"https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png":["https://emcdn.ru/384263/241017_18_HFSbGb5.png"],"https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png":["https://emcdn.ru/384263/241017_18_Uu6iuFF.png"],"https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png":["https://emcdn.ru/384263/241017_18_lkaw2P4.png"],"https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png":["https://emcdn.ru/384263/241017_18_ykdbX19.png"],"https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png":["https://emcdn.ru/384263/241017_18_HMNSbZd.png"],"https://cdn.useblocks.io/1351/241031_18_JoH0f3E.png":["https://emcdn.ru/719787/241031_976_jyIsWjj.png"],"https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png":["https://emcdn.ru/719787/241031_976_lgYswn9.png"],"https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png":["https://emcdn.ru/719787/241031_976_XfDnnmK.png"],"images":["Изображения"],"indent":["отступ"],"kB":["kB"],"letter\\u0004Email":["Письмо"],"letter\\u0004email":["Письмо"],"link":["ссылка"],"loading more":["загрузить ещё"],"mail generator":["генератор писем"],"main heading":["основной заголовок"],"max 10":["максимум 10"],"member\\u0004 to ":[" на "],"member\\u0004Administrator":["Администратор"],"member\\u0004Invited":["Приглашённый"],"member\\u0004Owner":["Владелец"],"messeges":["сообщения"],"minute":["минута","минуты","минут"],"ms":["мс"],"new password":["новый пароль"],"not valid":["не верно"],"of":["из"],"or":["или"],"password":["пароль"],"picture":["изображение"],"project\\u0004 across all your projects?":[" во всех ваших проектах?"],"project\\u0004 from project ":[" из проекта "],"project\\u0004 in project ":["в проекте"],"project\\u0004Actions":["Действия"],"project\\u0004Add members":["Добавить участников"],"project\\u0004Are you sure you want to change permissions for user ":["Вы уверены, что хотите изменить права доступа для пользователя "],"project\\u0004Are you sure you want to invite user ":["Вы уверены, что хотите пригласить этого пользователя "],"project\\u0004Are you sure you want to remove user ":["Вы уверены, что хотите удалить пользователя "],"project\\u0004Are you sure you want to revoke the invitation for ":["Вы уверены, что хотите отозвать приглашение для "],"project\\u0004Change in all projects":["Изменить во всех проектах"],"project\\u0004Confirm":["Подтвердить"],"project\\u0004Could not load the project list":["Не удалось загрузить список проектов"],"project\\u0004Could not undo exclusion":["Не удалось отменить исключение"],"project\\u0004Delete":["Удалить"],"project\\u0004Delete project":["Удалить проект"],"project\\u0004Edit member list":["Изменить список участников"],"project\\u0004Email address":["Email"],"project\\u0004Exclude":["Удалить"],"project\\u0004Failed to send invitation":["Не удалось отправить приглашение"],"project\\u0004Failed to send invitations":["Не удалось отправить приглашения"],"project\\u0004Failed to update permissions":["Не удалось обновить права доступа"],"project\\u0004In all projects":["Во всех проектах"],"project\\u0004Invite":["Пригласить"],"project\\u0004Invite participants":["Пригласить участников"],"project\\u0004Invite to all projects":["Пригласить во все проекты"],"project\\u0004Name":["Имя"],"project\\u0004No matching memberships to update in your other projects":["В других ваших проектах нет подходящих участников для обновления"],"project\\u0004Permissions updated":["Права доступа обновлены"],"project\\u0004Project participants":["Участники проекта"],"project\\u0004Project settings":["Настройки проекта"],"project\\u0004Remove from project":["Удалить из проекта"],"project\\u0004Revoke":["Отозвать"],"project\\u0004Revoke invite":["Отозвать приглашение"],"project\\u0004Role in project":["Роль в проекте"],"project\\u0004The invitation was restored":["Приглашение было восстановлено"],"project\\u0004The invitation was sent to all your projects":["Приглашение было отправлено во все ваши проекты"],"project\\u0004The invitation was sent to some of your projects":["Приглашение было отправлено некоторым из ваших проектов"],"project\\u0004The participant was restored to the project":["Участник был восстановлен в проекте"],"project\\u0004Undo":["Отменить"],"project\\u0004You":["Вы"],"project\\u0004You are not the owner of any project":["Вы не являетесь владельцем какого-либо проекта"],"project\\u0004You excluded user ":["Вы заблокировали пользователя "],"recovery\\u0004\\" was successfully recovered.":["» восстановлен."],"recovery\\u0004” was successfully deleted.":["» удалено."],"recovery\\u0004” was successfully recovered.":["» завершено."],"resize":["размер"],"running+shoes":["running+shoes"],"s":["с"],"secure":["безопасно"],"selected":["выбрано"],"selling blue":["продающий синий"],"sender@example.com":["sender@example.com"],"spring_sale":["spring_sale"],"square":["квадрат"],"tab\\u0004AI assistant":["AI Ассистент"],"tab\\u0004Build":["Контент"],"tab\\u0004Calendar":["Календарь"],"tab\\u0004Checkbox":["Чекбокс"],"tab\\u0004Discuss":["Обсуждение"],"tab\\u0004Dropdown list":["Выпадающий список"],"tab\\u0004Input":["Поле ввода"],"tab\\u0004Optimize":["Оптимизация"],"tab\\u0004Radio button":["Радиокнопка"],"tab\\u0004Settings":["Настройки"],"tab\\u0004Styles":["Стили"],"table":["таблица"],"test":["тест","теста","тестов"],"text":["текст"],"textlink":["textlink"],"time to load":["время загрузки"],"total size":["общий размер"],"user":["Пользователь"],"utm_campaign":["utm_campaign"],"utm_content":["utm_content"],"utm_medium":["utm_medium"],"utm_source":["utm_source"],"utm_term":["utm_term"],"variable":["переменная"],"verb\\u0004Import":["Импортировать"],"video":["видео"],"was successfully":[" успешно"],"was used":["был использован","было использовано","было использовано"],"which exceeds the recommended 90 KB limit.":["что превышает рекомендуемый предел в 90 КБ."],"width":["ширина"],"–":["–"],"—":["—"],"“":["«"],"”":["»"],"” block?":["»?"],"” folder?":["»?"],"” group and all nested groups?":["» вместе со всеми вложениями?"],"” was successfully created.":["» создан."],"” was successfully imported.":["» импортировано."],"” was successfully sent.":["» отправлено."],"”.":["»."],"🎉 Welcome! Pro plan is activated":["🎉 Привет! Тариф Pro активирован"]}`)};function rb(e){if(!$s)return;const{id:t,catalog:n,time:r,hash:i}=$s;e.getInstance(o.LOCALE_SERVICE_ID)?.prime(t,n,{time:r,hash:i})}function zs(e,t,n){let r=!1;const i=e.watch(a=>{r||!t(a)||(r=!0,n())});r&&i.dispose()}function ib(e,t){const n=e.getInstance(g.CONFIG_SOURCE_ID);n&&zs(n,r=>!!r?.codeEnabled||!!r?.codeSideEnabled,()=>{lb(e,()=>{cb(e,()=>{sb(e,()=>{Ht(e).whenVisible(()=>{Xt(()=>{ab(t).catch(()=>{})})})})})})})}async function ab(e){await e()}function sb(e,t){const n=e.getInstance(Da);if(!n){Xt(t);return}const r=()=>{if(n.pipeline.filledGeneration()!==void 0){t();return}Xt(r)};Xt(r)}function lb(e,t){const n=e.getInstance(o.EMAIL_DOCUMENTS_ID);if(!n)return;if(n.current()){t();return}let r=!1;const i=n.subscribe(()=>{r||!n.current()||(r=!0,t())});r&&i()}function cb(e,t){const n=e.getInstance(g.OPTIONS_SOURCE_ID);n&&zs(n,r=>!!r?.element,t)}function db(e){ib(e,lu)}var Gs=g.createIdentifier$1("NotificationService");function Ws(e,t="success"){return typeof e=="string"&&(e={message:e}),o.filterUndefined({type:e.type||t,data:e.data,innerException:e.innerException,title:e.message,description:e.description,actions:e.btn,onClose:e.onClose,duration:e.duration,icon:e.icon,placement:e.placement,style:e.style,closeIcon:e.closeIcon,props:e.props,role:e.role})}var ub="bottomRight";function Wr(e,t){return typeof e=="string"||typeof e=="object"?Ws(e,t):e}var mb=class extends g.Disposable{send;onNotify;onError;onSuccess;constructor(e,t,n){super(),this.send=n,this.onNotify=Ct(t,c=>c,c=>Wr(c)),this.onError=Ct(g.filter(t,c=>c.type==="error"),c=>c,c=>Wr(c,"error")),this.onSuccess=Ct(g.filter(t,c=>c.type==="success"),c=>c,c=>Wr(c));const r=this.addDisposable(new kt(this.onNotify)),i=this.addDisposable(new kt(this.onError)),a=this.addDisposable(new kt(this.onSuccess));this.addDisposable(e.watch(({handleNotify:c,handleError:d,handleSuccess:u})=>{r.setListener(c),i.setListener(d),a.setListener(u)}))}notify(e){this.send({placement:ub,...Ws(e)})}};function pb(e){e.injectFactory(Gs,()=>{const t=new mb(e.getInstance(g.OPTIONS_SOURCE_ID),g.getEvent(e,g.events.ON_NOTIFICATION),n=>{o.executeCommand(e,o.NOTIFY_COMMAND_ID,n)});return e.getInstance(g.DISPOSABLE_ID)?.addDisposable(t),t},!0)}function fb(e){const t=o.getEmailDocuments(e),n=i=>{e.getInstance(g.STORE_ID)?.dispatch(o.taxonomiesApi.util.invalidateTags([{type:"folder",id:i}]))},r=t.onSaved(i=>{i.created&&n("folder")});e.getInstance(g.DISPOSABLE_ID)?.addDispose(r)}function P0(e){return e}var hb=[{name:"rest.legacySections",provides:[g.REST_CLIENT_ID],setup:g.provideLegacyRestSections},{name:"canvas.resizer",provides:[Ni],setup:X_},{name:"canvas.sandboxLocale",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:J_},{name:"locale.brandCatalog",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:rb},{name:"email.restPorts",provides:[o.REST_EMAIL_PORTS_ID],setup:G_},{name:"block.historyPort",setup:q_},{name:"email.templatePrefetch",setup:eb},{name:"locale.antd",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:ob},{name:"save.listsFollow",setup:fb},{name:"monaco.prewarm",awaits:{services:[g.CONFIG_SOURCE_ID]},setup:db},{name:"notifications",provides:[Gs],setup:pb},{name:"email.operations",setup:T_}],gb=g.defineMixin(e=>{for(const t of L_(hb))t.setup(e);return{instance:I_(e)}}),yb=g.combineMixins([gb,Dy,m_,y_,A_,x_,Bh,p_,$a,za]);async function _b(e){const t=new Map;typeof e=="object"&&(e=e.code);const{amp2html:n,html2amp:r}=await(0,Ye.__vitePreload)(async()=>{const{amp2html:c,html2amp:d}=await Promise.resolve().then(()=>be("./static/core/72c8c438.js"));return{amp2html:c,html2amp:d}},void 0,{}.url),i=await _t.changeHtml(e,async c=>{await _t.replaceImagesInDocument(c.document,d=>o.mapper.getEscapedText(d)!==d?d:o.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-disabled"))d.remove();c.handleRender(async({contentDocument:d,managedNodeController:u})=>{await r(d,{mappedTags:{script:"___script"},commit:()=>u.commit()})})},[800]),a=await _t.changeHtml(e,async c=>{await _t.replaceImagesInDocument(c.document,d=>o.mapper.getEscapedText(d)!==d?d:o.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-only"))d.remove();await n(c.document,{mappedTags:{script:"___script"}})},[800]);return{code:e,html:a,ampHtml:i}}async function bb(){const{installDiagnostics:e}=await(0,Ye.__vitePreload)(async()=>{const{installDiagnostics:t}=await Promise.resolve().then(()=>be("./static/core/baf39a20.js"));return{installDiagnostics:t}},void 0,{}.url);return e()}async function vb(e,t){const{initDevTools:n}=await(0,Ye.__vitePreload)(async()=>{const{initDevTools:r}=await Promise.resolve().then(()=>be("./static/core/ceff9046.js"));return{initDevTools:r}},void 0,{}.url);n(e,t)}var Eb="1.1.85-dev.6";nn.asyncMixins=yb,nn.initDevTools=vb,nn.installDiagnostics=bb,nn.parseAMP=_b,nn.version=Eb});
857
+ </tr>`)}},fn=async()=>{const O=ie();at(O,async V=>{try{const X=document.querySelector(".email-preview"),re=getComputedStyle(X),oe=await I(V,[re.width],e.utm_parameters,async qe=>{rt(qe)}),H=await ne({htmlContent:oe,notification:E}).unwrap(),ke=window.URL.createObjectURL(new Blob([H],{type:"application/pdf"})),_e=document.createElement("a");_e.href=ke,_e.setAttribute("download",`${Ve()}.pdf`),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),window.URL.revokeObjectURL(ke)}catch{}})},Lt=O=>{const V=ie();at(V,X=>{Ee({event:"click",action:"export_email",export_type:"HTML"});const re=document.querySelector(".email-preview"),oe=getComputedStyle(re);I(X,[oe.width],e.utm_parameters,async H=>{await Ue(H),rt(H),await o.processAmp(H,O)}).then(H=>{const ke=new Blob([H],{type:"text/html;charset=utf-8"});(0,an.saveAs)(ke,`${Ve()}.html`)}).catch(H=>{})},!0)},ct=O=>{const V=ie();at(V,X=>{Ee({event:"click",action:"export_email",export_type:"TEXT"});const re=document.querySelector(".email-preview"),oe=getComputedStyle(re);I(X,[oe.width],e.utm_parameters,async H=>{await Ue(H),rt(H),await o.processAmp(H,O);const[{htmlToText:ke},{EmailTextPlainConvertOptions:_e}]=await Promise.all([(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/8130abb3.js")),void 0,{}.url),(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/422d6166.js")),void 0,{}.url)]);H.handleReadHtml(qe=>{qe.html=ke(qe.contentDocument,_e)})}).then(H=>{const ke=new Blob([H],{type:"text/plain;charset=utf-8"});(0,an.saveAs)(ke,`${Ve()}.txt`)}).catch(H=>{})})},Et=()=>{const O=ie();at(O,V=>{Ee({event:"click",action:"export_email",export_type:"MARKDOWN"});const X=document.querySelector(".email-preview"),re=getComputedStyle(X),{utm_parameters:oe}=e;I(V,[re.width],oe,async H=>{rt(H),await o.processAmp(H,"html");const{htmlToMarkdown:ke}=await(0,Ye.__vitePreload)(async()=>{const{htmlToMarkdown:_e}=await Promise.resolve().then(()=>be("./static/core/c54e9dcb.js"));return{htmlToMarkdown:_e}},void 0,{}.url);H.handleReadHtml(_e=>{_e.html=ke(_e.contentDocument)})}).then(H=>{const ke=new Blob([H],{type:"text/markdown;charset=utf-8"});(0,an.saveAs)(ke,`${Ve()}.md`)}).catch(H=>o.reportError(H,{origin:"markdown-export"}))})},Ot=O=>{const V=ie();at(V,X=>{Ee({event:"click",action:"export_email",export_type:"Clipboard"});const re=document.querySelector(".email-preview"),oe=getComputedStyle(re);I(X,[oe.width],e.utm_parameters,async H=>{await Ue(H),rt(H),await o.processAmp(H,O)}).then(H=>navigator.clipboard.writeText(H).then(function(){E.success(n("The email has been copied to the clipboard."))})).catch(H=>{})},!0)},jn=async O=>{je&&mr(je)},Ln=()=>{ze(null),T("")},hn=async()=>{if(!P){N(!0);try{const O=await Se([800,uf],cf);if(!O)return;const{hrefs:V,dispose:X}=O;try{const[re,oe]=await Promise.all(V.map(_e=>_t.getImageByUrl(_e).then(qe=>_t.imageToBlob(qe)))),H=Ve(),ke=await _t.htmlFilesToZip(lf(H,{desktop:re,mobile:oe}));(0,an.saveAs)(ke,Ia(H).archive),Ee({event:"click",action:"export_email",export_type:"Image"})}finally{X()}}catch{E.error({title:n("Error"),description:n("Failed to export the email as images. Please try again.")})}finally{N(!1)}}},On=O=>{const V=Z.get(o.APP_COOKIES.em_token);return fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(O)}`,{headers:{authorization:`Bearer ${V}`}}).then(X=>X.blob())},Mn=O=>new Promise((V,X)=>{const re=()=>On(O).then(V,X);fetch(O).then(oe=>V(oe.blob()),re).catch(()=>{})}),ht=(O,V)=>{const X=ie();at(X,re=>{Ee({event:"click",action:"export_email",export_type:"Outlook"});const oe=document.querySelector(".email-preview"),H=getComputedStyle(oe),ke=async(_e,qe)=>{_e.document,await o.processAmp(_e,qe),await Ue(_e),rt(_e)};x(e.title,re,[H.width,H.height],e.utm_parameters,O?_e=>ke(_e,"html"):_e=>ke(_e),V?{embedImagesAsBase64:!0,getImageBlob:Mn}:void 0).then(_e=>{const qe=new Blob([_e],{type:"text/html;charset=utf-8"});(0,an.saveAs)(qe,`${Ve()}.eml`)}).catch(_e=>{})})},St=O=>{C({centered:!0,mask:{closable:!0},title:n("Embed images in the file?"),content:n('If "Yes", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If "No", images will be loaded from external links.'),okText:n("Yes"),cancelText:n("No"),onOk:()=>ht(O,!0),onCancel:()=>ht(O,!1)})},ce=async()=>{const O=ie();at(O,async V=>{Ee({event:"click",action:"export_email",export_type:"ZIP"});const X=document.querySelector(".email-preview"),re=getComputedStyle(X),oe=await Y(V,[re.width,void 0],e.utm_parameters,Mn,async ke=>{await Ue(ke),rt(ke),Tt&&await o.processAmp(ke,"html")});Tt&&(oe["amp.html"]=await I(V,[re.width],e.utm_parameters,async ke=>{await Ue(ke),rt(ke),await o.processAmp(ke,"amp")}));const H=await _t.htmlFilesToZip(oe);(0,an.saveAs)(H,`${Ve()}.zip`)},!0)},we=async()=>{if(Ee({event:"click",action:"duplicate_email",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew)E.warning({title:n("To create a copy, you need to save the email.")});else{if((await B.fire(e)).some(O=>O===!1))return;ft({title:xt.generateCopyTitle(e.title),...e.meta!==void 0?{meta:e.meta}:{},project:Number(ue?.id),description:e.description,html:xt.generateCopyHtml(ie()||"",String(e.title)),parent_email:e.parent_email||127017,common_styles:e.common_styles||"",utm_parameters:{utm_source:e.utm_parameters?.utm_source,utm_medium:e.utm_parameters?.utm_medium,utm_campaign:e.utm_parameters?.utm_campaign,utm_term:e.utm_parameters?.utm_term,utm_content:e.utm_parameters?.utm_content},emailtags:e.emailtags,folder:e.folder}).unwrap().then(O=>{u(`/projects/${ue.id}/emails/${O.id}`),E.success({title:n('The copy of email "')+e.title+n('" was successfully created.')}),Ee({event:"duplicate",action:"duplicate_email_success",entity_type:"email",entity_id:e.id,cloned_entity_id:O.id,project_id:e.project,context:"editor"}),ge("folder")}).catch(O=>{E.error({title:O.data.code,description:O.data.message})})}},De=()=>{Ee({event:"click",action:"click_delete_email_menu_item",entity_type:"email",entity_id:e.id,project_id:e.project,context:"editor"}),e.isNew?E.success(n("The draft of the email has been deleted.")):nt(e,u)},nt=(O,V)=>{Ee({event:"open",action:"open_delete_email_modal",entity_type:"email",entity_id:O.id,project_id:O.project,context:"editor"}),C({mask:{closable:!0},centered:!0,title:r('Are you sure to delete "',"email")+O.title+n('" email?'),icon:(0,s.jsx)(o.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:22,style:{color:y.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:n("Yes"),cancelText:n("No"),onOk:()=>vt(O,V)})},Le=()=>{fr().catch(()=>{}),o.uploadFile("application/zip, message/rfc822, text/html",Kt)},Kt=async O=>{const V=O[0];try{i(o.setIsGlobalLoading(!0));const{createDocumentProcessor:X,createFileProcessor:re,importEmail:oe}=await fr(),{html:H,hasBrowserExtensionArtifacts:ke}=await oe(V,re(c,d,g,ue,M),X(V))??{html:"",hasBrowserExtensionArtifacts:!1};ke&&$.fire();const[_e]=_t.getFileNameAndExt(V.name.replaceAll("&nbsp;"," ")),qe=_e||xt.getTitleFromHtml(H)||"";te(H,{undoable:!0}),a({title:qe}),i(o.setIsGlobalLoading(!1)),le.fire({html:H})}catch(X){i(o.setIsGlobalLoading(!1));const re=X instanceof Error?X.message:X;E.error({title:re})}Ee({event:"upload_file",action:"import_email"})},Ut=()=>{const O=ie();O&&(Ee({event:"click",action:"convert_layout"}),le.fire({html:O}))},dt=[];M.emailDropdownMenuClone&&dt.push({label:n("Clone"),icon:(0,s.jsx)(o.EmIcons,{icon:"CopyOutlined",component:y.icons$CopyOutlined,size:16,strokeWidth:M.iconStrokeWidth}),key:"Clone",className:"em-analytics__email-clone",disabled:lt.isLoading,onClick:we}),M.emailDropdownMenuImport&&dt.push({label:r("Import","verb"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,style:Dt}),locked:Qe.isLocked,strokeWidth:M.iconStrokeWidth}),key:"Import",className:"em-analytics__editor-page__import",onClick:()=>{if(Qe.isLocked){Ze("template_import");return}Ee({event:"click",action:"import_email"}),Le()}});const Nn=ie(),$t=!e.hasOwnProperty("type")&&Sa(Nn,L)!==null;M.emailDropdownMenuConvert&&$t&&dt.push({label:n("Convert"),icon:(0,s.jsx)(o.EmIcons,{icon:"SwapOutlined",component:y.icons$SwapOutlined,size:16,strokeWidth:M.iconStrokeWidth}),key:"ConvertLayout",className:"em-analytics__email-convert",onClick:Ut}),(m||f||g.id?.toString()===e.author?.toString())&&(M.emailDropdownMenuLock&&dt.push({label:(0,s.jsx)(va,{element:e,context:"editor"},"Lock"),icon:e.lock?(0,s.jsx)(o.EmIcons,{icon:"UnLock",component:y.icons$UnLock,size:16,strokeWidth:M.iconStrokeWidth}):(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:16,strokeWidth:M.iconStrokeWidth}),disabled:e.isNew}),M.emailDropdownMenuRemove&&dt.push({label:n("Remove"),icon:(0,s.jsx)(o.EmIcons,{icon:"DeleteOutlined",component:y.icons$DeleteOutlined,size:16,strokeWidth:M.iconStrokeWidth}),key:"Remove",className:"em-analytics__email-remove",style:{color:"#ff4d4f"},onClick:De}));const Tt=e.isAmp,It=[],Fo=()=>[...Tt?[{key:"html_txt",label:`${n("Plain text")} (HTML)`,onClick:()=>ct("html")},{key:"сode_txt",label:`${n("Plain text")} (AMP)`,onClick:()=>ct("amp")}]:[{key:"plain_txt",label:n("Plain text"),onClick:()=>ct()}],{key:"markdown",label:n("Markdown"),onClick:()=>Et()}];M.exportHtmlEnabled&&It.push({key:"html",label:n("Code"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileTextOutlined",component:y.icons$FileTextOutlined,style:Dt}),locked:D.isLocked,strokeWidth:M.iconStrokeWidth}),...D.isLocked?{onClick:()=>Ze("export_html")}:Tt?{children:[{key:"сode_html",label:n("AMP"),onClick:()=>Ae.isLocked?Ze("export_amp"):Lt("amp")},{key:"html_amp",label:n("HTML"),onClick:()=>Lt("html")}]}:{onClick:()=>Lt()}}),M.exportZipEnabled&&It.push({key:"zip",label:n("ZIP"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileZipOutlined",component:y.icons$FileZipOutlined,style:Dt}),locked:D.isLocked,strokeWidth:M.iconStrokeWidth}),...D.isLocked?{onClick:()=>Ze("export_html")}:{onClick:()=>ce().catch(O=>{})}}),M.exportClipboardEnabled&&It.push({key:"clipboard",label:n("Clipboard"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"SnippetsOutlined",component:y.icons$SnippetsOutlined,style:Dt}),locked:D.isLocked,strokeWidth:M.iconStrokeWidth}),...D.isLocked?{onClick:()=>Ze("export_html")}:Tt?{children:[{key:"clipboard_html",label:n("AMP"),onClick:()=>Ae.isLocked?Ze("export_amp"):Ot("amp")},{key:"clipboard_amp",label:n("HTML"),onClick:()=>Ot("html")}]}:{onClick:()=>Ot()}}),M.exportTextEnabled&&It.push({key:"text",label:n("Text"),icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileOutlined",component:y.icons$FileOutlined,style:Dt}),locked:D.isLocked,strokeWidth:M.iconStrokeWidth}),...D.isLocked?{onClick:()=>Ze("export_html")}:M.exportMarkdownEnabled?{children:Fo()}:Tt?{children:[{key:"сode_txt",label:n("AMP"),onClick:()=>Ae.isLocked?Ze("export_amp"):ct("amp")},{key:"html_txt",label:n("HTML"),onClick:()=>ct("html")}]}:{onClick:()=>ct()}}),M.exportOutlookEnabled&&It.push({key:"outlook",icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FileWordOutlined",component:y.icons$FileWordOutlined,style:Dt}),locked:Pe.isLocked,strokeWidth:M.iconStrokeWidth}),label:n("Outlook"),onClick:()=>Pe.isLocked?Ze("export_platforms"):St(!!Tt)}),M.exportPdfEnabled&&It.push({key:"pdf",icon:(0,s.jsx)(qt,{icon:(0,s.jsx)(o.EmIcons,{icon:"FilePdfOutlined",component:y.icons$FilePdfOutlined,style:Dt}),locked:b.isLocked,strokeWidth:M.iconStrokeWidth}),label:n("PDF"),onClick:()=>b.isLocked?Ze("export_pdf"):fn()}),M.exportPngEnabled&&It.push({key:"img",icon:(0,s.jsx)(qt,{icon:P?(0,s.jsx)(o.EmIcons,{icon:"LoadingOutlined",component:y.icons$LoadingOutlined,spin:!0,style:Dt}):(0,s.jsx)(o.EmIcons,{icon:"FileImageOutlined",component:y.icons$FileImageOutlined,style:Dt}),locked:W.isLocked,strokeWidth:M.iconStrokeWidth}),label:n("PNG"),disabled:!W.isLocked&&P,onClick:()=>W.isLocked?Ze("export_png"):hn()});const gt=e.author;return(0,s.jsxs)(y.ui_kit$Space,{children:[M.emailDropdownMenuEnabled?(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:dt},children:(0,s.jsx)(y.ui_kit$Button,{type:"default",block:!1,className:"email-page-header__btn email-page-header__btn_extra",onClick:()=>{},children:(0,s.jsx)(o.EmIcons,{icon:"DotsHoriz",component:y.icons$DotsHoriz,size:18,strokeWidth:M.iconStrokeWidth})})},"Actions"):M.emailDropdownMenuImport&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Import","verb"),placement:"bottom",children:M.emailDropdownMenuImportButton?(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:16,strokeWidth:M.iconStrokeWidth}),onClick:()=>{Ee({event:"click",action:"import_email"}),Le()},children:n("Import")}):(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__editor-page__import",type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudUploadOutlined",component:y.icons$CloudUploadOutlined,size:22,strokeWidth:M.iconStrokeWidth}),onClick:()=>{Ee({event:"click",action:"import_email"}),Le()}})}),M.emailExportEnabled&&(0,s.jsx)(y.ui_kit$Dropdown,{arrow:{pointAtCenter:!0},placement:"bottom",menu:{items:It},children:(0,s.jsx)(y.ui_kit$Button,{className:"em-analytics__email-page__export",type:"default",icon:(0,s.jsx)(o.EmIcons,{icon:"CloudDownloadOutlined",component:y.icons$CloudDownloadOutlined,size:16,strokeWidth:M.iconStrokeWidth}),children:n("Export")},"Export")},"Export"),!e.hasOwnProperty("type")&&(0,s.jsx)(ba,{disabled:fe,email:e},"Save"),!!e.hasOwnProperty("type")&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Nu,{disabled:fe,rightCol:void 0,block:e,isEditableRights:m||f||g.id?.toString()===gt?.toString(),autoSaveBlockResult:t})},"Save"),(0,s.jsx)(ap,{open:me,codeSize:o.getCodeSize(Ce),onMinimize:Bt,onDownloadAsIs:Me,onCancel:Xe}),je&&mr(je)&&(0,s.jsx)(yp,{integration:mr(je),visible:!!je,loading:et,onConfirm:jn,onCancel:Ln,__:n}),(0,s.jsx)(o.PlanUpgradePrompt,{open:J,sideOnOk:void 0,onCancel:()=>ye(!1),initialSlide:Te})]})},_o=o.createApi({reducerPath:"confirmationMailApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/",responseHandler:e=>e.text()}),endpoints:e=>({getConfirmationMail:e.query({query:({userId:t,email:n})=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/f0da9c0f-ed12-4d23-8a86-b86f7bf1a276?user_id=${t}&user_email=${n}`)}`})})})}),{useLazyGetConfirmationMailQuery:hf}=_o,gf=()=>{const{__:e}=o.useI18n(),t=o.useNotification(),n=o.useCurrentUser(),[r]=hf(),[i,a]=(0,l.useState)(!1),c=o.usePushToDataLayer();(0,l.useEffect)(()=>{n.hasOwnProperty("email_confirmation")&&a(n.email_confirmation)},[n,i]);const d=()=>{c({event:"click",action:"click_resend_confirmation_email",user_email:n.email,user_id:n.id}),r({userId:n.id,email:n.email}).then(({data:u,error:m})=>{u?t.success(e("Confirmation email has been sent to {confirmedEmail}.").replace("{confirmedEmail}",n.email)):m&&t.error(m)})};return n?.email_confirmation||!n?.privacy_policy_agreement?null:(0,s.jsx)("div",{className:"main__ribbon",children:(0,s.jsxs)("span",{children:[(0,s.jsx)(o.EmIcons,{icon:"EmailConfirmation",component:y.icons$EmailConfirmation,size:16,style:{marginRight:10,verticalAlign:"-0.15em"}}),e("Confirmation email was sent to")," ",(0,s.jsx)("em",{children:n.email}),". ",e("Didn't receive an email?")," ",(0,s.jsxs)(y.ui_kit$Button,{type:"primary",size:"small",className:"main__ribbon-resend",style:{fontSize:16,lineHeight:1,display:"inline-flex",alignItems:"center",gap:8},onClick:d,children:[e("Resend"),(0,s.jsx)(o.EmIcons,{icon:"SendOutlined",component:y.icons$SendOutlined,size:16,style:{flexShrink:0}})]})]})})},yf=({className:e,leftBlock:t,rightBlock:n,isHeaderCodeMenuOpen:r=!1})=>{const{token:i}=(0,y.ui_kit$useToken)(),a=(0,l.useRef)(),c=o.useAppConfig();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(gf,{}),c.headerShow&&(0,s.jsx)("header",{className:(0,ot.default)("header",{[e]:e}),style:{borderColor:i.colorBorder},children:!r&&(0,s.jsx)(o.CSSTransition,{nodeRef:a,in:!r,timeout:300,classNames:"transition",children:(0,s.jsxs)("div",{className:"header__container container",children:[(0,s.jsx)("div",{className:"header__left",style:{flexGrow:1},children:t}),(0,s.jsx)("div",{className:"header__right",children:(0,s.jsx)(y.ui_kit$Space,{size:10,children:n})})]})})})]})},_f=e=>{},Aa=h.createIdentifier$1("canvas.headerFlow");function bf(e){const t=(0,l.useCallback)(n=>e?e.subscribe(n):()=>{},[e]);return(0,l.useSyncExternalStore)(t,()=>e?.isReady()===!0)}var xa=({email:e,isCollaborationEditor:t})=>{const[n]=y.ui_kit$Form.useForm(),{__:r}=o.useI18n();let i=o.useDispatch();const a=o.useEmailAttributesWriter(),c=o.useAppNavigate(),d=o.useOpenPlanCatalog(),u=Yi("header"),m=o.useCurrentUser(),f=o.useContainer().getInstance(Aa),g=o.useProjectData(),{owner:_,admin:p}=Qn(),{token:E}=(0,y.ui_kit$useToken)(),C=o.useAppConfig(),w=o.usePushToDataLayer(),S=(0,l.useRef)(),I=(0,l.useRef)(),x=(0,l.useRef)(),Y=o.useEventEmitter(h.events.ON_PREVIOUSBUTTON_CLICK_ID),Z=o.useEventEmitter(h.events.ON_PREHEADER_CHANGED_ID),M=o.useEventEmitter(h.events.ON_SUBJECT_CHANGED_ID),L=o.useSelector(o.selectCodeModeDirection),A=e.hasOwnProperty("type")?o.BLOCK:o.EMAIL,j=o.useSelector(o.selectElementSettings$1),z=o.useSelector(o.selectElementSettings),B=A==="email"?j:z,$=o.useSelector(o.selectIsCodeMode),[de,pe]=(0,l.useState)(!1),[q,ee]=(0,l.useState)(!1),[Fe,ve]=(0,l.useState)(!1),et=(0,l.useCallback)(()=>ve(!1),[]),Ee=(0,l.useCallback)(()=>{ve(!1),d()},[d]),fe=Hi("email_generate"),Q=fe.exceeded?o.getLimitUpgradePresetDefinition(fe.exceeded.presetId):null;(0,l.useEffect)(()=>{const b=!!B?.type&&(B?.type===o.ELEMENT_TYPES.TEXT||B?.type===o.ELEMENT_TYPES.LINK||B.type===o.ELEMENT_TYPES.BUTTON)&&$&&L!=="bottom";pe(b),i(o.setHeaderCodeMenuOpen(b))},[B,L,$]);const me=(0,l.useCallback)(()=>{w({event:"click",action:"click_back_button",entity_type:A==="block"?"block":"email",entity_id:e?.id,project_id:e?.project||g?.id,context:"editor"}),Y.fire(e)},[c,Y,e,g?.id,w,A]),{document:ae}=o.useCurrentSession(),se=bf(ae);o.usePrevious(([b])=>{se&&b!==e.subject&&M.fire(e.subject)},[e.subject,se]);const Ie=(0,l.useCallback)(b=>{const W=b.target.value;M.fire(W)},[M]),Ce=(0,l.useCallback)(b=>{const W=b.target.value;Z.fire(W)},[Z]);o.usePrevious(([b])=>{se&&b!==e.preheader&&Z.fire(e.preheader)},[e.preheader,se]);const Be=(0,l.useCallback)((b,W="?")=>{b.subject?.length,b.preheader?.length,n.setFieldValue("subject",b.subject??""),n.setFieldValue("preheader",b.preheader??"")},[n]),J=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{const b=e?.renderGuid??(e?.id!=null?String(e.id):void 0);!se||!b||J.current===b||(J.current=b,Be(e,"identity"))},[se,e,Be]);const ye=(0,l.useCallback)(b=>{const W=o.stripSubjectTags(b.value).trim();return W!==b.value&&n.setFieldValue("subject",W),W},[n]),Te=(0,l.useCallback)(b=>{const W=ye(b.target);a({subject:W})},[a,ye]),he=o.useEvent(h.events.BEFORE_SAVE_EMAIL),je=(0,l.useCallback)(async b=>{const W=I.current?.input;if(document.activeElement===W){const Ae=ye(W);Ae!==b.subject&&(b.subject=Ae,a({subject:Ae}))}const Pe=x.current?.input;if(document.activeElement===Pe){const Ae=Pe.value.trim();Ae!==b.preheader&&(b.preheader=Ae,a({preheader:Ae}))}await f?.whenDelivered()},[f,a,ye]);(0,l.useEffect)(()=>{const b=he(je);return()=>b.dispose()},[he,je]);const ze=(0,l.useCallback)(b=>{const W=b.target.value.trim();a({preheader:W})},[a]),k=o.useEvent(h.events.ON_HEADER_APPLIED_ID);(0,l.useEffect)(()=>{const b=k(({field:W,value:Pe})=>{n.setFieldValue(W,Pe)});return()=>b.dispose()},[k,n]),_f(e.title===null?r("New email title"):e.title);const T=(0,l.useCallback)(()=>{i(o.setActiveSettingsTab(o.AICHAT)),setTimeout(()=>{const b=document.querySelector('li.ai-response-change-context[role="theme-and-preheader-generator"]');b&&b.click()},100)},[i]),P=(0,l.useCallback)(()=>{fe.isLocked?fe.state.state==="locked_by_limit"&&fe.exceeded?ve(!0):ee(!0):T()},[fe,T]),N=(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)(y.ui_kit$Space,{ref:S,size:10,children:[C.headerArrowBackVisible&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Back"),placement:"left",children:(0,s.jsx)(y.ui_kit$Button,{type:"text",icon:(0,s.jsx)(o.EmIcons,{icon:"ArrowLeftOutlined",component:y.icons$ArrowLeftOutlined,size:22,strokeWidth:C.iconStrokeWidth}),onClick:me,shape:"circle"})}),(0,s.jsx)("div",{children:(C.headerTitleVisible||C.headerPreheaderVisible)&&(0,s.jsxs)(y.ui_kit$Form,{form:n,layout:"vertical",name:"subject_preheader_form",autoComplete:"off",initialValues:{subject:"",preheader:""},children:[C.headerTitleVisible&&(0,s.jsx)("div",{style:{marginTop:se?-3:0},children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:r("Subject")}),se?(0,s.jsxs)("div",{className:"ant-page-header-heading",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"subject",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-title",ref:I,placeholder:r("Enter subject line here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Ie,onPressEnter:Te,onBlur:b=>{Te(b),document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-title").closest(".ant-page-header-heading").classList.add("focus")},disabled:C.lockPreheaderAndTitle})}),C.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Generate with AI"),children:(0,s.jsx)(o.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:C.iconStrokeWidth,onClick:P})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"40%",marginTop:3}})]})}),C.headerPreheaderVisible&&(0,s.jsx)("div",{children:(0,s.jsxs)(y.ui_kit$Space,{style:{width:"100%"},align:"baseline",size:12,children:[(0,s.jsx)("div",{className:"subject_preheader_form__title",children:r("Preheader")}),se?(0,s.jsxs)("div",{className:"ant-page-header-heading ant-page-header-heading_preheader",children:[(0,s.jsx)(y.ui_kit$Form.Item,{name:"preheader",noStyle:!0,children:(0,s.jsx)(y.ui_kit$Input,{className:"ant-page-header-heading-preheader",ref:x,placeholder:r("Enter preheader here"),variant:"borderless",autoComplete:"off","data-lpignore":"true","data-1p-ignore":"","data-bwignore":"true","data-form-type":"other",onChange:Ce,onPressEnter:ze,onBlur:b=>{ze(b),document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.remove("focus")},onFocus:()=>{document.querySelector(".ant-page-header-heading-preheader").closest(".ant-page-header-heading").classList.add("focus")},disabled:C.lockPreheaderAndTitle})}),C.aiAssistentEnabled&&(0,s.jsx)(y.ui_kit$Tooltip,{title:r("Generate with AI"),children:(0,s.jsx)(o.EmIcons,{icon:"AI",component:y.icons$AI,size:12,strokeWidth:C.iconStrokeWidth,onClick:P})})]}):(0,s.jsx)(y.ui_kit$Skeleton.Input,{active:!0,size:16,style:{width:"80%",marginTop:2}})]})})]})})]})}),D=(0,s.jsxs)(s.Fragment,{children:[C.emailIdShow&&!!e.id&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"email-page-header__email-id",children:"ID"+e.id}),(0,s.jsx)(y.ui_kit$Divider,{orientation:"vertical"})]}),(0,s.jsx)(fa,{emailElement:e,isCollaborationEditor:t}),C.commandButtonsEnabled&&(0,s.jsxs)(s.Fragment,{children:[e.lock?(0,s.jsx)(o.EmIcons,{icon:"Lock",component:y.icons$Lock,size:18,strokeWidth:C.iconStrokeWidth,className:(0,ot.default)("lock-icon",{"lock-icon__disabled":!(_||p||m.id?.toString()===e.author?.toString())}),style:{color:E.colorPrimary,verticalAlign:"sub"}},"Lock"):null,(0,s.jsx)(ff,{email:e,isHeaderCodeMenuOpen:de},"Buttons")]})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(yf,{className:"email-pane__header",leftBlock:u?N:null,rightBlock:u?D:null,isHeaderCodeMenuOpen:de}),(0,s.jsx)(o.PlanUpgradePrompt,{open:q,onCancel:()=>ee(!1),initialSlide:9}),Q&&fe.exceeded?(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(rr,{open:Fe,onClose:et,title:r(Q.titleKey),subtitle:r(Q.subtitleKey),usageResource:Q.usageResource,previousDisplay:o.presetLimitDisplay(fe.exceeded.previousLimit),nextDisplay:o.presetLimitDisplay(fe.exceeded.nextLimit),onChangePlan:Ee})}):null]})};xa.propTypes={};function vf(e){const t=o.parseEmBlockVersion(e);if(!t)return e;const n=r=>String(r).padStart(2,"0");return`${n(t.getDate())}.${n(t.getMonth()+1)}.${t.getFullYear()} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}var Ef=({open:e,blocks:t,projectId:n,onClose:r})=>{const{__:i,_n:a}=o.useI18n(),c=o.useSendPostMessage(),d=o.useNotification(),[u,m]=(0,l.useState)({});(0,l.useEffect)(()=>{e&&m(Object.fromEntries(t.map(p=>[p.emBlockId,!0])))},[e,t]);const f=(0,l.useMemo)(()=>Object.values(u).filter(Boolean).length,[u]),g=(p,E)=>{m(C=>({...C,[p]:E}))},_=()=>{const p=t.filter(E=>u[E.emBlockId]);p.length&&(p.forEach(E=>{c({operation:o.EVENT_TYPES.SANDBOX_GLOBAL_BLOCK_REPLACE,settings:{emBlockId:E.emBlockId,blockHTML:E.savedHtml,type:"project",...n?{project:String(n)}:{}}})}),d.success({message:i("Updated")+" "+p.length+" "+a("block","blocks",p.length),placement:"bottomRight"}),r())};return(0,s.jsxs)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Update global blocks")}),open:e,onOk:_,onCancel:r,footer:(0,s.jsxs)("div",{className:"update-global-blocks-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:r,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",disabled:f===0,onClick:_,children:i("Update")})]}),children:[(0,s.jsx)("div",{className:"update-global-blocks-modal__hint",children:i("These global blocks have a newer saved version. Select the ones to update in the template.")}),(0,s.jsx)("div",{className:"update-global-blocks-modal__list",children:t.map(p=>(0,s.jsxs)("div",{className:"update-global-blocks-modal__row",children:[(0,s.jsx)(y.ui_kit$Switch,{checked:!!u[p.emBlockId],onChange:E=>g(p.emBlockId,E)}),(0,s.jsxs)("span",{className:"update-global-blocks-modal__title",title:p.title,children:[p.title,(0,s.jsxs)("span",{className:"update-global-blocks-modal__version",children:[i("Version of")," ",vf(p.savedVersion)]})]}),p.instances>1&&(0,s.jsxs)("span",{className:"update-global-blocks-modal__count",children:[p.instances," ",a("instance","instances",p.instances)]})]},p.emBlockId))})]})};function Sf(e){const t=new Map;return e?.trim()&&new DOMParser().parseFromString(e,"text/html").querySelectorAll('[em="block"][em-block-id]').forEach(n=>{const r=n.getAttribute("em-block-id");if(!r)return;const i=n.getAttribute("em-block-version")??void 0,a=t.get(r);a?(a.versions.add(i),a.count+=1):t.set(r,{versions:new Set([i]),count:1})}),t}function wf(e,t){const n=Sf(e);if(!n.size||!t?.length)return[];const r=[];for(const i of t){if(!i.global_block||!i.id||!i.html)continue;const a=String(i.id),c=n.get(a);if(!c)continue;const d=o.readRootEmBlockAttrs(i.html).emBlockVersion;d&&[...c.versions].some(u=>u!==d)&&r.push({emBlockId:a,title:i.title?.trim()||a,savedHtml:i.html,savedVersion:d,templateVersion:[...c.versions][0],instances:c.count})}return r}var Pa="em-block-id";function kf({projectId:e,document:t}){const n=o.useEvent(h.events.ON_EMAIL_INIT_ID),r=o.useHeadless(),[i,a]=(0,l.useState)([]),[c,d]=(0,l.useState)(!1),[u,m]=(0,l.useState)(null),f=(0,l.useCallback)(E=>t?.subscribe(E)??(()=>{}),[t]),g=(0,l.useSyncExternalStore)(f,()=>!!t?.getContent().includes(Pa)),{data:_}=o.blocksApi.endpoints.getBlocks.useQuery(o.projectBlocksArgs(e),{skip:!e||!g}),p=(0,l.useRef)(!1);return(0,l.useEffect)(()=>{g&&p.current&&t&&(p.current=!1,m(t.getContent()))},[g,t]),(0,l.useEffect)(()=>{const E=new h.Disposable;return E.addDisposable(n(C=>{if(C?.reset)return;const w=C?.html??"",S=w.includes(Pa);p.current=!S,m(S?w:null)})),()=>E.dispose()},[n]),(0,l.useEffect)(()=>{if(u==null||!_)return;if(r){m(null);return}const E=wf(u,_);E.length&&(a(E),d(!0)),m(null)},[u,_,r]),{outdatedBlocks:i,isOpen:c,close:(0,l.useCallback)(()=>d(!1),[])}}var Cf=({open:e,html:t,emBlockId:n,onSaveAsNew:r,onClose:i})=>{const{__:a}=o.useI18n(),c=o.useSendPostMessage(),d=o.useNotification(),[u]=o.useEditBlockMutation(),[m,f]=(0,l.useState)(!1),g=async()=>{if(!n||!t){i();return}f(!0);const _=new Date,p=o.formatEmBlockVersion(_),E=o.injectEmBlockIdIntoBlockHtml(t,String(n),_),C=await u({blockId:String(n),html:E});if(f(!1),"error"in C&&C.error){d.error({message:a("Failed to update the global block."),placement:"bottomRight"});return}c({operation:o.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:String(n),emBlockVersion:p}}),d.success({message:a("The global block was updated."),placement:"bottomRight"}),i()};return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:a("Saving changes in the block")}),open:e,onCancel:i,footer:(0,s.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",disabled:m,onClick:r,children:a("Create new block")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",loading:m,onClick:g,children:a("Update current block")})]}),children:(0,s.jsx)("div",{children:a("This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.")})})},Tf=(function(){var e=window.__emailmaker__;if(e&&e.assetUrl)return e.assetUrl("converter-intro.bf4ee74d750b35ae2c10.png");if(e&&e.publicPath)try{return new URL("static/media/converter-intro.bf4ee74d750b35ae2c10.png",e.publicPath).href}catch{}try{return new URL("/static/media/converter-intro.bf4ee74d750b35ae2c10.png",typeof document<"u"&&document.baseURI?document.baseURI:typeof window<"u"&&window.location?window.location.href:"").href}catch{return"/static/media/converter-intro.bf4ee74d750b35ae2c10.png"}})(),If={closable:!1},Af=Tf,xf=({open:e,onConfirm:t,onCancel:n,neverSuggestAgain:r,onNeverSuggestAgainChange:i})=>{const{__:a}=o.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{className:"convert-layout-modal",title:(0,s.jsx)("div",{className:"convert-layout-modal__title",children:a("Template conversion")}),open:e,onOk:t,onCancel:n,mask:If,width:480,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",style:{display:"flex",flexDirection:"column",gap:16},children:[(0,s.jsx)(y.ui_kit$Switch,{size:"small",checked:r,onChange:i,label:a("Don't suggest again"),labelSize:"small"}),(0,s.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:n,children:a("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:t,children:a("Convert")})]})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__content",style:{display:"flex",flexDirection:"column",alignItems:"center",gap:24,padding:"0 8px",overflow:"hidden"},children:[(0,s.jsx)("div",{className:"convert-layout-modal__text convert-layout-modal__intro-text",style:{textAlign:"center"},children:a("This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.")}),(0,s.jsx)("img",{src:Af,alt:"Converter Intro",className:"convert-layout-modal__image",style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",borderRadius:8}})]})})},Pf={closable:!1},Rf=({open:e,message:t,onRetry:n,onCancel:r})=>{const{__:i}=o.useI18n();return(0,s.jsx)(y.ui_kit$Modal,{title:(0,s.jsx)("div",{className:"ant-modal-title",children:i("Conversion failed")}),open:e,onOk:n,onCancel:r,mask:Pf,footer:(0,s.jsxs)("div",{className:"convert-layout-modal__footer",children:[(0,s.jsx)(y.ui_kit$Button,{size:"large",onClick:r,children:i("Cancel")}),(0,s.jsx)(y.ui_kit$Button,{size:"large",type:"primary",onClick:n,children:i("Try again")})]}),children:(0,s.jsxs)("div",{className:"convert-layout-modal__text",children:[i("Something went wrong during layout conversion. You can try running the conversion again."),t?(0,s.jsx)("div",{className:"convert-layout-modal__error-details",children:t}):null]})})},jf=({open:e,progress:t})=>{const{__:n}=o.useI18n();return e?(0,s.jsx)("div",{className:"conversion-overlay",children:(0,s.jsxs)("div",{className:"conversion-overlay__content",children:[(0,s.jsx)(y.ui_kit$Spin,{size:"large"}),(0,s.jsx)("div",{className:"conversion-overlay__title",children:n("Converting layout…")}),(0,s.jsx)("div",{className:"conversion-overlay__hint",children:n("This may take several minutes. Please keep this tab open.")}),(0,s.jsx)(y.ui_kit$Progress,{className:"conversion-overlay__progress",percent:Math.round(t),status:"active",strokeColor:o.emCssVar("colorPrimary")})]})}):null},bo=o.createApi({reducerPath:"layoutConverterApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({createConvertJob:e.mutation({query:({html:t})=>({url:"/ai/converter/jobs",method:"POST",body:{html:t}})}),getConvertJobStatus:e.query({query:t=>({url:`/ai/converter/jobs/${t}`,method:"GET"})})})}),{useCreateConvertJobMutation:Lf,useLazyGetConvertJobStatusQuery:Of}=bo;function Mf(){try{return window.localStorage.getItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)==="true"}catch{return!1}}function Nf(e){try{e?window.localStorage.setItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest,"true"):window.localStorage.removeItem(o.LOCAL_STORAGE_ITEMS.em_layout_convert_never_suggest)}catch{}}function Ra(e){return e==="beefree"?(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/0cb54b92.js")).then(t=>t.convertBeeFreeToEmailMaker),void 0,{}.url):(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/918c30e2.js")).then(t=>t.convertStripoToEmailMaker),void 0,{}.url)}var Df=5,ja=95,Ff=35e3,Bf=1e3,Uf=e=>new Promise(t=>setTimeout(t,e));function $f(e,t){if(e&&typeof e=="object"){const n=e,r=n.data;if(r&&typeof r=="object"){const i=r.error;if(typeof i=="object"&&i?.message)return i.message;if(typeof i=="string"&&i)return i;if(r.message)return r.message}if(typeof r=="string"&&r)return r;if(n.error)return n.error;if(n.message)return n.message}return t}function zf(){const{__:e}=o.useI18n(),t=o.useContentReplacer(),n=o.useNotification(),r=Ea(),{aiLayoutConverterEnabled:i,anyConverterEnabled:a}=r,c=o.useHeadless(),d=o.useEvent(h.events.ON_EMAIL_INIT_ID),u=o.useEvent(h.events.ON_LAYOUT_CONVERT_REQUEST_ID),[m]=Lf(),[f]=Of(),[g,_]=(0,l.useState)(Mf),p=(0,l.useRef)(g),E=(0,l.useCallback)(ae=>{p.current=ae,_(ae),Nf(ae)},[]),[C,w]=(0,l.useState)(!1),[S,I]=(0,l.useState)(!1),[x,Y]=(0,l.useState)(0),[Z,M]=(0,l.useState)(!1),[L,A]=(0,l.useState)(""),j=(0,l.useRef)(""),z=(0,l.useRef)(null),B=(0,l.useRef)(null),$=(0,l.useRef)(!1),de=(0,l.useRef)({cancelled:!0}),pe=(0,l.useRef)(null);(0,l.useEffect)(()=>{$.current=S},[S]);const q=(0,l.useCallback)(()=>{pe.current!==null&&(clearInterval(pe.current),pe.current=null)},[]),ee=(0,l.useCallback)(()=>{q();const ae=Date.now();pe.current=setInterval(()=>{const se=Date.now()-ae,Ie=ja*(1-Math.exp(-se/Ff));Y(Ce=>Math.max(Ce,Math.min(ja,Ie)))},Bf)},[q]),Fe=(0,l.useCallback)(ae=>{ae&&(t(ae,{undoable:!0}),B.current=ae)},[t]),ve=(0,l.useCallback)(async ae=>{const se={cancelled:!1};de.current=se,M(!1);const Ie=z.current;if(Ie==="beefree"||Ie==="stripo"){try{const Ce=await Ra(Ie),Be=se.cancelled?"":Ce(ae);if(Be&&!se.cancelled){Fe(Be),n.success({message:o.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"});return}}catch{}if(!i){se.cancelled||(A(e("Layout conversion failed")),M(!0));return}}if(i){I(!0),Y(0),ee();try{const Ce=await m({html:ae}).unwrap();if(se.cancelled)return;let Be=Ce.retry_after>0?Ce.retry_after:Df;for(;!se.cancelled;){if(await Uf(Be*1e3),se.cancelled)return;const J=await f(Ce.job_id).unwrap();if(se.cancelled)return;if(J.retry_after&&J.retry_after>0&&(Be=J.retry_after),J.status==="completed"){q(),Y(100),Fe(J.html??""),n.success({message:o.isUseBlocksBuild()?e("Layout converted to Blocks format"):e("Layout converted to EmailMaker format"),placement:"bottomRight"}),setTimeout(()=>{se.cancelled||(I(!1),Y(0))},400);return}if(J.status==="failed")throw new Error(J.error?.message||e("Layout conversion failed"))}}catch(Ce){if(se.cancelled)return;q(),I(!1),Y(0),A($f(Ce,e("Layout conversion failed"))),M(!0)}}},[e,i,Fe,m,n,f,ee,q]),et=(0,l.useCallback)(()=>{w(!1);const ae=j.current;ae&&ve(ae)},[ve]),Ee=(0,l.useCallback)(()=>{w(!1),B.current=j.current},[]),fe=(0,l.useCallback)(()=>{M(!1);const ae=j.current;ae&&ve(ae)},[ve]),Q=(0,l.useCallback)(()=>{M(!1),B.current=j.current},[]),me=(0,l.useCallback)((ae,se=!1)=>{const Ie=Sa(ae,r);if(a&&!c&&Ie&&!$.current){if(se)B.current=null;else{if(p.current)return;if(B.current===ae)return}j.current=ae,z.current=Ie,Ie!=="ai"&&Ra(Ie).catch(()=>{}),w(!0)}},[a,r,c]);return(0,l.useEffect)(()=>{if(!a)return;const ae=new h.Disposable;return ae.addDisposable(d(se=>{se?.reset||me(se?.html??"")})),()=>ae.dispose()},[a,d,me]),(0,l.useEffect)(()=>{if(!a)return;const ae=new h.Disposable;return ae.addDisposable(u(se=>{me(se?.html??"",!0)})),()=>ae.dispose()},[a,u,me]),(0,l.useEffect)(()=>()=>{de.current.cancelled=!0,q()},[q]),{isPromptOpen:C,isConverting:S,progress:x,isErrorOpen:Z,errorMessage:L,confirmConversion:et,cancelPrompt:Ee,retryConversion:fe,closeError:Q,neverSuggestAgain:g,setNeverSuggestAgain:E}}var Gf=6e4,La=new Map;function Wf(e){const t=e?String(e):"",n=La.get(t);if(n&&(La.delete(t),!(Date.now()-n.at>Gf)))return n.promise}var hr={data:void 0,isSuccess:!1,isError:!1,error:void 0,isLoading:!1};function Hf(e){const t=o.useStore(),n=(0,l.useRef)(t);n.current=t;const[r,i]=(0,l.useState)(hr),a=e?String(e):void 0;return(0,l.useEffect)(()=>{if(!a){i(hr);return}let c=!1;return i({...hr,isLoading:!0}),(Wf(a)??o.resolveEmailPort(h.getContainer(n.current)).readEmail(a)).then(d=>{c||i({data:d??void 0,isSuccess:!0,isError:!1,error:void 0,isLoading:!1})}).catch(d=>{c||i({data:void 0,isSuccess:!1,isError:!0,error:d,isLoading:!1})}),()=>{c=!0}},[a]),r}var yv=2;function qf(){const e=o.useProjectData()?.id,t=!0,{data:n,isError:r,isFetching:i,refetch:a}=o.useGetProjectPlanQuery(e,{skip:t}),[c,d]=(0,l.useState)(0),u=(0,l.useRef)(!1),m=!!r,f=c>=2,g=(0,l.useCallback)(()=>{u.current=!1,d(0),a()},[a]);(0,l.useEffect)(()=>{},[m,i,a,c,t]),(0,l.useEffect)(()=>{},[m,e,f,t]);const _="ready";return(0,l.useMemo)(()=>({status:_,retry:g}),[_,g])}var _v=300,Vf=h.createIdentifier$1("prewarm.queue");function Yf(e){const t=[];let n=!1,r=!1,i;const a=()=>{i&&(i.unwatch(),e.clearTimer(i.timer),i=void 0)},c=()=>{const m=t.shift();if(!m)return;r=!0;const f=()=>{r=!1,u()};m.start().then(f,f)},d=()=>{a(),e.idle(()=>{if(!(r||t.length===0)){if(e.activity.inFlight()>0){u();return}c()}})};function u(){if(!n||r||i||t.length===0)return;const m=()=>e.setTimer(d,300),f={timer:e.activity.inFlight()===0?m():void 0,unwatch:e.activity.watch(()=>{e.clearTimer(f.timer),f.timer=e.activity.inFlight()===0?m():void 0})};i=f}return e.whenVisible(()=>{n=!0,u()}),{add(m){t.some(f=>f.name===m.name)||(t.push(m),u())},remove(m){const f=t.findIndex(g=>g.name===m);f>=0&&t.splice(f,1),t.length===0&&a()}}}function Kf(e){return e.getOrCreateInstance(Vf,()=>Yf({activity:h.getNetworkActivity(e),whenVisible:t=>Ht(e).whenVisible(t),idle:Xt,setTimer:(t,n)=>window.setTimeout(t,n),clearTimer:t=>window.clearTimeout(t)}))}function Qf({projectId:e,project:t,emailProjectId:n,parentEmailId:r}){const i=o.useContainer(),a=o.useAppDispatch(),d=!!o.useCookieManager().get(o.APP_COOKIES.em_token);(0,l.useEffect)(()=>{const u=Kf(i),m=[],f=[],g=(p,E)=>{f.push(p),u.add({name:p,start:()=>{const C=E();return m.push(C),Promise.resolve(C)}})},_=o.parentEmailSource(r);return _&&g("blocks.parentEmail",()=>a(o.blocksApi.endpoints.getParentEmailBlocks.initiate(o.parentEmailBlocksArgs(_)))),g("blocks.template",()=>a(o.blocksApi.endpoints.getTemplateBlocks.initiate(o.templateBlocksArgs()))),e&&g("blocks.list",()=>a(o.blocksApi.endpoints.getBlocks.initiate(o.projectBlocksArgs(e)))),g("blocks.schema",()=>a(o.blocksApi.endpoints.getBlocksSchema.initiate(void 0))),t?.id&&g("blocks.tags",()=>a(o.taxonomiesApi.endpoints.getTerms.initiate({project:t,kind:o.BLOCK_TAGS}))),()=>{f.forEach(p=>u.remove(p)),m.forEach(p=>p.unsubscribe())}},[i,a,e,t,n,r,d])}var gr="AUTOSAVE_RECOVERY";function Xf(e,t,n=!1,r){const i=t?.get().serverId??void 0,{__:a}=o.useI18n(),c=o.useNotification(),d=o.useAppConfig(),u=o.useSelector(o.selectMonacoFocusing),m=o.useContainer(),f=m?.getInstance(Aa),g=(0,l.useRef)(0),_=o.useSelector(o.selectIsPanelHistoryCollapsed),p=o.useSelector(o.selectActiveSettingsTab),E=o.useDispatch(),C=(0,l.useSyncExternalStore)((0,l.useCallback)(L=>r?.subscribe(L)??(()=>{}),[r]),()=>r?.recoveryFacts()),w=d?.revisionService===!0,S=C?.isRecovering===!0,I=C?.applied,x=(0,l.useCallback)(()=>{E(o.markAppearanceNeedsUpdate());const L=e?.renderGuid,A=e?.preheader,j=e?.subject;L&&(A||j)&&f?.reassert({...A?{preheader:A}:{},...j?{subject:j}:{}})},[E,f,e?.preheader,e?.subject,e?.title,e?.common_styles,e?.renderGuid,t,r]);(0,l.useEffect)(()=>()=>{clearTimeout(g.current),r?.endForcedHeaders()},[i,r]),(0,l.useEffect)(()=>{w&&S&&c.info({key:gr,title:a("Loading latest changes..."),duration:0})},[w,S,c,a]);const Y=(0,l.useRef)({emailId:void 0,seq:0});(0,l.useEffect)(()=>{if(!I||C?.emailId!==i||(Y.current.emailId!==i&&(Y.current={emailId:i,seq:0}),I.seq<=Y.current.seq))return;Y.current={emailId:i,seq:I.seq},x();const{phase:L}=I;!w||L==="normal"||(L==="found"?c.success({key:gr,title:a("Changes loaded"),duration:3}):L==="timeout"?c.warning({key:gr,title:a("Locally saved version applied"),description:a("Syncing with the server in the background..."),duration:5}):L==="bg"&&c.info({key:"AUTOSAVE_BG_SYNCED",title:a("Email synced with the server"),duration:3}))},[w,I,C?.emailId,i,x,c,a]),(0,l.useEffect)(()=>{if(!n)return;const L=A=>{A.preventDefault()};return window.addEventListener("beforeunload",L),()=>window.removeEventListener("beforeunload",L)},[n]);const Z=!_||u||p==="Discuss",M=m?o.provideAutosaveUiFacts(m):void 0;(0,l.useEffect)(()=>{M?.set({...M.get()??{isUserBusy:!1,saveContext:{}},isUserBusy:Z})},[M,Z])}var Jf=class extends Error{label;timeoutMs;constructor(e,t){super(`[${e}] timed out after ${t}ms`),this.name="OperationTimeoutError",this.label=e,this.timeoutMs=t}};function Zf(e,t,n){return t<=0?e:new Promise((r,i)=>{let a=!1,c;const d=u=>{a||(a=!0,c!==void 0&&(clearTimeout(c),c=void 0),u())};c=setTimeout(()=>{d(()=>i(new Jf(n,t)))},t),e.then(u=>{d(()=>r(u))},u=>{d(()=>i(u))})})}var eh=2,vo=Symbol("sandbox:frame-replaced");function sn(e,t,n,r,i,a,c){const d=`sandbox:${t}`,u=a?.getSandboxTimeoutMs(t)??o.DEFAULT_SANDBOX_OP_TIMEOUT_MS[t],m=()=>{let E=Zf(e.sendAsync(n,r),u,d);return E=h.raceWithAbortSignal(E,a?.signal),o.logShowPipelineWait(d,E,i)};if(t==="INIT_START"&&Qi(e)){const E=a?.getSandboxReadyTimeoutMs()??2e4,C=e,w=S=>{const I=Xi(C,E,a?.signal);return o.logShowPipelineWait("sandbox:INIT_START:ready-wait",I,i).then(()=>{if(!c||S<=0)return m();const x=c.getGeneration();let Y;const Z=new Promise((L,A)=>{Y=c.onChange(()=>{c.getGeneration()!==x&&A(vo)})}),M=m();return M.catch(()=>{}),Promise.race([M,Z]).finally(()=>Y?.()).catch(L=>{if(L!==vo)throw L;return{...i},w(S-1)})})};return w(eh)}if(!c)return m();const f=c.getGeneration();let g;const _=new Promise((E,C)=>{g=c.onChange(()=>{c.getGeneration()!==f&&C(vo)})}),p=m();return p.catch(()=>{}),Promise.race([p,_]).finally(()=>g?.()).catch(E=>{throw E===vo&&{...i},E})}function Oa(e,t,n,r){return{html:e,guid:t,...Object.keys(n).length>0?{templateDirectivesPolicy:n}:{},...r!==void 0?{rev:r}:{}}}var Ma="self-init:";function th(e){return e.startsWith(Ma)}function Na(e,t){const n=e.getActiveShowRequest();return th(t)?n===null:n?.showId===t&&e.hasPendingShow(t)}function nh(e){const t=()=>e.initPipeline(),n=e.messageService,r=()=>e.waitScope?.()??t();let i="";const a=()=>e.readDocument()?o.readDocumentContent(e.readDocument()):i,c=()=>rn(e.container).editorPolicy,d=()=>e.readEmail(),u=()=>{const m=d();return{...m,id:e.isTemplate()||m.isNew?void 0:m.id,html:a()}};return{readContent:a,publicEmail:u,sendInitStart:()=>sn(n,"INIT_START",o.EVENT_TYPES.SANDBOX_INIT_START,{guid:d().renderGuid},void 0,r()),sendInited:()=>sn(n,"INITED",o.EVENT_TYPES.SANDBOX_INITED,{guid:d().renderGuid},void 0,r()),async sendContent(){const m=d(),{html:f,hasBrowserExtensionArtifacts:g}=o.prepareEmailHtmlForEditor(m?.html||"");g&&e.events.browserExtensionDetected(),o.loadDocumentContent(e.readDocument(),f),i=f,await sn(n,"SET_ENTITY",o.EVENT_TYPES.SANDBOX_SET_ENTITY,Oa(a(),m.renderGuid,c(),e.readDocument()?.get().version),{guid:m.renderGuid,emailId:m.id??null},r())},refreshContent:()=>sn(n,"SET_ENTITY",o.EVENT_TYPES.SANDBOX_SET_ENTITY,Oa(a(),d().renderGuid,c(),e.readDocument()?.get().version),void 0,r()),sendPreheader:async()=>{const m=d();if(m.preheader!==void 0)return sn(n,"PREHEADER",o.EVENT_TYPES.SANDBOX_PREHEADER_UPDATE,{value:m.preheader,guid:m.renderGuid,force:!0},void 0,r())},sendSubject:async()=>{const m=d();if(m.subject!==void 0)return sn(n,"SUBJECT",o.EVENT_TYPES.SANDBOX_SUBJECT_UPDATE,{value:m.subject,guid:m.renderGuid,force:!0},void 0,r())},revealFilled:()=>e.revealFilled?.()??Promise.resolve(),showFilled:m=>e.showFilled?.(m),readTarget:()=>e.readTarget?.(),fireWillInit:()=>e.events.willInit(u()),fireInit(m,f){if(!Na(t(),m)){t().getActiveShowRequest()?.showId;return}const g=d();g.id,g.renderGuid,t().completeShow(m),o.writeEmailAttributes(e.readDocument(),{is_inited:!0},{source:"system"});const _=u();return f&&(_.reset=!0),e.events.inited(_)},fireEmailChanged(){e.events.emailChanged(u())},fireContentChanged(){e.events.contentChanged(a())}}}function oh(e){const t=()=>e.initPipeline();let n=!1,r,i,a,c=0,d;const u=nh({...e,waitScope:()=>({getSandboxTimeoutMs:w=>t().getSandboxTimeoutMs(w),getSandboxReadyTimeoutMs:()=>t().getSandboxReadyTimeoutMs(),signal:d?.signal??t().signal})});let m;const f=(w,S)=>{if(m===w)return;m=w;const I=c;setTimeout(()=>{c!==I||t().signal.aborted||E(w,S).catch(()=>{})},0)},g=()=>{d?.abort(),d=void 0};let _;const p=()=>{const w=t().signal;w!==_&&(_?.removeEventListener("abort",g),_=w,w.addEventListener("abort",g))};async function E(w,S){const I=++c;g(),d=new AbortController,p();const x=()=>c!==I,Y=u.readTarget(),Z=t().generation,M=()=>Z===t().generation&&!t().signal.aborted,L=S?"init:reset-":"init:";if(!S){const z=u.publicEmail();z?.id,z?.renderGuid,z?.preheader}let A=!1,j=!1;try{n=!0,await u.sendInitStart(),u.fireWillInit(),await(S?u.refreshContent():u.sendContent()),A=!0,S||u.publicEmail()?.id;try{await u.sendPreheader()}catch(z){o.logShowPipelineError(`${L}preheader-failed`,{showId:w,error:String(z)})}try{await u.sendSubject()}catch(z){o.logShowPipelineError(`${L}subject-failed`,{showId:w,error:String(z)})}if(x()||u.showFilled(Y),await u.sendInited(),j=!0,i===w){const z=e.readSandboxGeneration?.()??a;z!==void 0&&(r=z)}await u.revealFilled()}catch(z){throw x()||o.logShowPipelineError(`${L}failed`,{showId:w,contentApplied:A,sandboxInitedAcked:j,superseded:!1,...e.describeSurface?.(),error:String(z)}),!x()&&Na(t(),w)&&t().failShow(w,z),z}finally{C(w,S,L,{superseded:x(),sessionGeneration:Z,contentApplied:A,sandboxInitedAcked:j,commit:M()})}}function C(w,S,I,x){const{superseded:Y,contentApplied:Z,sandboxInitedAcked:M}=x;if(Y){`${I}`;return}M&&x.commit?u.fireInit(w,S||void 0):M?o.logShowPipelineError(`${I}aborted (stale session or signal)`,{showId:w,sessionGeneration:x.sessionGeneration,currentGeneration:t().generation,aborted:t().signal.aborted}):Z?o.logShowPipelineError(`${I}aborted (sandbox INITED ack missing)`,{showId:w}):o.logShowPipelineError(`${I}aborted (content not applied)`,{showId:w}),n=!1,d=void 0,!M&&i===w&&(i=void 0,r===a&&(r=void 0)),!M&&Z&&f(w,S)}return{channel:u,isEventsLocked:()=>n,filledGeneration:()=>r,markFilled:w=>{r=w},lastCorrelation:()=>i,markCorrelation:w=>{i=w},bumpRunSeq:()=>{c+=1},noteSandboxGeneration:w=>{a=w},fill:w=>E(w,!1),refill:w=>E(w,!0),stop:()=>{c+=1,g(),n=!1,_?.removeEventListener("abort",g),_=void 0}}}function rh(e,t,n){if(!e?.renderGuid||!e.showId||e.showId!==t.showId)return!1;if(t.isNew)return e.id==null;const r=t.emailId??t.navId;return r!=null&&String(e.id??"")!==String(r)?!1:Da(e,n)}function Da(e,t){return t?e?.id==null?!1:String(e.id)===String(t):!0}function ih(e){const{pipeline:t,readEmail:n,readDocument:r,readRouteEmailId:i,readSandboxGeneration:a}=e,c=f=>{const g=n(),_=i();if(!rh(g,f,_)){f.showId,f.navId,f.emailId,g?.id,g?.showId,g?.renderGuid;return}f.showId,g?.id,g?.renderGuid,t.markFilled(a()),t.markCorrelation(f.showId),t.fill(f.showId).catch(()=>{})};return{showRequested:f=>{c(f)},showRequestIdentityChanged:()=>{const f=e.initPipeline().getActiveShowRequest();f&&c(f)},selfInitChanged:()=>{if(e.initPipeline().getActiveShowRequest())return;const f=a();if(t.filledGeneration()===f)return;const g=n(),_=i();if(!g?.renderGuid||!Da(g,_))return;const p=`${Ma}${g.renderGuid}`;t.markFilled(f),t.markCorrelation(p);const E=r()?.isReady()===!0;g.id,g.renderGuid,(E?C=>t.refill(C):C=>t.fill(C))(p).catch(()=>{t.lastCorrelation()===p&&t.markFilled(void 0)})},saasChanged:()=>{const f=n();f?.renderGuid,f?.showToken,f?.id}}}var Fa=h.createIdentifier$1("canvas.sandboxFill"),ah=class extends Error{showId;constructor(e,t){super(`[emailmaker] show() timed out after ${t}ms waiting for editor init (showId=${e}). Check earlier console errors: wrong host-plugin publicPath (chunks return HTML), mount element removed without destroy(), or sandbox init never completed. Search for [show-pipeline] and [AMD] messages.`),this.name="ShowPipelineTimeoutError",this.showId=e}},sh=class{_activeRequest=null;_pending=new Map;_listeners=new Set;getActiveShowRequest(){return this._activeRequest}onShowRequested(e){return this._listeners.add(e),()=>{this._listeners.delete(e)}}requestShow(e,t,n){return this._rejectPending(h.createAbortError("Superseded by newer show()")),n.aborted?Promise.reject(h.createAbortError(n.reason)):(this._activeRequest=e,new Promise((r,i)=>{const a=setTimeout(()=>{this._settle(e.showId,()=>{i(new ah(e.showId,t))})},t);a.unref?.();const c=()=>{this._settle(e.showId,()=>{i(h.createAbortError(n.reason))})};n.addEventListener("abort",c,{once:!0});const d=()=>{clearTimeout(a),n.removeEventListener("abort",c)};this._pending.set(e.showId,{request:e,resolve:r,reject:i,timeoutId:a,dispose:d});for(const u of this._listeners)u(e)}))}completeShow(e){this._settle(e,t=>{t.resolve()})}hasPendingShow(e){return this._pending.has(e)}failShow(e,t){this._settle(e,n=>{n.reject(t)})}rejectAll(e){this._rejectPending(e),this._activeRequest=null}_settle(e,t){const n=this._pending.get(e);n&&(n.dispose(),this._pending.delete(e),this._activeRequest?.showId===e&&(this._activeRequest=null),t(n))}_rejectPending(e){for(const[,t]of this._pending)t.dispose(),t.reject(e);this._pending.clear()}};function lh(e,t){return{contentReady:t.contentReady??e?.contentReady,sandboxReady:t.sandboxReady??e?.sandboxReady,sandbox:t.sandbox?{...e?.sandbox,...t.sandbox}:e?.sandbox}}function ch(e){if(!e||!(e.contentReady!==void 0||e.sandboxReady!==void 0||e.sandbox!==void 0))return;const t=o.resolveContentReadyTimeoutMs(e),n=o.resolveSandboxReadyTimeoutMs(e),r=o.resolveSequentialSandboxOpBudgetMs(e.sandbox);t<n+r}var dh=class{_controller=new AbortController;_externalSignalDisposable=new h.Disposable;_sessionChangeListeners=new Set;_showRegistry=new sh;_timeouts;_generation=0;_sessionStarted=!1;get signal(){return this._controller.signal}get generation(){return this._generation}get contentReadyTimeoutMs(){return o.resolveContentReadyTimeoutMs(this._timeouts)}getSandboxTimeoutMs(e){return o.resolveSandboxOpTimeoutMs(e,this._timeouts?.sandbox)}getSandboxReadyTimeoutMs(){return o.resolveSandboxReadyTimeoutMs(this._timeouts)}bumpGeneration(){this._generation+=1}getActiveShowRequest(){return this._showRegistry.getActiveShowRequest()}onShowRequested(e){return this._showRegistry.onShowRequested(e)}requestShow(e){return this._showRegistry.requestShow(e,this.contentReadyTimeoutMs,this._controller.signal)}completeShow(e){this._showRegistry.completeShow(e)}hasPendingShow(e){return this._showRegistry.hasPendingShow(e)}failShow(e,t){this._showRegistry.failShow(e,t)}rejectAllPendingShows(e){this._showRegistry.rejectAll(e)}onSessionReplaced(e){return this._sessionChangeListeners.add(e),()=>{this._sessionChangeListeners.delete(e)}}configure(e){e.timeouts!==void 0&&(this._timeouts=lh(this._timeouts,e.timeouts),ch(this._timeouts));const t=e.replaceSession===!0||!this._sessionStarted||e.timeouts!==void 0||e.signal!==void 0;this._sessionStarted=!0,t&&(this._replaceSessionController(),this.bumpGeneration()),(e.signal!==void 0||t)&&this._linkExternalSignal(e.signal)}abort(e){const t=e??h.createAbortError("Editor instance destroyed");this._showRegistry.rejectAll(t),this._controller.signal.aborted||(this._controller.abort(t),this.bumpGeneration()),this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new h.Disposable}_replaceSessionController(){this._externalSignalDisposable.dispose(),this._externalSignalDisposable=new h.Disposable,this._showRegistry.rejectAll(h.createAbortError("Init session replaced")),this._controller.signal.aborted||this._controller.abort(h.createAbortError("Init session replaced")),this._controller=new AbortController,this._emitSessionReplaced()}_emitSessionReplaced(){for(const e of this._sessionChangeListeners)e()}_linkExternalSignal(e){if(!e)return;if(e.aborted){this._controller.signal.aborted||(this._controller.abort(e.reason??h.createAbortError()),this.bumpGeneration());return}const t=()=>{this._controller.signal.aborted||(this._controller.abort(e.reason??h.createAbortError()),this.bumpGeneration())};e.addEventListener("abort",t),this._externalSignalDisposable.addDispose(()=>{e.removeEventListener("abort",t)})}},uh=(()=>{const e=new dh;return e.configure({}),e})();function yr(){const e=o.useStore();return(0,l.useMemo)(()=>h.getContainer(e)?.getInstance(h.INIT_PIPELINE_ID)??uh,[e])}function mh(e){const t=yr(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>{let r;const i=()=>{r?.();const c=t.signal;if(c.aborted){n.current();return}const d=()=>n.current();c.addEventListener("abort",d),r=()=>c.removeEventListener("abort",d)};i();const a=t.onSessionReplaced(i);return()=>{a(),r?.()}},[t])}function ph(e){const t=yr(),n=(0,l.useRef)(e);n.current=e,(0,l.useEffect)(()=>t.onShowRequested(r=>n.current(r)),[t])}var fh=(e,t,n,r,i)=>{const a=o.useStore(),c=o.useMessageService(),d=yr(),u=(0,l.useRef)(d);u.current=d;const m=o.useEventEmitter(h.events.WILL_EMAIL_INIT_ID),f=o.useEventEmitter(h.events.ON_EMAIL_INIT_ID),g=o.useEventEmitter(h.events.ON_CONTENT_CHANGED_ID),_=o.useEventEmitter(h.events.ON_EMAIL_CHANGED_ID),p=o.useEventEmitter(h.events.ON_BROWSER_EXTENSION_DETECTED_ID),E=e?.id!==void 0,C=e?.showToken??0,w=C,S=(0,l.useRef)(w);S.current=w;const I=(0,l.useRef)(void 0);I.current=e;const[x,Y]=(0,l.useState)(()=>o.getSandboxGeneration(c)),Z=(0,l.useRef)(x);Z.current=x,(0,l.useEffect)(()=>(Y(o.getSandboxGeneration(c)),o.onSandboxGenerationChange(c,()=>{Y(o.getSandboxGeneration(c))})),[c]);const M=(0,l.useRef)(r);M.current=r;const L=(0,l.useRef)(t);L.current=t;const A=i?.standalone?void 0:h.getContainer(a)?.getInstance(Fa),j=!A,z=(0,l.useRef)(A?.pipeline);z.current||(z.current=oh({container:h.getContainer(a),messageService:c,initPipeline:()=>u.current,readDocument:()=>M.current,readEmail:()=>I.current,isTemplate:()=>!!L.current,readSandboxGeneration:()=>Z.current,events:{willInit:q=>m.fire(q),inited:q=>f.fire(q),contentChanged:q=>g.fire(q),emailChanged:q=>_.fire(q),browserExtensionDetected:()=>p.fire()}}));const B=z.current,$=(0,l.useRef)(n);$.current=n;const de=(0,l.useRef)(void 0);j&&!de.current&&(de.current=ih({pipeline:B,initPipeline:()=>u.current,readEmail:()=>I.current,readDocument:()=>M.current,readRouteEmailId:()=>$.current,readSandboxGeneration:()=>Z.current}));const pe=de.current;B.noteSandboxGeneration(Z.current),(0,l.useEffect)(()=>{if(j)return()=>z.current?.stop()},[j]),(0,l.useEffect)(()=>{A?.setRoute({emailId:n,isTemplate:t})},[A,n,t]),(0,l.useEffect)(()=>{const q=I.current;if(j&&!B.isEventsLocked()&&e?.renderGuid===q?.renderGuid&&q?.is_inited&&q){const ee=B.channel.readContent();_.fire({...q,id:t||q.isNew?void 0:q.id,html:ee})}},[B,e?.renderGuid,e?.preheader,e?.common_styles,e?.meta,e?.subject,e?.utm_parameters?.utm_campaign||"",e?.utm_parameters?.utm_content||"",e?.utm_parameters?.utm_medium||"",e?.utm_parameters?.utm_source||"",e?.utm_parameters?.utm_term||"",_,t,j]),(0,l.useEffect)(()=>{if(j){const q=o.subscribeToContent(r,()=>{const ee=I.current;if(!B.isEventsLocked()&&e?.renderGuid===ee?.renderGuid&&ee){const Fe=B.channel.readContent();g.fire(Fe),_.fire({...ee,id:t||ee.isNew?void 0:ee.id,html:Fe})}});return()=>q.dispose()}},[r,B,g,_,e,t,j]),mh(()=>{j&&B.stop()}),ph(q=>{pe?.showRequested(q)}),(0,l.useEffect)(()=>{pe?.showRequestIdentityChanged()},[pe,d,e?.renderGuid,e?.showId,e?.id,n]),(0,l.useEffect)(()=>{pe?.selfInitChanged()},[pe,d,e?.renderGuid,e?.showId,e?.id,n,r,x]),o.usePrevious(()=>{pe?.saasChanged()},[e?.renderGuid,C,E,pe]),Zo(async()=>{if(!j)return;const q=d.getActiveShowRequest()?.showId;q&&(B.markFilled(Z.current),await B.refill(q))},{async:!0})};function hh(e){const t=o.useEvent(h.events.ON_EMAIL_INIT_ID);(0,l.useEffect)(()=>{if(!e)return;const n=t(()=>e.clear());return()=>n.dispose()},[e,t])}function gh(e,t){const n=o.useEventEmitter(h.events.ON_DOCUMENT_SESSION_CHANGE);(0,l.useEffect)(()=>{n.fire({document:e,history:t})},[e,t,n])}function yh({templateEmailId:e,templateEmail:t,newEmail:n}){return e?t:n}function _h({routeEmailId:e,draft:t}){const n=o.useStore();(0,l.useRef)(0),(0,l.useEffect)(()=>{},[n,e,t])}function bh(e,t){return t}function vh(e){return!1}function Eh({documents:e,push:t,projectId:n,subscription:r}){(0,l.useEffect)(()=>e.onSaved(i=>{i.intent==="publish"&&t({event:"save",action:"save_email",email_id:i.serverId??void 0,project_id:n,subscription:r})}),[e,t,n,r])}function Sh(e){const t=o.useStore();(0,l.useEffect)(()=>{},[t,e])}function wh(e,t,n){const r=o.useAppNavigate(),i=o.useContainer();(0,l.useEffect)(()=>{},[r,e,t,n,i])}function kh(e){if(!e)return{status:"unknown"};if("status"in e){const t=e.data,n=t&&typeof t=="object"?t.message:void 0,r=typeof n=="string"?n:typeof t=="string"?t:void 0;return{status:String(e.status),message:r}}return{status:e.name??"unknown",message:e.message}}function Ba(e,t,n){const{status:r,message:i}=kh(n);o.reportMessage(`Failed to load ${e} ${t??"?"}: ${r}`,{origin:"entity-load-error",tags:{mechanism:"entity-load-error",entity_type:e,http_status:r},level:"error",contexts:{entity_load_error:{entityType:e,entityId:t,status:r,message:i,url:window.location.href}}})}var{Content:Ch}=y.ui_kit$Layout,Th={paddingTop:"40px"},Ih=()=>{const{__:e}=o.useI18n(),{owner:t,admin:n}=Qn(),r=o.useDispatch(),i=Vo(),a=o.useAppNavigate(),{modal:c}=y.ui_kit$App.useApp(),d=o.useAppConfig(),u=o.useRootElement(),m=o.useCookieManager(),f=o.useMessageService(),{emailId:g,preview:_}=o.useRouteParams(),p=o.useEditorProjectId(),E=o.useAppSearchParams(),C=o.useSelector(o.selectIsCodeMode),w=o.useSelector(o.selectActiveModal),S=o.useCurrentUser(),I=o.useProjectData(),x=(0,l.useMemo)(()=>o.createNewEmailDraft(I?{id:Number(I.id),title:I.name}:void 0),[I]),Y=o.useSelector(o.selectIsGlobalLoading),[Z]=o.useLazyGetMeQuery(),{isSuccess:M,data:L}=o.useGetSubscriptionsQuery(),A=qf(),[j,z]=(0,l.useState)(!1),[B,$]=(0,l.useState)(!1),[de,pe]=(0,l.useState)(),[q,ee]=(0,l.useState)(null),[Fe,ve]=(0,l.useState)(!1),[et,Ee]=(0,l.useState)(!1),[fe,Q]=(0,l.useState)(!1),[me,ae]=(0,l.useState)(!1),[se,Ie]=(0,l.useState)(!1),Ce=(0,l.useRef)(),{confirm:Be}=c,{counters:J,subscription:ye}=S,Te=J?.emails_counter;m.get(o.APP_COOKIES.em_template_email);const he=E.get("template")||!B&&!g&&m.get(o.APP_COOKIES.em_new_email),{isSuccess:je,isLoading:ze,isError:k,error:T,data:P}=Hf(g?void 0:he),N=yh({templateEmailId:he,templateEmail:P,newEmail:x});_h({routeEmailId:g,draft:N});const{document:D,email:b,error:W}=o.useOpenEmail(),Pe=b?.id!=null?String(b.id):void 0,Ae=bh(g,Pe);(0,l.useEffect)(()=>{},[g,Pe,D,he]),wh(g,b?.id,p);const Qe=o.useStore(),Ge=o.getEmailDocuments(h.getContainer(Qe)),Ze=(0,l.useCallback)((ce,we)=>Ge.save(ce,we),[Ge]),mt=(0,l.useCallback)(()=>Ge.saveState(),[Ge]),vt=o.usePushToDataLayer();Eh({documents:Ge,push:vt,projectId:p,subscription:ye?.post_title}),(0,l.useEffect)(()=>{!B&&b?.id&&$(!0)},[$,B,b?.id]);const ft=Ge.history();gh(D,ft),hh(ft),fh(b,vh(g),Ae,D);const lt=Jo({document:D,history:ft});Xf(b,D,Ge.saveState().saving,Ge),Sh(p),(0,l.useEffect)(()=>{o.injectEmailRightsResolver(h.getContainer(Qe),ce=>!!(t||n||S.id?.toString()===ce?.author?.toString()))},[Qe,t,n,S.id]);const G=op({email:b,save:Ze,saveState:mt,documentSession:D}),{outdatedBlocks:K,isOpen:ne,close:ue}=kf({projectId:p,document:D});Qf({projectId:p,project:I,emailProjectId:b?.project,parentEmailId:b?.parent_email});const ge=w===o.MODALS.ADD_NEW_EBLOCK_MODAL,We=kn(ge),Ve=kn(fe),{isPromptOpen:at,isConverting:Bt,progress:Me,isErrorOpen:Xe,errorMessage:ie,confirmConversion:te,cancelPrompt:U,retryConversion:le,closeError:xe,neverSuggestAgain:Se,setNeverSuggestAgain:Ne}=zf(),He=W??(he?T:void 0),Ue=!!He,rt=!b&&!Ue,fn=!!b;(0,l.useEffect)(()=>{Ue&&He&&Ba("email",g||he,He)},[Ue,He,g,he]),(0,l.useEffect)(()=>{he&&je&&($(!0),E.set({}))},[he,je,E]),(0,l.useEffect)(()=>(r(o.switchIsPanelHistoryCollapsed(!0)),()=>r(o.switchIsPanelHistoryCollapsed(!0))),[r]);const Lt=(0,l.useCallback)(()=>{i.toggle(),r(o.resetPanes())},[r,i]);(0,l.useEffect)(()=>{_&&!C&&Lt()},[C,_,Lt]),(0,l.useEffect)(()=>{document.body.classList.add("editor"),r(o.setActiveSettingsTab(o.BUILD))},[r]),(0,l.useEffect)(()=>{!j&&Te<3&&(Z(),z(!0))},[Z,Te,j]);const ct=(0,l.useCallback)(()=>{lt.undo()},[lt]),Et=(0,l.useCallback)(()=>{lt.redo()},[lt]);(0,l.useEffect)(()=>{Ce.current!==b?.id&&(lt.clear(),Ce.current=b?.id)},[b,lt]);const Ot=(0,l.useCallback)(ce=>{(window.navigator.appVersion.indexOf("Mac")&&ce.metaKey||ce.ctrlKey)&&ce.code==="KeyZ"&&(ce.preventDefault(),ce.shiftKey?Et():ct())},[ct,Et]);(0,l.useEffect)(()=>()=>{r(o.resetPanes()),r(o.closeModal()),r(o.closeModal$1()),r(o.resetElementHistorySlice())},[r]);const jn=(0,l.useCallback)(ce=>{const we=()=>{r(o.openModal(o.MODALS.ADD_NEW_EBLOCK_MODAL))},De=ce.data.operation,nt=ce.data,Le=ce.data.action,Kt=u.querySelector("#iframe-scroll-top"),Ut=u.querySelector("#iframe-scroll-bottom");if(De===o.EVENT_TYPES.APPLICATION_EBLOCK_ADD){const dt=nt.settings?.emBlockId;dt?ee({html:nt.data,emBlockId:String(dt)}):(pe(nt.data),we())}if(De===o.EVENT_TYPES.APPLICATION_ACTION&&(Le==="undo"?ct():Le==="redo"&&Et()),De===o.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_SHOW){const dt=u.querySelector("#email_iframe_slot"),Nn=document.body.getBoundingClientRect().height,$t=dt.getClientRects()[0];$t.top<0&&(Kt.style.display="block"),$t.top+$t.height>Nn&&(Ut.style.display="block")}De===o.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_HIDE&&(Kt.style.display="none",Ut.style.display="none")},[r,ct,Et,u]);o.useListenPostMessage(jn);const Ln=ce=>{if(ce.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const we=ce.dataTransfer,De=(we?Array.from(we.types||[]):[]).includes(o.DND_SOCIAL_LIST_REORDER_MIME),nt=typeof ce.composedPath=="function"?ce.composedPath():[];ce.target?.closest?.(".selected-social-form")||nt.some(Le=>Le&&Le.nodeType===1&&typeof Le.classList?.contains=="function"&&Le.classList.contains("selected-social-form"))||De||(ce.preventDefault(),ce.target&&f.send({operation:o.EVENT_TYPES.SANDBOX_DRAG_CANCEL}),u.querySelectorAll(".em-dragging-element").forEach(Le=>{Le.classList.remove("em-dragging-element")}))},hn=(0,l.useRef)({});(0,l.useEffect)(()=>{const ce=new h.Disposable,we=De=>nt=>hn.current[De]?.(nt);return ce.addDisposable(o.addWindowListenerFromShadow(u,"drop",we("drop"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragover",we("dragover"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragstart",we("dragstart"))),ce.addDisposable(o.addWindowListenerFromShadow(u,"dragend",we("dragend"))),()=>{ce.dispose()}},[u]),(0,l.useEffect)(()=>(window.addEventListener("keydown",Ot),()=>{window.removeEventListener("keydown",Ot)}),[Ot]);const On=ce=>{if(ce.preventDefault(),ce.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const we=u.querySelector("#iframe-scroll-top"),De=u.querySelector("#iframe-scroll-bottom"),nt=d.sidePanelFloating?u.querySelector("#pane-content-wrapper"):u.querySelector(".email-pane__col_preview"),Le=u.querySelector(".blocks-app").getBoundingClientRect().top,{height:Kt,top:Ut}=u.querySelector("#email_iframe_slot").getBoundingClientRect(),dt=nt.getBoundingClientRect().height;Ut>96?we.style.display==="block"&&(we.style.display="none"):(we.style.display==="none"||we.style.display==="")&&(we.style.display="block"),Kt-dt+Ut-Le<44?De.style.display==="block"&&(De.style.display="none"):De.style.display==="none"&&(De.style.display="block"),ce.target===we&&nt.scrollBy(0,-15),ce.target===De&&nt.scrollBy(0,15)},Mn=()=>{const ce=u.querySelector("#iframe-scroll-top"),we=u.querySelector("#iframe-scroll-bottom");ce&&we&&(ce.style.display="none",we.style.display="none"),u.querySelectorAll(".em-dragging-element").forEach(De=>{De.classList.remove("em-dragging-element")})},ht=ce=>{const we=ce.target,De=we instanceof Element?we:we.parentElement;if(!(De instanceof Element)||De.closest(".selected-social-form"))return;De.parentElement?.classList.add("em-dragging-element");const nt=!!De.closest(".blocks-search__result-wrapper");var Le=nt?o.cloneBlockPreviewForDrag(De.querySelector(".blocks-search__result-html")):De.cloneNode(!0);Le.classList.add("em-ghost-element"),Le.style.height=nt?"auto":"70px",Le.style.width=nt?"600px":"109px",Le.style.position="absolute",Le.style.top="0",Le.style.left="0",Le.style.zIndex="-1",De.appendChild(Le),ce.dataTransfer.setDragImage(Le,0,0),window.setTimeout(function(){Le.parentNode.removeChild(Le)},1e3)};hn.current={drop:Ln,dragover:On,dragstart:ht,dragend:Mn};const St=(0,l.useCallback)(()=>{Be({title:e("You reached the plan limit"),icon:(0,s.jsx)(o.EmIcons,{icon:"ExclamationCircleOutlined",component:y.icons$ExclamationCircleOutlined}),content:(0,s.jsx)("div",{style:{maxWidth:"330px"},children:e("Switch to a different plan to save more emails.")}),centered:!0,okText:e("Choose a plan"),cancelText:e("Continue without saving"),width:"unset",onOk(){a("/billing")},onCancel(){}})},[a,e,Be]);return(0,l.useEffect)(()=>{if(M&&L){const ce=L?.find(we=>we.id?.toString()===ye?.ID?.toString())?.limits?.emails_limit;ce&&Te>=ce&&!Fe&&!g&&t&&(St(),ve(!0))}},[L,M,ye,Te,Fe,St,g,t]),(0,l.useEffect)(()=>{const ce=f.onInit(()=>{f.send({operation:o.EVENT_TYPES.SANDBOX_LOCK_EDIT,data:!1})});return()=>ce.dispose()},[f]),(0,s.jsx)(o.DocumentSessionProvider,{document:D,history:ft,children:(0,s.jsx)(_a.Provider,{value:G,children:(0,s.jsxs)(y.ui_kit$Layout,{className:"email-page",children:[rt&&(0,s.jsx)(y.ui_kit$PageLoader,{}),!rt&&A.status==="pending"&&(0,s.jsx)(y.ui_kit$PageLoader,{}),A.status==="error"&&(0,s.jsx)(Ch,{style:Th,children:(0,s.jsx)("div",{className:"container",children:(0,s.jsx)(y.ui_kit$Result,{status:"warning",title:e("Failed to load plan data"),subTitle:e("Editor features depend on your plan. Check your connection and try again."),extra:(0,s.jsx)(y.ui_kit$Button,{type:"primary",onClick:A.retry,children:e("Try again")})})})}),Ue&&He&&!1,b&&!rt&&A.status==="ready"&&(0,s.jsxs)(y.ui_kit$Layout,{className:"email-pane",children:[Y&&(0,s.jsx)("div",{className:"email-pane__loader",children:(0,s.jsx)(y.ui_kit$PageLoader,{small:!0})}),(0,s.jsx)(xa,{email:b,isCollaborationEditor:et}),(0,s.jsx)(Hm,{emailElement:b,isSuccess:fn,setIsCollaborationEditor:Ee,setIsShowAddAllBlocksModal:Q,triggerOpenSavedBlocksTab:me})]}),We&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Lu,{isModalVisible:ge,htmlContent:de,projectId:p,setIsShowAddAllBlocksModal:Q,setIsShowAddAllBlocksModalForNewEmail:Ie,currentEmail:b})}),(0,s.jsx)(Ef,{open:ne,blocks:K,projectId:p,onClose:ue}),(0,s.jsx)(Cf,{open:!!q,html:q?.html,emBlockId:q?.emBlockId,onSaveAsNew:()=>{pe(q?.html),ee(null),r(o.openModal(o.MODALS.ADD_NEW_EBLOCK_MODAL))},onClose:()=>ee(null)}),Ve&&(0,s.jsx)(l.Suspense,{fallback:null,children:(0,s.jsx)(Ou,{isModalVisible:fe,currentEmail:b,setIsShowAddAllBlocksModal:Q,setTriggerOpenSavedBlocksTab:ae,autoStart:!se,projectId:p})}),(0,s.jsx)(xf,{open:at,onConfirm:te,onCancel:U,neverSuggestAgain:Se,onNeverSuggestAgainChange:Ne}),(0,s.jsx)(jf,{open:Bt,progress:Me}),(0,s.jsx)(Rf,{open:Xe,message:ie,onRetry:le,onCancel:xe})]})})})};function Ah(){const e=o.useStore(),t=o.getEmailDocuments(h.getContainer(e)),n=(0,l.useCallback)(r=>t.subscribe(r),[t]);return(0,l.useSyncExternalStore)(n,()=>!!t.current())}function xh(e,t){const n=o.useStore(),r=o.useAppConfig(),i=o.useStorageProvider();(0,l.useRef)(new Set),(0,l.useEffect)(()=>{},[e,t,r,n,i])}var Ph=30;function Rh(e){const t=o.useContainer(),n=o.useGetProjectQuery(+e,{skip:!e,refetchOnMountOrArgChange:Ph}),{isSuccess:r,isError:i,error:a,data:c,isFetching:d}=n;xh(e,r),(0,l.useEffect)(()=>{t&&o.setCurrentProjectRefreshing(t,d)},[t,d]),(0,l.useEffect)(()=>{t&&r&&c&&String(c.id)===String(e)&&o.setCurrentProjectCard(t,c)},[r,c,t,e]),(0,l.useEffect)(()=>{i&&a&&Ba("project",e,a)},[i,a,e]);const u=o.useProjectData(),m=!!u&&String(u.id)===String(e);return{...n,projectReady:m}}var An=o.createApi({reducerPath:"promoApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/promo/v1/"}),endpoints:e=>({checkPromo:e.mutation({queryFn:({code:t,type:n},r)=>o.clientFromApi(r).promo.set_code_create({code:t,type:n})}),getPromoInfo:e.query({queryFn({code:t},n){return o.clientFromApi(n).promo.get_code_info_list({code:t})}})})}),{useCheckPromoMutation:bv,useGetPromoInfoQuery:vv}=An;function jh(){const e=o.useContainer(),[t,n]=(0,l.useState)();return(0,l.useEffect)(()=>{if(!e)return;let r=!0;return o.getAppProject(e).then(i=>{r&&i!=null&&n(String(i))},()=>{}),()=>{r=!1}},[e]),t}var Lh=()=>{const e=o.useDispatch(),t=o.useCookieManager(),n=o.useCurrentUser(),r=o.useContainer();(0,l.useEffect)(()=>{const a=n?.code_editor;a&&r&&o.applyEditorOptions(r,a)},[n,r]),(0,l.useEffect)(()=>{const a=t.get(o.APP_COOKIES.em_token),c=t.get(o.APP_COOKIES.promocode);a&&c&&(e(An.endpoints.checkPromo.initiate({code:c,type:"by_link"})),t.remove(o.APP_COOKIES.promocode))},[e,t]),o.useNotifyCommand();const i=Ah();return Rh(jh()),i?(0,s.jsx)(Zl,{hasEmail:!0,children:(0,s.jsx)(l.Suspense,{fallback:(0,s.jsx)(y.ui_kit$PageLoader,{}),children:(0,s.jsx)(Ih,{})})}):null};function Oh(e,t){const n=(0,l.useRef)(!1);(0,l.useEffect)(()=>{!e||n.current||(n.current=!0,o.mark(o.PHASES.appVisible),t&&Ht(t).noteShellVisible())},[e,t])}var xn=new WeakMap,Mh="data-emailmaker-config-styles";function Nh(e){return typeof e=="string"?e.trim():""}function Ua(e,t){if(e.firstChild){e.insertBefore(t,e.firstChild);return}e.appendChild(t)}function Dh(e,t,n){if(!e||typeof document>"u")return null;const r=Nh(t),i=xn.get(e),a=n||e;if(!r)return i&&(i.remove(),xn.delete(e)),null;if(i)return i.textContent!==r&&(i.textContent=r),(i.parentNode!==a||i!==a.firstChild)&&Ua(a,i),i;const c=document.createElement("style");return c.setAttribute(Mh,"true"),c.textContent=r,Ua(a,c),xn.set(e,c),c}function _r(e){if(!e)return;const t=xn.get(e);t&&(t.remove(),xn.delete(e))}var Fh={height:"100%",display:"flex",justifyContent:"center",alignItems:"center"},Bh=({children:e,handleBeforeRender:t})=>{const[n,r]=(0,l.useState)(),i=o.useIsLocaleInited();Oh(i,o.useContainer());const a=o.useAppConfig().styles,c=(0,l.useRef)(null),d=(0,l.useRef)(!1),u=(0,l.useRef)(void 0),m=o.useRootElement();return(0,l.useLayoutEffect)(()=>{d.current||(d.current=!0,t&&t())},[]),(0,l.useLayoutEffect)(()=>{if(!m){u.current&&(_r(u.current),u.current=void 0);return}u.current&&u.current!==m&&_r(u.current),Dh(m,a,c.current||void 0),u.current=m},[m,a]),(0,l.useLayoutEffect)(()=>()=>{u.current&&(_r(u.current),u.current=void 0)},[]),(0,s.jsxs)(y.ui_kit$StyleProvider,{container:o.findShadowRoot(m)||document.head,children:[(0,s.jsxs)("div",{ref:c,className:"App blocks-app blocks-plugin",style:i?{}:{visibility:"hidden"},children:[(0,s.jsx)(o.ModalRootContext.Provider,{value:n,children:e}),(0,s.jsx)("div",{ref:r,className:"blocks-modal-container"})]}),!i&&(0,s.jsx)(y.ui_kit$Space,{size:"large",style:Fh,children:(0,s.jsx)(y.ui_kit$Spin,{size:"large"})})]})};async function Uh({container:e,renderTarget:t,mapKey:n,disposable:r,chunkLoadedFire:i}){const a=await e.getInstanceAsync(h.STORE_ID);return new Promise(c=>{if(r.isDisposed()){c();return}const d=(0,rl.createRoot)(t),u=(0,s.jsx)(o.Provider,{store:a,children:(0,s.jsx)(Vl,{onLoad:c,children:(0,s.jsx)(o.RootContext.Provider,{value:{element:n},children:(0,s.jsx)(y.ui_kit$StyleProvider,{container:o.isDocumentFragment(n)?document.head:n,children:(0,s.jsx)(o.LocaleProvider,{children:(0,s.jsx)(Bh,{handleBeforeRender:i,children:(0,s.jsx)(hl,{children:(0,s.jsx)(ql,{children:(0,s.jsx)(Lh,{})})})})})})})})});d.render(u),r.addDispose(c),r.addDispose(()=>{try{d.unmount()}catch(m){if(m instanceof DOMException&&m.name==="NotFoundError"||m instanceof Error&&m.name==="NotFoundError"&&/removeChild/i.test(m.message)){o.logShowPipelineError("mount:unmount-dom-mismatch (host container was already removed)",{hint:"Usually harmless during host React StrictMode teardown. Ensure instance.destroy() runs before the host removes the mount container."});return}throw m}}),r.addDispose(()=>{h.ELEMENT_MAP.delete(n)})})}var Ev="multiple init call on single HTMLELEMENT",$h=zn(async e=>{let t=null,n=!1;const r=h.getEmitter(e,h.events.ON_CHUNKS_LOADED),i=e.getInstance(h.DISPOSABLE_ID);let a,c=!1;const d=()=>{c||(c=!0,o.mark(o.PHASES.chunksLoaded),r.fire())},u=fl();i.addDisposable(r.event(()=>u.loaded()));const m=(f,g)=>Uh({container:e,renderTarget:f,mapKey:g,disposable:a,chunkLoadedFire:d});return{instance:{getElement(){return t}},async setOptions(f){u.use(f);const g=e.getInstance(h.INIT_PIPELINE_ID),_=await h.waitForElement(f.element,i,g.signal),p=e.getInstance(h.INSTANCE_ID),E=!!f.hidden&&!!_;if(t===_&&n===E)return;const C=t===_&&n&&!E;n=E,t&&h.ELEMENT_MAP.delete(t),_&&h.ELEMENT_MAP.has(_),a&&a.dispose(),a=i.addDisposable(new h.Disposable);const w=f.element!==void 0;if(o.setHeadlessMode(e,!_||E),o.setHiddenMount(e,E),!_){o.mark(o.MOUNT_HEADLESS_MARK);const I=document.createElement("div");I.style.position="absolute",I.style.left="-10000px",I.style.top="-10000px",I.style.width="1600px",I.style.height="1000px",document.body.appendChild(I),t=I,d(),a.addDispose(()=>{I.parentNode===document.body&&I.remove()});return}const S=o.findShadowRoot(_);if(S&&a.addDisposable(new pl({shadowRoot:S})),w&&_ instanceof Element){const I=_;sl(I,()=>{i.isDisposed()||a?.isDisposed()||(o.logShowPipelineError("mount:detached (host removed element without destroy)",{elementId:I.id||null}),g.abort(al()))},a)}if(E){o.mark(o.MOUNT_HEADLESS_MARK),t=_,d();return}if(w&&_ instanceof Element){const I=_,x=ul(I);t=I;const Y=m(x,I);return ml(I,x,a),Y}return t=_,m(_,_)},dispose(){a&&!a.isDisposed()&&a.dispose()}}});function br(e){return zn(async t=>(await t.getInstanceAsync(h.STORE_ID),await e(t)))}function zh({html:e,renderGuid:t,...n},r){const{requested:i}=o.getCurrentProject(r);return o.filterUndefined({...n,code:rn(r).toOutputForm(e),project:i===void 0?n.project:i,guid:void 0,link:void 0,status:void 0,slug:void 0,password:void 0,comment_status:void 0,template:void 0,blocktags:void 0,project_title:void 0,ping_status:void 0,lock:void 0,tag:void 0,is_template:void 0})}function Gh(e,t){return o.filterUndefined({...e,link:void 0,comment_status:void 0})}function Wh({html:e,...t},n){return o.filterUndefined({...t,code:e,guid:void 0,compiled:o.filterUndefined({html:e,ampHtml:e&&""})})}var $a=e=>{const t={current:Promise.resolve(),state:e,decorate:(n,r)=>(r&&(n=n.bind(r)),function(...i){const a=t.current.then(()=>n(...i));return t.current=a.then(c=>{t.state=c},c=>{}),a})};return t},vr=h.createIdentifier$1("NotificationService"),Hh=h.createIdentifier$1("emailTemplate.reads");async function qh(e,t){try{return await o.getRestEmailPortFactories(e).email(e).readEmail(t)??void 0}catch(n){o.logShowPipelineError("show:template-read-failed",{templateId:t,error:n instanceof Error?n.message:"неизвестная ошибка"}),Vh(e,t,n);return}}function Vh(e,t,n){e.getInstanceAsync(vr).then(()=>{h.getEmitter(e,h.events.ON_NOTIFICATION).fire({type:"error",id:"TEMPLATE_READ_ERROR",data:{templateId:t},innerException:n})},()=>{})}function Yh(e,t){const n=e.getOrCreateInstance(Hh,()=>new Map),r=n.get(t);if(r!==void 0)return r;const i=qh(e,t).then(a=>(a===void 0&&n.delete(t),a));return n.set(t,i),i}var kt=class extends h.Disposable{_event;_listener;_disposeEvent;constructor(e){super(),this._event=e}setListener(e){this._listener!==e&&(this._listener=e,this._disposeEvent&&this._disposeEvent(),e?this._disposeEvent=this._event(e):this._disposeEvent=void 0)}dispose(){this._disposeEvent&&this._disposeEvent(),super.dispose()}};function Ct(e,t,n){const r=h.snapshot(e);return(i,a,c)=>{const d=r(async u=>{const m=t?t(u):u;c&&i.bind(c);const f=await i(m);return n?n(f):f},a,c);return()=>d.dispose()}}var Sv=h.createIdentifier("application_block_inserted"),wv=h.createIdentifier$1("DataController"),kv=h.createIdentifier$1("DataEvents"),Kh=h.createIdentifier$1("plugin.startupShow");function Qh(e){return e.getInstance(Kh)?.current??Promise.resolve()}var za=br(async()=>({instance:{}})),Ga=br(async e=>({instance:{},async setOptions(){await Qh(e)}})),Cv=h.combineMixins([za,Ga]),Wa=()=>({title:"",description:"",website:"",company_size:"",industry:"",email:"",phone:"",logo_url:""}),Xh={title:"title",description:"description",website:"website",company_size:"company_size",industry:"industry",email:"email",phone:"phone",logo_url:"logo"},Ha=e=>({...Wa(),title:e?.title??"",description:e?.description??"",website:e?.website??"",company_size:e?.company_size??"",industry:e?.industry??"",email:e?.email??"",phone:e?.phone??"",logo_url:e?.logo??""}),qa=e=>(e??[]).filter(t=>!!t?.code).map(({code:t,label:n})=>({value:t,label:n??t})),Jh=e=>({company_sizes:qa(e?.company_sizes),industries:qa(e?.industries)}),Tv=Object.keys(Wa()),Va="ProjectProfile",Pn=o.createApi({reducerPath:"projectSettingsProfileApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Va],endpoints:e=>({getProjectProfile:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(h.getContainer(n)).projects.profileList({id:String(t)}));return"error"in r?{error:r.error}:{data:Ha(r.data)}},providesTags:(t,n,r)=>[{type:Va,id:String(r)}]}),getProjectProfileOptions:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(h.getContainer(n)).projects.profileOptionsList());return"error"in r?{error:r.error}:{data:Jh(r.data)}}}),updateProjectProfileField:e.mutation({async queryFn({projectId:t,field:n,value:r},i){const a={[Xh[n]]:r},c=o.v2ResultOf(await o.getClientV2(h.getContainer(i)).projects.profilePartialUpdate({id:String(t)},a));return"error"in c?{error:c.error}:{data:Ha(c.data)}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){try{const{data:i}=await r;n(Pn.util.updateQueryData("getProjectProfile",t,()=>i))}catch{}}})})}),{useGetProjectProfileQuery:Iv,useGetProjectProfileOptionsQuery:Av,useUpdateProjectProfileFieldMutation:xv}=Pn,Ya="ProjectStorage",Rn=o.createApi({reducerPath:"projectSettingsStorageApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),tagTypes:[Ya],endpoints:e=>({getProjectStorage:e.query({async queryFn(t,n){const r=o.v2ResultOf(await o.getClientV2(h.getContainer(n)).projects.storageList({id:String(t)}));return"error"in r?{error:r.error}:{data:r.data}},providesTags:(t,n,r)=>[{type:Ya,id:String(r)}]}),updateProjectStorage:e.mutation({async queryFn({projectId:t,body:n},r){const i=o.v2ResultOf(await o.getClientV2(h.getContainer(r)).projects.storageUpdate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}},async onQueryStarted({projectId:t},{dispatch:n,queryFulfilled:r}){const{data:i}=await r;n(Rn.util.upsertQueryData("getProjectStorage",t,i))}}),testProjectStorageConnection:e.mutation({async queryFn({projectId:t,body:n},r){const i=o.v2ResultOf(await o.getClientV2(h.getContainer(r)).projects.storageTestCreate({id:String(t)},n));return"error"in i?{error:i.error}:{data:i.data}}})})}),{useGetProjectStorageQuery:Pv,useUpdateProjectStorageMutation:Rv,useTestProjectStorageConnectionMutation:jv}=Rn,Zh=class{http;constructor(e){this.http=e}settings_summary_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/settings-summary/${e}`,method:"GET",...n})},Ka=class{http;constructor(e){this.http=e}developer_credentials_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"GET",...n});developer_credentials_partial_update=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}`,method:"PATCH",...n});developer_credentials_rotate_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/rotate-secret`,method:"POST",...n});developer_credentials_verify_secret_create=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/developer-credentials/${e}/verify-secret`,method:"POST",...n})},eg=class{http;constructor(e){this.http=e}developer_kit_postman_collection_list=(e={})=>this.http.request({path:"/projects/v1/developer-kit/postman-collection",method:"GET",...e})},tg=class{http;constructor(e){this.http=e}billing_context_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}`,method:"GET",...n});billing_context_payments_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/billing-context/${e}/payments`,method:"GET",query:t,...n})},ng=class{http;constructor(e){this.http=e}usage_detail=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}`,method:"GET",...n});usage_timeseries_list=({projectId:e,...t},n={})=>this.http.request({path:`/projects/v1/usage/${e}/timeseries`,method:"GET",query:t,...n})},Ke={PLUGIN_INIT:"plugin_init",LINK_CHECK:"link_check",IMAGE_CHECK:"image_check",SPAM_ASSASSIN:"spam_assassin",AI_IMAGE:"ai_image",AI_WRITE:"ai_write",AI_REPHRASE:"ai_rephrase"},Zt={TODAY:"today",WEEK:"week",MONTH:"month",CUSTOM:"custom"},Lv=[Ke.PLUGIN_INIT,Ke.LINK_CHECK,Ke.IMAGE_CHECK,Ke.SPAM_ASSASSIN,Ke.AI_IMAGE,Ke.AI_WRITE],ln={current:0,limit:null},og=()=>({pluginInit:{...ln},aiAssistant:{...ln},aiImage:{...ln},linkCheck:{...ln},imageCheck:{...ln},spamAssassin:{...ln}}),tt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Je=(e,t,n="")=>{for(const r of t){const i=e[r];if(typeof i=="string")return i;if(typeof i=="number"&&Number.isFinite(i))return String(i)}return n},Ft=(e,t,n=0)=>{for(const r of t){const i=e[r];if(typeof i=="number"&&Number.isFinite(i))return i;if(typeof i=="string"&&i.trim()&&Number.isFinite(Number(i)))return Number(i)}return n},Er=(e,t,n=!1)=>{for(const r of t){const i=e[r];if(typeof i=="boolean")return i}return n},Eo=(e,t)=>{for(const n of t){const r=e[n];if(r===null)return null;if(typeof r=="number"&&Number.isFinite(r))return r;if(typeof r=="string"&&r.trim()&&Number.isFinite(Number(r)))return Number(r)}return null},rg=new Set(Object.values(Ke)),ig=e=>rg.has(e)?e:null,en=e=>tt(e)&&"data"in e&&(e.ok===!0||typeof e.success=="boolean"||e.success===void 0)?e.data:e,cn=(e,t)=>{for(const n of t){const r=e[n];if(tt(r))return r}return null},ag=(e,t)=>{for(const n of t){const r=e[n];if(!Array.isArray(r))continue;const i=r.filter(a=>typeof a=="string");if(i.length>0)return i}},sg=e=>tt(e)?{clientId:Je(e,["clientId","client_id"]),clientSecretConfigured:Er(e,["clientSecretConfigured","client_secret_configured"]),rotatedAt:Je(e,["rotatedAt","rotated_at"])||void 0,scopesSuggested:ag(e,["scopesSuggested","scopes_suggested"])}:{clientId:"",clientSecretConfigured:!1},Qa=(e,t)=>{for(const n of t){const r=e[n];if(typeof r=="boolean")return r}},lg=e=>{const t=Qa(e,["pluginConnected","plugin_connected","connected","is_connected"]);if(t!==void 0)return t;for(const n of["plugin","developer_credentials","developerCredentials"]){const r=cn(e,[n]);if(!r)continue;const i=Qa(r,["connected","plugin_connected","is_connected"]);if(i!==void 0)return i;const a=Je(r,["clientId","client_id"]),c=Er(r,["clientSecretConfigured","client_secret_configured"]);if(a)return c}},cg=e=>{const t=en(e);if(!tt(t))return{};const n=cn(t,["members"]);return{myRole:Je(t,["myRole","my_role","role"])||(n?Je(n,["myRole","my_role","role"]):"")||void 0,pluginConnected:lg(t)}},dg=e=>tt(e)?{clientId:Je(e,["clientId","client_id"]),secret:Je(e,["secret","clientSecret","client_secret"])}:{clientId:"",secret:""},ug=e=>{if(!tt(e))return null;const t=Je(e,["event","type","key"]),n=ig(t);if(!n)return null;const r=e.delta??e.change??e.trend,i=r==null?null:typeof r=="number"&&Number.isFinite(r)?r:Number.isFinite(Number(r))?Number(r):null;return{event:n,total:Ft(e,["total","count","value"],0),delta:i}},Xa=e=>{if(!tt(e))return null;const t=Je(e,["date","day","x"]);if(!t)return null;const n={date:t},r=e.event_counts??e.eventCounts;if(tt(r)){for(const[i,a]of Object.entries(r))typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n}for(const[i,a]of Object.entries(e))i==="date"||i==="day"||i==="x"||i==="event_counts"||i==="eventCounts"||typeof a=="number"&&Number.isFinite(a)&&(n[i]=a);return n},mg=e=>{const t=en(e);return tt(t)?(Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:Array.isArray(t.time_series)?t.time_series:Array.isArray(t.history)?t.history:[]).map(Xa).filter(n=>n!==null):[]},pg=e=>{if(!tt(e))return{current:0,limit:null};const t=Ft(e,["current","count","used","value","total"],0),n=Eo(e,["limit","max","quota","cap"]);return{current:t,limit:n===null?null:n}},dn=(e,t)=>{for(const n of t)if(n in e)return pg(e[n]);return{current:0,limit:null}},un={pluginInit:[Ke.PLUGIN_INIT,"plugin_init","pluginInit"],aiAssistant:["ai_assistant","aiAssistant","ai"],aiImage:[Ke.AI_IMAGE,"ai_image","ai_img","aiImg"],linkCheck:[Ke.LINK_CHECK,"link_check","linkCheck"],imageCheck:[Ke.IMAGE_CHECK,"image_check","imageCheck"],spamAssassin:[Ke.SPAM_ASSASSIN,"spam_assassin","spamAssassin","spam_check","spamCheck"]},Sr=e=>{const t=og(),n=en(e),r=tt(n)&&tt(n.usage)?n.usage:n;if(!tt(r))return t;const i=Ft(r,["operationsTotal","operations_total"],0),a=Ft(r,["operationsLast30d","operations_last_30d"],0),c=cn(r,["metrics","counters","limits","events","usage_by_event","usageByEvent"])??r;return{pluginInit:dn(c,un.pluginInit),aiAssistant:dn(c,un.aiAssistant),aiImage:dn(c,un.aiImage),linkCheck:dn(c,un.linkCheck),imageCheck:dn(c,un.imageCheck),spamAssassin:dn(c,un.spamAssassin),lastActivityAt:Je(r,["lastActivityAt","last_activity_at"])||void 0,operationsTotal:i>0?i:void 0,operationsLast30d:a>0?a:void 0}},Ja=(e,t)=>{const n=[{event:Ke.LINK_CHECK,total:e.linkCheck.current,delta:null},{event:Ke.IMAGE_CHECK,total:e.imageCheck.current,delta:null},{event:Ke.SPAM_ASSASSIN,total:e.spamAssassin.current,delta:null},{event:Ke.AI_IMAGE,total:e.aiImage.current,delta:null}],r=t?mg(t):[];return r.length>0?{cards:n,chart:r}:{cards:n,chart:[]}},fg=e=>{const t=en(e);if(!tt(t))return Ja(Sr(e),e);const n=Array.isArray(t.cards)?t.cards:Array.isArray(t.summary)?t.summary:[],r=Array.isArray(t.chart)?t.chart:Array.isArray(t.series)?t.series:[];return n.length>0||r.length>0?{cards:n.map(ug).filter(i=>i!==null),chart:r.map(Xa).filter(i=>i!==null)}:Ja(Sr(t),t)},hg=e=>{if(!tt(e))return null;const t=Je(e,["id","payment_id"]);return t?{id:t,date:Je(e,["date","created_at","paid_at"]),amount:Ft(e,["amount","sum"],0),currency:Je(e,["currency"],"RUB"),status:Je(e,["status"],"unknown"),receiptUrl:Je(e,["receiptUrl","receipt_url","pdf_url"])||void 0}:null},gg=e=>{const t=en(e),n=tt(t)&&Array.isArray(t.payments)?t.payments:[];return{payments:n.map(hg).filter(r=>r!==null),page:tt(t)?Ft(t,["page"],1):1,perPage:tt(t)?Ft(t,["perPage","per_page"],20):20,total:tt(t)?Ft(t,["total"],n.length):n.length,totalPages:tt(t)?Ft(t,["totalPages","total_pages"],1):1}},yg=e=>{const t=en(e);if(!tt(t))return{viewerSeesBilling:!1};const n=cn(t,["endpoints"])??{},r=cn(t,["documentLinks","document_links"]),i=r?Object.fromEntries(Object.entries(r).filter(f=>typeof f[1]=="string")):void 0,a=Eo(t,["ownerUserId","owner_user_id"]),c=cn(t,["tariff","plan","subscription"]),d=Je(t,["planDescription","plan_description"])||(c?Je(c,["description","about","plan_description"]):"")||void 0,u=Eo(t,["planPrice","plan_price","price","amount"])??(c?Eo(c,["price","amount"]):null),m=Je(t,["planCurrency","plan_currency","currency"])||(c?Je(c,["currency"]):"")||void 0;return{viewerSeesBilling:Er(t,["viewerSeesBilling","viewer_sees_billing"]),ownerUserId:a??void 0,planName:Je(t,["planName","plan_name"])||void 0,planDescription:d,planPrice:u??void 0,planCurrency:m||void 0,endpoints:{limitsStats:Je(n,["limitsStats","limits_stats"])||void 0,subscriptionMe:Je(n,["subscriptionMe","subscription_me"])||void 0,payments:Je(n,["payments"])||void 0},documentLinks:i&&Object.keys(i).length>0?i:void 0}},_g={myRole:"owner"},bg=()=>({..._g}),vg={clientId:"rust-awkward-bear",clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"},Za=()=>({...vg,clientSecretConfigured:{}.REACT_APP_PLUGIN_SETTINGS_MOCK_CONNECTED!=="false"}),es=Object.values(Ke),Eg={[Ke.PLUGIN_INIT]:42,[Ke.LINK_CHECK]:-15,[Ke.IMAGE_CHECK]:28,[Ke.SPAM_ASSASSIN]:9,[Ke.AI_IMAGE]:6,[Ke.AI_WRITE]:-11,[Ke.AI_REPHRASE]:4},Sg=(e,t)=>{const n={date:e};return es.forEach((r,i)=>{const a=Math.sin(t*.65+i*.9),c=t*(i%2===0?.35:.2),d=2+i;n[r]=Math.max(0,Math.round(d+a*4+c))}),n},wg=e=>es.map(t=>({event:t,total:e.reduce((n,r)=>n+(typeof r[t]=="number"?r[t]:0),0),delta:Eg[t]})),kg=({period:e,dateFrom:t,dateTo:n})=>{const r=(0,En.default)().startOf("day");if(e===Zt.WEEK)return{startDate:r.subtract(6,"day"),days:7};if(e===Zt.MONTH)return{startDate:r.subtract(29,"day"),days:30};if(e===Zt.CUSTOM&&t&&n){const i=(0,En.default)(t),a=(0,En.default)(n);return{startDate:i,days:Math.max(1,a.diff(i,"day")+1)}}return{startDate:r,days:1}},wr=(e={period:Zt.TODAY})=>{const{startDate:t,days:n}=kg(e),r=Array.from({length:n},(i,a)=>Sg(t.add(a,"day").format("YYYY-MM-DD"),a));return{cards:wg(r),chart:r}},Ov=wr({period:Zt.WEEK}),Cg={pluginInit:{current:0,limit:null},aiAssistant:{current:0,limit:null},aiImage:{current:42,limit:100},linkCheck:{current:128,limit:500},imageCheck:{current:64,limit:200},spamAssassin:{current:31,limit:150},lastActivityAt:"2026-05-02T12:00:00Z"},ts={payments:[{id:"98765",date:"2026-05-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success",receiptUrl:"https://receipts.example/98765.pdf"},{id:"98764",date:"2026-04-12T10:15:00+00:00",amount:990,currency:"RUB",status:"success"},{id:"98763",date:"2026-03-12T10:15:00+00:00",amount:990,currency:"RUB",status:"failed"}],page:1,perPage:20,total:3,totalPages:1},Tg={viewerSeesBilling:!0,ownerUserId:1,planName:"Corporate",planDescription:"For fully addressing all necessary tasks in any field.",planPrice:3200,planCurrency:"RUB",endpoints:{limitsStats:"/wp-json/limits/v1/stats",subscriptionMe:"/wp-json/subscription/v2/me",payments:"/wp-json/projects/v1/billing-context/2581/payments"}},Ig={info:{name:"EmailMaker Plugin Requests",schema:"https://schema.getpostman.com/json/collection/v2.1.0/collection.json"},item:[]},Ag=e=>e,xg=()=>!1,Pg=()=>!1,Rg=e=>e,mn="ProjectPlugin",jg=()=>({}).REACT_APP_PLUGIN_SETTINGS_USE_MOCK==="true",Vt=(e,t,n)=>e.error&&jg()?{data:n(t)}:o.transformResponseFn(n)(e),Lg=e=>Ag(sg(e)),Og=e=>Rg(yg(e)),Mg=({period:e,dateFrom:t,dateTo:n})=>{if(e===Zt.CUSTOM){const r={};return t&&(r.date_from=t),n&&(r.date_to=n),r}return{period:e??Zt.TODAY}},So=o.createApi({reducerPath:"projectSettingsPluginApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/".replaceAll(/[\\/]$/g,"")}),tagTypes:[mn],endpoints:e=>({getPluginSummary:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[Zh]).settings_summary_detail({projectId:t}).then(r=>Vt(r,bg(),cg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:r}]}),getPluginCredentials:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[Ka]).developer_credentials_detail({projectId:t}).then(r=>Vt(r,Za(),Lg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`credentials-${r}`}]}),rotatePluginSecret:e.mutation({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[Ka]).developer_credentials_rotate_secret_create({projectId:t}).then(r=>Vt(r,{clientId:Za().clientId,secret:"mock-rotated-secret"},dg))},invalidatesTags:(t,n,{projectId:r})=>[{type:mn,id:`credentials-${r}`}]}),getPostmanCollection:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[eg]).developer_kit_postman_collection_list({extraQuery:{project_id:String(t)}}).then(r=>Vt(r,Ig,i=>en(i)??i))}}),getPluginAnalytics:e.query({queryFn({projectId:t,period:n,dateFrom:r,dateTo:i},a){const c={period:n,dateFrom:r,dateTo:i};return xg()?Promise.resolve({data:wr(c)}):o.getClient(h.getContainer(a)).request({path:`/projects/v1/usage/${t}/timeseries`,method:"GET",query:Mg(c)}).then(d=>Vt(d,wr(c),fg))}}),getPluginBillingContext:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[tg]).billing_context_detail({projectId:t}).then(r=>Vt(r,Tg,Og))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`billing-${r}`}]}),getPluginUsage:e.query({queryFn({projectId:t},n){return h.getApi(h.getContainer(n),[ng]).usage_detail({projectId:t}).then(r=>Vt(r,Cg,Sr))}}),getPluginPayments:e.query({queryFn({projectId:t,page:n=1,perPage:r=20},i){return Pg()?Promise.resolve({data:ts}):o.getClient(h.getContainer(i)).request({path:`/projects/v1/billing-context/${t}/payments`,method:"GET",query:{page:String(n),per_page:String(r)}}).then(a=>Vt(a,ts,gg))},providesTags:(t,n,{projectId:r})=>[{type:mn,id:`payments-${r}`}]})})}),{useGetPluginSummaryQuery:Mv,useGetPluginCredentialsQuery:Nv,useRotatePluginSecretMutation:Dv,useLazyGetPostmanCollectionQuery:Fv,useGetPluginAnalyticsQuery:Bv,useGetPluginBillingContextQuery:Uv,useGetPluginPaymentsQuery:$v,useGetPluginUsageQuery:zv}=So,ns="EmailRaw",wo=o.createApi({reducerPath:"emailRawApi",tagTypes:[ns],baseQuery:o.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/wp/v2/"}),endpoints:e=>({getEmailRaw:e.query({queryFn:function({emailId:t,secret_hash:n},r){return h.getApi(h.getContainer(r),[h.WpEmailApi]).email_detail({id:t},{extraQuery:{secret_hash:n}}).then(o.transformResponseFn(o.WpEmailToEmail))},providesTags:(t,n,r)=>[{type:ns,id:r}]})})}),{useGetEmailRawQuery:Gv}=wo,ko=o.createApi({reducerPath:"yandexAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateYandexToken:e.mutation({query:t=>({url:"/auth/yandex",method:"POST",body:t})})})}),{useValidateYandexTokenMutation:Wv}=ko,Co=o.createApi({reducerPath:"elamaAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateElamaCode:e.mutation({query:t=>({url:"/auth/elama",method:"POST",body:t})})})}),{useValidateElamaCodeMutation:Hv}=Co,To=o.createApi({reducerPath:"googleAuthApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({validateGoogleToken:e.mutation({query:t=>({url:"/auth/google",method:"POST",body:t})})})}),{useValidateGoogleTokenMutation:qv}=To,os=async e=>{const t=await e.text();let n=t;try{n=JSON.parse(t)}catch{n=t}return n},Ng=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",headers:{"Content-Type":"application/json"},body:t,responseHandler:os}},Dg=(e,t,n)=>{if(!e)throw new Error(`Set ${n}`);return{url:`?proxy_url=${encodeURIComponent(e)}`,method:"POST",body:t,responseHandler:os}},Io=o.createApi({reducerPath:"requestPlaneApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRequest:e.mutation({query:t=>Dg("https://webhook.latenode.com/5868/prod/9e7a6445-2244-4dd5-bda4-5bca82997bf8",t,"REACT_APP_PIPEDREAM_REQUEST_PLANE_SRC")}),getInvoiceRequest:e.mutation({query:t=>Ng("https://webhook.latenode.com/5868/prod/6e2d04a8-6cd9-4ec3-b884-ee2fd67267a3",t,"REACT_APP_REQUEST_PLANE_WEBHOOK_URL")})})}),{useGetRequestMutation:Vv,useGetInvoiceRequestMutation:Yv}=Io,Ao=o.createApi({reducerPath:"getCheckoutUrlApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({GetCheckoutUrl:e.mutation({query:t=>({url:`?proxy_url=${encodeURIComponent({}.REACT_APP_PIPEDREAM_GET_CHECKOUT_URL)}`,method:"POST",body:t})})})}),{useGetCheckoutUrlMutation:Kv}=Ao,kr=o.createApi({reducerPath:"recoverPasswordApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://app.emailmaker.ru/api/wp-json/bdpwr/v1/"}),endpoints:()=>({})}),xo=o.createApi({reducerPath:"addUserToProjectApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/user_to_project/v1/add_user"}),endpoints:e=>({addUserToProject:e.mutation({queryFn(t,n){return o.clientFromApi(n).userToProject.add_user_create(t,{type:h.ContentType.FormData})}})})}),{useAddUserToProjectMutation:Qv}=xo,Po=o.createApi({reducerPath:"recurrenceSubscriptionsOffApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getCanselRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/07ae4159-132b-4a00-998b-bc47c20365ba?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetCanselRecurrenceQuery:Xv,useGetCanselRecurrenceQuery:Jv}=Po,Ro=o.createApi({reducerPath:"recurrenceSubscriptionsOnApi",baseQuery:o.fetchBaseQuery({baseUrl:"https://px0.emailmaker.ru/"}),endpoints:e=>({getRecurrence:e.query({query:t=>({url:`?proxy_url=${encodeURIComponent(`https://webhook.latenode.com/5868/prod/e1dd37b1-c3d4-4441-b329-d6b3aa51bfe7?subscription_id=${t.sid}&user_id=${t.uid}`)}`})})})}),{useLazyGetRecurrenceQuery:Zv,useGetRecurrenceQuery:e0}=Ro,Fg="https://app.emailmaker.ru/api/v2",jo=o.createApi({reducerPath:"authApi",baseQuery:o.fetchBaseQueryApp({baseUrl:Fg,prepareHeaders:e=>{const t=o.api.get(o.APP_COOKIES.em_token);return t&&!e.has("authorization")&&e.set("authorization",`Bearer ${t}`),e}}),endpoints:e=>({login:e.mutation({query:t=>({url:"/auth/token",method:"POST",body:t})}),register:e.mutation({query:t=>({url:"/auth/register",method:"POST",body:t})}),refreshToken:e.mutation({query:t=>({url:"/auth/token/refresh",method:"POST",body:t})}),logout:e.mutation({query:()=>({url:"/auth/token",method:"DELETE"})}),getUser:e.query({query:()=>"/auth/user",transformResponse:t=>{const n=Array.isArray(t)?t[0]:t;return o.WpUserToUser(n)}}),changePassword:e.mutation({query:t=>({url:"/auth/password/change",method:"POST",body:t})}),resetPassword:e.mutation({query:t=>({url:"/auth/password/reset",method:"POST",body:t})}),resetPasswordConfirm:e.mutation({query:t=>({url:"/auth/password/reset/confirm",method:"POST",body:t})})})}),{useLoginMutation:t0,useRegisterMutation:n0,useRefreshTokenMutation:o0,useLogoutMutation:r0,useGetUserQuery:i0,useLazyGetUserQuery:a0,useChangePasswordMutation:s0,useResetPasswordMutation:l0,useResetPasswordConfirmMutation:c0}=jo;function rs(e){return{id:e.id??0,name:e.name??"",children:(e.children??[]).map(rs)}}function Bg(e){return(e?.folders??[]).map(rs)}function Ug(e){return{items:(e?.items??[]).flatMap(t=>t.id?[{kind:t.kind??"email",id:t.id,name:t.name??"",title:t.title??"",preheader:t.preheader??"",folderId:t.folder_id??0,hasAmp:t.has_amp??!1,previewImage:t.preview_image??"",updatedAt:t.updated_at??"",imported:t.imported??!1}]:[]),total:e?.total??0}}function Cr(e){const t=e.status??"pending";return{id:e.id??"",status:t,outcome:e.outcome,total:e.total??0,imported:e.imported??0,warnings:e.warnings??0,failed:e.failed??0,finished:t==="done"||t==="failed",items:(e.items??[]).map(n=>({kind:n.kind??"email",stripoId:n.stripo_id??0,name:n.name??"",status:n.status??"failed",reason:n.reason,emailId:n.email_id})),createdAt:e.created_at??"",finishedAt:e.finished_at}}function $g(e){return{selectors:e.map(t=>({kind:t.kind,...t.ids?.length?{ids:t.ids}:{},...t.all?{all:!0}:{},...t.folderId?{folder_id:t.folderId}:{},...t.rootOnly?{root_only:!0}:{},...t.search?{search:t.search}:{}}))}}var Tr="StripoItems",Ir="StripoFolders",Lo="StripoImportJob",pn=(e,t)=>{const n=o.v2ResultOf(e);return"error"in n?{error:n.error}:{data:t(n.data)}},Oo=o.createApi({reducerPath:"stripoImportApi",tagTypes:[Tr,Ir,Lo],baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/v2"}),endpoints:e=>({saveStripoKey:e.mutation({async queryFn({projectId:t,apiKey:n},r){return pn(await o.getClientV2(h.getContainer(r)).projects.stripoKeyUpdate({id:String(t)},{api_key:n}),()=>{})},invalidatesTags:[Tr,Ir]}),getStripoFolders:e.query({async queryFn({projectId:t,kind:n},r){return pn(await o.getClientV2(h.getContainer(r)).projects.stripoFoldersList({id:String(t),kind:n}),Bg)},providesTags:[Ir]}),getStripoItems:e.query({async queryFn({projectId:t,kind:n,folderId:r,rootOnly:i,search:a,page:c,limit:d},u){return pn(await o.getClientV2(h.getContainer(u)).projects.stripoItemsList({id:String(t),kind:n,...r?{folder_id:r}:{},...i?{root_only:!0}:{},...a?{search:a}:{},page:c,limit:d}),Ug)},providesTags:[Tr]}),startStripoImport:e.mutation({async queryFn({projectId:t,selectors:n},r){return pn(await o.getClientV2(h.getContainer(r)).projects.stripoImportsCreate({id:String(t)},$g(n)),Cr)},invalidatesTags:[Lo]}),getCurrentStripoImport:e.query({async queryFn(t,n){const r=await o.getClientV2(h.getContainer(n)).projects.stripoImportsCurrentList({id:String(t)});return r.status===204?{data:null}:pn(r,Cr)},providesTags:[Lo]}),getStripoImport:e.query({async queryFn({projectId:t,jobId:n},r){return pn(await o.getClientV2(h.getContainer(r)).projects.stripoImportsDetail({id:String(t),jobId:n}),Cr)},providesTags:[Lo]})})}),{useSaveStripoKeyMutation:d0,useGetStripoFoldersQuery:u0,useGetStripoItemsQuery:m0,useLazyGetStripoItemsQuery:p0,useStartStripoImportMutation:f0,useGetCurrentStripoImportQuery:h0,useGetStripoImportQuery:g0}=Oo,zg=o.createState({activeGroupsTags:[],activeProjectGroupsTags:[],groupsTemplateTotal:null,groupsTemplateProjectTotalPages:null,groupsTemplateProjectTotal:null}),Gg="projectSlice",Ar=o.createSlice({name:Gg,initialState:zg,reducers:{setActiveGroupsTags:(e,{payload:t})=>{e.activeGroupsTags=t,t.length&&(e.activeProjectGroupsTags=[])},setActiveProjectGroupsTags:(e,{payload:t})=>{e.activeProjectGroupsTags=t,t.length&&(e.activeGroupsTags=[])},resetAllTags:e=>{e.activeProjectGroupsTags=[],e.activeGroupsTags=[]}},extraReducers:e=>{e.addMatcher(o.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{payload:n,meta:r})=>{const{projectId:i}=r.arg.originalArgs;i?(t.groupsTemplateProjectTotal=+r.baseQueryMeta?.response.headers.get("X-WP-Total"),t.groupsTemplateProjectTotalPages=+r.baseQueryMeta?.response.headers.get("X-WP-TotalPages")):t.groupsTemplateTotal=+r.baseQueryMeta?.response.headers.get("X-WP-Total")})}}),{setActiveGroupsTags:y0,setActiveProjectGroupsTags:_0,resetAllTags:b0}=Ar.actions,Wg=o.createState({emailsTotal:0,elementsList:[],emailsTrashTotal:0,elementsTrashList:[],customFolders:{},elementsView:o.CARDS}),Hg="emailsPageSlice";function qg(e){const t=e?.baseQueryMeta?.response;return Number(t?.headers?.get("X-WP-Total"))||0}function is(e,t){const{emails:n,total:r,isSearch:i,page:a,tagOrFolderId:c}=t;if(t.status==="trash")!i&&r!==void 0&&(e.emailsTrashTotal=r),e.elementsTrashList=n;else if(c){const d=e.customFolders[c];e.customFolders={...e.customFolders,[c]:{list:n,page:a,total:r??d?.total??0}}}else r!==void 0&&(e.emailsTotal=r),e.elementsList=n}var xr=o.createSlice({name:Hg,initialState:Wg,reducers:{resetElementsList:e=>{e.elementsList=[]},syncElementsList:(e,{payload:t})=>{is(e,t)},toggleElementsView:(e,t)=>{e.elementsView=t.payload},removeEmailFromList:(e,{payload:t})=>{const n=e.customFolders;t.folder!=="all"&&n[t.folder]?.list&&(n[t.folder]={...n[t.folder],list:n[t.folder].list.filter(r=>r.id!==t.emailId),total:n[t.folder].total-1},e.customFolders=n)}},extraReducers:e=>{e.addMatcher(o.emailsApi.endpoints.getEmails.matchFulfilled,(t,{meta:n,payload:r})=>{const i=n.arg.originalArgs;is(t,{emails:r,total:qg(n),status:i?.status,page:i?.page,isSearch:!!i?.name?.length,tagOrFolderId:i?.folderTag||i?.tags?.[0]})}),e.addMatcher(o.emailsApi.endpoints.getTemplateEmails.matchFulfilled,(t,{meta:n,payload:r})=>{const i=+n.baseQueryMeta?.response.headers.get("X-WP-Total")||0;t.elementsList=r,t.emailsTotal=i;const{projectGroup:a,projectId:c,tags:d}=n.arg.originalArgs;(a?.length&&c||d?.length||!d?.length&&!a?.length)&&(t.emailsTotal=i)}),e.addMatcher(o.emailsApi.endpoints.editEmail.matchFulfilled,(t,{payload:n})=>{t.elementsList.map(r=>r.id?.toString()===n.id?.toString()?Object.assign(r,{lock:n.lock,title:n.title,emailtags:n.emailtags}):r)})}}),{toggleElementsView:v0,resetElementsList:E0,syncElementsList:S0,removeEmailFromList:w0}=xr.actions,as=o.combineReducers({[o.di.reducerPath]:o.di.reducer,[o.AiApi.reducerPath]:o.AiApi.reducer,[o.userSlice.name]:o.userSlice.reducer,[o.emailSlice.name]:o.emailSlice.reducer,[o.blockSlice.name]:o.blockSlice.reducer,[o.imageApi.reducerPath]:o.imageApi.reducer,[An.reducerPath]:An.reducer,[yo.reducerPath]:yo.reducer,[Ar.name]:Ar.reducer,[o.blocksApi.reducerPath]:o.blocksApi.reducer,[o.emailsApi.reducerPath]:o.emailsApi.reducer,[ho.reducerPath]:ho.reducer,[Xn.reducerPath]:Xn.reducer,[Jn.reducerPath]:Jn.reducer,[Zn.reducerPath]:Zn.reducer,[eo.reducerPath]:eo.reducer,[to.reducerPath]:to.reducer,[no.reducerPath]:no.reducer,[oo.reducerPath]:oo.reducer,[ro.reducerPath]:ro.reducer,[io.reducerPath]:io.reducer,[ao.reducerPath]:ao.reducer,[so.reducerPath]:so.reducer,[lo.reducerPath]:lo.reducer,[co.reducerPath]:co.reducer,[uo.reducerPath]:uo.reducer,[mo.reducerPath]:mo.reducer,[po.reducerPath]:po.reducer,[o.emailPageSlice.name]:o.emailPageSlice.reducer,[o.projectsApi.reducerPath]:o.projectsApi.reducer,[Pn.reducerPath]:Pn.reducer,[Qt.reducerPath]:Qt.reducer,[Rn.reducerPath]:Rn.reducer,[So.reducerPath]:So.reducer,[o.saveFileApi.reducerPath]:o.saveFileApi.reducer,[wo.reducerPath]:wo.reducer,[o.commentsApi.reducerPath]:o.commentsApi.reducer,[o.optimiseApi.reducerPath]:o.optimiseApi.reducer,[ir.name]:ir.reducer,[xr.name]:xr.reducer,[fo.reducerPath]:fo.reducer,[To.reducerPath]:To.reducer,[ko.reducerPath]:ko.reducer,[Co.reducerPath]:Co.reducer,[o.taxonomiesApi.reducerPath]:o.taxonomiesApi.reducer,[o.projectsPageSlice.name]:o.projectsPageSlice.reducer,[o.AiApiGenerator.reducerPath]:o.AiApiGenerator.reducer,[Io.reducerPath]:Io.reducer,[go.reducerPath]:go.reducer,[bo.reducerPath]:bo.reducer,[Gn.reducerPath]:Gn.reducer,[o.authorizationApi.reducerPath]:o.authorizationApi.reducer,[o.limitsApi.reducerPath]:o.limitsApi.reducer,[o.revisionHistorySlice.name]:o.revisionHistorySlice.reducer,[Ao.reducerPath]:Ao.reducer,[o.defaultModePanesSlice.name]:o.defaultModePanesSlice.reducer,[kr.reducerPath]:kr.reducer,[xo.reducerPath]:xo.reducer,[_o.reducerPath]:_o.reducer,[Ro.reducerPath]:Ro.reducer,[Po.reducerPath]:Po.reducer,[jo.reducerPath]:jo.reducer,[o.projectSettingsV2Api.reducerPath]:o.projectSettingsV2Api.reducer,[Oo.reducerPath]:Oo.reducer}),Vg=(e,t)=>t.type==="authorizationApi/resetApiState"?as({[o.reducerPath]:e[o.reducerPath]},t):as(e,t),ss=[o.AiApi,o.imageApi,yo,o.emailsApi,An,o.blocksApi,ho,Xn,Jn,Zn,eo,to,no,oo,ro,io,ao,so,lo,co,uo,mo,po,wo,o.projectsApi,Pn,Qt,Rn,So,o.commentsApi,o.optimiseApi,o.saveFileApi,fo,To,o.taxonomiesApi,ko,Co,o.AiApiGenerator,Io,o.authorizationApi,o.limitsApi,go,bo,Gn,Ao,kr,jo,o.projectSettingsV2Api,Oo,xo,_o,Ro,Po];function Yg(e){let t={};if(e){const r=h.createIdentifier$1();h.DependencyResolver.inject(r,e),t={INJECTION:r}}const n=o.configureStore({reducer:Vg,middleware:r=>r({serializableCheck:!1}).concat(ss.map(i=>i.middleware)),preloadedState:t});return o.setupListeners(n.dispatch),n}var ls=h.createIdentifier$1("RtkApiRegistry");function Kg(e,t){e.inject(ls,new Map(t.map(n=>[n.reducerPath,n])))}function st(e,t){const n=e?.getInstance(ls)?.get(t);if(!n)throw new Error(`RTK api "${t}" is not in the container registry (provideRtkApiRegistry did not run)`);return n}function Qg(e,t){let n={isCodeMode:void 0,direction:void 0};return o.provideCodeMode(e).watch(r=>{n.isCodeMode!==r.isCodeMode&&t.dispatch(o.setCodeMode(r.isCodeMode)),n.direction!==r.direction&&t.dispatch(o.switchCodeModeDirection(r.direction)),n={isCodeMode:r.isCodeMode,direction:r.direction}})}function Xg(e,t){const n=o.provideCurrentUser(e),r=o.authorizationApi.endpoints.getMe.select("");let i=n.get()?.profile;const a=()=>{const c=r(t.getState()).data;!c||c===i||(i=c,n.set({profile:c}))};return a(),{dispose:t.subscribe(a)}}var Jg=h.createIdentifier$1("EmailSettingsPort");function Zg(e,t){e.inject(Jg,{read:()=>o.selectEmailSettings(t.getState())??{},write:n=>{t.dispatch(o.setEmailSettings(n))},markAppearanceChanged:()=>{t.dispatch(o.markAppearanceNeedsUpdate())}})}var ey="Invalid standaloneKey.",ty="not implemented",k0=1,ny=h.createIdentifier$1("StandaloneMockGuard");function Pr(){const e=new Error(ey);return e.name="InvalidStandaloneKeyError",e}function Rr(e){return o.isStandaloneRuntime(h.getContainer(e))}function oy(e){return e instanceof Error?e.name==="InvalidStandaloneKeyError"||e.message==="Invalid standaloneKey."||e.message==="not implemented":e===ty}function cs(e){if(Rr(e))throw Pr()}function ry(e,t,n){return n instanceof Error&&n.name==="InvalidStandaloneKeyError"?n:Pr()}var iy=()=>()=>{throw Pr()};function ay(e){if(!e)throw new Error("DI container not found for standalone mock guard");e.inject(ny,1)}function sy(e){return typeof e!="function"}var C0="[plugin-api-mock]";function ds(){return!0}function ly(e){try{if(e===null||typeof e!="object")return e;const t={};for(const n of Object.keys(e).slice(0,12)){const r=e[n];t[n]=typeof r=="string"&&r.length>120?`${r.slice(0,120)}…(${r.length})`:r}return t}catch{return"(unserializable arg)"}}function cy(e,t){return n=>{const r=n.query,i=n.queryFn||((a,c,d,u)=>{if(!r)throw new Error("query not found EndpointDefinition");return u(r(a))});i&&(n.query=void 0,n.queryFn=async(a,c,d,u)=>{try{let m;const f=h.getContainer(c).getServices(e);for(let g=f.length-1;g>=0;g--){const _=f[g];if(m=m?await m(async p=>await _.execute(p),c):await _.execute(a),sy(m))return{data:m,error:null}}if(m)m=await m(async(g,_=c,p=d,E=u)=>{cs(c);const C=await i(g,_,p,E);if(C.error)throw C.error;return C.data},c);else{cs(c),ds();const g=await i(a,c,d,u);if(g.error)throw g.error;m=g.data}return{data:m,error:null}}catch(m){return Rr(c)&&oy(m)?{error:ry(t,ly(a),m)}:(ds(),{error:m})}})}}var us=new Set;function it(e){return(t,n)=>{const r=Object.create(null),i=Object.keys(n),a=new h.Disposable;for(const c of i){const d=`api_listeners_flag_${t.reducerPath}/${c.toString()}`,u=h.createIdentifier$1(`api_listeners_${t.reducerPath}/${c.toString()}`);us.has(d)||(r[c]=cy(u,`${t.reducerPath}/${c.toString()}`),us.add(d)),a.addDisposable(e.addService(u,{execute:n[c]}))}return Object.keys(r).length&&t.enhanceEndpoints({endpoints:r}),o.getDisposable(e).addDisposable(a),a}}function ms(e,t){for(const n of Object.keys(t))try{t[n](e)}catch{}}function T0(e){return e}function ps(e,t){return e({body:t}).catch(()=>new Promise(n=>setTimeout(n,1e3)))}function dy(e){it(e)(st(e,"AiApi"),{sendMessage:({body:t})=>async(n,r)=>{const i=o.getEmitter(e,h.events.AI_TEXT_REQUEST_ID);if(!i.hasListeners())return ps(n,t);const a=t,c={message:a.message??a.context,locale:a.locale,entityId:a.entity_id,projectId:a.project_id!=null?String(a.project_id):void 0,subject:a.subject,preheader:a.preheader,textContent:a.textContent,context:a.context??a.connection,connection:a.connection,onProgress:(d,u)=>{o.getEmitter(e,h.events.AI_TEXT_PROGRESS_ID).fire({progress:Number.isFinite(d)?d:0,status:typeof u=="string"?u:void 0})},onStreamChunk:d=>{typeof d!="string"||!d||o.getEmitter(e,h.events.AI_TEXT_STREAM_ID).fire({partialHtml:d})},signal:r.signal};for(const d of i.getListeners([c])){const u=await d(c);if(u)return{status:200,_eventResult:!0,aiMessage:typeof u.message=="string"?u.message:"",aiHtml:typeof u.html=="string"?u.html:void 0}}return ps(n,t)},getDialog:t=>(n,r)=>Rr(r)?Promise.resolve({documents:[],totalCount:0}):n(t)})}function uy(e){const t=it(e),n=o.getEmitter(e,h.events.FILE_PROXY_EVENT_ID);t(st(e,"proxyApi"),{async getFile({url:r,tryFetch:i=!0,type:a}){return async c=>{const{requested:d}=o.getCurrentProject(e),u=(await n.fire({url:r,project:d})).filter(m=>m instanceof Blob)[0];if(u)switch(a){case"json":return JSON.parse(await u.text());case"text":return u.text();default:return u}else return c({url:r,tryFetch:i,type:a})}}})}function my(e){it(e)(st(e,"tokenApi"),{tokenCreate(t){return n=>n(t)},tokenValidate(){return t=>t({})}})}function I0(e){return e}function py(e){it(e)(st(e,"imageApi"),{sendAiImageRequest:function({body:t}){return async(n,r)=>{const i=o.getEmitter(e,h.events.AI_IMAGE_REQUEST_ID);if(!i.hasListeners()||t.request!=="create-image")return n({body:t});const a={prompt:t.message??"",size:t.size,entityId:t.entity_id,projectId:t.project_id!=null?String(t.project_id):void 0,onProgress:(c,d)=>{o.getEmitter(e,h.events.AI_IMAGE_PROGRESS_ID).fire({progress:Number.isFinite(c)?c:0,status:typeof d=="string"?d:void 0})},signal:r.signal};for(const c of i.getListeners([a])){const d=await c(a);if(d&&d.images?.length)return{data:{status:200,_eventResult:!0,task:{images:d.images}}}}return n({body:t})}},getAiImage(t){return n=>n(t)}})}async function fs(e,t,n,r,i){try{const a=(await e.fire({project:String(t),emailId:n})).filter(c=>c!=null);if(a.length)return a.flat()}catch{}return r(i)}function fy(e){const t=it(e),n=st(e,"blocksApi"),r=o.blocksDataSourceProvider(e),i=r.byForeignKey("project"),a=o.blockRevisionsDataSourceProvider(e);a.byForeignKey("parent");const{dispatch:c}=o.getStore(e),d=o.getDisposable(e);d.addDisposable(r.onChange(()=>c(n.util.invalidateTags(["Blocks"])))),d.addDisposable(r.onSave(({prev:f,patch:g,value:_})=>{const p=f?{...f,...g}:g;let E=o.mergeEntityPreservingMeta(f,g,_);return p&&E.html===p.html&&E.title===p.title&&(E={...E,renderGuid:p.renderGuid}),E},Number.MIN_VALUE));const u=o.getEmitter(e,o.READ_COMMON_BLOCKS_EVENT_ID),m=o.getEmitter(e,o.READ_TEMPLATE_BLOCKS_EVENT_ID);t(n,{async getBlocks(f){const g={};f.name&&(g.title=f.name),f.type&&(g.type=f.type);const _=f.projectId??await o.getBlocksProject(e);return await i.get(_,{filter:g,page:f.page,pageSize:f.pageSize,order:f.order,orderBy:f.orderby}).then(({data:p})=>p)},getBlocksSchema(){return f=>f(void 0)},getParentEmailBlocks(f){return async g=>{const _=o.getCurrentProject(e).requested||"";return fs(m,_,f.emailId||"",g,f)}},getTemplateBlocks(f){return async g=>{const _=o.getCurrentProject(e).requested||"";return fs(u,_,f.emailId||"",g,f)}},async getBlock(f){const g=o.getCurrentProject(e).card?.id;if(g!==void 0)return i.first(Number(g),{filter:{id:f}})},addBlock(f){return async g=>{const _=await r.create(f);return o.getAppConfig(e).preventSendDataToEM||g(_).catch(p=>{}),_}},editBlock({blockId:f,...g}){return r.update(f,g)},deleteBlock(f){return r.remove(typeof f=="object"?f.id:f)},addTag(f){return f},getDeletableTag([f,g]){return[]},autoSaveBlock({blockId:f,body:g}){return a.create({...g,parent:f})}})}function hy(e){const{emails:t,emailRevisions:n}=o.provideEmailDocuments(e),{dispatch:r}=o.getStore(e),i=o.getDisposable(e),a=it(e),c=st(e,"emailsApi");i.addDisposable(t.onChange(async()=>{r(c.util.invalidateTags(["Email"]))})),a(c,{getEmails:d=>[],getTemplateEmails:d=>[],async addEmail({source:d,...u}){const m=await t.create(u,{source:d});return m.renderGuid||(m.renderGuid=h.generateUUID()),m},editEmail(d){return async u=>{const{emailId:m,source:f,...g}=d;return o.isRevisionServiceEnabled(e)&&await u(d),t.update(m,g,{source:f})}},deleteEmail(d){return t.remove(typeof d=="object"?d.id:d)},addTag(){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},getDeletableTag([d,u]){return[]},autoSaveEmail({emailId:d,body:u}){return async m=>{o.isRevisionServiceEnabled(e)&&await m({emailId:d,body:u});const f=await n.create({...u,parent:d,modified:new Date().toString()});return f&&!f.html&&u.html?{...f,html:u.html}:f}}})}var gy="tmp",A0=h.createIdentifier$1();function yy(e){const t=it(e);if(!e.getInstance(h.DISPOSABLE_ID))throw new Error("Something was wrong");const n=o.getEmitter(e,h.events.UPLOAD_EVENT_ID),r=o.getEmitter(e,h.events.ON_SEND_TESTEMAIL_ID),i=o.getEmitter(e,h.events.ON_SEND_LIVEPREVIEW_ID);t(st(e,"saveFileApi"),{uploadImage(a){return async c=>{const{requested:d}=o.getCurrentProject(e),u=async()=>c({...a,user_id:String((await e.getInstanceAsync(h.APP_ID)).app_id)});if(a.folder===gy)return u();const m=await o.fireUploadImageEvent(n,{file:a.file,project:d});if(m.url)return[{file_url:m.url,project:d}];if(!o.shouldFallbackToBuiltInUpload(m,{isStandalone:o.isStandaloneRuntime(e)}))throw o.toUploadImageError(m);return u()}},sendTestEmail(a){return async c=>{const{requested:d}=o.getCurrentProject(e);(await r.fire({project:d,email_id:a.email_id,subject:a.subject,email:a.email,html:a.html,from_name:a.from_name})).some(u=>u===!1)&&await c({...a,user_id:String((await e.getInstanceAsync(h.APP_ID)).app_id)})}},async sendLivePreview(a){const{requested:c}=o.getCurrentProject(e);(await i.fire({project:c,id:a.email,subject:a.subject,html:a.content})).some(d=>d===!1)},sendShortLink(a){return c=>c(a)}})}function _y(e){it(e)(st(e,"emailRawApi"),{getEmailRaw({emailId:t,secret_hash:n}){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Yt(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}function by(e,t){var n,r;o.requiredArgs(1,arguments);var i=Dl(e);if(isNaN(i.getTime()))throw new RangeError("Invalid time value");var a=String((n=t?.format)!==null&&n!==void 0?n:"extended"),c=String((r=t?.representation)!==null&&r!==void 0?r:"complete");if(a!=="extended"&&a!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(c!=="date"&&c!=="time"&&c!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var d="",u="",m=a==="extended"?"-":"",f=a==="extended"?":":"";if(c!=="time"){var g=Yt(i.getDate(),2),_=Yt(i.getMonth()+1,2),p=Yt(i.getFullYear(),4);d="".concat(p).concat(m).concat(_).concat(m).concat(g)}if(c!=="date"){var E=i.getTimezoneOffset();if(E!==0){var C=Math.abs(E),w=Yt(Math.floor(C/60),2),S=Yt(C%60,2),I=E<0?"+":"-";u="".concat(I).concat(w,":").concat(S)}else u="Z";var x=Yt(i.getHours(),2),Y=Yt(i.getMinutes(),2),Z=Yt(i.getSeconds(),2),M=d===""?"":"T",L=[x,Y,Z].join(f);d="".concat(d).concat(M).concat(L).concat(u)}return d}function vy(e){const t=it(e),n=st(e,"commentsApi"),r=o.commentsDataSourceProvider(e),i=r.byForeignKey("post"),{dispatch:a}=o.getStore(e);o.getDisposable(e).addDisposable(r.onChange(()=>a(n.util.invalidateTags(["Comments"])))),t(n,{getComments(c){return i.get(c).then(({data:d})=>d)},addComment({subjectId:c,author:d,parent:u,content:m,author_name:f,author_email:g,targetId:_}){const p={post:c,author:d,author_name:f,author_email:g,content:m,parent:u,target_id:_,date:by(new Date),author_avatar_urls:{}};return r.create(p)},deleteComment(c){return r.remove(c)},editComment({commentId:c,...d}){return r.update(c,d)},deleteTarget(c){return r.update(c,{target_id:""})}})}function jr(e){return{id:String(e),name:"",myRole:"",members:[],invites:[],emailsCount:0,blocksCount:0,title:"",group:[],folder:[],blockfolder:[]}}function hs(e,t){return{project:Number(e),app_id:t?.app_id||0,app_config:t?.app_config||{},user:t?.user}}function Ey(e,t){const n=jr(String(t)),r=o.getCurrentProject(e).card;return r&&String(r.id)===String(t)?Promise.resolve({...n,...r,id:String(t)}):Promise.resolve({...n,id:String(t)})}function Sy(e){let t,n;const r=i=>((t!==i||!n)&&(t=i,n=Ey(e,i)),n);it(e)(st(e,"projectsApi"),{getProjects(i={page:1}){return[]},getProject(i){return async a=>o.isStandaloneRuntime(e)?a(i):{...await r(i),id:String(i)}},addProject(i){throw new Error},async editProject({projectId:i,...a}){const c={...await r(i),...a,id:String(i)};return t=i,n=Promise.resolve(c),c},deleteProject(i){throw new Error},mutateProjectMembers(){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},addProjectMember(){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},getFrequentProjects(){return[]}})}function wy(e){let t={id:"0",username:"",email:"",password:"",code_editor:{},theme:"light",locale:o.getCurrentUser(e).profile?.locale,counters:{},avatar_urls:{},autosaves:!0};it(e)(st(e,"authorizationApi"),{getSchema:()=>n=>n({}),getMe:()=>t,editMe:n=>t={...t,...n},getSubscriptions:()=>[]})}function ky(e){it(e)(st(e,"notificationsApi"),{getNotifications(t){return[]},notificationShown({id:t,datetime:n}){throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Cy(e){it(e)(st(e,"addUserToProjectApi"),{addUserToProject:()=>{}})}function Ty(e){o.injectEmailTermsResolver(e,{resolve:async()=>{}}),it(e)(st(e,"taxonomiesApi"),{getTerms:()=>[],getStandardGroups:()=>[],addTerm:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},editTerm:t=>({id:t.id,name:t.name,parent:0,count:0}),deleteTerm:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Iy(e){it(e)(st(e,"projectSettingsV2Api"),{getProjectIntegrations:()=>({}),getProjectWebhook:()=>"",getProjectStorage:()=>({}),getProjectTestRecipients:()=>[],getIntegrationCredentials:()=>({}),putProjectIntegration:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},deleteProjectIntegration:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectWebhook:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectSettings:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},putProjectTestRecipients:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}function Ay(e){it(e)(st(e,"stripoImportApi"),{getStripoFolders:()=>[],getStripoItems:()=>({items:[],total:0}),getCurrentStripoImport:()=>null,getStripoImport:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},saveStripoKey:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)},startStripoImport:()=>{throw new Error(h.NOT_IMPLEMENTED_IN_PLUGIN)}})}var gs={addUserToProjectApiMock:Cy,AiApiMock:dy,authorizationApiMock:wy,blocksApiMock:fy,commentsApiMock:vy,emailsApiMock:hy,emailRawApiMock:_y,imageApiMock:py,notificationsApiMock:ky,projectsApiMock:Sy,projectSettingsV2ApiMock:Iy,proxyApiMock:uy,saveFileApiMock:yy,stripoImportApiMock:Ay,taxonomiesApiMock:Ty,tokenApiMock:my},Lr=o.createApi({reducerPath:"tokenApi",baseQuery:o.fetchBaseQueryApp({baseUrl:"https://app.emailmaker.ru/api/wp-json/jwt-auth/v1/"}),endpoints:e=>({tokenCreate:e.mutation({queryFn(t,n){return o.clientFromApi(n).jwtAuth.token_create({body:t,type:h.ContentType.Json})}}),tokenValidate:e.mutation({queryFn(t,n){return o.clientFromApi(n).jwtAuth.token_validate_create({type:h.ContentType.Json})}})})}),{useTokenCreateMutation:x0,useTokenValidateMutation:P0}=Lr;function Or(){const e=new Map;for(const t of ss)e.set(t.reducerPath,t);return e.set(Lr.reducerPath,Lr),[...e.values()]}function xy(e,t){const n=Object.keys(t.endpoints);n.length&&e(t,Object.fromEntries(n.map(r=>[r,iy])))}function Py(e){ay(e);const t=it(e);for(const n of Or())xy(t,n)}function Ry(e){if(!e)return;const t=h.decodeJwt(e)?.data,n=t?.data?.scope??t?.scope;return(Array.isArray(n)?n.flatMap(r=>typeof r=="string"?r.split(/\s+/):[]):typeof n=="string"?n.split(/\s+/):[]).find(r=>/^project_\d+$/.test(r))?.replace(/^project_/,"")||void 0}var jy={AiApi:new Set(["sendMessage","getDialog"]),imageApi:new Set(["sendAiImageRequest","getAiImage","getAiImageSSE"])};function Ly(e){return o.getAppConfig(h.getContainer(e))}function Oy(e){return e?.backendProxy!==void 0&&e?.backendProxyPolicy?.proxyAi===!0}function My(e){return Oy(Ly(e))}function Ny(e,t,n,r){return jy[t]?.has(n)?i=>My(e)?a=>a(i):r(i):r}function Dy(e){const t=it(e);return((n,r)=>{if(!n||typeof n.reducerPath!="string")return new h.Disposable;const i=Object.fromEntries(Object.entries(r??{}).map(([a,c])=>[a,typeof c=="function"?Ny(e,n.reducerPath,a,c):c]));return t(n,i)})}function Fy(e){const t=`blocks_${h.generateUUID().replaceAll("-","")}`,n=document.createElement("script");return n.type="text/javascript",n.text=`window.${t}(function(module, exports, require) { ${e}; })`,new Promise((r,i)=>{window[t]=function(a){const c={exports:{}},d=()=>{};a(c,c.exports,d),r(c.exports)},document.head.appendChild(n)}).finally(()=>{n.remove(),delete window[t]})}async function ys(e){const t=h.getContainer(e),n=t?.getInstance(h.STANDALONE_PROJECT_ID),r=n?void 0:await t?.getInstanceAsync(h.APP_ID).catch(()=>{}),i=n||(r?.project!==void 0?String(r.project):void 0);i&&t&&o.setCurrentProjectCard(t,jr(i))}async function By(e,t){try{const n=function(d){const u=e.getInstance(h.STANDALONE_PROJECT_ID),m=u?hs(u,d):d;e.injectFactory(h.APP_ID,async()=>m)},r=Dy(e),i=await o.readZipFromBase64(t),a=i.key&&o.zipEntryToText(i.key);if(typeof a!="string")return;const c=await Fy(a);if(typeof c!="object"||c===null||typeof c.execute!="function")return;c.execute(n,r,Or())}catch{}}async function _s(e,t){Py(h.getContainer(e)),await By(h.getContainer(e),t),ms(h.getContainer(e),gs)}var Uy=zn(async e=>{const t=Yg(e);e.inject(h.STORE_ID,t),Kg(e,Or()),Zg(e,t),o.getDisposable(e).addDisposable(Xg(e,t)),o.getDisposable(e).addDisposable(Qg(e,t));const n=h.getContainer(t);n&&(e.inject(h.MESSAGE_SERVICE_ID,o.getMessageService(n)),e.inject(o.CURRENT_PROJECT_ID,o.provideCurrentProject(n)));const r=e.getInstance(h.SECURITY_MODULE_ID);return r?(await _s(t,r),await ys(t)):ms(h.getContainer(t),gs),{instance:{}}}),bs=["historyEnabled","commentsEnabled","aiAssistentEnabled","livePreviewEnabled","sendTestEnabled","sharePreviewEnabled","webversionEnabled","optimizeSpamAssassinEnabled","exportWebHookEnabled","aiLayoutConverterEnabled","elementAIimageEnabled","elementAItextEnabled","revisionService"];function $y(e){const t={...e};for(const n of bs)t[n]=!1;return t}function zy(e){const t={...e};for(const n of bs)n in t&&typeof t[n]=="boolean"&&(t[n]=!1);return t}function Gy(e){if(!e||typeof e!="object"||Array.isArray(e))return;const t={};for(const[n,r]of Object.entries(e))!r||typeof r!="object"||Array.isArray(r)||(t[n]=zy(r));return Object.keys(t).length>0?t:void 0}function Mr(e){const t=$y(e),n=Gy(e.advancedConfigs),r={...t};return n?r.advancedConfigs=n:delete r.advancedConfigs,r}var R0=1,Wy=2592e6;function vs(){return"emailmaker".trim()||void 0}function Hy(e){return{schemaVersion:1,savedAt:Date.now(),project:e.project,app_id:e.app_id,app_config:Mr(Ss(e.app_config))}}function Es(e){return{...e,app_config:Ss(e.app_config)}}function Ss(e){if(!e||typeof e!="object"||Array.isArray(e))return{};try{if(typeof structuredClone=="function")return structuredClone(e)}catch{}try{return JSON.parse(JSON.stringify(e))}catch{return{}}}async function qy(e){const t=vs();t&&await Zy(t,Hy(e))}async function Vy(e=Date.now()){const t=vs();if(t)return e_(t,e)}function Yy(e,t=Date.now()){return e.savedAt>t?!1:t-e.savedAt<=Wy}function ws(e){if(!e||typeof e!="object")return!1;const t=e,n=typeof t.project=="number"&&Number.isFinite(t.project)||typeof t.project=="string"&&t.project.trim()!=="";return t.schemaVersion===1&&typeof t.savedAt=="number"&&Number.isFinite(t.savedAt)&&n&&typeof t.app_id=="number"&&Number.isFinite(t.app_id)&&t.app_config!=null&&typeof t.app_config=="object"&&!Array.isArray(t.app_config)}var jt="snapshots",Ky=1;function Qy(){return`${"emailmaker".trim()||"plugin"}-plugin-deferred-config`}function Mo(){return new Promise((e,t)=>{if(typeof indexedDB>"u"){t(new Error("indexedDB is not available"));return}const n=indexedDB.open(Qy(),Ky);n.onerror=()=>t(n.error||new Error("indexedDB open failed")),n.onupgradeneeded=()=>{const r=n.result;r.objectStoreNames.contains(jt)||r.createObjectStore(jt)},n.onsuccess=()=>e(n.result)})}function Xy(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error||new Error("indexedDB request failed"))})}function Jy(){return{async get(e){const t=await Mo();try{const n=await Xy(t.transaction(jt,"readonly").objectStore(jt).get(e));return n===void 0?void 0:n}finally{t.close()}},async put(e,t){const n=await Mo();try{const r=n.transaction(jt,"readwrite");r.objectStore(jt).put(t,e),await new Promise((i,a)=>{r.oncomplete=()=>i(),r.onerror=()=>a(r.error||new Error("indexedDB write failed")),r.onabort=()=>a(r.error||new Error("indexedDB write aborted"))})}finally{n.close()}},async delete(e){const t=await Mo();try{const n=t.transaction(jt,"readwrite");n.objectStore(jt).delete(e),await new Promise((r,i)=>{n.oncomplete=()=>r(),n.onerror=()=>i(n.error||new Error("indexedDB delete failed")),n.onabort=()=>i(n.error||new Error("indexedDB delete aborted"))})}finally{t.close()}},async clear(){const e=await Mo();try{const t=e.transaction(jt,"readwrite");t.objectStore(jt).clear(),await new Promise((n,r)=>{t.oncomplete=()=>n(),t.onerror=()=>r(t.error||new Error("indexedDB clear failed")),t.onabort=()=>r(t.error||new Error("indexedDB clear aborted"))})}finally{e.close()}}}}var ks,Nr;function Dr(){return ks||(Nr||(Nr=Jy()),Nr)}function Cs(e){Dr().delete(e).catch(()=>{})}async function Zy(e,t){if(ws(t))try{await Dr().put(e,Es(t))}catch{}}async function e_(e,t=Date.now()){try{const n=await Dr().get(e);if(n===void 0)return;if(!ws(n)){Cs(e);return}if(!Yy(n,t)){Cs(e);return}return Es(n)}catch{return}}function t_(e,t){if(e.getInstance(h.STANDALONE_FILE_PROXY_REGISTERED_ID))return;e.inject(h.STANDALONE_FILE_PROXY_REGISTERED_ID,!0);const n=h.getEvent(e,h.events.FILE_PROXY_EVENT_ID);t.addDisposable(n(async({url:r})=>(await fetch(r)).blob(),Number.MIN_VALUE))}function Ts(e){try{return Ry(e)||void 0}catch{return}}async function n_(e,t,n){if(!e)return;let r;try{const i=await e(t,n,void 0);r=String(i||"").trim()}catch{return}if(r)return{token:r,serverProjectId:Ts(r)}}function o_(e){if(e==null)return;const t=String(e).trim();return/^\d+$/.test(t)?t:void 0}function r_(e){const t=String(e.getInstance(h.JWT_TOKEN_ID)||"").trim();if(t)return Ts(t)}function Is(e,t,n){e.inject(h.APP_ID,void 0),e.inject(h.APP_ID,Promise.resolve(hs(t,n)))}function i_(e){return{app_id:e.app_id,app_config:Mr(e.app_config)}}async function As(){const e=await Vy();return e?i_(e):{app_config:Mr({})}}function a_(e,t){e.getInstance(h.STANDALONE_ACTIVATED_ID)||(e.inject(h.SECURITY_MODULE_ID,void 0),e.inject(h.STANDALONE_BOOTSTRAP_TOKEN_ID,void 0),e.inject(h.STANDALONE_PROJECT_ID,void 0),t&&e.inject(h.APP_ID,void 0),e.inject(h.STANDALONE_FILE_PROXY_REGISTERED_ID,void 0))}async function xs(e){const{container:t,store:n,standaloneKey:r,project:i,reason:a,getAuthToken:c,user:d}=e,u=e.disposable||t.getInstance(h.DISPOSABLE_ID);if(t.getInstance(h.STANDALONE_ACTIVATED_ID))return;const m=await n_(c,d,i),f=o_(i),g=m?.serverProjectId??r_(t)??(m?void 0:f);t.inject(h.SECURITY_MODULE_ID,r);let _=!1;try{if(m&&(t.inject(h.STANDALONE_BOOTSTRAP_TOKEN_ID,Promise.resolve(m.token)),c&&h.recreateTokenProvider(t,c,d,i)),g){const p=await As();t.inject(h.STANDALONE_PROJECT_ID,g),Is(t,g,p),_=!0,o.setCurrentProjectCard(t,jr(g))}if(await _s(n,r),_=!0,!g){await ys(n);const p=t.getInstance(h.STANDALONE_PROJECT_ID);if(p)Is(t,p,await As()),_=!0;else if(t.getInstance(h.APP_ID)!==void 0)try{(await t.getInstanceAsync(h.APP_ID))?.project==null}catch{}}u&&t_(t,u),t.inject(h.STANDALONE_ACTIVATED_ID,!0)}catch(p){throw a_(t,_),p}}async function s_(e,t,n,r){const i=r?.attemptTimeout??h.isFailoverEnabled(n),a=h.isFailoverEnabled(n)?h.getOrderedOriginCandidates(n):h.getOriginChain(n).length>0?[h.getActiveBaseUrl(n)]:[];if(a.length===0)throw new Error("[apiOriginFailover] no API base URL configured");const c=e.startsWith("/")?e:`/${e}`;let d,u;for(let m=0;m<a.length;m++){const f=a[m],g=m===a.length-1,_=i?h.beginFailoverAttempt(t.signal):void 0;try{const p=await fetch(`${f}${c}`,{...t,..._?{signal:_.signal}:{}});if(!p.ok&&h.shouldFailoverResponse(p.status)){if(d=p,!g){h.reportOriginFailure(f,n);continue}break}return p.ok&&h.reportOriginSuccess(f,n),p}catch(p){const E=_?.timeoutError();if(!E&&!h.shouldFailoverError(p))throw p;u=E||p,g||h.reportOriginFailure(f,n)}finally{_?.done()}}if(h.isFailoverEnabled(n)&&h.abandonStickyOrigin(),d)return d;throw u instanceof Error?u:new Error("[apiOriginFailover] fetch chain failed")}function l_(e,t){const n=String(t.baseUrl||"").trim();if(n)return h.resolveExplicitApiBaseUrl(n);const r=e.getInstance(h.REST_CLIENT_FACTORY_ID),i=String(r?.getOptions()?.baseUrl||"").trim();return h.resolveExplicitApiBaseUrl(i||void 0)}async function c_(e,t){if(t.getAuthToken)try{const n=await t.getAuthToken(t.user,t.project,void 0);if(String(n||"").trim())return!0}catch{if(!t.jwtAuth)return!1}if(t.jwtAuth)try{if(String(e.getInstance(h.JWT_TOKEN_ID)||"").trim())return!0;const n=l_(e,t);if(!n)return!1;const r=await s_("/jwt-auth/token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t.jwtAuth)},n,{attemptTimeout:!0});if(!r.ok)return!1;const i=await r.json();return i.token?(e.inject(h.JWT_ERROR_ID,void 0),e.inject(h.JWT_TOKEN_ID,i.token),!0):!1}catch{return!1}return!1}async function d_(e){try{if(e.getInstance(h.APP_ID)===void 0)return!1;const t=await m_(e.getInstanceAsync(h.APP_ID));return t!=null&&t.project!=null?t:!1}catch{return!1}}function u_(){return h.getFailoverAttemptTimeoutMs()*Math.max(1,h.getOriginChain().length)}function m_(e){const t=u_();return new Promise((n,r)=>{const i=setTimeout(()=>{n(void 0)},t);e.then(a=>{clearTimeout(i),n(a)},a=>{clearTimeout(i),r(a)})})}function Ps(e){return String(e.standaloneKey||"").trim()||void 0}function p_(e){return e.standaloneOnAuthFailure===!0?!0:e.config?.standaloneOnAuthFailure===!0}function f_(e){return p_(e)?!!Ps(e):!1}var h_=zn(async e=>{const t=e.getInstance(h.DISPOSABLE_ID),n=()=>e.getInstanceAsync(h.STORE_ID);return{async setOptions(r){if(!f_(r)){e.getInstance(h.STANDALONE_ACTIVATED_ID);return}const i=Ps(r);if(!i||e.getInstance(h.STANDALONE_ACTIVATED_ID))return;const a=await n(),c=!!(r.getAuthToken||r.jwtAuth),d=c?await c_(e,r):!0;if(c&&!d){await xs({container:e,store:a,standaloneKey:i,project:r.project,getAuthToken:r.getAuthToken,user:r.user,disposable:t,reason:"auth pipeline failed"});return}const u=await d_(e);if(u){await qy(u).catch(()=>{});return}await xs({container:e,store:a,standaloneKey:i,project:r.project,getAuthToken:r.getAuthToken,user:r.user,disposable:t,reason:"app_init failed"})}}}),g_=h.defineMixin(e=>{let t;const n=o.getDisposable(e),r=h.getEvent(e,h.events.ON_DOCUMENT_SESSION_CHANGE);n.addDisposable(r(({history:a})=>{t=a}));const i=()=>t?Fi(t):void 0;return{instance:{undoRedoService:{undo:()=>i()?.undo(),redo:()=>i()?.redo(),clear:()=>i()?.clear(),getPast:a=>i()?.getPast(a)??[],getFuture:a=>i()?.getFuture(a)??[],canUndo:()=>i()?.canUndo()??!1,canRedo:()=>i()?.canRedo()??!1,createSnapshot:()=>i()?.createSnapshot(),restoreSnapshot:a=>i()?.restoreSnapshot(a)}}}});function y_(e){return{font_size:e.fontSize,font_family:e.fontFamily,tab_size:e.tabSize,word_wrap:e.wordWrap,minimap:e.minimap,insert_spaces:e.insertSpaces}}function __(e){return{fontSize:e.fontSize,fontFamily:e.fontFamily,tabSize:e.tabSize,wordWrap:e.wordWrap!=="off",minimap:e.minimap?.enabled,insertSpaces:e.insertSpaces}}async function Rs(e){const t=o.getCurrentUser(e).profile;if(t)return t;const n=e.getInstance(h.STORE_ID);if(n)return(await n.dispatch(o.authorizationApi.endpoints.getMe.initiate("",{forceRefetch:!0}))).data}function b_(e){const t=o.resolveTemplateDirectivesConfig(e);if(!(Object.keys(t.output).length>0||Object.keys(t.editor).length>0))return ga();const n=new Set(Object.keys(t.output).filter(i=>t.output[i]==="html-comment")),r=new Set(Object.keys(t.output));return{isConfigured:()=>!0,toEditorForm:i=>o.mapper.normalizeToPolicy(i,t.editor),toOutputForm:i=>o.mapper.normalizeToPolicy(i,t.output),keepWrappedOnOutput:n,editorPolicy:t.editor,warnAboutUnconfiguredInput:ha(r)}}function js(e){const t=o.getCodeMode(e);return{...No(e),editor:__(o.getEditorOptions(e)),codeModeDirection:t.isCodeMode?t.direction:"none"}}function No(e){return e.getInstance(h.CONFIG_SOURCE_ID)?.get()??{}}function Fr(e){return e.getInstance(h.CONFIG_SOURCE_ID)?.layers()??{base:{},profile:{},serverSide:{},user:{},local:{},advancedConfigs:{}}}var v_=br(e=>{const t=o.getDisposable(e),n=Ct(o.getEvent(e,h.events.ON_LIMIT_ID)),r=t.addDisposable(new kt(n)),i=Ct(o.getEvent(e,h.events.READ_LOCALE)),a=t.addDisposable(new kt(i)),c=Ct(o.getEvent(e,h.events.ON_TRANSLATE_ID)),d=t.addDisposable(new kt(c)),u=o.getEmitter(e,h.CONFIG_CHANGED_EVENT_ID),m=async()=>{try{return e.getInstance(h.APP_ID)===void 0?{}:(await e.getInstanceAsync(h.APP_ID))?.app_config||{}}catch{return{}}},f=$a(),g=$a();let _,p=!1,E;const C=async()=>{const A=js(e);if(!p){E=h.deepClone(A),p=!0;return}E!==void 0&&h.deepEqual(E,A)||(E=h.deepClone(A),await u.fire(A))},w=A=>{if(typeof A=="number")return String(A);if(typeof A=="string")return A},S=A=>{if(A!==void 0){const j=o.provideCurrentProject(e);j.set({...j.get(),requested:String(A)})}},I=async(A,j)=>{if(!A){const ee=await Rs(e);return _=w(ee?.id),{didReset:!1}}const z=await Rs(e),B=A.id!==void 0?w(A.id):w(z?.id),$=_!==void 0?String(_):void 0,de=B!==void 0?String(B):void 0,pe=$!==void 0&&de!==void 0&&$!==de,q={...z,...o.filterUndefined(A),id:B};if(A.id===void 0&&!z?.id&&delete q.id,o.provideCurrentUser(e).set({profile:q}),pe&&j){const ee=e.getInstance(h.INSTANCE_ID);if(ee?.reset)return await ee.reset(j),{didReset:!0}}return _=de,{didReset:!1}},x=A=>{const j=e.getInstance(h.CONFIG_SOURCE_ID);j?.setAdvancedConfigs({...A.advancedConfigs,...A.user?.advancedConfigs}),j?.replace(A.user,"user"),j?.replace(A.serverSide,"server")},Y=async()=>{await e.getInstance(h.CONFIG_SOURCE_ID)?.ready(),o.getRevisionServiceFlag(e).set(No(e).revisionService===!0);const{codeModeDirection:A,editor:j}=No(e);j&&o.applyEditorOptions(e,y_(j)),A!==void 0&&(A==="none"?o.setCodeMode$1(e,!1):(o.setCodeMode$1(e,!0),o.setCodeModeDirection(e,A)))},Z=async A=>{x(A),await Y()};let M;const L=f.decorate(async({config:A={},project:j,user:z,advancedConfigs:B},$)=>{e.getInstance(h.CONFIG_SOURCE_ID)?.replace(await m(),"server"),await Y(),e.inject(h.TEMPLATE_DIRECTIVES_ID,b_(No(e).templateDirectives)),S(j),$&&"commonStyles"in $&&o.setDefaultCommonStyles(e,$.commonStyles===void 0?void 0:$.commonStyles);const{didReset:de}=await I(z,$)});return{setOptions:g.decorate(async A=>{const{config:j={},project:z,user:B,advancedConfigs:$,handleReadLocale:de,handleLimitUsage:pe,handleTranslate:q,storageProvider:ee}=A;e.inject(h.STORAGE_PROVIDER_ID,ee),a.setListener(de),r.setListener(pe),d.setListener(q),await L({config:j,project:z,user:B,advancedConfigs:$},A).catch(Fe=>{}),await C(),M&&M.dispose(),M=new h.Disposable}),instance:{setConfig:g.decorate(async A=>{const j=A,{commonStyles:z,...B}=j;"commonStyles"in j&&o.setDefaultCommonStyles(e,z===void 0?void 0:z),await Z({advancedConfigs:Fr(e).advancedConfigs,serverSide:await m(),user:B}),await C()}),getConfig:()=>js(e),updateConfig:g.decorate(async A=>{const j=A,{commonStyles:z,...B}=j;"commonStyles"in j&&o.setDefaultCommonStyles(e,z===void 0?void 0:z),await Z({advancedConfigs:Fr(e).advancedConfigs,serverSide:await m(),user:{...Fr(e).user,...B}}),await C()}),handleReadLocale:i,handleLimitUsage:n,handleTranslate:c}}}),Do;function Br(){return Do===void 0&&(Do=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/1c31ec91.js")),void 0,{}.url).catch(e=>{throw Do=void 0,e})),Do}var Ls;function E_(){return Ls??=(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/370f04c3.js")).then(e=>zt.__toESM(e.require_core())),void 0,{}.url),Ls}function S_(e){const t=[0],n=[];let r=0;for(;r<e.length;){const i=e.charCodeAt(r);i===10||i===13?(n.push(r-t[t.length-1]),r+=i===13&&e.charCodeAt(r+1)===10?2:1,t.push(r)):r+=1}return n.push(e.length-t[t.length-1]),{starts:t,lengths:n}}function Os({starts:e,lengths:t},n,r){const i=Math.min(Math.max(n,1),e.length)-1;return e[i]+Math.min(Math.max(r,1),t[i]+1)-1}var w_={error:8,warning:4,info:2};function k_(e,t){const n=e.evidence!==""?e.col+e.evidence.length:t.lengths[e.line-1]??e.col+1;return{severity:w_[e.type]??8,message:e.message,startLineNumber:e.line,startColumn:e.col,endLineNumber:e.line,endColumn:n,startOffset:Os(t,e.line,e.col),endOffset:Os(t,e.line,n)}}async function C_(e){const{HTMLHint:t}=await E_(),n=S_(e);return t.verify(e,o.EMAIL_CODE_RULESET).map(r=>k_(r,n))}var T_=class extends h.Disposable{_container;_dataSources;_currentEmail;_blockMetaWrites=Promise.resolve();constructor(e){super(),this._container=e,this._dataSources=o.getDataSources(e),this.addDisposable(h.getEvent(e,h.events.ON_EMAIL_CHANGED_ID)(t=>{this._currentEmail=t}))}async getBlocks(){const e=await this._readProjectBlocks();return await this._blockMetaWrites,(await this._dataSources.blocks.cache.values()).filter(t=>t.project===e).map(t=>zh(t,this._container))}async _readProjectBlocks(){const e=await o.getBlocksProject(this._container);return await this._dataSources.blocks.byForeignKey("project").get(e),e}async getComments(){const{cache:e}=this._dataSources.comments,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.post===t.id).map(n=>Gh(n,this._container))}async getEmailRevisions(){const{cache:e}=this._dataSources.emailRevisions,t=await this.getEmailSnapshot();return(await e.values()).filter(n=>n.parent===t.id).map(n=>Wh(n,this._container))}async getEmailSnapshot(){return Qm(o.getOpenEmail(this._container,this._currentEmail),this._container)}async getEmail(e=!0){return this.compile(e)}async compileEmail(e=!0){return this.compile(e)}async compile(e){const{compileEmail:t}=await Br();return t(await this.getEmailSnapshot(),e,rn(this._container).keepWrappedOnOutput)}setEmailMeta(e){const t=o.getOpenDocument(this._container);if(!t)return;const n=t.get().attributes.meta;o.writeEmailAttributes(t,{meta:o.applyMetaPatch({meta:n},e).meta});const r=t.get().serverId;r!=null&&this._dataSources.emails.cache.addOrUpdate(r,i=>i&&o.applyMetaPatch(i,e))}setBlockMeta(e,t){const n=async()=>{await this._readProjectBlocks();const{cache:r}=this._dataSources.blocks;await r.getIfPresent(e)&&await r.addOrUpdate(e,i=>i&&o.applyMetaPatch(i,t))};this._blockMetaWrites=this._blockMetaWrites.then(n).catch(()=>{})}getCodeErrors(){const e=o.getCodeErrors(this._container);return e.length>0?e:void 0}validateCode(){return Promise.resolve(C_(o.getOpenEmail(this._container,this._currentEmail).html??""))}};function Ms(){Br().catch(()=>{})}function I_(e){const t=o.provideHeadlessMode(e).watch(n=>{n&&Ms()});e.getInstance(h.DISPOSABLE_ID)?.addDisposable(t),Ht(e).whenVisible(()=>{Xt(Ms)})}var A_=h.createIdentifier$1("EmailOperationsController");function Ns(e){return e.getOrCreateInstance(A_,()=>{const t=new T_(e);return e.getInstance(h.DISPOSABLE_ID)?.addDisposable(t),t})}function x_(e){Ns(e),I_(e)}function P_(e){const t=Ns(e);return{getEmailSnapshot:()=>t.getEmailSnapshot(),getEmail:()=>t.getEmail(),async compileEmail(n,r=!0){if(!n)return t.compileEmail(r);const{compileEmail:i}=await Br();return i(n,r,rn(e).keepWrappedOnOutput)},validateCode:()=>t.validateCode(),getCodeErrors:()=>t.getCodeErrors(),getBlocks:()=>t.getBlocks(),getComments:()=>t.getComments(),getEmailRevisions:()=>t.getEmailRevisions(),setEmailMeta:n=>t.setEmailMeta(n),setBlockMeta:(n,r)=>t.setBlockMeta(n,r)}}var R_=h.defineMixin(e=>{const t=e.getInstance(h.DISPOSABLE_ID),n=h.getEvent(e,h.events.UPLOAD_EVENT_ID),r=h.getEvent(e,h.events.FILE_PROXY_EVENT_ID),i=h.getEmitter(e,h.events.PROXY_URL_EVENT_ID).event,a=Ct(n),c=Ct(i),d=Ct(r),u=t.addDisposable(new kt(a)),m=t.addDisposable(new kt(d)),f=t.addDisposable(new kt(c));return{setOptions(g){u.setListener(g.handleLoadImage),m.setListener(g.handleFileProxy),f.setListener(g.handleUrlProxy)},instance:{handleLoadImage:a,handleFileProxy:d,handleUrlProxy:c}}}),j_=h.defineMixin(e=>{const t=e.getInstance(h.DISPOSABLE_ID),n=h.getEvent(e,h.events.AI_TEXT_REQUEST_ID),r=h.getEvent(e,h.events.AI_IMAGE_REQUEST_ID),i=Ct(n),a=Ct(r),c=t.addDisposable(new kt(i)),d=t.addDisposable(new kt(a));return{setOptions(u){c.setListener(u.handleAITextRequest),d.setListener(u.handleAIImageRequest)},instance:{handleAITextRequest:i,handleAIImageRequest:a}}}),L_=class extends Error{cycle;constructor(e){super(`[units] цикл в зависимостях: ${e.join(" → ")}`),this.cycle=e}};function O_(e){const t=new Map;for(const n of e)for(const r of n.provides??[]){const i=t.get(r)??[];i.push(n),t.set(r,i)}return t}function M_(e,t){const n=[];for(const r of e.awaits?.services??[])for(const i of t.get(r)??[])i!==e&&n.push(i);return n}function N_(e){const t=O_(e),n=[],r=new Set,i=[],a=new Set,c=d=>{if(!r.has(d)){if(a.has(d)){const u=i.indexOf(d);throw new L_([...i.slice(u),d].map(m=>m.name))}a.add(d),i.push(d);for(const u of M_(d,t))c(u);i.pop(),a.delete(d),r.add(d),n.push(d)}};for(const d of e)c(d);return n}var D_="author,slug,date,modified,title,acf.html,id,parent,date_gmt",F_="author,slug,date,modified,modified_gmt,title,acf.html,id,parent",B_=20,Ur=[h.WpEblockApi];function Ds(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}function U_(e){return{async readRevisions(t,n=1){const r=await h.getApi(e,Ur).eblock_revisions_list({parent:t,per_page:B_,page:n},{extraQuery:{_fields:D_}}),i=(r?.data??[]).map(c=>o.WpBlockRevisionToBlockRevision(c)),a=Number(r?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=h.getApi(e,Ur),[r,i]=await Promise.all([n.eblock_autosaves_list({id:t},{extraQuery:{_fields:F_}}),n.eblock_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(r?.data??[]).map(d=>{const u=d,m=o.WpBlockRevisionToBlockRevision(u),f=Ds(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse(Ds(i?.data?.modified_gmt)??"");return o.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const r=n,i=r.global_block&&r.html?o.injectEmBlockIdIntoBlockHtml(r.html,t):r.html??"";o.writePendingData(t,{sentAt:Date.now(),html:i,common_styles:""});const a=await h.getApi(e,Ur).eblock_autosaves_create({id:t},o.BlockAutoSaveToWpBlockAutoSave({title:r.title,html:i,project:r.project,excerpt:new Date().toISOString()}),{type:h.ContentType.FormData});return o.WpBlockRevisionToBlockRevision(a?.data)}}}var $_="author,slug,date,modified,title,meta,acf.html,acf.common_styles,id,parent,date_gmt",z_="author,slug,date,modified,modified_gmt,title,meta,acf.html,acf.common_styles,id,parent";function Fs(e){return typeof e=="string"&&e?`${e.replace(/Z$/,"")}Z`:void 0}var G_=20,$r=[h.WpEmailApi];function W_(e){return{async readRevisions(t,n=1){const r=await h.getApi(e,$r).email_revisions_list({parent:t,per_page:G_,page:n},{extraQuery:{_fields:$_}}),i=(r?.data??[]).map(c=>o.WpEmailRevisionToEmailRevision(c)),a=Number(r?.headers?.get("X-WP-TotalPages"));return{revisions:i,page:n,hasMore:Number.isFinite(a)&&n<a}},async readAutosave(t){const n=h.getApi(e,$r),[r,i]=await Promise.all([n.email_autosaves_list({id:t},{extraQuery:{_fields:z_}}),n.email_detail({id:t},{extraQuery:{_fields:"modified_gmt"}})]),a=(r?.data??[]).map(d=>{const u=d,m=o.WpEmailRevisionToEmailRevision(u),f=Fs(u.modified_gmt);return f?{...m,modified:f}:m}),c=Date.parse(Fs(i?.data?.modified_gmt)??"");return o.autosaveStateFromSlots(a,Number.isFinite(c)?c:void 0)},async saveAutosave(t,n){const r=await h.getApi(e,$r).email_autosaves_create({id:t},o.EmailAutoSaveToWpEmailAutoSave({...n,excerpt:new Date().toISOString()}),{type:h.ContentType.FormData});return o.WpEmailRevisionToEmailRevision(r?.data)}}}var Bs=["_embedded","id","author","title","meta","emailtags","folder","group","modified","date","type","parent","date_gmt","acf.description","acf.html","acf.common_styles","acf.is_template","acf.lock","acf.parent_email","acf.project","acf.secret_hash","acf.subject","acf.utm_parameters"].join(","),zr=[h.WpEmailApi],Us=e=>o.EmailToWpEmail(e);function H_(e){return{async readEmail(t){const n=await h.getApi(e,zr).email_detail({id:o.toNumberSafe(t)},{extraQuery:{_embed:"wp:term",_fields:Bs}});if(!n)throw new o.EmailOpenFailedError("unavailable");if(n.ok===!1)throw o.openFailureFromResponse(n);return n.data?o.WpEmailToEmail(n.data):null},async createEmail(t){const n={status:"publish",...Us(t)},r=await h.getApi(e,zr).email_create(n,{type:h.ContentType.Json});return o.WpEmailToEmail(r?.data)},async updateEmail(t,n){const r=await h.getApi(e,zr).email_partial_update({id:t},Us(n),{type:h.ContentType.Json,extraQuery:{_embed:"wp:term",_fields:Bs}});return o.WpEmailToEmail(r?.data)}}}function q_(e){o.injectRestEmailPortFactories(e,{email:H_,history:W_,blockHistory:U_})}var Gr=20,V_=({source:e,emailtags:t,group:n,tags:r,...i})=>i;function Y_({revisions:e,revisionsByBlock:t}){const n=async(r,i)=>(t.clear(),await t.get(r,{page:i}),(await e.cache.values()??[]).filter(a=>String(a?.parent)===String(r)));return{async readRevisions(r,i=1){const a=await n(r,i);return{revisions:a.slice(Gr*(i-1),Gr*i),page:i,hasMore:a.length>Gr*i}},async readAutosave(r){return o.autosaveStateFromRevisions(await n(r,1))},async saveAutosave(r,i){const a=V_(i);return await e.create({...a,parent:r,modified:new Date().toString()})}}}var $s=h.createIdentifier$1("blockDocuments.provided");function K_(e){if(e.getInstance($s))return;e.inject($s,!0);const t=o.blockRevisionsDataSourceProvider(e);o.injectBlockHistoryPort(e,Y_({revisions:t,revisionsByBlock:t.byForeignKey("parent")}))}var Q_=zt.__commonJSMin(((e,t)=>{(function(n){if(typeof window>"u")return;var r=0,i,a=!1,c=!1,d=7,u="[iFrameSizer]",m=u.length,f=null,g=window.requestAnimationFrame,_=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),p={},E=null,C=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){j("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}});function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function S(k,T,P){k.addEventListener(T,P,!1)}function I(k,T,P){k.removeEventListener(T,P,!1)}function x(){for(var k=["moz","webkit","o","ms"],T=0;T<k.length&&!g;T+=1)g=window[k[T]+"RequestAnimationFrame"];g?g=g.bind(window):L("setup","RequestAnimationFrame not supported")}function Y(k){var T="Host page: "+k;return window.top!==window.self&&(T=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+k:"Nested host page: "+k),T}function Z(k){return u+"["+Y(k)+"]"}function M(k){return p[k]?p[k].log:a}function L(k,T){z("log",k,T,M(k))}function A(k,T){z("info",k,T,M(k))}function j(k,T){z("warn",k,T,!0)}function z(k,T,P,N){N===!0&&window.console}function B(k){function T(){function U(){et(ie),ee(te),We("onResized",ie)}b("Height"),b("Width"),Ee(U,ie,"init")}function P(){var U=Xe.slice(m).split(":"),le=U[1]?parseInt(U[1],10):0,xe=p[U[0]]&&p[U[0]].iframe,Se=getComputedStyle(xe);return{iframe:xe,id:U[0],height:le+N(Se)+D(Se),width:U[2],type:U[3]}}function N(U){return U.boxSizing!=="border-box"?0:(U.paddingTop?parseInt(U.paddingTop,10):0)+(U.paddingBottom?parseInt(U.paddingBottom,10):0)}function D(U){return U.boxSizing!=="border-box"?0:(U.borderTopWidth?parseInt(U.borderTopWidth,10):0)+(U.borderBottomWidth?parseInt(U.borderBottomWidth,10):0)}function b(U){var le=Number(p[te]["max"+U]),xe=Number(p[te]["min"+U]),Se=U.toLowerCase(),Ne=Number(ie[Se]);L(te,"Checking "+Se+" is in range "+xe+"-"+le),Ne<xe&&(Ne=xe,L(te,"Set "+Se+" to min value")),Ne>le&&(Ne=le,L(te,"Set "+Se+" to max value")),ie[Se]=""+Ne}function W(){function U(){function Se(){var He=0,Ue=!1;for(L(te,"Checking connection is from allowed list of origins: "+xe);He<xe.length;He++)if(xe[He]===le){Ue=!0;break}return Ue}function Ne(){var He=p[te]&&p[te].remoteHost;return L(te,"Checking connection is from: "+He),le===He}return xe.constructor===Array?Se():Ne()}var le=k.origin,xe=p[te]&&p[te].checkOrigin;if(xe&&""+le!="null"&&!U())throw new Error("Unexpected message received from: "+le+" for "+ie.iframe.id+". Message was: "+k.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}function Pe(){return u===(""+Xe).slice(0,m)&&Xe.slice(m).split(":")[0]in p}function Ae(){var U=ie.type in{true:1,false:1,undefined:1};return U&&L(te,"Ignoring init message from meta parent page"),U}function Qe(U){return Xe.slice(Xe.indexOf(":")+d+U)}function Ge(U){L(te,"onMessage passed: {iframe: "+ie.iframe.id+", message: "+U+"}"),We("onMessage",{iframe:ie.iframe,message:JSON.parse(U)}),L(te,"--")}function Ze(){var U=document.body.getBoundingClientRect(),le=ie.iframe.getBoundingClientRect();return JSON.stringify({iframeHeight:le.height,iframeWidth:le.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(le.top-U.top,10),offsetLeft:parseInt(le.left-U.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})}function mt(U,le){function xe(){fe("Send Page Info","pageInfo:"+Ze(),U,le)}Ce(xe,32,le)}function vt(){function U(Ne,He){function Ue(){p[Se]?mt(p[Se].iframe,Se):le()}["scroll","resize"].forEach(function(rt){L(Se,Ne+rt+" listener for sendPageInfo"),He(window,rt,Ue)})}function le(){U("Remove ",I)}function xe(){U("Add ",S)}var Se=te;xe(),p[Se]&&(p[Se].stopPageInfo=le)}function ft(){p[te]&&p[te].stopPageInfo&&(p[te].stopPageInfo(),delete p[te].stopPageInfo)}function lt(){var U=!0;return ie.iframe===null&&(j(te,"IFrame ("+ie.id+") not found"),U=!1),U}function G(U){var le=U.getBoundingClientRect();return q(te),{x:Math.floor(Number(le.left)+Number(f.x)),y:Math.floor(Number(le.top)+Number(f.y))}}function K(U){function le(){f=He,ne(),L(te,"--")}function xe(){return{x:Number(ie.width)+Ne.x,y:Number(ie.height)+Ne.y}}function Se(){window.parentIFrame?window.parentIFrame["scrollTo"+(U?"Offset":"")](He.x,He.y):j(te,"Unable to scroll to requested position, window.parentIFrame not found")}var Ne=U?G(ie.iframe):{x:0,y:0},He=xe();L(te,"Reposition requested from iFrame (offset x:"+Ne.x+" y:"+Ne.y+")"),window.top===window.self?le():Se()}function ne(){We("onScroll",f)===!1?Fe():ee(te)}function ue(U){function le(){var Ue=G(He);L(te,"Moving to in page link (#"+Se+") at x: "+Ue.x+" y: "+Ue.y),f={x:Ue.x,y:Ue.y},ne(),L(te,"--")}function xe(){window.parentIFrame?window.parentIFrame.moveToAnchor(Se):L(te,"In page link #"+Se+" not found and window.parentIFrame not found")}var Se=U.split("#")[1]||"",Ne=decodeURIComponent(Se),He=document.getElementById(Ne)||document.getElementsByName(Ne)[0];He?le():window.top===window.self?L(te,"In page link #"+Se+" not found"):xe()}function ge(U){var le={};if(Number(ie.width)===0&&Number(ie.height)===0){var xe=Qe(9).split(":");le={x:xe[1],y:xe[0]}}else le={x:ie.width,y:ie.height};We(U,{iframe:ie.iframe,screenX:Number(le.x),screenY:Number(le.y),type:ie.type})}function We(U,le){return $(te,U,le)}function Ve(){switch(p[te]&&p[te].firstRun&&Me(),ie.type){case"close":pe(ie.iframe);break;case"message":Ge(Qe(6));break;case"mouseenter":ge("onMouseEnter");break;case"mouseleave":ge("onMouseLeave");break;case"autoResize":p[te].autoResize=JSON.parse(Qe(9));break;case"scrollTo":K(!1);break;case"scrollToOffset":K(!0);break;case"pageInfo":mt(p[te]&&p[te].iframe,te),vt();break;case"pageInfoStop":ft();break;case"inPageLink":ue(Qe(9));break;case"reset":ve(ie);break;case"init":T(),We("onInit",ie.iframe);break;default:Number(ie.width)===0&&Number(ie.height)===0?j("Unsupported message received ("+ie.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):T()}}function at(U){var le=!0;return p[U]||(le=!1,j(ie.type+" No settings for "+U+". Message was: "+Xe)),le}function Bt(){for(var U in p)fe("iFrame requested init",Q(U),p[U].iframe,U)}function Me(){p[te]&&(p[te].firstRun=!1)}var Xe=k.data,ie={},te=null;Xe==="[iFrameResizerChild]Ready"?Bt():Pe()?(ie=P(),te=ie.id,p[te]&&(p[te].loaded=!0),!Ae()&&at(te)&&(L(te,"Received: "+Xe),lt()&&W()&&Ve())):A(te,"Ignored: "+Xe)}function $(k,T,P){var N=null,D=null;if(p[k])if(N=p[k][T],typeof N=="function")D=N(P);else throw new TypeError(T+" on iFrame["+k+"] is not a function");return D}function de(k){var T=k.id;delete p[T]}function pe(k){var T=k.id;if($(T,"onClose",T)===!1){L(T,"Close iframe cancelled by onClose event");return}L(T,"Removing iFrame: "+T);try{k.parentNode&&k.parentNode.removeChild(k)}catch(P){j(P)}$(T,"onClosed",T),L(T,"--"),de(k),i&&(i.disconnect(),i=null)}function q(k){f===null&&(f={x:window.pageXOffset===n?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===n?document.documentElement.scrollTop:window.pageYOffset},L(k,"Get page position: "+f.x+","+f.y))}function ee(k){f!==null&&(window.scrollTo(f.x,f.y),L(k,"Set page position: "+f.x+","+f.y),Fe())}function Fe(){f=null}function ve(k){function T(){et(k),fe("reset","reset",k.iframe,k.id)}L(k.id,"Size reset requested by "+(k.type==="init"?"host page":"iFrame")),q(k.id),Ee(T,k,"reset")}function et(k){function T(b){if(!k.id){L("undefined","messageData id not set");return}k.iframe.style[b]=k[b]+"px",L(k.id,"IFrame ("+D+") "+b+" set to "+k[b]+"px")}function P(b){!c&&k[b]==="0"&&(c=!0,L(D,"Hidden iFrame detected, creating visibility listener"),Be())}function N(b){T(b),P(b)}var D=k.iframe.id;p[D]&&(p[D].sizeHeight&&N("height"),p[D].sizeWidth&&N("width"))}function Ee(k,T,P){P!==T.type&&g&&!window.jasmine?(L(T.id,"Requesting animation frame"),g(k)):k()}function fe(k,T,P,N,D){function b(){var Ge=p[N]&&p[N].targetOrigin;L(N,"["+k+"] Sending msg to iframe["+N+"] ("+T+") targetOrigin: "+Ge),P.contentWindow.postMessage(u+T,Ge)}function W(){j(N,"["+k+"] IFrame("+N+") not found")}function Pe(){P&&"contentWindow"in P&&P.contentWindow!==null?b():W()}function Ae(){function Ge(){p[N]&&!p[N].loaded&&!Qe&&(Qe=!0,j(N,"IFrame has not responded within "+p[N].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}D&&p[N]&&p[N].warningTimeout&&(p[N].msgTimeout=setTimeout(Ge,p[N].warningTimeout))}var Qe=!1;N=N||P.id,p[N]&&(Pe(),Ae())}function Q(k){return k+":"+p[k].bodyMarginV1+":"+p[k].sizeWidth+":"+p[k].log+":"+p[k].interval+":"+p[k].enablePublicMethods+":"+p[k].autoResize+":"+p[k].bodyMargin+":"+p[k].heightCalculationMethod+":"+p[k].bodyBackground+":"+p[k].bodyPadding+":"+p[k].tolerance+":"+p[k].inPageLinks+":"+p[k].resizeFrom+":"+p[k].widthCalculationMethod+":"+p[k].mouseEvents}function me(k){return typeof k=="number"}function ae(k,T){function P(){function K(ue){var ge=p[G][ue];ge!==1/0&&ge!==0&&(k.style[ue]=me(ge)?ge+"px":ge,L(G,"Set "+ue+" = "+k.style[ue]))}function ne(ue){if(p[G]["min"+ue]>p[G]["max"+ue])throw new Error("Value for min"+ue+" can not be greater than max"+ue)}ne("Height"),ne("Width"),K("maxHeight"),K("minHeight"),K("maxWidth"),K("minWidth")}function N(){var K=T&&T.id||C.id+r++;return document.getElementById(K)!==null&&(K+=r++),K}function D(K){if(typeof K!="string")throw new TypeError("Invaild id for iFrame. Expected String");return K===""&&(k.id=K=N(),a=(T||{}).log,L(K,"Added missing iframe ID: "+K+" ("+k.src+")")),K}function b(){switch(L(G,"IFrame scrolling "+(p[G]&&p[G].scrolling?"enabled":"disabled")+" for "+G),k.style.overflow=(p[G]&&p[G].scrolling)===!1?"hidden":"auto",p[G]&&p[G].scrolling){case"omit":break;case!0:k.scrolling="yes";break;case!1:k.scrolling="no";break;default:k.scrolling=p[G]?p[G].scrolling:"no"}}function W(){(typeof(p[G]&&p[G].bodyMargin)=="number"||(p[G]&&p[G].bodyMargin)==="0")&&(p[G].bodyMarginV1=p[G].bodyMargin,p[G].bodyMargin=""+p[G].bodyMargin+"px")}function Pe(){var K=p[G]&&p[G].firstRun,ne=p[G]&&p[G].heightCalculationMethod in _;!K&&ne&&ve({iframe:k,height:0,width:0,type:"init"})}function Ae(){p[G]&&(p[G].iframe.iFrameResizer={close:pe.bind(null,p[G].iframe),removeListeners:de.bind(null,p[G].iframe),resize:fe.bind(null,"Window resize","resize",p[G].iframe),moveToAnchor:function(K){fe("Move to anchor","moveToAnchor:"+K,p[G].iframe,G)},sendMessage:function(K){K=JSON.stringify(K),fe("Send Message","message:"+K,p[G].iframe,G)}})}function Qe(K){function ne(){fe("iFrame.onload",K,k,n,!0),Pe()}function ue(We){if(!k.parentNode)return null;var Ve=new We(function(at){at.forEach(function(Bt){Array.prototype.slice.call(Bt.removedNodes).forEach(function(Me){Me===k&&pe(k)})})});return Ve.observe(k.parentNode,{childList:!0}),Ve}var ge=w();ge&&(i=ue(ge)),S(k,"load",ne),fe("init",K,k,n,!0)}function Ge(K){if(typeof K!="object")throw new TypeError("Options is not an object")}function Ze(K){for(var ne in C)Object.prototype.hasOwnProperty.call(C,ne)&&(p[G][ne]=Object.prototype.hasOwnProperty.call(K,ne)?K[ne]:C[ne])}function mt(K){return K===""||K.match(/^(about:blank|javascript:|file:\/\/)/)!==null?"*":K}function vt(K){var ne=K.split("Callback");if(ne.length===2){var ue="on"+ne[0].charAt(0).toUpperCase()+ne[0].slice(1);this[ue]=this[K],delete this[K],j(G,"Deprecated: '"+K+"' has been renamed '"+ue+"'. The old method will be removed in the next major version.")}}function ft(K){K=K||{},p[G]=Object.create(null),p[G].iframe=k,p[G].firstRun=!0,p[G].remoteHost=k.src&&k.src.split("/").slice(0,3).join("/"),Ge(K),Object.keys(K).forEach(vt,K),Ze(K),p[G]&&(p[G].targetOrigin=p[G].checkOrigin===!0?mt(p[G].remoteHost):"*")}function lt(){return G in p&&"iFrameResizer"in k}var G=D(k.id);lt()?j(G,"Ignored iFrame, already setup."):(ft(T),b(),P(),W(),Qe(Q(G)),Ae())}function se(k,T){E===null&&(E=setTimeout(function(){E=null,k()},T))}var Ie={};function Ce(k,T,P){Ie[P]||(Ie[P]=setTimeout(function(){Ie[P]=null,k()},T))}function Be(){function k(){function D(b){function W(Ae){return(p[b]&&p[b].iframe.style[Ae])==="0px"}function Pe(Ae){return Ae.offsetParent!==null}p[b]&&Pe(p[b].iframe)&&(W("height")||W("width"))&&fe("Visibility change","resize",p[b].iframe,b)}Object.keys(p).forEach(function(b){D(b)})}function T(D){L("window","Mutation observed: "+D[0].target+" "+D[0].type),se(k,16)}function P(){var D=document.querySelector("body");new N(T).observe(D,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0})}var N=w();N&&P()}function J(k){function T(){Te("Window "+k,"resize")}L("window","Trigger event: "+k),se(T,16)}function ye(){function k(){Te("Tab Visible","resize")}document.visibilityState!=="hidden"&&(L("document","Trigger event: Visibility change"),se(k,16))}function Te(k,T){function P(N){return p[N]&&p[N].resizeFrom==="parent"&&p[N].autoResize&&!p[N].firstRun}Object.keys(p).forEach(function(N){P(N)&&fe(k,T,p[N].iframe,N)})}function he(){S(window,"message",B),S(window,"resize",function(){J("resize")}),S(document,"visibilitychange",ye),S(document,"-webkit-visibilitychange",ye)}function je(){function k(N,D){function b(){if(D.tagName){if(D.tagName.toUpperCase()!=="IFRAME")throw new TypeError("Expected <IFRAME> tag, found <"+D.tagName+">")}else throw new TypeError("Object is not a valid DOM element")}D&&(b(),ae(D,N),P.push(D))}function T(N){N&&N.enablePublicMethods&&j("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}var P;return x(),he(),function(D,b){switch(P=[],T(D),typeof b){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(b||"iframe"),k.bind(n,D));break;case"object":k(D,b);break;default:throw new TypeError("Unexpected data type ("+typeof b+")")}return P}}function ze(k){k.fn?k.fn.iFrameResize||(k.fn.iFrameResize=function(P){function N(D,b){ae(b,P)}return this.filter("iframe").each(N).end()}):A("","Unable to bind to jQuery, it is not fully loaded.")}window.jQuery!==n&&ze(window.jQuery),typeof define=="function"&&define.amd?define([],je):typeof t=="object"&&typeof t.exports=="object"&&(t.exports=je()),window.iFrameResize=window.iFrameResize||je()})()})),X_=zt.__toESM(Q_()),J_={checkOrigin:!1,minHeight:600,scrolling:!1};function Z_(e){const t=()=>e.iFrameResizer;return(0,X_.default)(J_,e),{resize:()=>t()?.resize?.(),dispose:()=>t()?.removeListeners?.()}}function eb(e){e.inject(Di,Z_)}function tb(e){const t=o.getMessageService(e),n=e.getInstance(o.LOCALE_SERVICE_ID);if(!n)return;let r="";const i=()=>{const d=n.snapshot(),u=d.id??"";if(!t.isInited()||u===r)return;const m=o.createI18n(d.catalog),f=_=>m.__(_),g=o.SANDBOX_TRANSLATIONS_MAP(f);r=u,t.send(o.EVENT_TYPES.SANDBOX_TRANSLATIONS,{name:u,data:g})},a=t.onInit(()=>{r="",i()}),c=n.state.watch(i);e.getInstance(h.DISPOSABLE_ID)?.addDispose(()=>{a.dispose(),c.dispose()})}function nb(e){const t=e?.content?.templateId;return t==null||t===""?void 0:String(t)}function ob(e){e.getInstance(h.OPTIONS_SOURCE_ID)?.watch(t=>{const n=nb(t);n!==void 0&&Yh(e,n)})}var Wr={en_US:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/7b8ce310.js")),void 0,{}.url),ru_RU:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/5f7f72e9.js")).then(e=>e.ru_RU_exports),void 0,{}.url),uk_UA:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/afb434bd.js")),void 0,{}.url),es_ES:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/dbb931dd.js")),void 0,{}.url),pt_BR:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/7cc4b0e9.js")),void 0,{}.url),de_DE:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/1cb0ff80.js")),void 0,{}.url),fr_FR:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/adf163ad.js")),void 0,{}.url),it_IT:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/6a5804ca.js")),void 0,{}.url),pl_PL:()=>(0,Ye.__vitePreload)(()=>Promise.resolve().then(()=>be("./static/core/9ce867fe.js")),void 0,{}.url)};async function rb(e){const t=Wr[e];if(!t){const n=Wr.en_US;return n?(await n()).default:void 0}return(await t()).default}var j0=Object.keys(Wr),ib=e=>e==="uk"?"uk_UA":e;function ab(e){e.getInstance(o.LOCALE_SERVICE_ID)?.useAntdLoader(t=>rb(ib(t)))}var zs={id:"ru_RU",time:1790706059,hash:"1ab741bdbb0c7804851eb0f78c18e1b33235391ce7d804c532a0d4d81e023f44",catalog:JSON.parse(`{"":{"domain":"default","lang":"ru_RU","plural_forms":"nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10 >= 2 && n%10<=4 &&(n%100<10||n%100 >= 20)? 1 : 2);"}," Add section":["Добавить раздел"]," email was":["письмо","письма","писем"]," from the project successfully.":["из проекта."]," successfully imported.":["импортировано."],"\\" email?":["»?"],"\\" was successfully created.":["\\" создано."],"\\" was successfully removed.":["» удалён."],"%d day":["%d день","%d дня","%d дней"],"%d day left":["%d день остался","%d дня осталось","%d дней осталось"],"%s plan":["Тариф %s"],"+0:00 London, Lisbon, Dublin":["+0:00 Лондон, Лиссабон, Дублин"],"+10:00 Sydney, Melbourne, Port Moresby":["+10:00 Сидней, Мельбурн, Порт-Морсби"],"+11:00 Honiara, Nuku'alofa, Apia":["+11:00 Хониара, Нукуалофа, Апиа"],"+1:00 Paris, Berlin, Rome":["+1:00 Париж, Берлин, Рим"],"+2:00 Athens, Kiev, Istanbul":["+2:00 Афины, Киев, Стамбул"],"+3:00 Istanbul, Doha, Baghdad":["+3:00 Москва, Санкт-Петербург, Киев"],"+4:00 Baku, Dubai, Tbilisi":["+4:00 Баку, Дубай, Тбилиси"],"+5:00 Karachi, Tashkent, Islamabad":["+5:00 Екатеринбург, Ташкент, Исламабад"],"+6:00 Almaty, Dhaka, Bishkek":["+6:00 Алматы, Дакка, Омск"],"+7:00 Bangkok, Ho Chi Minh City, Jakarta":["+7:00 Бангкок, Хошимин, Джакарта"],"+8:00 Beijing, Hong Kong, Singapore":["+8:00 Пекин, Гонконг, Сингапур"],"+9:00 Tokyo, Seoul, Jayapura":["+9:00 Токио, Сеул, Якутск"],"-10:00 Honolulu, Anchorage":["-10:00 Гонолулу, Анкоридж"],"-11:00 Pago Pago, Midway Atoll":["- 11:00 Паго-Паго, атолл Мидуэй"],"-12:00 Apia":["-12:00 Апиа"],"-1:00 Azores, Cape Verde":["-1:00 Азорские острова, Кабо-Верде"],"-2:00 South Georgia, Saint Helena":["-2:00 Южная Джорджия, остров Святой Елены"],"-3:00 Buenos Aires, Santiago, Montevideo":["-3:00 Буэнос-Айрес, Сантьяго, Монтевидео"],"-4:00 Caracas, Santo Domingo":["-4:00 Каракас, Санто-Доминго"],"-5:00 New York, Toronto, Havana":["-5:00 Нью-Йорк, Торонто, Гавана"],"-6:00 Mexico City, Guadalajara":["-6:00 Мехико, Гвадалахара"],"-7:00 Denver, Phoenix":["-7:00 Денвер, Феникс"],"-8:00 Los Angeles, Vancouver":["-8:00 Лос-Анджелес, Ванкувер"],"-9:00 Anchorage, Yukon":["-9:00 Анкоридж, Юкон"],"/ month":["/ месяц"],"1000+":["1000+"],"11–50":["11–50"],"12 hours":["12 часов"],"123456, City, 1 Example St.":["123456, Город, ул. Пример, 1"],"14 days free":["14 дней бесплатно"],"1–10":["1–10"],"20 s":["20 s"],"201–500":["201–500"],"24 hours":["24 часа"],"40 s":["40 s"],"501–1000":["501–1000"],"51–200":["51–200"],"60 s":["60 s"],"<1>Upload your own templates</1> or use <2>ready-made ones</2> to create emails from blocks.":["<1>Загружайте свои шаблоны</1> или используйте <2>готовые</2> для создания писем из блоков."],"A browser extension (for example, Urban VPN Proxy or similar ad blockers/VPN tools) is injecting code into the email preview. This can corrupt your template when saving.":["Расширение браузера (например, Urban VPN Proxy или аналогичные блокировщики рекламы/VPN-сервисы) вставляет код в окно предварительного просмотра письма. Это может привести к повреждению шаблона при сохранении."],"A flexible plan tailored to your needs":["Гибкий план, разработанный с учетом ваших потребностей"],"A shareable link to this page has been copied to the clipboard.":["Ссылка на страницу предпросмотра скопирована в буфер обмена."],"A test email can be sent to a maximum of 10 addresses.":["Тестовое письмо можно отправить максимум на 10 адресов."],"A-Z":["А-Я"],"AI":["AI"],"AI Assistant":["AI Ассистент"],"AI assistant":["AI Ассистент"],"AI email generation":["AI генерация письма"],"AI image":["AI картинка"],"AI image generation":["AI генерация изображений"],"AI requests":["Запросы к ИИ"],"AMP":["AMP"],"AMP visibility":["Видимость в AMP"],"API Key":["Ключ API"],"API Token":["Токен API"],"API URL":["URL API"],"Above":["Сверху"],"Accepted formats: PNG, JPG, WEBP, SVG or GIF.":["Доступные форматы: PNG, JPG, SVG или GIF."],"Access Key ID":["Идентификатор ключа доступа"],"Access keys and integration":["Ключи доступа и интеграция"],"Accessibility":["Доступность"],"Accessibility text":["Текст для людей с ограниченными возможностями"],"Accordion":["Аккордеон"],"Account Login":["Логин"],"Account settings":["Настройки аккаунта"],"Actions with the chosen text":["Действия с выбранным текстом"],"Active date background color":["Цвет фона активной даты"],"Active date font":["Шрифт активной даты"],"Add a common block":["Добавить общий блок"],"Add a font file or a link to the font.":["Добавьте файл шрифта или ссылку на него."],"Add a new folder":["Добавить новую папку"],"Add a new group":["Добавить группу"],"Add a new project":["Создать проект"],"Add a note":["Добавить метку"],"Add a saved block":["Добавить сохранённый блок"],"Add a template block":["Добавить шаблонный блок"],"Add an empty block":["Добавить пустой блок"],"Add block":["Добавить блок"],"Add button":["Добавить кнопку"],"Add card":["Добавить карточку"],"Add color":["Добавить цвет"],"Add column":["Добавить колонку"],"Add first color":["Добавить первый цвет"],"Add first link":["Добавить первую ссылку"],"Add group":["Добавить группу"],"Add image":["Изображение"],"Add inline image":["Вставить картинку"],"Add paragraph":["Добавить абзац"],"Add slide":["Добавить слайд"],"Add social network":["Добавить соцсеть"],"Add social network links to use in your email templates.":["Добавьте ссылки на соцсети, чтобы использовать их в шаблонах писем."],"Add some tags":["Укажите несколько тегов"],"Add up to 10 recipients":["Добавьте до 10 получателей"],"Add value":["Добавить значение"],"Add your brand palette and reuse it in the email editor.":["Добавьте палитру бренда и используйте её в редакторе писем."],"Add your first block to the folder...":["Добавьте свой первый блок в папку..."],"Address of any S3-compatible storage, for example https://storage.example.com":["Адрес любого S3-совместимого хранилища, например https://storage.example.com"],"Adds VML markup so the background image is visible in Outlook.":["Добавляет разметку VML, чтобы фоновое изображение отображалось в Outlook."],"Adds bulletproof VML markup so the button keeps rounded corners in Outlook.":["Добавляет разметку VML, благодаря чему кнопка сохраняет закругленные углы в Outlook."],"Administrator":["Администратор"],"Align bottom":["По нижнему краю"],"Align center":["По центру"],"Align left":["Влево"],"Align middle":["Посередине"],"Align right":["Вправо"],"Align top":["По верхнему краю"],"Alignments":["Выравнивание"],"All":["Все"],"All EmailMaker features are available for 14 days":["Все функции EmailMaker доступны в течение 14 дней."],"All blocks saved at this point can be found in the “Saved Blocks” section in the sidebar.":["Все сохраненные на данный момент блоки можно найти в разделе «Сохраненные блоки» на боковой панели."],"All blocks saved successfully.":["Все блоки сохранены."],"All emails sent to this address will be added to your project as a template.":["Все письма, которые придут на этот адрес, будут добавлены в ваш проект в виде шаблона"],"All folders":["Все папки"],"All roles":["Все роли"],"Allow multiple selection":["Разрешить множественный выбор"],"Allowed protocols":["Допустимые протоколы"],"Already imported":["Уже импортировано"],"Altcraft":["Altcraft"],"Alternative text":["Альтернативный текст"],"Always":["Всегда"],"Amount":["Сумма"],"An unexpected error has occurred. Our team has already been notified. Please try reloading the page.":["Произошла непредвиденная ошибка. Наша команда уже получила уведомление. Попробуйте перезагрузить страницу."],"Anchor":["Якорь"],"Anchor links do not work in Outlook, Gmail, and several other email clients.":["Якорные ссылки не работают в Outlook, Gmail и ряде других почтовых клиентов."],"Anchor name":["Имя якоря"],"Animate":["Анимация"],"Annotation type":["Тип аннотации"],"Annotations":["Аннотации"],"Any additional details":["Любые дополнительные сведения"],"Appearance":["Внешний вид"],"Appearance on mobile devices":["Внешний вид на мобильных устройствах"],"Apply":["Применить"],"Apply horizontal padding to height":["Применить горизонтальный отступ к высоте"],"Approaching usage limit. Remaining":["Приближается предел использования. Остаток"],"Apps":["Приложения"],"Are you sure you want to delete project ":["Вы уверены, что хотите удалить проект "],"Are you sure you want to disable this integration?":["Вы уверены, что хотите отключить эту интеграцию?"],"Are you sure you want to leave the project ":["Вы уверены, что хотите покинуть проект "],"Are you sure?":["Вы уверены"],"Around":["Вокруг"],"Arrow":["Стрелка"],"Arrow color":["Цвет стрелки"],"Article":["Статьи"],"At least 8 characters in both cases, including letters, numbers, and special characters.":["Минимум 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least 8 characters, including a combination of uppercase and lowercase letters, numbers, and special characters.":["Не менее 8 символов в обоих регистрах, включая буквы, цифры и специальные символы."],"At least one card needs an image and a link starting with https://":["Нужна хотя бы одна карточка с изображением и ссылкой, начинающейся с https://"],"Author":["Автор"],"Authorization error via Yandex":["Ошибка авторизации через Яндекс"],"Authorization keys":["Ключи авторизации"],"Auto":["Авто"],"Auto-payment enabled":["Автоплатёж включён"],"Auto-payment will be available once the subscription is linked in the payment system.":["Автоматическая оплата станет доступна после привязки подписки в платежной системе."],"Auto-prepend protocol on blur":["Автоматически добавлять протокол при потере фокуса"],"Autoplay":["Автозапуск"],"Autosave could not be completed. Export the template and save the code on your local computer to avoid losing your work.":["Автосохранение не удалось выполнить. Экспортируйте шаблон и сохраните код на локальном компьютере, чтобы не потерять результаты своей работы."],"Autosave failed":["Автосохранение не удалось"],"Autosave in editor":["Автосохранение в редакторе"],"Available formats: HTML, EML, ZIP":["Доступные форматы: HTML, EML, ZIP"],"Available until:":["Оплачен до:"],"BIK (bank ID)":["БИК"],"BIK must be 9 digits":["БИК должен состоять из 9 цифр"],"Back":["Назад"],"Back Home":["Вернуться"],"Back To Project":["Вернуться в проект"],"Back To Projects":["Вернуться к проектам"],"Back to Log In":["Вернуться к авторизации"],"Back to integrations":["К интеграциям"],"Background":["Фон"],"Background color":["Цвет фона"],"Background color of the contrast blocks":["Цвет фона контрастных блоков"],"Background image":["Фоновое изображение"],"Background image in Outlook (VML)":["Фоновое изображение в Outlook (VML)"],"Background image link/route":["Ссылка на фоновое изображение"],"Background image repeat":["Повтор фона"],"Background image size":["Размер фона"],"Bank account (RUB)":["Банковский счет (рубли)"],"Bank name":["Название банка"],"Banners":["Баннеры"],"Base URL for public access to files":["Базовый адрес для публичного доступа к файлам"],"Base background color":["Базовый цвет фона"],"Base colors":["Базовые цвета"],"Base path for uploading files":["Базовый путь для загрузки файлов"],"Base text color":["Базовый цвет текста"],"Before exporting the project, make sure to provide the URL where the webhook request will be sent":["Перед экспортом проекта необходимо заполнить url, на который будет отправляться запрос webHook"],"Below":["Снизу"],"Between bullets and text":["Между буллетами и текстом"],"Between list items":["Между пунктами списка"],"Billing":["Тарифы и оплата"],"Billing period":["Расчетный период"],"Black":["Чёрный"],"Black and White":["Чёрно-белые"],"Black circle":["Чёрный круг"],"Black circle outlined":["Чёрный круг обводка"],"Blank template":["Пустой шаблон"],"Block":["Блок"],"Block name":["Название блока"],"Block not yet loaded or global container not found.":["Код блока не загружен или глобальный контейнер не найден."],"Block styles":["Стили блока"],"Blocks":["Блоки"],"Blocks background color":["Цвет фона блоков"],"Blocks not found":["Блоки не найдены."],"Blocks search":["Поиск блоков"],"Blocks storage":["Хранилище Blocks"],"Blue":["Синий"],"Blur radius":["Размытие"],"Body":["Сообщение"],"Border":["Рамка"],"Border color":["Цвет рамки"],"Border radius":["Скругление"],"Borders":["Рамка"],"Both":["Всегда"],"Bottom":["Снизу"],"Bottom Code panel":["Панель кода снизу"],"Bottom left corner":["Нижний левый угол"],"Bottom margin":["Отступ снизу"],"Bottom padding":["Отступ снизу"],"Bottom padding of the general text":["Нижний отступ у текста"],"Bottom right corner":["Нижний правый угол"],"Box shadow":["Тень"],"Broadcast successfully created!":["Выпуск успешно создан!"],"Browser extension detected":["Обнаружено расширение для браузера"],"Browser page translation (for example, Google Translate) is active. It can break the editor and cause errors when saving.":["Включена функция перевода страницы в браузере (например, Google Translate). Это может привести к сбоям в работе редактора и вызывать ошибки при сохранении."],"Browser translation detected":["Обнаружен перевод с помощью браузера"],"Bucket name":["Имя бакета"],"Build newsletters from scratch with <1>structures and elements</1>.":["Собирайте рассылки с нуля с помощью <1>структур и элементов</1>."],"Bulk saving of blocks":["Массовое сохранение блоков"],"Bullet":["Буллет"],"Bullets color":["Цвет буллетов"],"Bullets font":["Шрифт буллетов"],"Bullets size":["Размер буллетов"],"Bullets type":["Тип буллетов"],"Button":["Кнопка"],"Button background color in contrasting blocks":["Цвет фона кнопок в контрастных блоках"],"Button size":["Размер кнопки"],"Button text color in contrasting blocks":["Цвет текста кнопок в контрастных блоках"],"Buttons":["Кнопки"],"Buttons background color":["Цвет фона кнопки"],"Buttons font":["Шрифт кнопки"],"Buttons font size":["Размер текста кнопки"],"Buttons letter spacing":["Межбуквенный интервал кнопки"],"Buttons text color":["Цвет текста кнопки"],"Buy":["Купить"],"Buy generations":["Купить генерации"],"Buy image check package":["Купить пакет проверки изображений"],"Buy link check package":["Купить пакет проверки ссылок"],"Buy optimization package":["Купить пакет оптимизации"],"Buy package":["Купить пакет"],"Buy spam check package":["Купить пакет проверки на спам"],"Buy test sends package":["Купить пакет тестов"],"By card":["Картой"],"Calendar":["Календарь"],"Call to Action":["Призыв к действию"],"Campaign created. Dotdigital used your account default sender because this From email is not registered as a custom from address. Add the address in Dotdigital and export again to use it.":["Кампания создана. Dotdigital использовал отправителя по умолчанию вашей учетной записи, поскольку этот адрес электронной почты в поле «От» не зарегистрирован в качестве настраиваемого адреса отправителя. Добавьте адрес в Dotdigital и повторно экспортируйте данные, чтобы использовать его."],"Campaign successfully created!":["Кампания успешно создана!"],"Cancel":["Отмена"],"Cannot disable recurring payments":["Не удается отключить автоплатёж"],"Cannot enable recurring payments":["Не удается включить автоплатёж"],"Captcha required":["Требуется ввести капчу"],"Captcha verification failed":["Ошибка при проверке капчи"],"Caption next to checkbox":["Подпись рядом с чекбоксом"],"Caption next to options":["Подпись рядом с пунктами"],"Card":["Карточка"],"Card payment is not available for this change.":["Для данной операции оплата картой недоступна."],"Card payment is not available for this change. Use an invoice for a legal entity.":["Для данного изменения оплата картой недоступна. Для юридического лица воспользуйтесь счётом-фактурой."],"Card payment is not available for this plan change. Please contact support.":["Оплата картой недоступна при изменении тарифного плана. Пожалуйста, обратитесь в службу поддержки."],"Card payment is not available for this plan change. Use an invoice for a legal entity or contact support.":["Для данного изменения тарифного плана оплата картой недоступна. Для юридических лиц воспользуйтесь счетом-фактурой или обратитесь в службу поддержки."],"Cards":["Карточки"],"Cards view":["Карточки"],"Carousel":["Карусель"],"Case Change":["Изменение ситуации"],"Cell":["Ячейка"],"Center horizontally":["По центру"],"Center vertically":["По центру"],"Change":["Изменить"],"Change Stripo key":["Сменить ключ Stripo"],"Change folder name":["Переименовать папку"],"Change group name":["Переименовать группу"],"Change image":["Сменить изображение"],"Change name":["Переименовать"],"Change plan":["Изменить тариф"],"Change role":["Изменить роль"],"Change role to Administrator":["Изменить роль на Администратор"],"Change tariff":["Сменить тариф"],"Changes loaded":["Изменения загружены"],"Character limit":["Ограничение по количеству символов"],"Characters":["Символы"],"Chat support":["Чат поддержки"],"Check how your email appears across various devices and email clients.":["Проверьте, как будет выглядеть ваше письмо на разных устройствах и в разных почтовых клиентах."],"Check who and when made changes to the email template and, if necessary, restore one of the previous versions.":["Проверьте, кто и когда вносил изменения в шаблон, и при необходимости восстановите одну из предыдущих версий."],"Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.":["Проверьте письмо на наличие неработающих ссылок, отсутствующих alt-текстов, тяжелых изображений и других препятствий, которые могут помешать вашим письмам попасть в почтовые ящики."],"Check your network connection and try again.":["Проверьте подключение к сети и попробуйте ещё раз."],"Checkbox":["Чекбокс"],"Checked":["Отмечено"],"Checked fill color":["Цвет заливки отмеченного"],"Checked icon URL":["URL иконки отмеченного"],"Choose":["Выбрать"],"Choose a payment method":["Выберите способ оплаты"],"Choose a plan":["Выбрать тариф"],"Choose allowed protocols":["Выберите разрешенные протоколы"],"Choose block type":["Выберите тип блока"],"Choose complexity rules":["Выберите правила сложности"],"Choose input type":["Выберите тип ввода"],"Choose plan":["Выберите тариф"],"Clear":["Очистить"],"Clear all":["Очистить"],"Clear border":["Очистить рамку"],"Clear chat":["Очистить чат"],"Clear chat history?":["Очистить чат?"],"Clear selection":["Очистить выбор"],"Click or drag a block":["Нажмите или перетащите блок"],"Click the Add a new project button to add your first project.":["Нажмите кнопку «Добавить проект», чтобы создать свой первый проект."],"Click to select, paste from the clipboard, or drag and drop":["Перетащите изображения сюда или вставьте из буфера"],"Client ID":["Client ID"],"Client ID copied to clipboard.":["Client ID скопирован."],"Client Secret":["Client Secret"],"Client secret copied to clipboard.":["Client Secret скопирован."],"Client secret rotated successfully.":["Client Secret перевыпущен."],"Clipboard":["Буфер обмена"],"Clone":["Дублировать"],"Clone block":["Клонировать блок"],"Clone element":["Клонировать элемент"],"Clone group":["Клонировать группу"],"Close":["Закрыть"],"Closed field background":["Фон закрытого поля"],"Code":["Код"],"Code Size Warning":["Предупреждение о размере кода"],"Code editor":["Редактор кода"],"Code mode":["Режим кода"],"Code size":["Размер кода"],"Code that will replace the image \`src\`":["Код, который заменит путь к изображению"],"Collapse section":["Свернуть раздел"],"Collection of all HTTP requests used by the plugin (Postman Collection v2.1 format).":["Коллекция всех HTTP-запросов, которые использует плагин (формат Postman Collection v2.1)."],"Color":["Цвет"],"Color of the general text":["Цвет текста"],"Color settings":["Настройки цвета"],"Colors":["Цвета"],"Column":["Колонка"],"Column gap":["Отступ между колонками"],"Columns":["Колонки"],"Come up with a hint":["Придумайте подсказку"],"Coming soon":["В разработке"],"Comment":["Комментарий"],"Comment was removed.":["Комментарий удалён."],"Common blocks":["Общие блоки"],"Company size":["Размер компании"],"Complexity rules":["Правила сложности"],"Configure":["Настроить"],"Configure %s":["Настройка %s"],"Configure integration":["Настроить интеграцию"],"Configure social network link":["Настройка ссылки на соцсеть"],"Confirmation":["Подтверждение"],"Confirmation email has been sent to {confirmedEmail}.":["На адрес {confirmedEmail} отправлено письмо с подтверждением."],"Confirmation email was sent to":["Подтверждение было отправлено на"],"Connect":["Подключить"],"Connect plugin":["Подключить плагин"],"Connected":["Подключено"],"Connection established":["Соединение установлено"],"Connection test failed.":["Не удалось проверить соединение."],"Contact":["Связаться"],"Contact List ID":["ID списка контактов"],"Contact Us":["Связаться с нами"],"Contact person (full name)":["Контактное лицо (полное имя)"],"Contact sync, content personalization, and real-time campaign results tracking.":["Синхронизация контактов, персонализация содержимого и отслеживание результатов кампаний в реальном времени."],"Contacts":["Контакты"],"Contain":["Contain"],"Container":["Контейнер"],"Container width":["Ширина блока"],"Content":["Контент"],"Content styles":["Стили контента"],"Continue":["Продолжить"],"Continue (%d)":["Продолжить (%d)"],"Continue without saving":["Продолжить без сохранения"],"Contract":["Договор"],"Contract / invoice / public offer":["Договор / счёт-фактура / публичная оферта"],"Contract date":["Дата заключения договора"],"Contract number":["Номер договора"],"Contrast block":["Контрастный блок"],"Contrast block header color":["Цвет заголовка контрастного блока"],"Contrast block text color":["Цвет текста контрастного блока"],"Contrasting background color":["Контрастный цвет фона"],"Contrasting colors":["Контрастные цвета"],"Contrasting text color":["Контрастный цвет текста"],"Conversion failed":["Конвертация не удалась"],"Convert":["Конвертировать"],"Convert into an image":["Преобразовать в изображение"],"Converting layout…":["Конвертация шаблона..."],"Copy":["Копировать"],"Copy block to clipboard":["Скопировать блок в буфер обмена"],"Copy client ID":["Скопировать Client ID"],"Copy client secret":["Скопировать Client Secret"],"Copy code":["Скопировать код"],"Copy column":["Скопировать колонку"],"Copy hex":["Копировать HEX"],"Copy to clipboard":["Скопировать в буфер обмена"],"Copywriter":["Писатель"],"Corner radius":["Скругление"],"Correspondent account":["Корреспондентский счёт"],"Could not activate the trial. Please try again later or contact support.":["Не удалось активировать пробную версию. Попробуйте позже или обратитесь в службу поддержки."],"Could not move files from old storage":["Не удалось переместить файлы со старого хранилища"],"Could not reach the server. Please try again later.":["Не удалось установить соединение с сервером. Пожалуйста, попробуйте позже."],"Could not save the email":["Не удалось сохранить письмо"],"Couldn\`t determine the email width":["Не удалось определить ширину письма."],"Countdown":["Таймер"],"Countdown font settings":["Шрифт таймера"],"Country selector (flag+code)":["Выбор страны (флаг + код)"],"Cover":["Cover"],"Create a new email":["Создать письмо"],"Create a password":["Создайте пароль"],"Create email":["Создать письмо"],"Create folder":["Создать папку"],"Create group":["Создать группу"],"Create new block":["Создать новый блок"],"Create new email":["Создать письмо"],"Create project":["Создать проект"],"Creating an email on request":["Создание письма по запросу"],"Creation date":["Дата создания"],"Cross":["Крест"],"Current password":["Текущий пароль"],"Custom":["Пользовательский"],"Custom icon":["Пользовательская иконка"],"Customized solutions for large-scale operations with high productivity":["Индивидуальные решения для крупных компаний с высокой производительностью"],"Dark":["Тёмная"],"Dark theme":["Тёмная тема"],"Dash":["Тире"],"Dashed":["Пунктир"],"Date":["Дата"],"Date format":["Формат даты"],"Days":["Дни"],"Deal Annotation":["Аннотация акции"],"Deal Card":["Карточка акции"],"Default or bound value for the field":["Значение по умолчанию или заданное значение для поля"],"Default value":["Значение по умолчанию"],"Delete":["Удалить"],"Delete column":["Удалить колонку"],"Delete from palette":["Удалить из палитры"],"Delete from styles":["Удалить из стилей"],"Delete permanently":["Удалить навсегда"],"Delete this color from the palette?":["Удалить этот цвет из палитры?"],"Delete this font from styles?":["Удалить этот шрифт из стилей?"],"Delete this social network?":["Удалить эту соцсеть?"],"Deleted":["Удалённые"],"Describe your project":["Опишите свой проект"],"Description":["Описание"],"Description is used in other sections of the service.":["Описание используется в других разделах сервиса."],"Description must be at most 500 characters.":["Описание не длиннее 500 символов."],"Desktop":["Десктоп"],"Desktop view":["Десктопный вид"],"Details":["Подробнее"],"Developer files":["Файлы для разработчика"],"Diamond":["Ромб"],"Didn't receive an email?":["Не получили письмо?"],"Digits (0-9)":["Цифры (0–9)"],"Disable":["Отключить"],"Disable integration":["Отключить интеграцию"],"Disabled":["Отключенный"],"Disconnect Stripo":["Отключить Stripo"],"Discount code":["Промокод"],"Discount description":["Описание скидки"],"Discount description is required":["Нужно описание скидки"],"Discount with promo code: ":["Скидка по промокоду: "],"Discuss":["Обсуждение"],"Display control":["Видимость"],"Display control & Direction":["Видимость и направление"],"Display the minimap.":["Показывать миникарту кода."],"Divider":["Разделитель"],"Do not repeat background (no-repeat)":["Не повторять фон (no-repeat)"],"Domain that serves this folder: it goes into image links in emails":["Домен, который отдаёт эту папку: он попадает в ссылки на изображения в письмах"],"Don't suggest again":["Больше не предлагать"],"Done":["Готово"],"Dot color":["Цвет точки"],"Dotted":["Точки"],"Double arrow":["Двойная стрелка"],"Double quotation":["Двойная кавычка"],"Download":["Скачать"],"Download as is":["Скачать как есть"],"Draft Name":["Имя черновика"],"Draft campaign created! Open it to review and schedule.":["Проект кампании создан! Откройте его для проверки и планирования."],"Draft successfully created!":["Черновик создан!"],"Drag file here or upload from device":["Перетащите файл сюда или загрузите с устройства"],"Drag to reorder":["Можно перемещать"],"Drop here":["Вставить сюда"],"Dropdown list":["Выпадающий список"],"Duration":["Длительность"],"During export, the element is converted into an image.":["При экспорте элемент преобразуется в изображение."],"E-Commerce":["Электронная коммерция"],"E-mail":["E-mail"],"Edit":["Редактировать"],"Edit block":["Свойства блока"],"Edit element":["Редактировать элемент"],"Edit group":["Свойства группы"],"Edit icon":["Редактировать иконку"],"Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!":["Редактируйте HTML-версию шаблона письма в режиме кода и наблюдайте за изменениями в реальном времени. В EmailMaker нет ограничений на код: вы можете создавать шаблоны любой сложности!"],"Editing comments":["Редактирование комментариев"],"Education":["Образование"],"Element":["Элемент"],"Elements":["Элементы"],"Email":["Email"],"Email Subject":["Тема письма"],"Email background color":["Цвет фона письма"],"Email builder for your teamwork":["Редактор писем для совместной работы"],"Email confirmation required":["Требуется подтверждение email"],"Email generation":["Генерация писем"],"Email generator":["Генератор Email"],"Email layout width":["Ширина письма"],"Email name":["Название письма"],"Email not yet loaded or global container not found.":["Код письма не загружен или глобальный контейнер не найден."],"Email optimization":["Оптимизация шаблона"],"Email platforms":["Платформы"],"Email successfully copied to clipboard.":["Адрес скопирован в буфер обмена."],"Email successfully created!":["Письмо создано!"],"Email synced with the server":["Email синхронизирован с сервером"],"Email testing":["Тестирование шаблона"],"EmailMaker storage":["Хранилище EmailMaker"],"Emails":["Письма"],"Emails not found":["По данному запросу ничего не найдено."],"Embed images in the file?":["Включить изображения в файл?"],"Empty blocks":["Пустые блоки"],"Enable auto-payment":["Включить автоплатёж"],"Enabled":["Включено"],"End date":["Дата окончания"],"End time":["Время окончания"],"Endpoint":["Адрес хранилища"],"Ends":["Окончание"],"Ends in":["Заканчивается через"],"Enter Altcraft API token":["Введите токен API Altcraft"],"Enter Mailganer API key":["Введите ключ API Mailganer"],"Enter Sendsay API key":["Введите ключ API Sendsay"],"Enter URL":["Введите адрес"],"Enter Unisender API key":["Введите ключ API Unisender"],"Enter a URL starting with http:// or https://":["Адрес должен начинаться с http:// или https://"],"Enter a direct link to a font file (.woff2, .woff, .ttf, .otf) or a Google Fonts stylesheet.":["Укажите прямую ссылку на файл шрифта (.woff2, .woff, .ttf, .otf) или на стили Google Fonts."],"Enter a font name.":["Введите название шрифта."],"Enter a port between 1 and 65535":["Укажите порт от 1 до 65535"],"Enter a valid HEX color (e.g. #1F1F1F).":["Введите корректный HEX-цвет (например, #1F1F1F)."],"Enter a valid HEX color.":["Введите корректный HEX-цвет."],"Enter a valid URL (https://example.com or example.com).":["Введите корректный адрес (https://example.com или example.com)."],"Enter block name":["Укажите название блока"],"Enter color name":["Введите название цвета"],"Enter enKod API key":["Введите ключ API enKod"],"Enter font name":["Введите название шрифта"],"Enter heading":["Введите заголовок"],"Enter link":["Введите ссылку"],"Enter name":["Введите название"],"Enter path":["Введите путь"],"Enter preheader here":["Введите прехедер"],"Enter promo code":["Введите промокод"],"Enter subject line here":["Введите тему письма"],"Enter the access key":["Введите ключ доступа"],"Enter the block name":["Введите название блока"],"Enter the bucket name":["Введите имя бакета"],"Enter the confirmation code from the email and set a new password.":["Введите код подтверждения из письма и установите новый пароль."],"Enter the connection login":["Введите логин для подключения"],"Enter the connection password":["Введите пароль для подключения"],"Enter the email name":["Введите название письма"],"Enter the folder name":["Введите имя папки"],"Enter the group name":["Введите имя группы"],"Enter the project name":["Введите название проекта"],"Enter the secret key":["Введите секретный ключ"],"Enter the server host":["Введите имя хоста"],"Enter the storage endpoint":["Введите адрес хранилища"],"Enter the title of the image":["Введите название изображения"],"Enter value":["Введите значение"],"Enter your contact details":["Укажите свои контакты"],"Enter your current password":["Введите текущий пароль"],"Enter your email":["Укажите ваш email"],"Enter your email address and we will send you password reset instructions.":["Введите свой адрес электронной почты, и мы вышлем вам инструкции по сбросу пароля."],"Enter your first name":["Укажите ваше имя"],"Enter your last name":["Укажите вашу фамилию"],"Enter your new password":["Введите новый пароль"],"Enter your password":["Введите ваш пароль"],"Enter your phone or email":["Введите телефон или email"],"Equalize":["Сравнять"],"Error":["Ошибка"],"Error when initializing file manager":["Ошибка инициализации файлового менеджера"],"Error when receiving data. Try again (reload page) or contact support.":["Ошибка при получении данных. Попробуйте еще раз (перезагрузите страницу) или обратитесь в службу поддержки."],"Errors":["Ошибки"],"Evaluating the task":["Обдумываю задачу"],"Example:":["Например:"],"Expand only one section":["Раскрывать только один раздел"],"Expand section":["Развернуть раздел"],"Expires":["Действует до"],"Export":["Экспорт"],"Export emails as draft campaigns to ActiveCampaign":["Экспорт писем в ActiveCampaign в виде черновиков кампаний"],"Export emails to Altcraft":["Экспорт писем в Altcraft"],"Export emails to Bento":["Экспорт писем в Bento"],"Export emails to Brevo":["Экспорт писем в Brevo"],"Export emails to Campaign Monitor":["Экспорт писем в Campaign Monitor"],"Export emails to Constant Contact":["Экспорт писем в Constant Contact"],"Export emails to Dotdigital":["Экспорт писем в Dotdigital"],"Export emails to GetResponse":["Экспорт писем в GetResponse"],"Export emails to HubSpot":["Экспорт писем в HubSpot"],"Export emails to Klaviyo":["Экспорт писем в Klaviyo"],"Export emails to Mailchimp":["Экспорт писем в Mailchimp"],"Export emails to Mailganer":["Экспорт писем в Mailganer"],"Export emails to Salesforce":["Экспорт писем в Salesforce"],"Export emails to Sendsay":["Экспорт писем в Sendsay"],"Export emails to Unisender":["Экспорт писем в Unisender"],"Export emails to enKod":["Экспорт писем в enKod"],"Export settings":["Настройки экспорта"],"Extend plan":["Продлить тариф"],"Extra limit package":["Расширенный пакет"],"Extra package is not configured for this limit.":["Для этого ограничения дополнительный пакет не настроен."],"Extra packages are only available with CloudPayments at the moment.":["На данный момент дополнительные пакеты доступны только в CloudPayments."],"Eyedropper":["Пипетка"],"Failed to clean trash":["Не удалось очистить корзину"],"Failed to complete Yandex authorization":["Не удалось пройти авторизацию в «Яндексе»"],"Failed to copy.":["Не удалось скопировать."],"Failed to create broadcast":["Не удалось создать выпуск"],"Failed to create campaign":["Не удалось создать кампанию"],"Failed to create draft":["Не удалось создать черновик"],"Failed to create email":["Не удалось создать письмо"],"Failed to create mailing":["Не удалось создать рассылку"],"Failed to create newsletter":["Не удалось создать рассылку"],"Failed to create template":["Не удалось создать шаблон"],"Failed to download file.":["Не удалось скачать файл."],"Failed to download image from URL.":["Не удалось загрузить изображение по URL-адресу."],"Failed to export the email as images. Please try again.":["Не удалось экспортировать письмо в виде изображений. Попробуйте ещё раз."],"Failed to get file: %s":["Не удалось получить файл: %s"],"Failed to load":["Не удалось загрузить"],"Failed to load GIFs":["Не удалось загрузить GIF-файлы"],"Failed to load GIFs through the configured proxy chain.":["Не удалось загрузить GIF-файлы через настроенную цепочку прокси-серверов."],"Failed to load YaSendSuggestToken script":["Не удалось загрузить скрипт YaSendSuggestToken"],"Failed to load Yandex authorization script":["Не удалось загрузить скрипт авторизации Яндекс"],"Failed to load integrations.":["Не удалось загрузить интеграции."],"Failed to load payments.":["Не удалось загрузить платежи."],"Failed to load plugin analytics.":["Не удалось загрузить аналитику плагина."],"Failed to load plugin settings.":["Не удалось загрузить настройки плагина."],"Failed to load plugin usage.":["Не удалось загрузить статистику использования плагина."],"Failed to load project styles.":["Не удалось загрузить стили проекта."],"Failed to load stock images":["Не удалось загрузить стоковые изображения"],"Failed to load stock images through the configured proxy chain.":["Не удалось загрузить стоковые изображения через настроенную цепочку прокси-серверов."],"Failed to load storage settings.":["Не удалось загрузить настройки хранилища."],"Failed to process image URL.":["Не удалось обработать URL-адрес изображения."],"Failed to rotate client secret.":["Не удалось перевыпустить Client Secret."],"Failed to save blocks.":["Не удалось сохранить блоки."],"Failed to save integration settings.":["Не удалось сохранить настройки интеграции."],"Failed to save project settings.":["Не удалось сохранить настройки проекта."],"Failed to save project styles.":["Не удалось сохранить стили проекта."],"Failed to save storage settings.":["Не удалось сохранить настройки хранилища."],"Failed to save the image. Check the file storage settings.":["Не удалось сохранить изображение. Проверьте настройки хранилища файлов."],"Failed to update the global block.":["Не удалось обновить глобальный блок."],"Failed to update the inbox.":["Не удалось обновить папку «Входящие»."],"Features":["Возможности"],"Fewer settings":["Меньше настроек"],"Field heading":["Заголовок поля"],"Field required":["Обязательное поле"],"Field state appearance":["Внешний вид поля"],"File":["Файл"],"File upload failed":["Не удалось загрузить файл"],"Files ready: %s":["Файлы готовы: %s"],"Fill in at least one offer field":["Заполните хотя бы одно поле акции"],"Filter by type":["Фильтр по типу"],"Finance & Banking":["Финансы и банки"],"First name":["Имя"],"Float block width":["Ширина плавающего блока"],"Folder (Prefix)":["Папка (префикс)"],"Folder name is required":["Имя папки обязательно"],"Folder path":["Путь к папке"],"Folders":["Папки"],"Font":["Шрифт"],"Font family":["Шрифт"],"Font file":["Файл шрифта"],"Font of the general text":["Шрифта текста"],"Font settings":["Настройки шрифта"],"Font size":["Размер текста"],"Font size of the general text":["Размер текста"],"Fonts":["Шрифты"],"Footers":["Подвалы"],"For basic tasks in business or personal projects":["Для выполнения основных задач в рамках деловых или личных проектов"],"Forgot the password?":["Забыли пароль?"],"Forgot your password?":["Забыли пароль?"],"Form":["Форма"],"Found so far: %s":["Найдено на данный момент: %s"],"Free trial":["Пробная версия"],"From scratch":["С чистого листа"],"Full legal company name":["Полное юридическое название компании"],"GIF":["GIF"],"General settings":["Общие настройки"],"General text":["Текст"],"Generate":["Сгенерировать"],"Generate Email":["Создать письмо"],"Generate image":["Сгенерировать изображение"],"Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.":["С легкостью создавайте потрясающие визуальные эффекты. Мы обучили нашу модель искусственного интеллекта, чтобы обеспечить высочайшее качество изображений."],"Generate with AI":["Генерация с помощью ИИ"],"Generated images":["Генерация картинок"],"Get a discount":["получить со скидкой"],"Get started":["Начать работу"],"Give your users the ability to build beautiful emails without development costs":["Дайте пользователям возможность собирать красивые письма без затрат на разработку"],"Global block":["Глобальный блок"],"Global styles":["Стили письма"],"Gmail annotation was successfully applied to the template code.":["Аннотация Gmail добавлена в код письма."],"Gmail annotations":["аннотаций в Gmail"],"Gmail annotations were removed from the template code.":["Аннотации Gmail удалены из кода письма."],"Go to project settings?":["Перейти в настройки проекта?"],"Go to projects":["Перейти к проектам"],"Google Fonts":["Шрифты Google"],"Got it":["Понятно"],"Green":["Зелёный"],"Grid":["Сетка"],"Group":["Группа"],"HTML":["HTML"],"HTML URL is required. Save the email first, or paste a custom URL to your hosted HTML.":["Требуется URL-адрес HTML-страницы. Сначала сохраните письмо или вставьте собственный URL-адрес размещенной у вас HTML-страницы."],"Half year":["Полгода"],"Header":["Заголовок"],"Header text":["Текст заголовка"],"Headers":["Шапки"],"Heading":["Заголовок"],"Heading color":["Цвет заголовка"],"Heading font":["Шрифт заголовка"],"Heading font size":["Размер заголовка"],"Heading letter spacing":["Межбуквенный интервал заголовка"],"Heading line height":["Высота строки заголовка"],"Headings":["Заголовки"],"Headline":["Заголовок"],"Healthcare":["Здравоохранение"],"Height":["Высота"],"Hello":["Привет"],"Help":["Справка"],"Help menu":["Помощь"],"Helper text":["Подсказка"],"Helper text / tooltip":["Подсказка / всплывающая подсказка"],"Hide payment history":["Скрыть историю платежей"],"High contrast mode":["Режим высокой контрастности"],"Hint text":["Подсказка"],"Horizontal":["Горизонтальный"],"Horizontal alignment":["Горизонтальное выравнивание"],"Horizontal offset":["Гориз. смещение"],"Horizontal padding":["Горизонтальный отступ"],"Horizontal position":["Гориз. смещение"],"Hospitality & Travel":["Гостиничный бизнес и туризм"],"Host":["Имя хоста"],"Hostname or server IP address":["Имя хоста или IP-адрес сервера"],"How to get an API key?":["Как получить ключ API?"],"Hyperlink URL":["Адрес ссылки"],"I agree to the":["Я согласен с"],"I would like to receive updates from Blocks.":["Я хочу получать новости от Blocks"],"I would like to receive updates from EmailMaker.":["Я хочу получать новости от EmailMaker."],"I'd be happy to create an email for you! ":["Я с удовольствием создам для вас электронное письмо! "],"Icon":["Иконка"],"Icon URL":["URL иконки"],"Icon description":["Описание иконки"],"Identifies search terms. For example: utm_term=running+shoes":["Определяет условия поиска. Например: utm_term=running+shoes"],"Identifies what type of link was used, such as cost per click or email. For example: utm_medium=cpc":["Определяет, какой тип ссылки использовался, например, цена за клик или электронная почта. Например: utm_medium=cpc"],"If \\"Yes\\", images will be included in the file itself. This is useful for offline viewing or if external images are blocked, but increases file size. If \\"No\\", images will be loaded from external links.":["Если «Да», изображения будут включены в сам файл. Это полезно для просмотра без интернета или если внешние изображения заблокированы, но увеличивает размер файла. Если «Нет», изображения будут загружаться по внешним ссылкам."],"If different from the legal address":["Если отличается от юридического адреса"],"If you do not pay, you will be switched to the free plan automatically.":["Если вы не оплатите, вы будете автоматически переведены на бесплатный тарифный план."],"If you have problems connecting the plugin — contact us, our specialists will definitely help you.":["Если возникли сложности с подключением плагина — напишите нам, наши специалисты обязательно помогут."],"If you turn the switch off, lines of code will not wrap. If you turn the switch on, lines of code will wrap at the viewport.":["Если параметр отключен, строки никогда не будут переноситься. Если параметр включен, строки будут переноситься по ширине области просмотра."],"Image":["Картинка"],"Image Center":["Центр изображений"],"Image checks":["Проверка картинок"],"Image editor":["Редактор изображений"],"Image path":["Путь к изображению"],"Image replacer":["Замена картинки"],"Image src":["Картинка"],"Images validation":["Проверка изображений"],"Images validation was successfully completed":["Проверка изображений завершена"],"Import":["Импорт"],"Import email":["Импортировать письмо"],"Import finished":["Импорт завершён"],"Import first %d":["Импортировать первые %d"],"Import from Stripo":["Импорт из Stripo"],"Import problems":["Проблемы импорта"],"Import templates and emails from your Stripo project.":["Импорт шаблонов и писем из вашего проекта Stripo."],"Imported":["Импортировано"],"Imported %1$d of %2$d":["Импортировано %1$d из %2$d"],"Imported: %1$d, failed: %2$d.":["Импортировано: %1$d, не удалось: %2$d."],"Importing from Stripo":["Импорт из Stripo"],"Improves visibility by automatically tuning the form for accessibility. Turn off to restore the previous look.":["Улучшает читаемость за счет автоматической настройки формы с учетом требований доступности. Отключите эту функцию, чтобы вернуть прежний вид."],"Inactive date background color":["Цвет фона неактивной даты"],"Inactive date font":["Шрифт неактивной даты"],"Indent":["Отступ"],"Indent between columns":["Горизонтальный отступ"],"Indent height":["Высота"],"Indent in mobile":["Вертикальный отступ"],"Indexing files…":["Индексация файлов…"],"Indicates a specific product promotion or a marketing campaign. Example: utm_campaign=spring_sale":["Определяет продвижение конкретного продукта или стратегическую кампанию. Например: utm_campaign=spring_sale"],"Indicates what user clicked to get to the site: a banner or a text link. It is often used for A/B testing and ad campaigns. Example: utm_content=logolink or utm_content=textlink":["Определяет, что именно было нажато, чтобы привести пользователя на сайт, например, рекламный баннер или текстовая ссылка. Он часто используется для A/B-тестирования и рекламы, ориентированной на контент. Например: utm_content=logolink или utm_content=textlink."],"Individual corner radii":["Радиусы отдельных углов"],"Individual padding":["Отдельные отступы"],"Industry":["Отрасль"],"Input":["Поле ввода"],"Input field text":["Текст поля ввода"],"Insert column after":["Вставить столбец справа"],"Insert column before":["Вставить столбец слева"],"Insert row after":["Вставить строку после"],"Insert row before":["Вставить строку перед"],"Insert spaces":["Отступы пробелами"],"Inside":["Внутри"],"Integration settings saved.":["Настройки интеграции сохранены."],"Integrations":["Интеграции"],"Integrations are set up in the project settings. Unsaved changes in the email may be lost.":["Интеграции настраиваются в настройках проекта. Несохранённые изменения в письме могут потеряться."],"Internal padding":["Внутренний отступ"],"Invalid file data":["Неверные данные файла"],"Invite members":["Пригласить участников"],"Invited %s":["Приглашён %s"],"Invoice":["Счёт-фактура"],"Invoice for legal entity":["Счёт для юр. лица"],"Invoice request for a legal entity":["Запрос на выставление счета для юридического лица"],"Is a template":["Шаблон"],"It looks like the email was not created in our service, so the content styles won\`t work. Read more about content styles in the help.":["Похоже, письмо создано не в нашем сервисе, поэтому стили контента работать не будут. Подробнее о стилях содержимого читайте в справке."],"It\`s done!":["Готово!"],"Italic":["Курсив"],"Italic ( Ctrl+I )":["Курсив ( Ctrl+I )"],"Italic ( ⌘I )":["Курсив ( ⌘I )"],"Items to import: %d.":["Элементов к импорту: %d."],"Ivan Ivanov":["Иван Иванов"],"Joined the project":["Присоединился к проекту"],"Just now":["Только что"],"KB":["KB"],"KPP":["КПП"],"KPP must be 9 digits":["КПП должен состоять из 9 цифр"],"LLC \\"Example\\"":["ООО «Пример»"],"Label next to checkbox":["Надпись рядом с чекбоксом"],"Label text style":["Стиль текста подписи"],"Landscape":["Горизонтальная"],"Language":["Язык"],"Large emails may have delivery issues and load slowly. We recommend minimizing code before exporting.":["Большие электронные письма могут иметь проблемы с доставкой и медленно загружаться. Мы рекомендуем минимизировать код перед экспортом."],"Last login":["Последний вход"],"Last name":["Фамилия"],"Last update: ":["Обновлено:"],"Layout conversion failed":["Ошибка при преобразовании шаблона"],"Layout converted to Blocks format":["Шаблон преобразован в формат Blocks"],"Layout converted to EmailMaker format":["Шаблон преобразован в формат EmailMaker"],"Learn more about %s":["Подробнее о работе %s"],"Leave":["Уйти"],"Leave your comment":["Оставьте ваш комментарий"],"Left":["Слева"],"Left Code panel":["Панель кода слева"],"Left padding":["Отступ слева"],"Left to right":["Слева направо"],"Legal address":["Юридический адрес"],"Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!":["Позвольте нашему помощнику с ИИ улучшить ваше письмо! От создания темы и прехедеров на основе письма до генерации всего письма с учетом особенностей вашего сайта!"],"Letter spacing":["Межбуквенный интервал"],"Light":["Светлая"],"Light theme":["Светлая тема"],"Line break on mobile devices":["Переносить колонки друг под друга"],"Line height":["Высота строки"],"Line height of the general text":["Высота строки текста"],"Line wrap":["Перенос строк"],"Link":["Ссылка"],"Link checks":["Проверка ссылок"],"Link color":["Цвет ссылки"],"Link color in contrasting blocks":["Цвет ссылок в контрастных блоках"],"Link for all slides":["Общая ссылка"],"Link to web version of the font":["Ссылка на веб-версию шрифта"],"Links":["Ссылки"],"Links validation":["Проверка ссылок"],"Links validation was successfully completed":["Проверка ссылок завершена"],"List OL":["Список OL"],"List UL":["Список UL"],"List item appearance":["Внешний вид элемента списка"],"List of projects":["Список проектов"],"List panel background":["Фон панели списка"],"List settings":["Настройки списка"],"List text style":["Стиль текста списка"],"Lists":["Списки"],"Live preview":["Тест в почтовиках"],"Loading latest changes...":["Загрузка последних изменений..."],"Locally saved version applied":["Применена локально сохраненная версия"],"Lock":["Заблокировать"],"Login for connection":["Логин для подключения"],"Logo must be 2 MB or smaller.":["Логотип должен быть не больше 2 МБ."],"Loop":["Зациклить"],"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.":["С другой стороны, разбавленное изрядной долей эмпатии, рациональное мышление выявляет срочную потребность как самодостаточных, так и внешне зависимых концептуальных решений."],"Lower scores are better. Aim for a score less than ":["Чем ниже балл, тем лучше. Старайтесь набрать как можно меньше."],"Lowercase":["Строчные"],"Lowercase letters (a-z)":["Строчные буквы (a–z)"],"MB":["MB"],"Magenta":["Пурпурный"],"Mailganer":["Mailganer"],"Mailing Name":["Имя рассылки"],"Mailing address":["Почтовый адрес"],"Mailing automation, audience segmentation, and email personalization.":["Автоматизация рассылок, сегментация аудитории и персонализация писем."],"Mailing successfully created!":["Письмо создано!"],"Make columns the same width.":["Сделать колонки одинаковой ширины."],"Managed in billing settings":["Управляется в настройках оплаты"],"Mandatory. Indicates the traffic source. Example: utm_source=google":["Указывает, какой сайт отправил трафик, и является обязательным параметром. Например: utm_source=google"],"Manufacturing":["Производство"],"Margins":["Отступы"],"Markdown":["Markdown"],"Marker shape":["Форма маркера"],"Marketer":["Маркетолог"],"Mass mailing automation, audience segmentation, and campaign performance analytics.":["Автоматизация массовых рассылок, сегментация аудитории и аналитика по кампаниям."],"Max width":["Ширина изображения"],"Maximum 10 tags available.":["Максимум доступно 10 тегов."],"Maximum 64 characters.":["Не длиннее 64 символов."],"Maximum length":["Максимальная длина"],"Maximum width":["Макс. ширина"],"Maximum {0} colors in the palette.":["В палитре не больше {0} цветов."],"Maximum {0} fonts in the project.":["В проекте не больше {0} шрифтов."],"Maximum {0} social networks.":["Не больше {0} соцсетей."],"Media & Marketing":["Медиа и маркетинг"],"Members":["Участники"],"Menus":["Меню"],"Merchant homepage URL":["Ссылка на сайт магазина"],"Merge bottom cell":["Объединить нижнюю ячейку"],"Merge left cell":["Объединить левую ячейку"],"Merge right cell":["Объединить правую ячейку"],"Merge tags":["Переменные"],"Merge top cell":["Объединить верхнюю ячейку"],"Merge with the chosen block":["Объединить с выделенным блоком"],"Message when validation fails":["Сообщение в случае сбоя проверки"],"Minimap":["Миникарта"],"Minimize code":["Минимизировать код"],"Minimum length 8 characters":["Минимальная длина — 8 символов"],"Minimum width":["Мин. ширина"],"Minus":["Минус"],"Mobile":["На мобильном"],"Mobile L – 425px":["Смартфон L – 425px"],"Mobile M – 375px":["Смартфон M – 375px"],"Mobile S – 320px":["Смартфон S – 320px"],"Mobile view":["Мобильный вид"],"Month":["Месяц"],"More editing features":["Больше возможностей редактирования"],"More options":["Больше настроек"],"More settings":["Больше настроек"],"Move %1$d block to folder “%2$s”?":["Переместить %1$d блок в папку «%2$s»?","Переместить %1$d блока в папку «%2$s»?","Переместить %1$d блоков в папку «%2$s»?"],"Move %1$d template to folder “%2$s”?":["Переместить %1$d шаблон в папку «%2$s»?","Переместить %1$d шаблона в папку «%2$s»?","Переместить %1$d шаблонов в папку «%2$s»?"],"Move block “%1$s” to folder “%2$s”?":["Переместить блок «%1$s» в папку «%2$s»?"],"Move down":["Переместить вниз"],"Move stopped":["Перемещение остановлено"],"Move template “%1$s” to folder “%2$s”?":["Переместить шаблон «%1$s» в папку «%2$s»?"],"Move up":["Переместить вверх"],"Moving files from old storage…":["Перенос файлов со старого хранилища…"],"Multi-channel campaigns automation (email, SMS, push, WhatsApp, and more).":["Автоматизация мультиканальных кампаний (email, SMS, push, WhatsApp и другие)."],"Name":["Имя"],"Name must be at most 64 characters.":["Название не длиннее 64 символов."],"Need more?":["Нужно больше?"],"New block title":["Название нового блока"],"New blocks":["Новые блоки"],"New email title":["Новое письмо"],"New emails":["Новые письма"],"New file name is required":["Требуется новое имя файла"],"New folder":["Новая папка"],"New folder name is required":["Требуется название новой папки"],"New password":["Новый пароль"],"New project":["Новый проект"],"Newest first":["Сначала новые"],"Newsletter Subscription":["Подписка на новости"],"Newsletter successfully created!":["Рассылка успешно создана!"],"No":["Нет"],"No access to edit the letter.":["Нет доступа к редактированию письма."],"No analytics data for the selected period.":["За выбранный период данных нет."],"No brand colors yet":["Пока нет цветов бренда"],"No card required: we ask for no payment or personal details.":["Карту привязывать не нужно: ни платёжных, ни персональных данных мы не спросим."],"No emails match the search.":["По запросу не найдено ни одного письма."],"No history records available.":["Записи истории отсутствуют."],"No images found.":["Нет изображений."],"No internet connection":["Нет подключения к Интернету"],"No links found.":["Нет ссылок."],"No logo":["Без логотипа"],"No mailing address found. Add one in ActiveCampaign: ":["Почтовый адрес не найден. Добавьте его в ActiveCampaign: "],"No name":["Без названия"],"No one found":["Никого не нашлось"],"No payments yet.":["Платежей пока нет."],"No problems found.":["Проблем не найдено."],"No project fonts yet":["Пока нет шрифтов проекта"],"No projects match the search.":["По запросу не найдено ни одного проекта."],"No properties to edit.":["Нет свойств для редактирования."],"No related blocks found.":["У этого письма нет привязанных шаблонов."],"No social networks yet":["Пока нет соцсетей"],"Non-profit":["Некоммерческая организация"],"None":["Нет"],"Not available for the current payment settings":["Недоступно при текущих настройках оплаты"],"Not available in this context":["Недоступно в данном контексте"],"Not connected":["Не подключено"],"Not defined":["Не определено"],"Not found in Stripo":["Не найдено в Stripo"],"Not imported":["Не импортировано"],"Not now":["Не сейчас"],"Not set":["Не указано"],"Nothing found in Stripo":["В Stripo ничего не найдено"],"Now":["Сейчас"],"Now create an email":["Теперь создайте письмо"],"OGRN / PSRN":["ОГРН / ПСРН"],"OGRN/PSRN must be 13 or 15 digits":["ОГРН / ПСРН должно состоять из 13 или 15 цифр"],"Offer page URL":["Ссылка на страницу акции"],"Offer page or merchant homepage link starting with https:// is required":["Нужна ссылка на страницу акции или на сайт магазина, начинающаяся с https://"],"Ok. I'll be waiting":["Хорошо. Я подожду"],"Okay. I'll log in.":["Хорошо, я авторизуюсь."],"Oldest first":["Сначала старые"],"On request":["По запросу"],"On the left":["Слева"],"On the right":["Справа"],"Onboarding":["Тур по редактору"],"Only a-z, 0-9, hyphen, dot":["Только a-z, 0-9, дефис, точка"],"Oops! Something went wrong":["Ой! Что-то пошло не так"],"Open draft campaign":["Открыть черновик кампании "],"Open in Bento":["Открыть в Bento"],"Open in Brevo":["Открыть в Brevo"],"Open in Campaign Monitor":["Открыть в Campaign Monitor"],"Open in Constant Contact":["Открыть в Constant Contact"],"Open in Dotdigital":["Открыть в Dotdigital"],"Open in GetResponse":["Открыть в GetResponse"],"Open in HubSpot":["Открыть в HubSpot"],"Open in Klaviyo":["Открыть в Klaviyo"],"Open in Mailchimp":["Открыть в Mailchimp"],"Open in Mailganer":["Открыть в Mailganer"],"Open in Marketing Cloud":["Открыть в Marketing Cloud"],"Open in Sendsay":["Открыть в Sendsay"],"Open in Unisender":["Открыть в Unisender"],"Open in enKod":["Открыть в enKod"],"Optimize":["Оптимизация"],"Optional fields":["Необязательные поля"],"Orange":["Оранжевый"],"Ordered list":["Нумерованный список"],"Organization logo":["Логотип компании"],"Other":["Другое"],"Others":["Другие"],"Outlook":["Outlook"],"Outside":["Снаружи"],"PDF":["PDF"],"PJSC Sberbank":["ПАО «Сбербанк»"],"PNG":["PNG"],"Padding":["Внутренний отступ"],"Paid until: ":["Оплачен до: "],"Palette":["Палитра"],"Password":["Пароль"],"Password for connection":["Пароль для подключения"],"Paste block from clipboard":["Вставить блок из буфера обмена"],"Paste image URL here":["Вставьте URL изображения"],"Pay":["Оплата"],"Payment":["Оплата"],"Payment basis":["Условия оплаты"],"Payment history":["История платежей"],"Payment was successful. Limits will update in a few seconds.":["Оплата прошла успешно. Лимиты обновятся через несколько секунд."],"Payment was successful. New AI generations are now available.":["Оплата прошла успешно. Теперь доступны новые генерации с помощью ИИ."],"Payment was successful. Your plan features are now available.":["Оплата прошла успешно. Теперь вы можете пользоваться всеми возможностями вашего тарифного плана."],"Phone":["Телефон"],"Phone must be 3 to 40 characters and contain digits and separators only.":["Телефон — от 3 до 40 символов, только цифры и разделители."],"Phone number":["Телефон"],"Phone or email":["Телефон или email"],"Pick a color.":["Выберите цвет."],"Picture":["Изображение"],"Placeholder":["Плейсхолдер"],"Placeholder text":["Текст плейсхолдера"],"Plain text":["Простой текст"],"Plan":["Тариф"],"Plan usage statistics":["Статистика использования тарифа"],"Play button":["Кнопка воспроизведения"],"Please accept the agreement":["Пожалуйста, примите соглашение"],"Please add a comment to your request":["Введите комментарий к запросу"],"Please choose":["Пожалуйста, выберите"],"Please choose block type":["Пожалуйста, выберите тип блока"],"Please choose the block type":["Пожалуйста, укажите тип блока"],"Please complete payment on the Billing page.":["Пожалуйста, произведите оплату на странице «Тарифы и оплата»."],"Please complete the captcha":["Пожалуйста, пройдите капчу"],"Please complete the captcha to continue.":["Пожалуйста, пройдите капчу, чтобы продолжить."],"Please enter a URL.":["Пожалуйста, введите адрес."],"Please enter a color name.":["Пожалуйста, введите название цвета."],"Please enter a name.":["Пожалуйста, введите название."],"Please enter a valid email address.":["Введите действительный адрес электронной почты."],"Please enter a valid email.":["Пожалуйста, введите корректный email."],"Please enter the URL.":["Пожалуйста, введите адрес"],"Please enter the block name":["Введите название блока"],"Please enter the correct URL.":["Пожалуйста, введите правильный адрес."],"Please enter the correct email address.":["Пожалуйста, введите корректный адрес почты."],"Please enter the correct email.":["Пожалуйста, введите корректную эл. почту"],"Please enter the description":["Введите описание"],"Please enter the email name":["Введите имя письма"],"Please enter the folder name":["Введите имя папки "],"Please enter the group name":["Введите название группы"],"Please enter the project name":["Пожалуйста, введите название проекта"],"Please enter valid email":["Введите действительный адрес электронной почты"],"Please enter your email address":["Пожалуйста, укажите свой адрес эл. почты"],"Please enter your password":["Пожалуйста, введите свой пароль"],"Please input block name":["Пожалуйста укажите название блока"],"Please input container width":["Пожалуйста, укажите ширину блока"],"Please input tags!":["Пожалуйста, введите теги!"],"Please input type!":["Пожалуйста, введите тип!"],"Please log in":["Необходим вход в систему"],"Please select":["Пожалуйста, выберите"],"Please set the 'Type' field in the Settings section.":["Пожалуйста, заполните поле «Тип» в настройках блока."],"Please set the background color":["Пожалуйста, установите цвет фона"],"Please set the font color":["Установите цвет текста"],"Please type correct emails":["Пожалуйста, введите верные адреса получателей"],"Please type emails":["Пожалуйста, введите адреса получателей"],"Please type subject":["Укажите тему письма"],"Please type the project name.":["Пожалуйста, укажите название проекта."],"Please type the webhook URL.":["Пожалуйста, введите адрес вебхука."],"Please type your email address.":["Пожалуйста, укажите свой адрес электронной почты."],"Please type your password confirmation code.":["Пожалуйста, укажите код подтверждения."],"Please type your password.":["Пожалуйста, введите свой пароль."],"Please upgrade your plan.":["Пожалуйста, обновите тарифный план.\\n"],"Please upload a JPG, PNG, or WebP image.":["Загрузите изображение в формате JPG, PNG или WebP."],"Plugin":["Плагин"],"Plugin connected":["Плагин подключён"],"Plugin connection request":["Заявка на подключение плагина"],"Plugin is not connected":["Плагин не подключён"],"Plus":["Плюс"],"Pointer":["Треугольник"],"Polls":["Опросы"],"Port":["Порт"],"Portrait":["Вертикальная"],"Position in cell":["Положение в ячейке"],"Prefer spaces over tabs.":["Делать табуляцию пробелами."],"Prefix path inside the bucket for project files":["Префикс — путь внутри бакета для файлов проекта"],"Preheader":["Прехедер"],"Preheader copied to email settings":["Прехедер скопирован в настройки письма"],"Preparing countdown preview…":["Готовим превью таймера..."],"Preparing video preview…":["Готовим превью видео..."],"Preview":["Предпросмотр"],"Preview mode":["Предпросмотр"],"Price":["Цена"],"Price currency":["Валюта"],"Price currency must be a three-letter ISO 4217 code, for example USD":["Валюта указывается трёхбуквенным кодом ISO 4217, например USD"],"Privacy Policy.":["Политикой конфиденциальности."],"Product carousel":["Карусель товаров"],"Profile":["Профиль"],"Project":["Проект"],"Project files are stored on the built-in Blocks CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN Blocks. Дополнительно настраивать подключение не нужно."],"Project files are stored on the built-in EmailMaker CDN. No additional connection settings are required.":["Файлы проекта хранятся во встроенной CDN EmailMaker. Дополнительно настраивать подключение не нужно."],"Project information":["Информация о проекте"],"Project name":["Название проекта"],"Project name must be at most 100 characters.":["Название проекта не длиннее 100 символов."],"Project not found.":["Проект не найден."],"Project settings":["Настройки проекта"],"Project styles":["Стили проекта"],"Project styles saved.":["Стили проекта сохранены."],"Project switched to the built-in storage.":["Проект переключён на встроенное хранилище."],"Projects":["Проекты"],"Promo code applied.":["Промокод применен."],"Promocodes":["Промокоды"],"Promotion cards":["Промокарточки"],"Proofreader":["Корректор "],"Psychologist":["Психолог"],"Public URL":["Публичный адрес"],"Public access key":["Публичный ключ доступа"],"Public offer":["Публичная оферта"],"Purple":["Фиолетовый"],"Push block update to all templates":["Применить обновление блока ко всем шаблонам"],"Quarter":["Квартал"],"Radio button":["Радиокнопка"],"Ready-made HTML template for testing the plugin locally.":["Готовый HTML-шаблон, чтобы проверить плагин локально."],"Real Estate":["Недвижимость"],"Real-time notifications about email-related events.":["Уведомления о событиях с письмами в реальном времени."],"Receipt":["Чек"],"Recipients":["Получатели"],"Recommended":["Рекомендуемые"],"Recover":["Восстановить"],"Recover password":["Восстановить пароль"],"Recurring payments disabled":["Автоплатёж отключён"],"Recurring payments enabled":["Автоплатёж включён"],"Red":["Красный"],"Redo (Ctrl+Shift+Z)":["Повторить (Ctrl+Shift+Z)"],"Refresh":["Обновить"],"Refresh inbox":["Обновить почтовый ящик"],"Reload page":["Перезагрузить страницу"],"Remaining:":["Осталось:"],"Remember me":["Запомнить меня"],"Remove":["Удалить"],"Remove annotations":["Удалить аннотации"],"Remove block":["Удалить блок"],"Remove column":["Удалить столбец"],"Remove element":["Удалить элемент"],"Remove element by Delete Key":["Удалить элемент (Delete)"],"Remove file":["Удалить файл"],"Remove group":["Удалить группу"],"Remove logo":["Удалить логотип"],"Remove member":["Удалить участника"],"Remove row":["Удалить строку"],"Remove slide":["Удалить слайд"],"Rename":["Переименовать"],"Rename block":["Переименовать блок"],"Rename email":["Переименовать письмо"],"Reorder block":["Переместить блок"],"Reorder element":["Переместить элемент"],"Reorder group":["Переместить группу"],"Repeat background (repeat)":["Повторять фон (repeat)"],"Repeat background horizontally (repeat-x)":["Горизонтальное повторение фона (repeat-x)"],"Repeat background vertically (repeat-y)":["Вертикальное повторение фона (repeat-y)"],"Repeat the new password":["Повторите новый пароль"],"Replace the preheader":["Вставить в прехедер письма"],"Replace the title":["Вставить в заголовок письма"],"Reply":["Ответить"],"Reply to the comment":["Ответить на комментарий"],"Request for changing the pricing plan":["Запрос на смену тарифа"],"Request sent successfully.":["Запрос отправлен."],"Requests JSON":["JSON с запросами"],"Required field":["Обязательное поле"],"Resend":["Отправить повторно"],"Responsive email":["Адаптировать письмо в моб. устройствах"],"Restore %1$d block to folder “%2$s”?":["Восстановить %1$d блок в папку «%2$s»?","Восстановить %1$d блока в папку «%2$s»?","Восстановить %1$d блоков в папку «%2$s»?"],"Restore %1$d template to folder “%2$s”?":["Восстановить %1$d шаблон в папку «%2$s»?","Восстановить %1$d шаблона в папку «%2$s»?","Восстановить %1$d шаблонов в папку «%2$s»?"],"Restore block “%1$s” to folder “%2$s”?":["Восстановить блок «%1$s» в папку «%2$s»?"],"Restore template “%1$s” to folder “%2$s”?":["Восстановить шаблон «%1$s» в папку «%2$s»?"],"Resume":["Резюме"],"Retail & E-commerce":["Розница и e-commerce"],"Retry":["Повторить"],"Retry failed":["Повторить неудавшиеся"],"Retrying in %s sec (%d of %d)...":["Повторная попытка через %s секунд (%d из %d)..."],"Reverse order on desktop":["Изменить порядок в десктопе"],"Revoke the invite":["Отозвать приглашение"],"Right":["Справа"],"Right Code panel":["Панель кода справа"],"Right padding":["Отступ справа"],"Right to left":["Справа налево"],"Role":["Роль"],"Rotate":["Перевыпустить"],"Rotate client secret?":["Перевыпустить Client Secret?"],"Rotate secret":["Перевыпустить секрет"],"Round":["Круглый"],"Rounded corners in Outlook (VML)":["Закругленные углы в Outlook (VML)"],"SMS":["СМС"],"Safe Fonts":["Безопасные шрифты"],"Sandbox HTML file":["HTML-файл песочницы"],"Sans Serif":["Sans Serif"],"Save":["Сохранить"],"Save %d block":["Сохранить %d блок","Сохранить %d блока","Сохранить %d блоков"],"Save all blocks":["Сохранить все блоки"],"Save and continue":["Сохранить и продолжить"],"Save block":["Сохранить блок"],"Save by Ctrl+S":["Ctrl+S"],"Save by ⌘S":["Сохранить ( ⌘S )"],"Save email first.":["Сначала сохраните письмо."],"Save the block before commenting.":["Сохраните блок перед комментированием."],"Save the email before commenting.":["Сохраните письмо перед комментированием."],"Save to Blocks":["Сохранить в Блоки"],"Save to Blocks button.":["Сохранить в Блоки"],"Saved blocks":["Сохранённые блоки"],"Saving changes in the block":["Сохранение изменений в блоке"],"Saving failed":["Сохранение не удалось"],"Search":["Поиск"],"Search GIFs":["Поиск GIF"],"Search a block":["Найти блок"],"Search by name":["Поиск по названию"],"Search by title":["Поиск по названию"],"Search image":["Поиск изображения"],"Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.":["В обширной галерее стоковых фотографий и GIF-файлов вы найдете изображения для любого случая. Вы можете отфильтровать результаты по ориентации изображения, цветовой гамме и т. д."],"Secret Access Key":["Секретный ключ доступа"],"Secret access key":["Секретный ключ доступа"],"Secret is masked. Use Rotate to get a new secret once.":["Секрет скрыт. Нажмите «Перевыпустить», чтобы один раз увидеть новый."],"Section":["Раздел"],"Section ":["Раздел"],"Section title":["Заголовок раздела"],"Security":["Безопасность"],"Select a font family":["Выберите шрифт"],"Select a theme":["Выберите тему"],"Select all %d":["Выбрать все: %d"],"Select company size":["Выберите размер компании"],"Select email template":["Выберите шаблон письма"],"Select industry":["Выберите отрасль"],"Select period":["Выберите период"],"Select plan":["Выбрать тариф"],"Select the block type to find any block on the list faster.":["Выберите тип блока, чтобы быстрее найти любой блок в списке."],"Select the time zone":["Выберите часовой пояс"],"Selected %1$d, your plan allows %2$d more emails.":["Выбрано: %1$d, по тарифу можно создать ещё писем: %2$d."],"Send":["Отправить"],"Send a test email":["Отправить тест"],"Send again":["Повторить"],"Sender Email":["Email отправителя"],"Sender Name":["Имя отправителя"],"Sendsay":["Sendsay"],"Separators":["Разделители"],"Serif":["Serif"],"Server is unavailable":["Сервер недоступен"],"Set":["Установить"],"Set new password":["Установить новый пароль"],"Set the type":["Укажите тип"],"Settings":["Настройки"],"Shadow inside or outside of the element":["Если включено, то тень будет внутри элемента."],"Share":["Поделиться"],"Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.":["Поделитесь проектом со своей командой и сотрудничайте в режиме реального времени. Добавляйте комментарии к отдельным блокам писем и обсуждайте необходимые правки прямо в конструкторе."],"Short company name":["Краткое название компании"],"Show eye icon":["Показать иконку глаза"],"Show more":["Показать ещё"],"Shuffle options":["Параметры перемешивания"],"Sign In":["Войти"],"Sign Up":["Зарегистрироваться"],"Sign in to your account to activate the trial period.":["Войдите в свою учетную запись, чтобы активировать пробный период."],"Sign in with eLama":["Войти через eLama"],"Sign out":["Выйти"],"Single image preview":["Одно изображение"],"Single quotation":["Кавычка"],"Site":["Сайт"],"Size":["Размер"],"Small desktop – 768px":["Небольшой десктоп – 768px"],"Social buttons":["Кнопки соцсетей"],"Social media":["Соцсети"],"Social network name":["Название соцсети"],"Social network settings":["Настройки соцсети"],"Social networks":["Соцсети"],"Solid":["Сплошная"],"Some blocks were not saved successfully.":["Некоторые блоки не были сохранены."],"Some images were left as links to Stripo":["Часть картинок осталась ссылками на Stripo"],"Something went wrong":["Ошибка редактирования. Обратитесь в техподдержку."],"Something went wrong during layout conversion. You can try running the conversion again.":["При конвертации шаблона произошла ошибка. Вы можете повторить конвертацию."],"Something went wrong, please try again":["Что-то пошло не так. Попробуйте ещё раз."],"Something went wrong.":["Что-то пошло не так."],"Something went wrong. Try again later.":["Что-то пошло не так. Попробуйте позже."],"Soon":["Скоро"],"Sorry, the page you visited does not exist.":["Извините, страница, которую вы посетили, не существует."],"Source code validation":["Проверка кода"],"Spacer":["Отступ"],"Spacing":["Интервал"],"Spam checks":["Проверка на спам"],"Spam validation was successfully completed":["Проверка на спам завершена"],"SpamAssassin":["SpamAssassin"],"Special characters":["Специальные символы"],"Specifies the block width.":["Задаёт ширину блока."],"Split blocks":["Разделить блоки"],"Split cell":["Разделить ячейку"],"Spread radius":["Распространение"],"Square":["Квадрат"],"Squarish":["Квадратная"],"Star":["Звезда"],"Start Trial":["Начать Триал"],"Start date":["Дата начала"],"Start from scratch":["Начать с чистого листа"],"Start the trial":["Включить пробный период"],"Start typing the title":["Начните писать название"],"Start with a detailed description of your email.":["Начните с подробного описания вашего письма."],"Starts":["Начало"],"Status":["Статус"],"Stay":["Остаться"],"Stock":["Фотосток"],"Stock photos and GIFs":["Стоковые изображения"],"Stopping…":["Остановка…"],"Storage settings":["Настройки хранилища"],"Storage type":["Тип хранилища"],"Stored or bound value for this field":["Сохраненное или заданное значение для этого поля"],"Stored or bound value for this option":["Сохраненное или заданное значение для этого параметра"],"Strikethrough ( Alt+Shift+5 )":["Зачёркнутый ( Alt+Shift+5 )"],"Strikethrough ( ⌘+Shift+X )":["Зачёркнутый ( ⌘+Shift+X )"],"Stripo API key":["API-ключ Stripo"],"Stripo did not accept this key. Check that it is the REST API key of your Stripo project.":["Stripo не принял этот ключ. Проверьте, что это ключ REST API вашего проекта Stripo."],"Stripo did not respond":["Stripo не ответил"],"Stripo is not responding. Try again later.":["Stripo не отвечает. Попробуйте позже."],"Stripo stopped accepting the API key. Update the key and repeat the import.":["Stripo перестал принимать API-ключ. Обновите ключ и повторите импорт."],"Stripo templates become project templates, emails become emails. Folders are recreated, images are copied to the project storage. Items already imported are skipped when you select all.":["Шаблоны Stripo станут шаблонами проекта, письма — письмами. Папки будут воссозданы, картинки скопированы в хранилище проекта. При выборе всех уже импортированные элементы пропускаются."],"Stroke color":["Цвет контура"],"Strong":["Полужирный"],"Strong ( Ctrl+B )":["Полужирный ( Ctrl+B )"],"Strong ( ⌘B )":["Полужирный ( ⌘B )"],"Subject":["Тема"],"Subject line & preheader generator":["Генератор темы и прехедера"],"Subscription ID is missing":["Отсутствует идентификатор подписки"],"Subscription summary":["Сведения о подписке"],"Success":["Готово"],"Success!":["Готово!"],"Supported formats: .woff, .woff2, .ttf, .otf. Maximum file size is 5 MB.":["Поддерживаемые форматы: .woff, .woff2, .ttf, .otf. Файл не больше 5 МБ."],"Supported: .woff, .woff2, .ttf, .otf — up to {0} MB.":["Поддерживаются .woff, .woff2, .ttf, .otf — до {0} МБ."],"Swap columns":["Поменять местами"],"Switch to a different plan to save more emails.":["Перейдите на другой тариф, чтобы иметь возможность сохранять новые шаблоны."],"Syncing with the server in the background...":["Происходит синхронизация с сервером в фоновом режиме..."],"System":["Системная"],"System theme":["Системная тема"],"TIN (INN)":["ИНН"],"TIN (INN) must be 10 or 12 digits":["ИНН должен состоять из 10 или 12 цифр"],"Tab size":["Величина отступа"],"Table":["Таблица"],"Table view":["Таблица"],"Table width":["Ширина таблицы"],"Tags":["Теги"],"Tags help you find the block in the list.":["Теги помогают найти блок в списке."],"Tariff and payment":["Тариф и оплата"],"Teal":["Бирюзовый"],"Team collaboration":["Командная работа"],"Technical support":["Техническая поддержка"],"Technology & Software":["Технологии и ПО"],"Template":[" Шаблон"],"Template Name":["Название шаблона"],"Template blocks":["Блоки шаблона"],"Template conversion":["Конвертация шаблона"],"Template from another editor":["Шаблон из другого редактора"],"Template is not mobile-friendly":["Шаблон может некорректно отображаться в телефоне"],"Template successfully created!":["Шаблон создан!"],"Templates":["Шаблоны"],"Terms":["Условиями использования"],"Test sends":["Тесты отображения"],"Text":["Текст"],"Text & background":["Текст и фон"],"Text align center":["Текст по центру"],"Text align center ( Ctrl+Shift+E )":["По центру ( Ctrl+Shift+E )"],"Text align center ( ⌘+Shift+E )":["По центру ( ⌘+Shift+E )"],"Text align justify":["Текст по ширине"],"Text align justify ( Ctrl+Shift+J )":["По ширине ( Ctrl+Shift+J )"],"Text align justify ( ⌘+Shift+J )":["По ширине ( ⌘+Shift+J )"],"Text align left":["Текст слева"],"Text align left ( Ctrl+Shift+L )":["По левому краю ( Ctrl+Shift+L )"],"Text align left ( ⌘+Shift+L )":["По левому краю ( ⌘+Shift+L )"],"Text align right":["Текст справа"],"Text align right ( Ctrl+Shift+R )":["По правому краю ( Ctrl+Shift+R )"],"Text align right ( ⌘+Shift+R )":["По правому краю ( ⌘+Shift+R )"],"Text background":["Фон текста"],"Text beside the box":["Текст рядом с полем"],"Text color":["Цвет текста"],"Text copied to clipboard":["Скопировано в буфер обмена"],"Text font":["Шрифт текста"],"Text replacer":["Замена текста"],"Text size":["Размер текста"],"Text subscript":["Подстрочный текст"],"Text superscript":["Надстрочный текст"],"Text visible at the start":["Текст, отображаемый в начале"],"That\`s all we could find.":["Это все, что мы смогли найти."],"The ":[" "],"The Pro plan is not available.":["Тариф «Pro» недоступен."],"The URL that the hyperlink directs to.":["URL, на который указывает ссылка."],"The account number must be 20 digits":["Номер счета должен состоять из 20 цифр"],"The align attribute sets the horizontal alignment of the table.":["Атрибут align устанавливает горизонтальное выравнивание таблицы."],"The block \\"":["Блок «"],"The block was successfully renamed.":["Блок переименован."],"The block was successfully saved.":["Блок сохранен."],"The block will change its colors to contrasting colors. You can change them in the Content Styles section.":["Блок изменит свои цвета на контрастные. Вы можете изменить их в разделе «Стили контента»."],"The block “":["Блок «"],"The captcha is invalid or expired. Please try again.":["Капча неверна или срок её действия истек. Пожалуйста, попробуйте ещё раз."],"The code size exceeds the recommended value 90kB":["Размер кода превышает рекомендуемое значение 90 кБ."],"The code that will replace this text":["Код, который заменит этот текст"],"The copies were successfully created.":["Копии созданы."],"The copy of block “":["Копия блока «"],"The copy of email \\"":["Копия письма \\""],"The current code size is":["Текущий размер кода составляет"],"The current template will be changed to the generated one, are you sure about this?":["Текущий шаблон будет заменен на сгенерированный, вы уверены в этом?"],"The draft of the block has been deleted.":["Черновик блока удалён."],"The draft of the email has been deleted.":["Черновик письма удалён."],"The email \\"":["Письмо \\""],"The email has been copied to the clipboard.":["Код письма скопирован в буфер обмена."],"The email limit of your plan has been reached.":["Лимит писем вашего тарифа исчерпан."],"The email was successfully renamed.":["Письмо переименованно."],"The email was successfully saved.":["Письмо сохранено."],"The email “":["Письмо «"],"The feature is under development.":["Функционал находится в разработке."],"The folder \\"":["Папка «"],"The folder “":["Папка «"],"The font-size CSS property sets the size of the font.":["Свойство font-size устанавливает размер шрифта."],"The global block was updated.":["Глобальный блок был обновлён."],"The group “":["Группа «"],"The image could not be uploaded.":["Не удалось загрузить изображение."],"The image was successfully uploaded.":["Изображение загружено."],"The import failed. Try again later.":["Импорт не удался. Попробуйте позже."],"The inbox has been updated.":["Почтовый ящик обновлён."],"The invitation has been sent":["Приглашение отправлено"],"The maximum number of requests for the current subscription period has been reached.\\nSelect the appropriate plan to fulfil more requests":["Максимальное количество запросов для текущего периода подписки достигнуто.\\nВыберите соответствующий тариф для выполнения большего количества запросов."],"The password does not meet the requirements:":["Пароль не соответствует требованиям безопасности:"],"The password is too simple.":["Слишком простой пароль."],"The payment widget failed to load. Refresh the page and try again.":["Не удалось загрузить виджет оплаты. Обновите страницу и попробуйте ещё раз."],"The previous secret will stop working immediately.":["Прежний секрет перестанет работать сразу."],"The project \\"":["Проект «"],"The saved key no longer works. Enter a new one.":["Сохранённый ключ больше не работает. Введите новый."],"The selected element is in the block that supports a multicolumn structure. To add a new column, click the \\"Add a column\\" button.":["Выделенный элемент находится в блоке, в котором можно организовать многоколоночную структуру. Для добавления новой колонки нажмите кнопку «Добавить колонку»."],"The server returned an unexpected response. Please try again or contact support.":["Сервер вернул неожиданный ответ. Попробуйте ещё раз или обратитесь в службу поддержки."],"The specified parameters will be added to all links when exporting the email.":["Специальные параметры будут добавлены во все ссылки при экспорте."],"The test email will be sent to the specified addresses.":["Тестовое письмо будет отправлено на указанные адреса."],"The title of the email is displayed in the list of the templates and usually matches the subject line, but you can change it.":["Название отображается в списке шаблонов и зачастую совпадает с темой письма, но вы можете его изменить."],"The trash is empty.":["Корзина пуста."],"The trial has ended. You are on the Free plan.":["Пробный период закончился. Вы пользуетесь тарифом «Free»."],"The two passwords that you entered do not match!":["Два введенных вами пароля не совпадают!"],"The usage limit has been exceeded":["Превышен лимит использования"],"The whole email":["Всё письмо"],"Theme":["Тема"],"There are no blocks for this request.":["По данному запросу ничего не найдено."],"There are no members yet":["Участников пока нет"],"There's no such comment.":["Нет такого комментария."],"There's no such element in the email.":["В письме нет такой метки."],"These global blocks have a newer saved version. Select the ones to update in the template.":["Для этих глобальных блоков имеется более новая сохраненная версия. Выберите в шаблоне те из них, которые необходимо обновить."],"This action cannot be undone.":["Это действие нельзя отменить."],"This and other features are available for you on a higher plan.":["Эти и другие функции доступны для вас на более старшем тарифном плане."],"This can be the name of your company, department, website, project, marketing campaign, or other activity.":["Это может быть название вашей компании, отдела, веб-сайта, проекта или сферы деятельности, для которой вы планируете создать рассылку."],"This element":["Этот элемент"],"This email must be verified in Mailganer":["Адрес необходимо подтвердить в Mailganer"],"This email must be verified in Sendsay":["Адрес необходимо подтвердить в Sendsay"],"This email must be verified in Unisender":["Адрес необходимо подтвердить в Unisender"],"This field is required":["Это обязательное поле"],"This field sets the width of the email.":["Это поле выставляет ширину письма."],"This is a global block. You can create a new one to apply changes only in this email, or update the current one — then the changes will be applied everywhere this block is used.":["Это глобальный блок. Вы можете создать новый блок, чтобы изменения вступили в силу только в этом письме, или обновить текущий — в этом случае изменения будут применены везде, где используется этот блок."],"This layout was not created in our editor. Convert it to unlock full editing capabilities: easily change texts, replace images, and manage blocks.":["Этот шаблон не был создан в нашем редакторе. Преобразуйте его, чтобы получить доступ ко всем возможностям редактирования: легко изменяйте тексты, заменяйте изображения и управляйте блоками."],"This link cannot be used as a font source.":["Эту ссылку нельзя использовать как источник шрифта."],"This may take several minutes. Please keep this tab open.":["Это может занять несколько минут. Пожалуйста, не закрывайте эту вкладку."],"This promo code is already applied.":["Промокод уже применен."],"This section will be implemented in a separate task.":["Раздел пока в разработке."],"This template was created in another editor. Rebuild it from our components to get stable rendering, error-free editing, and full design control.":["Этот шаблон создан в другом редакторе. Пересоберите его из наших компонентов и получите стабильное отображение, редактирование без ошибок и полный контроль над дизайном."],"Time":["Время"],"Time units font settings":["Шрифт единиц времени"],"Time zone":["Часовой пояс"],"Title":["Название"],"Title copied to email settings":["Заголовок скопирован в настройки письма"],"Title should not be empty":["Заголовок не должен быть пустым"],"Title shown above the control":["Название, отображаемое над элементом управления"],"To add a block from the dashboard click the":["Чтобы добавить блок, нажмите в визуальном редакторе письма кнопку"],"To avoid this issue, disable translation for this site in your browser settings or turn off auto-translate.":["Чтобы избежать этой проблемы, отключите перевод данного сайта в настройках браузера или отключите функцию автоматического перевода."],"To change the appearance of the element on the mobile device, edit the fields below. If the fields remain empty, the desktop styles will be applied to the mobile version.":["Для изменения внешнего вида элемента в мобильном устройстве, внесите правки в поля ниже. Если поле пустое, то в мобильной версии применятся стили для десктопа."],"To create a copy, you need to save the block.":["Чтобы создать копию, вы должны сохранить блок."],"To create a copy, you need to save the email.":["Чтобы создать копию, вы должны сохранить письмо."],"To emails":["В письма"],"To fully address all necessary tasks in any field":["Чтобы в полной мере решить все необходимые задачи в любой области"],"To get started quickly":["Чтобы быстро приступить к работе"],"To import from Stripo, add the REST API key of your Stripo project: <1>open the project settings in Stripo</1>, find “Access the REST API” and generate a key.":["Чтобы импортировать из Stripo, добавьте ключ REST API вашего проекта Stripo: <1>откройте настройки проекта в Stripo</1>, найдите «Access the REST API» и сгенерируйте ключ."],"To leave comments you must be logged into Blocks and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To leave comments you must be logged into EmailMaker and added to the project ":["Чтобы оставлять комментарии, вы должны быть авторизованы и добавлены в проект "],"To preview and edit the uploaded image":["Предварительный просмотр и редактирование загруженного изображения"],"To send a test email, you need to confirm your email address. If you haven’t received the confirmation link, contact support in the chat or email {supportEmail}.":["Чтобы отправить тестовое письмо, вам необходимо подтвердить свой адрес электронной почты. Если вы не получили ссылку для подтверждения, обратитесь в службу поддержки через чат или по электронной почте {supportEmail}."],"Today":["Сегодня"],"Too many items selected. One import takes up to 1000 items.":["Выбрано слишком много. Один импорт берёт до 1000 элементов."],"Tooltip or hint text":["Всплывающая подсказка или текст подсказки"],"Tooltip text":["Текст всплывающей подсказки"],"Top":["Сверху"],"Top left corner":["Верхний левый угол"],"Top margin":["Отступ сверху"],"Top padding":["Отступ сверху"],"Top right corner":["Верхний правый угол"],"Top up balance":["Пополнить баланс"],"Transfer to folder":["Переместить"],"Translator":["Переводчик"],"Transparency":["Прозрачность"],"Trial":["Триал"],"Trial activated":["Пробная версия активирована"],"Trial active":["Пробная версия активна"],"Trial period activated.":["Пробный период активирован."],"Try again":["Попробовать ещё раз"],"Try every editor feature — free":["Попробуйте все возможности редактора — бесплатно"],"Try for free":["Попробуйте бесплатно"],"Try reloading the page.":["Попробуйте перезагрузить страницу."],"Try sign in with your new password.":["Попробуйте войти с новым паролем."],"Turn on a 14-day trial and the whole editor opens up:":["Включим пробный период на 14 дней — и редактор откроется целиком:"],"Type":["Тип"],"Type category here":["Укажите категорию"],"Type in the project's webhook":["Введите проект webHook"],"Type subject":["Укажите тему письма"],"Type the output parameters of your platform. E.g., ":["Указывайте символы вывода параметра вашей платформы. Например, "],"Type title here":["Введите название"],"Type your description here":["Введите описание"],"Type your request":["Введите ваш запрос"],"Type your tags here":["Укажите теги"],"Typing...":["Ввод текста..."],"Typograf":["Типограф"],"Typography":["Типограф"],"URL":["URL"],"URL must start with https://":["Адрес должен начинаться с https://"],"URL of the video clip.":["URL-адрес видеоклипа."],"UTM parameters":["UTM-метки"],"Unavailable":["Недоступно"],"Underline":["Подчёркнутый"],"Underline ( Ctrl+U )":["Подчёркнутый ( Ctrl+U )"],"Underline ( ⌘U )":["Подчёркнутый ( ⌘U )"],"Undo (Ctrl+Z)":["Отменить (Ctrl+Z)"],"Unisender":["Unisender"],"Unknown error":["Неизвестная ошибка"],"Unknown integration":["Неизвестная интеграция"],"Unlimited possibilities with the PRO plan":["Безграничные возможности с тарифом PRO"],"Unlock":["Разблокировать"],"Unordered list":["Ненумерованный список"],"Unsaved changes":["Несохранённые изменения"],"Untitled email.":["Письмо без названия."],"Up to parent element":["Перейти к контейнеру"],"Update":["Обновить"],"Update current block":["Обновить текущий блок"],"Update date":["Дата обновления"],"Update global blocks":["Обновить глобальные блоки"],"Updated":["Обновлено"],"Upload":["Загрузить"],"Upload .woff, .woff2, .ttf or .otf files for use in the email editor.":["Загрузите файлы .woff, .woff2, .ttf или .otf, чтобы использовать их в редакторе писем."],"Upload Image":["Загрузить изображение"],"Upload failed":["Загрузка не удалась"],"Upload first font":["Загрузить первый шрифт"],"Upload font":["Загрузить шрифт"],"Upload logo":["Загрузить логотип"],"Upload your email":["Загрузить своё письмо"],"Uppercase":["Заглавные"],"Uppercase letters (A-Z)":["Заглавные буквы (A–Z)"],"Usage analytics":["Аналитика использования"],"Use custom icon for checked state":["Использовать пользовательскую иконку для отмеченного состояния"],"Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.":["Используйте наш визуальный редактор, чтобы настроить каждый элемент под свои нужды: изменить рамки и их радиус, тени, отступы, фон и многое другое."],"Use this email as a template for creating future emails.":["Используйте это письмо в качестве шаблона для создания будущих писем."],"Use this one":["Использовать эту"],"Use your own styles instead of defaults for states such as error, focus, and success.":["Используйте собственные стили вместо стандартных для таких состояний, как «ошибка», «фокус» и «успех»."],"Used":["Используемые"],"User":["Пользователь"],"Username":["Логин"],"VAT":["НДС"],"Valid":["Верно"],"Valid until":["Оплачен до"],"Validation error message":["Сообщение об ошибке проверки"],"Value":["Значение"],"Variable value":["Значение переменной"],"Version history":["Контроль версий"],"Version of":["Версия от"],"Vertical":["Вертикальный"],"Vertical alignment":["Верт. выравнивание"],"Vertical offset":["Верт. смещение"],"Vertical padding":["Вертикальный отступ"],"Vertical position":["Верт. смещение"],"Video":["Видео"],"Video URL":["URL-адрес видео"],"View only — you cannot edit settings in this section.":["Только просмотр — настройки в этом разделе менять нельзя."],"Vimeo":["Vimeo"],"Visibility":["Видимость"],"Visibility in AMP":["Видимость в AMP"],"Visit site":["Перейти на сайт"],"Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.":["Хотите изменить размер изображения, добавить текст или применить фильтр? Не нужно покидать EmailMaker! Все основные изменения вы можете сделать в нашем редакторе изображений."],"Warning":["Предупреждение"],"Warnings":["Предупреждения"],"We are always in touch":["Мы всегда на связи"],"We removed the injected code automatically. To avoid this issue, disable the extension for this site or use the editor in an incognito window without extensions.":["Мы автоматически удалили внедренный код. Чтобы избежать этой проблемы, отключите расширение для этого сайта или воспользуйтесь редактором в окне инкогнито без расширений."],"Web version":["Веб-версия"],"Webhook":["WebHook"],"Webhook URL":["Вебхук"],"Webhook settings":["Настройки вебхука"],"Webhook successfully sent!":["WebHook отправлен!"],"Website link":["Ссылка на сайт"],"Week":["Неделя"],"What's new":["Что нового"],"When the trial ends, the service switches to the free plan.":["Когда триал закончится, сервис перейдёт в бесплатный режим."],"When the trial ends, you will return to the Free plan.":["По окончании пробного периода вы вернётесь к тарифу «Free»."],"When you need more letters, additional projects and participants":["Если вам понадобится больше писем, дополнительных проектов и участников"],"While editing, some elements of the email no longer fit the screen of the mobile device. Check that these elements are set to a smaller width for mobile devices.":["Похоже, при редактировании шаблона, некоторые элементы перестали помещаться в экран мобильного устройства. Попробуйте уменьшить их ширину."],"White":["Белый"],"White circle":["Белый круг"],"White circle outlined":["Белый круг обводка"],"Width":["Ширина"],"With VAT":["С НДС"],"With VAT / without VAT":["С НДС / без НДС"],"With warnings":["С предупреждениями"],"Without VAT":["Без НДС"],"Without background color":["Без цвета фона"],"Without button":["Без кнопки"],"Without folder":["Без папки"],"Without shadow":["Без тени"],"Work with the HTML code":["Работа с HTML-кодом"],"Work with your markup":["Работайте со своей вёрсткой"],"Year":["Год"],"Yes":["Да"],"You are buying a set of AI generation requests:":["Вы приобретаете набор запросов на генерацию с помощью ИИ:"],"You are buying an extra email generation package:":["Вы приобретаете дополнительный пакет для создания писем:"],"You are buying an extra image check package:":["Вы приобретаете дополнительный пакет проверки изображений:"],"You are buying an extra image generation package:":["Вы приобретаете дополнительный пакет для генерации изображений:"],"You are buying an extra link check package:":["Вы приобретаете дополнительный пакет проверки ссылок:"],"You are buying an extra optimization package:":["Вы приобретаете дополнительный пакет оптимизации:"],"You are buying an extra preview/test sends package:":["Вы приобретаете дополнительный пакет тестов:"],"You are buying an extra spam check package:":["Вы приобретаете дополнительный пакет проверки на спам:"],"You are paying for the plan:":["Вы оплачиваете тарифный план:"],"You are running out of AI tool usage.":["Ваш лимит использования инструментов ИИ подходит к концу."],"You can activate a 2-week trial version that includes access to all features.":["Вы можете активировать 2-недельную пробную версию, которая включает доступ ко всем функциям."],"You can add more generations right now; they are billed separately from the generations included in your plan.":["Вы можете добавить дополнительные генерации прямо сейчас; их стоимость оплачивается отдельно от генераций, включенных в ваш тарифный план."],"You can also save all blocks at once. The AI assistant will automatically determine the type and create a name for each block when saving.":["Вы также можете сохранить все блоки сразу. ИИ ассистент автоматически определит тип и создаст имя для каждого блока при сохранении."],"You can close this window: the import continues in the background.":["Окно можно закрыть: импорт продолжится в фоне."],"You can get more emails and access to all features.":["Вы сможете создавать больше писем и получить доступ ко всем функциям."],"You can increase the limit by changing your plan or buying an extra package.":["Вы можете увеличить лимит, сменив тарифный план."],"You can increase the number of emails right now.":["Вы можете увеличить количество писем прямо сейчас."],"You can save blocks from the email template.":["Вы можете сохранить блоки из шаблона письма."],"You cannot switch plans because a limit has been exceeded.":["Вы не можете сменить тарифный план, так как превышен лимит."],"You changed the role of ":["Вы поменяли роль "],"You deleted ":["Вы исключили пользователя "],"You deleted yourself from the project successfully.":["Вы исключили себя из проекта."],"You do not have permission to edit project styles.":["У вас нет прав на редактирование стилей проекта."],"You do not have permission to view this section.":["У вас нет прав на просмотр этого раздела."],"You don't have any blocks in this folder.":["У вас нет блоков в этой папке."],"You don't have any blocks yet.":["У вас еще нет сохранённых блоков."],"You don't have any emails in this folder.":["В папке пока нет писем."],"You don't have any emails yet.":["У вас еще нет сохранённых писем."],"You don't have any projects yet.":["У вас пока нет проектов."],"You don\`t have any saved blocks yet.":["У вас ещё нет сохранённых блоков."],"You have reached the limit of AI chat usage.":["Вы достигли предела использования чата ИИ.\\n"],"You have reached the limit of AI generator usage.":["Вы достигли предела использования генератора ИИ.\\n"],"You have unsaved changes. Leave this page without saving?":["У вас есть несохранённые изменения. Покинуть страницу без сохранения?"],"You have used up the number of emails you can create on your current plan":["Вы исчерпали лимит на количество писем, которое можно создать в рамках вашего текущего тарифа"],"You have used up your AI generations":["Вы исчерпали лимит генераций ИИ"],"You have used up your image check limit":["Вы исчерпали лимит проверки изображений"],"You have used up your image generation limit":["Вы исчерпали лимит на генерацию изображений"],"You have used up your link check limit":["Вы исчерпали лимит проверок ссылок"],"You have used up your optimisation limit":["Вы исчерпали лимит оптимизаций"],"You have used up your preview (test send) limit":["Вы исчерпали лимит на просмотр в почтовиках"],"You have used up your spam check limit":["Вы исчерпали лимит проверок на спам"],"You reached the plan limit":["Достигнут лимит тарифа"],"You revoke invite for ":["Вы отзываете приглашение для "],"Your Altcraft Platform URL (Cloud: ru.altkraft.com or your On-Premises URL)":["URL вашей платформы Altcraft (облачная версия: ru.altkraft.com или URL вашей локальной версии)"],"Your Sendsay account login (not email). For sublogin use format: account/sublogin":["Ваш логин в Sendsay (не email). Для ввода дополнительного логина используйте формат: account/sublogin"],"Your company":["Ваша компания"],"Your current plan":["Ваш текущий тариф"],"Your email doesn't look like spam.":["Ваше письмо не похоже на спам."],"Your generations are running out soon":["Генерации с помощью ИИ скоро закончатся"],"Your letter contains %d block that can be saved for future use.":["Ваше письмо содержит %d блок, который можно сохранить для использования в будущем.","Ваше письмо содержит %d блока, которые можно сохранить для использования в будущем.","Ваше письмо содержит %d блоков, которые можно сохранить для использования в будущем."],"Your package is activated":["Пакет активирован"],"Your password successfully reset.":["Ваш пароль успешно сброшен."],"Your password was successfully changed.":["Ваш пароль успешно изменен."],"Your plan is activated":["Тариф активирован"],"Your plan will expire soon":["Ваш тариф скоро закончится"],"Your profile was successfully updated.":["Настройки сохранены."],"Your project has incoming email":["У вашего проекта есть входящая почта"],"Your templates and emails":["Ваши шаблоны и письма"],"Youtube Black":["Youtube Чёрный"],"Youtube Red":["Youtube Красный"],"Youtube White":["Youtube Белый"],"Z-A":["Я-А"],"ZIP":["ZIP-архив"],"accordion":["аккордеон"],"and":["и"],"before %s":["до %s"],"block":["Блок","",""],"block\\u0004\\" was successfully removed.":["» удалён."],"block\\u0004Are you sure to delete selected blocks?":["Вы уверены, что хотите удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete selected blocks?":["Вы уверены, что хотите безвозвратно удалить выбранные блоки?"],"block\\u0004Are you sure to irrevocably delete the “":["Вы уверены, что хотите удалить «"],"block\\u0004Are you sure you want to delete the “":["Вы уверены, что хотите удалить блок «"],"block\\u0004locked.":["заблокирован."],"block\\u0004unlocked.":["разблокирован."],"block\\u0004” was successfully created.":["» создана."],"block\\u0004” was successfully removed.":["» удалён."],"border\\u0004Width":["Толщина"],"button":["кнопка"],"carousel":["карусель"],"cell":["ячейка"],"column":["колонка"],"confirmation code":["код подтверждения"],"container":["контейнер"],"copy\\u0004\\" was successfully created.":["» создана."],"countdown":["таймер"],"cpc":["cpc"],"day":["день","дня","дней"],"e.g., 123456":["Например, 123456"],"e.g., Newsletter June 2026":["Например, дайджест за июнь"],"e.g., Special offer for you!":["Например: Специальное предложение!"],"e.g., Your Company":["Например, Ваша компания"],"e.g., https://ru.altkraft.com":["Например, https://ru.altkraft.com"],"e.g., myaccount or myaccount/sublogin":["Например, myaccount или myaccount/sublogin"],"element":["элемент"],"email":["эл. почта"],"email\\u0004\\" was successfully removed.":["\\" удалено."],"email\\u0004Are you sure to delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to delete selected emails?":["Вы уверены, что хотите удалить выбранные письма?"],"email\\u0004Are you sure to irrevocably delete \\"":["Вы уверены, что хотите удалить письмо «"],"email\\u0004Are you sure to irrevocably delete selected emails?":["Вы уверены, что хотите безвозвратно удалить выбранные письма?"],"email\\u0004locked.":["заблокировано."],"email\\u0004unlocked.":["разблокировано."],"empty link":["пустая ссылка"],"empty src":["нет картинки"],"enKod":["enKod"],"expanded":["Раскрыт"],"folder\\u0004\\" was successfully created.":["» создана."],"folder\\u0004Are you sure to delete “":["Вы уверены, что хотите удалить папку «"],"folder\\u0004” was successfully changed to “":["» переименована в «"],"google":["google"],"group":["группа"],"group\\u0004All":["Все"],"group\\u0004Are you sure to delete “":["Вы уверенны, что хотите удалить группу «"],"group\\u0004Project":["Проектные"],"group\\u0004Standard":["Стандартные"],"group\\u0004” was successfully changed to “":["» переименована в «"],"hour":["час","часа","часов"],"https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png":["https://emcdn.ru/384263/241017_18_K3O0sad.png"],"https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png":["https://emcdn.ru/644755/241021_5149_MtX8mBz.png"],"https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png":["https://emcdn.ru/384263/241017_18_fsshqsL.png"],"https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png":["https://emcdn.ru/384263/241017_18_I98a6kp.png"],"https://cdn.useblocks.io/1351/241017_18_NDYloAO.png":["https://emcdn.ru/384263/241017_18_QFBYtv0.png"],"https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png":["https://emcdn.ru/384263/241017_18_HFSbGb5.png"],"https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png":["https://emcdn.ru/384263/241017_18_Uu6iuFF.png"],"https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png":["https://emcdn.ru/384263/241017_18_lkaw2P4.png"],"https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png":["https://emcdn.ru/384263/241017_18_ykdbX19.png"],"https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png":["https://emcdn.ru/384263/241017_18_HMNSbZd.png"],"https://cdn.useblocks.io/1351/241031_18_JoH0f3E.png":["https://emcdn.ru/719787/241031_976_jyIsWjj.png"],"https://cdn.useblocks.io/1351/241031_18_OQEyMEF.png":["https://emcdn.ru/719787/241031_976_lgYswn9.png"],"https://cdn.useblocks.io/1351/241031_18_aJAY1Xz.png":["https://emcdn.ru/719787/241031_976_XfDnnmK.png"],"images":["Изображения"],"indent":["отступ"],"kB":["kB"],"letter\\u0004Email":["Письмо"],"letter\\u0004email":["Письмо"],"link":["ссылка"],"loading more":["загрузить ещё"],"mail generator":["генератор писем"],"main heading":["основной заголовок"],"max 10":["максимум 10"],"member\\u0004 to ":[" на "],"member\\u0004Administrator":["Администратор"],"member\\u0004Invited":["Приглашённый"],"member\\u0004Owner":["Владелец"],"messeges":["сообщения"],"minute":["минута","минуты","минут"],"ms":["мс"],"new password":["новый пароль"],"not valid":["не верно"],"of":["из"],"or":["или"],"password":["пароль"],"picture":["изображение"],"project\\u0004 across all your projects?":[" во всех ваших проектах?"],"project\\u0004 from project ":[" из проекта "],"project\\u0004 in project ":["в проекте"],"project\\u0004Actions":["Действия"],"project\\u0004Add members":["Добавить участников"],"project\\u0004Are you sure you want to change permissions for user ":["Вы уверены, что хотите изменить права доступа для пользователя "],"project\\u0004Are you sure you want to invite user ":["Вы уверены, что хотите пригласить этого пользователя "],"project\\u0004Are you sure you want to remove user ":["Вы уверены, что хотите удалить пользователя "],"project\\u0004Are you sure you want to revoke the invitation for ":["Вы уверены, что хотите отозвать приглашение для "],"project\\u0004Change in all projects":["Изменить во всех проектах"],"project\\u0004Confirm":["Подтвердить"],"project\\u0004Could not load the project list":["Не удалось загрузить список проектов"],"project\\u0004Could not undo exclusion":["Не удалось отменить исключение"],"project\\u0004Delete":["Удалить"],"project\\u0004Delete project":["Удалить проект"],"project\\u0004Edit member list":["Изменить список участников"],"project\\u0004Email address":["Email"],"project\\u0004Exclude":["Удалить"],"project\\u0004Failed to send invitation":["Не удалось отправить приглашение"],"project\\u0004Failed to send invitations":["Не удалось отправить приглашения"],"project\\u0004Failed to update permissions":["Не удалось обновить права доступа"],"project\\u0004In all projects":["Во всех проектах"],"project\\u0004Invite":["Пригласить"],"project\\u0004Invite participants":["Пригласить участников"],"project\\u0004Invite to all projects":["Пригласить во все проекты"],"project\\u0004Name":["Имя"],"project\\u0004No matching memberships to update in your other projects":["В других ваших проектах нет подходящих участников для обновления"],"project\\u0004Permissions updated":["Права доступа обновлены"],"project\\u0004Project participants":["Участники проекта"],"project\\u0004Project settings":["Настройки проекта"],"project\\u0004Remove from project":["Удалить из проекта"],"project\\u0004Revoke":["Отозвать"],"project\\u0004Revoke invite":["Отозвать приглашение"],"project\\u0004Role in project":["Роль в проекте"],"project\\u0004The invitation was restored":["Приглашение было восстановлено"],"project\\u0004The invitation was sent to all your projects":["Приглашение было отправлено во все ваши проекты"],"project\\u0004The invitation was sent to some of your projects":["Приглашение было отправлено некоторым из ваших проектов"],"project\\u0004The participant was restored to the project":["Участник был восстановлен в проекте"],"project\\u0004Undo":["Отменить"],"project\\u0004You":["Вы"],"project\\u0004You are not the owner of any project":["Вы не являетесь владельцем какого-либо проекта"],"project\\u0004You excluded user ":["Вы заблокировали пользователя "],"recovery\\u0004\\" was successfully recovered.":["» восстановлен."],"recovery\\u0004” was successfully deleted.":["» удалено."],"recovery\\u0004” was successfully recovered.":["» завершено."],"running+shoes":["running+shoes"],"s":["с"],"secure":["безопасно"],"selected":["выбрано"],"selling blue":["продающий синий"],"sender@example.com":["sender@example.com"],"spring_sale":["spring_sale"],"tab\\u0004AI assistant":["AI Ассистент"],"tab\\u0004Build":["Контент"],"tab\\u0004Calendar":["Календарь"],"tab\\u0004Checkbox":["Чекбокс"],"tab\\u0004Discuss":["Обсуждение"],"tab\\u0004Dropdown list":["Выпадающий список"],"tab\\u0004Input":["Поле ввода"],"tab\\u0004Optimize":["Оптимизация"],"tab\\u0004Radio button":["Радиокнопка"],"tab\\u0004Settings":["Настройки"],"tab\\u0004Styles":["Стили"],"table":["таблица"],"test":["тест","теста","тестов"],"text":["текст"],"textlink":["textlink"],"time to load":["время загрузки"],"total size":["общий размер"],"user":["Пользователь"],"utm_campaign":["utm_campaign"],"utm_content":["utm_content"],"utm_medium":["utm_medium"],"utm_source":["utm_source"],"utm_term":["utm_term"],"variable":["переменная"],"verb\\u0004Import":["Импортировать"],"video":["видео"],"was successfully":[" успешно"],"was used":["был использован","было использовано","было использовано"],"which exceeds the recommended 90 KB limit.":["что превышает рекомендуемый предел в 90 КБ."],"–":["–"],"—":["—"],"“":["«"],"”":["»"],"” block?":["»?"],"” folder?":["»?"],"” group and all nested groups?":["» вместе со всеми вложениями?"],"” was successfully created.":["» создан."],"” was successfully imported.":["» импортировано."],"” was successfully sent.":["» отправлено."],"”.":["»."],"🎉 Welcome! Pro plan is activated":["🎉 Привет! Тариф Pro активирован"]}`)};function sb(e){if(!zs)return;const{id:t,catalog:n,time:r,hash:i}=zs;e.getInstance(o.LOCALE_SERVICE_ID)?.prime(t,n,{time:r,hash:i})}function Gs(e,t,n){let r=!1;const i=e.watch(a=>{r||!t(a)||(r=!0,n())});r&&i.dispose()}function lb(e,t){const n=e.getInstance(h.CONFIG_SOURCE_ID);n&&Gs(n,r=>!!r?.codeEnabled||!!r?.codeSideEnabled,()=>{ub(e,()=>{mb(e,()=>{db(e,()=>{Ht(e).whenVisible(()=>{Xt(()=>{cb(t).catch(()=>{})})})})})})})}async function cb(e){await e()}function db(e,t){const n=e.getInstance(Fa);if(!n){Xt(t);return}const r=()=>{if(n.pipeline.filledGeneration()!==void 0){t();return}Xt(r)};Xt(r)}function ub(e,t){const n=e.getInstance(o.EMAIL_DOCUMENTS_ID);if(!n)return;if(n.current()){t();return}let r=!1;const i=n.subscribe(()=>{r||!n.current()||(r=!0,t())});r&&i()}function mb(e,t){const n=e.getInstance(h.OPTIONS_SOURCE_ID);n&&Gs(n,r=>!!r?.element,t)}function pb(e){lb(e,cu)}function Ws(e,t="success"){return typeof e=="string"&&(e={message:e}),o.filterUndefined({type:e.type||t,data:e.data,innerException:e.innerException,title:e.message,description:e.description,actions:e.btn,onClose:e.onClose,duration:e.duration,icon:e.icon,placement:e.placement,style:e.style,closeIcon:e.closeIcon,props:e.props,role:e.role})}var fb="bottomRight";function Hr(e,t){return typeof e=="string"||typeof e=="object"?Ws(e,t):e}var hb=class extends h.Disposable{send;onNotify;onError;onSuccess;constructor(e,t,n){super(),this.send=n,this.onNotify=Ct(t,c=>c,c=>Hr(c)),this.onError=Ct(h.filter(t,c=>c.type==="error"),c=>c,c=>Hr(c,"error")),this.onSuccess=Ct(h.filter(t,c=>c.type==="success"),c=>c,c=>Hr(c));const r=this.addDisposable(new kt(this.onNotify)),i=this.addDisposable(new kt(this.onError)),a=this.addDisposable(new kt(this.onSuccess));this.addDisposable(e.watch(({handleNotify:c,handleError:d,handleSuccess:u})=>{r.setListener(c),i.setListener(d),a.setListener(u)}))}notify(e){this.send({placement:fb,...Ws(e)})}};function gb(e){e.injectFactory(vr,()=>{const t=new hb(e.getInstance(h.OPTIONS_SOURCE_ID),h.getEvent(e,h.events.ON_NOTIFICATION),n=>{o.executeCommand(e,o.NOTIFY_COMMAND_ID,n)});return e.getInstance(h.DISPOSABLE_ID)?.addDisposable(t),t},!0)}function yb(e){const t=o.getEmailDocuments(e),n=i=>{e.getInstance(h.STORE_ID)?.dispatch(o.taxonomiesApi.util.invalidateTags([{type:"folder",id:i}]))},r=t.onSaved(i=>{i.created&&n("folder")});e.getInstance(h.DISPOSABLE_ID)?.addDispose(r)}function L0(e){return e}var _b=[{name:"rest.legacySections",provides:[h.REST_CLIENT_ID],setup:h.provideLegacyRestSections},{name:"canvas.resizer",provides:[Di],setup:eb},{name:"canvas.sandboxLocale",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:tb},{name:"locale.brandCatalog",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:sb},{name:"email.restPorts",provides:[o.REST_EMAIL_PORTS_ID],setup:q_},{name:"block.historyPort",setup:K_},{name:"email.templatePrefetch",setup:ob},{name:"locale.antd",awaits:{services:[o.LOCALE_SERVICE_ID]},setup:ab},{name:"save.listsFollow",setup:yb},{name:"monaco.prewarm",awaits:{services:[h.CONFIG_SOURCE_ID]},setup:pb},{name:"notifications",provides:[vr],setup:gb},{name:"email.operations",setup:x_}],bb=h.defineMixin(e=>{for(const t of N_(_b))t.setup(e);return{instance:P_(e)}}),vb=h.combineMixins([bb,Uy,h_,v_,R_,j_,$h,g_,za,Ga]);async function Eb(e){const t=new Map;typeof e=="object"&&(e=e.code);const{amp2html:n,html2amp:r}=await(0,Ye.__vitePreload)(async()=>{const{amp2html:c,html2amp:d}=await Promise.resolve().then(()=>be("./static/core/72c8c438.js"));return{amp2html:c,html2amp:d}},void 0,{}.url),i=await _t.changeHtml(e,async c=>{await _t.replaceImagesInDocument(c.document,d=>o.mapper.getEscapedText(d)!==d?d:o.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-disabled"))d.remove();c.handleRender(async({contentDocument:d,managedNodeController:u})=>{await r(d,{mappedTags:{script:"___script"},commit:()=>u.commit()})})},[800]),a=await _t.changeHtml(e,async c=>{await _t.replaceImagesInDocument(c.document,d=>o.mapper.getEscapedText(d)!==d?d:o.toAbsoluteUrl(d),t);for(const d of c.document.querySelectorAll(".em-amp-show-only"))d.remove();await n(c.document,{mappedTags:{script:"___script"}})},[800]);return{code:e,html:a,ampHtml:i}}async function Sb(){const{installDiagnostics:e}=await(0,Ye.__vitePreload)(async()=>{const{installDiagnostics:t}=await Promise.resolve().then(()=>be("./static/core/baf39a20.js"));return{installDiagnostics:t}},void 0,{}.url);return e()}async function wb(e,t){const{initDevTools:n}=await(0,Ye.__vitePreload)(async()=>{const{initDevTools:r}=await Promise.resolve().then(()=>be("./static/core/ceff9046.js"));return{initDevTools:r}},void 0,{}.url);n(e,t)}var kb="1.1.85-dev.7";nn.asyncMixins=vb,nn.initDevTools=wb,nn.installDiagnostics=Sb,nn.parseAMP=Eb,nn.version=kb});