1 |
- import{r as t,a as e,U as i,V as r,I as n,b as o,c as a,d as s,e as l,k as c,j as u,F as d,f,m as g,l as p,i as h,B as m,h as v,C as b,X as w,g as x,v as y,n as k,t as A,Y as T,T as C,Z as I}from"./index.1711290598880.js";import{_ as S}from"./wangEditor.1711290598880.js";var L={exports:{}},j={},V={exports:{}},O={};function z(){var t={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return t}var E=/javascript\s*\:/gim;O.whiteList=z(),O.getDefaultWhiteList=z,O.onAttr=function(t,e,i){},O.onIgnoreAttr=function(t,e,i){},O.safeAttrValue=function(t,e){return E.test(e)?"":e};var _={indexOf:function(t,e){var i,r;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1},forEach:function(t,e,i){var r,n;if(Array.prototype.forEach)return t.forEach(e,i);for(r=0,n=t.length;r<n;r++)e.call(i,t[r],r,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}};var W=O,B=function(t,e){";"!==(t=_.trimRight(t))[t.length-1]&&(t+=";");var i=t.length,r=!1,n=0,o=0,a="";function s(){if(!r){var i=_.trim(t.slice(n,o)),s=i.indexOf(":");if(-1!==s){var l=_.trim(i.slice(0,s)),c=_.trim(i.slice(s+1));if(l){var u=e(n,a.length,l,c,i);u&&(a+=u+"; ")}}}n=o+1}for(;o<i;o++){var l=t[o];if("/"===l&&"*"===t[o+1]){var c=t.indexOf("*/",o+2);if(-1===c)break;n=(o=c+1)+1,r=!1}else"("===l?r=!0:")"===l?r=!1:";"===l?r||s():"\n"===l&&s()}return _.trim(a)};function F(t){return null==t}function D(t){(t=function(t){var e={};for(var i in t)e[i]=t[i];return e}(t||{})).whiteList=t.whiteList||W.whiteList,t.onAttr=t.onAttr||W.onAttr,t.onIgnoreAttr=t.onIgnoreAttr||W.onIgnoreAttr,t.safeAttrValue=t.safeAttrValue||W.safeAttrValue,this.options=t}D.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,i=e.whiteList,r=e.onAttr,n=e.onIgnoreAttr,o=e.safeAttrValue;return B(t,(function(t,e,a,s,l){var c=i[a],u=!1;if(!0===c?u=c:"function"==typeof c?u=c(s):c instanceof RegExp&&(u=c.test(s)),!0!==u&&(u=!1),s=o(a,s)){var d,f={position:e,sourcePosition:t,source:l,isWhite:u};return u?F(d=r(a,s,f))?a+":"+s:d:F(d=n(a,s,f))?void 0:d}}))};var H=D;!function(t,e){var i=O,r=H;for(var n in(e=t.exports=function(t,e){return new r(e).process(t)}).FilterCSS=r,i)e[n]=i[n];"undefined"!=typeof window&&(window.filterCSS=t.exports)}(V,V.exports);var X={indexOf:function(t,e){var i,r;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,r=t.length;i<r;i++)if(t[i]===e)return i;return-1},forEach:function(t,e,i){var r,n;if(Array.prototype.forEach)return t.forEach(e,i);for(r=0,n=t.length;r<n;r++)e.call(i,t[r],r,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var e=/\s|\n|\t/.exec(t);return e?e.index:-1}},N=V.exports.FilterCSS,q=V.exports.getDefaultWhiteList,$=X;function R(){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 P=new N;function U(t){return t.replace(M,"<").replace(Z,">")}var M=/</g,Z=/>/g,G=/"/g,K=/"/g,Q=/&#([a-zA-Z0-9]*);?/gim,Y=/:?/gim,J=/&newline;?/gim,tt=/((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,et=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,it=/u\s*r\s*l\s*\(.*/gi;function rt(t){return t.replace(G,""")}function nt(t){return t.replace(K,'"')}function ot(t){return t.replace(Q,(function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))}))}function at(t){return t.replace(Y,":").replace(J," ")}function st(t){for(var e="",i=0,r=t.length;i<r;i++)e+=t.charCodeAt(i)<32?" ":t.charAt(i);return $.trim(e)}function lt(t){return t=st(t=at(t=ot(t=nt(t))))}function ct(t){return t=U(t=rt(t))}j.whiteList={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"]},j.getDefaultWhiteList=R,j.onTag=function(t,e,i){},j.onIgnoreTag=function(t,e,i){},j.onTagAttr=function(t,e,i){},j.onIgnoreTagAttr=function(t,e,i){},j.safeAttrValue=function(t,e,i,r){if(i=lt(i),"href"===e||"src"===e){if("#"===(i=$.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===e){if(tt.lastIndex=0,tt.test(i))return""}else if("style"===e){if(et.lastIndex=0,et.test(i))return"";if(it.lastIndex=0,it.test(i)&&(tt.lastIndex=0,tt.test(i)))return"";!1!==r&&(i=(r=r||P).process(i))}return i=ct(i)},j.escapeHtml=U,j.escapeQuote=rt,j.unescapeQuote=nt,j.escapeHtmlEntities=ot,j.escapeDangerHtml5Entities=at,j.clearNonPrintableCharacter=st,j.friendlyAttrValue=lt,j.escapeAttrValue=ct,j.onIgnoreTagStripAll=function(){return""},j.StripTagBody=function(t,e){"function"!=typeof e&&(e=function(){});var i=!Array.isArray(t),r=[],n=!1;return{onIgnoreTag:function(o,a,s){if(function(e){return!!i||-1!==$.indexOf(t,e)}(o)){if(s.isClosing){var l="[/removed]",c=s.position+l.length;return r.push([!1!==n?n:s.position,c]),n=!1,l}return n||(n=s.position),"[removed]"}return e(o,a,s)},remove:function(t){var e="",i=0;return $.forEach(r,(function(r){e+=t.slice(i,r[0]),i=r[1]})),e+=t.slice(i)}}},j.stripCommentTag=function(t){for(var e="",i=0;i<t.length;){var r=t.indexOf("\x3c!--",i);if(-1===r){e+=t.slice(i);break}e+=t.slice(i,r);var n=t.indexOf("--\x3e",r);if(-1===n)break;i=n+3}return e},j.stripBlankChar=function(t){var e=t.split("");return(e=e.filter((function(t){var e=t.charCodeAt(0);return 127!==e&&(!(e<=31)||(10===e||13===e))}))).join("")},j.cssFilter=P,j.getDefaultCSSWhiteList=q;var ut={},dt=X;function ft(t){var e,i=dt.spaceIndex(t);return e=-1===i?t.slice(1,-1):t.slice(1,i+1),"/"===(e=dt.trim(e).toLowerCase()).slice(0,1)&&(e=e.slice(1)),"/"===e.slice(-1)&&(e=e.slice(0,-1)),e}function gt(t){return"</"===t.slice(0,2)}var pt=/[^a-zA-Z0-9\\_:.-]/gim;function ht(t,e){for(;e<t.length;e++){var i=t[e];if(" "!==i)return"="===i?e:-1}}function mt(t,e){for(;e<t.length;e++){var i=t[e];if(" "!==i)return"'"===i||'"'===i?e:-1}}function vt(t,e){for(;e>0;e--){var i=t[e];if(" "!==i)return"="===i?e:-1}}function bt(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}ut.parseTag=function(t,e,i){var r="",n=0,o=!1,a=!1,s=0,l=t.length,c="",u="";t:for(s=0;s<l;s++){var d=t.charAt(s);if(!1===o){if("<"===d){o=s;continue}}else if(!1===a){if("<"===d){r+=i(t.slice(n,s)),o=s,n=s;continue}if(">"===d||s===l-1){r+=i(t.slice(n,o)),c=ft(u=t.slice(o,s+1)),r+=e(o,r.length,c,u,gt(u)),n=s+1,o=!1;continue}if('"'===d||"'"===d)for(var f=1,g=t.charAt(s-f);""===g.trim()||"="===g;){if("="===g){a=d;continue t}g=t.charAt(s-++f)}}else if(d===a){a=!1;continue}}return n<l&&(r+=i(t.substr(n))),r},ut.parseAttr=function(t,e){var i=0,r=0,n=[],o=!1,a=t.length;function s(t,i){if(!((t=(t=dt.trim(t)).replace(pt,"").toLowerCase()).length<1)){var r=e(t,i||"");r&&n.push(r)}}for(var l=0;l<a;l++){var c,u=t.charAt(l);if(!1!==o||"="!==u)if(!1===o||l!==r)if(/\s|\n|\t/.test(u)){if(t=t.replace(/\s|\n|\t/g," "),!1===o){if(-1===(c=ht(t,l))){s(dt.trim(t.slice(i,l))),o=!1,i=l+1;continue}l=c-1;continue}if(-1===(c=vt(t,l-1))){s(o,bt(dt.trim(t.slice(i,l)))),o=!1,i=l+1;continue}}else;else{if(-1===(c=t.indexOf(u,l+1)))break;s(o,dt.trim(t.slice(r+1,c))),o=!1,i=(l=c)+1}else o=t.slice(i,l),i=l+1,r='"'===t.charAt(i)||"'"===t.charAt(i)?i:mt(t,l+1)}return i<t.length&&(!1===o?s(t.slice(i)):s(o,bt(dt.trim(t.slice(i))))),dt.trim(n.join(" "))};var wt=V.exports.FilterCSS,xt=j,yt=ut,kt=yt.parseTag,At=yt.parseAttr,Tt=X;function Ct(t){return null==t}function It(t){(t=function(t){var e={};for(var i in t)e[i]=t[i];return e}(t||{})).stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=xt.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i.toLowerCase()]=t[i].map((function(t){return t.toLowerCase()})):e[i.toLowerCase()]=t[i];return e}(t.whiteList||t.allowList):t.whiteList=xt.whiteList,t.onTag=t.onTag||xt.onTag,t.onTagAttr=t.onTagAttr||xt.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||xt.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||xt.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||xt.safeAttrValue,t.escapeHtml=t.escapeHtml||xt.escapeHtml,this.options=t,!1===t.css?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new wt(t.css))}It.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,i=e.whiteList,r=e.onTag,n=e.onIgnoreTag,o=e.onTagAttr,a=e.onIgnoreTagAttr,s=e.safeAttrValue,l=e.escapeHtml,c=this.cssFilter;e.stripBlankChar&&(t=xt.stripBlankChar(t)),e.allowCommentTag||(t=xt.stripCommentTag(t));var u=!1;e.stripIgnoreTagBody&&(u=xt.StripTagBody(e.stripIgnoreTagBody,n),n=u.onIgnoreTag);var d=kt(t,(function(t,e,u,d,f){var g={sourcePosition:t,position:e,isClosing:f,isWhite:Object.prototype.hasOwnProperty.call(i,u)},p=r(u,d,g);if(!Ct(p))return p;if(g.isWhite){if(g.isClosing)return"</"+u+">";var h=function(t){var e=Tt.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var i="/"===(t=Tt.trim(t.slice(e+1,-1)))[t.length-1];return i&&(t=Tt.trim(t.slice(0,-1))),{html:t,closing:i}}(d),m=i[u],v=At(h.html,(function(t,e){var i=-1!==Tt.indexOf(m,t),r=o(u,t,e,i);return Ct(r)?i?(e=s(u,t,e,c))?t+'="'+e+'"':t:Ct(r=a(u,t,e,i))?void 0:r:r}));return d="<"+u,v&&(d+=" "+v),h.closing&&(d+=" /"),d+=">"}return Ct(p=n(u,d,g))?l(d):p}),l);return u&&(d=u.remove(d)),d};var St=It;!function(t,e){var i=j,r=ut,n=St;function o(t,e){return new n(e).process(t)}(e=t.exports=o).filterXSS=o,e.FilterXSS=n,function(){for(var t in i)e[t]=i[t];for(var n in r)e[n]=r[n]}(),"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)}(L,L.exports);var Lt=L.exports;const jt=(t,e=[])=>{const i=["p","a","img","font","span","b","blockquote","code","h1","h2","h3","h4","h5","h6","hr","br","s","i","u","strike","div","strong","pre","code","pre","table","tbody","thead","colgroup","col","th","tr","td","colgroup","col","ul","li","ol"];e.length>0&&e.forEach((t=>{i.push(t)}));const r=["color","size","style","href","src","class"];let n={};for(let o=0;o<i.length;o++){n[i[o]]=r}return Lt(t,{whiteList:n})};const Vt={class:"flex w-full noteApp bg-white"},Ot={class:"h-full noteApp-left mt-4"},zt={class:"pb-4 bg-white sticky top-0 z-20 flex justify-center"},Et={key:0},_t=["onClick"],Wt={class:"overflow-ellipsis whitespace-nowrap overflow-hidden font-bold noteApp-title"},Bt={class:"flex items-center mt-2"},Ft={class:"noteApp-time ml-2"},Dt=["onClick"],Ht=[l("svg",{width:"24",height:"24",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[l("path",{d:"M24.0605 10L24.0239 38",stroke:"#fff","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"}),l("path",{d:"M10 24L38 24",stroke:"#fff","stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)],Xt={class:"px-2 w-full noteApp-context mt-2.5"},Nt={key:0,class:"mt-4"},qt={class:"mb-4",style:{width:"calc(100% - 150px)"}},$t={key:0,class:"flex flex-col",style:{height:"calc(100vh - 90px)"}},Rt={class:"noteApp-edit-footer flex",style:{height:"30px","margin-top":"10px"}},Pt={class:"flex items-center gap-4 ml-4"},Ut=["onClick"],Mt={class:"ml-auto"},Zt={key:1,class:"flex justify-center flex-col items-center h-full"},Gt=l("img",{style:{transform:"translateX(-90px)"},src:"/dist/assets/wiki.1711290598880.png",alt:""},null,-1),Kt={style:{transform:"translateX(-90px)"},class:"mt-6 text-2xl"},Qt={__name:"index",setup(L){const j=t(""),V=t(!1),O=t([]),z=t(""),E=t(""),_={text:"",id:"",user_id:"",title:"",create_time:"",update_time:"",weight:0},W=t(Object.assign({},_));e((async()=>{window.addEventListener("keydown",(async function(t){const e=t.ctrlKey||t.metaKey,i="s"===t.key;e&&i&&(t.preventDefault(),await B())}));const t=await i({url:"/Note/get?sort=desc"});1===t.code&&(O.value=t.data,O.value.length>0&&await X(O.value[0]))}));const B=async()=>{if(!W.value.id)return;let t=Object.assign({},W.value);if(t.text=E.value,0===t.title.length){let e=document.createElement("div");e.innerHTML=E.value,t.title=e.innerText.slice(0,50)}const{title:e=!1}=O.value.find((t=>t.id===W.value.id));if(e===W.value.title&&t.text===W.value.text)return;const n=await i({url:"/Note/add",method:"post",data:t}),o=O.value.findIndex((e=>e.id===t.id));O.value[o]=Object.assign({},null==n?void 0:n.data),W.value=null==n?void 0:n.data,r.success("已保存最新内容")};let F=!1;const D=async()=>{if(F)return;F=!0;let t={title:"",text:""};try{const e=await i({url:"/Note/add",method:"post",data:t});if(0===e.code)return void r.warning(e.msg);O.value.unshift(e.data),await X(O.value[0]),W.value=e.data,j.value=""}catch(e){}setTimeout((()=>{F=!1}),2e3)};let H=!1;const X=async t=>{t.id!==W.value.id&&(H||(H=!0,z.value=t.id,V.value=!1,await n((async()=>{try{(t=Object.assign(_,t)).text=await i({url:"/note/getText?id="+t.id}),W.value=t,E.value=jt(t.text),V.value=!0}catch(e){console.log("错误",e.message)}await n((()=>{setTimeout((()=>{H=!1}),300)}))}))))};return(t,e)=>{const r=o("el-input"),n=o("el-icon"),L=o("el-button");return a(),s("div",Vt,[l("div",Ot,[l("div",zt,[c(r,{placeholder:"标题快捷搜索","suffix-icon":u(w),modelValue:j.value,"onUpdate:modelValue":e[0]||(e[0]=t=>j.value=t),clearable:"",class:"w-4/5 noteSearch"},null,8,["suffix-icon","modelValue"])]),0!==O.value.length?(a(),s("div",Et,[(a(!0),s(d,null,f(O.value,(t=>(a(),x(C,{key:t.id},{default:v((()=>[h(l("div",{class:k(["w-full noteApp-item",{"noteApp-listSelect":z.value===t.id}]),onClick:e=>X(t)},[l("div",Wt,A(t.title||"新建笔记"),1),l("div",Bt,[(null==t?void 0:t.weight)>0?(a(),s("div",{key:0,class:k(`note-weight weight-${t.weight}`)},null,2)):g("",!0),l("div",Ft,A(null==t?void 0:t.update_time),1),z.value===t.id?(a(),x(n,{key:1,class:"hover:text-blue-400 ml-auto",title:"删除笔记",onClick:p((e=>(async t=>{try{await I.confirm("删除将无法恢复,是否删除?","温馨提示",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"}),await i({url:"/note/del?id="+t});const e=O.value.findIndex((e=>e.id===t));O.value.splice(e,1),t===W.value.id&&(W.value={text:"",id:"",user_id:"",title:"",create_time:"",update_time:"",weight:0},E.value=jt(""),V.value=!1)}catch(e){console.log(e)}})(t.id)),["stop"]),size:"15px",color:"#999999"},{default:v((()=>[c(u(T))])),_:2},1032,["onClick"])):g("",!0)])],10,_t),[[y,t.title.includes(j.value)||!t.title]])])),_:2},1024)))),128))])):g("",!0),l("div",{class:"addNote",onClick:p(D,["stop"]),title:"新建笔记"},Ht,8,Dt)]),l("div",Xt,[V.value?(a(),s("div",Nt,[l("div",qt,[h(l("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>W.value.title=t),id:"noteAppTitle",maxlength:"50",placeholder:"点击这里设置标题哟!"},null,512),[[m,W.value.title]])]),V.value&&W.value.id?(a(),s("div",$t,[c(S,{modelValue:E.value,"onUpdate:modelValue":e[2]||(e[2]=t=>E.value=t)},null,8,["modelValue"]),l("div",Rt,[l("div",Pt,[(a(),s(d,null,f(7,(t=>l("div",{onClick:e=>(async t=>{W.value.weight=t,await i({url:"/Note/setWeight",method:"post",data:{id:W.value.id,weight:t}}),O.value.forEach((e=>{e.id===z.value&&(e.weight=t)}))})(t-1),class:k(`note-weight maxWeight weight-${t-1} ${t-1===W.value.weight?"selWeight":""}`)},null,10,Ut))),64))]),l("div",Mt,[c(L,{size:"default",class:"w-24",onClick:B,type:"primary",title:"(Ctrl/Command) + S"},{default:v((()=>[b("保存 ")])),_:1})])])])):g("",!0)])):(a(),s("div",Zt,[Gt,l("b",Kt,[b("请选择文档或"),c(L,{type:"primary",class:"ml-4",onClick:p(D,["stop"]),round:""},{default:v((()=>[b("创建文档")])),_:1},8,["onClick"])])]))])])}}};export{Qt as default};
|