useblocks 1.1.12 → 1.1.18
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/js/amp.D-Tohkio.js +1 -0
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.B4dVzZIU.js +1 -1
- package/iframe/js/sanitize-html/sanitize-html.js +21756 -0
- package/iframe/js/sanitize-html/sanitize-html.min.js +16923 -0
- package/package.json +1 -1
- package/singlepage_headless_plugin.html +592 -0
- package/static/core/{f5ec0c26.js → 1f689931.js} +2 -2
- package/static/core/{7c72beab.js → 2badccbb.js} +2 -2
- package/static/core/{881fae91.js → 35607bb1.js} +1 -1
- package/static/core/{db26622b.js → 3a42c130.js} +1 -1
- package/static/core/4563fc0f.js +78 -0
- package/static/core/{45ca014c.js → 509ab76b.js} +1 -1
- package/static/core/5314a021.js +20 -0
- package/static/core/6bcdbb89.js +1 -0
- package/static/core/7af8064f.js +834 -0
- package/static/core/{c838a921.js → 9cff1281.js} +2 -2
- package/static/core/ae8e0b50.js +33 -0
- package/static/core/d40f545f.js +471 -0
- package/static/core/{f8d97f85.js → dd0f0da5.js} +2 -2
- package/static/core/{59433719.js → f996d4e4.js} +1 -1
- package/static/esm/104e77cb.js +1 -0
- package/static/esm/d7803c14.js +1 -0
- package/static/esm/e9b10e90.js +7 -0
- package/static/esm/{6046a29b.js → ea7efce0.js} +1 -1
- package/two_step_headless_plugin.html +1 -1
- package/useblocks-core.4d06f79d.js +1 -0
- package/useblocks-esm.js +109 -19
- package/useblocks.d.ts +44 -0
- package/useblocks.js +593 -3
- package/iframe/js/amp.BSx0mG91.js +0 -1
- package/iframe/js/sanitize-html.BA1fFyP6.js +0 -1
- package/static/core/205b9597.js +0 -33
- package/static/core/574b863a.js +0 -853
- package/static/core/6c14ab8c.js +0 -78
- package/static/core/aee03984.js +0 -1
- package/static/core/be208808.js +0 -1
- package/static/core/d70c8996.js +0 -1
- package/static/core/e97808c2.js +0 -490
- package/static/esm/1be7efab.js +0 -1
- package/static/esm/cadc597d.js +0 -1
- package/useblocks-core.0a906a35.js +0 -1
- /package/iframe/{iframe-eblock.0a906a35.html → iframe-eblock.4d06f79d.html} +0 -0
- /package/iframe/{iframe.0a906a35.html → iframe.4d06f79d.html} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.setAttribute(`data-useblocks`,`true`),e.appendChild(document.createTextNode(`@import "https://fonts.googleapis.com/css2?family=Geologica:wght@300;600&display=swap";.blocks-app .ant-modal.premium-features-modal .ant-modal-content{border-radius:calc(var(--borderRadiusXL) * 2px);padding:20px 19px}.blocks-app .premium-features-modal .modal-title{text-align:center;margin-bottom:0;font-size:32px}.blocks-app .premium-features-modal .ant-carousel .slick-dots li button{opacity:.5;background:#fff}.blocks-app .premium-features-modal .ant-carousel .slick-dots li.slick-active button{opacity:1}.blocks-app .premium-features-modal .modal-subtitle{text-align:center;margin-bottom:20px;font-size:18px}.blocks-app .premium-features-modal .carousel-slider{margin-bottom:20px}.blocks-app .premium-features-modal .slick-list{border-radius:calc(var(--borderRadiusXL) * 1.5px)}.blocks-app .premium-features-modal .slick-slide{padding:0 5px}.blocks-app .premium-features-modal .carousel-slide{border-radius:calc(var(--borderRadiusXL) * 1.5px);justify-content:flex-end;align-items:center;height:480px;display:flex}.blocks-app .premium-features-modal .slide-item-image{width:50%;padding:24px 0 24px 32px}.blocks-app .premium-features-modal .slide-item-image img{border-radius:calc(var(--borderRadiusXL) * 1.3px);width:100%}.blocks-app .premium-features-modal .slide-item-content{width:50%;padding:48px}.blocks-app .premium-features-modal .slide-title{margin-bottom:48px;font-size:50px;font-weight:700;line-height:1}.blocks-app .premium-features-modal .slide-description{font-size:22px}.blocks-app .premium-features-modal .modal-buttons{justify-content:center;gap:10px;display:flex}.blocks-app .premium-features-modal .modal-buttons button{padding:0 30px}.blocks-app .limit-upgrade-modal.ant-modal{max-width:calc(100vw - 24px)}.blocks-app .limit-upgrade-modal .ant-modal-content{border-radius:16px;padding:0;overflow:hidden;box-shadow:0 12px 24px -4px #191d3a14}.blocks-app .limit-upgrade-modal .ant-modal-header{display:none}.blocks-app .limit-upgrade-modal .ant-modal-content .ant-modal-body{padding:0}.blocks-app .limit-upgrade-modal__wrap{background:var(--colorBgContainer);flex-direction:column;align-items:center;width:400px;max-width:100%;display:flex}.blocks-app .limit-upgrade-modal__header{box-sizing:border-box;flex-direction:row;justify-content:flex-end;align-items:center;width:100%;min-height:34px;padding:8px 8px 0;display:flex}.blocks-app .limit-upgrade-modal__close{background:var(--colorBgContainer);width:34px;height:34px;color:var(--colorTextSecondary);cursor:pointer;border:none;border-radius:6px;justify-content:center;align-items:center;margin:0;padding:0;transition:background .15s,color .15s;display:flex}.blocks-app .limit-upgrade-modal__close:hover{background:var(--colorFillTertiary);color:var(--colorText)}.blocks-app .limit-upgrade-modal__close .anticon{font-size:16px}.blocks-app .limit-upgrade-modal__body{box-sizing:border-box;flex-direction:column;align-items:center;gap:16px;width:100%;padding:0 40px 24px;display:flex}.blocks-app .limit-upgrade-modal__title{text-align:center;max-width:320px;color:var(--colorText);margin:0;font-size:18px;font-weight:400;line-height:130%}.blocks-app .limit-upgrade-modal__subtitle{text-align:center;max-width:320px;color:var(--colorTextSecondary);margin:0;font-size:14px;font-weight:100;line-height:120%}.blocks-app .limit-upgrade-modal__limits-row{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;width:100%;max-width:320px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle{box-sizing:border-box;border:1px solid var(--colorText);width:34px;height:34px;color:var(--colorText);border-radius:32px;flex:none;justify-content:center;align-items:center;padding:8px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle .anticon{font-size:18px}.blocks-app .limit-upgrade-modal__icon-circle svg{flex-shrink:0;width:18px;height:18px;display:block}.blocks-app .limit-upgrade-modal__limit-old{color:#f85243;flex-shrink:0;font-size:40px;font-weight:100;line-height:100%}.blocks-app .limit-upgrade-modal__arrow-btn{color:#fff;background:#8946fb;border-radius:38px;flex:none;justify-content:center;align-items:center;width:34px;height:34px;display:flex}.blocks-app .limit-upgrade-modal__arrow-icon{font-size:16px;transform:rotate(45deg)}.blocks-app .limit-upgrade-modal__limit-new{color:#7ed846;flex-shrink:0;font-size:40px;font-weight:400;line-height:100%}.blocks-app .limit-upgrade-modal__limit-new--infinity{font-size:36px;line-height:40px}.blocks-app .limit-upgrade-modal__divider{border:none;border-top:1px solid var(--colorBorderSecondary);width:100%;height:0;margin:0}.blocks-app .limit-upgrade-modal__footer{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;width:100%;padding:16px 0;display:flex}.blocks-app .limit-upgrade-modal__footer--dual{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;padding:16px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary{min-width:147px;height:32px;box-shadow:none;background:#2884ff;border-color:#2884ff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary:hover{background:#1a75f0;border-color:#1a75f0}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default{border-color:var(--colorBorder);min-width:147px;height:32px;color:var(--colorText);box-shadow:none;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default:hover{color:#2884ff;border-color:#2884ff}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();__useblocks__.define(`static/core/59433719.js`,[`require`,`exports`,`module`,`static/core/4dc58c63.js`,`static/core/395cdb1b.js`,`static/core/205b9597.js`,`static/core/f8d97f85.js`,`static/core/c838a921.js`,`react`,`react-dom`,`react-router-dom`,`react/jsx-runtime`,`antd`,`react-dom/client`,`@ant-design/icons`],function(e,t,n){let r=e("./4dc58c63.js"),i=e("./205b9597.js"),a=e("./c838a921.js");e("./395cdb1b.js");let o=e("./f8d97f85.js"),s=e("react");s=r.l(s),e("react-dom");let c=e("react-router-dom"),l=e("react/jsx-runtime"),u=e("antd");e("react-dom/client");let d=e("@ant-design/icons");var f=({open:e,sideOnOk:t,onCancel:n,initialSlide:r=0})=>{let{__:a}=o.h(),u=(0,c.useNavigate)(),[d,f]=(0,s.useState)(r),p=(0,s.useRef)(null),m=i.wt(),h=()=>{t&&t(),u(`/billing`),n(!1)};(0,s.useEffect)(()=>{e&&p.current&&(p.current.goTo(r,!0),f(r))},[e,r]);let g=(0,s.useMemo)(()=>[{image:a(`https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png`),backgroundColor:`var(--blue-2)`,title:a(`More editing features`),description:a(`Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png`),backgroundColor:`var(--purple-2)`,title:a(`Work with the HTML code`),description:a(`Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png`),backgroundColor:`var(--cyan-2)`,title:a(`AI image generation`),description:a(`Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png`),backgroundColor:`var(--green-2)`,title:a(`Stock photos and GIFs`),description:a(`Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_NDYloAO.png`),backgroundColor:`var(--magenta-2)`,title:a(`Version history`),description:a(`Check who and when made changes to the email template and, if necessary, restore one of the previous versions.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png`),backgroundColor:`var(--red-2)`,title:a(`Image editor`),description:a(`Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png`),backgroundColor:`var(--orange-2)`,title:a(`Email optimization`),description:a(`Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png`),backgroundColor:`var(--volcano-2)`,title:a(`Team collaboration`),description:a(`Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png`),backgroundColor:`var(--geekblue-2)`,title:a(`Email testing`),description:a(`Check how your email appears across various devices and email clients.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png`),backgroundColor:`var(--geekblue-2)`,title:a(`AI assistant`),description:a(`Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!`)}],[a]);return(0,s.useEffect)(()=>{if(e&&p.current){p.current.goTo(r,!0),f(r);let e=g[r];m({event:`open_modal`,action:`open_premium-features_modal`,modal_id:`premium-features`,offer_id:e.title})}},[e,g,r,m]),(0,l.jsxs)(o.J,{open:e,footer:null,onCancel:n,closable:!1,className:`premium-features-modal`,classNames:{mask:`premium-features-modal-mask`},styles:{mask:{background:`rgba(0, 0, 0, 0.65)`}},width:1100,style:{maxWidth:`80%`},children:[(0,l.jsx)(o.V,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:`carousel-slider`,draggable:!0,autoplaySpeed:5e3,initialSlide:d,ref:p,children:g.map((e,t)=>(0,l.jsx)(`div`,{children:(0,l.jsxs)(`div`,{className:`carousel-slide`,style:{background:`${e.backgroundColor}`},children:[(0,l.jsx)(`div`,{className:`slide-item-image`,children:(0,l.jsx)(`img`,{src:e.image,alt:`slide-${t}`})}),(0,l.jsxs)(`div`,{className:`slide-item-content`,children:[(0,l.jsx)(`h3`,{className:`slide-title`,children:e.title}),(0,l.jsx)(`p`,{className:`slide-description`,children:e.description})]})]})},t))}),(0,l.jsx)(`div`,{className:`modal-subtitle`,children:a(`This and other features are available for you on any paid plan.`)}),(0,l.jsxs)(`div`,{className:`modal-buttons`,children:[(0,l.jsx)(o.It,{size:`large`,onClick:()=>n(!1),children:a(`Cancel`)}),(0,l.jsx)(o.It,{type:`primary`,size:`large`,onClick:h,style:{padding:`0 30px`},children:a(`Select plan`)})]})]})};function p(e){return e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,``),e=e.replace(/<\/?(?:script|embed|object|frameset|frame|iframe|applet|meta)[^>]*>/gi,``),e=e.replace(/ on\w+="[^"]*"/g,``),e=e.replace(/ on\w+='[^']*'/g,``),e}var m=({icon:e,...t})=>{let n=i.sn();return(0,l.jsx)(o.Ft,{icon:e,configIcons:(0,s.useMemo)(()=>{if(!n?.icons)return;let e={};for(let[t,r]of Object.entries(n.icons))typeof r==`string`&&(e[t]=p(r));return Object.keys(e).length>0?e:void 0},[n?.icons]),...t})},h={ai:`AIRequests`,email_generate:`EmailEnvelope`,image_generate:`Image`,optimization:`Optimization`,preview:`SendOutlined`,link_check:`Web`,image_check:`Image`,spam_check:`Block`,projects:`FolderOpen`,emails:`EmailEnvelope`,blocks:`Block`,users:`SliderGroup`};function g(e,t){if(e==null)return null;if(typeof e==`number`||typeof e==`string`){let n=e===`∞`||e===`∞`||e===`infinity`||typeof e==`string`&&e.toLowerCase()===`infinity`;return(0,l.jsx)(`span`,{className:t===`old`?`limit-upgrade-modal__limit-old`:`limit-upgrade-modal__limit-new${n?` limit-upgrade-modal__limit-new--infinity`:``}`,children:n?`∞`:e})}return e}var _=({open:e,onClose:t,title:n,subtitle:r,usageResource:i,icon:a,previousDisplay:s,nextDisplay:c,onChangePlan:f,secondaryAction:p,changePlanLabel:_})=>{let{__:v}=o.h(),y=_??v(`Change plan`),b=!!p,x=i==null?a??null:(0,l.jsx)(m,{icon:h[i]});return(0,l.jsx)(u.Modal,{open:e,onCancel:t,footer:null,closable:!1,width:400,centered:!0,className:`limit-upgrade-modal`,destroyOnClose:!0,maskClosable:!0,children:(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__wrap`,children:[(0,l.jsx)(`div`,{className:`limit-upgrade-modal__header`,children:(0,l.jsx)(`button`,{type:`button`,className:`limit-upgrade-modal__close`,onClick:t,"aria-label":v(`Close`),children:(0,l.jsx)(d.CloseOutlined,{})})}),(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__body`,children:[(0,l.jsx)(`h1`,{className:`limit-upgrade-modal__title`,children:n}),(0,l.jsx)(`p`,{className:`limit-upgrade-modal__subtitle`,children:r}),(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__limits-row`,children:[(0,l.jsx)(`div`,{className:`limit-upgrade-modal__icon-circle`,"aria-hidden":!0,children:x}),g(s,`old`),(0,l.jsx)(`div`,{className:`limit-upgrade-modal__arrow-btn`,"aria-hidden":!0,children:(0,l.jsx)(d.ArrowUpOutlined,{className:`limit-upgrade-modal__arrow-icon`})}),g(c,`new`)]})]}),(0,l.jsx)(`hr`,{className:`limit-upgrade-modal__divider`}),(0,l.jsx)(`div`,{className:b?`limit-upgrade-modal__footer limit-upgrade-modal__footer--dual`:`limit-upgrade-modal__footer`,children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Button,{className:`limit-upgrade-modal__cta-secondary`,onClick:p.onClick,children:p.label}),(0,l.jsx)(u.Button,{type:`primary`,className:`limit-upgrade-modal__cta`,onClick:f,children:y})]}):(0,l.jsx)(u.Button,{type:`primary`,className:`limit-upgrade-modal__cta`,onClick:f,children:y})})]})})},v={email_10_30:{id:`email_10_30`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:10,next:30,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 10→30`},email_30_300:{id:`email_30_300`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:30,next:300,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 30→300`},email_300_inf:{id:`email_300_inf`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:300,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 300→∞`},ai_10_50:{id:`ai_10_50`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:10,next:50,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 10→50`},ai_30_150:{id:`ai_30_150`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:30,next:150,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 30→150`},ai_150_inf:{id:`ai_150_inf`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:150,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 150→∞`},optimization_exceeded:{id:`optimization_exceeded`,titleKey:`You have used up your optimisation limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`optimization`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: optimization exhausted`},image_generate_exceeded:{id:`image_generate_exceeded`,titleKey:`You have used up your image generation limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`image_generate`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: image_generate exhausted`},preview_exceeded:{id:`preview_exceeded`,titleKey:`You have used up your preview (test send) limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`preview`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: preview exhausted`},link_check_exceeded:{id:`link_check_exceeded`,titleKey:`You have used up your link check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`link_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: link_check exhausted`},image_check_exceeded:{id:`image_check_exceeded`,titleKey:`You have used up your image check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`image_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: image_check exhausted`},spam_check_exceeded:{id:`spam_check_exceeded`,titleKey:`You have used up your spam check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`spam_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: spam_check exhausted`}};function y(e){return v[e]}function b(e){return e===`infinity`?`∞`:e}var x={ai:`ai_150_inf`,email_generate:`email_300_inf`,image_generate:`image_generate_exceeded`,preview:`preview_exceeded`,link_check:`link_check_exceeded`,image_check:`image_check_exceeded`,spam_check:`spam_check_exceeded`};function S(e){return!e||e.is_unlimited||e.total_limit<=0?!1:e.remaining<=0||e.used>=e.total_limit}function C(e,t){return S(t)?{presetId:x[e],previousLimit:t?.total_limit??0,nextLimit:`infinity`}:null}function w(e,t){return C(e,t)}function T(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(typeof n==`string`&&n)return n}}function E(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof Blob)return n}}function D(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(typeof r==`string`&&r&&r!==t)return r}}var O=(0,s.createContext)(null),k=e=>e.includes(`UPLOAD_IMAGE_`)||e.includes(`UPLOAD_BACKGROUND_`),A=({children:e})=>{let t=i.Di(),n=i.Ei(a.s),[r,o]=(0,s.useState)(null),c=(0,s.useRef)(null),u=(0,s.useCallback)(e=>{c.current?.(e),c.current=null},[]),d=(0,s.useCallback)(e=>(u(null),o(e),t(a.r(e.entryModal)),new Promise(e=>{c.current=e})),[t,u]);(0,s.useEffect)(()=>{k(n)||(o(null),c.current&&u(null))},[n,u]);let f=(0,s.useMemo)(()=>({request:r,openImagePicker:d,resolveImagePicker:u}),[r,d,u]);return(0,l.jsx)(O.Provider,{value:f,children:e})},j=()=>{let e=(0,s.useContext)(O);if(!e)throw Error(`useImagePicker must be used within ImagePickerProvider`);return e};function M(e){if(!e)return!1;try{return i.xi.getInstance(e,i.po)!==void 0}catch{return!1}}function N(){let e=i.Oi();return(0,s.useMemo)(()=>M(e),[e])}Object.defineProperty(t,"a",{enumerable:!0,get:function(){return D}}),Object.defineProperty(t,"c",{enumerable:!0,get:function(){return C}}),Object.defineProperty(t,"d",{enumerable:!0,get:function(){return b}}),Object.defineProperty(t,"f",{enumerable:!0,get:function(){return _}}),Object.defineProperty(t,"g",{enumerable:!0,get:function(){return f}}),Object.defineProperty(t,"h",{enumerable:!0,get:function(){return p}}),Object.defineProperty(t,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(t,"l",{enumerable:!0,get:function(){return w}}),Object.defineProperty(t,"m",{enumerable:!0,get:function(){return m}}),Object.defineProperty(t,"n",{enumerable:!0,get:function(){return A}}),Object.defineProperty(t,"o",{enumerable:!0,get:function(){return T}}),Object.defineProperty(t,"p",{enumerable:!0,get:function(){return h}}),Object.defineProperty(t,"r",{enumerable:!0,get:function(){return j}}),Object.defineProperty(t,"s",{enumerable:!0,get:function(){return S}}),Object.defineProperty(t,"t",{enumerable:!0,get:function(){return N}}),Object.defineProperty(t,"u",{enumerable:!0,get:function(){return y}})});
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.setAttribute(`data-useblocks`,`true`),e.appendChild(document.createTextNode(`@import "https://fonts.googleapis.com/css2?family=Geologica:wght@300;600&display=swap";.blocks-app .ant-modal.premium-features-modal .ant-modal-content{border-radius:calc(var(--borderRadiusXL) * 2px);padding:20px 19px}.blocks-app .premium-features-modal .modal-title{text-align:center;margin-bottom:0;font-size:32px}.blocks-app .premium-features-modal .ant-carousel .slick-dots li button{opacity:.5;background:#fff}.blocks-app .premium-features-modal .ant-carousel .slick-dots li.slick-active button{opacity:1}.blocks-app .premium-features-modal .modal-subtitle{text-align:center;margin-bottom:20px;font-size:18px}.blocks-app .premium-features-modal .carousel-slider{margin-bottom:20px}.blocks-app .premium-features-modal .slick-list{border-radius:calc(var(--borderRadiusXL) * 1.5px)}.blocks-app .premium-features-modal .slick-slide{padding:0 5px}.blocks-app .premium-features-modal .carousel-slide{border-radius:calc(var(--borderRadiusXL) * 1.5px);justify-content:flex-end;align-items:center;height:480px;display:flex}.blocks-app .premium-features-modal .slide-item-image{width:50%;padding:24px 0 24px 32px}.blocks-app .premium-features-modal .slide-item-image img{border-radius:calc(var(--borderRadiusXL) * 1.3px);width:100%}.blocks-app .premium-features-modal .slide-item-content{width:50%;padding:48px}.blocks-app .premium-features-modal .slide-title{margin-bottom:48px;font-size:50px;font-weight:700;line-height:1}.blocks-app .premium-features-modal .slide-description{font-size:22px}.blocks-app .premium-features-modal .modal-buttons{justify-content:center;gap:10px;display:flex}.blocks-app .premium-features-modal .modal-buttons button{padding:0 30px}.blocks-app .limit-upgrade-modal.ant-modal{max-width:calc(100vw - 24px)}.blocks-app .limit-upgrade-modal .ant-modal-content{border-radius:16px;padding:0;overflow:hidden;box-shadow:0 12px 24px -4px #191d3a14}.blocks-app .limit-upgrade-modal .ant-modal-header{display:none}.blocks-app .limit-upgrade-modal .ant-modal-content .ant-modal-body{padding:0}.blocks-app .limit-upgrade-modal__wrap{background:var(--colorBgContainer);flex-direction:column;align-items:center;width:400px;max-width:100%;display:flex}.blocks-app .limit-upgrade-modal__header{box-sizing:border-box;flex-direction:row;justify-content:flex-end;align-items:center;width:100%;min-height:34px;padding:8px 8px 0;display:flex}.blocks-app .limit-upgrade-modal__close{background:var(--colorBgContainer);width:34px;height:34px;color:var(--colorTextSecondary);cursor:pointer;border:none;border-radius:6px;justify-content:center;align-items:center;margin:0;padding:0;transition:background .15s,color .15s;display:flex}.blocks-app .limit-upgrade-modal__close:hover{background:var(--colorFillTertiary);color:var(--colorText)}.blocks-app .limit-upgrade-modal__close .anticon{font-size:16px}.blocks-app .limit-upgrade-modal__body{box-sizing:border-box;flex-direction:column;align-items:center;gap:16px;width:100%;padding:0 40px 24px;display:flex}.blocks-app .limit-upgrade-modal__title{text-align:center;max-width:320px;color:var(--colorText);margin:0;font-size:18px;font-weight:400;line-height:130%}.blocks-app .limit-upgrade-modal__subtitle{text-align:center;max-width:320px;color:var(--colorTextSecondary);margin:0;font-size:14px;font-weight:100;line-height:120%}.blocks-app .limit-upgrade-modal__limits-row{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;width:100%;max-width:320px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle{box-sizing:border-box;border:1px solid var(--colorText);width:34px;height:34px;color:var(--colorText);border-radius:32px;flex:none;justify-content:center;align-items:center;padding:8px;display:flex}.blocks-app .limit-upgrade-modal__icon-circle .anticon{font-size:18px}.blocks-app .limit-upgrade-modal__icon-circle svg{flex-shrink:0;width:18px;height:18px;display:block}.blocks-app .limit-upgrade-modal__limit-old{color:#f85243;flex-shrink:0;font-size:40px;font-weight:100;line-height:100%}.blocks-app .limit-upgrade-modal__arrow-btn{color:#fff;background:#8946fb;border-radius:38px;flex:none;justify-content:center;align-items:center;width:34px;height:34px;display:flex}.blocks-app .limit-upgrade-modal__arrow-icon{font-size:16px;transform:rotate(45deg)}.blocks-app .limit-upgrade-modal__limit-new{color:#7ed846;flex-shrink:0;font-size:40px;font-weight:400;line-height:100%}.blocks-app .limit-upgrade-modal__limit-new--infinity{font-size:36px;line-height:40px}.blocks-app .limit-upgrade-modal__divider{border:none;border-top:1px solid var(--colorBorderSecondary);width:100%;height:0;margin:0}.blocks-app .limit-upgrade-modal__footer{box-sizing:border-box;flex-direction:column;justify-content:center;align-items:center;width:100%;padding:16px 0;display:flex}.blocks-app .limit-upgrade-modal__footer--dual{flex-flow:wrap;justify-content:center;align-items:center;gap:8px;padding:16px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary{min-width:147px;height:32px;box-shadow:none;background:#2884ff;border-color:#2884ff;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta.ant-btn-primary:hover{background:#1a75f0;border-color:#1a75f0}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default{border-color:var(--colorBorder);min-width:147px;height:32px;color:var(--colorText);box-shadow:none;border-radius:6px;padding:8px 16px;font-size:14px;font-weight:400;line-height:19px}.blocks-app .limit-upgrade-modal__cta-secondary.ant-btn-default:hover{color:#2884ff;border-color:#2884ff}`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();__useblocks__.define(`static/core/f996d4e4.js`,[`require`,`exports`,`module`,`static/core/4dc58c63.js`,`static/core/395cdb1b.js`,`static/core/ae8e0b50.js`,`static/core/dd0f0da5.js`,`static/core/9cff1281.js`,`react`,`react-dom`,`react-router-dom`,`react/jsx-runtime`,`antd`,`react-dom/client`,`@ant-design/icons`],function(e,t,n){let r=e("./4dc58c63.js"),i=e("./ae8e0b50.js"),a=e("./9cff1281.js");e("./395cdb1b.js");let o=e("./dd0f0da5.js"),s=e("react");s=r.l(s),e("react-dom");let c=e("react-router-dom"),l=e("react/jsx-runtime"),u=e("antd");e("react-dom/client");let d=e("@ant-design/icons");var f=({open:e,sideOnOk:t,onCancel:n,initialSlide:r=0})=>{let{__:a}=o.h(),u=(0,c.useNavigate)(),[d,f]=(0,s.useState)(r),p=(0,s.useRef)(null),m=i.wt(),h=()=>{t&&t(),u(`/billing`),n(!1)};(0,s.useEffect)(()=>{e&&p.current&&(p.current.goTo(r,!0),f(r))},[e,r]);let g=(0,s.useMemo)(()=>[{image:a(`https://cdn.useblocks.io/1351/241017_18_1sGjUaZ.png`),backgroundColor:`var(--blue-2)`,title:a(`More editing features`),description:a(`Use our visual editor to customize every element to your needs: change borders and their radius, box shadows, paddings, background, and much more.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_J7QtvZ3.png`),backgroundColor:`var(--purple-2)`,title:a(`Work with the HTML code`),description:a(`Edit the HTML version of your email template in the Code mode and see the changes in real time. Builder has no code restrictions — you can create templates of any complexity!`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_2fjDRfL.png`),backgroundColor:`var(--cyan-2)`,title:a(`AI image generation`),description:a(`Generate stunning visuals for your emails with ease. We have trained our AI model to ensure the highest quality images.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_D5C25Zp.png`),backgroundColor:`var(--green-2)`,title:a(`Stock photos and GIFs`),description:a(`Search the vast gallery of stock photos and GIFs to find visuals for any occasion. You can filter the results by image orientation, color scheme, and more.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_NDYloAO.png`),backgroundColor:`var(--magenta-2)`,title:a(`Version history`),description:a(`Check who and when made changes to the email template and, if necessary, restore one of the previous versions.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_g5mVlmh.png`),backgroundColor:`var(--red-2)`,title:a(`Image editor`),description:a(`Want to resize an image, add some text, or apply a filter? No need to leave builder! You can make all the basic changes in our image editor.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_ur8Lh3W.png`),backgroundColor:`var(--orange-2)`,title:a(`Email optimization`),description:a(`Check your email against broken links, missing alt texts, large images, and other issues that might prevent your emails from hitting inboxes.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_S5Pld9p.png`),backgroundColor:`var(--volcano-2)`,title:a(`Team collaboration`),description:a(`Share the project with your team and collaborate in real time. Add comments to individual email blocks and discuss necessary edits right in the builder.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_tGbb2j9.png`),backgroundColor:`var(--geekblue-2)`,title:a(`Email testing`),description:a(`Check how your email appears across various devices and email clients.`)},{image:a(`https://cdn.useblocks.io/1351/241017_18_gDXi4uM.png`),backgroundColor:`var(--geekblue-2)`,title:a(`AI assistant`),description:a(`Let our AI assistant enhance your email template! From creating subject lines and preheaders based on the email copy to generating the whole email with your website in mind!`)}],[a]);return(0,s.useEffect)(()=>{if(e&&p.current){p.current.goTo(r,!0),f(r);let e=g[r];m({event:`open_modal`,action:`open_premium-features_modal`,modal_id:`premium-features`,offer_id:e.title})}},[e,g,r,m]),(0,l.jsxs)(o.J,{open:e,footer:null,onCancel:n,closable:!1,className:`premium-features-modal`,classNames:{mask:`premium-features-modal-mask`},styles:{mask:{background:`rgba(0, 0, 0, 0.65)`}},width:1100,style:{maxWidth:`80%`},children:[(0,l.jsx)(o.V,{dots:!0,slidesToShow:1,slidesToScroll:1,autoplay:!0,className:`carousel-slider`,draggable:!0,autoplaySpeed:5e3,initialSlide:d,ref:p,children:g.map((e,t)=>(0,l.jsx)(`div`,{children:(0,l.jsxs)(`div`,{className:`carousel-slide`,style:{background:`${e.backgroundColor}`},children:[(0,l.jsx)(`div`,{className:`slide-item-image`,children:(0,l.jsx)(`img`,{src:e.image,alt:`slide-${t}`})}),(0,l.jsxs)(`div`,{className:`slide-item-content`,children:[(0,l.jsx)(`h3`,{className:`slide-title`,children:e.title}),(0,l.jsx)(`p`,{className:`slide-description`,children:e.description})]})]})},t))}),(0,l.jsx)(`div`,{className:`modal-subtitle`,children:a(`This and other features are available for you on any paid plan.`)}),(0,l.jsxs)(`div`,{className:`modal-buttons`,children:[(0,l.jsx)(o.It,{size:`large`,onClick:()=>n(!1),children:a(`Cancel`)}),(0,l.jsx)(o.It,{type:`primary`,size:`large`,onClick:h,style:{padding:`0 30px`},children:a(`Select plan`)})]})]})};function p(e){return e=e.replace(/<script[^>]*>([\S\s]*?)<\/script>/gim,``),e=e.replace(/<\/?(?:script|embed|object|frameset|frame|iframe|applet|meta)[^>]*>/gi,``),e=e.replace(/ on\w+="[^"]*"/g,``),e=e.replace(/ on\w+='[^']*'/g,``),e}var m=({icon:e,...t})=>{let n=i.on();return(0,l.jsx)(o.Ft,{icon:e,configIcons:(0,s.useMemo)(()=>{if(!n?.icons)return;let e={};for(let[t,r]of Object.entries(n.icons))typeof r==`string`&&(e[t]=p(r));return Object.keys(e).length>0?e:void 0},[n?.icons]),...t})},h={ai:`AIRequests`,email_generate:`EmailEnvelope`,image_generate:`Image`,optimization:`Optimization`,preview:`SendOutlined`,link_check:`Web`,image_check:`Image`,spam_check:`Block`,projects:`FolderOpen`,emails:`EmailEnvelope`,blocks:`Block`,users:`SliderGroup`};function g(e,t){if(e==null)return null;if(typeof e==`number`||typeof e==`string`){let n=e===`∞`||e===`∞`||e===`infinity`||typeof e==`string`&&e.toLowerCase()===`infinity`;return(0,l.jsx)(`span`,{className:t===`old`?`limit-upgrade-modal__limit-old`:`limit-upgrade-modal__limit-new${n?` limit-upgrade-modal__limit-new--infinity`:``}`,children:n?`∞`:e})}return e}var _=({open:e,onClose:t,title:n,subtitle:r,usageResource:i,icon:a,previousDisplay:s,nextDisplay:c,onChangePlan:f,secondaryAction:p,changePlanLabel:_})=>{let{__:v}=o.h(),y=_??v(`Change plan`),b=!!p,x=i==null?a??null:(0,l.jsx)(m,{icon:h[i]});return(0,l.jsx)(u.Modal,{open:e,onCancel:t,footer:null,closable:!1,width:400,centered:!0,className:`limit-upgrade-modal`,destroyOnClose:!0,maskClosable:!0,children:(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__wrap`,children:[(0,l.jsx)(`div`,{className:`limit-upgrade-modal__header`,children:(0,l.jsx)(`button`,{type:`button`,className:`limit-upgrade-modal__close`,onClick:t,"aria-label":v(`Close`),children:(0,l.jsx)(d.CloseOutlined,{})})}),(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__body`,children:[(0,l.jsx)(`h1`,{className:`limit-upgrade-modal__title`,children:n}),(0,l.jsx)(`p`,{className:`limit-upgrade-modal__subtitle`,children:r}),(0,l.jsxs)(`div`,{className:`limit-upgrade-modal__limits-row`,children:[(0,l.jsx)(`div`,{className:`limit-upgrade-modal__icon-circle`,"aria-hidden":!0,children:x}),g(s,`old`),(0,l.jsx)(`div`,{className:`limit-upgrade-modal__arrow-btn`,"aria-hidden":!0,children:(0,l.jsx)(d.ArrowUpOutlined,{className:`limit-upgrade-modal__arrow-icon`})}),g(c,`new`)]})]}),(0,l.jsx)(`hr`,{className:`limit-upgrade-modal__divider`}),(0,l.jsx)(`div`,{className:b?`limit-upgrade-modal__footer limit-upgrade-modal__footer--dual`:`limit-upgrade-modal__footer`,children:p?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.Button,{className:`limit-upgrade-modal__cta-secondary`,onClick:p.onClick,children:p.label}),(0,l.jsx)(u.Button,{type:`primary`,className:`limit-upgrade-modal__cta`,onClick:f,children:y})]}):(0,l.jsx)(u.Button,{type:`primary`,className:`limit-upgrade-modal__cta`,onClick:f,children:y})})]})})},v={email_10_30:{id:`email_10_30`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:10,next:30,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 10→30`},email_30_300:{id:`email_30_300`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:30,next:300,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 30→300`},email_300_inf:{id:`email_300_inf`,titleKey:`You have used up the number of emails you can create on your current plan`,subtitleKey:`You can increase the number of emails right now.`,usageResource:`email_generate`,previous:300,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: emails 300→∞`},ai_10_50:{id:`ai_10_50`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:10,next:50,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 10→50`},ai_30_150:{id:`ai_30_150`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:30,next:150,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 30→150`},ai_150_inf:{id:`ai_150_inf`,titleKey:`You have used up your AI generations`,subtitleKey:`You can add more generations right now; they are billed separately from the generations included in your plan.`,usageResource:`ai`,previous:150,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: AI 150→∞`},optimization_exceeded:{id:`optimization_exceeded`,titleKey:`You have used up your optimisation limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`optimization`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: optimization exhausted`},image_generate_exceeded:{id:`image_generate_exceeded`,titleKey:`You have used up your image generation limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`image_generate`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: image_generate exhausted`},preview_exceeded:{id:`preview_exceeded`,titleKey:`You have used up your preview (test send) limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`preview`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: preview exhausted`},link_check_exceeded:{id:`link_check_exceeded`,titleKey:`You have used up your link check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`link_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: link_check exhausted`},image_check_exceeded:{id:`image_check_exceeded`,titleKey:`You have used up your image check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`image_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: image_check exhausted`},spam_check_exceeded:{id:`spam_check_exceeded`,titleKey:`You have used up your spam check limit`,subtitleKey:`You can increase the limit by changing your plan or buying an extra package.`,usageResource:`spam_check`,previous:0,next:`infinity`,showSecondaryBuy:!1,debugLabelKey:`Limit modal: spam_check exhausted`}};function y(e){return v[e]}function b(e){return e===`infinity`?`∞`:e}var x={ai:`ai_150_inf`,email_generate:`email_300_inf`,image_generate:`image_generate_exceeded`,preview:`preview_exceeded`,link_check:`link_check_exceeded`,image_check:`image_check_exceeded`,spam_check:`spam_check_exceeded`};function S(e){return!e||e.is_unlimited||e.total_limit<=0?!1:e.remaining<=0||e.used>=e.total_limit}function C(e,t){return S(t)?{presetId:x[e],previousLimit:t?.total_limit??0,nextLimit:`infinity`}:null}function w(e,t){return C(e,t)}function T(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(typeof n==`string`&&n)return n}}function E(e){for(let t=0;t<e.length;t++){let n=e[t];if(n instanceof Blob)return n}}function D(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(typeof r==`string`&&r&&r!==t)return r}}var O=(0,s.createContext)(null),k=e=>e.includes(`UPLOAD_IMAGE_`)||e.includes(`UPLOAD_BACKGROUND_`),A=({children:e})=>{let t=i.wi(),n=i.Ci(a.s),[r,o]=(0,s.useState)(null),c=(0,s.useRef)(null),u=(0,s.useCallback)(e=>{c.current?.(e),c.current=null},[]),d=(0,s.useCallback)(e=>(u(null),o(e),t(a.r(e.entryModal)),new Promise(e=>{c.current=e})),[t,u]);(0,s.useEffect)(()=>{k(n)||(o(null),c.current&&u(null))},[n,u]);let f=(0,s.useMemo)(()=>({request:r,openImagePicker:d,resolveImagePicker:u}),[r,d,u]);return(0,l.jsx)(O.Provider,{value:f,children:e})},j=()=>{let e=(0,s.useContext)(O);if(!e)throw Error(`useImagePicker must be used within ImagePickerProvider`);return e};function M(e){if(!e)return!1;try{return i.vi.getInstance(e,i.do)!==void 0}catch{return!1}}function N(){let e=i.Ti();return(0,s.useMemo)(()=>M(e),[e])}Object.defineProperty(t,"a",{enumerable:!0,get:function(){return D}}),Object.defineProperty(t,"c",{enumerable:!0,get:function(){return C}}),Object.defineProperty(t,"d",{enumerable:!0,get:function(){return b}}),Object.defineProperty(t,"f",{enumerable:!0,get:function(){return _}}),Object.defineProperty(t,"g",{enumerable:!0,get:function(){return f}}),Object.defineProperty(t,"h",{enumerable:!0,get:function(){return p}}),Object.defineProperty(t,"i",{enumerable:!0,get:function(){return E}}),Object.defineProperty(t,"l",{enumerable:!0,get:function(){return w}}),Object.defineProperty(t,"m",{enumerable:!0,get:function(){return m}}),Object.defineProperty(t,"n",{enumerable:!0,get:function(){return A}}),Object.defineProperty(t,"o",{enumerable:!0,get:function(){return T}}),Object.defineProperty(t,"p",{enumerable:!0,get:function(){return h}}),Object.defineProperty(t,"r",{enumerable:!0,get:function(){return j}}),Object.defineProperty(t,"s",{enumerable:!0,get:function(){return S}}),Object.defineProperty(t,"t",{enumerable:!0,get:function(){return N}}),Object.defineProperty(t,"u",{enumerable:!0,get:function(){return y}})});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));export{s as n,l as r,o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as e,s as t}from"./ea7efce0.js";import"useblocks/runtime/react";function n(e){if(e instanceof DOMException&&e.name===`AbortError`)return e;let t=e===void 0?`The operation was aborted.`:typeof e==`string`?e:e instanceof Error?e.message:String(e);return new DOMException(t,`AbortError`)}function r(e){if(e?.aborted)throw n(e.reason)}function i(e,t){return t?(r(t),new Promise((r,i)=>{let a=()=>{o(),i(n(t.reason))},o=()=>{t.removeEventListener(`abort`,a)};t.addEventListener(`abort`,a),e.then(e=>{o(),r(e)},e=>{o(),i(e)})})):e}function a(t,i,a){if(r(a),t!==void 0){if(typeof t==`string`){let r=t,o=document.querySelector(r);if(o)return o;let s=i.addDisposable(new e);return new Promise((e,t)=>{let i=e=>{s.dispose(),e()},o=()=>{i(()=>t(n(a?.reason)))};if(a?.aborted){o();return}a?.addEventListener(`abort`,o),s.addDispose(()=>a?.removeEventListener(`abort`,o));let c=new MutationObserver(()=>{let t=document.querySelector(r);t&&i(()=>e(t))});c.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),s.addDispose(()=>c.disconnect())})}return t}return t}var o=new Map;t(`ELEMENT_INSERT_HTML_PIPELINE`),t(`BLOCK_INSERT_HTML_PIPELINE`),t(`DomComponentRegistry`),t(`ComponentRegistry`);function s(e){return t(e)}var c;(function(e){e.BEFORE_SAVE_EMAIL=s(),e.ON_SAVEBUTTON_CLICK_ID=s(),e.ON_NEXTBUTTON_CLICK_ID=s(),e.ON_PREVIOUSBUTTON_CLICK_ID=s(),e.ON_MODEL_CHANGE=s(),e.WILL_EMAIL_INIT_ID=s(),e.ON_EMAIL_INIT_ID=s(),e.ON_BLOCK_INIT_ID=s(),e.ON_CONTENT_CHANGED_ID=s(),e.ON_PREHEADER_CHANGED_ID=s(),e.ON_SUBJECT_CHANGED_ID=s(),e.ON_EMAIL_CHANGED_ID=s(),e.ON_BLOCK_CHANGED_ID=s(),e.ON_CHUNKS_LOADED=s(),e.ON_SEND_TESTEMAIL_ID=s(),e.ON_SEND_LIVEPREVIEW_ID=s(),e.ON_SHARE_ID=s(),e.ON_SHOW_PREVIEW_ID=s(),e.ON_EMAIL_CLONE_ID=s(),e.ON_SEND_EMAIL_MODAL_ID=s(),e.ON_NOTIFICATION=s(),e.READ_LOCALE=s(),e.ON_TRANSLATE_ID=s(),e.ON_CODE_VALIDATE_ID=s(),e.UPLOAD_EVENT_ID=s(),e.PROXY_URL_EVENT_ID=s(),e.FILE_PROXY_EVENT_ID=s(),e.ON_LIMIT_ID=s(),e.ON_BROWSER_EXTENSION_DETECTED_ID=s()})(c||={}),t(),t(),t(`InitPipelineContext`),t(),t(),t(),t(),t(),t(),t(`PluginCollection`),s(`APP_LOAD_EVENT`),s(`CONFIG_CHANGED_EVENT`);export{r as a,i,a as n,n as r,o as t};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{t as e}from"./104e77cb.js";import t,{useCallback as n,useContext as r,useDebugValue as i,useEffect as a,useLayoutEffect as o,useMemo as s,useReducer as c,useRef as l,useState as u}from"useblocks/runtime/react";import"useblocks/runtime/prop-types";import{unstable_batchedUpdates as d}from"useblocks/runtime/react-dom";var f=f===void 0?typeof self<`u`?self:typeof window<`u`?window:{}:f;function p(e){var t=[...arguments].slice(1);throw Error(`[Immer] minified error nr: `+e+(t.length?` `+t.map((function(e){return`'`+e+`'`})).join(`,`):``)+`. Find the full error at: https://bit.ly/3cXEKWf`)}function m(e){return!!e&&!!e[z]}function h(e){return!!e&&(function(e){if(!e||typeof e!=`object`)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;var n=Object.hasOwnProperty.call(t,`constructor`)&&t.constructor;return n===Object||typeof n==`function`&&Function.toString.call(n)===be}(e)||Array.isArray(e)||!!e[ye]||!!e.constructor?.[ye]||C(e)||w(e))}function g(e){return m(e)||p(23,e),e[z].t}function _(e,t,n){n===void 0&&(n=!1),v(e)===0?(n?Object.keys:xe)(e).forEach((function(r){n&&typeof r==`symbol`||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function v(e){var t=e[z];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:C(e)?2:w(e)?3:0}function y(e,t){return v(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function b(e,t){return v(e)===2?e.get(t):e[t]}function x(e,t,n){var r=v(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function S(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function C(e){return he&&e instanceof Map}function w(e){return ge&&e instanceof Set}function T(e){return e.o||e.t}function E(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Se(e);delete t[z];for(var n=xe(t),r=0;r<n.length;r++){var i=n[r],a=t[i];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function D(e,t){return t===void 0&&(t=!1),k(e)||m(e)||!h(e)||(v(e)>1&&(e.set=e.add=e.clear=e.delete=O),Object.freeze(e),t&&_(e,(function(e,t){return D(t,!0)}),!0)),e}function O(){p(2)}function k(e){return typeof e!=`object`||!e||Object.isFrozen(e)}function A(e){var t=Ce[e];return t||p(18,e),t}function j(e,t){Ce[e]||(Ce[e]=t)}function M(){return pe}function N(e,t){t&&(A(`Patches`),e.u=[],e.s=[],e.v=t)}function P(e){ee(e),e.p.forEach(ne),e.p=null}function ee(e){e===pe&&(pe=e.l)}function te(e){return pe={p:[],l:pe,h:e,m:!0,_:0}}function ne(e){var t=e[z];t.i===0||t.i===1?t.j():t.g=!0}function re(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||A(`ES5`).S(t,e,r),r?(n[z].P&&(P(t),p(4)),h(e)&&(e=ie(t,e),t.l||F(t,e)),t.u&&A(`Patches`).M(n[z].t,e,t.u,t.s)):e=ie(t,n,[]),P(t),t.u&&t.v(t.u,t.s),e===ve?void 0:e}function ie(e,t,n){if(k(t))return t;var r=t[z];if(!r)return _(t,(function(i,a){return ae(e,r,t,i,a,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return F(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var i=r.i===4||r.i===5?r.o=E(r.k):r.o,a=i,o=!1;r.i===3&&(a=new Set(i),i.clear(),o=!0),_(a,(function(t,a){return ae(e,r,i,t,a,n,o)})),F(e,i,!1),n&&e.u&&A(`Patches`).N(r,n,e.u,e.s)}return r.o}function ae(e,t,n,r,i,a,o){if(m(i)){var s=ie(e,i,a&&t&&t.i!==3&&!y(t.R,r)?a.concat(r):void 0);if(x(n,r,s),!m(s))return;e.m=!1}else o&&n.add(i);if(h(i)&&!k(i)){if(!e.h.D&&e._<1)return;ie(e,i),t&&t.A.l||F(e,i)}}function F(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&D(t,n)}function oe(e,t){var n=e[z];return(n?T(n):e)[t]}function se(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function I(e){e.P||(e.P=!0,e.l&&I(e.l))}function ce(e){e.o||=E(e.t)}function L(e,t,n){var r=C(t)?A(`MapSet`).F(t,n):w(t)?A(`MapSet`).T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:+!!n,A:t?t.A:M(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},i=r,a=we;n&&(i=[r],a=Te);var o=Proxy.revocable(i,a),s=o.revoke,c=o.proxy;return r.k=c,r.j=s,c}(t,n):A(`ES5`).J(t,n);return(n?n.A:M()).p.push(r),r}function le(e){return m(e)||p(22,e),function e(t){if(!h(t))return t;var n,r=t[z],i=v(t);if(r){if(!r.P&&(r.i<4||!A(`ES5`).K(r)))return r.t;r.I=!0,n=ue(t,i),r.I=!1}else n=ue(t,i);return _(n,(function(t,i){r&&b(r.t,t)===i||x(n,t,e(i))})),i===3?new Set(n):n}(e)}function ue(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return E(e)}function de(){function e(e,t){var n=i[e];return n?n.enumerable=t:i[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[z];return we.get(t,e)},set:function(t){var n=this[z];we.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var i=e[t][z];if(!i.P)switch(i.i){case 5:r(i)&&I(i);break;case 4:n(i)&&I(i)}}}function n(e){for(var t=e.t,n=e.k,r=xe(n),i=r.length-1;i>=0;i--){var a=r[i];if(a!==z){var o=t[a];if(o===void 0&&!y(t,a))return!0;var s=n[a],c=s&&s[z];if(c?c.t!==o:!S(s,o))return!0}}var l=!!t[z];return r.length!==xe(t).length+ +!l}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var i={};j(`ES5`,{J:function(t,n){var r=Array.isArray(t),i=function(t,n){if(t){for(var r=Array(n.length),i=0;i<n.length;i++)Object.defineProperty(r,``+i,e(i,!0));return r}var a=Se(n);delete a[z];for(var o=xe(a),s=0;s<o.length;s++){var c=o[s];a[c]=e(c,t||!!a[c].enumerable)}return Object.create(Object.getPrototypeOf(n),a)}(r,t),a={i:r?5:4,A:n?n.A:M(),P:!1,I:!1,R:{},l:n,t,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,z,{value:a,writable:!0}),i},S:function(e,n,i){i?m(n)&&n[z].A===e&&t(e.p):(e.u&&function e(t){if(t&&typeof t==`object`){var n=t[z];if(n){var i=n.t,a=n.k,o=n.R,s=n.i;if(s===4)_(a,(function(t){t!==z&&(i[t]!==void 0||y(i,t)?o[t]||e(a[t]):(o[t]=!0,I(n)))})),_(i,(function(e){a[e]!==void 0||y(a,e)||(o[e]=!1,I(n))}));else if(s===5){if(r(n)&&(I(n),o.length=!0),a.length<i.length)for(var c=a.length;c<i.length;c++)o[c]=!1;else for(var l=i.length;l<a.length;l++)o[l]=!0;for(var u=Math.min(a.length,i.length),d=0;d<u;d++)a.hasOwnProperty(d)||(o[d]=!0),o[d]===void 0&&e(a[d])}}}}(e.p[0]),t(e.p))},K:function(e){return e.i===4?n(e):r(e)}})}function R(){function e(t){if(!h(t))return t;if(Array.isArray(t))return t.map(e);if(C(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(w(t))return new Set(Array.from(t).map(e));var n=Object.create(Object.getPrototypeOf(t));for(var r in t)n[r]=e(t[r]);return y(t,ye)&&(n[ye]=t[ye]),n}function t(t){return m(t)?e(t):t}var n=`add`;j(`Patches`,{$:function(t,r){return r.forEach((function(r){for(var i=r.path,a=r.op,o=t,s=0;s<i.length-1;s++){var c=v(o),l=i[s];typeof l!=`string`&&typeof l!=`number`&&(l=``+l),c!==0&&c!==1||l!==`__proto__`&&l!==`constructor`||p(24),typeof o==`function`&&l===`prototype`&&p(24),typeof(o=b(o,l))!=`object`&&p(15,i.join(`/`))}var u=v(o),d=e(r.value),f=i[i.length-1];switch(a){case`replace`:switch(u){case 2:return o.set(f,d);case 3:p(16);default:return o[f]=d}case n:switch(u){case 1:return f===`-`?o.push(d):o.splice(f,0,d);case 2:return o.set(f,d);case 3:return o.add(d);default:return o[f]=d}case`remove`:switch(u){case 1:return o.splice(f,1);case 2:return o.delete(f);case 3:return o.delete(r.value);default:return delete o[f]}default:p(17,a)}})),t},N:function(e,r,i,a){switch(e.i){case 0:case 4:case 2:return function(e,r,i,a){var o=e.t,s=e.o;_(e.R,(function(e,c){var l=b(o,e),u=b(s,e),d=c?y(o,e)?`replace`:n:`remove`;if(l!==u||d!==`replace`){var f=r.concat(e);i.push(d===`remove`?{op:d,path:f}:{op:d,path:f,value:u}),a.push(d===n?{op:`remove`,path:f}:d===`remove`?{op:n,path:f,value:t(l)}:{op:`replace`,path:f,value:t(l)})}}))}(e,r,i,a);case 5:case 1:return function(e,r,i,a){var o=e.t,s=e.R,c=e.o;if(c.length<o.length){var l=[c,o];o=l[0],c=l[1];var u=[a,i];i=u[0],a=u[1]}for(var d=0;d<o.length;d++)if(s[d]&&c[d]!==o[d]){var f=r.concat([d]);i.push({op:`replace`,path:f,value:t(c[d])}),a.push({op:`replace`,path:f,value:t(o[d])})}for(var p=o.length;p<c.length;p++){var m=r.concat([p]);i.push({op:n,path:m,value:t(c[p])})}o.length<c.length&&a.push({op:`replace`,path:r.concat([`length`]),value:o.length})}(e,r,i,a);case 3:return function(e,t,r,i){var a=e.t,o=e.o,s=0;a.forEach((function(e){if(!o.has(e)){var a=t.concat([s]);r.push({op:`remove`,path:a,value:e}),i.unshift({op:n,path:a,value:e})}s++})),s=0,o.forEach((function(e){if(!a.has(e)){var o=t.concat([s]);r.push({op:n,path:o,value:e}),i.unshift({op:`remove`,path:o,value:e})}s++}))}(e,r,i,a)}},M:function(e,t,n,r){n.push({op:`replace`,path:[],value:t===ve?void 0:t}),r.push({op:`replace`,path:[],value:e})}})}var fe,pe,me=typeof Symbol<`u`&&typeof Symbol(`x`)==`symbol`,he=typeof Map<`u`,ge=typeof Set<`u`,_e=typeof Proxy<`u`&&Proxy.revocable!==void 0&&typeof Reflect<`u`,ve=me?Symbol.for(`immer-nothing`):((fe={})[`immer-nothing`]=!0,fe),ye=me?Symbol.for(`immer-draftable`):`__$immer_draftable`,z=me?Symbol.for(`immer-state`):`__$immer_state`,be=``+Object.prototype.constructor,xe=typeof Reflect<`u`&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols===void 0?Object.getOwnPropertyNames:function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},Se=Object.getOwnPropertyDescriptors||function(e){var t={};return xe(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},Ce={},we={get:function(e,t){if(t===z)return e;var n=T(e);if(!y(n,t))return function(e,t,n){var r=se(t,n);return r?`value`in r?r.value:r.get?.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!h(r)?r:r===oe(e.t,t)?(ce(e),e.o[t]=L(e.A.h,r,e)):r},has:function(e,t){return t in T(e)},ownKeys:function(e){return Reflect.ownKeys(T(e))},set:function(e,t,n){var r=se(T(e),t);if(r?.set)return r.set.call(e.k,n),!0;if(!e.P){var i=oe(T(e),t),a=i?.[z];if(a&&a.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(S(n,i)&&(n!==void 0||y(e.t,t)))return!0;ce(e),I(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return oe(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,ce(e),I(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=T(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!==`length`,enumerable:r.enumerable,value:n[t]}},defineProperty:function(){p(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){p(12)}},Te={};_(we,(function(e,t){Te[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),Te.deleteProperty=function(e,t){return Te.set.call(this,e,t,void 0)},Te.set=function(e,t,n){return we.set.call(this,e[0],t,n,e[0])};var B=new(function(){function e(e){var t=this;this.O=_e,this.D=!0,this.produce=function(e,n,r){if(typeof e==`function`&&typeof n!=`function`){var i=n;n=e;var a=t;return function(e){var t=this;e===void 0&&(e=i);var r=[...arguments].slice(1);return a.produce(e,(function(e){var i;return(i=n).call.apply(i,[t,e].concat(r))}))}}var o;if(typeof n!=`function`&&p(6),r!==void 0&&typeof r!=`function`&&p(7),h(e)){var s=te(t),c=L(t,e,void 0),l=!0;try{o=n(c),l=!1}finally{l?P(s):ee(s)}return typeof Promise<`u`&&o instanceof Promise?o.then((function(e){return N(s,r),re(e,s)}),(function(e){throw P(s),e})):(N(s,r),re(o,s))}if(!e||typeof e!=`object`){if((o=n(e))===void 0&&(o=e),o===ve&&(o=void 0),t.D&&D(o,!0),r){var u=[],d=[];A(`Patches`).M(e,o,u,d),r(u,d)}return o}p(21,e)},this.produceWithPatches=function(e,n){if(typeof e==`function`)return function(n){var r=[...arguments].slice(1);return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(r))}))};var r,i,a=t.produce(e,n,(function(e,t){r=e,i=t}));return typeof Promise<`u`&&a instanceof Promise?a.then((function(e){return[e,r,i]})):[a,r,i]},typeof e?.useProxies==`boolean`&&this.setUseProxies(e.useProxies),typeof e?.autoFreeze==`boolean`&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){h(e)||p(8),m(e)&&(e=le(e));var t=te(this),n=L(this,e,void 0);return n[z].C=!0,ee(t),n},t.finishDraft=function(e,t){var n=(e&&e[z]).A;return N(n,t),re(void 0,n)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!_e&&p(20),this.O=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(r.path.length===0&&r.op===`replace`){e=r.value;break}}n>-1&&(t=t.slice(n+1));var i=A(`Patches`).$;return m(e)?i(e,t):this.produce(e,(function(e){return i(e,t)}))},e}()),Ee=B.produce,De=B.produceWithPatches.bind(B);B.setAutoFreeze.bind(B),B.setUseProxies.bind(B);var Oe=B.applyPatches.bind(B);B.createDraft.bind(B),B.finishDraft.bind(B);function ke(e){return`Minified Redux error #`+e+`; visit https://redux.js.org/Errors?code=`+e+` for the full message or use the non-minified dev environment for full errors. `}(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();var Ae=function(){return Math.random().toString(36).substring(7).split(``).join(`.`)},je={INIT:`@@redux/INIT`+Ae(),REPLACE:`@@redux/REPLACE`+Ae(),PROBE_UNKNOWN_ACTION:function(){return`@@redux/PROBE_UNKNOWN_ACTION`+Ae()}};function Me(e){Object.keys(e).forEach(function(t){var n=e[t];if(n(void 0,{type:je.INIT})===void 0)throw Error(ke(12));if(n(void 0,{type:je.PROBE_UNKNOWN_ACTION()})===void 0)throw Error(ke(13))})}function Ne(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var i=t[r];typeof e[i]==`function`&&(n[i]=e[i])}var a=Object.keys(n),o;try{Me(n)}catch(e){o=e}return function(e,t){if(e===void 0&&(e={}),o)throw o;for(var r=!1,i={},s=0;s<a.length;s++){var c=a[s],l=n[c],u=e[c],d=l(u,t);if(d===void 0)throw t&&t.type,Error(ke(14));i[c]=d,r||=d!==u}return r||=a.length!==Object.keys(e).length,r?i:e}}var Pe=`NOT_FOUND`;function Fe(e){var t;return{get:function(n){return t&&e(t.key,n)?t.value:Pe},put:function(e,n){t={key:e,value:n}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function Ie(e,t){var n=[];function r(e){var r=n.findIndex(function(n){return t(e,n.key)});if(r>-1){var i=n[r];return r>0&&(n.splice(r,1),n.unshift(i)),i.value}return Pe}function i(t,i){r(t)===Pe&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var Le=function(e,t){return e===t};function Re(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;for(var r=t.length,i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function ze(e,t){var n=typeof t==`object`?t:{equalityCheck:t},r=n.equalityCheck,i=r===void 0?Le:r,a=n.maxSize,o=a===void 0?1:a,s=n.resultEqualityCheck,c=Re(i),l=o===1?Fe(c):Ie(o,c);function u(){var t=l.get(arguments);if(t===Pe){if(t=e.apply(null,arguments),s){var n=l.getEntries().find(function(e){return s(e.value,t)});n&&(t=n.value)}l.put(arguments,t)}return t}return u.clearCache=function(){return l.clear()},u}function Be(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return typeof e==`function`})){var n=t.map(function(e){return typeof e==`function`?`function `+(e.name||`unnamed`)+`()`:typeof e}).join(`, `);throw Error(`createSelector expects all input-selectors to be functions, but received the following types: [`+n+`]`)}return t}function Ve(e){var t=[...arguments].slice(1);return function(){var n=[...arguments],r=0,i,a={memoizeOptions:void 0},o=n.pop();if(typeof o==`object`&&(a=o,o=n.pop()),typeof o!=`function`)throw Error(`createSelector expects an output function after the inputs, but received: [`+typeof o+`]`);var s=a.memoizeOptions,c=s===void 0?t:s,l=Array.isArray(c)?c:[c],u=Be(n),d=e.apply(void 0,[function(){return r++,o.apply(null,arguments)}].concat(l)),f=e(function(){for(var e=[],t=u.length,n=0;n<t;n++)e.push(u[n].apply(null,arguments));return i=d.apply(null,e),i});return Object.assign(f,{resultFunc:o,memoizedResultFunc:d,dependencies:u,lastResult:function(){return i},recomputations:function(){return r},resetRecomputations:function(){return r=0}}),f}}var He=Ve(ze),Ue=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),We=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},Ge=function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},Ke=Object.defineProperty,qe=Object.defineProperties,Je=Object.getOwnPropertyDescriptors,Ye=Object.getOwnPropertySymbols,Xe=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable,Qe=function(e,t,n){return t in e?Ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},V=function(e,t){for(var n in t||={})Xe.call(t,n)&&Qe(e,n,t[n]);if(Ye)for(var r=0,i=Ye(t);r<i.length;r++){var n=i[r];Ze.call(t,n)&&Qe(e,n,t[n])}return e},$e=function(e,t){return qe(e,Je(t))},et=function(e,t,n){return new Promise(function(r,i){var a=function(e){try{s(n.next(e))}catch(e){i(e)}},o=function(e){try{s(n.throw(e))}catch(e){i(e)}},s=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(a,o)};s((n=n.apply(e,t)).next())})};typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__,typeof window<`u`&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function H(e){if(typeof e!=`object`||!e)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}var tt=function(e){return e&&typeof e.match==`function`};function U(e,t){function n(){var n=[...arguments];if(t){var r=t.apply(void 0,n);if(!r)throw Error(`prepareAction did not return an object`);return V(V({type:e,payload:r.payload},`meta`in r&&{meta:r.meta}),`error`in r&&{error:r.error})}return{type:e,payload:n[0]}}return n.toString=function(){return``+e},n.type=e,n.match=function(t){return t.type===e},n}(function(e){Ue(t,e);function t(){var n=[...arguments],r=e.apply(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){var t=[...arguments];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){var e=[...arguments];return e.length===1&&Array.isArray(e[0])?new(t.bind.apply(t,Ge([void 0],e[0].concat(this)))):new(t.bind.apply(t,Ge([void 0],e.concat(this))))},t})(Array),function(e){Ue(t,e);function t(){var n=[...arguments],r=e.apply(this,n)||this;return Object.setPrototypeOf(r,t.prototype),r}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){var t=[...arguments];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){var e=[...arguments];return e.length===1&&Array.isArray(e[0])?new(t.bind.apply(t,Ge([void 0],e[0].concat(this)))):new(t.bind.apply(t,Ge([void 0],e.concat(this))))},t}(Array);function nt(e){return h(e)?Ee(e,function(){}):e}function rt(e){var t={},n=[],r,i={addCase:function(e,n){var r=typeof e==`string`?e:e.type;if(!r)throw Error("`builder.addCase` cannot be called with an empty action type");if(r in t)throw Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[r]=n,i},addMatcher:function(e,t){return n.push({matcher:e,reducer:t}),i},addDefaultCase:function(e){return r=e,i}};return e(i),[t,n,r]}function it(e){return typeof e==`function`}function at(e,t,n,r){n===void 0&&(n=[]);var i=typeof t==`function`?rt(t):[t,n,r],a=i[0],o=i[1],s=i[2],c;if(it(e))c=function(){return nt(e())};else{var l=nt(e);c=function(){return l}}function u(e,t){e===void 0&&(e=c());var n=Ge([a[t.type]],o.filter(function(e){var n=e.matcher;return n(t)}).map(function(e){return e.reducer}));return n.filter(function(e){return!!e}).length===0&&(n=[s]),n.reduce(function(e,n){if(n)if(m(e)){var r=n(e,t);return r===void 0?e:r}else if(h(e))return Ee(e,function(e){return n(e,t)});else{var r=n(e,t);if(r===void 0){if(e===null)return e;throw Error(`A case reducer on a non-draftable value must not return undefined`)}return r}return e},e)}return u.getInitialState=c,u}function ot(e,t){return e+`/`+t}function W(e){var t=e.name;if(!t)throw Error("`name` is a required option for createSlice");var n=typeof e.initialState==`function`?e.initialState:nt(e.initialState),r=e.reducers||{},i=Object.keys(r),a={},o={},s={};i.forEach(function(e){var n=r[e],i=ot(t,e),c,l;`reducer`in n?(c=n.reducer,l=n.prepare):c=n,a[e]=c,o[i]=c,s[e]=l?U(i,l):U(i)});function c(){var t=typeof e.extraReducers==`function`?rt(e.extraReducers):[e.extraReducers],r=t[0],i=r===void 0?{}:r,a=t[1],s=a===void 0?[]:a,c=t[2],l=c===void 0?void 0:c,u=V(V({},i),o);return at(n,function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=s;n<r.length;n++){var i=r[n];e.addMatcher(i.matcher,i.reducer)}l&&e.addDefaultCase(l)})}var l;return{name:t,reducer:function(e,t){return l||=c(),l(e,t)},actions:s,caseReducers:a,getInitialState:function(){return l||=c(),l.getInitialState()}}}var st=`ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW`,ct=function(e){e===void 0&&(e=21);for(var t=``,n=e;n--;)t+=st[Math.random()*64|0];return t},lt=[`name`,`message`,`stack`,`code`],ut=function(){function e(e,t){this.payload=e,this.meta=t}return e}(),dt=function(){function e(e,t){this.payload=e,this.meta=t}return e}(),ft=function(e){if(typeof e==`object`&&e){for(var t={},n=0,r=lt;n<r.length;n++){var i=r[n];typeof e[i]==`string`&&(t[i]=e[i])}return t}return{message:String(e)}},pt=(function(){function e(e,t,n){var r=U(e+`/fulfilled`,function(e,t,n,r){return{payload:e,meta:$e(V({},r||{}),{arg:n,requestId:t,requestStatus:`fulfilled`})}}),i=U(e+`/pending`,function(e,t,n){return{payload:void 0,meta:$e(V({},n||{}),{arg:t,requestId:e,requestStatus:`pending`})}}),a=U(e+`/rejected`,function(e,t,r,i,a){return{payload:i,error:(n&&n.serializeError||ft)(e||`Rejected`),meta:$e(V({},a||{}),{arg:r,requestId:t,rejectedWithValue:!!i,requestStatus:`rejected`,aborted:e?.name===`AbortError`,condition:e?.name===`ConditionError`})}}),o=typeof AbortController<`u`?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();function s(e){return function(s,c,l){var u=n?.idGenerator?n.idGenerator(e):ct(),d=new o,f;function p(e){f=e,d.abort()}var m=function(){return et(this,null,function(){var o,m,h,g,_;return We(this,function(v){switch(v.label){case 0:return v.trys.push([0,4,,5]),m=(n?.condition)?.call(n,e,{getState:c,extra:l}),ht(m)?[4,m]:[3,2];case 1:m=v.sent(),v.label=2;case 2:if(m===!1||d.signal.aborted)throw{name:`ConditionError`,message:`Aborted due to condition callback returning false.`};return h=new Promise(function(e,t){return d.signal.addEventListener(`abort`,function(){return t({name:`AbortError`,message:f||`Aborted`})})}),s(i(u,e,(n?.getPendingMeta)?.call(n,{requestId:u,arg:e},{getState:c,extra:l}))),[4,Promise.race([h,Promise.resolve(t(e,{dispatch:s,getState:c,extra:l,requestId:u,signal:d.signal,abort:p,rejectWithValue:function(e,t){return new ut(e,t)},fulfillWithValue:function(e,t){return new dt(e,t)}})).then(function(t){if(t instanceof ut)throw t;return t instanceof dt?r(t.payload,u,e,t.meta):r(t,u,e)})])];case 3:return o=v.sent(),[3,5];case 4:return g=v.sent(),o=g instanceof ut?a(null,u,e,g.payload,g.meta):a(g,u,e),[3,5];case 5:return _=n&&!n.dispatchConditionRejection&&a.match(o)&&o.meta.condition,_||s(o),[2,o]}})})}();return Object.assign(m,{abort:p,requestId:u,arg:e,unwrap:function(){return m.then(mt)}})}}return Object.assign(s,{pending:i,rejected:a,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e})();function mt(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function ht(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}var gt=function(e,t){return tt(e)?e.match(t):e(t)};function _t(){var e=[...arguments];return function(t){return e.some(function(e){return gt(e,t)})}}function vt(){var e=[...arguments];return function(t){return e.every(function(e){return gt(e,t)})}}function yt(e,t){if(!e||!e.meta)return!1;var n=typeof e.meta.requestId==`string`,r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function bt(e){return typeof e[0]==`function`&&`pending`in e[0]&&`fulfilled`in e[0]&&`rejected`in e[0]}function xt(){var e=[...arguments];return e.length===0?function(e){return yt(e,[`pending`])}:bt(e)?function(t){var n=e.map(function(e){return e.pending});return _t.apply(void 0,n)(t)}:xt()(e[0])}function St(){var e=[...arguments];return e.length===0?function(e){return yt(e,[`rejected`])}:bt(e)?function(t){var n=e.map(function(e){return e.rejected});return _t.apply(void 0,n)(t)}:St()(e[0])}function Ct(){var e=[...arguments],t=function(e){return e&&e.meta&&e.meta.rejectedWithValue};return e.length===0||bt(e)?function(n){return vt(St.apply(void 0,e),t)(n)}:Ct()(e[0])}function G(){var e=[...arguments];return e.length===0?function(e){return yt(e,[`fulfilled`])}:bt(e)?function(t){var n=e.map(function(e){return e.fulfilled});return _t.apply(void 0,n)(t)}:G()(e[0])}function wt(){var e=[...arguments];return e.length===0?function(e){return yt(e,[`pending`,`fulfilled`,`rejected`])}:bt(e)?function(t){for(var n=[],r=0,i=e;r<i.length;r++){var a=i[r];n.push(a.pending,a.rejected,a.fulfilled)}return _t.apply(void 0,n)(t)}:wt()(e[0])}var Tt=`task`,Et=`listener`,Dt=`completed`,Ot=`cancelled`;``+Ot,``+Dt,Et+``+Ot,Et+``+Dt,function(){function e(e){this.code=e,this.name=`TaskAbortError`,this.message=Tt+` `+Ot+` (reason: `+e+`)`}return e}();var kt=`listenerMiddleware`;U(kt+`/add`),U(kt+`/removeAll`),U(kt+`/remove`);var At=`RTK_autoBatch`,jt=function(){return function(e){var t;return{payload:e,meta:(t={},t[At]=!0,t)}}};typeof queueMicrotask==`function`&&queueMicrotask.bind(typeof window<`u`?window:f===void 0?globalThis:f),typeof window<`u`&&window.requestAnimationFrame?window.requestAnimationFrame:function(e){return function(t){setTimeout(t,e)}}(10),de();var Mt=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},Nt=function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},Pt=Object.defineProperty,Ft=Object.defineProperties,It=Object.getOwnPropertyDescriptors,Lt=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,Bt=function(e,t,n){return t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},K=function(e,t){for(var n in t||={})Rt.call(t,n)&&Bt(e,n,t[n]);if(Lt)for(var r=0,i=Lt(t);r<i.length;r++){var n=i[r];zt.call(t,n)&&Bt(e,n,t[n])}return e},q=function(e,t){return Ft(e,It(t))},Vt=function(e,t){var n={};for(var r in e)Rt.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Lt)for(var i=0,a=Lt(e);i<a.length;i++){var r=a[i];t.indexOf(r)<0&&zt.call(e,r)&&(n[r]=e[r])}return n},Ht=function(e,t,n){return new Promise(function(r,i){var a=function(e){try{s(n.next(e))}catch(e){i(e)}},o=function(e){try{s(n.throw(e))}catch(e){i(e)}},s=function(e){return e.done?r(e.value):Promise.resolve(e.value).then(a,o)};s((n=n.apply(e,t)).next())})},J;(function(e){e.uninitialized=`uninitialized`,e.pending=`pending`,e.fulfilled=`fulfilled`,e.rejected=`rejected`})(J||={});function Ut(e){return{status:e,isUninitialized:e===J.uninitialized,isLoading:e===J.pending,isSuccess:e===J.fulfilled,isError:e===J.rejected}}function Wt(e){return RegExp(`(^|:)//`).test(e)}var Gt=function(e){return e.replace(/\/$/,``)},Kt=function(e){return e.replace(/^\//,``)};function qt(e,t){if(!e)return t;if(!t)return e;if(Wt(t))return t;var n=e.endsWith(`/`)||!t.startsWith(`?`)?`/`:``;return e=Gt(e),t=Kt(t),``+e+n+t}var Jt=function(e){return[].concat.apply([],e)};function Yt(){return typeof navigator>`u`||navigator.onLine===void 0?!0:navigator.onLine}function Xt(){return typeof document>`u`?!0:document.visibilityState!==`hidden`}var Zt=H;function Qt(e,t){if(e===t||!(Zt(e)&&Zt(t)||Array.isArray(e)&&Array.isArray(t)))return t;for(var n=Object.keys(t),r=Object.keys(e),i=n.length===r.length,a=Array.isArray(t)?[]:{},o=0,s=n;o<s.length;o++){var c=s[o];a[c]=Qt(e[c],t[c]),i&&=e[c]===a[c]}return i?e:a}var $t=function(){var e=[...arguments];return fetch.apply(void 0,e)},en=function(e){return e.status>=200&&e.status<=299},tn=function(e){return/ion\/(vnd\.api\+)?json/.test(e.get(`content-type`)||``)};function nn(e){if(!H(e))return e;for(var t=K({},e),n=0,r=Object.entries(t);n<r.length;n++){var i=r[n],a=i[0];i[1]===void 0&&delete t[a]}return t}function rn(e){var t=this;e===void 0&&(e={});var n=e,r=n.baseUrl,i=n.prepareHeaders,a=i===void 0?function(e){return e}:i,o=n.fetchFn,s=o===void 0?$t:o,c=n.paramsSerializer,l=n.isJsonContentType,u=l===void 0?tn:l,d=n.jsonContentType,f=d===void 0?`application/json`:d,p=n.jsonReplacer,m=n.timeout,h=n.responseHandler,g=n.validateStatus,_=Vt(n,[`baseUrl`,`prepareHeaders`,`fetchFn`,`paramsSerializer`,`isJsonContentType`,`jsonContentType`,`jsonReplacer`,`timeout`,`responseHandler`,`validateStatus`]);return function(e,n){return Ht(t,null,function(){var t,i,o,l,d,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,ee,te,ne,re,ie,ae,F,oe,se,I,ce,L,le,ue,de;return Mt(this,function(R){switch(R.label){case 0:return t=n.signal,i=n.getState,o=n.extra,l=n.endpoint,d=n.forced,y=n.type,x=typeof e==`string`?{url:e}:e,S=x.url,C=x.headers,w=C===void 0?new Headers(_.headers):C,T=x.params,E=T===void 0?void 0:T,D=x.responseHandler,O=D===void 0?h??`json`:D,k=x.validateStatus,A=k===void 0?g??en:k,j=x.timeout,M=j===void 0?m:j,N=Vt(x,[`url`,`headers`,`params`,`responseHandler`,`validateStatus`,`timeout`]),P=K(q(K({},_),{signal:t}),N),w=new Headers(nn(w)),ee=P,[4,a(w,{getState:i,extra:o,endpoint:l,forced:d,type:y})];case 1:ee.headers=R.sent()||w,te=function(e){return typeof e==`object`&&(H(e)||Array.isArray(e)||typeof e.toJSON==`function`)},!P.headers.has(`content-type`)&&te(P.body)&&P.headers.set(`content-type`,f),te(P.body)&&u(P.headers)&&(P.body=JSON.stringify(P.body,p)),E&&(ne=~S.indexOf(`?`)?`&`:`?`,re=c?c(E):new URLSearchParams(nn(E)),S+=ne+re),S=qt(r,S),ie=new Request(S,P),ae=new Request(S,P),b={request:ae},oe=!1,se=M&&setTimeout(function(){oe=!0,n.abort()},M),R.label=2;case 2:return R.trys.push([2,4,5,6]),[4,s(ie)];case 3:return F=R.sent(),[3,6];case 4:return I=R.sent(),[2,{error:{status:oe?`TIMEOUT_ERROR`:`FETCH_ERROR`,error:String(I)},meta:b}];case 5:return se&&clearTimeout(se),[7];case 6:ce=F.clone(),b.response=ce,le=``,R.label=7;case 7:return R.trys.push([7,9,,10]),[4,Promise.all([v(F,O).then(function(e){return L=e},function(e){return ue=e}),ce.text().then(function(e){return le=e},function(){})])];case 8:if(R.sent(),ue)throw ue;return[3,10];case 9:return de=R.sent(),[2,{error:{status:`PARSING_ERROR`,originalStatus:F.status,data:le,error:String(de)},meta:b}];case 10:return[2,A(F,L)?{data:L,meta:b}:{error:{status:F.status,data:L},meta:b}]}})})};function v(e,t){return Ht(this,null,function(){var n;return Mt(this,function(r){switch(r.label){case 0:return typeof t==`function`?[2,t(e)]:(t===`content-type`&&(t=u(e.headers)?`json`:`text`),t===`json`?[4,e.text()]:[3,2]);case 1:return n=r.sent(),[2,n.length?JSON.parse(n):null];case 2:return[2,e.text()]}})})}}var an=function(){function e(e,t){t===void 0&&(t=void 0),this.value=e,this.meta=t}return e}(),on=U(`__rtkq/focused`),sn=U(`__rtkq/unfocused`),cn=U(`__rtkq/online`),ln=U(`__rtkq/offline`),Y;(function(e){e.query=`query`,e.mutation=`mutation`})(Y||={});function un(e){return e.type===Y.query}function dn(e){return e.type===Y.mutation}function fn(e,t,n,r,i,a){return pn(e)?e(t,n,r,i).map(mn).map(a):Array.isArray(e)?e.map(mn).map(a):[]}function pn(e){return typeof e==`function`}function mn(e){return typeof e==`string`?{type:e}:e}function hn(e){return e!=null}var gn=Symbol(`forceQueryFn`),_n=function(e){return typeof e[gn]==`function`};function vn(e){var t=e.serializeQueryArgs,n=e.queryThunk,r=e.mutationThunk,i=e.api,a=e.context,o=new Map,s=new Map,c=i.internalActions,l=c.unsubscribeQueryResult,u=c.removeMutationResult,d=c.updateSubscriptionOptions;return{buildInitiateQuery:v,buildInitiateMutation:y,getRunningQueryThunk:m,getRunningMutationThunk:h,getRunningQueriesThunk:g,getRunningMutationsThunk:_,getRunningOperationPromises:p,removalWarning:f};function f(){throw Error(`This method had to be removed due to a conceptual bug in RTK.
|
|
2
|
+
Please see https://github.com/reduxjs/redux-toolkit/pull/2481 for details.
|
|
3
|
+
See https://redux-toolkit.js.org/rtk-query/usage/server-side-rendering for new guidance on SSR.`)}function p(){var e=function(e){return Array.from(e.values()).flatMap(function(e){return e?Object.values(e):[]})};return Nt(Nt([],e(o)),e(s)).filter(hn)}function m(e,n){return function(r){var i=a.endpointDefinitions[e],s=t({queryArgs:n,endpointDefinition:i,endpointName:e});return o.get(r)?.[s]}}function h(e,t){return function(e){return s.get(e)?.[t]}}function g(){return function(e){return Object.values(o.get(e)||{}).filter(hn)}}function _(){return function(e){return Object.values(s.get(e)||{}).filter(hn)}}function v(e,r){var a=function(s,c){var u=c===void 0?{}:c,f=u.subscribe,p=f===void 0?!0:f,m=u.forceRefetch,h=u.subscriptionOptions,g=u[gn];return function(c,u){var f,_=t({queryArgs:s,endpointDefinition:r,endpointName:e}),v=n((f={type:`query`,subscribe:p,forceRefetch:m,subscriptionOptions:h,endpointName:e,originalArgs:s,queryCacheKey:_},f[gn]=g,f)),y=i.endpoints[e].select(s),b=c(v),x=y(u()),S=b.requestId,C=b.abort,w=x.requestId!==S,T=o.get(c)?.[_],E=function(){return y(u())},D=Object.assign(g?b.then(E):w&&!T?Promise.resolve(x):Promise.all([T,b]).then(E),{arg:s,requestId:S,subscriptionOptions:h,queryCacheKey:_,abort:C,unwrap:function(){return Ht(this,null,function(){var e;return Mt(this,function(t){switch(t.label){case 0:return[4,D];case 1:if(e=t.sent(),e.isError)throw e.error;return[2,e.data]}})})},refetch:function(){return c(a(s,{subscribe:!1,forceRefetch:!0}))},unsubscribe:function(){p&&c(l({queryCacheKey:_,requestId:S}))},updateSubscriptionOptions:function(t){D.subscriptionOptions=t,c(d({endpointName:e,requestId:S,queryCacheKey:_,options:t}))}});if(!T&&!w&&!g){var O=o.get(c)||{};O[_]=D,o.set(c,O),D.then(function(){delete O[_],Object.keys(O).length||o.delete(c)})}return D}};return a}function y(e){return function(t,n){var i=n===void 0?{}:n,a=i.track,o=a===void 0?!0:a,c=i.fixedCacheKey;return function(n,i){var a=n(r({type:`mutation`,endpointName:e,originalArgs:t,track:o,fixedCacheKey:c})),l=a.requestId,d=a.abort,f=a.unwrap,p=a.unwrap().then(function(e){return{data:e}}).catch(function(e){return{error:e}}),m=function(){n(u({requestId:l,fixedCacheKey:c}))},h=Object.assign(p,{arg:a.arg,requestId:l,abort:d,unwrap:f,unsubscribe:m,reset:m}),g=s.get(n)||{};return s.set(n,g),g[l]=h,h.then(function(){delete g[l],Object.keys(g).length||s.delete(n)}),c&&(g[c]=h,h.then(function(){g[c]===h&&(delete g[c],Object.keys(g).length||s.delete(n))})),h}}}}function yn(e){return e}function bn(e){var t=this,n=e.reducerPath,r=e.baseQuery,i=e.context.endpointDefinitions,a=e.serializeQueryArgs,o=e.api,s=e.assertTagType,c=function(e,t,n,r){return function(c,l){var u=i[e],d=a({queryArgs:t,endpointDefinition:u,endpointName:e});if(c(o.internalActions.queryResultPatched({queryCacheKey:d,patches:n})),r){var f=o.endpoints[e].select(t)(l()),p=fn(u.providesTags,f.data,void 0,t,{},s);c(o.internalActions.updateProvidedBy({queryCacheKey:d,providedTags:p}))}}},l=function(e,t,n,r){return r===void 0&&(r=!0),function(i,a){var s,c,l=o.endpoints[e].select(t)(a()),u={patches:[],inversePatches:[],undo:function(){return i(o.util.patchQueryData(e,t,u.inversePatches,r))}};if(l.status===J.uninitialized)return u;var d;if(`data`in l)if(h(l.data)){var f=De(l.data,n),p=f[0],m=f[1],g=f[2];(s=u.patches).push.apply(s,m),(c=u.inversePatches).push.apply(c,g),d=p}else d=n(l.data),u.patches.push({op:`replace`,path:[],value:d}),u.inversePatches.push({op:`replace`,path:[],value:l.data});return i(o.util.patchQueryData(e,t,u.patches,r)),u}},u=function(e,t,n){return function(r){var i;return r(o.endpoints[e].initiate(t,(i={subscribe:!1,forceRefetch:!0},i[gn]=function(){return{data:n}},i)))}},d=function(e,n){return Ht(t,[e,n],function(e,t){var n,a,o,s,c,l,u,d,p,m,h,g,_,v=t.signal,y=t.abort,b=t.rejectWithValue,x=t.fulfillWithValue,S=t.dispatch,C=t.getState,w=t.extra;return Mt(this,function(t){switch(t.label){case 0:n=i[e.endpointName],t.label=1;case 1:return t.trys.push([1,8,,13]),a=yn,o=void 0,s={signal:v,abort:y,dispatch:S,getState:C,extra:w,endpoint:e.endpointName,type:e.type,forced:e.type===`query`?f(e,C()):void 0},c=e.type===`query`?e[gn]:void 0,c?(o=c(),[3,6]):[3,2];case 2:return n.query?[4,r(n.query(e.originalArgs),s,n.extraOptions)]:[3,4];case 3:return o=t.sent(),n.transformResponse&&(a=n.transformResponse),[3,6];case 4:return[4,n.queryFn(e.originalArgs,s,n.extraOptions,function(e){return r(e,s,n.extraOptions)})];case 5:o=t.sent(),t.label=6;case 6:if(o.error)throw new an(o.error,o.meta);return l=x,[4,a(o.data,o.meta,e.originalArgs)];case 7:return[2,l.apply(void 0,[t.sent(),(g={fulfilledTimeStamp:Date.now(),baseQueryMeta:o.meta},g[At]=!0,g)])];case 8:if(u=t.sent(),d=u,!(d instanceof an))return[3,12];p=yn,n.query&&n.transformErrorResponse&&(p=n.transformErrorResponse),t.label=9;case 9:return t.trys.push([9,11,,12]),m=b,[4,p(d.value,d.meta,e.originalArgs)];case 10:return[2,m.apply(void 0,[t.sent(),(_={baseQueryMeta:d.meta},_[At]=!0,_)])];case 11:return h=t.sent(),d=h,[3,12];case 12:throw d;case 13:return[2]}})})};function f(e,t){var r=t[n]?.queries?.[e.queryCacheKey],i=t[n]?.config.refetchOnMountOrArgChange,a=r?.fulfilledTimeStamp,o=e.forceRefetch??(e.subscribe&&i);return o?o===!0||(Number(new Date)-Number(a))/1e3>=o:!1}var p=pt(n+`/executeQuery`,d,{getPendingMeta:function(){var e;return e={startedTimeStamp:Date.now()},e[At]=!0,e},condition:function(e,t){var r=t.getState,a=r(),o=a[n]?.queries?.[e.queryCacheKey],s=o?.fulfilledTimeStamp,c=e.originalArgs,l=o?.originalArgs,u=i[e.endpointName];return _n(e)?!0:o?.status===`pending`?!1:f(e,a)||un(u)&&(u?.forceRefetch)?.call(u,{currentArg:c,previousArg:l,endpointState:o,state:a})?!0:!s},dispatchConditionRejection:!0}),m=pt(n+`/executeMutation`,d,{getPendingMeta:function(){var e;return e={startedTimeStamp:Date.now()},e[At]=!0,e}}),g=function(e){return`force`in e},_=function(e){return`ifOlderThan`in e},v=function(e,t,n){return function(r,i){var a=g(n)&&n.force,s=_(n)&&n.ifOlderThan,c=function(n){return n===void 0&&(n=!0),o.endpoints[e].initiate(t,{forceRefetch:n})},l=o.endpoints[e].select(t)(i());if(a)r(c());else if(s){var u=l?.fulfilledTimeStamp;if(!u){r(c());return}(Number(new Date)-Number(new Date(u)))/1e3>=s&&r(c())}else r(c(!1))}};function y(e){return function(t){return t?.meta?.arg?.endpointName===e}}function b(e,t){return{matchPending:vt(xt(e),y(t)),matchFulfilled:vt(G(e),y(t)),matchRejected:vt(St(e),y(t))}}return{queryThunk:p,mutationThunk:m,prefetch:v,updateQueryData:l,upsertQueryData:u,patchQueryData:c,buildMatchThunkActions:b}}function xn(e,t,n,r){return fn(n[e.meta.arg.endpointName][t],G(e)?e.payload:void 0,Ct(e)?e.payload:void 0,e.meta.arg.originalArgs,`baseQueryMeta`in e.meta?e.meta.baseQueryMeta:void 0,r)}function Sn(e,t,n){var r=e[t];r&&n(r)}function Cn(e){return(`arg`in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function wn(e,t,n){var r=e[Cn(t)];r&&n(r)}var Tn={};function En(e){var t=e.reducerPath,n=e.queryThunk,r=e.mutationThunk,i=e.context,a=i.endpointDefinitions,o=i.apiUid,s=i.extractRehydrationInfo,c=i.hasRehydrationInfo,l=e.assertTagType,u=e.config,d=U(t+`/resetApiState`),f=W({name:t+`/queries`,initialState:Tn,reducers:{removeQueryResult:{reducer:function(e,t){var n=t.payload.queryCacheKey;delete e[n]},prepare:jt()},queryResultPatched:{reducer:function(e,t){var n=t.payload,r=n.queryCacheKey,i=n.patches;Sn(e,r,function(e){e.data=Oe(e.data,i.concat())})},prepare:jt()}},extraReducers:function(e){e.addCase(n.pending,function(e,t){var n=t.meta,r=t.meta.arg,i,a=_n(r);(r.subscribe||a)&&(e[i=r.queryCacheKey]??(e[i]={status:J.uninitialized,endpointName:r.endpointName})),Sn(e,r.queryCacheKey,function(e){e.status=J.pending,e.requestId=a&&e.requestId?e.requestId:n.requestId,r.originalArgs!==void 0&&(e.originalArgs=r.originalArgs),e.startedTimeStamp=n.startedTimeStamp})}).addCase(n.fulfilled,function(e,t){var n=t.meta,r=t.payload;Sn(e,n.arg.queryCacheKey,function(e){if(!(e.requestId!==n.requestId&&!_n(n.arg))){var t=a[n.arg.endpointName].merge;if(e.status=J.fulfilled,t)if(e.data!==void 0){var i=n.fulfilledTimeStamp,o=n.arg,s=n.baseQueryMeta,c=n.requestId;e.data=Ee(e.data,function(e){return t(e,r,{arg:o.originalArgs,baseQueryMeta:s,fulfilledTimeStamp:i,requestId:c})})}else e.data=r;else e.data=a[n.arg.endpointName].structuralSharing??!0?Qt(m(e.data)?g(e.data):e.data,r):r;delete e.error,e.fulfilledTimeStamp=n.fulfilledTimeStamp}})}).addCase(n.rejected,function(e,t){var n=t.meta,r=n.condition,i=n.arg,a=n.requestId,o=t.error,s=t.payload;Sn(e,i.queryCacheKey,function(e){if(!r){if(e.requestId!==a)return;e.status=J.rejected,e.error=s??o}})}).addMatcher(c,function(e,t){for(var n=s(t).queries,r=0,i=Object.entries(n);r<i.length;r++){var a=i[r],o=a[0],c=a[1];(c?.status===J.fulfilled||c?.status===J.rejected)&&(e[o]=c)}})}}),p=W({name:t+`/mutations`,initialState:Tn,reducers:{removeMutationResult:{reducer:function(e,t){var n=t.payload,r=Cn(n);r in e&&delete e[r]},prepare:jt()}},extraReducers:function(e){e.addCase(r.pending,function(e,t){var n=t.meta,r=t.meta,i=r.requestId,a=r.arg,o=r.startedTimeStamp;a.track&&(e[Cn(n)]={requestId:i,status:J.pending,endpointName:a.endpointName,startedTimeStamp:o})}).addCase(r.fulfilled,function(e,t){var n=t.payload,r=t.meta;r.arg.track&&wn(e,r,function(e){e.requestId===r.requestId&&(e.status=J.fulfilled,e.data=n,e.fulfilledTimeStamp=r.fulfilledTimeStamp)})}).addCase(r.rejected,function(e,t){var n=t.payload,r=t.error,i=t.meta;i.arg.track&&wn(e,i,function(e){e.requestId===i.requestId&&(e.status=J.rejected,e.error=n??r)})}).addMatcher(c,function(e,t){for(var n=s(t).mutations,r=0,i=Object.entries(n);r<i.length;r++){var a=i[r],o=a[0],c=a[1];(c?.status===J.fulfilled||c?.status===J.rejected)&&o!==c?.requestId&&(e[o]=c)}})}}),h=W({name:t+`/invalidation`,initialState:Tn,reducers:{updateProvidedBy:{reducer:function(e,t){for(var n,r,i=t.payload,a=i.queryCacheKey,o=i.providedTags,s=0,c=Object.values(e);s<c.length;s++)for(var l=c[s],u=0,d=Object.values(l);u<d.length;u++){var f=d[u],p=f.indexOf(a);p!==-1&&f.splice(p,1)}for(var m=0,h=o;m<h.length;m++){var g=h[m],_=g.type,v=g.id,y=(n=e[_]??(e[_]={}))[r=v||`__internal_without_id`]??(n[r]=[]);y.includes(a)||y.push(a)}},prepare:jt()}},extraReducers:function(e){e.addCase(f.actions.removeQueryResult,function(e,t){for(var n=t.payload.queryCacheKey,r=0,i=Object.values(e);r<i.length;r++)for(var a=i[r],o=0,s=Object.values(a);o<s.length;o++){var c=s[o],l=c.indexOf(n);l!==-1&&c.splice(l,1)}}).addMatcher(c,function(e,t){for(var n,r,i=s(t).provided,a=0,o=Object.entries(i);a<o.length;a++)for(var c=o[a],l=c[0],u=c[1],d=0,f=Object.entries(u);d<f.length;d++)for(var p=f[d],m=p[0],h=p[1],g=(n=e[l]??(e[l]={}))[r=m||`__internal_without_id`]??(n[r]=[]),_=0,v=h;_<v.length;_++){var y=v[_];g.includes(y)||g.push(y)}}).addMatcher(_t(G(n),Ct(n)),function(e,t){var n=xn(t,`providesTags`,a,l),r=t.meta.arg.queryCacheKey;h.caseReducers.updateProvidedBy(e,h.actions.updateProvidedBy({queryCacheKey:r,providedTags:n}))})}}),_=W({name:t+`/subscriptions`,initialState:Tn,reducers:{updateSubscriptionOptions:function(e,t){},unsubscribeQueryResult:function(e,t){},internal_probeSubscription:function(e,t){}}}),v=W({name:t+`/internalSubscriptions`,initialState:Tn,reducers:{subscriptionsUpdated:{reducer:function(e,t){return Oe(e,t.payload)},prepare:jt()}}}),y=W({name:t+`/config`,initialState:K({online:Yt(),focused:Xt(),middlewareRegistered:!1},u),reducers:{middlewareRegistered:function(e,t){var n=t.payload;e.middlewareRegistered=e.middlewareRegistered===`conflict`||o!==n?`conflict`:!0}},extraReducers:function(e){e.addCase(cn,function(e){e.online=!0}).addCase(ln,function(e){e.online=!1}).addCase(on,function(e){e.focused=!0}).addCase(sn,function(e){e.focused=!1}).addMatcher(c,function(e){return K({},e)})}}),b=Ne({queries:f.reducer,mutations:p.reducer,provided:h.reducer,subscriptions:v.reducer,config:y.reducer});return{reducer:function(e,t){return b(d.match(t)?void 0:e,t)},actions:q(K(K(K(K(K(K({},y.actions),f.actions),_.actions),v.actions),p.actions),h.actions),{unsubscribeMutationResult:p.actions.removeMutationResult,resetApiState:d})}}var X=Symbol.for(`RTKQ/skipToken`),Dn={status:J.uninitialized},On=Ee(Dn,function(){}),kn=Ee(Dn,function(){});function An(e){var t=e.serializeQueryArgs,n=e.reducerPath,r=function(e){return On},i=function(e){return kn};return{buildQuerySelector:s,buildMutationSelector:c,selectInvalidatedBy:l};function a(e){return K(K({},e),Ut(e.status))}function o(e){return e[n]}function s(e,n){return function(i){var s=t({queryArgs:i,endpointDefinition:n,endpointName:e});return He(i===X?r:function(e){return o(e)?.queries?.[s]??On},a)}}function c(){return function(e){var t=typeof e==`object`?Cn(e)??X:e;return He(t===X?i:function(e){return o(e)?.mutations?.[t]??kn},a)}}function l(e,t){for(var r=e[n],i=new Set,a=0,o=t.map(mn);a<o.length;a++){var s=o[a],c=r.provided[s.type];if(c)for(var l=(s.id===void 0?Jt(Object.values(c)):c[s.id])??[],u=0,d=l;u<d.length;u++){var f=d[u];i.add(f)}}return Jt(Array.from(i.values()).map(function(e){var t=r.queries[e];return t?[{queryCacheKey:e,endpointName:t.endpointName,originalArgs:t.originalArgs}]:[]}))}}var jn=WeakMap?new WeakMap:void 0,Mn=function(e){var t=e.endpointName,n=e.queryArgs,r=``,i=jn?.get(n);if(typeof i==`string`)r=i;else{var a=JSON.stringify(n,function(e,t){return H(t)?Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{}):t});H(n)&&jn?.set(n,a),r=a}return t+`(`+r+`)`};function Nn(){var e=[...arguments];return function(t){var n=ze(function(e){return t.extractRehydrationInfo?.call(t,e,{reducerPath:t.reducerPath??`api`})}),r=q(K({reducerPath:`api`,keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1},t),{extractRehydrationInfo:n,serializeQueryArgs:function(e){var n=Mn;if(`serializeQueryArgs`in e.endpointDefinition){var r=e.endpointDefinition.serializeQueryArgs;n=function(e){var t=r(e);return typeof t==`string`?t:Mn(q(K({},e),{queryArgs:t}))}}else t.serializeQueryArgs&&(n=t.serializeQueryArgs);return n(e)},tagTypes:Nt([],t.tagTypes||[])}),i={endpointDefinitions:{},batch:function(e){e()},apiUid:ct(),extractRehydrationInfo:n,hasRehydrationInfo:ze(function(e){return n(e)!=null})},a={injectEndpoints:s,enhanceEndpoints:function(e){var t=e.addTagTypes,n=e.endpoints;if(t)for(var o=0,s=t;o<s.length;o++){var c=s[o];r.tagTypes.includes(c)||r.tagTypes.push(c)}if(n)for(var l=0,u=Object.entries(n);l<u.length;l++){var d=u[l],f=d[0],p=d[1];typeof p==`function`?p(i.endpointDefinitions[f]):Object.assign(i.endpointDefinitions[f]||{},p)}return a}},o=e.map(function(e){return e.init(a,r,i)});function s(e){for(var t=e.endpoints({query:function(e){return q(K({},e),{type:Y.query})},mutation:function(e){return q(K({},e),{type:Y.mutation})}}),n=0,r=Object.entries(t);n<r.length;n++){var s=r[n],c=s[0],l=s[1];if(!(!e.overrideExisting&&c in i.endpointDefinitions)){i.endpointDefinitions[c]=l;for(var u=0,d=o;u<d.length;u++)d[u].injectEndpoint(c,l)}}return a}return a.injectEndpoints({endpoints:t.endpoints})}}function Pn(e){for(var t in e)return!1;return!0}var Fn=2147483647/1e3-1,In=function(e){var t=e.reducerPath,n=e.api,r=e.context,i=e.internalState,a=n.internalActions,o=a.removeQueryResult,s=a.unsubscribeQueryResult;function c(e){var t=i.currentSubscriptions[e];return!!t&&!Pn(t)}var l={},u=function(e,i,a){if(s.match(e)){var o=i.getState()[t],c=e.payload.queryCacheKey;d(c,o.queries[c]?.endpointName,i,o.config)}if(n.util.resetApiState.match(e))for(var u=0,f=Object.entries(l);u<f.length;u++){var p=f[u],m=p[0],h=p[1];h&&clearTimeout(h),delete l[m]}if(r.hasRehydrationInfo(e))for(var o=i.getState()[t],g=r.extractRehydrationInfo(e).queries,_=0,v=Object.entries(g);_<v.length;_++){var y=v[_],c=y[0],b=y[1];d(c,b?.endpointName,i,o.config)}};function d(e,t,n,i){var a=r.endpointDefinitions[t]?.keepUnusedDataFor??i.keepUnusedDataFor;if(a!==1/0){var s=Math.max(0,Math.min(a,Fn));if(!c(e)){var u=l[e];u&&clearTimeout(u),l[e]=setTimeout(function(){c(e)||n.dispatch(o({queryCacheKey:e})),delete l[e]},s*1e3)}}}return u},Ln=function(e){var t=e.reducerPath,n=e.context,r=e.context.endpointDefinitions,i=e.mutationThunk,a=e.api,o=e.assertTagType,s=e.refetchQuery,c=a.internalActions.removeQueryResult,l=_t(G(i),Ct(i)),u=function(e,t){l(e)&&d(xn(e,`invalidatesTags`,r,o),t),a.util.invalidateTags.match(e)&&d(fn(e.payload,void 0,void 0,void 0,void 0,o),t)};function d(e,r){var i=r.getState(),o=i[t],l=a.util.selectInvalidatedBy(i,e);n.batch(function(){for(var e=Array.from(l.values()),t=0,n=e;t<n.length;t++){var i=n[t].queryCacheKey,a=o.queries[i],u=o.subscriptions[i]??{};a&&(Object.keys(u).length===0?r.dispatch(c({queryCacheKey:i})):a.status!==J.uninitialized&&r.dispatch(s(a,i)))}})}return u},Rn=function(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.refetchQuery,a=e.internalState,o={},s=function(e,t){(r.internalActions.updateSubscriptionOptions.match(e)||r.internalActions.unsubscribeQueryResult.match(e))&&l(e.payload,t),(n.pending.match(e)||n.rejected.match(e)&&e.meta.condition)&&l(e.meta.arg,t),(n.fulfilled.match(e)||n.rejected.match(e)&&!e.meta.condition)&&c(e.meta.arg,t),r.util.resetApiState.match(e)&&d()};function c(e,n){var r=e.queryCacheKey,s=n.getState()[t].queries[r],c=a.currentSubscriptions[r];if(!(!s||s.status===J.uninitialized)){var l=f(c);if(Number.isFinite(l)){var u=o[r];u?.timeout&&(clearTimeout(u.timeout),u.timeout=void 0);var d=o[r]={nextPollTimestamp:Date.now()+l,pollingInterval:l,timeout:setTimeout(function(){d.timeout=void 0,n.dispatch(i(s,r))},l)}}}}function l(e,n){var r=e.queryCacheKey,i=n.getState()[t].queries[r],s=a.currentSubscriptions[r];if(!(!i||i.status===J.uninitialized)){var l=f(s);if(!Number.isFinite(l)){u(r);return}var d=o[r],p=Date.now()+l;(!d||p<d.nextPollTimestamp)&&c({queryCacheKey:r},n)}}function u(e){var t=o[e];t?.timeout&&clearTimeout(t.timeout),delete o[e]}function d(){for(var e=0,t=Object.keys(o);e<t.length;e++){var n=t[e];u(n)}}function f(e){e===void 0&&(e={});var t=1/0;for(var n in e)e[n].pollingInterval&&(t=Math.min(e[n].pollingInterval,t));return t}return s},zn=function(e){var t=e.reducerPath,n=e.context,r=e.api,i=e.refetchQuery,a=e.internalState,o=r.internalActions.removeQueryResult,s=function(e,t){on.match(e)&&c(t,`refetchOnFocus`),cn.match(e)&&c(t,`refetchOnReconnect`)};function c(e,r){var s=e.getState()[t],c=s.queries,l=a.currentSubscriptions;n.batch(function(){for(var t=0,n=Object.keys(l);t<n.length;t++){var a=n[t],u=c[a],d=l[a];!d||!u||(Object.values(d).some(function(e){return e[r]===!0})||Object.values(d).every(function(e){return e[r]===void 0})&&s.config[r])&&(Object.keys(d).length===0?e.dispatch(o({queryCacheKey:a})):u.status!==J.uninitialized&&e.dispatch(i(u,a)))}})}return s},Bn=Error(`Promise never resolved before cacheEntryRemoved.`),Vn=function(e){var t=e.api,n=e.reducerPath,r=e.context,i=e.queryThunk,a=e.mutationThunk;e.internalState;var o=wt(i),s=wt(a),c=G(i,a),l={},u=function(e,r,o){var s=d(e);if(i.pending.match(e)){var u=o[n].queries[s],p=r.getState()[n].queries[s];!u&&p&&f(e.meta.arg.endpointName,e.meta.arg.originalArgs,s,r,e.meta.requestId)}else if(a.pending.match(e)){var p=r.getState()[n].mutations[s];p&&f(e.meta.arg.endpointName,e.meta.arg.originalArgs,s,r,e.meta.requestId)}else if(c(e)){var m=l[s];m?.valueResolved&&(m.valueResolved({data:e.payload,meta:e.meta.baseQueryMeta}),delete m.valueResolved)}else if(t.internalActions.removeQueryResult.match(e)||t.internalActions.removeMutationResult.match(e)){var m=l[s];m&&(delete l[s],m.cacheEntryRemoved())}else if(t.util.resetApiState.match(e))for(var h=0,g=Object.entries(l);h<g.length;h++){var _=g[h],v=_[0],m=_[1];delete l[v],m.cacheEntryRemoved()}};function d(e){return o(e)?e.meta.arg.queryCacheKey:s(e)?e.meta.requestId:t.internalActions.removeQueryResult.match(e)?e.payload.queryCacheKey:t.internalActions.removeMutationResult.match(e)?Cn(e.payload):``}function f(e,n,i,a,o){var s=r.endpointDefinitions[e],c=s?.onCacheEntryAdded;if(c){var u={},d=new Promise(function(e){u.cacheEntryRemoved=e}),f=Promise.race([new Promise(function(e){u.valueResolved=e}),d.then(function(){throw Bn})]);f.catch(function(){}),l[i]=u;var p=t.endpoints[e].select(s.type===Y.query?n:i),m=a.dispatch(function(e,t,n){return n}),h=c(n,q(K({},a),{getCacheEntry:function(){return p(a.getState())},requestId:o,extra:m,updateCachedData:s.type===Y.query?function(r){return a.dispatch(t.util.updateQueryData(e,n,r))}:void 0,cacheDataLoaded:f,cacheEntryRemoved:d}));Promise.resolve(h).catch(function(e){if(e!==Bn)throw e})}}return u},Hn=function(e){var t=e.api,n=e.context,r=e.queryThunk,i=e.mutationThunk,a=xt(r,i),o=St(r,i),s=G(r,i),c={};return function(e,r){var i,l;if(a(e)){var u=e.meta,d=u.requestId,f=u.arg,p=f.endpointName,m=f.originalArgs,h=n.endpointDefinitions[p],g=h?.onQueryStarted;if(g){var _={},v=new Promise(function(e,t){_.resolve=e,_.reject=t});v.catch(function(){}),c[d]=_;var y=t.endpoints[p].select(h.type===Y.query?m:d),b=r.dispatch(function(e,t,n){return n});g(m,q(K({},r),{getCacheEntry:function(){return y(r.getState())},requestId:d,extra:b,updateCachedData:h.type===Y.query?function(e){return r.dispatch(t.util.updateQueryData(p,m,e))}:void 0,queryFulfilled:v}))}}else if(s(e)){var x=e.meta,d=x.requestId,S=x.baseQueryMeta;(i=c[d])==null||i.resolve({data:e.payload,meta:S}),delete c[d]}else if(o(e)){var C=e.meta,d=C.requestId,w=C.rejectedWithValue,S=C.baseQueryMeta;(l=c[d])==null||l.reject({error:e.payload??e.error,isUnhandledError:!w,meta:S}),delete c[d]}}},Un=function(e){var t=e.api,n=e.context.apiUid;return e.reducerPath,function(e,r){t.util.resetApiState.match(e)&&r.dispatch(t.internalActions.middlewareRegistered(n))}},Wn,Gn=typeof queueMicrotask==`function`?queueMicrotask.bind(typeof window<`u`?window:f===void 0?globalThis:f):function(e){return(Wn||=Promise.resolve()).then(e).catch(function(e){return setTimeout(function(){throw e},0)})},Kn=function(e){var t=e.api,n=e.queryThunk,r=e.internalState,i=t.reducerPath+`/subscriptions`,a=null,o=!1,s=t.internalActions,c=s.updateSubscriptionOptions,l=s.unsubscribeQueryResult,u=function(e,r){var i,a;if(c.match(r)){var o=r.payload,s=o.queryCacheKey,u=o.requestId,d=o.options;return e?.[s]?.[u]&&(e[s][u]=d),!0}if(l.match(r)){var f=r.payload,s=f.queryCacheKey,u=f.requestId;return e[s]&&delete e[s][u],!0}if(t.internalActions.removeQueryResult.match(r))return delete e[r.payload.queryCacheKey],!0;if(n.pending.match(r)){var p=r.meta,m=p.arg,u=p.requestId;if(m.subscribe){var h=e[i=m.queryCacheKey]??(e[i]={});return h[u]=m.subscriptionOptions??h[u]??{},!0}}if(n.rejected.match(r)){var g=r.meta,_=g.condition,m=g.arg,u=g.requestId;if(_&&m.subscribe){var h=e[a=m.queryCacheKey]??(e[a]={});return h[u]=m.subscriptionOptions??h[u]??{},!0}}return!1};return function(e,s){if(a||=JSON.parse(JSON.stringify(r.currentSubscriptions)),t.util.resetApiState.match(e))return a=r.currentSubscriptions={},[!0,!1];if(t.internalActions.internal_probeSubscription.match(e)){var c=e.payload,l=c.queryCacheKey,d=c.requestId;return[!1,!!r.currentSubscriptions[l]?.[d]]}if(u(r.currentSubscriptions,e)){o||=(Gn(function(){var e=JSON.parse(JSON.stringify(r.currentSubscriptions)),n=De(a,function(){return e})[1];s.next(t.internalActions.subscriptionsUpdated(n)),a=e,o=!1}),!0);var f=!!e.type?.startsWith(i),p=n.rejected.match(e)&&e.meta.condition&&!!e.meta.arg.subscribe;return[!f&&!p,!1]}return[!0,!1]}};function qn(e){var t=e.reducerPath,n=e.queryThunk,r=e.api,i=e.context,a=i.apiUid,o={invalidateTags:U(t+`/invalidateTags`)},s=function(e){return!!e&&typeof e.type==`string`&&e.type.startsWith(t+`/`)},c=[Un,In,Ln,Rn,Vn,Hn];return{middleware:function(n){var o=!1,u=q(K({},e),{internalState:{currentSubscriptions:{}},refetchQuery:l}),d=c.map(function(e){return e(u)}),f=Kn(u),p=zn(u);return function(e){return function(c){o||(o=!0,n.dispatch(r.internalActions.middlewareRegistered(a)));var l=q(K({},n),{next:e}),u=n.getState(),m=f(c,l,u),h=m[0],g=m[1],_=h?e(c):g;if(n.getState()[t]&&(p(c,l,u),s(c)||i.hasRehydrationInfo(c)))for(var v=0,y=d;v<y.length;v++){var b=y[v];b(c,l,u)}return _}}},actions:o};function l(e,t,r){return r===void 0&&(r={}),n(K({type:`query`,endpointName:e.endpointName,originalArgs:e.originalArgs,subscribe:!1,forceRefetch:!0,queryCacheKey:t},r))}}function Z(e){var t=[...arguments].slice(1);Object.assign.apply(Object,Nt([e],t))}var Jn=Symbol(),Yn=function(){return{name:Jn,init:function(e,t,n){var r=t.baseQuery;t.tagTypes;var i=t.reducerPath,a=t.serializeQueryArgs,o=t.keepUnusedDataFor,s=t.refetchOnMountOrArgChange,c=t.refetchOnFocus,l=t.refetchOnReconnect;R();var u=function(e){return e};Object.assign(e,{reducerPath:i,endpoints:{},internalActions:{onOnline:cn,onOffline:ln,onFocus:on,onFocusLost:sn},util:{}});var d=bn({baseQuery:r,reducerPath:i,context:n,api:e,serializeQueryArgs:a,assertTagType:u}),f=d.queryThunk,p=d.mutationThunk,m=d.patchQueryData,h=d.updateQueryData,g=d.upsertQueryData,_=d.prefetch,v=d.buildMatchThunkActions,y=En({context:n,queryThunk:f,mutationThunk:p,reducerPath:i,assertTagType:u,config:{refetchOnFocus:c,refetchOnReconnect:l,refetchOnMountOrArgChange:s,keepUnusedDataFor:o,reducerPath:i}}),b=y.reducer,x=y.actions;Z(e.util,{patchQueryData:m,updateQueryData:h,upsertQueryData:g,prefetch:_,resetApiState:x.resetApiState}),Z(e.internalActions,x);var S=qn({reducerPath:i,context:n,queryThunk:f,mutationThunk:p,api:e,assertTagType:u}),C=S.middleware,w=S.actions;Z(e.util,w),Z(e,{reducer:b,middleware:C});var T=An({serializeQueryArgs:a,reducerPath:i}),E=T.buildQuerySelector,D=T.buildMutationSelector,O=T.selectInvalidatedBy;Z(e.util,{selectInvalidatedBy:O});var k=vn({queryThunk:f,mutationThunk:p,api:e,serializeQueryArgs:a,context:n}),A=k.buildInitiateQuery,j=k.buildInitiateMutation,M=k.getRunningMutationThunk,N=k.getRunningMutationsThunk,P=k.getRunningQueriesThunk,ee=k.getRunningQueryThunk,te=k.getRunningOperationPromises,ne=k.removalWarning;return Z(e.util,{getRunningOperationPromises:te,getRunningOperationPromise:ne,getRunningMutationThunk:M,getRunningMutationsThunk:N,getRunningQueryThunk:ee,getRunningQueriesThunk:P}),{name:Jn,injectEndpoint:function(t,n){var r,i=e;(r=i.endpoints)[t]??(r[t]={}),un(n)?Z(i.endpoints[t],{name:t,select:E(t,n),initiate:A(t,n)},v(f,t)):dn(n)&&Z(i.endpoints[t],{name:t,select:D(),initiate:j(t)},v(p,t))}}}}},Q=t.createContext(null);function Xn(e){e()}var Zn=Xn,Qn=function(e){return Zn=e},$n=function(){return Zn};function er(){var e=$n(),t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e(function(){for(var e=t;e;)e.callback(),e=e.next})},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,i=n={callback:e,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!r||t===null||(r=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var tr={notify:function(){},get:function(){return[]}};function nr(e,t){var n,r=tr;function i(e){return c(),r.subscribe(e)}function a(){r.notify()}function o(){u.onStateChange&&u.onStateChange()}function s(){return!!n}function c(){n||(n=t?t.addNestedSub(o):e.subscribe(o),r=er())}function l(){n&&(n(),n=void 0,r.clear(),r=tr)}var u={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:o,isSubscribed:s,trySubscribe:c,tryUnsubscribe:l,getListeners:function(){return r}};return u}var rr=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?o:a,ir=e((e=>{var t=typeof Symbol==`function`&&Symbol.for,n=t?Symbol.for(`react.element`):60103,r=t?Symbol.for(`react.portal`):60106,i=t?Symbol.for(`react.fragment`):60107,a=t?Symbol.for(`react.strict_mode`):60108,o=t?Symbol.for(`react.profiler`):60114,s=t?Symbol.for(`react.provider`):60109,c=t?Symbol.for(`react.context`):60110,l=t?Symbol.for(`react.async_mode`):60111,u=t?Symbol.for(`react.concurrent_mode`):60111,d=t?Symbol.for(`react.forward_ref`):60112,f=t?Symbol.for(`react.suspense`):60113,p=t?Symbol.for(`react.suspense_list`):60120,m=t?Symbol.for(`react.memo`):60115,h=t?Symbol.for(`react.lazy`):60116,g=t?Symbol.for(`react.block`):60121,_=t?Symbol.for(`react.fundamental`):60117,v=t?Symbol.for(`react.responder`):60118,y=t?Symbol.for(`react.scope`):60119;function b(e){if(typeof e==`object`&&e){var t=e.$$typeof;switch(t){case n:switch(e=e.type,e){case l:case u:case i:case o:case a:case f:return e;default:switch(e&&=e.$$typeof,e){case c:case d:case h:case m:case s:return e;default:return t}}case r:return t}}}function x(e){return b(e)===u}e.AsyncMode=l,e.ConcurrentMode=u,e.ContextConsumer=c,e.ContextProvider=s,e.Element=n,e.ForwardRef=d,e.Fragment=i,e.Lazy=h,e.Memo=m,e.Portal=r,e.Profiler=o,e.StrictMode=a,e.Suspense=f,e.isAsyncMode=function(e){return x(e)||b(e)===l},e.isConcurrentMode=x,e.isContextConsumer=function(e){return b(e)===c},e.isContextProvider=function(e){return b(e)===s},e.isElement=function(e){return typeof e==`object`&&!!e&&e.$$typeof===n},e.isForwardRef=function(e){return b(e)===d},e.isFragment=function(e){return b(e)===i},e.isLazy=function(e){return b(e)===h},e.isMemo=function(e){return b(e)===m},e.isPortal=function(e){return b(e)===r},e.isProfiler=function(e){return b(e)===o},e.isStrictMode=function(e){return b(e)===a},e.isSuspense=function(e){return b(e)===f},e.isValidElementType=function(e){return typeof e==`string`||typeof e==`function`||e===i||e===u||e===o||e===a||e===f||e===p||typeof e==`object`&&!!e&&(e.$$typeof===h||e.$$typeof===m||e.$$typeof===s||e.$$typeof===c||e.$$typeof===d||e.$$typeof===_||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=b})),ar=e(((e,t)=>{t.exports=ir()})),or=e(((e,t)=>{var n=ar(),r={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},i={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[n.ForwardRef]=a,s[n.Memo]=o;function c(e){return n.isMemo(e)?o:s[e.$$typeof]||r}var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;function h(e,t,n){if(typeof t!=`string`){if(m){var r=p(t);r&&r!==m&&h(e,r,n)}var a=u(t);d&&(a=a.concat(d(t)));for(var o=c(e),s=c(t),g=0;g<a.length;++g){var _=a[g];if(!i[_]&&!(n&&n[_])&&!(s&&s[_])&&!(o&&o[_])){var v=f(t,_);try{l(e,_,v)}catch{}}}}return e}t.exports=h})),sr=e((e=>{if(typeof Symbol==`function`&&Symbol.for){var t=Symbol.for;t(`react.element`),t(`react.portal`),t(`react.fragment`),t(`react.strict_mode`),t(`react.profiler`),t(`react.provider`),t(`react.context`),t(`react.forward_ref`),t(`react.suspense`),t(`react.suspense_list`),t(`react.memo`),t(`react.lazy`),t(`react.block`),t(`react.server.block`),t(`react.fundamental`),t(`react.debug_trace_mode`),t(`react.legacy_hidden`)}})),cr=e(((e,t)=>{t.exports=sr()}));or(),cr();function lr(e,t){return e===t?e!==0||t!==0||1/e==1/t:e!==e&&t!==t}function ur(e,t){if(lr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var i=0;i<n.length;i++)if(!Object.prototype.hasOwnProperty.call(t,n[i])||!lr(e[n[i]],t[n[i]]))return!1;return!0}function dr(){return r(Q)}function fr(e){e===void 0&&(e=Q);var t=e===Q?dr:function(){return r(e)};return function(){return t().store}}var pr=fr();function mr(e){e===void 0&&(e=Q);var t=e===Q?pr:fr(e);return function(){return t().dispatch}}var hr=mr(),gr=function(e,t){return e===t};function _r(e,t,n,r){var i=c(function(e){return e+1},0)[1],a=s(function(){return nr(n,r)},[n,r]),o=l(),u=l(),d=l(),f=l(),p=n.getState(),m;try{if(e!==u.current||p!==d.current||o.current){var h=e(p);m=f.current===void 0||!t(h,f.current)?h:f.current}else m=f.current}catch(e){throw o.current&&(e.message+=`
|
|
4
|
+
The error may be correlated with this previous error:
|
|
5
|
+
`+o.current.stack+`
|
|
6
|
+
|
|
7
|
+
`),e}return rr(function(){u.current=e,d.current=p,f.current=m,o.current=void 0}),rr(function(){function e(){try{var e=n.getState();if(e===d.current)return;var r=u.current(e);if(t(r,f.current))return;f.current=r,d.current=e}catch(e){o.current=e}i()}return a.onStateChange=e,a.trySubscribe(),e(),function(){return a.tryUnsubscribe()}},[n,a]),m}function vr(e){e===void 0&&(e=Q);var t=e===Q?dr:function(){return r(e)};return function(e,n){n===void 0&&(n=gr);var r=t(),a=r.store,o=r.subscription,s=_r(e,n,a,o);return i(s),s}}var yr=vr();Qn(d);var br=function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e},xr=Object.defineProperty,Sr=Object.defineProperties,Cr=Object.getOwnPropertyDescriptors,wr=Object.getOwnPropertySymbols,Tr=Object.prototype.hasOwnProperty,Er=Object.prototype.propertyIsEnumerable,Dr=function(e,t,n){return t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},$=function(e,t){for(var n in t||={})Tr.call(t,n)&&Dr(e,n,t[n]);if(wr)for(var r=0,i=wr(t);r<i.length;r++){var n=i[r];Er.call(t,n)&&Dr(e,n,t[n])}return e},Or=function(e,t){return Sr(e,Cr(t))};function kr(e,t,n,r){var i=s(function(){return{queryArgs:e,serialized:typeof e==`object`?t({queryArgs:e,endpointDefinition:n,endpointName:r}):e}},[e,t,n,r]),o=l(i);return a(function(){o.current.serialized!==i.serialized&&(o.current=i)},[i]),o.current.serialized===i.serialized?o.current.queryArgs:e}var Ar=Symbol();function jr(e){var t=l(e);return a(function(){ur(t.current,e)||(t.current=e)},[e]),ur(t.current,e)?t.current:e}var Mr=WeakMap?new WeakMap:void 0,Nr=function(e){var t=e.endpointName,n=e.queryArgs,r=``,i=Mr?.get(n);if(typeof i==`string`)r=i;else{var a=JSON.stringify(n,function(e,t){return H(t)?Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{}):t});H(n)&&Mr?.set(n,a),r=a}return t+`(`+r+`)`},Pr=typeof window<`u`&&window.document&&window.document.createElement?o:a,Fr=function(e){return e},Ir=function(e){return e.isUninitialized?Or($({},e),{isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:J.pending}):e};function Lr(e){var t=e.api,r=e.moduleOptions,o=r.batch,c=r.useDispatch,d=r.useSelector,f=r.useStore,p=r.unstable__sideEffectsInRender,m=e.serializeQueryArgs,h=e.context,g=p?function(e){return e()}:a;return{buildQueryHooks:y,buildMutationHook:b,usePrefetch:v};function _(e,t,n){if(t?.endpointName&&e.isUninitialized){var r=t.endpointName,i=h.endpointDefinitions[r];m({queryArgs:t.originalArgs,endpointDefinition:i,endpointName:r})===m({queryArgs:n,endpointDefinition:i,endpointName:r})&&(t=void 0)}var a=e.isSuccess?e.data:t?.data;a===void 0&&(a=e.data);var o=a!==void 0,s=e.isLoading,c=!o&&s,l=e.isSuccess||s&&o;return Or($({},e),{data:a,currentData:e.data,isFetching:s,isLoading:c,isSuccess:l})}function v(e,r){var i=c(),a=jr(r);return n(function(n,r){return i(t.util.prefetch(e,n,$($({},a),r)))},[e,i,a])}function y(e){var r=function(n,r){var i=r===void 0?{}:r,o=i.refetchOnReconnect,u=i.refetchOnFocus,d=i.refetchOnMountOrArgChange,f=i.skip,p=f===void 0?!1:f,m=i.pollingInterval,_=m===void 0?0:m,v=t.endpoints[e].initiate,y=c(),b=kr(p?X:n,Nr,h.endpointDefinitions[e],e),x=jr({refetchOnReconnect:o,refetchOnFocus:u,pollingInterval:_}),S=l(!1),C=l(),w=C.current||{},T=w.queryCacheKey,E=w.requestId,D=!1;T&&E&&(D=!!y(t.internalActions.internal_probeSubscription({queryCacheKey:T,requestId:E})));var O=!D&&S.current;return g(function(){S.current=D}),g(function(){O&&(C.current=void 0)},[O]),g(function(){var e=C.current;if(b===X){e?.unsubscribe(),C.current=void 0;return}var t=C.current?.subscriptionOptions;!e||e.arg!==b?(e?.unsubscribe(),C.current=y(v(b,{subscriptionOptions:x,forceRefetch:d}))):x!==t&&e.updateSubscriptionOptions(x)},[y,v,d,b,x,O]),a(function(){return function(){var e;(e=C.current)==null||e.unsubscribe(),C.current=void 0}},[]),s(function(){return{refetch:function(){if(!C.current)throw Error(`Cannot refetch a query that has not been started yet.`);return C.current?.refetch()}}},[])},p=function(r){var i=r===void 0?{}:r,d=i.refetchOnReconnect,f=i.refetchOnFocus,p=i.pollingInterval,m=p===void 0?0:p,h=t.endpoints[e].initiate,_=c(),v=u(Ar),y=v[0],b=v[1],x=l(),S=jr({refetchOnReconnect:d,refetchOnFocus:f,pollingInterval:m});g(function(){var e;S!==x.current?.subscriptionOptions&&((e=x.current)==null||e.updateSubscriptionOptions(S))},[S]);var C=l(S);g(function(){C.current=S},[S]);var w=n(function(e,t){t===void 0&&(t=!1);var n;return o(function(){var r;(r=x.current)==null||r.unsubscribe(),x.current=n=_(h(e,{subscriptionOptions:C.current,forceRefetch:!t})),b(e)}),n},[_,h]);return a(function(){return function(){var e;(e=x?.current)==null||e.unsubscribe()}},[]),a(function(){y!==Ar&&!x.current&&w(y,!0)},[y,w]),s(function(){return[w,y]},[w,y])},v=function(n,r){var i=r===void 0?{}:r,a=i.skip,o=a===void 0?!1:a,c=i.selectFromResult,u=t.endpoints[e].select,p=kr(o?X:n,m,h.endpointDefinitions[e],e),g=l(),v=s(function(){return He([u(p),function(e,t){return t},function(e){return p}],_)},[u,p]),y=s(function(){return c?He([v],c):v},[v,c]),b=d(function(e){return y(e,g.current)},ur),x=v(f().getState(),g.current);return Pr(function(){g.current=x},[x]),b};return{useQueryState:v,useQuerySubscription:r,useLazyQuerySubscription:p,useLazyQuery:function(e){var t=p(e),n=t[0],r=t[1],i=v(r,Or($({},e),{skip:r===Ar})),a=s(function(){return{lastArg:r}},[r]);return s(function(){return[n,i,a]},[n,i,a])},useQuery:function(e,t){var n=r(e,t),a=v(e,$({selectFromResult:e===X||t?.skip?void 0:Ir},t)),o=a.data,c=a.status,l=a.isLoading,u=a.isSuccess,d=a.isError,f=a.error;return i({data:o,status:c,isLoading:l,isSuccess:u,isError:d,error:f}),s(function(){return $($({},a),n)},[a,n])}}}function b(e){return function(r){var l=r===void 0?{}:r,f=l.selectFromResult,p=f===void 0?Fr:f,m=l.fixedCacheKey,h=t.endpoints[e],g=h.select,_=h.initiate,v=c(),y=u(),b=y[0],x=y[1];a(function(){return function(){b?.arg.fixedCacheKey||b?.reset()}},[b]);var S=n(function(e){var t=v(_(e,{fixedCacheKey:m}));return x(t),t},[v,_,m]),C=(b||{}).requestId,w=d(s(function(){return He([g({fixedCacheKey:m,requestId:b?.requestId})],p)},[g,b,p,m]),ur),T=m==null?b?.arg.originalArgs:void 0,E=n(function(){o(function(){b&&x(void 0),m&&v(t.internalActions.removeMutationResult({requestId:C,fixedCacheKey:m}))})},[v,m,b,C]),D=w.endpointName,O=w.data,k=w.status,A=w.isLoading,j=w.isSuccess,M=w.isError,N=w.error;i({endpointName:D,data:O,status:k,isLoading:A,isSuccess:j,isError:M,error:N});var P=s(function(){return Or($({},w),{originalArgs:T,reset:E})},[w,T,E]);return s(function(){return[S,P]},[S,P])}}}var Rr;(function(e){e.query=`query`,e.mutation=`mutation`})(Rr||={});function zr(e){return e.type===Rr.query}function Br(e){return e.type===Rr.mutation}function Vr(e){return e.replace(e[0],e[0].toUpperCase())}function Hr(e){var t=[...arguments].slice(1);Object.assign.apply(Object,br([e],t))}var Ur=Symbol(),Wr=Nn(Yn(),function(e){var t=e===void 0?{}:e,n=t.batch,r=n===void 0?d:n,i=t.useDispatch,a=i===void 0?hr:i,o=t.useSelector,s=o===void 0?yr:o,c=t.useStore,l=c===void 0?pr:c,u=t.unstable__sideEffectsInRender,f=u===void 0?!1:u;return{name:Ur,init:function(e,t,n){var i=t.serializeQueryArgs,o=e,c=Lr({api:e,moduleOptions:{batch:r,useDispatch:a,useSelector:s,useStore:l,unstable__sideEffectsInRender:f},serializeQueryArgs:i,context:n}),u=c.buildQueryHooks,d=c.buildMutationHook,p=c.usePrefetch;return Hr(o,{usePrefetch:p}),Hr(n,{batch:r}),{injectEndpoint:function(t,n){if(zr(n)){var r=u(t),i=r.useQuery,a=r.useLazyQuery,s=r.useLazyQuerySubscription,c=r.useQueryState,l=r.useQuerySubscription;Hr(o.endpoints[t],{useQuery:i,useLazyQuery:a,useLazyQuerySubscription:s,useQueryState:c,useQuerySubscription:l}),e[`use`+Vr(t)+`Query`]=i,e[`useLazy`+Vr(t)+`Query`]=a}else if(Br(n)){var f=d(t);Hr(o.endpoints[t],{useMutation:f}),e[`use`+Vr(t)+`Mutation`]=f}}}}}}());export{W as a,pt as i,pr as n,rn as r,Wr as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{n as e}from"./104e77cb.js";var t=class e{_inner;_isDisposed=!1;constructor(e=[]){this._inner=e}addDisposable(t){return this._inner.push(t),t instanceof e&&t.addDispose(()=>{this.removeDisposable(t)}),t}addDispose(e){this.addDisposable({dispose:e})}removeDisposable(e){let t=this._inner.indexOf(e);t>=0&&this._inner.splice(t,1)}isDisposed(){return this._isDisposed}dispose(){if(!this._isDisposed){this._isDisposed=!0;for(let e of[...this._inner])e.dispose()}}};function n(e){return`service_container_${e}`}var r=class e extends t{_parent;_injectCallbacks=[];_injections=Object.create(null);_runCallbacks(e){this._injectCallbacks.forEach(t=>t(e))}constructor(e=null){super(),this._parent=e,e&&this.addDisposable(e.onInject(e=>this._runCallbacks(e)))}onInject=e=>(this._injectCallbacks.push(e),{dispose:()=>{let t=this._injectCallbacks.indexOf(e);t>=0&&this._injectCallbacks.splice(t,1)}});inject(e,t){this._injections[e]=()=>t,this._runCallbacks(e)}injectFactory(e,t,n){let r=this._injections[e],i=typeof r==`function`?r():r,a=this._injections[e]=()=>(i=t(this,i),i);n&&a(),this._runCallbacks(e)}_find(e,t=!0){return this._injections[e]||t&&this._parent?._find(e)}_onInject(e,n,r=new t){return r.addDisposable(this.onInject(t=>{e===t&&(r.dispose(),n(this.getInstance(t)))})),this._parent&&r.addDisposable(this._parent._onInject(e,n,r)),this.addDisposable(r),r}getInstance(e,t=!0){let n=this._find(e,t);if(typeof n==`function`)return n()}getOrCreateInstance(e,t){let n=this._find(e);if(typeof n==`function`)return n();let r=t(this);return this.inject(e,r),r}getInstanceAsync(e){let t=this._find(e);return typeof t==`function`?Promise.resolve(t()):new Promise(t=>this._onInject(e,()=>t(this.getInstance(e))))}addService(e,r){let i=n(e);this.injectFactory(i,(e,t=[])=>t.indexOf(r)<0?[...t,r]:t);let a=new t;return a.addDispose(()=>{this.injectFactory(i,(e,t=[])=>t.filter(e=>e!==r))}),a}addServiceFactory(e,r,i){let a=n(e),o;this.injectFactory(a,(e,t=[])=>(o=r(e,o),o===void 0?t:t.indexOf(o)<0?[...t,o]:t),i);let s=new t;return s.addDispose(()=>{this.injectFactory(a,(e,t=[])=>o===void 0?t:t.filter(e=>e!==o))}),s}getServices(e){let t=n(e);return[...this.getInstance(t,!1)||[],...this._parent?.getServices(e)||[]]}createChild(){return new e(this)}getOrCreateIsolatedContainer(t){return this.getOrCreateInstance(t,()=>{let n=this._parent?.getOrCreateIsolatedContainer(t);return new e(n)})}dispose(){this._injections=Object.create(null)}};function i(e){return e.startsWith(`__`)?e:`__${e}__`}function a(e){if(typeof globalThis>`u`)throw Error(`[di] globalThis is required for namespace container access.`);let t=i(e),n=globalThis;return n[t]??={}}function o(e){return typeof e==`object`&&!!e&&typeof e.inject==`function`&&typeof e.getInstance==`function`}function s(e){return i(e||`useblocks`)}function c(e){let t=a(s(e));if(o(t.container))return t.container;let n=new r(null);return t.container=n,n}function l(e){return c(e)}function u(){let e=new Date().getTime(),t=typeof performance<`u`&&performance.now&&performance.now()*1e3||0;return`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(n){let r=Math.random()*16;return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),(n===`x`?r:r&3|8).toString(16)})}function d(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():u()}function f(e=d()){return e}function p(){return`esm`}function m(e){if(typeof globalThis>`u`)return;let t=p(),n=globalThis[e]??{};globalThis[e]=n;let r=n.__diagnostics??={},i=r.diModuleEval??={evalCount:0,records:[],duplicateWarned:!1};i.records.push({buildSource:t,timestamp:Date.now(),stack:Error().stack}),i.evalCount+=1,!(i.evalCount<=1||i.duplicateWarned)&&(i.duplicateWarned=!0,i.evalCount,i.records)}function h(){return`__useblocks__`}function g(e,t){if(m(t),typeof globalThis>`u`)return e;let n=p(),r=globalThis,i=r[t]=r[t]||{},a=i.__diagnostics=i.__diagnostics||{},o=a.dependencyResolver=a.dependencyResolver||{entries:[],warnings:[]},s={container:e,source:`packages/runtime-core/di/index.ts`,buildSource:n,timestamp:Date.now(),stack:Error().stack};if(o.entries.push(s),o.entries.length>1){let e=o.entries[0];if(o.entries.some(t=>t.container!==e.container)&&!o.duplicateWarningShown){o.duplicateWarningShown=!0;let e={message:`[di] Multiple DependencyResolver instances detected on namespace`,namespaceKey:t,buildSource:n,entries:o.entries};o.warnings.push(e)}}return e}var _;function v(){if(_)return _;let e=h();return _=g(c(e),e),_}var y=new Proxy({},{get(e,t,n){let r=v(),i=Reflect.get(r,t,n);return typeof i==`function`?i.bind(r):i}}),b=class e extends Error{code;httpStatus;details;constructor(t,n,r,i){super(t),this.name=`FileManagerApiError`,this.code=n,this.httpStatus=r,this.details=i;let a=Error.captureStackTrace;a&&a(this,e)}};function x(e,t=`BackendError`){switch(e){case 400:return`ValidationError`;case 401:return`AuthenticationFailed`;case 403:return`AuthorizationFailed`;case 404:return`FileNotFound`;case 413:return`PayloadTooLarge`;case 415:return`UnsupportedMediaType`;case 429:return`RateLimitExceeded`;case 500:return`BackendError`;case 503:return`ServiceUnavailable`;case 504:return`Timeout`;default:return t}}var S=class{_plugins=new Map;_listeners=new Map;_getOrCreateEntry(e){let t=this._plugins.get(e);return t||(t={overrides:[]},this._plugins.set(e,t)),t}_applyOverrides(e,t){let n=this._plugins.get(e);if(n?.overrides)for(let e of n.overrides)t=e(t)||t;return t}_notifyListeners(e,t){let n=this._listeners.get(e);if(!n||n.length===0)return;for(let e of n)try{e.callback(t)}catch{}let r=n.filter(e=>!e.once);r.length>0?this._listeners.set(e,r):this._listeners.delete(e)}get(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor)}async getAsync(e){let t=this._plugins.get(e);if(t?.ctor)return this._applyOverrides(e,t.ctor);if(t?.loading){let n=await t.loading;return this._applyOverrides(e,n)}if(t?.factory){let n=Promise.resolve(t.factory()).then(n=>(t.ctor=n,t.loading=void 0,this._notifyListeners(e,n),n));t.loading=n;let r=await n;return this._applyOverrides(e,r)}return new Promise(t=>{this.on(e,n=>t(this._applyOverrides(e,n)))})}add(e,t){let n=this._getOrCreateEntry(e);n.ctor=t,this._notifyListeners(e,t)}addAll(e){for(let t of Object.keys(e)){let n=e[t];n!==void 0&&this.add(t,n)}}addAsync(e,t){let n=this._getOrCreateEntry(e);return n.factory=t,{dispose:()=>{n.ctor||(n.factory=void 0)}}}has(e){let t=this._plugins.get(e);return!!(t?.ctor||t?.factory)}isLoaded(e){return!!this._plugins.get(e)?.ctor}override(e,t){let n=this._getOrCreateEntry(e);return n.overrides.push(t),{dispose:()=>{let e=n.overrides.indexOf(t);e>=0&&n.overrides.splice(e,1)}}}on(e,t){let n=this.get(e);n&&t(n);let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!1};return r.push(i),{dispose:()=>this._removeListener(e,t)}}once(e,t){let n=this.get(e);if(n)return t(n),{dispose:()=>{}};let r=this._listeners.get(e);r||(r=[],this._listeners.set(e,r));let i={callback:t,once:!0};return r.push(i),{dispose:()=>this._removeListener(e,t)}}off(e,t){this._removeListener(e,t)}_removeListener(e,t){let n=this._listeners.get(e);if(n){let r=n.findIndex(e=>e.callback===t);r>=0&&n.splice(r,1),n.length===0&&this._listeners.delete(e)}}keys(){return Array.from(this._plugins.keys())}forContext(){let e=this;return{add(t,n){e.add(t,n)}}}},C=class{resolveRegistry;constructor(e){this.resolveRegistry=e}target(){return this.resolveRegistry()}get(e){return this.target().get(e)}getAsync(e){return this.target().getAsync(e)}add(e,t){return this.target().add(e,t)}addAll(e){return this.target().addAll(e)}addAsync(e,t){return this.target().addAsync(e,t)}has(e){return this.target().has(e)}isLoaded(e){return this.target().isLoaded(e)}override(e,t){return this.target().override(e,t)}on(e,t){return this.target().on(e,t)}once(e,t){return this.target().once(e,t)}off(e,t){return this.target().off(e,t)}keys(){return this.target().keys()}forContext(){return this.target().forContext()}},w=`PluginRegistry`;function T(e=l()){return e.getOrCreateInstance(w,()=>new S)}var E=new C(()=>T());function D(e){return e}function O(e){return f(e)}O(`HANDLE_ATOM_INSERT`),O(`SETTINGS_PANEL_EVENT`),O(`MODAL_SHOW_EVENT`),O(`MODAL_CLOSE_EVENT`),O(`MODAL_UPDATE_EVENT`);var k=f(`client`),A=e({FileManagerApiError:()=>b}),j=e({mapHttpStatusToErrorCode:()=>x});export{E as a,d as c,t as d,D as i,r as l,A as n,y as o,k as r,f as s,j as t,n as u};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
5
|
<title>Two-step flow: design → subject/preheader (headless)</title>
|
|
6
|
-
<script id="plugin-script" type="text/javascript" src="useblocks.js?
|
|
6
|
+
<script id="plugin-script" type="text/javascript" src="useblocks.js?4d06f79d"></script>
|
|
7
7
|
<style>
|
|
8
8
|
body {
|
|
9
9
|
margin: 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__useblocks__.define(`core`,[`require`,`exports`,`module`,`static/core/4dc58c63.js`,`static/core/ae8e0b50.js`,`static/core/9cff1281.js`,`static/core/4563fc0f.js`],function(e,t,n){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),e("./static/core/4dc58c63.js");let r=e("./static/core/ae8e0b50.js"),i=e("./static/core/4563fc0f.js"),a=e("./static/core/9cff1281.js");function o(e){return async()=>(await e.app.app_init_create({})).data}function s(e,t,n){e.inject(r.ro,void 0);let i;e.injectFactory(r.ro,async(e,r)=>i||(i=(async()=>{let e=r?await r:void 0;return t({baseUrl:n.baseUrl,user:n.user,project:n.project,prevApp:e})})(),i),!0)}var c=a.A(e=>{let t,n,i,a,c,l=!1;function u(e){return String(e||``).trim()||void 0}return{setOptions(d){let f=!!e.getInstance(r.do),p=d.hasOwnProperty(`baseUrl`)?u(d.baseUrl):n,m=p?r.Wa(p):void 0;if(d.hasOwnProperty(`baseUrl`)){let n=e.getInstance(r.Ha);t!==m&&n?.setOptions(m?{baseUrl:m}:{})}let h=i!==d.appInit,g=!r.za(a,d.user),_=c!==d.project,v=t!==m;if(i=d.appInit,a=d.user,c=d.project,t=m,n=p,f||l&&!h&&!g&&!_&&!v)return;let y=e.getInstance(r.eo);s(e,i||o(y),{baseUrl:n,user:d.user,project:d.project}),l=!0}}}),l=r.Ro(),u=r.Ro(),d=a.A(e=>({setOptions(t){let n=i.Nn();e.addService(r.Va,{execute:n.decorate(async n=>{if(!t.jwtAuth)return;let i=e.getInstance(l);if(!e.getInstance(u)){if(!i)try{let n=e.getInstance(r.Ha)?.getOptions()?.baseUrl||``,a=await fetch(`${n}/jwt-auth/token`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t.jwtAuth)});if(!a.ok)throw Error(`JWT auth failed: ${a.status}`);i=(await a.json()).token,e.inject(l,i)}catch{throw e.inject(u,r.ra),Error(r.ra)}i&&n.headers.append(`authorization`,`Bearer ${i}`)}})})}})),f=a.A(e=>{let t,n,a;return{async setOptions(o){let s=a!==o.getAuthToken,c=!r.za(t,o.user),l=n!==o.project;if(a=o.getAuthToken,t=o.user,n=o.project,!(!e.getInstance(r.do)||!o.getAuthToken)&&!(!s&&!c&&!l))try{let t=await o.getAuthToken(o.user,o.project);e.inject(r.fo,Promise.resolve(t||``));let n=i.B(t);if(!n)return;e.inject(r.po,n);let a=e.getInstance(r.ro),s=a?await a.catch(()=>void 0):void 0;e.inject(r.ro,Promise.resolve(i.z(n,s)))}catch{}}}}),p=a.A(e=>{let t=e.getInstance(r.oo),n=new r.Mo,a=i.R(n.event);t.addDispose(()=>{let t=e.getInstance(r.co);n.fire(t)});let o=t.addDisposable(new i.L(a));return t.addDisposable(n),{setOptions({handleDestroy:e}){o.setListener(e)},instance:{handleDestroy:a,destroy:()=>{if(!t.isDisposed())try{t.dispose()}catch{}}}}}),m=a.A(e=>{let t=e.getInstance(r.oo),n=new i.P;e.inject(r.so,n);let a;return t.addDispose(()=>{n.abort()}),{setOptions(e){e.signal!==void 0&&(a=e.signal),n.configure({replaceSession:!0,...e.timeouts===void 0?{}:{timeouts:e.timeouts},...a===void 0?{}:{signal:a}})},dispose(){}}}),h=a.A(e=>{let t=e.getInstance(r.oo),n=i.R(r._o(e,r.io)),a=t.addDisposable(new i.L(n));return{setOptions({handleLoad:e}){a.setListener(e)},instance:{handleLoad:n},dispose:()=>t.dispose()}}),g=a.A(e=>{let t=e.getInstance(r.oo),n=t.addDisposable(new r.jo),a=t.addDisposable(new r.jo),o=r.go(e,r.ao),s=i.R(n.event),c=i.R(a.event),l=i.R(o.event),u=t.addDisposable(new i.L(s)),d=t.addDisposable(new i.L(c)),f=t.addDisposable(new i.L(l));return{instance:{handleSetOptions:s,handleOptionsChanged:c,handleConfigChanged:l},async setOptions(e){u.setListener(e.handleSetOptions),d.setListener(e.handleOptionsChanged),f.setListener(e.handleConfigChanged),await n.fire(e),await a.fire(e)},dispose(){}}}),_=1e4;function v(e,t,n,r={}){let i=Object.assign({},e);for(let[e,a]of Object.entries(t))if(a!==void 0)if(n.includes(e)&&typeof a==`object`&&a){let t=i[e],n=r[e]??{};i[e]=Object.assign({},typeof t==`object`&&t?t:n,a)}else i[e]=a;return i}var y={border:{all:null,top:null,right:null,bottom:null,left:null},borderRadius:{all:5,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},borderRadiusCards:{all:10,topLeft:null,topRight:null,bottomRight:null,bottomLeft:null},padding:{all:null,top:null,right:null,bottom:null,left:null}},b={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:16,fontSizeDim:`px`,lineHeight:21,lineHeightDim:`px`,color:`#5a5a5a`,contrastColor:`#FFFFFF`,textAlign:`left`,paddingBottom:10,paddingBottomDim:`px`},x={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:24,fontSizeDim:`px`,lineHeight:32,lineHeightDim:`px`,color:`#333333`,contrastColor:`#FFFFFF`,textAlign:`left`,paddingTop:20,paddingTopDim:`px`,paddingBottom:20,paddingBottomDim:`px`,letterSpacing:0,letterSpacingDim:`px`,bold:!0,italic:!1},S={color:`#1C52DC`,contrastColor:`#FFFFFF`,underline:!0},C={fontFamily:[`Safe Fonts`,`-apple-system, 'Segoe UI', 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif`],fontSize:16,fontSizeDim:`px`,letterSpacing:0,letterSpacingDim:`px`,color:`#FFFFFF`,contrastColor:`#1C52DC`,bold:!1,italic:!1,backgroundColor:`#1C52DC`,contrastBackgroundColor:`#FFFFFF`,marginTop:10,marginTopDim:`px`,marginBottom:10,marginBottomDim:`px`,border:y.border,borderRadius:y.borderRadius,textAlign:`center`,padding:y.padding},w={backgroundColor:`#FFFFFF`,contrastBackgroundColor:`#1C52DC`,padding:y.padding},T={contrastBackgroundColor:`#1C52DC`,contrastTextColor:`#FFFFFF`,baseBackgroundColor:`#F8F8F8`,baseTextColor:`#333333`,border:y.border,borderRadius:y.borderRadiusCards};function E(e){return{...b,...e}}function D(e){return{...x,...e,bold:e?.bold??x.bold,italic:e?.italic??x.italic}}function O(e){return{...S,...e,underline:e?.underline??S.underline}}function k(e){return{...C,...e,bold:e?.bold??C.bold,italic:e?.italic??C.italic,border:{...C.border,...e?.border??{}},borderRadius:{...C.borderRadius,...e?.borderRadius??{}},padding:{...C.padding,...e?.padding??{}}}}function A(e){return{...w,...e,padding:{...w.padding,...e?.padding??{}}}}function j(e){return{...T,...e,border:{...T.border,...e?.border??{}},borderRadius:{...T.borderRadius,...e?.borderRadius??{}}}}var M=class{_editor;_layoutSettingsChanged=new r.Mo;_contentStylesChanged=new r.Mo;_messageSubscription;_messageSubscriptionPromise;_prevLayoutSnapshot;_prevContentSnapshot;constructor(e){this._editor=e}onChangeEmailLayoutSettings(e){let t=this._layoutSettingsChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}onChangeEmailContentStyles(e){let t=this._contentStylesChanged.event(e);return this._ensureMessageSubscription(),{dispose:()=>{t.dispose(),this._disposeMessageSubscriptionIfUnused()}}}_disposeMessageSubscriptionIfUnused(){this._layoutSettingsChanged.hasListeners()||this._contentStylesChanged.hasListeners()||(this._messageSubscription?.dispose(),this._messageSubscription=void 0)}_mapLayoutSettings(e={}){return{backgroundColor:e.backgroundColor||``,backgroundImage:(e.backgroundImage||[]).map(e=>({type:`url`,value:e?.value||``})),backgroundPositionX:e.backgroundPositionX||``,backgroundPositionY:e.backgroundPositionY||``,backgroundRepeat:e.backgroundRepeat||``,backgroundSize:e.backgroundSize||``,backgroundColorContent:e.backgroundColorContent||``,textStrong:e.textStrong||!1,textItalic:e.textItalic||!1,textUnderline:e.textUnderline||!1,width:e.width,responsive:e.responsive}}_parseCommonStyles(e){let t={...r.La};try{e&&e!==`{}`&&(t=JSON.parse(e))}catch{}return t}_mapCommonStylesToContentStyles(e){return{text:E(e.text),headings:D(e.headings),links:O(e.links),buttons:k(e.buttons),block:A(e.block),cards:j(e.cards)}}_getCurrentLayoutSettings(e){return this._mapLayoutSettings(r.fr(e.getState()))}_getCurrentContentStyles(e){return this._mapCommonStylesToContentStyles(this._parseCommonStyles(r.cr(e.getState())?.common_styles))}_getLayoutSnapshot(e){return JSON.stringify(e)}_getContentSnapshot(e){return JSON.stringify(e)}async _ensureMessageSubscription(){if(!this._messageSubscription){if(this._messageSubscriptionPromise)return this._messageSubscriptionPromise;this._messageSubscriptionPromise=(async()=>{let e=await this._editor.container.getInstanceAsync(r.mo);if(this._messageSubscription)return;let t=this._editor.container.getOrCreateInstance(r.Co,()=>new r.ko),n=this._getCurrentLayoutSettings(e),i=this._getCurrentContentStyles(e);this._prevLayoutSnapshot=this._getLayoutSnapshot(n),this._prevContentSnapshot=this._getContentSnapshot(i),this._messageSubscription=t.addListener(e=>{let t=e?.data?.operation;if(t===r.aa.APPLICATION_EMAIL_SETTINGS_SET){let t=this._mapLayoutSettings(e.data?.settings),n=this._getLayoutSnapshot(t);n!==this._prevLayoutSnapshot&&(this._prevLayoutSnapshot=n,this._layoutSettingsChanged.fire(t));return}if(t!==r.aa.APPLICATION_COMMON_STYLES_UPDATE)return;let n=this._mapCommonStylesToContentStyles(e.data?.settings?.commonStyles??{...r.La}),i=this._getContentSnapshot(n);i!==this._prevContentSnapshot&&(this._prevContentSnapshot=i,this._contentStylesChanged.fire(n))})})();try{await this._messageSubscriptionPromise}finally{this._messageSubscriptionPromise=void 0}}}async getEmailLayoutSettings(){let e=await this._editor.container.getInstanceAsync(r.mo);return await this._waitForEmailSettingsFromIframe(e),this._getCurrentLayoutSettings(e)}async setEmailLayoutSettings(e){let t=await this._editor.container.getInstanceAsync(r.mo);await this._waitForEmailSettingsFromIframe(t);let n={...r.fr(t.getState()),...e};t.dispatch(r.Or(n));let i=this._mapLayoutSettings(n);this._prevLayoutSnapshot=this._getLayoutSnapshot(i),this._layoutSettingsChanged.fire(i)}async _waitForEmailSettingsFromIframe(e,t=_){let n=e.getState(),i=r.cr(n),a=r.fr(n);if(i?.is_inited&&a&&Object.keys(a).length>0&&(a.backgroundColor||a.backgroundImage?.[0]?.value||a.width?.value||a.responsive!==void 0)||i?.is_inited)return;let o=this._editor.container,s=r._o(o,r.ho.ON_EMAIL_INIT_ID);return new Promise(e=>{let n=!1,r,i=()=>{r&&=(clearTimeout(r),void 0)},a=s(()=>{n||(n=!0,i(),a.dispose(),e())});r=setTimeout(()=>{n||(n=!0,a.dispose(),e())},t)})}async getEmailContentStyles(){let e=await this._editor.container.getInstanceAsync(r.mo);return this._getCurrentContentStyles(e)}async setEmailContentStyles(e){let t=await this._editor.container.getInstanceAsync(r.mo),n=r.cr(t.getState());if(!n)return;let i=this._parseCommonStyles(n.common_styles);e.text!==void 0&&(i.text={...i.text||{},...e.text}),e.headings!==void 0&&(i.headings={...i.headings||{},...e.headings}),e.links!==void 0&&(i.links={...i.links||{},...e.links}),e.buttons!==void 0&&(i.buttons=v(i.buttons||{},e.buttons,[`border`,`borderRadius`,`padding`],{border:y.border,borderRadius:y.borderRadius,padding:y.padding})),e.block!==void 0&&(i.block=v(i.block||{},e.block,[`padding`],{padding:y.padding})),e.cards!==void 0&&(i.cards=v(i.cards||{},e.cards,[`border`,`borderRadius`],{border:y.border,borderRadius:y.borderRadiusCards})),t.dispatch(r.Sr({...n,common_styles:JSON.stringify(i)}));let a=this._mapCommonStylesToContentStyles(i);this._prevContentSnapshot=this._getContentSnapshot(a),this._contentStylesChanged.fire(a)}},N={...r.vo,EmailSettingsApi:M};({...r.vo});var P={...N};function F(){i.j.addAll(P)}var I=[m,p,h,g,d,f,a.E,c];async function L(){return(await Promise.resolve().then(()=>e("./static/core/7af8064f.js"))).default}var R=e=>{let t=null,n=!1;return{instance:{},async setOptions(i){if(!t&&!n){t=(await L())(e);let n=await e.getInstanceAsync(r.co);Object.assign(n,t.instance||{}),F()}t&&await t.setOptions(i)},dispose(){t?.dispose(),n=!0}}},z=a.k([...I,R]),B=class{_storage=Object.create(null);get(e){let t=this._storage[e];return t&&(!t.expires||t.expires<Date.now())?t.value:``}set(e,t,n){this._storage[e]={value:t,expires:n.expires?n.expires*1e3+Date.now():void 0}}remove(e){delete this._storage[e]}},V=100,H={events:[],container:null,collection:null};function U(e,t){H.container=e,H.collection=t,t.onLifecycle(e=>{H.events.push({...e,timestamp:Date.now()}),H.events.length>V&&(H.events=H.events.slice(-100))}),typeof window<`u`&&(window.__EMAILMAKER_DEVTOOLS__=W())}function W(){return{enabled:!0,plugins(){return H.collection?H.collection.getStatus().map(e=>({...e,hasInit:!0,hasDispose:!0,hasAfterInit:!0})):[]},registry(){if(!H.container)return[];try{return H.container.getInstance(i.M).keys().map(String)}catch{return[]}},events(e=50){return H.events.slice(-e)},clearEvents(){H.events=[]},getPlugin(e){if(H.collection)try{return H.collection.use(e)}catch{return}}}}var G=a.k([z]);async function K(e){i.In(e.signal);let t=new r.Ho;async function n(){let n=r.Lo.createChild();if(e.standaloneKey){n.inject(r.do,e.standaloneKey);let i=r._o(n,r.ho.FILE_PROXY_EVENT_ID);t.addDisposable(i(async({url:e})=>(await fetch(e)).blob(),Number.MIN_VALUE))}n.inject(r.oo,t),n.inject(r.$a,new B),r.Ga(n);let a=G(n),o={...a.instance,container:n,async reset(e){return i.In(e.signal),await a.setOptions(e),o}};n.inject(r.co,o);try{if(await a.setOptions(e),i.In(e.signal),e.devTools)try{let e=n.getInstance(r.uo);e&&U(n,e)}catch{}return i.In(e.signal),r.go(n,r.io).fire(o),o}catch(e){throw t.dispose(),e}}try{return await i.Fn(n(),e.signal)}catch(e){throw t.isDisposed()||t.dispose(),e}}async function q(e){let t=new Map;typeof e==`object`&&(e=e.code);let n=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-disabled`))t.remove();e.handleRender(async({contentDocument:e,managedNodeController:t})=>{await i.n(e,{mappedTags:{script:`___script`},commit:()=>t.commit()})})},[800]),r=await i.a(e,async e=>{await i.g(e.document,e=>i.m.getEscapedText(e)===e?i.y(e):e,t);for(let t of e.document.querySelectorAll(`.em-amp-show-only`))t.remove();await i.t(e.document,{mappedTags:{script:`___script`}})},[800]);return{code:e,html:r,ampHtml:n}}t.init=K,t.parseAMP=q,t.version=`1.1.18`});
|