// source --> https://3dpokloni.com/wp-content/plugins/flexible-product-fields/assets/js/fpf_product.min.js?ver=2.4.6.69 
jQuery(document).ready(function () {
    function fpf_price_options() {
        var qty = jQuery('input.qty').val();
        var adjusted_price = 0;
        var calculate_price = false;

        // Loop through custom fields
        jQuery.each(fpf_fields, function (i, val) {
            if (typeof fpf_product.fields_rules[val.id] !== 'undefined') {
                if (!fpf_product.fields_rules[val.id].enabled) {
                    return;
                }
            }

            // Handle fixed-price fields
            if (val.has_price && val.price_value != 0) {
                if (val.type === 'checkbox' && jQuery('#' + val.id).is(':checked')) {
                    adjusted_price += val.price_value;
                    calculate_price = true;
                } else if (val.type !== 'checkbox') {
                    var field_val = jQuery('#' + val.id).val();
                    if (field_val !== '') {
                        adjusted_price += val.price_value;
                        calculate_price = true;
                    }
                }
            }

            // Handle fields with options
            if (val.has_options) {
                jQuery.each(val.options, function (i, val_option) {
                    var field_val;
                    if (val.type === 'select') {
                        field_val = jQuery('#' + val.id).val();
                        if (field_val == val_option.value) {
                            adjusted_price += val_option.price_value;
                            calculate_price = true;
                        }
                    } else if (val.type === 'radio' || val.type === 'radio-images') {
                        field_val = jQuery('input[name=' + val.id + ']:checked').val();
                        if (field_val == val_option.value) {
                            adjusted_price += val_option.price_value;
                            calculate_price = true;
                        }
                    }
                });
            }
        });

        if (calculate_price) {
            // Calculate the total adjusted price
            var total_price = qty * fpf_product_price + adjusted_price;

            // Format total price
            total_price = accounting.formatMoney(total_price, {
                symbol: fpf_product.currency_format_symbol,
                decimal: fpf_product.currency_format_decimal_sep,
                thousand: fpf_product.currency_format_thousand_sep,
                precision: fpf_product.currency_format_num_decimals,
                format: fpf_product.currency_format,
            });

            // Update the WooCommerce price element with the final total price
            jQuery('.woocommerce-Price-amount').text(total_price);
        }
    }

    // Recalculate prices on document ready if custom fields are defined
    if (typeof fpf_fields != 'undefined') {
        fpf_price_options();
    }

    // Event listeners for recalculating prices on user input
    jQuery(document).on("change", ".fpf-input-field,input.qty", function () {
        fpf_price_options();
    });

    jQuery(document).on("keyup", ".fpf-input-field,input.qty,.variations select", function () {
        fpf_price_options();
    });

    // Update price when WooCommerce variation is found
    jQuery(document).on('found_variation', 'form.cart', function (event, variation) {
        fpf_product_price = variation.display_price;
        fpf_price_options();
    });

    // Additional configuration handling (optional)
    jQuery(document).on('click', '.fpf-fields-config', function (event, variation) {
        var values = jQuery('form.cart').serialize().split('&');
        var items = [];
        var keys = [];

        var length = fpf_fields.length;
        for (var i = 0; i < length; i++) {
            var field_key = fpf_fields[i].id;
            if (fpf_fields[i].type === 'multiselect') {
                field_key += '[]';
            }
            keys.push(field_key);
        }

        jQuery.each(values, function (i, val) {
            var field_data = val.split('=');
            if ((keys.indexOf(decodeURIComponent(field_data[0])) === -1) || (field_data[1] === '')) {
                return;
            }
            items.push(val);
        });
        if (!items) {
            return;
        }

        var new_url = jQuery('form.cart').attr('action');
        new_url += '?' + items.join('&');
        location.replace(new_url);
    });
});
// source --> https://3dpokloni.com/wp-content/plugins/flexible-product-fields-pro/assets/js/front.js?ver=9 
jQuery.noConflict();
(function($) {
    function fpf_field_value( field_name ) {
        if ( jQuery( 'input[name=' + field_name + ']' ).length ) {
            if ( jQuery( 'input[name=' + field_name + ']' ).attr( 'type' ) == 'radio' ) {
                return jQuery('input[name=' + field_name + ']:checked').val();;
            }
            if ( jQuery( 'input[name=' + field_name + ']' ).attr( 'type' ) == 'checkbox' ) {
                if ( jQuery('input[name=' + field_name + ']').is(':checked') ) {
                    return 'checked';
                }
                else {
                    return 'unchecked';
                }
            }
            return jQuery('input[name=' + field_name + ']').val();
        }
        if ( jQuery( 'select[name=' + field_name + ']' ).length ) {
            return jQuery( 'select[name=' + field_name + ']' ).val();
        }
    }

    function fpf_field_change_rules() {
        var hidden_fields = true;
        while ( hidden_fields) {
            hidden_fields = false;
            jQuery.each(fpf_product.fields_rules, function (index, field) {
                var operator = field.operator;
                var show_field = true;
                if (operator == 'or') {
                    show_field = false;
                }
                jQuery.each(field.rules, function (index_rule, value_rule) {
                    var rule_result = false;
                    if ( value_rule.field != '' ) {
                        var field_value = fpf_field_value(value_rule.field);
                        if (typeof fpf_product.fields_rules[value_rule.field] !== 'undefined') {
                            if (!fpf_product.fields_rules[value_rule.field].enabled) {
                                field_value = value_rule.field_value + '1';
                            }
                        }
                        rule_result = (field_value == value_rule.field_value);
                    }
                    if (value_rule.compare == 'is_not') {
                        rule_result = !rule_result;
                    }
                    if (operator == 'and') {
                        show_field = show_field && rule_result;
                    }
                    if (operator == 'or') {
                        show_field = show_field || rule_result;
                    }
                });
                if ( !show_field ) {
                    if ( typeof field.enabled == 'undefined' || field.enabled ) {
                        field.enabled = false;
                        hidden_fields = true;
                        jQuery('#' + index + '_field').parent().hide();
                    }
                }
                else {
                    field.enabled = true;
                    jQuery('#' + index + '_field').parent().show();
                }
            });
        }
    }
    jQuery(document).on('change','select.fpf-input-field,input.fpf-input-field',function(){
        fpf_field_change_rules();
    });

    jQuery(document).ready(function(){
        jQuery('select.fpf-input-field,input.fpf-input-field').change();
    })

})(jQuery);
// source --> https://3dpokloni.com/wp-content/themes/woodmart/js/libs/device.min.js?ver=8.5.0 
!function(s){var n="";screen.width&&(width=screen.width?screen.width:"",height=screen.height?screen.height:"",n+=width+" x "+height);var i,r,e,o=navigator.appVersion,a=navigator.userAgent,d=navigator.appName,t=""+parseFloat(navigator.appVersion),w=parseInt(navigator.appVersion,10);-1!=(r=a.indexOf("Opera"))&&(d="Opera",t=a.substring(r+6),-1!=(r=a.indexOf("Version"))&&(t=a.substring(r+8))),-1!=(r=a.indexOf("OPR"))?(d="Opera",t=a.substring(r+4)):-1!=(r=a.indexOf("Edge"))?(d="Edge",t=a.substring(r+5)):-1!=(r=a.indexOf("Edg"))?(d="Microsoft Edge",t=a.substring(r+4)):-1!=(r=a.indexOf("MSIE"))?(d="Internet",t=a.substring(r+5)):-1!=(r=a.indexOf("Chrome"))?(d="Chrome",t=a.substring(r+7)):-1!=(r=a.indexOf("Safari"))?(d="Safari",t=a.substring(r+7),-1!=(r=a.indexOf("Version"))&&(t=a.substring(r+8))):-1!=(r=a.indexOf("Firefox"))?(d="Firefox",t=a.substring(r+8)):-1!=a.indexOf("Trident/")?(d="Internet",t=a.substring(a.indexOf("rv:")+3)):(i=a.lastIndexOf(" ")+1)<(r=a.lastIndexOf("/"))&&(d=a.substring(i,r),t=a.substring(r+1),d.toLowerCase()==d.toUpperCase()&&(d=navigator.appName)),-1!=(e=t.indexOf(";"))&&(t=t.substring(0,e)),-1!=(e=t.indexOf(" "))&&(t=t.substring(0,e)),-1!=(e=t.indexOf(")"))&&(t=t.substring(0,e)),w=parseInt(""+t,10),isNaN(w)&&(t=""+parseFloat(navigator.appVersion),w=parseInt(navigator.appVersion,10));var c=/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(o),O="-",W=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var g in W){var f=W[g];if(f.r.test(a)){O=f.s;break}}var p="-";switch(/Windows/.test(O)&&(p=/Windows (.*)/.exec(O)[1],O="Windows"),O){case"Mac OS":case"Mac OS X":case"Android":p=/(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([\.\_\d]+)/.exec(a)[1];break;case"iOS":p=(p=/OS (\d+)_(\d+)_?(\d+)?/.exec(o))[1]+"."+p[2]+"."+(0|p[3])}var S="no check";if("undefined"!=typeof swfobject){var b=swfobject.getFlashPlayerVersion();S=b.major>0?b.major+"."+b.minor+" r"+b.release:"-"}s.jscd={screen:n,browser:d,browserVersion:t,browserMajorVersion:w,mobile:c,os:O,osVersion:p,flashVersion:S}}(this),function(){var s=jQuery("html");s.addClass("browser-"+jscd.browser.replaceAll(" ","-")),s.addClass("platform-"+jscd.os)}();
// source --> https://3dpokloni.com/wp-content/themes/woodmart/js/scripts/global/scrollBar.min.js?ver=8.5.0 
const htmlElement=document.getElementsByTagName("html")[0],windowWidth=window.innerWidth,htmlOffsetWidth=htmlElement.offsetWidth,userAgent=navigator.userAgent;let shouldCalculateScrollbar=windowWidth>1024&&windowWidth>htmlOffsetWidth;if(userAgent.includes("Chrome")){const t=userAgent.match(/Chrome\/(\d+)/);t&&parseInt(t[1],10)>=145&&(shouldCalculateScrollbar=!1)}if(shouldCalculateScrollbar){const t=windowWidth-htmlOffsetWidth,e=document.createElement("style");e.textContent=`:root {--wd-scroll-w: ${t}px;}`,document.head.appendChild(e)};