@editora/core 1.0.30 → 1.0.31
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/{TextColorPlugin.native-C2IjioNM.mjs → TextColorPlugin.native-30VvsUUv.mjs} +2 -2
- package/dist/editora.min.js +2 -2
- package/dist/editora.umd.js +2 -2
- package/dist/{index-BIsub9gV.mjs → index-8WhEVFK8.mjs} +8 -6
- package/dist/{index-Z9P9O-ty.js → index-DMk3V5_f.js} +4 -4
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +2 -2
- package/dist/plugin-loader.js +1 -1
- package/dist/webcomponent-core.js +75 -73
- package/dist/webcomponent-core.min.js +19 -19
- package/dist/webcomponent.cjs.js +1 -1
- package/dist/webcomponent.esm.js +1 -1
- package/dist/webcomponent.js +53 -51
- package/dist/webcomponent.min.js +190 -190
- package/package.json +1 -1
|
@@ -477,7 +477,7 @@ function x() {
|
|
|
477
477
|
`, document.head.appendChild(e);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
|
-
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", x) : setTimeout(x, 100);
|
|
480
|
+
typeof document != "undefined" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", x) : setTimeout(x, 100));
|
|
481
481
|
const z = () => ({
|
|
482
482
|
name: "textColor",
|
|
483
483
|
marks: {
|
|
@@ -530,4 +530,4 @@ const z = () => ({
|
|
|
530
530
|
export {
|
|
531
531
|
z as TextColorPlugin
|
|
532
532
|
};
|
|
533
|
-
//# sourceMappingURL=TextColorPlugin.native-
|
|
533
|
+
//# sourceMappingURL=TextColorPlugin.native-30VvsUUv.mjs.map
|
package/dist/editora.min.js
CHANGED
|
@@ -521,6 +521,6 @@ var Editora=(function(b){"use strict";class ce{constructor(e,t,o){this.doc=e,thi
|
|
|
521
521
|
`,e}updateGrid(){const e=this.categorySelect.value;this.emojisGrid.innerHTML="";let t=[];e==="all"?t=Object.values(this.emojis).flat():t=this.emojis[e]||[],t.forEach(o=>{const n=document.createElement("button");n.className="emoji-button",n.textContent=o,n.title=`Insert ${o}`,n.addEventListener("click",i=>{i.preventDefault(),this.handleSelect(o)}),this.emojisGrid.appendChild(n)})}filterEmojis(){const e=this.searchInput.value.toLowerCase();this.emojisGrid.querySelectorAll(".emoji-button").forEach(o=>{const n=o.textContent||"",i=!e||n.includes(e);o.style.display=i?"flex":"none"})}handleSelect(e){this.onSelect(e),this.dialog.close()}show(){this.dialog.show(),this.searchInput.value="",this.categorySelect.value="popular",this.updateGrid(),setTimeout(()=>this.searchInput.focus(),100)}close(){this.dialog.close()}}function jt(s,e){const t=s.textContent||"",o=$t(s,e.startContainer,e.startOffset),i=t.substring(0,o).split(`
|
|
522
522
|
`),a=i.length,c=i[i.length-1].length+1;return{line:a,column:c}}function $t(s,e,t){var a;let o=0;const n=document.createTreeWalker(s,NodeFilter.SHOW_TEXT,null);let i=n.firstChild();for(;i;){if(i===e){o+=t;break}else i.nodeType===Node.TEXT_NODE&&(o+=((a=i.textContent)==null?void 0:a.length)||0);i=n.nextNode()}return o}function Wt(s){var o,n;const e=s.querySelectorAll("div, p, br, h1, h2, h3, h4, h5, h6, blockquote, li, pre");let t=1;if(e.length>0){t=e.length;const i=e[e.length-1];(i.tagName==="BR"||((o=i.innerHTML)==null?void 0:o.trim())===""||((n=i.textContent)==null?void 0:n.trim())==="")&&t++}else{const a=(s.textContent||"").split(`
|
|
523
523
|
`).length;t=Math.max(1,a)}return t}function qt(s){const e=s.trim()?s.trim().split(/\s+/).length:0,t=s.length;return{words:e,chars:t}}function Gt(s,e){const t=s.toString();return{startLine:e.line,startColumn:e.column,endLine:e.line,endColumn:e.column+t.length,selectedChars:t.length,selectedWords:t.trim().split(/\s+/).filter(Boolean).length}}function Kt(s,e){(e==null||e>s.length)&&(e=s.length);for(var t=0,o=Array(e);t<e;t++)o[t]=s[t];return o}function fn(s){if(Array.isArray(s))return s}function gn(s,e){var t=s==null?null:typeof Symbol!="undefined"&&s[Symbol.iterator]||s["@@iterator"];if(t!=null){var o,n,i,a,c=[],d=!0,m=!1;try{if(i=(t=t.call(s)).next,e!==0)for(;!(d=(o=i.call(t)).done)&&(c.push(o.value),c.length!==e);d=!0);}catch(f){m=!0,n=f}finally{try{if(!d&&t.return!=null&&(a=t.return(),Object(a)!==a))return}finally{if(m)throw n}}return c}}function bn(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
524
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yn(s,e){return fn(s)||gn(s,e)||vn(s,e)||bn()}function vn(s,e){if(s){if(typeof s=="string")return Kt(s,e);var t={}.toString.call(s).slice(8,-1);return t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set"?Array.from(s):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Kt(s,e):void 0}}const Vt=Object.entries,Yt=Object.setPrototypeOf,En=Object.isFrozen,wn=Object.getPrototypeOf,xn=Object.getOwnPropertyDescriptor;let _=Object.freeze,D=Object.seal,de=Object.create,Xt=typeof Reflect!="undefined"&&Reflect,nt=Xt.apply,it=Xt.construct;_||(_=function(e){return e}),D||(D=function(e){return e}),nt||(nt=function(e,t){for(var o=arguments.length,n=new Array(o>2?o-2:0),i=2;i<o;i++)n[i-2]=arguments[i];return e.apply(t,n)}),it||(it=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return new e(...o)});const ne=I(Array.prototype.forEach),kn=I(Array.prototype.lastIndexOf),Zt=I(Array.prototype.pop),Se=I(Array.prototype.push),Tn=I(Array.prototype.splice),ue=Array.isArray,Ae=I(String.prototype.toLowerCase),rt=I(String.prototype.toString),Jt=I(String.prototype.match),Le=I(String.prototype.replace),Qt=I(String.prototype.indexOf),Cn=I(String.prototype.trim),Sn=I(Number.prototype.toString),An=I(Boolean.prototype.toString),eo=typeof BigInt=="undefined"?null:I(BigInt.prototype.toString),to=typeof Symbol=="undefined"?null:I(Symbol.prototype.toString),N=I(Object.prototype.hasOwnProperty),Me=I(Object.prototype.toString),O=I(RegExp.prototype.test),Y=Ln(TypeError);function I(s){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return nt(s,e,o)}}function Ln(s){return function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return it(s,t)}}function x(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ae;if(Yt&&Yt(s,null),!ue(e))return s;let o=e.length;for(;o--;){let n=e[o];if(typeof n=="string"){const i=t(n);i!==n&&(En(e)||(e[o]=i),n=i)}s[n]=!0}return s}function Mn(s){for(let e=0;e<s.length;e++)N(s,e)||(s[e]=null);return s}function F(s){const e=de(null);for(const o of Vt(s)){var t=yn(o,2);const n=t[0],i=t[1];N(s,n)&&(ue(i)?e[n]=Mn(i):i&&typeof i=="object"&&i.constructor===Object?e[n]=F(i):e[n]=i)}return e}function In(s){switch(typeof s){case"string":return s;case"number":return Sn(s);case"boolean":return An(s);case"bigint":return eo?eo(s):"0";case"symbol":return to?to(s):"Symbol()";case"undefined":return Me(s);case"function":case"object":{if(s===null)return Me(s);const e=s,t=$(e,"toString");if(typeof t=="function"){const o=t(e);return typeof o=="string"?o:Me(o)}return Me(s)}default:return Me(s)}}function $(s,e){for(;s!==null;){const o=xn(s,e);if(o){if(o.get)return I(o.get);if(typeof o.value=="function")return I(o.value)}s=wn(s)}function t(){return null}return t}function _n(s){try{return O(s,""),!0}catch(e){return!1}}const oo=_(["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"]),at=_(["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"]),st=_(["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"]),Dn=_(["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"]),lt=_(["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"]),On=_(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),no=_(["#text"]),io=_(["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"]),ct=_(["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"]),ro=_(["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"]),Fe=_(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Rn=D(/{{[\w\W]*|^[\w\W]*}}/g),Pn=D(/<%[\w\W]*|^[\w\W]*%>/g),Nn=D(/\${[\w\W]*/g),zn=D(/^data-[\-\w.\u00B7-\uFFFF]+$/),Fn=D(/^aria-[\-\w]+$/),ao=D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hn=D(/^(?:\w+script|data):/i),Un=D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bn=D(/^html$/i),jn=D(/^[a-z][.\w]*(-[.\w]+)+$/i),so=D(/<[/\w!]/g),lo=D(/<[/\w]/g),$n=D(/<\/no(script|embed|frames)/i),Wn=D(/\/>/i),H={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},co=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],qn=_(x({},co)),Gn=(function(){const s={};return ne(co,e=>{s[e]=D(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),_(s)})(),Kn=function(){return typeof window=="undefined"?null:window},Vn=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));const i="dompurify"+(o?"#"+o:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch(a){return console.warn("TrustedTypes policy "+i+" could not be created."),null}},uo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},X=function(e,t,o,n){return N(e,t)&&ue(e[t])?x(n.base?F(n.base):{},e[t],n.transform):o},dt=function(e,t,o){const n=N(e,t)?e[t]:void 0;return n&&typeof n=="object"?F(n):o()};function ho(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Kn();const e=h=>ho(h);if(e.version="3.4.16",e.removed=[],!s||!s.document||s.document.nodeType!==H.document||!s.Element)return e.isSupported=!1,e;let t=s.document;const o=t,n=o.currentScript;s.DocumentFragment;const i=s.HTMLTemplateElement,a=s.Node,c=s.Element,d=s.NodeFilter;s.NamedNodeMap===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const m=s.DOMParser,f=s.trustedTypes,k=c.prototype,y=$(k,"cloneNode"),E=$(k,"remove"),T=$(k,"removeAttributeNode"),ie=$(k,"nextSibling"),q=$(k,"childNodes"),U=$(k,"parentNode"),pe=$(k,"shadowRoot"),B=$(k,"attributes"),R=a&&a.prototype?$(a.prototype,"nodeType"):null,me=a&&a.prototype?$(a.prototype,"nodeName"):null,$e=a&&a.prototype?$(a.prototype,"ownerDocument"):null,_e=function(r){return R?R(r):r.nodeType},gt=function(r){return me?me(r):r.nodeName};if(typeof i=="function"){const h=t.createElement("template");h.content&&h.content.ownerDocument&&(t=h.content.ownerDocument)}let z,re="",bt,ko=!1,De=0;const To=function(){if(De>0)throw Y('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.')},fe=function(r){To(),De++;try{return z.createHTML(r)}finally{De--}},mi=function(r){To(),De++;try{return z.createScriptURL(r)}finally{De--}},fi=function(){return ko||(bt=Vn(f,n),ko=!0),bt},We=t,yt=We.implementation,Co=We.createNodeIterator,gi=We.createDocumentFragment,bi=We.getElementsByTagName,yi=o.importNode;let C=uo();e.isSupported=typeof Vt=="function"&&typeof U=="function"&&yt&&yt.createHTMLDocument!==void 0;const vi=Rn,Ei=Pn,wi=Nn,xi=zn,ki=Fn,Ti=Hn,So=Un,Ci=jn;let Ao=ao,S=null;const vt=x({},[...oo,...at,...st,...lt,...no]);let A=null;const Et=x({},[...io,...ct,...ro,...Fe]);let G=Object.seal(de(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}})),Oe=null,Lo=null;const Q=Object.seal(de(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Mo=!0,wt=!0,Io=!1,_o=!0,ee=!1,ae=!0,se=!1,xt=!1,qe=null,Ge=null,kt=!1,ge=!1,Ke=!1,Ve=!1,Do=!0,Oo=!1;const Ro="user-content-";let Tt=!0,Ct=!1,be={},ye=null;const Po=x({},["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 No=null;const zo=x({},["audio","video","img","source","image","track"]);let Fo=null;const Ho=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",K="http://www.w3.org/1999/xhtml";let ve=K,St=!1,At=null;const Si=x({},[Ye,Xe,K],rt),Uo=_(["mi","mo","mn","ms","mtext"]);let Lt=x({},Uo);const Bo=_(["annotation-xml"]);let Mt=x({},Bo);const Ai=x({},["title","style","font","a","script"]);let Re=null;const Li=["application/xhtml+xml","text/html"],Mi="text/html";let M=null,Ee=null;const Ii=t.createElement("form"),jo=function(r){return r instanceof RegExp||r instanceof Function},It=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ee&&Ee===r)return;(!r||typeof r!="object")&&(r={}),r=F(r),Re=Li.indexOf(r.PARSER_MEDIA_TYPE)===-1?Mi:r.PARSER_MEDIA_TYPE,M=Re==="application/xhtml+xml"?rt:Ae,S=X(r,"ALLOWED_TAGS",vt,{transform:M}),A=X(r,"ALLOWED_ATTR",Et,{transform:M}),At=X(r,"ALLOWED_NAMESPACES",Si,{transform:rt}),Fo=X(r,"ADD_URI_SAFE_ATTR",Ho,{transform:M,base:Ho}),No=X(r,"ADD_DATA_URI_TAGS",zo,{transform:M,base:zo}),ye=X(r,"FORBID_CONTENTS",Po,{transform:M}),Oe=X(r,"FORBID_TAGS",F({}),{transform:M}),Lo=X(r,"FORBID_ATTR",F({}),{transform:M}),be=N(r,"USE_PROFILES")?r.USE_PROFILES&&typeof r.USE_PROFILES=="object"?F(r.USE_PROFILES):r.USE_PROFILES:!1,Mo=r.ALLOW_ARIA_ATTR!==!1,wt=r.ALLOW_DATA_ATTR!==!1,Io=r.ALLOW_UNKNOWN_PROTOCOLS||!1,_o=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=r.SAFE_FOR_TEMPLATES||!1,ae=r.SAFE_FOR_XML!==!1,se=r.WHOLE_DOCUMENT||!1,ge=r.RETURN_DOM||!1,Ke=r.RETURN_DOM_FRAGMENT||!1,Ve=r.RETURN_TRUSTED_TYPE||!1,kt=r.FORCE_BODY||!1,Do=r.SANITIZE_DOM!==!1,Oo=r.SANITIZE_NAMED_PROPS||!1,Tt=r.KEEP_CONTENT!==!1,Ct=r.IN_PLACE||!1,Ao=_n(r.ALLOWED_URI_REGEXP)?r.ALLOWED_URI_REGEXP:ao,ve=typeof r.NAMESPACE=="string"?r.NAMESPACE:K,Lt=dt(r,"MATHML_TEXT_INTEGRATION_POINTS",()=>x({},Uo)),Mt=dt(r,"HTML_INTEGRATION_POINTS",()=>x({},Bo));const l=dt(r,"CUSTOM_ELEMENT_HANDLING",()=>de(null));if(G=de(null),N(l,"tagNameCheck")&&jo(l.tagNameCheck)&&(G.tagNameCheck=l.tagNameCheck),N(l,"attributeNameCheck")&&jo(l.attributeNameCheck)&&(G.attributeNameCheck=l.attributeNameCheck),N(l,"allowCustomizedBuiltInElements")&&typeof l.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=l.allowCustomizedBuiltInElements),D(G),ee&&(wt=!1),Ke&&(ge=!0),be&&(S=x({},no),A=de(null),be.html===!0&&(x(S,oo),x(A,io)),be.svg===!0&&(x(S,at),x(A,ct),x(A,Fe)),be.svgFilters===!0&&(x(S,st),x(A,ct),x(A,Fe)),be.mathMl===!0&&(x(S,lt),x(A,ro),x(A,Fe))),Q.tagCheck=null,Q.attributeCheck=null,N(r,"ADD_TAGS")&&(typeof r.ADD_TAGS=="function"?Q.tagCheck=r.ADD_TAGS:ue(r.ADD_TAGS)&&(S===vt&&(S=F(S)),x(S,r.ADD_TAGS,M))),N(r,"ADD_ATTR")&&(typeof r.ADD_ATTR=="function"?Q.attributeCheck=r.ADD_ATTR:ue(r.ADD_ATTR)&&(A===Et&&(A=F(A)),x(A,r.ADD_ATTR,M))),N(r,"ADD_FORBID_CONTENTS")&&ue(r.ADD_FORBID_CONTENTS)&&(ye===Po&&(ye=F(ye)),x(ye,r.ADD_FORBID_CONTENTS,M)),Tt&&(S["#text"]=!0),se&&x(S,["html","head","body"]),S.table&&(x(S,["tbody"]),delete Oe.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw Y('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Y('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const u=z;z=r.TRUSTED_TYPES_POLICY;try{re=fe("")}catch(p){throw z=u,p}}else r.TRUSTED_TYPES_POLICY===null?(z=void 0,re=""):(z===void 0&&(z=fi()),z&&typeof re=="string"&&(re=fe("")));_&&_(r),Ee=r},$o=x({},[...at,...st,...Dn]),Wo=x({},[...lt,...On]),_i=function(r,l,u){return l.namespaceURI===K?r==="svg":l.namespaceURI===Ye?r==="svg"&&(u==="annotation-xml"||Lt[u]):!!$o[r]},Di=function(r,l,u){return l.namespaceURI===K?r==="math":l.namespaceURI===Xe?r==="math"&&Mt[u]:!!Wo[r]},Oi=function(r,l,u){return l.namespaceURI===Xe&&!Mt[u]||l.namespaceURI===Ye&&!Lt[u]?!1:!Wo[r]&&(Ai[r]||!$o[r])},Ri=function(r){let l=U(r);(!l||!l.tagName)&&(l={namespaceURI:ve,tagName:"template"});const u=Ae(r.tagName),p=Ae(l.tagName);return At[r.namespaceURI]?r.namespaceURI===Xe?_i(u,l,p):r.namespaceURI===Ye?Di(u,l,p):r.namespaceURI===K?Oi(u,l,p):!!(Re==="application/xhtml+xml"&&At[r.namespaceURI]):!1},te=function(r){Se(e.removed,{element:r});try{U(r).removeChild(r)}catch(l){if(E(r),!U(r))throw Y("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},qo=function(r,l,u){try{T(r,l)}catch(p){try{r.removeAttribute(u)}catch(g){}}},Ze=function(r){Je(r);const l=q(r);if(l){const p=[];ne(l,g=>{Se(p,g)}),ne(p,g=>{try{E(g)}catch(v){}})}const u=B(r);if(u)for(let p=u.length-1;p>=0;--p){const g=u[p],v=g&&g.name;typeof v=="string"&&qo(r,g,v)}},le=function(r,l,u){if(!u)try{u=l.getAttributeNode(r)}catch(p){u=null}Se(e.removed,{attribute:u||null,from:l});try{u?T(l,u):l.removeAttribute(r)}catch(p){try{l.removeAttribute(r)}catch(g){}}if(r==="is")if(ge||Ke)try{te(l)}catch(p){}else try{l.setAttribute(r,"")}catch(p){}},Pi=function(r){const l=B(r);if(l)for(let u=l.length-1;u>=0;--u){const p=l[u],g=p&&p.name;typeof g!="string"||A[M(g)]||qo(r,p,g)}},Je=function(r){const l=[r];for(;l.length>0;){const u=l.pop();_e(u)===H.element&&Pi(u);const p=q(u);if(p)for(let g=p.length-1;g>=0;--g)l.push(p[g])}},Go=function(r,l){return ae?r==="patchsrc"?!0:r==="for"&&l!=="label"&&l!=="output":!1},Ni=function(r){if(!ae)return;const l=[r];for(;l.length>0;){const u=l.pop(),p=_e(u);if(p===H.processingInstruction||p===H.comment&&O(lo,u.data)){try{E(u)}catch(v){}continue}if(p===H.element){const v=u,w=M(gt(u));try{v.hasAttribute&&v.hasAttribute("patchsrc")&&v.removeAttribute("patchsrc"),v.hasAttribute&&v.hasAttribute("for")&&Go("for",w)&&v.removeAttribute("for")}catch(L){}}const g=q(u);if(g)for(let v=g.length-1;v>=0;--v)l.push(g[v])}},Ko=function(r){let l=null,u=null;if(kt)r="<remove></remove>"+r;else{const v=Jt(r,/^[\r\n\t ]+/);u=v&&v[0]}Re==="application/xhtml+xml"&&ve===K&&(r='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+r+"</body></html>");const p=z?fe(r):r;if(ve===K)try{l=new m().parseFromString(p,Re)}catch(v){}if(!l||!l.documentElement){l=yt.createDocument(ve,"template",null);try{l.documentElement.innerHTML=St?re:p}catch(v){}}const g=l.body||l.documentElement;return r&&u&&g.insertBefore(t.createTextNode(u),g.childNodes[0]||null),ve===K?bi.call(l,se?"html":"body")[0]:se?l.documentElement:g},Vo=function(r){const l=$e?$e(r):r.ownerDocument;return Co.call(l||r,r,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Qe=function(r){return r=Le(r,vi," "),r=Le(r,Ei," "),r=Le(r,wi," "),r},_t=function(r){var l;r.normalize();const u=$e?$e(r):r.ownerDocument,p=Co.call(u||r,r,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let g=p.nextNode();for(;g;)g.data=Qe(g.data),g=p.nextNode();const v=(l=r.querySelectorAll)===null||l===void 0?void 0:l.call(r,"template");v&&ne(v,w=>{we(w.content)&&_t(w.content)})},et=function(r){const l=me?me(r):null;return typeof l!="string"||M(l)!=="form"?!1:typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||r.attributes!==B(r)||typeof r.removeAttribute!="function"||typeof r.removeAttributeNode!="function"||typeof r.getAttributeNode!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function"||r.nodeType!==R(r)||r.childNodes!==q(r)},we=function(r){if(!R||typeof r!="object"||r===null)return!1;try{return R(r)===H.documentFragment}catch(l){return!1}},Pe=function(r){if(!R||typeof r!="object"||r===null)return!1;try{return typeof R(r)=="number"}catch(l){return!1}};function V(h,r,l){h.length!==0&&ne(h,u=>{u.call(e,r,l,Ee)})}const zi=function(r,l){return!!(ae&&r.hasChildNodes()&&!Pe(r.firstElementChild)&&O(so,r.textContent)&&O(so,r.innerHTML)||ae&&r.namespaceURI===K&&qn[l]&&(Pe(r.firstElementChild)||typeof r.textContent=="string"&&O(Gn[l],r.textContent))||r.nodeType===H.processingInstruction||ae&&r.nodeType===H.comment&&O(lo,r.data))},tt=function(r,l){if(r instanceof RegExp)return O(r,l);if(r instanceof Function){for(var u=arguments.length,p=new Array(u>2?u-2:0),g=2;g<u;g++)p[g-2]=arguments[g];return!!r(l,...p)}return!1},Fi=function(r,l,u){if(!Oe[l]&&Jo(l)&&tt(G.tagNameCheck,l))return!1;if(Tt&&!ye[l]){const p=U(r),g=q(r);if(g&&p){const v=g.length;for(let w=v-1;w>=0;--w){const L=r===u?y(g[w],!0):g[w];p.insertBefore(L,ie(r))}}}return te(r),!0},Yo=function(r,l,u,p){return r.length===0?l:l===u||l===p?F(l):l},xe=function(r,l){return r===l||U(r)!==null?!1:(Ct&&Je(r),!0)},Xo=function(r,l){if(V(C.beforeSanitizeElements,r,null),xe(r,l))return!0;if(et(r))return te(r),!0;const u=M(gt(r));if(S=Yo(C.uponSanitizeElement,S,vt,qe),V(C.uponSanitizeElement,r,{tagName:u,allowedTags:S}),xe(r,l))return!0;if(zi(r,u))return te(r),!0;if(Oe[u]||!(Q.tagCheck instanceof Function&&Q.tagCheck(u))&&!S[u]){const p=Fi(r,u,l);return p===!1&&(V(C.afterSanitizeElements,r,null),xe(r,l))?!0:p}if(_e(r)===H.element&&!Ri(r)||(u==="noscript"||u==="noembed"||u==="noframes")&&O($n,r.innerHTML))return te(r),!0;if(ee&&r.nodeType===H.text){const p=Qe(r.textContent);r.textContent!==p&&(Se(e.removed,{element:r.cloneNode()}),r.textContent=p)}return V(C.afterSanitizeElements,r,null),xe(r,l)},Zo=function(r,l,u){if(Lo[l]||Go(l,r)||Do&&(l==="id"||l==="name")&&(u in t||u in Ii))return!1;const p=A[l]||Q.attributeCheck instanceof Function&&Q.attributeCheck(l,r);return wt&&O(xi,l)||Mo&&O(ki,l)?!0:p?Fo[l]||O(Ao,Le(u,So,""))||(l==="src"||l==="xlink:href"||l==="href")&&r!=="script"&&Qt(u,"data:")===0&&No[r]||Io&&!O(Ti,Le(u,So,""))?!0:!u:Jo(r)&&tt(G.tagNameCheck,r)&&tt(G.attributeNameCheck,l,r)||l==="is"&&G.allowCustomizedBuiltInElements&&tt(G.tagNameCheck,u)},Hi=x({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Jo=function(r){return!Hi[Ae(r)]&&O(Ci,r)},Ui=function(r,l,u,p){if(z&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!u)switch(f.getAttributeType(r,l)){case"TrustedHTML":return fe(p);case"TrustedScriptURL":return mi(p)}return p},Bi=function(r,l,u,p){try{return u?r.setAttributeNS(u,l,p):r.setAttribute(l,p),et(r)?(te(r),!1):!0}catch(g){return le(l,r),!1}},Qo=function(r,l){if(V(C.beforeSanitizeAttributes,r,null),xe(r,l))return;const u=r.attributes;if(!u||et(r))return;A=Yo(C.uponSanitizeAttribute,A,Et,Ge);const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let g=u.length;const v=M(r.nodeName);for(;g--;){const w=u[g],L=w.name,W=w.namespaceURI,j=w.value,ke=M(L),Ot=j;let P=L==="value"?Ot:Cn(Ot),en=!1;if(p.attrName=ke,p.attrValue=P,p.keepAttr=!0,p.forceKeepAttr=void 0,V(C.uponSanitizeAttribute,r,p),P=p.attrValue,Oo&&(ke==="id"||ke==="name")&&Qt(P,Ro)!==0&&(le(L,r,w),P=Ro+P,en=!0),ae&&O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,P)){le(L,r,w);continue}if(ke==="attributename"&&Jt(P,"href")){le(L,r,w);continue}if(!p.forceKeepAttr){if(!p.keepAttr){le(L,r,w);continue}if(!_o&&O(Wn,P)){le(L,r,w);continue}if(ee&&(P=Qe(P)),!Zo(v,ke,P)){le(L,r,w);continue}P=Ui(v,ke,W,P),P!==Ot&&Bi(r,L,W,P)&&en&&Zt(e.removed)}}V(C.afterSanitizeAttributes,r,null),xe(r,l)},ot=function(r){let l=null;const u=Vo(r);for(V(C.beforeSanitizeShadowDOM,r,null);l=u.nextNode();)if(V(C.uponSanitizeShadowNode,l,null),Xo(l,r),Qo(l,r),we(l.content)&&ot(l.content),_e(l)===H.element){const p=pe(l);we(p)&&(Dt(p),ot(p))}V(C.afterSanitizeShadowDOM,r,null)},Dt=function(r){const l=[{node:r,shadow:null}];for(;l.length>0;){const u=l.pop();if(u.shadow){ot(u.shadow);continue}const p=u.node,g=_e(p)===H.element,v=q(p);if(v)for(let w=v.length-1;w>=0;--w)l.push({node:v[w],shadow:null});if(g){const w=me?me(p):null;if(typeof w=="string"&&M(w)==="template"){const L=p.content;we(L)&&l.push({node:L,shadow:null})}}if(g){const w=pe(p);we(w)&&l.push({node:null,shadow:w},{node:w,shadow:null})}}};return e.sanitize=function(h){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=null,u=null,p=null,g=null;if(St=!h,St&&(h="<!-->"),typeof h!="string"&&!Pe(h)&&(h=In(h),typeof h!="string"))throw Y("dirty is not a string, aborting");if(!e.isSupported)return h;xt?(S=qe,A=Ge):It(r),(C.uponSanitizeElement.length>0||C.uponSanitizeAttribute.length>0)&&(S=F(S)),C.uponSanitizeAttribute.length>0&&(A=F(A)),e.removed=[];const v=Ct&&typeof h!="string"&&Pe(h);if(v){Ni(h);const W=gt(h);if(typeof W=="string"){const j=M(W);if(!S[j]||Oe[j])throw Ze(h),Y("root node is forbidden and cannot be sanitized in-place")}if(et(h))throw Ze(h),Y("root node is clobbered and cannot be sanitized in-place");try{Dt(h)}catch(j){throw Ze(h),j}}else if(Pe(h))l=Ko("<!---->"),u=l.ownerDocument.importNode(h,!0),u.nodeType===H.element&&u.nodeName==="BODY"||u.nodeName==="HTML"?l=u:l.appendChild(u),Dt(l);else{if(!ge&&!ee&&!se&&h.indexOf("<")===-1)return z&&Ve?fe(h):h;if(l=Ko(h),!l)return ge?null:Ve?re:""}l&&kt&&te(l.firstChild);const w=v?h:l;try{const W=Vo(w);for(;p=W.nextNode();)Xo(p,w),Qo(p,w),we(p.content)&&ot(p.content)}catch(W){throw v&&(Ze(h),ne(e.removed,j=>{j.element&&Je(j.element)})),W}if(v){let W=!1;if(ne(e.removed,j=>{j.element&&(j.element===h&&(W=!0),Je(j.element))}),W)throw Y("a node selected for removal could not be safely returned; refusing to sanitize in place");return ee&&_t(h),h}if(ge){if(ee&&_t(l),Ke)for(g=gi.call(l.ownerDocument);l.firstChild;)g.appendChild(l.firstChild);else g=l;return(A.shadowroot||A.shadowrootmode)&&(g=yi.call(o,g,!0)),g}let L=se?l.outerHTML:l.innerHTML;return se&&S["!doctype"]&&l.ownerDocument&&l.ownerDocument.doctype&&l.ownerDocument.doctype.name&&O(Bn,l.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+l.ownerDocument.doctype.name+`>
|
|
525
|
-
`+L),ee&&(L=Qe(L)),z&&Ve?fe(L):L},e.setConfig=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};It(h),xt=!0,qe=S,Ge=A},e.clearConfig=function(){Ee=null,xt=!1,qe=null,Ge=null,z=bt,re=""},e.isValidAttribute=function(h,r,l){Ee||It({});const u=M(h),p=M(r);return Zo(u,p,l)},e.addHook=function(h,r){typeof r=="function"&&N(C,h)&&Se(C[h],r)},e.removeHook=function(h,r){if(N(C,h)){if(r!==void 0){const l=kn(C[h],r);return l===-1?void 0:Tn(C[h],l,1)[0]}return Zt(C[h])}},e.removeHooks=function(h){N(C,h)&&(C[h]=[])},e.removeAllHooks=function(){C=uo()},e}var He=ho();const Yn=["p","br","strong","em","u","s","strike","del","b","i","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","video","audio","table","thead","tbody","tr","th","td","blockquote","pre","code","span","div","section","figure","figcaption","sup","sub","hr"],Xn={"*":["class","style","id","data-*","role","aria-*","tabindex","contenteditable","spellcheck","dir","lang"],a:["href","target","rel","title"],img:["src","alt","width","height","loading"],video:["src","controls","width","height","autoplay","loop","muted"],audio:["src","controls","autoplay","loop","muted"],ol:["start","reversed"],table:["border","cellpadding","cellspacing"],td:["colspan","rowspan","align","valign"],th:["colspan","rowspan","align","valign"],iframe:["src","width","height","name","title","frameborder","scrolling","allowfullscreen","longdesc","allow"]},Zn="data-editora-embed";function Jn(s){if(!s||/\s/.test(s.trim()))return!1;try{const e=new URL(s.trim());return(e.protocol==="https:"||e.protocol==="http:")&&e.hostname.length>0}catch(e){return!1}}function po(s,e,t,o){if((e==null?void 0:e.sanitize)===!1)return s;const n=e!=null&&e.allowedTags&&e.allowedTags.length>0?e.allowedTags:Yn,i=t!=null&&t.length?Array.from(new Set([...n,...t])):n,c=!!(e!=null&&e.allowedAttributes)&&Object.keys(e.allowedAttributes).length>0?e.allowedAttributes:Xn,d=new Set;for(const k of Object.values(c))for(const y of k)d.add(y);const m={ALLOWED_TAGS:i,ALLOWED_ATTR:Array.from(d)};if(!o)return He.sanitize(s,m);const f=i.includes("iframe");He.addHook("uponSanitizeElement",(k,y)=>{var T;if(y.tagName!=="iframe")return;const E=k;y.allowedTags.iframe=f||((T=E.getAttribute)==null?void 0:T.call(E,Zn))==="true"&&Jn(E.getAttribute("src"))});try{return He.sanitize(s,m)}finally{He.removeHook("uponSanitizeElement")}}function mo(s,e,t,o){return po(s,e,o,!1)}function fo(s,e,t){return(t==null?void 0:t.sanitizeOnPaste)===!1?s:mo(s,e)}function ut(s,e,t,o){return(t==null?void 0:t.sanitizeOnInput)===!1?s:po(s,e,o,!0)}const Qn=".resize-handle, .table-resize-handle, [data-rte-media-pending]",ei=/resize-handle|data-rte-media-pending|rte-media/;function ht(s){if(!s||!ei.test(s))return s;const e=document.createElement("template");e.innerHTML=s;const t=new Set;return e.content.querySelectorAll(Qn).forEach(o=>{const n=o.parentElement;n&&(n.tagName==="TD"||n.tagName==="TH")&&t.add(n),o.remove()}),t.forEach(o=>{var n;o.style.position==="relative"&&(o.style.removeProperty("position"),(n=o.getAttribute("style"))!=null&&n.trim()||o.removeAttribute("style"))}),e.content.querySelectorAll("figure.rte-media").forEach(o=>{var i;o.removeAttribute("contenteditable");const n=o.querySelector(":scope > figcaption");n&&(n.removeAttribute("contenteditable"),!((i=n.textContent)!=null&&i.trim())&&!n.querySelector("img, video, a")&&n.remove())}),e.innerHTML}function he(s){return s?ht(s.innerHTML):""}const je=class je{static resolve(e){const t={};if(Object.assign(t,this.EDITOR_DEFAULTS),e.pluginDefaults&&Object.assign(t,e.pluginDefaults),e.attributes){const o=this.parseAttributes(e.attributes);Object.assign(t,o)}return e.jsConfig&&Object.assign(t,e.jsConfig),this.normalizeConfig(t)}static normalizeConfig(e){const t={...e};if(t.toolbarFloating!==void 0||t.toolbarSticky!==void 0){const a=typeof t.toolbar=="object"&&t.toolbar?{...t.toolbar}:typeof t.toolbar=="string"?{items:t.toolbar}:{};t.toolbarFloating!==void 0&&(a.floating=!!t.toolbarFloating),t.toolbarSticky!==void 0&&(a.sticky=!!t.toolbarSticky),t.toolbar=a}if(t.toolbarItems!==void 0&&typeof t.toolbar=="object"&&t.toolbar&&(t.toolbar.items=t.toolbarItems),t.autosaveEnabled!==void 0||t.autosaveIntervalMs!==void 0||t.autosaveStorageKey!==void 0||t.autosaveProvider!==void 0||t.autosaveApiUrl!==void 0){const a=typeof t.autosave=="object"&&t.autosave?{...t.autosave}:{};t.autosaveEnabled!==void 0&&(a.enabled=!!t.autosaveEnabled),t.autosaveIntervalMs!==void 0&&(a.intervalMs=Number(t.autosaveIntervalMs)),t.autosaveStorageKey!==void 0&&(a.storageKey=t.autosaveStorageKey),t.autosaveProvider!==void 0&&(a.provider=t.autosaveProvider),t.autosaveApiUrl!==void 0&&(a.apiUrl=t.autosaveApiUrl),t.autosave=a}const o={enabled:!1,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage",apiUrl:""};if(typeof t.autosave=="boolean")t.autosave={...o,enabled:t.autosave};else if(typeof t.autosave=="object"&&t.autosave){const a={...o,...t.autosave};a.intervalMs===void 0&&a.interval!==void 0&&(a.intervalMs=Number(a.interval)),a.enabled===void 0&&(a.enabled=!0),(!Number.isFinite(a.intervalMs)||a.intervalMs<=0)&&(a.intervalMs=o.intervalMs),t.autosave=a}else t.autosave=o;if(t.languageLocale!==void 0||t.languageDirection!==void 0){const a=typeof t.language=="object"&&t.language?{...t.language}:{};t.languageLocale!==void 0&&(a.locale=t.languageLocale),t.languageDirection!==void 0&&(a.direction=t.languageDirection),t.language=a}const n={locale:"en",direction:"ltr"};if(typeof t.language=="string"?t.language={locale:t.language,direction:n.direction}:typeof t.language=="object"&&t.language?t.language={...n,...t.language}:t.language=n,t.spellcheckEnabled!==void 0||t.spellcheckProvider!==void 0||t.spellcheckApiUrl!==void 0){const a=typeof t.spellcheck=="object"&&t.spellcheck?{...t.spellcheck}:{};t.spellcheckEnabled!==void 0&&(a.enabled=!!t.spellcheckEnabled),t.spellcheckProvider!==void 0&&(a.provider=t.spellcheckProvider),t.spellcheckApiUrl!==void 0&&(a.apiUrl=t.spellcheckApiUrl),t.spellcheck=a}const i={enabled:!1,provider:"browser",apiUrl:""};if(typeof t.spellcheck=="boolean")t.spellcheck={...i,enabled:t.spellcheck};else if(typeof t.spellcheck=="object"&&t.spellcheck){const a={...i,...t.spellcheck};!a.provider&&a.mode&&(a.provider=a.mode==="local"?"browser":"api"),a.enabled===void 0&&(a.enabled=!!(a.mode||a.provider||a.apiUrl)),t.spellcheck=a}else t.spellcheck=i;return t.contextMenuEnabled!==void 0&&(t.contextMenu={enabled:!!t.contextMenuEnabled}),typeof t.contextMenu=="boolean"?t.contextMenu={enabled:t.contextMenu}:typeof t.contextMenu=="object"&&t.contextMenu?t.contextMenu={enabled:t.contextMenu.enabled!==!1}:t.contextMenu={enabled:!0},(t.pasteClean!==void 0||t.pasteKeepFormatting!==void 0||t.pasteConvertWord!==void 0)&&(t.paste={...t.paste||{},...t.pasteClean!==void 0?{clean:!!t.pasteClean}:{},...t.pasteKeepFormatting!==void 0?{keepFormatting:!!t.pasteKeepFormatting}:{},...t.pasteConvertWord!==void 0?{convertWord:!!t.pasteConvertWord}:{}}),t.paste={clean:!0,keepFormatting:!1,convertWord:!0,...t.paste||{}},t.contentConfig={allowedTags:[],allowedAttributes:{},sanitize:!0,...t.contentConfig||{}},(t.securitySanitizeOnPaste!==void 0||t.securitySanitizeOnInput!==void 0)&&(t.security={...t.security||{},...t.securitySanitizeOnPaste!==void 0?{sanitizeOnPaste:!!t.securitySanitizeOnPaste}:{},...t.securitySanitizeOnInput!==void 0?{sanitizeOnInput:!!t.securitySanitizeOnInput}:{}}),t.security={sanitizeOnPaste:!0,sanitizeOnInput:!0,...t.security||{}},(t.accessibilityEnableAria!==void 0||t.accessibilityKeyboardNavigation!==void 0||t.accessibilityChecker!==void 0)&&(t.accessibility={...t.accessibility||{},...t.accessibilityEnableAria!==void 0?{enableARIA:!!t.accessibilityEnableAria}:{},...t.accessibilityKeyboardNavigation!==void 0?{keyboardNavigation:!!t.accessibilityKeyboardNavigation}:{},...t.accessibilityChecker!==void 0?{checker:!!t.accessibilityChecker}:{}}),typeof t.accessibility=="boolean"&&(t.accessibility={enableARIA:t.accessibility,keyboardNavigation:t.accessibility,checker:!1}),t.accessibility={enableARIA:!0,keyboardNavigation:!0,checker:!1,...t.accessibility||{}},(t.performanceDebounceInputMs!==void 0||t.performanceViewportOnlyScan!==void 0)&&(t.performance={...t.performance||{},...t.performanceDebounceInputMs!==void 0?{debounceInputMs:Number(t.performanceDebounceInputMs)}:{},...t.performanceViewportOnlyScan!==void 0?{viewportOnlyScan:!!t.performanceViewportOnlyScan}:{}}),typeof t.performance=="boolean"&&(t.performance={debounceInputMs:100,viewportOnlyScan:t.performance}),t.performance={debounceInputMs:100,viewportOnlyScan:!0,...t.performance||{}},(typeof t.performance.debounceInputMs!="number"||!Number.isFinite(t.performance.debounceInputMs)||t.performance.debounceInputMs<0)&&(t.performance.debounceInputMs=100),t}static parseAttributes(e){const t={};for(const[o,n]of Object.entries(e)){const i=this.kebabToCamel(o);t[i]=this.BOOLEAN_ATTRIBUTES.has(o)&&(n===""||n===o)?!0:this.parseAttributeValue(n)}return t}static parseAttributeValue(e){if(e==="true")return!0;if(e==="false")return!1;if(/^\d+$/.test(e))return parseInt(e,10);if(/^\d+\.\d+$/.test(e))return parseFloat(e);if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch(t){return e}return e}static kebabToCamel(e){return e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase())}static validate(e){const t=[];return e.height!==void 0&&typeof e.height=="number"&&e.height<0&&t.push("height must be a positive number"),e.width!==void 0&&typeof e.width=="number"&&e.width<0&&t.push("width must be a positive number"),e.plugins!==void 0&&!Array.isArray(e.plugins)&&typeof e.plugins!="string"&&t.push("plugins must be an array or string"),e.theme!==void 0&&typeof e.theme!="string"&&t.push("theme must be a string"),{valid:t.length===0,errors:t}}static getDefaults(){return{...this.EDITOR_DEFAULTS}}static merge(...e){const t={};for(const o of e)for(const[n,i]of Object.entries(o))i!=null&&(typeof i=="object"&&!Array.isArray(i)&&t[n]?t[n]=this.merge(t[n],i):t[n]=i);return t}};je.EDITOR_DEFAULTS={height:400,width:"100%",readonly:!1,disabled:!1,menubar:!0,toolbar:!0,plugins:[],theme:"light",content:"",placeholder:"Start typing...",autofocus:!1,autosave:!1,accessibility:{enableARIA:!0,keyboardNavigation:!0,checker:!1},performance:{debounceInputMs:100,viewportOnlyScan:!0},spellcheck:{enabled:!1,provider:"browser",apiUrl:""},language:{locale:"en",direction:"ltr"},contextMenu:{enabled:!0},contentConfig:{allowedTags:[],allowedAttributes:{},sanitize:!0},paste:{clean:!0,keepFormatting:!1,convertWord:!0},security:{sanitizeOnPaste:!0,sanitizeOnInput:!0},statusbar:!1},je.BOOLEAN_ATTRIBUTES=new Set(["readonly","disabled","autofocus","statusbar","toolbar-floating","toolbar-sticky","autosave-enabled","accessibility-enable-aria","accessibility-keyboard-navigation","accessibility-checker","performance-viewport-only-scan","spellcheck-enabled","context-menu-enabled","paste-clean","paste-keep-formatting","paste-convert-word","security-sanitize-on-paste","security-sanitize-on-input"]);let Ue=je;class go{constructor(){this.loadedPlugins=new Map,this.pluginRegistry=new Map}register(e,t){this.pluginRegistry.set(e,t)}async load(e,t){if(this.loadedPlugins.has(e))return this.loadedPlugins.get(e);const o=this.pluginRegistry.get(e);if(!o)return console.warn(`Plugin not found: ${e}`),null;const n=await o();return t&&this.applyPluginConfig(n,t),this.loadedPlugins.set(e,n),n}async loadMultiple(e,t){return(await Promise.all(e.map(n=>this.load(n,t)))).filter(n=>n!==null)}async parsePluginString(e,t){const o=e.split(/\s+/).filter(Boolean);return this.loadMultiple(o,t)}applyPluginConfig(e,t){e.__pluginConfig=t}unload(e){this.loadedPlugins.delete(e)}clear(){this.loadedPlugins.clear()}getLoadedPlugins(){return Array.from(this.loadedPlugins.values())}getRegisteredPluginNames(){return Array.from(this.pluginRegistry.keys())}isLoaded(e){return this.loadedPlugins.has(e)}}class bo{constructor(e={}){this.changeListeners=[],this.options=e,this.engine=new Ne({content:e.content,plugins:e.plugins||[],readonly:e.readonly}),e.onChange&&this.onChange(e.onChange),this.engine.on("change",()=>{const t=this.getHTML();this.changeListeners.forEach(o=>o(t))})}mount(e,t){this.contentElement=e,this.toolbarElement=t,this.contentElement.contentEditable=this.options.readonly?"false":"true",this.contentElement.className="rte-content",this.options.content&&(this.contentElement.innerHTML=this.options.content),this.options.toolbar!==!1&&this.toolbarElement&&(this.toolbar=new ze({items:typeof this.options.toolbar=="string"?this.options.toolbar:void 0},this.options.plugins||[]),this.toolbar.setCommandHandler((o,n)=>{this.execCommand(o,n)}),this.toolbar.render(this.toolbarElement)),this.contentElement.addEventListener("input",()=>{const o=this.getHTML();this.changeListeners.forEach(n=>n(o))}),this.options.onInit&&this.options.onInit(this.getAPI())}getHTML(){var e;return((e=this.contentElement)==null?void 0:e.innerHTML)||""}setHTML(e){this.contentElement&&(this.contentElement.innerHTML=e)}execCommand(e,t){const o=this.engine.execCommand(e,t);return this.toolbar,o}focus(){var e;(e=this.contentElement)==null||e.focus()}blur(){var e;(e=this.contentElement)==null||e.blur()}onChange(e){return this.changeListeners.push(e),()=>{const t=this.changeListeners.indexOf(e);t>-1&&this.changeListeners.splice(t,1)}}registerCommand(e,t){if(typeof window!="undefined"){const o=window.__editorCommands||new Map;o.set(e,t),window.__editorCommands=o}}getState(){return{plugins:this.options.plugins,config:this.options,engine:this.engine.getState()}}getAPI(){var e;return{getHTML:()=>this.getHTML(),setHTML:t=>this.setHTML(t),execCommand:(t,o)=>this.execCommand(t,o),focus:()=>this.focus(),blur:()=>this.blur(),destroy:()=>this.destroy(),registerCommand:(t,o)=>this.registerCommand(t,o),onChange:t=>this.onChange(t),getState:()=>this.getState(),toolbar:{items:((e=this.options.plugins)==null?void 0:e.flatMap(t=>t.toolbar||[]))||[]}}}destroy(){var e;this.engine.destroy(),(e=this.toolbar)==null||e.destroy(),this.changeListeners=[],this.options.onDestroy&&this.options.onDestroy()}}function ti(s){return new bo(s)}class yo{constructor(e){this.options=e,this.containerElement=e.element;const t=this.resolvePlugins(e.plugins);this.engine=new Ne({content:e.content,plugins:t,readonly:e.readonly}),this.initializeDOM()}resolvePlugins(e){return e?typeof e=="string"?(console.warn("String-based plugin loading not yet implemented for VanillaAdapter"),[]):e:[]}initializeDOM(){this.containerElement.innerHTML="",this.containerElement.classList.add("editora-editor"),this.options.enableToolbar!==!1&&this.options.toolbar!==!1&&(this.toolbarElement=document.createElement("div"),this.toolbarElement.className="editora-toolbar-container",this.containerElement.appendChild(this.toolbarElement),this.toolbar=new ze({items:typeof this.options.toolbar=="string"?this.options.toolbar:void 0},this.options.plugins||[]),this.toolbar.setCommandHandler((e,t)=>{this.execCommand(e,t)}),this.toolbar.render(this.toolbarElement)),this.contentElement=document.createElement("div"),this.contentElement.className="editora-content",this.contentElement.contentEditable=this.options.readonly?"false":"true",this.contentElement.style.minHeight="200px",this.contentElement.style.outline="none",this.contentElement.style.padding="12px",this.options.content&&(this.contentElement.innerHTML=this.options.content),this.containerElement.appendChild(this.contentElement),this.contentElement.addEventListener("input",()=>{this.containerElement.dispatchEvent(new CustomEvent("change",{detail:{html:this.getContent()}}))})}getContent(){var e;return((e=this.contentElement)==null?void 0:e.innerHTML)||""}setContent(e){this.contentElement&&(this.contentElement.innerHTML=e)}execCommand(e,t){return this.engine.execCommand(e,t)}focus(){var e;(e=this.contentElement)==null||e.focus()}on(e,t){const o=n=>{t(n.detail)};return this.containerElement.addEventListener(e,o),()=>{this.containerElement.removeEventListener(e,o)}}destroy(){var e;this.engine.destroy(),(e=this.toolbar)==null||e.destroy(),this.containerElement.innerHTML=""}}const oi='.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';let Be;const ni="__editoraCommandEditorRoot",ii="__editoraLastCommandButton",vo="editora-editor, [data-editora-editor], .rte-editor, .editora-editor",Eo=".rte-content, .editora-content",ri="Rich text editor",ai=new Set(["collaboration"]),pt=new Set;let Z=null,wo=!1,mt=null,ft=null;function xo(s){if(!(s instanceof HTMLElement))return!1;const e=s;return typeof e.execCommand=="function"&&(e.tagName.toLowerCase()==="editora-editor"||e.classList.contains("editora-editor")||e.hasAttribute("data-editora-editor"))}function si(s){return s?s.nodeType===Node.ELEMENT_NODE?s:s.parentElement:null}function Ie(s){if(!s)return null;if(xo(s))return s;const e=s.matches(vo)?s:s.closest(vo);return!e||!xo(e)?null:e}function li(){var n;if(typeof window=="undefined")return null;const s=window[ni];if(s instanceof HTMLElement){const i=Ie(s);if(i)return i;const a=s.matches(Eo)?s:s.querySelector(Eo);if(a){const c=Ie(a);if(c)return c}}const e=window[ii];if(e instanceof HTMLElement){const i=Ie(e);if(i)return i}const t=document.activeElement;if(t){const i=Ie(t);if(i)return i}const o=(n=window.getSelection)==null?void 0:n.call(window);if(o&&o.rangeCount>0){const i=Ie(si(o.getRangeAt(0).startContainer));if(i)return i}if(Z&&Z.isConnected)return Z;for(const i of pt)if(i.isConnected)return i;return null}function ci(){if(typeof window=="undefined"||wo)return;mt=typeof window.executeEditorCommand=="function"?window.executeEditorCommand.bind(window):null,ft=typeof window.execEditorCommand=="function"?window.execEditorCommand.bind(window):null;const s=(e,...t)=>{const o=li();return o?o.execCommand(e,...t):mt?mt(e,...t):ft?ft(e,...t):!1};window.executeEditorCommand=s,window.execEditorCommand=s,wo=!0}function di(){const s="editora-webcomponent-styles";if(!document.getElementById(s)){const e=document.createElement("style");e.id=s,e.textContent=oi,document.head.appendChild(e)}}function ui(){if(!Be){const s=J.__globalPluginLoader;s?Be=s:Be=new go}return Be}class J extends HTMLElement{constructor(){if(super(),this.pluginLoader=ui(),this.config={},this.isInitialized=!1,this.buildGeneration=0,this.keyboardShortcutManager=new Nt,this.lastAutosavedContent="",this.preservedContent=null,this.loadedPlugins=[],this.lastBeforeInputType=null,this.pendingHistorySnapshot=null,di(),!this.hasAttribute("data-initial-content")){const e=this.innerHTML.trim();e&&this.setAttribute("data-initial-content",e)}}static get observedAttributes(){return["height","width","menubar","plugins","toolbar","toolbar-items","toolbar-floating","toolbar-sticky","readonly","disabled","theme","placeholder","aria-label","autofocus","autosave","autosave-enabled","autosave-interval-ms","autosave-storage-key","autosave-provider","autosave-api-url","accessibility","accessibility-enable-aria","accessibility-keyboard-navigation","accessibility-checker","performance","performance-debounce-input-ms","performance-viewport-only-scan","language","language-locale","language-direction","spellcheck","spellcheck-enabled","spellcheck-provider","context-menu","context-menu-enabled","paste","paste-clean","paste-keep-formatting","paste-convert-word","security","security-sanitize-on-paste","security-sanitize-on-input","statusbar"]}connectedCallback(){this.config=this.resolveConfig(),this.waitForPluginLoader().then(()=>{setTimeout(async()=>{await this.initialize()},0)})}async waitForPluginLoader(){if(J.__globalPluginLoader){this.pluginLoader=J.__globalPluginLoader;return}return new Promise(e=>{const t=()=>{J.__globalPluginLoader?(this.pluginLoader=J.__globalPluginLoader,e()):setTimeout(t,0)};t()})}disconnectedCallback(){this.destroy()}attributeChangedCallback(e,t,o){t!==o&&(this.config=this.resolveConfig(),this.handleAttributeChange(e,o))}async setConfig(e){this.jsConfig=e,this.config=this.resolveConfig(),this.isConnected&&(this.destroy(),await this.waitForPluginLoader(),await this.initialize())}async initialize(){var i;if(this.querySelector(".editora-toolbar")||this.isInitialized)return;const e=++this.buildGeneration;this.setAttribute("data-editora-editor","true"),pt.add(this),Z||(Z=this),ci(),this.config.height&&(this.style.height=typeof this.config.height=="number"?`${this.config.height}px`:this.config.height),this.config.width&&(this.style.width=typeof this.config.width=="number"?`${this.config.width}px`:this.config.width),this.classList.add("editora-editor"),this.config.theme&&this.classList.add(`editora-theme-${this.config.theme}`),this.setAttribute("data-loading","true"),this.setAttribute("aria-busy","true");const t=await this.loadPlugins();if(e!==this.buildGeneration||!this.isConnected)return;if(this.loadedPlugins=t,t.forEach(a=>{if(a.init&&typeof a.init=="function")try{a.init({editorElement:this})}catch(c){console.error(`[RichTextEditor] Error initializing plugin ${a.name}:`,c)}}),!this.hasAttribute("data-initial-content")&&!this.contentElement){const a=this.innerHTML.trim();a&&this.setAttribute("data-initial-content",a)}const o=this.preservedContent;this.preservedContent=null;const n=this.sanitizeLoadedContent((i=o!=null?o:this.restoreAutosavedContent())!=null?i:this.getAttribute("data-initial-content")||"");this.engine=new Ne({content:n,plugins:t,readonly:this.config.readonly}),this.createUI(t,n),this.setupEventListeners(),this.startAutosave(),this.isInitialized=!0,this.removeAttribute("data-loading"),this.removeAttribute("aria-busy"),this.dispatchEvent(new CustomEvent("editor-ready",{detail:{api:this.getAPI()},bubbles:!0}))}getInitialContent(){if(this.config.content)return this.config.content;const e=this.querySelector("[slot]");return e?e.innerHTML:this.hasChildNodes()?Array.from(this.childNodes).map(o=>o.nodeType===Node.TEXT_NODE?o.textContent:o.nodeType===Node.ELEMENT_NODE?o.outerHTML:"").join("").trim():""}async loadPlugins(){this.pluginLoader||await this.waitForPluginLoader();const e=[],t=this.config.plugins&&(typeof this.config.plugins=="string"&&this.config.plugins.length>0||Array.isArray(this.config.plugins)&&this.config.plugins.length>0),n=this.getAccessibilityConfig().checker===!0;if(t){if(typeof this.config.plugins=="string"){const i=this.config.plugins.split(/\s+/).filter(Boolean);n&&!i.includes("a11yChecker")&&i.push("a11yChecker");for(const a of i){const c=await this.pluginLoader.load(a,this.getPluginLoadConfig(a));c&&e.push(c)}}else if(Array.isArray(this.config.plugins)){for(const i of this.config.plugins)if(typeof i=="string"){const a=await this.pluginLoader.load(i,this.getPluginLoadConfig(i));a&&e.push(a)}else e.push(i);if(n&&!e.some(i=>(i==null?void 0:i.name)==="a11yChecker")){const i=await this.pluginLoader.load("a11yChecker",this.getPluginLoadConfig("a11yChecker"));i&&e.push(i)}}}else{const i=this.pluginLoader.getRegisteredPluginNames();for(const a of i){const c=this.getPluginLoadConfig(a);if(ai.has(a)&&!c)continue;const d=await this.pluginLoader.load(a,c);d&&e.push(d)}}return e}resolveToolbarItems(){const e=this.config.toolbarItems;if(typeof e=="string")return e;if(Array.isArray(e))return e.join(" ");const t=this.config.toolbar;if(typeof t=="string")return t;if(!t||typeof t!="object")return;const o=t.items;if(typeof o=="string")return o;if(Array.isArray(o))return o.join(" ")}isToolbarStickyEnabled(){const e=this.config.toolbar;return!e||typeof e!="object"?!1:!!e.sticky}isToolbarFloatingEnabled(){const e=this.config.toolbar;return!e||typeof e!="object"?!1:!!e.floating}isStatusbarEnabled(){const e=this.config.statusbar;return typeof e=="boolean"?e:e&&typeof e=="object"?e.enabled!==!1:!1}getStatusbarPosition(){const e=this.config.statusbar;return e&&typeof e=="object"&&e.position==="top"?"top":"bottom"}getLanguageConfig(){const e=this.config.language;return typeof e=="string"?{locale:e,direction:"ltr"}:e&&typeof e=="object"?{locale:e.locale||"en",direction:e.direction==="rtl"?"rtl":"ltr"}:{locale:"en",direction:"ltr"}}getAccessibilityConfig(){const e=this.config.accessibility;return typeof e=="boolean"?{enableARIA:e,keyboardNavigation:e,checker:!1}:e&&typeof e=="object"?{enableARIA:e.enableARIA!==!1,keyboardNavigation:e.keyboardNavigation!==!1,checker:!!e.checker}:{enableARIA:!0,keyboardNavigation:!0,checker:!1}}getPerformanceConfig(){var t;const e=this.config.performance;if(typeof e=="boolean")return{debounceInputMs:100,viewportOnlyScan:e};if(e&&typeof e=="object"){const o=Number((t=e.debounceInputMs)!=null?t:100);return{debounceInputMs:Number.isFinite(o)&&o>=0?o:100,viewportOnlyScan:e.viewportOnlyScan!==!1}}return{debounceInputMs:100,viewportOnlyScan:!0}}isEditorInViewport(){if(!this.contentElement||typeof window=="undefined")return!0;const e=this.contentElement.getBoundingClientRect();return e.bottom>=0&&e.top<=window.innerHeight}applyAccessibilitySettings(){var t;if(!this.contentElement)return;const e=this.getAccessibilityConfig();if(e.enableARIA){this.contentElement.setAttribute("role","textbox"),this.contentElement.setAttribute("aria-multiline","true"),this.contentElement.setAttribute("aria-disabled",this.config.readonly?"true":"false");const o=(t=this.getAttribute("aria-label"))==null?void 0:t.trim(),n=typeof this.config.placeholder=="string"?this.config.placeholder.trim():"";this.contentElement.setAttribute("aria-label",o||n||ri)}else this.contentElement.removeAttribute("role"),this.contentElement.removeAttribute("aria-multiline"),this.contentElement.removeAttribute("aria-disabled"),this.contentElement.removeAttribute("aria-label");this.contentElement.tabIndex=e.keyboardNavigation?0:-1}applyLanguageSettings(){if(!this.contentElement)return;const e=this.getLanguageConfig();this.contentElement.setAttribute("lang",e.locale),this.contentElement.setAttribute("dir",e.direction)}getSpellcheckConfig(){const e=this.config.spellcheck;if(typeof e=="boolean")return{enabled:e,provider:"browser"};if(e&&typeof e=="object"){const t=e.provider||"browser";return{enabled:!!e.enabled,provider:t,mode:e.mode}}return{enabled:!1,provider:"browser"}}applySpellcheckSettings(){if(!this.contentElement)return;const e=this.getSpellcheckConfig(),t=e.enabled&&e.provider==="browser";this.contentElement.spellcheck=t,this.contentElement.setAttribute("spellcheck",t?"true":"false")}executeCommand(e,...t){var i;typeof window!="undefined"&&(window.__editoraCommandEditorRoot=this);const o={editorElement:this,contentElement:this.contentElement,toolbarElement:this.toolbarElement},n=this.loadedPlugins.find(a=>a.commands&&a.commands[e]);if(n&&n.commands){const a=n.commands[e];if(typeof a=="function")try{return e==="toggleFullscreen"?a(this,o):a(...t,o),!0}catch(c){return console.error(`[RichTextEditor] Error executing native command ${e}:`,c),!1}}return((i=this.engine)==null?void 0:i.execCommand(e,...t))||!1}getPluginLoadConfig(e){const t=this.config.pluginConfig;if(t&&typeof t=="object"){const i=t[e];if(i&&typeof i=="object")return i}const o={spellCheck:["spellcheck","spellCheck"],trackChanges:["trackchanges","track-changes","trackChanges"],versionDiff:["versiondiff","version-diff","versionDiff"],"version-diff":["versiondiff","version-diff","versionDiff"],conditionalContent:["conditionalcontent","conditional-content","conditionalContent"],"conditional-content":["conditionalcontent","conditional-content","conditionalContent"],dataBinding:["databinding","data-binding","dataBinding"],"data-binding":["databinding","data-binding","dataBinding"],contentRules:["contentrules","content-rules","contentRules"],"content-rules":["contentrules","content-rules","contentRules"],mentions:["mention","mentions"],mention:["mention","mentions"],slashCommands:["slashcommands","slash-commands","slashCommands"],"slash-commands":["slashcommands","slash-commands","slashCommands"],formatPainter:["formatpainter","format-painter","formatPainter"],"format-painter":["formatpainter","format-painter","formatPainter"]},n=[e,e.toLowerCase(),...o[e]||[]];for(const i of n){const a=this.config[i];if(a&&typeof a=="object"&&!Array.isArray(a))return a}}getContentSanitizeConfig(){const e=this.config.contentConfig;return e&&typeof e=="object"?e:{sanitize:!0}}getSecurityConfig(){const e=this.config.security;return e&&typeof e=="object"?e:{sanitizeOnPaste:!0,sanitizeOnInput:!0}}sanitizeLoadedContent(e){return ut(e,this.getContentSanitizeConfig(),this.getSecurityConfig())}getAutosaveConfig(){var t,o;const e=this.config.autosave;if(typeof e=="boolean")return{enabled:e,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage"};if(e&&typeof e=="object"){const n=Number((o=(t=e.intervalMs)!=null?t:e.interval)!=null?o:3e4);return{enabled:!!e.enabled,intervalMs:Number.isFinite(n)&&n>0?n:3e4,storageKey:String(e.storageKey||"rte-autosave"),provider:e.provider||"localStorage",apiUrl:e.apiUrl}}return{enabled:!1,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage"}}persistAutosave(e){const t=this.getAutosaveConfig();if(t.enabled&&e!==this.lastAutosavedContent){if(this.lastAutosavedContent=e,t.provider==="localStorage"){try{localStorage.setItem(t.storageKey,e),localStorage.setItem(`${t.storageKey}-timestamp`,Date.now().toString())}catch(o){console.error("[RichTextEditor] Failed to save autosave content to localStorage:",o)}return}t.provider==="api"&&t.apiUrl&&fetch(t.apiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,timestamp:Date.now()})}).catch(o=>{console.error("[RichTextEditor] Failed to save autosave content to API:",o)})}}restoreAutosavedContent(){const e=this.getAutosaveConfig();if(!e.enabled||e.provider!=="localStorage")return null;try{const t=localStorage.getItem(e.storageKey);if(t)return this.lastAutosavedContent=t,t}catch(t){console.error("[RichTextEditor] Failed to restore autosaved content:",t)}return null}stopAutosave(){this.autosaveTimer&&(clearInterval(this.autosaveTimer),this.autosaveTimer=void 0)}startAutosave(){this.stopAutosave();const e=this.getAutosaveConfig();!e.enabled||!this.contentElement||(this.autosaveTimer=setInterval(()=>{this.persistAutosave(he(this.contentElement))},e.intervalMs))}insertHTMLAtSelection(e){if(!this.contentElement)return;const t=window.getSelection();if(t&&t.rangeCount>0){const o=t.getRangeAt(0);o.deleteContents();const n=document.createElement("div");n.innerHTML=e;const i=document.createDocumentFragment();for(;n.firstChild;)i.appendChild(n.firstChild);o.insertNode(i),o.collapse(!1),t.removeAllRanges(),t.addRange(o)}else this.contentElement.focus(),document.execCommand("insertHTML",!1,e)}createUI(e,t){const o=this.querySelector('[slot="toolbar"]'),n=this.querySelector('[slot="statusbar"]');this.innerHTML="",this.config.toolbar!==!1&&!o?(this.toolbarElement=document.createElement("div"),this.toolbarElement.className="editora-toolbar-container",this.appendChild(this.toolbarElement),this.toolbar=new ze({items:this.resolveToolbarItems(),sticky:this.isToolbarStickyEnabled(),position:"top"},e,this.pluginLoader),this.toolbar.setCommandHandler((i,a)=>{var c;if(this.contentElement){this.contentElement.focus();const d=window.getSelection();if(!d||d.rangeCount===0||!this.contentElement.contains(d.anchorNode)){const m=document.createRange(),f=this.contentElement.lastChild||this.contentElement;f.nodeType===Node.TEXT_NODE?m.setStart(f,((c=f.textContent)==null?void 0:c.length)||0):f.nodeType===Node.ELEMENT_NODE?(m.selectNodeContents(f),m.collapse(!1)):m.setStart(this.contentElement,0),m.collapse(!0),d==null||d.removeAllRanges(),d==null||d.addRange(m)}}return this.executeCommand(i,a)}),this.toolbar.render(this.toolbarElement)):o&&this.appendChild(o),this.contentElement=document.createElement("div"),this.contentElement.className="editora-content rte-content",this.contentElement.contentEditable=this.config.readonly?"false":"true",this.applyLanguageSettings(),this.applyAccessibilitySettings(),this.applySpellcheckSettings(),this.config.placeholder&&this.contentElement.setAttribute("data-placeholder",this.config.placeholder);try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch(i){console.warn("defaultParagraphSeparator not supported:",i)}if(t){const i=document.createElement("div");i.innerHTML=t.trim(),!Array.from(i.childNodes).some(c=>{if(c.nodeType===Node.ELEMENT_NODE){const d=c.tagName;return["P","DIV","H1","H2","H3","H4","H5","H6","UL","OL","BLOCKQUOTE","PRE"].includes(d)}return!1})&&t.trim()?this.contentElement.innerHTML=`<p>${t.trim()}</p>`:this.contentElement.innerHTML=t}else this.config.placeholder?this.contentElement.innerHTML="":this.contentElement.innerHTML="<p><br></p>";this.appendChild(this.contentElement),this.isToolbarFloatingEnabled()&&(this.floatingToolbar=new Ut({enabled:!0}),this.floatingToolbar.create(this)),n?this.appendChild(n):this.isStatusbarEnabled()&&(this.statusBarElement=document.createElement("div"),this.statusBarElement.className="editora-statusbar-container",this.appendChild(this.statusBarElement),this.statusBar=new Bt({position:this.getStatusbarPosition()}),this.statusBar.create(this.statusBarElement)),this.config.autofocus&&setTimeout(()=>{var i;return(i=this.contentElement)==null?void 0:i.focus()},0)}recordInputHistory(e){const t=this.pendingHistorySnapshot;if(this.pendingHistorySnapshot=null,!t||!this.contentElement||t.beforeHTML===e)return;const o=window.execEditorCommand;typeof o=="function"&&o("recordDomTransaction",this.contentElement,t.beforeHTML,e,{inputType:t.inputType,data:t.data,selectionCollapsed:t.selectionCollapsed})}setupEventListeners(){if(!this.contentElement||!this.engine)return;const e=this.keyboardShortcutManager;this.contentElement.addEventListener("beforeinput",o=>{var n,i;this.lastBeforeInputType=o.inputType||null,o.inputType==="historyUndo"||o.inputType==="historyRedo"?this.pendingHistorySnapshot=null:this.contentElement&&(this.pendingHistorySnapshot={beforeHTML:this.contentElement.innerHTML,inputType:o.inputType||null,data:typeof o.data=="string"?o.data:null,selectionCollapsed:(i=(n=window.getSelection())==null?void 0:n.isCollapsed)!=null?i:!0})}),this.contentElement.addEventListener("input",o=>{var y;if(!this.contentElement)return;let n=this.contentElement.innerHTML;const i=(y=o==null?void 0:o.detail)==null?void 0:y.allowedTags,a=this.getPerformanceConfig(),c=this.getContentSanitizeConfig(),d=this.getSecurityConfig(),m=this.lastBeforeInputType;if(this.lastBeforeInputType=null,d.sanitizeOnInput!==!1&&c.sanitize!==!1&&!m){const E=ut(n,c,d,i);if(E!==n){const T=window.getSelection(),ie=T&&T.rangeCount>0?T.getRangeAt(0):null;if(this.contentElement.innerHTML=E,ie&&T)try{T.removeAllRanges(),T.addRange(ie)}catch(q){}n=E}}this.recordInputHistory(n),this.contentChangeDebounceTimer&&clearTimeout(this.contentChangeDebounceTimer);const k=()=>{this.dispatchEvent(new CustomEvent("content-change",{detail:{html:ht(n)},bubbles:!0}))};a.debounceInputMs>0?this.contentChangeDebounceTimer=setTimeout(k,a.debounceInputMs):k(),this.updateStatusBar()}),this.contentElement.addEventListener("contextmenu",o=>{const n=this.config.contextMenu;(n===!1||typeof n=="object"&&n!==null&&n.enabled===!1)&&o.preventDefault()}),this.contentElement.addEventListener("paste",o=>{var f,k;if(o.__editoraSmartPasteHandled===!0||o.defaultPrevented)return;o.preventDefault();const n=this.config.paste||{};let i=((f=o.clipboardData)==null?void 0:f.getData("text/html"))||"";const a=((k=o.clipboardData)==null?void 0:k.getData("text/plain"))||"",c=this.getContentSanitizeConfig(),d=this.getSecurityConfig(),m=!!i&&/class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(i);if((n.clean||!n.keepFormatting)&&a){document.execCommand("insertText",!1,a);return}if(n.convertWord===!1&&m&&a){document.execCommand("insertText",!1,a);return}if(i){d.sanitizeOnPaste!==!1&&c.sanitize!==!1&&(i=fo(i,c,d)),this.insertHTMLAtSelection(i);return}a&&document.execCommand("insertText",!1,a)}),this.contentElement.addEventListener("focus",()=>{Z=this,this.dispatchEvent(new Event("editor-focus",{bubbles:!0})),this.updateStatusBar()}),this.contentElement.addEventListener("blur",()=>{this.contentChangeDebounceTimer&&(clearTimeout(this.contentChangeDebounceTimer),this.contentChangeDebounceTimer=void 0),this.contentElement&&this.dispatchEvent(new CustomEvent("content-change",{detail:{html:he(this.contentElement)},bubbles:!0})),this.dispatchEvent(new Event("editor-blur",{bubbles:!0})),this.updateFloatingToolbar(),this.updateStatusBar()}),this.contentElement.addEventListener("keydown",o=>{this.getAccessibilityConfig().keyboardNavigation&&e.handleKeyDown(o,(i,a)=>{this.executeCommand(i,a)})});const t=()=>{const o=this.getSelectionRangeInEditor(),n=document.activeElement,i=!!n&&!!this.contentElement&&(n===this.contentElement||this.contentElement.contains(n));this.getPerformanceConfig().viewportOnlyScan&&!this.isEditorInViewport()&&!i||!o&&!i||(this.updateFloatingToolbar(),this.updateStatusBar())};this.selectionChangeHandler=t,document.addEventListener("selectionchange",this.selectionChangeHandler)}getSelectionRangeInEditor(){if(!this.contentElement)return null;const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0),o=t.commonAncestorContainer;return this.contentElement.contains(o)?t:null}isSelectionBackward(e){if(!e.anchorNode||!e.focusNode)return!1;try{const t=document.createRange();return t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.collapsed}catch(t){return!1}}getSelectionAnchorRect(e,t){const o=Array.from(t.getClientRects()).filter(i=>i.width>0||i.height>0);return o.length===0?t.getBoundingClientRect():this.isSelectionBackward(e)?o[0]:o[o.length-1]}updateFloatingToolbar(){if(!this.floatingToolbar||!this.contentElement)return;if(this.config.readonly||this.contentElement.contentEditable==="false"||this.contentElement.getAttribute("data-readonly")==="true"||this.isReadonlyAttribute(this.getAttribute("readonly"))||this.getAttribute("data-readonly")==="true"){this.floatingToolbar.hide();return}const t=this.getPerformanceConfig(),o=document.activeElement===this.contentElement||!!this.contentElement&&this.contentElement.contains(document.activeElement);if(t.viewportOnlyScan&&!this.isEditorInViewport()&&!o){this.floatingToolbar.hide();return}const n=this.getSelectionRangeInEditor();if(!n){this.floatingToolbar.hide();return}if(n.collapsed){this.floatingToolbar.hide();return}const i=window.getSelection();if(!i){this.floatingToolbar.hide();return}const a=this.getSelectionAnchorRect(i,n);if(!a){this.floatingToolbar.hide();return}this.floatingToolbar.show(a.left,a.top-40)}updateStatusBar(){if(!this.statusBar||!this.contentElement)return;const e=this.getPerformanceConfig(),t=document.activeElement===this.contentElement||this.contentElement.contains(document.activeElement);if(e.viewportOnlyScan&&!this.isEditorInViewport()&&!t)return;const o=this.contentElement.textContent||"",{words:n,chars:i}=qt(o),a=Wt(this.contentElement);let c,d;const m=this.getSelectionRangeInEditor();m&&(c=jt(this.contentElement,m),m.collapsed||(d=Gt(m,c),c=void 0)),this.statusBar.update({wordCount:n,charCount:i,lineCount:a,cursorPosition:c,selectionInfo:d})}isReadonlyAttribute(e){return e!==null&&e!=="false"}handleAttributeChange(e,t){switch(e){case"readonly":this.contentElement&&(this.contentElement.contentEditable=this.isReadonlyAttribute(t)?"false":"true",this.applyAccessibilitySettings()),this.engine&&this.engine.setReadonly(this.isReadonlyAttribute(t));break;case"theme":this.classList.forEach(o=>{o.startsWith("editora-theme-")&&this.classList.remove(o)}),t&&this.classList.add(`editora-theme-${t}`);break;case"placeholder":this.contentElement&&(this.contentElement.setAttribute("data-placeholder",t),this.applyAccessibilitySettings());break;case"aria-label":case"accessibility":case"accessibility-enable-aria":case"accessibility-keyboard-navigation":case"accessibility-checker":this.applyAccessibilitySettings();break;case"performance":case"performance-debounce-input-ms":case"performance-viewport-only-scan":break;case"language":case"language-locale":case"language-direction":this.applyLanguageSettings();break;case"spellcheck":case"spellcheck-enabled":case"spellcheck-provider":this.applySpellcheckSettings();break;case"autosave":case"autosave-enabled":case"autosave-interval-ms":case"autosave-storage-key":case"autosave-provider":case"autosave-api-url":this.startAutosave();break;case"security":case"security-sanitize-on-paste":case"security-sanitize-on-input":case"paste":case"paste-clean":case"paste-keep-formatting":case"paste-convert-word":case"context-menu":case"context-menu-enabled":break;case"toolbar":case"toolbar-items":case"toolbar-floating":case"toolbar-sticky":case"plugins":case"statusbar":this.isConnected&&(this.destroy(),this.waitForPluginLoader().then(()=>{this.initialize().catch(o=>{console.error("[RichTextEditor] Error during attribute change re-initialization:",o)})}));break}}resolveConfig(){const e={};for(let t=0;t<this.attributes.length;t++){const o=this.attributes[t];e[o.name]=o.value}return Ue.resolve({jsConfig:this.jsConfig,attributes:e})}getAPI(){return{getContent:()=>he(this.contentElement),setContent:e=>{this.contentElement&&(this.contentElement.innerHTML=this.sanitizeLoadedContent(e))},execCommand:(e,t)=>this.executeCommand(e,t),focus:()=>{var e;(e=this.contentElement)==null||e.focus()},blur:()=>{var e;(e=this.contentElement)==null||e.blur()},destroy:()=>{this.destroy()},on:(e,t)=>(this.addEventListener(e,t),()=>this.removeEventListener(e,t)),getConfig:()=>({...this.config}),setReadonly:e=>{this.setAttribute("readonly",e.toString())}}}destroy(){var e,t,o,n;this.buildGeneration+=1,this.contentChangeDebounceTimer&&(clearTimeout(this.contentChangeDebounceTimer),this.contentChangeDebounceTimer=void 0),this.contentElement&&(this.preservedContent=he(this.contentElement),this.persistAutosave(this.preservedContent)),this.stopAutosave(),this.selectionChangeHandler&&(document.removeEventListener("selectionchange",this.selectionChangeHandler),this.selectionChangeHandler=void 0),(e=this.engine)==null||e.destroy(),(t=this.toolbar)==null||t.destroy(),(o=this.floatingToolbar)==null||o.destroy(),(n=this.statusBar)==null||n.destroy(),this.innerHTML="",this.contentElement=void 0,this.toolbarElement=void 0,this.statusBarElement=void 0,this.loadedPlugins=[],this.isInitialized=!1,pt.delete(this),Z===this&&(Z=null),this.dispatchEvent(new Event("editor-destroy",{bubbles:!0}))}getContent(){return he(this.contentElement)}setContent(e){this.contentElement&&(this.contentElement.innerHTML=this.sanitizeLoadedContent(e))}execCommand(e,...t){return this.executeCommand(e,...t)}focus(){var e;(e=this.contentElement)==null||e.focus()}blur(){var e;(e=this.contentElement)==null||e.blur()}}function hi(s){return new yo(s)}function pi(){typeof window!="undefined"&&!customElements.get("editora-editor")&&customElements.define("editora-editor",J)}return b.CharacterDialog=pn,b.ColorPicker=ln,b.CommandRegistry=Ht,b.ConfigResolver=Ue,b.Dialog=oe,b.DocumentModel=Ce,b.Dropdown=sn,b.Editor=on,b.EditorEngine=Ne,b.EditorState=ce,b.EmojiDialog=mn,b.FloatingToolbar=Ut,b.ImageDialog=un,b.KeyboardShortcutManager=Nt,b.LinkDialog=cn,b.MathDialog=hn,b.MediaPlugin=an,b.PluginLoader=go,b.PluginManager=Te,b.PluginRuntime=Pt,b.ReactAdapter=bo,b.RichTextEditorElement=J,b.Schema=Rt,b.SpellcheckPlugin=rn,b.StatusBar=Bt,b.TableDialog=dn,b.ToolbarRenderer=ze,b.VanillaAdapter=yo,b.calculateTextStats=qt,b.countLines=Wt,b.createEditor=hi,b.createPluginManager=tn,b.createPluginRuntime=nn,b.createReactAdapter=ti,b.getCleanEditorHTML=he,b.getCursorPosition=jt,b.getSelectionInfo=Gt,b.getTextOffset=$t,b.initWebComponent=pi,b.sanitizeHTML=mo,b.sanitizeInputHTML=ut,b.sanitizePastedHTML=fo,b.stripEditorUiArtifacts=ht,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b})({});
|
|
524
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yn(s,e){return fn(s)||gn(s,e)||vn(s,e)||bn()}function vn(s,e){if(s){if(typeof s=="string")return Kt(s,e);var t={}.toString.call(s).slice(8,-1);return t==="Object"&&s.constructor&&(t=s.constructor.name),t==="Map"||t==="Set"?Array.from(s):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Kt(s,e):void 0}}const Vt=Object.entries,Yt=Object.setPrototypeOf,En=Object.isFrozen,wn=Object.getPrototypeOf,xn=Object.getOwnPropertyDescriptor;let _=Object.freeze,D=Object.seal,de=Object.create,Xt=typeof Reflect!="undefined"&&Reflect,nt=Xt.apply,it=Xt.construct;_||(_=function(e){return e}),D||(D=function(e){return e}),nt||(nt=function(e,t){for(var o=arguments.length,n=new Array(o>2?o-2:0),i=2;i<o;i++)n[i-2]=arguments[i];return e.apply(t,n)}),it||(it=function(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return new e(...o)});const ne=I(Array.prototype.forEach),kn=I(Array.prototype.lastIndexOf),Zt=I(Array.prototype.pop),Se=I(Array.prototype.push),Tn=I(Array.prototype.splice),ue=Array.isArray,Ae=I(String.prototype.toLowerCase),rt=I(String.prototype.toString),Jt=I(String.prototype.match),Le=I(String.prototype.replace),Qt=I(String.prototype.indexOf),Cn=I(String.prototype.trim),Sn=I(Number.prototype.toString),An=I(Boolean.prototype.toString),eo=typeof BigInt=="undefined"?null:I(BigInt.prototype.toString),to=typeof Symbol=="undefined"?null:I(Symbol.prototype.toString),N=I(Object.prototype.hasOwnProperty),Me=I(Object.prototype.toString),O=I(RegExp.prototype.test),Y=Ln(TypeError);function I(s){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];return nt(s,e,o)}}function Ln(s){return function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return it(s,t)}}function x(s,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ae;if(Yt&&Yt(s,null),!ue(e))return s;let o=e.length;for(;o--;){let n=e[o];if(typeof n=="string"){const i=t(n);i!==n&&(En(e)||(e[o]=i),n=i)}s[n]=!0}return s}function Mn(s){for(let e=0;e<s.length;e++)N(s,e)||(s[e]=null);return s}function F(s){const e=de(null);for(const o of Vt(s)){var t=yn(o,2);const n=t[0],i=t[1];N(s,n)&&(ue(i)?e[n]=Mn(i):i&&typeof i=="object"&&i.constructor===Object?e[n]=F(i):e[n]=i)}return e}function In(s){switch(typeof s){case"string":return s;case"number":return Sn(s);case"boolean":return An(s);case"bigint":return eo?eo(s):"0";case"symbol":return to?to(s):"Symbol()";case"undefined":return Me(s);case"function":case"object":{if(s===null)return Me(s);const e=s,t=$(e,"toString");if(typeof t=="function"){const o=t(e);return typeof o=="string"?o:Me(o)}return Me(s)}default:return Me(s)}}function $(s,e){for(;s!==null;){const o=xn(s,e);if(o){if(o.get)return I(o.get);if(typeof o.value=="function")return I(o.value)}s=wn(s)}function t(){return null}return t}function _n(s){try{return O(s,""),!0}catch(e){return!1}}const oo=_(["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"]),at=_(["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"]),st=_(["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"]),Dn=_(["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"]),lt=_(["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"]),On=_(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),no=_(["#text"]),io=_(["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"]),ct=_(["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"]),ro=_(["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"]),Fe=_(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Rn=D(/{{[\w\W]*|^[\w\W]*}}/g),Pn=D(/<%[\w\W]*|^[\w\W]*%>/g),Nn=D(/\${[\w\W]*/g),zn=D(/^data-[\-\w.\u00B7-\uFFFF]+$/),Fn=D(/^aria-[\-\w]+$/),ao=D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hn=D(/^(?:\w+script|data):/i),Un=D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bn=D(/^html$/i),jn=D(/^[a-z][.\w]*(-[.\w]+)+$/i),so=D(/<[/\w!]/g),lo=D(/<[/\w]/g),$n=D(/<\/no(script|embed|frames)/i),Wn=D(/\/>/i),H={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},co=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],qn=_(x({},co)),Gn=(function(){const s={};return ne(co,e=>{s[e]=D(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),_(s)})(),Kn=function(){return typeof window=="undefined"?null:window},Vn=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(o=t.getAttribute(n));const i="dompurify"+(o?"#"+o:"");try{return e.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch(a){return console.warn("TrustedTypes policy "+i+" could not be created."),null}},uo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},X=function(e,t,o,n){return N(e,t)&&ue(e[t])?x(n.base?F(n.base):{},e[t],n.transform):o},dt=function(e,t,o){const n=N(e,t)?e[t]:void 0;return n&&typeof n=="object"?F(n):o()};function ho(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Kn();const e=h=>ho(h);if(e.version="3.4.16",e.removed=[],!s||!s.document||s.document.nodeType!==H.document||!s.Element)return e.isSupported=!1,e;let t=s.document;const o=t,n=o.currentScript;s.DocumentFragment;const i=s.HTMLTemplateElement,a=s.Node,c=s.Element,d=s.NodeFilter;s.NamedNodeMap===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const m=s.DOMParser,f=s.trustedTypes,k=c.prototype,y=$(k,"cloneNode"),E=$(k,"remove"),T=$(k,"removeAttributeNode"),ie=$(k,"nextSibling"),q=$(k,"childNodes"),U=$(k,"parentNode"),pe=$(k,"shadowRoot"),B=$(k,"attributes"),R=a&&a.prototype?$(a.prototype,"nodeType"):null,me=a&&a.prototype?$(a.prototype,"nodeName"):null,$e=a&&a.prototype?$(a.prototype,"ownerDocument"):null,_e=function(r){return R?R(r):r.nodeType},gt=function(r){return me?me(r):r.nodeName};if(typeof i=="function"){const h=t.createElement("template");h.content&&h.content.ownerDocument&&(t=h.content.ownerDocument)}let z,re="",bt,ko=!1,De=0;const To=function(){if(De>0)throw Y('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.')},fe=function(r){To(),De++;try{return z.createHTML(r)}finally{De--}},fi=function(r){To(),De++;try{return z.createScriptURL(r)}finally{De--}},gi=function(){return ko||(bt=Vn(f,n),ko=!0),bt},We=t,yt=We.implementation,Co=We.createNodeIterator,bi=We.createDocumentFragment,yi=We.getElementsByTagName,vi=o.importNode;let C=uo();e.isSupported=typeof Vt=="function"&&typeof U=="function"&&yt&&yt.createHTMLDocument!==void 0;const Ei=Rn,wi=Pn,xi=Nn,ki=zn,Ti=Fn,Ci=Hn,So=Un,Si=jn;let Ao=ao,S=null;const vt=x({},[...oo,...at,...st,...lt,...no]);let A=null;const Et=x({},[...io,...ct,...ro,...Fe]);let G=Object.seal(de(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}})),Oe=null,Lo=null;const Q=Object.seal(de(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Mo=!0,wt=!0,Io=!1,_o=!0,ee=!1,ae=!0,se=!1,xt=!1,qe=null,Ge=null,kt=!1,ge=!1,Ke=!1,Ve=!1,Do=!0,Oo=!1;const Ro="user-content-";let Tt=!0,Ct=!1,be={},ye=null;const Po=x({},["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 No=null;const zo=x({},["audio","video","img","source","image","track"]);let Fo=null;const Ho=x({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",K="http://www.w3.org/1999/xhtml";let ve=K,St=!1,At=null;const Ai=x({},[Ye,Xe,K],rt),Uo=_(["mi","mo","mn","ms","mtext"]);let Lt=x({},Uo);const Bo=_(["annotation-xml"]);let Mt=x({},Bo);const Li=x({},["title","style","font","a","script"]);let Re=null;const Mi=["application/xhtml+xml","text/html"],Ii="text/html";let M=null,Ee=null;const _i=t.createElement("form"),jo=function(r){return r instanceof RegExp||r instanceof Function},It=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ee&&Ee===r)return;(!r||typeof r!="object")&&(r={}),r=F(r),Re=Mi.indexOf(r.PARSER_MEDIA_TYPE)===-1?Ii:r.PARSER_MEDIA_TYPE,M=Re==="application/xhtml+xml"?rt:Ae,S=X(r,"ALLOWED_TAGS",vt,{transform:M}),A=X(r,"ALLOWED_ATTR",Et,{transform:M}),At=X(r,"ALLOWED_NAMESPACES",Ai,{transform:rt}),Fo=X(r,"ADD_URI_SAFE_ATTR",Ho,{transform:M,base:Ho}),No=X(r,"ADD_DATA_URI_TAGS",zo,{transform:M,base:zo}),ye=X(r,"FORBID_CONTENTS",Po,{transform:M}),Oe=X(r,"FORBID_TAGS",F({}),{transform:M}),Lo=X(r,"FORBID_ATTR",F({}),{transform:M}),be=N(r,"USE_PROFILES")?r.USE_PROFILES&&typeof r.USE_PROFILES=="object"?F(r.USE_PROFILES):r.USE_PROFILES:!1,Mo=r.ALLOW_ARIA_ATTR!==!1,wt=r.ALLOW_DATA_ATTR!==!1,Io=r.ALLOW_UNKNOWN_PROTOCOLS||!1,_o=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ee=r.SAFE_FOR_TEMPLATES||!1,ae=r.SAFE_FOR_XML!==!1,se=r.WHOLE_DOCUMENT||!1,ge=r.RETURN_DOM||!1,Ke=r.RETURN_DOM_FRAGMENT||!1,Ve=r.RETURN_TRUSTED_TYPE||!1,kt=r.FORCE_BODY||!1,Do=r.SANITIZE_DOM!==!1,Oo=r.SANITIZE_NAMED_PROPS||!1,Tt=r.KEEP_CONTENT!==!1,Ct=r.IN_PLACE||!1,Ao=_n(r.ALLOWED_URI_REGEXP)?r.ALLOWED_URI_REGEXP:ao,ve=typeof r.NAMESPACE=="string"?r.NAMESPACE:K,Lt=dt(r,"MATHML_TEXT_INTEGRATION_POINTS",()=>x({},Uo)),Mt=dt(r,"HTML_INTEGRATION_POINTS",()=>x({},Bo));const l=dt(r,"CUSTOM_ELEMENT_HANDLING",()=>de(null));if(G=de(null),N(l,"tagNameCheck")&&jo(l.tagNameCheck)&&(G.tagNameCheck=l.tagNameCheck),N(l,"attributeNameCheck")&&jo(l.attributeNameCheck)&&(G.attributeNameCheck=l.attributeNameCheck),N(l,"allowCustomizedBuiltInElements")&&typeof l.allowCustomizedBuiltInElements=="boolean"&&(G.allowCustomizedBuiltInElements=l.allowCustomizedBuiltInElements),D(G),ee&&(wt=!1),Ke&&(ge=!0),be&&(S=x({},no),A=de(null),be.html===!0&&(x(S,oo),x(A,io)),be.svg===!0&&(x(S,at),x(A,ct),x(A,Fe)),be.svgFilters===!0&&(x(S,st),x(A,ct),x(A,Fe)),be.mathMl===!0&&(x(S,lt),x(A,ro),x(A,Fe))),Q.tagCheck=null,Q.attributeCheck=null,N(r,"ADD_TAGS")&&(typeof r.ADD_TAGS=="function"?Q.tagCheck=r.ADD_TAGS:ue(r.ADD_TAGS)&&(S===vt&&(S=F(S)),x(S,r.ADD_TAGS,M))),N(r,"ADD_ATTR")&&(typeof r.ADD_ATTR=="function"?Q.attributeCheck=r.ADD_ATTR:ue(r.ADD_ATTR)&&(A===Et&&(A=F(A)),x(A,r.ADD_ATTR,M))),N(r,"ADD_FORBID_CONTENTS")&&ue(r.ADD_FORBID_CONTENTS)&&(ye===Po&&(ye=F(ye)),x(ye,r.ADD_FORBID_CONTENTS,M)),Tt&&(S["#text"]=!0),se&&x(S,["html","head","body"]),S.table&&(x(S,["tbody"]),delete Oe.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw Y('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Y('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const u=z;z=r.TRUSTED_TYPES_POLICY;try{re=fe("")}catch(p){throw z=u,p}}else r.TRUSTED_TYPES_POLICY===null?(z=void 0,re=""):(z===void 0&&(z=gi()),z&&typeof re=="string"&&(re=fe("")));_&&_(r),Ee=r},$o=x({},[...at,...st,...Dn]),Wo=x({},[...lt,...On]),Di=function(r,l,u){return l.namespaceURI===K?r==="svg":l.namespaceURI===Ye?r==="svg"&&(u==="annotation-xml"||Lt[u]):!!$o[r]},Oi=function(r,l,u){return l.namespaceURI===K?r==="math":l.namespaceURI===Xe?r==="math"&&Mt[u]:!!Wo[r]},Ri=function(r,l,u){return l.namespaceURI===Xe&&!Mt[u]||l.namespaceURI===Ye&&!Lt[u]?!1:!Wo[r]&&(Li[r]||!$o[r])},Pi=function(r){let l=U(r);(!l||!l.tagName)&&(l={namespaceURI:ve,tagName:"template"});const u=Ae(r.tagName),p=Ae(l.tagName);return At[r.namespaceURI]?r.namespaceURI===Xe?Di(u,l,p):r.namespaceURI===Ye?Oi(u,l,p):r.namespaceURI===K?Ri(u,l,p):!!(Re==="application/xhtml+xml"&&At[r.namespaceURI]):!1},te=function(r){Se(e.removed,{element:r});try{U(r).removeChild(r)}catch(l){if(E(r),!U(r))throw Y("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},qo=function(r,l,u){try{T(r,l)}catch(p){try{r.removeAttribute(u)}catch(g){}}},Ze=function(r){Je(r);const l=q(r);if(l){const p=[];ne(l,g=>{Se(p,g)}),ne(p,g=>{try{E(g)}catch(v){}})}const u=B(r);if(u)for(let p=u.length-1;p>=0;--p){const g=u[p],v=g&&g.name;typeof v=="string"&&qo(r,g,v)}},le=function(r,l,u){if(!u)try{u=l.getAttributeNode(r)}catch(p){u=null}Se(e.removed,{attribute:u||null,from:l});try{u?T(l,u):l.removeAttribute(r)}catch(p){try{l.removeAttribute(r)}catch(g){}}if(r==="is")if(ge||Ke)try{te(l)}catch(p){}else try{l.setAttribute(r,"")}catch(p){}},Ni=function(r){const l=B(r);if(l)for(let u=l.length-1;u>=0;--u){const p=l[u],g=p&&p.name;typeof g!="string"||A[M(g)]||qo(r,p,g)}},Je=function(r){const l=[r];for(;l.length>0;){const u=l.pop();_e(u)===H.element&&Ni(u);const p=q(u);if(p)for(let g=p.length-1;g>=0;--g)l.push(p[g])}},Go=function(r,l){return ae?r==="patchsrc"?!0:r==="for"&&l!=="label"&&l!=="output":!1},zi=function(r){if(!ae)return;const l=[r];for(;l.length>0;){const u=l.pop(),p=_e(u);if(p===H.processingInstruction||p===H.comment&&O(lo,u.data)){try{E(u)}catch(v){}continue}if(p===H.element){const v=u,w=M(gt(u));try{v.hasAttribute&&v.hasAttribute("patchsrc")&&v.removeAttribute("patchsrc"),v.hasAttribute&&v.hasAttribute("for")&&Go("for",w)&&v.removeAttribute("for")}catch(L){}}const g=q(u);if(g)for(let v=g.length-1;v>=0;--v)l.push(g[v])}},Ko=function(r){let l=null,u=null;if(kt)r="<remove></remove>"+r;else{const v=Jt(r,/^[\r\n\t ]+/);u=v&&v[0]}Re==="application/xhtml+xml"&&ve===K&&(r='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+r+"</body></html>");const p=z?fe(r):r;if(ve===K)try{l=new m().parseFromString(p,Re)}catch(v){}if(!l||!l.documentElement){l=yt.createDocument(ve,"template",null);try{l.documentElement.innerHTML=St?re:p}catch(v){}}const g=l.body||l.documentElement;return r&&u&&g.insertBefore(t.createTextNode(u),g.childNodes[0]||null),ve===K?yi.call(l,se?"html":"body")[0]:se?l.documentElement:g},Vo=function(r){const l=$e?$e(r):r.ownerDocument;return Co.call(l||r,r,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Qe=function(r){return r=Le(r,Ei," "),r=Le(r,wi," "),r=Le(r,xi," "),r},_t=function(r){var l;r.normalize();const u=$e?$e(r):r.ownerDocument,p=Co.call(u||r,r,d.SHOW_TEXT|d.SHOW_COMMENT|d.SHOW_CDATA_SECTION|d.SHOW_PROCESSING_INSTRUCTION,null);let g=p.nextNode();for(;g;)g.data=Qe(g.data),g=p.nextNode();const v=(l=r.querySelectorAll)===null||l===void 0?void 0:l.call(r,"template");v&&ne(v,w=>{we(w.content)&&_t(w.content)})},et=function(r){const l=me?me(r):null;return typeof l!="string"||M(l)!=="form"?!1:typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||r.attributes!==B(r)||typeof r.removeAttribute!="function"||typeof r.removeAttributeNode!="function"||typeof r.getAttributeNode!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function"||r.nodeType!==R(r)||r.childNodes!==q(r)},we=function(r){if(!R||typeof r!="object"||r===null)return!1;try{return R(r)===H.documentFragment}catch(l){return!1}},Pe=function(r){if(!R||typeof r!="object"||r===null)return!1;try{return typeof R(r)=="number"}catch(l){return!1}};function V(h,r,l){h.length!==0&&ne(h,u=>{u.call(e,r,l,Ee)})}const Fi=function(r,l){return!!(ae&&r.hasChildNodes()&&!Pe(r.firstElementChild)&&O(so,r.textContent)&&O(so,r.innerHTML)||ae&&r.namespaceURI===K&&qn[l]&&(Pe(r.firstElementChild)||typeof r.textContent=="string"&&O(Gn[l],r.textContent))||r.nodeType===H.processingInstruction||ae&&r.nodeType===H.comment&&O(lo,r.data))},tt=function(r,l){if(r instanceof RegExp)return O(r,l);if(r instanceof Function){for(var u=arguments.length,p=new Array(u>2?u-2:0),g=2;g<u;g++)p[g-2]=arguments[g];return!!r(l,...p)}return!1},Hi=function(r,l,u){if(!Oe[l]&&Jo(l)&&tt(G.tagNameCheck,l))return!1;if(Tt&&!ye[l]){const p=U(r),g=q(r);if(g&&p){const v=g.length;for(let w=v-1;w>=0;--w){const L=r===u?y(g[w],!0):g[w];p.insertBefore(L,ie(r))}}}return te(r),!0},Yo=function(r,l,u,p){return r.length===0?l:l===u||l===p?F(l):l},xe=function(r,l){return r===l||U(r)!==null?!1:(Ct&&Je(r),!0)},Xo=function(r,l){if(V(C.beforeSanitizeElements,r,null),xe(r,l))return!0;if(et(r))return te(r),!0;const u=M(gt(r));if(S=Yo(C.uponSanitizeElement,S,vt,qe),V(C.uponSanitizeElement,r,{tagName:u,allowedTags:S}),xe(r,l))return!0;if(Fi(r,u))return te(r),!0;if(Oe[u]||!(Q.tagCheck instanceof Function&&Q.tagCheck(u))&&!S[u]){const p=Hi(r,u,l);return p===!1&&(V(C.afterSanitizeElements,r,null),xe(r,l))?!0:p}if(_e(r)===H.element&&!Pi(r)||(u==="noscript"||u==="noembed"||u==="noframes")&&O($n,r.innerHTML))return te(r),!0;if(ee&&r.nodeType===H.text){const p=Qe(r.textContent);r.textContent!==p&&(Se(e.removed,{element:r.cloneNode()}),r.textContent=p)}return V(C.afterSanitizeElements,r,null),xe(r,l)},Zo=function(r,l,u){if(Lo[l]||Go(l,r)||Do&&(l==="id"||l==="name")&&(u in t||u in _i))return!1;const p=A[l]||Q.attributeCheck instanceof Function&&Q.attributeCheck(l,r);return wt&&O(ki,l)||Mo&&O(Ti,l)?!0:p?Fo[l]||O(Ao,Le(u,So,""))||(l==="src"||l==="xlink:href"||l==="href")&&r!=="script"&&Qt(u,"data:")===0&&No[r]||Io&&!O(Ci,Le(u,So,""))?!0:!u:Jo(r)&&tt(G.tagNameCheck,r)&&tt(G.attributeNameCheck,l,r)||l==="is"&&G.allowCustomizedBuiltInElements&&tt(G.tagNameCheck,u)},Ui=x({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Jo=function(r){return!Ui[Ae(r)]&&O(Si,r)},Bi=function(r,l,u,p){if(z&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!u)switch(f.getAttributeType(r,l)){case"TrustedHTML":return fe(p);case"TrustedScriptURL":return fi(p)}return p},ji=function(r,l,u,p){try{return u?r.setAttributeNS(u,l,p):r.setAttribute(l,p),et(r)?(te(r),!1):!0}catch(g){return le(l,r),!1}},Qo=function(r,l){if(V(C.beforeSanitizeAttributes,r,null),xe(r,l))return;const u=r.attributes;if(!u||et(r))return;A=Yo(C.uponSanitizeAttribute,A,Et,Ge);const p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let g=u.length;const v=M(r.nodeName);for(;g--;){const w=u[g],L=w.name,W=w.namespaceURI,j=w.value,ke=M(L),Ot=j;let P=L==="value"?Ot:Cn(Ot),en=!1;if(p.attrName=ke,p.attrValue=P,p.keepAttr=!0,p.forceKeepAttr=void 0,V(C.uponSanitizeAttribute,r,p),P=p.attrValue,Oo&&(ke==="id"||ke==="name")&&Qt(P,Ro)!==0&&(le(L,r,w),P=Ro+P,en=!0),ae&&O(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,P)){le(L,r,w);continue}if(ke==="attributename"&&Jt(P,"href")){le(L,r,w);continue}if(!p.forceKeepAttr){if(!p.keepAttr){le(L,r,w);continue}if(!_o&&O(Wn,P)){le(L,r,w);continue}if(ee&&(P=Qe(P)),!Zo(v,ke,P)){le(L,r,w);continue}P=Bi(v,ke,W,P),P!==Ot&&ji(r,L,W,P)&&en&&Zt(e.removed)}}V(C.afterSanitizeAttributes,r,null),xe(r,l)},ot=function(r){let l=null;const u=Vo(r);for(V(C.beforeSanitizeShadowDOM,r,null);l=u.nextNode();)if(V(C.uponSanitizeShadowNode,l,null),Xo(l,r),Qo(l,r),we(l.content)&&ot(l.content),_e(l)===H.element){const p=pe(l);we(p)&&(Dt(p),ot(p))}V(C.afterSanitizeShadowDOM,r,null)},Dt=function(r){const l=[{node:r,shadow:null}];for(;l.length>0;){const u=l.pop();if(u.shadow){ot(u.shadow);continue}const p=u.node,g=_e(p)===H.element,v=q(p);if(v)for(let w=v.length-1;w>=0;--w)l.push({node:v[w],shadow:null});if(g){const w=me?me(p):null;if(typeof w=="string"&&M(w)==="template"){const L=p.content;we(L)&&l.push({node:L,shadow:null})}}if(g){const w=pe(p);we(w)&&l.push({node:null,shadow:w},{node:w,shadow:null})}}};return e.sanitize=function(h){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=null,u=null,p=null,g=null;if(St=!h,St&&(h="<!-->"),typeof h!="string"&&!Pe(h)&&(h=In(h),typeof h!="string"))throw Y("dirty is not a string, aborting");if(!e.isSupported)return h;xt?(S=qe,A=Ge):It(r),(C.uponSanitizeElement.length>0||C.uponSanitizeAttribute.length>0)&&(S=F(S)),C.uponSanitizeAttribute.length>0&&(A=F(A)),e.removed=[];const v=Ct&&typeof h!="string"&&Pe(h);if(v){zi(h);const W=gt(h);if(typeof W=="string"){const j=M(W);if(!S[j]||Oe[j])throw Ze(h),Y("root node is forbidden and cannot be sanitized in-place")}if(et(h))throw Ze(h),Y("root node is clobbered and cannot be sanitized in-place");try{Dt(h)}catch(j){throw Ze(h),j}}else if(Pe(h))l=Ko("<!---->"),u=l.ownerDocument.importNode(h,!0),u.nodeType===H.element&&u.nodeName==="BODY"||u.nodeName==="HTML"?l=u:l.appendChild(u),Dt(l);else{if(!ge&&!ee&&!se&&h.indexOf("<")===-1)return z&&Ve?fe(h):h;if(l=Ko(h),!l)return ge?null:Ve?re:""}l&&kt&&te(l.firstChild);const w=v?h:l;try{const W=Vo(w);for(;p=W.nextNode();)Xo(p,w),Qo(p,w),we(p.content)&&ot(p.content)}catch(W){throw v&&(Ze(h),ne(e.removed,j=>{j.element&&Je(j.element)})),W}if(v){let W=!1;if(ne(e.removed,j=>{j.element&&(j.element===h&&(W=!0),Je(j.element))}),W)throw Y("a node selected for removal could not be safely returned; refusing to sanitize in place");return ee&&_t(h),h}if(ge){if(ee&&_t(l),Ke)for(g=bi.call(l.ownerDocument);l.firstChild;)g.appendChild(l.firstChild);else g=l;return(A.shadowroot||A.shadowrootmode)&&(g=vi.call(o,g,!0)),g}let L=se?l.outerHTML:l.innerHTML;return se&&S["!doctype"]&&l.ownerDocument&&l.ownerDocument.doctype&&l.ownerDocument.doctype.name&&O(Bn,l.ownerDocument.doctype.name)&&(L="<!DOCTYPE "+l.ownerDocument.doctype.name+`>
|
|
525
|
+
`+L),ee&&(L=Qe(L)),z&&Ve?fe(L):L},e.setConfig=function(){let h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};It(h),xt=!0,qe=S,Ge=A},e.clearConfig=function(){Ee=null,xt=!1,qe=null,Ge=null,z=bt,re=""},e.isValidAttribute=function(h,r,l){Ee||It({});const u=M(h),p=M(r);return Zo(u,p,l)},e.addHook=function(h,r){typeof r=="function"&&N(C,h)&&Se(C[h],r)},e.removeHook=function(h,r){if(N(C,h)){if(r!==void 0){const l=kn(C[h],r);return l===-1?void 0:Tn(C[h],l,1)[0]}return Zt(C[h])}},e.removeHooks=function(h){N(C,h)&&(C[h]=[])},e.removeAllHooks=function(){C=uo()},e}var He=ho();const Yn=["p","br","strong","em","u","s","strike","del","b","i","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","video","audio","table","thead","tbody","tr","th","td","blockquote","pre","code","span","div","section","figure","figcaption","sup","sub","hr"],Xn={"*":["class","style","id","data-*","role","aria-*","tabindex","contenteditable","spellcheck","dir","lang"],a:["href","target","rel","title"],img:["src","alt","width","height","loading"],video:["src","controls","width","height","autoplay","loop","muted"],audio:["src","controls","autoplay","loop","muted"],ol:["start","reversed"],table:["border","cellpadding","cellspacing"],td:["colspan","rowspan","align","valign"],th:["colspan","rowspan","align","valign"],iframe:["src","width","height","name","title","frameborder","scrolling","allowfullscreen","longdesc","allow"]},Zn="data-editora-embed";function Jn(s){if(!s||/\s/.test(s.trim()))return!1;try{const e=new URL(s.trim());return(e.protocol==="https:"||e.protocol==="http:")&&e.hostname.length>0}catch(e){return!1}}function po(s,e,t,o){if((e==null?void 0:e.sanitize)===!1)return s;const n=e!=null&&e.allowedTags&&e.allowedTags.length>0?e.allowedTags:Yn,i=t!=null&&t.length?Array.from(new Set([...n,...t])):n,c=!!(e!=null&&e.allowedAttributes)&&Object.keys(e.allowedAttributes).length>0?e.allowedAttributes:Xn,d=new Set;for(const k of Object.values(c))for(const y of k)d.add(y);const m={ALLOWED_TAGS:i,ALLOWED_ATTR:Array.from(d)};if(!o)return He.sanitize(s,m);const f=i.includes("iframe");He.addHook("uponSanitizeElement",(k,y)=>{var T;if(y.tagName!=="iframe")return;const E=k;y.allowedTags.iframe=f||((T=E.getAttribute)==null?void 0:T.call(E,Zn))==="true"&&Jn(E.getAttribute("src"))});try{return He.sanitize(s,m)}finally{He.removeHook("uponSanitizeElement")}}function mo(s,e,t,o){return po(s,e,o,!1)}function fo(s,e,t){return(t==null?void 0:t.sanitizeOnPaste)===!1?s:mo(s,e)}function ut(s,e,t,o){return(t==null?void 0:t.sanitizeOnInput)===!1?s:po(s,e,o,!0)}const Qn=".resize-handle, .table-resize-handle, [data-rte-media-pending]",ei=/resize-handle|data-rte-media-pending|rte-media/;function ht(s){if(!s||!ei.test(s))return s;const e=document.createElement("template");e.innerHTML=s;const t=new Set;return e.content.querySelectorAll(Qn).forEach(o=>{const n=o.parentElement;n&&(n.tagName==="TD"||n.tagName==="TH")&&t.add(n),o.remove()}),t.forEach(o=>{var n;o.style.position==="relative"&&(o.style.removeProperty("position"),(n=o.getAttribute("style"))!=null&&n.trim()||o.removeAttribute("style"))}),e.content.querySelectorAll("figure.rte-media").forEach(o=>{var i;o.removeAttribute("contenteditable");const n=o.querySelector(":scope > figcaption");n&&(n.removeAttribute("contenteditable"),!((i=n.textContent)!=null&&i.trim())&&!n.querySelector("img, video, a")&&n.remove())}),e.innerHTML}function he(s){return s?ht(s.innerHTML):""}const je=class je{static resolve(e){const t={};if(Object.assign(t,this.EDITOR_DEFAULTS),e.pluginDefaults&&Object.assign(t,e.pluginDefaults),e.attributes){const o=this.parseAttributes(e.attributes);Object.assign(t,o)}return e.jsConfig&&Object.assign(t,e.jsConfig),this.normalizeConfig(t)}static normalizeConfig(e){const t={...e};if(t.toolbarFloating!==void 0||t.toolbarSticky!==void 0){const a=typeof t.toolbar=="object"&&t.toolbar?{...t.toolbar}:typeof t.toolbar=="string"?{items:t.toolbar}:{};t.toolbarFloating!==void 0&&(a.floating=!!t.toolbarFloating),t.toolbarSticky!==void 0&&(a.sticky=!!t.toolbarSticky),t.toolbar=a}if(t.toolbarItems!==void 0&&typeof t.toolbar=="object"&&t.toolbar&&(t.toolbar.items=t.toolbarItems),t.autosaveEnabled!==void 0||t.autosaveIntervalMs!==void 0||t.autosaveStorageKey!==void 0||t.autosaveProvider!==void 0||t.autosaveApiUrl!==void 0){const a=typeof t.autosave=="object"&&t.autosave?{...t.autosave}:{};t.autosaveEnabled!==void 0&&(a.enabled=!!t.autosaveEnabled),t.autosaveIntervalMs!==void 0&&(a.intervalMs=Number(t.autosaveIntervalMs)),t.autosaveStorageKey!==void 0&&(a.storageKey=t.autosaveStorageKey),t.autosaveProvider!==void 0&&(a.provider=t.autosaveProvider),t.autosaveApiUrl!==void 0&&(a.apiUrl=t.autosaveApiUrl),t.autosave=a}const o={enabled:!1,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage",apiUrl:""};if(typeof t.autosave=="boolean")t.autosave={...o,enabled:t.autosave};else if(typeof t.autosave=="object"&&t.autosave){const a={...o,...t.autosave};a.intervalMs===void 0&&a.interval!==void 0&&(a.intervalMs=Number(a.interval)),a.enabled===void 0&&(a.enabled=!0),(!Number.isFinite(a.intervalMs)||a.intervalMs<=0)&&(a.intervalMs=o.intervalMs),t.autosave=a}else t.autosave=o;if(t.languageLocale!==void 0||t.languageDirection!==void 0){const a=typeof t.language=="object"&&t.language?{...t.language}:{};t.languageLocale!==void 0&&(a.locale=t.languageLocale),t.languageDirection!==void 0&&(a.direction=t.languageDirection),t.language=a}const n={locale:"en",direction:"ltr"};if(typeof t.language=="string"?t.language={locale:t.language,direction:n.direction}:typeof t.language=="object"&&t.language?t.language={...n,...t.language}:t.language=n,t.spellcheckEnabled!==void 0||t.spellcheckProvider!==void 0||t.spellcheckApiUrl!==void 0){const a=typeof t.spellcheck=="object"&&t.spellcheck?{...t.spellcheck}:{};t.spellcheckEnabled!==void 0&&(a.enabled=!!t.spellcheckEnabled),t.spellcheckProvider!==void 0&&(a.provider=t.spellcheckProvider),t.spellcheckApiUrl!==void 0&&(a.apiUrl=t.spellcheckApiUrl),t.spellcheck=a}const i={enabled:!1,provider:"browser",apiUrl:""};if(typeof t.spellcheck=="boolean")t.spellcheck={...i,enabled:t.spellcheck};else if(typeof t.spellcheck=="object"&&t.spellcheck){const a={...i,...t.spellcheck};!a.provider&&a.mode&&(a.provider=a.mode==="local"?"browser":"api"),a.enabled===void 0&&(a.enabled=!!(a.mode||a.provider||a.apiUrl)),t.spellcheck=a}else t.spellcheck=i;return t.contextMenuEnabled!==void 0&&(t.contextMenu={enabled:!!t.contextMenuEnabled}),typeof t.contextMenu=="boolean"?t.contextMenu={enabled:t.contextMenu}:typeof t.contextMenu=="object"&&t.contextMenu?t.contextMenu={enabled:t.contextMenu.enabled!==!1}:t.contextMenu={enabled:!0},(t.pasteClean!==void 0||t.pasteKeepFormatting!==void 0||t.pasteConvertWord!==void 0)&&(t.paste={...t.paste||{},...t.pasteClean!==void 0?{clean:!!t.pasteClean}:{},...t.pasteKeepFormatting!==void 0?{keepFormatting:!!t.pasteKeepFormatting}:{},...t.pasteConvertWord!==void 0?{convertWord:!!t.pasteConvertWord}:{}}),t.paste={clean:!0,keepFormatting:!1,convertWord:!0,...t.paste||{}},t.contentConfig={allowedTags:[],allowedAttributes:{},sanitize:!0,...t.contentConfig||{}},(t.securitySanitizeOnPaste!==void 0||t.securitySanitizeOnInput!==void 0)&&(t.security={...t.security||{},...t.securitySanitizeOnPaste!==void 0?{sanitizeOnPaste:!!t.securitySanitizeOnPaste}:{},...t.securitySanitizeOnInput!==void 0?{sanitizeOnInput:!!t.securitySanitizeOnInput}:{}}),t.security={sanitizeOnPaste:!0,sanitizeOnInput:!0,...t.security||{}},(t.accessibilityEnableAria!==void 0||t.accessibilityKeyboardNavigation!==void 0||t.accessibilityChecker!==void 0)&&(t.accessibility={...t.accessibility||{},...t.accessibilityEnableAria!==void 0?{enableARIA:!!t.accessibilityEnableAria}:{},...t.accessibilityKeyboardNavigation!==void 0?{keyboardNavigation:!!t.accessibilityKeyboardNavigation}:{},...t.accessibilityChecker!==void 0?{checker:!!t.accessibilityChecker}:{}}),typeof t.accessibility=="boolean"&&(t.accessibility={enableARIA:t.accessibility,keyboardNavigation:t.accessibility,checker:!1}),t.accessibility={enableARIA:!0,keyboardNavigation:!0,checker:!1,...t.accessibility||{}},(t.performanceDebounceInputMs!==void 0||t.performanceViewportOnlyScan!==void 0)&&(t.performance={...t.performance||{},...t.performanceDebounceInputMs!==void 0?{debounceInputMs:Number(t.performanceDebounceInputMs)}:{},...t.performanceViewportOnlyScan!==void 0?{viewportOnlyScan:!!t.performanceViewportOnlyScan}:{}}),typeof t.performance=="boolean"&&(t.performance={debounceInputMs:100,viewportOnlyScan:t.performance}),t.performance={debounceInputMs:100,viewportOnlyScan:!0,...t.performance||{}},(typeof t.performance.debounceInputMs!="number"||!Number.isFinite(t.performance.debounceInputMs)||t.performance.debounceInputMs<0)&&(t.performance.debounceInputMs=100),t}static parseAttributes(e){const t={};for(const[o,n]of Object.entries(e)){const i=this.kebabToCamel(o);t[i]=this.BOOLEAN_ATTRIBUTES.has(o)&&(n===""||n===o)?!0:this.parseAttributeValue(n)}return t}static parseAttributeValue(e){if(e==="true")return!0;if(e==="false")return!1;if(/^\d+$/.test(e))return parseInt(e,10);if(/^\d+\.\d+$/.test(e))return parseFloat(e);if(e.startsWith("{")||e.startsWith("["))try{return JSON.parse(e)}catch(t){return e}return e}static kebabToCamel(e){return e.replace(/-([a-z])/g,(t,o)=>o.toUpperCase())}static validate(e){const t=[];return e.height!==void 0&&typeof e.height=="number"&&e.height<0&&t.push("height must be a positive number"),e.width!==void 0&&typeof e.width=="number"&&e.width<0&&t.push("width must be a positive number"),e.plugins!==void 0&&!Array.isArray(e.plugins)&&typeof e.plugins!="string"&&t.push("plugins must be an array or string"),e.theme!==void 0&&typeof e.theme!="string"&&t.push("theme must be a string"),{valid:t.length===0,errors:t}}static getDefaults(){return{...this.EDITOR_DEFAULTS}}static merge(...e){const t={};for(const o of e)for(const[n,i]of Object.entries(o))i!=null&&(typeof i=="object"&&!Array.isArray(i)&&t[n]?t[n]=this.merge(t[n],i):t[n]=i);return t}};je.EDITOR_DEFAULTS={height:400,width:"100%",readonly:!1,disabled:!1,menubar:!0,toolbar:!0,plugins:[],theme:"light",content:"",placeholder:"Start typing...",autofocus:!1,autosave:!1,accessibility:{enableARIA:!0,keyboardNavigation:!0,checker:!1},performance:{debounceInputMs:100,viewportOnlyScan:!0},spellcheck:{enabled:!1,provider:"browser",apiUrl:""},language:{locale:"en",direction:"ltr"},contextMenu:{enabled:!0},contentConfig:{allowedTags:[],allowedAttributes:{},sanitize:!0},paste:{clean:!0,keepFormatting:!1,convertWord:!0},security:{sanitizeOnPaste:!0,sanitizeOnInput:!0},statusbar:!1},je.BOOLEAN_ATTRIBUTES=new Set(["readonly","disabled","autofocus","statusbar","toolbar-floating","toolbar-sticky","autosave-enabled","accessibility-enable-aria","accessibility-keyboard-navigation","accessibility-checker","performance-viewport-only-scan","spellcheck-enabled","context-menu-enabled","paste-clean","paste-keep-formatting","paste-convert-word","security-sanitize-on-paste","security-sanitize-on-input"]);let Ue=je;class go{constructor(){this.loadedPlugins=new Map,this.pluginRegistry=new Map}register(e,t){this.pluginRegistry.set(e,t)}async load(e,t){if(this.loadedPlugins.has(e))return this.loadedPlugins.get(e);const o=this.pluginRegistry.get(e);if(!o)return console.warn(`Plugin not found: ${e}`),null;const n=await o();return t&&this.applyPluginConfig(n,t),this.loadedPlugins.set(e,n),n}async loadMultiple(e,t){return(await Promise.all(e.map(n=>this.load(n,t)))).filter(n=>n!==null)}async parsePluginString(e,t){const o=e.split(/\s+/).filter(Boolean);return this.loadMultiple(o,t)}applyPluginConfig(e,t){e.__pluginConfig=t}unload(e){this.loadedPlugins.delete(e)}clear(){this.loadedPlugins.clear()}getLoadedPlugins(){return Array.from(this.loadedPlugins.values())}getRegisteredPluginNames(){return Array.from(this.pluginRegistry.keys())}isLoaded(e){return this.loadedPlugins.has(e)}}class bo{constructor(e={}){this.changeListeners=[],this.options=e,this.engine=new Ne({content:e.content,plugins:e.plugins||[],readonly:e.readonly}),e.onChange&&this.onChange(e.onChange),this.engine.on("change",()=>{const t=this.getHTML();this.changeListeners.forEach(o=>o(t))})}mount(e,t){this.contentElement=e,this.toolbarElement=t,this.contentElement.contentEditable=this.options.readonly?"false":"true",this.contentElement.className="rte-content",this.options.content&&(this.contentElement.innerHTML=this.options.content),this.options.toolbar!==!1&&this.toolbarElement&&(this.toolbar=new ze({items:typeof this.options.toolbar=="string"?this.options.toolbar:void 0},this.options.plugins||[]),this.toolbar.setCommandHandler((o,n)=>{this.execCommand(o,n)}),this.toolbar.render(this.toolbarElement)),this.contentElement.addEventListener("input",()=>{const o=this.getHTML();this.changeListeners.forEach(n=>n(o))}),this.options.onInit&&this.options.onInit(this.getAPI())}getHTML(){var e;return((e=this.contentElement)==null?void 0:e.innerHTML)||""}setHTML(e){this.contentElement&&(this.contentElement.innerHTML=e)}execCommand(e,t){const o=this.engine.execCommand(e,t);return this.toolbar,o}focus(){var e;(e=this.contentElement)==null||e.focus()}blur(){var e;(e=this.contentElement)==null||e.blur()}onChange(e){return this.changeListeners.push(e),()=>{const t=this.changeListeners.indexOf(e);t>-1&&this.changeListeners.splice(t,1)}}registerCommand(e,t){if(typeof window!="undefined"){const o=window.__editorCommands||new Map;o.set(e,t),window.__editorCommands=o}}getState(){return{plugins:this.options.plugins,config:this.options,engine:this.engine.getState()}}getAPI(){var e;return{getHTML:()=>this.getHTML(),setHTML:t=>this.setHTML(t),execCommand:(t,o)=>this.execCommand(t,o),focus:()=>this.focus(),blur:()=>this.blur(),destroy:()=>this.destroy(),registerCommand:(t,o)=>this.registerCommand(t,o),onChange:t=>this.onChange(t),getState:()=>this.getState(),toolbar:{items:((e=this.options.plugins)==null?void 0:e.flatMap(t=>t.toolbar||[]))||[]}}}destroy(){var e;this.engine.destroy(),(e=this.toolbar)==null||e.destroy(),this.changeListeners=[],this.options.onDestroy&&this.options.onDestroy()}}function ti(s){return new bo(s)}class yo{constructor(e){this.options=e,this.containerElement=e.element;const t=this.resolvePlugins(e.plugins);this.engine=new Ne({content:e.content,plugins:t,readonly:e.readonly}),this.initializeDOM()}resolvePlugins(e){return e?typeof e=="string"?(console.warn("String-based plugin loading not yet implemented for VanillaAdapter"),[]):e:[]}initializeDOM(){this.containerElement.innerHTML="",this.containerElement.classList.add("editora-editor"),this.options.enableToolbar!==!1&&this.options.toolbar!==!1&&(this.toolbarElement=document.createElement("div"),this.toolbarElement.className="editora-toolbar-container",this.containerElement.appendChild(this.toolbarElement),this.toolbar=new ze({items:typeof this.options.toolbar=="string"?this.options.toolbar:void 0},this.options.plugins||[]),this.toolbar.setCommandHandler((e,t)=>{this.execCommand(e,t)}),this.toolbar.render(this.toolbarElement)),this.contentElement=document.createElement("div"),this.contentElement.className="editora-content",this.contentElement.contentEditable=this.options.readonly?"false":"true",this.contentElement.style.minHeight="200px",this.contentElement.style.outline="none",this.contentElement.style.padding="12px",this.options.content&&(this.contentElement.innerHTML=this.options.content),this.containerElement.appendChild(this.contentElement),this.contentElement.addEventListener("input",()=>{this.containerElement.dispatchEvent(new CustomEvent("change",{detail:{html:this.getContent()}}))})}getContent(){var e;return((e=this.contentElement)==null?void 0:e.innerHTML)||""}setContent(e){this.contentElement&&(this.contentElement.innerHTML=e)}execCommand(e,t){return this.engine.execCommand(e,t)}focus(){var e;(e=this.contentElement)==null||e.focus()}on(e,t){const o=n=>{t(n.detail)};return this.containerElement.addEventListener(e,o),()=>{this.containerElement.removeEventListener(e,o)}}destroy(){var e;this.engine.destroy(),(e=this.toolbar)==null||e.destroy(),this.containerElement.innerHTML=""}}const oi='.editora-editor{display:flex;flex-direction:column;border:1px solid #ddd;border-radius:4px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;font-size:14px;overflow:hidden}.editora-editor *{box-sizing:border-box}.editora-theme-light{background:#fff;color:#333}.editora-theme-dark{--editora-dark-toolbar-bg-start: #353d48;--editora-dark-toolbar-bg-end: #2d3540;--editora-dark-button-bg-start: #46505f;--editora-dark-button-bg-end: #3b4553;--editora-dark-button-hover-start: #525d6d;--editora-dark-button-hover-end: #465262;--editora-dark-button-active-start: #5eaaf6;--editora-dark-button-active-end: #4a95de;--editora-dark-border: #475263;--editora-dark-border-strong: #566275;--editora-dark-text: #e1e9f5;--editora-dark-text-strong: #f3f7ff;--editora-dark-text-muted: #aeb9cc;--editora-dark-surface: #1d242d;--editora-dark-content: #1f2732;background:linear-gradient(180deg,#1b2330,#1c2430);color:var(--editora-dark-text);border-color:var(--editora-dark-border)}.editora-toolbar{display:flex;align-items:center;gap:4px;padding:8px;background:#f5f5f5;border-bottom:1px solid #ddd;flex-wrap:wrap}.editora-theme-dark .editora-toolbar{background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%);border-bottom-color:var(--editora-dark-border);box-shadow:inset 0 1px #ffffff0d}.editora-toolbar-sticky{position:sticky;top:0;z-index:100;position:-webkit-sticky}.editora-toolbar-group{display:flex;align-items:center;gap:2px}.editora-toolbar-button{padding:6px 12px;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-weight:600;font-size:14px;height:30px;display:flex;align-items:center;white-space:nowrap}.editora-toolbar-group-button{display:flex;align-items:center}.editora-toolbar-input.font-size{width:40px;padding:.25rem;text-align:center;font-size:14px;background:#fff;border:1px solid var(--rte-color-border-light);border-radius:var(--rte-radius-sm)}.editora-toolbar-group-items{display:flex;align-items:center;border:1px solid #ccc;.editora-toolbar-button{border:none;border-radius:0;&:first-child{border-right:1px solid #ccc;border-top-left-radius:3px;border-bottom-left-radius:3px}&:last-child{border:0px solid #ccc;border-radius:0!important}&:hover{background:#e0e0e0;border-color:#ccc}}}.editora-theme-dark .editora-toolbar-button{background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%);border-color:var(--editora-dark-border-strong);color:var(--editora-dark-text);box-shadow:inset 0 1px #ffffff14,0 1px 1px #00000059}.editora-theme-dark .editora-toolbar-group-items{border-color:var(--editora-dark-border-strong);background:linear-gradient(180deg,var(--editora-dark-button-bg-start) 0%,var(--editora-dark-button-bg-end) 100%)}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:first-child{border-right-color:#566275}.editora-theme-dark .editora-toolbar-group-items .editora-toolbar-button:last-child{border-left-color:#566275}.editora-theme-dark .editora-toolbar-input.font-size{background-color:#2e3642;color:var(--editora-dark-text-strong);border-color:var(--editora-dark-border-strong);caret-color:var(--editora-dark-text-strong)}.editora-theme-dark .editora-toolbar-input.font-size::placeholder{color:var(--editora-dark-text-strong);opacity:1}.editora-toolbar-button:hover{background:#e0e0e0;border-color:#ccc}.editora-theme-dark .editora-toolbar-button:hover{background:linear-gradient(180deg,var(--editora-dark-button-hover-start) 0%,var(--editora-dark-button-hover-end) 100%);border-color:#66748a;color:var(--editora-dark-text-strong)}.editora-toolbar-button:active,.editora-toolbar-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-button:active,.editora-theme-dark .editora-toolbar-button.active{background:linear-gradient(180deg,var(--editora-dark-button-active-start) 0%,var(--editora-dark-button-active-end) 100%);border-color:#67adf4;color:#0f1b2a}.editora-theme-dark .editora-toolbar-button:disabled{background:#313946;border-color:#424d5e;color:#7f8ca1}.editora-theme-dark .editora-toolbar-button[data-command=insertTable],.editora-theme-dark .editora-toolbar-button[data-command=print],.editora-theme-dark .editora-toolbar-button[data-command=toggleSpellCheck],.editora-theme-dark .editora-toolbar-button[data-command=toggleA11yChecker],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionLTR],.editora-theme-dark .editora-toolbar-button[data-command=setDirectionRTL]{color:#f1f6ff}.editora-toolbar-button:disabled{opacity:.5;cursor:not-allowed}.editora-toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;line-height:1}.editora-toolbar-button svg,.editora-toolbar-icon svg{width:20px;height:20px;display:block;color:currentColor}.editora-theme-dark .editora-toolbar-button svg:not([fill=none i]),.editora-theme-dark .editora-toolbar-icon svg:not([fill=none i]){fill:currentColor}.editora-theme-dark .editora-toolbar-icon,.editora-theme-dark .editora-toolbar-icon *{color:inherit}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([stroke="#000" i],[stroke="#000000" i],[stroke=black i],[stroke="#0f0f0f" i],[stroke="#111111" i],[style*="stroke:#000" i],[style*="stroke: #000" i],[style*="stroke:black" i],[style*="stroke: black" i],[style*="stroke:#0f0f0f" i],[style*="stroke: #0f0f0f" i]){stroke:currentColor!important}.editora-theme-dark :is(.editora-toolbar-button,.editora-toolbar-icon) svg :is([fill="#000" i],[fill="#000000" i],[fill=black i],[fill="#0f0f0f" i],[fill="#111111" i],[style*="fill:#000" i],[style*="fill: #000" i],[style*="fill:black" i],[style*="fill: black" i],[style*="fill:#0f0f0f" i],[style*="fill: #0f0f0f" i]){fill:currentColor!important}.editora-toolbar-separator{width:1px;height:24px;background:#ddd;margin:0 4px}.editora-theme-dark .editora-toolbar-separator{background:#4d596b}.editora-toolbar-items-container{display:flex;align-items:center;gap:4px;flex:1;min-width:0;overflow:hidden}.editora-toolbar-more-button{display:flex;align-items:center;justify-content:center;width:30px;height:30px;flex-shrink:0;padding:0;border:1px solid #ccc;background:#fff;cursor:pointer;border-radius:3px;font-size:16px}.editora-toolbar-more-button:hover{background:#e0e0e0}.editora-toolbar-more-button.active{background:#d0d0d0;border-color:#999}.editora-theme-dark .editora-toolbar-more-button{background:var(--editora-dark-content);border-color:var(--editora-dark-border);color:var(--editora-dark-text)}.editora-theme-dark .editora-toolbar-more-button:hover,.editora-theme-dark .editora-toolbar-more-button.active{background:#3a4554;border-color:#607088}.editora-toolbar-expanded-row{display:none;flex-wrap:wrap;align-items:center;gap:4px;width:100%;padding:8px;border-top:1px solid #ddd;background:#f5f5f5}.editora-toolbar-expanded-row.show{display:flex}.editora-theme-dark .editora-toolbar-expanded-row{border-top-color:var(--editora-dark-border);background:linear-gradient(180deg,var(--editora-dark-toolbar-bg-start) 0%,var(--editora-dark-toolbar-bg-end) 100%)}.editora-toolbar-dropdown{position:relative}.editora-toolbar-dropdown-menu{position:absolute;top:100%;left:0;min-width:150px;margin-top:4px;padding:4px 0;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-toolbar-dropdown-menu{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;color:#333;text-align:left;cursor:pointer;font-size:13px;transition:background .15s ease}.editora-theme-dark .editora-toolbar-dropdown-item{color:#d7deea}.editora-toolbar-dropdown-item:hover{background:#f5f5f5}.editora-theme-dark .editora-toolbar-dropdown-item:hover{background:#3a4554;color:#f0f6ff}.editora-content{flex:1;min-height:200px;padding:16px;outline:none;overflow-y:auto;line-height:1.6}.editora-theme-dark .editora-content{color:#ecf3ff;background:linear-gradient(180deg,var(--editora-dark-content) 0%,#1c232e 100%)}.editora-content:empty:before{content:attr(data-placeholder);color:#999;pointer-events:none}.editora-theme-dark .editora-content:empty:before{color:#8f9bb0}.editora-content h1{font-size:2em;margin:.67em 0;font-weight:600}.editora-content h2{font-size:1.5em;margin:.75em 0;font-weight:600}.editora-content h3{font-size:1.17em;margin:.83em 0;font-weight:600}.editora-content p{margin:1em 0}.editora-theme-dark .editora-content,.editora-theme-dark .editora-content :is(p,span,div,li,ul,ol,td,th,h1,h2,h3,h4,h5,h6,strong,em,u,s,small,sub,sup,blockquote,code,pre,a){color:#ecf3ff}.editora-content ul,.editora-content ol{margin:1em 0;padding-left:2em}.editora-content a{color:#06c;text-decoration:underline}.editora-theme-dark .editora-content a{color:#ecf3ff}.editora-content code{padding:2px 4px;background:#f5f5f5;border-radius:3px;font-family:Monaco,Menlo,Consolas,monospace;font-size:.9em}.editora-theme-dark .editora-content code{background:#1e1e1e}.editora-content pre{padding:12px;background:#f5f5f5;border-radius:4px;overflow-x:auto;margin:1em 0}.editora-theme-dark .editora-content pre{background:#1e1e1e}.editora-theme-dark .rte-code-block{background:linear-gradient(180deg,#212a36,#1b2430)!important;border-color:#4f5b70!important;color:#e7effc!important}.editora-theme-dark .rte-code-block code{color:#e7effc!important}.editora-theme-dark .rte-code-block:before{background:#111927!important;color:#dce8ff!important}.editora-theme-dark .rte-code-block .rte-code-copy{background:#2b3441!important;border-color:#5a667b!important;color:#dce8ff!important}.editora-content blockquote{margin:1em 0;padding-left:1em;border-left:4px solid #ddd;color:#666}.editora-theme-dark .editora-content blockquote{border-left-color:#3c3c3c;color:#ecf3ff}.editora-floating-toolbar{position:absolute;padding:4px;background:#fff;border:1px solid #ddd;border-radius:4px;box-shadow:0 2px 8px #00000026;z-index:1000}.editora-theme-dark .editora-floating-toolbar{background:#29323d;border-color:#4d596b;box-shadow:0 8px 20px #00000073}.editora-statusbar-container{display:flex;flex-direction:column}.editora-statusbar-left{display:flex;align-items:center;gap:8px}.editora-statusbar-right{display:flex;align-items:center;gap:8px;margin-left:auto}.editora-statusbar{display:flex;align-items:center;gap:12px;padding:6px 12px;background:#f5f5f5;border-top:1px solid #ddd;font-size:12px;color:#666}.editora-theme-dark .editora-statusbar{background:linear-gradient(180deg,#2c3440,#252d37);border-top-color:#3f4a5b;color:#d7deea}.editora-statusbar-item{white-space:nowrap}.editora-statusbar-separator{color:#ddd}.editora-theme-dark .editora-statusbar-separator{color:#566275}.editora-editor[readonly] .editora-content{background:#fafafa;cursor:not-allowed}.editora-theme-dark.editora-editor[readonly] .editora-content{background:#1a1a1a}.editora-editor:focus-within{border-color:#06c;box-shadow:0 0 0 3px #0066cc1a}.editora-theme-dark.editora-editor:focus-within{border-color:#4db8ff;box-shadow:0 0 0 3px #4db8ff1a}.editora-editor[disabled]{opacity:.6;pointer-events:none}@media(max-width:768px){.editora-toolbar{padding:4px}.editora-toolbar-button{min-width:28px;min-height:28px;padding:4px 8px;font-size:12px}.editora-content{padding:12px}}.editora-content ::selection{background:#06c3}.editora-theme-dark .editora-content ::selection{background:#4db8ff33}.editora-content table{border-collapse:collapse;width:100%;margin:1em 0}.editora-content th,.editora-content td{border:1px solid #ddd;padding:8px 12px;text-align:left}.editora-theme-dark .editora-content th,.editora-theme-dark .editora-content td{border-color:#3c3c3c}.editora-content th{background:#f5f5f5;font-weight:600}.editora-theme-dark .editora-content th{background:#252526}.editora-content img{max-width:100%;height:auto;border-radius:4px;display:block}.editora-content video{max-width:100%;height:auto;border-radius:4px;display:block}.editora-editor.loading{opacity:.7;pointer-events:none}.editora-editor.loading:after{content:"";position:absolute;top:50%;left:50%;width:24px;height:24px;margin:-12px 0 0 -12px;border:3px solid #ddd;border-top-color:#06c;border-radius:50%;animation:editora-spin .8s linear infinite}@keyframes editora-spin{to{transform:rotate(360deg)}}.toolbar-container-wrapper{display:flex;align-items:center;background:#fff;border-bottom:1px solid #e0e0e0;padding:0;margin:0;width:100%;box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;font-size:14px;line-height:1.5;position:relative}.toolbar-container-wrapper[data-toolbar-sticky=true]{position:sticky;top:0;z-index:999;box-shadow:0 2px 4px #0000001a}.toolbar-container-wrapper[data-toolbar-floating=true]{position:fixed;top:0;left:0;right:0;z-index:1000;box-shadow:0 4px 12px #00000026}.toolbar-container-wrapper[data-toolbar-position=bottom]{border-bottom:none;border-top:1px solid #e0e0e0}.toolbar-container-wrapper .toolbar-wrapper{display:flex;width:100%;padding:8px;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar{display:flex;width:100%;gap:4px;flex-wrap:wrap;align-items:center}.toolbar-container-wrapper .toolbar-container{display:flex;gap:4px;flex-wrap:wrap;align-items:center;flex:1;position:relative}.toolbar-container-wrapper .toolbar-item{display:flex;align-items:center;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:6px 10px;border:1px solid #d1d5db;background:#fff;border-radius:4px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;gap:4px;transition:all .15s ease;min-height:32px;white-space:nowrap}.toolbar-container-wrapper .toolbar-button:hover{background-color:#f3f4f6;border-color:#9ca3af}.toolbar-container-wrapper .toolbar-button:active,.toolbar-container-wrapper .toolbar-button[data-active=true]{background-color:#06c;color:#fff;border-color:#0052a3;box-shadow:inset 0 1px 3px #0000001a}.toolbar-container-wrapper .toolbar-button:disabled{opacity:.5;cursor:not-allowed;background-color:#f9fafb}.toolbar-container-wrapper .toolbar-more-button{padding:6px 8px;font-size:16px;font-weight:500;line-height:1}.toolbar-container-wrapper .toolbar-separator{width:1px;height:24px;background-color:#d1d5db;margin:0 4px}.toolbar-container-wrapper .toolbar-icon{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;flex-shrink:0}.toolbar-container-wrapper .toolbar-icon svg{width:100%;height:100%}.toolbar-container-wrapper .toolbar-dropdown{position:relative;display:flex;align-items:center}.toolbar-container-wrapper .toolbar-dropdown-arrow{font-size:10px;margin-left:2px;line-height:1}.toolbar-container-wrapper .toolbar-dropdown-menu{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:6px;box-shadow:0 4px 12px #00000026;z-index:1000;min-width:160px;padding:4px 0;margin-top:4px;display:none}.toolbar-container-wrapper .toolbar-dropdown-menu.show{display:block}.toolbar-container-wrapper .toolbar-dropdown-item{display:block;width:100%;padding:8px 12px;border:none;background:transparent;text-align:left;cursor:pointer;font-size:13px;color:#1f2937;transition:background-color .15s ease;font-family:inherit}.toolbar-container-wrapper .toolbar-dropdown-item:hover{background-color:#f3f4f6}.toolbar-container-wrapper .toolbar-dropdown-item:active{background-color:#e5e7eb}.toolbar-container-wrapper .toolbar-input{padding:6px 8px;border:1px solid #d1d5db;border-radius:4px;font-size:13px;font-family:inherit;background-color:#fff;color:#1f2937;transition:all .15s ease}.toolbar-container-wrapper .toolbar-input:focus{outline:none;border-color:#06c;box-shadow:0 0 0 3px #0066cc1a;background-color:#fff}.toolbar-container-wrapper .toolbar-input::placeholder{color:#9ca3af}.toolbar-overflow-menu{animation:slideDown .2s ease-out}@keyframes slideDown{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}.toolbar-overflow-item{transition:background-color .15s ease}.floating-toolbar{user-select:none;-webkit-user-select:none;font-family:system-ui,-apple-system,sans-serif;font-size:14px;animation:fadeInUp .15s ease-out}@keyframes fadeInUp{0%{opacity:0;transform:translate(-50%) translateY(10px)}to{opacity:1;transform:translate(-50%) translateY(0)}}.floating-toolbar-btn{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border:none;background:transparent;border-radius:4px;color:#495057;cursor:pointer;font-size:14px;font-weight:500;transition:all .15s ease;outline:none}.floating-toolbar-btn:hover{background:#f8f9fa;color:#212529}.floating-toolbar-btn:active{background:#e9ecef;transform:scale(.95)}.floating-toolbar-btn.floating-toolbar-toggle{color:#dc3545;font-weight:700}.floating-toolbar-btn.floating-toolbar-toggle:hover{background:#f8d7da;color:#721c24}.floating-toolbar-separator{width:1px;height:20px;background:#e1e5e9;margin:0 2px}@media(max-width:768px){.toolbar-container-wrapper .toolbar-button{padding:5px 8px;font-size:12px;min-height:28px}.toolbar-container-wrapper .toolbar-icon{width:16px;height:16px}.toolbar-container-wrapper .toolbar-dropdown-menu{min-width:140px}.toolbar-container-wrapper .toolbar-dropdown-item{padding:6px 10px;font-size:12px}.floating-toolbar{padding:4px;gap:2px}.floating-toolbar-btn{width:28px;height:28px;font-size:12px}}@media(max-width:480px){.toolbar-container-wrapper{padding:4px}.toolbar-container-wrapper .toolbar-wrapper{padding:4px;gap:2px}.toolbar-container-wrapper .toolbar-button{padding:4px 6px;font-size:11px;min-height:24px}.toolbar-container-wrapper .toolbar-icon{width:14px;height:14px}}.floating-toolbar{pointer-events:auto}.floating-toolbar{max-width:calc(100vw - 20px);overflow-x:auto}@media(prefers-color-scheme:dark){.floating-toolbar{background:#2d3748;border-color:#4a5568;color:#e2e8f0}.floating-toolbar-btn:hover{background:#4a5568;color:#f7fafc}.floating-toolbar-btn:active{background:#718096}.floating-toolbar-separator{background:#4a5568}}editora-editor[data-loading]{display:block;position:relative;min-height:160px;border:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px);background:var(--ui-color-surface, #fff)}editora-editor[data-loading]:before{content:"";position:absolute;inset:0 0 auto;height:46px;border-bottom:1px solid var(--ui-color-border, #ddd);border-radius:var(--ui-radius, 4px) var(--ui-radius, 4px) 0 0;background:linear-gradient(90deg,var(--ui-color-surface-alt, #f5f5f5) 0%,color-mix(in srgb,var(--ui-color-surface-alt, #f5f5f5) 70%,var(--ui-color-border, #ddd)) 50%,var(--ui-color-surface-alt, #f5f5f5) 100%);background-size:220% 100%;animation:editora-loading-shimmer 1.2s linear infinite}editora-editor[data-loading]:after{content:"Loading editor…";position:absolute;top:62px;left:16px;font:14px/1.4 var(--ui-font-family, system-ui, sans-serif);color:var(--ui-color-muted, #6b7280)}editora-editor[data-loading]>*{visibility:hidden}@keyframes editora-loading-shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){editora-editor[data-loading]:before{animation:none}}';let Be;const ni="__editoraCommandEditorRoot",ii="__editoraLastCommandButton",vo="editora-editor, [data-editora-editor], .rte-editor, .editora-editor",Eo=".rte-content, .editora-content",ri="Rich text editor",ai=new Set(["collaboration"]),pt=new Set;let Z=null,wo=!1,mt=null,ft=null;function xo(s){if(!(s instanceof HTMLElement))return!1;const e=s;return typeof e.execCommand=="function"&&(e.tagName.toLowerCase()==="editora-editor"||e.classList.contains("editora-editor")||e.hasAttribute("data-editora-editor"))}function si(s){return s?s.nodeType===Node.ELEMENT_NODE?s:s.parentElement:null}function Ie(s){if(!s)return null;if(xo(s))return s;const e=s.matches(vo)?s:s.closest(vo);return!e||!xo(e)?null:e}function li(){var n;if(typeof window=="undefined")return null;const s=window[ni];if(s instanceof HTMLElement){const i=Ie(s);if(i)return i;const a=s.matches(Eo)?s:s.querySelector(Eo);if(a){const c=Ie(a);if(c)return c}}const e=window[ii];if(e instanceof HTMLElement){const i=Ie(e);if(i)return i}const t=document.activeElement;if(t){const i=Ie(t);if(i)return i}const o=(n=window.getSelection)==null?void 0:n.call(window);if(o&&o.rangeCount>0){const i=Ie(si(o.getRangeAt(0).startContainer));if(i)return i}if(Z&&Z.isConnected)return Z;for(const i of pt)if(i.isConnected)return i;return null}function ci(){if(typeof window=="undefined"||wo)return;mt=typeof window.executeEditorCommand=="function"?window.executeEditorCommand.bind(window):null,ft=typeof window.execEditorCommand=="function"?window.execEditorCommand.bind(window):null;const s=(e,...t)=>{const o=li();return o?o.execCommand(e,...t):mt?mt(e,...t):ft?ft(e,...t):!1};window.executeEditorCommand=s,window.execEditorCommand=s,wo=!0}function di(){const s="editora-webcomponent-styles";if(!document.getElementById(s)){const e=document.createElement("style");e.id=s,e.textContent=oi,document.head.appendChild(e)}}function ui(){if(!Be){const s=J.__globalPluginLoader;s?Be=s:Be=new go}return Be}const hi=typeof HTMLElement=="undefined"?class{}:HTMLElement;class J extends hi{constructor(){if(super(),this.pluginLoader=ui(),this.config={},this.isInitialized=!1,this.buildGeneration=0,this.keyboardShortcutManager=new Nt,this.lastAutosavedContent="",this.preservedContent=null,this.loadedPlugins=[],this.lastBeforeInputType=null,this.pendingHistorySnapshot=null,di(),!this.hasAttribute("data-initial-content")){const e=this.innerHTML.trim();e&&this.setAttribute("data-initial-content",e)}}static get observedAttributes(){return["height","width","menubar","plugins","toolbar","toolbar-items","toolbar-floating","toolbar-sticky","readonly","disabled","theme","placeholder","aria-label","autofocus","autosave","autosave-enabled","autosave-interval-ms","autosave-storage-key","autosave-provider","autosave-api-url","accessibility","accessibility-enable-aria","accessibility-keyboard-navigation","accessibility-checker","performance","performance-debounce-input-ms","performance-viewport-only-scan","language","language-locale","language-direction","spellcheck","spellcheck-enabled","spellcheck-provider","context-menu","context-menu-enabled","paste","paste-clean","paste-keep-formatting","paste-convert-word","security","security-sanitize-on-paste","security-sanitize-on-input","statusbar"]}connectedCallback(){this.config=this.resolveConfig(),this.waitForPluginLoader().then(()=>{setTimeout(async()=>{await this.initialize()},0)})}async waitForPluginLoader(){if(J.__globalPluginLoader){this.pluginLoader=J.__globalPluginLoader;return}return new Promise(e=>{const t=()=>{J.__globalPluginLoader?(this.pluginLoader=J.__globalPluginLoader,e()):setTimeout(t,0)};t()})}disconnectedCallback(){this.destroy()}attributeChangedCallback(e,t,o){t!==o&&(this.config=this.resolveConfig(),this.handleAttributeChange(e,o))}async setConfig(e){this.jsConfig=e,this.config=this.resolveConfig(),this.isConnected&&(this.destroy(),await this.waitForPluginLoader(),await this.initialize())}async initialize(){var i;if(this.querySelector(".editora-toolbar")||this.isInitialized)return;const e=++this.buildGeneration;this.setAttribute("data-editora-editor","true"),pt.add(this),Z||(Z=this),ci(),this.config.height&&(this.style.height=typeof this.config.height=="number"?`${this.config.height}px`:this.config.height),this.config.width&&(this.style.width=typeof this.config.width=="number"?`${this.config.width}px`:this.config.width),this.classList.add("editora-editor"),this.config.theme&&this.classList.add(`editora-theme-${this.config.theme}`),this.setAttribute("data-loading","true"),this.setAttribute("aria-busy","true");const t=await this.loadPlugins();if(e!==this.buildGeneration||!this.isConnected)return;if(this.loadedPlugins=t,t.forEach(a=>{if(a.init&&typeof a.init=="function")try{a.init({editorElement:this})}catch(c){console.error(`[RichTextEditor] Error initializing plugin ${a.name}:`,c)}}),!this.hasAttribute("data-initial-content")&&!this.contentElement){const a=this.innerHTML.trim();a&&this.setAttribute("data-initial-content",a)}const o=this.preservedContent;this.preservedContent=null;const n=this.sanitizeLoadedContent((i=o!=null?o:this.restoreAutosavedContent())!=null?i:this.getAttribute("data-initial-content")||"");this.engine=new Ne({content:n,plugins:t,readonly:this.config.readonly}),this.createUI(t,n),this.setupEventListeners(),this.startAutosave(),this.isInitialized=!0,this.removeAttribute("data-loading"),this.removeAttribute("aria-busy"),this.dispatchEvent(new CustomEvent("editor-ready",{detail:{api:this.getAPI()},bubbles:!0}))}getInitialContent(){if(this.config.content)return this.config.content;const e=this.querySelector("[slot]");return e?e.innerHTML:this.hasChildNodes()?Array.from(this.childNodes).map(o=>o.nodeType===Node.TEXT_NODE?o.textContent:o.nodeType===Node.ELEMENT_NODE?o.outerHTML:"").join("").trim():""}async loadPlugins(){this.pluginLoader||await this.waitForPluginLoader();const e=[],t=this.config.plugins&&(typeof this.config.plugins=="string"&&this.config.plugins.length>0||Array.isArray(this.config.plugins)&&this.config.plugins.length>0),n=this.getAccessibilityConfig().checker===!0;if(t){if(typeof this.config.plugins=="string"){const i=this.config.plugins.split(/\s+/).filter(Boolean);n&&!i.includes("a11yChecker")&&i.push("a11yChecker");for(const a of i){const c=await this.pluginLoader.load(a,this.getPluginLoadConfig(a));c&&e.push(c)}}else if(Array.isArray(this.config.plugins)){for(const i of this.config.plugins)if(typeof i=="string"){const a=await this.pluginLoader.load(i,this.getPluginLoadConfig(i));a&&e.push(a)}else e.push(i);if(n&&!e.some(i=>(i==null?void 0:i.name)==="a11yChecker")){const i=await this.pluginLoader.load("a11yChecker",this.getPluginLoadConfig("a11yChecker"));i&&e.push(i)}}}else{const i=this.pluginLoader.getRegisteredPluginNames();for(const a of i){const c=this.getPluginLoadConfig(a);if(ai.has(a)&&!c)continue;const d=await this.pluginLoader.load(a,c);d&&e.push(d)}}return e}resolveToolbarItems(){const e=this.config.toolbarItems;if(typeof e=="string")return e;if(Array.isArray(e))return e.join(" ");const t=this.config.toolbar;if(typeof t=="string")return t;if(!t||typeof t!="object")return;const o=t.items;if(typeof o=="string")return o;if(Array.isArray(o))return o.join(" ")}isToolbarStickyEnabled(){const e=this.config.toolbar;return!e||typeof e!="object"?!1:!!e.sticky}isToolbarFloatingEnabled(){const e=this.config.toolbar;return!e||typeof e!="object"?!1:!!e.floating}isStatusbarEnabled(){const e=this.config.statusbar;return typeof e=="boolean"?e:e&&typeof e=="object"?e.enabled!==!1:!1}getStatusbarPosition(){const e=this.config.statusbar;return e&&typeof e=="object"&&e.position==="top"?"top":"bottom"}getLanguageConfig(){const e=this.config.language;return typeof e=="string"?{locale:e,direction:"ltr"}:e&&typeof e=="object"?{locale:e.locale||"en",direction:e.direction==="rtl"?"rtl":"ltr"}:{locale:"en",direction:"ltr"}}getAccessibilityConfig(){const e=this.config.accessibility;return typeof e=="boolean"?{enableARIA:e,keyboardNavigation:e,checker:!1}:e&&typeof e=="object"?{enableARIA:e.enableARIA!==!1,keyboardNavigation:e.keyboardNavigation!==!1,checker:!!e.checker}:{enableARIA:!0,keyboardNavigation:!0,checker:!1}}getPerformanceConfig(){var t;const e=this.config.performance;if(typeof e=="boolean")return{debounceInputMs:100,viewportOnlyScan:e};if(e&&typeof e=="object"){const o=Number((t=e.debounceInputMs)!=null?t:100);return{debounceInputMs:Number.isFinite(o)&&o>=0?o:100,viewportOnlyScan:e.viewportOnlyScan!==!1}}return{debounceInputMs:100,viewportOnlyScan:!0}}isEditorInViewport(){if(!this.contentElement||typeof window=="undefined")return!0;const e=this.contentElement.getBoundingClientRect();return e.bottom>=0&&e.top<=window.innerHeight}applyAccessibilitySettings(){var t;if(!this.contentElement)return;const e=this.getAccessibilityConfig();if(e.enableARIA){this.contentElement.setAttribute("role","textbox"),this.contentElement.setAttribute("aria-multiline","true"),this.contentElement.setAttribute("aria-disabled",this.config.readonly?"true":"false");const o=(t=this.getAttribute("aria-label"))==null?void 0:t.trim(),n=typeof this.config.placeholder=="string"?this.config.placeholder.trim():"";this.contentElement.setAttribute("aria-label",o||n||ri)}else this.contentElement.removeAttribute("role"),this.contentElement.removeAttribute("aria-multiline"),this.contentElement.removeAttribute("aria-disabled"),this.contentElement.removeAttribute("aria-label");this.contentElement.tabIndex=e.keyboardNavigation?0:-1}applyLanguageSettings(){if(!this.contentElement)return;const e=this.getLanguageConfig();this.contentElement.setAttribute("lang",e.locale),this.contentElement.setAttribute("dir",e.direction)}getSpellcheckConfig(){const e=this.config.spellcheck;if(typeof e=="boolean")return{enabled:e,provider:"browser"};if(e&&typeof e=="object"){const t=e.provider||"browser";return{enabled:!!e.enabled,provider:t,mode:e.mode}}return{enabled:!1,provider:"browser"}}applySpellcheckSettings(){if(!this.contentElement)return;const e=this.getSpellcheckConfig(),t=e.enabled&&e.provider==="browser";this.contentElement.spellcheck=t,this.contentElement.setAttribute("spellcheck",t?"true":"false")}executeCommand(e,...t){var i;typeof window!="undefined"&&(window.__editoraCommandEditorRoot=this);const o={editorElement:this,contentElement:this.contentElement,toolbarElement:this.toolbarElement},n=this.loadedPlugins.find(a=>a.commands&&a.commands[e]);if(n&&n.commands){const a=n.commands[e];if(typeof a=="function")try{return e==="toggleFullscreen"?a(this,o):a(...t,o),!0}catch(c){return console.error(`[RichTextEditor] Error executing native command ${e}:`,c),!1}}return((i=this.engine)==null?void 0:i.execCommand(e,...t))||!1}getPluginLoadConfig(e){const t=this.config.pluginConfig;if(t&&typeof t=="object"){const i=t[e];if(i&&typeof i=="object")return i}const o={spellCheck:["spellcheck","spellCheck"],trackChanges:["trackchanges","track-changes","trackChanges"],versionDiff:["versiondiff","version-diff","versionDiff"],"version-diff":["versiondiff","version-diff","versionDiff"],conditionalContent:["conditionalcontent","conditional-content","conditionalContent"],"conditional-content":["conditionalcontent","conditional-content","conditionalContent"],dataBinding:["databinding","data-binding","dataBinding"],"data-binding":["databinding","data-binding","dataBinding"],contentRules:["contentrules","content-rules","contentRules"],"content-rules":["contentrules","content-rules","contentRules"],mentions:["mention","mentions"],mention:["mention","mentions"],slashCommands:["slashcommands","slash-commands","slashCommands"],"slash-commands":["slashcommands","slash-commands","slashCommands"],formatPainter:["formatpainter","format-painter","formatPainter"],"format-painter":["formatpainter","format-painter","formatPainter"]},n=[e,e.toLowerCase(),...o[e]||[]];for(const i of n){const a=this.config[i];if(a&&typeof a=="object"&&!Array.isArray(a))return a}}getContentSanitizeConfig(){const e=this.config.contentConfig;return e&&typeof e=="object"?e:{sanitize:!0}}getSecurityConfig(){const e=this.config.security;return e&&typeof e=="object"?e:{sanitizeOnPaste:!0,sanitizeOnInput:!0}}sanitizeLoadedContent(e){return ut(e,this.getContentSanitizeConfig(),this.getSecurityConfig())}getAutosaveConfig(){var t,o;const e=this.config.autosave;if(typeof e=="boolean")return{enabled:e,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage"};if(e&&typeof e=="object"){const n=Number((o=(t=e.intervalMs)!=null?t:e.interval)!=null?o:3e4);return{enabled:!!e.enabled,intervalMs:Number.isFinite(n)&&n>0?n:3e4,storageKey:String(e.storageKey||"rte-autosave"),provider:e.provider||"localStorage",apiUrl:e.apiUrl}}return{enabled:!1,intervalMs:3e4,storageKey:"rte-autosave",provider:"localStorage"}}persistAutosave(e){const t=this.getAutosaveConfig();if(t.enabled&&e!==this.lastAutosavedContent){if(this.lastAutosavedContent=e,t.provider==="localStorage"){try{localStorage.setItem(t.storageKey,e),localStorage.setItem(`${t.storageKey}-timestamp`,Date.now().toString())}catch(o){console.error("[RichTextEditor] Failed to save autosave content to localStorage:",o)}return}t.provider==="api"&&t.apiUrl&&fetch(t.apiUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,timestamp:Date.now()})}).catch(o=>{console.error("[RichTextEditor] Failed to save autosave content to API:",o)})}}restoreAutosavedContent(){const e=this.getAutosaveConfig();if(!e.enabled||e.provider!=="localStorage")return null;try{const t=localStorage.getItem(e.storageKey);if(t)return this.lastAutosavedContent=t,t}catch(t){console.error("[RichTextEditor] Failed to restore autosaved content:",t)}return null}stopAutosave(){this.autosaveTimer&&(clearInterval(this.autosaveTimer),this.autosaveTimer=void 0)}startAutosave(){this.stopAutosave();const e=this.getAutosaveConfig();!e.enabled||!this.contentElement||(this.autosaveTimer=setInterval(()=>{this.persistAutosave(he(this.contentElement))},e.intervalMs))}insertHTMLAtSelection(e){if(!this.contentElement)return;const t=window.getSelection();if(t&&t.rangeCount>0){const o=t.getRangeAt(0);o.deleteContents();const n=document.createElement("div");n.innerHTML=e;const i=document.createDocumentFragment();for(;n.firstChild;)i.appendChild(n.firstChild);o.insertNode(i),o.collapse(!1),t.removeAllRanges(),t.addRange(o)}else this.contentElement.focus(),document.execCommand("insertHTML",!1,e)}createUI(e,t){const o=this.querySelector('[slot="toolbar"]'),n=this.querySelector('[slot="statusbar"]');this.innerHTML="",this.config.toolbar!==!1&&!o?(this.toolbarElement=document.createElement("div"),this.toolbarElement.className="editora-toolbar-container",this.appendChild(this.toolbarElement),this.toolbar=new ze({items:this.resolveToolbarItems(),sticky:this.isToolbarStickyEnabled(),position:"top"},e,this.pluginLoader),this.toolbar.setCommandHandler((i,a)=>{var c;if(this.contentElement){this.contentElement.focus();const d=window.getSelection();if(!d||d.rangeCount===0||!this.contentElement.contains(d.anchorNode)){const m=document.createRange(),f=this.contentElement.lastChild||this.contentElement;f.nodeType===Node.TEXT_NODE?m.setStart(f,((c=f.textContent)==null?void 0:c.length)||0):f.nodeType===Node.ELEMENT_NODE?(m.selectNodeContents(f),m.collapse(!1)):m.setStart(this.contentElement,0),m.collapse(!0),d==null||d.removeAllRanges(),d==null||d.addRange(m)}}return this.executeCommand(i,a)}),this.toolbar.render(this.toolbarElement)):o&&this.appendChild(o),this.contentElement=document.createElement("div"),this.contentElement.className="editora-content rte-content",this.contentElement.contentEditable=this.config.readonly?"false":"true",this.applyLanguageSettings(),this.applyAccessibilitySettings(),this.applySpellcheckSettings(),this.config.placeholder&&this.contentElement.setAttribute("data-placeholder",this.config.placeholder);try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch(i){console.warn("defaultParagraphSeparator not supported:",i)}if(t){const i=document.createElement("div");i.innerHTML=t.trim(),!Array.from(i.childNodes).some(c=>{if(c.nodeType===Node.ELEMENT_NODE){const d=c.tagName;return["P","DIV","H1","H2","H3","H4","H5","H6","UL","OL","BLOCKQUOTE","PRE"].includes(d)}return!1})&&t.trim()?this.contentElement.innerHTML=`<p>${t.trim()}</p>`:this.contentElement.innerHTML=t}else this.config.placeholder?this.contentElement.innerHTML="":this.contentElement.innerHTML="<p><br></p>";this.appendChild(this.contentElement),this.isToolbarFloatingEnabled()&&(this.floatingToolbar=new Ut({enabled:!0}),this.floatingToolbar.create(this)),n?this.appendChild(n):this.isStatusbarEnabled()&&(this.statusBarElement=document.createElement("div"),this.statusBarElement.className="editora-statusbar-container",this.appendChild(this.statusBarElement),this.statusBar=new Bt({position:this.getStatusbarPosition()}),this.statusBar.create(this.statusBarElement)),this.config.autofocus&&setTimeout(()=>{var i;return(i=this.contentElement)==null?void 0:i.focus()},0)}recordInputHistory(e){const t=this.pendingHistorySnapshot;if(this.pendingHistorySnapshot=null,!t||!this.contentElement||t.beforeHTML===e)return;const o=window.execEditorCommand;typeof o=="function"&&o("recordDomTransaction",this.contentElement,t.beforeHTML,e,{inputType:t.inputType,data:t.data,selectionCollapsed:t.selectionCollapsed})}setupEventListeners(){if(!this.contentElement||!this.engine)return;const e=this.keyboardShortcutManager;this.contentElement.addEventListener("beforeinput",o=>{var n,i;this.lastBeforeInputType=o.inputType||null,o.inputType==="historyUndo"||o.inputType==="historyRedo"?this.pendingHistorySnapshot=null:this.contentElement&&(this.pendingHistorySnapshot={beforeHTML:this.contentElement.innerHTML,inputType:o.inputType||null,data:typeof o.data=="string"?o.data:null,selectionCollapsed:(i=(n=window.getSelection())==null?void 0:n.isCollapsed)!=null?i:!0})}),this.contentElement.addEventListener("input",o=>{var y;if(!this.contentElement)return;let n=this.contentElement.innerHTML;const i=(y=o==null?void 0:o.detail)==null?void 0:y.allowedTags,a=this.getPerformanceConfig(),c=this.getContentSanitizeConfig(),d=this.getSecurityConfig(),m=this.lastBeforeInputType;if(this.lastBeforeInputType=null,d.sanitizeOnInput!==!1&&c.sanitize!==!1&&!m){const E=ut(n,c,d,i);if(E!==n){const T=window.getSelection(),ie=T&&T.rangeCount>0?T.getRangeAt(0):null;if(this.contentElement.innerHTML=E,ie&&T)try{T.removeAllRanges(),T.addRange(ie)}catch(q){}n=E}}this.recordInputHistory(n),this.contentChangeDebounceTimer&&clearTimeout(this.contentChangeDebounceTimer);const k=()=>{this.dispatchEvent(new CustomEvent("content-change",{detail:{html:ht(n)},bubbles:!0}))};a.debounceInputMs>0?this.contentChangeDebounceTimer=setTimeout(k,a.debounceInputMs):k(),this.updateStatusBar()}),this.contentElement.addEventListener("contextmenu",o=>{const n=this.config.contextMenu;(n===!1||typeof n=="object"&&n!==null&&n.enabled===!1)&&o.preventDefault()}),this.contentElement.addEventListener("paste",o=>{var f,k;if(o.__editoraSmartPasteHandled===!0||o.defaultPrevented)return;o.preventDefault();const n=this.config.paste||{};let i=((f=o.clipboardData)==null?void 0:f.getData("text/html"))||"";const a=((k=o.clipboardData)==null?void 0:k.getData("text/plain"))||"",c=this.getContentSanitizeConfig(),d=this.getSecurityConfig(),m=!!i&&/class=["'][^"']*Mso|xmlns:w=|urn:schemas-microsoft-com:office/i.test(i);if((n.clean||!n.keepFormatting)&&a){document.execCommand("insertText",!1,a);return}if(n.convertWord===!1&&m&&a){document.execCommand("insertText",!1,a);return}if(i){d.sanitizeOnPaste!==!1&&c.sanitize!==!1&&(i=fo(i,c,d)),this.insertHTMLAtSelection(i);return}a&&document.execCommand("insertText",!1,a)}),this.contentElement.addEventListener("focus",()=>{Z=this,this.dispatchEvent(new Event("editor-focus",{bubbles:!0})),this.updateStatusBar()}),this.contentElement.addEventListener("blur",()=>{this.contentChangeDebounceTimer&&(clearTimeout(this.contentChangeDebounceTimer),this.contentChangeDebounceTimer=void 0),this.contentElement&&this.dispatchEvent(new CustomEvent("content-change",{detail:{html:he(this.contentElement)},bubbles:!0})),this.dispatchEvent(new Event("editor-blur",{bubbles:!0})),this.updateFloatingToolbar(),this.updateStatusBar()}),this.contentElement.addEventListener("keydown",o=>{this.getAccessibilityConfig().keyboardNavigation&&e.handleKeyDown(o,(i,a)=>{this.executeCommand(i,a)})});const t=()=>{const o=this.getSelectionRangeInEditor(),n=document.activeElement,i=!!n&&!!this.contentElement&&(n===this.contentElement||this.contentElement.contains(n));this.getPerformanceConfig().viewportOnlyScan&&!this.isEditorInViewport()&&!i||!o&&!i||(this.updateFloatingToolbar(),this.updateStatusBar())};this.selectionChangeHandler=t,document.addEventListener("selectionchange",this.selectionChangeHandler)}getSelectionRangeInEditor(){if(!this.contentElement)return null;const e=window.getSelection();if(!e||e.rangeCount===0)return null;const t=e.getRangeAt(0),o=t.commonAncestorContainer;return this.contentElement.contains(o)?t:null}isSelectionBackward(e){if(!e.anchorNode||!e.focusNode)return!1;try{const t=document.createRange();return t.setStart(e.anchorNode,e.anchorOffset),t.setEnd(e.focusNode,e.focusOffset),t.collapsed}catch(t){return!1}}getSelectionAnchorRect(e,t){const o=Array.from(t.getClientRects()).filter(i=>i.width>0||i.height>0);return o.length===0?t.getBoundingClientRect():this.isSelectionBackward(e)?o[0]:o[o.length-1]}updateFloatingToolbar(){if(!this.floatingToolbar||!this.contentElement)return;if(this.config.readonly||this.contentElement.contentEditable==="false"||this.contentElement.getAttribute("data-readonly")==="true"||this.isReadonlyAttribute(this.getAttribute("readonly"))||this.getAttribute("data-readonly")==="true"){this.floatingToolbar.hide();return}const t=this.getPerformanceConfig(),o=document.activeElement===this.contentElement||!!this.contentElement&&this.contentElement.contains(document.activeElement);if(t.viewportOnlyScan&&!this.isEditorInViewport()&&!o){this.floatingToolbar.hide();return}const n=this.getSelectionRangeInEditor();if(!n){this.floatingToolbar.hide();return}if(n.collapsed){this.floatingToolbar.hide();return}const i=window.getSelection();if(!i){this.floatingToolbar.hide();return}const a=this.getSelectionAnchorRect(i,n);if(!a){this.floatingToolbar.hide();return}this.floatingToolbar.show(a.left,a.top-40)}updateStatusBar(){if(!this.statusBar||!this.contentElement)return;const e=this.getPerformanceConfig(),t=document.activeElement===this.contentElement||this.contentElement.contains(document.activeElement);if(e.viewportOnlyScan&&!this.isEditorInViewport()&&!t)return;const o=this.contentElement.textContent||"",{words:n,chars:i}=qt(o),a=Wt(this.contentElement);let c,d;const m=this.getSelectionRangeInEditor();m&&(c=jt(this.contentElement,m),m.collapsed||(d=Gt(m,c),c=void 0)),this.statusBar.update({wordCount:n,charCount:i,lineCount:a,cursorPosition:c,selectionInfo:d})}isReadonlyAttribute(e){return e!==null&&e!=="false"}handleAttributeChange(e,t){switch(e){case"readonly":this.contentElement&&(this.contentElement.contentEditable=this.isReadonlyAttribute(t)?"false":"true",this.applyAccessibilitySettings()),this.engine&&this.engine.setReadonly(this.isReadonlyAttribute(t));break;case"theme":this.classList.forEach(o=>{o.startsWith("editora-theme-")&&this.classList.remove(o)}),t&&this.classList.add(`editora-theme-${t}`);break;case"placeholder":this.contentElement&&(this.contentElement.setAttribute("data-placeholder",t),this.applyAccessibilitySettings());break;case"aria-label":case"accessibility":case"accessibility-enable-aria":case"accessibility-keyboard-navigation":case"accessibility-checker":this.applyAccessibilitySettings();break;case"performance":case"performance-debounce-input-ms":case"performance-viewport-only-scan":break;case"language":case"language-locale":case"language-direction":this.applyLanguageSettings();break;case"spellcheck":case"spellcheck-enabled":case"spellcheck-provider":this.applySpellcheckSettings();break;case"autosave":case"autosave-enabled":case"autosave-interval-ms":case"autosave-storage-key":case"autosave-provider":case"autosave-api-url":this.startAutosave();break;case"security":case"security-sanitize-on-paste":case"security-sanitize-on-input":case"paste":case"paste-clean":case"paste-keep-formatting":case"paste-convert-word":case"context-menu":case"context-menu-enabled":break;case"toolbar":case"toolbar-items":case"toolbar-floating":case"toolbar-sticky":case"plugins":case"statusbar":this.isConnected&&(this.destroy(),this.waitForPluginLoader().then(()=>{this.initialize().catch(o=>{console.error("[RichTextEditor] Error during attribute change re-initialization:",o)})}));break}}resolveConfig(){const e={};for(let t=0;t<this.attributes.length;t++){const o=this.attributes[t];e[o.name]=o.value}return Ue.resolve({jsConfig:this.jsConfig,attributes:e})}getAPI(){return{getContent:()=>he(this.contentElement),setContent:e=>{this.contentElement&&(this.contentElement.innerHTML=this.sanitizeLoadedContent(e))},execCommand:(e,t)=>this.executeCommand(e,t),focus:()=>{var e;(e=this.contentElement)==null||e.focus()},blur:()=>{var e;(e=this.contentElement)==null||e.blur()},destroy:()=>{this.destroy()},on:(e,t)=>(this.addEventListener(e,t),()=>this.removeEventListener(e,t)),getConfig:()=>({...this.config}),setReadonly:e=>{this.setAttribute("readonly",e.toString())}}}destroy(){var e,t,o,n;this.buildGeneration+=1,this.contentChangeDebounceTimer&&(clearTimeout(this.contentChangeDebounceTimer),this.contentChangeDebounceTimer=void 0),this.contentElement&&(this.preservedContent=he(this.contentElement),this.persistAutosave(this.preservedContent)),this.stopAutosave(),this.selectionChangeHandler&&(document.removeEventListener("selectionchange",this.selectionChangeHandler),this.selectionChangeHandler=void 0),(e=this.engine)==null||e.destroy(),(t=this.toolbar)==null||t.destroy(),(o=this.floatingToolbar)==null||o.destroy(),(n=this.statusBar)==null||n.destroy(),this.innerHTML="",this.contentElement=void 0,this.toolbarElement=void 0,this.statusBarElement=void 0,this.loadedPlugins=[],this.isInitialized=!1,pt.delete(this),Z===this&&(Z=null),this.dispatchEvent(new Event("editor-destroy",{bubbles:!0}))}getContent(){return he(this.contentElement)}setContent(e){this.contentElement&&(this.contentElement.innerHTML=this.sanitizeLoadedContent(e))}execCommand(e,...t){return this.executeCommand(e,...t)}focus(){var e;(e=this.contentElement)==null||e.focus()}blur(){var e;(e=this.contentElement)==null||e.blur()}}function pi(s){return new yo(s)}function mi(){typeof window!="undefined"&&!customElements.get("editora-editor")&&customElements.define("editora-editor",J)}return b.CharacterDialog=pn,b.ColorPicker=ln,b.CommandRegistry=Ht,b.ConfigResolver=Ue,b.Dialog=oe,b.DocumentModel=Ce,b.Dropdown=sn,b.Editor=on,b.EditorEngine=Ne,b.EditorState=ce,b.EmojiDialog=mn,b.FloatingToolbar=Ut,b.ImageDialog=un,b.KeyboardShortcutManager=Nt,b.LinkDialog=cn,b.MathDialog=hn,b.MediaPlugin=an,b.PluginLoader=go,b.PluginManager=Te,b.PluginRuntime=Pt,b.ReactAdapter=bo,b.RichTextEditorElement=J,b.Schema=Rt,b.SpellcheckPlugin=rn,b.StatusBar=Bt,b.TableDialog=dn,b.ToolbarRenderer=ze,b.VanillaAdapter=yo,b.calculateTextStats=qt,b.countLines=Wt,b.createEditor=pi,b.createPluginManager=tn,b.createPluginRuntime=nn,b.createReactAdapter=ti,b.getCleanEditorHTML=he,b.getCursorPosition=jt,b.getSelectionInfo=Gt,b.getTextOffset=$t,b.initWebComponent=mi,b.sanitizeHTML=mo,b.sanitizeInputHTML=ut,b.sanitizePastedHTML=fo,b.stripEditorUiArtifacts=ht,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b})({});
|
|
526
526
|
//# sourceMappingURL=editora.min.js.map
|