티스토리 수익 글 보기
“use strict”;(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([[“4497”],{38692:function(e,t,n){n.d(t,{_:()=>g});var r=n(4006),l=n(31583),o=n(31386),i=n(32485),a=n.n(i);n(38221);var s=n(98188),c=n(17402);n(84605);var u=n(56909);n(86500);var d=n(68349);n(35369),n(97515);var p=n(76977);n(16993);var f=n(63136);n(11587);var m=n(90292),h=n(7777);let g=e=>{let{node:t,id:n}=e,[i,g]=(0,c.useState)(t.attrs.persistentExpression);return(0,c.useEffect)(()=>{g(t.attrs.persistentExpression)},[t]),(0,c.useEffect)(()=>{let e=e=>{let{detail:n}=e;n.node.attrs.id===t.attrs.id&&g(n.persistentExpression)};return(0,u.o)().addEventListener(“close”,e),()=>{(0,u.o)().removeEventListener(“close”,e)}},[]),(0,r.Y)(l.VR,{“data-drag-handle”:””,children:(0,r.Y)(m.q,{children:(0,r.Y)(“div”,{className:”latex-block”,id:n,children:(0,r.Y)(p.I1,{className:a()(h.A.latexWrapper,t.attrs.persistentExpression||(0,d.rr)()?h.A.emptyStateWrapper:null),radius:”md”,”data-attrs”:JSON.stringify({persistentExpression:i,id:t.attrs.id}),onClick:()=>{i!==t.attrs.persistentExpression&&g(t.attrs.persistentExpression),(0,u.o)().dispatchEvent(new CustomEvent(“open”,{detail:{persistentExpression:t.attrs.persistentExpression,node:t}}))},children:(0,r.FD)(p.Ye,{paddingY:8,paddingX:16,flex:”grow”,justifyContent:”center”,alignItems:”center”,children:[i||t.attrs.persistentExpression?(0,r.Y)(p.I1,{alignItems:”center”,justifyContent:”center”,children:(0,r.Y)(o.A,{typesettingOptions:{fn:”tex2chtml”,options:void 0},text:””.concat(i||t.attrs.persistentExpression),renderMode:”pre”,inline:!1,dynamic:!0})}):(0,r.Y)(p.I1,{alignSelf:”center”,children:(0,r.Y)(f.EY.Meta,{fontStyle:”italic”,translated:!0,color:”secondary”,children:”Edit & enter LaTeX expressions here”})}),(0,r.Y)(p.I1,{children:(0,r.Y)(“button”,{className:h.A.latexEdit,children:(0,r.Y)(s.A,{width:20,height:20})})})]})})})})})}},9472:function(e,t,n){n.d(t,{g:()=>l});var r=n(4006);let l=e=>(0,r.Y)(“div”,{className:”file-embed-wrapper-editor”,children:(0,r.Y)(“div”,{className:”file-embed-aligner”,children:(0,r.Y)(“div”,{className:”file-embed-container placeholder”,children:(0,r.Y)(o,{})})})}),o=()=>(0,r.FD)(“div”,{className:”embed-loader-container”,children:[(0,r.Y)(“div”,{className:”embed-loader”}),(0,r.Y)(“div”,{className:”embed-loader-text”,children:”Loading…”})]})},90827:function(e,t,n){n.d(t,{P:()=>u,X:()=>c});var r=n(4006),l=n(17402),o=n(35369),i=n(76977),a=n(63136),s=n(78962);let c=(0,l.forwardRef)((e,t)=>{let{onClick:n,children:l,disabled:i=!1,size:a=”md”}=e;return(0,r.Y)(o.mZ,{ref:t,rounded:!0,onClick:n,disabled:i,size:a,children:l})}),u=e=>{let{label:t,children:n}=e,[o,c]=(0,l.useState)(!1);return(0,r.FD)(i.Ye,{gap:8,justifyContent:”center”,alignItems:”center”,children:[t&&(0,r.Y)(i.Ye,{bg:”glass-inverted-medium”,justifyContent:”center”,alignItems:”center”,radius:”sm”,paddingY:6,paddingX:8,className:s.A.verticalMenuLabel,style:{opacity:+!!o},children:(0,r.Y)(a.EY.B4,{color:”white”,children:t})}),(0,r.Y)(“div”,{onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),children:n})]})}},37575:function(e,t,n){n.d(t,{H2:()=>I,_R:()=>B});var r=n(69277),l=n(86500);n(68349);var o=n(98111),i=n(46754),a=n(82776),s=n(38474),c=n(26116),u=n(39729),d=n(42985),p=n(79431),f=n(45595),m=n(70679),h=n(97966),g=n(70084),v=n(37859),y=n(31611);n(86508);var b=n(17768),k=n(82979),w=n(58097),_=n(30131),x=n(41298),E=n(60440),A=n(41758),S=n(75594),C=n(84262),D=n(14304),T=n(13625);n(33333);var N=n(39248),O=n(60147);let L=async(e,t)=>{var n;if(!e)throw Error(“No URL provided”);return”undefined”!=typeof window&&(null==(n=window._preloads.siteConfigs)?void 0:n.enable_polymarket_post_embeds)&&(0,i.QE)(e)?(0,E.hI)(e,t):(0,A.i1)(e,t)},M=[[y.NT,y.h$],[_.FR,_.yJ],[T.hq,T.GW],[b.Ys,b.VM],[O.NO,O.Sw],[N.ou,N.zd],[C.mc,C.Xs],[f.RD,f.oM],[p.Bp,p.so],[d.XB,d.w1],[S.AF,S.d1],[c.ez,c.lQ],[k.Rj,k.gE],[v.SU,v.Z7],[h.iO,h.Xs],[g.oI,g.t2],[s.q_,s.TM],[w.Hh,w.Wc],[m.t7,m.eZ],[x.sF,x.DI],[e=>{var t;if(!e)return null;if(“undefined”!=typeof window&&(null==(t=window._preloads.siteConfigs)?void 0:t.enable_polymarket_post_embeds)){let t=(0,i.QE)(e);if(t)return t}return(0,A.J7)(e)},L],[function(){for(var e=arguments.length,t=Array(e),n=0;ne===o.T.FIRST_NOTE_EMBED,d.x7]],B=(e,t,n)=>{if(t.nodes.augmentation_placeholder)for(let[l]of M){let o=l(e,(0,r._)({customSchema:t},n));if(o){let e=t.nodes.augmentation_placeholder.create({request_id:(0,a.randomString)(),url:o});return[o,e]}}return[null,null]},I=async(e,t,n,o)=>{let i,a,{request_id:s,url:c}=e.attrs;try{for(let[t,a]of M)if(t(e.attrs.url,(0,r._)({customSchema:n},o))&&((0,l.u4)(l.qY.EMBED_URL_ATTEMPTED,{url:c,source:”paste”}),i=await a(c,{customSchema:n}),(0,l.u4)(l.qY.EMBED_URL_SUCCEEDED,{url:c,source:”paste”}),i))break}catch(t){(0,l.u4)(l.qY.EMBED_URL_FAILED,{url:c,source:”paste”}),console.error(“Failed to process augmentation placeholder:”,e.attrs,t),400<=t.status&&t.status<600&&(a=t)}if(a){let r=(0,T.hq)(e.attrs.url);if(setTimeout(()=>{z(s,t,n,(e,t,l)=>{r&&n.marks.link&&e.replaceRangeWith(t,t+l.nodeSize,n.text(l.attrs.url,[n.marks.link.create({title:l.attrs.url,href:l.attrs.url})])),e.delete(t,t+l.nodeSize)})},0),!r)throw a}else i?setTimeout(()=>{z(s,t,n,(e,t,n)=>{i&&e.setNodeMarkup(t,i.type,i.attrs,n.marks)})},0):setTimeout(()=>{z(s,t,n,(e,t,r)=>{e.replaceRangeWith(t,t+r.nodeSize,n.text(r.attrs.url))})},0)},z=(e,t,n,r)=>{let l=!1,o=t.state.tr;return t.state.doc.descendants((t,i)=>{t.type===n.nodes.augmentation_placeholder&&t.attrs.request_id===e&&!1!==r(o,i,t)&&(l=!0)}),l&&t.dispatch(o),l}},35974:function(e,t,n){n.d(t,{c:()=>l});var r=n(87166);”undefined”!=typeof navigator&&/Mac/.test(navigator.platform);let l=e=>(t,n,l)=>{if(n){var o,i,a;(0,r.S)(e.marks.link,{scrollParent:”.editor-scroll”,language:”undefined”!=typeof window?null==(a=window)||null==(i=a._preloads)||null==(o=i.publication)?void 0:o.language:null}).spec.run(t,n,l)}return!0}},32526:function(e,t,n){n.d(t,{A_:()=>p,Lz:()=>s,PN:()=>f,Rh:()=>h,cz:()=>v,dG:()=>g,yb:()=>m});var r=n(99851),l=n(43712),o=n(86500),i=n(68349),a=n(39318);class s extends l.Dr{static fromMenuItem(e,t){let{spec:n}=e;return new s(n,t)}constructor(e,t){super(e);const n=this.spec.run;this.spec.run=(e,r,l,i)=>((0,o.u4)(o.qY.EDITOR_MENU_ICON_CLICKED,{button:t||this.spec.label||this.spec.title}),n.call(this,e,r,l,i))}}let c=”ProseMirror-prompt”,u=””.concat(c,”-visible”);class d{read(e){return e.value}validate(e){return(e=this.clean(e))||!this.options.required?this.options.validate&&this.options.validate(e):”Required field”}clean(e){return this.options.clean?this.options.clean(e):e}constructor(e){(0,r._)(this,”options”,void 0),this.options=e}}class p extends d{render(){let e=document.createElement(“input”);return e.type=”text”,e.placeholder=this.options.label,e.value=this.options.value||””,e.className=this.options.className||””,e.autocomplete=”off”,e}}class f extends p{constructor(e,t,n=”en”){const{iString:r}=I18N.i(n);super({label:r(“Enter URL…”),className:”url-input”,value:t||e&&e.mark.attrs.href||””,required:!0,clean:e=>{let t;return e?(t=e.trim()).startsWith(“http”)||t.startsWith(“mailto”)||/^%%.*%%$/.test(t)?t:”http://”.concat(t):””},validate:e=>{if(!/^%%.*%%$/.test(e)){if(e.startsWith(“”.concat((0,a.$_T)(),”/publish/post/”))&&alert(r(“This is a link to a post draft. Readers will not be able to access this page.”)),e.length>1900)return r(“Link is too long”);try{let t=new URL(e);if([“http:”,”https:”,”mailto:”].includes(t.protocol))return}catch(e){}return e.startsWith(“http”)?r(“Invalid URL”):r(“Invalid URL. Try using http://”)}}})}}function m(e,t){let{from:n,$from:r,to:l,empty:o}=e.selection;return o?!!t.isInSet(e.storedMarks||r.marks()):e.doc.rangeHasMark(n,l,t)}function h(e){if(g(e))return;let{iString:t}=I18N.i(e.language||”en”),n=””.concat(c,”-“).concat(e.parentClass),r=e.root||document.body,l=e.scrollParent&&document.querySelector&&document.querySelector(e.scrollParent)||function e(t){return null==t?null:t.scrollHeight>t.clientHeight?t:e(t.parentElement)}(r)||window,o=r.appendChild(document.createElement(“div”));o.classList.add(c),e.className&&o.classList.add(e.className),o.id=n,(0,i.iQ)(document.body,u);let a=e=>{o.contains(e.target)||p()},s=()=>{if(e.position)e.position(o,f);else{var t,n;let r=e.parentClass&&(null==(t=(n=document).querySelector)?void 0:t.call(n,”.”.concat(e.parentClass)));if(r){let t=r.getBoundingClientRect();o.style.top=””.concat(t.bottom+(e.offsetTop||0),”px”),o.style.left=””.concat(t.left+(e.offsetLeft||0),”px”)}else{let t=o.getBoundingClientRect();o.style.top=””.concat((window.innerHeight-t.height)/2+(e.offsetTop||0),”px”),o.style.left=””.concat((window.innerWidth-t.width)/2+(e.offsetLeft||0),”px”)}}},d=t=>{var n;t&&t.preventDefault();let r=function(e,t){let n={},r=0;for(let l in e){let o=e[l],i=t[r++],a=o.read(i),s=o.validate(a);if(s)return function(e,t){let n=e.parentNode;if(!n)return;let r=n.appendChild(document.createElement(“div”));r.style.left=””.concat(e.offsetLeft+e.offsetWidth+2,”px”),r.style.top=””.concat(e.offsetTop-5,”px”),r.className=”ProseMirror-invalid”,r.textContent=t,setTimeout(()=>n.removeChild(r),1500)}(i,s),null;n[l]=o.clean(a)}return n}(null!=(n=e.fields)?n:{},m);r&&p(r)},p=t=>{(0,i.vy)(document.body,u),window.removeEventListener(“mousedown”,a),window.removeEventListener(“resize”,s,!1),l.removeEventListener(“scroll”,s,!1),o.parentNode&&o.parentNode.removeChild(o),t?(e.onSubmit&&e.onSubmit(t),e.callback&&e.callback(t)):e.onCancel&&e.onCancel(),e.onClose&&e.onClose()};setTimeout(()=>window.addEventListener(“mousedown”,a),50),window.addEventListener(“resize”,s,!1),l.addEventListener(“scroll”,s,!1);let f=o.appendChild(document.createElement(“span”));f.className=”head”;let m=[],h=0;for(let t in e.fields){h++;let n=e.fields[t].render();n.tabIndex=h,m.push(n)}let v=o.appendChild(document.createElement(“form”));if(e.title&&(v.appendChild(document.createElement(“h5”)).textContent=e.title),m.forEach(e=>{v.appendChild(document.createElement(“div”)).appendChild(e)}),!e.no_buttons){let n=document.createElement(“button”);n.type=”submit”,n.className=””.concat(c,”-submit”),n.textContent=e.submitText||”OK”,n.addEventListener(“click”,d);let r=document.createElement(“button”);r.type=”button”,r.className=””.concat(c,”-cancel”),r.textContent=t(“Cancel”),r.addEventListener(“click”,()=>p());let l=v.appendChild(document.createElement(“div”));l.className=””.concat(c,”-buttons”),l.appendChild(n),l.appendChild(document.createTextNode(” “)),l.appendChild(r)}if(e.footer&&v.appendChild(e.footer),e.openseaEmbedFooter&&v.appendChild(e.openseaEmbedFooter),s(),v.addEventListener(“submit”,d),e.onInput&&v.addEventListener(“input”,t=>{var n;null==(n=e.onInput)||n.call(e,t,o)}),v.addEventListener(“keydown”,e=>{if(27==e.keyCode)e.preventDefault(),p();else if(13!=e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey){if(9==e.keyCode&&(window.setTimeout(()=>{o.contains(document.activeElement)||p()},500),m.length>1)){for(let t=0;t0){let e=v.elements[0];for(let t of Array.from(v.elements))if(!t.value&&[“INPUT”,”TEXTAREA”].includes(t.nodeName)){e=t;break}e.focus()}}function g(e){let t=””.concat(c,”-“).concat(e.parentClass),n=document.getElementById(t);if(n){let e;if(n.querySelector&&(e=n.querySelector(“.”.concat(c,”-cancel”))),e)e.click();else{var r;null==(r=n.parentNode)||r.removeChild(n),(0,i.vy)(document.body,u)}return!0}}function v(e,t){let n=e.selection.$from;for(let e=n.depth;e>=0;e–){let r=n.index(e);if(n.node(e).canReplaceWith(r,r,t))return!0}return!1}},56909:function(e,t,n){n.d(t,{o:()=>r}),n(4006),n(17402),n(38692);let r=()=>{if(window)return window.LatexModalEvent||(window.LatexModalEvent=new EventTarget),window.LatexModalEvent}},84810:function(e,t,n){n.d(t,{L:()=>a});var r=n(69277),l=n(70408),o=n(17402),i=n(73484);let a=()=>{let{initialTab:e,isDrawerOpen:t,setInitialTab:n,setIsDrawerOpen:a,setPreventChange:s}=(0,i.gJ)(),c=(0,o.useCallback)(e=>{a((0,l._)((0,r._)({},e),{drawerId:”podcast”}))},[a]);return{initialTab:e,isPodcastDrawerOpen:t(“podcast”),setInitialTab:n,setIsPodcastDrawerOpen:c,setPreventChange:e=>s({preventChange:e,preventChangeMessage:”Please wait until the upload is finished before closing the drawer”})}}},9129:function(e,t,n){n.d(t,{e4:()=>r}),n(68349);let r=”data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAY4AAAB0BAMAAABgVMiEAAAAMFBMVEX////7+/vt7e3o6Ojm5ubn5+fu7u709PTs7Oz39/f19fX29vby8vLx8fHz8/Pw8PCxY+A8AAAAoklEQVR4AWJgVHYZ+sBIgEE0vXzog7JAhrZZq4Y+WJnB4A5o5w5oAAYBGAi6mcKpQgIaClhCBklz7+AM/Gjo5+Dg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODgeO7g4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4ODg4OD4Zse3dmVXfIST0/B1vh0UtMKbNF7rAAAAAElFTkSuQmCC”},47885:function(e,t,n){n.d(t,{Y:()=>a});var r=n(4006),l=n(76977),o=n(63136),i=n(82776);let a=e=>{let{duration:t,icon:n,position:a=”bottom-left”,previewDuration:s}=e;return(0,r.FD)(l.Ye,{alignItems:”center”,bg:”glass-inverted-medium”,gap:6,paddingX:8,paddingY:2,position:”absolute”,radius:”sm”,style:”bottom-left”===a?{left:8,bottom:8}:{right:8,bottom:8},children:[n,(0,r.Y)(o.EY.Meta,{color:”white”,lineHeight:20,children:s?””.concat((0,i.secondsToHHMMSS)(s),” / “).concat((0,i.secondsToHHMMSS)(null!=t?t:0)):(0,i.secondsToHHMMSS)(null!=t?t:0)})]})}},82100:function(e,t,n){n.d(t,{Q:()=>s});var r=n(69277),l=n(70408),o=n(32641),i=n(4006),a=n(33727);function s(e){var{isDragging:t,dragProps:n,children:s}=e,c=(0,o._)(e,[“isDragging”,”dragProps”,”children”]);return(0,i.Y)(a.Z,(0,l._)((0,r._)({outline:”none”,border:”detail”,borderStyle:t?”solid”:”dashed”,bg:t?”primary-hover”:”primary”,animate:!0,pressable:”lg”},n,c),{children:s}))}},46754:function(e,t,n){n.d(t,{QE:()=>i,RP:()=>a});var r=n(39318);let l=/^.*(https?:\/\/(?:www\.)?polymarket\.com\/event\/([^/\s]+)(?:\/([^/\s?]+))?).*$/,o=/^.*(https?:\/\/(?:www\.)?polymarket\.com\/sports\/(?:[^/\s]+\/)*([^/\s?]+)).*$/,i=e=>{var t,n;let r=l.exec(e);if(r)return null!=(t=r[1])?t:null;let i=o.exec(e);return i&&null!=(n=i[1])?n:null},a=e=>{if(!e)return null;let t=l.exec(e);if(t&&t[2]){let e=t[2],n=t[3]||void 0;return{eventSlug:e,marketSlug:n,fullEmbedUrl:s(e,n)}}let n=o.exec(e);if(n&&n[2]){let e=n[2];return{eventSlug:e,marketSlug:void 0,fullEmbedUrl:s(e)}}return null},s=(e,t)=>””.concat((0,r.$_T)(),”/embed/polymarket/”).concat(e).concat(t?”/”.concat(t):””)},8037:function(e,t,n){let r;n.d(t,{Rq:()=>o,T_:()=>c,f9:()=>a,iW:()=>u,mw:()=>s,qy:()=>i});var l=n(82776);n.e(“7578”).then(n.t.bind(n,86049,19)).then(e=>{r=e.default});let o={“application/x-cbr”:[[82,97,114,33,26,7,0],[82,97,114,33,26,7,1,0],[127,69,76,70]],”application/x-cbz”:[[80,75,3,4],[80,75,5,6],[80,75,7,8]]},i={“application/vnd.amazon.kfx”:[[75,70,88,32]],”application/vnd.amazon.kpf”:[[80,75,3,4]],”application/epub+zip”:[[80,75,3,4]],”application/x-mobipocket-ebook”:[[77,79,66,73]]},a={“application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”:[[80,75,3,4],[80,75,5,6],[80,75,7,8]]},s={“application/pdf”:[[37,80,68,70]]};function c(e){let{mimeTypesToSignature:t,substackType:n,actionButtonAttr:r}=e;return[{tag:”div.file-embed-wrapper”,getAttrs:e=>{let o={};try{var i,a,s;let[c,u,d]=e.children[0].children;if(!c)return!1;let[p,f]=c.children;if(!f||!p)return!1;let[m,h]=f.children;if(!h)return!1;o.title=null==m?void 0:m.textContent;let[g,v]=(null==(i=h.textContent)?void 0:i.split(“∙”))||[];if(!g||!v)return!1;o.filesize=(0,l.formattedBytesToNumber)(g);let y=null==(s=v.split(“File”))||null==(a=s[0])?void 0:a.trim().toLowerCase();if(!y)return!1;if(t[y]||n===y)o.filetype=y;else{if(“file”!==n)return!1;o.filetype=y}return(null==p?void 0:p.classList.contains(“file-embed-thumbnail-default”))||(o.thumbnail=p.getAttribute(“src”)||””),o.description=null==u?void 0:u.innerText,o[r]=null==d?void 0:d.getAttribute(“href”),o}catch(e){return!1}}}]}function u(e){var t;let{attrs:n}=e;return””.concat((0,l.numberToHumanFileSize)(null!=(t=Number(n.filesize))?t:void 0),” ∙ “).concat(function(e){var t,n,l,o;let{filetype:i}=e;return r&&i?[“application/vnd.amazon.kfx”,”application/vnd.amazon.kpf”,”application/vnd.amazon.ebook”].includes(i)?”Kindle”:null!=(o=null==(n=r.extension(i)||(null==(l=i.split(“/”).pop())?void 0:l.split(“-“).pop()))||null==(t=n.toUpperCase)?void 0:t.call(n))?o:””:””}({filetype:n.filetype}),” file”)}},86508:function(e,t,n){n.r(t),n.d(t,{EMPTY_DOC:()=>tv,HEADER_IMAGE_ATTRS_FROM_NODE_TYPE:()=>ty,addIdsToHeaders:()=>tq,checkForUnpublishableComments:()=>t9,checkForUnsafeLinks:()=>t5,createStringDoc:()=>nl,customMediaNodes:()=>tk,extractTags:()=>tV,fromHtml:()=>tX,getCoverImage:()=>tZ,getCoverImages:()=>t8,getDefaultPodcastDescriptionWithoutFeedCTAs:()=>nr,getDescription:()=>t$,getDimensionsFromImageUrl:()=>tg,getFirstImageFromBody:()=>t1,getHeaderImageFromBody:()=>t7,getImageUrlsFromPostBody:()=>t3,getImagesFromBody:()=>t0,getLinks:()=>t6,getPreviewImageUrl:()=>t2,hasExplicitPaywall:()=>no,migrateMarkdown:()=>tG,migratePost:()=>tK,migrateProsemirrorToTiptap:()=>tI,migratePublication:()=>tQ,migrateTiptapToProsemirror:()=>tz,nodeToHtml:()=>tW,normalizeDbPodcastDescriptionToHtmlString:()=>nn,purgeUnsafeLinks:()=>ne,schema:()=>tE,schemaStatic:()=>tA,serializeDoc:()=>tP,serializedToPodcastDescription:()=>tJ,setBelowTheFoldAttribute:()=>nt,setButtonActions:()=>t4,tipTapNodes:()=>tO,tipTapSchema:()=>tL,toHtml:()=>tH,toText:()=>tj,trackedCustomNodes:()=>t_,unserializeDoc:()=>tY,unserializeDocAsync:()=>tF,unserializeDocToJSON:()=>tR,unserializeJson:()=>tU});var r=n(69277),l=n(70408),o=n(88285),i=n(76229),a=n(93993),s=n(16571),c=n(55895),u=n(55679),d=n(31707),p=n(16233),f=n(96436),m=n(96282),h=n(58521),g=n(18708),v=n(60526),y=n(34688),b=n(61292),k=n(6142),w=n(35933),_=n(41002),x=n(39001),E=n(90846),A=n(579),S=n(31583),C=n(83673),D=n.n(C),T=n(69843),N=n.n(T),O=n(63375),L=n.n(O),M=n(77003),B=n(98111),I=n(56458),z=n(58278),U=n(463),R=n(39318),Y=n(82776),F=n(38474),P=n(79589),W=n(26082),q=n(55277),H=n(58588),j=n(26116),J=n(55029),V=n(39729),X=n(82086),G=n(37855),K=n(32422),Q=n(82311),$=n(34202),Z=n(83485),ee=n(30909),et=n(42985),en=n(79431),er=n(45595),el=n(60282),eo=n(70679),ei=n(21577),ea=n(85052),es=n(26746),ec=n(97966),eu=n(70084),ed=n(66151),ep=n(32365),ef=n(33967),em=n(92678),eh=n(66347),eg=n(64287),ev=n(89909),ey=n(43146),eb=n(79493),ek=n(28072),ew=n(5113),e_=n(96208),ex=n(93692),eE=n(56456),eA=n(95663),eS=n(28177),eC=n(38435),eD=n(36986),eT=n(67902),eN=n(19015),eO=n(31933),eL=n(19062),eM=n(37859),eB=n(83733),eI=n(36504),ez=n(31611),eU=n(8540),eR=n(17768),eY=n(53680),eF=n(82979),eP=n(78598),eW=n(58097),eq=n(6905),eH=n(63998),ej=n(30131),eJ=n(69866),eV=n(54958),eX=n(41298),eG=n(76527),eK=n(60440),eQ=n(41758),e$=n(14489),eZ=n(88457),e0=n(88213),e1=n(96384),e7=n(48818),e3=n(40282),e8=n(75594),e2=n(66613),e4=n(52910),e6=n(84262),e9=n(25187),e5=n(51600),te=n(90565),tt=n(54544),tn=n(47727),tr=n(14304),tl=n(23491),to=n(13625),ti=n(60597),ta=n(33333),ts=n(90032),tc=n(79207),tu=n(68530),td=n(47579),tp=n(39248),tf=n(72385),tm=n(54749),th=n(60147);let tg=e=>{var t,n,r,l;let[o,i]=((null==(l=e.split(“_”))||null==(r=l[1])||null==(n=r.split(“.”))||null==(t=n[0])?void 0:t.split(“x”))||[0,0]).map(Number);return{width:o||0,height:i||0}},tv={type:”doc”,content:[{type:”paragraph”}]},ty={captionedImage:e=>{var t,n,r,l;let o=null==(t=e.content)?void 0:t.find(e=>{var t,n;return”image2″===e.type&&(null==(t=e.attrs)?void 0:t.width)>=300&&(null==e||null==(n=e.attrs)?void 0:n.height)>=300});if(!o)return{url:null,caption:void 0,alt:void 0};let i=null==e||null==(n=e.content)?void 0:n.find(e=>”caption”===e.type);return{url:null==o||null==(r=o.attrs)?void 0:r.src,caption:i,alt:null==o||null==(l=o.attrs)?void 0:l.alt}},image2:e=>{var t,n,r,l;return”number”!=typeof(null==(t=e.attrs)?void 0:t.width)&&”number”!=typeof(null==(n=e.attrs)?void 0:n.height)||e.attrs.width>=300&&e.attrs.height>=300?{url:null==e||null==(r=e.attrs)?void 0:r.src,alt:null==e||null==(l=e.attrs)?void 0:l.alt}:{url:null,caption:void 0,alt:void 0}},image3:e=>{var t,n,r,l,o;let i=tg(null==(t=e.attrs)?void 0:t.src);return”number”!=typeof(null==(n=e.attrs)?void 0:n.width)&&”number”!=typeof(null==(r=e.attrs)?void 0:r.height)||e.attrs.width>=300&&e.attrs.height>=300||i.width>=300&&i.height>=300?{url:null==(l=e.attrs)?void 0:l.src,caption:e.content,alt:null==(o=e.attrs)?void 0:o.alt}:{url:null,caption:void 0,alt:void 0}}},tb={image:e=>{var t;return t2(null==(t=e.attrs)?void 0:t.src)},image2:e=>{var t,n,r;return”number”!=typeof(null==(t=e.attrs)?void 0:t.width)&&”number”!=typeof(null==(n=e.attrs)?void 0:n.height)||e.attrs.width>=300&&e.attrs.height>=300?t2(null==(r=e.attrs)?void 0:r.src):null},image3:e=>{var t,n,r,l;let o=tg(null==(t=e.attrs)?void 0:t.src);return”number”!=typeof(null==(n=e.attrs)?void 0:n.width)&&”number”!=typeof(null==(r=e.attrs)?void 0:r.height)||e.attrs.width>=300&&e.attrs.height>=300||o.width>=300&&o.height>=300?t2(null==(l=e.attrs)?void 0:l.src):null},imageGallery:e=>{var t,n,r;return t2(null==(r=e.attrs)||null==(n=r.gallery.images)||null==(t=n[0])?void 0:t.src)},spotify:e=>{var t;return t2(null==(t=e.attrs)?void 0:t.image)},spotify2:e=>{var t;return t2(null==(t=e.attrs)?void 0:t.image)},opensea:e=>{var t;return t2(null==(t=e.attrs)?void 0:t.image)},twitter2:e=>{var t,n;if(null==(t=e.attrs)?void 0:t.photos){for(let t of e.attrs.photos)if(t.img_url)return t2(t.img_url)}return(null==(n=e.attrs)?void 0:n.expanded_url)&&e.attrs.expanded_url.image?e.attrs.expanded_url.image.url?t2(e.attrs.expanded_url.image.url):t2(e.attrs.expanded_url.image):null},vimeo:e=>{var t;return tp.VG(null==(t=e.attrs)?void 0:t.videoId,{playButton:!1})},youtube:e=>{var t;return th.VG(null==(t=e.attrs)?void 0:t.videoId,{playButton:!1})},youtube2:e=>{var t;return th.VG(null==(t=e.attrs)?void 0:t.videoId,{playButton:!1})},kindle:e=>{var t;return(0,R.dJ9)(null==(t=e.attrs)?void 0:t.imageUrl)},applePodcast:e=>{var t;return(0,R.dJ9)(null==(t=e.attrs)?void 0:t.imageUrl)},tiktok:e=>{var t;return(0,R.dJ9)(null==(t=e.attrs)?void 0:t.thumbnail_url)},polymarket:()=>null,prediction_market:e=>{var t;return(0,R.dJ9)(null==(t=e.attrs)?void 0:t.thumbnail_url)},manifold:e=>{var t;return(0,R.dJ9)(null==(t=e.attrs)?void 0:t.thumbnail_url)},lichess:e=>{var t;return(0,R.dJ9)(null==(t=e.attrs)?void 0:t.thumbnail_url)},datawrapper:e=>{var t;return(0,R.dJ9)(null==(t=e.attrs)?void 0:t.thumbnail_url)},pinterest:e=>{var t;return t2(null==(t=e.attrs)?void 0:t.image)}},tk={augmentation_placeholder:H.c,youtube2:th.c,youtube:tm.c,vimeo:tp.c,install_substack_app:eY.c,preview_in_substack_app:eZ.c,opensea:ej.c,twitter2:to.c,twitter:tl.c,communityChat:en.c,communityPost:er.c,comment:et.c,spotify2:e6.c,spotify:e4.c,soundcloud:e8.c,instagram:eR.c,image2:ez.c,image:eB.c,button:X.c,comic:ee.A.nodeSpec,file:ee.A.nodeSpec,pdf:eV.A.nodeSpec,xlsx:tf.A.nodeSpec,ebook:es.A.nodeSpec,referral_link:e7.c,bandcamp:j.c,kindle:eF.c,gitgist:eM.c,embeddedPost:ec.c,embeddedPublication:eu.c,applePodcast:F.c,audio:W.c,video:td.c,audioUrl:q.c,tiktok:tr.c,bluesky:V.c,poll:eG.c,sponsorshipCampaign:e2.c,imageGallery:eI.c,image3:eU.c,cashtag:Z.c,substack_mentions:eH.c,polymarket:eK.c,prediction_market:eQ.c,manifold:eQ.c,lichess:eW.c,datawrapper:eo.c,digestPostEmbed:ei.c,assetError:P.c,directMessage:ea.c,recipe:e1.c,pinterest:eX.c},tw=(0,l._)((0,r._)({},tk),{blockquote:J.c,calloutBlock:G.c,fragmentNode:eL.c,captionedImage:$.c,caption:K.c,ctaCaption:el.c,footnote:eT.c,footnoteAnchor:eN.c,latex_block:eP.c,paywall:eJ.c,preformatted_text_block:e$.c,pullquote:e0.c,subscribeWidget:e5.c,captionedShareButton:(0,Q.c)({url:B.T.SHARE_URL}),captionedWriterReferralButton:(0,Q.c)({hasDynamicSubstitutions:!1}),templateComment:tn.c,meeting:eq.c,referralTier:e3.c,fpRecircBlock:eO.c}),t_=(0,l._)((0,r._)({},tk),{subscribeWidget:e5.c,paywall:eJ.c,templateComment:tn.c}),tx={strikethrough:e9.o,superscript:tt.L,subscript:te.i},tE=new A.Sj({nodes:tM(),marks:tB()}),tA=new A.Sj({nodes:tM({isStatic:!0}),marks:tB({isStatic:!0})}),tS=Object.keys(tw).filter(e=>![“blockquote”,”pullquote”,”calloutBlock”,”fpRecircBlock”].includes(e)).map(e=>{let t=(0,ta.m0)(e,tw[e]),n=(0,r._)({},tw[e],t);return”youtube2″===e?n.addNodeView=()=>e=>{let{node:t}=e;return new th.fe(t)}:”tiktok”===e?n.addNodeView=()=>e=>{let{node:t}=e;return new tr.e1(t)}:”lichess”===e?n.addNodeView=()=>e=>{let{node:t}=e;return new eW.Hk(t)}:”datawrapper”===e?n.addNodeView=()=>e=>{let{node:t}=e;return new eo.nV(t)}:”prediction_market”===e||”manifold”===e?n.addNodeView=()=>e=>{let{node:t}=e;return new eQ.hG(t)}:”paywall”===e?n.addNodeView=()=>e=>new eJ.U:”latex_block”===e?n.addNodeView=()=>e=>{let{node:t}=e;return new eP.uP(t)}:”comic”===e?n.addNodeView=()=>e=>{let{node:t,editor:n,getPos:r}=e;return ee.A.getNodeView({node:t,editor:n,getPos:r})}:”pdf”===e?n.addNodeView=()=>e=>{let{node:t,editor:n,getPos:r}=e;return eV.A.getNodeView({node:t,editor:n,getPos:r})}:”xlsx”===e?n.addNodeView=()=>e=>{let{node:t,editor:n,getPos:r}=e;return tf.A.getNodeView({node:t,editor:n,getPos:r})}:”ebook”===e?n.addNodeView=()=>e=>{let{node:t,editor:n,getPos:r}=e;return es.A.getNodeView({node:t,editor:n,getPos:r})}:”augmentation_placeholder”===e&&(n.addNodeView=()=>(0,S.gu)(M.i)),o.bP.create(n)}),tC=i.Cv.extend({addCommands(){return{toggleBlockquote:()=>e=>{let{state:t,commands:n}=e;return!(!(0,o.rU)(t,”paragraph”)||(0,o.rU)(t,”pullquote”)||(0,o.rU)(t,”calloutBlock”))&&n.toggleWrap(this.name)}}},parseHTML:()=>J.c.parseDOM}),tD=i.Cv.extend({name:”calloutBlock”,addCommands(){return{toggleCalloutBlock:()=>e=>{let{state:t,commands:n}=e;if((0,o.rU)(t,”calloutBlock”))return n.lift(“calloutBlock”);if((0,o.rU)(t,”paragraph”)||(0,o.rU)(t,”button”))return!((0,o.rU)(t,”pullquote”)||(0,o.rU)(t,”blockquote”))&&n.toggleWrap(this.name);let r=[t.schema.nodes.paragraph,t.schema.nodes.button].filter(e=>!!e),l=!0;return t.doc.nodesBetween(t.selection.from,t.selection.to,(e,n,o,i)=>{if(o===t.doc&&(e.type===t.schema.nodes.blockquote||e.type===t.schema.nodes.pullquote||!r.includes(e.type)))return l=!1,!1}),!(!l||(0,o.rU)(t,”pullquote”)||(0,o.rU)(t,”blockquote”))&&n.toggleWrap(this.name)}}},parseHTML:()=>[{tag:”div[data-callout]”,priority:100},{tag:”div.callout-block”,priority:99}],renderHTML:()=>[“div”,{class:”callout-block”,”data-callout”:”true”},0],addInputRules:()=>[]}),tT=h.d.extend({addCommands:()=>({insertHorizontalRule:()=>e=>{let{state:t,dispatch:n}=e;return n&&t.schema.nodes.horizontalRule&&n((0,ta.DL)(t,t.schema.nodes.horizontalRule.create())),!0},setHorizontalRule:()=>e=>{let{state:t,dispatch:n}=e;if(n){if(!t.schema.nodes.horizontalRule)return console.error(“horizontalRule is missing”),!1;n((0,ta.DL)(t,t.schema.nodes.horizontalRule.create()))}return!0}})}),tN=u.NG.extend({marks:”_”}),tO=[tC,a.yN,s.Rg,ep.$,tD,c.Cy,tN,em.q,d.y,eg.t,p.B,f.D,m.B,tT,ed.K,eD.T,ey.W,ek.N,ex.P,eS.S,eE.c,e_.k,ev.H,g.J2,eb.u,v.c,y._J,b.f,ew.p,e0.k,k.n,w.E,_.Z,x.E,ef.A,eC.S,eh.I,ea.eW,eO.ik,…tS],tL=(0,o._w)(tO);function tM(){let{isStatic:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=E.wQ.spec.nodes;for(let n of Object.keys(tw)){let r=Object.assign({},tw[n]);e&&r.toDOMStatic&&(r.toDOM=r.toDOMStatic),delete r.toDOMStatic,t=t.get(n)?t.update(n,r):t.addToEnd(n,r)}return t}function tB(){let{isStatic:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=E.wQ.spec.marks;for(let n of Object.keys(tx)){let r=Object.assign({},tx[n]);e&&r.toDOMStatic&&(r.toDOM=r.toDOMStatic),delete r.toDOMStatic,t=t.get(n)?t.update(n,r):t.addToEnd(n,r)}return t}function tI(e){let{postId:t,pubId:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e;return”string”==typeof r&&(r=tU(r,{postId:t,pubId:n})),(0,ta.jE)(r,e=>{let t=ta.rl.find(t=>t[0]===e.type);return t&&(e.type=t[1],e.attrs&&”orderedList”===t[1]&&(e.attrs.start=e.attrs.order)),e.marks&&e.marks.forEach(e=>{var t;let n=ta.EI.find(t=>t[0]===e.type);n&&(e.type=n[1]),”link”===e.type&&(null==(t=e.attrs)?void 0:t.href)===!0&&(e.attrs.href=null)}),e}),r}function tz(e){let{postId:t,pubId:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e;return”string”==typeof r&&(r=tU(r,{postId:t,pubId:n})),(0,ta.jE)(r,e=>{let t=ta.rl.find(t=>t[1]===e.type);return t&&(e.type=t[0],e.attrs&&”ordered_list”===t[0]&&(e.attrs.order=e.attrs.start)),e.marks&&e.marks.forEach(e=>{let t=ta.EI.find(t=>t[1]===e.type);t&&(e.type=t[0])}),e}),r}function tU(e){let t,{postId:n,pubId:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&(e=(e=e.replace(“http://substack-post-media”,”https://substack-post-media”)).replace(“http://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984″,”https://bucketeer-e05bbc84-baa3-437e-9518-adb32be77984”)),e=tG(e))try{t=JSON.parse(e)}catch(t){console.error(“unserializeJson for post [“.concat(n,”], pubId [“).concat(r,”], could not parse serialized:”),e,t)}return null!=t?t:void 0}function tR(e){let{docStr:t,postId:n,pubId:r}=e,l=ne(tU(t,{postId:n,pubId:r})||tv);if(!l)throw Error(“could not purgeUnsafeLinks”);let o=l;return(o=tI(o,{postId:n,pubId:r}))||tv}function tY(e){let{customSchema:t,useTiptap:n,mutateJson:r,shouldSetBelowTheFoldAttribute:l=!1,shouldThrowOnInvalid:o,postId:i,pubId:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let o=tU(e,{postId:i,pubId:a})||tv;r&&r(o);let s=ne(o);if(!s)throw Error(“could not purgeUnsafeLinks”);let c=s;return l&&(c=nt(c)),c=n?tI(c,{postId:i,pubId:a}):tz(c,{postId:i,pubId:a}),(t||tE).nodeFromJSON(c)}catch(n){if(console.error(“Failed to parse JSON for post [“.concat(i,”], serialized:”),e,n),o)throw Error(“Failed to parse JSON: “.concat(n.message));return(t||tE).nodeFromJSON(tv)}}async function tF(e){let{customSchema:t,useTiptap:n,mutateJson:r,shouldSetBelowTheFoldAttribute:l=!1,shouldThrowOnInvalid:o,postId:i,pubId:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let o=tU(e,{postId:i,pubId:a})||tv;r&&await r(o);let s=ne(o);if(!s)throw Error(“could not purgeUnsafeLinks”);let c=s;return l&&(c=nt(c)),c=n?tI(c,{postId:i,pubId:a}):tz(c,{postId:i,pubId:a}),(t||tE).nodeFromJSON(c)}catch(n){if(console.error(“Failed to parse JSON for post [“.concat(i,”], serialized:”),e,n),o)throw Error(“Failed to parse JSON: “.concat(n.message));return(t||tE).nodeFromJSON(tv)}}function tP(e){let{runMigrations:t=!1,postId:n,pubId:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=e.toJSON();return t&&(l=tz(l=ne(l=function(e){let{postId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=”string”==typeof e?tU(e,{postId:t}):e;return(0,ta.jE)(n,e=>{e.text&&(e.text=(0,Y.stripInvalidBytes)(e.text))},{nodeTypes:[“text”]}),n}(l)),{postId:n,pubId:r})),JSON.stringify(l)}function tW(e,t){let n=document.createElement(“div”);return n.appendChild(A.ZF.fromSchema(t?tA:tE).serializeFragment(A.FK.fromArray([e]),{document})),n}function tq(e){Array.from(e.querySelectorAll(“h2, h3, h4, h5, h6”)).forEach(e=>{if(!e.getAttribute(“id”)){var t;let n=(0,z.uB)(e.textContent||””,!0),r=document.createElement(“div”);r.setAttribute(“id”,n),r.setAttribute(“class”,”anchor-target”),null==(t=e.parentNode)||t.insertBefore(r,e);let l=document.createElement(“a”);for(l.setAttribute(“href”,”#”.concat(n));e.firstChild;)l.appendChild(e.firstChild);e.appendChild(l)}})}function tH(e,t){let{isAmp:n,transform:r,useTipTap:l,pubId:o,postId:i}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(l){let n=tI(tU(e,{postId:i,pubId:o}),{postId:i,pubId:o});if(!n)throw Error(“could not serialize json doc”);return(0,tu.i)({doc:n,extensions:(0,eA.w)({isStatic:null!=t&&t}),customDocument:document})}let a=tY(e,{shouldSetBelowTheFoldAttribute:!0,postId:i,pubId:o}),s=A.ZF.fromSchema(t?tA:tE),c=document.createElement(“div”);try{s.serializeFragment(a.content,{document},c)}catch(e){return console.error(“could not serialize fragment, for pubId [“.concat(o,”], postId [“).concat(i,”]”),e),c.innerHTML}return r&&r(c),n&&Array.from(c.querySelectorAll(“img”)).forEach(e=>{let t=document.createElement(“amp-img”);t.setAttribute(“layout”,”intrinsic”),e.getAttributeNames().forEach(n=>{var r;”srcset”!==n&&t.setAttribute(n,null!=(r=e.getAttribute(n))?r:”null”)}),e.replaceWith(t)}),c.innerHTML}function tj(e,t){let{postId:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(0,ta.fE)(tY(e,{postId:n}),t)}function tJ(e){let{postId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,ta.Lz)(tY(e,{postId:t}))}function tV(e){let{postId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,ta.Te)(tY(e,{postId:t}))}function tX(e){let{stripEmptyParagraphs:t,postId:n,pubId:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=A.S4.fromSchema(tE).parse(new DOMParser().parseFromString(e,”text/html”));return(t&&(l=(0,ts.c)(l,e=>!e.type||”paragraph”!==e.type.name||!!(0,ta.fE)(e))),l)?tP(l,{postId:n,pubId:r}):null}function tG(e){return e&&”{“!==e[0]&&”null”!==e?tP(E.ee.parse(e)):e}function tK(e){var t,n;return e.body=null!=(t=tG(e.body))?t:null,e.draft_body=null!=(n=tG(e.draft_body))?n:null,e}function tQ(e){var t,n,r,l,o;return e.subscribe_content=null!=(t=tG(e.subscribe_content))?t:null,e.welcome_email_content=null!=(n=tG(e.welcome_email_content))?n:null,e.tos_content=null!=(r=tG(e.tos_content))?r:null,e.privacy_content=null!=(l=tG(e.privacy_content))?l:null,e.disclosures_content=null!=(o=tG(e.disclosures_content))?o:null,e}function t$(e,t){let{post:n=null,pubId:r,minCharacters:l=6,maxStopAfter:o=null,singleSentence:i=!0,language:a=”en”,excludeMediaPrefix:s=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{iString:c}=I18N.i(a),u=(null==n?void 0:n.type)===”thread”?145:250;(o||0===o)&&(u=Math.min(o,u));let d=(null==n?void 0:n.type)===”thread”,p=””;if(t)p+=t;else if(0!==u){var f;let t={paragraph:!0,blockquote:!0,list_item:!0,listItem:!0,heading:!0,code_block:!0,codeBlock:!0,hardbreak:!0,hard_break:!0,hardBreak:!0},o={caption:!0,footnote:!0};(0,ta.jE)(“string”==typeof e?tU(e,{postId:null!=(f=null==n?void 0:n.id)?f:null,pubId:r}):e,e=>{if(u&&p.length>=u)return!1;if(“paywall”===e.type)return tc.Vw;if(e.type&&o[e.type])return!1;if(“text”===e.type){let{text:t}=e;if(t){let e=t.match(/[.?!] /);if(i&&(null==e?void 0:e.index))return p+=t.slice(0,e.index+1),tc.Vw;p+=t}}else if(e.type&&t[e.type]&&p){if(p.length>l)return tc.Vw;” “!==p[p.length-1]&&(p+=” “)}else if(“substack_mentions”===e.type){var n,r;p+=null!=(r=null==(n=e.attrs)?void 0:n.name)?r:””}})}if(p=p.replace(/\s+/g,” “).trim(),d&&u&&p.length>=u&&(p=(0,Y.truncateText)(p,u)),((null==n?void 0:n.type)===”podcast”||(null==n?void 0:n.type)===”video”)&&!s){let e=(0,I.Fk)(n);p=””.concat(c((null==n?void 0:n.type)===”video”||(null==n?void 0:n.videoUpload)?”Watch now”:”Listen now”),” “).concat(e?”(“.concat((0,Y.secondsToLargestUnit)(e,{minutesCutoff:10800,language:a}),”) “):””,”| “).concat(p)}return p}function tZ(e,t){var n;return null!=(n=t8(e,t)[0])?n:null}function t0(e){let{postId:t,pubId:n,width:r,height:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=tU(e,{postId:t,pubId:n});return o?L()(D()((0,ta.zM)(o,e=>{var t;return!!tb[null!=(t=e.type)?t:””]}).map(e=>{var t,n;let o=null==(t=tb[null!=(n=e.type)?n:””])?void 0:t.call(tb,e);return o?(0,R.dJ9)(o,r,{height:l}):null}))):[]}function t1(e){let{postId:t,pubId:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t0(e,{postId:t,pubId:n});return r.length>0&&!N()(r[0])?r[0]:null}function t7(e){let{body:t}=e,n=tU(t);if(n)return(0,ta.zM)(n,e=>{var t;return!!ty[null!=(t=e.type)?t:””]}).map(e=>{var t,n;return null==(t=ty[null!=(n=e.type)?n:””])?void 0:t.call(ty,e)})[0]}async function t3(e){let{body:t,postId:n}=e,r=tY(t,{postId:n}),l=[];return(0,ta.Rv)(r,e=>{switch(e.type.name){case”image”:case”image2″:e.attrs.src&&l.push(e.attrs.src);break;case”imageGallery”:var t;null==(t=e.attrs.gallery.images)||t.map(e=>{e.src&&l.push(e.src)})}}),l}function t8(e,t){var n;let r=[];”podcast_episode_image_info”in t&&t.podcast_episode_image_info&&!t.podcast_episode_image_info.isDefaultArt&&t.podcast_episode_image_info.url!==t.podcast_art_url&&r.unshift(t.podcast_episode_image_info.url),r.unshift(…t0(e,{postId:t.id}));let l=”podcastUpload”in t&&t.podcastUpload||”draftPodcastUpload”in t&&t.draftPodcastUpload||void 0;if((null==l?void 0:l.state)===”transcoded”&&(null!=(n=null==l?void 0:l.thumbnail_id)?n:1)>1){let e=(0,R.H10)(l);e&&r.unshift(e)}let o=”videoUpload”in t&&t.videoUpload||”draftVideoUpload”in t&&t.draftVideoUpload||void 0;if((null==o?void 0:o.state)===”transcoded”){let e=(0,R.H10)(o);e&&r.unshift(e)}return r}function t2(e){return”string”!=typeof e?null:(e=e.replace(/\/l_twitter_play_button_rvaygk[^/]+/g,””),(0,R.dJ9)(e,void 0,{height:600}))}function t4(e){(0,ta.jE)(e,e=>{var t;return”button”===e.type&&((null==(t=e.attrs)?void 0:t.url)&&”string”==typeof e.attrs.url&&e.attrs.url.startsWith(“%%”)&&(e.attrs.action=e.attrs.url.replace(/%%/g,””)),!0)},{nodeTypes:”button”})}function t6(e){let{postId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;if(“string”==typeof n){let e=tU(n,{postId:t});if(!e)return[];n=e}t4(n);let r=[];return(0,ta.jE)(n,e=>{var t,n,l;if(“button”===e.type&&(null==(t=e.attrs)?void 0:t.url)&&!e.attrs.action)r.push({text:e.attrs.text,url:e.attrs.url});else if(“image2″===e.type&&(null==(n=e.attrs)?void 0:n.href))r.push({text:e.attrs.href,url:e.attrs.href});else if(e.marks){for(let t of e.marks)if(“link”===t.type&&(null==(l=t.attrs)?void 0:l.href)){r.push({text:e.text,url:t.attrs.href});break}}}),r}function t9(e){let{postId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;let n=e;if(“string”==typeof n){let e=tU(n,{postId:t});if(!e)return!1;n=e}return!!(0,ta.cy)(n,e=>”templateComment”===e.type)}function t5(e){let{postId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;let n=e;if(“string”==typeof n){let e=tU(n,{postId:t});if(!e)return!1;n=e}return!!(0,ta.cy)(n,e=>{for(let a of[“href”,”src”,”url”]){var t,n,r,l,o,i;if((null==e||null==(l=e.attrs)||null==(r=l[a])||null==(n=r.trim)||null==(t=(o=n.call(r)).toLowerCase)?void 0:t.call(o).startsWith(“javascript:”))||(null==e||null==(i=e.marks)?void 0:i.find(e=>{var t,n,r,l,o;return null==(l=e.attrs)||null==(r=l[a])||null==(n=r.trim)||null==(t=(o=n.call(r)).toLowerCase)?void 0:t.call(o).startsWith(“javascript:”)})))return!0}return!1})}function ne(e){let t,{postId:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(“string”==typeof e){let r=tU(e,{postId:n});if(!r)return null;t=r}else t=e;return(0,ti.M5)(t)?(0,ts.c)(t,e=>{for(let a of[“href”,”src”,”url”]){var t,n,r,l,o,i;if((null==e||null==(l=e.attrs)||null==(r=l[a])||null==(n=r.trim)||null==(t=(o=n.call(r)).toLowerCase)?void 0:t.call(o).startsWith(“javascript:”))||(null==e||null==(i=e.marks)?void 0:i.find(e=>{var t,n,r,l,o;return null==(l=e.attrs)||null==(r=l[a])||null==(n=r.trim)||null==(t=(o=n.call(r)).toLowerCase)?void 0:t.call(o).startsWith(“javascript:”)})))return!1}return!0}):(0,ts.c)(t,e=>{for(let a of[“href”,”src”,”url”]){var t,n,r,l,o,i;if((null==e||null==(l=e.attrs)||null==(r=l[a])||null==(n=r.trim)||null==(t=(o=n.call(r)).toLowerCase)?void 0:t.call(o).startsWith(“javascript:”))||(null==e||null==(i=e.marks)?void 0:i.find(e=>{var t,n,r,l,o;return null==(l=e.attrs)||null==(r=l[a])||null==(n=r.trim)||null==(t=(o=n.call(r)).toLowerCase)?void 0:t.call(o).startsWith(“javascript:”)})))return!1}return!0})}function nt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8,{postId:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=”string”==typeof e?tU(e,{postId:n}):e;if(!r)return;let l=!1;return”doc”===r.type&&r.content&&r.content.map((e,n)=>{n>t?(0,ta.jE)(e,e=>{!e.content&&e.attrs&&(e.attrs.belowTheFold=!0)}):l||(0,ta.jE)(e,e=>{!e.content&&(null==e?void 0:e.type)==”image2″&&e.attrs&&(e.attrs.topImage=!0,l=!0)})}),r}function nn(e){let{postId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{return JSON.parse(e),tJ(e,{postId:t})}catch(t){return e}}function nr(e,t){let{body:n,hasPodcastPreview:r}=t;if(!e||!n)return null;let l=n;return r&&(l=JSON.stringify((0,ta.n)(tU(n,{postId:e.id}),{maxLength:”post_preview_limit”in e&&e.post_preview_limit&&”number”==typeof e.post_preview_limit?e.post_preview_limit:356}))),tJ(l,{postId:e.id})}function nl(e){return tP(tE.node(“doc”,null,e.split(“\n”).map(e=>e.trim()).filter(e=>e.length>0).map(e=>{let t=[],n=(0,U.P2)(e);if(n.length>0){let r=e;for(;;){let e=n.map(e=>[r.indexOf(e.value),e.value]).sort().find(e=>{let[t]=e;return t>=0});if(!e)break;let[l,o]=e;if(l>0&&t.push(tE.text(r.substring(0,l))),!tE.marks.link){console.error(“link is missing from schema”);continue}t.push(tE.text(o,[tE.marks.link.create({title:o,href:o,target:”_blank”})])),r=r.substring(l+o.length)}r&&t.push(tE.text(r))}else t.push(tE.text(e));return tE.node(“paragraph”,null,t)})))}function no(e){let{postId:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return!1;let n=e;if(“string”==typeof e){let r=tU(e,{postId:t});if(!r)return!1;n=r}else n=e;return(0,ta.Ll)(n)}Object.entries(tL.nodes).forEach(e=>{let[t,n]=e;void 0!==tw[t]&&(n.spec=(0,r._)({},tw[t],n.spec))})},60597:function(e,t,n){function r(e){let{fragment:t}=e;return”content”in t?t.content:[]}function l(e){let{fragment:t,content:n}=e;t.content=n}function o(e){return”type”in e&&”object”==typeof e.type}function i(e){return”type”in e&&”string”==typeof e.type}n.d(t,{M5:()=>i,p0:()=>r,rQ:()=>o,x6:()=>l})},33333:function(e,t,n){n.d(t,{Ao:()=>R,DL:()=>J,EI:()=>v,JK:()=>I,Ll:()=>X,Lz:()=>D,OB:()=>M,Q7:()=>q,Rv:()=>h.Rv,Te:()=>_,WS:()=>j,Z3:()=>V,cy:()=>w,f$:()=>z,fD:()=>F,fE:()=>T,jE:()=>h.jE,jp:()=>L,m0:()=>O,n:()=>b,rl:()=>g,zM:()=>k,zl:()=>B});var r=n(69277),l=n(70408),o=n(26469);n(83673);var i=n(69843),a=n.n(i),s=n(31521),c=n.n(s),u=n(17460),d=n(28700),p=n(82776),f=n(82061),m=n(90032),h=n(79207);let g=[[“list_item”,”listItem”],[“bullet_list”,”bulletList”],[“ordered_list”,”orderedList”],[“hard_break”,”hardBreak”],[“horizontal_rule”,”horizontalRule”],[“code_block”,”codeBlock”]],v=[[“em”,”italic”],[“strong”,”bold”],[“strikethrough”,”strike”]],y={image2:1,image:0,horizontal_rule:0,audio:0,video:0,youtube:0,youtube2:0,vimeo:0,opensea:0,twitter:0,twitter2:0,spotify:0,spotify2:0,soundcloud:0,bandcamp:0,kindle:0,tiktok:0,polymarket:0,prediction_market:0,lichess:0,datawrapper:0,recipe:0,pinterest:0},b=function(e){let{maxLength:t=356,getAfterCutoff:n=!1,withEllipsis:r=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=””,o=!1,i={},a=X(e),s=!1,c=(0,m.c)(e,e=>{var r;if(o)return n;if(“paywall”===e.type)return o=!0,!1;if(a)return!0;let c=null!=(r=e.type)?r:”undefined”;if(i[c]=(i[c]||0)+1,e.type&&e.type in y&&i[c]>y[e.type])return o=!0,n;let u=t-l.length;if(u<=0&&!a||!(u>0))return n;if(n){if(“text”===e.type&&e.text){if(!(t-(l+=e.text).length<=0))return!1;e.text=e.text.substring(e.text.length+t-l.length-1,e.text.length)}}else if("text"===e.type&&e.text){l+=e.text;let t=e.text;e.text=(0,p.truncateText)(t,u),s=t!==e.text}return!0});if(c&&r&&!s){let e=function(e){let t=[],n=[e];for(;n.length;){var r;let e=n.pop();if(!e)break;if(e.content&&(null==(r=e.content)?void 0:r.length)>0)for(let t=e.content.length-1;t>=0;t–){let r=e.content[t];r&&n.push(r)}else t.push(e)}return t}(c),t=null,n=null;for(let r=e.length-1;r>=0&&(!t||!n);r–){let l=e[r];null===t&&(null==l?void 0:l.type)===”text”&&(t=r),null===n&&(null==l?void 0:l.type)!==”text”&&(null==l?void 0:l.type)!==”paragraph”&&(n=r)}let r=null!==t?e[t]:null,l=r&&null!==n&&null!==t&&n>t;r&&!l&&(r.text=N(r.text))}return c},k=(e,t)=>{let n=[];if(e&&(t(e)&&n.push(e),e.content))for(let r of e.content)n=n.concat(k(r,t));return n},w=(e,t)=>{if(e){if(t(e))return e;if(e.content)for(let n of e.content){let e=w(n,t);if(e)return e}}return null},_=e=>{let t=[];return e.nodesBetween(0,e.content.size,e=>{var n;(null==(n=e.type)?void 0:n.name)===”cashtag”&&t.push(e.attrs.symbol)},0),t},x=new Set([“caption”,”footnote”,”captionedImage”,”image”,”image2″]),E=new Set([“bullet_list”,”bulletList”,”ordered_list”,”orderedList”,”blockquote”]),A=”x_li_start_placeholder_x”,S=(e,t)=>{var n,r,l,o;if((null==(n=e.type)?void 0:n.name)===”list_item”||(null==(r=e.type)?void 0:r.name)===”listItem”)return{open:A,close:””};if((null==(l=e.type)?void 0:l.name)===”paragraph”||e.isBlock&&e.textContent.length>0&&!E.has(null==(o=e.type)?void 0:o.name)){let e=”
“:f+=”\n”):!h&&e.isBlock?(h=!0,d+=”\n”,l?f+=”
“:f+=”\n”):(null==(k=e.type)?void 0:k.name)===”cashtag”?f+=””.concat(e.attrs.symbol,” “):(null==(w=e.type)?void 0:w.name)===”substack_mentions”&&(f+=””.concat(e.attrs.name,” “))},0),!a()(o)&&d.length>o&&m&&(f=m),f=f.trim(),l&&(f=f.replace(/\s*(
)+$/,””).trim()),f},N=e=>””.concat(c()(e,”.”),”…”),O=(e,t)=>(0,l._)((0,r._)({name:e},t),{addAttributes:()=>t.attrs||{},parseHTML:()=>t.parseDOM,renderHTML(n){let{node:r}=n;if(!t.toDOM)return console.warn(“trying to create TipTapNode, no toDOM found for node”,e),[“span”];try{return t.toDOM(r)}catch(t){try{return console.error(“error in toDOM for node”,e,t),(0,f.D)({msg:null,node:r,err:t,group:r.isInline?”inline”:”block”})}catch(t){return console.error(“error rendering error element for node”,e,t),(null==r?void 0:r.isInline)?[“span”]:[“div”]}}}}),L=(e,t)=>{let n,r,l;if(e.doc.nodesBetween(e.selection.from,e.selection.to,(e,o)=>{if(n||r)return!1;let i=e.marks.find(e=>e.type===t);i&&(n=e,r=i,l={from:o,to:o+e.nodeSize})}),n)return{node:n,mark:r,pos:l}},M=(e,t)=>{let n,r,l;if(e.doc.nodesBetween(e.selection.from,e.selection.to,(o,i)=>{if(n||r||!(i<=e.selection.from)||!(e.selection.to<=i+o.nodeSize))return!1;{let e=o.marks.find(e=>e.type===t);e&&(n=o,r=e,l={from:i,to:i+o.nodeSize})}}),!n){if(e.selection.empty){let a=e.doc.resolve(e.selection.from),s=a.nodeBefore&&a.nodeBefore.marks.find(e=>e.type===t),c=a.nodeAfter&&a.nodeAfter.marks.find(e=>e.type===t);if(s||c){var o,i;n=c?a.nodeAfter:a.nodeBefore,r=c||s,l=c?{from:a.pos,to:a.pos+a.nodeAfter.nodeSize}:{from:a.pos-(null!=(i=null==(o=a.nodeBefore)?void 0:o.nodeSize)?i:0),to:a.pos}}}if(!n)return}return{node:n,mark:r,pos:l}},B=function(e){let{allowedMarks:t=[]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!e.selection.empty||I(e,e.selection.from,e.selection.to,{allowedMarks:t})},I=function(e,t,n){let{allowedMarks:r=[]}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=!0,o=!1;return e.doc.nodesBetween(t,n,t=>{if(!l)return!1;t.type!==e.schema.nodes.text?o?l=!1:o=!0:t.marks.find(e=>!r.includes(e.type))&&(l=!1)}),l},z=(e,t)=>{if(e.selection.empty)return!1;let n=Array.isArray(t)?t:[t];if(“node”in e.selection){var r;let t=e.selection;return n.includes(null==(r=t.node)?void 0:r.type)}return U(e,e.selection.from,e.selection.to,n)},U=(e,t,n,r)=>{let l=null;return e.doc.nodesBetween(t,n,e=>{if(!(!1!==l&&r.includes(e.type)))return l=!1,!1;l=!0}),l||!1},R=e=>e.selection.empty?null:Y(e,e.selection.from,e.selection.to),Y=(e,t,n)=>{let r=null;return e.doc.nodesBetween(t,n,t=>!r&&(t.type===e.schema.nodes.image2?(r=t.attrs.href,!1):void(t.type===e.schema.nodes.image3&&(r=t.attrs.href)))),r||null},F=(e,t,n)=>{e.selection.empty||P(e,t,e.selection.from,e.selection.to,n)},P=(e,t,n,r,l)=>{e.doc.nodesBetween(n,r,(n,r)=>{(n.type===e.schema.nodes.image2||n.type===e.schema.nodes.image3)&&t.setNodeMarkup(r,n.type,Object.assign({},n.attrs,{href:l}),n.marks)})},W=e=>({top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}),q=(e,t,n,r)=>{let l=document.body,o=window.innerWidth<=481,i=H(e,t.from,t.to,t=>[e.state.schema.nodes.image,e.state.schema.nodes.image2].includes(t.type))?-44:8,a=W(e.coordsAtPos(t.from)),s=W(e.coordsAtPos(t.to));n.style.position=”fixed”;let c=s.bottom+(o?l.scrollTop:0),u=l.clientHeight-n.clientHeight-96-i;a.topn.clientWidth?(r&&(r.style.left=”10px”),n.style.right=””,n.style.left=””.concat(a.left,”px”)):(r&&(r.style.left=””.concat(a.left-l.clientWidth+n.clientWidth,”px”)),n.style.right=”10px”,n.style.left=””),o||c{let l=!1;return e.state.doc.nodesBetween(t,n,e=>{if(l)return!1;l=r(e)}),l},j=(e,t)=>{var n;return t.includes(null==(n=e.doc.resolve(e.selection.from).node(1))?void 0:n.type)},J=(e,t)=>{var n,r,l;let i=e.tr,a=i.selection instanceof o.U3,s=a&&(null==(l=i.selection.$from)||null==(r=l.parent)||null==(n=r.content)?void 0:n.size)===0?e.selection.to-1:e.selection.to;if(Array.isArray(t))for(let e of t.slice().reverse())i.insert(s,e);else i.insert(s,t);return a||i.setSelection(o.nh.near(i.doc.resolve(s))),i},V=(e,t)=>{let n=e.tr;return n.replaceSelectionWith(t),n},X=e=>!!w(e,e=>”paywall”===e.type)},8221:function(e,t,n){function r(e){let{tr:t,schema:n}=e,r=!1,l=1,o=1;return t.doc.descendants((e,i)=>{if(e.type===n.nodes.footnote){if(e.attrs.number!==l){let o=n.nodes.footnote.create({number:l},e.content);t.replaceWith(i,i+e.nodeSize,o),r=!0}l+=1}else if(e.type===n.nodes.footnoteAnchor){if(e.attrs.number!==o){let l=n.nodes.footnoteAnchor.create({number:o});t.replaceWith(i,i+e.nodeSize,l),r=!0}o+=1}}),r}function l(e){let{tr:t,schema:n}=e,r=0;t.doc.nodesBetween(0,t.selection.from,e=>{e.type===n.nodes.footnoteAnchor&&(r+=1)});let l=[];if(t.doc.forEach((e,t)=>{e.type===n.nodes.footnote&&l.push(t)}),rl,TD:()=>r})}}]);
“;return(t.length>0?t[t.length-1]:null)===A&&(t.pop(),e+=”* “),{open:e,close:”
“}}return null},C=e=>{var t,n,r;let{node:l,recursiveDepth:o,tokens:i}=e;if(o>100)return console.warn(“Reached max recursive depth while converting document to HTML for podcast”),!1;let a=!0;if(x.has(null==(t=l.type)?void 0:t.name))a=!1;else if(l.isText){if(l.text&&l.text.length>0){let e=l.marks.find(e=>”link”===e.type.name&&e.attrs.href&&”string”==typeof e.attrs.href),t=l.marks.find(e=>”em”===e.type.name),n=l.marks.find(e=>”strong”===e.type.name),r=l.text;t&&(r=”“.concat(r,”“)),n&&(r=”“.concat(r,”“)),e&&(r=’‘).concat(r,”“)),i.push(r)}}else if(S(l,[])){let e=S(l,i);e&&i.push(e.open),l.descendants(e=>C({node:e,recursiveDepth:o+1,tokens:i})),e&&i.push(e.close),a=!1}else if((null==(n=l.type)?void 0:n.name)===”cashtag”)i.push(“”.concat(l.attrs.symbol,” “));else if((null==(r=l.type)?void 0:r.name)===”substack_mentions”){let e=l.marks.find(e=>”em”===e.type.name),t=l.marks.find(e=>”strong”===e.type.name),n=l.attrs.name;if(e&&(n=”“.concat(n,”“)),t&&(n=”“.concat(n,”“)),”user”===l.attrs.type){let e=(0,d.rf)(l.attrs.id,l.attrs.name);i.push(‘‘).concat(n,”“))}else if(“pub”===l.attrs.type){let e=l.attrs.url;i.push(‘‘).concat(n,”“))}}return a},D=e=>{let t=[];return e.descendants(e=>C({node:e,recursiveDepth:1,tokens:t})),t.filter(e=>e!==A).join(“”).trim()},T=function(e){let{withLinks:t=!0,withCaptionsAndFootnotes:n=!1,withQuotes:r=!0,forPodcast:l=!1,truncateAt:o=null,truncateTo:i=o,truncateEllipsis:s=”…”,truncateExtension:c=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=””,f=””,m=””,h=!0;return e.nodesBetween(0,e.content.size,e=>{var o,g,v,y,b,k,w;if(!n&&[“caption”,”footnote”].includes(null==(o=e.type)?void 0:o.name)||!r&&((null==(g=e.type)?void 0:g.name)===”pullquote”||(null==(v=e.type)?void 0:v.name)===”blockquote”||(null==(y=e.type)?void 0:y.name)===”calloutBlock”))return!1;if(e.isText){if(e.text&&e.text.length>0){let n;h=!1,!a()(i)&&d.length=i&&(n=(0,p.truncateText)(e.text,i-d.length,{ellipsis:s,extension:c}));let r=e.marks.filter(e=>”link”===e.type.name&&e.attrs.href)[0],o=e.marks.filter(e=>”em”===e.type.name)[0],g=e.marks.filter(e=>”strong”===e.type.name)[0],v=e.text;d+=v,o&&l&&(n&&(n=”“.concat(n,”“)),v=”“.concat(v,”“)),g&&l&&(n&&(n=”“.concat(n,”“)),v=”“.concat(v,”“)),r&&t?l?(n&&(m=””.concat(f,’‘).concat(n,”“)),f+=’‘).concat(v,”“)):(n&&(m=””.concat(f).concat(n,” [ “).concat(r.attrs.href,” ]”)),f+=””.concat(v,” [ “).concat(r.attrs.href,” ]”)):(n&&(m=f+n),f+=v)}}else!h&&[“hard_break”,”hardBreak”].includes(null==(b=e.type)?void 0:b.name)?(h=!0,d+=”\n”,l?f+=”“:f+=”\n”):!h&&e.isBlock?(h=!0,d+=”\n”,l?f+=”
“:f+=”\n”):(null==(k=e.type)?void 0:k.name)===”cashtag”?f+=””.concat(e.attrs.symbol,” “):(null==(w=e.type)?void 0:w.name)===”substack_mentions”&&(f+=””.concat(e.attrs.name,” “))},0),!a()(o)&&d.length>o&&m&&(f=m),f=f.trim(),l&&(f=f.replace(/\s*(
)+$/,””).trim()),f},N=e=>””.concat(c()(e,”.”),”…”),O=(e,t)=>(0,l._)((0,r._)({name:e},t),{addAttributes:()=>t.attrs||{},parseHTML:()=>t.parseDOM,renderHTML(n){let{node:r}=n;if(!t.toDOM)return console.warn(“trying to create TipTapNode, no toDOM found for node”,e),[“span”];try{return t.toDOM(r)}catch(t){try{return console.error(“error in toDOM for node”,e,t),(0,f.D)({msg:null,node:r,err:t,group:r.isInline?”inline”:”block”})}catch(t){return console.error(“error rendering error element for node”,e,t),(null==r?void 0:r.isInline)?[“span”]:[“div”]}}}}),L=(e,t)=>{let n,r,l;if(e.doc.nodesBetween(e.selection.from,e.selection.to,(e,o)=>{if(n||r)return!1;let i=e.marks.find(e=>e.type===t);i&&(n=e,r=i,l={from:o,to:o+e.nodeSize})}),n)return{node:n,mark:r,pos:l}},M=(e,t)=>{let n,r,l;if(e.doc.nodesBetween(e.selection.from,e.selection.to,(o,i)=>{if(n||r||!(i<=e.selection.from)||!(e.selection.to<=i+o.nodeSize))return!1;{let e=o.marks.find(e=>e.type===t);e&&(n=o,r=e,l={from:i,to:i+o.nodeSize})}}),!n){if(e.selection.empty){let a=e.doc.resolve(e.selection.from),s=a.nodeBefore&&a.nodeBefore.marks.find(e=>e.type===t),c=a.nodeAfter&&a.nodeAfter.marks.find(e=>e.type===t);if(s||c){var o,i;n=c?a.nodeAfter:a.nodeBefore,r=c||s,l=c?{from:a.pos,to:a.pos+a.nodeAfter.nodeSize}:{from:a.pos-(null!=(i=null==(o=a.nodeBefore)?void 0:o.nodeSize)?i:0),to:a.pos}}}if(!n)return}return{node:n,mark:r,pos:l}},B=function(e){let{allowedMarks:t=[]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!!e.selection.empty||I(e,e.selection.from,e.selection.to,{allowedMarks:t})},I=function(e,t,n){let{allowedMarks:r=[]}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},l=!0,o=!1;return e.doc.nodesBetween(t,n,t=>{if(!l)return!1;t.type!==e.schema.nodes.text?o?l=!1:o=!0:t.marks.find(e=>!r.includes(e.type))&&(l=!1)}),l},z=(e,t)=>{if(e.selection.empty)return!1;let n=Array.isArray(t)?t:[t];if(“node”in e.selection){var r;let t=e.selection;return n.includes(null==(r=t.node)?void 0:r.type)}return U(e,e.selection.from,e.selection.to,n)},U=(e,t,n,r)=>{let l=null;return e.doc.nodesBetween(t,n,e=>{if(!(!1!==l&&r.includes(e.type)))return l=!1,!1;l=!0}),l||!1},R=e=>e.selection.empty?null:Y(e,e.selection.from,e.selection.to),Y=(e,t,n)=>{let r=null;return e.doc.nodesBetween(t,n,t=>!r&&(t.type===e.schema.nodes.image2?(r=t.attrs.href,!1):void(t.type===e.schema.nodes.image3&&(r=t.attrs.href)))),r||null},F=(e,t,n)=>{e.selection.empty||P(e,t,e.selection.from,e.selection.to,n)},P=(e,t,n,r,l)=>{e.doc.nodesBetween(n,r,(n,r)=>{(n.type===e.schema.nodes.image2||n.type===e.schema.nodes.image3)&&t.setNodeMarkup(r,n.type,Object.assign({},n.attrs,{href:l}),n.marks)})},W=e=>({top:e.top+window.scrollY,bottom:e.bottom+window.scrollY,left:e.left+window.scrollX,right:e.right+window.scrollX}),q=(e,t,n,r)=>{let l=document.body,o=window.innerWidth<=481,i=H(e,t.from,t.to,t=>[e.state.schema.nodes.image,e.state.schema.nodes.image2].includes(t.type))?-44:8,a=W(e.coordsAtPos(t.from)),s=W(e.coordsAtPos(t.to));n.style.position=”fixed”;let c=s.bottom+(o?l.scrollTop:0),u=l.clientHeight-n.clientHeight-96-i;a.top