@richscripts/richtexteditor 2.13.0 → 2.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/richtexteditor/all_plugins.js +126 -10
- package/richtexteditor/all_plugins.min.js +53 -53
- package/richtexteditor/plugins/a11yenhance.min.js +1 -0
- package/richtexteditor/plugins/accessibilitychecker.min.js +1 -0
- package/richtexteditor/plugins/aitoolkit.min.js +14 -0
- package/richtexteditor/plugins/all_plugins.js +126 -10
- package/richtexteditor/plugins/all_plugins.min.js +53 -53
- package/richtexteditor/plugins/autocorrect.min.js +1 -0
- package/richtexteditor/plugins/autoembed.min.js +1 -0
- package/richtexteditor/plugins/blocktypes.min.js +2 -0
- package/richtexteditor/plugins/bookmarkcard.min.js +2 -0
- package/richtexteditor/plugins/changecase.min.js +1 -0
- package/richtexteditor/plugins/charlimit.min.js +2 -0
- package/richtexteditor/plugins/comments.min.js +3 -0
- package/richtexteditor/plugins/contentminimap.min.js +1 -0
- package/richtexteditor/plugins/crossreference.min.js +1 -0
- package/richtexteditor/plugins/dialoga11y.min.js +1 -0
- package/richtexteditor/plugins/dictation.min.js +1 -0
- package/richtexteditor/plugins/documentimport.min.js +4 -0
- package/richtexteditor/plugins/documentoutline.js +54 -6
- package/richtexteditor/plugins/documentoutline.min.js +1 -0
- package/richtexteditor/plugins/docxexport.min.js +2 -0
- package/richtexteditor/plugins/draghandle.min.js +1 -0
- package/richtexteditor/plugins/emailtoolkit.min.js +1 -0
- package/richtexteditor/plugins/emojiautocomplete.min.js +1 -0
- package/richtexteditor/plugins/foldheadings.min.js +1 -0
- package/richtexteditor/plugins/footnotes.min.js +1 -0
- package/richtexteditor/plugins/formatpainter.min.js +1 -0
- package/richtexteditor/plugins/formattingmarks.js +48 -3
- package/richtexteditor/plugins/formattingmarks.min.js +1 -0
- package/richtexteditor/plugins/gapcursor.min.js +1 -0
- package/richtexteditor/plugins/ghostcomplete.min.js +1 -0
- package/richtexteditor/plugins/html2pdf.min.js +1 -0
- package/richtexteditor/plugins/imageeditor.min.js +1 -0
- package/richtexteditor/plugins/importstyles.min.js +1 -0
- package/richtexteditor/plugins/inlinecode.min.js +1 -0
- package/richtexteditor/plugins/insertcode.min.js +8 -0
- package/richtexteditor/plugins/insertemoji.min.js +1 -0
- package/richtexteditor/plugins/insertgallery.min.js +1 -0
- package/richtexteditor/plugins/inserttemplate.min.js +1 -0
- package/richtexteditor/plugins/keyboarda11y.min.js +1 -0
- package/richtexteditor/plugins/layouttable.min.js +1 -0
- package/richtexteditor/plugins/linenumbers.min.js +1 -0
- package/richtexteditor/plugins/linkchecker.min.js +1 -0
- package/richtexteditor/plugins/localdraft.min.js +1 -0
- package/richtexteditor/plugins/markdownexport.min.js +2 -0
- package/richtexteditor/plugins/mathdialog.min.js +1 -0
- package/richtexteditor/plugins/mentionplugin.min.js +3 -0
- package/richtexteditor/plugins/mergefields.min.js +1 -0
- package/richtexteditor/plugins/mermaiddiagram.min.js +16 -0
- package/richtexteditor/plugins/multilevellist.min.js +1 -0
- package/richtexteditor/plugins/multiroot.min.js +1 -0
- package/richtexteditor/plugins/nodetypes.min.js +1 -0
- package/richtexteditor/plugins/pagination.min.js +1 -0
- package/richtexteditor/plugins/pdfexport.min.js +19 -0
- package/richtexteditor/plugins/permanentpen.min.js +1 -0
- package/richtexteditor/plugins/readabilitystats.min.js +1 -0
- package/richtexteditor/plugins/readaloud.min.js +1 -0
- package/richtexteditor/plugins/restrictedediting.min.js +2 -0
- package/richtexteditor/plugins/revisionhistory.min.js +3 -0
- package/richtexteditor/plugins/rtlui.min.js +2 -0
- package/richtexteditor/plugins/rubyannotation.min.js +1 -0
- package/richtexteditor/plugins/sanitizer.js +24 -1
- package/richtexteditor/plugins/sanitizer.min.js +1 -0
- package/richtexteditor/plugins/shadowdom.min.js +1 -0
- package/richtexteditor/plugins/slashcommand.min.js +2 -0
- package/richtexteditor/plugins/smartchips.min.js +2 -0
- package/richtexteditor/plugins/spellcheck.min.js +2 -0
- package/richtexteditor/plugins/stateinspector.min.js +2 -0
- package/richtexteditor/plugins/structured-content-bridge.js +5178 -0
- package/richtexteditor/plugins/structured-content-bridge.min.js +19 -0
- package/richtexteditor/plugins/tableofcontents.min.js +1 -0
- package/richtexteditor/plugins/tabletools.min.js +1 -0
- package/richtexteditor/plugins/textdirection.min.js +1 -0
- package/richtexteditor/plugins/textpartlanguage.min.js +1 -0
- package/richtexteditor/plugins/todolist.min.js +1 -0
- package/richtexteditor/plugins/trackedchanges.min.js +3 -0
- package/richtexteditor/plugins/typewriter.min.js +1 -0
- package/richtexteditor/plugins/watermark.min.js +1 -0
- package/richtexteditor/plugins/wordexport.min.js +23 -0
- package/richtexteditor/plugins/yjscollab.min.js +2 -0
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -0
- package/richtexteditor/rte-config.js +3 -0
- package/richtexteditor/rte.js +5 -2
- package/richtexteditor/runtime/colorpicker_more_ns.htm +93 -16
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_mathdialog=RTE_Plugin_MathDialog,RTE_DefaultConfig.mathDialogSamples=RTE_DefaultConfig.mathDialogSamples||["x^2 + y^2 = z^2","\\frac{a}{b}","\\sqrt{x}","\\sum_{i=1}^{n} i","\\int_0^1 x\\,dx","\\alpha\\beta\\gamma"];function RTE_Plugin_MathDialog(){var c=this,m,t;c.PluginName="MathDialog",c.InitConfig=function(e){m=e},c.InitEditor=function(e){t=e,t.attachEvent("exec_command_insertmath",function(a){a.returnValue=!0,c.OpenMathDialog()})};function i(e,a,n,p){var u=e.ownerDocument.createElement(a);return n&&(u.style.cssText=n),p&&(u.className=p),e.appendChild(u),u}function b(){try{var e=t.getSelection();if(!e||e.rangeCount===0)return null;for(var a=e.getRangeAt(0).startContainer,n=t.getEditable();a&&a!==n;){if(a.nodeType===1&&a.classList&&a.classList.contains("rte-math-inline"))return a;a=a.parentNode}}catch{}return null}function T(e){var a=e.katex||e.parent&&e.parent.katex;if(a&&typeof a.render=="function")return{kind:"katex",katex:a};var n=e.MathJax||e.parent&&e.parent.MathJax;return n&&n.typesetPromise?{kind:"mathjax",MathJax:n}:null}c.OpenMathDialog=function(){var e=b(),a=e&&e.getAttribute("data-tex")||"",n=t.createDialog(t.getLangText&&t.getLangText("insertmathtitle")||"Insert / edit equation","rte-dialog-math"),p=typeof n.close=="function"?function(){n.close()}:function(){t.closeCurrentPopup()},u=n.ownerDocument.defaultView||window,d=i(n,"div","padding:14px;min-width:420px;font:13px -apple-system,Segoe UI,sans-serif");i(d,"div","font-weight:600;margin-bottom:4px","").innerText=t.getLangText&&t.getLangText("insertmathlabel")||"TeX / LaTeX";var l=i(d,"textarea","width:100%;box-sizing:border-box;min-height:72px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:13px ui-monospace,Consolas,monospace;resize:vertical");l.value=a,l.placeholder="e.g. x^2 + y^2 = z^2";var w=i(d,"div","display:flex;flex-wrap:wrap;gap:6px;margin:8px 0");(m.mathDialogSamples||[]).forEach(function(r){var o=i(w,"button","font:11px ui-monospace,monospace;padding:3px 8px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc;cursor:pointer","");o.type="button",o.textContent=r,o.onclick=function(){l.value=r,s(),l.focus()}}),i(d,"div","font-weight:600;margin:10px 0 4px","").innerText=t.getLangText&&t.getLangText("insertmathpreview")||"Preview";var f=i(d,"div","min-height:48px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;overflow:auto;text-align:center"),k=i(d,"div","font-size:11px;color:#94a3b8;margin-top:4px",""),x=T(u);x||(k.innerText="No KaTeX/MathJax detected on the page \u2014 the equation is stored as markup and will render wherever a math renderer is loaded.");function s(){var r=l.value;if(!r.trim()){f.textContent="";return}if(x&&x.kind==="katex")try{x.katex.render(r,f,{throwOnError:!1,displayMode:!1})}catch(o){f.textContent="\u26A0 "+(o&&o.message?o.message:"render error")}else if(x&&x.kind==="mathjax"){f.textContent="\\("+r+"\\)";try{x.MathJax.typesetPromise([f])}catch{}}else f.textContent="$"+r+"$"}l.oninput=s,setTimeout(function(){l.focus(),s()},0);var v=i(d,"div","display:flex;justify-content:flex-end;gap:8px;margin-top:14px"),g=i(v,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer","");g.type="button",g.textContent="Cancel",g.onclick=p;var h=i(v,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer","");h.type="button",h.textContent=e?"Update":"Insert",h.onclick=function(){var r=l.value.trim();if(!r){p();return}if(e){e.setAttribute("data-tex",r),e.textContent="$"+r+"$",p(),t.renderMath&&t.renderMath(),t.focus();return}var o=String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),C=("$"+r+"$").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");t.insertHTML('<span class="rte-math-inline" data-tex="'+o+'">'+C+"</span>\u200B"),p(),t.renderMath&&t.renderMath(),t.focus()}}}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_mention=RTE_Plugin_Mention;function RTE_Plugin_Mention(){var w=this,l,s,p=null,i=null,C=null,h=[],v=null,m=null,f=[],c=0,y=!1,E=0,b=null;w.PluginName="Mention",w.InitConfig=function(e){l=e,l.mentionEnabled!==!1&&(l.mentionTrigger=l.mentionTrigger||"@",l.mentionDebounceMs=l.mentionDebounceMs==null?150:l.mentionDebounceMs,l.mentionMaxItems=l.mentionMaxItems||8,l.mentionStaticList=l.mentionStaticList||null,l.mentionSource=l.mentionSource||null,l.mentionInsertClass=l.mentionInsertClass||"rte-mention",l.mentionTriggers=l.mentionTriggers||null)},w.InitEditor=function(e){if(s=e,l.mentionEnabled!==!1){if(s.mentions={register:A,remove:M,list:function(){return h.slice()},close:d,isOpen:function(){return!!i}},(l.mentionSource||l.mentionStaticList)&&A({trigger:l.mentionTrigger,source:l.mentionSource||function(r){return P(l.mentionStaticList,r)}}),Array.isArray(l.mentionTriggers))for(var t=0;t<l.mentionTriggers.length;t++)A(l.mentionTriggers[t]);G();var n=s.getDocument();n.addEventListener("keydown",z,!0),n.addEventListener("input",H,!0),n.addEventListener("compositionstart",function(){y=!0}),n.addEventListener("compositionend",function(){y=!1}),n.addEventListener("mousedown",function(r){r.target&&r.target.closest&&r.target.closest("."+l.mentionInsertClass)||d()},!0),n.addEventListener("blur",function(){setTimeout(d,150)},!0),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O,!0)}};function A(e){if(!(!e||!e.trigger||typeof e.source!="function")){var t=T(e.trigger),n={trigger:e.trigger,source:e.source,renderItem:e.renderItem||null,renderInsert:e.renderInsert||null,insertClass:e.insertClass||l.mentionInsertClass,label:e.label||"mentions "+e.trigger};t>=0?h[t]=n:h.push(n)}}function M(e){var t=T(e);t>=0&&h.splice(t,1)}function T(e){for(var t=0;t<h.length;t++)if(h[t].trigger===e)return t;return-1}function x(e){return e&&(e.label||e.name||e.id)||""}function I(e){return e&&(e.subtitle||e.email)||""}function P(e,t){if(!Array.isArray(e))return[];if(!t)return e.slice(0,50);var n=t.toLowerCase();return e.filter(function(r){var o=(x(r)+" "+I(r)+" "+(r.id||"")).toLowerCase();return o.indexOf(n)!==-1})}function z(e){if(!y){if(i)switch(e.key){case"ArrowDown":e.preventDefault(),e.stopPropagation(),k(1);return;case"ArrowUp":e.preventDefault(),e.stopPropagation(),k(-1);return;case"Enter":case"Tab":if(f.length){e.preventDefault(),e.stopPropagation(),S();return}d();return;case"Escape":case"Esc":e.preventDefault(),e.stopPropagation(),d();return}if(!e.ctrlKey&&!e.metaKey&&!e.altKey){var t=T(e.key);if(t>=0&&q()){var n=h[t];setTimeout(function(){j(n)},0)}}}}function H(){i&&U()}function q(){var e=s.getSelection();if(!e||e.rangeCount===0||!e.isCollapsed)return!1;for(var t=e.getRangeAt(0),n=t.startContainer,r=t.startOffset,o=s.getEditable(),a=n.nodeType===1?n:n.parentNode;a&&a!==o;){var g=a.nodeName;if(g==="CODE"||g==="PRE"||a.classList&&a.classList.contains(l.mentionInsertClass))return!1;a=a.parentNode}if(n.nodeType===3){if(r===0)return!0;var u=n.nodeValue.charAt(r-1);return/\s/.test(u)}return!0}function j(e){d();var t=s.getSelection();if(!(!t||t.rangeCount===0)){var n=t.getRangeAt(0).cloneRange();v=e,m={range:n,startNode:n.startContainer,startOffset:n.startOffset,triggerCharCount:1,query:""},_(),L(),R("")}}function d(){b&&(clearTimeout(b),b=null),i&&i.parentNode&&i.parentNode.removeChild(i),i=null,C=null,v=null,m=null,f=[],c=0}function U(){if(m){var e=s.getSelection();if(!e||e.rangeCount===0||!e.isCollapsed){d();return}var t=e.getRangeAt(0),n=t.startContainer;if(n!==m.startNode){d();return}var r=t.startOffset;if(r<m.startOffset){d();return}var o=(n.nodeType===3?n.nodeValue:"")||"",a=o.substring(m.startOffset,r);if(/\s/.test(a)){d();return}m.query=a,R(a),L()}}function R(e){if(!v)return;var t=++E;b&&(clearTimeout(b),b=null);var n=e.length===0?0:l.mentionDebounceMs;function r(){B();var o;try{o=v.source(e,{trigger:v.trigger})}catch(a){console.warn("Mention source threw:",a),o=[]}Promise.resolve(o).then(function(a){t!==E||!i||(f=Array.isArray(a)?a.slice(0,l.mentionMaxItems):[],c=0,N())},function(a){t!==E||!i||(console.warn("Mention source failed:",a),f=[],N())})}n>0?b=setTimeout(r,n):r()}function _(){p=s.iframe.ownerDocument,i=p.createElement("div"),i.className="rte-mention-popup",i.setAttribute("role","listbox"),i.setAttribute("aria-label",v.label),p.body.appendChild(i)}function B(){if(i){i.innerHTML="";var e=p.createElement("div");e.className="rte-mention-loading",e.textContent="Searching\u2026",i.appendChild(e),C=e}}function N(){if(i){if(i.innerHTML="",C=null,!f.length){var e=p.createElement("div");e.className="rte-mention-empty",e.textContent="No matches",i.appendChild(e);return}for(var t=0;t<f.length;t++)(function(n,r){var o=p.createElement("button");o.type="button",o.className="rte-mention-item"+(r===c?" rte-mention-item-active":""),o.setAttribute("role","option"),o.setAttribute("aria-selected",r===c?"true":"false"),o.setAttribute("data-index",r),v.renderItem?v.renderItem(o,n):K(o,n),o.addEventListener("mousedown",function(a){a.preventDefault(),a.stopPropagation(),c=r,S()}),o.addEventListener("click",function(a){i&&(a.preventDefault(),a.stopPropagation(),c=r,S())}),o.addEventListener("mouseenter",function(){c!==r&&(c=r,D())}),i.appendChild(o)})(f[t],t)}}function K(e,t){var n=p.createElement("span");if(n.className="rte-mention-avatar",t.avatarUrl){var r=p.createElement("img");r.src=t.avatarUrl,r.alt="",n.appendChild(r)}else n.textContent=V(x(t)||"?");e.appendChild(n);var o=p.createElement("span");o.className="rte-mention-body";var a=p.createElement("span");a.className="rte-mention-label",a.textContent=x(t),o.appendChild(a);var g=I(t);if(g){var u=p.createElement("span");u.className="rte-mention-subtitle",u.textContent=g,o.appendChild(u)}e.appendChild(o)}function V(e){var t=String(e).trim().split(/\s+/);return t[0]?t.length===1?t[0].charAt(0).toUpperCase():(t[0].charAt(0)+t[t.length-1].charAt(0)).toUpperCase():"?"}function D(){if(i){for(var e=i.querySelectorAll(".rte-mention-item"),t=0;t<e.length;t++){var n=+e[t].getAttribute("data-index"),r=n===c;e[t].classList.toggle("rte-mention-item-active",r),e[t].setAttribute("aria-selected",r?"true":"false")}Y()}}function Y(){if(i){var e=i.querySelector(".rte-mention-item-active");if(e){var t=e.offsetTop,n=t+e.offsetHeight;t<i.scrollTop?i.scrollTop=t:n>i.scrollTop+i.clientHeight&&(i.scrollTop=n-i.clientHeight)}}}function k(e){f.length&&(c=(c+e+f.length)%f.length,D())}function S(){if(!f.length){d();return}var e=f[c],t=m,n=v;d(),!(!e||!t||!n)&&(X(t),F(n,e))}function X(e){var t=e.startNode;if(t){var n=e.startOffset-(e.triggerCharCount||0);n<0&&(n=0);var r=s.getSelection();if(!(!r||r.rangeCount===0)){var o=r.getRangeAt(0),a=o.startContainer,g=o.startOffset,u=s.getDocument().createRange();u.setStart(t,n),u.setEnd(a,g);try{u.deleteContents()}catch{return}r.removeAllRanges(),r.addRange(u)}}}function F(e,t){var n=s.getDocument(),r;if(e.renderInsert?r=e.renderInsert(n,t):(r=n.createElement("span"),r.className=e.insertClass,r.setAttribute("contenteditable","false"),r.setAttribute("data-rte-mention-id",t.id!=null?t.id:""),r.setAttribute("data-rte-mention-trigger",e.trigger),r.textContent=e.trigger+x(t)),!!r){var o=s.getSelection();if(!(!o||o.rangeCount===0)){var a=o.getRangeAt(0);a.insertNode(r);var g=n.createTextNode("\xA0");r.parentNode.insertBefore(g,r.nextSibling);var u=n.createRange();u.setStartAfter(g),u.collapse(!0),o.removeAllRanges(),o.addRange(u)}}}function L(){if(!(!i||!m)){var e=s.iframe,t=e.getBoundingClientRect(),n=m.range.getClientRects(),r=n&&n.length?n[n.length-1]:null;r||(r=m.range.getBoundingClientRect());var o=t.left+(r.left||0)+window.pageXOffset,a=t.top+(r.bottom||r.top||0)+window.pageYOffset+4;i.style.position="absolute",i.style.left=o+"px",i.style.top=a+"px";var g=window.innerHeight||document.documentElement.clientHeight,u=i.getBoundingClientRect();u.bottom>g-8&&t.top+(r.top||0)>u.height+16&&(i.style.top=t.top+(r.top||0)+window.pageYOffset-u.height-4+"px")}}function O(){i&&L()}function G(){var e=s&&s.iframe&&s.iframe.ownerDocument||document;if(!e.querySelector("style[data-rte-mention]")){var t=e.createElement("style");t.setAttribute("data-rte-mention","1"),t.textContent=["/* 2026-07-12 mention picker precision */",".rte-mention-popup{position:absolute;z-index:2147483000;min-width:240px;max-width:min(340px,calc(100vw - 24px));max-height:min(320px,60vh);overflow-y:auto;padding:5px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.96));border:1px solid rgba(148,163,184,.22);box-shadow:0 14px 32px rgba(29,78,216,.12),0 2px 8px rgba(15,23,42,.08);border-radius:8px;font-family:Aptos,'Segoe UI',sans-serif;font-size:13px;color:#172033;scrollbar-width:thin}",".rte-mention-item{display:flex;align-items:center;gap:9px;width:100%;min-height:40px;padding:6px 8px;border:0;background:transparent;text-align:left;cursor:pointer;color:inherit;font:inherit;border-radius:7px}",".rte-mention-item:hover,.rte-mention-item-active{background:#eef4ff;color:#0f3f9f}",".rte-mention-avatar{flex:0 0 30px;width:30px;height:30px;border-radius:8px;overflow:hidden;display:inline-flex;align-items:center;justify-content:center;background:#e7eefb;color:#315277;font-size:11px;font-weight:800;letter-spacing:.02em;box-shadow:inset 0 0 0 1px rgba(148,163,184,.18)}",".rte-mention-avatar img{width:100%;height:100%;object-fit:cover}",".rte-mention-item-active .rte-mention-avatar{background:#ffffff;color:#0f3f9f}",".rte-mention-body{display:flex;flex-direction:column;min-width:0;flex:1}",".rte-mention-label{font-weight:750;font-size:13px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-mention-subtitle{font-size:11px;color:#64748b;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}",".rte-mention-item-active .rte-mention-subtitle{color:#315277}",".rte-mention-loading,.rte-mention-empty{padding:14px 16px;color:#52657e;font-size:12px;font-weight:700;text-align:center}",".rte-mention{display:inline-block;padding:1px 7px;border-radius:999px;background:#eef4ff;color:#0f3f9f;font-weight:650;cursor:default;border:1px solid rgba(37,99,235,.16)}",".rte-mention:hover{background:#e4edff}"].join(`
|
|
2
|
+
`),e.head.appendChild(t),s&&typeof s.ensureStyleSheetLive=="function"&&s.ensureStyleSheetLive(e,t,"rte-mentionplugin-style",t.textContent);var n=s.getDocument();if(n&&n.head&&!n.querySelector("style[data-rte-mention-inline]")){var r=n.createElement("style");r.setAttribute("data-rte-mention-inline","1"),r.textContent=[".rte-mention{display:inline-block;padding:1px 7px;border-radius:999px;background:#eef4ff;color:#0f3f9f;font-weight:650;cursor:default;border:1px solid rgba(37,99,235,.16);user-select:all}",".rte-mention:hover{background:#e4edff}"].join(`
|
|
3
|
+
`),n.head.appendChild(r),s&&typeof s.ensureStyleSheetLive=="function"&&s.ensureStyleSheetLive(n,r,"rte-mentionplugin-iStyle",r.textContent)}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_mergefields=RTE_Plugin_MergeFields,typeof RTE_DefaultConfig.mergeFields>"u"&&(RTE_DefaultConfig.mergeFields=[{id:"recipient.name",label:"Recipient name",sample:"Ada Lovelace"},{id:"recipient.email",label:"Recipient email",sample:"ada@example.com"},{id:"company.name",label:"Company name",sample:"Analytical Engines Ltd"},{id:"document.title",label:"Document title",sample:"Statement of Work"},{id:"date.today",label:"Today's date",sample:function(){return new Date().toLocaleDateString()}}]),typeof RTE_DefaultConfig.mergeFieldPrefix>"u"&&(RTE_DefaultConfig.mergeFieldPrefix="{{"),typeof RTE_DefaultConfig.mergeFieldSuffix>"u"&&(RTE_DefaultConfig.mergeFieldSuffix="}}"),typeof RTE_DefaultConfig.mergeFieldMissing>"u"&&(RTE_DefaultConfig.mergeFieldMissing="placeholder");function RTE_Plugin_MergeFields(){var f=this,c,a,C=null,u=!1,h=!1;f.PluginName="MergeFields",f.InitConfig=function(e){c=e},f.InitEditor=function(e){a=e,a.attachEvent("exec_command_insertmergefield",function(t){t.returnValue=!0,f.Insert(t&&t.value)}),d();try{a.attachEvent("ready",d)}catch{}try{a.attachEvent("aftersethtml",d)}catch{}setTimeout(d,0),a.getMergeFieldDefinitions=function(){return m().slice()},a.insertMergeField=function(t){return f.Insert(t)},a.listMergeFields=function(){return f.List()},a.setMergeFieldPreview=function(t){return w(!!t)},a.toggleMergeFieldPreview=function(){return w(!u)},a.isMergeFieldPreview=function(){return u},a.renderMergeFields=function(t){return f.Render(t)},a.getMergeFieldCss=function(){return S()}};function d(){var e=x();e&&(L(e),R(),e!==C&&(C=e,F()))}function x(){try{return a.getDocument()}catch{return null}}function p(){try{return a.getEditable()}catch{return null}}function m(){var e=c.mergeFields;return Object.prototype.toString.call(e)==="[object Array]"?e:[]}function v(e){for(var t=m(),r=0;r<t.length;r++)if(t[r]&&t[r].id===e)return t[r];return null}function g(e){var t=v(e),r=t&&t.label?t.label:e;return String(c.mergeFieldPrefix||"")+r+String(c.mergeFieldSuffix||"")}function E(e){var t=v(e);if(!t)return"";var r=t.sample;if(typeof r=="function")try{return String(r(e))}catch{return""}return r==null?"":String(r)}f.Insert=function(e){var t=x(),r=p();if(!t||!r)return!1;if(!e){var i=m()[0];if(!i)return!1;e=i.id}var n=t.createElement("span");n.className="rte-merge-field",n.setAttribute("data-merge-field",e),n.setAttribute("contenteditable","false"),n.textContent=u?E(e):g(e),u&&(n.className+=" rte-merge-preview");var l=!1;try{typeof a.insertElement=="function"&&(a.insertElement(n),l=!0)}catch{}if(!l)try{var o=a.getSelection();if(o&&o.rangeCount){var s=o.getRangeAt(0);s.collapse(!1),s.insertNode(n),s.setStartAfter(n),s.collapse(!0),o.removeAllRanges(),o.addRange(s),l=!0}}catch{}return l||r.appendChild(n),A(),e};function y(){var e=p();return e?Array.prototype.slice.call(e.querySelectorAll("span.rte-merge-field[data-merge-field]")):[]}f.List=function(){for(var e=[],t={},r=y(),i=0;i<r.length;i++){var n=r[i].getAttribute("data-merge-field"),l=v(n);e.push({id:n,label:l&&l.label?l.label:n,known:!!l,count:t[n]=(t[n]||0)+1})}return e};function w(e){return u=!!e,F(),u}function F(){for(var e=y(),t=0;t<e.length;t++)D(e[t])}function D(e){var t=e.getAttribute("data-merge-field");u?(e.textContent=E(t),e.classList&&e.classList.add("rte-merge-preview")):(e.textContent=g(t),e.classList&&e.classList.remove("rte-merge-preview"))}f.Render=function(e){var t=p();if(!t)return"";for(var r=t.cloneNode(!0),i=r.querySelectorAll("span.rte-merge-field[data-merge-field]"),n=0;n<i.length;n++){var l=i[n],o=l.getAttribute("data-merge-field"),s=T(e,o);if(s==null){String(c.mergeFieldMissing)==="empty"?l.parentNode&&l.parentNode.removeChild(l):l.textContent=g(o);continue}var b=l.ownerDocument.createTextNode(String(s));l.parentNode&&l.parentNode.replaceChild(b,l)}return r.innerHTML};function T(e,t){if(!e||typeof e!="object")return null;if(Object.prototype.hasOwnProperty.call(e,t))return e[t];for(var r=String(t).split("."),i=e,n=0;n<r.length;n++){if(i==null||typeof i!="object"||!Object.prototype.hasOwnProperty.call(i,r[n]))return null;i=i[r[n]]}return i??null}function _(){if(!u)return function(){};for(var e=y(),t=[],r=0;r<e.length;r++)t.push({chip:e[r],text:e[r].textContent}),e[r].textContent=g(e[r].getAttribute("data-merge-field")),e[r].classList&&e[r].classList.remove("rte-merge-preview");return function(){for(var n=0;n<t.length;n++)t[n].chip.textContent=t[n].text,t[n].chip.classList&&t[n].chip.classList.add("rte-merge-preview")}}function R(){if(!h){for(var e=["getHTMLCode","getJSON","getHTMLContent","getText"],t=!1,r=0;r<e.length;r++)(function(i){var n=a[i];if(!(typeof n!="function"||n.__rteMfWrapped)){var l=function(){var o=_();try{return n.apply(a,arguments)}finally{o()}};l.__rteMfWrapped=!0,a[i]=l,t=!0}})(e[r]);t&&(h=!0)}}function A(){try{typeof a.updateDesign=="function"&&a.updateDesign()}catch{}try{typeof a.fireChange=="function"&&a.fireChange()}catch{}}function S(){return"span.rte-merge-field{display:inline-block;padding:0 .35em;border-radius:3px;background:#e8f0fe;color:#1a4fa0;border:1px solid #c3d8f7;font-size:.94em;white-space:nowrap;user-select:none;cursor:default;}span.rte-merge-field.rte-merge-preview{background:#eef7ed;color:#1e6b32;border-color:#c6e3c8;}"}function L(e){if(e){var t=e.getElementById("rte-merge-field-styles"),r=S();if(t){if(t.getAttribute("data-css")===r)return;t.parentNode&&t.parentNode.removeChild(t)}var i=e.createElement("style");i.id="rte-merge-field-styles",i.setAttribute("data-css",r),i.appendChild(e.createTextNode(r)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(i),a&&typeof a.ensureStyleSheetLive=="function"&&a.ensureStyleSheetLive(e,i,"rte-merge-field-styles",i.textContent)}}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_mermaiddiagram=RTE_Plugin_MermaidDiagram,RTE_DefaultConfig.diagramResolver=RTE_DefaultConfig.diagramResolver||null,RTE_DefaultConfig.diagramSamples=RTE_DefaultConfig.diagramSamples||[`graph TD
|
|
2
|
+
A[Start] --> B{Decision}
|
|
3
|
+
B -->|Yes| C[Do it]
|
|
4
|
+
B -->|No| D[Skip]`,`sequenceDiagram
|
|
5
|
+
Alice->>Bob: Hello Bob
|
|
6
|
+
Bob-->>Alice: Hi Alice`,`pie title Pets
|
|
7
|
+
"Dogs" : 386
|
|
8
|
+
"Cats" : 85
|
|
9
|
+
"Birds" : 24`,`gantt
|
|
10
|
+
title Schedule
|
|
11
|
+
dateFormat YYYY-MM-DD
|
|
12
|
+
section Phase 1
|
|
13
|
+
Spec :a1, 2026-01-01, 20d
|
|
14
|
+
Build :after a1, 30d`];var RTE_MermaidSeq=0;function RTE_Plugin_MermaidDiagram(){var s=this,f,n;s.PluginName="MermaidDiagram",s.InitConfig=function(e){f=e},s.InitEditor=function(e){n=e,n.renderDiagrams=function(){return s.RenderAll()},n.attachEvent("exec_command_insertdiagram",function(r){r.returnValue=!0,s.OpenDiagramDialog()});try{var t=n.getEditable();t&&t.addEventListener("dblclick",function(r){var a=x(r.target,t);a&&(r.preventDefault(),s.OpenDiagramDialog(a))}),t&&t.addEventListener("click",function(r){for(var a=r.target;a&&a!==t;){if(a.nodeType===1&&a.getAttribute&&a.getAttribute("data-rte-mermaid-remove")==="1"){var i=x(a,t);i&&(r.preventDefault(),r.stopPropagation(),S(i));return}a=a.parentNode}},!0),t&&t.addEventListener("keydown",function(r){if(!(r.key!=="Delete"&&r.key!=="Backspace")){var a=E();a&&(r.preventDefault(),S(a))}},!0)}catch{}};function u(e,t,r,a){var i=e.ownerDocument.createElement(t);return r&&(i.style.cssText=r),a&&(i.className=a),e.appendChild(i),i}function T(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function C(e){return String(e).replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function M(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function x(e,t){for(;e&&e!==t;){if(e.nodeType===1&&e.classList&&e.classList.contains("rte-mermaid"))return e;e=e.parentNode}return null}function E(){try{var e=n.getSelection();return!e||e.rangeCount===0?null:x(e.getRangeAt(0).startContainer,n.getEditable())}catch{return null}}function S(e){if(!(!e||!e.parentNode)){e.parentNode.removeChild(e);try{typeof n.fireChange=="function"&&n.fireChange()}catch{}try{n.focus()}catch{}}}function R(e){if(!(!e||e.getElementById("rte-mermaid-styles"))){var t=".rte-mermaid{position:relative;display:block;margin:12px 0;padding:12px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;text-align:center;overflow:auto;}.rte-mermaid-remove{position:absolute;top:7px;right:7px;width:24px;height:24px;border:1px solid rgba(15,23,42,.14);border-radius:999px;background:rgba(255,255,255,.96);color:#334155;font:700 13px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;box-shadow:0 4px 12px rgba(15,23,42,.12);opacity:0;cursor:pointer;transition:opacity 120ms,border-color 120ms,color 120ms;}.rte-mermaid:hover .rte-mermaid-remove,.rte-mermaid-remove:focus{opacity:1;}.rte-mermaid-remove:hover{border-color:rgba(220,38,38,.38);color:#b91c1c;}.rte-mermaid svg{max-width:100%;height:auto;}.rte-mermaid .rte-mermaid-src{display:block;text-align:left;white-space:pre;overflow:auto;font:12px ui-monospace,Consolas,monospace;color:#334155;background:#f8fafc;border-radius:6px;padding:10px;margin:0;}.rte-mermaid .rte-mermaid-err{color:#b91c1c;font:12px ui-monospace,monospace;text-align:left;}",r=e.createElement("style");r.id="rte-mermaid-styles",r.appendChild(e.createTextNode(t)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(r),n&&typeof n.ensureStyleSheetLive=="function"&&n.ensureStyleSheetLive(e,r,"rte-mermaid-styles",r.textContent)}}function L(e){try{return e.mermaid||e.parent&&e.parent.mermaid||null}catch{return null}}function B(e,t,r){return new Promise(function(a,i){try{var d=e.render(t,r);d&&typeof d.then=="function"?d.then(function(l){a(l&&l.svg?l.svg:l)},i):typeof d=="string"?a(d):i(new Error("Unsupported Mermaid API"))}catch(l){i(l)}})}function v(e,t){var r=e.ownerDocument,a=r.defaultView||window;function i(o){e.innerHTML="";var c=r.createElement("pre");if(c.className="rte-mermaid-src",c.textContent=t,e.appendChild(c),o){var g=r.createElement("div");g.className="rte-mermaid-err",g.textContent=o,e.appendChild(g)}}if(typeof f.diagramResolver=="function")return Promise.resolve().then(function(){return f.diagramResolver(t)}).then(function(o){if(o&&o.svg)e.innerHTML=o.svg;else if(o&&o.imageUrl){e.innerHTML="";var c=r.createElement("img");c.src=o.imageUrl,c.alt="diagram",c.style.maxWidth="100%",e.appendChild(c)}else i("")}).catch(function(o){i(o&&o.message?o.message:"resolver error")});var d=L(a);if(d&&typeof d.render=="function"){var l="rtemmd"+ ++RTE_MermaidSeq;return B(d,l,t).then(function(o){e.innerHTML=o}).catch(function(o){i(o&&o.message?o.message:"render error")})}return i(""),Promise.resolve()}s.RenderAll=function(){var e=n.getEditable();if(!e)return 0;R(n.getDocument());for(var t=e.querySelectorAll(".rte-mermaid[data-diagram]"),r=0;r<t.length;r++){var a=t[r],i=a.querySelector(".rte-mermaid-render");i||(i=a.ownerDocument.createElement("div"),i.className="rte-mermaid-render",a.appendChild(i)),v(i,C(a.getAttribute("data-diagram")||""))}return t.length};function N(e,t){var r=T(e);return'<div class="rte-mermaid" data-rte-diagram="1" data-diagram="'+r+'" contenteditable="false"'+(t?' id="'+t+'"':"")+'><button type="button" class="rte-mermaid-remove" data-rte-mermaid-remove="1" aria-label="Remove diagram" title="Remove diagram">x</button><div class="rte-mermaid-render"><pre class="rte-mermaid-src">'+M(e)+"</pre></div></div>"}s.OpenDiagramDialog=function(e){e||(e=E());var t=e?C(e.getAttribute("data-diagram")||""):"",r=n.createDialog(n.getLangText&&n.getLangText("insertdiagramtitle")||"Insert / edit diagram","rte-dialog-diagram"),a=typeof r.close=="function"?function(){r.close()}:function(){n.closeCurrentPopup()},i=r.ownerDocument.defaultView||window,d=u(r,"div","padding:14px;min-width:480px;font:13px -apple-system,Segoe UI,sans-serif");u(d,"div","font-weight:600;margin-bottom:4px").innerText=n.getLangText&&n.getLangText("insertdiagramlabel")||"Mermaid";var l=u(d,"textarea","width:100%;box-sizing:border-box;min-height:120px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:12px ui-monospace,Consolas,monospace;resize:vertical");l.value=t,l.placeholder=`graph TD
|
|
15
|
+
A --> B`;var o=u(d,"div","display:flex;flex-wrap:wrap;gap:6px;margin:8px 0");(f.diagramSamples||[]).forEach(function(p){var m=u(o,"button","font:11px ui-monospace,monospace;padding:3px 8px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc;cursor:pointer");m.type="button",m.textContent=(p.split(`
|
|
16
|
+
`)[0]||"sample").slice(0,22),m.title=p,m.onclick=function(){l.value=p,h(),l.focus()}}),u(d,"div","font-weight:600;margin:10px 0 4px").innerText=n.getLangText&&n.getLangText("insertdiagrampreview")||"Preview";var c=u(d,"div","min-height:80px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;overflow:auto;text-align:center"),g=u(d,"div","font-size:11px;color:#94a3b8;margin-top:4px");typeof f.diagramResolver!="function"&&!L(i)&&(g.innerText="No Mermaid renderer detected on the page \u2014 the diagram is stored as source and will render wherever Mermaid (or config.diagramResolver) is available.");var b=null;function h(){var p=l.value.trim();if(!p){c.textContent="";return}b&&clearTimeout(b),b=setTimeout(function(){var m=c.ownerDocument.createElement("div");m.className="rte-mermaid-render",c.innerHTML="",c.appendChild(m),v(m,p)},250)}l.oninput=h,setTimeout(function(){l.focus(),h()},0);var k=u(d,"div","display:flex;justify-content:flex-end;gap:8px;margin-top:14px"),y=u(k,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");y.type="button",y.textContent="Cancel",y.onclick=a;var w=u(k,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");w.type="button",w.textContent=e?"Update":"Insert",w.onclick=function(){var p=l.value.trim();if(!p){a();return}if(R(n.getDocument()),e){e.setAttribute("data-diagram",T(p));var m=e.querySelector(".rte-mermaid-render");m||(m=e.ownerDocument.createElement("div"),m.className="rte-mermaid-render",e.appendChild(m)),v(m,p),a(),n.focus();return}var A="rtemmd-pending-"+ ++RTE_MermaidSeq;n.insertHTML(N(p,A)),a();try{var _=n.getDocument(),D=_.getElementById(A);if(D){D.removeAttribute("id");var m=D.querySelector(".rte-mermaid-render");v(m,p)}}catch{}n.focus()}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_multilevellist=RTE_Plugin_MultiLevelList,typeof RTE_DefaultConfig.legalListClass>"u"&&(RTE_DefaultConfig.legalListClass="rte-legal-list"),typeof RTE_DefaultConfig.legalListSeparator>"u"&&(RTE_DefaultConfig.legalListSeparator="."),typeof RTE_DefaultConfig.legalListSuffix>"u"&&(RTE_DefaultConfig.legalListSuffix=".");function RTE_Plugin_MultiLevelList(){var s=this,a,l,u=null;s.PluginName="MultiLevelList",s.InitConfig=function(e){a=e},s.InitEditor=function(e){l=e,r();try{l.attachEvent("ready",r)}catch{}try{l.attachEvent("aftersethtml",r)}catch{}setTimeout(r,0),l.setLegalNumbering=function(i){return g(!!i)},l.toggleLegalNumbering=function(){return g(!f(o()))},l.isLegalNumbering=function(){return f(o())},l.getLegalListCss=function(){return c()}};function r(){var e=p();e&&e!==u?(d(e),u=e):e&&d(e)}function p(){try{return l.getDocument()}catch{return null}}function L(){try{return l.getEditable()}catch{return null}}function o(){try{var e=l.getSelection();if(!e||e.rangeCount===0)return null;var i=L(),t=e.getRangeAt(0).startContainer;t&&t.nodeType===3&&(t=t.parentNode);for(var n=null;t&&t!==i;)t.nodeName==="OL"&&(n=t),t=t.parentNode;return n}catch{return null}}function f(e){return!!(e&&e.classList&&e.classList.contains(a.legalListClass))}function g(e){var i=o();if(!i)return!1;e?i.classList.add(a.legalListClass):i.classList.remove(a.legalListClass);try{typeof l.updateDesign=="function"&&l.updateDesign()}catch{}try{l.fireEvent&&l.fireEvent("change")}catch{}return e}function c(){var e=a.legalListClass,i=String(a.legalListSeparator||".").replace(/"/g,'\\"'),t=String(a.legalListSuffix==null?".":a.legalListSuffix).replace(/"/g,'\\"');return"ol."+e+",ol."+e+" ol{counter-reset:rte-legal;list-style:none;}ol."+e+">li,ol."+e+" ol>li{counter-increment:rte-legal;position:relative;}ol."+e+">li::marker,ol."+e+' ol>li::marker{content:"";}ol.'+e+">li::before,ol."+e+' ol>li::before{content:counters(rte-legal,"'+i+'")"'+t+'";position:absolute;left:-3.2em;width:3em;text-align:right;font-variant-numeric:tabular-nums;}ol.'+e+"{padding-left:3.6em;}ol."+e+" ol{padding-left:3.2em;margin-top:.25em;}"}function d(e){if(e){var i=e.getElementById("rte-legal-list-styles"),t=c();if(i){if(i.getAttribute("data-css")===t)return;i.parentNode&&i.parentNode.removeChild(i)}var n=e.createElement("style");n.id="rte-legal-list-styles",n.setAttribute("data-css",t),n.appendChild(e.createTextNode(t)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(n),l&&typeof l.ensureStyleSheetLive=="function"&&l.ensureStyleSheetLive(e,n,"rte-legal-list-styles",n.textContent)}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_multiroot=RTE_Plugin_MultiRoot,typeof RTE_DefaultConfig.multiRootGroup>"u"&&(RTE_DefaultConfig.multiRootGroup=null),typeof RTE_DefaultConfig.multiRootName>"u"&&(RTE_DefaultConfig.multiRootName=null),typeof RTE_DefaultConfig.multiRootToolbarHost>"u"&&(RTE_DefaultConfig.multiRootToolbarHost=null),window.__RTE_MultiRootGroups||(window.__RTE_MultiRootGroups={});function RTE_Plugin_MultiRoot(){var f=this,l,i,u=null;f.PluginName="MultiRoot",f.InitConfig=function(o){l=o},f.InitEditor=function(o){i=o;var t=l.multiRootGroup;if(t){u={name:l.multiRootName||R()||"root"+(a(t).roots.length+1),editor:i,container:c(),group:t},a(t).roots.push(u),i.multiRoot=h(t),setTimeout(function(){v(),s(t)},0);try{i.attachEvent("ready",function(){v(),s(t)})}catch{}}};function a(o){window.__RTE_MultiRootGroups[o]||(window.__RTE_MultiRootGroups[o]={roots:[],active:null,listeners:[]});var t=window.__RTE_MultiRootGroups[o];return t.listeners||(t.listeners=[]),t}function c(){try{if(i.container)return i.container;if(i.iframe){for(var o=i.iframe.parentNode;o&&!(o.classList&&o.classList.contains("richtexteditor"));)o=o.parentNode;return o||null}}catch{}return null}function R(){var o=c();return o&&o.id?o.id:null}function d(o){var t=o.container;return t?[].slice.call(t.querySelectorAll("rte-toolbar")):[]}function _(o,t){for(var e=d(o),r=0;r<e.length;r++){var n=e[r];t?n.__rteMultiRootPrevDisplay!==void 0&&(n.style.display=n.__rteMultiRootPrevDisplay,delete n.__rteMultiRootPrevDisplay):(n.__rteMultiRootPrevDisplay===void 0&&(n.__rteMultiRootPrevDisplay=n.style.display),n.style.display="none")}}function s(o){var t=a(o);if(t.roots.length){t.active||(t.active=t.roots[0]);for(var e=0;e<t.roots.length;e++)_(t.roots[e],t.roots[e]===t.active);p(t.active)}}function p(o){var t=l.multiRootToolbarHost;if(!(!t||!o)){var e=typeof t=="string"?document.getElementById(t):t;if(e)for(var r=d(o),n=0;n<r.length;n++)r[n].parentNode!==e&&e.appendChild(r[n])}}function v(){var o;try{o=i.getDocument()}catch{return}if(!(!o||o.__rteMultiRootBound)){o.__rteMultiRootBound=!0;var t=function(){if(u){var e=a(u.group);e.active!==u&&(e.active=u,s(u.group),g(u.group,u))}};o.addEventListener("focusin",t,!0),o.addEventListener("mousedown",t,!0)}}function g(o,t){for(var e=a(o).listeners,r=0;r<e.length;r++)try{e[r]({active:t.name,editor:t.editor})}catch{}}function h(o){var t=a(o);return{group:o,getRoots:function(){return t.roots.map(function(e){return e.name})},getActive:function(){return t.active?t.active.name:null},getEditor:function(e){for(var r=0;r<t.roots.length;r++)if(t.roots[r].name===e)return t.roots[r].editor;return null},focusRoot:function(e){for(var r=null,n=0;n<t.roots.length;n++)t.roots[n].name===e&&(r=t.roots[n]);if(!r)return!1;t.active=r,s(o);try{r.editor.focus()}catch{}return g(o,r),!0},getHTML:function(){for(var e={},r=0;r<t.roots.length;r++)try{e[t.roots[r].name]=t.roots[r].editor.getHTMLCode()}catch{e[t.roots[r].name]=null}return e},setHTML:function(e){if(!e)return!1;for(var r=0;r<t.roots.length;r++){var n=t.roots[r];if(n.name in e)try{n.editor.setHTMLCode(e[n.name])}catch{}}return!0},onActiveChange:function(e){return typeof e!="function"?function(){}:(t.listeners.push(e),function(){var r=t.listeners.indexOf(e);r>=0&&t.listeners.splice(r,1)})},getCapabilities:function(){return{sharedToolbar:!0,sharedGroupApi:!0,perRootUndo:!0,sharedUndoStack:!1,selectionAcrossRoots:!1,sharedCollaborationSession:!1,note:"Each root is a separate editor instance sharing one visible toolbar. Undo, selection and collaboration are per-root; the editor edits an iframe body, so a single instance cannot own several editables without core changes."}}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_nodetypes=RTE_Plugin_NodeTypes;function RTE_Plugin_NodeTypes(){var E=this,c,a,v=[],g={},D=0,N=null;E.PluginName="NodeTypes",E.InitConfig=function(t){if(c=t,c.nodeTypesEnabled!==!1&&Array.isArray(c.nodeTypes))for(var r=0;r<c.nodeTypes.length;r++)R(c.nodeTypes[r])},E.InitEditor=function(t){a=t,c.nodeTypesEnabled!==!1&&(a.nodeTypes={find:function(r){return H(r)},get:function(r){return g[r]||null},insert:function(r,n){return B(r,n)},list:function(){return v.map(L)},register:function(r){return R(r)},serialize:function(){return _()},typeOf:function(r){var n=C(r);return n?n.name:null},unregister:function(r){return J(r)}},a.attachEvent("change",function(){x()}),I(),K(),setTimeout(F,0),O())};function R(t){if(!t||!t.name||typeof t.match!="string"&&typeof t.match!="function")return!1;g[t.name]&&J(t.name);var r={name:t.name,match:t.match,atomic:t.atomic!==!1,inline:!!t.inline,toJSON:typeof t.toJSON=="function"?t.toJSON:null,fromJSON:typeof t.fromJSON=="function"?t.fromJSON:null,toMarkdown:typeof t.toMarkdown=="function"?t.toMarkdown:null,toExportHTML:typeof t.toExportHTML=="function"?t.toExportHTML:null,toDocx:typeof t.toDocx=="function"?t.toDocx:null,toPdf:typeof t.toPdf=="function"?t.toPdf:null,toWord:typeof t.toWord=="function"?t.toWord:null,allowTags:t.allowTags||[],allowAttributes:t.allowAttributes||[]};return v.push(r),g[r.name]=r,W(r),a&&O(),!0}function J(t){return g[t]?(v=v.filter(function(r){return r.name!==t}),delete g[t],!0):!1}function L(t){return{name:t.name,atomic:t.atomic,inline:t.inline,hasToJSON:!!t.toJSON,hasFromJSON:!!t.fromJSON,hasToMarkdown:!!t.toMarkdown,hasExportHTML:!!(t.toExportHTML||t.toDocx||t.toPdf),instances:H(t.name).length}}function W(t){c&&(P("sanitizerAllowTags",t.allowTags),P("sanitizerAllowAttributes",t.allowAttributes))}function P(t,r){if(!(!r||!r.length)){var n=c[t];Array.isArray(n)||(n=n?[n]:[]);for(var e=0;e<r.length;e++)n.indexOf(r[e])===-1&&n.push(r[e]);c[t]=n}}function k(t,r){if(!r||r.nodeType!==1)return!1;if(typeof t.match=="string")try{return r.matches(t.match)}catch{return!1}try{return!!t.match(r)}catch{return!1}}function C(t){for(var r=0;r<v.length;r++)if(k(v[r],t))return v[r];return null}function b(){return a&&a.getEditable?a.getEditable():null}function H(t){var r=b(),n=g[t],e=[];if(!r||!n)return e;for(var o=r.querySelectorAll("*"),l=0;l<o.length;l++)k(n,o[l])&&e.push(o[l]);return e}function w(){var t=b(),r=[];if(!t)return r;for(var n=t.querySelectorAll("*"),e=0;e<n.length;e++){var o=C(n[e]);o&&r.push({type:o,el:n[e]})}return r}function B(t,r){var n=g[t];if(!n||!n.fromJSON||!a)return null;var e=n.fromJSON(r||{}),o=typeof e=="string"?e:e&&e.outerHTML;return o?(a.insertHTML(o),x(),o):null}function _(){for(var t=[],r=w(),n=0;n<r.length;n++){var e=r[n].type,o=r[n].el;t.push({name:e.name,data:e.toJSON?M(e.toJSON,o,{}):z(o)})}return t}function z(t){for(var r={},n=t.attributes,e=0;n&&e<n.length;e++)n[e].name.indexOf("data-")===0&&(r[n[e].name]=n[e].value);return r}function M(t,r,n){try{return t(r)}catch{return n}}function I(){var t=b();if(!(!t||typeof MutationObserver>"u")){var r=new MutationObserver(function(){x()});r.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["contenteditable"]})}}function x(){clearTimeout(D),D=setTimeout(O,60)}function O(){for(var t=w(),r=0;r<t.length;r++)t[r].type.atomic&&t[r].el.getAttribute("contenteditable")!=="false"&&t[r].el.setAttribute("contenteditable","false")}function F(){p("getDocxBlob","toDocx"),p("exportToDocx","toDocx"),p("getPdfBytes","toPdf"),p("exportToPdf","toPdf"),p("downloadPdf","toPdf"),p("getWordDocument","toWord"),p("exportToWord","toWord"),p("downloadWord","toWord")}function p(t,r){if(!(!a||typeof a[t]!="function")){var n=a[t];a[t]=function(){var e=arguments,o=w().filter(function(i){return i.type[r]||i.type.toExportHTML});if(!o.length)return n.apply(a,e);var l=q(o,r),u;try{u=n.apply(a,e)}catch(i){throw l(),i}return u&&typeof u.then=="function"?u.then(function(i){return l(),i},function(i){throw l(),i}):(l(),u)}}}function q(t,r){var n=a.getDocument(),e=[],o=null;try{var l=n.getSelection();l&&l.rangeCount&&(o=l.getRangeAt(0).cloneRange())}catch{o=null}for(var u=0;u<t.length;u++){var i=t[u].el,y=t[u].type[r]||t[u].type.toExportHTML,m=y?M(y,i,null):null;if(m!=null){var h=n.createElement(t[u].type.inline?"span":"div");h.innerHTML=String(m),i.parentNode.insertBefore(h,i),i.parentNode.removeChild(i),e.push({holder:h,original:i})}}var T=!1;return function(){if(!T){T=!0;for(var s=e.length-1;s>=0;s--){var f=e[s];f.holder.parentNode&&(f.holder.parentNode.insertBefore(f.original,f.holder),f.holder.parentNode.removeChild(f.holder))}if(o)try{var d=n.getSelection();d.removeAllRanges(),d.addRange(o)}catch{}}}}function K(){!a||typeof a.toMarkdown!="function"||(N=a.toMarkdown,a.toMarkdown=function(){var t=w().filter(function(A){return A.type.toMarkdown});if(!t.length)return N.call(a);var r=a.getDocument(),n=[],e=[],o=null;try{var l=r.getSelection();l&&l.rangeCount&&(o=l.getRangeAt(0).cloneRange())}catch{o=null}try{for(var u=0;u<t.length;u++){var i=t[u].el,y=M(t[u].type.toMarkdown,i,null);if(y!=null){var m="RTENODETYPETOKEN"+u+"ENDRTENODETYPETOKEN",h=r.createElement(t[u].type.inline?"span":"p");h.textContent=m,i.parentNode.insertBefore(h,i),i.parentNode.removeChild(i),n.push({holder:h,original:i}),e.push({token:m,markdown:String(y)})}}for(var T=N.call(a),s=0;s<e.length;s++)T=T.split(e[s].token).join(e[s].markdown);return T}finally{for(var f=n.length-1;f>=0;f--){var d=n[f];d.holder.parentNode&&(d.holder.parentNode.insertBefore(d.original,d.holder),d.holder.parentNode.removeChild(d.holder))}if(o)try{var S=r.getSelection();S.removeAllRanges(),S.addRange(o)}catch{}}})}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_pagination=RTE_Plugin_Pagination,typeof RTE_DefaultConfig.paginationEnabled>"u"&&(RTE_DefaultConfig.paginationEnabled=!1),typeof RTE_DefaultConfig.pageFormat>"u"&&(RTE_DefaultConfig.pageFormat="A4"),typeof RTE_DefaultConfig.pageOrientation>"u"&&(RTE_DefaultConfig.pageOrientation="portrait"),typeof RTE_DefaultConfig.pageMargins>"u"&&(RTE_DefaultConfig.pageMargins={top:1,right:1,bottom:1,left:1}),typeof RTE_DefaultConfig.paginationShowPageNumbers>"u"&&(RTE_DefaultConfig.paginationShowPageNumbers=!0),typeof RTE_DefaultConfig.paginationShowPageCount>"u"&&(RTE_DefaultConfig.paginationShowPageCount=!0);function RTE_Plugin_Pagination(){var M=this,l,o,s=!1,u=null,A=null,F=!1,R=0,N=1,T="";M.PluginName="Pagination";var m=96,c=25.4,B={a4:{w:210/c,h:297/c},letter:{w:8.5,h:11},legal:{w:8.5,h:14},a3:{w:297/c,h:420/c},a5:{w:148/c,h:210/c},tabloid:{w:11,h:17}};M.InitConfig=function(e){l=e,s=!!l.paginationEnabled},M.InitEditor=function(e){o=e,D();try{o.attachEvent("ready",D)}catch{}try{o.attachEvent("aftersethtml",v)}catch{}o.setPageView=function(t){return s=!!t,E(),s},o.togglePageView=function(){return s=!s,E(),s},o.isPageView=function(){return s},o.getPageCount=function(){return s&&I(),N},o.setPageSetup=function(t){return t&&typeof t=="object"&&(t.format&&(l.pageFormat=t.format),t.orientation&&(l.pageOrientation=t.orientation),t.margins&&(l.pageMargins=t.margins),typeof t.headerHtml=="string"&&(l.pageHeaderHtml=t.headerHtml),typeof t.footerHtml=="string"&&(l.pageFooterHtml=t.footerHtml)),T="",E(),x()},o.getPageGeometry=function(){return x()},o.getPageOfElement=function(t){return U(t)},setTimeout(D,0),setTimeout(v,250)};function D(){var e=L();if(e&&(K(e),e!==A)){e.addEventListener("input",v,!0),e.addEventListener("keyup",v,!0),A=e;var t=e.defaultView||e.parentWindow;if(t)try{t.addEventListener("resize",v,!0)}catch{}}X(),E()}function L(){try{return o.getDocument()}catch{return null}}function b(){try{return o.getEditable()}catch{return null}}function z(){var e=null;try{typeof o.getDocumentPageSetup=="function"&&(e=o.getDocumentPageSetup())}catch{e=null}return(!e||typeof e!="object")&&(e={}),{format:e.format||l.pageFormat||"A4",orientation:e.orientation||l.pageOrientation||"portrait",margins:e.margins||l.pageMargins||{top:1,right:1,bottom:1,left:1},headerHtml:typeof e.headerHtml=="string"?e.headerHtml:l.pageHeaderHtml||"",footerHtml:typeof e.footerHtml=="string"?e.footerHtml:l.pageFooterHtml||""}}function H(e,t){if(typeof e=="number"&&isFinite(e))return e*m;if(typeof e=="string"){var r=/^\s*(-?[\d.]+)\s*(mm|cm|in|px|pt)?\s*$/.exec(e);if(r){var n=parseFloat(r[1]);switch(r[2]){case"mm":return n/c*m;case"cm":return n*10/c*m;case"pt":return n/72*m;case"px":return n;default:return n*m}}}return(t||0)*m}function x(){var e=z(),t=B[String(e.format).toLowerCase()]||B.a4,r=t.w,n=t.h;if(String(e.orientation).toLowerCase()==="landscape"){var a=r;r=n,n=a}var f=e.margins||{},i={pageWidth:Math.round(r*m),pageHeight:Math.round(n*m),marginTop:Math.round(H(f.top,1)),marginRight:Math.round(H(f.right,1)),marginBottom:Math.round(H(f.bottom,1)),marginLeft:Math.round(H(f.left,1)),format:e.format,orientation:e.orientation,headerHtml:e.headerHtml,footerHtml:e.footerHtml};return i.contentHeight=Math.max(120,i.pageHeight-i.marginTop-i.marginBottom),i.contentWidth=Math.max(120,i.pageWidth-i.marginLeft-i.marginRight),i}function E(){var e=b();if(e){if(!s){V(e);return}var t=x();e.classList.add("rte-page-view"),e.style.width=t.contentWidth+"px",e.style.paddingLeft=t.marginLeft+"px",e.style.paddingRight=t.marginRight+"px",e.style.paddingTop=t.marginTop+"px",e.style.paddingBottom=t.marginBottom+"px",e.style.margin="24px auto",e.style.boxSizing="content-box",e.style.background="#fff",e.style.minHeight=t.contentHeight+"px",v()}}function V(e){if(e=e||b(),e){e.classList.remove("rte-page-view");for(var t=["width","paddingLeft","paddingRight","paddingTop","paddingBottom","margin","boxSizing","background","minHeight"],r=0;r<t.length;r++)e.style[t[r]]=""}J(),N=1,T=""}function v(){if(s&&!R){var e=L(),t=e&&(e.defaultView||e.parentWindow)||window,r=t&&typeof t.requestAnimationFrame=="function"?function(n){return t.requestAnimationFrame(n)}:function(n){return setTimeout(n,16)};R=r(function(){R=0,I()})}}function j(e){for(var t=e.children,r=0;r<t.length;r++){var n=t[r];if(n&&n.nodeType===1&&!(n.getAttribute&&n.getAttribute("data-rte-page-overlay")==="true"))return n.offsetTop}return e.offsetTop}function U(e){if(!s||!e)return null;var t=b();if(!t)return null;for(var r=e;r&&r.parentNode&&r.parentNode!==t;)r=r.parentNode;if(!r||r.parentNode!==t)return null;for(var n=O(t,x()),a=r.offsetTop,f=1,i=0;i<n.length;i++)n[i]<=a&&f++;return f}function O(e,t){var r=[],n=e.children;if(!n||!n.length)return r;for(var a=[],f=0;f<n.length;f++){var i=n[f];!i||i.nodeType!==1||i.getAttribute&&i.getAttribute("data-rte-page-overlay")==="true"||a.push(i)}if(!a.length)return r;var g=a[0].offsetTop,d,h,p,y;for(d=0;d<a.length;d++){h=a[d],p=h.offsetTop,y=d+1<a.length?a[d+1].offsetTop:p+h.offsetHeight;var w=h.hasAttribute&&(h.hasAttribute("data-rte-page-break")||h.querySelector&&!!h.querySelector("[data-rte-page-break]"));if(w&&p>g){r.push(p),g=p;continue}if(y-g>t.contentHeight)for(p>g&&(r.push(p),g=p);y-g>t.contentHeight;)g+=t.contentHeight,r.push(g)}return r}function I(){if(s){var e=b(),t=L();if(!(!e||!t)){var r=x(),n=O(e,r);N=n.length+1;var a=r.pageWidth+"x"+r.pageHeight+"|"+r.contentHeight+"|"+n.join(",")+"|"+e.offsetHeight;a!==T&&(T=a,$(t,e,r,n))}}}function G(e,t){return u&&u.parentNode||(u=e.createElement("div"),u.setAttribute("data-rte-page-overlay","true"),u.setAttribute("contenteditable","false"),u.setAttribute("aria-hidden","true"),u.className="rte-page-overlay",(t.parentNode||e.body||e.documentElement).appendChild(u)),u}function J(){u&&u.parentNode&&u.parentNode.removeChild(u),u=null}function W(e,t,r){return String(e).replace(/\{\s*page\s*\}/gi,String(t)).replace(/\{\s*total\s*\}/gi,String(r))}function $(e,t,r,n){for(var a=G(e,t);a.firstChild;)a.removeChild(a.firstChild);var f=t.offsetTop,i=j(t),g=[i].concat(n),d=g.length,h=g[d-1]+r.contentHeight+r.marginBottom;a.style.position="absolute",a.style.left=t.offsetLeft+"px",a.style.top=f+"px",a.style.width=t.offsetWidth+"px",a.style.height=Math.max(t.offsetHeight,h-f)+"px",a.style.pointerEvents="none",a.style.zIndex="1";var p,y;for(p=0;p<n.length;p++){y=n[p]-f-Math.round(r.marginTop/2);var w=e.createElement("div");w.className="rte-page-sep",w.style.top=y+"px",a.appendChild(w)}for(p=0;p<g.length;p++){var C=p+1,k=g[p]-f,q=k+r.contentHeight;if(l.paginationShowPageNumbers){var S=e.createElement("div");S.className="rte-page-num",S.style.top=q+6+"px",S.appendChild(e.createTextNode(l.paginationShowPageCount?"Page "+C+" of "+d:"Page "+C)),a.appendChild(S)}if(r.headerHtml){var P=e.createElement("div");P.className="rte-page-hf rte-page-header",P.style.top=k-Math.round(r.marginTop/2)+"px",P.innerHTML=W(r.headerHtml,C,d),a.appendChild(P)}if(r.footerHtml){var _=e.createElement("div");_.className="rte-page-hf rte-page-footer",_.style.top=q+Math.round(r.marginBottom/3)+"px",_.innerHTML=W(r.footerHtml,C,d),a.appendChild(_)}}}function K(e){if(!(!e||e.getElementById("rte-pagination-styles"))){var t=".rte-page-view{box-shadow:0 1px 4px rgba(15,23,42,.16),0 8px 28px rgba(15,23,42,.10);}body.rte-page-desk{background:#f1f5f9;}.rte-page-overlay{position:absolute;pointer-events:none;}.rte-page-sep{position:absolute;left:-24px;right:-24px;height:0;border-top:1px dashed #94a3b8;}.rte-page-num{position:absolute;right:8px;font:600 10px/1.4 'Segoe UI',system-ui,sans-serif;letter-spacing:.04em;color:#94a3b8;text-transform:uppercase;}.rte-page-hf{position:absolute;left:0;right:0;font:400 11px/1.4 'Segoe UI',system-ui,sans-serif;color:#64748b;}.rte-page-header{text-align:left;}.rte-page-footer{text-align:center;}@media print{.rte-page-overlay{display:none !important;}.rte-page-view{box-shadow:none !important;margin:0 !important;width:auto !important;}}",r=e.createElement("style");r.id="rte-pagination-styles",r.appendChild(e.createTextNode(t)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(r),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(e,r,"rte-pagination-styles",r.textContent)}}function Q(){var e=b();if(!e)return function(){};for(var t=e.querySelectorAll?e.querySelectorAll("[data-rte-page-overlay]"):[],r=[],n=0;n<t.length;n++){var a=t[n];r.push({node:a,parent:a.parentNode,next:a.nextSibling}),a.parentNode&&a.parentNode.removeChild(a)}return function(){for(var i=0;i<r.length;i++){var g=r[i];g.parent&&g.parent.insertBefore(g.node,g.next||null)}}}function X(){if(!F){for(var e=["getHTMLCode","getJSON","getHTMLContent","getText"],t=!1,r=0;r<e.length;r++)(function(n){var a=o[n];if(!(typeof a!="function"||a.__rtePgWrapped)){var f=function(){var i=Q();try{return a.apply(o,arguments)}finally{i()}};f.__rtePgWrapped=!0,o[n]=f,t=!0}})(e[r]);t&&(F=!0)}}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_pdfexport=RTE_Plugin_PdfExport,typeof RTE_DefaultConfig.pdfExport>"u"&&(RTE_DefaultConfig.pdfExport=!0);function RTE_Plugin_PdfExport(){var ae=this,M,N;ae.PluginName="PdfExport",ae.InitConfig=function(e){M=e},ae.InitEditor=function(e){N=e,M.pdfExport!==!1&&(N.getPdfBytes=function(t){return de(t||{})},N.exportToPdf=function(t,r){var n=de(r||{}),i=we(t)||we(M.pdfExportFileName)||Me();return We(n,i+".pdf")},N.downloadPdf=N.exportToPdf,N.attachEvent("exec_command_exportpdf",function(t){t.returnValue=!0,t.stopBubble=!0;try{N.exportToPdf()}catch(r){window.console&&console.error("pdfexport:",r)}}))};var G=72,se={letter:[612,792],legal:[612,1008],tabloid:[792,1224],a3:[842,1191],a4:[595,842],a5:[420,595]};function V(e,t){if(typeof e=="number"&&isFinite(e))return e*G;if(typeof e!="string")return t;var r=/^\s*(-?[\d.]+)\s*(mm|cm|in|px|pt)?\s*$/.exec(e);if(!r)return t;var n=parseFloat(r[1]);if(!isFinite(n))return t;switch(r[2]){case"mm":return n*G/25.4;case"cm":return n*G/2.54;case"pt":return n;case"px":return n*.75;default:return n*G}}function be(e){var t=null;try{typeof N.getDocumentPageSetup=="function"&&(t=N.getDocumentPageSetup())}catch{t=null}t=t||{};var r=String(e.format||t.format||"letter").toLowerCase(),n=se[r]||se.letter,i=String(e.orientation||t.orientation||"").toLowerCase()==="landscape",f=i?n[1]:n[0],s=i?n[0]:n[1],a=e.margins||t.margins||{},o=G/2;return{width:f,height:s,margin:{top:V(a.top,o),right:V(a.right,o),bottom:V(a.bottom,o),left:V(a.left,o)}}}var Q={helvetica:{css:"Arial, Helvetica, sans-serif",faces:["Helvetica","Helvetica-Bold","Helvetica-Oblique","Helvetica-BoldOblique"]},times:{css:'"Times New Roman", Times, serif',faces:["Times-Roman","Times-Bold","Times-Italic","Times-BoldItalic"]},courier:{css:'"Courier New", Courier, monospace',faces:["Courier","Courier-Bold","Courier-Oblique","Courier-BoldOblique"]}},te=32,oe=255,le={};function re(e,t){var r=e+":"+t;if(le[r])return le[r];var n=Q[e]||Q.helvetica,i=re.canvas||(re.canvas=document.createElement("canvas")),f=i.getContext("2d"),s=t&1?"bold ":"",a=t&2?"italic ":"";f.font=s+a+"100px "+n.css;for(var o=[],u=te;u<=oe;u++){var l=f.measureText(String.fromCharCode(u)).width;o.push(Math.round(l*10))}return le[r]=o,o}function Te(e,t,r){return(r<te||r>oe)&&(r=63),re(e,t)[r-te]||500}function ue(e,t,r,n){for(var i=0,f=0;f<e.length;f++)i+=Te(t,r,e.charCodeAt(f));return i*n/1e3}var Ce={8364:128,8218:130,402:131,8222:132,8230:133,8224:134,8225:135,710:136,8240:137,352:138,8249:139,338:140,381:142,8216:145,8217:146,8220:147,8221:148,8226:149,8211:150,8212:151,732:152,8482:153,353:154,8250:155,339:156,382:158,376:159};function W(e){for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);if(n<256){t+=String.fromCharCode(n);continue}var i=Ce[n];if(i){t+=String.fromCharCode(i);continue}if(n===160){t+=" ";continue}if(n>=8192&&n<=8202){t+=" ";continue}if(n===8722){t+="-";continue}t+="?"}return t}function H(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")}function Y(){this.objects=[]}Y.prototype.alloc=function(){return this.objects.push(null),this.objects.length},Y.prototype.set=function(e,t){this.objects[e-1]=t},Y.prototype.add=function(e){var t=this.alloc();return this.set(t,e),t},Y.prototype.build=function(e,t){var r=[],n=0;function i(m){var d=typeof m=="string"?he(m):m;return r.push(d),n+=d.length,n}i(`%PDF-1.4
|
|
2
|
+
`),i(new Uint8Array([37,226,227,207,211,10]));for(var f=[],s=0;s<this.objects.length;s++){f[s]=n,i(s+1+` 0 obj
|
|
3
|
+
`);var a=this.objects[s];if(a&&a.stream){var o=typeof a.stream=="string"?he(a.stream):a.stream;i(a.dict.replace("/Length 0","/Length "+o.length)+`
|
|
4
|
+
stream
|
|
5
|
+
`),i(o),i(`
|
|
6
|
+
endstream
|
|
7
|
+
`)}else i(a+`
|
|
8
|
+
`);i(`endobj
|
|
9
|
+
`)}for(var u=n,l=`xref
|
|
10
|
+
0 `+(this.objects.length+1)+`
|
|
11
|
+
0000000000 65535 f
|
|
12
|
+
`,c=0;c<f.length;c++)l+=Se(f[c])+` 00000 n
|
|
13
|
+
`;i(l),i(`trailer
|
|
14
|
+
<< /Size `+(this.objects.length+1)+" /Root "+e+" 0 R /Info "+t+` 0 R >>
|
|
15
|
+
`),i(`startxref
|
|
16
|
+
`+u+`
|
|
17
|
+
%%EOF
|
|
18
|
+
`);for(var h=new Uint8Array(n),v=0,p=0;p<r.length;p++)h.set(r[p],v),v+=r[p].length;return h};function Se(e){for(var t=String(e);t.length<10;)t="0"+t;return t}function he(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function _(e,t){var r={bold:t.bold,italic:t.italic,underline:t.underline,strike:t.strike,size:t.size,color:t.color,mono:t.mono,link:t.link},n=e.tagName?e.tagName.toLowerCase():"";(n==="b"||n==="strong")&&(r.bold=!0),(n==="i"||n==="em")&&(r.italic=!0),(n==="u"||n==="ins")&&(r.underline=!0),(n==="s"||n==="strike"||n==="del")&&(r.strike=!0),(n==="code"||n==="kbd"||n==="samp"||n==="pre")&&(r.mono=!0),n==="a"&&e.getAttribute("href")&&(r.link=e.getAttribute("href"),r.color=[0,.33,.8],r.underline=!0),(n==="sup"||n==="sub")&&(r.size=r.size*.75);var i=e.style;if(i){if(/bold|^[6-9]00$/.test(i.fontWeight||"")&&(r.bold=!0),(i.fontStyle==="italic"||i.fontStyle==="oblique")&&(r.italic=!0),(i.textDecorationLine||i.textDecoration||"").indexOf("underline")>=0&&(r.underline=!0),(i.textDecorationLine||i.textDecoration||"").indexOf("line-through")>=0&&(r.strike=!0),i.color){var f=ke(i.color);f&&(r.color=f)}if(i.fontSize){var s=V(i.fontSize,null);s&&(r.size=s)}}return r}function ke(e){var t=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.replace(/\s/g,""));if(t){var r=t[1];return r.length===3&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]),[parseInt(r.substr(0,2),16)/255,parseInt(r.substr(2,2),16)/255,parseInt(r.substr(4,2),16)/255]}var n=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i.exec(e);return n?[n[1]/255,n[2]/255,n[3]/255]:null}var q={h1:2,h2:1.6,h3:1.35,h4:1.15,h5:1,h6:.9};function Z(e,t,r){this.geom=e,this.baseSize=t,this.family=r,this.contentWidth=e.width-e.margin.left-e.margin.right,this.blocks=[]}Z.prototype.runsOf=function(e,t){var r=[],n=this;return(function i(f,s){for(var a=0;a<f.childNodes.length;a++){var o=f.childNodes[a];if(o.nodeType===3){var u=(o.nodeValue||"").replace(/\s+/g," ");u&&r.push({text:u,style:s});continue}if(o.nodeType===1){var l=o.tagName.toLowerCase();if(l==="br"){r.push({br:!0,style:s});continue}if(l==="img"){r.push({img:o,style:s});continue}l==="script"||l==="style"||i(o,_(o,s))}}})(e,t),r},Z.prototype.wrap=function(e,t,r){var n=[],i=[],f=0,s=this,a=this.baseSize;function o(){for(;i.length&&/^\s+$/.test(i[i.length-1].text||"");)i.pop();n.push({parts:i,width:f,size:a}),i=[],f=0,a=s.baseSize}for(var u=0;u<e.length;u++){var l=e[u];if(l.br){o();continue}if(l.img){var c=ce(l.img,t);i.length&&o(),n.push({parts:[{img:l.img,w:c.w,h:c.h,style:l.style}],width:c.w,size:c.h,image:!0});continue}for(var h=(l.style.bold?1:0)|(l.style.italic?2:0),v=l.style.mono?"courier":this.family,p=l.text.split(/(\s+)/),m=0;m<p.length;m++){var d=p[m];if(d){var x=ue(W(d),v,h,l.style.size);f+x>t&&i.length&&!/^\s+$/.test(d)&&(o(),/^\s+$/.test(d))||(i.push({text:d,style:l.style,family:v,styleIndex:h,w:x}),f+=x,l.style.size>a&&(a=l.style.size))}}}i.length&&o(),n.length||n.push({parts:[],width:0,size:this.baseSize});for(var w=0;w<n.length;w++)n[w].height=n[w].image?n[w].size:n[w].size*r;return n};function ce(e,t){var r=e.naturalWidth||e.width||0,n=e.naturalHeight||e.height||0;if(!r||!n)return{w:0,h:0};var i=r*.75,f=n*.75;return i>t&&(f=f*t/i,i=t),{w:i,h:f}}Z.prototype.run=function(e){var t=this,r={bold:!1,italic:!1,underline:!1,strike:!1,size:this.baseSize,color:[0,0,0],mono:!1,link:null};function n(a){if(!a||!a.style)return 0;var o=a.style.marginLeft||a.style.paddingLeft||"",u=/^\s*(-?[\d.]+)\s*([a-z%]*)\s*$/i.exec(o);if(!u)return 0;var l=parseFloat(u[1]);if(!l||l<=0)return 0;var c=(u[2]||"px").toLowerCase(),h=c==="px"?l:c==="pt"?l*(4/3):c==="in"?l*96:c==="cm"?l*37.795:c==="mm"?l*3.7795:c==="em"||c==="rem"?l*16:0;return h*.75}function i(a,o,u,l,c,h,v){var p=a.tagName.toLowerCase(),m=_(a,o),d="left",x=a.style&&a.style.textAlign||"";(x==="center"||x==="right"||x==="justify")&&(d=x),q[p]&&(m.size=t.baseSize*q[p],m.bold=!0),p==="pre"&&(m.mono=!0);var w=t.contentWidth-u,y=t.runsOf(a,m),k=t.wrap(y,w,p==="pre"?1.25:1.4);t.blocks.push({type:"text",lines:k,indent:u,align:d,spaceBefore:q[p]?m.size*.6:t.baseSize*.35,spaceAfter:q[p]?m.size*.3:t.baseSize*.35,marker:l||null,markerStyle:m,keepWithNext:!!q[p],rule:p==="blockquote"?"quote":null,role:v||(q[p]?"H"+p.charAt(1):p==="blockquote"?"BlockQuote":"P"),listId:c||null,listOrdered:!!h})}function f(a,o,u,l){for(var c=0;c<a.childNodes.length;c++){var h=a.childNodes[c];if(h.nodeType===3){if(!(h.nodeValue||"").trim())continue;t.blocks.push({type:"text",lines:t.wrap([{text:h.nodeValue.replace(/\s+/g," "),style:o}],t.contentWidth-u,1.4),indent:u,align:"left",spaceBefore:0,spaceAfter:t.baseSize*.35});continue}if(h.nodeType===1){var v=h.tagName.toLowerCase();if(!(v==="script"||v==="style"||v==="noscript")){if(h.getAttribute&&h.getAttribute("data-rte-page-break")!==null){t.blocks.push({type:"pagebreak"});continue}if(h.style&&/always|page/.test(h.style.pageBreakBefore||h.style.breakBefore||"")&&t.blocks.push({type:"pagebreak"}),v==="hr"){t.blocks.push({type:"rule",indent:u});continue}if(v==="ul"||v==="ol"){for(var p=parseInt(h.getAttribute("start")||"1",10)||1,m="L"+(t.listSeq=(t.listSeq||0)+1),d=0;d<h.childNodes.length;d++){var x=h.childNodes[d];if(!(x.nodeType!==1||x.tagName.toLowerCase()!=="li")){var w=v==="ol"?p+++".":"\u2022";i(x,_(x,o),u+t.baseSize*1.6,w,m,v==="ol"),s(x,_(x,o),u+t.baseSize*1.6)}}continue}if(v==="table"){t.table(h,_(h,o),u);continue}if(v==="img"){var y=ce(h,t.contentWidth-u);y.w&&t.blocks.push({type:"text",role:"Figure",alt:h.getAttribute("alt")||"",lines:[{parts:[{img:h,w:y.w,h:y.h,style:o}],width:y.w,size:y.h,height:y.h,image:!0}],indent:u,align:"left",spaceBefore:4,spaceAfter:4});continue}if(ve(v)){var k=(v==="blockquote"?t.baseSize*1.5:0)+n(h),C=v==="blockquote"?"BlockQuote":l;if(ze(h)){f(h,_(h,o),u+k,C);continue}i(h,o,u+k,null,null,!1,C);continue}i(h,o,u,null)}}}}function s(a,o,u){for(var l=0;l<a.childNodes.length;l++){var c=a.childNodes[l];if(c.nodeType===1){var h=c.tagName.toLowerCase();(h==="ul"||h==="ol")&&f({childNodes:[c]},o,u)}}}return f(e,r,0),this.blocks};function ve(e){return/^(p|div|h[1-6]|blockquote|pre|section|article|header|footer|main|aside|figure|figcaption|dl|dd|dt|li|address)$/.test(e)}function ze(e){for(var t=0;t<e.childNodes.length;t++){var r=e.childNodes[t];if(r.nodeType===1&&(ve(r.tagName.toLowerCase())||/^(ul|ol|table|hr)$/.test(r.tagName.toLowerCase())))return!0}return!1}Z.prototype.table=function(e,t,r){for(var n=this,i=[],f=e.getElementsByTagName("tr"),s=0,a=0;a<f.length;a++){for(var o=[],u=0;u<f[a].childNodes.length;u++){var l=f[a].childNodes[u];if(l.nodeType===1){var c=l.tagName.toLowerCase();c!=="td"&&c!=="th"||o.push({node:l,header:c==="th"})}}o.length&&(i.push(o),o.length>s&&(s=o.length))}if(i.length){for(var h=this.contentWidth-r,v=h/s,p=4,m=[],d=0;d<i.length;d++){for(var x=[],w=0,y=0;y<i[d].length;y++){var k=_(i[d][y].node,t);i[d][y].header&&(k.bold=!0);for(var C=n.wrap(n.runsOf(i[d][y].node,k),v-p*2,1.35),z=0,I=0;I<C.length;I++)z+=C[I].height;z>w&&(w=z),x.push({lines:C,header:i[d][y].header})}m.push({cells:x,height:w+p*2,header:i[d][0]&&i[d][0].header})}this.blocks.push({type:"table",rows:m,colWidth:v,cols:s,indent:r,pad:p,spaceBefore:this.baseSize*.5,spaceAfter:this.baseSize*.5})}};function de(e){var t=String(e.font||M.pdfExportFont||"helvetica").toLowerCase();Q[t]||(t="helvetica");var r=Number(e.fontSize||M.pdfExportBaseFontSize||11);(!isFinite(r)||r<=0)&&(r=11);var n=be(e),i=document.createElement("div");i.innerHTML=N.getHTMLCode()||"";var f=new Z(n,r,t),s=f.run(i),a=Ee(s,n,r);return Re(a,n,t,r,e)}function Ee(e,t,r){var n=t.height-t.margin.top,i=t.margin.bottom,f=[],s=[],a=n;function o(){f.push(s),s=[],a=n}for(var u=0;u<e.length;u++){var l=e[u];if(l.type==="pagebreak"){s.length&&o();continue}if(l.type==="rule"){a-r<i&&o(),a-=r*.6,s.push({op:"rule",y:a,indent:l.indent}),a-=r*.6;continue}if(l.type==="table"){a-=l.spaceBefore;for(var c=0;c<l.rows.length;c++){var h=l.rows[c];a-h.height<i&&(o(),l.rows[0]&&l.rows[0].header&&c>0&&(s.push({op:"row",row:l.rows[0],y:a,block:l}),a-=l.rows[0].height)),s.push({op:"row",row:h,y:a,block:l}),a-=h.height}a-=l.spaceAfter;continue}a-=l.spaceBefore;for(var v=0;v<l.lines.length;v++){var p=l.lines[v];a-p.height<i&&o(),s.push({op:"line",line:p,y:a,block:l,first:v===0}),a-=p.height}if(a-=l.spaceAfter,l.keepWithNext&&s.length&&e[u+1]&&e[u+1].type!=="pagebreak"){var m=Ae(e[u+1]);if(a-m<i){for(var d=[];s.length&&s[s.length-1].block===l;)d.unshift(s.pop());if(s.length){o();for(var x=0;x<d.length;x++)d[x].y=a,s.push(d[x]),a-=d[x].line.height}else for(var w=0;w<d.length;w++)s.push(d[w])}}}return(s.length||!f.length)&&f.push(s),f}function Ae(e){return e.type==="table"?e.rows[0]?e.rows[0].height:0:e.lines&&e.lines[0]?e.lines[0].height:0}function Re(e,t,r,n,i){var f=new Y,s=Q[r],a=Q.courier,o={},u=[];function l(B,F,O,T){var A=re(F,O),P=f.add("<< /Type /Font /Subtype /Type1 /BaseFont /"+B+" /Encoding /WinAnsiEncoding /FirstChar "+te+" /LastChar "+oe+" /Widths ["+A.join(" ")+"] >>");o[T]=P,u.push("/"+T+" "+P+" 0 R")}for(var c=0;c<4;c++)l(s.faces[c],r,c,"F"+c),l(a.faces[c],"courier",c,"M"+c);var h={},v=[];function p(B){var F=B.getAttribute("src")||"";if(h[F])return h[F];var O=Fe(B);if(!O)return null;var T=f.add({dict:"<< /Type /XObject /Subtype /Image /Width "+O.width+" /Height "+O.height+" /ColorSpace /DeviceRGB /BitsPerComponent 8 /Filter /DCTDecode /Length 0 >>",stream:O.bytes}),A="Im"+(v.length+1);return h[F]={id:T,alias:A},v.push("/"+A+" "+T+" 0 R"),h[F]}for(var m=[],d=[],x=[],w=0;w<e.length;w++)m.push(f.alloc()),d.push(f.alloc()),x.push([]);for(var y=f.alloc(),k=[],C=0;C<e.length;C++){var z=new ne(C),I=De(e[C],t,r,n,p,C+1,e.length,i,z);f.set(d[C],{dict:"<< /Length 0 >>",stream:I.content}),k.push(I.marks);for(var S=0;S<I.links.length;S++){var L=I.links[S];x[C].push(f.add("<< /Type /Annot /Subtype /Link /Rect ["+g(L.x0)+" "+g(L.y0)+" "+g(L.x1)+" "+g(L.y1)+"] /Border [0 0 0] /A << /S /URI /URI ("+H(W(L.href))+") >> >>"))}}for(var b=Ie(f,k,m),R=0;R<e.length;R++)f.set(m[R],"<< /Type /Page /Parent "+y+" 0 R /MediaBox [0 0 "+g(t.width)+" "+g(t.height)+"] /Resources << /Font << "+u.join(" ")+" >>"+(v.length?" /XObject << "+v.join(" ")+" >>":"")+" >> /Contents "+d[R]+" 0 R /StructParents "+R+(x[R].length?" /Annots ["+x[R].map(function(B){return B+" 0 R"}).join(" ")+"]":"")+" >>");f.set(y,"<< /Type /Pages /Count "+e.length+" /Kids ["+m.map(function(B){return B+" 0 R"}).join(" ")+"] >>");var E=i.title||M.pdfExportTitle||document.title||"Document",J=i.author||M.pdfExportAuthor||"",U=f.add("<< /Type /Catalog /Pages "+y+" 0 R /Lang ("+H(String(i.lang||document.documentElement.lang||"en"))+") /MarkInfo << /Marked true >> /StructTreeRoot "+b.rootId+" 0 R /ViewerPreferences << /DisplayDocTitle true >> >>"),ie=f.add("<< /Title ("+H(W(String(E)))+")"+(J?" /Author ("+H(W(String(J)))+")":"")+" /Producer (RichTextEditor) /Creator (RichTextEditor) /CreationDate ("+Le(new Date)+") >>");return f.build(U,ie)}function Ie(e,t,r){var n=e.alloc(),i=[],f=[];function s(T,A){var P={id:e.alloc(),role:T,kids:[],extra:A||"",children:[],parent:null};return i.push(P),P}for(var a=s("Document"),o=new Map,u=new Map,l=new Map,c=new Map,h=new Map,v=new Map,p=new Map,m=0;m<t.length;m++){var d=t[m];f[m]=[];for(var x=0;x<d.length;x++){var w=d[x].owner,y=d[x].mcid,k=z(w);k.kids.push({page:m,mcid:y}),f[m][y]=k.id}}function C(T,A){A.parent||(A.parent=T,T.children.push(A))}function z(T){if(T.kind==="cell"){var A=h.get(T.block);A||(A=s("Table"),h.set(T.block,A),C(a,A));var P=v.get(T.row);P||(P=s("TR"),v.set(T.row,P),C(A,P));var j=p.get(T.row);return j||(j={},p.set(T.row,j)),j[T.col]||(j[T.col]=s(T.header?"TH":"TD",T.header?" /Scope /Column":""),C(P,j[T.col])),j[T.col]}var D=T.block,fe=a;if(D.listId){var K=o.get(D.listId);K||(K=s("L"),o.set(D.listId,K),C(a,K));var X=u.get(D);X||(X=s("LI"),u.set(D,X),C(K,X)),fe=X}if(T.kind==="lbl"){var ee=l.get(D);return ee||(ee=s("Lbl"),l.set(D,ee),C(fe,ee)),ee}var $=c.get(D);if(!$){if(D.listId)$=s("LBody");else{var He=D.role==="Figure"?" /Alt ("+H(W(D.alt||"Image"))+")":"";$=s(D.role||"P",He)}c.set(D,$),C(fe,$)}return $}for(var I=0;I<i.length;I++){for(var S=i[I],L=[],b=0;b<S.children.length;b++)L.push(S.children[b].id+" 0 R");for(var R=0;R<S.kids.length;R++)L.push("<< /Type /MCR /Pg "+r[S.kids[R].page]+" 0 R /MCID "+S.kids[R].mcid+" >>");var E=S.parent?S.parent.id:n;e.set(S.id,"<< /Type /StructElem /S /"+S.role+" /P "+E+" 0 R"+S.extra+(L.length?" /K ["+L.join(" ")+"]":"")+" >>")}for(var J=[],U=0;U<f.length;U++){for(var ie=f[U]||[],B=[],F=0;F<ie.length;F++)B.push((ie[F]||a.id)+" 0 R");J.push(U+" ["+B.join(" ")+"]")}var O=e.add("<< /Nums ["+J.join(" ")+"] >>");return e.set(n,"<< /Type /StructTreeRoot /K ["+a.id+" 0 R] /ParentTree "+O+" 0 R /ParentTreeNextKey "+f.length+" >>"),{rootId:n}}function Le(e){function t(r){return(r<10?"0":"")+r}return"D:"+e.getFullYear()+t(e.getMonth()+1)+t(e.getDate())+t(e.getHours())+t(e.getMinutes())+t(e.getSeconds())+"Z"}function g(e){return(Math.round(e*100)/100).toString()}function ne(e){this.pageIndex=e,this.next=0,this.marks=[]}ne.prototype.open=function(e,t,r){var n=this.next++;return this.marks.push({owner:r,mcid:n,role:t}),e.push("/"+t+" << /MCID "+n+" >> BDC"),n},ne.prototype.close=function(e){e.push("EMC")},ne.prototype.artifact=function(e,t){e.push("/Artifact BMC"),t(),e.push("EMC")};function De(e,t,r,n,i,f,s,a,o){for(var u=[],l=[],c=t.margin.left,h=0;h<e.length;h++){var v=e[h];if(v.op==="rule"){o.artifact(u,function(){u.push("0.8 0.8 0.8 RG 0.5 w "+g(c+v.indent)+" "+g(v.y)+" m "+g(t.width-t.margin.right)+" "+g(v.y)+" l S")});continue}if(v.op==="row"){Pe(v,t,u,c,i,l,o);continue}xe(v,t,u,c,r,i,l,o)}var p=Ne(a);return(p.header||p.footer)&&o.artifact(u,function(){p.header&&ge(u,p.header,t,t.height-t.margin.top*.55,r,n*.85,f,s),p.footer&&ge(u,p.footer,t,t.margin.bottom*.55,r,n*.85,f,s)}),{content:u.join(`
|
|
19
|
+
`),links:l,marks:o.marks}}function Ne(e){var t=null;try{typeof N.getDocumentPageSetup=="function"&&(t=N.getDocumentPageSetup())}catch{}return t=t||{},{header:e.headerText||M.pdfExportHeader||pe(t.headerHtml)||"",footer:e.footerText||M.pdfExportFooter||pe(t.footerHtml)||""}}function pe(e){if(!e||typeof e!="string")return"";var t=document.createElement("div");return t.innerHTML=e,(t.textContent||"").replace(/\s+/g," ").trim()}function ge(e,t,r,n,i,f,s,a){var o=String(t).replace(/\{page\}/g,s).replace(/\{total\}/g,a),u=W(o),l=ue(u,i,0,f),c=(r.width-l)/2;e.push("BT /F0 "+g(f)+" Tf 0.4 0.4 0.4 rg "+g(c)+" "+g(n)+" Td ("+H(u)+") Tj ET")}function xe(e,t,r,n,i,f,s,a){var o=e.line,u=e.block,l=n+(u.indent||0),c=t.width-t.margin.right-l;if(u.align==="center"?l+=(c-o.width)/2:u.align==="right"&&(l+=c-o.width),u.rule==="quote"&&!o.image){var h=g(n+u.indent-8),v=function(){r.push("0.8 0.8 0.85 RG 2 w "+h+" "+g(e.y-o.height+4)+" m "+h+" "+g(e.y+o.size*.8)+" l S")};a?a.artifact(r,v):v()}if(e.first&&u.marker){var p=u.markerStyle||{size:o.size,color:[0,0,0]},m=ue(u.marker,i,0,p.size);a&&a.open(r,"Lbl",{kind:"lbl",block:u}),r.push("BT /F0 "+g(p.size)+" Tf "+me(p.color)+" "+g(l-m-6)+" "+g(e.y-o.size*.85)+" Td ("+H(W(u.marker))+") Tj ET"),a&&a.close(r)}a&&a.open(r,o.image?"Figure":"Span",e.cell||{kind:"body",block:u});for(var d=[],x=l,w=0;w<o.parts.length;w++){var y=o.parts[w];if(y.img){d.push({img:y,x,w:y.w}),x+=y.w;continue}var k=y.style,C=(k.mono?"M":"F")+y.styleIndex,z=d.length?d[d.length-1]:null,I=z&&!z.img&&z.alias===C&&z.style.size===k.size&&Be(z.style.color,k.color)&&z.style.underline===k.underline&&z.style.strike===k.strike&&z.style.link===k.link;I?(z.text+=y.text,z.w+=y.w):d.push({text:y.text,style:k,alias:C,x,w:y.w}),x+=y.w}for(var S=e.y-o.size*.85,L=0;L<d.length;L++){var b=d[L];if(b.img){var R=f(b.img.img);R&&r.push("q "+g(b.w)+" 0 0 "+g(b.img.h)+" "+g(b.x)+" "+g(e.y-b.img.h)+" cm /"+R.alias+" Do Q");continue}if(!(!b.text||/^\s+$/.test(b.text))){var E=b.style;r.push("BT /"+b.alias+" "+g(E.size)+" Tf "+me(E.color)+" "+g(b.x)+" "+g(S)+" Td ("+H(W(b.text))+") Tj ET"),E.underline&&r.push(ye(E.color)+" 0.5 w "+g(b.x)+" "+g(S-E.size*.12)+" m "+g(b.x+b.w)+" "+g(S-E.size*.12)+" l S"),E.strike&&r.push(ye(E.color)+" 0.5 w "+g(b.x)+" "+g(S+E.size*.28)+" m "+g(b.x+b.w)+" "+g(S+E.size*.28)+" l S"),E.link&&s.push({href:E.link,x0:b.x,y0:S-2,x1:b.x+b.w,y1:S+E.size})}}a&&a.close(r)}function Be(e,t){return e=e||[0,0,0],t=t||[0,0,0],e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Pe(e,t,r,n,i,f,s){for(var a=e.block,o=e.row,u=n+a.indent,l=e.y,c=e.y-o.height,h=0;h<o.cells.length;h++){var v=u+h*a.colWidth,p=function(){o.header&&r.push("0.94 0.95 0.97 rg "+g(v)+" "+g(c)+" "+g(a.colWidth)+" "+g(o.height)+" re f"),r.push("0.75 0.78 0.82 RG 0.5 w "+g(v)+" "+g(c)+" "+g(a.colWidth)+" "+g(o.height)+" re S")};s?s.artifact(r,p):p();for(var m={kind:"cell",block:a,row:o,col:h,header:!!o.cells[h].header},d=l-a.pad,x=o.cells[h].lines,w=0;w<x.length;w++)xe({line:x[w],y:d,block:{indent:0,align:"left"},first:w===0,cell:m},{width:v+a.colWidth+t.margin.right,margin:{right:t.margin.right}},r,v+a.pad,"helvetica",i,f,s),d-=x[w].height}}function me(e){return e=e||[0,0,0],g(e[0])+" "+g(e[1])+" "+g(e[2])+" rg"}function ye(e){return e=e||[0,0,0],g(e[0])+" "+g(e[1])+" "+g(e[2])+" RG"}function Fe(e){try{var t=e.naturalWidth||e.width,r=e.naturalHeight||e.height;if(!t||!r)return null;var n=2e3,i=Math.min(1,n/Math.max(t,r)),f=Math.max(1,Math.round(t*i)),s=Math.max(1,Math.round(r*i)),a=document.createElement("canvas");a.width=f,a.height=s;var o=a.getContext("2d");o.fillStyle="#ffffff",o.fillRect(0,0,f,s),o.drawImage(e,0,0,f,s);var u=a.toDataURL("image/jpeg",.92),l=u.indexOf(",");if(l<0)return null;for(var c=atob(u.slice(l+1)),h=new Uint8Array(c.length),v=0;v<c.length;v++)h[v]=c.charCodeAt(v);return{bytes:h,width:f,height:s}}catch{return null}}function we(e){return!e||typeof e!="string"?"":e.replace(/\.pdf$/i,"").replace(/[\\/:*?"<>|]+/g,"").trim().slice(0,120)}function Me(){var e=new Date;function t(r){return(r<10?"0":"")+r}return"Export-"+String(e.getFullYear()).slice(2)+t(e.getMonth()+1)+t(e.getDate())+"-"+t(e.getHours())+t(e.getMinutes())+t(e.getSeconds())}function We(e,t){var r=new Blob([e],{type:"application/pdf"}),n=URL.createObjectURL(r),i=document.createElement("a");return i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),setTimeout(function(){URL.revokeObjectURL(n)},4e3),t}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_permanentpen=RTE_Plugin_PermanentPen,typeof RTE_DefaultConfig.permanentPenStyle>"u"&&(RTE_DefaultConfig.permanentPenStyle={color:"#c81e1e","font-weight":"700"}),typeof RTE_DefaultConfig.permanentPenClass>"u"&&(RTE_DefaultConfig.permanentPenClass="rte-pen");function RTE_Plugin_PermanentPen(){var c=this,u,a,y=null,o=!1,i=null;c.PluginName="PermanentPen",c.InitConfig=function(t){u=t},c.InitEditor=function(t){a=t,a.attachEvent("exec_command_permanentpen",function(e){e.returnValue=!0,c.Toggle()}),s();try{a.attachEvent("ready",s)}catch{}try{a.attachEvent("aftersethtml",s)}catch{}setTimeout(s,0),a.setPermanentPen=function(e){return P(!!e)},a.togglePermanentPen=function(){return P(!o)},a.isPermanentPenActive=function(){return o},a.setPermanentPenStyle=function(e){return e&&typeof e=="object"&&(u.permanentPenStyle=e,i=null),u.permanentPenStyle},a.getPermanentPenStyle=function(){var e=u.permanentPenStyle||{},n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}};function s(){var t=p();if(!(!t||t===y)){y=t;var e=d();e&&(e.addEventListener("beforeinput",R,!0),e.addEventListener("mouseup",function(){i=null}),e.addEventListener("keydown",function(n){/^Arrow|^Home|^End|^Page/.test(n.key)&&(i=null)}),e.addEventListener("blur",function(){i=null}))}}function p(){try{return a.getDocument()}catch{return null}}function d(){try{return a.getEditable()}catch{return null}}function P(t){var e=o;o=!!t;var n=d();return n&&n.classList&&(o?n.classList.add("rte-pen-active"):n.classList.remove("rte-pen-active")),e&&!o&&C(),i=null,o}function C(){var t=p();if(t){var e;try{e=a.getSelection()}catch{return}if(!(!e||e.rangeCount===0)){var n=h(e.getRangeAt(0).startContainer);if(!(!n||!n.parentNode)){E(n);try{var r=t.createRange();r.setStartAfter(n),r.collapse(!0),e.removeAllRanges(),e.addRange(r)}catch{}}}}}function E(t){if(t){var e=t.textContent||"";if(e.replace(//g,"")===""){t.parentNode&&t.parentNode.removeChild(t);return}for(var n=t.ownerDocument.createTreeWalker(t,4,null,!1),r;r=n.nextNode();)r.nodeValue.indexOf("\u200B")>=0&&(r.nodeValue=r.nodeValue.replace(//g,""))}}function R(t){if(o&&!(t.inputType&&t.inputType!=="insertText"&&t.inputType!=="insertCompositionText")){var e=p();if(e){var n;try{n=a.getSelection()}catch{return}if(!(!n||n.rangeCount===0)){var r=n.getRangeAt(0);if(r.collapsed&&!(i&&T(i,r.startContainer))){var f=h(r.startContainer);if(f&&S(f)){i=f;return}var l=e.createElement("span");l.className=String(u.permanentPenClass||"rte-pen");var v=u.permanentPenStyle||{};for(var g in v)v.hasOwnProperty(g)&&l.style.setProperty(g,v[g]);l.appendChild(e.createTextNode("\u200B")),r.insertNode(l);var m=e.createRange();m.setStart(l.firstChild,1),m.collapse(!0),n.removeAllRanges(),n.addRange(m),i=l}}}}}function T(t,e){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function h(t){for(var e=d(),n=String(u.permanentPenClass||"rte-pen"),r=t&&t.nodeType===3?t.parentNode:t;r&&r!==e;){if(r.nodeType===1&&r.classList&&r.classList.contains(n))return r;r=r.parentNode}return null}function S(t){var e=u.permanentPenStyle||{};for(var n in e)if(e.hasOwnProperty(n)&&t.style.getPropertyValue(n)!==String(e[n]))return!1;return!0}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_readabilitystats=RTE_Plugin_ReadabilityStats,typeof RTE_DefaultConfig.readabilityStats>"u"&&(RTE_DefaultConfig.readabilityStats=!0);function RTE_Plugin_ReadabilityStats(){var u=this,h,r;u.PluginName="ReadabilityStats",u.InitConfig=function(e){h=e},u.InitEditor=function(e){r=e,h.readabilityStats!==!1&&(r.countSyllables=function(t){return v(t)},r.getReadabilityStats=function(t){return b(t!=null?String(t):p())},r.attachEvent("exec_command_readability",function(t){t.returnValue=!0,t.stopBubble=!0,S()}))};function p(){try{var e=r.getEditable&&r.getEditable();if(e)return e.innerText||e.textContent||""}catch{}return""}function v(e){if(e=String(e||"").toLowerCase().replace(/[^a-z]/g,""),!e)return 0;if(e.length<=3)return 1;e=e.replace(/(?:[^laeiouy]es|ed|[^laeiouy]e)$/,"").replace(/^y/,"");var t=e.match(/[aeiouy]{1,2}/g);return t?t.length:1}function b(e){e=String(e||"").replace(/\s+/g," ").trim();var t=e?e.split(/\s+/):[],a=t.length,o=e.match(/[^.!?]+[.!?]+/g),n=o?o.length:a?1:0;a&&n===0&&(n=1);for(var i=0,l=0;l<t.length;l++)i+=v(t[l]);var c=e.replace(/\s/g,"").length,s=n?a/n:0,d=a?i/a:0,g=a?206.835-1.015*s-84.6*d:0,y=a?.39*s+11.8*d-15.59:0;g=Math.round(g*10)/10,y=Math.round(y*10)/10;var T=parseInt(h.readabilityWordsPerMinute,10)||200,f=a/T,x=f<1?Math.max(1,Math.round(f*60))+" sec":Math.round(f)+" min";return{words:a,sentences:n,syllables:i,characters:c,avgWordsPerSentence:Math.round(s*10)/10,avgSyllablesPerWord:Math.round(d*100)/100,fleschReadingEase:g,fleschKincaidGrade:Math.max(0,y),readingTimeMinutes:Math.round(f*10)/10,readingTimeText:x,easeLabel:m(g)}}function m(e){return e>=90?"Very easy (5th grade)":e>=80?"Easy (6th grade)":e>=70?"Fairly easy (7th grade)":e>=60?"Standard (8\u20139th grade)":e>=50?"Fairly difficult (10\u201312th grade)":e>=30?"Difficult (college)":"Very difficult (college graduate)"}function S(){var e=b(p());try{var t=r.createDialog(r.getLangText&&r.getLangText("readabilitytitle")||"Readability statistics","rte-dialog-readability"),a=t.ownerDocument,o=a.createElement("div");o.style.cssText="padding:14px 18px;min-width:340px;font:13px -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Arial,sans-serif;color:#0f172a";for(var n=[["Flesch Reading Ease",e.fleschReadingEase+" \u2014 "+e.easeLabel,!0],["Flesch\u2013Kincaid Grade",String(e.fleschKincaidGrade),!1],["Reading time",e.readingTimeText,!1],["Words",String(e.words),!1],["Sentences",String(e.sentences),!1],["Avg words / sentence",String(e.avgWordsPerSentence),!1],["Avg syllables / word",String(e.avgSyllablesPerWord),!1],["Characters (no spaces)",String(e.characters),!1]],i=0;i<n.length;i++){var l=a.createElement("div");l.style.cssText="display:flex;justify-content:space-between;gap:24px;padding:6px 0;border-bottom:1px solid #eef2f7"+(n[i][2]?";font-weight:600;font-size:14px":"");var c=a.createElement("span");c.textContent=n[i][0],c.style.color="#475569";var s=a.createElement("span");s.textContent=n[i][1],s.style.textAlign="right",l.appendChild(c),l.appendChild(s),o.appendChild(l)}t.appendChild(o)}catch{window.console&&console.warn("readabilitystats:",e)}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_readaloud=RTE_Plugin_ReadAloud,RTE_DefaultConfig.readAloudRate=RTE_DefaultConfig.readAloudRate||1,RTE_DefaultConfig.readAloudHighlight=typeof RTE_DefaultConfig.readAloudHighlight>"u"?!0:RTE_DefaultConfig.readAloudHighlight;function RTE_Plugin_ReadAloud(){var r=this,w,f,i=null,N,E,u,h,R=[],v=0,g=!1,m=!1,x=null;r.PluginName="ReadAloud";function C(){return window.speechSynthesis||null}function P(){return!!C()&&typeof window.SpeechSynthesisUtterance=="function"}r.InitConfig=function(e){w=e},r.InitEditor=function(e){f=e,f.readAloud=function(t){r.Start(t||{})},f.stopReadAloud=function(){r.Stop()},f.attachEvent("exec_command_readaloud",function(t){if(t.returnValue=!0,!P()){r.NotifyUnsupported();return}i?r.CloseBar():r.OpenBar()});try{window.addEventListener("pagehide",function(){r.Stop()}),document.addEventListener("visibilitychange",function(){document.hidden&&r.Pause()})}catch{}},r.NotifyUnsupported=function(){try{var e=f.createDialog(f.getLangText&&f.getLangText("readaloudtitle")||"Read aloud","rte-dialog-readaloud"),t=e.ownerDocument.createElement("div");t.style.cssText="padding:16px;min-width:320px;font:13px -apple-system,Segoe UI,sans-serif",t.textContent="This browser does not provide a speech synthesizer (Web Speech API). Read-aloud is unavailable here.",e.appendChild(t)}catch{}};function I(){for(var e=f.getEditable(),t=e.ownerDocument,a=t.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(p){for(var c=p.parentNode;c&&c!==e;){var s=c.nodeName;if(s==="SCRIPT"||s==="STYLE"||s==="NOSCRIPT")return NodeFilter.FILTER_REJECT;c=c.parentNode}return p.data&&p.data.length?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}}),n=[],o="",l;l=a.nextNode();)n.push({node:l,start:o.length,len:l.data.length}),o+=l.data;function d(p){for(var c=0;c<n.length;c++){var s=n[c];if(p<=s.start+s.len)return{node:s.node,offset:Math.max(0,p-s.start)}}var b=n[n.length-1];return b?{node:b.node,offset:b.len}:null}function y(p,c){for(var s=0;s<n.length;s++)if(n[s].node===p)return n[s].start+c;return-1}return{full:o,locate:d,globalOffset:y,hasNodes:n.length>0}}function L(e,t){for(var a=[],n=/[^.!?\n。!?]*[.!?\n。!?]+|\S[^.!?\n]*$/g,o;(o=n.exec(e))!==null;)o[0]&&/\S/.test(o[0])&&a.push({text:o[0],start:t+o.index,end:t+o.index+o[0].length}),o.index===n.lastIndex&&n.lastIndex++;return!a.length&&/\S/.test(e)&&a.push({text:e,start:t,end:t+e.length}),a}r.Start=function(e){if(!P()){r.NotifyUnsupported();return}r.Stop();var t=I();if(!t.hasNodes){S("Nothing to read");return}var a=f.getSelection?f.getSelection():null,n=0,o=t.full.length;try{if(a&&a.rangeCount&&!a.isCollapsed){var l=a.getRangeAt(0),d=t.globalOffset(l.startContainer,l.startOffset),y=t.globalOffset(l.endContainer,l.endOffset);d>=0&&y>=0&&y>d&&(n=d,o=y)}}catch{}x=a&&a.rangeCount?a.getRangeAt(0).cloneRange():null;var p=t.full.substring(n,o);if(R=L(p,n),!R.length){S("Nothing to read");return}v=0,g=!0,m=!1,r._map=t,r._opts=e||{},_(),T()};function T(){var e=C();if(!e||v>=R.length){r.Stop();return}var t=R[v],a=new SpeechSynthesisUtterance(t.text),n=r._opts&&r._opts.rate||h&&parseFloat(h.value)||w.readAloudRate||1;a.rate=Math.min(2,Math.max(.5,n));var o=B();o&&(a.voice=o),a.onstart=function(){w.readAloudHighlight!==!1&&O(t),S("Reading\u2026 ("+(v+1)+"/"+R.length+")")},a.onend=function(){g&&(v++,T())},a.onerror=function(){g&&(v++,T())};try{e.speak(a)}catch{v++,T()}}function O(e){try{var t=r._map;if(!t)return;var a=t.locate(e.start),n=t.locate(e.end);if(!a||!n)return;var o=f.getDocument(),l=o.createRange();l.setStart(a.node,a.offset),l.setEnd(n.node,n.offset);var d=f.getSelection();d&&(d.removeAllRanges(),d.addRange(l))}catch{}}r.Pause=function(){var e=C();if(!(!e||!g)&&!m){try{e.pause()}catch{}m=!0,_(),S("Paused")}},r.Resume=function(){var e=C();if(!(!e||!g)&&m){try{e.resume()}catch{}m=!1,_(),S("Reading\u2026")}},r.Stop=function(){var e=C();if(g=!1,m=!1,R=[],v=0,e)try{e.cancel()}catch{}try{if(x){var t=f.getSelection();t&&(t.removeAllRanges(),t.addRange(x))}}catch{}x=null,_(),S("")};function D(){var e=C();if(!(!e||!u)){var t=e.getVoices()||[];if(t.length){var a=u.value;u.innerHTML="",t.forEach(function(n,o){var l=u.ownerDocument.createElement("option");l.value=n.name,l.textContent=n.name+" ("+n.lang+")",n.default&&(l.textContent+=" (default)"),u.appendChild(l)}),a&&(u.value=a)}}}function B(){var e=C();if(!e)return null;var t=e.getVoices()||[];if(r._opts&&r._opts.voice){for(var a=0;a<t.length;a++)if(t[a].name===r._opts.voice)return t[a]}if(u&&u.value){for(var n=0;n<t.length;n++)if(t[n].name===u.value)return t[n]}return null}function A(e,t,a){var n=e.ownerDocument.createElement("button");return n.type="button",n.textContent=t,a&&(n.title=a),n.className="rte-readaloud-button",e.appendChild(n),n}r.OpenBar=function(){if(!i){var e=document;i=e.createElement("div"),i.className="rte-readaloud-bar";var t=e.createElement("span");t.className="rte-readaloud-title",t.textContent="Read",i.appendChild(t),N=A(i,"Play","Play / Pause");var a=A(i,"Stop","Stop");u=e.createElement("select"),u.className="rte-readaloud-voice",u.title="Voice",i.appendChild(u),h=e.createElement("select"),h.className="rte-readaloud-rate",h.title="Speed",["0.75","1","1.25","1.5","2"].forEach(function(l){var d=e.createElement("option");d.value=l,d.textContent=l+"x",l==="1"&&(d.selected=!0),h.appendChild(d)}),i.appendChild(h),E=e.createElement("span"),E.className="rte-readaloud-status",i.appendChild(E);var n=A(i,"Close","Close");n.className+=" is-close",e.body.appendChild(i),D();var o=C();o&&typeof o.addEventListener=="function"&&o.addEventListener("voiceschanged",D),N.onclick=function(){g?m?r.Resume():r.Pause():r.Start({})},a.onclick=function(){r.Stop()},n.onclick=function(){r.CloseBar()},r.Start({})}},r.CloseBar=function(){r.Stop(),i&&i.parentNode&&i.parentNode.removeChild(i),i=null,N=E=u=h=null};function _(){N&&(N.textContent=g&&!m?"Pause":"Play")}function S(e){E&&(E.textContent=e)}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.svgCode_restrictedediting||(RTE_DefaultConfig.svgCode_restrictedediting='<svg viewBox="0 0 24 24" fill="none" stroke="#5F6368" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="11" width="14" height="9" rx="1.5"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/></svg>'),RTE_DefaultConfig.plugin_restrictedediting=RTE_Plugin_RestrictedEditing;function RTE_Plugin_RestrictedEditing(){var v=this,l,o,u=!1,d="data-rte-editable";v.PluginName="RestrictedEditing",v.InitConfig=function(e){l=e,l.text_restrictedediting=l.text_restrictedediting||"Restricted editing",l.text_restrictedediting_mark=l.text_restrictedediting_mark||"Mark as editable",l.text_restrictedediting_next=l.text_restrictedediting_next||"Next editable region",l.text_restrictedediting_hint=l.text_restrictedediting_hint||"Lock the document; only marked regions accept input."},v.InitEditor=function(e){o=e,u=!!l.restrictedEditingMode,o.restrictedEditing={isEnabled:function(){return u},enable:g,disable:_,toggle:function(){return u?_():g()},markSelection:m,unmark:x,list:p,goToNext:function(){return y(1)},goToPrev:function(){return y(-1)}},o.attachEvent("exec_command_restrictedediting",function(t){t.returnValue=!0,t.stopBubble=!0,o.restrictedEditing.toggle()}),u&&g(),o.attachEvent("change",f),f()};function c(){return o.getEditable?o.getEditable():null}function f(){var e=c();if(e){var t=e.ownerDocument;if(!(!t||t.getElementById("__rte_restrictedediting_styles"))){var r=t.createElement("style");r.id="__rte_restrictedediting_styles",r.textContent=["["+d+"='true']{background:rgba(34,197,94,.10);outline:1px dashed rgba(34,197,94,.55);outline-offset:1px;border-radius:2px;padding:1px 2px}","body.rte-restricted [contenteditable='false']{cursor:not-allowed}","body.rte-restricted ["+d+"='true']{background:rgba(34,197,94,.16)}"].join(`
|
|
2
|
+
`),(t.head||t.getElementsByTagName("head")[0]).appendChild(r),o&&typeof o.ensureStyleSheetLive=="function"&&o.ensureStyleSheetLive(t,r,"__rte_restrictedediting_styles",r.textContent)}}}function g(){var e=c();if(!e)return!1;u=!0,e.classList.add("rte-restricted");for(var t=0;t<e.children.length;t++){var r=e.children[t];r.querySelector("["+d+"='true']")?(r.setAttribute("contenteditable","true"),r.setAttribute(d+"-wrapper","true")):r.setAttribute("contenteditable","false")}return e.setAttribute("contenteditable","false"),f(),!0}function _(){var e=c();if(!e)return!1;u=!1,e.classList.remove("rte-restricted");for(var t=e.querySelectorAll("[contenteditable]"),r=0;r<t.length;r++)t[r].removeAttribute("contenteditable"),t[r].removeAttribute(d+"-wrapper");return e.setAttribute("contenteditable","true"),!0}function m(e){e=e||{};var t=c();if(!t)return null;var r=t.ownerDocument,a=r.getSelection();if(!a||a.rangeCount===0)return null;var n=a.getRangeAt(0);if(n.collapsed)return null;var i=r.createElement("span");i.setAttribute(d,"true"),e.label&&i.setAttribute("aria-label",e.label);try{n.surroundContents(i)}catch{var h=n.extractContents();i.appendChild(h),n.insertNode(i)}var s=r.createRange();return s.selectNodeContents(i),a.removeAllRanges(),a.addRange(s),f(),u&&g(),i}function x(e){if(e=e||(function(){var r=c(),a=r&&r.ownerDocument.getSelection();if(!a||a.rangeCount===0)return null;for(var n=a.anchorNode;n&&n!==r;){if(n.nodeType===1&&n.getAttribute&&n.getAttribute(d)==="true")return n;n=n.parentNode}return null})(),!e)return!1;for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);return t.removeChild(e),u&&g(),!0}function p(){var e=c();return e?Array.prototype.slice.call(e.querySelectorAll("["+d+"='true']")):[]}function y(e){var t=p();if(t.length===0)return null;var r=c(),a=r&&r.ownerDocument.getSelection(),n=null;if(a&&a.anchorNode)for(var i=a.anchorNode;i&&i!==r;){if(i.nodeType===1&&i.getAttribute&&i.getAttribute(d)==="true"){n=i;break}i=i.parentNode}var h=n?t.indexOf(n):-1,s=t[(h+e+t.length)%t.length];if(!s)return null;var b=r.ownerDocument.createRange();return b.selectNodeContents(s),b.collapse(!1),a.removeAllRanges(),a.addRange(b),s.scrollIntoView({block:"center",behavior:"smooth"}),s}}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.svgCode_revisionhistory||(RTE_DefaultConfig.svgCode_revisionhistory='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 12a9 9 0 1 0 3-6.7"/><path d="M3 4v5h5"/><path d="M12 8v4l3 2"/></svg>'),RTE_DefaultConfig.plugin_revisionhistory=RTE_Plugin_RevisionHistory;function RTE_Plugin_RevisionHistory(){var F=this,a,n,d=null,K=null,L="";F.PluginName="RevisionHistory",F.InitConfig=function(r){a=r,a.revisionHistoryEnabled!==!1&&(a.revisionHistoryMaxEntries=a.revisionHistoryMaxEntries||50,a.revisionHistoryAutoSnapshotMs=a.revisionHistoryAutoSnapshotMs||0,a.revisionHistoryUrl=a.revisionHistoryUrl||"",a.revisionHistoryRequestHeaders=a.revisionHistoryRequestHeaders||null,a.onRevisionHistorySyncError=a.onRevisionHistorySyncError||null,a.text_revisionhistory=a.text_revisionhistory||"Revision history",I("toolbar_default","#{revisionhistory}"),I("toolbar_full","#{revisionhistory}"),I("toolbar_mobile","#{revisionhistory}"),(a.controltoolbar_TEXT||"").indexOf("revisionhistory")===-1&&(a.controltoolbar_TEXT=(a.controltoolbar_TEXT||"")+"|{revisionhistory}"))},F.InitEditor=function(r){n=r,a.revisionHistoryEnabled!==!1&&(n.revisionHistory={snapshot:function(e,t){return j(e,t)},promptAndSnapshot:function(e){return ae(e)},rename:function(e,t){return se(e,t)},list:function(){return C().slice().sort(function(e,t){return(t.createdAt||0)-(e.createdAt||0)})},listNamed:function(){return C().slice().filter(function(e){return e.isNamed===!0}).sort(function(e,t){return(t.createdAt||0)-(e.createdAt||0)})},get:function(e){return g(e)},restore:function(e,t){return B(e,t||{})},delete:function(e){return ee(e)},clear:function(){return ce()},diff:function(e,t){return le(e,t)},openBrowser:function(){V()},closeBrowser:function(){N()}},n.toolbarFactoryMap=n.toolbarFactoryMap||{},n.toolbarFactoryMap.revisionhistory=function(e){return n.createToolbarButton(e)},n.attachEvent("exec_command_revisionhistory",function(e){e.returnValue=!0,e.stopBubble=!0,V()}),ve(),ie(),L=n.getHTML?n.getHTML():"",a.revisionHistoryAutoSnapshotMs>0&&n.getDocument().addEventListener("input",function(){K&&clearTimeout(K),K=setTimeout(function(){var e=n.getHTML();e!==L&&j("Auto",{auto:!0})},a.revisionHistoryAutoSnapshotMs)},!0),n.getDocument().addEventListener("keydown",function(e){(e.ctrlKey||e.metaKey)&&e.shiftKey&&(e.key==="H"||e.key==="h")&&(e.preventDefault(),V())},!0))};function I(r,e){a[r]&&a[r].indexOf(e)===-1&&(a[r]=a[r]+e)}function te(){return a.currentUser&&a.currentUser.id?a.currentUser:{id:"user",name:"User",color:"#64748b"}}function W(){var r=a.aiToolkitPersistenceKey||"default";return"RTE.Revisions."+r}function C(){return n.__revisions||(n.__revisions=[]),n.__revisions}function g(r){for(var e=C(),t=0;t<e.length;t++)if(e[t].id===r)return e[t];return null}function _(){for(var r=C();r.length>a.revisionHistoryMaxEntries;)r.shift();try{window.localStorage&&window.localStorage.setItem(W(),JSON.stringify(r))}catch(e){console.warn("revisionhistory: localStorage quota or access issue:",e&&e.message)}a.revisionHistoryUrl&&ne(r)}function ne(r){try{var e=new XMLHttpRequest;e.open("POST",a.revisionHistoryUrl,!0),e.setRequestHeader("Content-Type","application/json");var t=oe();for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(o)){var l=String(t[o]);if(!/\r|\n/.test(l))try{e.setRequestHeader(o,l)}catch{}}e.onerror=function(){R({reason:"network",status:e.status||0})},e.onload=function(){(e.status<200||e.status>=300)&&R({reason:"http",status:e.status,responseText:(e.responseText||"").slice(0,512)})},e.send(JSON.stringify({documentKey:a.aiToolkitPersistenceKey||"",savedAt:Date.now(),revisions:r}))}catch(c){R({reason:"exception",error:c})}}function oe(){var r=a.revisionHistoryRequestHeaders;if(typeof r=="function")try{r=r(n)}catch(e){return R({reason:"header-provider",error:e}),{}}return r&&typeof r=="object"?r:{}}function R(r){console.warn("revisionhistory: remote persistence failed:",r&&r.reason,r&&r.status);try{typeof a.onRevisionHistorySyncError=="function"&&a.onRevisionHistorySyncError(r)}catch{}try{typeof n.fireEvent=="function"&&n.fireEvent("revision_history_sync_error",r)}catch{}}function ie(){try{if(!window.localStorage)return;var r=window.localStorage.getItem(W());if(!r)return;var e=JSON.parse(r);Array.isArray(e)&&(n.__revisions=e)}catch{}}function j(r,e){var t=n.getHTML?n.getHTML():n.getHTMLCode?n.getHTMLCode():"",o=te(),l=(r||"").toString().slice(0,120),c=l.length>0&&(!e||e.auto!==!0),i={id:"rev-"+Date.now()+"-"+Math.floor(Math.random()*1e4),html:t,text:n.getText?n.getText():S(t),label:l||de(),isNamed:c,author:{id:o.id,name:o.name,color:o.color},createdAt:Date.now(),metadata:e||{}};C().push(i),L=t,_(),d&&d.isConnected&&b();try{typeof n.fireEvent=="function"&&n.fireEvent("revision_snapshot",{id:i.id,label:i.label,isNamed:i.isNamed,createdAt:i.createdAt})}catch{}return i}function ae(r){var e=n.iframe?n.iframe.ownerDocument:document,t=e.defaultView||window,o=t.prompt('Name this version (e.g. "Draft sent to legal"):',r||"");if(o===null)return null;var l=(o||"").trim();return l?j(l,{user:!0}):null}function se(r,e){var t=g(r);if(!t)return!1;var o=(e||"").toString().trim().slice(0,120);return o?(t.label=o,t.isNamed=!0,_(),d&&d.isConnected&&b(),!0):!1}function le(r,e){var t=g(r),o=g(e);if(!t||!o)return null;var l=t.text||S(t.html),c=o.text||S(o.html);return{oldEntry:t,newEntry:o,oldText:l,newText:c,lines:re(l,c)}}function de(){var r=new Date;function e(t){return t<10?"0"+t:""+t}return e(r.getHours())+":"+e(r.getMinutes())+":"+e(r.getSeconds())}function B(r,e){e=e||{};var t=g(r);if(!t)return!1;if(!e.skipConfirm){var o=n.iframe?n.iframe.ownerDocument:document;if(!o.defaultView.confirm("Restore this version? Your current content will be replaced (this itself is not auto-snapshotted)."))return!1}return n.setHTMLCode?n.setHTMLCode(t.html):n.setHTML&&n.setHTML(t.html),L=t.html,d&&d.isConnected&&N(),!0}function ee(r){for(var e=C(),t=0;t<e.length;t++)if(e[t].id===r)return e.splice(t,1),_(),d&&d.isConnected&&b(),!0;return!1}function ce(){n.__revisions=[],_(),d&&d.isConnected&&b()}function re(r,e){for(var t=String(r||"").split(/\r?\n/),o=String(e||"").split(/\r?\n/),l=[],c=fe(t,o),i=0,v=0,s=0;i<t.length&&v<o.length;)s<c.length&&t[i]===c[s]&&o[v]===c[s]?(l.push({type:"eq",text:t[i]}),i++,v++,s++):s<c.length&&t[i]!==c[s]?(l.push({type:"del",text:t[i]}),i++):s<c.length&&o[v]!==c[s]?(l.push({type:"add",text:o[v]}),v++):i<t.length?(l.push({type:"del",text:t[i]}),i++):v<o.length&&(l.push({type:"add",text:o[v]}),v++);for(;i<t.length;)l.push({type:"del",text:t[i]}),i++;for(;v<o.length;)l.push({type:"add",text:o[v]}),v++;return l}function fe(r,e){for(var t=r.length,o=e.length,l=new Array(o+1).fill(0),c=new Array(o+1).fill(0),i=[],s=0;s<=t;s++)i.push(new Array(o+1).fill(0));for(var s=1;s<=t;s++)for(var u=1;u<=o;u++)r[s-1]===e[u-1]?i[s][u]=i[s-1][u-1]+1:i[s][u]=Math.max(i[s-1][u],i[s][u-1]);for(var v=[],s=t,u=o;s>0&&u>0;)r[s-1]===e[u-1]?(v.unshift(r[s-1]),s--,u--):i[s-1][u]>=i[s][u-1]?s--:u--;return v}function S(r){var e=document.createElement("div");return e.innerHTML=r||"",e.innerText||e.textContent||""}function V(){if(!(d&&d.isConnected)&&!(!n||!n.iframe||!n.iframe.ownerDocument)){d&&!d.isConnected&&(d=null);var r=n.iframe.ownerDocument;if(!(!r||!r.body)){d=r.createElement("div");var e=!1;try{var t=n.container||n.getEditable&&n.getEditable().closest&&n.getEditable().closest(".richtexteditor");e=!!(t&&t.classList&&t.classList.contains("rte-dark"))}catch{}d.className="rte-rev-dialog"+(e?" rte-rev-dark":""),d.setAttribute("role","dialog"),d.setAttribute("aria-modal","true"),d.setAttribute("aria-labelledby","rte-rev-dialog-title");var o=r.createElement("div");o.className="rte-rev-backdrop",o.addEventListener("mousedown",function(c){c.target===o&&N()});var l=r.createElement("div");l.className="rte-rev-panel",o.appendChild(l),d.appendChild(o),r.body.appendChild(d),b()}}}function N(){d&&d.parentNode&&d.parentNode.removeChild(d),d=null}var h=null,m="preview";function b(){if(d){var r=d.ownerDocument,e=d.querySelector(".rte-rev-panel");if(!e){N();return}e.innerHTML="";var t=r.createElement("div");t.className="rte-rev-header";var o=r.createElement("div");o.id="rte-rev-dialog-title",o.className="rte-rev-title",o.textContent="Revision history",t.appendChild(o);var l=r.createElement("div");l.className="rte-rev-header-actions";var c=r.createElement("button");c.type="button",c.className="rte-rev-btn rte-rev-btn-ghost",c.textContent="Save version now",c.addEventListener("mousedown",function(f){f.preventDefault();var p=r.defaultView.prompt("Label this version (optional):","");p!==null&&j(p||"")}),l.appendChild(c);var i=r.createElement("button");i.type="button",i.className="rte-rev-btn rte-rev-btn-ghost",i.textContent="Close",i.setAttribute("aria-label","Close revision history"),i.addEventListener("mousedown",function(f){f.preventDefault(),N()}),l.appendChild(i),t.appendChild(l),e.appendChild(t);var v=r.createElement("div");v.className="rte-rev-body";var s=r.createElement("div");s.className="rte-rev-list",s.setAttribute("role","listbox"),s.setAttribute("aria-label","Saved revisions");var u=n.revisionHistory.list();if(u.length){(!h||!g(h))&&(h=u[0].id);for(var Y=0;Y<u.length;Y++)(function(f){var p=r.createElement("button");p.type="button",p.className="rte-rev-row"+(f.id===h?" rte-rev-row-active":""),p.setAttribute("role","option"),p.setAttribute("aria-selected",f.id===h?"true":"false");var Z=r.createElement("span");Z.className="rte-rev-dot",Z.style.background=f.author&&f.author.color||"#64748b";var G=r.createElement("div");G.className="rte-rev-row-who",G.textContent=f.author&&f.author.name||"User";var Q=r.createElement("div");Q.className="rte-rev-row-when",Q.textContent=ue(f.createdAt)+" \xB7 "+(f.label||"");var O=r.createElement("div");O.className="rte-rev-row-col",O.appendChild(G),O.appendChild(Q),p.appendChild(Z),p.appendChild(O),p.addEventListener("mousedown",function(be){be.preventDefault(),h=f.id,b()}),s.appendChild(p)})(u[Y])}else{var X=r.createElement("div");X.className="rte-rev-empty",X.textContent='No revisions yet. Click "Save version now" to capture the current document.',s.appendChild(X)}v.appendChild(s);var A=r.createElement("div");if(A.className="rte-rev-pane",u.length){var x=g(h)||u[0],E=r.createElement("div");E.className="rte-rev-tabs",E.setAttribute("role","tablist"),E.setAttribute("aria-label","Revision view");var y=r.createElement("button");y.type="button",y.className="rte-rev-tab"+(m==="preview"?" rte-rev-tab-active":""),y.setAttribute("role","tab"),y.setAttribute("aria-selected",m==="preview"?"true":"false"),y.textContent="Preview",y.addEventListener("mousedown",function(f){f.preventDefault(),m="preview",b()});var w=r.createElement("button");w.type="button",w.className="rte-rev-tab"+(m==="diff"?" rte-rev-tab-active":""),w.setAttribute("role","tab"),w.setAttribute("aria-selected",m==="diff"?"true":"false"),w.textContent="Diff vs current",w.addEventListener("mousedown",function(f){f.preventDefault(),m="diff",b()}),E.appendChild(y),E.appendChild(w),A.appendChild(E);var q=r.createElement("div");if(q.className="rte-rev-content",m==="preview"){var k=r.createElement("iframe");k.className="rte-rev-preview-frame",k.setAttribute("title","Revision preview"),k.setAttribute("sandbox","allow-same-origin"),q.appendChild(k),setTimeout(function(){try{k.contentDocument.open(),k.contentDocument.write('<!DOCTYPE html><html><head><meta charset="utf-8"><style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;padding:16px;color:#0f172a;line-height:1.6}img{max-width:100%}</style></head><body>'+(x.html||"")+"</body></html>"),k.contentDocument.close()}catch{}},0)}else{var pe=n.getText?n.getText():S(n.getHTML()),D=re(x.text||S(x.html),pe),J=r.createElement("pre");J.className="rte-rev-diff";for(var H=0;H<D.length;H++){var P=r.createElement("span");P.className="rte-rev-diff-line rte-rev-diff-"+D[H].type,P.textContent=(D[H].type==="add"?"+ ":D[H].type==="del"?"- ":" ")+D[H].text+`
|
|
2
|
+
`,J.appendChild(P)}q.appendChild(J)}A.appendChild(q);var U=r.createElement("div");U.className="rte-rev-footer";var $=r.createElement("div");$.className="rte-rev-footer-info",$.textContent=x.label?"Label: "+x.label:"";var z=r.createElement("div");z.className="rte-rev-footer-btns";var M=r.createElement("button");M.type="button",M.className="rte-rev-btn rte-rev-btn-danger",M.textContent="Delete",M.addEventListener("mousedown",function(f){f.preventDefault(),ee(x.id)});var T=r.createElement("button");T.type="button",T.className="rte-rev-btn rte-rev-btn-primary",T.textContent="Restore this version",T.addEventListener("mousedown",function(f){f.preventDefault()}),T.addEventListener("click",function(f){f.preventDefault(),B(x.id)}),z.appendChild(M),z.appendChild(T),U.appendChild($),U.appendChild(z),A.appendChild(U)}v.appendChild(A),e.appendChild(v)}}function ue(r){if(!r)return"";var e=new Date(r),t=new Date;function o(c){return c<10?"0"+c:""+c}var l=o(e.getHours())+":"+o(e.getMinutes());return e.toDateString()===t.toDateString()?"Today "+l:e.getFullYear()+"-"+o(e.getMonth()+1)+"-"+o(e.getDate())+" "+l}function ve(){var r=n&&n.iframe&&n.iframe.ownerDocument||document;if(!r.querySelector("style[data-rte-revisionhistory]")){var e=r.createElement("style");e.setAttribute("data-rte-revisionhistory","1"),e.textContent=[".rte-rev-dialog{position:fixed;inset:0;z-index:2147483600;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;font-size:13px;color:#172033}",".rte-rev-backdrop{position:absolute;inset:0;background:linear-gradient(135deg,rgba(12,18,32,.44),rgba(40,54,77,.26));display:flex;align-items:center;justify-content:center;padding:18px}","/* 2026-07-12 revision dialog precision */",".rte-rev-panel{background:linear-gradient(180deg,#ffffff 0%,#f8fbff 100%);border:1px solid rgba(117,137,163,.28);border-radius:8px;width:min(960px,calc(100vw - 28px));max-height:min(82vh,740px);display:flex;flex-direction:column;box-shadow:0 16px 40px rgba(35,48,72,.18);overflow:hidden}",".rte-rev-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid rgba(117,137,163,.18);background:rgba(255,255,255,.72)}",".rte-rev-title{font-size:16px;font-weight:760;letter-spacing:-.01em;color:#172033}",".rte-rev-header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}",".rte-rev-btn{padding:8px 12px;border-radius:7px;border:1px solid rgba(116,135,162,.25);font:inherit;font-size:12px;font-weight:680;line-height:1;cursor:pointer;background:#fff;color:#223652;box-shadow:0 1px 2px rgba(32,45,66,.06);transition:background .14s ease,border-color .14s ease,box-shadow .14s ease,transform .14s ease}",".rte-rev-btn:hover{background:#f5f8fc;border-color:rgba(81,111,151,.42);box-shadow:0 5px 14px rgba(32,45,66,.09);transform:translateY(-1px)}",".rte-rev-btn:focus-visible{outline:2px solid rgba(56,122,255,.34);outline-offset:2px}",".rte-rev-btn-ghost{background:#fff;color:#34506f}",".rte-rev-btn-primary{background:linear-gradient(135deg,#2563eb,#1d67ba);color:#fff;border-color:rgba(29,103,186,.85);box-shadow:0 8px 18px rgba(37,99,235,.22)}",".rte-rev-btn-primary:hover{background:linear-gradient(135deg,#1d4ed8,#195fad);color:#fff;border-color:rgba(29,78,216,.9);box-shadow:0 9px 20px rgba(37,99,235,.28)}",".rte-rev-btn-danger{background:#fff5f5;color:#9f1d1d;border-color:rgba(190,45,45,.22)}",".rte-rev-body{display:flex;flex:1;min-height:0;background:linear-gradient(90deg,#f8fbff 0%,#fff 42%)}",".rte-rev-list{width:258px;flex:0 0 258px;border-right:1px solid rgba(117,137,163,.18);overflow-y:auto;background:rgba(244,248,253,.78);padding:10px}",".rte-rev-empty{padding:16px;border:1px dashed rgba(99,118,145,.28);border-radius:8px;background:#fff;color:#5b6c81;font-size:12px;line-height:1.5}",".rte-rev-row{display:flex;align-items:center;gap:10px;width:100%;padding:10px;border:1px solid transparent;border-radius:8px;background:transparent;text-align:left;cursor:pointer;font:inherit;color:inherit}",".rte-rev-row:hover{background:#fff;border-color:rgba(93,122,161,.24);box-shadow:0 8px 18px rgba(33,48,70,.08)}",".rte-rev-row-active{background:#eef6ff;border-color:rgba(37,99,235,.28);box-shadow:0 8px 22px rgba(37,99,235,.12)}",".rte-rev-dot{width:9px;height:9px;border-radius:50%;flex:0 0 9px;box-shadow:0 0 0 3px rgba(255,255,255,.95),0 0 0 4px rgba(96,116,140,.18)}",".rte-rev-row-col{flex:1;min-width:0}",".rte-rev-row-who{font-weight:720;font-size:12px;line-height:1.25;color:#172033}",".rte-rev-row-when{margin-top:2px;font-size:11px;color:#637487;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-rev-pane{flex:1;display:flex;flex-direction:column;min-width:0;padding:10px}",".rte-rev-tabs{display:flex;align-self:flex-start;gap:3px;padding:3px;margin:0 0 10px;border:1px solid rgba(117,137,163,.2);border-radius:7px;background:#eef3f8}",".rte-rev-tab{padding:7px 12px;border:0;border-radius:6px;background:transparent;font:inherit;font-size:12px;font-weight:680;color:#637487;cursor:pointer}",".rte-rev-tab:hover{color:#1d3557;background:rgba(255,255,255,.58)}",".rte-rev-tab:focus-visible{outline:2px solid rgba(56,122,255,.34);outline-offset:2px}",".rte-rev-tab-active{color:#163966;background:#fff;box-shadow:0 2px 7px rgba(35,48,72,.08)}",".rte-rev-content{flex:1;overflow:auto;padding:0;border:1px solid rgba(117,137,163,.18);border-radius:8px;background:#fff;min-height:300px}",".rte-rev-preview-frame{width:100%;height:100%;min-height:330px;border:0;display:block;background:#fff}",".rte-rev-diff{margin:0;padding:14px 16px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.55;white-space:pre-wrap;color:#172033;background:#fbfdff;min-height:100%}",".rte-rev-diff-line{display:block}",".rte-rev-diff-add{background:#e8f8ef;color:#17633f}",".rte-rev-diff-del{background:#fff0f0;color:#9f1d1d}",".rte-rev-diff-eq{color:#556575}",".rte-rev-footer{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0 0;background:transparent}",".rte-rev-footer-info{font-size:12px;color:#637487;min-height:18px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",".rte-rev-footer-btns{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}","@media(max-width:720px){.rte-rev-backdrop{padding:10px;align-items:flex-start}.rte-rev-panel{width:calc(100vw - 20px);max-height:calc(100vh - 20px);border-radius:8px}.rte-rev-header{align-items:flex-start;flex-direction:column}.rte-rev-body{flex-direction:column}.rte-rev-list{width:auto;flex:0 0 auto;max-height:178px;border-right:0;border-bottom:1px solid rgba(117,137,163,.18)}.rte-rev-pane{min-height:360px}.rte-rev-footer{align-items:stretch;flex-direction:column}.rte-rev-footer-info{white-space:normal}.rte-rev-footer-btns{justify-content:stretch}.rte-rev-footer-btns .rte-rev-btn{flex:1}}",".rte-rev-dark{color:#e2e8f0}",".rte-rev-dark .rte-rev-panel{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155}",".rte-rev-dark .rte-rev-header{background:rgba(30,41,59,.72);border-color:#334155}",".rte-rev-dark .rte-rev-title,.rte-rev-dark .rte-rev-row-who{color:#e2e8f0}",".rte-rev-dark .rte-rev-btn,.rte-rev-dark .rte-rev-btn-ghost{background:#0f172a;color:#cbd5e1;border-color:#334155}",".rte-rev-dark .rte-rev-btn:hover{background:#334155}",".rte-rev-dark .rte-rev-btn-primary,.rte-rev-dark .rte-rev-btn-primary:hover{background:linear-gradient(135deg,#2563eb,#1d4ed8);color:#fff;border-color:#3b82f6}",".rte-rev-dark .rte-rev-body{background:#0f172a}",".rte-rev-dark .rte-rev-list{background:rgba(15,23,42,.6);border-color:#334155}",".rte-rev-dark .rte-rev-empty{background:#1e293b;color:#94a3b8;border-color:#334155}",".rte-rev-dark .rte-rev-row:hover{background:#1e293b;border-color:#334155}",".rte-rev-dark .rte-rev-row-active{background:#1e3a8a;border-color:#3b82f6}",".rte-rev-dark .rte-rev-row-when,.rte-rev-dark .rte-rev-footer-info{color:#94a3b8}",".rte-rev-dark .rte-rev-tabs{background:#1e293b;border-color:#334155}",".rte-rev-dark .rte-rev-tab{color:#94a3b8}.rte-rev-dark .rte-rev-tab-active{color:#fff;background:#1d4ed8}",".rte-rev-dark .rte-rev-diff{background:#0f172a;color:#cbd5e1}.rte-rev-dark .rte-rev-diff-eq{color:#94a3b8}",".rte-rev-dark .rte-rev-diff-add{background:rgba(16,185,129,.16);color:#6ee7b7}",".rte-rev-dark .rte-rev-diff-del{background:rgba(244,63,94,.16);color:#fda4af}"].join(`
|
|
3
|
+
`),r.head.appendChild(e),n&&typeof n.ensureStyleSheetLive=="function"&&n.ensureStyleSheetLive(r,e,"rte-revisionhistory-style",e.textContent)}}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_rtlui=RTE_Plugin_RtlUi,typeof RTE_DefaultConfig.rtlUserInterface>"u"&&(RTE_DefaultConfig.rtlUserInterface="auto");function RTE_Plugin_RtlUi(){var a=this,c,r,n=!1;a.PluginName="RtlUi",a.InitConfig=function(e){c=e},a.InitEditor=function(e){r=e,r.attachEvent("exec_command_rtlui",function(t){t.returnValue=!0,a.Toggle()}),o();try{r.attachEvent("ready",o)}catch{}try{r.attachEvent("aftersethtml",o)}catch{}setTimeout(o,0),r.setRtlUserInterface=function(t){return l(!!t)},r.toggleRtlUserInterface=function(){return l(!n)},r.isRtlUserInterface=function(){return n},r.getRtlUiCss=function(){return d()}},a.Toggle=function(){return l(!n)};function o(){s(),c.rtlUserInterface===!0?l(!0):c.rtlUserInterface===!1?l(!1):l(u())}function u(){try{if(typeof r.getBaseDirection=="function"&&r.getBaseDirection()==="rtl")return!0;var e=r.getEditable();if(e){var t=e.ownerDocument,i=t&&(t.defaultView||t.parentWindow);if(i&&i.getComputedStyle(e).direction==="rtl")return!0}}catch{}return!1}function f(){try{var e=r.getEditable();if(!e)return null;for(var t=e.ownerDocument.defaultView,i=t&&t.frameElement?t.frameElement:e;i&&i.classList&&!i.classList.contains("richtexteditor");)i=i.parentNode;return i&&i.classList?i:null}catch{return null}}function l(e){var t=f();return t&&(e?t.setAttribute("dir","rtl"):t.removeAttribute("dir"),n=!!e),n}function d(){return['.richtexteditor[dir="rtl"]{direction:rtl;}','.richtexteditor[dir="rtl"] rte-dropdown,','.richtexteditor[dir="rtl"] rte-submenu,','.richtexteditor[dir="rtl"] rte-floatpanel{direction:rtl;text-align:right;}','.richtexteditor[dir="rtl"] rte-menuitem{flex-direction:row-reverse;}','.richtexteditor[dir="rtl"] rte-menutext{margin-left:0;margin-right:3px;}','.richtexteditor[dir="rtl"] rte-menuarrow{margin-right:0;margin-left:4px;}','.richtexteditor[dir="rtl"] rte-ribbon-group-right{margin-left:2px;margin-right:5px;}','.richtexteditor[dir="rtl"] rte-toolbar-arrowbutton{padding-right:0;padding-left:12px;}','.richtexteditor[dir="rtl"] rte-toolbar-dropdown-input{padding-left:0;padding-right:3px;}','.richtexteditor[dir="rtl"] rte-dialog-line-target rte-dialog-input-label{padding-left:0;padding-right:20px;}','.richtexteditor[dir="rtl"] .rte-find-replace-all{margin-left:0;margin-right:auto;}','.richtexteditor[dir="rtl"] .rte-gallery-browser-footer-text{margin-right:0;margin-left:auto;}','.richtexteditor[dir="rtl"] rte-bottom,','.richtexteditor[dir="rtl"] rte-taglist,','.richtexteditor[dir="rtl"] rte-textcounter{direction:rtl;}','.richtexteditor[dir="rtl"] rte-resizecorner{transform:scaleX(-1);}','.richtexteditor[dir="rtl"] [class*="indent"] svg,','.richtexteditor[dir="rtl"] [class*="outdent"] svg,','.richtexteditor[dir="rtl"] rte-menuarrow svg{transform:scaleX(-1);}'].join(`
|
|
2
|
+
`)}function s(){var e=document;if(!e.getElementById("rte-rtl-ui-styles")){var t=e.createElement("style");t.id="rte-rtl-ui-styles",t.appendChild(e.createTextNode(d())),(e.head||e.documentElement).appendChild(t),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(e,t,"rte-rtl-ui-styles",t.textContent)}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_rubyannotation=RTE_Plugin_RubyAnnotation;function RTE_Plugin_RubyAnnotation(){var d=this,a,r;d.PluginName="RubyAnnotation",d.InitConfig=function(e){a=e,a.rubyAnnotationEnabled!==!1&&(typeof a.rubyAnnotationParentheses!="boolean"&&(a.rubyAnnotationParentheses=!0),w("toolbar_full","#{rubyannotation}"),S("subtoolbar_more","rubyannotation"))},d.InitEditor=function(e){r=e,a.rubyAnnotationEnabled!==!1&&(r.ruby={add:function(t){return h(t)},get:function(){var t=p();return t?y(t):null},isRuby:function(){return!!p()},open:function(){d.OpenRubyDialog()},remove:function(){return m()}},E(),r.toolbarFactoryMap=r.toolbarFactoryMap||{},r.toolbarFactoryMap.rubyannotation=function(t){return r.createToolbarButton(t)},r.attachEvent("exec_command_rubyannotation",function(t){t.returnValue=!0,t.stopBubble=!0,d.OpenRubyDialog()}))};function w(e,t){a[e]&&a[e].indexOf(t)===-1&&(a[e]=a[e]+t)}function S(e,t){var n=a[e];if(!(!n||n.indexOf(t)!==-1)){var o=n.indexOf("}");o!==-1&&(a[e]=n.substring(0,o)+","+t+n.substring(o))}}function E(){var e=a.container.ownerDocument;if(!e.getElementById("rte-ruby-style")){var t=e.createElement("style");t.id="rte-ruby-style",t.innerHTML=[".rte-ruby-annotated{ruby-position:over;}",".rte-ruby-annotated>rt{font-size:.55em;line-height:1.15;opacity:.85;user-select:none;}","@supports (display:ruby){.rte-ruby-annotated>rp{display:none;}}"].join(""),e.head.appendChild(t),r&&typeof r.ensureStyleSheetLive=="function"&&r.ensureStyleSheetLive(e,t,"rte-ruby-style",t.textContent)}}function D(){return r&&r.getEditable?r.getEditable():null}function b(){var e=r.getDocument();try{var t=e.getSelection();return!t||!t.rangeCount?null:t.getRangeAt(0)}catch{return null}}function p(){var e=b(),t=D();if(!e||!t)return null;for(var n=e.startContainer;n&&n!==t;){if(n.nodeType===1&&n.nodeName==="RUBY")return n;n=n.parentNode}return null}function y(e){var t=e.querySelector("rt");return t&&t.textContent||""}function x(e){for(var t="",n=0;n<e.childNodes.length;n++){var o=e.childNodes[n];o.nodeType===3?t+=o.nodeValue:o.nodeType===1&&o.nodeName!=="RT"&&o.nodeName!=="RP"&&(t+=o.textContent||"")}return t}function v(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function k(e,t){var n=a.rubyAnnotationParentheses;return'<ruby class="rte-ruby-annotated">'+v(e)+(n?"<rp>(</rp>":"")+"<rt>"+v(t)+"</rt>"+(n?"<rp>)</rp>":"")+"</ruby>"}function h(e){var t=p();if(t){var n=t.querySelector("rt");return n||(n=t.ownerDocument.createElement("rt"),t.appendChild(n)),n.textContent=String(e??""),r.focus(),t}var o=b();if(!o||o.collapsed)return null;var u=String(o.toString()||"");return u?(r.insertHTML(k(u,e)),r.focus(),!0):null}function m(){var e=p();if(!e)return!1;var t=e.ownerDocument,n=t.createTextNode(x(e));return e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e),r.focus(),!0}function i(e,t,n,o){var u=e.ownerDocument.createElement(t);return n&&(u.style.cssText=n),o&&(u.className=o),e.appendChild(u),u}d.OpenRubyDialog=function(){var e=p(),t=b(),n=e?x(e):t?String(t.toString()||""):"",o=r.createDialog(r.getLangText&&r.getLangText("rubyannotationtitle")||"Ruby annotation","rte-dialog-ruby"),u=typeof o.close=="function"?function(){o.close()}:function(){r.closeCurrentPopup()},l=i(o,"div","padding:14px;min-width:340px;font:13px -apple-system,Segoe UI,sans-serif");i(l,"div","font-weight:600;margin-bottom:4px").innerText="Base text";var A=i(l,"div","padding:8px 10px;border:1px solid #e2e8f0;border-radius:8px;background:#f8fafc;min-height:20px;word-break:break-word");A.textContent=n,i(l,"div","font-weight:600;margin:10px 0 4px").innerText="Reading";var f=i(l,"input","width:100%;box-sizing:border-box;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:13px inherit");f.type="text",f.value=e?y(e):"",f.placeholder="e.g. \u304B\u3093\u3058";var N=i(l,"div","font-size:11px;color:#94a3b8;margin-top:6px");N.innerText=n?"Shown above the base text. Parentheses are emitted for readers without ruby support.":"Select the text to annotate first, then reopen this dialog.";var R=i(l,"div","display:flex;justify-content:space-between;gap:8px;margin-top:14px"),_=i(R,"div","display:flex;gap:8px");if(e){var s=i(_,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#b91c1c;cursor:pointer");s.type="button",s.textContent="Remove",s.onclick=function(){m(),u()}}var C=i(R,"div","display:flex;gap:8px"),g=i(C,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");g.type="button",g.textContent="Cancel",g.onclick=u;var c=i(C,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");c.type="button",c.textContent=e?"Update":"Add",c.disabled=!n,c.onclick=function(){var T=f.value.trim();if(!T||!n){u();return}h(T),u()},setTimeout(function(){f.focus()},0)}}
|
|
@@ -380,6 +380,7 @@ function RTE_Plugin_Sanitizer() {
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
var attrs = [];
|
|
383
|
+
var strippedSrc = false;
|
|
383
384
|
for (var a = 0; a < el.attributes.length; a++) attrs.push(el.attributes[a]);
|
|
384
385
|
for (var k = 0; k < attrs.length; k++) {
|
|
385
386
|
var name = attrs[k].name.toLowerCase();
|
|
@@ -397,7 +398,11 @@ function RTE_Plugin_Sanitizer() {
|
|
|
397
398
|
if (name.indexOf("data-") === 0 || name.indexOf("aria-") === 0) continue;
|
|
398
399
|
|
|
399
400
|
if (URL_ATTRS[name]) {
|
|
400
|
-
if (!isSafeUrl(value, tag, name)) {
|
|
401
|
+
if (!isSafeUrl(value, tag, name)) {
|
|
402
|
+
note(report.removedAttributes, tag + "[" + name + "]");
|
|
403
|
+
el.removeAttribute(attrs[k].name);
|
|
404
|
+
if (name === "src") strippedSrc = true;
|
|
405
|
+
}
|
|
401
406
|
continue;
|
|
402
407
|
}
|
|
403
408
|
if (!ALLOWED_ATTRS[name] && !attrExtra(name)) {
|
|
@@ -406,6 +411,18 @@ function RTE_Plugin_Sanitizer() {
|
|
|
406
411
|
}
|
|
407
412
|
}
|
|
408
413
|
|
|
414
|
+
// An <img> whose only source was just stripped is an empty box that
|
|
415
|
+
// saves as <img> with no src -- dragging a page image into the editor
|
|
416
|
+
// from a page opened on disk did exactly that (its file: src is not a
|
|
417
|
+
// safe scheme). Drop the element when nothing is left to show. Keep it
|
|
418
|
+
// when srcset or a lazy-load data-*src still carries an image, and never
|
|
419
|
+
// touch an <img> that arrived without a src (an app placeholder).
|
|
420
|
+
if (tag === "img" && strippedSrc && !el.hasAttribute("srcset") && !hasDataSource(el)) {
|
|
421
|
+
note(report.removedTags, "img");
|
|
422
|
+
el.parentNode.removeChild(el);
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
|
|
409
426
|
// A link that opens a new tab without rel="noopener" hands the
|
|
410
427
|
// opener window to the destination.
|
|
411
428
|
if (tag === "a" && (el.getAttribute("target") || "").toLowerCase() === "_blank") {
|
|
@@ -422,6 +439,12 @@ function RTE_Plugin_Sanitizer() {
|
|
|
422
439
|
parent.removeChild(el);
|
|
423
440
|
}
|
|
424
441
|
function note(list, what) { if (list.indexOf(what) < 0) list.push(what); }
|
|
442
|
+
function hasDataSource(el) {
|
|
443
|
+
for (var i = 0; i < el.attributes.length; i++) {
|
|
444
|
+
if (/^data-(.*-)?(src|srcset|original)$/i.test(el.attributes[i].name)) return true;
|
|
445
|
+
}
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
425
448
|
|
|
426
449
|
function sanitizeHtml(html) {
|
|
427
450
|
var out = html;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_sanitizer=RTE_Plugin_Sanitizer,typeof RTE_DefaultConfig.contentSanitizer>"u"&&(RTE_DefaultConfig.contentSanitizer=!0);function RTE_Plugin_Sanitizer(){var w=this,p,l,L=!1,b={removedTags:[],removedAttributes:[],calls:0,lastPasses:0},R=[];w.PluginName="Sanitizer",w.InitConfig=function(t){p=t},w.InitEditor=function(t){if(l=t,p.contentSanitizer===!1)return;l.sanitizeHtml=function(r){return y(String(r??""))},l.getSanitizerReport=function(){return JSON.parse(JSON.stringify(b))};function e(){try{$(),q()}catch{}try{Q()}catch{}try{K()}catch{}}e();try{l.attachEvent("ready",e)}catch{}setTimeout(e,0),setTimeout(e,400)};var z={};"p,div,span,br,hr,h1,h2,h3,h4,h5,h6,b,strong,i,em,u,s,strike,del,ins,mark,small,sub,sup,abbr,cite,q,dfn,kbd,samp,var,time,data,bdi,bdo,wbr,ruby,rt,rp,ul,ol,li,dl,dt,dd,table,thead,tbody,tfoot,tr,td,th,caption,colgroup,col,blockquote,pre,code,figure,figcaption,section,article,header,footer,main,aside,nav,address,details,summary,a,img,picture,source,video,audio,track,map,area,input,label,button,svg,g,path,circle,ellipse,rect,line,polyline,polygon,text,tspan,defs,marker,linearGradient,radialGradient,stop,clipPath,mask,pattern,use,symbol,title,desc".split(",").forEach(function(t){z[t]=!0});var M={script:1,noscript:1,template:1,object:1,embed:1,applet:1,base:1,meta:1,link:1,frame:1,frameset:1,foreignobject:1,xml:1,"script:":1},C={};"id,class,style,title,lang,dir,translate,hidden,tabindex,role,contenteditable,spellcheck,autocomplete,draggable,sandbox,allowfullscreen,allow,frameborder,scrolling,href,src,srcset,sizes,alt,width,height,loading,decoding,referrerpolicy,target,rel,download,type,value,name,placeholder,checked,disabled,readonly,colspan,rowspan,headers,scope,span,align,valign,bgcolor,border,cellpadding,cellspacing,start,reversed,datetime,cite,open,controls,autoplay,loop,muted,playsinline,poster,preload,kind,srclang,label,usemap,ismap,coords,shape,viewbox,xmlns,fill,stroke,stroke-width,stroke-linecap,stroke-linejoin,stroke-dasharray,d,cx,cy,r,rx,ry,x,y,x1,y1,x2,y2,points,transform,opacity,fill-rule,clip-rule,gradientunits,offset,stop-color,stop-opacity,text-anchor,font-size,font-family,font-weight,preserveaspectratio,version".split(",").forEach(function(t){C[t]=!0});var I={href:1,src:1,action:1,formaction:1,poster:1,cite:1,data:1,longdesc:1,background:1,ping:1,srcset:1},H=/^(https?|mailto|tel|ftp|sms|callto|webcal|geo|bitcoin):/i,P=/^data:image\/(png|jpe?g|gif|webp|bmp|x-icon|avif);base64,[a-z0-9+/=\s]+$/i;function x(t,e,r){var a=String(t??"").replace(/[\u0000-\u0020\u007F-\u00A0]+/g,"").trim();if(!a)return!1;if(e==="use")return a.charAt(0)==="#";if(/^[#?/]/.test(a))return!0;var o=/^([a-z][a-z0-9+.\-]*):/i.exec(a);return o?P.test(a)?e==="img"||e==="source"||r==="poster"||r==="srcset":/^blob:/i.test(a)?e==="img"||e==="video"||e==="audio"||e==="source":H.test(a):!0}function j(t){for(var e=[],r=String(t??"").split(";"),a=0;a<r.length;a++){var o=r[a];if(o.trim()&&!/expression\s*\(|(javascript|vbscript|livescript)\s*:|-moz-binding|behaviou?r\s*:|@import|-o-link/i.test(o)){var n=/url\s*\(\s*(['"]?)([^'")]*)\1\s*\)/i.exec(o);n&&!x(n[2],"img","src")||e.push(o.trim())}}return e.join("; ")}var G="allow-scripts allow-same-origin allow-presentation";function U(t,e){var r=G.split(" "),a=!1;try{a=new URL(e,location.href).origin===location.origin}catch{}if(a&&(r=r.filter(function(n){return n!=="allow-same-origin"})),t.hasAttribute("sandbox")){var o=(t.getAttribute("sandbox")||"").toLowerCase().split(/\s+/);r=r.filter(function(n){return o.indexOf(n)>=0})}t.setAttribute("sandbox",r.join(" "))}function F(t){if(p.sanitizerAllowIframes===!1)return!1;var e=t.getAttribute("src")||"";if(!/^https?:/i.test(e))return!1;var r=p.sanitizerAllowedIframeHosts;if(!r||!r.length)return U(t,e),!0;try{for(var a=new URL(e).hostname.toLowerCase(),o=0;o<r.length;o++){var n=String(r[o]).toLowerCase();if(a===n||a.slice(-(n.length+1))==="."+n)return!0}}catch{}return!1}function N(t){var e={},r=[],a=[];(t||[]).forEach(function(n){if(n instanceof RegExp){a.push(n);return}var s=String(n).toLowerCase();if(s.indexOf("*")===-1){e[s]=!0;return}r.push(s.split("*"))});function o(n,s){var i=n[0];if(s.lastIndexOf(i,0)!==0)return!1;var u=n[n.length-1];if(u&&(s.length<u.length||s.indexOf(u,s.length-u.length)===-1))return!1;for(var d=i.length,g=1;g<n.length;g++)if(n[g]){var h=s.indexOf(n[g],d);if(h===-1)return!1;d=h+n[g].length}return!0}return function(n){if(e[n])return!0;for(var s=0;s<r.length;s++)if(o(r[s],n))return!0;for(var i=0;i<a.length;i++)if(a[i].test(n))return!0;return!1}}function A(t,e){var r=N(p.sanitizerAllowTags),a=N(p.sanitizerAllowAttributes),o=p.sanitizerAllowStyleTags===!0,n=[];(function V(k){for(var E=0;E<k.childNodes.length;E++){var m=k.childNodes[E];m.nodeType===1?(n.push(m),V(m)):m.nodeType===8&&n.push(m)}})(t);for(var s=0;s<n.length;s++){var i=n[s];if(i.parentNode){if(i.nodeType===8){O(i.data)&&(c(e.removedTags,"#comment"),i.parentNode.removeChild(i));continue}var u=(i.localName||i.nodeName||"").toLowerCase();if(u==="style"){if(!o){c(e.removedTags,"style"),i.parentNode.removeChild(i);continue}}else if(u==="iframe"){if(i.hasAttribute("srcdoc")&&(c(e.removedAttributes,"iframe[srcdoc]"),i.removeAttribute("srcdoc")),!F(i)){c(e.removedTags,"iframe"),i.parentNode.removeChild(i);continue}}else if(u==="title"||u==="desc"){if(!i.closest||!i.closest("svg")){c(e.removedTags,u),i.parentNode.removeChild(i);continue}}else if(M[u]){c(e.removedTags,u),i.parentNode.removeChild(i);continue}else if(!z[u]&&!r(u)){c(e.removedTags,u),B(i);continue}for(var d=[],g=!1,h=0;h<i.attributes.length;h++)d.push(i.attributes[h]);for(var v=0;v<d.length;v++){var f=d[v].name.toLowerCase(),S=d[v].value;if(f.indexOf("on")===0){c(e.removedAttributes,f),i.removeAttribute(d[v].name);continue}if(f==="xlink:href"||f==="xmlns:xlink"){x(S,u,f)||(c(e.removedAttributes,f),i.removeAttribute(d[v].name));continue}if(f==="srcdoc"){c(e.removedAttributes,"srcdoc"),i.removeAttribute(d[v].name);continue}if(f==="style"){i.setAttribute("style",j(S));continue}if(!(f.indexOf("data-")===0||f.indexOf("aria-")===0)){if(I[f]){x(S,u,f)||(c(e.removedAttributes,u+"["+f+"]"),i.removeAttribute(d[v].name),f==="src"&&(g=!0));continue}!C[f]&&!a(f)&&(c(e.removedAttributes,f),i.removeAttribute(d[v].name))}}if(u==="img"&&g&&!i.hasAttribute("srcset")&&!W(i)){c(e.removedTags,"img"),i.parentNode.removeChild(i);continue}if(u==="a"&&(i.getAttribute("target")||"").toLowerCase()==="_blank"){var _=(i.getAttribute("rel")||"").toLowerCase();_.indexOf("noopener")<0&&i.setAttribute("rel",(_?_+" ":"")+"noopener noreferrer")}}}return t}function B(t){for(var e=t.parentNode;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function c(t,e){t.indexOf(e)<0&&t.push(e)}function W(t){for(var e=0;e<t.attributes.length;e++)if(/^data-(.*-)?(src|srcset|original)$/i.test(t.attributes[e].name))return!0;return!1}function y(t){var e=t;b.calls++;for(var r=0;r<3;r++){var a=new DOMParser().parseFromString("<body>"+e+"</body>","text/html");A(a.body,b);var o=a.body.innerHTML;if(b.lastPasses=r+1,o===e)break;e=o}return e}function $(){if(!L){for(var t=["getHTMLCode","getHTMLContent"],e=!1,r=0;r<t.length;r++)(function(a){var o=l[a];if(!(typeof o!="function"||o.__rteSanitized)){var n=function(){var s=o.apply(l,arguments);return typeof s!="string"?s:y(s)};n.__rteSanitized=!0,l[a]=n,e=!0}})(t[r]);e&&(L=!0)}}function q(){for(var t=["setHTMLCode","setHTMLContent"],e=0;e<t.length;e++)(function(r){var a=l[r];if(!(typeof a!="function"||a.__rteSanitizedIn)){var o=function(n){var s=[].slice.call(arguments);return typeof n=="string"&&(s[0]=y(n)),a.apply(l,s)};o.__rteSanitizedIn=!0,l[r]=o}})(t[e])}function J(t){return/\son[a-z]+\s*=/i.test(t)||/<\s*(script|iframe|object|embed|base)\b/i.test(t)||/srcdoc\s*=/i.test(t)||/(javascript|vbscript)\s*:/i.test(t)||/data:\s*text\/html/i.test(t)}function O(t){var e=String(t??"");return e.indexOf("-->")!==-1||e.indexOf("--!>")!==-1||e.charAt(0)===">"||e.charAt(0)==="-"&&e.charAt(1)===">"}var D=/^(script|iframe|object|embed|base|meta|link|form)$/;function T(t){if(!t.attributes)return!1;for(var e=0;e<t.attributes.length;e++){var r=t.attributes[e].name.toLowerCase();if(r.indexOf("on")===0||r==="srcdoc"||(r==="href"||r==="src"||r==="data"||r==="action"||r==="xlink:href")&&/(javascript|vbscript)\s*:|data:\s*text\/html/i.test(t.attributes[e].value||""))return!0}return!1}function X(t){if(D.test(t.localName||"")||T(t))return!0;for(var e=t.getElementsByTagName?t.getElementsByTagName("*"):[],r=0;r<e.length;r++)if(D.test(e[r].localName||"")||T(e[r]))return!0;return!1}function K(){if(p.sanitizerGuardLiveDom!==!1){var t=null;try{t=l.getEditable()}catch{return}if(!(!t||t.__rteLiveGuard)){t.__rteLiveGuard=!0;var e=new MutationObserver(function(r){for(var a=!1,o=0;o<r.length&&!a;o++){var n=r[o];if(n.type==="attributes"){var s=(n.attributeName||"").toLowerCase();(s.indexOf("on")===0||s==="srcdoc"||T(n.target))&&(a=!0);continue}for(var i=0;i<n.addedNodes.length;i++){var u=n.addedNodes[i];if(u.nodeType===8){if(O(u.data)){a=!0;break}continue}if(u.nodeType===1&&X(u)){a=!0;break}}}if(a)try{A(t,b)}catch{}});e.observe(t,{childList:!0,subtree:!0,attributes:!0}),R.push(e)}}}function Q(){var t=null;try{t=l.getEditable()}catch{return}if(!t||t.__rteSanitizePaste)return;t.__rteSanitizePaste=!0,t.addEventListener("paste",function(r){var a=r.clipboardData||window.clipboardData;if(a){var o="";try{o=a.getData("text/html")||""}catch{return}if(!(!o||!J(o))){r.preventDefault(),r.stopImmediatePropagation();var n=y(o);try{l.insertHTML(n)}catch{try{l.insertText(a.getData("text/plain")||"")}catch{}}}}},!0);function e(){var r=function(){try{A(t,b)}catch{}};setTimeout(r,0),setTimeout(r,250)}t.addEventListener("paste",e,!1),t.addEventListener("drop",e,!0)}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_shadowdom=RTE_Plugin_ShadowDom,typeof RTE_DefaultConfig.shadowStyleAdoption>"u"&&(RTE_DefaultConfig.shadowStyleAdoption=!0),typeof RTE_DefaultConfig.shadowStyleSources>"u"&&(RTE_DefaultConfig.shadowStyleSources=null);function RTE_Plugin_ShadowDom(){var s=this,l,f,c=null,d=null,o=null;s.PluginName="ShadowDom",s.InitConfig=function(t){l=t},s.InitEditor=function(t){f=t,f.getShadowRoot=function(){return h()},f.isInShadowDom=function(){return!!h()},f.adoptEditorStyles=function(r){return p(r||h(),!0)},f.getAdoptedStyleCount=function(){return o?o.size:0},!(l&&l.shadowStyleAdoption===!1)&&D(function(){c=h(),c&&(o=new(window.Set||Array),p(c,!1),A(c))})},s.Destroy=function(){if(d){try{d.disconnect()}catch{}d=null}};function S(){try{var t=f.getEditable(),r=t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView.frameElement:null;if(!r)return null;for(var e=r;e;){if(e.classList&&e.classList.contains("richtexteditor"))return e;e=e.parentNode||e.host}return r}catch{return null}}function h(){var t=S();if(!t||typeof t.getRootNode!="function")return null;var r=t.getRootNode();return r&&r.host&&r!==document?r:null}function D(t){if(S()){t();return}var r=0,e=window.setInterval(function(){(S()||++r>100)&&(window.clearInterval(e),t())},50)}function R(){try{for(var t=document.getElementsByTagName("script"),r=0;r<t.length;r++){var e=t[r].src||"";if(/(^|\/)rte(\.min)?\.js(\?|$)/.test(e))return e.replace(/[^\/]*$/,"")}}catch{}return null}function _(t){var r=String(t.id||"");if(/^rte[-_]|^__rte/.test(r))return!0;var e=t.href||"";if(!e){if(t.tagName==="STYLE"){var n=t.textContent||"";return/[.]richtexteditor|rte-toolbar|rte-editor|rte-dialog|[.]rte-a11y/.test(n)}return!1}var i=R();return i&&e.indexOf(i)===0?!0:/rte_theme|rte_mobile|richtexteditor_content|richtexteditor_preview|aitoolkit/.test(e)}function b(){var t=l&&l.shadowStyleSources||null;return t?typeof t=="string"?[t]:t:[]}function N(t){return(t.href||"")+"|"+(t.id||"")+"|"+(t.textContent||"").length}function w(t){return o&&(o.has?o.has(t):o.indexOf(t)>=0)}function C(t){o&&(o.add?o.add(t):o.push(t))}function p(t,r){if(!t)return 0;o||(o=new(window.Set||Array));for(var e=0,n=document.querySelectorAll("link[rel~=stylesheet],style"),i=0;i<n.length;i++){var u=n[i];if(_(u)){var a=N(u);!r&&w(a)||w(a)||(t.appendChild(T(u,t)),C(a),e++)}}for(var g=b(),v=0;v<g.length;v++){var x="extra|"+g[v];if(!w(x)){var m=document.createElement("link");m.rel="stylesheet",m.href=g[v],m.setAttribute("data-rte-adopted","1"),t.appendChild(m),C(x),e++}}try{if(t.adoptedStyleSheets&&document.adoptedStyleSheets&&document.adoptedStyleSheets.length){for(var E=t.adoptedStyleSheets.slice(),y=0;y<document.adoptedStyleSheets.length;y++)E.indexOf(document.adoptedStyleSheets[y])<0&&E.push(document.adoptedStyleSheets[y]);t.adoptedStyleSheets=E}}catch{}return e}function T(t,r){if(t.tagName==="LINK"){var e=document.createElement("link");return e.rel="stylesheet",e.href=t.href,t.media&&(e.media=t.media),e.setAttribute("data-rte-adopted","1"),e}var n=document.createElement("style");return n.textContent=t.textContent,t.id&&n.setAttribute("data-rte-source-id",t.id),n.setAttribute("data-rte-adopted","1"),n}function A(t){window.MutationObserver&&(d=new MutationObserver(function(r){for(var e=!1,n=0;n<r.length&&!e;n++)for(var i=r[n].addedNodes||[],u=0;u<i.length;u++){var a=i[u];if(a.nodeType===1&&(a.tagName==="STYLE"||a.tagName==="LINK")&&_(a)){e=!0;break}}e&&p(t,!1)}),d.observe(document.head||document.documentElement,{childList:!0,subtree:!0}))}}
|