damon-utils
Version:
A post-processing library for DAMON
11 lines • 91.4 kB
JavaScript
(()=>{var Xe=(F,r)=>()=>(r||F((r={exports:{}}).exports,r),r.exports);var Bt=Xe((Rr,Jt)=>{"use strict";var{entries:zt,setPrototypeOf:kt,isFrozen:ir,getPrototypeOf:sr,getOwnPropertyDescriptor:ar}=Object,{freeze:Ae,seal:xe,create:pt}=Object,{apply:dt,construct:ht}=typeof Reflect<"u"&&Reflect;Ae||(Ae=function(r){return r});xe||(xe=function(r){return r});dt||(dt=function(r,m){for(var e=arguments.length,t=new Array(e>2?e-2:0),f=2;f<e;f++)t[f-2]=arguments[f];return r.apply(m,t)});ht||(ht=function(r){for(var m=arguments.length,e=new Array(m>1?m-1:0),t=1;t<m;t++)e[t-1]=arguments[t];return new r(...e)});var Ze=be(Array.prototype.forEach),lr=be(Array.prototype.lastIndexOf),Dt=be(Array.prototype.pop),Ke=be(Array.prototype.push),or=be(Array.prototype.splice),et=be(String.prototype.toLowerCase),at=be(String.prototype.toString),lt=be(String.prototype.match),Je=be(String.prototype.replace),fr=be(String.prototype.indexOf),ur=be(String.prototype.trim),Ne=be(Object.prototype.hasOwnProperty),ge=be(RegExp.prototype.test),Be=cr(TypeError);function be(F){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var m=arguments.length,e=new Array(m>1?m-1:0),t=1;t<m;t++)e[t-1]=arguments[t];return dt(F,r,e)}}function cr(F){return function(){for(var r=arguments.length,m=new Array(r),e=0;e<r;e++)m[e]=arguments[e];return ht(F,m)}}function B(F,r){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;kt&&kt(F,null);let e=r.length;for(;e--;){let t=r[e];if(typeof t=="string"){let f=m(t);f!==t&&(ir(r)||(r[e]=f),t=f)}F[t]=!0}return F}function pr(F){for(let r=0;r<F.length;r++)Ne(F,r)||(F[r]=null);return F}function Ie(F){let r=pt(null);for(let[m,e]of zt(F))Ne(F,m)&&(Array.isArray(e)?r[m]=pr(e):e&&typeof e=="object"&&e.constructor===Object?r[m]=Ie(e):r[m]=e);return r}function je(F,r){for(;F!==null;){let e=ar(F,r);if(e){if(e.get)return be(e.get);if(typeof e.value=="function")return be(e.value)}F=sr(F)}function m(){return null}return m}var It=Ae(["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"]),ot=Ae(["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"]),ft=Ae(["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"]),dr=Ae(["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"]),ut=Ae(["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"]),hr=Ae(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Mt=Ae(["#text"]),vt=Ae(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),ct=Ae(["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","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","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-rendering","textlength","type","u1","u2","unicode","values","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"]),$t=Ae(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),Qe=Ae(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),mr=xe(/\{\{[\w\W]*|[\w\W]*\}\}/gm),yr=xe(/<%[\w\W]*|[\w\W]*%>/gm),gr=xe(/\$\{[\w\W]*/gm),Ar=xe(/^data-[\-\w.\u00B7-\uFFFF]+$/),br=xe(/^aria-[\-\w]+$/),Ut=xe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Tr=xe(/^(?:\w+script|data):/i),_r=xe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pt=xe(/^html$/i),Er=xe(/^[a-z][.\w]*(-[.\w]+)+$/i),Ht=Object.freeze({__proto__:null,ARIA_ATTR:br,ATTR_WHITESPACE:_r,CUSTOM_ELEMENT:Er,DATA_ATTR:Ar,DOCTYPE_NAME:Pt,ERB_EXPR:yr,IS_ALLOWED_URI:Ut,IS_SCRIPT_OR_DATA:Tr,MUSTACHE_EXPR:mr,TMPLIT_EXPR:gr}),Ge={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},xr=function(){return typeof window>"u"?null:window},wr=function(r,m){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let e=null,t="data-tt-policy-suffix";m&&m.hasAttribute(t)&&(e=m.getAttribute(t));let f="dompurify"+(e?"#"+e:"");try{return r.createPolicy(f,{createHTML(n){return n},createScriptURL(n){return n}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},Ft=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Kt(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xr(),r=$=>Kt($);if(r.version="3.3.0",r.removed=[],!F||!F.document||F.document.nodeType!==Ge.document||!F.Element)return r.isSupported=!1,r;let{document:m}=F,e=m,t=e.currentScript,{DocumentFragment:f,HTMLTemplateElement:n,Node:i,Element:p,NodeFilter:c,NamedNodeMap:d=F.NamedNodeMap||F.MozNamedAttrMap,HTMLFormElement:l,DOMParser:h,trustedTypes:C}=F,_=p.prototype,x=je(_,"cloneNode"),I=je(_,"remove"),b=je(_,"nextSibling"),w=je(_,"childNodes"),N=je(_,"parentNode");if(typeof n=="function"){let $=m.createElement("template");$.content&&$.content.ownerDocument&&(m=$.content.ownerDocument)}let y,g="",{implementation:s,createNodeIterator:a,createDocumentFragment:o,getElementsByTagName:A}=m,{importNode:T}=e,E=Ft();r.isSupported=typeof zt=="function"&&typeof N=="function"&&s&&s.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:D,ERB_EXPR:j,TMPLIT_EXPR:X,DATA_ATTR:O,ARIA_ATTR:v,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:z,CUSTOM_ELEMENT:k}=Ht,{IS_ALLOWED_URI:H}=Ht,S=null,ne=B({},[...It,...ot,...ft,...ut,...Mt]),P=null,ie=B({},[...vt,...ct,...$t,...Qe]),G=Object.seal(pt(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}})),K=null,W=null,Z=Object.seal(pt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),J=!0,Q=!0,oe=!1,te=!0,q=!1,U=!0,se=!1,Y=!1,ee=!1,re=!1,we=!1,ye=!1,Me=!0,ce=!1,Ee="user-content-",le=!0,fe=!1,he={},Ce=null,ze=B({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Se=null,_e=B({},["audio","video","img","source","image","track"]),Le=null,Ue=B({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",qe="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml",$e=Oe,tt=!1,rt=null,Xt=B({},[We,qe,Oe],at),Ve=B({},["mi","mo","mn","ms","mtext"]),Ye=B({},["annotation-xml"]),Zt=B({},["title","style","font","a","script"]),Pe=null,Qt=["application/xhtml+xml","text/html"],er="text/html",pe=null,He=null,tr=m.createElement("form"),bt=function(u){return u instanceof RegExp||u instanceof Function},nt=function(){let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(He&&He===u)){if((!u||typeof u!="object")&&(u={}),u=Ie(u),Pe=Qt.indexOf(u.PARSER_MEDIA_TYPE)===-1?er:u.PARSER_MEDIA_TYPE,pe=Pe==="application/xhtml+xml"?at:et,S=Ne(u,"ALLOWED_TAGS")?B({},u.ALLOWED_TAGS,pe):ne,P=Ne(u,"ALLOWED_ATTR")?B({},u.ALLOWED_ATTR,pe):ie,rt=Ne(u,"ALLOWED_NAMESPACES")?B({},u.ALLOWED_NAMESPACES,at):Xt,Le=Ne(u,"ADD_URI_SAFE_ATTR")?B(Ie(Ue),u.ADD_URI_SAFE_ATTR,pe):Ue,Se=Ne(u,"ADD_DATA_URI_TAGS")?B(Ie(_e),u.ADD_DATA_URI_TAGS,pe):_e,Ce=Ne(u,"FORBID_CONTENTS")?B({},u.FORBID_CONTENTS,pe):ze,K=Ne(u,"FORBID_TAGS")?B({},u.FORBID_TAGS,pe):Ie({}),W=Ne(u,"FORBID_ATTR")?B({},u.FORBID_ATTR,pe):Ie({}),he=Ne(u,"USE_PROFILES")?u.USE_PROFILES:!1,J=u.ALLOW_ARIA_ATTR!==!1,Q=u.ALLOW_DATA_ATTR!==!1,oe=u.ALLOW_UNKNOWN_PROTOCOLS||!1,te=u.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=u.SAFE_FOR_TEMPLATES||!1,U=u.SAFE_FOR_XML!==!1,se=u.WHOLE_DOCUMENT||!1,re=u.RETURN_DOM||!1,we=u.RETURN_DOM_FRAGMENT||!1,ye=u.RETURN_TRUSTED_TYPE||!1,ee=u.FORCE_BODY||!1,Me=u.SANITIZE_DOM!==!1,ce=u.SANITIZE_NAMED_PROPS||!1,le=u.KEEP_CONTENT!==!1,fe=u.IN_PLACE||!1,H=u.ALLOWED_URI_REGEXP||Ut,$e=u.NAMESPACE||Oe,Ve=u.MATHML_TEXT_INTEGRATION_POINTS||Ve,Ye=u.HTML_INTEGRATION_POINTS||Ye,G=u.CUSTOM_ELEMENT_HANDLING||{},u.CUSTOM_ELEMENT_HANDLING&&bt(u.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(G.tagNameCheck=u.CUSTOM_ELEMENT_HANDLING.tagNameCheck),u.CUSTOM_ELEMENT_HANDLING&&bt(u.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(G.attributeNameCheck=u.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),u.CUSTOM_ELEMENT_HANDLING&&typeof u.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=u.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(Q=!1),we&&(re=!0),he&&(S=B({},Mt),P=[],he.html===!0&&(B(S,It),B(P,vt)),he.svg===!0&&(B(S,ot),B(P,ct),B(P,Qe)),he.svgFilters===!0&&(B(S,ft),B(P,ct),B(P,Qe)),he.mathMl===!0&&(B(S,ut),B(P,$t),B(P,Qe))),u.ADD_TAGS&&(typeof u.ADD_TAGS=="function"?Z.tagCheck=u.ADD_TAGS:(S===ne&&(S=Ie(S)),B(S,u.ADD_TAGS,pe))),u.ADD_ATTR&&(typeof u.ADD_ATTR=="function"?Z.attributeCheck=u.ADD_ATTR:(P===ie&&(P=Ie(P)),B(P,u.ADD_ATTR,pe))),u.ADD_URI_SAFE_ATTR&&B(Le,u.ADD_URI_SAFE_ATTR,pe),u.FORBID_CONTENTS&&(Ce===ze&&(Ce=Ie(Ce)),B(Ce,u.FORBID_CONTENTS,pe)),le&&(S["#text"]=!0),se&&B(S,["html","head","body"]),S.table&&(B(S,["tbody"]),delete K.tbody),u.TRUSTED_TYPES_POLICY){if(typeof u.TRUSTED_TYPES_POLICY.createHTML!="function")throw Be('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof u.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Be('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=u.TRUSTED_TYPES_POLICY,g=y.createHTML("")}else y===void 0&&(y=wr(C,t)),y!==null&&typeof g=="string"&&(g=y.createHTML(""));Ae&&Ae(u),He=u}},Tt=B({},[...ot,...ft,...dr]),_t=B({},[...ut,...hr]),rr=function(u){let R=N(u);(!R||!R.tagName)&&(R={namespaceURI:$e,tagName:"template"});let M=et(u.tagName),ae=et(R.tagName);return rt[u.namespaceURI]?u.namespaceURI===qe?R.namespaceURI===Oe?M==="svg":R.namespaceURI===We?M==="svg"&&(ae==="annotation-xml"||Ve[ae]):!!Tt[M]:u.namespaceURI===We?R.namespaceURI===Oe?M==="math":R.namespaceURI===qe?M==="math"&&Ye[ae]:!!_t[M]:u.namespaceURI===Oe?R.namespaceURI===qe&&!Ye[ae]||R.namespaceURI===We&&!Ve[ae]?!1:!_t[M]&&(Zt[M]||!Tt[M]):!!(Pe==="application/xhtml+xml"&&rt[u.namespaceURI]):!1},Re=function(u){Ke(r.removed,{element:u});try{N(u).removeChild(u)}catch{I(u)}},ve=function(u,R){try{Ke(r.removed,{attribute:R.getAttributeNode(u),from:R})}catch{Ke(r.removed,{attribute:null,from:R})}if(R.removeAttribute(u),u==="is")if(re||we)try{Re(R)}catch{}else try{R.setAttribute(u,"")}catch{}},Et=function(u){let R=null,M=null;if(ee)u="<remove></remove>"+u;else{let ue=lt(u,/^[\r\n\t ]+/);M=ue&&ue[0]}Pe==="application/xhtml+xml"&&$e===Oe&&(u='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+u+"</body></html>");let ae=y?y.createHTML(u):u;if($e===Oe)try{R=new h().parseFromString(ae,Pe)}catch{}if(!R||!R.documentElement){R=s.createDocument($e,"template",null);try{R.documentElement.innerHTML=tt?g:ae}catch{}}let me=R.body||R.documentElement;return u&&M&&me.insertBefore(m.createTextNode(M),me.childNodes[0]||null),$e===Oe?A.call(R,se?"html":"body")[0]:se?R.documentElement:me},xt=function(u){return a.call(u.ownerDocument||u,u,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},it=function(u){return u instanceof l&&(typeof u.nodeName!="string"||typeof u.textContent!="string"||typeof u.removeChild!="function"||!(u.attributes instanceof d)||typeof u.removeAttribute!="function"||typeof u.setAttribute!="function"||typeof u.namespaceURI!="string"||typeof u.insertBefore!="function"||typeof u.hasChildNodes!="function")},wt=function(u){return typeof i=="function"&&u instanceof i};function ke($,u,R){Ze($,M=>{M.call(r,u,R,He)})}let Nt=function(u){let R=null;if(ke(E.beforeSanitizeElements,u,null),it(u))return Re(u),!0;let M=pe(u.nodeName);if(ke(E.uponSanitizeElement,u,{tagName:M,allowedTags:S}),U&&u.hasChildNodes()&&!wt(u.firstElementChild)&&ge(/<[/\w!]/g,u.innerHTML)&&ge(/<[/\w!]/g,u.textContent)||u.nodeType===Ge.progressingInstruction||U&&u.nodeType===Ge.comment&&ge(/<[/\w]/g,u.data))return Re(u),!0;if(!(Z.tagCheck instanceof Function&&Z.tagCheck(M))&&(!S[M]||K[M])){if(!K[M]&&Rt(M)&&(G.tagNameCheck instanceof RegExp&&ge(G.tagNameCheck,M)||G.tagNameCheck instanceof Function&&G.tagNameCheck(M)))return!1;if(le&&!Ce[M]){let ae=N(u)||u.parentNode,me=w(u)||u.childNodes;if(me&&ae){let ue=me.length;for(let Te=ue-1;Te>=0;--Te){let De=x(me[Te],!0);De.__removalCount=(u.__removalCount||0)+1,ae.insertBefore(De,b(u))}}}return Re(u),!0}return u instanceof p&&!rr(u)||(M==="noscript"||M==="noembed"||M==="noframes")&&ge(/<\/no(script|embed|frames)/i,u.innerHTML)?(Re(u),!0):(q&&u.nodeType===Ge.text&&(R=u.textContent,Ze([D,j,X],ae=>{R=Je(R,ae," ")}),u.textContent!==R&&(Ke(r.removed,{element:u.cloneNode()}),u.textContent=R)),ke(E.afterSanitizeElements,u,null),!1)},Ct=function(u,R,M){if(Me&&(R==="id"||R==="name")&&(M in m||M in tr))return!1;if(!(Q&&!W[R]&&ge(O,R))){if(!(J&&ge(v,R))){if(!(Z.attributeCheck instanceof Function&&Z.attributeCheck(R,u))){if(!P[R]||W[R]){if(!(Rt(u)&&(G.tagNameCheck instanceof RegExp&&ge(G.tagNameCheck,u)||G.tagNameCheck instanceof Function&&G.tagNameCheck(u))&&(G.attributeNameCheck instanceof RegExp&&ge(G.attributeNameCheck,R)||G.attributeNameCheck instanceof Function&&G.attributeNameCheck(R,u))||R==="is"&&G.allowCustomizedBuiltInElements&&(G.tagNameCheck instanceof RegExp&&ge(G.tagNameCheck,M)||G.tagNameCheck instanceof Function&&G.tagNameCheck(M))))return!1}else if(!Le[R]){if(!ge(H,Je(M,z,""))){if(!((R==="src"||R==="xlink:href"||R==="href")&&u!=="script"&&fr(M,"data:")===0&&Se[u])){if(!(oe&&!ge(L,Je(M,z,"")))){if(M)return!1}}}}}}}return!0},Rt=function(u){return u!=="annotation-xml"&<(u,k)},St=function(u){ke(E.beforeSanitizeAttributes,u,null);let{attributes:R}=u;if(!R||it(u))return;let M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:P,forceKeepAttr:void 0},ae=R.length;for(;ae--;){let me=R[ae],{name:ue,namespaceURI:Te,value:De}=me,Fe=pe(ue),st=De,de=ue==="value"?st:ur(st);if(M.attrName=Fe,M.attrValue=de,M.keepAttr=!0,M.forceKeepAttr=void 0,ke(E.uponSanitizeAttribute,u,M),de=M.attrValue,ce&&(Fe==="id"||Fe==="name")&&(ve(ue,u),de=Ee+de),U&&ge(/((--!?|])>)|<\/(style|title|textarea)/i,de)){ve(ue,u);continue}if(Fe==="attributename"&<(de,"href")){ve(ue,u);continue}if(M.forceKeepAttr)continue;if(!M.keepAttr){ve(ue,u);continue}if(!te&&ge(/\/>/i,de)){ve(ue,u);continue}q&&Ze([D,j,X],Ot=>{de=Je(de,Ot," ")});let Lt=pe(u.nodeName);if(!Ct(Lt,Fe,de)){ve(ue,u);continue}if(y&&typeof C=="object"&&typeof C.getAttributeType=="function"&&!Te)switch(C.getAttributeType(Lt,Fe)){case"TrustedHTML":{de=y.createHTML(de);break}case"TrustedScriptURL":{de=y.createScriptURL(de);break}}if(de!==st)try{Te?u.setAttributeNS(Te,ue,de):u.setAttribute(ue,de),it(u)?Re(u):Dt(r.removed)}catch{ve(ue,u)}}ke(E.afterSanitizeAttributes,u,null)},nr=function $(u){let R=null,M=xt(u);for(ke(E.beforeSanitizeShadowDOM,u,null);R=M.nextNode();)ke(E.uponSanitizeShadowNode,R,null),Nt(R),St(R),R.content instanceof f&&$(R.content);ke(E.afterSanitizeShadowDOM,u,null)};return r.sanitize=function($){let u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=null,M=null,ae=null,me=null;if(tt=!$,tt&&($="<!-->"),typeof $!="string"&&!wt($))if(typeof $.toString=="function"){if($=$.toString(),typeof $!="string")throw Be("dirty is not a string, aborting")}else throw Be("toString is not a function");if(!r.isSupported)return $;if(Y||nt(u),r.removed=[],typeof $=="string"&&(fe=!1),fe){if($.nodeName){let De=pe($.nodeName);if(!S[De]||K[De])throw Be("root node is forbidden and cannot be sanitized in-place")}}else if($ instanceof i)R=Et("<!---->"),M=R.ownerDocument.importNode($,!0),M.nodeType===Ge.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?R=M:R.appendChild(M);else{if(!re&&!q&&!se&&$.indexOf("<")===-1)return y&&ye?y.createHTML($):$;if(R=Et($),!R)return re?null:ye?g:""}R&&ee&&Re(R.firstChild);let ue=xt(fe?$:R);for(;ae=ue.nextNode();)Nt(ae),St(ae),ae.content instanceof f&&nr(ae.content);if(fe)return $;if(re){if(we)for(me=o.call(R.ownerDocument);R.firstChild;)me.appendChild(R.firstChild);else me=R;return(P.shadowroot||P.shadowrootmode)&&(me=T.call(e,me,!0)),me}let Te=se?R.outerHTML:R.innerHTML;return se&&S["!doctype"]&&R.ownerDocument&&R.ownerDocument.doctype&&R.ownerDocument.doctype.name&&ge(Pt,R.ownerDocument.doctype.name)&&(Te="<!DOCTYPE "+R.ownerDocument.doctype.name+`>
`+Te),q&&Ze([D,j,X],De=>{Te=Je(Te,De," ")}),y&&ye?y.createHTML(Te):Te},r.setConfig=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nt($),Y=!0},r.clearConfig=function(){He=null,Y=!1},r.isValidAttribute=function($,u,R){He||nt({});let M=pe($),ae=pe(u);return Ct(M,ae,R)},r.addHook=function($,u){typeof u=="function"&&Ke(E[$],u)},r.removeHook=function($,u){if(u!==void 0){let R=lr(E[$],u);return R===-1?void 0:or(E[$],R,1)[0]}return Dt(E[$])},r.removeHooks=function($){E[$]=[]},r.removeAllHooks=function(){E=Ft()},r}var Nr=Kt();Jt.exports=Nr});var jt=Xe((mt,yt)=>{((F,r)=>{typeof define=="function"&&define.amd?define([],r):typeof yt=="object"&&typeof mt<"u"?yt.exports=r():F.Papa=r()})(mt,function F(){var r=typeof self<"u"?self:typeof window<"u"?window:r!==void 0?r:{},m,e=!r.document&&!!r.postMessage,t=r.IS_PAPA_WORKER||!1,f={},n=0,i={};function p(s){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(a){var o=N(a);o.chunkSize=parseInt(o.chunkSize),a.step||a.chunk||(o.chunkSize=null),this._handle=new C(o),(this._handle.streamer=this)._config=o}.call(this,s),this.parseChunk=function(a,o){var A=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<A){let E=this._config.newline;E||(T=this._config.quoteChar||'"',E=this._handle.guessLineEndings(a,T)),a=[...a.split(E).slice(A)].join(E)}this.isFirstChunk&&g(this._config.beforeFirstChunk)&&(T=this._config.beforeFirstChunk(a))!==void 0&&(a=T),this.isFirstChunk=!1,this._halted=!1;var A=this._partialLine+a,T=(this._partialLine="",this._handle.parse(A,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(a=T.meta.cursor,A=(this._finished||(this._partialLine=A.substring(a-this._baseIndex),this._baseIndex=a),T&&T.data&&(this._rowCount+=T.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),t)r.postMessage({results:T,workerId:i.WORKER_ID,finished:A});else if(g(this._config.chunk)&&!o){if(this._config.chunk(T,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=T=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(T.data),this._completeResults.errors=this._completeResults.errors.concat(T.errors),this._completeResults.meta=T.meta),this._completed||!A||!g(this._config.complete)||T&&T.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),A||T&&T.meta.paused||this._nextChunk(),T}this._halted=!0},this._sendError=function(a){g(this._config.error)?this._config.error(a):t&&this._config.error&&r.postMessage({workerId:i.WORKER_ID,error:a,finished:!1})}}function c(s){var a;(s=s||{}).chunkSize||(s.chunkSize=i.RemoteChunkSize),p.call(this,s),this._nextChunk=e?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(o){this._input=o,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(a=new XMLHttpRequest,this._config.withCredentials&&(a.withCredentials=this._config.withCredentials),e||(a.onload=y(this._chunkLoaded,this),a.onerror=y(this._chunkError,this)),a.open(this._config.downloadRequestBody?"POST":"GET",this._input,!e),this._config.downloadRequestHeaders){var o,A=this._config.downloadRequestHeaders;for(o in A)a.setRequestHeader(o,A[o])}var T;this._config.chunkSize&&(T=this._start+this._config.chunkSize-1,a.setRequestHeader("Range","bytes="+this._start+"-"+T));try{a.send(this._config.downloadRequestBody)}catch(E){this._chunkError(E.message)}e&&a.status===0&&this._chunkError()}},this._chunkLoaded=function(){a.readyState===4&&(a.status<200||400<=a.status?this._chunkError():(this._start+=this._config.chunkSize||a.responseText.length,this._finished=!this._config.chunkSize||this._start>=(o=>(o=o.getResponseHeader("Content-Range"))!==null?parseInt(o.substring(o.lastIndexOf("/")+1)):-1)(a),this.parseChunk(a.responseText)))},this._chunkError=function(o){o=a.statusText||o,this._sendError(new Error(o))}}function d(s){(s=s||{}).chunkSize||(s.chunkSize=i.LocalChunkSize),p.call(this,s);var a,o,A=typeof FileReader<"u";this.stream=function(T){this._input=T,o=T.slice||T.webkitSlice||T.mozSlice,A?((a=new FileReader).onload=y(this._chunkLoaded,this),a.onerror=y(this._chunkError,this)):a=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var T=this._input,E=(this._config.chunkSize&&(E=Math.min(this._start+this._config.chunkSize,this._input.size),T=o.call(T,this._start,E)),a.readAsText(T,this._config.encoding));A||this._chunkLoaded({target:{result:E}})},this._chunkLoaded=function(T){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(T.target.result)},this._chunkError=function(){this._sendError(a.error)}}function l(s){var a;p.call(this,s=s||{}),this.stream=function(o){return a=o,this._nextChunk()},this._nextChunk=function(){var o,A;if(!this._finished)return o=this._config.chunkSize,a=o?(A=a.substring(0,o),a.substring(o)):(A=a,""),this._finished=!a,this.parseChunk(A)}}function h(s){p.call(this,s=s||{});var a=[],o=!0,A=!1;this.pause=function(){p.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){p.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(T){this._input=T,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){A&&a.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),a.length?this.parseChunk(a.shift()):o=!0},this._streamData=y(function(T){try{a.push(typeof T=="string"?T:T.toString(this._config.encoding)),o&&(o=!1,this._checkIsFinished(),this.parseChunk(a.shift()))}catch(E){this._streamError(E)}},this),this._streamError=y(function(T){this._streamCleanUp(),this._sendError(T)},this),this._streamEnd=y(function(){this._streamCleanUp(),A=!0,this._streamData("")},this),this._streamCleanUp=y(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function C(s){var a,o,A,T,E=Math.pow(2,53),D=-E,j=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,X=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,O=this,v=0,L=0,z=!1,k=!1,H=[],S={data:[],errors:[],meta:{}};function ne(K){return s.skipEmptyLines==="greedy"?K.join("").trim()==="":K.length===1&&K[0].length===0}function P(){if(S&&A&&(G("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+i.DefaultDelimiter+"'"),A=!1),s.skipEmptyLines&&(S.data=S.data.filter(function(Q){return!ne(Q)})),ie()){let Q=function(oe,te){g(s.transformHeader)&&(oe=s.transformHeader(oe,te)),H.push(oe)};var J=Q;if(S)if(Array.isArray(S.data[0])){for(var K=0;ie()&&K<S.data.length;K++)S.data[K].forEach(Q);S.data.splice(0,1)}else S.data.forEach(Q)}function W(Q,oe){for(var te=s.header?{}:[],q=0;q<Q.length;q++){var U=q,se=Q[q],se=((Y,ee)=>(re=>(s.dynamicTypingFunction&&s.dynamicTyping[re]===void 0&&(s.dynamicTyping[re]=s.dynamicTypingFunction(re)),(s.dynamicTyping[re]||s.dynamicTyping)===!0))(Y)?ee==="true"||ee==="TRUE"||ee!=="false"&&ee!=="FALSE"&&((re=>{if(j.test(re)&&(re=parseFloat(re),D<re&&re<E))return 1})(ee)?parseFloat(ee):X.test(ee)?new Date(ee):ee===""?null:ee):ee)(U=s.header?q>=H.length?"__parsed_extra":H[q]:U,se=s.transform?s.transform(se,U):se);U==="__parsed_extra"?(te[U]=te[U]||[],te[U].push(se)):te[U]=se}return s.header&&(q>H.length?G("FieldMismatch","TooManyFields","Too many fields: expected "+H.length+" fields but parsed "+q,L+oe):q<H.length&&G("FieldMismatch","TooFewFields","Too few fields: expected "+H.length+" fields but parsed "+q,L+oe)),te}var Z;S&&(s.header||s.dynamicTyping||s.transform)&&(Z=1,!S.data.length||Array.isArray(S.data[0])?(S.data=S.data.map(W),Z=S.data.length):S.data=W(S.data,0),s.header&&S.meta&&(S.meta.fields=H),L+=Z)}function ie(){return s.header&&H.length===0}function G(K,W,Z,J){K={type:K,code:W,message:Z},J!==void 0&&(K.row=J),S.errors.push(K)}g(s.step)&&(T=s.step,s.step=function(K){S=K,ie()?P():(P(),S.data.length!==0&&(v+=K.data.length,s.preview&&v>s.preview?o.abort():(S.data=S.data[0],T(S,O))))}),this.parse=function(K,W,Z){var J=s.quoteChar||'"',J=(s.newline||(s.newline=this.guessLineEndings(K,J)),A=!1,s.delimiter?g(s.delimiter)&&(s.delimiter=s.delimiter(K),S.meta.delimiter=s.delimiter):((J=((Q,oe,te,q,U)=>{var se,Y,ee,re;U=U||[","," ","|",";",i.RECORD_SEP,i.UNIT_SEP];for(var we=0;we<U.length;we++){for(var ye,Me=U[we],ce=0,Ee=0,le=0,fe=(ee=void 0,new x({comments:q,delimiter:Me,newline:oe,preview:10}).parse(Q)),he=0;he<fe.data.length;he++)te&&ne(fe.data[he])?le++:(ye=fe.data[he].length,Ee+=ye,ee===void 0?ee=ye:0<ye&&(ce+=Math.abs(ye-ee),ee=ye));0<fe.data.length&&(Ee/=fe.data.length-le),(Y===void 0||ce<=Y)&&(re===void 0||re<Ee)&&1.99<Ee&&(Y=ce,se=Me,re=Ee)}return{successful:!!(s.delimiter=se),bestDelimiter:se}})(K,s.newline,s.skipEmptyLines,s.comments,s.delimitersToGuess)).successful?s.delimiter=J.bestDelimiter:(A=!0,s.delimiter=i.DefaultDelimiter),S.meta.delimiter=s.delimiter),N(s));return s.preview&&s.header&&J.preview++,a=K,o=new x(J),S=o.parse(a,W,Z),P(),z?{meta:{paused:!0}}:S||{meta:{paused:!1}}},this.paused=function(){return z},this.pause=function(){z=!0,o.abort(),a=g(s.chunk)?"":a.substring(o.getCharIndex())},this.resume=function(){O.streamer._halted?(z=!1,O.streamer.parseChunk(a,!0)):setTimeout(O.resume,3)},this.aborted=function(){return k},this.abort=function(){k=!0,o.abort(),S.meta.aborted=!0,g(s.complete)&&s.complete(S),a=""},this.guessLineEndings=function(Q,J){Q=Q.substring(0,1048576);var J=new RegExp(_(J)+"([^]*?)"+_(J),"gm"),Z=(Q=Q.replace(J,"")).split("\r"),J=Q.split(`
`),Q=1<J.length&&J[0].length<Z[0].length;if(Z.length===1||Q)return`
`;for(var oe=0,te=0;te<Z.length;te++)Z[te][0]===`
`&&oe++;return oe>=Z.length/2?`\r
`:"\r"}}function _(s){return s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function x(s){var a=(s=s||{}).delimiter,o=s.newline,A=s.comments,T=s.step,E=s.preview,D=s.fastMode,j=null,X=!1,O=s.quoteChar==null?'"':s.quoteChar,v=O;if(s.escapeChar!==void 0&&(v=s.escapeChar),(typeof a!="string"||-1<i.BAD_DELIMITERS.indexOf(a))&&(a=","),A===a)throw new Error("Comment character same as delimiter");A===!0?A="#":(typeof A!="string"||-1<i.BAD_DELIMITERS.indexOf(A))&&(A=!1),o!==`
`&&o!=="\r"&&o!==`\r
`&&(o=`
`);var L=0,z=!1;this.parse=function(k,H,S){if(typeof k!="string")throw new Error("Input must be a string");var ne=k.length,P=a.length,ie=o.length,G=A.length,K=g(T),W=[],Z=[],J=[],Q=L=0;if(!k)return ce();if(D||D!==!1&&k.indexOf(O)===-1){for(var oe=k.split(o),te=0;te<oe.length;te++){if(J=oe[te],L+=J.length,te!==oe.length-1)L+=o.length;else if(S)return ce();if(!A||J.substring(0,G)!==A){if(K){if(W=[],re(J.split(a)),Ee(),z)return ce()}else re(J.split(a));if(E&&E<=te)return W=W.slice(0,E),ce(!0)}}return ce()}for(var q=k.indexOf(a,L),U=k.indexOf(o,L),se=new RegExp(_(v)+_(O),"g"),Y=k.indexOf(O,L);;)if(k[L]===O)for(Y=L,L++;;){if((Y=k.indexOf(O,Y+1))===-1)return S||Z.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:W.length,index:L}),ye();if(Y===ne-1)return ye(k.substring(L,Y).replace(se,O));if(O===v&&k[Y+1]===v)Y++;else if(O===v||Y===0||k[Y-1]!==v){q!==-1&&q<Y+1&&(q=k.indexOf(a,Y+1));var ee=we((U=U!==-1&&U<Y+1?k.indexOf(o,Y+1):U)===-1?q:Math.min(q,U));if(k.substr(Y+1+ee,P)===a){J.push(k.substring(L,Y).replace(se,O)),k[L=Y+1+ee+P]!==O&&(Y=k.indexOf(O,L)),q=k.indexOf(a,L),U=k.indexOf(o,L);break}if(ee=we(U),k.substring(Y+1+ee,Y+1+ee+ie)===o){if(J.push(k.substring(L,Y).replace(se,O)),Me(Y+1+ee+ie),q=k.indexOf(a,L),Y=k.indexOf(O,L),K&&(Ee(),z))return ce();if(E&&W.length>=E)return ce(!0);break}Z.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:W.length,index:L}),Y++}}else if(A&&J.length===0&&k.substring(L,L+G)===A){if(U===-1)return ce();L=U+ie,U=k.indexOf(o,L),q=k.indexOf(a,L)}else if(q!==-1&&(q<U||U===-1))J.push(k.substring(L,q)),L=q+P,q=k.indexOf(a,L);else{if(U===-1)break;if(J.push(k.substring(L,U)),Me(U+ie),K&&(Ee(),z))return ce();if(E&&W.length>=E)return ce(!0)}return ye();function re(le){W.push(le),Q=L}function we(le){var fe=0;return fe=le!==-1&&(le=k.substring(Y+1,le))&&le.trim()===""?le.length:fe}function ye(le){return S||(le===void 0&&(le=k.substring(L)),J.push(le),L=ne,re(J),K&&Ee()),ce()}function Me(le){L=le,re(J),J=[],U=k.indexOf(o,L)}function ce(le){if(s.header&&!H&&W.length&&!X){var fe=W[0],he=Object.create(null),Ce=new Set(fe);let ze=!1;for(let Se=0;Se<fe.length;Se++){let _e=fe[Se];if(he[_e=g(s.transformHeader)?s.transformHeader(_e,Se):_e]){let Le,Ue=he[_e];for(;Le=_e+"_"+Ue,Ue++,Ce.has(Le););Ce.add(Le),fe[Se]=Le,he[_e]++,ze=!0,(j=j===null?{}:j)[Le]=_e}else he[_e]=1,fe[Se]=_e;Ce.add(_e)}ze&&console.warn("Duplicate headers found and renamed."),X=!0}return{data:W,errors:Z,meta:{delimiter:a,linebreak:o,aborted:z,truncated:!!le,cursor:Q+(H||0),renamedHeaders:j}}}function Ee(){T(ce()),W=[],Z=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return L}}function I(s){var a=s.data,o=f[a.workerId],A=!1;if(a.error)o.userError(a.error,a.file);else if(a.results&&a.results.data){var T={abort:function(){A=!0,b(a.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:w,resume:w};if(g(o.userStep)){for(var E=0;E<a.results.data.length&&(o.userStep({data:a.results.data[E],errors:a.results.errors,meta:a.results.meta},T),!A);E++);delete a.results}else g(o.userChunk)&&(o.userChunk(a.results,T,a.file),delete a.results)}a.finished&&!A&&b(a.workerId,a.results)}function b(s,a){var o=f[s];g(o.userComplete)&&o.userComplete(a),o.terminate(),delete f[s]}function w(){throw new Error("Not implemented.")}function N(s){if(typeof s!="object"||s===null)return s;var a,o=Array.isArray(s)?[]:{};for(a in s)o[a]=N(s[a]);return o}function y(s,a){return function(){s.apply(a,arguments)}}function g(s){return typeof s=="function"}return i.parse=function(s,a){var o=(a=a||{}).dynamicTyping||!1;if(g(o)&&(a.dynamicTypingFunction=o,o={}),a.dynamicTyping=o,a.transform=!!g(a.transform)&&a.transform,!a.worker||!i.WORKERS_SUPPORTED)return o=null,i.NODE_STREAM_INPUT,typeof s=="string"?(s=(A=>A.charCodeAt(0)!==65279?A:A.slice(1))(s),o=new(a.download?c:l)(a)):s.readable===!0&&g(s.read)&&g(s.on)?o=new h(a):(r.File&&s instanceof File||s instanceof Object)&&(o=new d(a)),o.stream(s);(o=(()=>{var A;return!!i.WORKERS_SUPPORTED&&(A=(()=>{var T=r.URL||r.webkitURL||null,E=F.toString();return i.BLOB_URL||(i.BLOB_URL=T.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",E,")();"],{type:"text/javascript"})))})(),(A=new r.Worker(A)).onmessage=I,A.id=n++,f[A.id]=A)})()).userStep=a.step,o.userChunk=a.chunk,o.userComplete=a.complete,o.userError=a.error,a.step=g(a.step),a.chunk=g(a.chunk),a.complete=g(a.complete),a.error=g(a.error),delete a.worker,o.postMessage({input:s,config:a,workerId:o.id})},i.unparse=function(s,a){var o=!1,A=!0,T=",",E=`\r
`,D='"',j=D+D,X=!1,O=null,v=!1,L=((()=>{if(typeof a=="object"){if(typeof a.delimiter!="string"||i.BAD_DELIMITERS.filter(function(H){return a.delimiter.indexOf(H)!==-1}).length||(T=a.delimiter),typeof a.quotes!="boolean"&&typeof a.quotes!="function"&&!Array.isArray(a.quotes)||(o=a.quotes),typeof a.skipEmptyLines!="boolean"&&typeof a.skipEmptyLines!="string"||(X=a.skipEmptyLines),typeof a.newline=="string"&&(E=a.newline),typeof a.quoteChar=="string"&&(D=a.quoteChar),typeof a.header=="boolean"&&(A=a.header),Array.isArray(a.columns)){if(a.columns.length===0)throw new Error("Option columns is empty");O=a.columns}a.escapeChar!==void 0&&(j=a.escapeChar+D),a.escapeFormulae instanceof RegExp?v=a.escapeFormulae:typeof a.escapeFormulae=="boolean"&&a.escapeFormulae&&(v=/^[=+\-@\t\r].*$/)}})(),new RegExp(_(D),"g"));if(typeof s=="string"&&(s=JSON.parse(s)),Array.isArray(s)){if(!s.length||Array.isArray(s[0]))return z(null,s,X);if(typeof s[0]=="object")return z(O||Object.keys(s[0]),s,X)}else if(typeof s=="object")return typeof s.data=="string"&&(s.data=JSON.parse(s.data)),Array.isArray(s.data)&&(s.fields||(s.fields=s.meta&&s.meta.fields||O),s.fields||(s.fields=Array.isArray(s.data[0])?s.fields:typeof s.data[0]=="object"?Object.keys(s.data[0]):[]),Array.isArray(s.data[0])||typeof s.data[0]=="object"||(s.data=[s.data])),z(s.fields||[],s.data||[],X);throw new Error("Unable to serialize unrecognized input");function z(H,S,ne){var P="",ie=(typeof H=="string"&&(H=JSON.parse(H)),typeof S=="string"&&(S=JSON.parse(S)),Array.isArray(H)&&0<H.length),G=!Array.isArray(S[0]);if(ie&&A){for(var K=0;K<H.length;K++)0<K&&(P+=T),P+=k(H[K],K);0<S.length&&(P+=E)}for(var W=0;W<S.length;W++){var Z=(ie?H:S[W]).length,J=!1,Q=ie?Object.keys(S[W]).length===0:S[W].length===0;if(ne&&!ie&&(J=ne==="greedy"?S[W].join("").trim()==="":S[W].length===1&&S[W][0].length===0),ne==="greedy"&&ie){for(var oe=[],te=0;te<Z;te++){var q=G?H[te]:te;oe.push(S[W][q])}J=oe.join("").trim()===""}if(!J){for(var U=0;U<Z;U++){0<U&&!Q&&(P+=T);var se=ie&&G?H[U]:U;P+=k(S[W][se],U)}W<S.length-1&&(!ne||0<Z&&!Q)&&(P+=E)}}return P}function k(H,S){var ne,P;return H==null?"":H.constructor===Date?JSON.stringify(H).slice(1,25):(P=!1,v&&typeof H=="string"&&v.test(H)&&(H="'"+H,P=!0),ne=H.toString().replace(L,j),(P=P||o===!0||typeof o=="function"&&o(H,S)||Array.isArray(o)&&o[S]||((ie,G)=>{for(var K=0;K<G.length;K++)if(-1<ie.indexOf(G[K]))return!0;return!1})(ne,i.BAD_DELIMITERS)||-1<ne.indexOf(T)||ne.charAt(0)===" "||ne.charAt(ne.length-1)===" ")?D+ne+D:ne)}},i.RECORD_SEP="",i.UNIT_SEP="",i.BYTE_ORDER_MARK="\uFEFF",i.BAD_DELIMITERS=["\r",`
`,'"',i.BYTE_ORDER_MARK],i.WORKERS_SUPPORTED=!e&&!!r.Worker,i.NODE_STREAM_INPUT=1,i.LocalChunkSize=10485760,i.RemoteChunkSize=5242880,i.DefaultDelimiter=",",i.Parser=x,i.ParserHandle=C,i.NetworkStreamer=c,i.FileStreamer=d,i.StringStreamer=l,i.ReadableStreamStreamer=h,r.jQuery&&((m=r.jQuery).fn.parse=function(s){var a=s.config||{},o=[];return this.each(function(E){if(!(m(this).prop("tagName").toUpperCase()==="INPUT"&&m(this).attr("type").toLowerCase()==="file"&&r.FileReader)||!this.files||this.files.length===0)return!0;for(var D=0;D<this.files.length;D++)o.push({file:this.files[D],inputElem:this,instanceConfig:m.extend({},a)})}),A(),this;function A(){if(o.length===0)g(s.complete)&&s.complete();else{var E,D,j,X,O=o[0];if(g(s.before)){var v=s.before(O.file,O.inputElem);if(typeof v=="object"){if(v.action==="abort")return E="AbortError",D=O.file,j=O.inputElem,X=v.reason,void(g(s.error)&&s.error({name:E},D,j,X));if(v.action==="skip")return void T();typeof v.config=="object"&&(O.instanceConfig=m.extend(O.instanceConfig,v.config))}else if(v==="skip")return void T()}var L=O.instanceConfig.complete;O.instanceConfig.complete=function(z){g(L)&&L(z,O.file,O.inputElem),T()},i.parse(O.file,O.instanceConfig)}}function T(){o.splice(0,1),A()}}),t&&(r.onmessage=function(s){s=s.data,i.WORKER_ID===void 0&&s&&(i.WORKER_ID=s.workerId),typeof s.input=="string"?r.postMessage({workerId:i.WORKER_ID,results:i.parse(s.input,s.config),finished:!0}):(r.File&&s.input instanceof File||s.input instanceof Object)&&(s=i.parse(s.input,s.config))&&r.postMessage({workerId:i.WORKER_ID,results:s,finished:!0})}),(c.prototype=Object.create(p.prototype)).constructor=c,(d.prototype=Object.create(p.prototype)).constructor=d,(l.prototype=Object.create(l.prototype)).constructor=l,(h.prototype=Object.create(p.prototype)).constructor=h,i})});var Wt=Xe((gt,Gt)=>{(function(F,r){typeof define=="function"&&define.amd?define(r):typeof gt=="object"?Gt.exports=r():F.jsonLogic=r()})(gt,function(){"use strict";Array.isArray||(Array.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"});function F(e){for(var t=[],f=0,n=e.length;f<n;f++)t.indexOf(e[f])===-1&&t.push(e[f]);return t}var r={},m={"==":function(e,t){return e==t},"===":function(e,t){return e===t},"!=":function(e,t){return e!=t},"!==":function(e,t){return e!==t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"<":function(e,t,f){return f===void 0?e<t:e<t&&t<f},"<=":function(e,t,f){return f===void 0?e<=t:e<=t&&t<=f},"!!":function(e){return r.truthy(e)},"!":function(e){return!r.truthy(e)},"%":function(e,t){return e%t},log:function(e){return console.log(e),e},in:function(e,t){return!t||typeof t.indexOf>"u"?!1:t.indexOf(e)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(e,t,f){if(f<0){var n=String(e).substr(t);return n.substr(0,n.length+f)}return String(e).substr(t,f)},"+":function(){return Array.prototype.reduce.call(arguments,function(e,t){return parseFloat(e,10)+parseFloat(t,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(e,t){return parseFloat(e,10)*parseFloat(t,10)})},"-":function(e,t){return t===void 0?-e:e-t},"/":function(e,t){return e/t},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(e,t){return e.concat(t)},[])},var:function(e,t){var f=t===void 0?null:t,n=this;if(typeof e>"u"||e===""||e===null)return n;for(var i=String(e).split("."),p=0;p<i.length;p++)if(n==null||(n=n[i[p]],n===void 0))return f;return n},missing:function(){for(var e=[],t=Array.isArray(arguments[0])?arguments[0]:arguments,f=0;f<t.length;f++){var n=t[f],i=r.apply({var:n},this);(i===null||i==="")&&e.push(n)}return e},missing_some:function(e,t){var f=r.apply({missing:t},this);return t.length-f.length>=e?[]:f}};return r.is_logic=function(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&Object.keys(e).length===1},r.truthy=function(e){return Array.isArray(e)&&e.length===0?!1:!!e},r.get_operator=function(e){return Object.keys(e)[0]},r.get_values=function(e){return e[r.get_operator(e)]},r.apply=function(e,t){if(Array.isArray(e))return e.map(function(_){return r.apply(_,t)});if(!r.is_logic(e))return e;var f=r.get_operator(e),n=e[f],i,p,c,d,l;if(Array.isArray(n)||(n=[n]),f==="if"||f=="?:"){for(i=0;i<n.length-1;i+=2)if(r.truthy(r.apply(n[i],t)))return r.apply(n[i+1],t);return n.length===i+1?r.apply(n[i],t):null}else if(f==="and"){for(i=0;i<n.length;i+=1)if(p=r.apply(n[i],t),!r.truthy(p))return p;return p}else if(f==="or"){for(i=0;i<n.length;i+=1)if(p=r.apply(n[i],t),r.truthy(p))return p;return p}else{if(f==="filter")return d=r.apply(n[0],t),c=n[1],Array.isArray(d)?d.filter(function(_){return r.truthy(r.apply(c,_))}):[];if(f==="map")return d=r.apply(n[0],t),c=n[1],Array.isArray(d)?d.map(function(_){return r.apply(c,_)}):[];if(f==="reduce")return d=r.apply(n[0],t),c=n[1],l=typeof n[2]<"u"?r.apply(n[2],t):null,Array.isArray(d)?d.reduce(function(_,x){return r.apply(c,{current:x,accumulator:_})},l):l;if(f==="all"){if(d=r.apply(n[0],t),c=n[1],!Array.isArray(d)||!d.length)return!1;for(i=0;i<d.length;i+=1)if(!r.truthy(r.apply(c,d[i])))return!1;return!0}else if(f==="none"){if(d=r.apply(n[0],t),c=n[1],!Array.isArray(d)||!d.length)return!0;for(i=0;i<d.length;i+=1)if(r.truthy(r.apply(c,d[i])))return!1;return!0}else if(f==="some"){if(d=r.apply(n[0],t),c=n[1],!Array.isArray(d)||!d.length)return!1;for(i=0;i<d.length;i+=1)if(r.truthy(r.apply(c,d[i])))return!0;return!1}}if(n=n.map(function(_){return r.apply(_,t)}),m.hasOwnProperty(f)&&typeof m[f]=="function")return m[f].apply(t,n);if(f.indexOf(".")>0){var h=String(f).split("."),C=m;for(i=0;i<h.length;i++){if(!C.hasOwnProperty(h[i]))throw new Error("Unrecognized operation "+f+" (failed at "+h.slice(0,i+1).join(".")+")");C=C[h[i]]}return C.apply(t,n)}throw new Error("Unrecognized operation "+f)},r.uses_data=function(e){var t=[];if(r.is_logic(e)){var f=r.get_operator(e),n=e[f];Array.isArray(n)||(n=[n]),f==="var"?t.push(n[0]):n.forEach(function(i){t.push.apply(t,r.uses_data(i))})}return F(t)},r.add_operation=function(e,t){m[e]=t},r.rm_operation=function(e){delete m[e]},r.rule_like=function(e,t){if(t===e||t==="@")return!0;if(t==="number")return typeof e=="number";if(t==="string")return typeof e=="string";if(t==="array")return Array.isArray(e)&&!r.is_logic(e);if(r.is_logic(t)){if(r.is_logic(e)){var f=r.get_operator(t),n=r.get_operator(e);if(f==="@"||f===n)return r.rule_like(r.get_values(e,!1),r.get_values(t,!1))}return!1}if(Array.isArray(t))if(Array.isArray(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i+=1)if(!r.rule_like(e[i],t[i]))return!1;return!0}else return!1;return!1},r})});var Yt=Xe((Lr,Vt)=>{var V=Bt(),qt=jt(),At=Wt();Vt.exports=class{constructor(r){let m=this;m.damon=r,m.domPurify=V,m.websiteRegex=/^(https?:\/\/)?[-a-zA-Z0-9]*[a-zA-Z0-9]+(\.[-a-zA-Z0-9]*[a-zA-Z0-9]+)+/,m.httpRegex=/^https?:\/\//,m.pathRegex=/^\.*\//}damonToHtmlTable(r){let m=this;return m.mapToHtmlTable(m.damon.damonToMap(r,0,!0))}damonToSExpression(r){let m=this;return m.prefixedKeysMapToSExpression(m.damon.damonToMap(r,0,!0))}sExpressionToDamon(r){let m=this;return m.damon.mapToDamon(m.sExpressionToPrefixedKeysMap(r),!1,!0)}escape(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}mapToHtmlList(r,m=!1,e=void 0){let t=this;try{t.damon.mapToJSON(r)}catch{throw new Error("Provided map value doesn't passes JSON.parse()")}var f=0,n=document.createElement("ul"),i;return e!==void 0&&(i=JSON.parse(e)),n.className="DAMON-List",p(r,n),n;function p(c,d,l=[]){if(typeof d!="object"||d==null||Array.isArray(d))throw new Error("Error List Item number "+f+": @param { {} } list");if(typeof c=="object"&&c!==null&&!Array.isArray(c)&&c instanceof Map&&c.constructor===Map){if(d.tagName=="UL")for(let[_,x]of c){let I=document.createElement("ul"),b=document.createElement("code"),w=document.createElement("span"),N=document.createElement("li");if(N.dataset.graphArbo=Array.from(c.keys()).indexOf(_),l.length>0&&(N.dataset.graphArbo=l.join("-")+"-"+Array.from(c.keys()).indexOf(_)),w.className="type-key",t.websiteRegex.test(_)||t.pathRegex.test(_)){let y=_;t.websiteRegex.test(_)&&!t.httpRegex.test(_)&&(y="https://"+_);let g=V.sanitize(`<a href="${y}"><span>${y}</span></a>`);w.innerHTML=g}else e!==void 0&&_ in i["@context"]?w.innerHTML=V.sanitize(`<a href="${i["@context"][_]["@id"]}"><span>${_}</span></a>`):w.textContent=_;if(typeof x=="object"&&x!==null)if(Array.isArray(x))if(c.damonInlineArrays!==void 0&&c.damonInlineArrays.indexOf(_)>-1){b.innerHTML=w.outerHTML+'<span class="operator">: </span>[';for(let y=0,g=x.length;y<g;y++){let s=document.createElement("span"),a=x[y];if(a===!0)s.textContent="true",s.className="type-boolean";else if(a===!1)s.textContent="false",s.className="type-boolean";else if(a===null)s.textContent="null",s.className="type-null";else if(Number.isFinite(a)&&!Number.isNaN(a))s.textContent=a+"",s.className="type-number";else{if(m)if(t.websiteRegex.test(a)||t.pathRegex.test(a)){let o=a;t.websiteRegex.test(a)&&!t.httpRegex.test(a)&&(o="https://"+a),s.innerHTML=V.sanitize(`<a href="${o}">"${o}"</a>`)}else s.innerHTML=`"${a}"`;else if(t.websiteRegex.test(a)||t.pathRegex.test(a)){let o=a;!t.httpRegex.test(a)&&t.websiteRegex.test(a)&&(o="https://"+a),s.innerHTML=V.sanitize(`<a href="${o}">"${o}"</a>`)}else s.textContent=`"${a}"`;s.className="type-string"}y!==0&&(b.innerHTML+=", "),b.appendChild(s)}b.innerHTML+="]",N.appendChild(b),N.appendChild(I),d.appendChild(N)}else b.innerHTML=w.outerHTML+'<span class="opera