Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

quill-paste-smart

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

quill-paste-smart - npm Package Compare versions

Comparing version 1.4.0 to 1.4.1

4

dist/quill-paste-smart.js

@@ -1,3 +0,3 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("quill")):"function"==typeof define&&define.amd?define(["quill"],t):"object"==typeof exports?exports.QuillPasteSmart=t(require("quill")):e.QuillPasteSmart=t(e.Quill)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(t,r){t.exports=e},function(e,t,r){
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("quill")):"function"==typeof define&&define.amd?define(["quill"],t):"object"==typeof exports?exports.QuillPasteSmart=t(require("quill")):e.QuillPasteSmart=t(e.Quill)}(window,(function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=2)}([function(e,t,n){
/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.0.8/LICENSE */
e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,r=Object.isFrozen,n=Object.keys,o=Object.freeze,i=Object.seal,a="undefined"!=typeof Reflect&&Reflect,u=a.apply,l=a.construct;u||(u=function(e,t,r){return e.apply(t,r)}),o||(o=function(e){return e}),i||(i=function(e){return e}),l||(l=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(t))))});var s=T(Array.prototype.forEach),c=T(Array.prototype.indexOf),p=T(Array.prototype.join),f=T(Array.prototype.pop),d=T(Array.prototype.push),m=T(Array.prototype.slice),h=T(String.prototype.toLowerCase),y=T(String.prototype.match),F=T(String.prototype.replace),g=T(String.prototype.indexOf),A=T(String.prototype.trim),D=T(RegExp.prototype.test),v=L(RegExp),b=L(TypeError);function T(e){return function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return u(e,t,n)}}function L(e){return function(){for(var t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];return l(e,r)}}function E(e,n){t&&t(e,null);for(var o=n.length;o--;){var i=n[o];if("string"==typeof i){var a=h(i);a!==i&&(r(n)||(n[o]=a),i=a)}e[i]=!0}return e}function S(t){var r={},n=void 0;for(n in t)u(e,t,[n])&&(r[n]=t[n]);return r}var x=o(["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","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","section","select","shadow","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"]),_=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),O=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),k=o(["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"]),R=o(["#text"]),w=o(["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","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns"]),M=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","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","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","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","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","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","tabindex","targetx","targety","transform","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"]),C=o(["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"]),W=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),N=i(/\{\{[\s\S]*|[\s\S]*\}\}/gm),G=i(/<%[\s\S]*|[\s\S]*%>/gm),H=i(/^data-[\-\w.\u00B7-\uFFFF]/),j=i(/^aria-[\-\w]+$/),z=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),B=i(/^(?:\w+script|data):/i),P=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function q(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var U=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!==(void 0===e?"undefined":I(e))||"function"!=typeof e.createPolicy)return null;var r=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(r=t.currentScript.getAttribute("data-tt-policy-suffix"));var n="dompurify"+(r?"#"+r:"");try{return e.createPolicy(n,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+n+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U(),r=function(t){return e(t)};if(r.version="2.0.10",r.removed=[],!t||!t.document||9!==t.document.nodeType)return r.isSupported=!1,r;var i=t.document,a=!1,u=t.document,l=t.DocumentFragment,T=t.HTMLTemplateElement,L=t.Node,V=t.NodeFilter,Q=t.NamedNodeMap,Y=void 0===Q?t.NamedNodeMap||t.MozNamedAttrMap:Q,$=t.Text,X=t.Comment,J=t.DOMParser,Z=t.trustedTypes;if("function"==typeof T){var ee=u.createElement("template");ee.content&&ee.content.ownerDocument&&(u=ee.content.ownerDocument)}var te=K(Z,i),re=te?te.createHTML(""):"",ne=u,oe=ne.implementation,ie=ne.createNodeIterator,ae=ne.getElementsByTagName,ue=ne.createDocumentFragment,le=i.importNode,se={};r.isSupported=oe&&void 0!==oe.createHTMLDocument&&9!==u.documentMode;var ce=N,pe=G,fe=H,de=j,me=B,he=P,ye=z,Fe=null,ge=E({},[].concat(q(x),q(_),q(O),q(k),q(R))),Ae=null,De=E({},[].concat(q(w),q(M),q(C),q(W))),ve=null,be=null,Te=!0,Le=!0,Ee=!1,Se=!1,xe=!1,_e=!1,Oe=!1,ke=!1,Re=!1,we=!1,Me=!1,Ce=!1,We=!0,Ne=!0,Ge=!1,He={},je=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),ze=E({},["audio","video","img","source","image","track"]),Be=null,Pe=E({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ie=null,qe=u.createElement("form"),Ue=function(e){Ie&&Ie===e||(e&&"object"===(void 0===e?"undefined":I(e))||(e={}),Fe="ALLOWED_TAGS"in e?E({},e.ALLOWED_TAGS):ge,Ae="ALLOWED_ATTR"in e?E({},e.ALLOWED_ATTR):De,Be="ADD_URI_SAFE_ATTR"in e?E(S(Pe),e.ADD_URI_SAFE_ATTR):Pe,ve="FORBID_TAGS"in e?E({},e.FORBID_TAGS):{},be="FORBID_ATTR"in e?E({},e.FORBID_ATTR):{},He="USE_PROFILES"in e&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Le=!1!==e.ALLOW_DATA_ATTR,Ee=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=e.SAFE_FOR_JQUERY||!1,xe=e.SAFE_FOR_TEMPLATES||!1,_e=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,we=e.RETURN_DOM_FRAGMENT||!1,Me=e.RETURN_DOM_IMPORT||!1,Ce=e.RETURN_TRUSTED_TYPE||!1,ke=e.FORCE_BODY||!1,We=!1!==e.SANITIZE_DOM,Ne=!1!==e.KEEP_CONTENT,Ge=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||ye,xe&&(Le=!1),we&&(Re=!0),He&&(Fe=E({},[].concat(q(R))),Ae=[],!0===He.html&&(E(Fe,x),E(Ae,w)),!0===He.svg&&(E(Fe,_),E(Ae,M),E(Ae,W)),!0===He.svgFilters&&(E(Fe,O),E(Ae,M),E(Ae,W)),!0===He.mathMl&&(E(Fe,k),E(Ae,C),E(Ae,W))),e.ADD_TAGS&&(Fe===ge&&(Fe=S(Fe)),E(Fe,e.ADD_TAGS)),e.ADD_ATTR&&(Ae===De&&(Ae=S(Ae)),E(Ae,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&E(Be,e.ADD_URI_SAFE_ATTR),Ne&&(Fe["#text"]=!0),_e&&E(Fe,["html","head","body"]),Fe.table&&(E(Fe,["tbody"]),delete ve.tbody),o&&o(e),Ie=e)},Ke=function(e){d(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=re}},Ve=function(e,t){try{d(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){d(r.removed,{attribute:null,from:t})}t.removeAttribute(e)},Qe=function(e){var t=void 0,r=void 0;if(ke)e="<remove></remove>"+e;else{var n=y(e,/^[\s]+/);r=n&&n[0]}var o=te?te.createHTML(e):e;try{t=(new J).parseFromString(o,"text/html")}catch(e){}if(a&&E(ve,["title"]),!t||!t.documentElement){var i=(t=oe.createHTMLDocument("")).body;i.parentNode.removeChild(i.parentNode.firstElementChild),i.outerHTML=o}return e&&r&&t.body.insertBefore(u.createTextNode(r),t.body.childNodes[0]||null),ae.call(t,_e?"html":"body")[0]};r.isSupported&&function(){try{var e=Qe("<x/><title>&lt;/title&gt;&lt;img&gt;");D(/<\/title/,e.querySelector("title").innerHTML)&&(a=!0)}catch(e){}}();var Ye=function(e){return ie.call(e.ownerDocument||e,e,V.SHOW_ELEMENT|V.SHOW_COMMENT|V.SHOW_TEXT,(function(){return V.FILTER_ACCEPT}),!1)},$e=function(e){return!(e instanceof $||e instanceof X||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof Y&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI)},Xe=function(e){return"object"===(void 0===L?"undefined":I(L))?e instanceof L:e&&"object"===(void 0===e?"undefined":I(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Je=function(e,t,n){se[e]&&s(se[e],(function(e){e.call(r,t,n,Ie)}))},Ze=function(e){var t=void 0;if(Je("beforeSanitizeElements",e,null),$e(e))return Ke(e),!0;var n=h(e.nodeName);if(Je("uponSanitizeElement",e,{tagName:n,allowedTags:Fe}),("svg"===n||"math"===n)&&0!==e.querySelectorAll("p, br").length)return Ke(e),!0;if(!Fe[n]||ve[n]){if(Ne&&!je[n]&&"function"==typeof e.insertAdjacentHTML)try{var o=e.innerHTML;e.insertAdjacentHTML("AfterEnd",te?te.createHTML(o):o)}catch(e){}return Ke(e),!0}return"noscript"===n&&D(/<\/noscript/i,e.innerHTML)||"noembed"===n&&D(/<\/noembed/i,e.innerHTML)?(Ke(e),!0):(!Se||e.firstElementChild||e.content&&e.content.firstElementChild||!D(/</g,e.textContent)||(d(r.removed,{element:e.cloneNode()}),e.innerHTML?e.innerHTML=F(e.innerHTML,/</g,"&lt;"):e.innerHTML=F(e.textContent,/</g,"&lt;")),xe&&3===e.nodeType&&(t=e.textContent,t=F(t,ce," "),t=F(t,pe," "),e.textContent!==t&&(d(r.removed,{element:e.cloneNode()}),e.textContent=t)),Je("afterSanitizeElements",e,null),!1)},et=function(e,t,r){if(We&&("id"===t||"name"===t)&&(r in u||r in qe))return!1;if(Le&&D(fe,t));else if(Te&&D(de,t));else{if(!Ae[t]||be[t])return!1;if(Be[t]);else if(D(ye,F(r,he,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==g(r,"data:")||!ze[e])if(Ee&&!D(me,F(r,he,"")));else if(r)return!1}return!0},tt=function(e){var t=void 0,o=void 0,i=void 0,a=void 0,u=void 0;Je("beforeSanitizeAttributes",e,null);var l=e.attributes;if(l){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae};for(u=l.length;u--;){var d=t=l[u],y=d.name,g=d.namespaceURI;if(o=A(t.value),i=h(y),s.attrName=i,s.attrValue=o,s.keepAttr=!0,s.forceKeepAttr=void 0,Je("uponSanitizeAttribute",e,s),o=s.attrValue,!s.forceKeepAttr){if("name"===i&&"IMG"===e.nodeName&&l.id)a=l.id,l=m(l,[]),Ve("id",e),Ve(y,e),c(l,a)>u&&e.setAttribute("id",a.value);else{if("INPUT"===e.nodeName&&"type"===i&&"file"===o&&s.keepAttr&&(Ae[i]||!be[i]))continue;"id"===y&&e.setAttribute(y,""),Ve(y,e)}if(s.keepAttr)if(Se&&D(/\/>/i,o))Ve(y,e);else if(D(/svg|math/i,e.namespaceURI)&&D(v("</("+p(n(je),"|")+")","i"),o))Ve(y,e);else{xe&&(o=F(o,ce," "),o=F(o,pe," "));var b=e.nodeName.toLowerCase();if(et(b,i,o))try{g?e.setAttributeNS(g,y,o):e.setAttribute(y,o),f(r.removed)}catch(e){}}}}Je("afterSanitizeAttributes",e,null)}},rt=function e(t){var r=void 0,n=Ye(t);for(Je("beforeSanitizeShadowDOM",t,null);r=n.nextNode();)Je("uponSanitizeShadowNode",r,null),Ze(r)||(r.content instanceof l&&e(r.content),tt(r));Je("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e,n){var o=void 0,a=void 0,u=void 0,s=void 0,c=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!Xe(e)){if("function"!=typeof e.toString)throw b("toString is not a function");if("string"!=typeof(e=e.toString()))throw b("dirty is not a string, aborting")}if(!r.isSupported){if("object"===I(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Xe(e))return t.toStaticHTML(e.outerHTML)}return e}if(Oe||Ue(n),r.removed=[],"string"==typeof e&&(Ge=!1),Ge);else if(e instanceof L)1===(a=(o=Qe("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!Re&&!xe&&!_e&&Ce&&-1===e.indexOf("<"))return te?te.createHTML(e):e;if(!(o=Qe(e)))return Re?null:re}o&&ke&&Ke(o.firstChild);for(var p=Ye(Ge?e:o);u=p.nextNode();)3===u.nodeType&&u===s||Ze(u)||(u.content instanceof l&&rt(u.content),tt(u),s=u);if(s=null,Ge)return e;if(Re){if(we)for(c=ue.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return Me&&(c=le.call(i,c,!0)),c}var f=_e?o.outerHTML:o.innerHTML;return xe&&(f=F(f,ce," "),f=F(f,pe," ")),te&&Ce?te.createHTML(f):f},r.setConfig=function(e){Ue(e),Oe=!0},r.clearConfig=function(){Ie=null,Oe=!1},r.isValidAttribute=function(e,t,r){Ie||Ue({});var n=h(e),o=h(t);return et(n,o,r)},r.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],d(se[e],t))},r.removeHook=function(e){se[e]&&f(se[e])},r.removeHooks=function(e){se[e]&&(se[e]=[])},r.removeAllHooks=function(){se={}},r}()}()},function(e,t,r){"use strict";r.r(t);var n=r(0),o=r.n(n),i=r(1),a=r.n(i);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=o.a.import("modules/clipboard"),m=o.a.import("delta"),h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(d,e);var t,r,n,i,u=(t=d,function(){var e,r=f(t);if(p()){var n=f(this).constructor;e=Reflect.construct(r,arguments,n)}else e=r.apply(this,arguments);return c(this,e)});function d(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),(r=u.call(this,e,t)).allowed=t.allowed,r.keepSelection=t.keepSelection,r.magicPasteLinks=t.magicPasteLinks,r}return r=d,(n=[{key:"onPaste",value:function(e){e.preventDefault();var t=this.quill.getSelection(),r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("text/html"),i=(new m).retain(t.index).delete(t.length),u=this.getAllowed(),l=r;n?(l=a.a.sanitize(n,u),i=i.concat(this.convert(l))):u.ALLOWED_TAGS.includes("a")&&this.isURL(r)&&t.length>0&&this.magicPasteLinks?(l=this.quill.getText(t.index,t.length),i=i.insert(l,{link:r})):i=i.insert(l),this.quill.updateContents(i,o.a.sources.USER),i=this.convert(l),this.keepSelection?this.quill.setSelection(t.index,i.length(),o.a.sources.SILENT):this.quill.setSelection(t.index+i.length(),o.a.sources.SILENT),this.quill.scrollIntoView()}},{key:"getAllowed",value:function(){var e,t,r={};if((null==this||null===(e=this.allowed)||void 0===e?void 0:e.tags)&&(r.ALLOWED_TAGS=this.allowed.tags),(null==this||null===(t=this.allowed)||void 0===t?void 0:t.attributes)&&(r.ALLOWED_ATTR=this.allowed.attributes),void 0===r.ALLOWED_TAGS||void 0===r.ALLOWED_ATTR){var n,o=!1;void 0===r.ALLOWED_TAGS&&(o=!0,r.ALLOWED_TAGS=["p","br","span"]);var i=!1;void 0===r.ALLOWED_ATTR&&(i=!0,r.ALLOWED_ATTR=["class"]);var a=this.quill.getModule("toolbar");null==a||null===(n=a.controls)||void 0===n||n.forEach((function(e){switch(e[0]){case"bold":o&&(r.ALLOWED_TAGS.push("b"),r.ALLOWED_TAGS.push("strong"));break;case"italic":o&&r.ALLOWED_TAGS.push("i");break;case"underline":o&&r.ALLOWED_TAGS.push("u");break;case"strike":o&&r.ALLOWED_TAGS.push("s");break;case"color":case"background":i&&r.ALLOWED_ATTR.push("style");break;case"script":o&&("super"===e[1].value?r.ALLOWED_TAGS.push("sup"):"sub"===e[1].value&&r.ALLOWED_TAGS.push("sub"));break;case"header":if(o){var t=function(e){"1"===e?r.ALLOWED_TAGS.push("h1"):"2"===e?r.ALLOWED_TAGS.push("h2"):"3"===e?r.ALLOWED_TAGS.push("h3"):"4"===e?r.ALLOWED_TAGS.push("h4"):"5"===e?r.ALLOWED_TAGS.push("h5"):"6"===e&&r.ALLOWED_TAGS.push("h6")};e[1].value?t(e[1].value):e[1].options&&e[1].options.length&&[].forEach.call(e[1].options,(function(e){e.value&&t(e.value)}))}break;case"code-block":o&&r.ALLOWED_TAGS.push("pre"),i&&r.ALLOWED_ATTR.push("spellcheck");break;case"list":o&&("ordered"===e[1].value?r.ALLOWED_TAGS.push("ol"):"bullet"===e[1].value&&r.ALLOWED_TAGS.push("ul"),r.ALLOWED_TAGS.push("li"));break;case"link":o&&r.ALLOWED_TAGS.push("a"),i&&(r.ALLOWED_ATTR.push("href"),r.ALLOWED_ATTR.push("target"),r.ALLOWED_ATTR.push("rel"));break;case"image":o&&r.ALLOWED_TAGS.push("img"),i&&(r.ALLOWED_ATTR.push("src"),r.ALLOWED_ATTR.push("title"),r.ALLOWED_ATTR.push("alt"));break;case"video":o&&r.ALLOWED_TAGS.push("iframe"),i&&(r.ALLOWED_ATTR.push("frameborder"),r.ALLOWED_ATTR.push("allowfullscreen"),r.ALLOWED_ATTR.push("src"));break;case"blockquote":o&&r.ALLOWED_TAGS.push(e[0])}}))}return r}},{key:"isURL",value:function(e){return!!/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+\x2D?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+\x2D?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i.test(e)}}])&&l(r.prototype,n),i&&l(r,i),d}(d);o.a.register("modules/clipboard",h,!0),t.default=h}])}));
e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.keys,o=Object.freeze,i=Object.seal,a="undefined"!=typeof Reflect&&Reflect,u=a.apply,l=a.construct;u||(u=function(e,t,n){return e.apply(t,n)}),o||(o=function(e){return e}),i||(i=function(e){return e}),l||(l=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var s=T(Array.prototype.forEach),c=T(Array.prototype.indexOf),f=T(Array.prototype.join),d=T(Array.prototype.pop),p=T(Array.prototype.push),m=T(Array.prototype.slice),h=T(String.prototype.toLowerCase),y=T(String.prototype.match),b=T(String.prototype.replace),F=T(String.prototype.indexOf),A=T(String.prototype.trim),g=T(RegExp.prototype.test),v=S(RegExp),D=S(TypeError);function T(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return u(e,t,r)}}function S(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return l(e,n)}}function L(e,r){t&&t(e,null);for(var o=r.length;o--;){var i=r[o];if("string"==typeof i){var a=h(i);a!==i&&(n(r)||(r[o]=a),i=a)}e[i]=!0}return e}function E(t){var n={},r=void 0;for(r in t)u(e,t,[r])&&(n[r]=t[r]);return n}var k=o(["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","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","section","select","shadow","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"]),O=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","audio","canvas","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","video","view","vkern"]),x=o(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_=o(["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"]),w=o(["#text"]),M=o(["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","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns"]),R=o(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","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","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","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","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","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","tabindex","targetx","targety","transform","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"]),z=o(["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"]),N=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),C=i(/\{\{[\s\S]*|[\s\S]*\}\}/gm),H=i(/<%[\s\S]*|[\s\S]*%>/gm),W=i(/^data-[\-\w.\u00B7-\uFFFF]/),G=i(/^aria-[\-\w]+$/),j=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),B=i(/^(?:\w+script|data):/i),P=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g),I="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function q(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var U=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!==(void 0===e?"undefined":I(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U(),n=function(t){return e(t)};if(n.version="2.0.10",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var i=t.document,a=!1,u=t.document,l=t.DocumentFragment,T=t.HTMLTemplateElement,S=t.Node,V=t.NodeFilter,Q=t.NamedNodeMap,Y=void 0===Q?t.NamedNodeMap||t.MozNamedAttrMap:Q,$=t.Text,X=t.Comment,J=t.DOMParser,Z=t.trustedTypes;if("function"==typeof T){var ee=u.createElement("template");ee.content&&ee.content.ownerDocument&&(u=ee.content.ownerDocument)}var te=K(Z,i),ne=te?te.createHTML(""):"",re=u,oe=re.implementation,ie=re.createNodeIterator,ae=re.getElementsByTagName,ue=re.createDocumentFragment,le=i.importNode,se={};n.isSupported=oe&&void 0!==oe.createHTMLDocument&&9!==u.documentMode;var ce=C,fe=H,de=W,pe=G,me=B,he=P,ye=j,be=null,Fe=L({},[].concat(q(k),q(O),q(x),q(_),q(w))),Ae=null,ge=L({},[].concat(q(M),q(R),q(z),q(N))),ve=null,De=null,Te=!0,Se=!0,Le=!1,Ee=!1,ke=!1,Oe=!1,xe=!1,_e=!1,we=!1,Me=!1,Re=!1,ze=!1,Ne=!0,Ce=!0,He=!1,We={},Ge=L({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","plaintext","script","style","svg","template","thead","title","video","xmp"]),je=L({},["audio","video","img","source","image","track"]),Be=null,Pe=L({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ie=null,qe=u.createElement("form"),Ue=function(e){Ie&&Ie===e||(e&&"object"===(void 0===e?"undefined":I(e))||(e={}),be="ALLOWED_TAGS"in e?L({},e.ALLOWED_TAGS):Fe,Ae="ALLOWED_ATTR"in e?L({},e.ALLOWED_ATTR):ge,Be="ADD_URI_SAFE_ATTR"in e?L(E(Pe),e.ADD_URI_SAFE_ATTR):Pe,ve="FORBID_TAGS"in e?L({},e.FORBID_TAGS):{},De="FORBID_ATTR"in e?L({},e.FORBID_ATTR):{},We="USE_PROFILES"in e&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Se=!1!==e.ALLOW_DATA_ATTR,Le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ee=e.SAFE_FOR_JQUERY||!1,ke=e.SAFE_FOR_TEMPLATES||!1,Oe=e.WHOLE_DOCUMENT||!1,we=e.RETURN_DOM||!1,Me=e.RETURN_DOM_FRAGMENT||!1,Re=e.RETURN_DOM_IMPORT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,_e=e.FORCE_BODY||!1,Ne=!1!==e.SANITIZE_DOM,Ce=!1!==e.KEEP_CONTENT,He=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||ye,ke&&(Se=!1),Me&&(we=!0),We&&(be=L({},[].concat(q(w))),Ae=[],!0===We.html&&(L(be,k),L(Ae,M)),!0===We.svg&&(L(be,O),L(Ae,R),L(Ae,N)),!0===We.svgFilters&&(L(be,x),L(Ae,R),L(Ae,N)),!0===We.mathMl&&(L(be,_),L(Ae,z),L(Ae,N))),e.ADD_TAGS&&(be===Fe&&(be=E(be)),L(be,e.ADD_TAGS)),e.ADD_ATTR&&(Ae===ge&&(Ae=E(Ae)),L(Ae,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&L(Be,e.ADD_URI_SAFE_ATTR),Ce&&(be["#text"]=!0),Oe&&L(be,["html","head","body"]),be.table&&(L(be,["tbody"]),delete ve.tbody),o&&o(e),Ie=e)},Ke=function(e){p(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.outerHTML=ne}},Ve=function(e,t){try{p(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){p(n.removed,{attribute:null,from:t})}t.removeAttribute(e)},Qe=function(e){var t=void 0,n=void 0;if(_e)e="<remove></remove>"+e;else{var r=y(e,/^[\s]+/);n=r&&r[0]}var o=te?te.createHTML(e):e;try{t=(new J).parseFromString(o,"text/html")}catch(e){}if(a&&L(ve,["title"]),!t||!t.documentElement){var i=(t=oe.createHTMLDocument("")).body;i.parentNode.removeChild(i.parentNode.firstElementChild),i.outerHTML=o}return e&&n&&t.body.insertBefore(u.createTextNode(n),t.body.childNodes[0]||null),ae.call(t,Oe?"html":"body")[0]};n.isSupported&&function(){try{var e=Qe("<x/><title>&lt;/title&gt;&lt;img&gt;");g(/<\/title/,e.querySelector("title").innerHTML)&&(a=!0)}catch(e){}}();var Ye=function(e){return ie.call(e.ownerDocument||e,e,V.SHOW_ELEMENT|V.SHOW_COMMENT|V.SHOW_TEXT,(function(){return V.FILTER_ACCEPT}),!1)},$e=function(e){return!(e instanceof $||e instanceof X||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof Y&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI)},Xe=function(e){return"object"===(void 0===S?"undefined":I(S))?e instanceof S:e&&"object"===(void 0===e?"undefined":I(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Je=function(e,t,r){se[e]&&s(se[e],(function(e){e.call(n,t,r,Ie)}))},Ze=function(e){var t=void 0;if(Je("beforeSanitizeElements",e,null),$e(e))return Ke(e),!0;var r=h(e.nodeName);if(Je("uponSanitizeElement",e,{tagName:r,allowedTags:be}),("svg"===r||"math"===r)&&0!==e.querySelectorAll("p, br").length)return Ke(e),!0;if(!be[r]||ve[r]){if(Ce&&!Ge[r]&&"function"==typeof e.insertAdjacentHTML)try{var o=e.innerHTML;e.insertAdjacentHTML("AfterEnd",te?te.createHTML(o):o)}catch(e){}return Ke(e),!0}return"noscript"===r&&g(/<\/noscript/i,e.innerHTML)||"noembed"===r&&g(/<\/noembed/i,e.innerHTML)?(Ke(e),!0):(!Ee||e.firstElementChild||e.content&&e.content.firstElementChild||!g(/</g,e.textContent)||(p(n.removed,{element:e.cloneNode()}),e.innerHTML?e.innerHTML=b(e.innerHTML,/</g,"&lt;"):e.innerHTML=b(e.textContent,/</g,"&lt;")),ke&&3===e.nodeType&&(t=e.textContent,t=b(t,ce," "),t=b(t,fe," "),e.textContent!==t&&(p(n.removed,{element:e.cloneNode()}),e.textContent=t)),Je("afterSanitizeElements",e,null),!1)},et=function(e,t,n){if(Ne&&("id"===t||"name"===t)&&(n in u||n in qe))return!1;if(Se&&g(de,t));else if(Te&&g(pe,t));else{if(!Ae[t]||De[t])return!1;if(Be[t]);else if(g(ye,b(n,he,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==F(n,"data:")||!je[e])if(Le&&!g(me,b(n,he,"")));else if(n)return!1}return!0},tt=function(e){var t=void 0,o=void 0,i=void 0,a=void 0,u=void 0;Je("beforeSanitizeAttributes",e,null);var l=e.attributes;if(l){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ae};for(u=l.length;u--;){var p=t=l[u],y=p.name,F=p.namespaceURI;if(o=A(t.value),i=h(y),s.attrName=i,s.attrValue=o,s.keepAttr=!0,s.forceKeepAttr=void 0,Je("uponSanitizeAttribute",e,s),o=s.attrValue,!s.forceKeepAttr){if("name"===i&&"IMG"===e.nodeName&&l.id)a=l.id,l=m(l,[]),Ve("id",e),Ve(y,e),c(l,a)>u&&e.setAttribute("id",a.value);else{if("INPUT"===e.nodeName&&"type"===i&&"file"===o&&s.keepAttr&&(Ae[i]||!De[i]))continue;"id"===y&&e.setAttribute(y,""),Ve(y,e)}if(s.keepAttr)if(Ee&&g(/\/>/i,o))Ve(y,e);else if(g(/svg|math/i,e.namespaceURI)&&g(v("</("+f(r(Ge),"|")+")","i"),o))Ve(y,e);else{ke&&(o=b(o,ce," "),o=b(o,fe," "));var D=e.nodeName.toLowerCase();if(et(D,i,o))try{F?e.setAttributeNS(F,y,o):e.setAttribute(y,o),d(n.removed)}catch(e){}}}}Je("afterSanitizeAttributes",e,null)}},nt=function e(t){var n=void 0,r=Ye(t);for(Je("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Je("uponSanitizeShadowNode",n,null),Ze(n)||(n.content instanceof l&&e(n.content),tt(n));Je("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,r){var o=void 0,a=void 0,u=void 0,s=void 0,c=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!Xe(e)){if("function"!=typeof e.toString)throw D("toString is not a function");if("string"!=typeof(e=e.toString()))throw D("dirty is not a string, aborting")}if(!n.isSupported){if("object"===I(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Xe(e))return t.toStaticHTML(e.outerHTML)}return e}if(xe||Ue(r),n.removed=[],"string"==typeof e&&(He=!1),He);else if(e instanceof S)1===(a=(o=Qe("\x3c!--\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!we&&!ke&&!Oe&&ze&&-1===e.indexOf("<"))return te?te.createHTML(e):e;if(!(o=Qe(e)))return we?null:ne}o&&_e&&Ke(o.firstChild);for(var f=Ye(He?e:o);u=f.nextNode();)3===u.nodeType&&u===s||Ze(u)||(u.content instanceof l&&nt(u.content),tt(u),s=u);if(s=null,He)return e;if(we){if(Me)for(c=ue.call(o.ownerDocument);o.firstChild;)c.appendChild(o.firstChild);else c=o;return Re&&(c=le.call(i,c,!0)),c}var d=Oe?o.outerHTML:o.innerHTML;return ke&&(d=b(d,ce," "),d=b(d,fe," ")),te&&ze?te.createHTML(d):d},n.setConfig=function(e){Ue(e),xe=!0},n.clearConfig=function(){Ie=null,xe=!1},n.isValidAttribute=function(e,t,n){Ie||Ue({});var r=h(e),o=h(t);return et(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(se[e]=se[e]||[],p(se[e],t))},n.removeHook=function(e){se[e]&&d(se[e])},n.removeHooks=function(e){se[e]&&(se[e]=[])},n.removeAllHooks=function(){se={}},n}()}()},function(t,n){t.exports=e},function(e,t,n){"use strict";n.r(t);var r=n(1),o=n.n(r),i=n(0),a=n.n(i);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=function(e,t){if(!e)return;if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return s(e,t)}(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,o,i=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==r.return||r.return()}finally{if(a)throw o}}}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){return!t||"object"!==u(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function m(e){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=o.a.import("modules/clipboard"),y=o.a.import("delta"),b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}(s,e);var t,n,r,i,u=(t=s,function(){var e,n=m(t);if(p()){var r=m(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return d(this,e)});function s(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(n=u.call(this,e,t)).allowed=t.allowed,n.keepSelection=t.keepSelection,n.substituteBlockElements=t.substituteBlockElements,n.magicPasteLinks=t.magicPasteLinks,n.hooks=t.hooks,n}return n=s,(r=[{key:"onPaste",value:function(e){e.preventDefault();var t=this.quill.getSelection(),n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("text/html"),i=(new y).retain(t.index).delete(t.length),u=this.getAllowed(),l=n;r?(!1!==this.substituteBlockElements&&this.substitute(),"function"==typeof this.hooks.beforeSanitizeElements&&a.a.addHook("beforeSanitizeElements",this.hooks.beforeSanitizeElements),"function"==typeof this.hooks.uponSanitizeElement&&a.a.addHook("uponSanitizeElement",this.hooks.uponSanitizeElement),"function"==typeof this.hooks.afterSanitizeElements&&a.a.addHook("afterSanitizeElements",this.hooks.afterSanitizeElements),"function"==typeof this.hooks.beforeSanitizeAttributes&&a.a.addHook("beforeSanitizeAttributes",this.hooks.beforeSanitizeAttributes),"function"==typeof this.hooks.uponSanitizeAttribute&&a.a.addHook("uponSanitizeAttribute",this.hooks.uponSanitizeAttribute),"function"==typeof this.hooks.afterSanitizeAttributes&&a.a.addHook("afterSanitizeAttributes",this.hooks.afterSanitizeAttributes),"function"==typeof this.hooks.beforeSanitizeShadowDOM&&a.a.addHook("beforeSanitizeShadowDOM",this.hooks.beforeSanitizeShadowDOM),"function"==typeof this.hooks.uponSanitizeShadowNode&&a.a.addHook("uponSanitizeShadowNode",this.hooks.uponSanitizeShadowNode),"function"==typeof this.hooks.afterSanitizeShadowDOM&&a.a.addHook("afterSanitizeShadowDOM",this.hooks.afterSanitizeShadowDOM),l=a.a.sanitize(r,u),i=i.concat(this.convert(l))):u.ALLOWED_TAGS.includes("a")&&this.isURL(n)&&t.length>0&&this.magicPasteLinks?(l=this.quill.getText(t.index,t.length),i=i.insert(l,{link:n})):i=i.insert(l),this.quill.updateContents(i,o.a.sources.USER),i=this.convert(l),this.keepSelection?this.quill.setSelection(t.index,i.length(),o.a.sources.SILENT):this.quill.setSelection(t.index+i.length(),o.a.sources.SILENT),this.quill.scrollIntoView(),a.a.removeAllHooks()}},{key:"getAllowed",value:function(){var e,t,n={};if((null===(e=this.allowed)||void 0===e?void 0:e.tags)&&(n.ALLOWED_TAGS=this.allowed.tags),(null===(t=this.allowed)||void 0===t?void 0:t.attributes)&&(n.ALLOWED_ATTR=this.allowed.attributes),void 0===n.ALLOWED_TAGS||void 0===n.ALLOWED_ATTR){var r,o=!1;void 0===n.ALLOWED_TAGS&&(o=!0,n.ALLOWED_TAGS=["p","br","span"]);var i=!1;void 0===n.ALLOWED_ATTR&&(i=!0,n.ALLOWED_ATTR=["class"]);var a=this.quill.getModule("toolbar");null==a||null===(r=a.controls)||void 0===r||r.forEach((function(e){switch(e[0]){case"bold":o&&(n.ALLOWED_TAGS.push("b"),n.ALLOWED_TAGS.push("strong"));break;case"italic":o&&n.ALLOWED_TAGS.push("i");break;case"underline":o&&n.ALLOWED_TAGS.push("u");break;case"strike":o&&n.ALLOWED_TAGS.push("s");break;case"color":case"background":i&&n.ALLOWED_ATTR.push("style");break;case"script":o&&("super"===e[1].value?n.ALLOWED_TAGS.push("sup"):"sub"===e[1].value&&n.ALLOWED_TAGS.push("sub"));break;case"header":if(o){var t=function(e){"1"===e?n.ALLOWED_TAGS.push("h1"):"2"===e?n.ALLOWED_TAGS.push("h2"):"3"===e?n.ALLOWED_TAGS.push("h3"):"4"===e?n.ALLOWED_TAGS.push("h4"):"5"===e?n.ALLOWED_TAGS.push("h5"):"6"===e&&n.ALLOWED_TAGS.push("h6")};e[1].value?t(e[1].value):e[1].options&&e[1].options.length&&[].forEach.call(e[1].options,(function(e){e.value&&t(e.value)}))}break;case"code-block":o&&n.ALLOWED_TAGS.push("pre"),i&&n.ALLOWED_ATTR.push("spellcheck");break;case"list":o&&("ordered"===e[1].value?n.ALLOWED_TAGS.push("ol"):"bullet"===e[1].value&&n.ALLOWED_TAGS.push("ul"),n.ALLOWED_TAGS.push("li"));break;case"link":o&&n.ALLOWED_TAGS.push("a"),i&&(n.ALLOWED_ATTR.push("href"),n.ALLOWED_ATTR.push("target"),n.ALLOWED_ATTR.push("rel"));break;case"image":o&&n.ALLOWED_TAGS.push("img"),i&&(n.ALLOWED_ATTR.push("src"),n.ALLOWED_ATTR.push("title"),n.ALLOWED_ATTR.push("alt"));break;case"video":o&&n.ALLOWED_TAGS.push("iframe"),i&&(n.ALLOWED_ATTR.push("frameborder"),n.ALLOWED_ATTR.push("allowfullscreen"),n.ALLOWED_ATTR.push("src"));break;case"blockquote":o&&n.ALLOWED_TAGS.push(e[0])}}))}return n}},{key:"substitute",value:function(){var e,t=function(e,t){var n,r=document.createElement(t),o=l(e.getAttributeNames());try{for(o.s();!(n=o.n()).done;){var i=n.value;r.setAttribute(i,e.getAttribute(i))}}catch(e){o.e(e)}finally{o.f()}return r.innerHTML=e.innerHTML,e.replaceWith(r),r};a.a.addHook("beforeSanitizeElements",(function(e){"span"===(null==e?void 0:e.tagName.toLowerCase())&&(e.innerHTML="".concat(e.innerHTML," "))})),a.a.addHook("uponSanitizeElement",(function(n,r,o){for(var i=["p","div","section","article","fieldset","address","aside","blockquote","canvas","dl","figcaption","figure","footer","form","header","main","nav","noscript","ol","pre","table","tfoot","ul","video"],a=0;!e&&a<3;)o.ALLOWED_TAGS.includes(i[a])&&(e=i[a]),++a;if(n.tagName&&e&&!o.ALLOWED_TAGS.includes(n.tagName.toLowerCase())){var u=n.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6"].includes(u)?(n.innerHTML="<b>".concat(n.innerHTML,"</b>"),t(n,e)):i.includes(u)?t(n,e):["li","dt","dd","hr"].includes(u)&&(n.innerHTML="".concat(n.innerHTML,"<br>"))}}))}},{key:"isURL",value:function(e){return!!/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+\x2D?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+\x2D?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i.test(e)}}])&&c(n.prototype,r),i&&c(n,i),s}(h);o.a.register("modules/clipboard",b,!0),t.default=b}])}));
{
"name": "quill-paste-smart",
"version": "1.4.0",
"version": "1.4.1",
"description": "Quill Extension to paste only supported HTML",

@@ -5,0 +5,0 @@ "main": "dist/quill-paste-smart.js",

@@ -75,3 +75,3 @@ # Quill Paste Smart

> :raised_hand: You don't need a custom configuration.
> :raised_hand: **Probably you don't need a custom configuration.**
> You could stick with the default settings by completely omit the `clipboard` object in your quill options.

@@ -88,3 +88,3 @@

| keepSelection | `true` `false` | `false` | `Boolean` | If this setting is set to `true` the pasted content will be selected after pasting it. Otherwise the cursor will be placed right after the pasted content |
| magicPasteLinks | `true` `false` | `false` | `Boolean` | If this setting is set to `true` pasted links over selected text will be converted to an `a` tag. Example: If you select the word `foo` and paste the link `https://foo.bar/` the result will be `<a href="https://foo.bar/">foo</a>`. Note: This only works if there is nothing pasted except a valid link. |
| magicPasteLinks | `true` `false` | `false` | `Boolean` | If this setting is set to `true` pasted URLs over selected text will be converted to an `a` tag. Example: If you select the word `foo` and paste the URL `https://foo.bar/` the result will be `<a href="https://foo.bar/">foo</a>`. Note: This only works if there is nothing pasted except a valid URL. |
| hooks | [DOMPurify Hooks](https://github.com/cure53/DOMPurify#hooks) | `undefined` | `Array<function>` | Here you can define any of the DOMPurify hooks. This can be handy if you need to cusomtize the HTML sanitizer. For more information see the [hook demos](https://github.com/cure53/DOMPurify/tree/main/demos) from DOMPurify.<br>**BE AWARE**<br>Here you can mess up things. E.g. You could create an infinite loop by adding not allowed tags to the node. |

@@ -91,0 +91,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc