').val(option).html(option);
            selector.append(newOption);
          }
           //console.log(availableOptionsJas);
          jQuery('#callBackVariant .swatches-select[data-option-index="' + selectorIndex + '"] .basel-swatch').each(function() {
            //console.log('sdffsdfds');
            if (jQuery.inArray($(this).attr('data-value'), availableOptions) !== -1) {
              $(this).removeClass('jas_unavailable')
            }
            else {
              $(this).addClass('jas_unavailable')
            }
          });
          jQuery('#callBackVariant .swatches-select[data-option-index="' + selectorIndex + '"] .basel-swatch').each(function() {
            //console.log('sdffsdfds');
            if (jQuery.inArray($(this).attr('data-value'), availableOptionsJas) !== -1) {
              $(this).removeClass('jas_soldout')
            }
            else {
              $(this).addClass('jas_soldout')
            }
          });
          if (jQuery.inArray(initialValue, availableOptions) !== -1) {
            selector.val(initialValue);
          }
          selector.trigger('change');  
        };
        Shopify.linkOptionSelectors = function(product) {
          // Building our mapping object.
          for (var i=0; i 1) {
                var key = variant.option1;
                Shopify.optionsMap[key] = Shopify.optionsMap[key] || [];
                Shopify.optionsMap[key].push(variant.option2);
                Shopify.optionsMap[key] = Shopify.uniq(Shopify.optionsMap[key]);
              }
              // Gathering values for the 3rd drop-down.
              if (product.options.length === 3) {
                var key = variant.option1 + ' / ' + variant.option2;
                Shopify.optionsMap[key] = Shopify.optionsMap[key] || [];
                Shopify.optionsMap[key].push(variant.option3);
                Shopify.optionsMap[key] = Shopify.uniq(Shopify.optionsMap[key]);
              }
            }
            if (variant.available) {
              // Gathering values for the 1st drop-down.
              Shopify.optionsMapJas['root'] = Shopify.optionsMapJas['root'] || [];
              Shopify.optionsMapJas['root'].push(variant.option1);
              Shopify.optionsMapJas['root'] = Shopify.uniq(Shopify.optionsMapJas['root']);
              // Gathering values for the 2nd drop-down.
              if (product.options.length > 1) {
                var key = variant.option1;
                Shopify.optionsMapJas[key] = Shopify.optionsMapJas[key] || [];
                Shopify.optionsMapJas[key].push(variant.option2);
                Shopify.optionsMapJas[key] = Shopify.uniq(Shopify.optionsMapJas[key]);
              }
              // Gathering values for the 3rd drop-down.
              if (product.options.length === 3) {
                var key = variant.option1 + ' / ' + variant.option2;
                Shopify.optionsMapJas[key] = Shopify.optionsMapJas[key] || [];
                Shopify.optionsMapJas[key].push(variant.option3);
                Shopify.optionsMapJas[key] = Shopify.uniq(Shopify.optionsMapJas[key]);
              }
            }
          }
          // Update options right away.
          Shopify.updateOptionsInSelector(0);
          if (product.options.length > 1) Shopify.updateOptionsInSelector(1);
          if (product.options.length === 3) Shopify.updateOptionsInSelector(2);
          // When there is an update in the first dropdown.
          jQuery("#callBackVariant .single-option-selector:eq(0)").change(function() {
            Shopify.updateOptionsInSelector(1);
            if (product.options.length === 3) Shopify.updateOptionsInSelector(2);
            return true;
          });
          // When there is an update in the second dropdown.
          jQuery("#callBackVariant .single-option-selector:eq(1)").change(function() {
            if (product.options.length === 3) Shopify.updateOptionsInSelector(2);
            return true;
          });  
        };
        
            var product = {"id": 8777391702190,"title": "P370 Tube Dive Sock (Unisex)","handle": "p370-tube-dive-sock-unisex","price": 23000,"price_min": 23000,"price_max": 23000,"available": true,"price_varies": false,"compare_at_price": null,"compare_at_price_min": 0,"compare_at_price_max": 0,"compare_at_price_varies": false,"variants": [{"id": 46616266473646,"title": "s / blk","option1": "s","option2":"blk","option3":null,"sku": "P370-BLK-S","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047202762926,"product_id": 8777391702190,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P370.jpg?v=1750669650"},"available": true,"public_title": "s / blk","options": ["s","blk"],"price": 23000,"weight": 100,"compare_at_price": null,"inventory_quantity": 4,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616266506414,"title": "l / blk","option1": "l","option2":"blk","option3":null,"sku": "P370-BLK-L","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047202762926,"product_id": 8777391702190,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P370.jpg?v=1750669650"},"available": true,"public_title": "l / blk","options": ["l","blk"],"price": 23000,"weight": 100,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616266539182,"title": "xl / blk","option1": "xl","option2":"blk","option3":null,"sku": "P370-BLK-XL","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047202762926,"product_id": 8777391702190,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P370.jpg?v=1750669650"},"available": true,"public_title": "xl / blk","options": ["xl","blk"],"price": 23000,"weight": 100,"compare_at_price": null,"inventory_quantity": 2,"inventory_management": "shopify","inventory_policy": "deny","barcode": null},{"id": 46616266571950,"title": "2xl / blk","option1": "2xl","option2":"blk","option3":null,"sku": "P370-BLK-2XL","requires_shipping": true,"taxable": false,"featured_image":{"id": 40047202762926,"product_id": 8777391702190,"width": 2048,"height": 2048,"src": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P370.jpg?v=1750669650"},"available": true,"public_title": "2xl / blk","options": ["2xl","blk"],"price": 23000,"weight": 100,"compare_at_price": null,"inventory_quantity": 10,"inventory_management": "shopify","inventory_policy": "deny","barcode": null}],"featured_image": "\/\/snorkeling-gear.com\/cdn\/shop\/files\/P370.jpg?v=1750669650","options": ["Size","Color"]};
          var $addToCartForm = $('#callBackVariant form[action="/cart/add"]');
          if (window.MutationObserver && $addToCartForm.length) {
            if (typeof observer === 'object' && typeof observer.disconnect === 'function') {
              observer.disconnect();
            }
            var config = { childList: true, subtree: true };
            var observer = new MutationObserver(function() {      
              Shopify.linkOptionSelectors(product);
              observer.disconnect();
            });  
            observer.observe($addToCartForm[0], config);
          }