"use strict";var Virtuemart=window.Virtuemart||{};!function(d,s){s.findContainers=function(t){var n,t=d(t.currentTarget).closest(".product-field-display"),e=s.containerSelector;return t.length?(s.container=t,s.containerSelector='[data-vm="product-container"]:not([data-ignore-dynamic])',(n=s.container.closest(s.containerSelector)).length||(s.containerSelector=e||s.containerSelector,(n=s.container.closest(s.containerSelector)).length)?(s.container=n,t):(console.log("CV: Could not find product-container "+e,t),!1)):(console.log("CV: Could not find parent container product-field-display"),!1)},s.cvFind=function(t){t.preventDefault();var n=[],e=s.findContainers(t),r=!1,a=(d(e).find("input.cvselection:checked").each(function(){n[n.length]=d(this).val(),r=!0}),r||d(e).find("select.cvselection").each(function(){n[n.length]=d(this).val()}),0),i=0,o=0;d(this).prop("url",t.data.variants[0][0]);for(var c,l=0;l<n.length;a++){for(a=0;a<t.data.variants.length;a++)for(i=o=0;i<=n.length&&n[i]==t.data.variants[a][i+1];i++)if(++o==n.length-l)return c=t.data.variants[a][0].replace(/amp;/g,""),d(this).attr("url",c),d(this).val(c),d(this).attr("reload")||d(this).attr("data-reload")?(s.isUpdatingContent=!0,d(this).vm2front("startVmLoading"),window.top.location.href=c,!1):c;l++}return!1},s.avFind=function(t){s.findContainers(t)}}(jQuery,Virtuemart);