wrec 0.20.2 → 0.20.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wrec.d.ts +72 -41
- package/dist/wrec.es.js +529 -681
- package/dist/wrec.umd.js +4 -4
- package/package.json +5 -4
package/dist/wrec.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(T,g){typeof exports=="object"&&typeof module<"u"?g(exports):typeof define=="function"&&define.amd?define(["exports"],g):(T=typeof globalThis<"u"?globalThis:T||self,g(T.wrec={}))})(this,(function(T){"use strict";var fn=T=>{throw TypeError(T)};var Ee=(T,g,M)=>g.has(T)||fn("Cannot "+M);var O=(T,g,M)=>(Ee(T,g,"read from private field"),M?M.call(T):g.get(T)),q=(T,g,M)=>g.has(T)?fn("Cannot add the same private member more than once"):g instanceof WeakSet?g.add(T):g.set(T,M),ct=(T,g,M,St)=>(Ee(T,g,"write to private field"),St?St.call(T,M):g.set(T,M),M),un=(T,g,M)=>(Ee(T,g,"access private method"),M);var K,Nt,H,Tt,Et,Y,Dt,pn;const{entries:g,setPrototypeOf:M,isFrozen:St,getPrototypeOf:hn,getOwnPropertyDescriptor:mn}=Object;let{freeze:L,seal:x,create:zt}=Object,{apply:$t,construct:Wt}=typeof Reflect<"u"&&Reflect;L||(L=function(t){return t}),x||(x=function(t){return t}),$t||($t=function(t,e){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i];return t.apply(e,s)}),Wt||(Wt=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return new t(...n)});const yt=D(Array.prototype.forEach),dn=D(Array.prototype.lastIndexOf),ge=D(Array.prototype.pop),lt=D(Array.prototype.push),Tn=D(Array.prototype.splice),Rt=D(String.prototype.toLowerCase),Gt=D(String.prototype.toString),Bt=D(String.prototype.match),ft=D(String.prototype.replace),En=D(String.prototype.indexOf),gn=D(String.prototype.trim),k=D(Object.prototype.hasOwnProperty),N=D(RegExp.prototype.test),ut=An(TypeError);function D(r){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return $t(r,t,n)}}function An(r){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Wt(r,e)}}function d(r,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rt;M&&M(r,null);let n=t.length;for(;n--;){let s=t[n];if(typeof s=="string"){const i=e(s);i!==s&&(St(t)||(t[n]=i),s=i)}r[s]=!0}return r}function _n(r){for(let t=0;t<r.length;t++)k(r,t)||(r[t]=null);return r}function U(r){const t=zt(null);for(const[e,n]of g(r))k(r,e)&&(Array.isArray(n)?t[e]=_n(n):n&&typeof n=="object"&&n.constructor===Object?t[e]=U(n):t[e]=n);return t}function pt(r,t){for(;r!==null;){const n=mn(r,t);if(n){if(n.get)return D(n.get);if(typeof n.value=="function")return D(n.value)}r=hn(r)}function e(){return null}return e}const Ae=L(["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"]),jt=L(["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"]),Yt=L(["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"]),bn=L(["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"]),Vt=L(["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"]),Sn=L(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_e=L(["#text"]),be=L(["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"]),Xt=L(["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"]),Se=L(["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"]),wt=L(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yn=x(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Rn=x(/<%[\w\W]*|[\w\W]*%>/gm),wn=x(/\$\{[\w\W]*/gm),On=x(/^data-[\-\w.\u00B7-\uFFFF]+$/),Cn=x(/^aria-[\-\w]+$/),ye=x(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Mn=x(/^(?:\w+script|data):/i),Ln=x(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Re=x(/^html$/i),Nn=x(/^[a-z][.\w]*(-[.\w]+)+$/i);var we=Object.freeze({__proto__:null,ARIA_ATTR:Cn,ATTR_WHITESPACE:Ln,CUSTOM_ELEMENT:Nn,DATA_ATTR:On,DOCTYPE_NAME:Re,ERB_EXPR:Rn,IS_ALLOWED_URI:ye,IS_SCRIPT_OR_DATA:Mn,MUSTACHE_EXPR:yn,TMPLIT_EXPR:wn});const ht={element:1,text:3,progressingInstruction:7,comment:8,document:9},Dn=function(){return typeof window>"u"?null:window},In=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const s="data-tt-policy-suffix";e&&e.hasAttribute(s)&&(n=e.getAttribute(s));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Oe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Ce(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Dn();const t=f=>Ce(f);if(t.version="3.3.1",t.removed=[],!r||!r.document||r.document.nodeType!==ht.document||!r.Element)return t.isSupported=!1,t;let{document:e}=r;const n=e,s=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:c,Node:u,Element:p,NodeFilter:h,NamedNodeMap:m=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:y,DOMParser:V,trustedTypes:W}=r,X=p.prototype,Xn=pt(X,"cloneNode"),qn=pt(X,"remove"),Kn=pt(X,"nextSibling"),Zn=pt(X,"childNodes"),It=pt(X,"parentNode");if(typeof c=="function"){const f=e.createElement("template");f.content&&f.content.ownerDocument&&(e=f.content.ownerDocument)}let I,gt="";const{implementation:ee,createNodeIterator:Jn,createDocumentFragment:Qn,getElementsByTagName:to}=e,{importNode:eo}=n;let P=Oe();t.isSupported=typeof g=="function"&&typeof It=="function"&&ee&&ee.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:ne,ERB_EXPR:oe,TMPLIT_EXPR:se,DATA_ATTR:no,ARIA_ATTR:oo,IS_SCRIPT_OR_DATA:so,ATTR_WHITESPACE:He,CUSTOM_ELEMENT:io}=we;let{IS_ALLOWED_URI:ze}=we,S=null;const $e=d({},[...Ae,...jt,...Yt,...Vt,..._e]);let R=null;const We=d({},[...be,...Xt,...Se,...wt]);let A=Object.seal(zt(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}})),At=null,ie=null;const et=Object.seal(zt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ge=!0,re=!0,Be=!1,je=!0,nt=!1,Pt=!0,Z=!1,ae=!1,ce=!1,ot=!1,vt=!1,xt=!1,Ye=!0,Ve=!1;const ro="user-content-";let le=!0,_t=!1,st={},z=null;const fe=d({},["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"]);let Xe=null;const qe=d({},["audio","video","img","source","image","track"]);let ue=null;const Ke=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kt="http://www.w3.org/1998/Math/MathML",Ft="http://www.w3.org/2000/svg",G="http://www.w3.org/1999/xhtml";let it=G,pe=!1,he=null;const ao=d({},[kt,Ft,G],Gt);let Ut=d({},["mi","mo","mn","ms","mtext"]),Ht=d({},["annotation-xml"]);const co=d({},["title","style","font","a","script"]);let bt=null;const lo=["application/xhtml+xml","text/html"],fo="text/html";let b=null,rt=null;const uo=e.createElement("form"),Ze=function(o){return o instanceof RegExp||o instanceof Function},me=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(rt&&rt===o)){if((!o||typeof o!="object")&&(o={}),o=U(o),bt=lo.indexOf(o.PARSER_MEDIA_TYPE)===-1?fo:o.PARSER_MEDIA_TYPE,b=bt==="application/xhtml+xml"?Gt:Rt,S=k(o,"ALLOWED_TAGS")?d({},o.ALLOWED_TAGS,b):$e,R=k(o,"ALLOWED_ATTR")?d({},o.ALLOWED_ATTR,b):We,he=k(o,"ALLOWED_NAMESPACES")?d({},o.ALLOWED_NAMESPACES,Gt):ao,ue=k(o,"ADD_URI_SAFE_ATTR")?d(U(Ke),o.ADD_URI_SAFE_ATTR,b):Ke,Xe=k(o,"ADD_DATA_URI_TAGS")?d(U(qe),o.ADD_DATA_URI_TAGS,b):qe,z=k(o,"FORBID_CONTENTS")?d({},o.FORBID_CONTENTS,b):fe,At=k(o,"FORBID_TAGS")?d({},o.FORBID_TAGS,b):U({}),ie=k(o,"FORBID_ATTR")?d({},o.FORBID_ATTR,b):U({}),st=k(o,"USE_PROFILES")?o.USE_PROFILES:!1,Ge=o.ALLOW_ARIA_ATTR!==!1,re=o.ALLOW_DATA_ATTR!==!1,Be=o.ALLOW_UNKNOWN_PROTOCOLS||!1,je=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,nt=o.SAFE_FOR_TEMPLATES||!1,Pt=o.SAFE_FOR_XML!==!1,Z=o.WHOLE_DOCUMENT||!1,ot=o.RETURN_DOM||!1,vt=o.RETURN_DOM_FRAGMENT||!1,xt=o.RETURN_TRUSTED_TYPE||!1,ce=o.FORCE_BODY||!1,Ye=o.SANITIZE_DOM!==!1,Ve=o.SANITIZE_NAMED_PROPS||!1,le=o.KEEP_CONTENT!==!1,_t=o.IN_PLACE||!1,ze=o.ALLOWED_URI_REGEXP||ye,it=o.NAMESPACE||G,Ut=o.MATHML_TEXT_INTEGRATION_POINTS||Ut,Ht=o.HTML_INTEGRATION_POINTS||Ht,A=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Ze(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(A.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Ze(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(A.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(A.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),nt&&(re=!1),vt&&(ot=!0),st&&(S=d({},_e),R=[],st.html===!0&&(d(S,Ae),d(R,be)),st.svg===!0&&(d(S,jt),d(R,Xt),d(R,wt)),st.svgFilters===!0&&(d(S,Yt),d(R,Xt),d(R,wt)),st.mathMl===!0&&(d(S,Vt),d(R,Se),d(R,wt))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?et.tagCheck=o.ADD_TAGS:(S===$e&&(S=U(S)),d(S,o.ADD_TAGS,b))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?et.attributeCheck=o.ADD_ATTR:(R===We&&(R=U(R)),d(R,o.ADD_ATTR,b))),o.ADD_URI_SAFE_ATTR&&d(ue,o.ADD_URI_SAFE_ATTR,b),o.FORBID_CONTENTS&&(z===fe&&(z=U(z)),d(z,o.FORBID_CONTENTS,b)),o.ADD_FORBID_CONTENTS&&(z===fe&&(z=U(z)),d(z,o.ADD_FORBID_CONTENTS,b)),le&&(S["#text"]=!0),Z&&d(S,["html","head","body"]),S.table&&(d(S,["tbody"]),delete At.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ut('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=o.TRUSTED_TYPES_POLICY,gt=I.createHTML("")}else I===void 0&&(I=In(W,s)),I!==null&&typeof gt=="string"&&(gt=I.createHTML(""));L&&L(o),rt=o}},Je=d({},[...jt,...Yt,...bn]),Qe=d({},[...Vt,...Sn]),po=function(o){let a=It(o);(!a||!a.tagName)&&(a={namespaceURI:it,tagName:"template"});const l=Rt(o.tagName),E=Rt(a.tagName);return he[o.namespaceURI]?o.namespaceURI===Ft?a.namespaceURI===G?l==="svg":a.namespaceURI===kt?l==="svg"&&(E==="annotation-xml"||Ut[E]):!!Je[l]:o.namespaceURI===kt?a.namespaceURI===G?l==="math":a.namespaceURI===Ft?l==="math"&&Ht[E]:!!Qe[l]:o.namespaceURI===G?a.namespaceURI===Ft&&!Ht[E]||a.namespaceURI===kt&&!Ut[E]?!1:!Qe[l]&&(co[l]||!Je[l]):!!(bt==="application/xhtml+xml"&&he[o.namespaceURI]):!1},$=function(o){lt(t.removed,{element:o});try{It(o).removeChild(o)}catch{qn(o)}},J=function(o,a){try{lt(t.removed,{attribute:a.getAttributeNode(o),from:a})}catch{lt(t.removed,{attribute:null,from:a})}if(a.removeAttribute(o),o==="is")if(ot||vt)try{$(a)}catch{}else try{a.setAttribute(o,"")}catch{}},tn=function(o){let a=null,l=null;if(ce)o="<remove></remove>"+o;else{const _=Bt(o,/^[\r\n\t ]+/);l=_&&_[0]}bt==="application/xhtml+xml"&&it===G&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const E=I?I.createHTML(o):o;if(it===G)try{a=new V().parseFromString(E,bt)}catch{}if(!a||!a.documentElement){a=ee.createDocument(it,"template",null);try{a.documentElement.innerHTML=pe?gt:E}catch{}}const C=a.body||a.documentElement;return o&&l&&C.insertBefore(e.createTextNode(l),C.childNodes[0]||null),it===G?to.call(a,Z?"html":"body")[0]:Z?a.documentElement:C},en=function(o){return Jn.call(o.ownerDocument||o,o,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},de=function(o){return o instanceof y&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof m)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},nn=function(o){return typeof u=="function"&&o instanceof u};function B(f,o,a){yt(f,l=>{l.call(t,o,a,rt)})}const on=function(o){let a=null;if(B(P.beforeSanitizeElements,o,null),de(o))return $(o),!0;const l=b(o.nodeName);if(B(P.uponSanitizeElement,o,{tagName:l,allowedTags:S}),Pt&&o.hasChildNodes()&&!nn(o.firstElementChild)&&N(/<[/\w!]/g,o.innerHTML)&&N(/<[/\w!]/g,o.textContent)||o.nodeType===ht.progressingInstruction||Pt&&o.nodeType===ht.comment&&N(/<[/\w]/g,o.data))return $(o),!0;if(!(et.tagCheck instanceof Function&&et.tagCheck(l))&&(!S[l]||At[l])){if(!At[l]&&rn(l)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,l)||A.tagNameCheck instanceof Function&&A.tagNameCheck(l)))return!1;if(le&&!z[l]){const E=It(o)||o.parentNode,C=Zn(o)||o.childNodes;if(C&&E){const _=C.length;for(let v=_-1;v>=0;--v){const j=Xn(C[v],!0);j.__removalCount=(o.__removalCount||0)+1,E.insertBefore(j,Kn(o))}}}return $(o),!0}return o instanceof p&&!po(o)||(l==="noscript"||l==="noembed"||l==="noframes")&&N(/<\/no(script|embed|frames)/i,o.innerHTML)?($(o),!0):(nt&&o.nodeType===ht.text&&(a=o.textContent,yt([ne,oe,se],E=>{a=ft(a,E," ")}),o.textContent!==a&&(lt(t.removed,{element:o.cloneNode()}),o.textContent=a)),B(P.afterSanitizeElements,o,null),!1)},sn=function(o,a,l){if(Ye&&(a==="id"||a==="name")&&(l in e||l in uo))return!1;if(!(re&&!ie[a]&&N(no,a))){if(!(Ge&&N(oo,a))){if(!(et.attributeCheck instanceof Function&&et.attributeCheck(a,o))){if(!R[a]||ie[a]){if(!(rn(o)&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,o)||A.tagNameCheck instanceof Function&&A.tagNameCheck(o))&&(A.attributeNameCheck instanceof RegExp&&N(A.attributeNameCheck,a)||A.attributeNameCheck instanceof Function&&A.attributeNameCheck(a,o))||a==="is"&&A.allowCustomizedBuiltInElements&&(A.tagNameCheck instanceof RegExp&&N(A.tagNameCheck,l)||A.tagNameCheck instanceof Function&&A.tagNameCheck(l))))return!1}else if(!ue[a]){if(!N(ze,ft(l,He,""))){if(!((a==="src"||a==="xlink:href"||a==="href")&&o!=="script"&&En(l,"data:")===0&&Xe[o])){if(!(Be&&!N(so,ft(l,He,"")))){if(l)return!1}}}}}}}return!0},rn=function(o){return o!=="annotation-xml"&&Bt(o,io)},an=function(o){B(P.beforeSanitizeAttributes,o,null);const{attributes:a}=o;if(!a||de(o))return;const l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0};let E=a.length;for(;E--;){const C=a[E],{name:_,namespaceURI:v,value:j}=C,at=b(_),Te=j;let w=_==="value"?Te:gn(Te);if(l.attrName=at,l.attrValue=w,l.keepAttr=!0,l.forceKeepAttr=void 0,B(P.uponSanitizeAttribute,o,l),w=l.attrValue,Ve&&(at==="id"||at==="name")&&(J(_,o),w=ro+w),Pt&&N(/((--!?|])>)|<\/(style|title|textarea)/i,w)){J(_,o);continue}if(at==="attributename"&&Bt(w,"href")){J(_,o);continue}if(l.forceKeepAttr)continue;if(!l.keepAttr){J(_,o);continue}if(!je&&N(/\/>/i,w)){J(_,o);continue}nt&&yt([ne,oe,se],ln=>{w=ft(w,ln," ")});const cn=b(o.nodeName);if(!sn(cn,at,w)){J(_,o);continue}if(I&&typeof W=="object"&&typeof W.getAttributeType=="function"&&!v)switch(W.getAttributeType(cn,at)){case"TrustedHTML":{w=I.createHTML(w);break}case"TrustedScriptURL":{w=I.createScriptURL(w);break}}if(w!==Te)try{v?o.setAttributeNS(v,_,w):o.setAttribute(_,w),de(o)?$(o):ge(t.removed)}catch{J(_,o)}}B(P.afterSanitizeAttributes,o,null)},ho=function f(o){let a=null;const l=en(o);for(B(P.beforeSanitizeShadowDOM,o,null);a=l.nextNode();)B(P.uponSanitizeShadowNode,a,null),on(a),an(a),a.content instanceof i&&f(a.content);B(P.afterSanitizeShadowDOM,o,null)};return t.sanitize=function(f){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,l=null,E=null,C=null;if(pe=!f,pe&&(f="<!-->"),typeof f!="string"&&!nn(f))if(typeof f.toString=="function"){if(f=f.toString(),typeof f!="string")throw ut("dirty is not a string, aborting")}else throw ut("toString is not a function");if(!t.isSupported)return f;if(ae||me(o),t.removed=[],typeof f=="string"&&(_t=!1),_t){if(f.nodeName){const j=b(f.nodeName);if(!S[j]||At[j])throw ut("root node is forbidden and cannot be sanitized in-place")}}else if(f instanceof u)a=tn("<!---->"),l=a.ownerDocument.importNode(f,!0),l.nodeType===ht.element&&l.nodeName==="BODY"||l.nodeName==="HTML"?a=l:a.appendChild(l);else{if(!ot&&!nt&&!Z&&f.indexOf("<")===-1)return I&&xt?I.createHTML(f):f;if(a=tn(f),!a)return ot?null:xt?gt:""}a&&ce&&$(a.firstChild);const _=en(_t?f:a);for(;E=_.nextNode();)on(E),an(E),E.content instanceof i&&ho(E.content);if(_t)return f;if(ot){if(vt)for(C=Qn.call(a.ownerDocument);a.firstChild;)C.appendChild(a.firstChild);else C=a;return(R.shadowroot||R.shadowrootmode)&&(C=eo.call(n,C,!0)),C}let v=Z?a.outerHTML:a.innerHTML;return Z&&S["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&N(Re,a.ownerDocument.doctype.name)&&(v="<!DOCTYPE "+a.ownerDocument.doctype.name+`>
|
|
2
|
-
`+
|
|
1
|
+
(function(F,Y){typeof exports=="object"&&typeof module<"u"?Y(exports):typeof define=="function"&&define.amd?define(["exports"],Y):(F=typeof globalThis<"u"?globalThis:F||self,Y(F.wrec={}))})(this,(function(F){"use strict";const{entries:Y,setPrototypeOf:ne,isFrozen:je,getPrototypeOf:Ye,getOwnPropertyDescriptor:Ve}=Object;let{freeze:C,seal:D,create:Ct}=Object,{apply:Mt,construct:Ot}=typeof Reflect<"u"&&Reflect;C||(C=function(t){return t}),D||(D=function(t){return t}),Mt||(Mt=function(t,e){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return t.apply(e,i)}),Ot||(Ot=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return new t(...n)});const pt=O(Array.prototype.forEach),Xe=O(Array.prototype.lastIndexOf),oe=O(Array.prototype.pop),et=O(Array.prototype.push),qe=O(Array.prototype.splice),mt=O(String.prototype.toLowerCase),Nt=O(String.prototype.toString),wt=O(String.prototype.match),nt=O(String.prototype.replace),Ke=O(String.prototype.indexOf),Ze=O(String.prototype.trim),I=O(Object.prototype.hasOwnProperty),M=O(RegExp.prototype.test),ot=Je(TypeError);function O(s){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return Mt(s,t,n)}}function Je(s){return function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return Ot(s,e)}}function m(s,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mt;ne&&ne(s,null);let n=t.length;for(;n--;){let i=t[n];if(typeof i=="string"){const r=e(i);r!==i&&(je(t)||(t[n]=r),i=r)}s[i]=!0}return s}function Qe(s){for(let t=0;t<s.length;t++)I(s,t)||(s[t]=null);return s}function v(s){const t=Ct(null);for(const[e,n]of Y(s))I(s,e)&&(Array.isArray(n)?t[e]=Qe(n):n&&typeof n=="object"&&n.constructor===Object?t[e]=v(n):t[e]=n);return t}function it(s,t){for(;s!==null;){const n=Ve(s,t);if(n){if(n.get)return O(n.get);if(typeof n.value=="function")return O(n.value)}s=Ye(s)}function e(){return null}return e}const ie=C(["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"]),Lt=C(["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"]),Dt=C(["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"]),tn=C(["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"]),It=C(["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"]),en=C(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),se=C(["#text"]),re=C(["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"]),Pt=C(["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"]),ae=C(["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"]),ht=C(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nn=D(/\{\{[\w\W]*|[\w\W]*\}\}/gm),on=D(/<%[\w\W]*|[\w\W]*%>/gm),sn=D(/\$\{[\w\W]*/gm),rn=D(/^data-[\-\w.\u00B7-\uFFFF]+$/),an=D(/^aria-[\-\w]+$/),ce=D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),cn=D(/^(?:\w+script|data):/i),ln=D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),le=D(/^html$/i),fn=D(/^[a-z][.\w]*(-[.\w]+)+$/i);var fe=Object.freeze({__proto__:null,ARIA_ATTR:an,ATTR_WHITESPACE:ln,CUSTOM_ELEMENT:fn,DATA_ATTR:rn,DOCTYPE_NAME:le,ERB_EXPR:on,IS_ALLOWED_URI:ce,IS_SCRIPT_OR_DATA:cn,MUSTACHE_EXPR:nn,TMPLIT_EXPR:sn});const st={element:1,text:3,progressingInstruction:7,comment:8,document:9},un=function(){return typeof window>"u"?null:window},pn=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(n=e.getAttribute(i));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},ue=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function pe(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:un();const t=f=>pe(f);if(t.version="3.3.1",t.removed=[],!s||!s.document||s.document.nodeType!==st.document||!s.Element)return t.isSupported=!1,t;let{document:e}=s;const n=e,i=n.currentScript,{DocumentFragment:r,HTMLTemplateElement:c,Node:h,Element:u,NodeFilter:p,NamedNodeMap:d=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:b,DOMParser:W,trustedTypes:U}=s,$=u.prototype,Nn=it($,"cloneNode"),wn=it($,"remove"),Ln=it($,"nextSibling"),Dn=it($,"childNodes"),Et=it($,"parentNode");if(typeof c=="function"){const f=e.createElement("template");f.content&&f.content.ownerDocument&&(e=f.content.ownerDocument)}let N,ct="";const{implementation:zt,createNodeIterator:In,createDocumentFragment:Pn,getElementsByTagName:vn}=e,{importNode:xn}=n;let w=ue();t.isSupported=typeof Y=="function"&&typeof Et=="function"&&zt&&zt.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Gt,ERB_EXPR:Wt,TMPLIT_EXPR:$t,DATA_ATTR:kn,ARIA_ATTR:Fn,IS_SCRIPT_OR_DATA:Un,ATTR_WHITESPACE:be,CUSTOM_ELEMENT:Hn}=fe;let{IS_ALLOWED_URI:Se}=fe,_=null;const ye=m({},[...ie,...Lt,...Dt,...It,...se]);let S=null;const Re=m({},[...re,...Pt,...ae,...ht]);let E=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}})),lt=null,Bt=null;const X=Object.seal(Ct(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ce=!0,jt=!0,Me=!1,Oe=!0,q=!1,gt=!0,B=!1,Yt=!1,Vt=!1,K=!1,At=!1,_t=!1,Ne=!0,we=!1;const zn="user-content-";let Xt=!0,ft=!1,Z={},x=null;const qt=m({},["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"]);let Le=null;const De=m({},["audio","video","img","source","image","track"]);let Kt=null;const Ie=m({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bt="http://www.w3.org/1998/Math/MathML",St="http://www.w3.org/2000/svg",H="http://www.w3.org/1999/xhtml";let J=H,Zt=!1,Jt=null;const Gn=m({},[bt,St,H],Nt);let yt=m({},["mi","mo","mn","ms","mtext"]),Rt=m({},["annotation-xml"]);const Wn=m({},["title","style","font","a","script"]);let ut=null;const $n=["application/xhtml+xml","text/html"],Bn="text/html";let A=null,Q=null;const jn=e.createElement("form"),Pe=function(o){return o instanceof RegExp||o instanceof Function},Qt=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Q&&Q===o)){if((!o||typeof o!="object")&&(o={}),o=v(o),ut=$n.indexOf(o.PARSER_MEDIA_TYPE)===-1?Bn:o.PARSER_MEDIA_TYPE,A=ut==="application/xhtml+xml"?Nt:mt,_=I(o,"ALLOWED_TAGS")?m({},o.ALLOWED_TAGS,A):ye,S=I(o,"ALLOWED_ATTR")?m({},o.ALLOWED_ATTR,A):Re,Jt=I(o,"ALLOWED_NAMESPACES")?m({},o.ALLOWED_NAMESPACES,Nt):Gn,Kt=I(o,"ADD_URI_SAFE_ATTR")?m(v(Ie),o.ADD_URI_SAFE_ATTR,A):Ie,Le=I(o,"ADD_DATA_URI_TAGS")?m(v(De),o.ADD_DATA_URI_TAGS,A):De,x=I(o,"FORBID_CONTENTS")?m({},o.FORBID_CONTENTS,A):qt,lt=I(o,"FORBID_TAGS")?m({},o.FORBID_TAGS,A):v({}),Bt=I(o,"FORBID_ATTR")?m({},o.FORBID_ATTR,A):v({}),Z=I(o,"USE_PROFILES")?o.USE_PROFILES:!1,Ce=o.ALLOW_ARIA_ATTR!==!1,jt=o.ALLOW_DATA_ATTR!==!1,Me=o.ALLOW_UNKNOWN_PROTOCOLS||!1,Oe=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=o.SAFE_FOR_TEMPLATES||!1,gt=o.SAFE_FOR_XML!==!1,B=o.WHOLE_DOCUMENT||!1,K=o.RETURN_DOM||!1,At=o.RETURN_DOM_FRAGMENT||!1,_t=o.RETURN_TRUSTED_TYPE||!1,Vt=o.FORCE_BODY||!1,Ne=o.SANITIZE_DOM!==!1,we=o.SANITIZE_NAMED_PROPS||!1,Xt=o.KEEP_CONTENT!==!1,ft=o.IN_PLACE||!1,Se=o.ALLOWED_URI_REGEXP||ce,J=o.NAMESPACE||H,yt=o.MATHML_TEXT_INTEGRATION_POINTS||yt,Rt=o.HTML_INTEGRATION_POINTS||Rt,E=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Pe(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(E.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Pe(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(E.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(E.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(jt=!1),At&&(K=!0),Z&&(_=m({},se),S=[],Z.html===!0&&(m(_,ie),m(S,re)),Z.svg===!0&&(m(_,Lt),m(S,Pt),m(S,ht)),Z.svgFilters===!0&&(m(_,Dt),m(S,Pt),m(S,ht)),Z.mathMl===!0&&(m(_,It),m(S,ae),m(S,ht))),o.ADD_TAGS&&(typeof o.ADD_TAGS=="function"?X.tagCheck=o.ADD_TAGS:(_===ye&&(_=v(_)),m(_,o.ADD_TAGS,A))),o.ADD_ATTR&&(typeof o.ADD_ATTR=="function"?X.attributeCheck=o.ADD_ATTR:(S===Re&&(S=v(S)),m(S,o.ADD_ATTR,A))),o.ADD_URI_SAFE_ATTR&&m(Kt,o.ADD_URI_SAFE_ATTR,A),o.FORBID_CONTENTS&&(x===qt&&(x=v(x)),m(x,o.FORBID_CONTENTS,A)),o.ADD_FORBID_CONTENTS&&(x===qt&&(x=v(x)),m(x,o.ADD_FORBID_CONTENTS,A)),Xt&&(_["#text"]=!0),B&&m(_,["html","head","body"]),_.table&&(m(_,["tbody"]),delete lt.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw ot('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ot('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');N=o.TRUSTED_TYPES_POLICY,ct=N.createHTML("")}else N===void 0&&(N=pn(U,i)),N!==null&&typeof ct=="string"&&(ct=N.createHTML(""));C&&C(o),Q=o}},ve=m({},[...Lt,...Dt,...tn]),xe=m({},[...It,...en]),Yn=function(o){let a=Et(o);(!a||!a.tagName)&&(a={namespaceURI:J,tagName:"template"});const l=mt(o.tagName),T=mt(a.tagName);return Jt[o.namespaceURI]?o.namespaceURI===St?a.namespaceURI===H?l==="svg":a.namespaceURI===bt?l==="svg"&&(T==="annotation-xml"||yt[T]):!!ve[l]:o.namespaceURI===bt?a.namespaceURI===H?l==="math":a.namespaceURI===St?l==="math"&&Rt[T]:!!xe[l]:o.namespaceURI===H?a.namespaceURI===St&&!Rt[T]||a.namespaceURI===bt&&!yt[T]?!1:!xe[l]&&(Wn[l]||!ve[l]):!!(ut==="application/xhtml+xml"&&Jt[o.namespaceURI]):!1},k=function(o){et(t.removed,{element:o});try{Et(o).removeChild(o)}catch{wn(o)}},j=function(o,a){try{et(t.removed,{attribute:a.getAttributeNode(o),from:a})}catch{et(t.removed,{attribute:null,from:a})}if(a.removeAttribute(o),o==="is")if(K||At)try{k(a)}catch{}else try{a.setAttribute(o,"")}catch{}},ke=function(o){let a=null,l=null;if(Vt)o="<remove></remove>"+o;else{const g=wt(o,/^[\r\n\t ]+/);l=g&&g[0]}ut==="application/xhtml+xml"&&J===H&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");const T=N?N.createHTML(o):o;if(J===H)try{a=new W().parseFromString(T,ut)}catch{}if(!a||!a.documentElement){a=zt.createDocument(J,"template",null);try{a.documentElement.innerHTML=Zt?ct:T}catch{}}const R=a.body||a.documentElement;return o&&l&&R.insertBefore(e.createTextNode(l),R.childNodes[0]||null),J===H?vn.call(a,B?"html":"body")[0]:B?a.documentElement:R},Fe=function(o){return In.call(o.ownerDocument||o,o,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},te=function(o){return o instanceof b&&(typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||!(o.attributes instanceof d)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function")},Ue=function(o){return typeof h=="function"&&o instanceof h};function z(f,o,a){pt(f,l=>{l.call(t,o,a,Q)})}const He=function(o){let a=null;if(z(w.beforeSanitizeElements,o,null),te(o))return k(o),!0;const l=A(o.nodeName);if(z(w.uponSanitizeElement,o,{tagName:l,allowedTags:_}),gt&&o.hasChildNodes()&&!Ue(o.firstElementChild)&&M(/<[/\w!]/g,o.innerHTML)&&M(/<[/\w!]/g,o.textContent)||o.nodeType===st.progressingInstruction||gt&&o.nodeType===st.comment&&M(/<[/\w]/g,o.data))return k(o),!0;if(!(X.tagCheck instanceof Function&&X.tagCheck(l))&&(!_[l]||lt[l])){if(!lt[l]&&Ge(l)&&(E.tagNameCheck instanceof RegExp&&M(E.tagNameCheck,l)||E.tagNameCheck instanceof Function&&E.tagNameCheck(l)))return!1;if(Xt&&!x[l]){const T=Et(o)||o.parentNode,R=Dn(o)||o.childNodes;if(R&&T){const g=R.length;for(let L=g-1;L>=0;--L){const G=Nn(R[L],!0);G.__removalCount=(o.__removalCount||0)+1,T.insertBefore(G,Ln(o))}}}return k(o),!0}return o instanceof u&&!Yn(o)||(l==="noscript"||l==="noembed"||l==="noframes")&&M(/<\/no(script|embed|frames)/i,o.innerHTML)?(k(o),!0):(q&&o.nodeType===st.text&&(a=o.textContent,pt([Gt,Wt,$t],T=>{a=nt(a,T," ")}),o.textContent!==a&&(et(t.removed,{element:o.cloneNode()}),o.textContent=a)),z(w.afterSanitizeElements,o,null),!1)},ze=function(o,a,l){if(Ne&&(a==="id"||a==="name")&&(l in e||l in jn))return!1;if(!(jt&&!Bt[a]&&M(kn,a))){if(!(Ce&&M(Fn,a))){if(!(X.attributeCheck instanceof Function&&X.attributeCheck(a,o))){if(!S[a]||Bt[a]){if(!(Ge(o)&&(E.tagNameCheck instanceof RegExp&&M(E.tagNameCheck,o)||E.tagNameCheck instanceof Function&&E.tagNameCheck(o))&&(E.attributeNameCheck instanceof RegExp&&M(E.attributeNameCheck,a)||E.attributeNameCheck instanceof Function&&E.attributeNameCheck(a,o))||a==="is"&&E.allowCustomizedBuiltInElements&&(E.tagNameCheck instanceof RegExp&&M(E.tagNameCheck,l)||E.tagNameCheck instanceof Function&&E.tagNameCheck(l))))return!1}else if(!Kt[a]){if(!M(Se,nt(l,be,""))){if(!((a==="src"||a==="xlink:href"||a==="href")&&o!=="script"&&Ke(l,"data:")===0&&Le[o])){if(!(Me&&!M(Un,nt(l,be,"")))){if(l)return!1}}}}}}}return!0},Ge=function(o){return o!=="annotation-xml"&&wt(o,Hn)},We=function(o){z(w.beforeSanitizeAttributes,o,null);const{attributes:a}=o;if(!a||te(o))return;const l={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:S,forceKeepAttr:void 0};let T=a.length;for(;T--;){const R=a[T],{name:g,namespaceURI:L,value:G}=R,tt=A(g),ee=G;let y=g==="value"?ee:Ze(ee);if(l.attrName=tt,l.attrValue=y,l.keepAttr=!0,l.forceKeepAttr=void 0,z(w.uponSanitizeAttribute,o,l),y=l.attrValue,we&&(tt==="id"||tt==="name")&&(j(g,o),y=zn+y),gt&&M(/((--!?|])>)|<\/(style|title|textarea)/i,y)){j(g,o);continue}if(tt==="attributename"&&wt(y,"href")){j(g,o);continue}if(l.forceKeepAttr)continue;if(!l.keepAttr){j(g,o);continue}if(!Oe&&M(/\/>/i,y)){j(g,o);continue}q&&pt([Gt,Wt,$t],Be=>{y=nt(y,Be," ")});const $e=A(o.nodeName);if(!ze($e,tt,y)){j(g,o);continue}if(N&&typeof U=="object"&&typeof U.getAttributeType=="function"&&!L)switch(U.getAttributeType($e,tt)){case"TrustedHTML":{y=N.createHTML(y);break}case"TrustedScriptURL":{y=N.createScriptURL(y);break}}if(y!==ee)try{L?o.setAttributeNS(L,g,y):o.setAttribute(g,y),te(o)?k(o):oe(t.removed)}catch{j(g,o)}}z(w.afterSanitizeAttributes,o,null)},Vn=function f(o){let a=null;const l=Fe(o);for(z(w.beforeSanitizeShadowDOM,o,null);a=l.nextNode();)z(w.uponSanitizeShadowNode,a,null),He(a),We(a),a.content instanceof r&&f(a.content);z(w.afterSanitizeShadowDOM,o,null)};return t.sanitize=function(f){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,l=null,T=null,R=null;if(Zt=!f,Zt&&(f="<!-->"),typeof f!="string"&&!Ue(f))if(typeof f.toString=="function"){if(f=f.toString(),typeof f!="string")throw ot("dirty is not a string, aborting")}else throw ot("toString is not a function");if(!t.isSupported)return f;if(Yt||Qt(o),t.removed=[],typeof f=="string"&&(ft=!1),ft){if(f.nodeName){const G=A(f.nodeName);if(!_[G]||lt[G])throw ot("root node is forbidden and cannot be sanitized in-place")}}else if(f instanceof h)a=ke("<!---->"),l=a.ownerDocument.importNode(f,!0),l.nodeType===st.element&&l.nodeName==="BODY"||l.nodeName==="HTML"?a=l:a.appendChild(l);else{if(!K&&!q&&!B&&f.indexOf("<")===-1)return N&&_t?N.createHTML(f):f;if(a=ke(f),!a)return K?null:_t?ct:""}a&&Vt&&k(a.firstChild);const g=Fe(ft?f:a);for(;T=g.nextNode();)He(T),We(T),T.content instanceof r&&Vn(T.content);if(ft)return f;if(K){if(At)for(R=Pn.call(a.ownerDocument);a.firstChild;)R.appendChild(a.firstChild);else R=a;return(S.shadowroot||S.shadowrootmode)&&(R=xn.call(n,R,!0)),R}let L=B?a.outerHTML:a.innerHTML;return B&&_["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&M(le,a.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+a.ownerDocument.doctype.name+`>
|
|
2
|
+
`+L),q&&pt([Gt,Wt,$t],G=>{L=nt(L,G," ")}),N&&_t?N.createHTML(L):L},t.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Qt(f),Yt=!0},t.clearConfig=function(){Q=null,Yt=!1},t.isValidAttribute=function(f,o,a){Q||Qt({});const l=A(f),T=A(o);return ze(l,T,a)},t.addHook=function(f,o){typeof o=="function"&&et(w[f],o)},t.removeHook=function(f,o){if(o!==void 0){const a=Xe(w[f],o);return a===-1?void 0:qe(w[f],a,1)[0]}return oe(w[f])},t.removeHooks=function(f){w[f]=[]},t.removeAllHooks=function(){w=ue()},t}var me=pe();function he(s,t){let e=s;for(const n of t.split("."))e=e[n];return e}function mn(s,t,e){const n=t.split("."),i=n.length-1;let r=s;n.forEach((c,h)=>{h===i?r[c]=e:r=r[c]})}const hn=new Set(["onblur","onchange","onclick","onfocus","oninput","onkeydown","onreset","onsubmit"]);me.addHook("uponSanitizeAttribute",(s,t)=>{const{attrName:e}=t,n=e.toLowerCase();hn.has(n)&&(t.forceKeepAttr=!0)});class V extends Error{}const dn=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,de="a-zA-Z_$",Tn=de+"0-9",rt=`[${de}][${Tn}]*`,En=/<!--\s*(.*?)\s*-->/,gn=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,vt=new RegExp(`^this\\.${rt}$`),xt=new RegExp(`this\\.${rt}(\\.${rt})*`,"g"),Te=new RegExp(`this\\.${rt}(\\.${rt})*`),An=new Set(["class","style"]),Ee=5;function _n(s){return s instanceof HTMLButtonElement||s instanceof HTMLFieldSetElement||s instanceof HTMLInputElement||s instanceof HTMLSelectElement||s instanceof HTMLTextAreaElement||s instanceof P}function bn(s,t,e){const n=document.createElement(s);if(t)for(const[i,r]of Object.entries(t))n.setAttribute(i,r);return e&&(n.innerHTML=e),n}const Sn=s=>s===String?"":s===Number?0:s===Boolean?!1:s===Array?[]:s===Object?{}:void 0;function dt(s){const t=[];let e=s.firstElementChild;for(;e;)t.push(e),e.shadowRoot&&t.push(...dt(e.shadowRoot)),e.firstElementChild&&t.push(...dt(e)),e=e.nextElementSibling;return t}const Tt=s=>s.substring(Ee).split(".")[0];function ge(s,t){let e=s[0];return t.forEach((n,i)=>{e+=n+s[i+1]}),e}function kt(s){const t=typeof s;return t==="string"||t==="number"||t==="boolean"}function at(s){return s.localName==="textarea"}function Ft(s){const{localName:t}=s;return t==="input"||t==="select"}const yn=s=>s.replace(/<!--[\s\S]*?-->/g,"");function Ae(s,t,e,n){return s.slice(0,t)+n+s.slice(t+e)}function Rn(s){let t=s.trim(),e=null;/^\s*<tr[\s>]/i.test(t)?(t=`<table><tbody>${t}</tbody></table>`,e="tbody"):/^\s*<(td|th)[\s>]/i.test(t)?(t=`<table><tbody><tr>${t}</tr></tbody></table>`,e="tr"):/^\s*<option[\s>]/i.test(t)?(t=`<select>${t}</select>`,e="select"):/^\s*<col[\s>]/i.test(t)&&(t=`<table><colgroup>${t}</colgroup></table>`,e="colgroup");const n=me.sanitize(t,{ADD_TAGS:["#comment"],ALLOW_UNKNOWN_PROTOCOLS:!0,RETURN_DOM_FRAGMENT:!0});if(e){const i=n.querySelector(e);if(i)return i.childNodes}return n.childNodes}function Ut(s){const t=Number(s);if(isNaN(t))throw new V(`can't convert "${s}" to a number`);return t}function _e(s,t,e){const[n,i]=t.split(":");if(kt(e))if(typeof e=="boolean"){e?s.setAttribute(n,n):s.removeAttribute(n);const r=P.getPropName(n);s[r]=e}else{const r=s.getAttribute(t),c=String(e);r!==c&&(s.setAttribute(n,c),n==="value"&&Ft(s)&&(s.value=c))}else{const r=P.getPropName(t);s[r]=e}}function Ht(s,t,e){const[n,i]=t.split(":");s instanceof CSSStyleRule?s.style.setProperty(n,e):(_e(s,n,e),n==="value"&&Ft(s)&&(s.value=e))}async function Cn(s){const t=new Set;for(const n of dt(s.content)){const{localName:i}=n;i.includes("-")&&t.add(i)}function e(n){return new Promise((i,r)=>{setTimeout(()=>{const c=`custom element <${n}> not defined`;r(new Error(c))},1e3)})}return Promise.all([...t].map(async n=>Promise.race([customElements.whenDefined(n),e(n)])))}class P extends HTMLElement{static attrToPropMap=new Map;static propToAttrMap=new Map;static css="";static elementName="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static template=null;#t=this.constructor;#n=new Map;#c={};#i;#l={};#f=null;#u=new Map;static define(t){if(this.elementName=t,customElements.get(t))throw new V(`custom element ${t} is already defined`);customElements.define(t,this)}constructor(){super(),this.attachShadow({mode:"open"});const t=this.#t;t.attrToPropMap||(t.attrToPropMap=new Map),t.properties||(t.properties={}),t.propToAttrMap||(t.propToExprsMap=new Map),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,n){t==="disabled"&&this.#m();const i=P.getPropName(t);if(this.#s(i)){const r=this.#A(i,String(n));this[i]=r;const c=this.#c[i];c&&this.setFormValue(c,String(r)),this.propertyChangedCallback(i,e,n)}}async#S(){const t=this.#t;let{template:e}=t;if(!e){e=t.template=document.createElement("template");let n=`<style>
|
|
3
3
|
:host([hidden]) { display: none; }`;t.css&&(n+=t.css),n+=`</style>
|
|
4
|
-
`;let
|
|
5
|
-
${
|
|
4
|
+
`;let i=t.html.trim();if(!i)throw new V("static property html must be set");i.startsWith("<")||(i=`<span><!--${i}--></span>`),e.innerHTML=n+i}await Cn(e),this.shadowRoot.replaceChildren(e.content.cloneNode(!0))}changed(t,e,n){this[e]=n}connectedCallback(){this.#P(),this.#R(),this.#S().then(()=>{this.hasAttribute("disabled")&&this.#m(),this.#b(this.shadowRoot),this.#h(this.shadowRoot),this.#y()})}#y(){const t=this.#t,{properties:e}=t;for(const[n,{computed:i}]of Object.entries(e))i&&(this[n]=this.#o(i))}#R(){const t=this.#t,{observedAttributes:e,properties:n}=t;for(const[i,r]of Object.entries(n))this.#C(i,r,e)}#C(t,e,n){const i=P.getAttrName(t),r=this.hasAttribute(i);e.required&&!r&&this.#e(this,t,"is a required attribute");let c=e.value;this.hasOwnProperty(t)&&(c=this[t],delete this[t]);const{type:h}=e,u=h===Boolean?c||r:n.includes(i)&&r?this.#g(t,i):c||Sn(h),p="#"+t;this[p]=u,e.computed&&this.#w(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[p]},set(d){h===Number&&typeof d=="string"&&(d=Ut(d));const b=this[p];if(d===b)return;this.#x(t,h,d),this[p]=d;const{state:W,stateProp:U}=this.#t.properties[t];U&&mn(W,U,d),this.#D(t),this.#L(t,h,d,i),this.#E(t),this.#I(t,d);const $=this.#c[t];$&&this.setFormValue($,String(d)),this.propertyChangedCallback(t,b,d),e.dispatch&&this.dispatch("change",{tagName:this.localName,property:t,oldValue:b,value:d})}})}#m(){const t=this.hasAttribute("disabled"),e=dt(this.shadowRoot);for(const n of e)_n(n)&&(n.disabled=t)}disconnectedCallback(){this.#n.clear(),this.#l.clear(),this.#u.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}#M(t){const e=t instanceof P;for(const n of t.getAttributeNames()){const i=t.getAttribute(n),r=this.#T(t,i);if(r){const c=this[r];c===void 0&&this.#a(t,n,r),t[r]=c;let[h,u]=n.split(":");h==="value"&&(u?(t["on"+u]===void 0&&this.#e(t,n,"refers to an unsupported event name"),t.setAttribute(h,this[r])):u="change"),e&&t.#u.set(P.getPropName(h),r)}this.#r(i,t,n)}}#o(t){const e=new Function("return "+t).call(this);return Array.isArray(e)?e.join(""):e}#O(t){const{localName:e}=t;if(e==="style"){const{sheet:n}=t,i=n?.cssRules??[],r=Array.from(i);for(const c of r)if(c.constructor===CSSStyleRule){const h=Array.from(c.style);for(const u of h)if(u.startsWith("--")){const p=c.style.getPropertyValue(u);this.#r(p,c,u)}}}else{let n="";if(at(t)){this.#r(t.textContent,t);const i=t.textContent?.match(En);i&&(n=i[1])}else{const i=Array.from(t.childNodes).find(r=>r.nodeType===Node.COMMENT_NODE);i&&(n=i.textContent?.trim()??"")}if(n){const i=this.#T(t,n);i&&at(t)?t.textContent=this[i]:this.#r(n,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const c=this.getAttribute("name");if(c)if(this.#s("value"))t=`value:${c}`;else return;else return}const e={},n=t.split(",");for(const c of n){const[h,u]=c.split(":");e[h.trim()]=u.trim()}this.#c=e,this.#i=new FormData,this.#f=this.attachInternals(),this.#f.setFormValue(this.#i);const i=Object.keys(this.#t.properties),r=this.#l;for(const c of i)r[c]=this[c]}formResetCallback(){const t=this.#l;for(const e of Object.keys(t)){let n=t[e];vt.test(n)&&(n=this.#o(n)),this[e]=n}}static getAttrName(t){let e=this.propToAttrMap.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),this.propToAttrMap.set(t,e)),e}static getPropName(t){let e=this.attrToPropMap.get(t);return e||(e=t.replace(/-([a-z])/g,(n,i)=>i.toUpperCase()),this.attrToPropMap.set(t,e)),e}#N(t,e,n){if(n.length!==1)return;const[i]=n;if(!vt.test(i))return;const r=Ft(t)||at(t);let[c,h]=(e??"").split(":");if(!(r&&c==="value"||at(t)))return;h?t["on"+h]===void 0&&this.#e(t,e,"refers to an unsupported event name"):h="change";const p=Tt(i);t.addEventListener(h,d=>{const{target:b}=d;if(!b)return;const W=b.value,{type:U}=this.#t.properties[p];this[p]=U===Number?Ut(W):W,this.#E(p)})}#s(t){return!!this.#t.properties[t]}#h(t){const e=Array.from(t.querySelectorAll("*"));for(const n of e)this.#M(n),n.firstElementChild||this.#O(n)}#d(){if(this.#t.formAssociated||this.closest("form")===null)return;const t=this.#t.name;throw new V(`inside form, class ${t} requires "static formAssociated = true;"`)}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(e=>P.getAttrName(e));return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,n){}#T(t,e){if(!e||!vt.test(e))return;const n=Tt(e);return this[n]===void 0&&this.#a(t,"",n),n}#E(t){const i=this.#t.propToExprsMap.get(t)||[];for(const r of i){let c=this.#o(r);const h=this.#n.get(r)??[];for(const u of h)if(u instanceof HTMLElement)this.#_(u,c);else if(!(u instanceof CSSStyleRule)){const{element:p,attrName:d}=u;p instanceof CSSStyleRule?p.style.setProperty(d,c):Ht(p,d,c)}}}#w(t,e){const{computed:n,uses:i}=e,r=this.#t.propToComputedMap;function c(u,p){let d=r.get(u);d||(d=[],r.set(u,d)),d.push([t,p])}const h=n.match(xt)||[];for(const u of h){const p=u.substring(Ee);this[p]===void 0&&this.#a(null,t,p),typeof this[p]!="function"&&c(p,n)}if(i)for(const u of i.split(","))c(u,n)}#r(t,e,n=void 0){if(!t)return;const i=this.#p(e,n,t);if(!i){const u=t.replaceAll("this..","this.");n?Ht(e,n,u):"textContent"in e&&(e.textContent=u);return}const r=this.#t;i.forEach(u=>{const p=Tt(u);if(typeof this[p]=="function")return;const d=r.propToExprsMap;let b=d.get(p);b||(b=[],d.set(p,b)),b.includes(t)||b.push(t)});for(const[u,p]of this.#n.entries())for(const d of p){const b=d instanceof HTMLElement||d instanceof CSSStyleRule?d:d.element;b instanceof CSSStyleRule||b.isConnected||this.#n.set(u,p.filter(W=>W!==d))}let c=this.#n.get(t);c||(c=[],this.#n.set(t,c)),c.push(n?{element:e,attrName:n}:e),e instanceof HTMLElement&&this.#N(e,n,i);const h=this.#o(t);n?Ht(e,n,h):this.#_(e,h)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){!this.#i||!kt(e)||(this.#i.set(t,e),this.#f?.setFormValue(this.#i))}#e(t,e,n){const i=t instanceof HTMLElement?t.localName:"CSS rule";throw new V(`component ${this.#t.elementName}`+(t?`, element "${i}"`:"")+(e?`, attribute "${e}"`:"")+` ${n}`)}#a(t,e,n){this.#e(t,e,`refers to missing property "${n}"`)}#g(t,e){return this.#A(t,this.getAttribute(e))}#A(t,e){if(e?.match(xt))return e;const n=this.#t,{type:i}=n.properties[t];if(i||this.#e(null,t,"does not specify its type"),i===String)return e;if(i===Number)return Ut(e);if(i===Boolean)return e==="true"?!0:e==="false"||e==="null"?!1:(e&&e!==t&&this.#e(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t)}#L(t,e,n,i){if(kt(n)&&this.hasAttribute(i)){const r=e===Boolean?this.hasAttribute(i):this.#g(t,i);n!==r&&_e(this,t,n)}}#D(t){const n=this.#t.propToComputedMap.get(t)||[];for(const[i,r]of n)this[i]=this.#o(r)}#_(t,e){if(e===void 0)return;const n=t instanceof HTMLElement,i=typeof e;if(i!=="string"&&i!=="number"&&this.#e(t,void 0," computed content is not a string or number"),t instanceof HTMLElement&&at(t))t.value=e;else if(n&&i==="string"&&e.trim().startsWith("<")){const r=Rn(e);t.replaceChildren(...r),this.#b(t),this.#h(t)}else n&&(t.textContent=e)}#I(t,e){const n=this.#u.get(t);if(!n)return;const i=this.getRootNode();if(!(i instanceof ShadowRoot))return;const{host:r}=i;if(!r)return;const c=r;c[n]=e}useState(t,e){if(!e){e={};for(const n of Object.keys(t))e[n]=n}this.#v(t,e);for(const[n,i]of Object.entries(e))if(this.#s(i)){const r=he(t,n);r!==void 0&&(this[i]=r);const c=this.#t.properties[i];c.state=t,c.stateProp=n}t.addListener(this,e)}#P(){const t=this.#t,e=new Set(Object.keys(t.properties));for(const n of e)An.has(n)&&this.#e(null,"",`property "${n}" is not allowed because it is a reserved attribute`);for(const n of this.getAttributeNames())if(n!=="class"&&n!=="id"&&n!=="disabled"&&!n.startsWith("on")){if(n==="form-assoc"){this.#d();continue}if(!e.has(P.getPropName(n))){if(n==="name"){this.#d();continue}this.#e(null,n,"is not a supported attribute")}}}#p(t,e,n){const i=n.match(xt);if(i)return i.forEach(r=>{const c=Tt(r);this[c]===void 0&&this.#a(t,e,c)}),i}#v(t,e){for(const[n,i]of Object.entries(e)){let r=he(t,n);if(r===void 0)throw new V(`invalid state path "${n}"`);r=this[i],this.#s(i)||this.#e(null,i,"refers to missing property in useState map")}}#x(t,e,n){if(n instanceof e)return;let i=typeof n;if(i==="object"){const{constructor:r}=n;i=r.name,r!==e&&this.#e(null,t,`was set to a ${i}, but must be a ${e.name}`)}i!==e.name.toLowerCase()&&this.#e(null,t,`was set to a ${i}, but must be a ${e.name}`)}#b(t){const e=Array.from(t.querySelectorAll("*"));for(const n of e){const i=[];for(const r of Array.from(n.attributes)){const c=r.name;if(c.startsWith("on")){let h=c.slice(2);h=h[0].toLowerCase()+h.slice(1).toLowerCase();const u=r.value;this.#p(n,c,u);let p;typeof this[u]=="function"?p=d=>this[u](d):(this.#p(n,c,u),p=()=>this.#o(u)),n.addEventListener(h,p),i.push(c)}}for(const r of i)n.removeAttribute(r)}}}function Mn(s,...t){let e=ge(s,t);for(;;){const n=dn.exec(e);if(!n)break;const i=n[2];if(Te.test(i)){const r=n[1];if(!r.startsWith("--")){const c=`--${r}: ${i};
|
|
5
|
+
${r}: var(--${r})`;e=Ae(e,n.index,n[0].length,c)}}}return e}function On(s,...t){let e=ge(s,t);for(;;){const n=gn.exec(e);if(!n||n[1]==="style")break;const i=yn(n[2]);if(Te.test(i)){const r=`<!-- ${i.trim()} -->`,c=n.index+n[0].indexOf(">")+1;e=Ae(e,c,i.length,r)}}return e}F.Wrec=P,F.createElement=bn,F.css=Mn,F.html=On,Object.defineProperty(F,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "wrec",
|
|
3
3
|
"description": "a small library that greatly simplifies building web components",
|
|
4
4
|
"author": "R. Mark Volkmann",
|
|
5
|
-
"version": "0.20.
|
|
5
|
+
"version": "0.20.4",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -13,11 +13,13 @@
|
|
|
13
13
|
"component"
|
|
14
14
|
],
|
|
15
15
|
"type": "module",
|
|
16
|
+
"main": "./dist/wrec.umd.js",
|
|
17
|
+
"module": "./dist/wrec.es.js",
|
|
16
18
|
"types": "./dist/wrec.d.ts",
|
|
17
|
-
"
|
|
18
|
-
"module": "dist/wrec.es.js",
|
|
19
|
+
"moduleResolution": "bundler",
|
|
19
20
|
"exports": {
|
|
20
21
|
".": {
|
|
22
|
+
"types": "./dist/wrec.d.ts",
|
|
21
23
|
"import": "./dist/wrec.es.js",
|
|
22
24
|
"require": "./dist/wrec.umd.js"
|
|
23
25
|
}
|
|
@@ -38,7 +40,6 @@
|
|
|
38
40
|
"unittest": "vitest"
|
|
39
41
|
},
|
|
40
42
|
"devDependencies": {
|
|
41
|
-
"@microsoft/api-extractor": "7.56.3",
|
|
42
43
|
"@playwright/test": "^1.57.0",
|
|
43
44
|
"@types/node": "^25.0.6",
|
|
44
45
|
"oxlint": "^1.38.0",
|