JezK
Edit File: wishlist.js
import*as t from"@wordpress/interactivity";import*as e from"@woocommerce/stores/woocommerce/shopper-lists";import*as n from"@woocommerce/stores/woocommerce/cart";var o={d:(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const r=(i={getConfig:()=>t.getConfig,getContext:()=>t.getContext,getElement:()=>t.getElement,store:()=>t.store},a={},o.d(a,i),a);var i,a;function l(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 c(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 l(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)?l(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.")}()}o.d({},{}),o.d({},{});const s=Object.entries,u=Object.setPrototypeOf,m=Object.isFrozen,f=Object.getPrototypeOf,p=Object.getOwnPropertyDescriptor;let d=Object.freeze,h=Object.seal,g=Object.create,y="undefined"!=typeof Reflect&&Reflect,b=y.apply,T=y.construct;d||(d=function(t){return t}),h||(h=function(t){return t}),b||(b=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)}),T||(T=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 w=j(Array.prototype.forEach),S=j(Array.prototype.lastIndexOf),v=j(Array.prototype.pop),A=j(Array.prototype.push),E=j(Array.prototype.splice),x=Array.isArray,_=j(String.prototype.toLowerCase),O=j(String.prototype.toString),C=j(String.prototype.match),N=j(String.prototype.replace),k=j(String.prototype.indexOf),D=j(String.prototype.trim),R=j(Number.prototype.toString),I=j(Boolean.prototype.toString),L="undefined"==typeof BigInt?null:j(BigInt.prototype.toString),M="undefined"==typeof Symbol?null:j(Symbol.prototype.toString),z=j(Object.prototype.hasOwnProperty),P=j(Object.prototype.toString),U=j(RegExp.prototype.test),F=(H=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return T(H,e)});var H;function j(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 b(t,e,o)}}function B(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_;if(u&&u(t,null),!x(e))return t;let o=e.length;for(;o--;){let r=e[o];if("string"==typeof r){const t=n(r);t!==r&&(m(e)||(e[o]=t),r=t)}t[r]=!0}return t}function W(t){for(let e=0;e<t.length;e++)z(t,e)||(t[e]=null);return t}function Y(t){const e=g(null);for(const o of s(t)){var n=c(o,2);const r=n[0],i=n[1];z(t,r)&&(x(i)?e[r]=W(i):i&&"object"==typeof i&&i.constructor===Object?e[r]=Y(i):e[r]=i)}return e}function G(t,e){for(;null!==t;){const n=p(t,e);if(n){if(n.get)return j(n.get);if("function"==typeof n.value)return j(n.value)}t=f(t)}return function(){return null}}const q=d(["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"]),$=d(["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"]),K=d(["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"]),X=d(["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"]),V=d(["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"]),Z=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),J=d(["#text"]),Q=d(["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"]),tt=d(["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"]),et=d(["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"]),nt=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ot=h(/{{[\w\W]*|^[\w\W]*}}/g),rt=h(/<%[\w\W]*|^[\w\W]*%>/g),it=h(/\${[\w\W]*/g),at=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),lt=h(/^aria-[\-\w]+$/),ct=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),st=h(/^(?:\w+script|data):/i),ut=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),mt=h(/^html$/i),ft=h(/^[a-z][.\w]*(-[.\w]+)+$/i),pt=h(/<[/\w!]/g),dt=h(/<[/\w]/g),ht=h(/<\/no(script|embed|frames)/i),gt=h(/\/>/i),yt=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],bt=d(B({},yt)),Tt=function(){const t={};return w(yt,e=>{t[e]=h(new RegExp("</"+e+"(?=[\\t\\n\\f\\r />])","i"))}),d(t)}(),wt=function(){return"undefined"==typeof window?null:window},St=function(t,e,n,o){return z(t,e)&&x(t[e])?B(o.base?Y(o.base):{},t[e],o.transform):n},vt=function(t,e,n){const o=z(t,e)?t[e]:void 0;return o&&"object"==typeof o?Y(o):n()};var At=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wt();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,c=e.Element,u=e.NodeFilter;void 0===e.NamedNodeMap&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const m=e.DOMParser,f=e.trustedTypes,p=c.prototype,y=G(p,"cloneNode"),b=G(p,"remove"),T=G(p,"nextSibling"),H=G(p,"childNodes"),j=G(p,"parentNode"),W=G(p,"shadowRoot"),yt=G(p,"attributes"),At=l&&l.prototype?G(l.prototype,"nodeType"):null,Et=l&&l.prototype?G(l.prototype,"nodeName"):null,xt=l&&l.prototype?G(l.prototype,"ownerDocument"):null,_t=function(t){return At?At(t):t.nodeType},Ot=function(t){return Et?Et(t):t.nodeName};if("function"==typeof a){const t=o.createElement("template");t.content&&t.content.ownerDocument&&(o=t.content.ownerDocument)}let Ct,Nt,kt="",Dt=!1,Rt=0;const It=function(){if(Rt>0)throw F('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(),Rt++;try{return Ct.createHTML(t)}finally{Rt--}},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 s&&"function"==typeof j&&zt&&void 0!==zt.createHTMLDocument;const Bt=ot,Wt=rt,Yt=it,Gt=at,qt=lt,$t=st,Kt=ut,Xt=ft;let Vt=ct,Zt=null;const Jt=B({},[...q,...$,...K,...V,...J]);let Qt=null;const te=B({},[...Q,...tt,...et,...nt]);let ee=Object.seal(g(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(g(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,me=!1,fe=!1,pe=null,de=null,he=!1,ge=!1,ye=!1,be=!1,Te=!0,we=!1;const Se="user-content-";let ve=!0,Ae=!1,Ee={},xe=null;const _e=B({},["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 Oe=null;const Ce=B({},["audio","video","img","source","image","track"]);let Ne=null;const ke=B({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),De="http://www.w3.org/1998/Math/MathML",Re="http://www.w3.org/2000/svg",Ie="http://www.w3.org/1999/xhtml";let Le=Ie,Me=!1,ze=null;const Pe=B({},[De,Re,Ie],O),Ue=d(["mi","mo","mn","ms","mtext"]);let Fe=B({},Ue);const He=d(["annotation-xml"]);let je=B({},He);const Be=B({},["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=Y(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:O}),Ne=St(t,"ADD_URI_SAFE_ATTR",ke,{transform:Ge,base:ke}),Oe=St(t,"ADD_DATA_URI_TAGS",Ce,{transform:Ge,base:Ce}),xe=St(t,"FORBID_CONTENTS",_e,{transform:Ge}),ne=St(t,"FORBID_TAGS",Y({}),{transform:Ge}),oe=St(t,"FORBID_ATTR",Y({}),{transform:Ge}),Ee=!!z(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?Y(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,me=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,we=t.SANITIZE_NAMED_PROPS||!1,ve=!1!==t.KEEP_CONTENT,Ae=t.IN_PLACE||!1,Vt=function(t){try{return U(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:ct,Le="string"==typeof t.NAMESPACE?t.NAMESPACE:Ie,Fe=vt(t,"MATHML_TEXT_INTEGRATION_POINTS",()=>B({},Ue)),je=vt(t,"HTML_INTEGRATION_POINTS",()=>B({},He));const e=vt(t,"CUSTOM_ELEMENT_HANDLING",()=>g(null));if(ee=g(null),z(e,"tagNameCheck")&&Ke(e.tagNameCheck)&&(ee.tagNameCheck=e.tagNameCheck),z(e,"attributeNameCheck")&&Ke(e.attributeNameCheck)&&(ee.attributeNameCheck=e.attributeNameCheck),z(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(ee.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),h(ee),se&&(ae=!1),ye&&(ge=!0),Ee&&(Zt=B({},J),Qt=g(null),!0===Ee.html&&(B(Zt,q),B(Qt,Q)),!0===Ee.svg&&(B(Zt,$),B(Qt,tt),B(Qt,nt)),!0===Ee.svgFilters&&(B(Zt,K),B(Qt,tt),B(Qt,nt)),!0===Ee.mathMl&&(B(Zt,V),B(Qt,et),B(Qt,nt))),re.tagCheck=null,re.attributeCheck=null,z(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?re.tagCheck=t.ADD_TAGS:x(t.ADD_TAGS)&&(Zt===Jt&&(Zt=Y(Zt)),B(Zt,t.ADD_TAGS,Ge))),z(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?re.attributeCheck=t.ADD_ATTR:x(t.ADD_ATTR)&&(Qt===te&&(Qt=Y(Qt)),B(Qt,t.ADD_ATTR,Ge))),z(t,"ADD_FORBID_CONTENTS")&&x(t.ADD_FORBID_CONTENTS)&&(xe===_e&&(xe=Y(xe)),B(xe,t.ADD_FORBID_CONTENTS,Ge)),ve&&(Zt["#text"]=!0),me&&B(Zt,["html","head","body"]),Zt.table&&(B(Zt,["tbody"]),delete ne.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw F('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw F('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=Ct;Ct=t.TRUSTED_TYPES_POLICY;try{kt=Lt("")}catch(t){throw Ct=e,t}}else null===t.TRUSTED_TYPES_POLICY?(Ct=void 0,kt=""):(void 0===Ct&&(Dt||(Nt=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}}(f,i),Dt=!0),Ct=Nt),Ct&&"string"==typeof kt&&(kt=Lt("")));d&&d(t),qe=t},Ve=B({},[...$,...K,...X]),Ze=B({},[...V,...Z]),Je=function(t){A(n.removed,{element:t});try{j(t).removeChild(t)}catch(e){if(b(t),!j(t))throw F("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=[];w(e,e=>{A(t,e)}),w(t,t=>{try{b(t)}catch(t){}})}const n=yt(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}A(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=yt(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=C(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=Ct?Lt(t):t;if(Le===Ie)try{e=(new m).parseFromString(r,We)}catch(t){}if(!e||!e.documentElement){e=zt.createDocument(Le,"template",null);try{e.documentElement.innerHTML=Me?kt: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,me?"html":"body")[0]:me?e.documentElement:i},ln=function(t){const e=xt?xt(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=xt?xt(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&&w(i,t=>{mn(t.content)&&sn(t.content)})},un=function(t){const e=Et?Et(t):null;return"string"==typeof e&&"form"===Ge(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==yt(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))},mn=function(t){if(!At||"object"!=typeof t||null===t)return!1;try{return 11===At(t)}catch(t){return!1}},fn=function(t){if(!At||"object"!=typeof t||null===t)return!1;try{return"number"==typeof At(t)}catch(t){return!1}};function pn(t,e,o){0!==t.length&&w(t,t=>{t.call(n,e,o,qe)})}const dn=function(t,e){if(t instanceof RegExp)return U(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?Y(e):e},gn=function(t,e){return t!==e&&null===j(t)&&(Ae&&on(t),!0)},yn=function(t,e){if(pn(jt.beforeSanitizeElements,t,null),gn(t,e))return!0;if(un(t))return Je(t),!0;const o=Ge(Ot(t));if(Zt=hn(jt.uponSanitizeElement,Zt,Jt,pe),pn(jt.uponSanitizeElement,t,{tagName:o,allowedTags:Zt}),gn(t,e))return!0;if(function(t,e){return!!(ue&&t.hasChildNodes()&&!fn(t.firstElementChild)&&U(pt,t.textContent)&&U(pt,t.innerHTML))||!!(ue&&t.namespaceURI===Ie&&bt[e]&&(fn(t.firstElementChild)||"string"==typeof t.textContent&&U(Tt[e],t.textContent)))||7===t.nodeType||!(!ue||8!==t.nodeType||!U(dt,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]&&wn(e)&&dn(ee.tagNameCheck,e))return!1;if(ve&&!xe[e]){const e=j(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,T(t))}}return Je(t),!0}(t,o,e);return!1===n&&pn(jt.afterSanitizeElements,t,null),n}if(1===_t(t)&&!function(t){let e=j(t);e&&e.tagName||(e={namespaceURI:Le,tagName:"template"});const n=_(t.tagName),o=_(e.tagName);return!!ze[t.namespaceURI]&&(t.namespaceURI===Re?function(t,e,n){return e.namespaceURI===Ie?"svg"===t:e.namespaceURI===De?"svg"===t&&("annotation-xml"===n||Fe[n]):Boolean(Ve[t])}(n,e,o):t.namespaceURI===De?function(t,e,n){return e.namespaceURI===Ie?"math"===t:e.namespaceURI===Re?"math"===t&&je[n]:Boolean(Ze[t])}(n,e,o):t.namespaceURI===Ie?function(t,e,n){return!(e.namespaceURI===Re&&!je[n])&&!(e.namespaceURI===De&&!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)&&U(ht,t.innerHTML))return Je(t),!0;if(se&&3===t.nodeType){const e=cn(t.textContent);t.textContent!==e&&(A(n.removed,{element:t.cloneNode()}),t.textContent=e)}return pn(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||!U(Gt,e))||!(!ie||!U(qt,e))||(r?!(!Ne[e]&&!U(Vt,N(n,Kt,""))&&("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==k(n,"data:")||!Oe[t])&&(!le||U($t,N(n,Kt,"")))&&n):wn(t)&&dn(ee.tagNameCheck,t)&&dn(ee.attributeNameCheck,e,t)||"is"===e&&ee.allowCustomizedBuiltInElements&&dn(ee.tagNameCheck,n))},Tn=B({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),wn=function(t){return!Tn[_(t)]&&U(Xt,t)},Sn=function(t,e,n,o){if(Ct&&"object"==typeof f&&"function"==typeof f.getAttributeType&&!n)switch(f.getAttributeType(t,e)){case"TrustedHTML":return Lt(o);case"TrustedScriptURL":return function(t){It(),Rt++;try{return Ct.createScriptURL(t)}finally{Rt--}}(o)}return o},vn=function(t,e,o,r){try{o?t.setAttributeNS(o,e,r):t.setAttribute(e,r),un(t)?Je(t):v(n.removed)}catch(n){en(e,t)}},An=function(t){pn(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 m="value"===a?u:D(u);n.attrName=s,n.attrValue=m,n.keepAttr=!0,n.forceKeepAttr=void 0,pn(jt.uponSanitizeAttribute,t,n),m=n.attrValue,!we||"id"!==s&&"name"!==s||0===k(m,Se)||(en(a,t,i),m=Se+m),ue&&U(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,m)||"attributename"===s&&C(m,"href")?en(a,t,i):n.forceKeepAttr||(!n.keepAttr||!ce&&U(gt,m)?en(a,t,i):(se&&(m=cn(m)),bn(r,s,m)?(m=Sn(r,s,l,m),m!==u&&vn(t,a,l,m)):en(a,t,i)))}pn(jt.afterSanitizeAttributes,t,null)},En=function(t){let e=null;const n=ln(t);for(pn(jt.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(pn(jt.uponSanitizeShadowNode,e,null),yn(e,t),An(e),mn(e.content)&&En(e.content),1===_t(e)){const t=W(e);mn(t)&&(xn(t),En(t))}pn(jt.afterSanitizeShadowDOM,t,null)},xn=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){En(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=Et?Et(n):null;if("string"==typeof t&&"template"===Ge(t)){const t=n.content;mn(t)&&e.push({node:t,shadow:null})}}if(o){const t=W(n);mn(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&&!fn(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return R(t);case"boolean":return I(t);case"bigint":return L?L(t):"0";case"symbol":return M?M(t):"Symbol()";case"undefined":default:return P(t);case"function":case"object":{if(null===t)return P(t);const e=t,n=G(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:P(t)}return P(t)}}}(t)))throw F("dirty is not a string, aborting");if(!n.isSupported)return t;fe?(Zt=pe,Qt=de):Xe(e),(jt.uponSanitizeElement.length>0||jt.uponSanitizeAttribute.length>0)&&(Zt=Y(Zt)),jt.uponSanitizeAttribute.length>0&&(Qt=Y(Qt)),n.removed=[];const c=Ae&&"string"!=typeof t&&fn(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&&U(dt,t.data)){try{b(t)}catch(t){}continue}if(1===n){const e=t,n=Ge(Ot(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=Ot(t);if("string"==typeof e){const n=Ge(e);if(!Zt[n]||ne[n])throw tn(t),F("root node is forbidden and cannot be sanitized in-place")}if(un(t))throw tn(t),F("root node is clobbered and cannot be sanitized in-place");try{xn(t)}catch(e){throw tn(t),e}}else if(fn(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),xn(i);else{if(!ge&&!se&&!me&&-1===t.indexOf("<"))return Ct&&be?Lt(t):t;if(o=an(t),!o)return ge?null:be?kt:""}o&&he&&Je(o.firstChild);const s=c?t:o;try{const t=ln(s);for(;a=t.nextNode();)yn(a,s),An(a),mn(a.content)&&En(a.content)}catch(e){throw c&&(tn(t),w(n.removed,t=>{t.element&&on(t.element)})),e}if(c)return w(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=me?o.outerHTML:o.innerHTML;return me&&Zt["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&U(mt,o.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+u),se&&(u=cn(u)),Ct&&be?Lt(u):u},n.setConfig=function(){Xe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),fe=!0,pe=Zt,de=Qt},n.clearConfig=function(){qe=null,fe=!1,pe=null,de=null,Ct=Nt,kt=""},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&&z(jt,t)&&A(jt[t],e)},n.removeHook=function(t,e){if(z(jt,t)){if(void 0!==e){const n=S(jt[t],e);return-1===n?void 0:E(jt[t],n,1)[0]}return v(jt[t])}},n.removeHooks=function(t){z(jt,t)&&(jt[t]=[])},n.removeAllHooks=function(){jt={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();let Et;const xt=["a","b","em","i","strong","p","br","abbr"],_t=["target","href","rel","name","download","title"];const Ot={tags:["a","b","em","i","strong","p","br","span","bdi","del","ins","img","picture","source"],attr:["class","target","href","rel","name","download","aria-hidden","src","srcset","sizes","alt","width","height","loading","decoding","dir","translate"]},Ct="I acknowledge that using a private store means my plugin will inevitably break on the next store release.",Nt="wishlist",{state:kt,actions:Dt}=(0,r.store)("woocommerce/shopper-lists",{},{lock:Ct}),{actions:Rt}=(0,r.store)("woocommerce",{},{lock:Ct}),It=t=>{const e=document.createElement("textarea");return e.innerHTML=t,e.value},Lt=t=>kt.lists[t]??null;(0,r.store)("woocommerce/wishlist",{state:{get currentItems(){return Lt(Nt)?.items??[]},get isCurrentItemPending(){const{listItem:t,pendingKeys:e}=(0,r.getContext)();return!!t&&!!e[t.key]},get isEmpty(){const t=Lt(Nt);return!!t&&!t.isLoading&&0===t.items.length},get isPriceHidden(){const{listItem:t}=(0,r.getContext)();return!t?.price_html},get isAddToCartHidden(){const{listItem:t}=(0,r.getContext)();return!t||!t.is_purchasable},get currentItemDisplayName(){const{listItem:t}=(0,r.getContext)();return t?It(t.name):""},get currentItemRemoveLabel(){const{listItem:t}=(0,r.getContext)();if(!t)return"";const{removeLabelTemplate:e}=(0,r.getConfig)("woocommerce/wishlist");return e.replace("%s",It(t.name))},get currentItemVariationLabel(){const{listItem:t}=(0,r.getContext)();return t&&(e=t).variation&&0!==e.variation.length?e.variation.map(t=>`${It(t.attribute)}: ${It(t.value)}`).join(", "):"";var e}},actions:{*onClickRemove(){const{listItem:t,pendingKeys:e}=(0,r.getContext)();if(t&&!e[t.key]){e[t.key]=!0;try{yield Dt.removeItem(Nt,t.key)}finally{delete e[t.key]}}},*onClickAddToCart(){const{listItem:t,pendingKeys:e}=(0,r.getContext)();if(!t||!t.is_purchasable||e[t.key])return;const n=t.variation.map(({raw_attribute:t,value:e,attribute:n})=>({attribute:t||n,value:e})),o=t.variation_id>0;e[t.key]=!0;try{if(!(yield Rt.addCartItem({id:t.id,quantityToAdd:1,type:o?"variation":"simple",...o&&{variation:n}})).success)return;yield Dt.removeItem(Nt,t.key)}finally{delete e[t.key]}}},callbacks:{updateInnerHtml:()=>{const{listItem:t,htmlField:e}=(0,r.getContext)();t&&e&&((t,e,n)=>{t&&"string"==typeof e&&(t.innerHTML=function(t,e){const n={ALLOWED_TAGS:[...e?.tags||xt],ALLOWED_ATTR:[...e?.attr||_t]},o=function(){if(void 0!==Et)return Et;if("undefined"==typeof window||!window.trustedTypes)return Et=null,null;try{Et=window.trustedTypes.createPolicy("woocommerce-sanitize-noop",{createHTML:t=>t})}catch(t){Et=null,console.warn('Failed to create "woocommerce-sanitize-noop" trusted type policy:',t)}return Et}();return o&&(n.TRUSTED_TYPES_POLICY=o),"HTMLBodyElement"===e?.returnType?n.RETURN_DOM=!0:"DocumentFragment"===e?.returnType&&(n.RETURN_DOM_FRAGMENT=!0),At.sanitize(t??"",n)}(e,n))})((0,r.getElement)().ref,t[e],Ot)}}},{lock:Ct});