@editora/plugins 1.0.17 → 1.0.19

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.
Files changed (100) hide show
  1. package/dist/{CodePlugin.native-Cqi46sxh.js → CodePlugin.native-Bwf25lLX.js} +6 -6
  2. package/dist/{CodePlugin.native-CmnEFfJi.mjs → CodePlugin.native-Cpp4u3Jl.mjs} +23 -21
  3. package/dist/a11y-checker.cjs.js +16 -16
  4. package/dist/a11y-checker.esm.js +79 -75
  5. package/dist/anchor.cjs.js +9 -9
  6. package/dist/anchor.esm.js +61 -60
  7. package/dist/anchoredPopover-Bg-ey7Yo.js +1 -0
  8. package/dist/anchoredPopover-D_JbjvdA.mjs +111 -0
  9. package/dist/approval-workflow.cjs.js +5 -5
  10. package/dist/approval-workflow.esm.js +105 -104
  11. package/dist/background-color.cjs.js +1 -1
  12. package/dist/background-color.esm.js +1 -1
  13. package/dist/blocks-library.cjs.js +6 -6
  14. package/dist/blocks-library.esm.js +226 -202
  15. package/dist/capitalization.cjs.js +1 -1
  16. package/dist/capitalization.esm.js +9 -4
  17. package/dist/checklist.cjs.js +1 -1
  18. package/dist/checklist.esm.js +154 -116
  19. package/dist/citations.cjs.js +43 -18
  20. package/dist/citations.esm.js +465 -446
  21. package/dist/clear-formatting.cjs.js +1 -1
  22. package/dist/clear-formatting.esm.js +21 -20
  23. package/dist/code-sample.cjs.js +85 -66
  24. package/dist/code-sample.esm.js +301 -190
  25. package/dist/code.cjs.js +1 -1
  26. package/dist/code.esm.js +1 -1
  27. package/dist/collaboration.cjs.js +68 -0
  28. package/dist/collaboration.esm.js +7428 -0
  29. package/dist/comments.cjs.js +11 -11
  30. package/dist/comments.esm.js +284 -237
  31. package/dist/conditional-content.cjs.js +67 -60
  32. package/dist/conditional-content.esm.js +270 -220
  33. package/dist/data-binding.cjs.js +3 -3
  34. package/dist/data-binding.esm.js +28 -27
  35. package/dist/dialogHelpers-5d5BuOCW.mjs +39 -0
  36. package/dist/dialogHelpers-zU6zpMIA.js +12 -0
  37. package/dist/document-manager.cjs.js +1 -1
  38. package/dist/document-manager.esm.js +1 -1
  39. package/dist/{documentManager-3nPkITwx.js → documentManager-BDz6tovy.js} +1 -1
  40. package/dist/{documentManager-CRumGpCT.mjs → documentManager-yjRBab4v.mjs} +1 -1
  41. package/dist/embed-iframe.cjs.js +37 -17
  42. package/dist/embed-iframe.esm.js +188 -143
  43. package/dist/emojis.cjs.js +13 -10
  44. package/dist/emojis.esm.js +288 -76
  45. package/dist/enterprise.cjs.js +1 -1
  46. package/dist/enterprise.esm.js +9 -7
  47. package/dist/escapeHtml-D2Zh82pD.js +1 -0
  48. package/dist/escapeHtml-DyksyvcZ.mjs +6 -0
  49. package/dist/font-family.cjs.js +1 -1
  50. package/dist/font-family.esm.js +48 -41
  51. package/dist/font-size.cjs.js +1 -1
  52. package/dist/font-size.esm.js +67 -60
  53. package/dist/format-painter.cjs.js +1 -1
  54. package/dist/format-painter.esm.js +2 -1
  55. package/dist/history.cjs.js +1 -1
  56. package/dist/history.esm.js +40 -36
  57. package/dist/historyHelpers-BEKwNOtA.mjs +14 -0
  58. package/dist/historyHelpers-Cu8Pk7m1.js +1 -0
  59. package/dist/index-Bm1eqYHh.mjs +194 -0
  60. package/dist/index-CoflqYuK.js +30 -0
  61. package/dist/index.cjs.js +1 -1
  62. package/dist/index.esm.js +17 -15
  63. package/dist/link.cjs.js +17 -13
  64. package/dist/link.esm.js +138 -69
  65. package/dist/list.cjs.js +1 -1
  66. package/dist/list.esm.js +66 -33
  67. package/dist/math.cjs.js +22 -22
  68. package/dist/math.esm.js +221 -126
  69. package/dist/media-manager.cjs.js +12 -12
  70. package/dist/media-manager.esm.js +55 -50
  71. package/dist/mentions.cjs.js +2 -2
  72. package/dist/mentions.esm.js +17 -12
  73. package/dist/merge-tag.cjs.js +2 -2
  74. package/dist/merge-tag.esm.js +43 -42
  75. package/dist/plugins.css +1 -1
  76. package/dist/preview.cjs.js +3 -3
  77. package/dist/preview.esm.js +30 -27
  78. package/dist/slash-commands.cjs.js +13 -7
  79. package/dist/slash-commands.esm.js +90 -79
  80. package/dist/smart-paste.cjs.js +5 -5
  81. package/dist/smart-paste.esm.js +85 -81
  82. package/dist/special-characters.cjs.js +6 -3
  83. package/dist/special-characters.esm.js +72 -25
  84. package/dist/spell-check.cjs.js +8 -8
  85. package/dist/spell-check.esm.js +10189 -295
  86. package/dist/table.cjs.js +166 -13
  87. package/dist/table.esm.js +543 -266
  88. package/dist/template.cjs.js +11 -11
  89. package/dist/template.esm.js +290 -264
  90. package/dist/text-color.cjs.js +1 -1
  91. package/dist/text-color.esm.js +1 -1
  92. package/dist/translation-workflow.cjs.js +4 -4
  93. package/dist/translation-workflow.esm.js +33 -31
  94. package/dist/version-diff.cjs.js +6 -6
  95. package/dist/version-diff.esm.js +40 -40
  96. package/package.json +12 -5
  97. package/dist/anchoredPopover-BzqGPOAE.js +0 -1
  98. package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
  99. package/dist/index-CJ90EVWy.mjs +0 -145
  100. package/dist/index-DTkvH8gX.js +0 -1
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const{entries:Bt,setPrototypeOf:Mt,isFrozen:Tn,getPrototypeOf:bn,getOwnPropertyDescriptor:En}=Object;let{freeze:R,seal:O,create:De}=Object,{apply:et,construct:tt}=typeof Reflect<"u"&&Reflect;R||(R=function(t){return t});O||(O=function(t){return t});et||(et=function(t,o){for(var l=arguments.length,c=new Array(l>2?l-2:0),f=2;f<l;f++)c[f-2]=arguments[f];return t.apply(o,c)});tt||(tt=function(t){for(var o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];return new t(...l)});const Re=L(Array.prototype.forEach),An=L(Array.prototype.lastIndexOf),Nt=L(Array.prototype.pop),se=L(Array.prototype.push),_n=L(Array.prototype.splice),we=L(String.prototype.toLowerCase),$e=L(String.prototype.toString),qe=L(String.prototype.match),ce=L(String.prototype.replace),yn=L(String.prototype.indexOf),vn=L(String.prototype.trim),C=L(Object.prototype.hasOwnProperty),x=L(RegExp.prototype.test),ue=Sn(TypeError);function L(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];return et(n,t,l)}}function Sn(n){return function(){for(var t=arguments.length,o=new Array(t),l=0;l<t;l++)o[l]=arguments[l];return tt(n,o)}}function s(n,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:we;Mt&&Mt(n,null);let l=t.length;for(;l--;){let c=t[l];if(typeof c=="string"){const f=o(c);f!==c&&(Tn(t)||(t[l]=f),c=f)}n[c]=!0}return n}function xn(n){for(let t=0;t<n.length;t++)C(n,t)||(n[t]=null);return n}function I(n){const t=De(null);for(const[o,l]of Bt(n))C(n,o)&&(Array.isArray(l)?t[o]=xn(l):l&&typeof l=="object"&&l.constructor===Object?t[o]=I(l):t[o]=l);return t}function pe(n,t){for(;n!==null;){const l=En(n,t);if(l){if(l.get)return L(l.get);if(typeof l.value=="function")return L(l.value)}n=bn(n)}function o(){return null}return o}const It=R(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Xe=R(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ze=R(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Rn=R(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ke=R(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ln=R(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kt=R(["#text"]),Pt=R(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Qe=R(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ft=R(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Le=R(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Dn=O(/\{\{[\w\W]*|[\w\W]*\}\}/gm),wn=O(/<%[\w\W]*|[\w\W]*%>/gm),Cn=O(/\$\{[\w\W]*/gm),On=O(/^data-[\-\w.\u00B7-\uFFFF]+$/),Mn=O(/^aria-[\-\w]+$/),Gt=O(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Nn=O(/^(?:\w+script|data):/i),In=O(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Wt=O(/^html$/i),kn=O(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ht=Object.freeze({__proto__:null,ARIA_ATTR:Mn,ATTR_WHITESPACE:In,CUSTOM_ELEMENT:kn,DATA_ATTR:On,DOCTYPE_NAME:Wt,ERB_EXPR:wn,IS_ALLOWED_URI:Gt,IS_SCRIPT_OR_DATA:Nn,MUSTACHE_EXPR:Dn,TMPLIT_EXPR:Cn});const de={element:1,text:3,progressingInstruction:7,comment:8,document:9},Pn=function(){return typeof window>"u"?null:window},Fn=function(t,o){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let l=null;const c="data-tt-policy-suffix";o&&o.hasAttribute(c)&&(l=o.getAttribute(c));const f="dompurify"+(l?"#"+l:"");try{return t.createPolicy(f,{createHTML(w){return w},createScriptURL(w){return w}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},Ut=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function jt(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Pn();const t=i=>jt(i);if(t.version="3.3.2",t.removed=[],!n||!n.document||n.document.nodeType!==de.document||!n.Element)return t.isSupported=!1,t;let{document:o}=n;const l=o,c=l.currentScript,{DocumentFragment:f,HTMLTemplateElement:w,Node:z,Element:b,NodeFilter:E,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:j,DOMParser:Oe,trustedTypes:he}=n,re=b.prototype,Zt=pe(re,"cloneNode"),Kt=pe(re,"remove"),Qt=pe(re,"nextSibling"),Jt=pe(re,"childNodes"),Te=pe(re,"parentNode");if(typeof w=="function"){const i=o.createElement("template");i.content&&i.content.ownerDocument&&(o=i.content.ownerDocument)}let v,oe="";const{implementation:Me,createNodeIterator:en,createDocumentFragment:tn,getElementsByTagName:nn}=o,{importNode:rn}=l;let S=Ut();t.isSupported=typeof Bt=="function"&&typeof Te=="function"&&Me&&Me.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ne,ERB_EXPR:Ie,TMPLIT_EXPR:ke,DATA_ATTR:on,ARIA_ATTR:an,IS_SCRIPT_OR_DATA:ln,ATTR_WHITESPACE:st,CUSTOM_ELEMENT:sn}=Ht;let{IS_ALLOWED_URI:ct}=Ht,h=null;const ut=s({},[...It,...Xe,...Ze,...Ke,...kt]);let A=null;const pt=s({},[...Pt,...Qe,...Ft,...Le]);let p=Object.seal(De(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ae=null,be=null;const B=Object.seal(De(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let dt=!0,Pe=!0,mt=!1,ft=!0,$=!1,Ee=!0,V=!1,Fe=!1,He=!1,q=!1,Ae=!1,_e=!1,gt=!0,ht=!1;const cn="user-content-";let Ue=!0,ie=!1,X={},M=null;const ze=s({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Tt=null;const bt=s({},["audio","video","img","source","image","track"]);let Be=null;const Et=s({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ye="http://www.w3.org/1998/Math/MathML",ve="http://www.w3.org/2000/svg",F="http://www.w3.org/1999/xhtml";let Z=F,Ge=!1,We=null;const un=s({},[ye,ve,F],$e);let Se=s({},["mi","mo","mn","ms","mtext"]),xe=s({},["annotation-xml"]);const pn=s({},["title","style","font","a","script"]);let le=null;const dn=["application/xhtml+xml","text/html"],mn="text/html";let g=null,K=null;const fn=o.createElement("form"),At=function(e){return e instanceof RegExp||e instanceof Function},je=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(K&&K===e)){if((!e||typeof e!="object")&&(e={}),e=I(e),le=dn.indexOf(e.PARSER_MEDIA_TYPE)===-1?mn:e.PARSER_MEDIA_TYPE,g=le==="application/xhtml+xml"?$e:we,h=C(e,"ALLOWED_TAGS")?s({},e.ALLOWED_TAGS,g):ut,A=C(e,"ALLOWED_ATTR")?s({},e.ALLOWED_ATTR,g):pt,We=C(e,"ALLOWED_NAMESPACES")?s({},e.ALLOWED_NAMESPACES,$e):un,Be=C(e,"ADD_URI_SAFE_ATTR")?s(I(Et),e.ADD_URI_SAFE_ATTR,g):Et,Tt=C(e,"ADD_DATA_URI_TAGS")?s(I(bt),e.ADD_DATA_URI_TAGS,g):bt,M=C(e,"FORBID_CONTENTS")?s({},e.FORBID_CONTENTS,g):ze,ae=C(e,"FORBID_TAGS")?s({},e.FORBID_TAGS,g):I({}),be=C(e,"FORBID_ATTR")?s({},e.FORBID_ATTR,g):I({}),X=C(e,"USE_PROFILES")?e.USE_PROFILES:!1,dt=e.ALLOW_ARIA_ATTR!==!1,Pe=e.ALLOW_DATA_ATTR!==!1,mt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ft=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,V=e.WHOLE_DOCUMENT||!1,q=e.RETURN_DOM||!1,Ae=e.RETURN_DOM_FRAGMENT||!1,_e=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,gt=e.SANITIZE_DOM!==!1,ht=e.SANITIZE_NAMED_PROPS||!1,Ue=e.KEEP_CONTENT!==!1,ie=e.IN_PLACE||!1,ct=e.ALLOWED_URI_REGEXP||Gt,Z=e.NAMESPACE||F,Se=e.MATHML_TEXT_INTEGRATION_POINTS||Se,xe=e.HTML_INTEGRATION_POINTS||xe,p=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&At(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(p.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&At(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(p.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(p.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$&&(Pe=!1),Ae&&(q=!0),X&&(h=s({},kt),A=De(null),X.html===!0&&(s(h,It),s(A,Pt)),X.svg===!0&&(s(h,Xe),s(A,Qe),s(A,Le)),X.svgFilters===!0&&(s(h,Ze),s(A,Qe),s(A,Le)),X.mathMl===!0&&(s(h,Ke),s(A,Ft),s(A,Le))),C(e,"ADD_TAGS")||(B.tagCheck=null),C(e,"ADD_ATTR")||(B.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?B.tagCheck=e.ADD_TAGS:(h===ut&&(h=I(h)),s(h,e.ADD_TAGS,g))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?B.attributeCheck=e.ADD_ATTR:(A===pt&&(A=I(A)),s(A,e.ADD_ATTR,g))),e.ADD_URI_SAFE_ATTR&&s(Be,e.ADD_URI_SAFE_ATTR,g),e.FORBID_CONTENTS&&(M===ze&&(M=I(M)),s(M,e.FORBID_CONTENTS,g)),e.ADD_FORBID_CONTENTS&&(M===ze&&(M=I(M)),s(M,e.ADD_FORBID_CONTENTS,g)),Ue&&(h["#text"]=!0),V&&s(h,["html","head","body"]),h.table&&(s(h,["tbody"]),delete ae.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw ue('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ue('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=e.TRUSTED_TYPES_POLICY,oe=v.createHTML("")}else v===void 0&&(v=Fn(he,c)),v!==null&&typeof oe=="string"&&(oe=v.createHTML(""));R&&R(e),K=e}},_t=s({},[...Xe,...Ze,...Rn]),yt=s({},[...Ke,...Ln]),gn=function(e){let r=Te(e);(!r||!r.tagName)&&(r={namespaceURI:Z,tagName:"template"});const a=we(e.tagName),u=we(r.tagName);return We[e.namespaceURI]?e.namespaceURI===ve?r.namespaceURI===F?a==="svg":r.namespaceURI===ye?a==="svg"&&(u==="annotation-xml"||Se[u]):!!_t[a]:e.namespaceURI===ye?r.namespaceURI===F?a==="math":r.namespaceURI===ve?a==="math"&&xe[u]:!!yt[a]:e.namespaceURI===F?r.namespaceURI===ve&&!xe[u]||r.namespaceURI===ye&&!Se[u]?!1:!yt[a]&&(pn[a]||!_t[a]):!!(le==="application/xhtml+xml"&&We[e.namespaceURI]):!1},N=function(e){se(t.removed,{element:e});try{Te(e).removeChild(e)}catch{Kt(e)}},Y=function(e,r){try{se(t.removed,{attribute:r.getAttributeNode(e),from:r})}catch{se(t.removed,{attribute:null,from:r})}if(r.removeAttribute(e),e==="is")if(q||Ae)try{N(r)}catch{}else try{r.setAttribute(e,"")}catch{}},vt=function(e){let r=null,a=null;if(He)e="<remove></remove>"+e;else{const d=qe(e,/^[\r\n\t ]+/);a=d&&d[0]}le==="application/xhtml+xml"&&Z===F&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const u=v?v.createHTML(e):e;if(Z===F)try{r=new Oe().parseFromString(u,le)}catch{}if(!r||!r.documentElement){r=Me.createDocument(Z,"template",null);try{r.documentElement.innerHTML=Ge?oe:u}catch{}}const y=r.body||r.documentElement;return e&&a&&y.insertBefore(o.createTextNode(a),y.childNodes[0]||null),Z===F?nn.call(r,V?"html":"body")[0]:V?r.documentElement:y},St=function(e){return en.call(e.ownerDocument||e,e,E.SHOW_ELEMENT|E.SHOW_COMMENT|E.SHOW_TEXT|E.SHOW_PROCESSING_INSTRUCTION|E.SHOW_CDATA_SECTION,null)},Ve=function(e){return e instanceof j&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof W)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},xt=function(e){return typeof z=="function"&&e instanceof z};function H(i,e,r){Re(i,a=>{a.call(t,e,r,K)})}const Rt=function(e){let r=null;if(H(S.beforeSanitizeElements,e,null),Ve(e))return N(e),!0;const a=g(e.nodeName);if(H(S.uponSanitizeElement,e,{tagName:a,allowedTags:h}),Ee&&e.hasChildNodes()&&!xt(e.firstElementChild)&&x(/<[/\w!]/g,e.innerHTML)&&x(/<[/\w!]/g,e.textContent)||e.nodeType===de.progressingInstruction||Ee&&e.nodeType===de.comment&&x(/<[/\w]/g,e.data))return N(e),!0;if(!(B.tagCheck instanceof Function&&B.tagCheck(a))&&(!h[a]||ae[a])){if(!ae[a]&&Dt(a)&&(p.tagNameCheck instanceof RegExp&&x(p.tagNameCheck,a)||p.tagNameCheck instanceof Function&&p.tagNameCheck(a)))return!1;if(Ue&&!M[a]){const u=Te(e)||e.parentNode,y=Jt(e)||e.childNodes;if(y&&u){const d=y.length;for(let D=d-1;D>=0;--D){const U=Zt(y[D],!0);U.__removalCount=(e.__removalCount||0)+1,u.insertBefore(U,Qt(e))}}}return N(e),!0}return e instanceof b&&!gn(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&x(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):($&&e.nodeType===de.text&&(r=e.textContent,Re([Ne,Ie,ke],u=>{r=ce(r,u," ")}),e.textContent!==r&&(se(t.removed,{element:e.cloneNode()}),e.textContent=r)),H(S.afterSanitizeElements,e,null),!1)},Lt=function(e,r,a){if(be[r]||gt&&(r==="id"||r==="name")&&(a in o||a in fn))return!1;if(!(Pe&&!be[r]&&x(on,r))){if(!(dt&&x(an,r))){if(!(B.attributeCheck instanceof Function&&B.attributeCheck(r,e))){if(!A[r]||be[r]){if(!(Dt(e)&&(p.tagNameCheck instanceof RegExp&&x(p.tagNameCheck,e)||p.tagNameCheck instanceof Function&&p.tagNameCheck(e))&&(p.attributeNameCheck instanceof RegExp&&x(p.attributeNameCheck,r)||p.attributeNameCheck instanceof Function&&p.attributeNameCheck(r,e))||r==="is"&&p.allowCustomizedBuiltInElements&&(p.tagNameCheck instanceof RegExp&&x(p.tagNameCheck,a)||p.tagNameCheck instanceof Function&&p.tagNameCheck(a))))return!1}else if(!Be[r]){if(!x(ct,ce(a,st,""))){if(!((r==="src"||r==="xlink:href"||r==="href")&&e!=="script"&&yn(a,"data:")===0&&Tt[e])){if(!(mt&&!x(ln,ce(a,st,"")))){if(a)return!1}}}}}}}return!0},Dt=function(e){return e!=="annotation-xml"&&qe(e,sn)},wt=function(e){H(S.beforeSanitizeAttributes,e,null);const{attributes:r}=e;if(!r||Ve(e))return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let u=r.length;for(;u--;){const y=r[u],{name:d,namespaceURI:D,value:U}=y,Q=g(d),Ye=U;let _=d==="value"?Ye:vn(Ye);if(a.attrName=Q,a.attrValue=_,a.keepAttr=!0,a.forceKeepAttr=void 0,H(S.uponSanitizeAttribute,e,a),_=a.attrValue,ht&&(Q==="id"||Q==="name")&&(Y(d,e),_=cn+_),Ee&&x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,_)){Y(d,e);continue}if(Q==="attributename"&&qe(_,"href")){Y(d,e);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){Y(d,e);continue}if(!ft&&x(/\/>/i,_)){Y(d,e);continue}$&&Re([Ne,Ie,ke],Ot=>{_=ce(_,Ot," ")});const Ct=g(e.nodeName);if(!Lt(Ct,Q,_)){Y(d,e);continue}if(v&&typeof he=="object"&&typeof he.getAttributeType=="function"&&!D)switch(he.getAttributeType(Ct,Q)){case"TrustedHTML":{_=v.createHTML(_);break}case"TrustedScriptURL":{_=v.createScriptURL(_);break}}if(_!==Ye)try{D?e.setAttributeNS(D,d,_):e.setAttribute(d,_),Ve(e)?N(e):Nt(t.removed)}catch{Y(d,e)}}H(S.afterSanitizeAttributes,e,null)},hn=function i(e){let r=null;const a=St(e);for(H(S.beforeSanitizeShadowDOM,e,null);r=a.nextNode();)H(S.uponSanitizeShadowNode,r,null),Rt(r),wt(r),r.content instanceof f&&i(r.content);H(S.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=null,a=null,u=null,y=null;if(Ge=!i,Ge&&(i="<!-->"),typeof i!="string"&&!xt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw ue("dirty is not a string, aborting")}else throw ue("toString is not a function");if(!t.isSupported)return i;if(Fe||je(e),t.removed=[],typeof i=="string"&&(ie=!1),ie){if(i.nodeName){const U=g(i.nodeName);if(!h[U]||ae[U])throw ue("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof z)r=vt("<!---->"),a=r.ownerDocument.importNode(i,!0),a.nodeType===de.element&&a.nodeName==="BODY"||a.nodeName==="HTML"?r=a:r.appendChild(a);else{if(!q&&!$&&!V&&i.indexOf("<")===-1)return v&&_e?v.createHTML(i):i;if(r=vt(i),!r)return q?null:_e?oe:""}r&&He&&N(r.firstChild);const d=St(ie?i:r);for(;u=d.nextNode();)Rt(u),wt(u),u.content instanceof f&&hn(u.content);if(ie)return i;if(q){if(Ae)for(y=tn.call(r.ownerDocument);r.firstChild;)y.appendChild(r.firstChild);else y=r;return(A.shadowroot||A.shadowrootmode)&&(y=rn.call(l,y,!0)),y}let D=V?r.outerHTML:r.innerHTML;return V&&h["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&x(Wt,r.ownerDocument.doctype.name)&&(D="<!DOCTYPE "+r.ownerDocument.doctype.name+`>
2
- `+D),$&&Re([Ne,Ie,ke],U=>{D=ce(D,U," ")}),v&&_e?v.createHTML(D):D},t.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};je(i),Fe=!0},t.clearConfig=function(){K=null,Fe=!1},t.isValidAttribute=function(i,e,r){K||je({});const a=g(i),u=g(e);return Lt(a,u,r)},t.addHook=function(i,e){typeof e=="function"&&se(S[i],e)},t.removeHook=function(i,e){if(e!==void 0){const r=An(S[i],e);return r===-1?void 0:_n(S[i],r,1)[0]}return Nt(S[i])},t.removeHooks=function(i){S[i]=[]},t.removeAllHooks=function(){S=Ut()},t}var Hn=jt();let m=null,P=null,J=null,T=null,ee="",te="",me="insert",fe=null,k=null,Ce=null;function Vt(n,t){if(t===n.innerHTML)return;const o=window.execEditorCommand||window.executeEditorCommand;if(typeof o=="function")try{o("recordDomTransaction",n,t,n.innerHTML)}catch{}}function Un(n){if(!n)return null;let t=n.startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const o=t;if(o.getAttribute("contenteditable")==="true")return o}t=t.parentNode}return null}const Yt=[{id:"formal-letter",name:"Formal Letter",category:"Letters",description:"Professional business letter template",html:`<p><strong>{{ Company Name }}</strong></p>
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const bn=require("./escapeHtml-D2Zh82pD.js"),En=require("./dialogHelpers-zU6zpMIA.js");const{entries:Gt,setPrototypeOf:Nt,isFrozen:An,getPrototypeOf:_n,getOwnPropertyDescriptor:yn}=Object;let{freeze:R,seal:N,create:De}=Object,{apply:et,construct:tt}=typeof Reflect<"u"&&Reflect;R||(R=function(t){return t});N||(N=function(t){return t});et||(et=function(t,o){for(var l=arguments.length,c=new Array(l>2?l-2:0),d=2;d<l;d++)c[d-2]=arguments[d];return t.apply(o,c)});tt||(tt=function(t){for(var o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];return new t(...l)});const Re=L(Array.prototype.forEach),vn=L(Array.prototype.lastIndexOf),Mt=L(Array.prototype.pop),se=L(Array.prototype.push),Sn=L(Array.prototype.splice),Ce=L(String.prototype.toLowerCase),$e=L(String.prototype.toString),qe=L(String.prototype.match),ce=L(String.prototype.replace),xn=L(String.prototype.indexOf),Rn=L(String.prototype.trim),C=L(Object.prototype.hasOwnProperty),x=L(RegExp.prototype.test),ue=Ln(TypeError);function L(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];return et(n,t,l)}}function Ln(n){return function(){for(var t=arguments.length,o=new Array(t),l=0;l<t;l++)o[l]=arguments[l];return tt(n,o)}}function s(n,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ce;Nt&&Nt(n,null);let l=t.length;for(;l--;){let c=t[l];if(typeof c=="string"){const d=o(c);d!==c&&(An(t)||(t[l]=d),c=d)}n[c]=!0}return n}function Dn(n){for(let t=0;t<n.length;t++)C(n,t)||(n[t]=null);return n}function k(n){const t=De(null);for(const[o,l]of Gt(n))C(n,o)&&(Array.isArray(l)?t[o]=Dn(l):l&&typeof l=="object"&&l.constructor===Object?t[o]=k(l):t[o]=l);return t}function pe(n,t){for(;n!==null;){const l=yn(n,t);if(l){if(l.get)return L(l.get);if(typeof l.value=="function")return L(l.value)}n=_n(n)}function o(){return null}return o}const It=R(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Xe=R(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ke=R(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Cn=R(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ze=R(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),wn=R(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kt=R(["#text"]),Pt=R(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Qe=R(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ht=R(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Le=R(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),On=N(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nn=N(/<%[\w\W]*|[\w\W]*%>/gm),Mn=N(/\$\{[\w\W]*/gm),In=N(/^data-[\-\w.\u00B7-\uFFFF]+$/),kn=N(/^aria-[\-\w]+$/),Wt=N(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pn=N(/^(?:\w+script|data):/i),Hn=N(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jt=N(/^html$/i),Fn=N(/^[a-z][.\w]*(-[.\w]+)+$/i);var Ft=Object.freeze({__proto__:null,ARIA_ATTR:kn,ATTR_WHITESPACE:Hn,CUSTOM_ELEMENT:Fn,DATA_ATTR:In,DOCTYPE_NAME:jt,ERB_EXPR:Nn,IS_ALLOWED_URI:Wt,IS_SCRIPT_OR_DATA:Pn,MUSTACHE_EXPR:On,TMPLIT_EXPR:Mn});const de={element:1,text:3,progressingInstruction:7,comment:8,document:9},Un=function(){return typeof window>"u"?null:window},zn=function(t,o){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let l=null;const c="data-tt-policy-suffix";o&&o.hasAttribute(c)&&(l=o.getAttribute(c));const d="dompurify"+(l?"#"+l:"");try{return t.createPolicy(d,{createHTML(w){return w},createScriptURL(w){return w}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},Ut=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Vt(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Un();const t=i=>Vt(i);if(t.version="3.3.2",t.removed=[],!n||!n.document||n.document.nodeType!==de.document||!n.Element)return t.isSupported=!1,t;let{document:o}=n;const l=o,c=l.currentScript,{DocumentFragment:d,HTMLTemplateElement:w,Node:H,Element:p,NodeFilter:m,NamedNodeMap:W=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:j,DOMParser:Oe,trustedTypes:he}=n,re=p.prototype,Zt=pe(re,"cloneNode"),Qt=pe(re,"remove"),Jt=pe(re,"nextSibling"),en=pe(re,"childNodes"),Te=pe(re,"parentNode");if(typeof w=="function"){const i=o.createElement("template");i.content&&i.content.ownerDocument&&(o=i.content.ownerDocument)}let v,oe="";const{implementation:Ne,createNodeIterator:tn,createDocumentFragment:nn,getElementsByTagName:rn}=o,{importNode:on}=l;let S=Ut();t.isSupported=typeof Gt=="function"&&typeof Te=="function"&&Ne&&Ne.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Me,ERB_EXPR:Ie,TMPLIT_EXPR:ke,DATA_ATTR:an,ARIA_ATTR:ln,IS_SCRIPT_OR_DATA:sn,ATTR_WHITESPACE:st,CUSTOM_ELEMENT:cn}=Ft;let{IS_ALLOWED_URI:ct}=Ft,b=null;const ut=s({},[...It,...Xe,...Ke,...Ze,...kt]);let A=null;const pt=s({},[...Pt,...Qe,...Ht,...Le]);let f=Object.seal(De(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ae=null,be=null;const G=Object.seal(De(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let dt=!0,Pe=!0,mt=!1,ft=!0,$=!1,Ee=!0,V=!1,He=!1,Fe=!1,q=!1,Ae=!1,_e=!1,gt=!0,ht=!1;const un="user-content-";let Ue=!0,ie=!1,X={},M=null;const ze=s({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Tt=null;const bt=s({},["audio","video","img","source","image","track"]);let Be=null;const Et=s({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ye="http://www.w3.org/1998/Math/MathML",ve="http://www.w3.org/2000/svg",F="http://www.w3.org/1999/xhtml";let K=F,Ge=!1,We=null;const pn=s({},[ye,ve,F],$e);let Se=s({},["mi","mo","mn","ms","mtext"]),xe=s({},["annotation-xml"]);const dn=s({},["title","style","font","a","script"]);let le=null;const mn=["application/xhtml+xml","text/html"],fn="text/html";let T=null,Z=null;const gn=o.createElement("form"),At=function(e){return e instanceof RegExp||e instanceof Function},je=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Z&&Z===e)){if((!e||typeof e!="object")&&(e={}),e=k(e),le=mn.indexOf(e.PARSER_MEDIA_TYPE)===-1?fn:e.PARSER_MEDIA_TYPE,T=le==="application/xhtml+xml"?$e:Ce,b=C(e,"ALLOWED_TAGS")?s({},e.ALLOWED_TAGS,T):ut,A=C(e,"ALLOWED_ATTR")?s({},e.ALLOWED_ATTR,T):pt,We=C(e,"ALLOWED_NAMESPACES")?s({},e.ALLOWED_NAMESPACES,$e):pn,Be=C(e,"ADD_URI_SAFE_ATTR")?s(k(Et),e.ADD_URI_SAFE_ATTR,T):Et,Tt=C(e,"ADD_DATA_URI_TAGS")?s(k(bt),e.ADD_DATA_URI_TAGS,T):bt,M=C(e,"FORBID_CONTENTS")?s({},e.FORBID_CONTENTS,T):ze,ae=C(e,"FORBID_TAGS")?s({},e.FORBID_TAGS,T):k({}),be=C(e,"FORBID_ATTR")?s({},e.FORBID_ATTR,T):k({}),X=C(e,"USE_PROFILES")?e.USE_PROFILES:!1,dt=e.ALLOW_ARIA_ATTR!==!1,Pe=e.ALLOW_DATA_ATTR!==!1,mt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ft=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,V=e.WHOLE_DOCUMENT||!1,q=e.RETURN_DOM||!1,Ae=e.RETURN_DOM_FRAGMENT||!1,_e=e.RETURN_TRUSTED_TYPE||!1,Fe=e.FORCE_BODY||!1,gt=e.SANITIZE_DOM!==!1,ht=e.SANITIZE_NAMED_PROPS||!1,Ue=e.KEEP_CONTENT!==!1,ie=e.IN_PLACE||!1,ct=e.ALLOWED_URI_REGEXP||Wt,K=e.NAMESPACE||F,Se=e.MATHML_TEXT_INTEGRATION_POINTS||Se,xe=e.HTML_INTEGRATION_POINTS||xe,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&At(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&At(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$&&(Pe=!1),Ae&&(q=!0),X&&(b=s({},kt),A=De(null),X.html===!0&&(s(b,It),s(A,Pt)),X.svg===!0&&(s(b,Xe),s(A,Qe),s(A,Le)),X.svgFilters===!0&&(s(b,Ke),s(A,Qe),s(A,Le)),X.mathMl===!0&&(s(b,Ze),s(A,Ht),s(A,Le))),C(e,"ADD_TAGS")||(G.tagCheck=null),C(e,"ADD_ATTR")||(G.attributeCheck=null),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?G.tagCheck=e.ADD_TAGS:(b===ut&&(b=k(b)),s(b,e.ADD_TAGS,T))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?G.attributeCheck=e.ADD_ATTR:(A===pt&&(A=k(A)),s(A,e.ADD_ATTR,T))),e.ADD_URI_SAFE_ATTR&&s(Be,e.ADD_URI_SAFE_ATTR,T),e.FORBID_CONTENTS&&(M===ze&&(M=k(M)),s(M,e.FORBID_CONTENTS,T)),e.ADD_FORBID_CONTENTS&&(M===ze&&(M=k(M)),s(M,e.ADD_FORBID_CONTENTS,T)),Ue&&(b["#text"]=!0),V&&s(b,["html","head","body"]),b.table&&(s(b,["tbody"]),delete ae.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw ue('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ue('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=e.TRUSTED_TYPES_POLICY,oe=v.createHTML("")}else v===void 0&&(v=zn(he,c)),v!==null&&typeof oe=="string"&&(oe=v.createHTML(""));R&&R(e),Z=e}},_t=s({},[...Xe,...Ke,...Cn]),yt=s({},[...Ze,...wn]),hn=function(e){let r=Te(e);(!r||!r.tagName)&&(r={namespaceURI:K,tagName:"template"});const a=Ce(e.tagName),u=Ce(r.tagName);return We[e.namespaceURI]?e.namespaceURI===ve?r.namespaceURI===F?a==="svg":r.namespaceURI===ye?a==="svg"&&(u==="annotation-xml"||Se[u]):!!_t[a]:e.namespaceURI===ye?r.namespaceURI===F?a==="math":r.namespaceURI===ve?a==="math"&&xe[u]:!!yt[a]:e.namespaceURI===F?r.namespaceURI===ve&&!xe[u]||r.namespaceURI===ye&&!Se[u]?!1:!yt[a]&&(dn[a]||!_t[a]):!!(le==="application/xhtml+xml"&&We[e.namespaceURI]):!1},I=function(e){se(t.removed,{element:e});try{Te(e).removeChild(e)}catch{Qt(e)}},Y=function(e,r){try{se(t.removed,{attribute:r.getAttributeNode(e),from:r})}catch{se(t.removed,{attribute:null,from:r})}if(r.removeAttribute(e),e==="is")if(q||Ae)try{I(r)}catch{}else try{r.setAttribute(e,"")}catch{}},vt=function(e){let r=null,a=null;if(Fe)e="<remove></remove>"+e;else{const g=qe(e,/^[\r\n\t ]+/);a=g&&g[0]}le==="application/xhtml+xml"&&K===F&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const u=v?v.createHTML(e):e;if(K===F)try{r=new Oe().parseFromString(u,le)}catch{}if(!r||!r.documentElement){r=Ne.createDocument(K,"template",null);try{r.documentElement.innerHTML=Ge?oe:u}catch{}}const y=r.body||r.documentElement;return e&&a&&y.insertBefore(o.createTextNode(a),y.childNodes[0]||null),K===F?rn.call(r,V?"html":"body")[0]:V?r.documentElement:y},St=function(e){return tn.call(e.ownerDocument||e,e,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null)},Ve=function(e){return e instanceof j&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof W)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},xt=function(e){return typeof H=="function"&&e instanceof H};function U(i,e,r){Re(i,a=>{a.call(t,e,r,Z)})}const Rt=function(e){let r=null;if(U(S.beforeSanitizeElements,e,null),Ve(e))return I(e),!0;const a=T(e.nodeName);if(U(S.uponSanitizeElement,e,{tagName:a,allowedTags:b}),Ee&&e.hasChildNodes()&&!xt(e.firstElementChild)&&x(/<[/\w!]/g,e.innerHTML)&&x(/<[/\w!]/g,e.textContent)||e.nodeType===de.progressingInstruction||Ee&&e.nodeType===de.comment&&x(/<[/\w]/g,e.data))return I(e),!0;if(!(G.tagCheck instanceof Function&&G.tagCheck(a))&&(!b[a]||ae[a])){if(!ae[a]&&Dt(a)&&(f.tagNameCheck instanceof RegExp&&x(f.tagNameCheck,a)||f.tagNameCheck instanceof Function&&f.tagNameCheck(a)))return!1;if(Ue&&!M[a]){const u=Te(e)||e.parentNode,y=en(e)||e.childNodes;if(y&&u){const g=y.length;for(let D=g-1;D>=0;--D){const z=Zt(y[D],!0);z.__removalCount=(e.__removalCount||0)+1,u.insertBefore(z,Jt(e))}}}return I(e),!0}return e instanceof p&&!hn(e)||(a==="noscript"||a==="noembed"||a==="noframes")&&x(/<\/no(script|embed|frames)/i,e.innerHTML)?(I(e),!0):($&&e.nodeType===de.text&&(r=e.textContent,Re([Me,Ie,ke],u=>{r=ce(r,u," ")}),e.textContent!==r&&(se(t.removed,{element:e.cloneNode()}),e.textContent=r)),U(S.afterSanitizeElements,e,null),!1)},Lt=function(e,r,a){if(be[r]||gt&&(r==="id"||r==="name")&&(a in o||a in gn))return!1;if(!(Pe&&!be[r]&&x(an,r))){if(!(dt&&x(ln,r))){if(!(G.attributeCheck instanceof Function&&G.attributeCheck(r,e))){if(!A[r]||be[r]){if(!(Dt(e)&&(f.tagNameCheck instanceof RegExp&&x(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&x(f.attributeNameCheck,r)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(r,e))||r==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&x(f.tagNameCheck,a)||f.tagNameCheck instanceof Function&&f.tagNameCheck(a))))return!1}else if(!Be[r]){if(!x(ct,ce(a,st,""))){if(!((r==="src"||r==="xlink:href"||r==="href")&&e!=="script"&&xn(a,"data:")===0&&Tt[e])){if(!(mt&&!x(sn,ce(a,st,"")))){if(a)return!1}}}}}}}return!0},Dt=function(e){return e!=="annotation-xml"&&qe(e,cn)},Ct=function(e){U(S.beforeSanitizeAttributes,e,null);const{attributes:r}=e;if(!r||Ve(e))return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:A,forceKeepAttr:void 0};let u=r.length;for(;u--;){const y=r[u],{name:g,namespaceURI:D,value:z}=y,Q=T(g),Ye=z;let _=g==="value"?Ye:Rn(Ye);if(a.attrName=Q,a.attrValue=_,a.keepAttr=!0,a.forceKeepAttr=void 0,U(S.uponSanitizeAttribute,e,a),_=a.attrValue,ht&&(Q==="id"||Q==="name")&&(Y(g,e),_=un+_),Ee&&x(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,_)){Y(g,e);continue}if(Q==="attributename"&&qe(_,"href")){Y(g,e);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){Y(g,e);continue}if(!ft&&x(/\/>/i,_)){Y(g,e);continue}$&&Re([Me,Ie,ke],Ot=>{_=ce(_,Ot," ")});const wt=T(e.nodeName);if(!Lt(wt,Q,_)){Y(g,e);continue}if(v&&typeof he=="object"&&typeof he.getAttributeType=="function"&&!D)switch(he.getAttributeType(wt,Q)){case"TrustedHTML":{_=v.createHTML(_);break}case"TrustedScriptURL":{_=v.createScriptURL(_);break}}if(_!==Ye)try{D?e.setAttributeNS(D,g,_):e.setAttribute(g,_),Ve(e)?I(e):Mt(t.removed)}catch{Y(g,e)}}U(S.afterSanitizeAttributes,e,null)},Tn=function i(e){let r=null;const a=St(e);for(U(S.beforeSanitizeShadowDOM,e,null);r=a.nextNode();)U(S.uponSanitizeShadowNode,r,null),Rt(r),Ct(r),r.content instanceof d&&i(r.content);U(S.afterSanitizeShadowDOM,e,null)};return t.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=null,a=null,u=null,y=null;if(Ge=!i,Ge&&(i="<!-->"),typeof i!="string"&&!xt(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw ue("dirty is not a string, aborting")}else throw ue("toString is not a function");if(!t.isSupported)return i;if(He||je(e),t.removed=[],typeof i=="string"&&(ie=!1),ie){if(i.nodeName){const z=T(i.nodeName);if(!b[z]||ae[z])throw ue("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof H)r=vt("<!---->"),a=r.ownerDocument.importNode(i,!0),a.nodeType===de.element&&a.nodeName==="BODY"||a.nodeName==="HTML"?r=a:r.appendChild(a);else{if(!q&&!$&&!V&&i.indexOf("<")===-1)return v&&_e?v.createHTML(i):i;if(r=vt(i),!r)return q?null:_e?oe:""}r&&Fe&&I(r.firstChild);const g=St(ie?i:r);for(;u=g.nextNode();)Rt(u),Ct(u),u.content instanceof d&&Tn(u.content);if(ie)return i;if(q){if(Ae)for(y=nn.call(r.ownerDocument);r.firstChild;)y.appendChild(r.firstChild);else y=r;return(A.shadowroot||A.shadowrootmode)&&(y=on.call(l,y,!0)),y}let D=V?r.outerHTML:r.innerHTML;return V&&b["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&x(jt,r.ownerDocument.doctype.name)&&(D="<!DOCTYPE "+r.ownerDocument.doctype.name+`>
2
+ `+D),$&&Re([Me,Ie,ke],z=>{D=ce(D,z," ")}),v&&_e?v.createHTML(D):D},t.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};je(i),He=!0},t.clearConfig=function(){Z=null,He=!1},t.isValidAttribute=function(i,e,r){Z||je({});const a=T(i),u=T(e);return Lt(a,u,r)},t.addHook=function(i,e){typeof e=="function"&&se(S[i],e)},t.removeHook=function(i,e){if(e!==void 0){const r=vn(S[i],e);return r===-1?void 0:Sn(S[i],r,1)[0]}return Mt(S[i])},t.removeHooks=function(i){S[i]=[]},t.removeAllHooks=function(){S=Ut()},t}var Bn=Vt();let h=null,O=null,J=null,E=null,ee="",te="",me="insert",fe=null,P=null,we=null;function Yt(n,t){if(t===n.innerHTML)return;const o=window.execEditorCommand||window.executeEditorCommand;if(typeof o=="function")try{o("recordDomTransaction",n,t,n.innerHTML)}catch{}}function Gn(n){if(!n)return null;let t=n.startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const o=t;if(o.getAttribute("contenteditable")==="true")return o}t=t.parentNode}return null}const $t=[{id:"formal-letter",name:"Formal Letter",category:"Letters",description:"Professional business letter template",html:`<p><strong>{{ Company Name }}</strong></p>
3
3
  <p>{{ Today }}</p>
4
4
  <p>Dear {{ first_name }} {{ last_name }},</p>
5
5
  <p>I hope this letter finds you well. [Your letter content here]</p>
@@ -41,7 +41,7 @@
41
41
  <h3>Q: How do I get started?</h3>
42
42
  <p>A: [Answer here]</p>
43
43
  <h3>Q: What are the requirements?</h3>
44
- <p>A: [Answer here]</p>`}];let ne=[...Yt];const nt=()=>ne,zn=n=>ne.filter(t=>t.category===n),rt=()=>{const n=new Set(ne.map(t=>t.category));return Array.from(n)},$t=n=>{const t=n.toLowerCase();return ne.filter(o=>o.name.toLowerCase().includes(t)||o.description?.toLowerCase().includes(t)||o.tags?.some(l=>l.toLowerCase().includes(t)))},ot=n=>Hn.sanitize(n,{ALLOWED_TAGS:["p","br","strong","em","u","h1","h2","h3","h4","ul","ol","li","blockquote","table","thead","tbody","tr","th","td","a","span"],ALLOWED_ATTR:["href","target","class","data-key","data-category"]}),Bn=n=>ne.some(t=>t.id===n.id)?(console.warn(`Template with ID ${n.id} already exists`),!1):(ne.push(n),!0),Gn=n=>!!(n.id&&n.name&&n.category&&n.html&&n.html.trim().length>0);function Wn(n){P=document.createElement("div"),P.className="rte-dialog-overlay",Yn(n)&&P.classList.add("rte-ui-theme-dark"),P.addEventListener("click",()=>G()),m=document.createElement("div"),m.className="rte-dialog rte-template-dialog",m.addEventListener("click",o=>o.stopPropagation());const t=rt();t.length>0&&!ee&&(ee=t[0]),ge(),P.appendChild(m),document.body.appendChild(P),jn(),Qn()}function jn(){qt(),fe=n=>{n.key==="Escape"&&(!P||!m||(n.preventDefault(),n.stopPropagation(),G()))},document.addEventListener("keydown",fe,!0)}function qt(){fe&&(document.removeEventListener("keydown",fe,!0),fe=null)}const Vn='[data-theme="dark"], .dark, .editora-theme-dark',at=()=>{const n=window.getSelection();if(!n||n.rangeCount===0)return null;const t=n.anchorNode;return(t instanceof HTMLElement?t:t?.parentElement)?.closest(".rte-content, .editora-content")||null},Yn=n=>{const t=n||at();return t?!!t.closest(Vn):!1};function it(){const n=Un(J);if(n)return n;if(Ce?.isConnected)return Ce;const t=at();return t||document.querySelector(".rte-content, .editora-content")}function ge(){if(!m)return;const n=rt(),t=lt();m.innerHTML=`
44
+ <p>A: [Answer here]</p>`}],ne=[...$t],nt=()=>ne,Wn=n=>ne.filter(t=>t.category===n),rt=()=>{const n=new Set(ne.map(t=>t.category));return Array.from(n)},qt=n=>{const t=n.toLowerCase();return ne.filter(o=>o.name.toLowerCase().includes(t)||o.description?.toLowerCase().includes(t)||o.tags?.some(l=>l.toLowerCase().includes(t)))},ot=n=>Bn.sanitize(n,{ALLOWED_TAGS:["p","br","strong","em","u","h1","h2","h3","h4","ul","ol","li","blockquote","table","thead","tbody","tr","th","td","a","span"],ALLOWED_ATTR:["href","target","class","data-key","data-category"]}),jn=n=>ne.some(t=>t.id===n.id)?(console.warn(`Template with ID ${n.id} already exists`),!1):(ne.push(n),!0),Vn=n=>!!(n.id&&n.name&&n.category&&n.html&&n.html.trim().length>0);function Yn(n){O&&B(),O=document.createElement("div"),En.initDialogOverlay(O),O.className="rte-dialog-overlay",Xn(n)&&O.classList.add("rte-ui-theme-dark"),O.addEventListener("click",()=>B()),h=document.createElement("div"),h.className="rte-dialog rte-template-dialog",h.addEventListener("click",o=>o.stopPropagation());const t=rt();t.length>0&&!ee&&(ee=t[0]),ge(),O.appendChild(h),document.body.appendChild(O),$n(),nr()}function $n(){Xt(),fe=n=>{n.key==="Escape"&&(!O||!h||(n.preventDefault(),n.stopPropagation(),B()))},document.addEventListener("keydown",fe,!0)}function Xt(){fe&&(document.removeEventListener("keydown",fe,!0),fe=null)}const qn='[data-theme="dark"], .dark, .editora-theme-dark',at=()=>{const n=window.getSelection();if(!n||n.rangeCount===0)return null;const t=n.anchorNode;return(t instanceof HTMLElement?t:t?.parentElement)?.closest(".rte-content, .editora-content")||null},Xn=n=>{const t=n||at();return t?!!t.closest(qn):!1};function it(){const n=Gn(J);if(n)return n;if(we?.isConnected)return we;const t=at();return t||document.querySelector(".rte-content, .editora-content")}function ge(){if(!h)return;const n=rt(),t=lt();h.innerHTML=`
45
45
  <div class="rte-dialog-header">
46
46
  <h2>Insert Template</h2>
47
47
  <button class="rte-dialog-close" aria-label="Close">✕</button>
@@ -52,7 +52,7 @@
52
52
  <input
53
53
  type="text"
54
54
  placeholder="Search templates..."
55
- value="${te}"
55
+ value="${bn.escapeHtml(te)}"
56
56
  class="rte-input rte-template-search"
57
57
  aria-label="Search templates"
58
58
  />
@@ -70,7 +70,7 @@
70
70
  <div class="rte-template-list">
71
71
  ${t.length>0?t.map(o=>`
72
72
  <div
73
- class="rte-template-item ${T?.id===o.id?"selected":""}"
73
+ class="rte-template-item ${E?.id===o.id?"selected":""}"
74
74
  data-template-id="${o.id}"
75
75
  >
76
76
  <div class="template-name">${o.name}</div>
@@ -80,10 +80,10 @@
80
80
  </div>
81
81
 
82
82
  <!-- Preview -->
83
- ${T?`
83
+ ${E?`
84
84
  <div class="rte-template-preview">
85
85
  <strong>Preview:</strong>
86
- <div class="template-preview-content">${T.html}</div>
86
+ <div class="template-preview-content">${E.html}</div>
87
87
  </div>
88
88
  `:""}
89
89
 
@@ -102,11 +102,11 @@
102
102
 
103
103
  <div class="rte-dialog-footer">
104
104
  <button class="rte-button-secondary rte-cancel-btn">Cancel</button>
105
- <button class="rte-button-primary rte-insert-btn" ${T?"":"disabled"}>
105
+ <button class="rte-button-primary rte-insert-btn" ${E?"":"disabled"}>
106
106
  ${me==="insert"?"Insert":"Replace"}
107
107
  </button>
108
108
  </div>
109
- `,qn()}function $n(){if(!m)return;m.innerHTML=`
109
+ `,Zn()}function Kn(){if(!h)return;h.innerHTML=`
110
110
  <div class="rte-dialog-header">
111
111
  <h2>Replace Document?</h2>
112
112
  </div>
@@ -117,7 +117,7 @@
117
117
  <button class="rte-button-secondary rte-cancel-warning-btn">Cancel</button>
118
118
  <button class="rte-button-primary rte-confirm-replace-btn">Replace</button>
119
119
  </div>
120
- `;const n=m.querySelector(".rte-cancel-warning-btn"),t=m.querySelector(".rte-confirm-replace-btn");n?.addEventListener("click",()=>ge()),t?.addEventListener("click",()=>Xn())}function lt(){const n=nt();return te.trim()?$t(te):ee?n.filter(t=>t.category===ee):n}function qn(){if(!m)return;m.querySelector(".rte-dialog-close")?.addEventListener("click",()=>G()),m.querySelector(".rte-cancel-btn")?.addEventListener("click",()=>G()),m.querySelector(".rte-insert-btn")?.addEventListener("click",()=>Je());const l=m.querySelector(".rte-template-search");l?.addEventListener("input",b=>{k!==null&&cancelAnimationFrame(k),te=b.target.value,k=requestAnimationFrame(()=>{k=null,zt()})}),l?.addEventListener("keydown",b=>{b.key==="Enter"&&T?Je():b.key==="Escape"&&G()}),m.querySelector(".rte-tabs")?.addEventListener("click",b=>{const W=b.target.closest(".rte-tab");if(!W)return;const j=W.getAttribute("data-category");j&&(ee=j,te="",k!==null&&(cancelAnimationFrame(k),k=null),zt())});const f=m.querySelector(".rte-template-list"),w=b=>{const W=b.target.closest(".rte-template-item");if(!W)return null;const j=W.getAttribute("data-template-id");return j&&nt().find(Oe=>Oe.id===j)||null};f?.addEventListener("click",b=>{const E=w(b);E&&(T=E,ge())}),f?.addEventListener("dblclick",b=>{const E=w(b);E&&(T=E,Je())}),m.querySelector(".rte-insert-mode")?.addEventListener("change",b=>{const E=b.target;!E||E.name!=="insertMode"||(me=E.value,ge())})}function zt(){const n=lt();n.length>0?(!T||!n.find(t=>t.id===T.id))&&(T=n[0]):T=null,ge()}function Je(){if(T)if(me==="replace"){if(it()?.innerHTML?.trim()){$n();return}Xt(T),G()}else Zn(T),G()}function Xn(){T&&(Xt(T),G())}function Zn(n){const t=window.getSelection();if(!t)return;const o=it();if(!o)return;if(J)t.removeAllRanges(),t.addRange(J);else{const z=document.createRange();z.selectNodeContents(o),z.collapse(!1),t.removeAllRanges(),t.addRange(z)}if(t.rangeCount===0)return;const l=t.getRangeAt(0),c=o?.innerHTML??"",f=document.createRange().createContextualFragment(ot(n.html));l.deleteContents(),l.insertNode(f);const w=document.createRange();w.setStartAfter(l.endContainer),w.collapse(!0),t.removeAllRanges(),t.addRange(w),o&&(Vt(o,c),o.dispatchEvent(new Event("input",{bubbles:!0})))}function Xt(n){const t=it();if(t){const o=t.innerHTML;t.innerHTML=ot(n.html),Vt(t,o),t.dispatchEvent(new Event("input",{bubbles:!0}))}}function G(){qt(),k!==null&&(cancelAnimationFrame(k),k=null),P&&(P.remove(),P=null),m=null,J=null,te="",Ce=null}function Kn(n){const t=window.getSelection();t&&t.rangeCount>0?J=t.getRangeAt(0).cloneRange():J=null;const o=lt();o.length>0&&!T&&(T=o[0]);const l=n?.contentElement instanceof HTMLElement?n.contentElement:at();Ce=l||null,Wn(l)}function Qn(){if(typeof document>"u")return;const n="template-plugin-dialog-styles";if(document.getElementById(n))return;const t=document.createElement("style");t.id=n,t.textContent=`
120
+ `;const n=h.querySelector(".rte-cancel-warning-btn"),t=h.querySelector(".rte-confirm-replace-btn");n?.addEventListener("click",()=>ge()),t?.addEventListener("click",()=>Qn())}function lt(){const n=nt();return te.trim()?qt(te):ee?n.filter(t=>t.category===ee):n}function Zn(){if(!h)return;h.querySelector(".rte-dialog-close")?.addEventListener("click",()=>B()),h.querySelector(".rte-cancel-btn")?.addEventListener("click",()=>B()),h.querySelector(".rte-insert-btn")?.addEventListener("click",()=>Je());const l=h.querySelector(".rte-template-search");l?.addEventListener("input",p=>{P!==null&&cancelAnimationFrame(P),te=p.target.value,P=requestAnimationFrame(()=>{P=null,zt()})}),l?.addEventListener("keydown",p=>{p.key==="Enter"&&E?Je():p.key==="Escape"&&B()}),h.querySelector(".rte-tabs")?.addEventListener("click",p=>{const W=p.target.closest(".rte-tab");if(!W)return;const j=W.getAttribute("data-category");j&&(ee=j,te="",P!==null&&(cancelAnimationFrame(P),P=null),zt())});const d=h.querySelector(".rte-template-list"),w=p=>{const W=p.target.closest(".rte-template-item");if(!W)return null;const j=W.getAttribute("data-template-id");return j&&nt().find(Oe=>Oe.id===j)||null};d?.addEventListener("click",p=>{const m=w(p);m&&(E=m,ge())}),d?.addEventListener("dblclick",p=>{const m=w(p);m&&(E=m,Je())}),h.querySelector(".rte-insert-mode")?.addEventListener("change",p=>{const m=p.target;!m||m.name!=="insertMode"||(me=m.value,ge())})}function zt(){const n=lt();n.length>0?(!E||!n.find(t=>t.id===E.id))&&(E=n[0]):E=null,ge()}function Je(){if(E)if(me==="replace"){if(it()?.innerHTML?.trim()){Kn();return}Kt(E),B()}else er(E),B()}function Qn(){E&&(Kt(E),B())}const Jn=new Set(["DIV","P","BLOCKQUOTE","PRE","H1","H2","H3","H4","H5","H6","LI","TD","TH"]);function Bt(n,t){let o=n;for(;o&&o!==t;){if(o.nodeType===Node.ELEMENT_NODE&&Jn.has(o.tagName))return o;o=o.parentNode}return null}function er(n){const t=window.getSelection();if(!t)return;const o=it();if(!o)return;if(J)t.removeAllRanges(),t.addRange(J);else{const m=document.createRange();m.selectNodeContents(o),m.collapse(!1),t.removeAllRanges(),t.addRange(m)}if(t.rangeCount===0)return;const l=t.getRangeAt(0),c=o?.innerHTML??"",d=document.createRange().createContextualFragment(ot(n.html));l.deleteContents();const w=d.lastChild,H=Bt(l.endContainer,o)||Bt(l.startContainer,o);H&&H.parentNode?H.parentNode.insertBefore(d,H.nextSibling):l.insertNode(d);const p=document.createRange();w?p.setStartAfter(w):p.setStartAfter(l.endContainer),p.collapse(!0),t.removeAllRanges(),t.addRange(p),o&&(Yt(o,c),o.dispatchEvent(new Event("input",{bubbles:!0})))}function Kt(n){const t=it();if(t){const o=t.innerHTML;t.innerHTML=ot(n.html),Yt(t,o),t.dispatchEvent(new Event("input",{bubbles:!0}))}}function B(){Xt(),P!==null&&(cancelAnimationFrame(P),P=null),O&&(O.remove(),O=null),h=null,J=null,te="",we=null}function tr(n){const t=window.getSelection();t&&t.rangeCount>0?J=t.getRangeAt(0).cloneRange():J=null;const o=lt();o.length>0&&!E&&(E=o[0]);const l=n?.contentElement instanceof HTMLElement?n.contentElement:at();we=l||null,Yn(l)}function nr(){if(typeof document>"u")return;const n="template-plugin-dialog-styles";if(document.getElementById(n))return;const t=document.createElement("style");t.id=n,t.textContent=`
121
121
  .rte-dialog-overlay {
122
122
  --rte-tmpl-overlay-bg: rgba(15, 23, 36, 0.56);
123
123
  --rte-tmpl-dialog-bg: #fff;
@@ -354,4 +354,4 @@
354
354
  .rte-button-secondary:hover {
355
355
  background-color: var(--rte-tmpl-subtle-hover);
356
356
  }
357
- `,document.head.appendChild(t)}const Jn=()=>({name:"template",toolbar:[{label:"Template",command:"insertTemplate",icon:'<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M3 3V9H21V3H3ZM19 5H5V7H19V5Z" fill="#000000"></path> <path fill-rule="evenodd" clip-rule="evenodd" d="M3 11V21H11V11H3ZM9 13H5V19H9V13Z" fill="#000000"></path> <path d="M21 11H13V13H21V11Z" fill="#000000"></path> <path d="M13 15H21V17H13V15Z" fill="#000000"></path> <path d="M21 19H13V21H21V19Z" fill="#000000"></path> </g></svg>'}],commands:{insertTemplate:(n,t)=>(Kn(t),!0)},keymap:{}});exports.PREDEFINED_TEMPLATES=Yt;exports.TemplatePlugin=Jn;exports.addCustomTemplate=Bn;exports.getAllTemplates=nt;exports.getTemplateCategories=rt;exports.getTemplatesByCategory=zn;exports.sanitizeTemplate=ot;exports.searchTemplates=$t;exports.validateTemplate=Gn;
357
+ `,document.head.appendChild(t)}const rr=()=>({name:"template",toolbar:[{label:"Template",command:"insertTemplate",icon:'<svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M3 3V9H21V3H3ZM19 5H5V7H19V5Z" fill="#000000"></path> <path fill-rule="evenodd" clip-rule="evenodd" d="M3 11V21H11V11H3ZM9 13H5V19H9V13Z" fill="#000000"></path> <path d="M21 11H13V13H21V11Z" fill="#000000"></path> <path d="M13 15H21V17H13V15Z" fill="#000000"></path> <path d="M21 19H13V21H21V19Z" fill="#000000"></path> </g></svg>'}],commands:{insertTemplate:(n,t)=>(tr(t),!0)},keymap:{}});exports.PREDEFINED_TEMPLATES=$t;exports.TemplatePlugin=rr;exports.addCustomTemplate=jn;exports.getAllTemplates=nt;exports.getTemplateCategories=rt;exports.getTemplatesByCategory=Wn;exports.sanitizeTemplate=ot;exports.searchTemplates=qt;exports.validateTemplate=Vn;