useblocks 1.3.8 → 1.3.10
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.
- package/iframe/.vite/manifest.json +4 -4
- package/iframe/css/sandbox.css +6 -0
- package/iframe/{iframe-eblock.a0b8903e.html → iframe-eblock.5455e870.html} +2 -2
- package/iframe/{iframe.a0b8903e.html → iframe.5455e870.html} +2 -2
- package/iframe/js/{elMarkupHelper.C1NUEUOF.js → elMarkupHelper.Cv72GdwF.js} +90 -90
- package/iframe/js/{iframe-eblock.body.a0b8903e.js → iframe-eblock.body.5455e870.js} +1 -1
- package/iframe/js/iframe-eblock.js +2 -2
- package/iframe/js/{iframe.body.a0b8903e.js → iframe.body.5455e870.js} +1 -1
- package/iframe/js/iframe.js +2 -2
- package/package.json +1 -1
- package/runtime/react/index.js +1 -1
- package/static/core/{c015f53f.js → 19270609.js} +1 -1
- package/static/core/233f23fd.js +1 -0
- package/static/core/{31aad6a0.js → 2cf7ee08.js} +1 -1
- package/static/core/{d5cd129a.js → 32f12150.js} +1 -1
- package/static/core/{ffabcd69.js → 38606c7d.js} +1 -1
- package/static/core/{cad7dc27.js → 395f9635.js} +1 -1
- package/static/core/{d4aa63e7.js → 4030ef2c.js} +1 -1
- package/static/core/{9f12c233.js → 4274a244.js} +1 -1
- package/static/core/{a2fb7ae9.js → 43305d10.js} +1 -1
- package/static/core/{f06286dd.js → 48def854.js} +1 -1
- package/static/core/{64a5118e.js → 4de0fff7.js} +1 -1
- package/static/core/{91a91433.js → 4fec552e.js} +1 -1
- package/static/core/{b79eddad.js → 5a290fb6.js} +1 -1
- package/static/core/{e6079a68.js → 630febfd.js} +1 -1
- package/static/core/{3fc88c79.js → 6539262f.js} +1 -1
- package/static/core/{1b6e3017.js → 710be2de.js} +1 -1
- package/static/core/{e85778fc.js → 7774d8cb.js} +1 -1
- package/static/core/{4a69114d.js → 791b9022.js} +1 -1
- package/static/core/{d7ccd97b.js → 7a43af5d.js} +1 -1
- package/static/core/{addbb53c.js → 7d2c1fd4.js} +1 -1
- package/static/core/{e4ebcc13.js → 7da32d21.js} +1 -1
- package/static/core/{d5774798.js → 84c5ed0d.js} +1 -1
- package/static/core/{ec23adac.js → 8606910e.js} +1 -1
- package/static/core/{4f9f6515.js → 91017e83.js} +1 -1
- package/static/core/{5bf0cc25.js → 97db045b.js} +1 -1
- package/static/core/{851da4d1.js → 9ccecd4a.js} +1 -1
- package/static/core/{7a1ca179.js → 9f336cc6.js} +1 -1
- package/static/core/{3d73b614.js → a802b68f.js} +1 -1
- package/static/core/{4e869a27.js → acf08b55.js} +1 -1
- package/static/core/{74b30e13.js → bf6643b0.js} +1 -1
- package/static/core/{88ed7988.js → c24c3d6b.js} +1 -1
- package/static/core/{3e55fbd4.js → c41fa010.js} +1 -1
- package/static/core/{75b3d05d.js → c8cfd469.js} +2 -2
- package/static/core/{3339abc3.js → cbfe265e.js} +1 -1
- package/static/core/d8d10299.js +19 -0
- package/static/core/{2d458997.js → dd82fe37.js} +1 -1
- package/static/core/{f370243f.js → e0f9c94e.js} +1 -1
- package/static/core/{a7e83e25.js → e532cd8d.js} +1 -1
- package/static/core/{80f29ed0.js → e7f50492.js} +1 -1
- package/static/core/{55a6e3bc.js → eeba774d.js} +3 -3
- package/static/core/{c0f26c01.js → ef13a2d7.js} +1 -1
- package/static/core/{6584ba9a.js → f033fd82.js} +1 -1
- package/static/core/{58b98b23.js → f615b5d9.js} +2 -2
- package/static/core/{bd188fca.js → fe47306c.js} +1 -1
- package/static/umd-runtime/runtime.C1l7PfWP.js +1 -0
- package/{useblocks-core.a0b8903e.js → useblocks-core.5455e870.js} +43 -42
- package/useblocks-esm.js +12 -12
- package/{useblocks-po.a0b8903e.js → useblocks-po.5455e870.js} +1 -1
- package/useblocks.js +12 -12
- package/vendor/useblocks-ui-kit/package.json +1 -1
- package/static/core/2ca6f0ad.js +0 -19
- package/static/core/d67c9b4e.js +0 -2
- package/static/umd-runtime/runtime.B77pxBrU.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/4274a244.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js","static/core/9f336cc6.js"],function(u,f,j){const R=u("./2ff39ddf.js"),r=u("./b8eb1c3a.js"),g=u("./9f336cc6.js");var v={link_check:"link checks",image_check:"image checks",spam_check:"spam checks"},S=t=>r.err("limitExceeded",`The plan limit for ${v[t]} is used up.`),p={ignoreEnabledFlag:!0};function w(t,e){switch(e.reason){case"noStore":return r.err("unavailable","Checks need the editor interface.");case"noDocument":return r.noDocument();case"notSaved":return r.err("unavailable","Save the email first: checks run on a saved email.");case"typeLimit":case"planLimit":case"usageLimit":return S(t);default:{const s=(e.reason==="failed"?e.error:void 0)?.data?.message;return r.err("internal",typeof s=="string"&&s?s:`The ${v[t]} service failed.`)}}}var _=(t,e)=>(e==="spam_check"?r.standaloneRefusal(t,"Spam checks"):void 0)??r.freePlanRefusal(t,"Checks are not available on the current plan.");async function m(t,e){const s=_(t,e);if(s)return s;const a=await g.getOptimiseChecks(t).run(e,p);return a.ok===!1?w(e,a):a}async function C(t,e){const s=_(t,e);if(s)return s;const a=await g.getOptimiseChecks(t).preflight(e,p);return a.ok===!1?w(e,a):a}function y(t){const e=new Map,s=(a,l)=>({precheck:async()=>{const i=C(t,a);e.set(a,i);const n=await i;return n.ok===!1?n:void 0},consent:async()=>{const i=r.agentTranslator(t),{__:n}=i,{title:h,what:k}=l(i),o=e.get(a)??C(t,a);e.delete(a);const c=await o.catch(()=>{}),b=c?.ok?c.remaining:void 0;return{title:h,details:[{label:n("What will be checked"),value:k},...b===void 0?[]:[{label:n("Plan limit"),value:r.sprintf(n("Uses 1 check; %d left"),b)}]]}}});return{"check.links":s("link_check",({__:a})=>({title:a("Check the links in the email"),what:a("Every link of the email is opened over the network.")})),"check.images":s("image_check",({__:a})=>({title:a("Check the images in the email"),what:a("Every image of the email is loaded over the network.")})),"check.spam":s("spam_check",({__:a})=>({title:a("Check the email for spam"),what:a("The email as it is now is scored by a spam filter.")}))}}var d=t=>t===void 0?{}:{limitRemaining:t};function E(t){return{"check.links":async()=>{const e=await m(t,"link_check");if(e.ok===!1)return e;const{links:s,summary:a}=e.value;return{links:s.map(({linkId:l,url:i,text:n,status:h,statusCode:k,resolvedUrl:o,message:c})=>({id:l,url:i,text:n,status:h,statusCode:k,...o?{resolvedUrl:o}:{},...c?{message:c}:{}})),summary:a,...d(e.limitRemaining)}},"check.images":async()=>{const e=await m(t,"image_check");if(e.ok===!1)return e;const{images:s,summary:a,totalKb:l}=e.value;return{images:s.map(({imageId:i,url:n,status:h,statusCode:k,message:o,image:c})=>({id:i,url:n,status:h,statusCode:k,sizeKb:Math.round((c?.bytes??0)/1024),...c?.dimensions?{width:c.dimensions.width,height:c.dimensions.height}:{},...o?{message:o}:{}})),summary:a,totalKb:l,...d(e.limitRemaining)}},"check.spam":async()=>{const e=await m(t,"spam_check");if(e.ok===!1)return e;const{spamScore:s,baseSpamScore:a,report:l}=e.value;return{score:s??null,baseScore:a??null,report:Array.isArray(l)?l.map(({score:i,description:n})=>({score:i,description:n})):[],...d(e.limitRemaining)}}}}f.agentCheckGates=y,f.agentCheckHandlers=E});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/43305d10.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js","vite/preload-helper"],function(a,g,z){const j=a("./2ff39ddf.js"),t=a("./b8eb1c3a.js");let f=a("vite/preload-helper");var h=3e3,S=/\.(woff2?|ttf|otf|eot)(\?|$)/i;function b(e){if(S.test(e.name))return"font";switch(e.initiatorType){case"script":return"script";case"link":case"css":return"style";case"fetch":case"xmlhttprequest":return"fetch";case"img":case"image":return"image";default:return"other"}}function _(e){return e.decodedBodySize===0&&e.transferSize===0?{transferred:null,fromCache:null}:{transferred:e.transferSize,fromCache:e.transferSize===0}}function d(e,r){return{name:e.name,kind:b(e),startedAt:t.toAbsolute(e.startTime,r),finishedAt:t.toAbsolute(e.responseEnd,r),..._(e)}}function y(e){if(!t.isDiagnosticsEnabled()||typeof PerformanceObserver>"u")return null;performance.setResourceTimingBufferSize(h);const{timeOrigin:r}=performance,n=new PerformanceObserver(s=>{s.getEntries().forEach(i=>{e(d(i,r))})});return n.observe({type:"resource",buffered:!0}),()=>n.disconnect()}var k="__emmDiagnostics__";function p(e){return typeof e=="object"&&e!==null}function o(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function R(e){if(!p(e))return null;const r=o(e.startTime),n=o(e.responseEnd),s=o(e.transferSize),i=o(e.decodedBodySize);return typeof e.name!="string"||typeof e.initiatorType!="string"||r===null||n===null||s===null||i===null?null:{name:e.name,initiatorType:e.initiatorType,startTime:r,responseEnd:n,transferSize:s,decodedBodySize:i}}function D(e){if(!p(e)||e.mark!=="__emmDiagnostics__")return null;if(e.type==="paint"||e.type==="settled"){const r=o(e.at);return r===null?null:{type:e.type,at:r}}if(e.type==="resources"){const r=o(e.timeOrigin);return r===null||!Array.isArray(e.items)?null:{type:"resources",records:e.items.map(R).filter(n=>n!==null).map(n=>d(n,r))}}return null}var c=null,m=null,u=!1,l=!1;function E(){return c?!0:(c=y(e=>t.getDiagnosticsStore().resources.push(e)),c!==null)}function w(){if(m!==null)return!0;if(!t.isDiagnosticsEnabled()||typeof window>"u")return!1;const e=r=>{const n=D(r.data);if(!n)return;const s=t.getDiagnosticsStore();if(n.type==="paint"){u||(u=!0,s.marks.push({phase:t.PHASES.canvasPainted,at:n.at}));return}if(n.type==="settled"){l||(l=!0,s.marks.push({phase:t.PHASES.canvasSettled,at:n.at}));return}n.records.forEach(i=>s.resources.push(i))};return window.addEventListener("message",e),m=()=>window.removeEventListener("message",e),!0}function v(){t.clearDiagnostics(),u=!1,l=!1}async function P(){if(!t.isDiagnosticsEnabled()||typeof window>"u")return!1;const{buildReportPayload:e,renderReportHtml:r}=await(0,f.__vitePreload)(async()=>{const{buildReportPayload:i,renderReportHtml:O}=await Promise.resolve().then(()=>a("./791b9022.js"));return{buildReportPayload:i,renderReportHtml:O}},void 0,{}.url),n=r(e(t.getDiagnosticsSnapshot(),t.getResourcesSnapshot())),s=window.open("","_blank");return s?(s.document.open(),s.document.write(n),s.document.close(),!0):!1}async function T(){const{buildReportPayload:e}=await(0,f.__vitePreload)(async()=>{const{buildReportPayload:r}=await Promise.resolve().then(()=>a("./791b9022.js"));return{buildReportPayload:r}},void 0,{}.url);return e(t.getDiagnosticsSnapshot(),t.getResourcesSnapshot())}function A(){if(!t.isDiagnosticsEnabled())return!1;t.drainLoaderMarks(),E(),w();const e=t.getBrandNamespace();return e?(e.diagnostics={snapshot:t.getDiagnosticsSnapshot,resources:t.getResourcesSnapshot,report:P,export:T,clear:v},!0):!1}g.installDiagnostics=A});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){try{if(typeof document<"u"){var o=".blocks-app .block-page-header__dropdown-menu{top:10px}.blocks-app .anticon.anticon-edit.block-page-header__icon-edit{color:#8c8c8c;margin-left:6px;font-size:16px}.blocks-app .ant-typography-edit:hover .anticon.anticon-edit.block-page-header__icon-edit{color:var(--ub-colorPrimaryHover)}.blocks-app .ant-page-header.block-page-header{margin-bottom:20px;padding-left:0;padding-right:0}@media (width<=1450px){.blocks-app .ant-page-header.block-page-header{padding-left:12px;padding-right:12px}}.blocks-app .block-page-header .ant-page-header-heading-left{flex-grow:1;overflow:visible}.blocks-app .block-page-header .ant-page-header-back{align-self:flex-start;margin-left:12px;margin-right:0;padding-top:12px}.blocks-app .block-page-header .ant-page-header-heading-title{white-space:pre-wrap;flex-grow:1;font-weight:500;overflow:visible}.blocks-app .block-page-header .ant-typography{margin-bottom:0;padding:4px 12px}.blocks-app .block-page-header .ant-typography-edit-content{margin-top:0;padding:0;left:auto}.blocks-app .block-page-header .ant-input{font-size:inherit;font-weight:inherit}.blocks-app .block-page-header .ant-page-header-heading-extra>*{margin-left:8px}.blocks-app .block-page-header .ant-btn.block-page-header__btn_extra,.blocks-app header .ant-btn.block-page-header__btn_extra{width:32px;padding:0}.blocks-app .block-page__row{margin-bottom:60px}@media (width>=1700px){.blocks-app .block-page__row{margin-right:-60px}}",e=window.__useblocks_styles__||(window.__useblocks_styles__={sheets:{},order:[]}),n=o;if(!e.sheets[n]){var a=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(a=new CSSStyleSheet,a.replaceSync(o))}catch{a=null}if(a){if(!e.host||!e.host.isConnected||!e.host.sheet){var t=document.createElement("style");t.setAttribute("data-useblocks","true"),document.head.appendChild(t),e.host=t}for(var c=e.host.sheet,l=0;l<a.cssRules.length;l++)try{c.insertRule(a.cssRules[l].cssText,c.cssRules.length)}catch{}(e.texts||(e.texts=[])).push(o),(e.listeners||[]).forEach(function(p){try{p(o)}catch{}})}else{var t=document.createElement("style");t.setAttribute("data-useblocks","true"),t.appendChild(document.createTextNode(o)),document.head.appendChild(t)}e.sheets[n]=!0,e.order.push(n)}}}catch(p){console.error("vite-plugin-css-injected-by-js",p)}})();
|
|
2
|
-
__useblocks__.define("static/core/f06286dd.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/a71d1c3a.js","static/core/22e64d27.js","static/core/ec23adac.js","react","react/jsx-runtime","__delivery__/libs","classnames"],function(h,re,he){const te=h("./2ff39ddf.js"),X=h("./cf7d1dd7.js"),e=h("./a71d1c3a.js"),z=h("./22e64d27.js"),le=h("./ec23adac.js");let n=h("react");n=te.__toESM(n);let o=h("react/jsx-runtime"),r=h("__delivery__/libs"),Z=h("classnames");Z=te.__toESM(Z);var oe={fontSize:"16px"},ae={color:"#ff4d4f"},se=({block:t,autoSaveBlockResult:d})=>{const{__:s,_x:c}=e.useI18n();let E=e.useDispatch();const l=e.useEmailAttributesWriter(),g=e.useAppNavigate(),a=e.useCurrentUser(),{modal:p}=r.ui_kit$App.useApp(),f=e.useNotification(),{confirm:b}=p,{token:$}=(0,r.ui_kit$useToken)(),W=e.useAppConfig(),M=e.useContainer(),y=e.usePluginMenuItems("menu:document"),S=e.usePluginItems("toolbar"),j=(0,n.useMemo)(()=>e.filterPluginItems(S,"collaboration"),[S]),K=(0,n.useMemo)(()=>e.filterPluginItems(S,e.TOOLBAR_GROUPS_BEFORE_SAVE),[S]),O=e.usePluginMenuItems("menu:save"),w=j.length>0,Q=K.length>0,k=O.length>0,R=()=>{e.leaveBlock(M)},H=e.useSelector(e.selectCodeModeDirection),J=t.hasOwnProperty("type")?e.BLOCK:e.EMAIL,U=e.useSelector(e.selectElementSettings$1),I=e.useSelector(e.selectElementSettings),P=J==="email"?U:I,A=e.useSelector(e.selectIsCodeMode),q=()=>(P?.type===e.ELEMENT_TYPES.TEXT||P?.type===e.ELEMENT_TYPES.LINK||P.type===e.ELEMENT_TYPES.BUTTON)&&A&&H!=="bottom",v=e.useProjectData(),F=e.isAuthoredByMe(t.author,a,v?.members),{owner:x,admin:T}=e.useMyRoles(),G=e.useStore(),V=(u,ee)=>G.dispatch(e.blocksApi.endpoints.deleteBlock.initiate(u.id)).then(ce=>{if(ce.error){f.fromError("BLOCK_REMOVING_ERROR",e.getBlockDesc(u),ce.error);return}R(),ee(`/projects/${v?.id??u.project}/blocks`),f.success({id:"BLOCK_REMOVING_SUCCESS",title:s("The block “")+u.title+c("” was successfully removed.","block"),data:e.getBlockDesc(u)})}),i=(u,ee)=>{b({mask:{closable:!0},centered:!0,title:c("Are you sure you want to delete the “","block")+u.title+s("” block?"),icon:(0,o.jsx)(e.EmIcons,{icon:"DeleteOutlined",component:r.icons$DeleteOutlined,size:22,style:{color:r.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:s("Yes"),cancelText:s("No"),onOk:()=>V(u,ee)})},m=()=>{R(),g(`/projects/${v.id}/blocks`)},_=u=>{l({title:u})},[B,C]=e.useAddBlockMutation(),Y=e.useContentReader(),D=()=>{t.isNew?t.isNew?f.warning({id:"COPY_NOT_SAVED",payload:t,title:s("To create a copy, you need to save the block.")}):B({title:e.generateCopyTitle(t.title),blocktags:t.blocktags,project:v.id,subject:t.subject,description:t.description,html:e.stripEmBlockMark(Y()),type:t.type?t.type:"Other"}).then(u=>{if(u.error||E(e.limitsApi.util.invalidateTags(["LimitsStats","LimitsWarnings"])),u.error){f.error({id:"BLOCK_CLONING_ERROR",data:e.getBlockDesc(t),innerException:u.error,title:u.error.data.code,description:u.error.data.message});return}g(`/projects/${v.id}/blocks/${u.data.id}`),f.success({id:"BLOCK_CLONING_SUCCESS",data:e.getBlockDesc(t),title:s("The copy of block “")+t.title+c("” was successfully created.","block")})}):e.getEmitter(M,X.events.ON_BLOCK_CLONE_ID).fire(t)},L=()=>{t.isNew?(R(),g(`/projects/${v.id}/blocks`),f.success({id:"BLOCK_REMOVING_SUCCESS",title:s("The draft of the block has been deleted."),data:e.getBlockDesc(t)})):i(t,g)};let N=[];N.push({label:s("Clone"),icon:(0,o.jsx)(e.EmIcons,{icon:"CopyOutlined",component:r.icons$CopyOutlined,size:16}),key:"Clone",className:"em-analytics__block-clone",disabled:C.isLoading,onClick:D}),N.push(...e.menuGroup(y,"document"),...e.menuGroup(y,"plugins"));const ie=x||T||F;ie&&N.push({label:(0,o.jsx)(e.SwitchLockBtn,{element:t},"Lock"),icon:t.lock?(0,o.jsx)(e.EmIcons,{icon:"UnlockOutlined",component:r.icons$UnlockOutlined,style:oe}):(0,o.jsx)(e.EmIcons,{icon:"LockOutlined",component:r.icons$LockOutlined,style:oe}),disabled:!!t.isNew}),N.push(...e.menuGroup(y,"access")),ie&&N.push({label:s("Remove"),icon:(0,o.jsx)(e.EmIcons,{icon:"DeleteOutlined",component:r.icons$DeleteOutlined,size:16}),key:"Remove",className:"em-analytics__block-remove",onClick:L,style:ae}),N.push(...e.menuGroup(y,"danger")),e.useSetTitle(t.title===null?s("New block title"):t.title);const Ee=(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(r.ui_kit$Space,{size:10,children:[W.headerArrowBackVisible&&(0,o.jsx)(r.ui_kit$Tooltip,{title:s("Back"),placement:"left",children:(0,o.jsx)(r.ui_kit$Button,{type:"text",icon:(0,o.jsx)(e.EmIcons,{icon:"ArrowLeftOutlined",component:r.icons$ArrowLeftOutlined}),onClick:m,shape:"circle"})}),(0,o.jsx)(r.ui_kit$Paragraph,{className:"ant-page-header-heading-title",editable:{triggerType:["text","icon"],icon:(0,o.jsx)(e.EmIcons,{icon:"EditOutlined",component:r.icons$EditOutlined,className:"email-page-header__icon-edit"}),onChange:_},children:t.title===null?s("New block title"):t.title})]})}),_e=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(z.EmailPreviewMenu,{emailElement:t}),t.lock?(0,o.jsx)(e.EmIcons,{icon:"LockOutlined",component:r.icons$LockOutlined,className:(0,Z.default)("lock-icon",{"lock-icon__disabled":!(x||T||F)}),style:{color:$.colorPrimary,fontSize:"16px"}},"Lock"):null,w&&(0,o.jsx)(e.PluginButtons,{items:j}),(0,o.jsx)(r.ui_kit$Dropdown,{arrow:"true",menu:{items:N},children:(0,o.jsx)(r.ui_kit$Button,{className:"block-page-header__btn block-page-header__btn_extra",onClick:()=>{},children:(0,o.jsx)(e.EmIcons,{icon:"EllipsisOutlined",component:r.icons$EllipsisOutlined})})},"Actions"),Q&&(0,o.jsx)(e.PluginButtons,{items:K}),(0,o.jsx)(le.SaveBlockBtn,{className:"em-analytics__block-save",block:t,isEditableRights:x||T||F,autoSaveBlockResult:d,ownsDocument:!0},"Save"),k&&(0,o.jsx)(e.PluginSaveMore,{items:O})]}),ye=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(z.EmailPreviewMenu,{emailElement:t}),w&&(0,o.jsx)(e.PluginButtons,{items:j}),y.length>0&&(0,o.jsx)(e.PluginMenuButton,{location:"menu:document",items:y,className:"block-page-header__btn block-page-header__btn_extra"}),Q&&(0,o.jsx)(e.PluginButtons,{items:K}),k&&(0,o.jsx)(e.PluginSaveMore,{items:O})]}),ve=W.commandButtonsEnabled?_e:ye;return(0,o.jsx)(e.Header,{leftBlock:Ee,rightBlock:ve,className:"header_blocks",isHeaderCodeMenuOpen:q()})};se.propTypes={};function ne(t=document){const d=t.getElementById("email_iframe_slot");return{slot:d,area:d?.closest("[data-scroll-area]")??null}}function de(t){if(t)return t.renderGuid??(t.id!=null?String(t.id):void 0)}function ue(t,d={}){const s=e.useStore(),c=d.key??de(t),E=d.recovery===!0,l=(0,n.useMemo)(()=>{if(c===void 0)return;const p=e.getEmailDocuments(X.getContainer(s));return E?t?.id!=null?p.open(String(t.id),{email:t}):p.openDraft(t):p.openBlock(c,t)},[c,s,E]),g=t?.modified,a=t?.lock;return(0,n.useEffect)(()=>{e.writeSourceReport(l,e.fromServerFacts({modified:g,lock:a}))},[l,g,a]),l}function me(){const t=e.useContainer(),d=e.useNotification(),{__:s}=e.useI18n(),c=(0,n.useRef)(void 0),E=(0,n.useRef)(0);(0,n.useEffect)(()=>{const l=e.getOpenEmailDocuments(t??void 0);if(l)return l.subscribe(()=>{const{error:g,failures:a,failedIntent:p}=l.saveState(),f=a>E.current;if(E.current=a,a===0||!e.isLockedBlockRefusal(g)){c.current=void 0;return}const b=l.current()?.get(),$=b?.savedVersion??null;!f||p!=="snapshot"||c.current?.saved===$||(c.current={saved:$},d.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",title:s("No access to edit the block."),data:e.getBlockDesc({id:b?.serverId??void 0,title:b?.attributes.title})}))})},[t,d,s])}var ge={status:0,data:{code:"timeout",message:"request timed out"}};function pe(t,d){const s=d?void 0:t,c=(0,n.useMemo)(()=>({key:s,inFlight:s!==void 0&&e.isBlockAutosaveInFlight(s)}),[s]),[E,l]=(0,n.useState)(void 0),g=E?.opening===c?E.settled:void 0,a=c.inFlight&&g===void 0;(0,n.useEffect)(()=>a&&c.key!==void 0?e.whenBlockAutosaveSettledWithin(c.key,e.getSaveTimeoutMs(),f=>l({opening:c,settled:f})):void 0,[a,c]);const p=e.useGetBlockQuery(t,{skip:d||a});return a?{...p,data:void 0,isSuccess:!1,isLoading:!0}:g===!1?{...p,data:void 0,isSuccess:!1,isLoading:!1,isError:!0,error:ge}:p}var{Content:Se}=r.ui_kit$Layout,fe=({session:t})=>{const{__:d}=e.useI18n(),s=e.useSendPostMessage(),{blockId:c,projectId:E}=e.useRouteParams();me();const l=e.useDispatch();e.useAppNavigate();const g=e.useCookieManager();e.useSelector(e.selectMonacoFocusing),e.useSelector(e.selectIsPanelHistoryCollapsed),e.useAppConfig();const a=g.get(e.APP_COOKIES.em_new_block),{isSuccess:p,data:f}=e.useGetBlockQuery(+a,{skip:!!t||!a}),[b,$]=(0,n.useState)(!1),{isLoading:W,isSuccess:M,isError:y,error:S,data:j}=pe(c,!!t||!c);(0,n.useEffect)(()=>{y&&S&&e.reportEntityLoadError("block",c,S)},[y,S,c]);const K=a?p:M,O=M&&j?.id?j:p&&f,w=t?t.block:O,Q=ue(t?void 0:O||void 0,{key:!t&&O?.id!=null?e.blockSessionKey(O.id):void 0}),k=t?t.document:Q,R=e.useDocumentAttributes(k),H=(0,n.useMemo)(()=>k?e.resolveOpenEmail({attributes:R,readContent:()=>k.getContent(),docId:k.get().docId,hasSession:!0,serverId:k.get().serverId,show:void 0}):w,[R,k,w]),J=e.useStore(),U=e.getEmailDocuments(X.getContainer(J)).history();e.usePublishDocumentSession(k,U);const I=e.useUserUndo({document:k,history:U}),P=(0,n.useCallback)(()=>{I.undo()},[I]),A=(0,n.useCallback)(()=>{I.redo()},[I]),q=(0,n.useCallback)(()=>I.clear(),[I]);e.useEditorUiReset(k?.get().docId,q);const v=(0,n.useCallback)(i=>{(window.navigator.appVersion.indexOf("Mac")&&i.metaKey||i.ctrlKey)&&(i.code==="KeyZ"?(i.preventDefault(),i.shiftKey?A():P()):i.code==="KeyY"&&!i.shiftKey&&(i.preventDefault(),A()))},[P,A]);(0,n.useEffect)(()=>(document.body.classList.add("editor"),()=>{l(e.resetPanes()),l(e.closeModal$1()),l(e.resetElementHistorySlice()),l(e.setActiveSettingsTab(e.BUILD))}),[l]);const F=i=>{const m=i.data.operation,_=i.data.action,B=document.getElementById("iframe-scroll-top"),C=document.getElementById("iframe-scroll-bottom");if(m===e.EVENT_TYPES.APPLICATION_ACTION&&(_==="undo"?P():_==="redo"&&A()),m===e.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_SHOW){const{slot:Y}=ne(),D=document.body.getBoundingClientRect().height,L=Y?.getClientRects()[0];if(!L||!B||!C)return;L.top<0&&(B.style.display="block"),L.top+L.height>D&&(C.style.display="block")}m===e.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_HIDE&&B&&C&&(B.style.display="none",C.style.display="none")};e.useListenPostMessage(F);const x=(0,n.useCallback)(i=>{i.target?.closest?.(".file-manager, .ant-modal.file-manager")||(i.preventDefault(),i.target&&s({operation:e.EVENT_TYPES.SANDBOX_DRAG_CANCEL}))},[s]),T=(0,n.useCallback)(()=>{},[]),G=(0,n.useCallback)(i=>{if(i.preventDefault(),i.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const m=document.getElementById("iframe-scroll-top"),_=document.getElementById("iframe-scroll-bottom"),{slot:B,area:C}=ne();if(!B||!m||!_)return;const{height:Y,top:D}=B.getBoundingClientRect(),L=document.body.getBoundingClientRect().height;D>1?m.style.display==="block"&&(m.style.display="none"):m.style.display==="none"&&(m.style.display="block"),Y-L+D<1?_.style.display==="block"&&(_.style.display="none"):_.style.display==="none"&&(_.style.display="block"),i.target===m&&C?.scrollBy(0,-20),i.target===_&&C?.scrollBy(0,20)},[]),V=(0,n.useCallback)(()=>{const i=document.getElementById("iframe-scroll-top"),m=document.getElementById("iframe-scroll-bottom");i&&m&&(i.style.display="none",m.style.display="none")},[]);return(0,n.useEffect)(()=>(window.addEventListener("dragstart",T),window.addEventListener("drop",x),window.addEventListener("dragend",V),window.addEventListener("dragover",G),window.addEventListener("keydown",v),()=>{window.removeEventListener("dragstart",T),window.removeEventListener("drop",x),window.removeEventListener("dragover",G),window.removeEventListener("dragend",V),window.removeEventListener("keydown",v)}),[v,T,x,V,G]),(0,o.jsx)(e.DocumentSessionProvider,{document:k,history:U,children:(0,o.jsxs)(r.ui_kit$Layout,{className:"block-page",children:[w&&(0,o.jsx)(se,{block:H}),W&&(0,o.jsx)(r.ui_kit$PageLoader,{}),y&&S&&!1,t?w&&(0,o.jsx)(z.EmailPane_default,{emailElement:H,kind:"block",isSuccess:!0}):(!c&&(a?b&&f:!0)||M&&j)&&(0,o.jsx)(z.EmailPane_default,{emailElement:H,kind:"block",isSuccess:K})]})})},ke=()=>{const{document:t,email:d}=e.useOpenEmail(),s=(0,n.useMemo)(()=>({document:t,block:d}),[t,d]);return(0,o.jsx)(fe,{session:s})};re.default=ke});
|
|
2
|
+
__useblocks__.define("static/core/48def854.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/b8eb1c3a.js","static/core/c7d1103d.js","static/core/8606910e.js","react","react/jsx-runtime","__delivery__/libs","classnames"],function(h,re,he){const te=h("./2ff39ddf.js"),X=h("./cf7d1dd7.js"),e=h("./b8eb1c3a.js"),z=h("./c7d1103d.js"),le=h("./8606910e.js");let n=h("react");n=te.__toESM(n);let o=h("react/jsx-runtime"),r=h("__delivery__/libs"),Z=h("classnames");Z=te.__toESM(Z);var oe={fontSize:"16px"},ae={color:"#ff4d4f"},se=({block:t,autoSaveBlockResult:d})=>{const{__:s,_x:c}=e.useI18n();let E=e.useDispatch();const l=e.useEmailAttributesWriter(),g=e.useAppNavigate(),a=e.useCurrentUser(),{modal:p}=r.ui_kit$App.useApp(),f=e.useNotification(),{confirm:b}=p,{token:$}=(0,r.ui_kit$useToken)(),W=e.useAppConfig(),M=e.useContainer(),y=e.usePluginMenuItems("menu:document"),S=e.usePluginItems("toolbar"),j=(0,n.useMemo)(()=>e.filterPluginItems(S,"collaboration"),[S]),K=(0,n.useMemo)(()=>e.filterPluginItems(S,e.TOOLBAR_GROUPS_BEFORE_SAVE),[S]),O=e.usePluginMenuItems("menu:save"),w=j.length>0,Q=K.length>0,k=O.length>0,R=()=>{e.leaveBlock(M)},H=e.useSelector(e.selectCodeModeDirection),J=t.hasOwnProperty("type")?e.BLOCK:e.EMAIL,U=e.useSelector(e.selectElementSettings$1),I=e.useSelector(e.selectElementSettings),P=J==="email"?U:I,A=e.useSelector(e.selectIsCodeMode),q=()=>(P?.type===e.ELEMENT_TYPES.TEXT||P?.type===e.ELEMENT_TYPES.LINK||P.type===e.ELEMENT_TYPES.BUTTON)&&A&&H!=="bottom",v=e.useProjectData(),F=e.isAuthoredByMe(t.author,a,v?.members),{owner:x,admin:T}=e.useMyRoles(),G=e.useStore(),V=(u,ee)=>G.dispatch(e.blocksApi.endpoints.deleteBlock.initiate(u.id)).then(ce=>{if(ce.error){f.fromError("BLOCK_REMOVING_ERROR",e.getBlockDesc(u),ce.error);return}R(),ee(`/projects/${v?.id??u.project}/blocks`),f.success({id:"BLOCK_REMOVING_SUCCESS",title:s("The block “")+u.title+c("” was successfully removed.","block"),data:e.getBlockDesc(u)})}),i=(u,ee)=>{b({mask:{closable:!0},centered:!0,title:c("Are you sure you want to delete the “","block")+u.title+s("” block?"),icon:(0,o.jsx)(e.EmIcons,{icon:"DeleteOutlined",component:r.icons$DeleteOutlined,size:22,style:{color:r.ui_kit$iconColors.danger,marginInlineEnd:12,flexShrink:0}}),okText:s("Yes"),cancelText:s("No"),onOk:()=>V(u,ee)})},m=()=>{R(),g(`/projects/${v.id}/blocks`)},_=u=>{l({title:u})},[B,C]=e.useAddBlockMutation(),Y=e.useContentReader(),D=()=>{t.isNew?t.isNew?f.warning({id:"COPY_NOT_SAVED",payload:t,title:s("To create a copy, you need to save the block.")}):B({title:e.generateCopyTitle(t.title),blocktags:t.blocktags,project:v.id,subject:t.subject,description:t.description,html:e.stripEmBlockMark(Y()),type:t.type?t.type:"Other"}).then(u=>{if(u.error||E(e.limitsApi.util.invalidateTags(["LimitsStats","LimitsWarnings"])),u.error){f.error({id:"BLOCK_CLONING_ERROR",data:e.getBlockDesc(t),innerException:u.error,title:u.error.data.code,description:u.error.data.message});return}g(`/projects/${v.id}/blocks/${u.data.id}`),f.success({id:"BLOCK_CLONING_SUCCESS",data:e.getBlockDesc(t),title:s("The copy of block “")+t.title+c("” was successfully created.","block")})}):e.getEmitter(M,X.events.ON_BLOCK_CLONE_ID).fire(t)},L=()=>{t.isNew?(R(),g(`/projects/${v.id}/blocks`),f.success({id:"BLOCK_REMOVING_SUCCESS",title:s("The draft of the block has been deleted."),data:e.getBlockDesc(t)})):i(t,g)};let N=[];N.push({label:s("Clone"),icon:(0,o.jsx)(e.EmIcons,{icon:"CopyOutlined",component:r.icons$CopyOutlined,size:16}),key:"Clone",className:"em-analytics__block-clone",disabled:C.isLoading,onClick:D}),N.push(...e.menuGroup(y,"document"),...e.menuGroup(y,"plugins"));const ie=x||T||F;ie&&N.push({label:(0,o.jsx)(e.SwitchLockBtn,{element:t},"Lock"),icon:t.lock?(0,o.jsx)(e.EmIcons,{icon:"UnlockOutlined",component:r.icons$UnlockOutlined,style:oe}):(0,o.jsx)(e.EmIcons,{icon:"LockOutlined",component:r.icons$LockOutlined,style:oe}),disabled:!!t.isNew}),N.push(...e.menuGroup(y,"access")),ie&&N.push({label:s("Remove"),icon:(0,o.jsx)(e.EmIcons,{icon:"DeleteOutlined",component:r.icons$DeleteOutlined,size:16}),key:"Remove",className:"em-analytics__block-remove",onClick:L,style:ae}),N.push(...e.menuGroup(y,"danger")),e.useSetTitle(t.title===null?s("New block title"):t.title);const Ee=(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(r.ui_kit$Space,{size:10,children:[W.headerArrowBackVisible&&(0,o.jsx)(r.ui_kit$Tooltip,{title:s("Back"),placement:"left",children:(0,o.jsx)(r.ui_kit$Button,{type:"text",icon:(0,o.jsx)(e.EmIcons,{icon:"ArrowLeftOutlined",component:r.icons$ArrowLeftOutlined}),onClick:m,shape:"circle"})}),(0,o.jsx)(r.ui_kit$Paragraph,{className:"ant-page-header-heading-title",editable:{triggerType:["text","icon"],icon:(0,o.jsx)(e.EmIcons,{icon:"EditOutlined",component:r.icons$EditOutlined,className:"email-page-header__icon-edit"}),onChange:_},children:t.title===null?s("New block title"):t.title})]})}),_e=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(z.EmailPreviewMenu,{emailElement:t}),t.lock?(0,o.jsx)(e.EmIcons,{icon:"LockOutlined",component:r.icons$LockOutlined,className:(0,Z.default)("lock-icon",{"lock-icon__disabled":!(x||T||F)}),style:{color:$.colorPrimary,fontSize:"16px"}},"Lock"):null,w&&(0,o.jsx)(e.PluginButtons,{items:j}),(0,o.jsx)(r.ui_kit$Dropdown,{arrow:"true",menu:{items:N},children:(0,o.jsx)(r.ui_kit$Button,{className:"block-page-header__btn block-page-header__btn_extra",onClick:()=>{},children:(0,o.jsx)(e.EmIcons,{icon:"EllipsisOutlined",component:r.icons$EllipsisOutlined})})},"Actions"),Q&&(0,o.jsx)(e.PluginButtons,{items:K}),(0,o.jsx)(le.SaveBlockBtn,{className:"em-analytics__block-save",block:t,isEditableRights:x||T||F,autoSaveBlockResult:d,ownsDocument:!0},"Save"),k&&(0,o.jsx)(e.PluginSaveMore,{items:O})]}),ye=(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(z.EmailPreviewMenu,{emailElement:t}),w&&(0,o.jsx)(e.PluginButtons,{items:j}),y.length>0&&(0,o.jsx)(e.PluginMenuButton,{location:"menu:document",items:y,className:"block-page-header__btn block-page-header__btn_extra"}),Q&&(0,o.jsx)(e.PluginButtons,{items:K}),k&&(0,o.jsx)(e.PluginSaveMore,{items:O})]}),ve=W.commandButtonsEnabled?_e:ye;return(0,o.jsx)(e.Header,{leftBlock:Ee,rightBlock:ve,className:"header_blocks",isHeaderCodeMenuOpen:q()})};se.propTypes={};function ne(t=document){const d=t.getElementById("email_iframe_slot");return{slot:d,area:d?.closest("[data-scroll-area]")??null}}function de(t){if(t)return t.renderGuid??(t.id!=null?String(t.id):void 0)}function ue(t,d={}){const s=e.useStore(),c=d.key??de(t),E=d.recovery===!0,l=(0,n.useMemo)(()=>{if(c===void 0)return;const p=e.getEmailDocuments(X.getContainer(s));return E?t?.id!=null?p.open(String(t.id),{email:t}):p.openDraft(t):p.openBlock(c,t)},[c,s,E]),g=t?.modified,a=t?.lock;return(0,n.useEffect)(()=>{e.writeSourceReport(l,e.fromServerFacts({modified:g,lock:a}))},[l,g,a]),l}function me(){const t=e.useContainer(),d=e.useNotification(),{__:s}=e.useI18n(),c=(0,n.useRef)(void 0),E=(0,n.useRef)(0);(0,n.useEffect)(()=>{const l=e.getOpenEmailDocuments(t??void 0);if(l)return l.subscribe(()=>{const{error:g,failures:a,failedIntent:p}=l.saveState(),f=a>E.current;if(E.current=a,a===0||!e.isLockedBlockRefusal(g)){c.current=void 0;return}const b=l.current()?.get(),$=b?.savedVersion??null;!f||p!=="snapshot"||c.current?.saved===$||(c.current={saved:$},d.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",title:s("No access to edit the block."),data:e.getBlockDesc({id:b?.serverId??void 0,title:b?.attributes.title})}))})},[t,d,s])}var ge={status:0,data:{code:"timeout",message:"request timed out"}};function pe(t,d){const s=d?void 0:t,c=(0,n.useMemo)(()=>({key:s,inFlight:s!==void 0&&e.isBlockAutosaveInFlight(s)}),[s]),[E,l]=(0,n.useState)(void 0),g=E?.opening===c?E.settled:void 0,a=c.inFlight&&g===void 0;(0,n.useEffect)(()=>a&&c.key!==void 0?e.whenBlockAutosaveSettledWithin(c.key,e.getSaveTimeoutMs(),f=>l({opening:c,settled:f})):void 0,[a,c]);const p=e.useGetBlockQuery(t,{skip:d||a});return a?{...p,data:void 0,isSuccess:!1,isLoading:!0}:g===!1?{...p,data:void 0,isSuccess:!1,isLoading:!1,isError:!0,error:ge}:p}var{Content:Se}=r.ui_kit$Layout,fe=({session:t})=>{const{__:d}=e.useI18n(),s=e.useSendPostMessage(),{blockId:c,projectId:E}=e.useRouteParams();me();const l=e.useDispatch();e.useAppNavigate();const g=e.useCookieManager();e.useSelector(e.selectMonacoFocusing),e.useSelector(e.selectIsPanelHistoryCollapsed),e.useAppConfig();const a=g.get(e.APP_COOKIES.em_new_block),{isSuccess:p,data:f}=e.useGetBlockQuery(+a,{skip:!!t||!a}),[b,$]=(0,n.useState)(!1),{isLoading:W,isSuccess:M,isError:y,error:S,data:j}=pe(c,!!t||!c);(0,n.useEffect)(()=>{y&&S&&e.reportEntityLoadError("block",c,S)},[y,S,c]);const K=a?p:M,O=M&&j?.id?j:p&&f,w=t?t.block:O,Q=ue(t?void 0:O||void 0,{key:!t&&O?.id!=null?e.blockSessionKey(O.id):void 0}),k=t?t.document:Q,R=e.useDocumentAttributes(k),H=(0,n.useMemo)(()=>k?e.resolveOpenEmail({attributes:R,readContent:()=>k.getContent(),docId:k.get().docId,hasSession:!0,serverId:k.get().serverId,show:void 0}):w,[R,k,w]),J=e.useStore(),U=e.getEmailDocuments(X.getContainer(J)).history();e.usePublishDocumentSession(k,U);const I=e.useUserUndo({document:k,history:U}),P=(0,n.useCallback)(()=>{I.undo()},[I]),A=(0,n.useCallback)(()=>{I.redo()},[I]),q=(0,n.useCallback)(()=>I.clear(),[I]);e.useEditorUiReset(k?.get().docId,q);const v=(0,n.useCallback)(i=>{(window.navigator.appVersion.indexOf("Mac")&&i.metaKey||i.ctrlKey)&&(i.code==="KeyZ"?(i.preventDefault(),i.shiftKey?A():P()):i.code==="KeyY"&&!i.shiftKey&&(i.preventDefault(),A()))},[P,A]);(0,n.useEffect)(()=>(document.body.classList.add("editor"),()=>{l(e.resetPanes()),l(e.closeModal$1()),l(e.resetElementHistorySlice()),l(e.setActiveSettingsTab(e.BUILD))}),[l]);const F=i=>{const m=i.data.operation,_=i.data.action,B=document.getElementById("iframe-scroll-top"),C=document.getElementById("iframe-scroll-bottom");if(m===e.EVENT_TYPES.APPLICATION_ACTION&&(_==="undo"?P():_==="redo"&&A()),m===e.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_SHOW){const{slot:Y}=ne(),D=document.body.getBoundingClientRect().height,L=Y?.getClientRects()[0];if(!L||!B||!C)return;L.top<0&&(B.style.display="block"),L.top+L.height>D&&(C.style.display="block")}m===e.EVENT_TYPES.APPLICATION_SCROLL_BLOCK_HIDE&&B&&C&&(B.style.display="none",C.style.display="none")};e.useListenPostMessage(F);const x=(0,n.useCallback)(i=>{i.target?.closest?.(".file-manager, .ant-modal.file-manager")||(i.preventDefault(),i.target&&s({operation:e.EVENT_TYPES.SANDBOX_DRAG_CANCEL}))},[s]),T=(0,n.useCallback)(()=>{},[]),G=(0,n.useCallback)(i=>{if(i.preventDefault(),i.target?.closest?.(".file-manager, .ant-modal.file-manager"))return;const m=document.getElementById("iframe-scroll-top"),_=document.getElementById("iframe-scroll-bottom"),{slot:B,area:C}=ne();if(!B||!m||!_)return;const{height:Y,top:D}=B.getBoundingClientRect(),L=document.body.getBoundingClientRect().height;D>1?m.style.display==="block"&&(m.style.display="none"):m.style.display==="none"&&(m.style.display="block"),Y-L+D<1?_.style.display==="block"&&(_.style.display="none"):_.style.display==="none"&&(_.style.display="block"),i.target===m&&C?.scrollBy(0,-20),i.target===_&&C?.scrollBy(0,20)},[]),V=(0,n.useCallback)(()=>{const i=document.getElementById("iframe-scroll-top"),m=document.getElementById("iframe-scroll-bottom");i&&m&&(i.style.display="none",m.style.display="none")},[]);return(0,n.useEffect)(()=>(window.addEventListener("dragstart",T),window.addEventListener("drop",x),window.addEventListener("dragend",V),window.addEventListener("dragover",G),window.addEventListener("keydown",v),()=>{window.removeEventListener("dragstart",T),window.removeEventListener("drop",x),window.removeEventListener("dragover",G),window.removeEventListener("dragend",V),window.removeEventListener("keydown",v)}),[v,T,x,V,G]),(0,o.jsx)(e.DocumentSessionProvider,{document:k,history:U,children:(0,o.jsxs)(r.ui_kit$Layout,{className:"block-page",children:[w&&(0,o.jsx)(se,{block:H}),W&&(0,o.jsx)(r.ui_kit$PageLoader,{}),y&&S&&!1,t?w&&(0,o.jsx)(z.EmailPane_default,{emailElement:H,kind:"block",isSuccess:!0}):(!c&&(a?b&&f:!0)||M&&j)&&(0,o.jsx)(z.EmailPane_default,{emailElement:H,kind:"block",isSuccess:K})]})})},ke=()=>{const{document:t,email:d}=e.useOpenEmail(),s=(0,n.useMemo)(()=>({document:t,block:d}),[t,d]);return(0,o.jsx)(fe,{session:s})};re.default=ke});
|
|
@@ -7,4 +7,4 @@ Minimum version required to store current data is: `+h+`.
|
|
|
7
7
|
`);let d=I(y,A,N),p=new t(s.getSymbolSize(y));return v(p,y),T(p),x(p,y),M(p,A,0),y>=7&&C(p,y),B(p,d),isNaN(f)&&(f=n.getBestMask(p,M.bind(null,p,A))),n.applyMask(f,p),M(p,A,f),{modules:p,version:y,errorCorrectionLevel:A,maskPattern:f,segments:N}}o.create=function(g,y){if(g===void 0||g==="")throw Error("No input text");let A=a.M,f,N;return y!==void 0&&(A=a.from(y.errorCorrectionLevel,a.M),f=E.from(y.version),N=n.from(y.maskPattern),y.toSJISFunc&&s.setToSJISFunction(y.toSJISFunc)),R(g,f,A,N)}})),$=P.s((o=>{function s(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw Error("Color should be defined as hex string");let r=a.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw Error("Invalid hex color: "+a);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(e){return[e,e]}))),r.length===6&&r.push("F","F");let t=parseInt(r.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+r.slice(0,6).join("")}}o.getOptions=function(a){a||={},a.color||(a.color={});let r=a.margin===void 0||a.margin===null||a.margin<0?4:a.margin,t=a.width&&a.width>=21?a.width:void 0,e=a.scale||4;return{width:t,scale:t?4:e,margin:r,color:{dark:s(a.color.dark||"#000000ff"),light:s(a.color.light||"#ffffffff")},type:a.type,rendererOpts:a.rendererOpts||{}}},o.getScale=function(a,r){return r.width&&r.width>=a+r.margin*2?r.width/(a+r.margin*2):r.scale},o.getImageWidth=function(a,r){let t=o.getScale(a,r);return Math.floor((a+r.margin*2)*t)},o.qrToImageData=function(a,r,t){let e=r.modules.size,i=r.modules.data,n=o.getScale(e,t),u=Math.floor((e+t.margin*2)*n),c=t.margin*n,E=[t.color.light,t.color.dark];for(let w=0;w<u;w++)for(let l=0;l<u;l++){let m=(w*u+l)*4,v=t.color.light;if(w>=c&&l>=c&&w<u-c&&l<u-c){let T=Math.floor((w-c)/n),x=Math.floor((l-c)/n);v=E[+!!i[T*e+x]]}a[m++]=v.r,a[m++]=v.g,a[m++]=v.b,a[m]=v.a}}})),Et=P.s((o=>{var s=$();function a(t,e,i){t.clearRect(0,0,e.width,e.height),e.style||={},e.height=i,e.width=i,e.style.height=i+"px",e.style.width=i+"px"}function r(){try{return document.createElement("canvas")}catch{throw Error("You need to specify a canvas element")}}o.render=function(t,e,i){let n=i,u=e;n===void 0&&(!e||!e.getContext)&&(n=e,e=void 0),e||(u=r()),n=s.getOptions(n);let c=s.getImageWidth(t.modules.size,n),E=u.getContext("2d"),w=E.createImageData(c,c);return s.qrToImageData(w.data,t,n),a(E,u,c),E.putImageData(w,0,0),u},o.renderToDataURL=function(t,e,i){let n=i;n===void 0&&(!e||!e.getContext)&&(n=e,e=void 0),n||={};let u=o.render(t,e,n),c=n.type||"image/png",E=n.rendererOpts||{};return u.toDataURL(c,E.quality)}})),wt=P.s((o=>{var s=$();function a(e,i){let n=e.a/255,u=i+'="'+e.hex+'"';return n<1?u+" "+i+'-opacity="'+n.toFixed(2).slice(1)+'"':u}function r(e,i,n){let u=e+i;return n!==void 0&&(u+=" "+n),u}function t(e,i,n){let u="",c=0,E=!1,w=0;for(let l=0;l<e.length;l++){let m=Math.floor(l%i),v=Math.floor(l/i);!m&&!E&&(E=!0),e[l]?(w++,l>0&&m>0&&e[l-1]||(u+=E?r("M",m+n,.5+v+n):r("m",c,0),c=0,E=!1),m+1<i&&e[l+1]||(u+=r("h",w),w=0)):c++}return u}o.render=function(e,i,n){let u=s.getOptions(i),c=e.modules.size,E=e.modules.data,w=c+u.margin*2,l=u.color.light.a?"<path "+a(u.color.light,"fill")+' d="M0 0h'+w+"v"+w+'H0z"/>':"",m="<path "+a(u.color.dark,"stroke")+' d="'+t(E,c,u.margin)+'"/>',v='viewBox="0 0 '+w+" "+w+'"',T='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+v+' shape-rendering="crispEdges">'+l+m+`</svg>
|
|
8
8
|
`;return typeof n=="function"&&n(null,T),T}})),yt=P.s((o=>{var s=tt(),a=vt(),r=Et(),t=wt();function e(i,n,u,c,E){let w=[].slice.call(arguments,1),l=w.length,m=typeof w[l-1]=="function";if(!m&&!s())throw Error("Callback required as last argument");if(m){if(l<2)throw Error("Too few arguments provided");l===2?(E=u,u=n,n=c=void 0):l===3&&(n.getContext&&E===void 0?(E=c,c=void 0):(E=c,c=u,u=n,n=void 0))}else{if(l<1)throw Error("Too few arguments provided");return l===1?(u=n,n=c=void 0):l===2&&!n.getContext&&(c=u,u=n,n=void 0),new Promise(function(v,T){try{v(i(a.create(u,c),n,c))}catch(x){T(x)}})}try{let v=a.create(u,c);E(null,i(v,n,c))}catch(v){E(v)}}o.create=a.create,o.toCanvas=e.bind(null,r.render),o.toDataURL=e.bind(null,r.renderToDataURL),o.toString=e.bind(null,function(i,n,u){return t.render(i,u)})})),At=yt();W.default=At});
|
|
9
9
|
|
|
10
|
-
__useblocks__.define("static/core/
|
|
10
|
+
__useblocks__.define("static/core/4de0fff7.js",["require","exports","module","static/core/2ff39ddf.js","static/core/395f9635.js","static/core/ff7d14e8.js","react","react/jsx-runtime","__delivery__/libs","vite/preload-helper"],function(m,Z,ve){const G=m("./2ff39ddf.js"),P=m("./395f9635.js"),y=m("./ff7d14e8.js");let o=m("react"),F=G.__toESM(o,1);o=G.__toESM(o);let r=m("react/jsx-runtime"),c=m("__delivery__/libs"),N=m("vite/preload-helper");var S=({size:C=24,color:R="currentColor",...s})=>F.createElement("svg",{viewBox:"0 0 24 24",width:C,height:C,stroke:R,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...s},F.createElement("path",{d:"m14 10 7-7m0 0h-6m6 0v6m-11 5-7 7m0 0h6m-6 0v-6"}));S.displayName="Expand01";var O=P.or(),t={"em-filemanager":"em-filemanager",emFilemanager:"em-filemanager",root:"root",controls:"controls",segmentedControl:"segmentedControl",sizeRow:"sizeRow",sizeRowLabel:"sizeRowLabel",sizeInputNumber:"sizeInputNumber",sizeSuffix:"sizeSuffix",colorGrid:"colorGrid",colorCell:"colorCell",colorCellLabel:"colorCellLabel",colorPickerFull:"colorPickerFull",bgExtras:"bgExtras",bgWarning:"bgWarning",previewSection:"previewSection",previewTitle:"previewTitle",previewWrap:"previewWrap",scanLine:"scanLine",scanLineBarcode:"scanLineBarcode",previewWrapBarcode:"previewWrapBarcode",previewCanvas:"previewCanvas",previewCanvasBarcode:"previewCanvasBarcode",actions:"actions"},z=80,D=600,ee=200,E=24,q=130,ae=60,re=280,te=72;function oe(){return typeof window>"u"?2:Math.min(3,Math.max(2,window.devicePixelRatio||2))}var le=({customRequest:C,state:R,setState:s})=>{let{t:l}=P.Rn(),{options:ie}=P.V(),Q=ie?.config?.iconStrokeWidth??1.75,V=(0,o.useRef)(null),{mode:d,rawText:x,foregroundHex:p,backgroundHex:f,transparentBackground:g,qrSidePx:j,barcodeBarHeightPx:k}=R,ne=(0,o.useCallback)(e=>s(a=>({...a,mode:e})),[s]),se=(0,o.useCallback)(e=>s(a=>({...a,rawText:e})),[s]),ce=(0,o.useCallback)(e=>s(a=>({...a,foregroundHex:e})),[s]),de=(0,o.useCallback)(e=>s(a=>({...a,backgroundHex:e})),[s]),he=(0,o.useCallback)(e=>s(a=>({...a,transparentBackground:e})),[s]),ue=(0,o.useCallback)(e=>s(a=>({...a,qrSidePx:e})),[s]),me=(0,o.useCallback)(e=>s(a=>({...a,barcodeBarHeightPx:e})),[s]),[T,xe]=(0,o.useState)(x),[$,b]=(0,o.useState)(null),[L,U]=(0,o.useState)(!1),_=(0,o.useMemo)(()=>(0,O.debounce)(e=>xe(e),300),[]);(0,o.useEffect)(()=>(_(x),()=>{_.cancel()}),[x,_]);let M=g?"#00000000":f,J=(0,o.useCallback)(async(e,a)=>{let n=(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./8daf15a4.js")).then(i=>y.l(i.default)),void 0,{}.url)).default,h=a.trim(),u=Math.min(re,Math.max(z,j));if(!h){e.width=u,e.height=u;let i=e.getContext("2d");i&&i.clearRect(0,0,e.width,e.height);return}e.width=u,e.height=u,await n.toCanvas(e,h,{width:u,margin:2,color:{dark:p,light:M}})},[p,M,j]),K=(0,o.useCallback)(async(e,a)=>{let n=(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./a6303cb2.js")).then(v=>y.l(v.default)),void 0,{}.url)).default,h=a.trim(),u=g?"rgba(0,0,0,0)":f,i=Math.min(te,Math.max(E,k)),W=Math.max(1,Math.round(i/42)),H=Math.max(4,Math.round(i*.07)),I=Math.max(10,Math.round(i*.15));if(!h){e.width=Math.round(i*4),e.height=Math.round(i*1.65);let v=e.getContext("2d");v&&v.clearRect(0,0,e.width,e.height);return}e.width=Math.round(i*4.2),e.height=Math.round(i*1.65),n(e,h,{format:"CODE128",displayValue:!0,background:u,lineColor:p,margin:H,width:W,height:i,fontSize:I})},[p,f,g,k]);(0,o.useEffect)(()=>{let e=V.current;if(!e)return;let a=!1;return(async()=>{try{d==="qr"?await J(e,T):await K(e,T),a||b(null)}catch(n){let h=n instanceof Error?n.message:String(n);if(!a){b(d==="barcode"?l("Barcode generation failed"):h);let u=e.getContext("2d");u&&u.clearRect(0,0,e.width,e.height)}}})(),()=>{a=!0}},[d,T,K,J,l]);let X=(0,o.useCallback)(async()=>{_.flush();let e=x.trim();if(!e)throw Error(l("Enter text or URL to preview"));let a=oe();if(d==="qr"){let w=Math.round(Math.min(D,Math.max(z,j))*a),B=document.createElement("canvas");B.width=w,B.height=w,await(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./8daf15a4.js")).then(A=>y.l(A.default)),void 0,{}.url)).default.toCanvas(B,e,{width:w,margin:2,color:{dark:p,light:M}});let Y=await new Promise(A=>B.toBlob(A,"image/png"));if(!Y)throw Error("PNG export failed");return Y}let n=(await(0,N.__vitePreload)(()=>Promise.resolve().then(()=>m("./a6303cb2.js")).then(w=>y.l(w.default)),void 0,{}.url)).default,h=document.createElement("canvas"),u=g?"rgba(0,0,0,0)":f,i=Math.min(q,Math.max(E,k)),W=Math.max(6,Math.round(i*.1)),H=Math.max(2,Math.round(i/36)),I=Math.max(12,Math.round(i*.16));n(h,e,{format:"CODE128",displayValue:!0,background:u,lineColor:p,margin:Math.round(W*a),width:Math.round(H*a),height:Math.round(i*a),fontSize:Math.round(I*a)});let v=await new Promise(w=>h.toBlob(w,"image/png"));if(!v)throw Error("PNG export failed");return v},[d,x,p,M,f,g,j,k,_,l]),pe=(0,o.useCallback)(async()=>{if(!L&&x.trim()){U(!0);try{let e;try{e=await X()}catch(n){let h=n instanceof Error?n.message:String(n);b(h);return}let a=new File([e],`${d==="qr"?"qr-code":"barcode"}-${Date.now()}.png`,{type:"image/png",lastModified:Date.now()});await Promise.resolve(C({file:a}))}finally{U(!1)}}},[C,X,d,x,L]),ge=!!x.trim()&&!$;return(0,r.jsx)("div",{className:t.root,children:(0,r.jsxs)("div",{className:t.controls,children:[(0,r.jsx)(c.antd$Segmented,{block:!0,className:t.segmentedControl,value:d,onChange:e=>{ne(e),b(null)},options:[{label:l("QR code"),value:"qr"},{label:l("Barcode"),value:"barcode"}]}),$&&(0,r.jsx)(c.antd$Alert,{type:"error",title:l("Validation error"),description:$,showIcon:!0,closable:!0,onClose:()=>b(null)}),(0,r.jsx)(c.antd$Input.TextArea,{value:x,onChange:e=>{se(e.target.value),b(null)},placeholder:l("Text or URL"),rows:3,spellCheck:!1,autoComplete:"off"}),(0,r.jsxs)("div",{className:t.sizeRow,children:[(0,r.jsx)(c.antd$Typography.Text,{type:"secondary",className:t.sizeRowLabel,children:l(d==="qr"?"QR image size px":"Barcode bar height px")}),d==="qr"?(0,r.jsx)(c.antd$InputNumber,{className:t.sizeInputNumber,min:z,max:D,step:8,value:j,onChange:e=>ue(typeof e=="number"&&!Number.isNaN(e)?e:ee),prefix:(0,r.jsx)(S,{size:18,strokeWidth:Q}),suffix:(0,r.jsx)("span",{className:t.sizeSuffix,children:"px"}),"aria-label":l("QR image size px")}):(0,r.jsx)(c.antd$InputNumber,{className:t.sizeInputNumber,min:E,max:q,step:4,value:k,onChange:e=>me(typeof e=="number"&&!Number.isNaN(e)?e:ae),prefix:(0,r.jsx)(S,{size:18,strokeWidth:Q}),suffix:(0,r.jsx)("span",{className:t.sizeSuffix,children:"px"}),"aria-label":l("Barcode bar height px")})]}),(0,r.jsxs)("div",{className:t.colorGrid,children:[(0,r.jsxs)("div",{className:t.colorCell,children:[(0,r.jsx)(c.antd$Typography.Text,{type:"secondary",className:t.colorCellLabel,children:l("Code color","Code color")}),(0,r.jsx)(c.antd$ColorPicker,{className:t.colorPickerFull,value:p,format:"hex",disabledAlpha:!0,showText:!0,onChange:(e,a)=>{let n=typeof e=="string"?e:e?.toHexString?e.toHexString():a;ce(n)}})]}),(0,r.jsxs)("div",{className:t.colorCell,children:[(0,r.jsx)(c.antd$Typography.Text,{type:"secondary",className:t.colorCellLabel,children:l("Background color","Background color")}),(0,r.jsx)(c.antd$ColorPicker,{className:t.colorPickerFull,value:f,format:"hex",disabledAlpha:!0,showText:!0,disabled:g,onChange:(e,a)=>{let n=typeof e=="string"?e:e?.toHexString?e.toHexString():a;de(n)}})]}),(0,r.jsxs)("div",{className:t.bgExtras,children:[(0,r.jsx)(c.antd$Checkbox,{checked:g,onChange:e=>he(e.target.checked),children:l("Transparent background","Transparent background")}),g&&(0,r.jsx)(c.antd$Alert,{type:"warning",showIcon:!0,title:l("QR transparent background hint"),className:t.bgWarning})]})]}),(0,r.jsxs)("div",{className:t.previewSection,children:[(0,r.jsx)(c.antd$Typography.Text,{className:t.previewTitle,children:l("Preview","Preview")}),(0,r.jsxs)("div",{className:[t.previewWrap,d==="barcode"&&t.previewWrapBarcode].filter(Boolean).join(" "),children:[(0,r.jsx)("div",{className:[t.scanLine,d==="barcode"&&t.scanLineBarcode].filter(Boolean).join(" ")}),(0,r.jsx)("canvas",{ref:V,className:[t.previewCanvas,d==="barcode"&&t.previewCanvasBarcode].filter(Boolean).join(" "),"aria-label":l("Preview")})]})]}),(0,r.jsx)("div",{className:t.actions,children:(0,r.jsx)(c.antd$Button,{type:"primary",onClick:()=>{pe()},loading:L,disabled:!ge,children:l("Add to My files")})})]})})};Z.default=le});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/4fec552e.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/b8eb1c3a.js","static/core/6539262f.js","static/core/233f23fd.js","static/core/84c5ed0d.js"],function(c,h,j){const O=c("./2ff39ddf.js"),D=c("./cf7d1dd7.js"),e=c("./b8eb1c3a.js"),p=c("./6539262f.js"),m=c("./233f23fd.js"),y=c("./84c5ed0d.js");var w={8:"error",4:"warning",2:"info",1:"hint"},S=()=>e.err("unavailable","A block is open, not an email; read its code with document.getHtml.");function f(t){return e.isBlockSessionKey(e.peekEmailDocuments(t)?.sessionKey())}function d(t){try{return t.getInstance(D.PLUGIN_COLLECTION_ID)?.use("EmailSettingsApi")}catch{return}}async function g(t,i,o){const{compileEmail:n}=await e.loadEmailCompiler();return n(await i.getEmailSnapshot(),{amp:!1,text:o},e.getTemplateDirectivesPolicy(t).keepWrappedOnOutput)}function v(t){return f(t)?S():e.featureRefusal(t,"export_html","the compiled email")}function k(t){const{id:i,date:o,modified:n,authorName:r,author:s,subject:a,title:u,isAutosave:l}=t;return{id:i===void 0?void 0:String(i),date:o??n,author:r??s,subject:a,title:u,isAutosave:l}}async function R(t,i){const o=e.peekEmailDocuments(t),n=o?.current()?.get().serverId;if(!o||n==null)return e.err("unavailable","The document has no saved revisions yet.");const r=e.featureRefusal(t,"version_history","revision history");if(r)return r;if(e.isBlockSessionKey(o.sessionKey())){if(!e.canReadBlockHistory(t))return{revisions:[],hasMore:!1};const{revisions:u,hasMore:l}=await e.resolveBlockHistoryPort(t).readRevisions(String(n),i,{wpId:e.openDocumentWpId(t,n)});return{revisions:u.map(k),hasMore:l}}if(!await e.isEmailHistoryAvailable(t))return e.planRefusal("Revision history is not available on this plan.");const{revisions:s,hasMore:a}=await e.resolveEmailHistoryPort(t).readRevisions(String(n),i,{wpId:e.openDocumentWpId(t,n)});return{revisions:s.map(k),hasMore:a}}function E(t,i){return e.openDocument(t)?e.isReadOnly(t)?e.readOnlyError():e.featureRefusal(t,"code_editor","the email code")??(e.markupHasContent(i)?void 0:e.err("invalidArgs",'"html" must not be empty: with no text, pictures or other visible elements it would erase the whole email.')):e.noDocument()}function b(t,{caller:i}){return i==="agent"&&e.getAgentService(t).answerOpen?e.err("undoConflict","The edits of this answer are not closed yet, so undo and redo are not possible now. Undo becomes available after the answer ends: tell the user about it."):void 0}function _(t){return{"document.replaceHtml":{precheck:i=>E(t,i.html),consent:i=>{const o=e.agentTranslator(t);return{title:o.__("Replace the whole email with new markup"),...e.detailsOf(e.markupSize(o,i.html))}}}}}function T(t,i){return{"document.getHtml":async({output:o})=>{const n=e.openDocument(t);return n?o!=="email"?n.getContent():v(t)??(await g(t,i,!1)).compiled.html:e.noDocument()},"document.getText":async()=>e.openDocument(t)?v(t)??(await g(t,i,!0)).compiled.text:e.noDocument(),"document.setHeaders":async o=>{const n=e.openDocument(t);if(!n)return e.noDocument();if(f(t))return e.err("unavailable","A block has no subject or preheader; open an email to set them.");if(e.isReadOnly(t))return e.readOnlyError();if(e.getAppConfig(t).lockPreheaderAndTitle===!0)return e.err("disabled","The subject and the preheader are locked in this editor.");const r=(o.subject!==void 0?e.featureRefusal(t,"theme_editing","the subject"):void 0)??(o.preheader!==void 0?e.featureRefusal(t,"preheader_editing","the preheader"):void 0);if(r)return r;const s=Object.fromEntries(Object.entries(o).filter(([,a])=>a!==void 0));return e.writeEmailAttributes(n,s),await e.settleHeaders(t),e.ok()},"document.getSettings":async()=>{const o=await d(t)?.getEmailLayoutSettings();return o?m.editableLayoutSettings(o):e.noDocument()},"document.setSettings":async({settings:o})=>{const n=d(t);if(!n||!e.openDocument(t))return e.noDocument();if(f(t))return e.err("unavailable","A block has no email layout settings; open an email to set them.");if(e.isReadOnly(t))return e.readOnlyError();const r=m.layoutSettingsRefusal(o);return r||(e.isCanvasOpen(t)?(await n.setEmailLayoutSettings(o),e.getMessageService(t).send({operation:e.EVENT_TYPES.SANDBOX_EMAIL_SETTINGS_SET,settings:o}),await e.askCanvasElement(t,{op:"settle"}).then(s=>s.ok,()=>!1)?e.ok():e.ok({canvasPending:!0})):e.err("unavailable","The canvas is not open."))},"document.getContentStyles":async()=>await d(t)?.getEmailContentStyles()??e.noDocument(),"document.setContentStyles":async({styles:o})=>{const n=d(t);if(!n||!e.openDocument(t))return e.noDocument();if(e.isReadOnly(t))return e.readOnlyError();const r=m.contentStylesRefusal(t,o,await n.getEmailContentStyles());return r||(await n.setEmailContentStyles(o),e.openDocument(t)?.markUnsaved(),e.ok())},"document.replaceHtml":({html:o})=>{const n=e.peekEmailDocuments(t),r=n?.current();if(!n||!r)return e.noDocument();const s=E(t,o);return s||(e.replaceDocumentContent(r,n.history(),o,{undoable:!0}),e.ok())},"history.undo":(o,n)=>{const r=e.undoPlanRefusal(t)??b(t,n);if(r)return r;const s=e.peekEmailDocuments(t)?.history();return s?.canUndo()?e.isReadOnly(t)?e.readOnlyError():s.tryUndo()?e.ok():e.err("nothingToUndo","The last step could not be undone: the text changed under it."):e.err("nothingToUndo","There is nothing to undo.")},"history.redo":(o,n)=>{const r=e.undoPlanRefusal(t)??b(t,n);if(r)return r;const s=e.peekEmailDocuments(t)?.history();return s?.canRedo()?e.isReadOnly(t)?e.readOnlyError():s.tryRedo()?e.ok():e.err("nothingToRedo","The step could not be redone: the text changed under it."):e.err("nothingToRedo","There is nothing to redo.")},"history.listRevisions":({page:o})=>R(t,o??1),"check.code":async()=>{const o=e.openDocument(t);return o?(await e.validateEmailCode(o.getContent())).map(({severity:n,message:r,startLineNumber:s,startColumn:a,endLineNumber:u,endColumn:l})=>({severity:w[n]??"error",message:r,startLineNumber:s,startColumn:a,endLineNumber:u,endColumn:l})):e.noDocument()},"check.codeSize":()=>{const o=e.openDocument(t);if(!o)return e.noDocument();const n=e.getCodeSize(o.getContent());return{sizeBytes:n,sizeKb:Math.round(n/1024),limitKb:90,exceeded:e.isCodeSizeExceeded(n,90)}},"block.list":async o=>{if(o.source==="gallery"){const r=await y.galleryBlockList(t);return e.isResult(r)?r:p.blockListPage(r.map(({id:s,title:a,description:u,type:l})=>({id:s,title:a,description:u,type:l})),o)}const n=await y.readProjectBlocks(t);return n?p.blockListPage(n.map(({id:r,title:s,description:a,type:u,global_block:l})=>({id:r,title:s,description:a,type:u,global:l===!0})),o):e.blocksNotLoaded()}}}h.agentDocumentGates=_,h.agentDocumentHandlers=T});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/5a290fb6.js",["require","exports","module","static/core/b8eb1c3a.js"],function(u,t,m){const r=u("./b8eb1c3a.js");var n="https://cdn.ampproject.org/v0",i=`${n}.js`,c=`script[src='${i}']`;function a(e){return r.isElement(e)&&(e.tagName.startsWith("AMP")||e.tagName==="FORM"||e.tagName==="TEMPLATE"&&e.getAttribute("type")?.toLowerCase()==="amp-mustache")}function s(e){return r.isScriptElement(e)&&e.src?.startsWith("https://cdn.ampproject.org/v0")}Object.defineProperty(t,"AMP_BASE_SCRIPT",{enumerable:!0,get:function(){return i}}),Object.defineProperty(t,"AMP_BASE_SELECTOR",{enumerable:!0,get:function(){return c}}),Object.defineProperty(t,"AMP_SCRIPTS_PATH",{enumerable:!0,get:function(){return n}}),Object.defineProperty(t,"isAmpElement",{enumerable:!0,get:function(){return a}}),Object.defineProperty(t,"isAmpScript",{enumerable:!0,get:function(){return s}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/630febfd.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js"],function(i,u,h){const b=i("./2ff39ddf.js"),a=i("./b8eb1c3a.js");function l(e,t){return a.readOnlyRefusal(e)??a.askCanvasElement(e,t)}function d(e){return e.ok?void 0:e}function s(e,t,r){return e.flatMap(n=>"children"in n?s(n.children??[],[...t,n.label],r):[{name:[...t,n.label].join(" / "),value:r.replace("%value%",()=>n.value),raw:n.value}])}function f(e,t){return e.flatMap((r,n)=>s([r],[],(t.length>1?t[n]:void 0)??t[0]??"%value%"))}function c(e){const{mergeTags:t}=a.getAppConfig(e);return f(t?.items??[],t?.syntax??[])}function m(e,t){const r=t.trim(),n=e.filter(o=>o.raw===r);return e.find(o=>o.value===r)??(n.length===1?n[0]:void 0)}function v(e){const t=()=>a.readOnlyRefusal(e);return{"column.remove":{precheck:t,consent:a.elementConsent(e,({__:r},n,{text:o})=>({title:r("Remove this column with its content"),...a.detailsOf(o)}))},"accordion.removeSection":{precheck:t,consent:a.elementConsent(e,({__:r},n)=>({title:r("Remove this accordion section with its content"),...a.detailsOf({label:r("Section"),value:String(n.index+1)})}))}}}function p(e){return{"variable.list":()=>a.featureRefusal(e,"variables","merge variables")??c(e).map(({name:t,value:r})=>({name:t,value:r})),"element.insertVariable":async({element:t,variable:r})=>{const n=a.readOnlyRefusal(e)??a.featureRefusal(e,"variables","merge variables");if(n)return n;const o=m(c(e),r);return o?l(e,{op:"insertVariable",element:t,variable:o.value}):a.err("notFound",`There is no merge variable "${r}"; take a value from variable.list.`)},"element.applyTypograf":async({element:t})=>a.featureRefusal(e,"typograph","the typograph")??d(await l(e,{op:"typograf",element:t})),"column.add":({element:t})=>l(e,{op:"addColumn",element:t}),"column.remove":({element:t})=>l(e,{op:"removeColumn",element:t}),"column.swap":({element:t,with:r})=>l(e,{op:"swapColumns",element:t,with:r}),"accordion.addSection":({element:t,title:r,text:n})=>l(e,{op:"addAccordionSection",element:t,title:r,text:n??""}),"accordion.removeSection":({element:t,index:r})=>l(e,{op:"removeAccordionSection",element:t,index:r})}}u.agentStructureGates=v,u.agentStructureHandlers=p});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/6539262f.js",["require","exports","module","static/core/b8eb1c3a.js"],function(l,t,O){const e=l("./b8eb1c3a.js");var n=50,o=200,_=["project","gallery"],a=e.Arg.optional(e.Arg.enum(..._)),d={source:a,type:e.Arg.optional(e.Arg.string()),search:e.Arg.optional(e.Arg.string()),limit:e.Arg.optional(e.Arg.number())},g=`Pass \`type\` (for example "header" or "footer") to list one kind only. \`search\` keeps blocks whose title contains it, in any case. Returns \`blocks\`, at most \`limit\` (${n} by default, up to ${o}), and \`total\`; \`truncated: true\` means more blocks matched than were returned.`;function L(m,{type:i,search:b,limit:f}){const u=b?.toLowerCase(),r=m.filter(c=>(i===void 0||c.type===i)&&(!u||(c.title??"").toLowerCase().includes(u))),s=Math.min(Math.max(Math.round(f??n),1),o);return{blocks:r.slice(0,s),total:r.length,...r.length>s?{truncated:!0}:{}}}Object.defineProperty(t,"BLOCK_LIST_ARGS",{enumerable:!0,get:function(){return d}}),Object.defineProperty(t,"BLOCK_LIST_HINT",{enumerable:!0,get:function(){return g}}),Object.defineProperty(t,"BLOCK_SOURCE_ARG",{enumerable:!0,get:function(){return a}}),Object.defineProperty(t,"blockListPage",{enumerable:!0,get:function(){return L}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/710be2de.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js"],function(i,d,P){const h=i("./2ff39ddf.js"),p=i("./b8eb1c3a.js");var u={items_per_page:"/ pagina",jump_to:"vai a",jump_to_confirm:"Conferma",page:"Pagina",prev_page:"Pagina precedente",next_page:"Pagina successiva",prev_5:"Precedente 5 pagine",next_5:"Prossime 5 pagine",prev_3:"Precedente 3 pagine",next_3:"Prossime 3 pagine",page_size:"dimensioni della pagina"};function o(a){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(a)}function l(a,e){var r=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(S){return Object.getOwnPropertyDescriptor(a,S).enumerable})),r.push.apply(r,n)}return r}function c(a){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?l(Object(r),!0).forEach(function(n){g(a,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(r)):l(Object(r)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(r,n))})}return a}function g(a,e,r){return e=f(e),e in a?Object.defineProperty(a,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):a[e]=r,a}function f(a){var e=b(a,"string");return o(e)=="symbol"?e:String(e)}function b(a,e){if(o(a)!="object"||!a)return a;var r=a[Symbol.toPrimitive];if(r!==void 0){var n=r.call(a,e||"default");if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var v=c(c({},p.commonLocale),{},{locale:"it_IT",today:"Oggi",now:"Adesso",backToToday:"Torna ad oggi",ok:"OK",clear:"Cancella",week:"Settimana",month:"Mese",year:"Anno",timeSelect:"Seleziona l'ora",dateSelect:"Seleziona la data",monthSelect:"Seleziona il mese",yearSelect:"Seleziona l'anno",decadeSelect:"Seleziona il decennio",previousMonth:"Il mese scorso (PageUp)",nextMonth:"Il prossimo mese (PageDown)",previousYear:"L'anno scorso (Control + sinistra)",nextYear:"L'anno prossimo (Control + destra)",previousDecade:"Ultimo decennio",nextDecade:"Prossimo decennio",previousCentury:"Secolo precedente",nextCentury:"Prossimo secolo",shortWeekDays:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],shortMonths:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"]}),s={placeholder:"Selezionare l'orario",rangePlaceholder:["Inizio orario","Fine orario"]},m={lang:{placeholder:"Selezionare la data",rangePlaceholder:["Data d'inizio","Data di fine"],...v},timePickerLocale:{...s}},y=m,t=" ${label} non è un ${type} valido",$={locale:"it",Pagination:u,DatePicker:m,TimePicker:s,Calendar:y,global:{placeholder:"Selezionare",close:"Chiudi",show:"Mostra",hide:"Nascondi"},Table:{filterTitle:"Menù Filtro",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"Senza filtri",filterCheckAll:"Seleziona tutti",filterSearchPlaceholder:"Cerca nei filtri",emptyText:"Senza dati",selectAll:"Seleziona pagina corrente",selectInvert:"Inverti selezione nella pagina corrente",selectNone:"Deseleziona tutto",selectionAll:"Seleziona tutto",sortTitle:"Ordina",expand:"Espandi riga",collapse:"Comprimi riga ",triggerDesc:"Clicca per ordinare in modo discendente",triggerAsc:"Clicca per ordinare in modo ascendente",cancelSort:"Clicca per eliminare l'ordinamento"},Tour:{Next:"Successivo",Previous:"Precedente",Finish:"Termina"},Modal:{okText:"OK",cancelText:"Annulla",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Annulla"},Transfer:{titles:["",""],searchPlaceholder:"Cerca qui",itemUnit:"elemento",itemsUnit:"elementi",remove:"Elimina",selectCurrent:"Seleziona la pagina corrente",removeCurrent:"Rimuovi la pagina corrente",selectAll:"Seleziona tutti i dati",removeAll:"Rimuovi tutti i dati",selectInvert:"Inverti la pagina corrente"},Upload:{uploading:"Caricamento...",removeFile:"Rimuovi il file",uploadError:"Errore di caricamento",previewFile:"Anteprima file",downloadFile:"Scarica file"},Empty:{description:"Nessun dato"},Icon:{icon:"icona"},Text:{edit:"modifica",copy:"copia",copied:"copia effettuata",expand:"espandi"},Form:{optional:"(opzionale)",defaultValidateMessages:{default:"Errore di convalida del campo ${label}",required:"Si prega di inserire ${label}",enum:"${label} deve essere uno di [${enum}]",whitespace:"${label} non può essere un carattere vuoto",date:{format:"Il formato della data ${label} non è valido",parse:"${label} non può essere convertito in una data",invalid:"${label} non è una data valida"},types:{string:t,method:t,array:t,object:t,number:t,date:t,boolean:t,integer:t,float:t,regexp:t,email:t,url:t,hex:t},string:{len:"${label} deve avere ${len} caratteri",min:"${label} deve contenere almeno ${min} caratteri",max:"${label} deve contenere fino a ${max} caratteri",range:"${label} deve contenere tra ${min}-${max} caratteri"},number:{len:"${label} deve essere uguale a ${len}",min:"${label} valore minimo è ${min}",max:"${label} valor e massimo è ${max}",range:"${label} deve essere compreso tra ${min}-${max}"},array:{len:"Deve essere ${len} ${label}",min:"Almeno ${min} ${label}",max:"Massimo ${max} ${label}",range:"Il totale di ${label} deve essere compreso tra ${min}-${max}"},pattern:{mismatch:"${label} non corrisponde al modello ${pattern}"}}},QRCode:{expired:"Codice QR scaduto",refresh:"Ricarica",scanned:"Scansionato"},ColorPicker:{presetEmpty:"Vuoto",transparent:"Trasparente",singleColor:"Tinta unita",gradientColor:"Gradiente"}};d.default=$});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/7774d8cb.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js"],function(i,p,$){const P=i("./2ff39ddf.js"),d=i("./b8eb1c3a.js");var u={items_per_page:"/ página",jump_to:"Vá até",jump_to_confirm:"confirme",page:"Página",prev_page:"Página anterior",next_page:"Próxima página",prev_5:"5 páginas anteriores",next_5:"5 próximas páginas",prev_3:"3 páginas anteriores",next_3:"3 próximas páginas",page_size:"tamanho da página"};function n(r){"@babel/helpers - typeof";return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(r)}function l(r,e){var a=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(h){return Object.getOwnPropertyDescriptor(r,h).enumerable})),a.push.apply(a,t)}return a}function c(r){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?l(Object(a),!0).forEach(function(t){v(r,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(a,t))})}return r}function v(r,e,a){return e=b(e),e in r?Object.defineProperty(r,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[e]=a,r}function b(r){var e=f(r,"string");return n(e)=="symbol"?e:String(e)}function f(r,e){if(n(r)!="object"||!r)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var t=a.call(r,e||"default");if(n(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var g=c(c({},d.commonLocale),{},{locale:"pt_BR",today:"Hoje",now:"Agora",backToToday:"Voltar para hoje",ok:"OK",clear:"Limpar",week:"Semana",month:"Mês",year:"Ano",timeSelect:"Selecionar hora",dateSelect:"Selecionar data",monthSelect:"Escolher mês",yearSelect:"Escolher ano",decadeSelect:"Escolher década",monthBeforeYear:!1,previousMonth:"Mês anterior (PageUp)",nextMonth:"Próximo mês (PageDown)",previousYear:"Ano anterior (Control + esquerda)",nextYear:"Próximo ano (Control + direita)",previousDecade:"Década anterior",nextDecade:"Próxima década",previousCentury:"Século anterior",nextCentury:"Próximo século",shortWeekDays:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],shortMonths:["Jan","Fev","Mar","Abr","Mai","Jun","Jul","Ago","Set","Out","Nov","Dez"]}),s={placeholder:"Hora",rangePlaceholder:["Hora de início","Hora de término"]},m={lang:{placeholder:"Selecionar data",rangePlaceholder:["Data inicial","Data final"],...g},timePickerLocale:{...s}},x=m,o="${label} não é um ${type} válido",y={locale:"pt-br",Pagination:u,DatePicker:m,TimePicker:s,Calendar:x,global:{placeholder:"Por favor escolha",close:"Fechar",show:"Mostrar",hide:"Ocultar"},Table:{filterTitle:"Menu de Filtro",filterConfirm:"OK",filterReset:"Resetar",filterEmptyText:"Sem filtros",filterCheckAll:"Selecionar todos os itens",filterSearchPlaceholder:"Pesquisar nos filtros",emptyText:"Sem conteúdo",selectAll:"Selecionar página atual",selectInvert:"Inverter seleção",selectNone:"Apagar todo o conteúdo",selectionAll:"Selecionar todo o conteúdo",sortTitle:"Ordenar título",expand:"Expandir linha",collapse:"Colapsar linha",triggerDesc:"Clique organiza por descendente",triggerAsc:"Clique organiza por ascendente",cancelSort:"Clique para cancelar organização"},Tour:{Next:"Próximo",Previous:"Anterior",Finish:"Finalizar"},Modal:{okText:"OK",cancelText:"Cancelar",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancelar"},Transfer:{titles:["",""],searchPlaceholder:"Procurar",itemUnit:"item",itemsUnit:"items",remove:"Remover",selectCurrent:"Selecionar página atual",removeCurrent:"Remover página atual",selectAll:"Selecionar todos",removeAll:"Remover todos",selectInvert:"Inverter seleção atual"},Upload:{uploading:"Enviando...",removeFile:"Remover arquivo",uploadError:"Erro no envio",previewFile:"Visualizar arquivo",downloadFile:"Baixar arquivo"},Empty:{description:"Não há dados"},Icon:{icon:"ícone"},Text:{edit:"editar",copy:"copiar",copied:"copiado",expand:"expandir"},Form:{optional:"(opcional)",defaultValidateMessages:{default:"Erro ${label} na validação de campo",required:"Por favor, insira ${label}",enum:"${label} deve ser um dos seguinte: [${enum}]",whitespace:"${label} não pode ser um carácter vazio",date:{format:" O formato de data ${label} é inválido",parse:"${label} não pode ser convertido para uma data",invalid:"${label} é uma data inválida"},types:{string:o,method:o,array:o,object:o,number:o,date:o,boolean:o,integer:o,float:o,regexp:o,email:o,url:o,hex:o},string:{len:"${label} deve possuir ${len} caracteres",min:"${label} deve possuir ao menos ${min} caracteres",max:"${label} deve possuir no máximo ${max} caracteres",range:"${label} deve possuir entre ${min} e ${max} caracteres"},number:{len:"${label} deve ser igual à ${len}",min:"O valor mínimo de ${label} é ${min}",max:"O valor máximo de ${label} é ${max}",range:"${label} deve estar entre ${min} e ${max}"},array:{len:"Deve ser ${len} ${label}",min:"No mínimo ${min} ${label}",max:"No máximo ${max} ${label}",range:"A quantidade de ${label} deve estar entre ${min} e ${max}"},pattern:{mismatch:"${label} não se encaixa no padrão ${pattern}"}}}};p.default=y});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/791b9022.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js"],function(g,$,L){const T=g("./2ff39ddf.js"),u=g("./b8eb1c3a.js");function w(t,e){const d={bytes:0,hidden:0,byKind:{}};for(const n of e)if(!(n.finishedAt>t.end||n.finishedAt<t.start)){if(n.transferred===null){d.hidden+=1;continue}d.bytes+=n.transferred,d.byKind[n.kind]=(d.byKind[n.kind]??0)+n.transferred}return d}var y="core:module:";function v(t){const e=[...t].sort((n,r)=>n.start-r.start),d=[];return e.forEach(n=>{const r=d[d.length-1];if(r&&n.start<=r.end){r.end=Math.max(r.end,n.end);return}d.push({start:n.start,end:n.end})}),d}function A(t,e){const d=Math.max(0,t.end-t.start),n=v(e.map(r=>({start:Math.max(t.start,r.startedAt),end:Math.min(t.end,r.finishedAt)})).filter(r=>r.end>r.start)).reduce((r,o)=>r+(o.end-o.start),0);return{networkMs:n,quietMs:d-n}}function P(t){const e=new Map;t.forEach(n=>{if(!n.phase.startsWith(y))return;const r=n.phase.slice(12),o=r.lastIndexOf(":");if(o<=0)return;const s=r.slice(0,o),a=r.slice(o+1),i=e.get(s)??{};a==="ask"?(i.ask=n.at,n.parent&&(i.parent=n.parent)):a==="loaded"?i.loaded=n.at:a==="deps"?i.deps=n.at:a==="ready"&&(i.ready=n.at),e.set(s,i)});const d=[];return e.forEach((n,r)=>{if(n.ask===void 0||n.ready===void 0)return;const o=n.ask,s=n.ready,a=n.deps,i=n.loaded;d.push({id:r,parent:n.parent,askedAt:o,loadedAt:i,depsAt:a,readyAt:s,networkMs:i===void 0?0:i-o,waitingMs:a===void 0?0:a-(i??o),executionMs:a===void 0?0:s-a})}),d}function S(t){const e=new Map;t.forEach(o=>{if(o.parent===void 0)return;const s=e.get(o.parent)??[];s.push(o),e.set(o.parent,s)});let d=t.filter(o=>o.parent===void 0).reduce((o,s)=>o===void 0||s.readyAt>o.readyAt?s:o,void 0);const n=[],r=new Set;for(;d&&!r.has(d.id);)r.add(d.id),n.push(d),d=(e.get(d.id)??[]).reduce((o,s)=>o===void 0||s.readyAt>o.readyAt?s:o,void 0);return n}function E(t,e){const d=u.detectMount(t),n=u.requiredPhases(d),r=new Map;t.forEach(l=>{n.includes(l.phase)&&!r.has(l.phase)&&r.set(l.phase,l.at)});const o=[...r.entries()].sort((l,h)=>l[1]-h[1]),s=q(d),a=o.findIndex(([l])=>l===s),i=a===-1?o:o.slice(0,a+1);return i.slice(1).map(([l,h],m)=>{const[x,p]=i[m],f=A({start:p,end:h},e);return{from:x,to:l,startedAt:p,endedAt:h,durationMs:h-p,networkMs:f.networkMs,quietMs:f.quietMs}})}function q(t){return t==="headless"?u.PHASES.showEnd:u.PHASES.canvasSettled}function M(t,e){const d=t.find(n=>n.phase===e);return d?d.at:null}function j(t,e){return t===null?e:e===null?t:Math.max(t,e)}function z(t,e){const d=u.missingRequiredPhases(t),n=d.length===0,r=t.reduce((p,f)=>p===null||f.at<p?f.at:p,null),o=u.detectMount(t),s=M(t,u.PHASES.canvasPainted),a=o==="headless"?M(t,u.PHASES.showEnd):j(M(t,u.PHASES.canvasSettled),M(t,u.PHASES.editorVisible)),i=P(t),l=i.reduce((p,f)=>p+f.executionMs,0),h=r!==null&&n&&(o==="headless"||s!==null),m=o==="headless"?a:s,x=h&&m!==null?A({start:r,end:m},e):{networkMs:0,quietMs:0};return{startedAt:r,paintedAt:s,settledAt:a,totalMs:h&&s!==null?s-r:null,settledMs:h&&a!==null?a-r:null,settleGapMs:h&&a!==null&&s!==null?a-s:null,segments:h?E(t,e):[],complete:n,missingPhases:d,networkMs:x.networkMs,quietMs:x.quietMs,moduleExecutionMs:l,criticalPath:S(i),transferBeforeFrame:h&&r!==null&&m!==null?w({start:r,end:m},e):{bytes:0,hidden:0,byKind:{}}}}function c(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}function H(){return"dev"}function k(t,e){return{mode:H(),summary:z(t,e),marks:[...t],resources:[...e]}}function b(t){return t===null?"—":`${Math.round(t)} мс`}function _(t){return t==="dev"?"dev-сервер — AMD-ядро не работает, слой модулей пуст":t==="build"?"собранная версия":"режим неизвестен"}function R(t){const{summary:e}=t,d=e.complete?'<span class="ok">прогон полный</span>':'<span class="bad">прогон неполный — в сравнение не идёт</span>',n=e.missingPhases.length===0?"":`<p class="bad">Не хватает фаз: ${e.missingPhases.map(c).join(", ")}</p>`;return`
|
|
2
2
|
<header>
|
|
3
3
|
<h1>Куда ушло время до показа письма</h1>
|
|
4
4
|
<p class="mode">${c(_(t.mode))}</p>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
(function(){try{if(typeof document<"u"){var r=".blocks-app .image-editor-modal .ant-modal-container{flex-direction:column;min-height:100vh;display:flex;border-radius:0!important}.blocks-app .image-editor-modal .ant-modal-body{border-bottom:1px solid #d9d9d9;flex-grow:1;display:flex}.blocks-app .image-editor-modal .ant-modal-body #filerobot-editor{flex-grow:1;height:calc(100vh - 70px);min-height:calc(100vh - 70px);overflow:hidden}.blocks-app .image-editor-modal .pi .text-on-primary{background:var(--ub-colorPrimary);border-color:var(--ub-colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary:hover{background:var(--ub-colorPrimaryHover);border-color:var(--ub-colorPrimaryHover)}.blocks-app .image-editor-modal .pi .text-on-primary.rounded-full{border-radius:calc(var(--ub-borderRadius) * 1px)}.blocks-app .image-editor-modal .pi .shadow-xl{box-shadow:none}.blocks-app .image-editor-modal .w-\\[4ch\\].text-sm.text-center{width:5ch}.blocks-app .image-editor-modal .pi .border-white{border-color:var(--ub-colorPrimary)}.blocks-app .image-editor-modal .pi .bg-white\\/50{background-color:var(--ub-colorPrimary)}.blocks-app .image-editor-modal .pi .text-on-primary{color:var(--ub-colorWhite)}",e=window.__useblocks_styles__||(window.__useblocks_styles__={sheets:{},order:[]}),l=r;if(!e.sheets[l]){var t=null;try{typeof CSSStyleSheet=="function"&&"replaceSync"in CSSStyleSheet.prototype&&(t=new CSSStyleSheet,t.replaceSync(r))}catch{t=null}if(t){if(!e.host||!e.host.isConnected||!e.host.sheet){var o=document.createElement("style");o.setAttribute("data-useblocks","true"),document.head.appendChild(o),e.host=o}for(var d=e.host.sheet,i=0;i<t.cssRules.length;i++)try{d.insertRule(t.cssRules[i].cssText,d.cssRules.length)}catch{}(e.texts||(e.texts=[])).push(r),(e.listeners||[]).forEach(function(a){try{a(r)}catch{}})}else{var o=document.createElement("style");o.setAttribute("data-useblocks","true"),o.appendChild(document.createTextNode(r)),document.head.appendChild(o)}e.sheets[l]=!0,e.order.push(l)}}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
|
|
2
|
-
__useblocks__.define("static/core/
|
|
2
|
+
__useblocks__.define("static/core/7a43af5d.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/b8eb1c3a.js","static/core/395f9635.js","static/core/f615b5d9.js","static/core/c41fa010.js","static/core/a73da823.js","react","react/jsx-runtime","__delivery__/libs"],function(r,N,Z){const F=r("./2ff39ddf.js"),b=r("./cf7d1dd7.js"),e=r("./b8eb1c3a.js"),E=r("./395f9635.js");r("./f615b5d9.js");const d=r("./c41fa010.js"),U=r("./a73da823.js");let s=r("react");s=F.__toESM(s);let c=r("react/jsx-runtime"),_=r("__delivery__/libs");var L={width:"100%",height:"100%"},P=[d.TABS_IDS.ADJUST,d.TABS_IDS.ANNOTATE,d.TABS_IDS.RESIZE],$={presetsItems:E.C};function z(n,l){if(n==="json")return new Blob([l],{type:"application/json"});if(n==="svg")return new Blob([l],{type:"image/svg+xml"});const f=`image/${n}`,p=l.replace(/data:image\/([a-z]*)?;base64,/,"");return U.base64ToBlob(p,f)}var G=({currentImageLink:n,prefetchedBlob:l,resolveImageBlob:f,onSave:p,uploadImageResultIsLoading:H})=>{const v=e.useCookieManager(),[I,S]=(0,s.useState)(),[R,T]=(0,s.useState)(),{__:D}=e.useI18n();let m=e.useDispatch();const O=e.useStore(),y=e.useAppConfig(),w=e.useEditorLocale(),J=e.useSelector(e.selectSecondModal),k=e.useProjectData();(0,s.useMemo)(()=>{if(!y?.icons)return;const a={};for(const[i,t]of Object.entries(y.icons))typeof t=="string"&&(a[i]=e.sanitizeHtml(t));return Object.keys(a).length>0?a:void 0},[y?.icons]);const[K,x]=(0,s.useState)(!1),h=(0,s.useRef)(),A=(0,s.useRef)(null),j=d.useCornerRadiusSync(A),B=e.useEventEmitter(b.events.FILE_PROXY_EVENT_ID);(0,s.useEffect)(()=>{let a=!1;return(async()=>{const t=n;if(!t&&!l)return;let o=l;if(!o&&t)try{typeof f=="function"?o=await f(t):o=await(await fetch(t)).blob()}catch{if(a)return;if(o=await B.fire({url:t,project:k}).filter(u=>u instanceof Blob)[0],!o){const u=v.get(e.APP_COOKIES.em_token)||await e.di.getContainer(O)?.getInstance(b.TOKEN_ID);o=await(await fetch(`https://app.useblocks.io/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(t)}`,{headers:{authorization:`Bearer ${u}`}})).blob()}}if(a||!o)return;const g=new FileReader;g.onload=()=>{if(a)return;const u=g.result;typeof u=="string"&&(S(u),T(o.type))},g.onerror=()=>{},g.readAsDataURL(o)})().catch(t=>{}),()=>{a=!0}},[n,l,f,v,B,k,O]);const V=(0,s.useCallback)(()=>{S(null),T(null),x(!1),m(e.closeSecondModal()),m(e.closeModal$1(e.MODALS.UPLOAD_IMAGE_MODAL))},[m]),M=(0,s.useRef)();M.current=async function(a,i,t){try{const o=z(t,a);p&&await p(new File([o],i,{lastModified:Date.now(),type:o.type}))}catch(o){throw o}};const Y=(0,s.useCallback)(a=>{x(!!a)},[]),W=(0,s.useCallback)(()=>{if(!h.current)return;const a=n?.split("/").pop().split(".")[0]||"image",i=j.isRounded?"png":R?.split("/")[1]||"png";try{const{imageData:t}=h.current({name:a,extension:i},void 0,!1),o=t.imageBase64??(t.imageCanvas?t.imageCanvas.toDataURL(`image/${i}`):void 0);if(!o)throw new Error("FIE не вернул ни imageBase64, ни imageCanvas");M.current(o,a,i)}catch{}},[j.isRounded,n,R]),C=w?w.replace("_","-"):"en-US",X=(0,s.useMemo)(()=>E._(C),[C]);return(0,c.jsxs)(_.ui_kit$Modal,{afterOpenChange:Y,width:"100%",style:{maxWidth:"100%",minHeight:"100vh"},className:"image-editor-modal",centered:!0,closable:!1,zIndex:1100,mask:!1,open:J,footer:[(0,c.jsx)(_.ui_kit$Button,{className:"em-analytics__profile-cancel",onClick:V,children:D("Cancel")},"Cancel"),(0,c.jsx)(_.ui_kit$Button,{className:"em-analytics__profile-updafilerobotte",id:"save",type:"primary",onClick:W,children:D("Update")},"Ok")],children:[H&&(0,c.jsx)("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:e.emCssVar("colorBgLayout"),zIndex:10,opacity:.7},children:(0,c.jsx)(_.ui_kit$Spin,{size:"large"})}),(0,c.jsx)("div",{id:"filerobot-editor",ref:A,style:L,children:K&&I&&(0,c.jsx)(d.AssemblyPoint_default,{source:I,useBackendTranslations:!1,language:C.split("-")[0],translations:X,tabsIds:P,defaultTabId:d.TABS_IDS.ADJUST,Crop:$,...j.editorConfig,avoidChangesNotSavedAlertOnLeave:!0,removeSaveButton:!0,getCurrentImgDataFnRef:h})})]})};N.default=G});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/7d2c1fd4.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js"],function(n,u,P){const x=n("./2ff39ddf.js"),p=n("./b8eb1c3a.js");var b={items_per_page:"/ сторінці",jump_to:"Перейти",jump_to_confirm:"підтвердити",page:"",prev_page:"Попередня сторінка",next_page:"Наступна сторінка",prev_5:"Попередні 5 сторінок",next_5:"Наступні 5 сторінок",prev_3:"Попередні 3 сторінки",next_3:"Наступні 3 сторінки",page_size:"Page Size"};function o(r){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(r)}function i(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);e&&(a=a.filter(function(v){return Object.getOwnPropertyDescriptor(r,v).enumerable})),t.push.apply(t,a)}return t}function c(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?i(Object(t),!0).forEach(function(a){d(r,a,t[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach(function(a){Object.defineProperty(r,a,Object.getOwnPropertyDescriptor(t,a))})}return r}function d(r,e,t){return e=f(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function f(r){var e=y(r,"string");return o(e)=="symbol"?e:String(e)}function y(r,e){if(o(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var a=t.call(r,e||"default");if(o(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var g=c(c({},p.commonLocale),{},{locale:"uk_UA",today:"Сьогодні",now:"Зараз",backToToday:"Поточна дата",ok:"OK",clear:"Очистити",week:"Тиждень",month:"Місяць",year:"Рік",timeSelect:"Обрати час",dateSelect:"Обрати дату",monthSelect:"Обрати місяць",yearSelect:"Обрати рік",decadeSelect:"Обрати десятиріччя",previousMonth:"Попередній місяць (PageUp)",nextMonth:"Наступний місяць (PageDown)",previousYear:"Попередній рік (Control + left)",nextYear:"Наступний рік (Control + right)",previousDecade:"Попереднє десятиріччя",nextDecade:"Наступне десятиріччя",previousCentury:"Попереднє століття",nextCentury:"Наступне століття"}),s={placeholder:"Оберіть час",rangePlaceholder:["Початковий час","Кінцевий час"]},m={lang:{placeholder:"Оберіть дату",yearPlaceholder:"Оберіть рік",quarterPlaceholder:"Оберіть квартал",monthPlaceholder:"Оберіть місяць",weekPlaceholder:"Оберіть тиждень",rangePlaceholder:["Початкова дата","Кінцева дата"],rangeYearPlaceholder:["Початковий рік","Кінцевий рік"],rangeMonthPlaceholder:["Початковий місяць","Кінцевий місяць"],rangeWeekPlaceholder:["Початковий тиждень","Кінцевий тиждень"],shortWeekDays:["Нд","Пн","Вт","Ср","Чт","Пт","Сб"],shortMonths:["Січ","Лют","Бер","Кві","Тра","Чер","Лип","Сер","Вер","Жов","Лис","Гру"],...g},timePickerLocale:{...s}},h=m,l="${label} не є типом ${type}",$={locale:"uk",Pagination:b,DatePicker:m,TimePicker:s,Calendar:h,global:{placeholder:"Будь ласка, оберіть",close:"Закрити",show:"Показати",hide:"Приховати"},Table:{filterTitle:"Фільтрувати",filterConfirm:"OK",filterReset:"Скинути",filterEmptyText:"Фільтри відсутні",filterCheckAll:"Обрати всі",filterSearchPlaceholder:"Пошук у фільтрах",emptyText:"Даних немає",selectAll:"Обрати всі на сторінці",selectInvert:"Інвертувати вибір",selectNone:"Очистити вибір",selectionAll:"Обрати всі",sortTitle:"Сортувати",expand:"Розгорнути рядок",collapse:"Згорнути рядок",triggerDesc:"Сортувати за спаданням",triggerAsc:"Сортувати за зростанням",cancelSort:"Відмінити сортування"},Tour:{Next:"Далі",Previous:"Назад",Finish:"Завершити"},Modal:{okText:"Гаразд",cancelText:"Скасувати",justOkText:"Гаразд"},Popconfirm:{okText:"Гаразд",cancelText:"Скасувати"},Transfer:{titles:["",""],searchPlaceholder:"Введіть текст для пошуку",itemUnit:"елем.",itemsUnit:"елем.",remove:"Видалити",selectCurrent:"Вибрати поточну сторінку",removeCurrent:"Скасувати вибір на сторінці",selectAll:"Вибрати всі дані",deselectAll:"Очистити вибір",removeAll:"Скасувати вибір",selectInvert:"Інвертувати поточну сторінку"},Upload:{uploading:"Завантаження ...",removeFile:"Видалити файл",uploadError:"Помилка завантаження",previewFile:"Попередній перегляд файлу",downloadFile:"Завантажити файл"},Empty:{description:"Даних немає"},Icon:{icon:"іконка"},Text:{edit:"Редагувати",copy:"Скопіювати",copied:"Скопійовано",expand:"Розширити"},Form:{optional:"(опціонально)",defaultValidateMessages:{default:"Помилка валідації для поля ${label}",required:"Будь ласка, заповніть ${label}",enum:"Лише одне зі значень [${enum}] доступне для ${label}",whitespace:"Значення у полі ${label} не може бути пробілом",date:{format:"Не валідний формат дати у ${label}",parse:"Значення ${label} не може бути приведене до дати",invalid:"Не валідна дата у ${label}"},types:{string:l,method:l,array:l,object:l,number:l,date:l,boolean:l,integer:l,float:l,regexp:l,email:l,url:l,hex:l},string:{len:"${label} має містити ${len} символів",min:"${label} має містити не менш, ніж ${min} символів",max:"${label} має містити не більш, ніж ${max} символів",range:"${label} має містити ${min}-${max} символів"},number:{len:"${label} має дорівнювати ${len}",min:"${label} має бути не менш, ніж ${min}",max:"${label} має бути не більш, ніж ${max}",range:"${label} має бути в межах ${min}-${max}"},array:{len:"${label} має містити ${len} елементи",min:"${label} має містити не менш, ніж ${min} елементи",max:"${label} має містити не більш, ніж ${max} елементи",range:"Кількість елементів в ${label} має бути в межах ${min}-${max}"},pattern:{mismatch:"${label} не відповідає шаблону ${pattern}"}}},QRCode:{expired:"QR-код закінчився",refresh:"Оновити"}};u.default=$});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/7da32d21.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js"],function(n,p,g){const $=n("./2ff39ddf.js"),u=n("./b8eb1c3a.js");var d={items_per_page:"na stronę",jump_to:"Idź do",jump_to_confirm:"potwierdź",page:"",prev_page:"Poprzednia strona",next_page:"Następna strona",prev_5:"Poprzednie 5 stron",next_5:"Następne 5 stron",prev_3:"Poprzednie 3 strony",next_3:"Następne 3 strony",page_size:"rozmiar strony"};function o(a){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(a)}function l(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(a);e&&(i=i.filter(function(j){return Object.getOwnPropertyDescriptor(a,j).enumerable})),t.push.apply(t,i)}return t}function s(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?l(Object(t),!0).forEach(function(i){y(a,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach(function(i){Object.defineProperty(a,i,Object.getOwnPropertyDescriptor(t,i))})}return a}function y(a,e,t){return e=b(e),e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function b(a){var e=w(a,"string");return o(e)=="symbol"?e:String(e)}function w(a,e){if(o(a)!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var i=t.call(a,e||"default");if(o(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}var z=s(s({},u.commonLocale),{},{locale:"pl_PL",today:"Dzisiaj",now:"Teraz",backToToday:"Ustaw dzisiaj",ok:"OK",clear:"Wyczyść",week:"Tydzień",month:"Miesiąc",year:"Rok",timeSelect:"Ustaw czas",dateSelect:"Ustaw datę",monthSelect:"Wybierz miesiąc",yearSelect:"Wybierz rok",decadeSelect:"Wybierz dekadę",previousMonth:"Poprzedni miesiąc (PageUp)",nextMonth:"Następny miesiąc (PageDown)",previousYear:"Ostatni rok (Ctrl + left)",nextYear:"Następny rok (Ctrl + right)",previousDecade:"Ostatnia dekada",nextDecade:"Następna dekada",previousCentury:"Ostatni wiek",nextCentury:"Następny wiek"}),c={placeholder:"Wybierz godzinę",rangePlaceholder:["Czas rozpoczęcia","Czas zakończenia"]},m={lang:{placeholder:"Wybierz datę",rangePlaceholder:["Data początkowa","Data końcowa"],yearFormat:"YYYY",monthFormat:"MMMM",monthBeforeYear:!0,shortWeekDays:["Niedz","Pon","Wt","Śr","Czw","Pt","Sob"],shortMonths:["Sty","Lut","Mar","Kwi","Maj","Cze","Lip","Sie","Wrz","Paź","Lis","Gru"],...z},timePickerLocale:{...c}},f=m,r="${label} nie posiada poprawnej wartości dla typu ${type}",k={locale:"pl",Pagination:d,DatePicker:m,TimePicker:c,Calendar:f,global:{placeholder:"Wybierz",close:"Zamknij",show:"Pokaż",hide:"Ukryj"},Table:{filterTitle:"Menu filtra",filterConfirm:"OK",filterReset:"Usuń filtry",filterEmptyText:"Brak filtrów",filterCheckAll:"Wybierz wszystkie elementy",filterSearchPlaceholder:"Szukaj w filtrach",emptyText:"Brak danych",selectAll:"Zaznacz bieżącą stronę",selectInvert:"Odwróć zaznaczenie",selectNone:"Wyczyść",selectionAll:"Wybierz wszystkie",sortTitle:"Sortowanie",expand:"Rozwiń wiersz",collapse:"Zwiń wiersz",triggerDesc:"Sortuj malejąco",triggerAsc:"Sortuj rosnąco",cancelSort:"Usuń sortowanie"},Tour:{Next:"Dalej",Previous:"Wróć",Finish:"Zakończ"},Modal:{okText:"OK",cancelText:"Anuluj",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Anuluj"},Transfer:{titles:["",""],searchPlaceholder:"Szukaj",itemUnit:"obiekt",itemsUnit:"obiekty",remove:"Usuń",selectCurrent:"Wybierz aktualną stronę",removeCurrent:"Usuń aktualną stronę",selectAll:"Wybierz wszystkie",removeAll:"Usuń wszystkie",selectInvert:"Odwróć wybór"},Upload:{uploading:"Wysyłanie...",removeFile:"Usuń plik",uploadError:"Błąd wysyłania",previewFile:"Podejrzyj plik",downloadFile:"Pobieranie pliku"},Empty:{description:"Brak danych"},Icon:{icon:"Ikona"},Text:{edit:"Edytuj",copy:"Kopiuj",copied:"Skopiowany",expand:"Rozwiń"},Form:{optional:"(opcjonalne)",defaultValidateMessages:{default:"Błąd walidacji dla pola ${label}",required:"Pole ${label} jest wymagane",enum:"Pole ${label} musi posiadać wartość z listy: [${enum}]",whitespace:"Pole ${label} nie może być puste",date:{format:"${label} posiada zły format daty",parse:"${label} nie może zostać zinterpretowane jako data",invalid:"${label} jest niepoprawną datą"},types:{string:r,method:r,array:r,object:r,number:r,date:r,boolean:r,integer:r,float:r,regexp:r,email:r,url:r,hex:r},string:{len:"${label} musi posiadać ${len} znaków",min:"${label} musi posiadać co namniej ${min} znaków",max:"${label} musi posiadać maksymalnie ${max} znaków",range:"${label} musi posiadać między ${min} a ${max} znaków"},number:{len:"${label} musi mieć wartość o długości ${len}",min:"${label} musi mieć wartość większą lub równą ${min}",max:"${label} musi mieć wartość mniejszą lub równą ${max}",range:"${label} musi mieć wartość pomiędzy ${min} a ${max}"},array:{len:"${label} musi posiadać ${len} elementów",min:"${label} musi posiadać co najmniej ${min} elementów",max:"${label} musi posiadać maksymalnie ${max} elementów",range:"${label} musi posiadać między ${min} a ${max} elementów"},pattern:{mismatch:"${label} nie posiada wartości zgodnej ze wzorem ${pattern}"}}}};p.default=k});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/84c5ed0d.js",["require","exports","module","static/core/cf7d1dd7.js","static/core/b8eb1c3a.js","static/core/cbfe265e.js"],function(n,c,f){const s=n("./cf7d1dd7.js"),r=n("./b8eb1c3a.js"),d=n("./cbfe265e.js");function j(e){const t=e.getInstance(s.STORE_ID);return t?t.dispatch:void 0}async function i(e,t,o){const l=j(e);if(!l)return;const u=l(t);try{const a=await u;return a.error===void 0?a.data??o:void 0}finally{u.unsubscribe?.()}}function g(e){const t=r.getCurrentProjectId(e);return i(e,r.blocksApi.endpoints.getBlocks.initiate(r.projectBlocksArgs(t===void 0?void 0:String(t))),[])}async function p(e){const t=r.getCurrentProjectId(e);return await i(e,r.blocksApi.endpoints.getTemplateBlocks.initiate(r.templateBlocksArgs(t===void 0?void 0:String(t))),[])??r.err("unavailable","The block gallery could not be loaded.")}async function b(e,t){const o=e.getInstance(s.STORE_ID);return o?d.blockHtmlForInsert(()=>o.getState(),t):void 0}Object.defineProperty(c,"galleryBlockList",{enumerable:!0,get:function(){return p}}),Object.defineProperty(c,"projectBlockHtml",{enumerable:!0,get:function(){return b}}),Object.defineProperty(c,"readProjectBlocks",{enumerable:!0,get:function(){return g}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/8606910e.js",["require","exports","module","static/core/2ff39ddf.js","static/core/cf7d1dd7.js","static/core/b8eb1c3a.js","react","react/jsx-runtime","__delivery__/libs"],function(C,ve,Me){const F=C("./2ff39ddf.js"),he=C("./cf7d1dd7.js"),e=C("./b8eb1c3a.js");let o=C("react");o=F.__toESM(o);let A=C("react/jsx-runtime"),P=C("__delivery__/libs");var d=F.__toESM(e.require_prop_types()),Q=t=>t?.message??t?.data?.message??"The block was not saved.",X=({block:t=null,isEditableRights:z,rightCol:D,autoSaveBlockResult:ke,disabled:Ee,ownsDocument:O=!1})=>{const{__:m}=e.useI18n(),{blockId:J}=e.useRouteParams(),j=e.useEditorProjectId();let Be=e.useSelector(e.selectIsCodeMode$1),Se=e.useSelector(e.selectIsCodeMode$1);e.useDispatch();const c=e.useNotification(),B=e.useContentReader(),{document:K}=e.useDocumentSessionContext(),W=e.useStore(),Z=e.useSendPostMessage(),[ee,te]=(0,o.useState)(!1),[Te,ye]=(0,o.useState)(null),[Ie,g]=(0,o.useState)(!1),[M,Ce]=(0,o.useState)(0),[G,Oe]=(0,o.useState)(0),S=M!==G,T=(0,o.useCallback)(()=>Ce(s=>s+1),[]),Re=e.usePushToDataLayer(),se=e.useEventEmitter(he.events.ON_BLOCK_SAVEBUTTON_CLICK_ID),b=e.useAppConfig().saveHotkeyEnabled!==!1,x=e.useContainer(),H=(0,o.useRef)([]),V=(0,o.useRef)(!0);(0,o.useEffect)(()=>{window?.navigator?.userAgent.includes("Macintosh")&&ye(!0)},[]);const{data:w,refetch:oe}=e.useGetProjectQuery(+j,{skip:!+j}),[ae]=e.useAddTermMutation(),[q,$]=e.useEditBlockMutation(),[ne,U]=e.useAddBlockMutation(),[ie]=e.useEditProjectMutation(),{data:re}=e.useGetTermsQuery({project:w,kind:e.BLOCK_TAGS},{skip:!w?.id}),N=(0,o.useCallback)((s,r)=>{g(!0);let R=!1;const i=y=>{R||(R=!0,r?.(y))};if(!z&&t.lock&&S){i({ok:!1,reason:"locked",message:"No access to edit the block.",notified:!0}),c.error({id:"BLOCK_ACCESS_TO_LOCKED_ERROR",title:m("No access to edit the block."),data:e.getBlockDesc(t)}),g(!1);return}if((t.tags?.length||t.blocktags?.length)>10&&S){i({ok:!1,reason:"failed",message:"Maximum 10 tags available.",notified:!0,refusal:"The block has more tags than allowed (10 at most), so nothing was saved."}),c.error({id:"BLOCK_TOO_MANY_TAGS_ERROR",title:m("Maximum 10 tags available."),data:e.getBlockDesc(t)}),g(!1);return}if(t.type===""){i({ok:!1,reason:"failed",message:"The block type is not set.",notified:!0,refusal:"The block type is not set, so nothing was saved; ask the user to set it in the block settings."}),c.error({title:m("Set the type"),description:m("Please set the 'Type' field in the Settings section.")}),g(!1);return}const u=y=>{const le=t.tags?.map(n=>{const _=re?.find(p=>p.name===n);return _?_.id:ae({project:w,kind:e.BLOCK_TAGS,name:n,parent:y}).then(({error:p,data:L})=>{if(p?.status===400)return e.existingTermIdFromError(p);if(L)return L.id;p&&(c.fromError("TAG_CREATING_ERROR",n,p),g(!1))})}),f=O&&K?K:void 0,de=(n=null)=>{let _=null;const p=f?.get().version,L=f?f.get().serverId==null:!!t?.isNew,me=f?.get().serverId??t?.id,ge=a=>{const v=a?.id;if(f&&p!==void 0){f.markSaved(p,L&&v!=null?String(v):void 0);const E=a;e.writeSourceReport(f,e.fromServerFacts(E&&{wpId:E.wpId,secretHash:E.secretHash}))}i({ok:!0}),W.dispatch(e.taxonomiesApi.endpoints.getTerms.initiate({project:w,kind:e.BLOCK_TAGS})),oe();const l=a,k=l.global_block?e.globalBlockMark(l):void 0;k&&Z({operation:e.EVENT_TYPES.SANDBOX_EBLOCK_SET_EM_BLOCK_ID,settings:{emBlockId:k,..._?{emBlockVersion:_}:{}}}),S&&(c.success({id:"BLOCK_EDITING_SUCCESS",title:m("The block was successfully saved."),data:e.getBlockDesc(t)}),g(!1));const I=e.wpEmailTarget(l,j),h=I?.emailId??(e.isBlocksV2Enabled()?void 0:l.id);h!=null&&fetch(e.blockPreviewHref(e.BLOCK,I?.projectId??j,h,l.modified),{mode:"no-cors"}).then(()=>{})},_e=a=>i({ok:!1,reason:"failed",message:Q(a),notified:!0}),pe=e.getTaxonomy(t,e.EMAIL_TAGS).filter(a=>(n||t.blocktags).includes(a.id)).map(a=>a.name);if(L){if(f||U.status!=="pending")return ne({source:s,title:t.title===null?m("New block title"):t.title,project:t.project,type:t.type?t.type:"Other",description:t.description,html:B(),blocktags:n?n.join(","):t.blocktags,tags:pe,...e.hasOwnMeta(t)?{meta:t.meta}:{}}).then(async({data:a,error:v})=>{if(v)c.fromError("BLOCK_CREATING_ERROR",{title:t.title,html:B()},v),g(!1),_e(v);else{let l=a;const k=B();if(a?.global_block&&a?.id&&e.globalBlockMark(a)&&k){const I=new Date,h=e.injectEmBlockIdIntoBlockHtml(k,e.globalBlockMark(a),I);if(_=e.formatEmBlockVersion(I),h!==k){const E=await q({blockId:a.id,html:h});E.error?c.fromError("BLOCK_EDITING_ERROR",e.getBlockDesc(t),E.error):E.data&&(l=E.data)}}ge(l)}})}else if(f||$.status!=="pending"){const a=B(),v=new Date,l=t.global_block?e.globalBlockMark({...t,id:me}):void 0,k=l?e.injectEmBlockIdIntoBlockHtml(a,l,v):a;return l&&(_=e.formatEmBlockVersion(v)),q({blockId:me,source:s,title:t.title,project:t.project,type:t.type?t.type:"Other",description:t.description,html:k,...n||Array.isArray(t.tags)?{blocktags:n||t.blocktags,tags:pe}:{},...e.hasOwnMeta(t)?{meta:t.meta}:{}}).then(({data:I,error:h})=>{h&&S?(c.fromError("BLOCK_EDITING_ERROR",e.getBlockDesc(t),h),g(!1),_e(h)):ge(I)})}return i({ok:!1,reason:"failed",message:"Another block save is in progress."}),Promise.resolve()},ue=n=>{try{return f?e.runBlockSave(f,()=>de(n)):de(n)}catch(_){return Promise.reject(_)}},fe=n=>{c.fromError("BLOCK_EDITING_ERROR",e.getBlockDesc(t),n),g(!1),i({ok:!1,reason:"failed",message:Q(n),notified:!0})};le?Promise.all(le).then(n=>ue(n)).catch(fe):ue(null).catch(fe)};g(!0),u(void 0)},[U.status,ne,$.status,q,t,z,ae,ie,j,m,S,B,c,re,oe,W,Z,O,K]);(0,o.useEffect)(()=>{if(S){const s=N,r=H.current.splice(0),R=M-G>r.filter(({settle:i})=>i).length;se.fire({...t,html:B()}).then(i=>{i.some(u=>u===!1)?r.forEach(({settle:u})=>u?.({ok:!1,reason:"aborted",message:"The save was cancelled by the host."})):V.current?r.length?s(void 0,u=>r.forEach(({settle:y})=>y?.(u))):s():(r.forEach(({settle:u})=>u?.({ok:!1,reason:"failed",message:"The save button was removed."})),R&&s())}).catch(i=>{c.fromError("SAVE_BUTTON_CLICK_EVENT_ERROR",e.getBlockDesc(t),i,!0);const u=i instanceof Error?i.message:"The save button handler failed.";r.forEach(({settle:y})=>y?.({ok:!1,reason:"failed",message:u,notified:!0}))}),Oe(M)}},[S,M,G,N,se,t,B,c]),(0,o.useEffect)(()=>{V.current=!0;const s=H.current;return()=>{V.current=!1,s.splice(0).forEach(({settle:r})=>r?.({ok:!1,reason:"failed",message:"The save button was removed."}))}},[]),e.useCommand(e.SAVE_BLOCK_COMMAND_ID,(0,o.useCallback)(s=>{O&&(H.current.push(e.isSaveRequest(s)?s:{}),T())},[O,T])),(0,o.useEffect)(()=>O&&x?e.registerSaveListener(x,"block"):void 0,[O,x]);const Y=(0,o.useCallback)(s=>{(s.ctrlKey||s.metaKey)&&s.keyCode===83&&(s.preventDefault(),b&&T())},[b,T]);(0,o.useEffect)(()=>(document.addEventListener("keydown",Y),()=>{document.removeEventListener("keydown",Y)}),[Y]);const je=(0,o.useCallback)(s=>{const r=s.data.operation,R=s.data.action;r===e.EVENT_TYPES.APPLICATION_ACTION&&R==="save_email"&&b&&T()},[b,T]);e.useListenPostMessage(je),(0,o.useEffect)(()=>{const s=setTimeout(()=>{te(!0)},1e4);return()=>{clearTimeout(s)}},[]),(0,o.useEffect)(()=>{t.isNew&&!J&&ee&&(N(),te(!1))},[ee,t,N,J]);const Le=$.isLoading||ie.isLoading||U.isLoading||Ie,ce=!!ke?.isLoading,Ae=Le||ce;return(0,A.jsx)(P.ui_kit$Tooltip,{title:m(Te?"Save by ⌘S":"Save by Ctrl+S"),placement:D?"right":"bottomRight",children:(0,A.jsx)("span",{className:"em-analytics__block-save-tooltip-target",children:(0,A.jsx)(P.ui_kit$Button,{type:"primary",block:D,disabled:Ee||ce,className:"em-analytics__block-save",icon:(0,A.jsx)(e.EmIcons,{icon:"SaveOutlined",component:P.icons$SaveOutlined}),onClick:s=>{const r=s.currentTarget;Re({event:"click",action:"save_block"}),T();try{r?.blur?.()}catch{}},loading:Ae,children:D||Be||Se?"":m("Save")})})})};X.propTypes={block:d.default.shape({id:d.default.string,isNew:d.default.bool,lock:d.default.bool,type:d.default.string,html:d.default.string,description:d.default.string,project:d.default.number,title:d.default.string}),isEditableRights:d.default.bool.isRequired,ownsDocument:d.default.bool},Object.defineProperty(ve,"SaveBlockBtn",{enumerable:!0,get:function(){return X}})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
__useblocks__.define("static/core/
|
|
1
|
+
__useblocks__.define("static/core/91017e83.js",["require","exports","module","static/core/2ff39ddf.js","static/core/b8eb1c3a.js","static/core/483ce33c.js","static/core/5a290fb6.js","static/core/19270609.js","static/core/c24c3d6b.js"],function(r,i,x){const b=r("./2ff39ddf.js"),s=r("./b8eb1c3a.js"),n=r("./483ce33c.js"),_=r("./5a290fb6.js"),j=r("./19270609.js"),d=r("./c24c3d6b.js");function p(t){return t?.tagName===s.SCRIPT_STAND_IN.toUpperCase()}function a(t){return p(t)&&t.src?.startsWith("https://cdn.ampproject.org/v0")}var u=t=>a(t)||_.isAmpElement(t)||s.isForm(t),h=t=>{if(u(t))return!0;if(s.isElement(t)||s.isDocument(t)){for(const c of t.querySelectorAll("*"))if(u(c))return!0}return!1};async function y(t,c={amp:!0,text:!1},l){const A=c===!0||typeof c=="object"&&c.amp,E=c===!0||typeof c=="object"&&c.text;typeof t=="string"&&(t={code:t});let m;const o={html:"",ampHtml:"",text:""};try{o.html=t.code?await n.prepareHTML(t.code||"",[800],t.utm_parameters,async e=>{m=h(e.document),m&&await s.processAmp(e,"html")},l):""}catch(e){throw new Error("[useblocks] compileEmail: не удалось собрать html письма",{cause:e})}try{o.ampHtml=A&&t.code&&m?await n.prepareHTML(t.code||"",[800],t.utm_parameters,e=>{s.processAmp(e,"amp")},l):""}catch{}try{o.text=E&&t.code?await n.prepareHTML(t.code||"",[800],t.utm_parameters,async e=>{e.handleReadHtml(f=>{f.html=j.convert(f.contentDocument,d.EmailTextPlainConvertOptions)})}):""}catch{}return{...t,compiled:o}}i.compileEmail=y,i.isAmpScript=a,i.isScriptElement=p});
|