Files
hub-insurance/wp-content/plugins/visual-regression-tests/build/editor.js
T
2026-07-02 15:54:39 -06:00

8 lines
30 KiB
JavaScript

(()=>{var e={835:(e,t,n)=>{var r={"./index.js":777};function s(e){var t=o(e);return n(t)}function o(e){if(!n.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}s.keys=function(){return Object.keys(r)},s.resolve=o,e.exports=s,s.id=835},777:(e,t,n)=>{"use strict";const r=window.wp.plugins,s=window.wp.editPost,o=window.wp.components,i=window.wp.i18n,a=window.wp.element,l=window.wp.data,c=window.wp.primitives,u=window.ReactJSXRuntime,d=(0,u.jsx)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,u.jsx)(c.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})});var m=n(838),p=n.n(m);const f=({})=>(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("div",{className:"vrts-metabox-notice vrts-metabox-notice-is-success",children:[(0,u.jsx)("p",{children:(0,u.jsx)("strong",{children:(0,i.__)("You have added a new test","visual-regression-tests")})}),(0,u.jsx)("p",{dangerouslySetInnerHTML:{__html:p().sanitize((0,i.sprintf)(/* translators: %s name of the page */ /* translators: %s name of the page */
(0,i.__)("The Visual Regression Test for the page %s has been added!","visual-regression-tests"),"<strong>"+(0,l.select)("core/editor").getEditedPostAttribute("title")+"</strong>"))}})]})}),g=({upgradeUrl:e="",remainingTests:t=0,totalTests:n=0})=>(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("div",{className:"vrts-metabox-notice vrts-metabox-notice-is-info",children:[(0,u.jsx)("p",{children:(0,u.jsx)("strong",{children:(0,i.__)("Unlock more tests","visual-regression-tests")})}),(0,u.jsx)("p",{dangerouslySetInnerHTML:{__html:p().sanitize((0,i.sprintf)("%1$s %2$s",(0,i.sprintf)(/* translators: %1$s, %2$s: number of tests. */ /* translators: %1$s, %2$s: number of tests. */
(0,i.__)("Good work! You have added %1$s of %2$s available tests.","visual-regression-tests"),n-t,n),(0,i.sprintf)(/* translators: %1$s, %2$s: link wrapper. */ /* translators: %1$s, %2$s: link wrapper. */
(0,i.__)("Upgrade %1$shere%2$s to add more tests to your website!","visual-regression-tests"),`<a href="${e}" target="_blank">`,"</a>")))}})]})}),h=({upgradeUrl:e=""})=>(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("div",{className:"vrts-metabox-notice vrts-metabox-notice-is-error",children:[(0,u.jsx)("p",{children:(0,u.jsx)("strong",{children:(0,i.__)("Ready for an Upgrade?","visual-regression-tests")})}),(0,u.jsx)("p",{dangerouslySetInnerHTML:{__html:p().sanitize((0,i.sprintf)('%1$s <a href="%2$s" target="_blank" title="%3$s">%3$s</a>',(0,i.__)("Looks like you need a bigger plan to add more tests.","visual-regression-tests"),e,(0,i.__)("Upgrade here!","visual-regression-tests")))}})]})}),_=({pluginUrl:e=""})=>(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("div",{className:"vrts-metabox-notice vrts-metabox-notice-is-error",children:[(0,u.jsx)("p",{children:(0,u.jsx)("strong",{children:(0,i.__)("Connection failed","visual-regression-tests")})}),(0,u.jsx)("p",{children:(0,i.__)("Something went wrong while trying to connect to the external service.","visual-regression-tests")}),(0,u.jsx)("p",{dangerouslySetInnerHTML:{__html:p().sanitize((0,i.sprintf)('<a href="%1$s" title="%2$s">%2$s</a>',e,(0,i.__)("Go to plugin page","visual-regression-tests")))}})]})}),v=({test:e={}})=>{const[t,n]=(0,a.useState)({hide_css_selectors:"",...e});return(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("div",{className:"settings",children:[(0,u.jsxs)("p",{className:"settings-title",children:[(0,i.__)("Hide elements from VRTs","visual-regression-tests"),(0,u.jsxs)("span",{className:"vrts-tooltip",children:[(0,u.jsx)("span",{className:"vrts-tooltip-icon",children:(0,u.jsx)(o.Icon,{icon:d,size:"20"})}),(0,u.jsx)("span",{className:"vrts-tooltip-content",children:(0,u.jsx)("span",{className:"vrts-tooltip-content-inner",dangerouslySetInnerHTML:{__html:(0,i.sprintf)(/* translators: %1$s, %2$s: link wrapper. */ /* translators: %1$s, %2$s: link wrapper. */
(0,i.__)("Exclude elements on this page: Add %1$sCSS selectors%2$s (as comma separated list) to exclude elements from VRTs when a new snapshot gets created.","visual-regression-tests"),'<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors" target="_blank">',"</a>")}})})]})]}),(0,u.jsx)(o.TextareaControl,{placeholder:(0,i.__)("e.g.: .lottie, #ads","visual-regression-tests"),value:t.hide_css_selectors,onChange:r=>{(r=>{const s={...t,hide_css_selectors:r};e.hide_css_selectors=r,n(s),(0,l.dispatch)("core/editor").editPost({vrts:{hide_css_selectors:r}})})(r)}})]})})},T=window.wp.apiFetch;var y=n.n(T);const x=()=>{const e=window.vrts_editor_vars.upgrade_url,t=window.vrts_editor_vars.plugin_url,n=window.vrts_editor_vars.test_status,r=window.vrts_editor_vars.screenshot,s=(0,l.select)("core/editor").getCurrentPostId(),[c,m]=(0,a.useState)((0,l.select)("core/editor").getEditedPostAttribute("status")),[p,T]=(0,a.useState)(!0),[x,E]=(0,a.useState)(!0),[w,b]=(0,a.useState)({}),[N,S]=(0,a.useState)({}),[A,R]=(0,a.useState)(!1);(0,a.useEffect)((()=>{E("auto-draft"===c)}),[c]),(0,a.useEffect)((()=>{T(!0),async function(){try{const e=await y()({path:`/vrts/v1/tests/post/${s}`});b(e)}catch(e){console.log(e)}T(!1)}()}),[c,s]),(0,a.useEffect)((()=>{T(!0),async function(){try{const e=await y()({path:"/vrts/v1/tests"});S(e)}catch(e){console.log(e)}}()}),[c]);const L=(0,a.useRef)((0,l.select)("core/editor").isSavingPost());(0,a.useEffect)((()=>{(0,l.subscribe)((()=>{const e=(0,l.select)("core/editor").getEditedPostAttribute("status"),t=(0,l.select)("core/editor").isSavingPost();L.current&&!t&&e!==c&&m(e),L.current=t}))}),[c]);let C=null;return!0===A?C=(0,u.jsx)(f,{}):1===N.remaining_tests?C=(0,u.jsx)(g,{upgradeUrl:e,remainingTests:N.remaining_tests,totalTests:N.total_tests}):0===N.remaining_tests&&(C=(0,u.jsx)(h,{upgradeUrl:e})),window.vrts_editor_vars.is_connected?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(o.Flex,{gap:3,style:{marginBottom:12},children:[(0,u.jsx)(o.ToggleControl,{label:(0,i.__)("Add to VRTs","visual-regression-tests"),checked:!!w.id,onChange:w.id?async function(){T(!0);try{const e=w.service_test_id,t=await y()({path:`/vrts/v1/tests/post/${s}`,method:"DELETE"});b(t||{}),R(!1),e&&S({...N,remaining_tests:N.remaining_tests+1})}catch(e){console.log(e)}T(!1)}:async function(){T(!0);try{const e=await y()({path:`/vrts/v1/tests/post/${s}`,method:"POST"});b(e),w.service_test_id&&S({...N,remaining_tests:N.remaining_tests-1})}catch(e){console.log(e)}T(!1),R(!0)},disabled:x||p||0===N.remaining_tests&&!w.id,__nextHasNoMarginBottom:!0}),(0,u.jsxs)("span",{className:"vrts-tooltip",children:[(0,u.jsx)("span",{className:"vrts-tooltip-icon",children:(0,u.jsx)(o.Icon,{icon:d,size:"20"})}),(0,u.jsx)("span",{className:"vrts-tooltip-content",children:(0,u.jsx)("span",{className:"vrts-tooltip-content-inner",dangerouslySetInnerHTML:{__html:(0,i.sprintf)(
// translators: %1$s, %2$s: link wrapper.
// translators: %1$s, %2$s: link wrapper.
(0,i.__)("Add this page to your Visual Regression Tests for consistent checks to ensure no visual changes go unnoticed. Explore the %1$sTests page%2$s in the VRTs plugin for an overview of all tests and their status.","visual-regression-tests"),'<a href="'+t+'">',"</a>")}})})]})]}),C,w.id&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"vrts-testing-status-wrapper",children:[(0,u.jsxs)("p",{className:"vrts-testing-status",children:[(0,u.jsx)("span",{children:(0,i.__)("Test Status","visual-regression-tests")}),(0,u.jsx)("strong",{children:(0,u.jsx)("span",{className:`vrts-testing-status--${n.class}`,children:n.text})})]}),(0,u.jsx)("p",{className:"vrts-testing-status-info",dangerouslySetInnerHTML:{__html:n.instructions}})]}),(0,u.jsxs)("div",{className:"vrts-testing-status-wrapper",children:[(0,u.jsxs)("p",{className:"vrts-testing-status",children:[(0,u.jsx)("span",{children:(0,i.__)("Snapshot","visual-regression-tests")}),(0,u.jsx)("span",{className:"vrts-testing-status-info",dangerouslySetInnerHTML:{__html:["paused","waiting"].includes(r.status)?r.text:r.instructions}})]}),(0,u.jsx)("figure",{className:"figure",dangerouslySetInnerHTML:{__html:r.screenshot}})]})]}),w.id&&(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(v,{test:w,setTest:b})})]}):(0,u.jsx)(_,{pluginUrl:t})},E=(0,a.createElement)("svg",{width:20,height:20,viewBox:"0 0 20 20"},(0,a.createElement)("path",{d:"M10.66 19a8.906 8.906 0 0 0 4.914-1.903H10.66V19zm0-3.194h6.254a9.27 9.27 0 0 0 1.236-1.935h-7.49v1.935zm0-3.226h7.992c.188-.63.305-1.279.348-1.936h-8.34v1.936zm7.992-5.16H10.66v1.936H19a8.772 8.772 0 0 0-.348-1.936zm-1.738-3.226H10.66V6.13h7.49v-.001a9.365 9.365 0 0 0-1.236-1.935zM10.66 1v1.904h4.914A8.913 8.913 0 0 0 10.66 1zM1 10a9.047 9.047 0 0 0 2.423 6.145 9.018 9.018 0 0 0 5.949 2.854V1a9.016 9.016 0 0 0-5.949 2.854A9.049 9.049 0 0 0 1 10z"})),w=window.vrts_editor_vars.plugin_name;(0,r.registerPlugin)("visual-regression-tests-plugin-sidebar",{render:()=>(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(s.PluginDocumentSettingPanel,{className:"vrts_post_options_metabox",name:"visual-regression-tests-document-setting-panel",title:w,icon:E,children:(0,u.jsx)(x,{})}),(0,u.jsx)(s.PluginSidebarMoreMenuItem,{target:"visual-regression-tests-sidebar",icon:E,children:w}),(0,u.jsx)(s.PluginSidebar,{className:"vrts_post_options_metabox",name:"visual-regression-tests-sidebar",title:w,icon:E,children:(0,u.jsx)(o.PanelBody,{title:(0,i.__)("Options","visual-regression-tests"),intialOpen:!0,children:(0,u.jsx)(x,{})})})]})})},838:function(e){e.exports=function(){"use strict";const{entries:e,setPrototypeOf:t,isFrozen:n,getPrototypeOf:r,getOwnPropertyDescriptor:s}=Object;let{freeze:o,seal:i,create:a}=Object,{apply:l,construct:c}="undefined"!=typeof Reflect&&Reflect;o||(o=function(e){return e}),i||(i=function(e){return e}),l||(l=function(e,t,n){return e.apply(t,n)}),c||(c=function(e,t){return new e(...t)});const u=w(Array.prototype.forEach),d=w(Array.prototype.pop),m=w(Array.prototype.push),p=w(String.prototype.toLowerCase),f=w(String.prototype.toString),g=w(String.prototype.match),h=w(String.prototype.replace),_=w(String.prototype.indexOf),v=w(String.prototype.trim),T=w(Object.prototype.hasOwnProperty),y=w(RegExp.prototype.test),x=(E=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c(E,t)});var E;function w(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return l(e,t,r)}}function b(e,r){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p;t&&t(e,null);let o=r.length;for(;o--;){let t=r[o];if("string"==typeof t){const e=s(t);e!==t&&(n(r)||(r[o]=e),t=e)}e[t]=!0}return e}function N(e){for(let t=0;t<e.length;t++)T(e,t)||(e[t]=null);return e}function S(t){const n=a(null);for(const[r,s]of e(t))T(t,r)&&(Array.isArray(s)?n[r]=N(s):s&&"object"==typeof s&&s.constructor===Object?n[r]=S(s):n[r]=s);return n}function A(e,t){for(;null!==e;){const n=s(e,t);if(n){if(n.get)return w(n.get);if("function"==typeof n.value)return w(n.value)}e=r(e)}return function(){return null}}const R=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","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","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"]),L=o(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","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","view","vkern"]),C=o(["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"]),O=o(["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"]),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","mprescripts"]),M=o(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),D=o(["#text"]),I=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","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","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","wrap","xmlns","slot"]),j=o(["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","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"]),P=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"]),U=o(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H=i(/\{\{[\w\W]*|[\w\W]*\}\}/gm),z=i(/<%[\w\W]*|[\w\W]*%>/gm),F=i(/\${[\w\W]*}/gm),B=i(/^data-[\-\w.\u00B7-\uFFFF]/),W=i(/^aria-[\-\w]+$/),$=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),G=i(/^(?:\w+script|data):/i),Y=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),V=i(/^html$/i),X=i(/^[a-z][.\w]*(-[.\w]+)+$/i);var q=Object.freeze({__proto__:null,MUSTACHE_EXPR:H,ERB_EXPR:z,TMPLIT_EXPR:F,DATA_ATTR:B,ARIA_ATTR:W,IS_ALLOWED_URI:$,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:Y,DOCTYPE_NAME:V,CUSTOM_ELEMENT:X});const K=1,Z=3,J=7,Q=8,ee=9,te=function(){return"undefined"==typeof window?null:window};return function t(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:te();const r=e=>t(e);if(r.version="3.1.7",r.removed=[],!n||!n.document||n.document.nodeType!==ee)return r.isSupported=!1,r;let{document:s}=n;const i=s,l=i.currentScript,{DocumentFragment:c,HTMLTemplateElement:E,Node:w,Element:N,NodeFilter:H,NamedNodeMap:z=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:F,DOMParser:B,trustedTypes:W}=n,G=N.prototype,Y=A(G,"cloneNode"),X=A(G,"remove"),ne=A(G,"nextSibling"),re=A(G,"childNodes"),se=A(G,"parentNode");if("function"==typeof E){const e=s.createElement("template");e.content&&e.content.ownerDocument&&(s=e.content.ownerDocument)}let oe,ie="";const{implementation:ae,createNodeIterator:le,createDocumentFragment:ce,getElementsByTagName:ue}=s,{importNode:de}=i;let me={};r.isSupported="function"==typeof e&&"function"==typeof se&&ae&&void 0!==ae.createHTMLDocument;const{MUSTACHE_EXPR:pe,ERB_EXPR:fe,TMPLIT_EXPR:ge,DATA_ATTR:he,ARIA_ATTR:_e,IS_SCRIPT_OR_DATA:ve,ATTR_WHITESPACE:Te,CUSTOM_ELEMENT:ye}=q;let{IS_ALLOWED_URI:xe}=q,Ee=null;const we=b({},[...R,...L,...C,...k,...D]);let be=null;const Ne=b({},[...I,...j,...P,...U]);let Se=Object.seal(a(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,Re=null,Le=!0,Ce=!0,Oe=!1,ke=!0,Me=!1,De=!0,Ie=!1,je=!1,Pe=!1,Ue=!1,He=!1,ze=!1,Fe=!0,Be=!1,We=!0,$e=!1,Ge={},Ye=null;const Ve=b({},["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 Xe=null;const qe=b({},["audio","video","img","source","image","track"]);let Ke=null;const Ze=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",et="http://www.w3.org/1999/xhtml";let tt=et,nt=!1,rt=null;const st=b({},[Je,Qe,et],f);let ot=null;const it=["application/xhtml+xml","text/html"];let at=null,lt=null;const ct=s.createElement("form"),ut=function(e){return e instanceof RegExp||e instanceof Function},dt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!lt||lt!==e){if(e&&"object"==typeof e||(e={}),e=S(e),ot=-1===it.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,at="application/xhtml+xml"===ot?f:p,Ee=T(e,"ALLOWED_TAGS")?b({},e.ALLOWED_TAGS,at):we,be=T(e,"ALLOWED_ATTR")?b({},e.ALLOWED_ATTR,at):Ne,rt=T(e,"ALLOWED_NAMESPACES")?b({},e.ALLOWED_NAMESPACES,f):st,Ke=T(e,"ADD_URI_SAFE_ATTR")?b(S(Ze),e.ADD_URI_SAFE_ATTR,at):Ze,Xe=T(e,"ADD_DATA_URI_TAGS")?b(S(qe),e.ADD_DATA_URI_TAGS,at):qe,Ye=T(e,"FORBID_CONTENTS")?b({},e.FORBID_CONTENTS,at):Ve,Ae=T(e,"FORBID_TAGS")?b({},e.FORBID_TAGS,at):{},Re=T(e,"FORBID_ATTR")?b({},e.FORBID_ATTR,at):{},Ge=!!T(e,"USE_PROFILES")&&e.USE_PROFILES,Le=!1!==e.ALLOW_ARIA_ATTR,Ce=!1!==e.ALLOW_DATA_ATTR,Oe=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Me=e.SAFE_FOR_TEMPLATES||!1,De=!1!==e.SAFE_FOR_XML,Ie=e.WHOLE_DOCUMENT||!1,Ue=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,Pe=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,Be=e.SANITIZE_NAMED_PROPS||!1,We=!1!==e.KEEP_CONTENT,$e=e.IN_PLACE||!1,xe=e.ALLOWED_URI_REGEXP||$,tt=e.NAMESPACE||et,Se=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Se.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ut(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Se.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Se.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Me&&(Ce=!1),He&&(Ue=!0),Ge&&(Ee=b({},D),be=[],!0===Ge.html&&(b(Ee,R),b(be,I)),!0===Ge.svg&&(b(Ee,L),b(be,j),b(be,U)),!0===Ge.svgFilters&&(b(Ee,C),b(be,j),b(be,U)),!0===Ge.mathMl&&(b(Ee,k),b(be,P),b(be,U))),e.ADD_TAGS&&(Ee===we&&(Ee=S(Ee)),b(Ee,e.ADD_TAGS,at)),e.ADD_ATTR&&(be===Ne&&(be=S(be)),b(be,e.ADD_ATTR,at)),e.ADD_URI_SAFE_ATTR&&b(Ke,e.ADD_URI_SAFE_ATTR,at),e.FORBID_CONTENTS&&(Ye===Ve&&(Ye=S(Ye)),b(Ye,e.FORBID_CONTENTS,at)),We&&(Ee["#text"]=!0),Ie&&b(Ee,["html","head","body"]),Ee.table&&(b(Ee,["tbody"]),delete Ae.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw x('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');oe=e.TRUSTED_TYPES_POLICY,ie=oe.createHTML("")}else void 0===oe&&(oe=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+s+" could not be created."),null}}(W,l)),null!==oe&&"string"==typeof ie&&(ie=oe.createHTML(""));o&&o(e),lt=e}},mt=b({},["mi","mo","mn","ms","mtext"]),pt=b({},["annotation-xml"]),ft=b({},["title","style","font","a","script"]),gt=b({},[...L,...C,...O]),ht=b({},[...k,...M]),_t=function(e){m(r.removed,{element:e});try{se(e).removeChild(e)}catch(t){X(e)}},vt=function(e,t){try{m(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){m(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!be[e])if(Ue||He)try{_t(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Tt=function(e){let t=null,n=null;if(Pe)e="<remove></remove>"+e;else{const t=g(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ot&&tt===et&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const r=oe?oe.createHTML(e):e;if(tt===et)try{t=(new B).parseFromString(r,ot)}catch(e){}if(!t||!t.documentElement){t=ae.createDocument(tt,"template",null);try{t.documentElement.innerHTML=nt?ie:r}catch(e){}}const o=t.body||t.documentElement;return e&&n&&o.insertBefore(s.createTextNode(n),o.childNodes[0]||null),tt===et?ue.call(t,Ie?"html":"body")[0]:Ie?t.documentElement:o},yt=function(e){return le.call(e.ownerDocument||e,e,H.SHOW_ELEMENT|H.SHOW_COMMENT|H.SHOW_TEXT|H.SHOW_PROCESSING_INSTRUCTION|H.SHOW_CDATA_SECTION,null)},xt=function(e){return e instanceof F&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof z)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Et=function(e){return"function"==typeof w&&e instanceof w},wt=function(e,t,n){me[e]&&u(me[e],(e=>{e.call(r,t,n,lt)}))},bt=function(e){let t=null;if(wt("beforeSanitizeElements",e,null),xt(e))return _t(e),!0;const n=at(e.nodeName);if(wt("uponSanitizeElement",e,{tagName:n,allowedTags:Ee}),e.hasChildNodes()&&!Et(e.firstElementChild)&&y(/<[/\w]/g,e.innerHTML)&&y(/<[/\w]/g,e.textContent))return _t(e),!0;if(e.nodeType===J)return _t(e),!0;if(De&&e.nodeType===Q&&y(/<[/\w]/g,e.data))return _t(e),!0;if(!Ee[n]||Ae[n]){if(!Ae[n]&&St(n)){if(Se.tagNameCheck instanceof RegExp&&y(Se.tagNameCheck,n))return!1;if(Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))return!1}if(We&&!Ye[n]){const t=se(e)||e.parentNode,n=re(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const s=Y(n[r],!0);s.__removalCount=(e.__removalCount||0)+1,t.insertBefore(s,ne(e))}}return _t(e),!0}return e instanceof N&&!function(e){let t=se(e);t&&t.tagName||(t={namespaceURI:tt,tagName:"template"});const n=p(e.tagName),r=p(t.tagName);return!!rt[e.namespaceURI]&&(e.namespaceURI===Qe?t.namespaceURI===et?"svg"===n:t.namespaceURI===Je?"svg"===n&&("annotation-xml"===r||mt[r]):Boolean(gt[n]):e.namespaceURI===Je?t.namespaceURI===et?"math"===n:t.namespaceURI===Qe?"math"===n&&pt[r]:Boolean(ht[n]):e.namespaceURI===et?!(t.namespaceURI===Qe&&!pt[r])&&!(t.namespaceURI===Je&&!mt[r])&&!ht[n]&&(ft[n]||!gt[n]):!("application/xhtml+xml"!==ot||!rt[e.namespaceURI]))}(e)?(_t(e),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!y(/<\/no(script|embed|frames)/i,e.innerHTML)?(Me&&e.nodeType===Z&&(t=e.textContent,u([pe,fe,ge],(e=>{t=h(t,e," ")})),e.textContent!==t&&(m(r.removed,{element:e.cloneNode()}),e.textContent=t)),wt("afterSanitizeElements",e,null),!1):(_t(e),!0)},Nt=function(e,t,n){if(Fe&&("id"===t||"name"===t)&&(n in s||n in ct))return!1;if(Ce&&!Re[t]&&y(he,t));else if(Le&&y(_e,t));else if(!be[t]||Re[t]){if(!(St(e)&&(Se.tagNameCheck instanceof RegExp&&y(Se.tagNameCheck,e)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(e))&&(Se.attributeNameCheck instanceof RegExp&&y(Se.attributeNameCheck,t)||Se.attributeNameCheck instanceof Function&&Se.attributeNameCheck(t))||"is"===t&&Se.allowCustomizedBuiltInElements&&(Se.tagNameCheck instanceof RegExp&&y(Se.tagNameCheck,n)||Se.tagNameCheck instanceof Function&&Se.tagNameCheck(n))))return!1}else if(Ke[t]);else if(y(xe,h(n,Te,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==_(n,"data:")||!Xe[e])if(Oe&&!y(ve,h(n,Te,"")));else if(n)return!1;return!0},St=function(e){return"annotation-xml"!==e&&g(e,ye)},At=function(e){wt("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:be};let s=t.length;for(;s--;){const o=t[s],{name:i,namespaceURI:a,value:l}=o,c=at(i);let m="value"===i?l:v(l);if(n.attrName=c,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,wt("uponSanitizeAttribute",e,n),m=n.attrValue,n.forceKeepAttr)continue;if(vt(i,e),!n.keepAttr)continue;if(!ke&&y(/\/>/i,m)){vt(i,e);continue}Me&&u([pe,fe,ge],(e=>{m=h(m,e," ")}));const p=at(e.nodeName);if(Nt(p,c,m))if(!Be||"id"!==c&&"name"!==c||(vt(i,e),m="user-content-"+m),De&&y(/((--!?|])>)|<\/(style|title)/i,m))vt(i,e);else{if(oe&&"object"==typeof W&&"function"==typeof W.getAttributeType)if(a);else switch(W.getAttributeType(p,c)){case"TrustedHTML":m=oe.createHTML(m);break;case"TrustedScriptURL":m=oe.createScriptURL(m)}try{a?e.setAttributeNS(a,i,m):e.setAttribute(i,m),xt(e)?_t(e):d(r.removed)}catch(e){}}}wt("afterSanitizeAttributes",e,null)},Rt=function e(t){let n=null;const r=yt(t);for(wt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)wt("uponSanitizeShadowNode",n,null),bt(n)||(n.content instanceof c&&e(n.content),At(n));wt("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,s=null,o=null,a=null;if(nt=!e,nt&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Et(e)){if("function"!=typeof e.toString)throw x("toString is not a function");if("string"!=typeof(e=e.toString()))throw x("dirty is not a string, aborting")}if(!r.isSupported)return e;if(je||dt(t),r.removed=[],"string"==typeof e&&($e=!1),$e){if(e.nodeName){const t=at(e.nodeName);if(!Ee[t]||Ae[t])throw x("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof w)n=Tt("\x3c!----\x3e"),s=n.ownerDocument.importNode(e,!0),s.nodeType===K&&"BODY"===s.nodeName||"HTML"===s.nodeName?n=s:n.appendChild(s);else{if(!Ue&&!Me&&!Ie&&-1===e.indexOf("<"))return oe&&ze?oe.createHTML(e):e;if(n=Tt(e),!n)return Ue?null:ze?ie:""}n&&Pe&&_t(n.firstChild);const l=yt($e?e:n);for(;o=l.nextNode();)bt(o)||(o.content instanceof c&&Rt(o.content),At(o));if($e)return e;if(Ue){if(He)for(a=ce.call(n.ownerDocument);n.firstChild;)a.appendChild(n.firstChild);else a=n;return(be.shadowroot||be.shadowrootmode)&&(a=de.call(i,a,!0)),a}let d=Ie?n.outerHTML:n.innerHTML;return Ie&&Ee["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&y(V,n.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+d),Me&&u([pe,fe,ge],(e=>{d=h(d,e," ")})),oe&&ze?oe.createHTML(d):d},r.setConfig=function(){dt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),je=!0},r.clearConfig=function(){lt=null,je=!1},r.isValidAttribute=function(e,t,n){lt||dt({});const r=at(e),s=at(t);return Nt(r,s,n)},r.addHook=function(e,t){"function"==typeof t&&(me[e]=me[e]||[],m(me[e],t))},r.removeHook=function(e){if(me[e])return d(me[e])},r.removeHooks=function(e){me[e]&&(me[e]=[])},r.removeAllHooks=function(){me={}},r}()}()}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e;(e=n(835)).keys().forEach(e)})()})();