JezK
Edit File: product-elements.js
import*as t from"@wordpress/interactivity";import*as e from"@woocommerce/stores/woocommerce/products";var n={d:(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const o=(r={getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store},i={},n.d(i,r),i);var r,i;function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,a,l=[],c=!0,s=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(c=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);c=!0);}catch(t){s=!0,r=t}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(s)throw r}}return l}}(t,e)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.d({},{});const c=Object.entries,s=Object.setPrototypeOf,u=Object.isFrozen,f=Object.getPrototypeOf,p=Object.getOwnPropertyDescriptor;let m=Object.freeze,d=Object.seal,h=Object.create,g="undefined"!=typeof Reflect&&Reflect,y=g.apply,b=g.construct;m||(m=function(t){return t}),d||(d=function(t){return t}),y||(y=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return t.apply(e,o)}),b||(b=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;o<e;o++)n[o-1]=arguments[o];return new t(...n)});const T=H(Array.prototype.forEach),S=H(Array.prototype.lastIndexOf),w=H(Array.prototype.pop),E=H(Array.prototype.push),A=H(Array.prototype.splice),v=Array.isArray,O=H(String.prototype.toLowerCase),_=H(String.prototype.toString),x=H(String.prototype.match),N=H(String.prototype.replace),D=H(String.prototype.indexOf),R=H(String.prototype.trim),k=H(Number.prototype.toString),C=H(Boolean.prototype.toString),I="undefined"==typeof BigInt?null:H(BigInt.prototype.toString),L="undefined"==typeof Symbol?null:H(Symbol.prototype.toString),M=H(Object.prototype.hasOwnProperty),z=H(Object.prototype.toString),P=H(RegExp.prototype.test),U=(F=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return b(F,e)});var F;function H(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return y(t,e,o)}}function j(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:O;if(s&&s(t,null),!v(e))return t;let o=e.length;for(;o--;){let r=e[o];if("string"==typeof r){const t=n(r);t!==r&&(u(e)||(e[o]=t),r=t)}t[r]=!0}return t}function B(t){for(let e=0;e<t.length;e++)M(t,e)||(t[e]=null);return t}function W(t){const e=h(null);for(const o of c(t)){var n=l(o,2);const r=n[0],i=n[1];M(t,r)&&(v(i)?e[r]=B(i):i&&"object"==typeof i&&i.constructor===Object?e[r]=W(i):e[r]=i)}return e}function Y(t,e){for(;null!==t;){const n=p(t,e);if(n){if(n.get)return H(n.get);if("function"==typeof n.value)return H(n.value)}t=f(t)}return function(){return null}}const G=m(["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"]),q=m(["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"]),$=m(["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"]),K=m(["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"]),X=m(["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"]),V=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Z=m(["#text"]),J=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","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"]),Q=m(["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","dominant-baseline","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","pointer-events","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-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","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"]),tt=m(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),et=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),nt=d(/{{[\w\W]*|^[\w\W]*}}/g),ot=d(/<%[\w\W]*|^[\w\W]*%>/g),rt=d(/\${[\w\W]*/g),it=d(/^data-[\-\w.\u00B7-\uFFFF]+$/),at=d(/^aria-[\-\w]+$/),lt=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ct=d(/^(?:\w+script|data):/i),st=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ut=d(/^html$/i),ft=d(/^[a-z][.\w]*(-[.\w]+)+$/i),pt=d(/<[/\w!]/g),mt=d(/<[/\w]/g),dt=d(/<\/no(script|embed|frames)/i),ht=d(/\/>/i),gt=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],yt=m(j({},gt)),bt=function(){const t={};return T(gt,e=>{t[e]=d(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),m(t)}(),Tt=function(){return"undefined"==typeof window?null:window},St=function(t,e,n,o){return M(t,e)&&v(t[e])?j(o.base?W(o.base):{},t[e],o.transform):n},wt=function(t,e,n){const o=M(t,e)?t[e]:void 0;return o&&"object"==typeof o?W(o):n()};var Et=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tt();const n=e=>t(e);if(n.version="3.4.14",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let o=e.document;const r=o,i=r.currentScript;e.DocumentFragment;const a=e.HTMLTemplateElement,l=e.Node,s=e.Element,u=e.NodeFilter;void 0===e.NamedNodeMap&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const f=e.DOMParser,p=e.trustedTypes,g=s.prototype,y=Y(g,"cloneNode"),b=Y(g,"remove"),F=Y(g,"nextSibling"),H=Y(g,"childNodes"),B=Y(g,"parentNode"),gt=Y(g,"shadowRoot"),Et=Y(g,"attributes"),At=l&&l.prototype?Y(l.prototype,"nodeType"):null,vt=l&&l.prototype?Y(l.prototype,"nodeName"):null,Ot=l&&l.prototype?Y(l.prototype,"ownerDocument"):null,_t=function(t){return At?At(t):t.nodeType},xt=function(t){return vt?vt(t):t.nodeName};if("function"==typeof a){const t=o.createElement("template");t.content&&t.content.ownerDocument&&(o=t.content.ownerDocument)}let Nt,Dt,Rt="",kt=!1,Ct=0;const It=function(){if(Ct>0)throw U('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Lt=function(t){It(),Ct++;try{return Nt.createHTML(t)}finally{Ct--}},Mt=o,zt=Mt.implementation,Pt=Mt.createNodeIterator,Ut=Mt.createDocumentFragment,Ft=Mt.getElementsByTagName,Ht=r.importNode;let jt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof c&&"function"==typeof B&&zt&&void 0!==zt.createHTMLDocument;const Bt=nt,Wt=ot,Yt=rt,Gt=it,qt=at,$t=ct,Kt=st,Xt=ft;let Vt=lt,Zt=null;const Jt=j({},[...G,...q,...$,...X,...Z]);let Qt=null;const te=j({},[...J,...Q,...tt,...et]);let ee=Object.seal(h(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}})),ne=null,oe=null;const re=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ie=!0,ae=!0,le=!1,ce=!0,se=!1,ue=!0,fe=!1,pe=!1,me=null,de=null,he=!1,ge=!1,ye=!1,be=!1,Te=!0,Se=!1;const we="user-content-";let Ee=!0,Ae=!1,ve={},Oe=null;const _e=j({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let xe=null;const Ne=j({},["audio","video","img","source","image","track"]);let De=null;const Re=j({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ke="http://www.w3.org/1998/Math/MathML",Ce="http://www.w3.org/2000/svg",Ie="http://www.w3.org/1999/xhtml";let Le=Ie,Me=!1,ze=null;const Pe=j({},[ke,Ce,Ie],_),Ue=m(["mi","mo","mn","ms","mtext"]);let Fe=j({},Ue);const He=m(["annotation-xml"]);let je=j({},He);const Be=j({},["title","style","font","a","script"]);let We=null;const Ye=["application/xhtml+xml","text/html"];let Ge=null,qe=null;const $e=o.createElement("form"),Ke=function(t){return t instanceof RegExp||t instanceof Function},Xe=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(qe&&qe===t)return;t&&"object"==typeof t||(t={}),t=W(t),We=-1===Ye.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Ge="application/xhtml+xml"===We?_:O,Zt=St(t,"ALLOWED_TAGS",Jt,{transform:Ge}),Qt=St(t,"ALLOWED_ATTR",te,{transform:Ge}),ze=St(t,"ALLOWED_NAMESPACES",Pe,{transform:_}),De=St(t,"ADD_URI_SAFE_ATTR",Re,{transform:Ge,base:Re}),xe=St(t,"ADD_DATA_URI_TAGS",Ne,{transform:Ge,base:Ne}),Oe=St(t,"FORBID_CONTENTS",_e,{transform:Ge}),ne=St(t,"FORBID_TAGS",W({}),{transform:Ge}),oe=St(t,"FORBID_ATTR",W({}),{transform:Ge}),ve=!!M(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?W(t.USE_PROFILES):t.USE_PROFILES),ie=!1!==t.ALLOW_ARIA_ATTR,ae=!1!==t.ALLOW_DATA_ATTR,le=t.ALLOW_UNKNOWN_PROTOCOLS||!1,ce=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,se=t.SAFE_FOR_TEMPLATES||!1,ue=!1!==t.SAFE_FOR_XML,fe=t.WHOLE_DOCUMENT||!1,ge=t.RETURN_DOM||!1,ye=t.RETURN_DOM_FRAGMENT||!1,be=t.RETURN_TRUSTED_TYPE||!1,he=t.FORCE_BODY||!1,Te=!1!==t.SANITIZE_DOM,Se=t.SANITIZE_NAMED_PROPS||!1,Ee=!1!==t.KEEP_CONTENT,Ae=t.IN_PLACE||!1,Vt=function(t){try{return P(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:lt,Le="string"==typeof t.NAMESPACE?t.NAMESPACE:Ie,Fe=wt(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>j({},Ue)),je=wt(t,"HTML_INTEGRATION_POINTS",()=>j({},He));const e=wt(t,"CUSTOM_ELEMENT_HANDLING",()=>h(null));if(ee=h(null),M(e,"tagNameCheck")&&Ke(e.tagNameCheck)&&(ee.tagNameCheck=e.tagNameCheck),M(e,"attributeNameCheck")&&Ke(e.attributeNameCheck)&&(ee.attributeNameCheck=e.attributeNameCheck),M(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ee.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),d(ee),se&&(ae=!1),ye&&(ge=!0),ve&&(Zt=j({},Z),Qt=h(null),!0===ve.html&&(j(Zt,G),j(Qt,J)),!0===ve.svg&&(j(Zt,q),j(Qt,Q),j(Qt,et)),!0===ve.svgFilters&&(j(Zt,$),j(Qt,Q),j(Qt,et)),!0===ve.mathMl&&(j(Zt,X),j(Qt,tt),j(Qt,et))),re.tagCheck=null,re.attributeCheck=null,M(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?re.tagCheck=t.ADD_TAGS:v(t.ADD_TAGS)&&(Zt===Jt&&(Zt=W(Zt)),j(Zt,t.ADD_TAGS,Ge))),M(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?re.attributeCheck=t.ADD_ATTR:v(t.ADD_ATTR)&&(Qt===te&&(Qt=W(Qt)),j(Qt,t.ADD_ATTR,Ge))),M(t,"ADD_FORBID_CONTENTS")&&v(t.ADD_FORBID_CONTENTS)&&(Oe===_e&&(Oe=W(Oe)),j(Oe,t.ADD_FORBID_CONTENTS,Ge)),Ee&&(Zt["#text"]=!0),fe&&j(Zt,["html","head","body"]),Zt.table&&(j(Zt,["tbody"]),delete ne.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw U('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw U('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=Nt;Nt=t.TRUSTED_TYPES_POLICY;try{Rt=Lt("")}catch(t){throw Nt=e,t}}else null===t.TRUSTED_TYPES_POLICY?(Nt=void 0,Rt=""):(void 0===Nt&&(kt||(Dt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(p,i),kt=!0),Nt=Dt),Nt&&"string"==typeof Rt&&(Rt=Lt("")));m&&m(t),qe=t},Ve=j({},[...q,...$,...K]),Ze=j({},[...X,...V]),Je=function(t){E(n.removed,{element:t});try{B(t).removeChild(t)}catch(e){if(b(t),!B(t))throw U("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qe=function(t,e,n){try{t.removeAttributeNode(e)}catch(e){try{t.removeAttribute(n)}catch(t){}}},tn=function(t){on(t);const e=H(t);if(e){const t=[];T(e,e=>{E(t,e)}),T(t,t=>{try{b(t)}catch(t){}})}const n=Et(t);if(n)for(let e=n.length-1;e>=0;--e){const o=n[e],r=o&&o.name;"string"==typeof r&&Qe(t,o,r)}},en=function(t,e,o){if(!o)try{o=e.getAttributeNode(t)}catch(t){o=null}E(n.removed,{attribute:o||null,from:e});try{o?e.removeAttributeNode(o):e.removeAttribute(t)}catch(n){try{e.removeAttribute(t)}catch(t){}}if("is"===t)if(ge||ye)try{Je(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},nn=function(t){const e=Et(t);if(e)for(let n=e.length-1;n>=0;--n){const o=e[n],r=o&&o.name;"string"!=typeof r||Qt[Ge(r)]||Qe(t,o,r)}},on=function(t){const e=[t];for(;e.length>0;){const t=e.pop();1===_t(t)&&nn(t);const n=H(t);if(n)for(let t=n.length-1;t>=0;--t)e.push(n[t])}},rn=function(t,e){return!!ue&&("patchsrc"===t||"for"===t&&"label"!==e&&"output"!==e)},an=function(t){let e=null,n=null;if(he)t="<remove></remove>"+t;else{const e=x(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===We&&Le===Ie&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=Nt?Lt(t):t;if(Le===Ie)try{e=(new f).parseFromString(r,We)}catch(t){}if(!e||!e.documentElement){e=zt.createDocument(Le,"template",null);try{e.documentElement.innerHTML=Me?Rt:r}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),Le===Ie?Ft.call(e,fe?"html":"body")[0]:fe?e.documentElement:i},ln=function(t){const e=Ot?Ot(t):t.ownerDocument;return Pt.call(e||t,t,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},cn=function(t){return t=N(t,Bt," "),t=N(t,Wt," "),N(t,Yt," ")},sn=function(t){var e;t.normalize();const n=Ot?Ot(t):t.ownerDocument,o=Pt.call(n||t,t,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let r=o.nextNode();for(;r;)r.data=cn(r.data),r=o.nextNode();const i=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");i&&T(i,t=>{fn(t.content)&&sn(t.content)})},un=function(t){const e=vt?vt(t):null;return"string"==typeof e&&"form"===Ge(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==Et(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==At(t)||t.childNodes!==H(t))},fn=function(t){if(!At||"object"!=typeof t||null===t)return!1;try{return 11===At(t)}catch(t){return!1}},pn=function(t){if(!At||"object"!=typeof t||null===t)return!1;try{return"number"==typeof At(t)}catch(t){return!1}};function mn(t,e,o){0!==t.length&&T(t,t=>{t.call(n,e,o,qe)})}const dn=function(t,e){if(t instanceof RegExp)return P(t,e);if(t instanceof Function){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return Boolean(t(e,...o))}return!1},hn=function(t,e,n,o){return 0===t.length?e:e===n||e===o?W(e):e},gn=function(t,e){return t!==e&&null===B(t)&&(Ae&&on(t),!0)},yn=function(t,e){if(mn(jt.beforeSanitizeElements,t,null),gn(t,e))return!0;if(un(t))return Je(t),!0;const o=Ge(xt(t));if(Zt=hn(jt.uponSanitizeElement,Zt,Jt,me),mn(jt.uponSanitizeElement,t,{tagName:o,allowedTags:Zt}),gn(t,e))return!0;if(function(t,e){return!!(ue&&t.hasChildNodes()&&!pn(t.firstElementChild)&&P(pt,t.textContent)&&P(pt,t.innerHTML))||!!(ue&&t.namespaceURI===Ie&&yt[e]&&(pn(t.firstElementChild)||"string"==typeof t.textContent&&P(bt[e],t.textContent)))||7===t.nodeType||!(!ue||8!==t.nodeType||!P(mt,t.data))}(t,o))return Je(t),!0;if(ne[o]||!(re.tagCheck instanceof Function&&re.tagCheck(o))&&!Zt[o]){const n=function(t,e,n){if(!ne[e]&&Sn(e)&&dn(ee.tagNameCheck,e))return!1;if(Ee&&!Oe[e]){const e=B(t),o=H(t);if(o&&e)for(let r=o.length-1;r>=0;--r){const i=t===n?y(o[r],!0):o[r];e.insertBefore(i,F(t))}}return Je(t),!0}(t,o,e);return!1===n&&mn(jt.afterSanitizeElements,t,null),n}if(1===_t(t)&&!function(t){let e=B(t);e&&e.tagName||(e={namespaceURI:Le,tagName:"template"});const n=O(t.tagName),o=O(e.tagName);return!!ze[t.namespaceURI]&&(t.namespaceURI===Ce?function(t,e,n){return e.namespaceURI===Ie?"svg"===t:e.namespaceURI===ke?"svg"===t&&("annotation-xml"===n||Fe[n]):Boolean(Ve[t])}(n,e,o):t.namespaceURI===ke?function(t,e,n){return e.namespaceURI===Ie?"math"===t:e.namespaceURI===Ce?"math"===t&&je[n]:Boolean(Ze[t])}(n,e,o):t.namespaceURI===Ie?function(t,e,n){return!(e.namespaceURI===Ce&&!je[n])&&!(e.namespaceURI===ke&&!Fe[n])&&!Ze[t]&&(Be[t]||!Ve[t])}(n,e,o):!("application/xhtml+xml"!==We||!ze[t.namespaceURI]))}(t))return Je(t),!0;if(("noscript"===o||"noembed"===o||"noframes"===o)&&P(dt,t.innerHTML))return Je(t),!0;if(se&&3===t.nodeType){const e=cn(t.textContent);t.textContent!==e&&(E(n.removed,{element:t.cloneNode()}),t.textContent=e)}return mn(jt.afterSanitizeElements,t,null),!1},bn=function(t,e,n){if(oe[e])return!1;if(rn(e,t))return!1;if(Te&&("id"===e||"name"===e)&&(n in o||n in $e))return!1;const r=Qt[e]||re.attributeCheck instanceof Function&&re.attributeCheck(e,t);return!(!ae||!P(Gt,e))||!(!ie||!P(qt,e))||(r?!(!De[e]&&!P(Vt,N(n,Kt,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==D(n,"data:")||!xe[t])&&(!le||P($t,N(n,Kt,"")))&&n):Sn(t)&&dn(ee.tagNameCheck,t)&&dn(ee.attributeNameCheck,e,t)||"is"===e&&ee.allowCustomizedBuiltInElements&&dn(ee.tagNameCheck,n))},Tn=j({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Sn=function(t){return!Tn[O(t)]&&P(Xt,t)},wn=function(t,e,n,o){if(Nt&&"object"==typeof p&&"function"==typeof p.getAttributeType&&!n)switch(p.getAttributeType(t,e)){case"TrustedHTML":return Lt(o);case"TrustedScriptURL":return function(t){It(),Ct++;try{return Nt.createScriptURL(t)}finally{Ct--}}(o)}return o},En=function(t,e,o,r){try{o?t.setAttributeNS(o,e,r):t.setAttribute(e,r),un(t)?Je(t):w(n.removed)}catch(n){en(e,t)}},An=function(t){mn(jt.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||un(t))return;Qt=hn(jt.uponSanitizeAttribute,Qt,te,de);const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Qt,forceKeepAttr:void 0};let o=e.length;const r=Ge(t.nodeName);for(;o--;){const i=e[o],a=i.name,l=i.namespaceURI,c=i.value,s=Ge(a),u=c;let f="value"===a?u:R(u);n.attrName=s,n.attrValue=f,n.keepAttr=!0,n.forceKeepAttr=void 0,mn(jt.uponSanitizeAttribute,t,n),f=n.attrValue,!Se||"id"!==s&&"name"!==s||0===D(f,we)||(en(a,t,i),f=we+f),ue&&P(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||"attributename"===s&&x(f,"href")?en(a,t,i):n.forceKeepAttr||(!n.keepAttr||!ce&&P(ht,f)?en(a,t,i):(se&&(f=cn(f)),bn(r,s,f)?(f=wn(r,s,l,f),f!==u&&En(t,a,l,f)):en(a,t,i)))}mn(jt.afterSanitizeAttributes,t,null)},vn=function(t){let e=null;const n=ln(t);for(mn(jt.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(mn(jt.uponSanitizeShadowNode,e,null),yn(e,t),An(e),fn(e.content)&&vn(e.content),1===_t(e)){const t=gt(e);fn(t)&&(On(t),vn(t))}mn(jt.afterSanitizeShadowDOM,t,null)},On=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){vn(t.shadow);continue}const n=t.node,o=1===_t(n),r=H(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(o){const t=vt?vt(n):null;if("string"==typeof t&&"template"===Ge(t)){const t=n.content;fn(t)&&e.push({node:t,shadow:null})}}if(o){const t=gt(n);fn(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,i=null,a=null,l=null;if(Me=!t,Me&&(t="\x3c!--\x3e"),"string"!=typeof t&&!pn(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return k(t);case"boolean":return C(t);case"bigint":return I?I(t):"0";case"symbol":return L?L(t):"Symbol()";case"undefined":default:return z(t);case"function":case"object":{if(null===t)return z(t);const e=t,n=Y(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:z(t)}return z(t)}}}(t)))throw U("dirty is not a string, aborting");if(!n.isSupported)return t;pe?(Zt=me,Qt=de):Xe(e),(jt.uponSanitizeElement.length>0||jt.uponSanitizeAttribute.length>0)&&(Zt=W(Zt)),jt.uponSanitizeAttribute.length>0&&(Qt=W(Qt)),n.removed=[];const c=Ae&&"string"!=typeof t&&pn(t);if(c){!function(t){if(!ue)return;const e=[t];for(;e.length>0;){const t=e.pop(),n=_t(t);if(7===n||8===n&&P(mt,t.data)){try{b(t)}catch(t){}continue}if(1===n){const e=t,n=Ge(xt(t));try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&rn("for",n)&&e.removeAttribute("for")}catch(t){}}const o=H(t);if(o)for(let t=o.length-1;t>=0;--t)e.push(o[t])}}(t);const e=xt(t);if("string"==typeof e){const n=Ge(e);if(!Zt[n]||ne[n])throw tn(t),U("root node is forbidden and cannot be sanitized in-place")}if(un(t))throw tn(t),U("root node is clobbered and cannot be sanitized in-place");try{On(t)}catch(e){throw tn(t),e}}else if(pn(t))o=an("\x3c!----\x3e"),i=o.ownerDocument.importNode(t,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i),On(i);else{if(!ge&&!se&&!fe&&-1===t.indexOf("<"))return Nt&&be?Lt(t):t;if(o=an(t),!o)return ge?null:be?Rt:""}o&&he&&Je(o.firstChild);const s=c?t:o;try{const t=ln(s);for(;a=t.nextNode();)yn(a,s),An(a),fn(a.content)&&vn(a.content)}catch(e){throw c&&(tn(t),T(n.removed,t=>{t.element&&on(t.element)})),e}if(c)return T(n.removed,t=>{t.element&&on(t.element)}),se&&sn(t),t;if(ge){if(se&&sn(o),ye)for(l=Ut.call(o.ownerDocument);o.firstChild;)l.appendChild(o.firstChild);else l=o;return(Qt.shadowroot||Qt.shadowrootmode)&&(l=Ht.call(r,l,!0)),l}let u=fe?o.outerHTML:o.innerHTML;return fe&&Zt["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&P(ut,o.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+u),se&&(u=cn(u)),Nt&&be?Lt(u):u},n.setConfig=function(){Xe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),pe=!0,me=Zt,de=Qt},n.clearConfig=function(){qe=null,pe=!1,me=null,de=null,Nt=Dt,Rt=""},n.isValidAttribute=function(t,e,n){qe||Xe({});const o=Ge(t),r=Ge(e);return bn(o,r,n)},n.addHook=function(t,e){"function"==typeof e&&M(jt,t)&&E(jt[t],e)},n.removeHook=function(t,e){if(M(jt,t)){if(void 0!==e){const n=S(jt[t],e);return-1===n?void 0:A(jt[t],n,1)[0]}return w(jt[t])}},n.removeHooks=function(t){M(jt,t)&&(jt[t]=[])},n.removeAllHooks=function(){jt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();let At;const vt=["a","b","em","i","strong","p","br","abbr"],Ot=["target","href","rel","name","download","title"];const _t={tags:["a","b","em","i","strong","p","br","span","bdi","del","ins","small"],attr:["class","target","href","rel","name","download","aria-hidden","dir","translate"]},{state:xt}=(0,o.store)("woocommerce/products",{},{lock:"I acknowledge that using a private store means my plugin will inevitably break on the next store release."});(0,o.store)("woocommerce/product-elements",{callbacks:{updateValue:()=>{const t=xt.productInContext;if(!t)return;const{productElementKey:e}=(0,o.getContext)();((t,e,n)=>{t&&"string"==typeof e&&(t.innerHTML=function(t,e){const n={ALLOWED_TAGS:[...e?.tags||vt],ALLOWED_ATTR:[...e?.attr||Ot]},o=function(){if(void 0!==At)return At;if("undefined"==typeof window||!window.trustedTypes)return At=null,null;try{At=window.trustedTypes.createPolicy("woocommerce-sanitize-noop",{createHTML:t=>t})}catch(t){At=null,console.warn('Failed to create "woocommerce-sanitize-noop" trusted type policy:',t)}return At}();return o&&(n.TRUSTED_TYPES_POLICY=o),"HTMLBodyElement"===e?.returnType?n.RETURN_DOM=!0:"DocumentFragment"===e?.returnType&&(n.RETURN_DOM_FRAGMENT=!0),Et.sanitize(t??"",n)}(e,n))})((0,o.getElement)().ref,t[e],_t)}}},{lock:!0});