@richscripts/richtexteditor 2.4.1 → 2.4.2

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.
@@ -67,7 +67,7 @@ endstream
67
67
  `),(T.head||T.getElementsByTagName("head")[0]).appendChild(x)}}}function O(){var j=q();if(!j)return!1;y=!0,j.classList.add("rte-restricted");for(var T=0;T<j.children.length;T++){var x=j.children[T];x.querySelector("["+N+"='true']")?(x.setAttribute("contenteditable","true"),x.setAttribute(N+"-wrapper","true")):x.setAttribute("contenteditable","false")}return j.setAttribute("contenteditable","false"),W(),!0}function o(){var j=q();if(!j)return!1;y=!1,j.classList.remove("rte-restricted");for(var T=j.querySelectorAll("[contenteditable]"),x=0;x<T.length;x++)T[x].removeAttribute("contenteditable"),T[x].removeAttribute(N+"-wrapper");return j.setAttribute("contenteditable","true"),!0}function D(j){j=j||{};var T=q();if(!T)return null;var x=T.ownerDocument,P=x.getSelection();if(!P||P.rangeCount===0)return null;var U=P.getRangeAt(0);if(U.collapsed)return null;var V=x.createElement("span");V.setAttribute(N,"true"),j.label&&V.setAttribute("aria-label",j.label);try{U.surroundContents(V)}catch{var R=U.extractContents();V.appendChild(R),U.insertNode(V)}var l=x.createRange();return l.selectNodeContents(V),P.removeAllRanges(),P.addRange(l),W(),y&&O(),V}function z(j){if(j=j||(function(){var x=q(),P=x&&x.ownerDocument.getSelection();if(!P||P.rangeCount===0)return null;for(var U=P.anchorNode;U&&U!==x;){if(U.nodeType===1&&U.getAttribute&&U.getAttribute(N)==="true")return U;U=U.parentNode}return null})(),!j)return!1;for(var T=j.parentNode;j.firstChild;)T.insertBefore(j.firstChild,j);return T.removeChild(j),y&&O(),!0}function K(){var j=q();return j?Array.prototype.slice.call(j.querySelectorAll("["+N+"='true']")):[]}function G(j){var T=K();if(T.length===0)return null;var x=q(),P=x&&x.ownerDocument.getSelection(),U=null;if(P&&P.anchorNode)for(var V=P.anchorNode;V&&V!==x;){if(V.nodeType===1&&V.getAttribute&&V.getAttribute(N)==="true"){U=V;break}V=V.parentNode}var R=U?T.indexOf(U):-1,l=T[(R+j+T.length)%T.length];if(!l)return null;var s=x.ownerDocument.createRange();return s.selectNodeContents(l),s.collapse(!1),P.removeAllRanges(),P.addRange(s),l.scrollIntoView({block:"center",behavior:"smooth"}),l}}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 L=this,u,n,y=null,N=null,q="";L.PluginName="RevisionHistory",L.InitConfig=function(c){u=c,u.revisionHistoryEnabled!==!1&&(u.revisionHistoryMaxEntries=u.revisionHistoryMaxEntries||50,u.revisionHistoryAutoSnapshotMs=u.revisionHistoryAutoSnapshotMs||0,u.revisionHistoryUrl=u.revisionHistoryUrl||"",u.revisionHistoryRequestHeaders=u.revisionHistoryRequestHeaders||null,u.onRevisionHistorySyncError=u.onRevisionHistorySyncError||null,u.text_revisionhistory=u.text_revisionhistory||"Revision history",W("toolbar_default","#{revisionhistory}"),W("toolbar_full","#{revisionhistory}"),W("toolbar_mobile","#{revisionhistory}"),(u.controltoolbar_TEXT||"").indexOf("revisionhistory")===-1&&(u.controltoolbar_TEXT=(u.controltoolbar_TEXT||"")+"|{revisionhistory}"))},L.InitEditor=function(c){n=c,u.revisionHistoryEnabled!==!1&&(n.revisionHistory={snapshot:function(p,k){return P(p,k)},promptAndSnapshot:function(p){return U(p)},rename:function(p,k){return V(p,k)},list:function(){return D().slice().sort(function(p,k){return(k.createdAt||0)-(p.createdAt||0)})},listNamed:function(){return D().slice().filter(function(p){return p.isNamed===!0}).sort(function(p,k){return(k.createdAt||0)-(p.createdAt||0)})},get:function(p){return z(p)},restore:function(p,k){return s(p,k||{})},delete:function(p){return b(p)},clear:function(){return S()},diff:function(p,k){return R(p,k)},openBrowser:function(){C()},closeBrowser:function(){_()}},n.toolbarFactoryMap=n.toolbarFactoryMap||{},n.toolbarFactoryMap.revisionhistory=function(p){return n.createToolbarButton(p)},n.attachEvent("exec_command_revisionhistory",function(p){p.returnValue=!0,p.stopBubble=!0,C()}),g(),x(),q=n.getHTML?n.getHTML():"",u.revisionHistoryAutoSnapshotMs>0&&n.getDocument().addEventListener("input",function(){N&&clearTimeout(N),N=setTimeout(function(){var p=n.getHTML();p!==q&&P("Auto",{auto:!0})},u.revisionHistoryAutoSnapshotMs)},!0),n.getDocument().addEventListener("keydown",function(p){(p.ctrlKey||p.metaKey)&&p.shiftKey&&(p.key==="H"||p.key==="h")&&(p.preventDefault(),C())},!0))};function W(c,p){u[c]&&u[c].indexOf(p)===-1&&(u[c]=u[c]+p)}function O(){return u.currentUser&&u.currentUser.id?u.currentUser:{id:"user",name:"User",color:"#64748b"}}function o(){var c=u.aiToolkitPersistenceKey||"default";return"RTE.Revisions."+c}function D(){return n.__revisions||(n.__revisions=[]),n.__revisions}function z(c){for(var p=D(),k=0;k<p.length;k++)if(p[k].id===c)return p[k];return null}function K(){for(var c=D();c.length>u.revisionHistoryMaxEntries;)c.shift();try{window.localStorage&&window.localStorage.setItem(o(),JSON.stringify(c))}catch(p){console.warn("revisionhistory: localStorage quota or access issue:",p&&p.message)}u.revisionHistoryUrl&&G(c)}function G(c){try{var p=new XMLHttpRequest;p.open("POST",u.revisionHistoryUrl,!0),p.setRequestHeader("Content-Type","application/json");var k=j();for(var E in k)if(Object.prototype.hasOwnProperty.call(k,E)&&/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/.test(E)){var I=String(k[E]);if(!/\r|\n/.test(I))try{p.setRequestHeader(E,I)}catch{}}p.onerror=function(){T({reason:"network",status:p.status||0})},p.onload=function(){(p.status<200||p.status>=300)&&T({reason:"http",status:p.status,responseText:(p.responseText||"").slice(0,512)})},p.send(JSON.stringify({documentKey:u.aiToolkitPersistenceKey||"",savedAt:Date.now(),revisions:c}))}catch(X){T({reason:"exception",error:X})}}function j(){var c=u.revisionHistoryRequestHeaders;if(typeof c=="function")try{c=c(n)}catch(p){return T({reason:"header-provider",error:p}),{}}return c&&typeof c=="object"?c:{}}function T(c){console.warn("revisionhistory: remote persistence failed:",c&&c.reason,c&&c.status);try{typeof u.onRevisionHistorySyncError=="function"&&u.onRevisionHistorySyncError(c)}catch{}try{typeof n.fireEvent=="function"&&n.fireEvent("revision_history_sync_error",c)}catch{}}function x(){try{if(!window.localStorage)return;var c=window.localStorage.getItem(o());if(!c)return;var p=JSON.parse(c);Array.isArray(p)&&(n.__revisions=p)}catch{}}function P(c,p){var k=n.getHTML?n.getHTML():n.getHTMLCode?n.getHTMLCode():"",E=O(),I=(c||"").toString().slice(0,120),X=I.length>0&&(!p||p.auto!==!0),ae={id:"rev-"+Date.now()+"-"+Math.floor(Math.random()*1e4),html:k,text:n.getText?n.getText():A(k),label:I||l(),isNamed:X,author:{id:E.id,name:E.name,color:E.color},createdAt:Date.now(),metadata:p||{}};D().push(ae),q=k,K(),y&&y.isConnected&&H();try{typeof n.fireEvent=="function"&&n.fireEvent("revision_snapshot",{id:ae.id,label:ae.label,isNamed:ae.isNamed,createdAt:ae.createdAt})}catch{}return ae}function U(c){var p=n.iframe?n.iframe.ownerDocument:document,k=p.defaultView||window,E=k.prompt('Name this version (e.g. "Draft sent to legal"):',c||"");if(E===null)return null;var I=(E||"").trim();return I?P(I,{user:!0}):null}function V(c,p){var k=z(c);if(!k)return!1;var E=(p||"").toString().trim().slice(0,120);return E?(k.label=E,k.isNamed=!0,K(),y&&y.isConnected&&H(),!0):!1}function R(c,p){var k=z(c),E=z(p);if(!k||!E)return null;var I=k.text||A(k.html),X=E.text||A(E.html);return{oldEntry:k,newEntry:E,oldText:I,newText:X,lines:v(I,X)}}function l(){var c=new Date;function p(k){return k<10?"0"+k:""+k}return p(c.getHours())+":"+p(c.getMinutes())+":"+p(c.getSeconds())}function s(c,p){var k=z(c);if(!k)return!1;if(!p.skipConfirm){var E=n.iframe?n.iframe.ownerDocument:document;if(!E.defaultView.confirm("Restore this version? Your current content will be replaced (this itself is not auto-snapshotted)."))return!1}return n.setHTMLCode?n.setHTMLCode(k.html):n.setHTML&&n.setHTML(k.html),q=k.html,y&&y.isConnected&&_(),!0}function b(c){for(var p=D(),k=0;k<p.length;k++)if(p[k].id===c)return p.splice(k,1),K(),y&&y.isConnected&&H(),!0;return!1}function S(){n.__revisions=[],K(),y&&y.isConnected&&H()}function v(c,p){for(var k=String(c||"").split(/\r?\n/),E=String(p||"").split(/\r?\n/),I=[],X=w(k,E),ae=0,Z=0,ie=0;ae<k.length&&Z<E.length;)ie<X.length&&k[ae]===X[ie]&&E[Z]===X[ie]?(I.push({type:"eq",text:k[ae]}),ae++,Z++,ie++):ie<X.length&&k[ae]!==X[ie]?(I.push({type:"del",text:k[ae]}),ae++):ie<X.length&&E[Z]!==X[ie]?(I.push({type:"add",text:E[Z]}),Z++):ae<k.length?(I.push({type:"del",text:k[ae]}),ae++):Z<E.length&&(I.push({type:"add",text:E[Z]}),Z++);for(;ae<k.length;)I.push({type:"del",text:k[ae]}),ae++;for(;Z<E.length;)I.push({type:"add",text:E[Z]}),Z++;return I}function w(c,p){for(var k=c.length,E=p.length,I=new Array(E+1).fill(0),X=new Array(E+1).fill(0),ae=[],ie=0;ie<=k;ie++)ae.push(new Array(E+1).fill(0));for(var ie=1;ie<=k;ie++)for(var ne=1;ne<=E;ne++)c[ie-1]===p[ne-1]?ae[ie][ne]=ae[ie-1][ne-1]+1:ae[ie][ne]=Math.max(ae[ie-1][ne],ae[ie][ne-1]);for(var Z=[],ie=k,ne=E;ie>0&&ne>0;)c[ie-1]===p[ne-1]?(Z.unshift(c[ie-1]),ie--,ne--):ae[ie-1][ne]>=ae[ie][ne-1]?ie--:ne--;return Z}function A(c){var p=document.createElement("div");return p.innerHTML=c||"",p.innerText||p.textContent||""}function C(){if(!(y&&y.isConnected)&&!(!n||!n.iframe||!n.iframe.ownerDocument)){y&&!y.isConnected&&(y=null);var c=n.iframe.ownerDocument;if(!(!c||!c.body)){y=c.createElement("div");var p=!1;try{var k=n.container||n.getEditable&&n.getEditable().closest&&n.getEditable().closest(".richtexteditor");p=!!(k&&k.classList&&k.classList.contains("rte-dark"))}catch{}y.className="rte-rev-dialog"+(p?" rte-rev-dark":""),y.setAttribute("role","dialog"),y.setAttribute("aria-modal","true"),y.setAttribute("aria-labelledby","rte-rev-dialog-title");var E=c.createElement("div");E.className="rte-rev-backdrop",E.addEventListener("mousedown",function(X){X.target===E&&_()});var I=c.createElement("div");I.className="rte-rev-panel",E.appendChild(I),y.appendChild(E),c.body.appendChild(y),H()}}}function _(){y&&y.parentNode&&y.parentNode.removeChild(y),y=null}var h=null,F="preview";function H(){if(y){var c=y.ownerDocument,p=y.querySelector(".rte-rev-panel");if(!p){_();return}p.innerHTML="";var k=c.createElement("div");k.className="rte-rev-header";var E=c.createElement("div");E.id="rte-rev-dialog-title",E.className="rte-rev-title",E.textContent="Revision history",k.appendChild(E);var I=c.createElement("div");I.className="rte-rev-header-actions";var X=c.createElement("button");X.type="button",X.className="rte-rev-btn rte-rev-btn-ghost",X.textContent="Save version now",X.addEventListener("mousedown",function(Se){Se.preventDefault();var Me=c.defaultView.prompt("Label this version (optional):","");Me!==null&&P(Me||"")}),I.appendChild(X);var ae=c.createElement("button");ae.type="button",ae.className="rte-rev-btn rte-rev-btn-ghost",ae.textContent="Close",ae.setAttribute("aria-label","Close revision history"),ae.addEventListener("mousedown",function(Se){Se.preventDefault(),_()}),I.appendChild(ae),k.appendChild(I),p.appendChild(k);var Z=c.createElement("div");Z.className="rte-rev-body";var ie=c.createElement("div");ie.className="rte-rev-list",ie.setAttribute("role","listbox"),ie.setAttribute("aria-label","Saved revisions");var ne=n.revisionHistory.list();if(ne.length){(!h||!z(h))&&(h=ne[0].id);for(var re=0;re<ne.length;re++)(function(Se){var Me=c.createElement("button");Me.type="button",Me.className="rte-rev-row"+(Se.id===h?" rte-rev-row-active":""),Me.setAttribute("role","option"),Me.setAttribute("aria-selected",Se.id===h?"true":"false");var Oe=c.createElement("span");Oe.className="rte-rev-dot",Oe.style.background=Se.author&&Se.author.color||"#64748b";var nt=c.createElement("div");nt.className="rte-rev-row-who",nt.textContent=Se.author&&Se.author.name||"User";var ft=c.createElement("div");ft.className="rte-rev-row-when",ft.textContent=m(Se.createdAt)+" \xB7 "+(Se.label||"");var Lt=c.createElement("div");Lt.className="rte-rev-row-col",Lt.appendChild(nt),Lt.appendChild(ft),Me.appendChild(Oe),Me.appendChild(Lt),Me.addEventListener("mousedown",function(_t){_t.preventDefault(),h=Se.id,H()}),ie.appendChild(Me)})(ne[re])}else{var J=c.createElement("div");J.className="rte-rev-empty",J.textContent='No revisions yet. Click "Save version now" to capture the current document.',ie.appendChild(J)}Z.appendChild(ie);var te=c.createElement("div");if(te.className="rte-rev-pane",ne.length){var oe=z(h)||ne[0],B=c.createElement("div");B.className="rte-rev-tabs",B.setAttribute("role","tablist"),B.setAttribute("aria-label","Revision view");var Y=c.createElement("button");Y.type="button",Y.className="rte-rev-tab"+(F==="preview"?" rte-rev-tab-active":""),Y.setAttribute("role","tab"),Y.setAttribute("aria-selected",F==="preview"?"true":"false"),Y.textContent="Preview",Y.addEventListener("mousedown",function(Se){Se.preventDefault(),F="preview",H()});var le=c.createElement("button");le.type="button",le.className="rte-rev-tab"+(F==="diff"?" rte-rev-tab-active":""),le.setAttribute("role","tab"),le.setAttribute("aria-selected",F==="diff"?"true":"false"),le.textContent="Diff vs current",le.addEventListener("mousedown",function(Se){Se.preventDefault(),F="diff",H()}),B.appendChild(Y),B.appendChild(le),te.appendChild(B);var se=c.createElement("div");if(se.className="rte-rev-content",F==="preview"){var de=c.createElement("iframe");de.className="rte-rev-preview-frame",de.setAttribute("title","Revision preview"),de.setAttribute("sandbox","allow-same-origin"),se.appendChild(de),setTimeout(function(){try{de.contentDocument.open(),de.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>'+(oe.html||"")+"</body></html>"),de.contentDocument.close()}catch{}},0)}else{var Ae=n.getText?n.getText():A(n.getHTML()),be=v(oe.text||A(oe.html),Ae),ye=c.createElement("pre");ye.className="rte-rev-diff";for(var fe=0;fe<be.length;fe++){var Ee=c.createElement("span");Ee.className="rte-rev-diff-line rte-rev-diff-"+be[fe].type,Ee.textContent=(be[fe].type==="add"?"+ ":be[fe].type==="del"?"- ":" ")+be[fe].text+`
68
68
  `,ye.appendChild(Ee)}se.appendChild(ye)}te.appendChild(se);var Ce=c.createElement("div");Ce.className="rte-rev-footer";var Pe=c.createElement("div");Pe.className="rte-rev-footer-info",Pe.textContent=oe.label?"Label: "+oe.label:"";var Je=c.createElement("div");Je.className="rte-rev-footer-btns";var We=c.createElement("button");We.type="button",We.className="rte-rev-btn rte-rev-btn-danger",We.textContent="Delete",We.addEventListener("mousedown",function(Se){Se.preventDefault(),b(oe.id)});var Re=c.createElement("button");Re.type="button",Re.className="rte-rev-btn rte-rev-btn-primary",Re.textContent="Restore this version",Re.addEventListener("mousedown",function(Se){Se.preventDefault()}),Re.addEventListener("click",function(Se){Se.preventDefault(),s(oe.id)}),Je.appendChild(We),Je.appendChild(Re),Ce.appendChild(Pe),Ce.appendChild(Je),te.appendChild(Ce)}Z.appendChild(te),p.appendChild(Z)}}function m(c){if(!c)return"";var p=new Date(c),k=new Date;function E(X){return X<10?"0"+X:""+X}var I=E(p.getHours())+":"+E(p.getMinutes());return p.toDateString()===k.toDateString()?"Today "+I:p.getFullYear()+"-"+E(p.getMonth()+1)+"-"+E(p.getDate())+" "+I}function g(){var c=n&&n.iframe&&n.iframe.ownerDocument||document;if(!c.querySelector("style[data-rte-revisionhistory]")){var p=c.createElement("style");p.setAttribute("data-rte-revisionhistory","1"),p.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(`
69
69
  `),c.head.appendChild(p)}}}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 L=this,u,n,y=!1;L.PluginName="RtlUi",L.InitConfig=function(z){u=z},L.InitEditor=function(z){n=z,n.attachEvent("exec_command_rtlui",function(K){K.returnValue=!0,L.Toggle()}),N();try{n.attachEvent("ready",N)}catch{}try{n.attachEvent("aftersethtml",N)}catch{}setTimeout(N,0),n.setRtlUserInterface=function(K){return O(!!K)},n.toggleRtlUserInterface=function(){return O(!y)},n.isRtlUserInterface=function(){return y},n.getRtlUiCss=function(){return o()}},L.Toggle=function(){return O(!y)};function N(){D(),u.rtlUserInterface===!0?O(!0):u.rtlUserInterface===!1?O(!1):O(q())}function q(){try{if(typeof n.getBaseDirection=="function"&&n.getBaseDirection()==="rtl")return!0;var z=n.getEditable();if(z){var K=z.ownerDocument,G=K&&(K.defaultView||K.parentWindow);if(G&&G.getComputedStyle(z).direction==="rtl")return!0}}catch{}return!1}function W(){try{var z=n.getEditable();if(!z)return null;for(var K=z.ownerDocument.defaultView,G=K&&K.frameElement?K.frameElement:z;G&&G.classList&&!G.classList.contains("richtexteditor");)G=G.parentNode;return G&&G.classList?G:null}catch{return null}}function O(z){var K=W();return K&&(z?K.setAttribute("dir","rtl"):K.removeAttribute("dir"),y=!!z),y}function o(){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(`
70
- `)}function D(){var z=document;if(!z.getElementById("rte-rtl-ui-styles")){var K=z.createElement("style");K.id="rte-rtl-ui-styles",K.appendChild(z.createTextNode(o())),(z.head||z.documentElement).appendChild(K)}}}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 L=this,u,n,y=!1,N={removedTags:[],removedAttributes:[],calls:0,lastPasses:0},q=[];L.PluginName="Sanitizer",L.InitConfig=function(_){u=_},L.InitEditor=function(_){if(n=_,u.contentSanitizer===!1)return;n.sanitizeHtml=function(F){return R(String(F??""))},n.getSanitizerReport=function(){return JSON.parse(JSON.stringify(N))};function h(){try{l(),s()}catch{}try{C()}catch{}try{A()}catch{}}h();try{n.attachEvent("ready",h)}catch{}setTimeout(h,0),setTimeout(h,400)};var W={};"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(_){W[_]=!0});var O={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},o={};"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(_){o[_]=!0});var D={href:1,src:1,action:1,formaction:1,poster:1,cite:1,data:1,longdesc:1,background:1,ping:1,srcset:1},z=/^(https?|mailto|tel|ftp|sms|callto|webcal|geo|bitcoin):/i,K=/^data:image\/(png|jpe?g|gif|webp|bmp|x-icon|avif);base64,[a-z0-9+/=\s]+$/i;function G(_,h,F){var H=String(_??"").replace(/[\u0000-\u0020\u007F-\u00A0]+/g,"").trim();if(!H)return!1;if(/^[#?/]/.test(H))return!0;var m=/^([a-z][a-z0-9+.\-]*):/i.exec(H);return m?K.test(H)?h==="img"||h==="source"||F==="poster"||F==="srcset":/^blob:/i.test(H)?h==="img"||h==="video"||h==="audio"||h==="source":z.test(H):!0}function j(_){for(var h=[],F=String(_??"").split(";"),H=0;H<F.length;H++){var m=F[H];if(m.trim()&&!/expression\s*\(|(javascript|vbscript|livescript)\s*:|-moz-binding|behaviou?r\s*:|@import|-o-link/i.test(m)){var g=/url\s*\(\s*(['"]?)([^'")]*)\1\s*\)/i.exec(m);g&&!G(g[2],"img","src")||h.push(m.trim())}}return h.join("; ")}var T="allow-scripts allow-same-origin allow-presentation";function x(_){if(u.sanitizerAllowIframes===!1)return!1;var h=_.getAttribute("src")||"";if(!/^https?:/i.test(h))return!1;var F=u.sanitizerAllowedIframeHosts;if(!F||!F.length)return _.hasAttribute("sandbox")||_.setAttribute("sandbox",T),!0;try{for(var H=new URL(h).hostname.toLowerCase(),m=0;m<F.length;m++){var g=String(F[m]).toLowerCase();if(H===g||H.slice(-(g.length+1))==="."+g)return!0}}catch{}return!1}function P(_,h){var F={};(u.sanitizerAllowTags||[]).forEach(function(ne){F[String(ne).toLowerCase()]=!0});var H={};(u.sanitizerAllowAttributes||[]).forEach(function(ne){H[String(ne).toLowerCase()]=!0});var m=u.sanitizerAllowStyleTags===!0,g=[];(function ne(J){for(var re=0;re<J.childNodes.length;re++){var te=J.childNodes[re];te.nodeType===1?(g.push(te),ne(te)):te.nodeType===8&&g.push(te)}})(_);for(var c=0;c<g.length;c++){var p=g[c];if(p.parentNode){if(p.nodeType===8){p.parentNode.removeChild(p);continue}var k=(p.localName||p.nodeName||"").toLowerCase();if(k==="style"){if(!m){V(h.removedTags,"style"),p.parentNode.removeChild(p);continue}}else if(k==="iframe"){if(p.hasAttribute("srcdoc")&&(V(h.removedAttributes,"iframe[srcdoc]"),p.removeAttribute("srcdoc")),!x(p)){V(h.removedTags,"iframe"),p.parentNode.removeChild(p);continue}}else if(O[k]){V(h.removedTags,k),p.parentNode.removeChild(p);continue}else if(!W[k]&&!F[k]){V(h.removedTags,k),U(p);continue}for(var E=[],I=0;I<p.attributes.length;I++)E.push(p.attributes[I]);for(var X=0;X<E.length;X++){var ae=E[X].name.toLowerCase(),Z=E[X].value;if(ae.indexOf("on")===0){V(h.removedAttributes,ae),p.removeAttribute(E[X].name);continue}if(ae==="xlink:href"||ae==="xmlns:xlink"){G(Z,k,ae)||(V(h.removedAttributes,ae),p.removeAttribute(E[X].name));continue}if(ae==="srcdoc"){V(h.removedAttributes,"srcdoc"),p.removeAttribute(E[X].name);continue}if(ae==="style"){p.setAttribute("style",j(Z));continue}if(!(ae.indexOf("data-")===0||ae.indexOf("aria-")===0)){if(D[ae]){G(Z,k,ae)||(V(h.removedAttributes,k+"["+ae+"]"),p.removeAttribute(E[X].name));continue}!o[ae]&&!H[ae]&&(V(h.removedAttributes,ae),p.removeAttribute(E[X].name))}}if(k==="a"&&(p.getAttribute("target")||"").toLowerCase()==="_blank"){var ie=(p.getAttribute("rel")||"").toLowerCase();ie.indexOf("noopener")<0&&p.setAttribute("rel",(ie?ie+" ":"")+"noopener noreferrer")}}}return _}function U(_){for(var h=_.parentNode;_.firstChild;)h.insertBefore(_.firstChild,_);h.removeChild(_)}function V(_,h){_.indexOf(h)<0&&_.push(h)}function R(_){var h=_;N.calls++;for(var F=0;F<3;F++){var H=new DOMParser().parseFromString("<body>"+h+"</body>","text/html");P(H.body,N);var m=H.body.innerHTML;if(N.lastPasses=F+1,m===h)break;h=m}return h}function l(){if(!y){for(var _=["getHTMLCode","getHTMLContent"],h=!1,F=0;F<_.length;F++)(function(H){var m=n[H];if(!(typeof m!="function"||m.__rteSanitized)){var g=function(){var c=m.apply(n,arguments);return typeof c!="string"?c:R(c)};g.__rteSanitized=!0,n[H]=g,h=!0}})(_[F]);h&&(y=!0)}}function s(){for(var _=["setHTMLCode","setHTMLContent"],h=0;h<_.length;h++)(function(F){var H=n[F];if(!(typeof H!="function"||H.__rteSanitizedIn)){var m=function(g){var c=[].slice.call(arguments);return typeof g=="string"&&(c[0]=R(g)),H.apply(n,c)};m.__rteSanitizedIn=!0,n[F]=m}})(_[h])}function b(_){return/\son[a-z]+\s*=/i.test(_)||/<\s*(script|iframe|object|embed|base)\b/i.test(_)||/srcdoc\s*=/i.test(_)||/(javascript|vbscript)\s*:/i.test(_)||/data:\s*text\/html/i.test(_)}var S=/^(script|iframe|object|embed|base|meta|link|form)$/;function v(_){if(!_.attributes)return!1;for(var h=0;h<_.attributes.length;h++){var F=_.attributes[h].name.toLowerCase();if(F.indexOf("on")===0||F==="srcdoc"||(F==="href"||F==="src"||F==="data"||F==="action"||F==="xlink:href")&&/(javascript|vbscript)\s*:|data:\s*text\/html/i.test(_.attributes[h].value||""))return!0}return!1}function w(_){if(S.test(_.localName||"")||v(_))return!0;for(var h=_.getElementsByTagName?_.getElementsByTagName("*"):[],F=0;F<h.length;F++)if(S.test(h[F].localName||"")||v(h[F]))return!0;return!1}function A(){if(u.sanitizerGuardLiveDom!==!1){var _=null;try{_=n.getEditable()}catch{return}if(!(!_||_.__rteLiveGuard)){_.__rteLiveGuard=!0;var h=new MutationObserver(function(F){for(var H=!1,m=0;m<F.length&&!H;m++){var g=F[m];if(g.type==="attributes"){var c=(g.attributeName||"").toLowerCase();(c.indexOf("on")===0||c==="srcdoc"||v(g.target))&&(H=!0);continue}for(var p=0;p<g.addedNodes.length;p++){var k=g.addedNodes[p];if(k.nodeType===1&&w(k)){H=!0;break}}}if(H)try{P(_,N)}catch{}});h.observe(_,{childList:!0,subtree:!0,attributes:!0}),q.push(h)}}}function C(){var _=null;try{_=n.getEditable()}catch{return}if(!_||_.__rteSanitizePaste)return;_.__rteSanitizePaste=!0,_.addEventListener("paste",function(F){var H=F.clipboardData||window.clipboardData;if(H){var m="";try{m=H.getData("text/html")||""}catch{return}if(!(!m||!b(m))){F.preventDefault(),F.stopImmediatePropagation();var g=R(m);try{n.insertHTML(g)}catch{try{n.insertText(H.getData("text/plain")||"")}catch{}}}}},!0);function h(){var F=function(){try{P(_,N)}catch{}};setTimeout(F,0),setTimeout(F,250)}_.addEventListener("paste",h,!1),_.addEventListener("drop",h,!0)}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_slashcommand=RTE_Plugin_SlashCommand;function RTE_Plugin_SlashCommand(){var L=this,u,n,y=null,N=null,q=null,W=[],O=[],o=0,D=!1,z=!1;L.PluginName="SlashCommand",L.InitConfig=function(Le){u=Le,u.slashCommandEnabled!==!1&&(u.slashCommandTrigger=u.slashCommandTrigger||"/",u.slashCommandMaxItems=u.slashCommandMaxItems||40,u.slashCommandIncludeAi=u.slashCommandIncludeAi!==!1,u.slashCommands=u.slashCommands||null)},L.InitEditor=function(Le){if(n=Le,u.slashCommandEnabled!==!1){if(n.slashCommands={register:K,remove:G,list:function(){return W.slice()},open:function(){b(!0)},close:S,isOpen:function(){return!!N}},W=V(),Array.isArray(u.slashCommands))for(var Te=0;Te<u.slashCommands.length;Te++)K(u.slashCommands[Te]);p();var Ye=n.getDocument();Ye.addEventListener("keydown",R,!0),Ye.addEventListener("input",l,!0),Ye.addEventListener("compositionstart",function(){D=!0}),Ye.addEventListener("compositionend",function(){D=!1}),Ye.addEventListener("mousedown",function(){S()},!0),Ye.addEventListener("blur",function(){setTimeout(S,150)},!0),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c,!0)}};function K(Le){if(!(!Le||!Le.id)){var Te=j(Le.id);Te>=0?W[Te]=T(Le):W.push(T(Le))}}function G(Le){var Te=j(Le);Te>=0&&W.splice(Te,1)}function j(Le){for(var Te=0;Te<W.length;Te++)if(W[Te].id===Le)return Te;return-1}function T(Le){return{id:Le.id,section:Le.section||"Blocks",title:Le.title||Le.id,description:Le.description||"",keywords:(Le.keywords||[]).slice(),icon:Le.icon||"",iconSvg:Le.iconSvg||"",run:Le.run||Le.action}}var x={P:1,DIV:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,PRE:1,LI:1};function P(){var Le=n.getSelection();if(!Le||Le.rangeCount===0)return null;for(var Te=Le.getRangeAt(0).startContainer,Ye=n.getEditable();Te&&Te!==Ye;){if(Te.nodeType===1&&x[Te.nodeName])return Te;Te=Te.parentNode}return null}function U(Le){var Te=P();if(Le=Le.toUpperCase(),Te&&!Te.textContent.trim()){var Ye=n.getDocument(),kt=Ye.createElement(Le);kt.appendChild(Ye.createElement("br")),Te.parentNode.replaceChild(kt,Te);var Ft=Ye.createRange();Ft.setStart(kt,0),Ft.setEnd(kt,0);var Ot=n.getSelection();Ot.removeAllRanges(),Ot.addRange(Ft);return}n.execCommand("formatblock",Le)}function V(){var Le=[];function Te(pt,wr,Va,_a,On,Go,lo){Le.push(T({id:wr,section:pt,title:Va,description:_a,keywords:On,iconSvg:Go,run:lo}))}if(Te("Blocks","heading1","Heading 1","Large section heading",["h1","title"],k("1"),function(){U("H1")}),Te("Blocks","heading2","Heading 2","Medium section heading",["h2","subtitle"],k("2"),function(){U("H2")}),Te("Blocks","heading3","Heading 3","Small section heading",["h3"],k("3"),function(){U("H3")}),Te("Blocks","paragraph","Paragraph","Plain body text",["p","text","body"],E(),function(){U("P")}),Te("Blocks","bulletlist","Bulleted list","Unordered list",["ul","bullets","list"],I(),function(){n.execCommand("insertunorderedlist")}),Te("Blocks","numberlist","Numbered list","Ordered list",["ol","numbered"],X(),function(){n.execCommand("insertorderedlist")}),Te("Blocks","quote","Quote","Block quotation",["blockquote"],ae(),function(){n.execCommand("insertblockquote")}),Te("Blocks","code","Code block","Monospaced code block",["pre","snippet"],Z(),function(){n.isCommandEnabled&&n.isCommandEnabled("insertcode")?n.execCommand("insertcode"):n.execCommand("formatblock","PRE")}),Te("Blocks","divider","Divider","Horizontal rule",["hr","line","separator"],ie(),function(){n.execCommand("inserthorizontalrule")}),(!n.isCommandEnabled||n.isCommandEnabled("insertcallout"))&&Te("Blocks","callout","Callout","Highlighted info / warning box",["admonition","info","warning","note","tip"],le(),function(){n.execCommand("insertcallout")}),(!n.isCommandEnabled||n.isCommandEnabled("insertcolumns"))&&Te("Blocks","columns","Columns","Multi-column layout",["layout","grid","column"],se(),function(){n.execCommand("insertcolumns")}),(!n.isCommandEnabled||n.isCommandEnabled("inserttoggle"))&&Te("Blocks","toggle","Toggle list","Collapsible toggle block",["collapse","details","accordion","expand"],de(),function(){n.execCommand("inserttoggle")}),(!n.isCommandEnabled||n.isCommandEnabled("insertmath"))&&Te("Insert","equation","Equation","Insert a math equation (TeX)",["math","latex","tex","formula","katex"],Ae(),function(){n.execCommand("insertmath")}),(!n.isCommandEnabled||n.isCommandEnabled("inserttodolist"))&&Te("Blocks","todolist","To-do list","Checklist with clickable checkboxes",["task","todo","checklist","checkbox","check"],Ke(),function(){n.execCommand("inserttodolist")}),(!n.isCommandEnabled||n.isCommandEnabled("insertdiagram"))&&Te("Insert","diagram","Diagram","Insert a Mermaid diagram",["mermaid","flowchart","sequence","gantt","graph","uml"],Ce(),function(){n.execCommand("insertdiagram")}),(!n.isCommandEnabled||n.isCommandEnabled("insertbookmark"))&&Te("Insert","bookmark","Bookmark","Insert a link preview card",["link","url","embed","preview","card"],be(),function(){n.execCommand("insertbookmark")}),(!n.isCommandEnabled||n.isCommandEnabled("spellcheck"))&&Te("Tools","spellcheck","Spell check","Check spelling",["spelling","grammar","proofread","typo"],ye(),function(){n.execCommand("spellcheck")}),(!n.isCommandEnabled||n.isCommandEnabled("insertdatechip"))&&Te("Insert","datechip","Date chip","Insert an interactive date chip",["date","calendar","chip","today"],fe(),function(){n.execCommand("insertdatechip")}),(!n.isCommandEnabled||n.isCommandEnabled("insertchip"))&&Te("Insert","chip","Smart chip","Insert a date / person / link chip",["chip","person","mention","link","pill"],fe(),function(){n.execCommand("insertchip")}),(!n.isCommandEnabled||n.isCommandEnabled("emailexport"))&&Te("Tools","emailexport","Export email HTML","Inline-styled HTML for email",["email","inline","mail","newsletter","html"],Ee(),function(){n.execCommand("emailexport")}),typeof n.openFindDialog=="function"&&Te("Tools","findreplace","Find & replace","Search the document and replace text",["find","replace","search","query","substitute"],et(),function(){n.openFindDialog()}),typeof n.showShortcuts=="function"&&Te("Tools","shortcuts","Keyboard shortcuts","Show the keyboard shortcut cheat sheet (Ctrl+/)",["keyboard","shortcuts","hotkeys","keys","help","cheat"],Ze(),function(){n.showShortcuts()}),typeof n.foldAtCaret=="function"&&(Te("Tools","foldsection","Fold section","Collapse the section under the current heading",["fold","collapse","heading","outline","section"],at(),function(){n.foldAtCaret()}),Te("Tools","unfoldall","Unfold all","Expand every collapsed heading section",["unfold","expand","headings","collapse"],at(),function(){n.unfoldAll&&n.unfoldAll()})),(!n.isCommandEnabled||n.isCommandEnabled("readaloud"))&&Te("Tools","readaloud","Read aloud","Speak the selection or document (text-to-speech)",["tts","speak","speech","voice","accessibility","narrate"],Pe(),function(){n.execCommand("readaloud")}),typeof n.sortTableAtCaret=="function"&&(Te("Tools","sorttableasc","Sort table by this column","Sort the table rows by the column the caret is in",["sort","table","column","order","ascending"],nt(),function(){n.sortTableAtCaret("asc")}),Te("Tools","sorttabledesc","Sort table (descending)","Sort the table rows by this column, largest first",["sort","table","column","descending","reverse"],nt(),function(){n.sortTableAtCaret("desc")}),Te("Tools","tablerownumbers","Number table rows","Add or remove an automatic row-numbering column",["number","rows","table","count","index"],nt(),function(){n.execCommand("tablerownumbers")})),typeof n.moveBlockUp=="function"&&(Te("Tools","moveblockup","Move block up","Move this paragraph or block above the previous one (Alt+Shift+Up)",["move","block","up","reorder","drag"],Je(),function(){n.moveBlockUp()}),Te("Tools","moveblockdown","Move block down","Move this paragraph or block below the next one (Alt+Shift+Down)",["move","block","down","reorder","drag"],Je(),function(){n.moveBlockDown()})),typeof n.toggleRtlUserInterface=="function"&&Te("Tools","rtlui","Mirror editor for RTL","Flip the toolbar, menus and dialogs for right-to-left languages",["rtl","mirror","interface","toolbar","arabic","hebrew"],We(),function(){n.toggleRtlUserInterface()}),typeof n.setTextDirection=="function"&&(Te("Tools","rtl","Right-to-left","Set this paragraph to right-to-left (Arabic, Hebrew, Persian)",["rtl","arabic","hebrew","persian","urdu","direction","bidi"],We(),function(){n.setTextDirection("rtl")}),Te("Tools","ltr","Left-to-right","Set this paragraph to left-to-right",["ltr","direction","bidi"],Re(),function(){n.setTextDirection("ltr")}),Te("Tools","autodir","Detect text direction","Set each paragraph's direction from its own content",["direction","detect","auto","rtl","bidi"],We(),function(){n.autoDetectTextDirection()})),typeof n.toggleFormattingMarks=="function"&&Te("Tools","formattingmarks","Formatting marks","Show paragraph marks, block outlines and invisible characters",["marks","pilcrow","paragraph","invisible","whitespace","nbsp"],Se(),function(){n.toggleFormattingMarks()}),typeof n.toggleWatermark=="function"&&Te("Tools","watermark","Watermark","Draw DRAFT or CONFIDENTIAL behind the content",["watermark","draft","confidential","background","stamp"],Me(),function(){n.toggleWatermark()}),typeof n.toggleLineNumbers=="function"&&Te("Tools","linenumbers","Line numbers","Number every line in the margin, as pleadings and transcripts require",["line","numbers","margin","pleading","legal","transcript"],Oe(),function(){n.toggleLineNumbers()}),typeof n.togglePermanentPen=="function"&&Te("Tools","permanentpen","Permanent pen","Keep typing in a fixed annotation format until switched off",["pen","marker","annotate","highlight","review"],ft(),function(){n.togglePermanentPen()}),typeof n.checkLinks=="function"&&Te("Tools","checklinks","Check links","Find broken anchors, unsafe schemes and unlabelled links",["link","check","broken","audit","url","accessibility"],Lt(),function(){n.highlightLinkIssues(!0),n.checkLinks()}),typeof n.getMergeFieldDefinitions=="function"){for(var Ye=n.getMergeFieldDefinitions(),kt=0;kt<Ye.length;kt++)(function(pt){!pt||!pt.id||Te("Insert","mergefield-"+pt.id,pt.label||pt.id,"Insert the "+(pt.label||pt.id)+" merge field",["merge","field","placeholder","variable","mail merge",pt.id],_t(),function(){n.insertMergeField(pt.id)})})(Ye[kt]);Te("Tools","mergepreview","Preview merge fields","Swap merge-field placeholders for sample data",["merge","preview","sample","data","placeholder"],_t(),function(){n.toggleMergeFieldPreview()})}if(typeof n.listCrossReferenceTargets=="function"){var Ft=[];try{Ft=n.listCrossReferenceTargets()}catch{Ft=[]}for(var Ot=0;Ot<Ft.length&&Ot<40;Ot++)(function(pt){if(!(!pt||!pt.id)){var wr=pt.number?pt.number+" "+pt.label:pt.label;Te("Insert","xref-"+pt.id,"Reference: "+wr,"Insert a cross-reference to this "+pt.type+" that updates itself",["cross","reference","xref","see","refer",pt.type,pt.number||""],Qt(),function(){n.insertCrossReference(pt.id,pt.number?"label":"text")})}})(Ft[Ot])}if(typeof n.insertTableOfContents=="function"&&Te("Insert","toc","Table of contents","Insert a contents block that updates itself from your headings",["toc","contents","outline","index","headings"],Et(),function(){n.insertTableOfContents()}),typeof n.insertFootnote=="function"&&Te("Insert","footnote","Footnote","Insert a numbered footnote reference and note",["footnote","note","citation","reference","endnote","cite"],Ue(),function(){n.insertFootnote()}),typeof n.toggleFormatPainter=="function"&&Te("Tools","formatpainter","Format painter","Copy formatting here, then select the text to paint it onto",["format","painter","brush","copy","style","clone"],Ge(),function(){n.toggleFormatPainter()}),typeof n.changeCase=="function"&&(Te("Tools","caseupper","UPPERCASE","Convert the selection to upper case",["case","upper","caps","capitals"],qe(),function(){n.changeCase("upper")}),Te("Tools","caselower","lowercase","Convert the selection to lower case",["case","lower","small"],qe(),function(){n.changeCase("lower")}),Te("Tools","casetitle","Title Case","Capitalise each significant word in the selection",["case","title","headline","capitalise","capitalize"],qe(),function(){n.changeCase("title")}),Te("Tools","casesentence","Sentence case","Capitalise the first letter of each sentence",["case","sentence","capitalise","capitalize"],qe(),function(){n.changeCase("sentence")})),typeof n.requestGhostText=="function"&&Te("Tools","aicomplete","AI complete","Suggest an inline AI completion of the current sentence",["ai","complete","autocomplete","ghost","suggest","continue","copilot"],br(),function(){n.requestGhostText()}),typeof n.exportToPdf=="function"&&Te("Tools","exportpdf","Export to PDF","Real text, not a screenshot \u2014 selectable, searchable and screen-reader friendly",["pdf","export","download","save","print","text","accessible","searchable"],St(),function(){n.exportToPdf()}),typeof n.exportToDocx=="function"&&Te("Tools","exportdocx","Export to Word (.docx)","A real OOXML document, built in the browser with no upload",["word","docx","ooxml","export","download","save","office"],Xt(),function(){n.exportToDocx()}),typeof n.copyAsMarkdown=="function"&&(Te("Tools","copymarkdown","Copy as Markdown","Copy the whole document to the clipboard as Markdown",["markdown","md","copy","clipboard","export"],Ct(),function(){n.copyAsMarkdown()}),Te("Tools","downloadmarkdown","Download as Markdown","Save the document as a .md file",["markdown","md","download","export","save","file"],Ct(),function(){n.downloadMarkdown()})),typeof n.toggleTypewriterMode=="function"&&(Te("Tools","typewriter","Typewriter mode","Keep the caret line centred as you type",["typewriter","center","scroll","focus","distraction","zen"],Gt(),function(){n.toggleTypewriterMode()}),Te("Tools","focusmode","Focus mode","Dim everything except the current paragraph",["focus","dim","highlight","distraction","zen","concentrate"],Xe(),function(){n.toggleFocusMode()})),Te("Insert","table","Table","Insert a table",["grid","rows","columns"],ne(),function(){n.execCommand("inserttable")}),Te("Insert","image","Image","Upload or embed an image",["picture","photo","img"],J(),function(){n.execCommand("imageupload")}),Te("Insert","link","Link","Insert a hyperlink",["url","anchor"],re(),function(){n.execCommand("insertlink")}),Te("Insert","emoji","Emoji","Insert an emoji",["smiley","icon"],te(),function(){n.execCommand("insertemoji")}),Te("Insert","template","Template","Insert from template gallery",["snippet"],oe(),function(){n.execCommand("inserttemplate")}),Te("Insert","date","Today's date","Insert the current date",["time","now"],B(),function(){n.execCommand("insertdate")}),u.slashCommandIncludeAi&&Array.isArray(u.aiToolkitActions))for(var Vt=0;Vt<u.aiToolkitActions.length;Vt++)(function(pt){Le.push(T({id:"ai-"+pt.id,section:"AI",title:pt.title||pt.id,description:pt.description||"",keywords:["ai",pt.id],iconSvg:u["svgCode_aiassist_"+(pt.icon||pt.id)]||u.svgCode_aiassist||"",run:function(){var wr=n.aiToolkit;if(wr){if(pt.id==="chat-panel"&&typeof wr.openChatPanel=="function"){wr.openChatPanel();return}if(pt.id==="review-panel"&&typeof wr.openReviewPanel=="function"){wr.openReviewPanel();return}if(pt.id==="open-dialog"&&typeof wr.openDialog=="function"){wr.openDialog();return}if(typeof wr.runQuickAction=="function"){wr.runQuickAction(pt.id);return}typeof wr.resolveAction=="function"&&wr.resolveAction(pt.id)}}}))})(u.aiToolkitActions[Vt]);return Le}function R(Le){if(!D){if(N)switch(Le.key){case"ArrowDown":Le.preventDefault(),Le.stopPropagation(),F(1);return;case"ArrowUp":Le.preventDefault(),Le.stopPropagation(),F(-1);return;case"Enter":case"Tab":if(O.length){Le.preventDefault(),Le.stopPropagation(),H();return}S();return;case"Escape":case"Esc":Le.preventDefault(),Le.stopPropagation(),S();return}if(Le.key===u.slashCommandTrigger&&!Le.ctrlKey&&!Le.metaKey&&!Le.altKey){if(!s())return;z=!1,setTimeout(function(){z||b(!1)},0)}}}function l(){N&&v()}function s(){var Le=n.getSelection();if(!Le||Le.rangeCount===0||!Le.isCollapsed)return!1;for(var Te=Le.getRangeAt(0),Ye=Te.startContainer,kt=Te.startOffset,Ft=n.getEditable(),Ot=Ye.nodeType===1?Ye:Ye.parentNode;Ot&&Ot!==Ft;){var Vt=Ot.nodeName;if(Vt==="CODE"||Vt==="PRE")return!1;Ot=Ot.parentNode}if(Ye.nodeType===3){if(kt===0)return!0;var pt=Ye.nodeValue.charAt(kt-1);return/\s/.test(pt)}return!0}function b(Le){S();var Te=n.getSelection();if(!(!Te||Te.rangeCount===0)){var Ye=Te.getRangeAt(0).cloneRange();q={range:Ye,startNode:Ye.startContainer,startOffset:Ye.startOffset,triggerCharCount:Le?0:1,query:""},A(),g(),w("")}}function S(){N&&N.parentNode&&N.parentNode.removeChild(N),N=null,q=null,O=[],o=0}function v(){if(q){var Le=n.getSelection();if(!Le||Le.rangeCount===0||!Le.isCollapsed){S();return}var Te=Le.getRangeAt(0),Ye=Te.startContainer;if(Ye!==q.startNode){S();return}var kt=Te.startOffset;if(kt<q.startOffset){S();return}var Ft=(Ye.nodeType===3?Ye.nodeValue:"")||"",Ot=Ft.substring(q.startOffset,kt);if(/\s/.test(Ot)){S();return}q.query=Ot,w(Ot),g()}}function w(Le){var Te=(Le||"").toLowerCase();O=W.filter(function(Ye){if(!Te||Ye.title.toLowerCase().indexOf(Te)!==-1||Ye.description&&Ye.description.toLowerCase().indexOf(Te)!==-1)return!0;for(var kt=0;kt<Ye.keywords.length;kt++)if(String(Ye.keywords[kt]).toLowerCase().indexOf(Te)!==-1)return!0;return!1}).slice(0,u.slashCommandMaxItems),o=0,C()}function A(){y=n.iframe.ownerDocument,N=y.createElement("div"),N.className="rte-slash-popup";try{var Le=n.container||n.getEditable&&n.getEditable().closest&&n.getEditable().closest(".richtexteditor");Le&&Le.classList&&Le.classList.contains("rte-dark")&&(N.className+=" rte-slash-popup-dark")}catch{}N.setAttribute("role","listbox"),N.setAttribute("aria-label","Slash commands"),y.body.appendChild(N)}function C(){if(N){if(N.innerHTML="",!O.length){var Le=y.createElement("div");Le.className="rte-slash-empty",Le.textContent="No matching commands",N.appendChild(Le);return}for(var Te="",Ye=0;Ye<O.length;Ye++)(function(kt,Ft){if(kt.section!==Te){var Ot=y.createElement("div");Ot.className="rte-slash-section",Ot.textContent=kt.section,N.appendChild(Ot),Te=kt.section}var Vt=y.createElement("button");Vt.type="button",Vt.className="rte-slash-item"+(Ft===o?" rte-slash-item-active":""),Vt.setAttribute("role","option"),Vt.setAttribute("aria-selected",Ft===o?"true":"false"),Vt.setAttribute("data-index",Ft);var pt=y.createElement("span");pt.className="rte-slash-item-icon",pt.innerHTML=kt.iconSvg||Y(),Vt.appendChild(pt);var wr=y.createElement("span");wr.className="rte-slash-item-body";var Va=y.createElement("span");if(Va.className="rte-slash-item-title",Va.textContent=kt.title,wr.appendChild(Va),kt.description){var _a=y.createElement("span");_a.className="rte-slash-item-desc",_a.textContent=kt.description,wr.appendChild(_a)}Vt.appendChild(wr),Vt.addEventListener("mousedown",function(On){On.preventDefault(),On.stopPropagation(),o=Ft,H()}),Vt.addEventListener("click",function(On){N&&(On.preventDefault(),On.stopPropagation(),o=Ft,H())}),Vt.addEventListener("mouseenter",function(){o!==Ft&&(o=Ft,_())}),N.appendChild(Vt)})(O[Ye],Ye)}}function _(){if(N){for(var Le=N.querySelectorAll(".rte-slash-item"),Te=0;Te<Le.length;Te++){var Ye=+Le[Te].getAttribute("data-index"),kt=Ye===o;Le[Te].classList.toggle("rte-slash-item-active",kt),Le[Te].setAttribute("aria-selected",kt?"true":"false")}h()}}function h(){if(N){var Le=N.querySelector(".rte-slash-item-active");if(Le){var Te=Le.offsetTop,Ye=Te+Le.offsetHeight;Te<N.scrollTop?N.scrollTop=Te:Ye>N.scrollTop+N.clientHeight&&(N.scrollTop=Ye-N.clientHeight)}}}function F(Le){O.length&&(o=(o+Le+O.length)%O.length,_())}function H(){if(!O.length){S();return}var Le=O[o],Te=q;if(S(),!(!Le||!Te)){m(Te);var Ye=n.getDocument();Ye.activeElement!==n.getEditable()&&!Ye.hasFocus()&&n.focus();try{Le.run(n)}catch(kt){console.warn("Slash command failed:",kt)}}}function m(Le){var Te=Le.startNode;if(Te){var Ye=Le.startOffset-(Le.triggerCharCount||0);Ye<0&&(Ye=0);var kt=n.getSelection();if(!(!kt||kt.rangeCount===0)){var Ft=kt.getRangeAt(0),Ot,Vt;Te.nodeType===3&&Ft.startContainer===Te?(Ot=Te,Vt=Ft.startOffset):(Ot=Ft.startContainer,Vt=Ft.startOffset);var pt=n.getDocument().createRange();pt.setStart(Te,Ye),pt.setEnd(Ot,Vt);try{pt.deleteContents()}catch{return}kt.removeAllRanges(),kt.addRange(pt)}}}function g(){if(!(!N||!q)){var Le=n.iframe,Te=Le.getBoundingClientRect(),Ye=q.range.getClientRects(),kt=Ye&&Ye.length?Ye[Ye.length-1]:null;kt||(kt=q.range.getBoundingClientRect());var Ft=Te.left+(kt.left||0)+window.pageXOffset,Ot=Te.top+(kt.bottom||kt.top||0)+window.pageYOffset+4;N.style.position="absolute",N.style.left=Ft+"px",N.style.top=Ot+"px";var Vt=window.innerHeight||document.documentElement.clientHeight,pt=N.getBoundingClientRect();pt.bottom>Vt-8&&Te.top+(kt.top||0)>pt.height+16&&(N.style.top=Te.top+(kt.top||0)+window.pageYOffset-pt.height-4+"px")}}function c(){N&&g()}function p(){var Le=n&&n.iframe&&n.iframe.ownerDocument||document;if(!Le.querySelector("style[data-rte-slashcommand]")){var Te=Le.createElement("style");Te.setAttribute("data-rte-slashcommand","1"),Te.textContent=["/* 2026-07-03 slash command polish */",".rte-slash-popup{position:absolute;z-index:2147483000;min-width:280px;max-width:min(390px,calc(100vw - 24px));max-height:min(360px,64vh);overflow-y:auto;overscroll-behavior:contain;padding:6px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.96));background-clip:padding-box;border:1px solid rgba(148,163,184,.22);box-shadow:0 16px 36px rgba(29,78,216,.14),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-slash-section{position:sticky;top:0;z-index:1;margin:4px 0 2px;padding:6px 8px 4px;background:linear-gradient(180deg,rgba(248,251,255,.98),rgba(248,251,255,.86));color:#52657e;font-size:10px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}",".rte-slash-item{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;width:100%;min-height:40px;padding:6px 8px;border:0;background:transparent;text-align:left;cursor:pointer;color:inherit;font:inherit;border-radius:8px}",".rte-slash-item:hover,.rte-slash-item-active{background:#eef4ff;color:#1559d6}",".rte-slash-item:focus-visible{outline:2px solid rgba(37,99,235,.22);outline-offset:2px}",".rte-slash-item-icon{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:#315277;background:#ffffff;border-radius:8px;box-shadow:inset 0 0 0 1px rgba(148,163,184,.18)}",".rte-slash-item-active .rte-slash-item-icon{color:#1559d6;background:#ffffff}",".rte-slash-item-icon svg{display:block;width:16px;height:16px;pointer-events:none}",".rte-slash-item-body{display:flex;flex-direction:column;min-width:0;flex:1}",".rte-slash-item-title{font-weight:780;font-size:13px;line-height:1.24;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-desc{font-size:11px;color:#64748b;line-height:1.24;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-active .rte-slash-item-desc{color:#315277}",".rte-slash-empty{padding:16px;color:#52657e;font-size:12px;font-weight:700;text-align:center}",".rte-slash-popup-dark{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155;color:#e2e8f0;box-shadow:0 20px 46px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.4)}",".rte-slash-popup-dark .rte-slash-section{background:linear-gradient(180deg,rgba(30,41,59,.98),rgba(30,41,59,.86));color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item:hover,.rte-slash-popup-dark .rte-slash-item-active{background:#1d4ed8;color:#fff}",".rte-slash-popup-dark .rte-slash-item-icon{color:#cbd5e1;background:#0f172a;box-shadow:inset 0 0 0 1px rgba(148,163,184,.25)}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-icon{color:#fff;background:#1e3a8a}",".rte-slash-popup-dark .rte-slash-item-desc{color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-desc{color:#dbeafe}",".rte-slash-popup-dark .rte-slash-empty{color:#94a3b8}"].join(`
70
+ `)}function D(){var z=document;if(!z.getElementById("rte-rtl-ui-styles")){var K=z.createElement("style");K.id="rte-rtl-ui-styles",K.appendChild(z.createTextNode(o())),(z.head||z.documentElement).appendChild(K)}}}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 L=this,u,n,y=!1,N={removedTags:[],removedAttributes:[],calls:0,lastPasses:0},q=[];L.PluginName="Sanitizer",L.InitConfig=function(_){u=_},L.InitEditor=function(_){if(n=_,u.contentSanitizer===!1)return;n.sanitizeHtml=function(F){return R(String(F??""))},n.getSanitizerReport=function(){return JSON.parse(JSON.stringify(N))};function h(){try{l(),s()}catch{}try{C()}catch{}try{A()}catch{}}h();try{n.attachEvent("ready",h)}catch{}setTimeout(h,0),setTimeout(h,400)};var W={};"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(_){W[_]=!0});var O={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},o={};"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(_){o[_]=!0});var D={href:1,src:1,action:1,formaction:1,poster:1,cite:1,data:1,longdesc:1,background:1,ping:1,srcset:1},z=/^(https?|mailto|tel|ftp|sms|callto|webcal|geo|bitcoin):/i,K=/^data:image\/(png|jpe?g|gif|webp|bmp|x-icon|avif);base64,[a-z0-9+/=\s]+$/i;function G(_,h,F){var H=String(_??"").replace(/[\u0000-\u0020\u007F-\u00A0]+/g,"").trim();if(!H)return!1;if(h==="use")return H.charAt(0)==="#";if(/^[#?/]/.test(H))return!0;var m=/^([a-z][a-z0-9+.\-]*):/i.exec(H);return m?K.test(H)?h==="img"||h==="source"||F==="poster"||F==="srcset":/^blob:/i.test(H)?h==="img"||h==="video"||h==="audio"||h==="source":z.test(H):!0}function j(_){for(var h=[],F=String(_??"").split(";"),H=0;H<F.length;H++){var m=F[H];if(m.trim()&&!/expression\s*\(|(javascript|vbscript|livescript)\s*:|-moz-binding|behaviou?r\s*:|@import|-o-link/i.test(m)){var g=/url\s*\(\s*(['"]?)([^'")]*)\1\s*\)/i.exec(m);g&&!G(g[2],"img","src")||h.push(m.trim())}}return h.join("; ")}var T="allow-scripts allow-same-origin allow-presentation";function x(_){if(u.sanitizerAllowIframes===!1)return!1;var h=_.getAttribute("src")||"";if(!/^https?:/i.test(h))return!1;var F=u.sanitizerAllowedIframeHosts;if(!F||!F.length)return _.hasAttribute("sandbox")||_.setAttribute("sandbox",T),!0;try{for(var H=new URL(h).hostname.toLowerCase(),m=0;m<F.length;m++){var g=String(F[m]).toLowerCase();if(H===g||H.slice(-(g.length+1))==="."+g)return!0}}catch{}return!1}function P(_,h){var F={};(u.sanitizerAllowTags||[]).forEach(function(ne){F[String(ne).toLowerCase()]=!0});var H={};(u.sanitizerAllowAttributes||[]).forEach(function(ne){H[String(ne).toLowerCase()]=!0});var m=u.sanitizerAllowStyleTags===!0,g=[];(function ne(J){for(var re=0;re<J.childNodes.length;re++){var te=J.childNodes[re];te.nodeType===1?(g.push(te),ne(te)):te.nodeType===8&&g.push(te)}})(_);for(var c=0;c<g.length;c++){var p=g[c];if(p.parentNode){if(p.nodeType===8){p.parentNode.removeChild(p);continue}var k=(p.localName||p.nodeName||"").toLowerCase();if(k==="style"){if(!m){V(h.removedTags,"style"),p.parentNode.removeChild(p);continue}}else if(k==="iframe"){if(p.hasAttribute("srcdoc")&&(V(h.removedAttributes,"iframe[srcdoc]"),p.removeAttribute("srcdoc")),!x(p)){V(h.removedTags,"iframe"),p.parentNode.removeChild(p);continue}}else if(k==="title"||k==="desc"){if(!p.closest||!p.closest("svg")){V(h.removedTags,k),p.parentNode.removeChild(p);continue}}else if(O[k]){V(h.removedTags,k),p.parentNode.removeChild(p);continue}else if(!W[k]&&!F[k]){V(h.removedTags,k),U(p);continue}for(var E=[],I=0;I<p.attributes.length;I++)E.push(p.attributes[I]);for(var X=0;X<E.length;X++){var ae=E[X].name.toLowerCase(),Z=E[X].value;if(ae.indexOf("on")===0){V(h.removedAttributes,ae),p.removeAttribute(E[X].name);continue}if(ae==="xlink:href"||ae==="xmlns:xlink"){G(Z,k,ae)||(V(h.removedAttributes,ae),p.removeAttribute(E[X].name));continue}if(ae==="srcdoc"){V(h.removedAttributes,"srcdoc"),p.removeAttribute(E[X].name);continue}if(ae==="style"){p.setAttribute("style",j(Z));continue}if(!(ae.indexOf("data-")===0||ae.indexOf("aria-")===0)){if(D[ae]){G(Z,k,ae)||(V(h.removedAttributes,k+"["+ae+"]"),p.removeAttribute(E[X].name));continue}!o[ae]&&!H[ae]&&(V(h.removedAttributes,ae),p.removeAttribute(E[X].name))}}if(k==="a"&&(p.getAttribute("target")||"").toLowerCase()==="_blank"){var ie=(p.getAttribute("rel")||"").toLowerCase();ie.indexOf("noopener")<0&&p.setAttribute("rel",(ie?ie+" ":"")+"noopener noreferrer")}}}return _}function U(_){for(var h=_.parentNode;_.firstChild;)h.insertBefore(_.firstChild,_);h.removeChild(_)}function V(_,h){_.indexOf(h)<0&&_.push(h)}function R(_){var h=_;N.calls++;for(var F=0;F<3;F++){var H=new DOMParser().parseFromString("<body>"+h+"</body>","text/html");P(H.body,N);var m=H.body.innerHTML;if(N.lastPasses=F+1,m===h)break;h=m}return h}function l(){if(!y){for(var _=["getHTMLCode","getHTMLContent"],h=!1,F=0;F<_.length;F++)(function(H){var m=n[H];if(!(typeof m!="function"||m.__rteSanitized)){var g=function(){var c=m.apply(n,arguments);return typeof c!="string"?c:R(c)};g.__rteSanitized=!0,n[H]=g,h=!0}})(_[F]);h&&(y=!0)}}function s(){for(var _=["setHTMLCode","setHTMLContent"],h=0;h<_.length;h++)(function(F){var H=n[F];if(!(typeof H!="function"||H.__rteSanitizedIn)){var m=function(g){var c=[].slice.call(arguments);return typeof g=="string"&&(c[0]=R(g)),H.apply(n,c)};m.__rteSanitizedIn=!0,n[F]=m}})(_[h])}function b(_){return/\son[a-z]+\s*=/i.test(_)||/<\s*(script|iframe|object|embed|base)\b/i.test(_)||/srcdoc\s*=/i.test(_)||/(javascript|vbscript)\s*:/i.test(_)||/data:\s*text\/html/i.test(_)}var S=/^(script|iframe|object|embed|base|meta|link|form)$/;function v(_){if(!_.attributes)return!1;for(var h=0;h<_.attributes.length;h++){var F=_.attributes[h].name.toLowerCase();if(F.indexOf("on")===0||F==="srcdoc"||(F==="href"||F==="src"||F==="data"||F==="action"||F==="xlink:href")&&/(javascript|vbscript)\s*:|data:\s*text\/html/i.test(_.attributes[h].value||""))return!0}return!1}function w(_){if(S.test(_.localName||"")||v(_))return!0;for(var h=_.getElementsByTagName?_.getElementsByTagName("*"):[],F=0;F<h.length;F++)if(S.test(h[F].localName||"")||v(h[F]))return!0;return!1}function A(){if(u.sanitizerGuardLiveDom!==!1){var _=null;try{_=n.getEditable()}catch{return}if(!(!_||_.__rteLiveGuard)){_.__rteLiveGuard=!0;var h=new MutationObserver(function(F){for(var H=!1,m=0;m<F.length&&!H;m++){var g=F[m];if(g.type==="attributes"){var c=(g.attributeName||"").toLowerCase();(c.indexOf("on")===0||c==="srcdoc"||v(g.target))&&(H=!0);continue}for(var p=0;p<g.addedNodes.length;p++){var k=g.addedNodes[p];if(k.nodeType===1&&w(k)){H=!0;break}}}if(H)try{P(_,N)}catch{}});h.observe(_,{childList:!0,subtree:!0,attributes:!0}),q.push(h)}}}function C(){var _=null;try{_=n.getEditable()}catch{return}if(!_||_.__rteSanitizePaste)return;_.__rteSanitizePaste=!0,_.addEventListener("paste",function(F){var H=F.clipboardData||window.clipboardData;if(H){var m="";try{m=H.getData("text/html")||""}catch{return}if(!(!m||!b(m))){F.preventDefault(),F.stopImmediatePropagation();var g=R(m);try{n.insertHTML(g)}catch{try{n.insertText(H.getData("text/plain")||"")}catch{}}}}},!0);function h(){var F=function(){try{P(_,N)}catch{}};setTimeout(F,0),setTimeout(F,250)}_.addEventListener("paste",h,!1),_.addEventListener("drop",h,!0)}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_slashcommand=RTE_Plugin_SlashCommand;function RTE_Plugin_SlashCommand(){var L=this,u,n,y=null,N=null,q=null,W=[],O=[],o=0,D=!1,z=!1;L.PluginName="SlashCommand",L.InitConfig=function(Le){u=Le,u.slashCommandEnabled!==!1&&(u.slashCommandTrigger=u.slashCommandTrigger||"/",u.slashCommandMaxItems=u.slashCommandMaxItems||40,u.slashCommandIncludeAi=u.slashCommandIncludeAi!==!1,u.slashCommands=u.slashCommands||null)},L.InitEditor=function(Le){if(n=Le,u.slashCommandEnabled!==!1){if(n.slashCommands={register:K,remove:G,list:function(){return W.slice()},open:function(){b(!0)},close:S,isOpen:function(){return!!N}},W=V(),Array.isArray(u.slashCommands))for(var Te=0;Te<u.slashCommands.length;Te++)K(u.slashCommands[Te]);p();var Ye=n.getDocument();Ye.addEventListener("keydown",R,!0),Ye.addEventListener("input",l,!0),Ye.addEventListener("compositionstart",function(){D=!0}),Ye.addEventListener("compositionend",function(){D=!1}),Ye.addEventListener("mousedown",function(){S()},!0),Ye.addEventListener("blur",function(){setTimeout(S,150)},!0),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c,!0)}};function K(Le){if(!(!Le||!Le.id)){var Te=j(Le.id);Te>=0?W[Te]=T(Le):W.push(T(Le))}}function G(Le){var Te=j(Le);Te>=0&&W.splice(Te,1)}function j(Le){for(var Te=0;Te<W.length;Te++)if(W[Te].id===Le)return Te;return-1}function T(Le){return{id:Le.id,section:Le.section||"Blocks",title:Le.title||Le.id,description:Le.description||"",keywords:(Le.keywords||[]).slice(),icon:Le.icon||"",iconSvg:Le.iconSvg||"",run:Le.run||Le.action}}var x={P:1,DIV:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,PRE:1,LI:1};function P(){var Le=n.getSelection();if(!Le||Le.rangeCount===0)return null;for(var Te=Le.getRangeAt(0).startContainer,Ye=n.getEditable();Te&&Te!==Ye;){if(Te.nodeType===1&&x[Te.nodeName])return Te;Te=Te.parentNode}return null}function U(Le){var Te=P();if(Le=Le.toUpperCase(),Te&&!Te.textContent.trim()){var Ye=n.getDocument(),kt=Ye.createElement(Le);kt.appendChild(Ye.createElement("br")),Te.parentNode.replaceChild(kt,Te);var Ft=Ye.createRange();Ft.setStart(kt,0),Ft.setEnd(kt,0);var Ot=n.getSelection();Ot.removeAllRanges(),Ot.addRange(Ft);return}n.execCommand("formatblock",Le)}function V(){var Le=[];function Te(pt,wr,Va,_a,On,Go,lo){Le.push(T({id:wr,section:pt,title:Va,description:_a,keywords:On,iconSvg:Go,run:lo}))}if(Te("Blocks","heading1","Heading 1","Large section heading",["h1","title"],k("1"),function(){U("H1")}),Te("Blocks","heading2","Heading 2","Medium section heading",["h2","subtitle"],k("2"),function(){U("H2")}),Te("Blocks","heading3","Heading 3","Small section heading",["h3"],k("3"),function(){U("H3")}),Te("Blocks","paragraph","Paragraph","Plain body text",["p","text","body"],E(),function(){U("P")}),Te("Blocks","bulletlist","Bulleted list","Unordered list",["ul","bullets","list"],I(),function(){n.execCommand("insertunorderedlist")}),Te("Blocks","numberlist","Numbered list","Ordered list",["ol","numbered"],X(),function(){n.execCommand("insertorderedlist")}),Te("Blocks","quote","Quote","Block quotation",["blockquote"],ae(),function(){n.execCommand("insertblockquote")}),Te("Blocks","code","Code block","Monospaced code block",["pre","snippet"],Z(),function(){n.isCommandEnabled&&n.isCommandEnabled("insertcode")?n.execCommand("insertcode"):n.execCommand("formatblock","PRE")}),Te("Blocks","divider","Divider","Horizontal rule",["hr","line","separator"],ie(),function(){n.execCommand("inserthorizontalrule")}),(!n.isCommandEnabled||n.isCommandEnabled("insertcallout"))&&Te("Blocks","callout","Callout","Highlighted info / warning box",["admonition","info","warning","note","tip"],le(),function(){n.execCommand("insertcallout")}),(!n.isCommandEnabled||n.isCommandEnabled("insertcolumns"))&&Te("Blocks","columns","Columns","Multi-column layout",["layout","grid","column"],se(),function(){n.execCommand("insertcolumns")}),(!n.isCommandEnabled||n.isCommandEnabled("inserttoggle"))&&Te("Blocks","toggle","Toggle list","Collapsible toggle block",["collapse","details","accordion","expand"],de(),function(){n.execCommand("inserttoggle")}),(!n.isCommandEnabled||n.isCommandEnabled("insertmath"))&&Te("Insert","equation","Equation","Insert a math equation (TeX)",["math","latex","tex","formula","katex"],Ae(),function(){n.execCommand("insertmath")}),(!n.isCommandEnabled||n.isCommandEnabled("inserttodolist"))&&Te("Blocks","todolist","To-do list","Checklist with clickable checkboxes",["task","todo","checklist","checkbox","check"],Ke(),function(){n.execCommand("inserttodolist")}),(!n.isCommandEnabled||n.isCommandEnabled("insertdiagram"))&&Te("Insert","diagram","Diagram","Insert a Mermaid diagram",["mermaid","flowchart","sequence","gantt","graph","uml"],Ce(),function(){n.execCommand("insertdiagram")}),(!n.isCommandEnabled||n.isCommandEnabled("insertbookmark"))&&Te("Insert","bookmark","Bookmark","Insert a link preview card",["link","url","embed","preview","card"],be(),function(){n.execCommand("insertbookmark")}),(!n.isCommandEnabled||n.isCommandEnabled("spellcheck"))&&Te("Tools","spellcheck","Spell check","Check spelling",["spelling","grammar","proofread","typo"],ye(),function(){n.execCommand("spellcheck")}),(!n.isCommandEnabled||n.isCommandEnabled("insertdatechip"))&&Te("Insert","datechip","Date chip","Insert an interactive date chip",["date","calendar","chip","today"],fe(),function(){n.execCommand("insertdatechip")}),(!n.isCommandEnabled||n.isCommandEnabled("insertchip"))&&Te("Insert","chip","Smart chip","Insert a date / person / link chip",["chip","person","mention","link","pill"],fe(),function(){n.execCommand("insertchip")}),(!n.isCommandEnabled||n.isCommandEnabled("emailexport"))&&Te("Tools","emailexport","Export email HTML","Inline-styled HTML for email",["email","inline","mail","newsletter","html"],Ee(),function(){n.execCommand("emailexport")}),typeof n.openFindDialog=="function"&&Te("Tools","findreplace","Find & replace","Search the document and replace text",["find","replace","search","query","substitute"],et(),function(){n.openFindDialog()}),typeof n.showShortcuts=="function"&&Te("Tools","shortcuts","Keyboard shortcuts","Show the keyboard shortcut cheat sheet (Ctrl+/)",["keyboard","shortcuts","hotkeys","keys","help","cheat"],Ze(),function(){n.showShortcuts()}),typeof n.foldAtCaret=="function"&&(Te("Tools","foldsection","Fold section","Collapse the section under the current heading",["fold","collapse","heading","outline","section"],at(),function(){n.foldAtCaret()}),Te("Tools","unfoldall","Unfold all","Expand every collapsed heading section",["unfold","expand","headings","collapse"],at(),function(){n.unfoldAll&&n.unfoldAll()})),(!n.isCommandEnabled||n.isCommandEnabled("readaloud"))&&Te("Tools","readaloud","Read aloud","Speak the selection or document (text-to-speech)",["tts","speak","speech","voice","accessibility","narrate"],Pe(),function(){n.execCommand("readaloud")}),typeof n.sortTableAtCaret=="function"&&(Te("Tools","sorttableasc","Sort table by this column","Sort the table rows by the column the caret is in",["sort","table","column","order","ascending"],nt(),function(){n.sortTableAtCaret("asc")}),Te("Tools","sorttabledesc","Sort table (descending)","Sort the table rows by this column, largest first",["sort","table","column","descending","reverse"],nt(),function(){n.sortTableAtCaret("desc")}),Te("Tools","tablerownumbers","Number table rows","Add or remove an automatic row-numbering column",["number","rows","table","count","index"],nt(),function(){n.execCommand("tablerownumbers")})),typeof n.moveBlockUp=="function"&&(Te("Tools","moveblockup","Move block up","Move this paragraph or block above the previous one (Alt+Shift+Up)",["move","block","up","reorder","drag"],Je(),function(){n.moveBlockUp()}),Te("Tools","moveblockdown","Move block down","Move this paragraph or block below the next one (Alt+Shift+Down)",["move","block","down","reorder","drag"],Je(),function(){n.moveBlockDown()})),typeof n.toggleRtlUserInterface=="function"&&Te("Tools","rtlui","Mirror editor for RTL","Flip the toolbar, menus and dialogs for right-to-left languages",["rtl","mirror","interface","toolbar","arabic","hebrew"],We(),function(){n.toggleRtlUserInterface()}),typeof n.setTextDirection=="function"&&(Te("Tools","rtl","Right-to-left","Set this paragraph to right-to-left (Arabic, Hebrew, Persian)",["rtl","arabic","hebrew","persian","urdu","direction","bidi"],We(),function(){n.setTextDirection("rtl")}),Te("Tools","ltr","Left-to-right","Set this paragraph to left-to-right",["ltr","direction","bidi"],Re(),function(){n.setTextDirection("ltr")}),Te("Tools","autodir","Detect text direction","Set each paragraph's direction from its own content",["direction","detect","auto","rtl","bidi"],We(),function(){n.autoDetectTextDirection()})),typeof n.toggleFormattingMarks=="function"&&Te("Tools","formattingmarks","Formatting marks","Show paragraph marks, block outlines and invisible characters",["marks","pilcrow","paragraph","invisible","whitespace","nbsp"],Se(),function(){n.toggleFormattingMarks()}),typeof n.toggleWatermark=="function"&&Te("Tools","watermark","Watermark","Draw DRAFT or CONFIDENTIAL behind the content",["watermark","draft","confidential","background","stamp"],Me(),function(){n.toggleWatermark()}),typeof n.toggleLineNumbers=="function"&&Te("Tools","linenumbers","Line numbers","Number every line in the margin, as pleadings and transcripts require",["line","numbers","margin","pleading","legal","transcript"],Oe(),function(){n.toggleLineNumbers()}),typeof n.togglePermanentPen=="function"&&Te("Tools","permanentpen","Permanent pen","Keep typing in a fixed annotation format until switched off",["pen","marker","annotate","highlight","review"],ft(),function(){n.togglePermanentPen()}),typeof n.checkLinks=="function"&&Te("Tools","checklinks","Check links","Find broken anchors, unsafe schemes and unlabelled links",["link","check","broken","audit","url","accessibility"],Lt(),function(){n.highlightLinkIssues(!0),n.checkLinks()}),typeof n.getMergeFieldDefinitions=="function"){for(var Ye=n.getMergeFieldDefinitions(),kt=0;kt<Ye.length;kt++)(function(pt){!pt||!pt.id||Te("Insert","mergefield-"+pt.id,pt.label||pt.id,"Insert the "+(pt.label||pt.id)+" merge field",["merge","field","placeholder","variable","mail merge",pt.id],_t(),function(){n.insertMergeField(pt.id)})})(Ye[kt]);Te("Tools","mergepreview","Preview merge fields","Swap merge-field placeholders for sample data",["merge","preview","sample","data","placeholder"],_t(),function(){n.toggleMergeFieldPreview()})}if(typeof n.listCrossReferenceTargets=="function"){var Ft=[];try{Ft=n.listCrossReferenceTargets()}catch{Ft=[]}for(var Ot=0;Ot<Ft.length&&Ot<40;Ot++)(function(pt){if(!(!pt||!pt.id)){var wr=pt.number?pt.number+" "+pt.label:pt.label;Te("Insert","xref-"+pt.id,"Reference: "+wr,"Insert a cross-reference to this "+pt.type+" that updates itself",["cross","reference","xref","see","refer",pt.type,pt.number||""],Qt(),function(){n.insertCrossReference(pt.id,pt.number?"label":"text")})}})(Ft[Ot])}if(typeof n.insertTableOfContents=="function"&&Te("Insert","toc","Table of contents","Insert a contents block that updates itself from your headings",["toc","contents","outline","index","headings"],Et(),function(){n.insertTableOfContents()}),typeof n.insertFootnote=="function"&&Te("Insert","footnote","Footnote","Insert a numbered footnote reference and note",["footnote","note","citation","reference","endnote","cite"],Ue(),function(){n.insertFootnote()}),typeof n.toggleFormatPainter=="function"&&Te("Tools","formatpainter","Format painter","Copy formatting here, then select the text to paint it onto",["format","painter","brush","copy","style","clone"],Ge(),function(){n.toggleFormatPainter()}),typeof n.changeCase=="function"&&(Te("Tools","caseupper","UPPERCASE","Convert the selection to upper case",["case","upper","caps","capitals"],qe(),function(){n.changeCase("upper")}),Te("Tools","caselower","lowercase","Convert the selection to lower case",["case","lower","small"],qe(),function(){n.changeCase("lower")}),Te("Tools","casetitle","Title Case","Capitalise each significant word in the selection",["case","title","headline","capitalise","capitalize"],qe(),function(){n.changeCase("title")}),Te("Tools","casesentence","Sentence case","Capitalise the first letter of each sentence",["case","sentence","capitalise","capitalize"],qe(),function(){n.changeCase("sentence")})),typeof n.requestGhostText=="function"&&Te("Tools","aicomplete","AI complete","Suggest an inline AI completion of the current sentence",["ai","complete","autocomplete","ghost","suggest","continue","copilot"],br(),function(){n.requestGhostText()}),typeof n.exportToPdf=="function"&&Te("Tools","exportpdf","Export to PDF","Real text, not a screenshot \u2014 selectable, searchable and screen-reader friendly",["pdf","export","download","save","print","text","accessible","searchable"],St(),function(){n.exportToPdf()}),typeof n.exportToDocx=="function"&&Te("Tools","exportdocx","Export to Word (.docx)","A real OOXML document, built in the browser with no upload",["word","docx","ooxml","export","download","save","office"],Xt(),function(){n.exportToDocx()}),typeof n.copyAsMarkdown=="function"&&(Te("Tools","copymarkdown","Copy as Markdown","Copy the whole document to the clipboard as Markdown",["markdown","md","copy","clipboard","export"],Ct(),function(){n.copyAsMarkdown()}),Te("Tools","downloadmarkdown","Download as Markdown","Save the document as a .md file",["markdown","md","download","export","save","file"],Ct(),function(){n.downloadMarkdown()})),typeof n.toggleTypewriterMode=="function"&&(Te("Tools","typewriter","Typewriter mode","Keep the caret line centred as you type",["typewriter","center","scroll","focus","distraction","zen"],Gt(),function(){n.toggleTypewriterMode()}),Te("Tools","focusmode","Focus mode","Dim everything except the current paragraph",["focus","dim","highlight","distraction","zen","concentrate"],Xe(),function(){n.toggleFocusMode()})),Te("Insert","table","Table","Insert a table",["grid","rows","columns"],ne(),function(){n.execCommand("inserttable")}),Te("Insert","image","Image","Upload or embed an image",["picture","photo","img"],J(),function(){n.execCommand("imageupload")}),Te("Insert","link","Link","Insert a hyperlink",["url","anchor"],re(),function(){n.execCommand("insertlink")}),Te("Insert","emoji","Emoji","Insert an emoji",["smiley","icon"],te(),function(){n.execCommand("insertemoji")}),Te("Insert","template","Template","Insert from template gallery",["snippet"],oe(),function(){n.execCommand("inserttemplate")}),Te("Insert","date","Today's date","Insert the current date",["time","now"],B(),function(){n.execCommand("insertdate")}),u.slashCommandIncludeAi&&Array.isArray(u.aiToolkitActions))for(var Vt=0;Vt<u.aiToolkitActions.length;Vt++)(function(pt){Le.push(T({id:"ai-"+pt.id,section:"AI",title:pt.title||pt.id,description:pt.description||"",keywords:["ai",pt.id],iconSvg:u["svgCode_aiassist_"+(pt.icon||pt.id)]||u.svgCode_aiassist||"",run:function(){var wr=n.aiToolkit;if(wr){if(pt.id==="chat-panel"&&typeof wr.openChatPanel=="function"){wr.openChatPanel();return}if(pt.id==="review-panel"&&typeof wr.openReviewPanel=="function"){wr.openReviewPanel();return}if(pt.id==="open-dialog"&&typeof wr.openDialog=="function"){wr.openDialog();return}if(typeof wr.runQuickAction=="function"){wr.runQuickAction(pt.id);return}typeof wr.resolveAction=="function"&&wr.resolveAction(pt.id)}}}))})(u.aiToolkitActions[Vt]);return Le}function R(Le){if(!D){if(N)switch(Le.key){case"ArrowDown":Le.preventDefault(),Le.stopPropagation(),F(1);return;case"ArrowUp":Le.preventDefault(),Le.stopPropagation(),F(-1);return;case"Enter":case"Tab":if(O.length){Le.preventDefault(),Le.stopPropagation(),H();return}S();return;case"Escape":case"Esc":Le.preventDefault(),Le.stopPropagation(),S();return}if(Le.key===u.slashCommandTrigger&&!Le.ctrlKey&&!Le.metaKey&&!Le.altKey){if(!s())return;z=!1,setTimeout(function(){z||b(!1)},0)}}}function l(){N&&v()}function s(){var Le=n.getSelection();if(!Le||Le.rangeCount===0||!Le.isCollapsed)return!1;for(var Te=Le.getRangeAt(0),Ye=Te.startContainer,kt=Te.startOffset,Ft=n.getEditable(),Ot=Ye.nodeType===1?Ye:Ye.parentNode;Ot&&Ot!==Ft;){var Vt=Ot.nodeName;if(Vt==="CODE"||Vt==="PRE")return!1;Ot=Ot.parentNode}if(Ye.nodeType===3){if(kt===0)return!0;var pt=Ye.nodeValue.charAt(kt-1);return/\s/.test(pt)}return!0}function b(Le){S();var Te=n.getSelection();if(!(!Te||Te.rangeCount===0)){var Ye=Te.getRangeAt(0).cloneRange();q={range:Ye,startNode:Ye.startContainer,startOffset:Ye.startOffset,triggerCharCount:Le?0:1,query:""},A(),g(),w("")}}function S(){N&&N.parentNode&&N.parentNode.removeChild(N),N=null,q=null,O=[],o=0}function v(){if(q){var Le=n.getSelection();if(!Le||Le.rangeCount===0||!Le.isCollapsed){S();return}var Te=Le.getRangeAt(0),Ye=Te.startContainer;if(Ye!==q.startNode){S();return}var kt=Te.startOffset;if(kt<q.startOffset){S();return}var Ft=(Ye.nodeType===3?Ye.nodeValue:"")||"",Ot=Ft.substring(q.startOffset,kt);if(/\s/.test(Ot)){S();return}q.query=Ot,w(Ot),g()}}function w(Le){var Te=(Le||"").toLowerCase();O=W.filter(function(Ye){if(!Te||Ye.title.toLowerCase().indexOf(Te)!==-1||Ye.description&&Ye.description.toLowerCase().indexOf(Te)!==-1)return!0;for(var kt=0;kt<Ye.keywords.length;kt++)if(String(Ye.keywords[kt]).toLowerCase().indexOf(Te)!==-1)return!0;return!1}).slice(0,u.slashCommandMaxItems),o=0,C()}function A(){y=n.iframe.ownerDocument,N=y.createElement("div"),N.className="rte-slash-popup";try{var Le=n.container||n.getEditable&&n.getEditable().closest&&n.getEditable().closest(".richtexteditor");Le&&Le.classList&&Le.classList.contains("rte-dark")&&(N.className+=" rte-slash-popup-dark")}catch{}N.setAttribute("role","listbox"),N.setAttribute("aria-label","Slash commands"),y.body.appendChild(N)}function C(){if(N){if(N.innerHTML="",!O.length){var Le=y.createElement("div");Le.className="rte-slash-empty",Le.textContent="No matching commands",N.appendChild(Le);return}for(var Te="",Ye=0;Ye<O.length;Ye++)(function(kt,Ft){if(kt.section!==Te){var Ot=y.createElement("div");Ot.className="rte-slash-section",Ot.textContent=kt.section,N.appendChild(Ot),Te=kt.section}var Vt=y.createElement("button");Vt.type="button",Vt.className="rte-slash-item"+(Ft===o?" rte-slash-item-active":""),Vt.setAttribute("role","option"),Vt.setAttribute("aria-selected",Ft===o?"true":"false"),Vt.setAttribute("data-index",Ft);var pt=y.createElement("span");pt.className="rte-slash-item-icon",pt.innerHTML=kt.iconSvg||Y(),Vt.appendChild(pt);var wr=y.createElement("span");wr.className="rte-slash-item-body";var Va=y.createElement("span");if(Va.className="rte-slash-item-title",Va.textContent=kt.title,wr.appendChild(Va),kt.description){var _a=y.createElement("span");_a.className="rte-slash-item-desc",_a.textContent=kt.description,wr.appendChild(_a)}Vt.appendChild(wr),Vt.addEventListener("mousedown",function(On){On.preventDefault(),On.stopPropagation(),o=Ft,H()}),Vt.addEventListener("click",function(On){N&&(On.preventDefault(),On.stopPropagation(),o=Ft,H())}),Vt.addEventListener("mouseenter",function(){o!==Ft&&(o=Ft,_())}),N.appendChild(Vt)})(O[Ye],Ye)}}function _(){if(N){for(var Le=N.querySelectorAll(".rte-slash-item"),Te=0;Te<Le.length;Te++){var Ye=+Le[Te].getAttribute("data-index"),kt=Ye===o;Le[Te].classList.toggle("rte-slash-item-active",kt),Le[Te].setAttribute("aria-selected",kt?"true":"false")}h()}}function h(){if(N){var Le=N.querySelector(".rte-slash-item-active");if(Le){var Te=Le.offsetTop,Ye=Te+Le.offsetHeight;Te<N.scrollTop?N.scrollTop=Te:Ye>N.scrollTop+N.clientHeight&&(N.scrollTop=Ye-N.clientHeight)}}}function F(Le){O.length&&(o=(o+Le+O.length)%O.length,_())}function H(){if(!O.length){S();return}var Le=O[o],Te=q;if(S(),!(!Le||!Te)){m(Te);var Ye=n.getDocument();Ye.activeElement!==n.getEditable()&&!Ye.hasFocus()&&n.focus();try{Le.run(n)}catch(kt){console.warn("Slash command failed:",kt)}}}function m(Le){var Te=Le.startNode;if(Te){var Ye=Le.startOffset-(Le.triggerCharCount||0);Ye<0&&(Ye=0);var kt=n.getSelection();if(!(!kt||kt.rangeCount===0)){var Ft=kt.getRangeAt(0),Ot,Vt;Te.nodeType===3&&Ft.startContainer===Te?(Ot=Te,Vt=Ft.startOffset):(Ot=Ft.startContainer,Vt=Ft.startOffset);var pt=n.getDocument().createRange();pt.setStart(Te,Ye),pt.setEnd(Ot,Vt);try{pt.deleteContents()}catch{return}kt.removeAllRanges(),kt.addRange(pt)}}}function g(){if(!(!N||!q)){var Le=n.iframe,Te=Le.getBoundingClientRect(),Ye=q.range.getClientRects(),kt=Ye&&Ye.length?Ye[Ye.length-1]:null;kt||(kt=q.range.getBoundingClientRect());var Ft=Te.left+(kt.left||0)+window.pageXOffset,Ot=Te.top+(kt.bottom||kt.top||0)+window.pageYOffset+4;N.style.position="absolute",N.style.left=Ft+"px",N.style.top=Ot+"px";var Vt=window.innerHeight||document.documentElement.clientHeight,pt=N.getBoundingClientRect();pt.bottom>Vt-8&&Te.top+(kt.top||0)>pt.height+16&&(N.style.top=Te.top+(kt.top||0)+window.pageYOffset-pt.height-4+"px")}}function c(){N&&g()}function p(){var Le=n&&n.iframe&&n.iframe.ownerDocument||document;if(!Le.querySelector("style[data-rte-slashcommand]")){var Te=Le.createElement("style");Te.setAttribute("data-rte-slashcommand","1"),Te.textContent=["/* 2026-07-03 slash command polish */",".rte-slash-popup{position:absolute;z-index:2147483000;min-width:280px;max-width:min(390px,calc(100vw - 24px));max-height:min(360px,64vh);overflow-y:auto;overscroll-behavior:contain;padding:6px;background:linear-gradient(180deg,rgba(255,255,255,.98),rgba(248,251,255,.96));background-clip:padding-box;border:1px solid rgba(148,163,184,.22);box-shadow:0 16px 36px rgba(29,78,216,.14),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-slash-section{position:sticky;top:0;z-index:1;margin:4px 0 2px;padding:6px 8px 4px;background:linear-gradient(180deg,rgba(248,251,255,.98),rgba(248,251,255,.86));color:#52657e;font-size:10px;font-weight:850;letter-spacing:.08em;text-transform:uppercase}",".rte-slash-item{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;width:100%;min-height:40px;padding:6px 8px;border:0;background:transparent;text-align:left;cursor:pointer;color:inherit;font:inherit;border-radius:8px}",".rte-slash-item:hover,.rte-slash-item-active{background:#eef4ff;color:#1559d6}",".rte-slash-item:focus-visible{outline:2px solid rgba(37,99,235,.22);outline-offset:2px}",".rte-slash-item-icon{flex:0 0 28px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;color:#315277;background:#ffffff;border-radius:8px;box-shadow:inset 0 0 0 1px rgba(148,163,184,.18)}",".rte-slash-item-active .rte-slash-item-icon{color:#1559d6;background:#ffffff}",".rte-slash-item-icon svg{display:block;width:16px;height:16px;pointer-events:none}",".rte-slash-item-body{display:flex;flex-direction:column;min-width:0;flex:1}",".rte-slash-item-title{font-weight:780;font-size:13px;line-height:1.24;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-desc{font-size:11px;color:#64748b;line-height:1.24;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}",".rte-slash-item-active .rte-slash-item-desc{color:#315277}",".rte-slash-empty{padding:16px;color:#52657e;font-size:12px;font-weight:700;text-align:center}",".rte-slash-popup-dark{background:linear-gradient(180deg,#1e293b,#0f172a);border-color:#334155;color:#e2e8f0;box-shadow:0 20px 46px rgba(0,0,0,.5),0 2px 8px rgba(0,0,0,.4)}",".rte-slash-popup-dark .rte-slash-section{background:linear-gradient(180deg,rgba(30,41,59,.98),rgba(30,41,59,.86));color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item:hover,.rte-slash-popup-dark .rte-slash-item-active{background:#1d4ed8;color:#fff}",".rte-slash-popup-dark .rte-slash-item-icon{color:#cbd5e1;background:#0f172a;box-shadow:inset 0 0 0 1px rgba(148,163,184,.25)}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-icon{color:#fff;background:#1e3a8a}",".rte-slash-popup-dark .rte-slash-item-desc{color:#94a3b8}",".rte-slash-popup-dark .rte-slash-item-active .rte-slash-item-desc{color:#dbeafe}",".rte-slash-popup-dark .rte-slash-empty{color:#94a3b8}"].join(`
71
71
  `),Le.head.appendChild(Te)}}function k(Le){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4v16"/><path d="M14 4v16"/><path d="M6 12h8"/><text x="16" y="18" font-size="9" font-weight="700" fill="currentColor" stroke="none" font-family="-apple-system,Segoe UI,sans-serif">'+Le+"</text></svg>"}function E(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4h5"/><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4a4 4 0 000 8h0"/></svg>'}function I(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="5" cy="7" r="1"/><circle cx="5" cy="12" r="1"/><circle cx="5" cy="17" r="1"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function X(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v3"/><path d="M4 9h2"/><path d="M4 14h2a1 1 0 010 2H4v1h2"/><path d="M9 7h11"/><path d="M9 12h11"/><path d="M9 17h11"/></svg>'}function ae(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/><path d="M16 8c-2 0-3 1.5-3 4s1 4 3 4V8z"/></svg>'}function Z(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 8l-4 4 4 4"/><path d="M15 8l4 4-4 4"/></svg>'}function ie(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 12h16"/><path d="M4 6h10"/><path d="M4 18h10"/></svg>'}function ne(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="5" width="16" height="14" rx="1"/><path d="M4 10h16"/><path d="M4 15h16"/><path d="M10 5v14"/><path d="M16 5v14"/></svg>'}function J(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><circle cx="9" cy="10" r="1.5"/><path d="M21 16l-5-5-8 8"/></svg>'}function re(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 14a4 4 0 005.7 0l3-3a4 4 0 10-5.7-5.7L11 7"/><path d="M14 10a4 4 0 00-5.7 0l-3 3a4 4 0 105.7 5.7L13 17"/></svg>'}function te(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M8 14c1 1.5 2.5 2 4 2s3-.5 4-2"/><circle cx="9" cy="10" r=".8"/><circle cx="15" cy="10" r=".8"/></svg>'}function oe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="4" width="16" height="16" rx="2"/><path d="M4 9h16"/><path d="M9 9v11"/></svg>'}function B(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="6" width="16" height="14" rx="1.5"/><path d="M4 10h16"/><path d="M9 3v4"/><path d="M15 3v4"/></svg>'}function Y(){return'<svg viewBox="0 0 24 24" fill="currentColor"><circle cx="12" cy="12" r="3"/></svg>'}function le(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M12 9v4"/><path d="M12 16h.01"/></svg>'}function se(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="16" rx="1"/><rect x="14" y="4" width="7" height="16" rx="1"/></svg>'}function de(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l6 6-6 6"/></svg>'}function Ae(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 5h9l-5 14"/><path d="M14 11h6"/><path d="M14 16h6"/></svg>'}function be(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M3 10h18"/><circle cx="7" cy="7.5" r=".6" fill="currentColor"/></svg>'}function ye(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 17l4-10 4 10"/><path d="M5.5 13.5h5"/><path d="M14 14a2.5 2.5 0 105 0v-3"/><path d="M14 20l2 2 4-4"/></svg>'}function fe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="7" width="18" height="10" rx="5"/><circle cx="8" cy="12" r="1.6"/><path d="M12 12h6"/></svg>'}function Ee(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="5" width="18" height="14" rx="2"/><path d="M4 7l8 6 8-6"/></svg>'}function Ce(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="6" height="5" rx="1"/><rect x="15" y="3" width="6" height="5" rx="1"/><rect x="9" y="16" width="6" height="5" rx="1"/><path d="M6 8v3h12V8M12 11v5"/></svg>'}function Pe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 9v6h4l5 4V5L8 9H4z"/><path d="M16 8.5a4 4 0 010 7"/><path d="M19 6a7 7 0 010 12"/></svg>'}function Je(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v18"/><path d="M8 7l4-4 4 4"/><path d="M8 17l4 4 4-4"/></svg>'}function We(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6H10a3 3 0 000 6h3"/><path d="M13 6v12"/><path d="M17 6v12"/><path d="M7 18l-3-3 3-3"/></svg>'}function Re(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 6H7a3 3 0 000 6h3"/><path d="M11 6v12"/><path d="M7 6v12"/><path d="M17 12l3 3-3 3"/></svg>'}function Se(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 4v16"/><path d="M17 4v16"/><path d="M13 4H9a4 4 0 000 8h4"/></svg>'}function Me(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M7 15l4-5 3 3 3-4"/></svg>'}function Oe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h1v4"/><path d="M4 14h2l-2 3h2"/><path d="M10 7h10"/><path d="M10 12h10"/><path d="M10 17h10"/></svg>'}function nt(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M7 4v16"/><path d="M4 8l3-4 3 4"/><path d="M14 6h6"/><path d="M14 12h5"/><path d="M14 18h3"/></svg>'}function ft(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 3l6 6L9 21H3v-6z"/><path d="M13 5l6 6"/></svg>'}function Lt(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 13a4 4 0 005.7 0l2-2a4 4 0 10-5.7-5.7l-1 1"/><path d="M13 11a4 4 0 00-5.7 0l-2 2a4 4 0 105.7 5.7l1-1"/><path d="M16 18l2 2 4-4"/></svg>'}function _t(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 4H7a2 2 0 00-2 2v3a2 2 0 01-2 2 2 2 0 012 2v3a2 2 0 002 2h2"/><path d="M15 4h2a2 2 0 012 2v3a2 2 0 002 2 2 2 0 00-2 2v3a2 2 0 01-2 2h-2"/></svg>'}function Qt(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h8"/><path d="M4 12h5"/><path d="M4 17h8"/><path d="M14 12h6"/><path d="M17 9l3 3-3 3"/></svg>'}function Et(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h7"/><path d="M4 11h9"/><path d="M4 16h5"/><path d="M17 6h3"/><path d="M17 11h3"/><path d="M17 16h3"/></svg>'}function Ue(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 6h9"/><path d="M4 11h9"/><path d="M4 18h16"/><path d="M17 4v6"/><path d="M20 7h-6"/></svg>'}function Ge(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 3h11a2 2 0 012 2v4a2 2 0 01-2 2H6z"/><path d="M12 11v3"/><path d="M10 14h4v5a2 2 0 01-4 0z"/></svg>'}function qe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 18L8 6l5 12"/><path d="M4.6 14.5h6.8"/><path d="M21 11.5a3 3 0 00-6 0"/><path d="M21 11.5V18"/><path d="M21 15.5a3 3 0 11-6 0 3 3 0 016 0z"/></svg>'}function Ke(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="7" height="7" rx="1.5"/><path d="M4.5 7.5 6 9l2.5-3"/><line x1="13" y1="6" x2="21" y2="6"/><line x1="13" y1="13" x2="21" y2="13"/><line x1="3" y1="17" x2="21" y2="17"/><line x1="3" y1="20.5" x2="14" y2="20.5"/></svg>'}function at(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 6l3 3 3-3"/><path d="M9 18l3-3 3 3"/><line x1="4" y1="12" x2="20" y2="12"/></svg>'}function Ze(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M6 14h.01M18 14h.01M9 14h6"/></svg>'}function et(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="10.5" cy="10.5" r="6.5"/><line x1="15.5" y1="15.5" x2="21" y2="21"/></svg>'}function Gt(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="9" width="18" height="7" rx="1"/><path d="M7 9V5h10v4"/><line x1="7" y1="20" x2="17" y2="20"/></svg>'}function Xe(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M3 12h3M18 12h3M12 3v3M12 18v3"/></svg>'}function Ct(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="2" y="5" width="20" height="14" rx="2"/><path d="M6 15V9l3 3 3-3v6"/><path d="M17 9v6M14.5 12.5L17 15l2.5-2.5"/></svg>'}function br(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 21V9a7 7 0 0114 0v12l-3-2-2 2-2-2-2 2-3-2z"/><circle cx="9.5" cy="10" r="1" fill="currentColor"/><circle cx="14.5" cy="10" r="1" fill="currentColor"/></svg>'}function St(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M9 13h6M9 17h4"/></svg>'}function Xt(){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 00-2 2v14a2 2 0 002 2h10a2 2 0 002-2V8z"/><path d="M14 3v5h5"/><path d="M8.5 12l1.3 5 2.2-3.6 2.2 3.6 1.3-5"/></svg>'}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_smartchips=RTE_Plugin_SmartChips,RTE_DefaultConfig.chipResolver=RTE_DefaultConfig.chipResolver||null,RTE_DefaultConfig.chipDateFormat=RTE_DefaultConfig.chipDateFormat||null;function RTE_Plugin_SmartChips(){var L=this,u,n;L.PluginName="SmartChips",L.InitConfig=function(G){u=G},L.InitEditor=function(G){n=G,n.attachEvent("exec_command_insertdatechip",function(j){j.returnValue=!0,L.OpenDateChip()}),n.attachEvent("exec_command_insertchip",function(j){j.returnValue=!0,L.OpenChipMenu()}),K()};function y(G,j,T,x){var P=G.ownerDocument.createElement(j);return T&&(P.style.cssText=T),x&&(P.className=x),G.appendChild(P),P}function N(G){return String(G??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var q=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function W(G){if(u.chipDateFormat&&typeof u.chipDateFormat=="function")try{return String(u.chipDateFormat(G))}catch{}return q[G.getMonth()]+" "+G.getDate()+", "+G.getFullYear()}function O(G){function j(T){return(T<10?"0":"")+T}return G.getFullYear()+"-"+j(G.getMonth()+1)+"-"+j(G.getDate())}var o={date:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><rect x="2" y="3" width="12" height="11" rx="1.5"/><path d="M2 6.5h12"/><path d="M5 1.5v3"/><path d="M11 1.5v3"/></svg>',person:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><circle cx="8" cy="5" r="2.6"/><path d="M3 13.5c0-2.5 2.2-4 5-4s5 1.5 5 4"/></svg>',link:'<svg viewBox="0 0 16 16" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.6"><path d="M6.5 9.5a3 3 0 004.2 0l2-2a3 3 0 10-4.2-4.2L7.4 4.3"/><path d="M9.5 6.5a3 3 0 00-4.2 0l-2 2a3 3 0 104.2 4.2l1-1"/></svg>'};function D(G,j,T,x){var P=o[G]||"",U='class="rte-chip rte-chip-'+N(G)+'" data-rte-chip="'+N(G)+'" data-rte-chip-value="'+N(T||j)+'" contenteditable="false"',V='<span class="rte-chip-icon">'+P+'</span><span class="rte-chip-label">'+N(j)+"</span>";if(G==="link"&&x){var R=/^(javascript|data|vbscript):/i.test(x)?"#":x;return"<a "+U+' href="'+N(R)+'" target="_blank" rel="noopener noreferrer">'+V+"</a>"}return"<span "+U+">"+V+"</span>"}function z(G,j,T,x){K(),n.insertHTML(D(G,j,T,x)+"\u200B"),n.focus()}L.OpenDateChip=function(){var G=n.createDialog(n.getLangText&&n.getLangText("insertdatechiptitle")||"Date","rte-dialog-datechip"),j=typeof G.close=="function"?function(){G.close()}:function(){n.closeCurrentPopup()},T=y(G,"div","","rte-chip-dialog rte-chip-date-dialog");y(T,"div","","rte-chip-dialog-copy").textContent="Choose a quick date or insert a custom date chip.";function x(s,b){var S=y(T,"button","","rte-chip-quick");return S.type="button",S.textContent=s+" \u2014 "+W(b),S.onmouseover=function(){S.style.background="#eef2ff"},S.onmouseout=function(){S.style.background="transparent"},S.textContent="",y(S,"span","","rte-chip-quick-label").textContent=s,y(S,"span","","rte-chip-quick-value").textContent=W(b),S.onmouseover=null,S.onmouseout=null,S.setAttribute("aria-label","Insert "+s+", "+W(b)),S.onclick=function(){j(),z("date",W(b),O(b))},S}var P=new Date(n.__chipNow||Date.now());function U(s,b){var S=new Date(s.getTime());return S.setDate(S.getDate()+b),S}x("Today",P),x("Tomorrow",U(P,1)),x("Yesterday",U(P,-1)),x("Next week",U(P,7));var V=y(T,"div","","rte-chip-pick-row"),R=y(V,"input","","rte-chip-input");R.type="date",R.value=O(P),R.setAttribute("aria-label","Custom date");var l=y(V,"button","","rte-chip-action rte-chip-action-primary");l.type="button",l.textContent="Insert",l.onclick=function(){var s=(R.value||"").split("-");if(s.length===3){var b=new Date(parseInt(s[0],10),parseInt(s[1],10)-1,parseInt(s[2],10));j(),z("date",W(b),R.value)}else j()},setTimeout(function(){R.focus()},0)},L.OpenChipMenu=function(){var G=n.createDialog(n.getLangText&&n.getLangText("insertchiptitle")||"Insert chip","rte-dialog-chip"),j=typeof G.close=="function"?function(){G.close()}:function(){n.closeCurrentPopup()},T=y(G,"div","","rte-chip-dialog rte-chip-menu-dialog");y(T,"div","","rte-chip-dialog-copy").textContent="Insert a date, person, or link chip into the document.";var x=y(T,"div","","rte-chip-type-tabs");x.setAttribute("role","tablist"),x.setAttribute("aria-label","Chip type");var P=[["date","Date"],["person","Person"],["link","Link"]],U="date",V=y(T,"div","","rte-chip-dialog-body"),R={};P.forEach(function(S){var v=y(x,"button","","rte-chip-type-tab");v.type="button",v.textContent=S[1],v.setAttribute("role","tab"),v.setAttribute("aria-selected",S[0]===U?"true":"false"),R[S[0]]=v,v.onclick=function(){U=S[0],l(),s()}});function l(){P.forEach(function(S){var v=S[0]===U;R[S[0]].classList.toggle("is-selected",v),R[S[0]].setAttribute("aria-selected",v?"true":"false")})}function s(){if(V.innerHTML="",U==="date"){var S=y(V,"div","","rte-chip-field-label");S.textContent="Insert a date chip:";var v=y(V,"input","","rte-chip-input");v.type="date",v.value=O(new Date(n.__chipNow||Date.now())),v.setAttribute("aria-label","Date chip value"),b(function(){var _=(v.value||"").split("-");if(_.length===3){var h=new Date(+_[0],+_[1]-1,+_[2]);j(),z("date",W(h),v.value)}})}else{var w=y(V,"div","","rte-chip-field-label");w.textContent=U==="person"?"Name (or search):":"URL:";var A=y(V,"input","","rte-chip-input");A.type=U==="link"?"url":"text",A.placeholder=U==="person"?"Jane Doe":"https://example.com",A.setAttribute("aria-label",U==="person"?"Person chip name":"Link chip URL");var C=y(V,"div","","rte-chip-results");C.setAttribute("role","listbox"),C.setAttribute("aria-label","Chip suggestions"),u.chipResolver&&typeof u.chipResolver=="function"&&(A.oninput=function(){var _=A.value.trim();if(C.innerHTML="",!!_)try{var h=u.chipResolver(_,U);h&&h.then&&h.then(function(F){C.innerHTML="",(F||[]).slice(0,6).forEach(function(H){var m=y(C,"button","","rte-chip-suggestion");m.type="button",m.textContent=H.label||H.value,m.setAttribute("role","option"),m.onclick=function(){j(),z(U,H.label||H.value,H.value||H.label,H.href)}})})}catch{}}),b(function(){var _=A.value.trim();if(!_){j();return}if(U==="link"){if(/^(javascript|data|vbscript|file):/i.test(_)){A.style.borderColor="#dc2626",A.placeholder="Enter a valid http(s) URL",A.value="";return}if(!/^https?:\/\//i.test(_))if(/^[a-z0-9.-]+\.[a-z]{2,}([\/?#].*)?$/i.test(_))_="https://"+_;else{A.style.borderColor="#dc2626",A.placeholder="Enter a valid http(s) URL",A.value="";return}j(),z("link",_.replace(/^https?:\/\//i,"").replace(/\/$/,""),_,_)}else j(),z("person",_,_)}),setTimeout(function(){A.focus()},0)}}function b(S){var v=y(V,"div","","rte-chip-dialog-footer"),w=y(v,"button","","rte-chip-action rte-chip-action-primary");w.type="button",w.textContent="Insert",w.onclick=S}l(),s()};function K(){var G=[".rte-chip{display:inline-flex;align-items:center;gap:4px;padding:2px 8px 2px 6px;margin:0 1px;border:1px solid rgba(100,116,139,.16);border-radius:999px;background:linear-gradient(180deg,#f8fbff,#eef4ff);color:#315277;font-size:.92em;line-height:1.45;white-space:nowrap;text-decoration:none;vertical-align:baseline;cursor:default;user-select:none;box-shadow:0 1px 2px rgba(15,23,42,.06)}",".rte-chip-icon{display:inline-flex;align-items:center;opacity:.9}",".rte-chip-date{background:linear-gradient(180deg,#f0fdff,#e6f8fb);color:#0e7490;border-color:rgba(14,116,144,.18)}",".rte-chip-person{background:linear-gradient(180deg,#f6f7ff,#eef2ff);color:#3730a3;border-color:rgba(55,48,163,.18)}",".rte-chip-link{background:linear-gradient(180deg,#f5fff8,#ecfdf4);color:#15803d;border-color:rgba(21,128,61,.18);cursor:pointer}",".rte-chip-link:hover{text-decoration:underline}"].join(`
72
72
  `);try{var j=n.getDocument();if(!j)return;var T=j.head||j.getElementsByTagName&&j.getElementsByTagName("head")[0]||j.documentElement;if(T&&!j.querySelector("style[data-rte-smartchips]")){var x=j.createElement("style");x.setAttribute("data-rte-smartchips","1"),x.textContent=G,T.appendChild(x)}}catch{}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_spellcheck=RTE_Plugin_SpellCheck,RTE_DefaultConfig.spellCheckResolver=RTE_DefaultConfig.spellCheckResolver||null,typeof RTE_DefaultConfig.spellCheckEnabled>"u"&&(RTE_DefaultConfig.spellCheckEnabled=!0);function RTE_Plugin_SpellCheck(){var L=this,u,n;L.PluginName="SpellCheck",L.InitConfig=function(o){u=o},L.InitEditor=function(o){n=o;try{var D=n.getEditable&&n.getEditable();D&&D.setAttribute("spellcheck",u.spellCheckEnabled===!1?"false":"true")}catch{}n.attachEvent("exec_command_spellcheck",function(z){z.returnValue=!0,L.RunSpellCheck()}),O()};function y(o,D,z,K){var G=o.ownerDocument.createElement(D);return z&&(G.style.cssText=z),K&&(G.className=K),o.appendChild(G),G}function N(o){return String(o??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function q(o){try{!n.InvokeEventHook||n.InvokeEventHook("customdialog","spellcheck",o)}catch{}try{var D=n.getEditable(),z=D.ownerDocument,K=z.createElement("div");K.className="rte-spell-toast",K.setAttribute("role","status"),K.setAttribute("aria-live","polite"),K.textContent=o,z.body.appendChild(K),setTimeout(function(){K.parentNode&&K.parentNode.removeChild(K)},2600)}catch{}}function W(o,D){try{for(var z=n.getEditable(),K=n.getDocument(),G=K.createTreeWalker(z,NodeFilter.SHOW_TEXT,null),j,T=new RegExp("\\b"+o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b");j=G.nextNode();){var x=j.parentNode;if(!(x&&(x.nodeName==="CODE"||x.nodeName==="PRE"))){var P=j.data.search(T);if(P>=0)return j.data=j.data.substring(0,P)+D+j.data.substring(P+o.length),!0}}}catch{}return!1}L.RunSpellCheck=function(){if(!u.spellCheckResolver||typeof u.spellCheckResolver!="function"){try{var o=n.getEditable();o.setAttribute("spellcheck","true"),o.focus()}catch{}q(n.getLangText&&n.getLangText("spellchecknative")||"Browser spell-check is on \u2014 misspellings are underlined as you type.");return}var D;try{D=n.getEditable().innerText||""}catch{D=""}if(!D.trim()){q("Nothing to check.");return}var z=n.createDialog(n.getLangText&&n.getLangText("spellchecktitle")||"Spelling","rte-dialog-spell"),K=typeof z.close=="function"?function(){z.close()}:function(){n.closeCurrentPopup()},G=y(z,"div","box-sizing:border-box;width:min(420px,calc(100vw - 32px));max-height:60vh;overflow:auto;padding:14px;font:13px -apple-system,Segoe UI,sans-serif"),j=y(G,"div","color:#64748b;margin-bottom:8px");j.innerText="Checking\u2026";var T=y(G,"div","");function x(s){if(T.innerHTML="",!s||!s.length){j.innerText=n.getLangText&&n.getLangText("spellcheckclean")||"No spelling issues found.";return}j.innerText=s.length+" issue"+(s.length===1?"":"s")+" found.",s.forEach(function(b){if(!(!b||!b.word)){var S=y(T,"div","padding:8px 0;border-bottom:1px solid rgba(15,23,42,.08)","rte-spell-row"),v=y(S,"div","font-weight:600;color:#b91c1c;margin-bottom:4px");v.textContent=b.word;var w=y(S,"div","display:flex;flex-wrap:wrap;gap:6px"),A=(b.suggestions||[]).slice(0,6);A.length||(y(w,"span","font-size:12px;color:#94a3b8").textContent="(no suggestions)"),A.forEach(function(C){var _=y(w,"button","font-size:12px;padding:4px 9px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fbff;color:#315277;cursor:pointer");_.type="button",_.textContent=C,_.onclick=function(){W(b.word,C)&&(S.style.opacity="0.45",v.innerHTML=N(b.word)+' &rarr; <span style="color:#16a34a">'+N(C)+"</span>",w.innerHTML="")}})}})}var P=!1;function U(s){P||(P=!0,x(s))}try{var V=u.spellCheckResolver(D);V&&typeof V.then=="function"?(V.then(function(s){U(s||[])},function(){j.innerText="Spell-check service error."}),setTimeout(function(){P||(j.innerText="Spell-check timed out.",P=!0)},12e3)):U(V||[])}catch{j.innerText="Spell-check error."}var R=y(G,"div","display:flex;justify-content:flex-end;margin-top:12px"),l=y(R,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");l.type="button",l.textContent="Done",l.onclick=function(){K(),n.focus()}};function O(){var o=["/* 2026-07-12 spell-check feedback precision */",".rte-spell-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);max-width:calc(100vw - 32px);padding:9px 12px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#172033;font:600 13px/1.35 -apple-system,Segoe UI,sans-serif;z-index:2147483600;box-shadow:0 10px 24px rgba(15,23,42,.14)}",".rte-spell-row:last-child{border-bottom:0}"].join(`
73
73
  `);try{var D=n&&n.iframe&&n.iframe.ownerDocument||document;if(!D.querySelector("style[data-rte-spellcheck]")){var z=D.createElement("style");z.setAttribute("data-rte-spellcheck","1"),z.textContent=o,(D.head||D.documentElement).appendChild(z)}}catch{}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_tableofcontents=RTE_Plugin_TableOfContents,typeof RTE_DefaultConfig.tocTitle>"u"&&(RTE_DefaultConfig.tocTitle="Contents"),typeof RTE_DefaultConfig.tocMinLevel>"u"&&(RTE_DefaultConfig.tocMinLevel=1),typeof RTE_DefaultConfig.tocMaxLevel>"u"&&(RTE_DefaultConfig.tocMaxLevel=3),typeof RTE_DefaultConfig.tocPageNumbers>"u"&&(RTE_DefaultConfig.tocPageNumbers="auto");function RTE_Plugin_TableOfContents(){var L=this,u,n,y=null,N=!1,q=0;L.PluginName="TableOfContents",L.InitConfig=function(s){u=s},L.InitEditor=function(s){n=s,n.attachEvent("exec_command_inserttoc",function(b){b.returnValue=!0,L.Insert()}),W();try{n.attachEvent("ready",W)}catch{}try{n.attachEvent("aftersethtml",function(){W(),D()})}catch{}setTimeout(function(){W(),D()},0),n.insertTableOfContents=function(){return L.Insert()},n.updateTableOfContents=function(){return U()},n.removeTableOfContents=function(){return L.Remove()},n.hasTableOfContents=function(){return!!G()},n.getTableOfContents=function(){return L.List()},n.getTocCss=function(){return R()}};function W(){var s=O();if(s&&(l(s),s!==y)){y=s;var b=o();b&&(b.addEventListener("keyup",D),b.addEventListener("cut",D),b.addEventListener("paste",D),b.addEventListener("drop",D),b.addEventListener("click",function(S){var v=z(S.target,"rte-toc-link",b);if(v){S.preventDefault();var w=b.querySelector("#"+K(v.getAttribute("data-toc-target")));if(w)try{w.scrollIntoView({block:"center"})}catch{w.scrollIntoView()}}}))}}function O(){try{return n.getDocument()}catch{return null}}function o(){try{return n.getEditable()}catch{return null}}function D(){N||(N=!0,setTimeout(function(){N=!1,U()},0))}function z(s,b,S){for(;s&&s!==S;){if(s.nodeType===1&&s.classList&&s.classList.contains(b))return s;s=s.parentNode}return null}function K(s){return String(s||"").replace(/["\\\]\[]/g,"\\$&")}function G(){var s=o();return s?s.querySelector("nav.rte-toc"):null}function j(){var s=Math.max(1,Math.min(6,parseInt(u.tocMinLevel,10)||1)),b=Math.max(s,Math.min(6,parseInt(u.tocMaxLevel,10)||3));return{min:s,max:b}}function T(){var s=o();if(!s)return[];for(var b=j(),S=[],v=b.min;v<=b.max;v++)S.push("h"+v);for(var w=s.querySelectorAll(S.join(",")),A=[],C=0;C<w.length;C++){var _=w[C];_.closest&&(_.closest("nav.rte-toc")||_.closest("section.rte-footnotes"))||(_.textContent||"").trim()&&A.push(_)}return A}function x(s){var b=s.getAttribute("id");return b&&b.indexOf("rte-h-")===0||b||(b="rte-h-"+Math.floor(Math.random()*1e9).toString(36)+(q++).toString(36),s.setAttribute("id",b)),b}function P(){var s=u.tocPageNumbers;if(s===!1||typeof n.getPageOfElement!="function")return!1;if(s===!0)return!0;try{return typeof n.isPageView=="function"&&n.isPageView()}catch{return!1}}L.Insert=function(){var s=O(),b=o();if(!s||!b)return!1;var S=G();if(S)return U(),!0;var v=s.createElement("nav");v.className="rte-toc",v.setAttribute("contenteditable","false"),v.setAttribute("data-rte-toc","1");var w=!1;try{typeof n.insertElement=="function"&&(n.insertElement(v),w=!0)}catch{}return w||b.insertBefore(v,b.firstChild),U(),V(),!0},L.Remove=function(){var s=G();return!s||!s.parentNode?!1:(s.parentNode.removeChild(s),V(),!0)};function U(){var s=G();if(!s)return[];var b=O();if(!b)return[];for(var S=T(),v=j(),w=P(),A={},C=s.querySelectorAll("li.rte-toc-item"),_=0;_<C.length;_++){var h=C[_].querySelector("a.rte-toc-link"),F=C[_].querySelector(".rte-toc-page");if(h&&F){var H=parseInt(F.textContent,10);H&&(A[h.getAttribute("data-toc-target")]=H)}}for(;s.firstChild;)s.removeChild(s.firstChild);var m=String(u.tocTitle==null?"":u.tocTitle);if(m){var g=b.createElement("div");g.className="rte-toc-title",g.textContent=m,s.appendChild(g)}if(!S.length){var c=b.createElement("div");return c.className="rte-toc-empty",c.textContent="No headings yet.",s.appendChild(c),[]}var p=b.createElement("ol");p.className="rte-toc-list";for(var k=[],E=0;E<S.length;E++){var I=S[E],X=parseInt(I.nodeName.substring(1),10)||1,ae=x(I),Z=(I.textContent||"").trim(),ie=b.createElement("li");ie.className="rte-toc-item rte-toc-l"+(X-v.min+1);var ne=b.createElement("a");ne.className="rte-toc-link",ne.setAttribute("href","#"+ae),ne.setAttribute("data-toc-target",ae),ne.textContent=Z,ie.appendChild(ne);var J=null;if(w)try{J=n.getPageOfElement(I)}catch{J=null}if(!J&&A[ae]&&(J=A[ae]),J){var re=b.createElement("span");re.className="rte-toc-page",re.textContent=String(J),ie.appendChild(re)}p.appendChild(ie),k.push({id:ae,level:X,text:Z,page:J})}return s.appendChild(p),k}L.List=function(){var s=G();if(!s)return[];for(var b=s.querySelectorAll("li.rte-toc-item"),S=[],v=0;v<b.length;v++){var w=b[v].querySelector("a.rte-toc-link"),A=b[v].querySelector(".rte-toc-page"),C=b[v].className.match(/rte-toc-l(\d+)/);S.push({id:w?w.getAttribute("data-toc-target"):null,level:C?parseInt(C[1],10):1,text:w?w.textContent:"",page:A?parseInt(A.textContent,10):null})}return S};function V(){try{typeof n.updateDesign=="function"&&n.updateDesign()}catch{}try{typeof n.fireChange=="function"&&n.fireChange()}catch{}}function R(){return"nav.rte-toc{margin:0 0 1.4em;padding:.9em 1.1em;border:1px solid #ddd;border-radius:6px;background:#fafbfc;}nav.rte-toc .rte-toc-title{font-weight:700;margin-bottom:.45em;}nav.rte-toc .rte-toc-empty{color:#888;font-style:italic;}ol.rte-toc-list{list-style:none;margin:0;padding:0;counter-reset:rte-toc;}ol.rte-toc-list>li{counter-increment:rte-toc;margin:.16em 0;display:flex;align-items:baseline;gap:.5em;}ol.rte-toc-list>li>a{color:#1474ea;text-decoration:none;cursor:pointer;}ol.rte-toc-list>li>a:hover{text-decoration:underline;}ol.rte-toc-list>li:has(>.rte-toc-page)>a::after{content:'';flex:1 1 auto;margin:0 .4em;border-bottom:1px dotted #bbb;transform:translateY(-.25em);display:inline-block;min-width:1.5em;}ol.rte-toc-list>li>a{flex:1 1 auto;display:flex;align-items:baseline;}.rte-toc-page{flex:0 0 auto;color:#666;font-variant-numeric:tabular-nums;}.rte-toc-l2{padding-left:1.3em;}.rte-toc-l3{padding-left:2.6em;}.rte-toc-l4{padding-left:3.9em;}.rte-toc-l5{padding-left:5.2em;}.rte-toc-l6{padding-left:6.5em;}"}function l(s){if(s){var b=s.getElementById("rte-toc-styles"),S=R();if(b){if(b.getAttribute("data-css")===S)return;b.parentNode&&b.parentNode.removeChild(b)}var v=s.createElement("style");v.id="rte-toc-styles",v.setAttribute("data-css",S),v.appendChild(s.createTextNode(S)),(s.head||s.getElementsByTagName("head")[0]||s.documentElement).appendChild(v)}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_tabletools=RTE_Plugin_TableTools,typeof RTE_DefaultConfig.tableNumberSeries>"u"&&(RTE_DefaultConfig.tableNumberSeries="numeric"),typeof RTE_DefaultConfig.tableNumberHeader>"u"&&(RTE_DefaultConfig.tableNumberHeader="#");function RTE_Plugin_TableTools(){var L=this,u,n;L.PluginName="TableTools",L.InitConfig=function(R){u=R},L.InitEditor=function(R){n=R,n.attachEvent("exec_command_sorttable",function(l){l.returnValue=!0,L.SortAtCaret(l&&l.value==="desc"?"desc":"asc")}),n.attachEvent("exec_command_tablerownumbers",function(l){l.returnValue=!0,L.ToggleRowNumbers()}),n.sortTableByColumn=function(l,s){return L.Sort(N(),l,s)},n.sortTableAtCaret=function(l){return L.SortAtCaret(l)},n.canSortTable=function(){return o(N())},n.addTableRowNumbers=function(l){return L.AddRowNumbers(l)},n.removeTableRowNumbers=function(){return L.RemoveRowNumbers()},n.hasTableRowNumbers=function(){var l=N();return!!(l&&l.querySelector("[data-rte-rownum]"))}};function y(){try{return n.getEditable()}catch{return null}}function N(){try{var R=n.getSelection();if(!R||R.rangeCount===0)return null;var l=R.getRangeAt(0).startContainer;l&&l.nodeType===3&&(l=l.parentNode);for(var s=y();l&&l!==s;){if(l.nodeName==="TABLE")return l;l=l.parentNode}return null}catch{return null}}function q(){try{var R=n.getSelection();if(!R||R.rangeCount===0)return null;var l=R.getRangeAt(0).startContainer;l&&l.nodeType===3&&(l=l.parentNode);for(var s=y();l&&l!==s;){if(l.nodeName==="TD"||l.nodeName==="TH")return l;l=l.parentNode}return null}catch{return null}}function W(R){if(!R)return[];for(var l=Array.prototype.slice.call(R.rows||[]),s=[],b=0;b<l.length;b++){var S=l[b],v=S.parentNode?S.parentNode.nodeName:"";v==="THEAD"||v==="TFOOT"||s.length===0&&b===0&&S.cells.length&&O(S)||s.push(S)}return s}function O(R){for(var l=0;l<R.cells.length;l++)if(R.cells[l].nodeName!=="TH")return!1;return!0}function o(R){if(!R)return{ok:!1,reason:"The caret is not inside a table."};var l=W(R);if(l.length<2)return{ok:!1,reason:"The table has fewer than two sortable rows."};for(var s=0;s<l.length;s++)for(var b=0;b<l[s].cells.length;b++){var S=l[s].cells[b];if((S.rowSpan||1)>1||(S.colSpan||1)>1)return{ok:!1,reason:"This table has merged cells. Sorting would move rows out from under a rowspan and break the table, so it has been left alone."}}return{ok:!0,reason:""}}function D(R){var l=String(R??"").trim();if(!l)return{type:"empty",v:""};if(/\d/.test(l)){var s=l.replace(/[\s ,]/g,"").replace(/^\(([^)]*)\)$/,"-$1").replace(/[^0-9.eE+-]/g,"");if(s&&/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(s))return{type:"number",v:parseFloat(s)};var b=Date.parse(l);if(!isNaN(b))return{type:"date",v:b}}return{type:"text",v:l.toLowerCase()}}function z(R,l){for(var s={number:0,date:0,text:0},b=0;b<R.length;b++){var S=R[b].cells[l];if(S){var v=D(S.textContent);v.type!=="empty"&&s[v.type]++}}return s.number>=s.date&&s.number>=s.text&&s.number>0?"number":s.date>=s.text&&s.date>0?"date":"text"}L.SortAtCaret=function(R){var l=N(),s=q();return!l||!s?!1:L.Sort(l,s.cellIndex,R)},L.Sort=function(R,l,s){var b=o(R);if(!b.ok)return b;for(var S=String(s).toLowerCase()==="desc",v=W(R),w=z(v,l),A=[],C=0;C<v.length;C++){var _=v[C].cells[l];A.push({row:v[C],order:C,val:D(_?_.textContent:"")})}A.sort(function(m,g){if(m.val.type==="empty"&&g.val.type==="empty")return m.order-g.order;if(m.val.type==="empty")return 1;if(g.val.type==="empty")return-1;var c;if(w==="number"||w==="date"){var p=m.val.type===w?m.val.v:Number.POSITIVE_INFINITY,k=g.val.type===w?g.val.v:Number.POSITIVE_INFINITY;c=p<k?-1:p>k?1:0}else{var E=String(m.val.v),I=String(g.val.v);c=E.localeCompare?E.localeCompare(I,void 0,{numeric:!0,sensitivity:"base"}):E<I?-1:E>I?1:0}return c===0?m.order-g.order:S?-c:c});var h=A.length?A[0].row.parentNode:null;if(!h)return{ok:!1,reason:"The table has no sortable rows."};for(var F=q(),H=0;H<A.length;H++)h.appendChild(A[H].row);return U(F),P(R),V(),{ok:!0,reason:"",sortedBy:l,direction:S?"desc":"asc",detectedType:w}};function K(R,l){switch(String(l)){case"upper-alpha":return G(R).toUpperCase();case"lower-alpha":return G(R);case"upper-roman":return j(R);case"lower-roman":return j(R).toLowerCase();default:return String(R)}}function G(R){for(var l="";R>0;){var s=(R-1)%26;l=String.fromCharCode(97+s)+l,R=Math.floor((R-1)/26)}return l||"a"}function j(R){for(var l=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]],s="",b=0;b<l.length;b++)for(;R>=l[b][0];)s+=l[b][1],R-=l[b][0];return s||"I"}L.AddRowNumbers=function(R){var l=N();if(!l)return!1;if(l.querySelector("[data-rte-rownum]"))return P(l),!0;R=R||{};for(var s=R.series||u.tableNumberSeries,b=l.ownerDocument,S=Array.prototype.slice.call(l.rows||[]),v=W(l),w={},A=0;A<v.length;A++)w[x(v[A])]=!0;for(var C=0;C<S.length;C++){var _=S[C],h=w[x(_)],F=b.createElement(h?"td":"th");F.setAttribute("data-rte-rownum",h?"value":"header"),h||(F.textContent=String(u.tableNumberHeader==null?"#":u.tableNumberHeader)),_.insertBefore(F,_.firstChild)}return l.setAttribute("data-rte-rownum-series",s),P(l),V(),!0};var T=0;function x(R){return R.__rteKey||(R.__rteKey="r"+T++),R.__rteKey}L.RemoveRowNumbers=function(){var R=N();if(!R)return!1;var l=R.querySelectorAll("[data-rte-rownum]");if(!l.length)return!1;for(var s=0;s<l.length;s++)l[s].parentNode&&l[s].parentNode.removeChild(l[s]);return R.removeAttribute("data-rte-rownum-series"),V(),!0},L.ToggleRowNumbers=function(){var R=N();return R?R.querySelector("[data-rte-rownum]")?L.RemoveRowNumbers():L.AddRowNumbers():!1};function P(R){if(R)for(var l=R.getAttribute("data-rte-rownum-series")||u.tableNumberSeries,s=W(R),b=1,S=0;S<s.length;S++){var v=s[S].querySelector("[data-rte-rownum='value']");v&&(v.textContent=K(b++,l))}}function U(R){if(!(!R||!R.parentNode))try{var l=R.ownerDocument,s=l.createRange();s.selectNodeContents(R),s.collapse(!0);var b=n.getSelection();b.removeAllRanges(),b.addRange(s)}catch{}}function V(){try{typeof n.updateDesign=="function"&&n.updateDesign()}catch{}try{typeof n.fireChange=="function"&&n.fireChange()}catch{}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_textdirection=RTE_Plugin_TextDirection,typeof RTE_DefaultConfig.defaultTextDirection>"u"&&(RTE_DefaultConfig.defaultTextDirection=null),typeof RTE_DefaultConfig.textDirectionAutoDetect>"u"&&(RTE_DefaultConfig.textDirectionAutoDetect=!1),typeof RTE_DefaultConfig.textDirectionSwapAlign>"u"&&(RTE_DefaultConfig.textDirectionSwapAlign=!0);function RTE_Plugin_TextDirection(){var L=this,u,n,y=null,N={P:1,DIV:1,LI:1,H1:1,H2:1,H3:1,H4:1,H5:1,H6:1,BLOCKQUOTE:1,TD:1,TH:1,PRE:1,UL:1,OL:1,TABLE:1,SECTION:1,ARTICLE:1},q=/[֐-׿؀-ۿ܀-ݏݐ-ݿހ-޿߀-߿ࠀ-࠿ࡀ-࡟ࢠ-ࣿיִ-﷿ﹰ-]/,W=/[A-Za-zÀ-ʯͰ-֏ऀ-႟Ḁ-῿Ⰰ-ⷿ⺀-꓏가-힯]/;L.PluginName="TextDirection",L.InitConfig=function(R){u=R},L.InitEditor=function(R){n=R,n.attachEvent("exec_command_textdirection",function(l){l.returnValue=!0;var s=l&&l.value;s==="rtl"||s==="ltr"?L.Apply(s):L.Toggle()}),O();try{n.attachEvent("ready",O)}catch{}try{n.attachEvent("aftersethtml",function(){O(),o()})}catch{}setTimeout(function(){O(),o()},0),n.setTextDirection=function(l){return L.Apply(l)},n.toggleTextDirection=function(){return L.Toggle()},n.getTextDirection=function(){return L.Current()},n.setBaseDirection=function(l){return L.Base(l)},n.getBaseDirection=function(){var l=z();return l&&l.getAttribute("dir")||"ltr"},n.detectTextDirection=function(l){return K(String(l??""))},n.autoDetectTextDirection=function(){return L.AutoDetect()},n.isolateBidi=function(l,s){return L.Isolate(l,s)},n.insertIsolated=function(l,s){return L.InsertIsolated(l,s)},n.getTextDirectionCss=function(){return U()}};function O(){var R=D();!R||R===y||(y=R,V(R))}function o(){var R=z();R&&((u.defaultTextDirection==="rtl"||u.defaultTextDirection==="ltr")&&(R.getAttribute("dir")||L.Base(u.defaultTextDirection)),u.textDirectionAutoDetect&&L.AutoDetect())}function D(){try{return n.getDocument()}catch{return null}}function z(){try{return n.getEditable()}catch{return null}}function K(R){for(var l=0;l<R.length;l++){var s=R.charAt(l);if(q.test(s))return"rtl";if(W.test(s))return"ltr"}return"neutral"}function G(){var R=z(),l=[];try{var s=n.getSelection();if(!s||s.rangeCount===0)return l;var b=s.getRangeAt(0),S=T(b.startContainer),v=T(b.endContainer);if(!S)return l;if(S===v||b.collapsed)return[S];for(var w=R.querySelectorAll("*"),A=!1,C=0;C<w.length;C++){var _=w[C];if(N[_.nodeName]&&(_===S&&(A=!0),A&&!j(_)&&l.push(_),_===v))break}l.length||l.push(S)}catch{}return l}function j(R){for(var l=0;l<R.children.length;l++)if(N[R.children[l].nodeName])return!0;return!1}function T(R){for(var l=z(),s=R&&R.nodeType===3?R.parentNode:R;s&&s!==l;){if(s.nodeType===1&&N[s.nodeName])return s;s=s.parentNode}return l&&l.firstElementChild?l.firstElementChild:null}L.Current=function(){var R=G()[0];if(!R)return n.getBaseDirection?n.getBaseDirection():"ltr";var l=R.getAttribute("dir");if(l)return l;try{var s=D(),b=s&&(s.defaultView||s.parentWindow);if(b)return b.getComputedStyle(R).direction||"ltr"}catch{}return"ltr"},L.Apply=function(R){R=R==="rtl"?"rtl":R==="auto"?"auto":"ltr";var l=G();if(!l.length)return!1;for(var s=0;s<l.length;s++){var b=l[s],S=b.getAttribute("dir")||"ltr";b.setAttribute("dir",R),u.textDirectionSwapAlign!==!1&&R!=="auto"&&S!==R&&x(b,R)}return P(),R},L.Toggle=function(){return L.Apply(L.Current()==="rtl"?"ltr":"rtl")};function x(R,l){var s=R.style&&R.style.textAlign||R.getAttribute("align")||"";if(s){var b=null;if(s==="left"?b="right":s==="right"&&(b="left"),!!b){var S=l==="rtl"?"right":"left";R.style&&(R.style.textAlign=b===S?"":b),R.getAttribute("align")&&R.removeAttribute("align")}}}L.Base=function(R){var l=z();return l?(R=R==="rtl"?"rtl":R==="auto"?"auto":"ltr",l.setAttribute("dir",R),P(),R):!1},L.AutoDetect=function(){var R=z();if(!R)return[];for(var l=[],s=R.querySelectorAll("*"),b=0;b<s.length;b++){var S=s[b];if(!(!N[S.nodeName]||j(S))){var v=K(S.textContent||"");v!=="neutral"&&S.getAttribute("dir")!==v&&(S.setAttribute("dir",v),l.push({tag:S.nodeName,dir:v}))}}return l.length&&P(),l},L.Isolate=function(R,l){var s=l==="rtl"||l==="ltr"?l:"auto";return'<bdi dir="'+s+'">'+String(R??"")+"</bdi>"},L.InsertIsolated=function(R,l){var s=D();if(!s)return!1;var b=s.createElement("bdi");b.setAttribute("dir",l==="rtl"||l==="ltr"?l:"auto"),b.innerHTML=String(R??"");try{if(typeof n.insertElement=="function")return n.insertElement(b),P(),!0}catch{}try{var S=n.getSelection();if(S&&S.rangeCount){var v=S.getRangeAt(0);return v.collapse(!1),v.insertNode(b),v.setStartAfter(b),v.collapse(!0),S.removeAllRanges(),S.addRange(v),P(),!0}}catch{}return!1};function P(){try{typeof n.updateDesign=="function"&&n.updateDesign()}catch{}try{typeof n.fireChange=="function"&&n.fireChange()}catch{}}function U(){return"[dir='rtl'] ul,[dir='rtl'] ol{padding-right:1.6em;padding-left:0;}[dir='rtl'] blockquote{border-right:3px solid #ddd;border-left:0;padding-right:.9em;padding-left:0;margin-right:0;}[dir='rtl'] table{direction:rtl;}bdi{unicode-bidi:isolate;}"}function V(R){if(R){var l=R.getElementById("rte-textdirection-styles"),s=U();if(l){if(l.getAttribute("data-css")===s)return;l.parentNode&&l.parentNode.removeChild(l)}var b=R.createElement("style");b.id="rte-textdirection-styles",b.setAttribute("data-css",s),b.appendChild(R.createTextNode(s)),(R.head||R.getElementsByTagName("head")[0]||R.documentElement).appendChild(b)}}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_todolist=RTE_Plugin_TodoList;function RTE_Plugin_TodoList(){var L=this,u,n,y,N;L.PluginName="TodoList",L.InitConfig=function(z){u=z},L.InitEditor=function(z){n=z,y=n.getEditable(),N=n.getDocument(),n.attachEvent("exec_command_inserttodolist",function(K){K.returnValue=!0,L.InsertTaskList()}),y&&(y.addEventListener("click",function(K){var G=q(K.target,"rte-task-checkbox",y);if(G){var j=G.parentNode;if(!(!j||!j.classList||!j.classList.contains("rte-task-item"))){var T=j.getAttribute("data-checked")==="true";j.setAttribute("data-checked",T?"false":"true"),K.preventDefault(),W()}}}),y.addEventListener("keyup",function(K){if(K.key==="Enter"&&!K.shiftKey){L.Normalize();var G=O();G&&G.setAttribute("data-checked","false")}}),setTimeout(function(){o(N)},0))};function q(z,K,G){for(;z&&z!==G;){if(z.nodeType===1&&z.classList&&z.classList.contains(K))return z;z=z.parentNode}return null}function W(){if(typeof n.fireChange=="function")try{n.fireChange()}catch{}}function O(){try{var z=n.getSelection();if(!z||z.rangeCount===0)return null;var K=z.getRangeAt(0).startContainer;return q(K,"rte-task-item",y)}catch{return null}}function o(z){if(!(!z||z.getElementById("rte-todolist-styles"))){var K="ul.rte-task-list{list-style:none;margin:.4em 0;padding-left:0;}ul.rte-task-list li.rte-task-item{position:relative;padding-left:28px;margin:3px 0;min-height:20px;}li.rte-task-item>.rte-task-checkbox{position:absolute;left:0;top:1px;width:18px;height:18px;border:2px solid #94a3b8;border-radius:5px;box-sizing:border-box;cursor:pointer;user-select:none;transition:background .12s,border-color .12s;}li.rte-task-item>.rte-task-checkbox:hover{border-color:#1d67ba;}li.rte-task-item[data-checked='true']>.rte-task-checkbox{background:#1d67ba;border-color:#1d67ba;}li.rte-task-item[data-checked='true']>.rte-task-checkbox::after{content:'';position:absolute;left:4px;top:0px;width:6px;height:11px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);}li.rte-task-item[data-checked='true']{color:#94a3b8;text-decoration:line-through;}",G=z.createElement("style");G.id="rte-todolist-styles",G.appendChild(z.createTextNode(K)),(z.head||z.getElementsByTagName("head")[0]||z.documentElement).appendChild(G)}}function D(){var z=N.createElement("span");return z.className="rte-task-checkbox",z.setAttribute("contenteditable","false"),z}L.Normalize=function(){if(y)for(var z=y.querySelectorAll("ul.rte-task-list"),K=0;K<z.length;K++)for(var G=z[K].children,j=0;j<G.length;j++){var T=G[j];if(T.nodeName==="LI"){T.classList.add("rte-task-item"),T.getAttribute("data-checked")!=="true"&&T.getAttribute("data-checked")!=="false"&&T.setAttribute("data-checked","false");var x=T.firstChild;x&&x.nodeType===1&&x.classList&&x.classList.contains("rte-task-checkbox")||T.insertBefore(D(),T.firstChild)}}},L.InsertTaskList=function(){o(N);var z="rte-todo-pending",K='<ul class="rte-task-list"><li class="rte-task-item" data-checked="false" id="'+z+'"><span class="rte-task-checkbox" contenteditable="false"></span>&#8203;</li></ul>';n.insertHTML(K);try{var G=N.getElementById(z);if(G){G.removeAttribute("id");var j=N.createRange(),T=G.lastChild;T&&T.nodeType===3?j.setStart(T,T.length):j.setStart(G,G.childNodes.length),j.collapse(!0);var x=n.getSelection();x&&(x.removeAllRanges(),x.addRange(j))}}catch{}n.focus(),W()}}window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.svgCode_trackchanges||(RTE_DefaultConfig.svgCode_trackchanges='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 17l4-1 10-10-3-3L5 13l-1 4z"/><path d="M14 4l3 3"/><path d="M4 21h10"/></svg>'),RTE_DefaultConfig.plugin_trackedchanges=RTE_Plugin_TrackedChanges;function RTE_Plugin_TrackedChanges(){var L=this,u,n,y=!1;L.PluginName="TrackedChanges",L.InitConfig=function(J){u=J,u.trackChangesEnabled!==!1&&(u.currentUser=u.currentUser||null,u.trackChangesInsertClass=u.trackChangesInsertClass||"rte-tc rte-tc-insert",u.trackChangesDeleteClass=u.trackChangesDeleteClass||"rte-tc rte-tc-delete",u.reviewCanDecide=u.reviewCanDecide||null,u.onReviewDecisionDenied=u.onReviewDecisionDenied||null,u.text_trackchanges=u.text_trackchanges||"Suggesting mode",N("toolbar_default","#{trackchanges}"),N("toolbar_full","#{trackchanges}"),N("toolbar_mobile","#{trackchanges}"),(u.controltoolbar_TEXT||"").indexOf("trackchanges")===-1&&(u.controltoolbar_TEXT=(u.controltoolbar_TEXT||"")+"|{trackchanges}"))},L.InitEditor=function(J){n=J,u.trackChangesEnabled!==!1&&(n.trackedChanges={enable:function(re){q(re)},disable:function(){W()},isEnabled:function(){return y},acceptAll:function(re){return X(re)},rejectAll:function(re){return ae(re)},accept:function(re){return E(re)},reject:function(re){return I(re)},canDecide:function(re,te){var oe=n.reviewLedger&&n.reviewLedger.get(re);return!!oe&&k(oe,te||"accept")},list:function(re){if(!n.reviewLedger)return[];var te=re&&re.all===!0;return n.reviewLedger.list().filter(function(oe){return oe.changeType!=="insert"&&oe.changeType!=="delete"?!1:te||oe.status==="pending"})}},ne(),n.toolbarFactoryMap=n.toolbarFactoryMap||{},n.toolbarFactoryMap.trackchanges=function(re){var te=n.createToolbarButton(re);return te.__tcSync=function(){y?te.classList.add("rte-ui-active"):te.classList.remove("rte-ui-active"),te.setAttribute("aria-pressed",y?"true":"false"),te.setAttribute("title",y?"Suggesting mode is on":"Turn on suggesting mode")},te.__tcSync(),te},n.attachEvent("exec_command_trackchanges",function(re){re.returnValue=!0,re.stopBubble=!0,y?W():q()}),n.getEditable().addEventListener("beforeinput",o,!0))};function N(J,re){u[J]&&u[J].indexOf(re)===-1&&(u[J]=u[J]+re)}function q(J){J&&(u.currentUser=J),u.currentUser||(u.currentUser={id:"user",name:"User",color:"#2563eb"},console.warn("trackedchanges: no config.currentUser configured; defaulting to generic user.")),y=!0,O()}function W(){y=!1,O()}function O(){for(var J=n.iframe&&n.iframe.ownerDocument||document,re=J.querySelectorAll(".rte_command_trackchanges"),te=0;te<re.length;te++)re[te].__tcSync&&re[te].__tcSync()}function o(J){if(y&&n.reviewLedger){var re=J.inputType;if(re){if(re==="insertText"||re==="insertReplacementText"){J.preventDefault(),D(J.data||"");return}if(re==="deleteContentBackward"||re==="deleteContentForward"||re==="deleteByCut"){J.preventDefault(),x(re);return}}}}function D(J){if(J){var re=n.getSelection();if(!(!re||re.rangeCount===0)){var te=re.getRangeAt(0);if(!te.collapsed){if(!C(te))return;te=re.getRangeAt(0),j(J,te);return}var oe=z(te);oe?G(oe,J):j(J,te)}}}function z(J){var re=J.startContainer;if(re.nodeType===3&&re.parentNode&&K(re.parentNode))return re.parentNode;if(re.nodeType===1&&J.startOffset>0){var te=re.childNodes[J.startOffset-1];if(te&&te.nodeType===1&&K(te))return te}return re.nodeType===3&&re.previousSibling&&K(re.previousSibling)&&J.startOffset===0?re.previousSibling:null}function K(J){return!J||J.nodeType!==1||!J.classList||!J.classList.contains("rte-tc-insert")?!1:J.getAttribute("data-tc-author")===u.currentUser.id}function G(J,re){var te=n.getDocument(),oe=J.lastChild,B;oe&&oe.nodeType===3?(oe.nodeValue=oe.nodeValue+re,B=oe):(B=te.createTextNode(re),J.appendChild(B)),c(B),T(J)}function j(J,re){var te=n.getDocument(),oe=te.createElement("span");oe.className=u.trackChangesInsertClass;var B=u.currentUser,Y="tc-"+Date.now()+"-"+Math.floor(Math.random()*1e4);oe.setAttribute("data-tc-id",Y),oe.setAttribute("data-tc-author",B.id),oe.setAttribute("data-tc-at",new Date().toISOString()),oe.style.color=B.color,oe.style.textDecoration="underline",oe.appendChild(te.createTextNode(J)),re.insertNode(oe),c(oe.firstChild),n.reviewLedger.add({id:Y,changeType:"insert",author:B,text:J,status:"pending",sourceLabel:"Suggested insert",createdAt:Date.now()})}function T(J){var re=J.getAttribute("data-tc-id");re&&n.reviewLedger.update(re,{text:J.textContent})}function x(J){var re=n.getSelection();if(!(!re||re.rangeCount===0)){var te=re.getRangeAt(0);if(!te.collapsed){C(te);return}var oe=n.getDocument().createRange();if(J==="deleteContentBackward"){var B=V(te.startContainer,te.startOffset);if(!B)return;oe.setStart(B.node,B.offset),oe.setEnd(B.node,B.offset+1)}else{var Y=R(te.startContainer,te.startOffset);if(!Y)return;oe.setStart(Y.node,Y.offset-1),oe.setEnd(Y.node,Y.offset)}if(A(oe)){oe.deleteContents();var le=n.getSelection();le.removeAllRanges(),le.addRange(oe),g();return}C(oe)}}function P(J){for(var re=J.nodeType===1?J:J.parentNode;re&&re!==n.getEditable();){if(re.classList&&re.classList.contains("rte-tc-delete"))return!0;re=re.parentNode}return!1}function U(){for(var J=n.getEditable(),re=n.getDocument().createTreeWalker(J,NodeFilter.SHOW_TEXT,{acceptNode:function(B){return P(B)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),te=[],oe;oe=re.nextNode();)te.push(oe);return te}function V(J,re){var te=U();if(!te.length)return null;var oe=l(J,re,te);return oe<=0?null:s(oe-1,te)}function R(J,re){var te=U();if(!te.length)return null;for(var oe=0,B=0;B<te.length;B++)oe+=te[B].nodeValue.length;var Y=l(J,re,te);return Y>=oe?null:s(Y+1,te)}function l(J,re,te){var oe=n.getDocument().createRange();oe.setStart(J,re),oe.collapse(!0);for(var B=0,Y=0;Y<te.length;Y++){var le=te[Y],se=oe.comparePoint(le,le.nodeValue.length);if(se<=0){B+=le.nodeValue.length;continue}var de=oe.comparePoint(le,0);if(de>=0)break;for(var Ae=0,be=le.nodeValue.length;Ae<be;){var ye=Ae+be>>1;oe.comparePoint(le,ye)<0?Ae=ye+1:be=ye}B+=Ae;break}return B}function s(J,re){for(var te=J,oe=0;oe<re.length;oe++){if(te<=re[oe].nodeValue.length)return{node:re[oe],offset:te};te-=re[oe].nodeValue.length}return null}function b(J){if(!J)return null;if(J.nodeType===3)return J;var re=n.getDocument().createTreeWalker(J,NodeFilter.SHOW_TEXT);return re.nextNode()}function S(J){if(!J)return null;if(J.nodeType===3)return J;for(var re=n.getDocument().createTreeWalker(J,NodeFilter.SHOW_TEXT),te=null,oe;oe=re.nextNode();)te=oe;return te}function v(J){for(var re=n.getEditable(),te=n.getDocument().createTreeWalker(re,NodeFilter.SHOW_TEXT),oe=null,B;B=te.nextNode();){if(B===J)return oe;oe=B}return null}function w(J){for(var re=n.getEditable(),te=n.getDocument().createTreeWalker(re,NodeFilter.SHOW_TEXT),oe=!1,B;B=te.nextNode();){if(oe)return B;B===J&&(oe=!0)}return null}function A(J){for(var re=J.startContainer.parentNode;re&&re!==n.getEditable();){if(K(re))return J.endContainer.parentNode===re||re.contains(J.endContainer);re=re.parentNode}return!1}function C(J){if(J.collapsed)return!1;var re=n.getDocument(),te=J.cloneContents();if(!m(te))return!1;var oe=u.currentUser,B=_(J,"before",oe),Y=_(J,"after",oe);if(J.deleteContents(),B){if(F(B,te),Y&&Y!==B){for(;Y.firstChild;)B.appendChild(Y.firstChild);var le=Y.getAttribute("data-tc-id");Y.remove(),le&&n.reviewLedger&&n.reviewLedger.remove(le)}var se=re.createRange();se.setStartAfter(B),se.collapse(!0);var de=n.getSelection();de.removeAllRanges(),de.addRange(se);var Ae=B.getAttribute("data-tc-id");return Ae&&n.reviewLedger&&n.reviewLedger.update(Ae,{text:B.textContent}),!0}if(Y){H(Y,te);var be=re.createRange();be.setStartBefore(Y),be.collapse(!0);var ye=n.getSelection();ye.removeAllRanges(),ye.addRange(be);var fe=Y.getAttribute("data-tc-id");return fe&&n.reviewLedger&&n.reviewLedger.update(fe,{text:Y.textContent}),!0}var Ee=re.createElement("span");Ee.className=u.trackChangesDeleteClass;var Ce="tc-"+Date.now()+"-"+Math.floor(Math.random()*1e4);Ee.setAttribute("data-tc-id",Ce),Ee.setAttribute("data-tc-author",oe.id),Ee.setAttribute("data-tc-at",new Date().toISOString()),Ee.style.color=oe.color,Ee.style.textDecoration="line-through",Ee.appendChild(te),J.insertNode(Ee);var Pe=re.createRange();Pe.setStartAfter(Ee),Pe.collapse(!0);var Je=n.getSelection();return Je.removeAllRanges(),Je.addRange(Pe),n.reviewLedger.add({id:Ce,changeType:"delete",author:oe,text:Ee.textContent,originalHtml:Ee.innerHTML,status:"pending",sourceLabel:"Suggested delete",createdAt:Date.now()}),!0}function _(J,re,te){var oe=re==="before"?J.startContainer:J.endContainer,B=re==="before"?J.startOffset:J.endOffset;if(oe.nodeType===3){if(re==="before"&&B===0){var Y=oe.previousSibling;if(Y&&h(Y,te))return Y}if(re==="after"&&B===oe.nodeValue.length){var le=oe.nextSibling;if(le&&h(le,te))return le}return null}if(re==="before"&&B>0){var se=oe.childNodes[B-1];if(se&&h(se,te))return se}if(re==="after"&&B<oe.childNodes.length){var de=oe.childNodes[B];if(de&&h(de,te))return de}return null}function h(J,re){return!J||J.nodeType!==1||!J.classList||!J.classList.contains("rte-tc-delete")?!1:J.getAttribute("data-tc-author")===re.id}function F(J,re){for(;re.firstChild;)J.appendChild(re.firstChild)}function H(J,re){for(var te=J.firstChild;re.firstChild;)J.insertBefore(re.firstChild,te)}function m(J){var re=(J.textContent||"").replace(/\s+/g,"");return!!re}function g(){for(var J=n.getEditable().querySelectorAll(".rte-tc-insert"),re=0;re<J.length;re++){var te=J[re];if(!te.textContent||!te.textContent.length){var oe=te.getAttribute("data-tc-id");oe&&n.reviewLedger&&n.reviewLedger.remove(oe),te.remove()}else T(te)}}function c(J){if(J){var re=n.getDocument(),te=re.createRange();J.nodeType===3?te.setStart(J,J.nodeValue.length):te.setStart(J,J.childNodes.length),te.collapse(!0);var oe=n.getSelection();oe.removeAllRanges(),oe.addRange(te)}}function p(){return u.currentUser||{id:"user",name:"User",color:"#2563eb"}}function k(J,re){if(typeof u.reviewCanDecide!="function")return!0;var te=!1,oe=p();try{te=u.reviewCanDecide(J,re,oe,n)!==!1}catch(Y){console.warn("trackedchanges: reviewCanDecide threw; denying decision.",Y)}if(te)return!0;var B={entry:J,action:re,user:oe};try{typeof u.onReviewDecisionDenied=="function"&&u.onReviewDecisionDenied(B)}catch{}try{typeof n.fireEvent=="function"&&n.fireEvent("review_decision_denied",B)}catch{}return!1}function E(J){var re=n.reviewLedger.get(J);if(!re||!k(re,"accept"))return!1;var te=n.getEditable().querySelector('[data-tc-id="'+ie(J)+'"]');return re.changeType==="insert"?te&&Z(te):re.changeType==="delete"&&te&&te.remove(),n.reviewLedger.update(J,{status:"accepted",decidedAt:Date.now(),decidedBy:p()}),!0}function I(J){var re=n.reviewLedger.get(J);if(!re||!k(re,"reject"))return!1;var te=n.getEditable().querySelector('[data-tc-id="'+ie(J)+'"]');return re.changeType==="insert"?te&&te.remove():re.changeType==="delete"&&te&&Z(te),n.reviewLedger.update(J,{status:"rejected",decidedAt:Date.now(),decidedBy:p()}),!0}function X(J){for(var re=n.reviewLedger.list(J).filter(function(B){return(B.changeType==="insert"||B.changeType==="delete")&&B.status==="pending"}),te=0,oe=0;oe<re.length;oe++)E(re[oe].id)&&te++;return te}function ae(J){for(var re=n.reviewLedger.list(J).filter(function(B){return(B.changeType==="insert"||B.changeType==="delete")&&B.status==="pending"}),te=0,oe=0;oe<re.length;oe++)I(re[oe].id)&&te++;return te}function Z(J){var re=J.parentNode;if(re){for(;J.firstChild;)re.insertBefore(J.firstChild,J);re.removeChild(J)}}function ie(J){var re=String(J);if(typeof CSS<"u"&&typeof CSS.escape=="function")try{return CSS.escape(re)}catch{}return re.replace(/["\\\]\[\(\)\{\}'#:;,<>=`~!@$%^&*+/?\s\x00-\x1F]/g,function(te){return"\\"+te})}function ne(){var J=n&&n.iframe&&n.iframe.ownerDocument||document;if(!J.querySelector("style[data-rte-trackchanges]")){var re=J.createElement("style");re.setAttribute("data-rte-trackchanges","1"),re.textContent=[".richtexteditor rte-toolbar-button.rte_command_trackchanges{position:relative;border-radius:8px;transition:background .14s ease,color .14s ease,box-shadow .14s ease}",".richtexteditor rte-toolbar-button.rte_command_trackchanges.rte-ui-active{background:linear-gradient(135deg,#e9f7ef,#eef5ff);color:#17633f;box-shadow:inset 0 0 0 1px rgba(34,132,82,.28),0 6px 14px rgba(34,132,82,.12)}",".richtexteditor rte-toolbar-button.rte_command_trackchanges.rte-ui-active:after{content:'';position:absolute;right:5px;top:5px;width:6px;height:6px;border-radius:50%;background:#22a66a;box-shadow:0 0 0 2px #fff}",".rte-tc{border-radius:4px;padding:0 2px;box-decoration-break:clone;-webkit-box-decoration-break:clone}",".rte-tc-insert{background:linear-gradient(180deg,rgba(232,248,239,.78),rgba(232,248,239,.38));color:#125b39;text-decoration:underline;text-decoration-color:#22a66a;text-decoration-thickness:2px;text-underline-offset:3px}",".rte-tc-delete{background:linear-gradient(180deg,rgba(255,240,240,.82),rgba(255,240,240,.42));color:#9f1d1d;text-decoration:line-through;text-decoration-color:#dc4c4c;text-decoration-thickness:2px;opacity:.92}"].join(`