!function(){"use strict";function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(r){return function(r){if(Array.isArray(r))return t(r)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var e=window.ctFrontend;function n(t){if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(t=function(t,r){if(!t)return;if("string"==typeof t)return o(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return o(t,r)}(t))){var r=0,e=function(){};return{s:e,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a,i=!0,c=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw a}}}}function o(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}var a=function(t){var r,e=new ClipboardEvent("").clipboardData||new DataTransfer,o=n(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;e.items.add(a)}}catch(t){o.e(t)}finally{o.f()}return e.files},i=[];(0,e.registerDynamicChunk)("blocksy_ext_woo_extra_advanced_reviews",{mount:function(t,e){var n=e.event,o=t.closest("form");if(o){o.enctype="multipart/form-data";var c=t.files,l=document.querySelector(".ct-review-upload-actions");l.querySelectorAll(".ct-media-container").forEach((function(t){t.remove()}));var u=n.bubbles?[].concat(r(i),r(Array.from(c))):i;i=u,t.files=a(u),u.length>0&&u.forEach((function(r,e){var n=URL.createObjectURL(r),o=document.createElement("figure");o.classList.add("ct-media-container"),o.innerHTML='\n\t\t\t\t\t<img src="'.concat(n,'" style="aspect-ratio: 1/1" alt="Review Image">\n\t\t\t\t\t<span class="ct-remove-image">\n\t\t\t\t\t\t<svg width="10" height="10" viewBox="0 0 15 15" fill="currentColor">\n\t\t\t\t\t\t\t<path d="M8.5,7.5l4.5,4.5l-1,1L7.5,8.5L3,13l-1-1l4.5-4.5L2,3l1-1l4.5,4.5L12,2l1,1L8.5,7.5z"></path>\n\t\t\t\t\t\t</svg>\n\t\t\t\t\t</span>\n\t\t\t\t'),l.insertBefore(o,l.querySelector('[for="blc-review-images"]')),o.querySelector(".ct-remove-image").addEventListener("click",(function(){o.remove();var r=u.filter((function(t,r){return r!==e}));t.files=a(r),i=r,t.dispatchEvent(new Event("change"))}))}))}}})}();