@squeed/flow-sdk 2.0.35 → 2.0.36

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.
@@ -0,0 +1,23 @@
1
+ "use strict";var Gn=Object.create;var je=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var Bn=Object.getOwnPropertyNames;var jn=Object.getPrototypeOf,Yn=Object.prototype.hasOwnProperty;var $n=(n,r,a,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of Bn(r))!Yn.call(n,u)&&u!==a&&je(n,u,{get:()=>r[u],enumerable:!(c=Wn(r,u))||c.enumerable});return n};var Xn=(n,r,a)=>(a=n!=null?Gn(jn(n)):{},$n(r||!n||!n.__esModule?je(a,"default",{value:n,enumerable:!0}):a,n));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE */function Ye(n,r){(r==null||r>n.length)&&(r=n.length);for(var a=0,c=Array(r);a<r;a++)c[a]=n[a];return c}function Vn(n){if(Array.isArray(n))return n}function qn(n,r){var a=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(a!=null){var c,u,m,A,z=[],y=!0,j=!1;try{if(m=(a=a.call(n)).next,r!==0)for(;!(y=(c=m.call(a)).done)&&(z.push(c.value),z.length!==r);y=!0);}catch(J){j=!0,u=J}finally{try{if(!y&&a.return!=null&&(A=a.return(),Object(A)!==A))return}finally{if(j)throw u}}return z}}function Kn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zn(n,r){return Vn(n)||qn(n,r)||Jn(n,r)||Kn()}function Jn(n,r){if(n){if(typeof n=="string")return Ye(n,r);var a={}.toString.call(n).slice(8,-1);return a==="Object"&&n.constructor&&(a=n.constructor.name),a==="Map"||a==="Set"?Array.from(n):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Ye(n,r):void 0}}const an=Object.entries,$e=Object.setPrototypeOf,Qn=Object.isFrozen,to=Object.getPrototypeOf,eo=Object.getOwnPropertyDescriptor;let S=Object.freeze,O=Object.seal,ct=Object.create,ln=typeof Reflect<"u"&&Reflect,ae=ln.apply,le=ln.construct;S||(S=function(r){return r});O||(O=function(r){return r});ae||(ae=function(r,a){for(var c=arguments.length,u=new Array(c>2?c-2:0),m=2;m<c;m++)u[m-2]=arguments[m];return r.apply(a,u)});le||(le=function(r){for(var a=arguments.length,c=new Array(a>1?a-1:0),u=1;u<a;u++)c[u-1]=arguments[u];return new r(...c)});const Z=b(Array.prototype.forEach),no=b(Array.prototype.lastIndexOf),Xe=b(Array.prototype.pop),Tt=b(Array.prototype.push),oo=b(Array.prototype.splice),ut=Array.isArray,Et=b(String.prototype.toLowerCase),ee=b(String.prototype.toString),Ve=b(String.prototype.match),gt=b(String.prototype.replace),qe=b(String.prototype.indexOf),ro=b(String.prototype.trim),io=b(Number.prototype.toString),so=b(Boolean.prototype.toString),Ke=typeof BigInt>"u"?null:b(BigInt.prototype.toString),Ze=typeof Symbol>"u"?null:b(Symbol.prototype.toString),N=b(Object.prototype.hasOwnProperty),_t=b(Object.prototype.toString),R=b(RegExp.prototype.test),K=ao(TypeError);function b(n){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var a=arguments.length,c=new Array(a>1?a-1:0),u=1;u<a;u++)c[u-1]=arguments[u];return ae(n,r,c)}}function ao(n){return function(){for(var r=arguments.length,a=new Array(r),c=0;c<r;c++)a[c]=arguments[c];return le(n,a)}}function p(n,r){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Et;if($e&&$e(n,null),!ut(r))return n;let c=r.length;for(;c--;){let u=r[c];if(typeof u=="string"){const m=a(u);m!==u&&(Qn(r)||(r[c]=m),u=m)}n[u]=!0}return n}function lo(n){for(let r=0;r<n.length;r++)N(n,r)||(n[r]=null);return n}function C(n){const r=ct(null);for(const c of an(n)){var a=Zn(c,2);const u=a[0],m=a[1];N(n,u)&&(ut(m)?r[u]=lo(m):m&&typeof m=="object"&&m.constructor===Object?r[u]=C(m):r[u]=m)}return r}function co(n){switch(typeof n){case"string":return n;case"number":return io(n);case"boolean":return so(n);case"bigint":return Ke?Ke(n):"0";case"symbol":return Ze?Ze(n):"Symbol()";case"undefined":return _t(n);case"function":case"object":{if(n===null)return _t(n);const r=n,a=x(r,"toString");if(typeof a=="function"){const c=a(r);return typeof c=="string"?c:_t(c)}return _t(n)}default:return _t(n)}}function x(n,r){for(;n!==null;){const c=eo(n,r);if(c){if(c.get)return b(c.get);if(typeof c.value=="function")return b(c.value)}n=to(n)}function a(){return null}return a}function uo(n){try{return R(n,""),!0}catch{return!1}}const Je=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ne=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),oe=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fo=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),re=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),po=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Qe=S(["#text"]),tn=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ie=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),en=S(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xt=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),mo=O(/{{[\w\W]*|^[\w\W]*}}/g),ho=O(/<%[\w\W]*|^[\w\W]*%>/g),To=O(/\${[\w\W]*/g),go=O(/^data-[\-\w.\u00B7-\uFFFF]+$/),_o=O(/^aria-[\-\w]+$/),nn=O(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Eo=O(/^(?:\w+script|data):/i),Ao=O(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),yo=O(/^html$/i),bo=O(/^[a-z][.\w]*(-[.\w]+)+$/i),on=O(/<[/\w!]/g),rn=O(/<[/\w]/g),So=O(/<\/no(script|embed|frames)/i),Oo=O(/\/>/i),M={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},cn=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Ro=S(p({},cn)),wo=(function(){const n={};return Z(cn,r=>{n[r]=O(new RegExp("</"+r+"(?=[\\t\\n\\f\\r />])","i"))}),S(n)})(),Do=function(){return typeof window>"u"?null:window},Lo=function(r,a){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let c=null;const u="data-tt-policy-suffix";a&&a.hasAttribute(u)&&(c=a.getAttribute(u));const m="dompurify"+(c?"#"+c:"");try{return r.createPolicy(m,{createHTML(A){return A},createScriptURL(A){return A}})}catch{return console.warn("TrustedTypes policy "+m+" could not be created."),null}},sn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},B=function(r,a,c,u){return N(r,a)&&ut(r[a])?p(u.base?C(u.base):{},r[a],u.transform):c},se=function(r,a,c){const u=N(r,a)?r[a]:void 0;return u&&typeof u=="object"?C(u):c()};function un(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Do();const r=i=>un(i);if(r.version="3.4.15",r.removed=[],!n||!n.document||n.document.nodeType!==M.document||!n.Element)return r.isSupported=!1,r;let a=n.document;const c=a,u=c.currentScript;n.DocumentFragment;const m=n.HTMLTemplateElement,A=n.Node,z=n.Element,y=n.NodeFilter,j=n.NamedNodeMap;j===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const J=n.DOMParser,F=n.trustedTypes,P=z.prototype,fn=x(P,"cloneNode"),vt=x(P,"remove"),ce=x(P,"removeAttributeNode"),pn=x(P,"nextSibling"),Q=x(P,"childNodes"),tt=x(P,"parentNode"),ue=x(P,"shadowRoot"),kt=x(P,"attributes"),Y=A&&A.prototype?x(A.prototype,"nodeType"):null,et=A&&A.prototype?x(A.prototype,"nodeName"):null,At=A&&A.prototype?x(A.prototype,"ownerDocument"):null,ft=function(t){return Y?Y(t):t.nodeType},Ut=function(t){return et?et(t):t.nodeName};if(typeof m=="function"){const i=a.createElement("template");i.content&&i.content.ownerDocument&&(a=i.content.ownerDocument)}let D,$="",Ft,fe=!1,pt=0;const pe=function(){if(pt>0)throw K('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},nt=function(t){pe(),pt++;try{return D.createHTML(t)}finally{pt--}},mn=function(t){pe(),pt++;try{return D.createScriptURL(t)}finally{pt--}},dn=function(){return fe||(Ft=Lo(F,u),fe=!0),Ft},yt=a,zt=yt.implementation,me=yt.createNodeIterator,hn=yt.createDocumentFragment,Tn=yt.getElementsByTagName,gn=c.importNode;let h=sn();r.isSupported=typeof an=="function"&&typeof tt=="function"&&zt&&zt.createHTMLDocument!==void 0;const _n=mo,En=ho,An=To,yn=go,bn=_o,Sn=Eo,de=Ao,On=bo;let he=nn,T=null;const Ht=p({},[...Je,...ne,...oe,...re,...Qe]);let g=null;const Gt=p({},[...tn,...ie,...en,...xt]);let v=Object.seal(ct(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),mt=null,Te=null;const H=Object.seal(ct(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ge=!0,Wt=!0,_e=!1,Ee=!0,G=!1,X=!0,V=!1,Bt=!1,bt=null,St=null,jt=!1,ot=!1,Ot=!1,Rt=!1,Ae=!0,ye=!1;const be="user-content-";let Yt=!0,$t=!1,rt={},it=null;const Se=p({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Oe=null;const Re=p({},["audio","video","img","source","image","track"]);let we=null;const De=p({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),wt="http://www.w3.org/1998/Math/MathML",Dt="http://www.w3.org/2000/svg",k="http://www.w3.org/1999/xhtml";let st=k,Xt=!1,Vt=null;const Rn=p({},[wt,Dt,k],ee),Le=S(["mi","mo","mn","ms","mtext"]);let qt=p({},Le);const Ie=S(["annotation-xml"]);let Kt=p({},Ie);const wn=p({},["title","style","font","a","script"]);let dt=null;const Dn=["application/xhtml+xml","text/html"],Ln="text/html";let E=null,at=null;const In=a.createElement("form"),Ne=function(t){return t instanceof RegExp||t instanceof Function},Zt=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(at&&at===t)return;(!t||typeof t!="object")&&(t={}),t=C(t),dt=Dn.indexOf(t.PARSER_MEDIA_TYPE)===-1?Ln:t.PARSER_MEDIA_TYPE,E=dt==="application/xhtml+xml"?ee:Et,T=B(t,"ALLOWED_TAGS",Ht,{transform:E}),g=B(t,"ALLOWED_ATTR",Gt,{transform:E}),Vt=B(t,"ALLOWED_NAMESPACES",Rn,{transform:ee}),we=B(t,"ADD_URI_SAFE_ATTR",De,{transform:E,base:De}),Oe=B(t,"ADD_DATA_URI_TAGS",Re,{transform:E,base:Re}),it=B(t,"FORBID_CONTENTS",Se,{transform:E}),mt=B(t,"FORBID_TAGS",C({}),{transform:E}),Te=B(t,"FORBID_ATTR",C({}),{transform:E}),rt=N(t,"USE_PROFILES")?t.USE_PROFILES&&typeof t.USE_PROFILES=="object"?C(t.USE_PROFILES):t.USE_PROFILES:!1,ge=t.ALLOW_ARIA_ATTR!==!1,Wt=t.ALLOW_DATA_ATTR!==!1,_e=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=t.SAFE_FOR_TEMPLATES||!1,X=t.SAFE_FOR_XML!==!1,V=t.WHOLE_DOCUMENT||!1,ot=t.RETURN_DOM||!1,Ot=t.RETURN_DOM_FRAGMENT||!1,Rt=t.RETURN_TRUSTED_TYPE||!1,jt=t.FORCE_BODY||!1,Ae=t.SANITIZE_DOM!==!1,ye=t.SANITIZE_NAMED_PROPS||!1,Yt=t.KEEP_CONTENT!==!1,$t=t.IN_PLACE||!1,he=uo(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:nn,st=typeof t.NAMESPACE=="string"?t.NAMESPACE:k,qt=se(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>p({},Le)),Kt=se(t,"HTML_INTEGRATION_POINTS",()=>p({},Ie));const e=se(t,"CUSTOM_ELEMENT_HANDLING",()=>ct(null));if(v=ct(null),N(e,"tagNameCheck")&&Ne(e.tagNameCheck)&&(v.tagNameCheck=e.tagNameCheck),N(e,"attributeNameCheck")&&Ne(e.attributeNameCheck)&&(v.attributeNameCheck=e.attributeNameCheck),N(e,"allowCustomizedBuiltInElements")&&typeof e.allowCustomizedBuiltInElements=="boolean"&&(v.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),O(v),G&&(Wt=!1),Ot&&(ot=!0),rt&&(T=p({},Qe),g=ct(null),rt.html===!0&&(p(T,Je),p(g,tn)),rt.svg===!0&&(p(T,ne),p(g,ie),p(g,xt)),rt.svgFilters===!0&&(p(T,oe),p(g,ie),p(g,xt)),rt.mathMl===!0&&(p(T,re),p(g,en),p(g,xt))),H.tagCheck=null,H.attributeCheck=null,N(t,"ADD_TAGS")&&(typeof t.ADD_TAGS=="function"?H.tagCheck=t.ADD_TAGS:ut(t.ADD_TAGS)&&(T===Ht&&(T=C(T)),p(T,t.ADD_TAGS,E))),N(t,"ADD_ATTR")&&(typeof t.ADD_ATTR=="function"?H.attributeCheck=t.ADD_ATTR:ut(t.ADD_ATTR)&&(g===Gt&&(g=C(g)),p(g,t.ADD_ATTR,E))),N(t,"ADD_FORBID_CONTENTS")&&ut(t.ADD_FORBID_CONTENTS)&&(it===Se&&(it=C(it)),p(it,t.ADD_FORBID_CONTENTS,E)),Yt&&(T["#text"]=!0),V&&p(T,["html","head","body"]),T.table&&(p(T,["tbody"]),delete mt.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw K('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const o=D;D=t.TRUSTED_TYPES_POLICY;try{$=nt("")}catch(s){throw D=o,s}}else t.TRUSTED_TYPES_POLICY===null?(D=void 0,$=""):(D===void 0&&(D=dn()),D&&typeof $=="string"&&($=nt("")));S&&S(t),at=t},Me=p({},[...ne,...oe,...fo]),Ce=p({},[...re,...po]),Nn=function(t,e,o){return e.namespaceURI===k?t==="svg":e.namespaceURI===wt?t==="svg"&&(o==="annotation-xml"||qt[o]):!!Me[t]},Mn=function(t,e,o){return e.namespaceURI===k?t==="math":e.namespaceURI===Dt?t==="math"&&Kt[o]:!!Ce[t]},Cn=function(t,e,o){return e.namespaceURI===Dt&&!Kt[o]||e.namespaceURI===wt&&!qt[o]?!1:!Ce[t]&&(wn[t]||!Me[t])},Pn=function(t){let e=tt(t);(!e||!e.tagName)&&(e={namespaceURI:st,tagName:"template"});const o=Et(t.tagName),s=Et(e.tagName);return Vt[t.namespaceURI]?t.namespaceURI===Dt?Nn(o,e,s):t.namespaceURI===wt?Mn(o,e,s):t.namespaceURI===k?Cn(o,e,s):!!(dt==="application/xhtml+xml"&&Vt[t.namespaceURI]):!1},W=function(t){Tt(r.removed,{element:t});try{tt(t).removeChild(t)}catch{if(vt(t),!tt(t))throw K("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Pe=function(t,e,o){try{ce(t,e)}catch{try{t.removeAttribute(o)}catch{}}},Lt=function(t){It(t);const e=Q(t);if(e){const s=[];Z(e,l=>{Tt(s,l)}),Z(s,l=>{try{vt(l)}catch{}})}const o=kt(t);if(o)for(let s=o.length-1;s>=0;--s){const l=o[s],f=l&&l.name;typeof f=="string"&&Pe(t,l,f)}},q=function(t,e,o){if(!o)try{o=e.getAttributeNode(t)}catch{o=null}Tt(r.removed,{attribute:o||null,from:e});try{o?ce(e,o):e.removeAttribute(t)}catch{try{e.removeAttribute(t)}catch{}}if(t==="is")if(ot||Ot)try{W(e)}catch{}else try{e.setAttribute(t,"")}catch{}},xn=function(t){const e=kt(t);if(e)for(let o=e.length-1;o>=0;--o){const s=e[o],l=s&&s.name;typeof l!="string"||g[E(l)]||Pe(t,s,l)}},It=function(t){const e=[t];for(;e.length>0;){const o=e.pop();ft(o)===M.element&&xn(o);const l=Q(o);if(l)for(let f=l.length-1;f>=0;--f)e.push(l[f])}},xe=function(t,e){return X?t==="patchsrc"?!0:t==="for"&&e!=="label"&&e!=="output":!1},vn=function(t){if(!X)return;const e=[t];for(;e.length>0;){const o=e.pop(),s=ft(o);if(s===M.processingInstruction||s===M.comment&&R(rn,o.data)){try{vt(o)}catch{}continue}if(s===M.element){const f=o,d=E(Ut(o));try{f.hasAttribute&&f.hasAttribute("patchsrc")&&f.removeAttribute("patchsrc"),f.hasAttribute&&f.hasAttribute("for")&&xe("for",d)&&f.removeAttribute("for")}catch{}}const l=Q(o);if(l)for(let f=l.length-1;f>=0;--f)e.push(l[f])}},ve=function(t){let e=null,o=null;if(jt)t="<remove></remove>"+t;else{const f=Ve(t,/^[\r\n\t ]+/);o=f&&f[0]}dt==="application/xhtml+xml"&&st===k&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const s=D?nt(t):t;if(st===k)try{e=new J().parseFromString(s,dt)}catch{}if(!e||!e.documentElement){e=zt.createDocument(st,"template",null);try{e.documentElement.innerHTML=Xt?$:s}catch{}}const l=e.body||e.documentElement;return t&&o&&l.insertBefore(a.createTextNode(o),l.childNodes[0]||null),st===k?Tn.call(e,V?"html":"body")[0]:V?e.documentElement:l},ke=function(t){const e=At?At(t):t.ownerDocument;return me.call(e||t,t,y.SHOW_ELEMENT|y.SHOW_COMMENT|y.SHOW_TEXT|y.SHOW_PROCESSING_INSTRUCTION|y.SHOW_CDATA_SECTION,null)},Nt=function(t){return t=gt(t,_n," "),t=gt(t,En," "),t=gt(t,An," "),t},Jt=function(t){var e;t.normalize();const o=At?At(t):t.ownerDocument,s=me.call(o||t,t,y.SHOW_TEXT|y.SHOW_COMMENT|y.SHOW_CDATA_SECTION|y.SHOW_PROCESSING_INSTRUCTION,null);let l=s.nextNode();for(;l;)l.data=Nt(l.data),l=s.nextNode();const f=(e=t.querySelectorAll)===null||e===void 0?void 0:e.call(t,"template");f&&Z(f,d=>{lt(d.content)&&Jt(d.content)})},Mt=function(t){const e=et?et(t):null;return typeof e!="string"||E(e)!=="form"?!1:typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||t.attributes!==kt(t)||typeof t.removeAttribute!="function"||typeof t.removeAttributeNode!="function"||typeof t.getAttributeNode!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function"||t.nodeType!==Y(t)||t.childNodes!==Q(t)},lt=function(t){if(!Y||typeof t!="object"||t===null)return!1;try{return Y(t)===M.documentFragment}catch{return!1}},ht=function(t){if(!Y||typeof t!="object"||t===null)return!1;try{return typeof Y(t)=="number"}catch{return!1}};function U(i,t,e){i.length!==0&&Z(i,o=>{o.call(r,t,e,at)})}const kn=function(t,e){return!!(X&&t.hasChildNodes()&&!ht(t.firstElementChild)&&R(on,t.textContent)&&R(on,t.innerHTML)||X&&t.namespaceURI===k&&Ro[e]&&(ht(t.firstElementChild)||typeof t.textContent=="string"&&R(wo[e],t.textContent))||t.nodeType===M.processingInstruction||X&&t.nodeType===M.comment&&R(rn,t.data))},Ct=function(t,e){if(t instanceof RegExp)return R(t,e);if(t instanceof Function){for(var o=arguments.length,s=new Array(o>2?o-2:0),l=2;l<o;l++)s[l-2]=arguments[l];return!!t(e,...s)}return!1},Un=function(t,e,o){if(!mt[e]&&Ge(e)&&Ct(v.tagNameCheck,e))return!1;if(Yt&&!it[e]){const s=tt(t),l=Q(t);if(l&&s){const f=l.length;for(let d=f-1;d>=0;--d){const _=t===o?fn(l[d],!0):l[d];s.insertBefore(_,pn(t))}}}return W(t),!0},Ue=function(t,e,o,s){return t.length===0?e:e===o||e===s?C(e):e},Fe=function(t,e){return t===e||tt(t)!==null?!1:($t&&It(t),!0)},ze=function(t,e){if(U(h.beforeSanitizeElements,t,null),Fe(t,e))return!0;if(Mt(t))return W(t),!0;const o=E(Ut(t));if(T=Ue(h.uponSanitizeElement,T,Ht,bt),U(h.uponSanitizeElement,t,{tagName:o,allowedTags:T}),Fe(t,e))return!0;if(kn(t,o))return W(t),!0;if(mt[o]||!(H.tagCheck instanceof Function&&H.tagCheck(o))&&!T[o]){const l=Un(t,o,e);return l===!1&&U(h.afterSanitizeElements,t,null),l}if(ft(t)===M.element&&!Pn(t)||(o==="noscript"||o==="noembed"||o==="noframes")&&R(So,t.innerHTML))return W(t),!0;if(G&&t.nodeType===M.text){const l=Nt(t.textContent);t.textContent!==l&&(Tt(r.removed,{element:t.cloneNode()}),t.textContent=l)}return U(h.afterSanitizeElements,t,null),!1},He=function(t,e,o){if(Te[e]||xe(e,t)||Ae&&(e==="id"||e==="name")&&(o in a||o in In))return!1;const s=g[e]||H.attributeCheck instanceof Function&&H.attributeCheck(e,t);return Wt&&R(yn,e)||ge&&R(bn,e)?!0:s?we[e]||R(he,gt(o,de,""))||(e==="src"||e==="xlink:href"||e==="href")&&t!=="script"&&qe(o,"data:")===0&&Oe[t]||_e&&!R(Sn,gt(o,de,""))?!0:!o:Ge(t)&&Ct(v.tagNameCheck,t)&&Ct(v.attributeNameCheck,e,t)||e==="is"&&v.allowCustomizedBuiltInElements&&Ct(v.tagNameCheck,o)},Fn=p({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ge=function(t){return!Fn[Et(t)]&&R(On,t)},zn=function(t,e,o,s){if(D&&typeof F=="object"&&typeof F.getAttributeType=="function"&&!o)switch(F.getAttributeType(t,e)){case"TrustedHTML":return nt(s);case"TrustedScriptURL":return mn(s)}return s},Hn=function(t,e,o,s){try{return o?t.setAttributeNS(o,e,s):t.setAttribute(e,s),Mt(t)?(W(t),!1):!0}catch{return q(e,t),!1}},We=function(t){U(h.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||Mt(t))return;g=Ue(h.uponSanitizeAttribute,g,Gt,St);const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:g,forceKeepAttr:void 0};let s=e.length;const l=E(t.nodeName);for(;s--;){const f=e[s],d=f.name,_=f.namespaceURI,L=f.value,I=E(d),te=L;let w=d==="value"?te:ro(te),Be=!1;if(o.attrName=I,o.attrValue=w,o.keepAttr=!0,o.forceKeepAttr=void 0,U(h.uponSanitizeAttribute,t,o),w=o.attrValue,ye&&(I==="id"||I==="name")&&qe(w,be)!==0&&(q(d,t,f),w=be+w,Be=!0),X&&R(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,w)){q(d,t,f);continue}if(I==="attributename"&&Ve(w,"href")){q(d,t,f);continue}if(!o.forceKeepAttr){if(!o.keepAttr){q(d,t,f);continue}if(!Ee&&R(Oo,w)){q(d,t,f);continue}if(G&&(w=Nt(w)),!He(l,I,w)){q(d,t,f);continue}w=zn(l,I,_,w),w!==te&&Hn(t,d,_,w)&&Be&&Xe(r.removed)}}U(h.afterSanitizeAttributes,t,null)},Pt=function(t){let e=null;const o=ke(t);for(U(h.beforeSanitizeShadowDOM,t,null);e=o.nextNode();)if(U(h.uponSanitizeShadowNode,e,null),ze(e,t),We(e),lt(e.content)&&Pt(e.content),ft(e)===M.element){const s=ue(e);lt(s)&&(Qt(s),Pt(s))}U(h.afterSanitizeShadowDOM,t,null)},Qt=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const o=e.pop();if(o.shadow){Pt(o.shadow);continue}const s=o.node,f=ft(s)===M.element,d=Q(s);if(d)for(let _=d.length-1;_>=0;--_)e.push({node:d[_],shadow:null});if(f){const _=et?et(s):null;if(typeof _=="string"&&E(_)==="template"){const L=s.content;lt(L)&&e.push({node:L,shadow:null})}}if(f){const _=ue(s);lt(_)&&e.push({node:null,shadow:_},{node:_,shadow:null})}}};return r.sanitize=function(i){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},e=null,o=null,s=null,l=null;if(Xt=!i,Xt&&(i="<!-->"),typeof i!="string"&&!ht(i)&&(i=co(i),typeof i!="string"))throw K("dirty is not a string, aborting");if(!r.isSupported)return i;Bt?(T=bt,g=St):Zt(t),(h.uponSanitizeElement.length>0||h.uponSanitizeAttribute.length>0)&&(T=C(T)),h.uponSanitizeAttribute.length>0&&(g=C(g)),r.removed=[];const f=$t&&typeof i!="string"&&ht(i);if(f){vn(i);const L=Ut(i);if(typeof L=="string"){const I=E(L);if(!T[I]||mt[I])throw Lt(i),K("root node is forbidden and cannot be sanitized in-place")}if(Mt(i))throw Lt(i),K("root node is clobbered and cannot be sanitized in-place");try{Qt(i)}catch(I){throw Lt(i),I}}else if(ht(i))e=ve("<!---->"),o=e.ownerDocument.importNode(i,!0),o.nodeType===M.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?e=o:e.appendChild(o),Qt(e);else{if(!ot&&!G&&!V&&i.indexOf("<")===-1)return D&&Rt?nt(i):i;if(e=ve(i),!e)return ot?null:Rt?$:""}e&&jt&&W(e.firstChild);const d=f?i:e;try{const L=ke(d);for(;s=L.nextNode();)ze(s,d),We(s),lt(s.content)&&Pt(s.content)}catch(L){throw f&&(Lt(i),Z(r.removed,I=>{I.element&&It(I.element)})),L}if(f)return Z(r.removed,L=>{L.element&&It(L.element)}),G&&Jt(i),i;if(ot){if(G&&Jt(e),Ot)for(l=hn.call(e.ownerDocument);e.firstChild;)l.appendChild(e.firstChild);else l=e;return(g.shadowroot||g.shadowrootmode)&&(l=gn.call(c,l,!0)),l}let _=V?e.outerHTML:e.innerHTML;return V&&T["!doctype"]&&e.ownerDocument&&e.ownerDocument.doctype&&e.ownerDocument.doctype.name&&R(yo,e.ownerDocument.doctype.name)&&(_="<!DOCTYPE "+e.ownerDocument.doctype.name+`>
3
+ `+_),G&&(_=Nt(_)),D&&Rt?nt(_):_},r.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zt(i),Bt=!0,bt=T,St=g},r.clearConfig=function(){at=null,Bt=!1,bt=null,St=null,D=Ft,$=""},r.isValidAttribute=function(i,t,e){at||Zt({});const o=E(i),s=E(t);return He(o,s,e)},r.addHook=function(i,t){typeof t=="function"&&N(h,i)&&Tt(h[i],t)},r.removeHook=function(i,t){if(N(h,i)){if(t!==void 0){const e=no(h[i],t);return e===-1?void 0:oo(h[i],e,1)[0]}return Xe(h[i])}},r.removeHooks=function(i){N(h,i)&&(h[i]=[])},r.removeAllHooks=function(){h=sn()},r}var Io=un();async function No(n,r,a=!1,c=!1){var z;if(n.length>1e5)throw new Error("Preview source exceeds 100,000 characters.");const u=crypto.randomUUID();let m;if(r==="html")m=Io.sanitize(n,{WHOLE_DOCUMENT:!0,ADD_TAGS:["style"],FORBID_TAGS:["script","meta","base","link","iframe","object","embed","form"],FORBID_ATTR:["href","action","formaction","srcset"]});else{const[y,{default:j}]=await Promise.all([import("typescript"),Promise.resolve().then(()=>require("./_virtual_content-preview-runtime-Deui59HN.cjs"))]),J=y.transpileModule(n,{fileName:"preview.tsx",reportDiagnostics:!0,compilerOptions:{jsx:y.JsxEmit.React,module:y.ModuleKind.CommonJS,target:y.ScriptTarget.ES2020,esModuleInterop:!0}}),F=(z=J.diagnostics)==null?void 0:z.filter(P=>P.category===y.DiagnosticCategory.Error);if(F!=null&&F.length)throw new Error(F.map(P=>y.flattenDiagnosticMessageText(P.messageText,`
4
+ `)).join(`
5
+ `));m=`<div id="preview"></div><script type="application/json" id="source">${JSON.stringify(J.outputText).replace(/</g,"\\u003c")}<\/script><script nonce="${u}">${j.replace(/<\/script/gi,"<\\/script")}<\/script>`}return a&&(m+=`<script nonce="${u}">document.addEventListener('dblclick', function(event) {
6
+ if (event.defaultPrevented || !(event.target instanceof Element) || event.target.closest('button, a, input, textarea, select, video, audio, [contenteditable], [role="button"], [role="textbox"]')) return;
7
+ event.preventDefault();
8
+ parent.postMessage({type: 'squeed:content-edit'}, '*');
9
+ });<\/script>`),c&&(m+=`<style>body{display:flow-root}</style><script nonce="${u}">(() => {
10
+ let previous = 0;
11
+ const report = () => {
12
+ const height = Math.ceil(Math.max(document.body.getBoundingClientRect().height, document.body.scrollHeight));
13
+ if (height > 0 && height !== previous) {
14
+ previous = height;
15
+ parent.postMessage({type: 'squeed:content-size', height}, '*');
16
+ }
17
+ };
18
+ new ResizeObserver(report).observe(document.body);
19
+ window.addEventListener('load', report);
20
+ document.fonts.ready.then(report);
21
+ report();
22
+ })();<\/script>`),`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${`default-src 'none'; script-src ${r==="jsx"?`'nonce-${u}' 'unsafe-eval'`:a||c?`'nonce-${u}'`:"'none'"}; style-src 'unsafe-inline'; img-src data: blob:; media-src https: data: blob:; connect-src 'none'; base-uri 'none'; form-action 'none'; frame-src 'none';`}"><meta name="referrer" content="no-referrer"><style>html{color-scheme:light}body{margin:0;padding:0;font:16px/1.5 sans-serif;color:#18181b;background:white;overflow-wrap:anywhere}*{box-sizing:border-box}img{max-width:100%}pre{white-space:pre-wrap}</style></head><body>${m}</body></html>`}exports.contentPreviewDocument=No;
23
+ //# sourceMappingURL=contentPreviewDocument-i1zWN5gw.cjs.map