@sakura-ui/sakura-ui 0.5.2 → 0.5.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/package.json +2 -2
- package/packages/forms/.turbo/turbo-build.log +2 -2
- package/packages/helper/.turbo/turbo-build.log +1 -1
- package/packages/markdown/.turbo/turbo-build.log +3 -3
- package/packages/markdown/dist/index.cjs.js +1 -1
- package/packages/markdown/dist/index.es.js +155 -149
- package/packages/markdown/dist/types/components/Markdown.d.ts.map +1 -1
- package/packages/markdown/dist/types/decorate.d.ts +2 -5
- package/packages/markdown/dist/types/decorate.d.ts.map +1 -1
- package/packages/markdown/dist/types/marked/attributes.d.ts +4 -7
- package/packages/markdown/dist/types/marked/attributes.d.ts.map +1 -1
- package/packages/markdown/dist/types/marked/registry.d.ts.map +1 -1
- package/packages/markdown/dist/types/marked/renderer.d.ts +4 -6
- package/packages/markdown/dist/types/marked/renderer.d.ts.map +1 -1
- package/packages/markdown/dist/types/marked/tokenizer.d.ts.map +1 -1
- package/packages/markdown/package.json +1 -1
- package/packages/markdown/src/components/Markdown.tsx +18 -4
- package/packages/markdown/src/decorate.ts +3 -8
- package/packages/markdown/src/marked/attributes.ts +4 -7
- package/packages/markdown/src/marked/directives/card.ts +2 -2
- package/packages/markdown/src/marked/html.ts +3 -3
- package/packages/markdown/src/marked/registry.ts +2 -5
- package/packages/markdown/src/marked/renderer.ts +4 -6
- package/packages/markdown/src/marked/tokenizer.ts +5 -7
- package/packages/markdown/tests/__snapshots__/Markdown.test.tsx.snap +50 -55
- package/packages/tailwind-theme-plugin/.turbo/turbo-build.log +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sakura-ui/sakura-ui",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.4",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": "glassonion1",
|
|
6
6
|
"homepage": "https://github.com/glassonion1/sakura-ui",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@sakura-ui/core": "0.5.2",
|
|
23
|
-
"@sakura-ui/helper": "0.0.10",
|
|
24
23
|
"@sakura-ui/forms": "0.4.3",
|
|
24
|
+
"@sakura-ui/helper": "0.0.10",
|
|
25
25
|
"@sakura-ui/tailwind-theme-plugin": "0.4.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
$ rimraf dist
|
|
2
2
|
$ run-p build:*
|
|
3
|
-
$ vite build
|
|
4
3
|
$ tsc && tsc-alias
|
|
4
|
+
$ vite build
|
|
5
5
|
[36mvite v7.3.6 [32mbuilding client environment for production...[36m[39m
|
|
6
6
|
transforming...
|
|
7
7
|
[32m✓[39m 25 modules transformed.
|
|
@@ -9,4 +9,4 @@ rendering chunks...
|
|
|
9
9
|
computing gzip size...
|
|
10
10
|
[2mdist/[22m[36mindex.es.js [39m[1m[2m24.22 kB[22m[1m[22m[2m │ gzip: 6.09 kB[22m
|
|
11
11
|
[2mdist/[22m[36mindex.cjs.js [39m[1m[2m16.80 kB[22m[1m[22m[2m │ gzip: 5.23 kB[22m
|
|
12
|
-
[32m✓ built in
|
|
12
|
+
[32m✓ built in 474ms[39m
|
|
@@ -9,4 +9,4 @@ rendering chunks...
|
|
|
9
9
|
computing gzip size...
|
|
10
10
|
[2mdist/[22m[36mindex.es.js [39m[1m[2m2.76 kB[22m[1m[22m[2m │ gzip: 0.96 kB[22m
|
|
11
11
|
[2mdist/[22m[36mindex.cjs.js [39m[1m[2m2.58 kB[22m[1m[22m[2m │ gzip: 0.95 kB[22m
|
|
12
|
-
[32m✓ built in
|
|
12
|
+
[32m✓ built in 340ms[39m
|
|
@@ -7,6 +7,6 @@ transforming...
|
|
|
7
7
|
[32m✓[39m 31 modules transformed.
|
|
8
8
|
rendering chunks...
|
|
9
9
|
computing gzip size...
|
|
10
|
-
[2mdist/[22m[36mindex.es.js [39m[1m[2m129.
|
|
11
|
-
[2mdist/[22m[36mindex.cjs.js [39m[1m[2m98.
|
|
12
|
-
[32m✓ built in
|
|
10
|
+
[2mdist/[22m[36mindex.es.js [39m[1m[2m129.50 kB[22m[1m[22m[2m │ gzip: 39.49 kB[22m
|
|
11
|
+
[2mdist/[22m[36mindex.cjs.js [39m[1m[2m98.47 kB[22m[1m[22m[2m │ gzip: 34.86 kB[22m
|
|
12
|
+
[32m✓ built in 657ms[39m
|
|
@@ -72,4 +72,4 @@ Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error
|
|
|
72
72
|
`,o=g=>ci({...g,"data-sakura":n}),c={token:t,attrs:s,nl:l,own:o,root:g=>o({...g,id:s[Or]}),body:()=>r===J?this.parser.parse(u):this.parser.parseInline(u),parser:this.parser,options:e},h=$i(n);return h?h(c):c.body()+l}const Ni=/^(:{2,})([A-Za-z][A-Za-z0-9_-]*)/,Mi=/^:([A-Za-z][A-Za-z0-9_-]*)/,zi=(t,e)=>{const n=new RegExp(`^:{${e},}[ \\t]*$`);let r=0;for(const s of t.split(`
|
|
73
73
|
`)){if(n.test(s))return{contentEnd:r,rawEnd:Math.min(r+s.length+1,t.length)};r+=s.length+1}return null},Ui=t=>{const e=/\n:{2,}[A-Za-z]/.exec(t);return e?e.index:void 0},ji=t=>{const e=/:[A-Za-z][A-Za-z0-9_-]*\[/.exec(t);return e?e.index:void 0},Hi=t=>{if(!/^grid-cols-\d+$/.test(t.name))return;const e=t.tokens.filter(r=>r.type!=="space"),n=e.filter(r=>r.type==="directive"&&r.name==="card");if(!(n.length===0||n.length!==e.length)){t.listed=!0;for(const r of n)r.listed=!0}},qi=t=>{if(t.name!=="card"||!t.attrs.href)return;const e=t.tokens;if(e.some(r=>r.type==="directive"&&r.name==="card-title")){t.linked=!0;for(const r of e)r.type==="directive"&&(r.name==="card-title"||r.name==="card-footer")&&(r.inherited={behavior:"link",href:t.attrs.href??""})}};function Gi(t){const e=Ni.exec(t);if(!e)return;const[,n,r]=e,s=n.length>=3?J:pe;if(!Pr(r,s))return;const u=vr(t,e[0].length),l=/^[ \t]*(?:\n|$)/.exec(t.slice(u.end));if(!l)return;const o=u.end+l[0].length,c={type:"directive",kind:s,name:r,attrs:u.attrs,tokens:[],raw:t.slice(0,o)};if(s===pe)return u.label&&this.lexer.inline(u.label,c.tokens),c;const h=t.slice(o),g=zi(h,n.length);return c.raw=t.slice(0,o+(g?g.rawEnd:h.length)),c.tokens=this.lexer.blockTokens(g?h.slice(0,g.contentEnd):h),qi(c),Hi(c),c}function Wi(t){const e=Mi.exec(t);if(!e)return;const[,n]=e;if(!Pr(n,Lt))return;const r=vr(t,e[0].length);if(r.label!==null)return{type:"directive",kind:Lt,name:n,attrs:r.attrs,tokens:this.lexer.inlineTokens(r.label),raw:t.slice(0,r.end)}}const Yi=t=>({extensions:[{name:"directive",level:"inline",start:ji,tokenizer:Wi},{name:"directive",level:"block",start:Ui,tokenizer:Gi,renderer(e){return Ii.call(this,e,t)}}]});function ur(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Zi(t){if(Array.isArray(t))return t}function Xi(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,s,u,l,o=[],c=!0,h=!1;try{if(u=(n=n.call(t)).next,e!==0)for(;!(c=(r=u.call(n)).done)&&(o.push(r.value),o.length!==e);c=!0);}catch(g){h=!0,s=g}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(h)throw s}}return o}}function Vi(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
74
74
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qi(t,e){return Zi(t)||Xi(t,e)||Ki(t,e)||Vi()}function Ki(t,e){if(t){if(typeof t=="string")return ur(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ur(t,e):void 0}}const $r=Object.entries,or=Object.setPrototypeOf,Ji=Object.isFrozen,eu=Object.getPrototypeOf,tu=Object.getOwnPropertyDescriptor;let N=Object.freeze,z=Object.seal,He=Object.create,Ir=typeof Reflect<"u"&&Reflect,an=Ir.apply,cn=Ir.construct;N||(N=function(e){return e});z||(z=function(e){return e});an||(an=function(e,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),u=2;u<r;u++)s[u-2]=arguments[u];return e.apply(n,s)});cn||(cn=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new e(...r)});const Se=I(Array.prototype.forEach),nu=I(Array.prototype.lastIndexOf),lr=I(Array.prototype.pop),rt=I(Array.prototype.push),ru=I(Array.prototype.splice),qe=Array.isArray,lt=I(String.prototype.toLowerCase),Jt=I(String.prototype.toString),ar=I(String.prototype.match),st=I(String.prototype.replace),cr=I(String.prototype.indexOf),su=I(String.prototype.trim),iu=I(Number.prototype.toString),uu=I(Boolean.prototype.toString),pr=typeof BigInt>"u"?null:I(BigInt.prototype.toString),fr=typeof Symbol>"u"?null:I(Symbol.prototype.toString),Z=I(Object.prototype.hasOwnProperty),it=I(Object.prototype.toString),j=I(RegExp.prototype.test),we=ou(TypeError);function I(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return an(t,e,r)}}function ou(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return cn(t,n)}}function T(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:lt;if(or&&or(t,null),!qe(e))return t;let r=e.length;for(;r--;){let s=e[r];if(typeof s=="string"){const u=n(s);u!==s&&(Ji(e)||(e[r]=u),s=u)}t[s]=!0}return t}function lu(t){for(let e=0;e<t.length;e++)Z(t,e)||(t[e]=null);return t}function V(t){const e=He(null);for(const r of $r(t)){var n=Qi(r,2);const s=n[0],u=n[1];Z(t,s)&&(qe(u)?e[s]=lu(u):u&&typeof u=="object"&&u.constructor===Object?e[s]=V(u):e[s]=u)}return e}function au(t){switch(typeof t){case"string":return t;case"number":return iu(t);case"boolean":return uu(t);case"bigint":return pr?pr(t):"0";case"symbol":return fr?fr(t):"Symbol()";case"undefined":return it(t);case"function":case"object":{if(t===null)return it(t);const e=t,n=re(e,"toString");if(typeof n=="function"){const r=n(e);return typeof r=="string"?r:it(r)}return it(t)}default:return it(t)}}function re(t,e){for(;t!==null;){const r=tu(t,e);if(r){if(r.get)return I(r.get);if(typeof r.value=="function")return I(r.value)}t=eu(t)}function n(){return null}return n}function cu(t){try{return j(t,""),!0}catch{return!1}}const hr=N(["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"]),en=N(["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"]),tn=N(["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"]),pu=N(["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"]),nn=N(["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"]),fu=N(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),dr=N(["#text"]),Dr=N(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),rn=N(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),gr=N(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),wt=N(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hu=z(/{{[\w\W]*|^[\w\W]*}}/g),du=z(/<%[\w\W]*|^[\w\W]*%>/g),Du=z(/\${[\w\W]*/g),gu=z(/^data-[\-\w.\u00B7-\uFFFF]+$/),mu=z(/^aria-[\-\w]+$/),mr=z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Fu=z(/^(?:\w+script|data):/i),Au=z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Eu=z(/^html$/i),bu=z(/^[a-z][.\w]*(-[.\w]+)+$/i),Fr=z(/<[/\w!]/g),Ar=z(/<[/\w]/g),ku=z(/<\/no(script|embed|frames)/i),yu=z(/\/>/i),X={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Nr=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Cu=N(T({},Nr)),xu=(function(){const t={};return Se(Nr,e=>{t[e]=z(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),N(t)})(),Tu=function(){return typeof window>"u"?null:window},_u=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const u="dompurify"+(r?"#"+r:"");try{return e.createPolicy(u,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+u+" could not be created."),null}},Er=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ee=function(e,n,r,s){return Z(e,n)&&qe(e[n])?T(s.base?V(s.base):{},e[n],s.transform):r},sn=function(e,n,r){const s=Z(e,n)?e[n]:void 0;return s&&typeof s=="object"?V(s):r()};function Mr(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tu();const e=d=>Mr(d);if(e.version="3.4.14",e.removed=[],!t||!t.document||t.document.nodeType!==X.document||!t.Element)return e.isSupported=!1,e;let n=t.document;const r=n,s=r.currentScript;t.DocumentFragment;const u=t.HTMLTemplateElement,l=t.Node,o=t.Element,c=t.NodeFilter,h=t.NamedNodeMap;h===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;const g=t.DOMParser,m=t.trustedTypes,k=o.prototype,v=re(k,"cloneNode"),x=re(k,"remove"),G=re(k,"nextSibling"),U=re(k,"childNodes"),te=re(k,"parentNode"),be=re(k,"shadowRoot"),ke=re(k,"attributes"),ne=l&&l.prototype?re(l.prototype,"nodeType"):null,Q=l&&l.prototype?re(l.prototype,"nodeName"):null,K=l&&l.prototype?re(l.prototype,"ownerDocument"):null,ye=function(i){return ne?ne(i):i.nodeType},We=function(i){return Q?Q(i):i.nodeName};if(typeof u=="function"){const d=n.createElement("template");d.content&&d.content.ownerDocument&&(n=d.content.ownerDocument)}let M,fe="",Ye,ve=!1,de=0;const pt=function(){if(de>0)throw we('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ue=function(i){pt(),de++;try{return M.createHTML(i)}finally{de--}},ft=function(i){pt(),de++;try{return M.createScriptURL(i)}finally{de--}},ht=function(){return ve||(Ye=_u(m,s),ve=!0),Ye},Ce=n,Le=Ce.implementation,Ze=Ce.createNodeIterator,f=Ce.createDocumentFragment,y=Ce.getElementsByTagName,S=r.importNode;let b=Er();e.isSupported=typeof $r=="function"&&typeof te=="function"&&Le&&Le.createHTMLDocument!==void 0;const Pe=hu,Xe=du,P=Du,De=gu,Ve=mu,$t=Fu,En=Au,Ur=bu;let bn=mr,R=null;const It=T({},[...hr,...en,...tn,...nn,...dr]);let B=null;const Nt=T({},[...Dr,...rn,...gr,...wt]);let oe=Object.seal(He(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}})),Qe=null,kn=null;const ge=Object.seal(He(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let yn=!0,Mt=!0,Cn=!1,xn=!0,me=!1,xe=!0,Te=!1,zt=!1,dt=null,Dt=null,Ut=!1,$e=!1,gt=!1,mt=!1,Tn=!0,_n=!1;const wn="user-content-";let jt=!0,Ht=!1,Ie={},Ne=null;const Sn=T({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Rn=null;const Bn=T({},["audio","video","img","source","image","track"]);let On=null;const vn=T({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ft="http://www.w3.org/1998/Math/MathML",At="http://www.w3.org/2000/svg",le="http://www.w3.org/1999/xhtml";let Me=le,qt=!1,Gt=null;const jr=T({},[Ft,At,le],Jt),Ln=N(["mi","mo","mn","ms","mtext"]);let Wt=T({},Ln);const Pn=N(["annotation-xml"]);let Yt=T({},Pn);const Hr=T({},["title","style","font","a","script"]);let Ke=null;const qr=["application/xhtml+xml","text/html"],Gr="text/html";let $=null,ze=null;const Wr=n.createElement("form"),$n=function(i){return i instanceof RegExp||i instanceof Function},Zt=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ze&&ze===i)return;(!i||typeof i!="object")&&(i={}),i=V(i),Ke=qr.indexOf(i.PARSER_MEDIA_TYPE)===-1?Gr:i.PARSER_MEDIA_TYPE,$=Ke==="application/xhtml+xml"?Jt:lt,R=Ee(i,"ALLOWED_TAGS",It,{transform:$}),B=Ee(i,"ALLOWED_ATTR",Nt,{transform:$}),Gt=Ee(i,"ALLOWED_NAMESPACES",jr,{transform:Jt}),On=Ee(i,"ADD_URI_SAFE_ATTR",vn,{transform:$,base:vn}),Rn=Ee(i,"ADD_DATA_URI_TAGS",Bn,{transform:$,base:Bn}),Ne=Ee(i,"FORBID_CONTENTS",Sn,{transform:$}),Qe=Ee(i,"FORBID_TAGS",V({}),{transform:$}),kn=Ee(i,"FORBID_ATTR",V({}),{transform:$}),Ie=Z(i,"USE_PROFILES")?i.USE_PROFILES&&typeof i.USE_PROFILES=="object"?V(i.USE_PROFILES):i.USE_PROFILES:!1,yn=i.ALLOW_ARIA_ATTR!==!1,Mt=i.ALLOW_DATA_ATTR!==!1,Cn=i.ALLOW_UNKNOWN_PROTOCOLS||!1,xn=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,me=i.SAFE_FOR_TEMPLATES||!1,xe=i.SAFE_FOR_XML!==!1,Te=i.WHOLE_DOCUMENT||!1,$e=i.RETURN_DOM||!1,gt=i.RETURN_DOM_FRAGMENT||!1,mt=i.RETURN_TRUSTED_TYPE||!1,Ut=i.FORCE_BODY||!1,Tn=i.SANITIZE_DOM!==!1,_n=i.SANITIZE_NAMED_PROPS||!1,jt=i.KEEP_CONTENT!==!1,Ht=i.IN_PLACE||!1,bn=cu(i.ALLOWED_URI_REGEXP)?i.ALLOWED_URI_REGEXP:mr,Me=typeof i.NAMESPACE=="string"?i.NAMESPACE:le,Wt=sn(i,"MATHML_TEXT_INTEGRATION_POINTS",()=>T({},Ln)),Yt=sn(i,"HTML_INTEGRATION_POINTS",()=>T({},Pn));const a=sn(i,"CUSTOM_ELEMENT_HANDLING",()=>He(null));if(oe=He(null),Z(a,"tagNameCheck")&&$n(a.tagNameCheck)&&(oe.tagNameCheck=a.tagNameCheck),Z(a,"attributeNameCheck")&&$n(a.attributeNameCheck)&&(oe.attributeNameCheck=a.attributeNameCheck),Z(a,"allowCustomizedBuiltInElements")&&typeof a.allowCustomizedBuiltInElements=="boolean"&&(oe.allowCustomizedBuiltInElements=a.allowCustomizedBuiltInElements),z(oe),me&&(Mt=!1),gt&&($e=!0),Ie&&(R=T({},dr),B=He(null),Ie.html===!0&&(T(R,hr),T(B,Dr)),Ie.svg===!0&&(T(R,en),T(B,rn),T(B,wt)),Ie.svgFilters===!0&&(T(R,tn),T(B,rn),T(B,wt)),Ie.mathMl===!0&&(T(R,nn),T(B,gr),T(B,wt))),ge.tagCheck=null,ge.attributeCheck=null,Z(i,"ADD_TAGS")&&(typeof i.ADD_TAGS=="function"?ge.tagCheck=i.ADD_TAGS:qe(i.ADD_TAGS)&&(R===It&&(R=V(R)),T(R,i.ADD_TAGS,$))),Z(i,"ADD_ATTR")&&(typeof i.ADD_ATTR=="function"?ge.attributeCheck=i.ADD_ATTR:qe(i.ADD_ATTR)&&(B===Nt&&(B=V(B)),T(B,i.ADD_ATTR,$))),Z(i,"ADD_FORBID_CONTENTS")&&qe(i.ADD_FORBID_CONTENTS)&&(Ne===Sn&&(Ne=V(Ne)),T(Ne,i.ADD_FORBID_CONTENTS,$)),jt&&(R["#text"]=!0),Te&&T(R,["html","head","body"]),R.table&&(T(R,["tbody"]),delete Qe.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw we('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw we('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const p=M;M=i.TRUSTED_TYPES_POLICY;try{fe=ue("")}catch(D){throw M=p,D}}else i.TRUSTED_TYPES_POLICY===null?(M=void 0,fe=""):(M===void 0&&(M=ht()),M&&typeof fe=="string"&&(fe=ue("")));N&&N(i),ze=i},In=T({},[...en,...tn,...pu]),Nn=T({},[...nn,...fu]),Yr=function(i,a,p){return a.namespaceURI===le?i==="svg":a.namespaceURI===Ft?i==="svg"&&(p==="annotation-xml"||Wt[p]):!!In[i]},Zr=function(i,a,p){return a.namespaceURI===le?i==="math":a.namespaceURI===At?i==="math"&&Yt[p]:!!Nn[i]},Xr=function(i,a,p){return a.namespaceURI===At&&!Yt[p]||a.namespaceURI===Ft&&!Wt[p]?!1:!Nn[i]&&(Hr[i]||!In[i])},Vr=function(i){let a=te(i);(!a||!a.tagName)&&(a={namespaceURI:Me,tagName:"template"});const p=lt(i.tagName),D=lt(a.tagName);return Gt[i.namespaceURI]?i.namespaceURI===At?Yr(p,a,D):i.namespaceURI===Ft?Zr(p,a,D):i.namespaceURI===le?Xr(p,a,D):!!(Ke==="application/xhtml+xml"&&Gt[i.namespaceURI]):!1},Fe=function(i){rt(e.removed,{element:i});try{te(i).removeChild(i)}catch{if(x(i),!te(i))throw we("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Mn=function(i,a,p){try{i.removeAttributeNode(a)}catch{try{i.removeAttribute(p)}catch{}}},Et=function(i){bt(i);const a=U(i);if(a){const D=[];Se(a,F=>{rt(D,F)}),Se(D,F=>{try{x(F)}catch{}})}const p=ke(i);if(p)for(let D=p.length-1;D>=0;--D){const F=p[D],E=F&&F.name;typeof E=="string"&&Mn(i,F,E)}},_e=function(i,a,p){if(!p)try{p=a.getAttributeNode(i)}catch{p=null}rt(e.removed,{attribute:p||null,from:a});try{p?a.removeAttributeNode(p):a.removeAttribute(i)}catch{try{a.removeAttribute(i)}catch{}}if(i==="is")if($e||gt)try{Fe(a)}catch{}else try{a.setAttribute(i,"")}catch{}},Qr=function(i){const a=ke(i);if(a)for(let p=a.length-1;p>=0;--p){const D=a[p],F=D&&D.name;typeof F!="string"||B[$(F)]||Mn(i,D,F)}},bt=function(i){const a=[i];for(;a.length>0;){const p=a.pop();ye(p)===X.element&&Qr(p);const F=U(p);if(F)for(let E=F.length-1;E>=0;--E)a.push(F[E])}},zn=function(i,a){return xe?i==="patchsrc"?!0:i==="for"&&a!=="label"&&a!=="output":!1},Kr=function(i){if(!xe)return;const a=[i];for(;a.length>0;){const p=a.pop(),D=ye(p);if(D===X.processingInstruction||D===X.comment&&j(Ar,p.data)){try{x(p)}catch{}continue}if(D===X.element){const E=p,w=$(We(p));try{E.hasAttribute&&E.hasAttribute("patchsrc")&&E.removeAttribute("patchsrc"),E.hasAttribute&&E.hasAttribute("for")&&zn("for",w)&&E.removeAttribute("for")}catch{}}const F=U(p);if(F)for(let E=F.length-1;E>=0;--E)a.push(F[E])}},Un=function(i){let a=null,p=null;if(Ut)i="<remove></remove>"+i;else{const E=ar(i,/^[\r\n\t ]+/);p=E&&E[0]}Ke==="application/xhtml+xml"&&Me===le&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const D=M?ue(i):i;if(Me===le)try{a=new g().parseFromString(D,Ke)}catch{}if(!a||!a.documentElement){a=Le.createDocument(Me,"template",null);try{a.documentElement.innerHTML=qt?fe:D}catch{}}const F=a.body||a.documentElement;return i&&p&&F.insertBefore(n.createTextNode(p),F.childNodes[0]||null),Me===le?y.call(a,Te?"html":"body")[0]:Te?a.documentElement:F},jn=function(i){const a=K?K(i):i.ownerDocument;return Ze.call(a||i,i,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},kt=function(i){return i=st(i,Pe," "),i=st(i,Xe," "),i=st(i,P," "),i},Xt=function(i){var a;i.normalize();const p=K?K(i):i.ownerDocument,D=Ze.call(p||i,i,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let F=D.nextNode();for(;F;)F.data=kt(F.data),F=D.nextNode();const E=(a=i.querySelectorAll)===null||a===void 0?void 0:a.call(i,"template");E&&Se(E,w=>{Ue(w.content)&&Xt(w.content)})},yt=function(i){const a=Q?Q(i):null;return typeof a!="string"||$(a)!=="form"?!1:typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||i.attributes!==ke(i)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function"||i.nodeType!==ne(i)||i.childNodes!==U(i)},Ue=function(i){if(!ne||typeof i!="object"||i===null)return!1;try{return ne(i)===X.documentFragment}catch{return!1}},Je=function(i){if(!ne||typeof i!="object"||i===null)return!1;try{return typeof ne(i)=="number"}catch{return!1}};function ae(d,i,a){d.length!==0&&Se(d,p=>{p.call(e,i,a,ze)})}const Jr=function(i,a){return!!(xe&&i.hasChildNodes()&&!Je(i.firstElementChild)&&j(Fr,i.textContent)&&j(Fr,i.innerHTML)||xe&&i.namespaceURI===le&&Cu[a]&&(Je(i.firstElementChild)||typeof i.textContent=="string"&&j(xu[a],i.textContent))||i.nodeType===X.processingInstruction||xe&&i.nodeType===X.comment&&j(Ar,i.data))},Ct=function(i,a){if(i instanceof RegExp)return j(i,a);if(i instanceof Function){for(var p=arguments.length,D=new Array(p>2?p-2:0),F=2;F<p;F++)D[F-2]=arguments[F];return!!i(a,...D)}return!1},es=function(i,a,p){if(!Qe[a]&&Yn(a)&&Ct(oe.tagNameCheck,a))return!1;if(jt&&!Ne[a]){const D=te(i),F=U(i);if(F&&D){const E=F.length;for(let w=E-1;w>=0;--w){const O=i===p?v(F[w],!0):F[w];D.insertBefore(O,G(i))}}}return Fe(i),!0},Hn=function(i,a,p,D){return i.length===0?a:a===p||a===D?V(a):a},qn=function(i,a){return i===a||te(i)!==null?!1:(Ht&&bt(i),!0)},Gn=function(i,a){if(ae(b.beforeSanitizeElements,i,null),qn(i,a))return!0;if(yt(i))return Fe(i),!0;const p=$(We(i));if(R=Hn(b.uponSanitizeElement,R,It,dt),ae(b.uponSanitizeElement,i,{tagName:p,allowedTags:R}),qn(i,a))return!0;if(Jr(i,p))return Fe(i),!0;if(Qe[p]||!(ge.tagCheck instanceof Function&&ge.tagCheck(p))&&!R[p]){const F=es(i,p,a);return F===!1&&ae(b.afterSanitizeElements,i,null),F}if(ye(i)===X.element&&!Vr(i)||(p==="noscript"||p==="noembed"||p==="noframes")&&j(ku,i.innerHTML))return Fe(i),!0;if(me&&i.nodeType===X.text){const F=kt(i.textContent);i.textContent!==F&&(rt(e.removed,{element:i.cloneNode()}),i.textContent=F)}return ae(b.afterSanitizeElements,i,null),!1},Wn=function(i,a,p){if(kn[a]||zn(a,i)||Tn&&(a==="id"||a==="name")&&(p in n||p in Wr))return!1;const D=B[a]||ge.attributeCheck instanceof Function&&ge.attributeCheck(a,i);return Mt&&j(De,a)||yn&&j(Ve,a)?!0:D?On[a]||j(bn,st(p,En,""))||(a==="src"||a==="xlink:href"||a==="href")&&i!=="script"&&cr(p,"data:")===0&&Rn[i]||Cn&&!j($t,st(p,En,""))?!0:!p:Yn(i)&&Ct(oe.tagNameCheck,i)&&Ct(oe.attributeNameCheck,a,i)||a==="is"&&oe.allowCustomizedBuiltInElements&&Ct(oe.tagNameCheck,p)},ts=T({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Yn=function(i){return!ts[lt(i)]&&j(Ur,i)},ns=function(i,a,p,D){if(M&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!p)switch(m.getAttributeType(i,a)){case"TrustedHTML":return ue(D);case"TrustedScriptURL":return ft(D)}return D},rs=function(i,a,p,D){try{p?i.setAttributeNS(p,a,D):i.setAttribute(a,D),yt(i)?Fe(i):lr(e.removed)}catch{_e(a,i)}},Zn=function(i){ae(b.beforeSanitizeAttributes,i,null);const a=i.attributes;if(!a||yt(i))return;B=Hn(b.uponSanitizeAttribute,B,Nt,Dt);const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B,forceKeepAttr:void 0};let D=a.length;const F=$(i.nodeName);for(;D--;){const E=a[D],w=E.name,O=E.namespaceURI,W=E.value,Y=$(w),Qt=W;let q=w==="value"?Qt:su(Qt);if(p.attrName=Y,p.attrValue=q,p.keepAttr=!0,p.forceKeepAttr=void 0,ae(b.uponSanitizeAttribute,i,p),q=p.attrValue,_n&&(Y==="id"||Y==="name")&&cr(q,wn)!==0&&(_e(w,i,E),q=wn+q),xe&&j(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,q)){_e(w,i,E);continue}if(Y==="attributename"&&ar(q,"href")){_e(w,i,E);continue}if(!p.forceKeepAttr){if(!p.keepAttr){_e(w,i,E);continue}if(!xn&&j(yu,q)){_e(w,i,E);continue}if(me&&(q=kt(q)),!Wn(F,Y,q)){_e(w,i,E);continue}q=ns(F,Y,O,q),q!==Qt&&rs(i,w,O,q)}}ae(b.afterSanitizeAttributes,i,null)},xt=function(i){let a=null;const p=jn(i);for(ae(b.beforeSanitizeShadowDOM,i,null);a=p.nextNode();)if(ae(b.uponSanitizeShadowNode,a,null),Gn(a,i),Zn(a),Ue(a.content)&&xt(a.content),ye(a)===X.element){const D=be(a);Ue(D)&&(Vt(D),xt(D))}ae(b.afterSanitizeShadowDOM,i,null)},Vt=function(i){const a=[{node:i,shadow:null}];for(;a.length>0;){const p=a.pop();if(p.shadow){xt(p.shadow);continue}const D=p.node,E=ye(D)===X.element,w=U(D);if(w)for(let O=w.length-1;O>=0;--O)a.push({node:w[O],shadow:null});if(E){const O=Q?Q(D):null;if(typeof O=="string"&&$(O)==="template"){const W=D.content;Ue(W)&&a.push({node:W,shadow:null})}}if(E){const O=be(D);Ue(O)&&a.push({node:null,shadow:O},{node:O,shadow:null})}}};return e.sanitize=function(d){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=null,p=null,D=null,F=null;if(qt=!d,qt&&(d="<!-->"),typeof d!="string"&&!Je(d)&&(d=au(d),typeof d!="string"))throw we("dirty is not a string, aborting");if(!e.isSupported)return d;zt?(R=dt,B=Dt):Zt(i),(b.uponSanitizeElement.length>0||b.uponSanitizeAttribute.length>0)&&(R=V(R)),b.uponSanitizeAttribute.length>0&&(B=V(B)),e.removed=[];const E=Ht&&typeof d!="string"&&Je(d);if(E){Kr(d);const W=We(d);if(typeof W=="string"){const Y=$(W);if(!R[Y]||Qe[Y])throw Et(d),we("root node is forbidden and cannot be sanitized in-place")}if(yt(d))throw Et(d),we("root node is clobbered and cannot be sanitized in-place");try{Vt(d)}catch(Y){throw Et(d),Y}}else if(Je(d))a=Un("<!---->"),p=a.ownerDocument.importNode(d,!0),p.nodeType===X.element&&p.nodeName==="BODY"||p.nodeName==="HTML"?a=p:a.appendChild(p),Vt(p);else{if(!$e&&!me&&!Te&&d.indexOf("<")===-1)return M&&mt?ue(d):d;if(a=Un(d),!a)return $e?null:mt?fe:""}a&&Ut&&Fe(a.firstChild);const w=E?d:a;try{const W=jn(w);for(;D=W.nextNode();)Gn(D,w),Zn(D),Ue(D.content)&&xt(D.content)}catch(W){throw E&&(Et(d),Se(e.removed,Y=>{Y.element&&bt(Y.element)})),W}if(E)return Se(e.removed,W=>{W.element&&bt(W.element)}),me&&Xt(d),d;if($e){if(me&&Xt(a),gt)for(F=f.call(a.ownerDocument);a.firstChild;)F.appendChild(a.firstChild);else F=a;return(B.shadowroot||B.shadowrootmode)&&(F=S.call(r,F,!0)),F}let O=Te?a.outerHTML:a.innerHTML;return Te&&R["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&j(Eu,a.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+a.ownerDocument.doctype.name+`>
|
|
75
|
-
`+O),me&&(O=kt(O)),M&&mt?ue(O):O},e.setConfig=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zt(d),zt=!0,dt=R,Dt=B},e.clearConfig=function(){ze=null,zt=!1,dt=null,Dt=null,M=Ye,fe=""},e.isValidAttribute=function(d,i,a){ze||Zt({});const p=$(d),D=$(i);return Wn(p,D,a)},e.addHook=function(d,i){typeof i=="function"&&Z(b,d)&&rt(b[d],i)},e.removeHook=function(d,i){if(Z(b,d)){if(i!==void 0){const a=nu(b[d],i);return a===-1?void 0:ru(b[d],a,1)[0]}return lr(b[d])}},e.removeHooks=function(d){Z(b,d)&&(b[d]=[])},e.removeAllHooks=function(){b=Er()},e}var wu=Mr();const Su=["caption","col","colgroup","small","u","iframe"],Ru=["target","role","colspan","rowspan","open","allow","allowfullscreen","frameborder","referrerpolicy","loading"],Bu=new Set(["www.youtube-nocookie.com"]),Ou=t=>{if(!t)return!1;try{return Bu.has(new URL(t).host)}catch{return!1}},vu=new Set(["background-color","border","border-bottom","border-collapse","border-left","border-radius","border-right","border-top","color","color-scheme","font-size","font-weight","height","line-height","list-style","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","max-width","min-width","padding","padding-bottom","padding-left","padding-right","padding-top","text-align","text-indent","text-orientation","vertical-align","white-space","width","writing-mode"]),Lu={position:new Set(["relative","static"])},Pu=t=>t.split(";").map(e=>e.trim()).filter(Boolean).filter(e=>{const[n,...r]=e.split(":"),s=n.trim().toLowerCase(),u=r.join(":").trim().toLowerCase();return/url\(|expression\(|@import|behavior:/i.test(u)?!1:vu.has(s)?!0:!!Lu[s]?.has(u)}).map(e=>`${e};`).join(" "),$u=t=>Array.from(t).filter(e=>(e.codePointAt(0)??0)>32).join("").toLowerCase();let ut=null;const Iu=()=>ut||(ut=wu(window),ut.addHook("afterSanitizeAttributes",t=>{const e=t;if(!e.getAttribute)return;if(e.tagName==="IFRAME"&&!Ou(e.getAttribute("src"))){e.remove();return}for(const r of["src","href"]){const s=e.getAttribute(r);s&&$u(s).startsWith("data:")&&e.removeAttribute(r)}const n=e.getAttribute("style");if(n){const r=Pu(n);r?e.setAttribute("style",r):e.removeAttribute("style")}e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer")}),ut),Nu=t=>Iu().sanitize(t,{ADD_TAGS:Su,ADD_ATTR:Ru,RETURN_DOM_FRAGMENT:!0,ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i}),Mu=t=>Math.min(6,Math.max(1,t)),zr=(t,e={})=>{const{shiftHeading:n=0,tocMaxDepth:r=2}=e,s=new Br({gfm:!0,breaks:!0},Yi({cardHeadingLevel:`h${Mu(3+n)}`})),u=Nu(s.parse(t,{async:!1})),{headings:l}=mi(u,document,{shiftHeading:n,tocMaxDepth:r}),o=document.createElement("div");return o.appendChild(u),{html:o.innerHTML,headings:l}},zu={html:"",headings:[]},An=({items:t})=>ee.jsx(ee.Fragment,{children:t.map(e=>ee.jsxs("li",{children:[ee.jsx(A.Link,{href:`#${e.id}`,children:e.value}),e.children?ee.jsx(A.Ul,{children:ee.jsx(An,{items:e.children})}):null]},e.id))}),Uu=({children:t,showToc:e,tocTitle:n="目次",shiftHeading:r=0,tocMaxDepth:s=2})=>{const[{html:u,headings:l},o]=St.useState(zu);return St.useEffect(()=>{o(zr(t,{shiftHeading:r,tocMaxDepth:s}))},[t,r,s]),St.useEffect(()=>{if(!u)return;const c=decodeURI(window.location.hash.slice(1));c&&document.getElementById(c)?.scrollIntoView()},[u]),ee.jsxs("div",{className:"py-8 flex flex-col gap-8",children:[e&&l.length>0&&ee.jsxs("nav",{className:"rounded-3xl p-10 bg-yellow-50",children:[ee.jsx(
|
|
75
|
+
`+O),me&&(O=kt(O)),M&&mt?ue(O):O},e.setConfig=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zt(d),zt=!0,dt=R,Dt=B},e.clearConfig=function(){ze=null,zt=!1,dt=null,Dt=null,M=Ye,fe=""},e.isValidAttribute=function(d,i,a){ze||Zt({});const p=$(d),D=$(i);return Wn(p,D,a)},e.addHook=function(d,i){typeof i=="function"&&Z(b,d)&&rt(b[d],i)},e.removeHook=function(d,i){if(Z(b,d)){if(i!==void 0){const a=nu(b[d],i);return a===-1?void 0:ru(b[d],a,1)[0]}return lr(b[d])}},e.removeHooks=function(d){Z(b,d)&&(b[d]=[])},e.removeAllHooks=function(){b=Er()},e}var wu=Mr();const Su=["caption","col","colgroup","small","u","iframe"],Ru=["target","role","colspan","rowspan","open","allow","allowfullscreen","frameborder","referrerpolicy","loading"],Bu=new Set(["www.youtube-nocookie.com"]),Ou=t=>{if(!t)return!1;try{return Bu.has(new URL(t).host)}catch{return!1}},vu=new Set(["background-color","border","border-bottom","border-collapse","border-left","border-radius","border-right","border-top","color","color-scheme","font-size","font-weight","height","line-height","list-style","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","max-width","min-width","padding","padding-bottom","padding-left","padding-right","padding-top","text-align","text-indent","text-orientation","vertical-align","white-space","width","writing-mode"]),Lu={position:new Set(["relative","static"])},Pu=t=>t.split(";").map(e=>e.trim()).filter(Boolean).filter(e=>{const[n,...r]=e.split(":"),s=n.trim().toLowerCase(),u=r.join(":").trim().toLowerCase();return/url\(|expression\(|@import|behavior:/i.test(u)?!1:vu.has(s)?!0:!!Lu[s]?.has(u)}).map(e=>`${e};`).join(" "),$u=t=>Array.from(t).filter(e=>(e.codePointAt(0)??0)>32).join("").toLowerCase();let ut=null;const Iu=()=>ut||(ut=wu(window),ut.addHook("afterSanitizeAttributes",t=>{const e=t;if(!e.getAttribute)return;if(e.tagName==="IFRAME"&&!Ou(e.getAttribute("src"))){e.remove();return}for(const r of["src","href"]){const s=e.getAttribute(r);s&&$u(s).startsWith("data:")&&e.removeAttribute(r)}const n=e.getAttribute("style");if(n){const r=Pu(n);r?e.setAttribute("style",r):e.removeAttribute("style")}e.getAttribute("target")==="_blank"&&e.setAttribute("rel","noopener noreferrer")}),ut),Nu=t=>Iu().sanitize(t,{ADD_TAGS:Su,ADD_ATTR:Ru,RETURN_DOM_FRAGMENT:!0,ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.\-:]|$))/i}),Mu=t=>Math.min(6,Math.max(1,t)),zr=(t,e={})=>{const{shiftHeading:n=0,tocMaxDepth:r=2}=e,s=new Br({gfm:!0,breaks:!0},Yi({cardHeadingLevel:`h${Mu(3+n)}`})),u=Nu(s.parse(t,{async:!1})),{headings:l}=mi(u,document,{shiftHeading:n,tocMaxDepth:r}),o=document.createElement("div");return o.appendChild(u),{html:o.innerHTML,headings:l}},zu={html:"",headings:[]},An=({items:t})=>ee.jsx(ee.Fragment,{children:t.map(e=>ee.jsxs("li",{children:[ee.jsx(A.Link,{href:`#${e.id}`,children:e.value}),e.children?ee.jsx(A.Ul,{children:ee.jsx(An,{items:e.children})}):null]},e.id))}),Uu=({children:t,showToc:e,tocTitle:n="目次",shiftHeading:r=0,tocMaxDepth:s=2})=>{const[{html:u,headings:l},o]=St.useState(zu);return St.useEffect(()=>{o(zr(t,{shiftHeading:r,tocMaxDepth:s}))},[t,r,s]),St.useEffect(()=>{if(!u)return;const c=decodeURI(window.location.hash.slice(1));c&&document.getElementById(c)?.scrollIntoView()},[u]),ee.jsxs("div",{className:"py-8 flex flex-col gap-8",children:[e&&l.length>0&&ee.jsxs("nav",{className:"rounded-3xl p-10 bg-yellow-50",children:[ee.jsx("h2",{className:"mb-4 font-bold text-h-xs-m sm:text-h-xs",children:n}),ee.jsx(A.Ul,{children:ee.jsx(An,{items:l})})]}),ee.jsx("div",{className:"flex flex-col gap-8",dangerouslySetInnerHTML:{__html:u}})]})};exports.Markdown=Uu;exports.TableOfContents=An;exports.render=zr;
|