mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
8.3 KiB
2 lines
8.3 KiB
import{l as G}from"./cssfilter-af71ba68.js";var X={exports:{}},o={},x={indexOf:function(r,t){var e,n;if(Array.prototype.indexOf)return r.indexOf(t);for(e=0,n=r.length;e<n;e++)if(r[e]===t)return e;return-1},forEach:function(r,t,e){var n,a;if(Array.prototype.forEach)return r.forEach(t,e);for(n=0,a=r.length;n<a;n++)t.call(e,r[n],n,r)},trim:function(r){return String.prototype.trim?r.trim():r.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(r){var t=/\s|\n|\t/,e=t.exec(r);return e?e.index:-1}},j=G.FilterCSS,rr=G.getDefaultWhiteList,L=x;function W(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var B=new j;function er(r,t,e){}function tr(r,t,e){}function nr(r,t,e){}function ir(r,t,e){}function H(r){return r.replace(sr,"<").replace(or,">")}function ar(r,t,e,n){if(e=q(e),t==="href"||t==="src"){if(e=L.trim(e),e==="#")return"#";if(!(e.substr(0,7)==="http://"||e.substr(0,8)==="https://"||e.substr(0,7)==="mailto:"||e.substr(0,4)==="tel:"||e.substr(0,11)==="data:image/"||e.substr(0,6)==="ftp://"||e.substr(0,2)==="./"||e.substr(0,3)==="../"||e[0]==="#"||e[0]==="/"))return""}else if(t==="background"){if(w.lastIndex=0,w.test(e))return""}else if(t==="style"){if(k.lastIndex=0,k.test(e)||(D.lastIndex=0,D.test(e)&&(w.lastIndex=0,w.test(e))))return"";n!==!1&&(n=n||B,e=n.process(e))}return e=z(e),e}var sr=/</g,or=/>/g,fr=/"/g,lr=/"/g,ur=/&#([a-zA-Z0-9]*);?/gim,cr=/:?/gim,gr=/&newline;?/gim,w=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a)\:/gi,k=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,D=/u\s*r\s*l\s*\(.*/gi;function U(r){return r.replace(fr,""")}function m(r){return r.replace(lr,'"')}function N(r){return r.replace(ur,function(e,n){return n[0]==="x"||n[0]==="X"?String.fromCharCode(parseInt(n.substr(1),16)):String.fromCharCode(parseInt(n,10))})}function Q(r){return r.replace(cr,":").replace(gr," ")}function $(r){for(var t="",e=0,n=r.length;e<n;e++)t+=r.charCodeAt(e)<32?" ":r.charAt(e);return L.trim(t)}function q(r){return r=m(r),r=N(r),r=Q(r),r=$(r),r}function z(r){return r=U(r),r=H(r),r}function pr(){return""}function vr(r,t){typeof t!="function"&&(t=function(){});var e=!Array.isArray(r);function n(s){return e?!0:L.indexOf(r,s)!==-1}var a=[],f=!1;return{onIgnoreTag:function(s,i,u){if(n(s))if(u.isClosing){var l="[/removed]",c=u.position+l.length;return a.push([f!==!1?f:u.position,c]),f=!1,l}else return f||(f=u.position),"[removed]";else return t(s,i,u)},remove:function(s){var i="",u=0;return L.forEach(a,function(l){i+=s.slice(u,l[0]),u=l[1]}),i+=s.slice(u),i}}}function dr(r){for(var t="",e=0;e<r.length;){var n=r.indexOf("<!--",e);if(n===-1){t+=r.slice(e);break}t+=r.slice(e,n);var a=r.indexOf("-->",n);if(a===-1)break;e=a+3}return t}function Tr(r){var t=r.split("");return t=t.filter(function(e){var n=e.charCodeAt(0);return n===127?!1:n<=31?n===10||n===13:!0}),t.join("")}o.whiteList=W();o.getDefaultWhiteList=W;o.onTag=er;o.onIgnoreTag=tr;o.onTagAttr=nr;o.onIgnoreTagAttr=ir;o.safeAttrValue=ar;o.escapeHtml=H;o.escapeQuote=U;o.unescapeQuote=m;o.escapeHtmlEntities=N;o.escapeDangerHtml5Entities=Q;o.clearNonPrintableCharacter=$;o.friendlyAttrValue=q;o.escapeAttrValue=z;o.onIgnoreTagStripAll=pr;o.StripTagBody=vr;o.stripCommentTag=dr;o.stripBlankChar=Tr;o.cssFilter=B;o.getDefaultCSSWhiteList=rr;var P={},h=x;function Ar(r){var t=h.spaceIndex(r);if(t===-1)var e=r.slice(1,-1);else var e=r.slice(1,t+1);return e=h.trim(e).toLowerCase(),e.slice(0,1)==="/"&&(e=e.slice(1)),e.slice(-1)==="/"&&(e=e.slice(0,-1)),e}function hr(r){return r.slice(0,2)==="</"}function Er(r,t,e){var n="",a=0,f=!1,s=!1,i=0,u=r.length,l="",c="";r:for(i=0;i<u;i++){var g=r.charAt(i);if(f===!1){if(g==="<"){f=i;continue}}else if(s===!1){if(g==="<"){n+=e(r.slice(a,i)),f=i,a=i;continue}if(g===">"){n+=e(r.slice(a,f)),c=r.slice(f,i+1),l=Ar(c),n+=t(f,n.length,l,c,hr(c)),a=i+1,f=!1;continue}if(g==='"'||g==="'")for(var A=1,v=r.charAt(i-A);v.trim()===""||v==="=";){if(v==="="){s=g;continue r}v=r.charAt(i-++A)}}else if(g===s){s=!1;continue}}return a<r.length&&(n+=e(r.substr(a))),n}var Sr=/[^a-zA-Z0-9_:\.\-]/gim;function Ir(r,t){var e=0,n=[],a=!1,f=r.length;function s(g,A){if(g=h.trim(g),g=g.replace(Sr,"").toLowerCase(),!(g.length<1)){var v=t(g,A||"");v&&n.push(v)}}for(var i=0;i<f;i++){var u=r.charAt(i),l,c;if(a===!1&&u==="="){a=r.slice(e,i),e=i+1;continue}if(a!==!1&&i===e&&(u==='"'||u==="'")&&r.charAt(i-1)==="="){if(c=r.indexOf(u,i+1),c===-1)break;l=h.trim(r.slice(e+1,c)),s(a,l),a=!1,i=c,e=i+1;continue}if(/\s|\n|\t/.test(u))if(r=r.replace(/\s|\n|\t/g," "),a===!1)if(c=_r(r,i),c===-1){l=h.trim(r.slice(e,i)),s(l),a=!1,e=i+1;continue}else{i=c-1;continue}else if(c=br(r,i-1),c===-1){l=h.trim(r.slice(e,i)),l=V(l),s(a,l),a=!1,e=i+1;continue}else continue}return e<r.length&&(a===!1?s(r.slice(e)):s(a,V(h.trim(r.slice(e))))),h.trim(n.join(" "))}function _r(r,t){for(;t<r.length;t++){var e=r[t];if(e!==" ")return e==="="?t:-1}}function br(r,t){for(;t>0;t--){var e=r[t];if(e!==" ")return e==="="?t:-1}}function wr(r){return r[0]==='"'&&r[r.length-1]==='"'||r[0]==="'"&&r[r.length-1]==="'"}function V(r){return wr(r)?r.substr(1,r.length-2):r}P.parseTag=Er;P.parseAttr=Ir;var Cr=G.FilterCSS,p=o,Z=P,yr=Z.parseTag,Lr=Z.parseAttr,y=x;function C(r){return r==null}function Pr(r){var t=y.spaceIndex(r);if(t===-1)return{html:"",closing:r[r.length-2]==="/"};r=y.trim(r.slice(t+1,-1));var e=r[r.length-1]==="/";return e&&(r=y.trim(r.slice(0,-1))),{html:r,closing:e}}function Rr(r){var t={};for(var e in r)t[e]=r[e];return t}function M(r){r=Rr(r||{}),r.stripIgnoreTag&&(r.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),r.onIgnoreTag=p.onIgnoreTagStripAll),r.whiteList=r.whiteList||r.allowList||p.whiteList,r.onTag=r.onTag||p.onTag,r.onTagAttr=r.onTagAttr||p.onTagAttr,r.onIgnoreTag=r.onIgnoreTag||p.onIgnoreTag,r.onIgnoreTagAttr=r.onIgnoreTagAttr||p.onIgnoreTagAttr,r.safeAttrValue=r.safeAttrValue||p.safeAttrValue,r.escapeHtml=r.escapeHtml||p.escapeHtml,this.options=r,r.css===!1?this.cssFilter=!1:(r.css=r.css||{},this.cssFilter=new Cr(r.css))}M.prototype.process=function(r){if(r=r||"",r=r.toString(),!r)return"";var t=this,e=t.options,n=e.whiteList,a=e.onTag,f=e.onIgnoreTag,s=e.onTagAttr,i=e.onIgnoreTagAttr,u=e.safeAttrValue,l=e.escapeHtml,c=t.cssFilter;e.stripBlankChar&&(r=p.stripBlankChar(r)),e.allowCommentTag||(r=p.stripCommentTag(r));var g=!1;if(e.stripIgnoreTagBody){var g=p.StripTagBody(e.stripIgnoreTagBody,f);f=g.onIgnoreTag}var A=yr(r,function(v,J,d,T,K){var b={sourcePosition:v,position:J,isClosing:K,isWhite:n.hasOwnProperty(d)},I=a(d,T,b);if(!C(I))return I;if(b.isWhite){if(b.isClosing)return"</"+d+">";var O=Pr(T),Y=n[d],F=Lr(O.html,function(E,S){var R=y.indexOf(Y,E)!==-1,_=s(d,E,S,R);if(!C(_))return _;if(R)return S=u(d,E,S,c),S?E+'="'+S+'"':E;var _=i(d,E,S,R);return C(_)?void 0:_}),T="<"+d;return F&&(T+=" "+F),O.closing&&(T+=" /"),T+=">",T}else{var I=f(d,T,b);return C(I)?l(T):I}},l);return g&&(A=g.remove(A)),A};var Xr=M;(function(r,t){var e=o,n=P,a=Xr;function f(u,l){var c=new a(l);return c.process(u)}t=r.exports=f,t.filterXSS=f,t.FilterXSS=a;for(var s in e)t[s]=e[s];for(var s in n)t[s]=n[s];typeof window<"u"&&(window.filterXSS=r.exports);function i(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}i()&&(self.filterXSS=r.exports)})(X,X.exports);var xr=X.exports;export{xr as l};
|