{"version":3,"file":"gf_image_choices.js","names":["imageChoices","$","cssClasses","selected","hover","focus","getFormMarkupVersion","form_or_id","formElementID","$form","formID","attr","window","hasOwnProperty","gf_get_form_id_by_html_id","replace","jQuery","indexOf","toString","length","find","is","isLegacyMarkup","isLegacyMode","imageChoicesVars","useNewFeatures","$fieldChoices","$field","choicesSelector","closest","SelectedFields","form_id","each","this","addClass","InitLightbox","field_id","elementorCompat","opts","captions","gform","applyFilters","hasClass","substring","lastIndexOf","captionType","captionsData","jetslothLightbox","onChoiceKeyPress","e","$input","target","keyCode","preventDefault","stopImmediatePropagation","direction","$inputWrap","next","prev","onChoicesSelectAllClick","$toggle","$choices","data","n","choiceEl","$choice","onChoiceLabelClick","$label","$wrap","first","setTimeout","not","removeClass","prop","SetUpFields","current_page","i","$fields","t","toggle","on","$this","blur","wrap","append","document","parent","$choicesField","id","escapedTitle","html","thumbUrl","imgUrl","elementorAtts","$lightboxBtn","prepend","InitLazyLoad","jetslothMatchHeights","doAction","imageChoices_SetUpFields","ConditionalLogic","bind","event","gformGetOptionLabel","fields","isInit","element","selected_value","current_price","colorPicker_gformGetOptionLabel","index","price","gformGetPrice","current_diff","original_label","diff","gformGetPriceDifference","gformToNumber","price_label","tagName","toLowerCase","label","gform_format_option_label","imageChoices_gformGetOptionLabel","fullLabel","fieldLabel","priceLabel","selectedPrice","formId","fieldId","markup","$allOptions","$thisOption","eq","loadedChoices","$option","$thisOptionLabel","thisOptionImage","thisOptionLightboxSrc","jmhId","jmhAttr","shouldLazyLoad","inArray","imageMarkup","join","observer","observe","imageChoices_gform_format_option_label","colorPicker_gform_format_option_label","onImageLoaded","$el","push","loadImage","img","Image","onload","css","src","lazyLoad","elements","item","intersectionRatio","unobserve","lazyLoadInit","lazyLoadOptions","rootMargin","threshold","IntersectionObserver","$page"],"sources":["gf_image_choices.js"],"sourcesContent":["var imageChoices = imageChoices || {};\n(function($){\n\n\timageChoices.cssClasses = {\n\t\t\"selected\": \"image-choices-choice-selected\",\n\t\t\"hover\": \"image-choices-choice-hover\",\n\t\t\"focus\": \"image-choices-choice-focus\"\n\t}\n\n\timageChoices.getFormMarkupVersion = function( form_or_id ){\n\t\tvar formElementID;\n\t\tvar formID = '';\n\t\tvar $form;\n\n\t\tif ( typeof form_or_id === 'undefined' || ( typeof form_or_id === 'string' && form_or_id === '' ) || ( typeof form_or_id === 'number' && form_or_id <= 0 ) ) {\n\t\t\tformElementID = $('form[id^=\"gform_\"]:first').attr('id');\n\t\t\tformID = ( window.hasOwnProperty('gf_get_form_id_by_html_id') ) ? window.gf_get_form_id_by_html_id( formElementID ) : formElementID.replace('gform_', '');\n\t\t\t$form = $('#' + formElementID);\n\t\t}\n\t\telse if ( form_or_id instanceof jQuery ) {\n\t\t\tformElementID = form_or_id.attr('id');\n\t\t\tformID = ( window.hasOwnProperty('gf_get_form_id_by_html_id') ) ? window.gf_get_form_id_by_html_id( formElementID ) : formElementID.replace('gform_', '');\n\t\t\t$form = form_or_id;\n\t\t}\n\t\telse if ( typeof form_or_id === 'string' && form_or_id.indexOf(\"gform_\") !== -1 ) {\n\t\t\tformID = (window.hasOwnProperty('gf_get_form_id_by_html_id')) ? window.gf_get_form_id_by_html_id( form_or_id ) : form_or_id.replace('gform_', '');\n\t\t\tformElementID = \"gform_\" + formID;\n\t\t\t$form = $('#' + formElementID);\n\t\t}\n\t\telse {\n\t\t\tformID = (window.hasOwnProperty('gf_get_form_id_by_html_id')) ? window.gf_get_form_id_by_html_id( \"gform_\" + form_or_id.toString() ) : form_or_id.toString();\n\t\t\tformElementID = \"gform_\" + formID;\n\t\t\t$form = $('#' + formElementID);\n\t\t}\n\n\t\tif ( !$form.length ) {\n\t\t\treturn $('.gform_body .gfield:first').is('li') ? 1 : 2;\n\t\t}\n\n\t\treturn $form.find('.gform_body .gfield:first').is('li') ? 1 : 2;\n\t};\n\n\timageChoices.isLegacyMarkup = function( form_or_id ) {\n\t\treturn ( imageChoices.getFormMarkupVersion( form_or_id ) === 1 );\n\t}\n\n\timageChoices.isLegacyMode = function() {\n\t\tvar useNewFeatures = ( imageChoicesVars.hasOwnProperty('useNewFeatures') && imageChoicesVars.useNewFeatures.toString() === 'true');\n\t\treturn !useNewFeatures;\n\t};\n\n\timageChoices.$fieldChoices = function( $field ) {\n\t\tif ( typeof $field === 'undefined' || $field instanceof jQuery === false) {\n\t\t\treturn [];\n\t\t}\n\n\t\tvar choicesSelector = '.ginput_container .gfield_radio div[class*=\"gchoice\"], .ginput_container .gfield_checkbox div[class*=\"gchoice\"]:not(.gchoice_select_all)';// GF 2.5+\n\t\tif ( imageChoices.isLegacyMarkup( $field.closest('[id^=\"gform_wrapper_\"]') ) ) {\n\t\t\tchoicesSelector = '.ginput_container .gfield_radio li, .ginput_container .gfield_checkbox li:not(.gchoice_select_all)';\n\t\t}\n\n\t\treturn $field.find(choicesSelector);\n\t};\n\n\timageChoices.SelectedFields = function( form_id ) {\n\t\tvar $form = ( typeof form_id !== 'undefined' && form_id !== '' ) ? $('#gform_'+form_id) : $('.gform_wrapper form');\n\t\timageChoices.$fieldChoices( $form.find('.image-choices-field') ).find('input:checked').each(function() {\n\t\t\tvar $input = $(this);\n\t\t\tvar $choice = $input.closest('[class*=\"gchoice\"]');// TODO: Update to just .gchoice ?\n\t\t\t$choice.addClass(imageChoices.cssClasses.selected);\n\t\t\t/*\n\t\t\tif ( $input.val() === \"gf_other_choice\" ) {\n\t\t\t\t$input.trigger('click')\n\t\t\t}\n\t\t\t*/\n\t\t});\n\t};\n\n\timageChoices.InitLightbox = function( form_id ){\n\t\tvar $form = ( typeof form_id !== 'undefined' && form_id !== '' ) ? $('#gform_'+form_id) : $('.gform_wrapper form');\n\t\t$form.find('.image-choices-field.image-choices-use-lightbox').each(function(){\n\t\t\tvar $field = $(this);\n\t\t\tvar field_id = $field.attr('id');\n\t\t\tif ( !imageChoicesVars.hasOwnProperty('elementorCompat') || imageChoicesVars.elementorCompat !== 'elementor' ) {\n\t\t\t\tvar opts = {\n\t\t\t\t\tcaptions: imageChoices.isLegacyMode() || gform.applyFilters('gfic_lightbox_captions', $field.hasClass('ic-lightbox-captions'), form_id.toString(), field_id.substring( field_id.lastIndexOf('_') + 1 )),\n\t\t\t\t\tcaptionType: 'data',\n\t\t\t\t\tcaptionsData: 'caption'\n\t\t\t\t};\n\t\t\t\t$field.find('.image-choices-lightbox-btn').jetslothLightbox(opts);\n\t\t\t}\n\t\t});\n\t};\n\n\timageChoices.onChoiceKeyPress = function(e) {\n\t\tvar TABKEY = 9;\n\t\tvar SPACEKEY = 32;\n\t\tvar $input = $(e.target);\n\t\tvar $field = $input.closest('.gfield');\n\n\t\tif (e.keyCode === SPACEKEY && ( $input.is(':checkbox') || $input.is(':radio') ) ) {\n\t\t\tif ($input.is(':radio') && !$input.is(':checked')) {\n\t\t\t\te.preventDefault();\n\t\t\t\t//e.stopImmediatePropagation();\n\t\t\t\t//$input.next('label').click();\n\t\t\t}\n\t\t\telse if ($input.is(':checkbox')) {\n\t\t\t\te.preventDefault();\n\t\t\t\te.stopImmediatePropagation();\n\t\t\t\t//$input.next('label').click();\n\t\t\t}\n\t\t}\n\t\telse if (e.keyCode === TABKEY && $field.hasClass('image-choices-field')) {\n\t\t\tvar direction = (e.shiftKey) ? 'previous' : 'next';\n\t\t\tvar $inputWrap = $input.closest('.image-choices-choice');\n\n\t\t\tif (direction === 'next') {\n\t\t\t\tif (!$inputWrap.is(':last-child')) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t//e.stopImmediatePropagation();\n\t\t\t\t\t$inputWrap.next('.image-choices-choice').find('> input').focus();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (direction === 'previous') {\n\t\t\t\tif (!$inputWrap.is(':first-child')) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\t//e.stopImmediatePropagation();\n\t\t\t\t\t$inputWrap.prev('.image-choices-choice').find('> input').focus();\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t};\n\n\timageChoices.onChoicesSelectAllClick = function(e) {\n\t\tvar $toggle = $(this);\n\t\tvar $field = $toggle.closest('.gfield');\n\t\tvar toggledOn = $toggle.is('input') ? $toggle.is(':checked') : $toggle.data('checked');\n\t\tvar $choices = toggledOn ? $field.find('.image-choices-choice input:checked') : $field.find('.image-choices-choice input:not(:checked)');\n\n\t\tif ($choices.length) {\n\t\t\t$choices.each(function(n, choiceEl){\n\t\t\t\tvar $choice = $(choiceEl);\n\t\t\t\timageChoices.onChoiceLabelClick( $choice.next('label') );\n\t\t\t});\n\t\t}\n\t};\n\n\timageChoices.onChoiceLabelClick = function( $label ) {\n\t\tvar $choice = $label.closest('[class*=\"gchoice\"]');\n\t\tvar $wrap = $choice.closest('.gfield_checkbox, .gfield_radio').first();\n\n\t\tvar $input = $choice.find('input');\n\n\t\tif ($choice.hasClass('image-choices-choice-other')) {\n\t\t\tsetTimeout(function(){\n\t\t\t\t$choice.find('.gf_other_wrap').addClass('active');\n\t\t\t\t$choice.find('input:text').focus();\n\t\t\t}, 250)\n\t\t}\n\n\t\tif ($wrap.hasClass('gfield_radio')) {\n\t\t\t// radio\n\t\t\t$wrap.find('.'+imageChoices.cssClasses.selected).not($choice).removeClass(imageChoices.cssClasses.selected).find('input').prop('checked', false);\n\t\t\t$choice.addClass(imageChoices.cssClasses.selected);\n\t\t}\n\t\telse if ($wrap.hasClass('gfield_checkbox')) {\n\t\t\t// checkbox\n\t\t\tif ( $input.is( ':checked' ) ) {\n\t\t\t\t$choice.addClass(imageChoices.cssClasses.selected);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$choice.removeClass(imageChoices.cssClasses.selected);\n\t\t\t}\n\t\t}\n\t};\n\n\n\timageChoices.SetUpFields = function( form_id, current_page ) {\n\n\t\t// Entry detail view, doesn't get the custom class on the \"field\" wrap (it's .detail-view not .gfield)\n\t\t// If we add the classes here, the rest of the script (and styles) will work\n\t\t$('.entry-details .detail-view .image-choices-choice-image-wrap').each(function(i){\n\t\t\tvar $imgWrap = $(this);\n\t\t\tvar $field = $imgWrap.closest('.detail-view');\n\t\t\t$field.addClass('image-choices-field image-choices-show-labels');\n\t\t});\n\n\n\t\tvar $form = ( typeof form_id !== 'undefined' && form_id !== '' ) ? $('#gform_'+form_id) : $('.gform_wrapper form');\n\n\t\t// WooCommerce Gravity Forms Product Add-Ons compatibility\n\t\tif ( !$form.length && $('.gform_variation_wrapper').length ) {\n\t\t\t$form = $('.gform_variation_wrapper');\n\t\t}\n\n\t\tvar $fields = $form.find('.image-choices-field');\n\t\tif ( $fields.length ) {\n\t\t\t$fields.find('.gfield_radio, .gfield_checkbox').addClass('gform-theme__no-reset--children');\n\t\t}\n\n\t\tvar $choices = imageChoices.$fieldChoices( $fields );\n\n\t\t$form.find('.gchoice_select_all input, button[id$=\"select_all\"]').each(function(t, toggle){\n\t\t\t$(toggle).on('click', imageChoices.onChoicesSelectAllClick);\n\t\t});\n\n\t\tif ($choices.length > 0) {\n\n\t\t\t$choices.each(function(){\n\t\t\t\tvar $choice = $(this);\n\n\t\t\t\tvar choiceInit = $choice.data('init');\n\t\t\t\tif (choiceInit !== true) {\n\n\t\t\t\t\t$choice.data('init', true);\n\n\t\t\t\t\t$choice.find('label').addClass('gform-field-label');// for non gf theme installs\n\n\t\t\t\t\t// add a hover state\n\t\t\t\t\t$choice.find('label').hover(function(e){\n\t\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\t\tif ( $this.find('input').is(':disabled') ) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar $choice = $this.closest('[class*=\"gchoice\"]');// TODO: Update to just .gchoice ?\n\t\t\t\t\t\t\t$choice.addClass(imageChoices.cssClasses.hover);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}, function(e){\n\t\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\t\tif ( $this.find('input').is(':disabled') ){\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar $choice = $this.closest('[class*=\"gchoice\"]');// TODO: Update to just .gchoice ?\n\t\t\t\t\t\t\t$choice.removeClass(imageChoices.cssClasses.hover);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t});\n\n\t\t\t\t\t$choice.find('input').focus(function() {\n\t\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\t\tvar $choice = $this.closest('[class*=\"gchoice\"]');// TODO: Update to just .gchoice ?\n\t\t\t\t\t\t$choice.addClass(imageChoices.cssClasses.focus);\n\t\t\t\t\t}).blur( function() {\n\t\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\t\tvar $choice = $this.closest('[class*=\"gchoice\"]');// TODO: Update to just .gchoice ?\n\t\t\t\t\t\t$choice.removeClass(imageChoices.cssClasses.focus);\n\t\t\t\t\t});\n\n\n\t\t\t\t\tif ($choice.find('input[value=\"gf_other_choice\"]').length) {\n\n\t\t\t\t\t\t$choice.addClass('image-choices-choice-other');\n\n\t\t\t\t\t\t$choice.find('input[type=\"text\"]').wrap('
');\n\t\t\t\t\t\t$('.gf_other_wrap').append('');\n\t\t\t\t\t\t$(document).on('click', '.gf_other_close', function(e){\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t$(this).parent().removeClass('active')\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t$choice.find( 'input:not([type=\"text\"])' ).on('click', function() {\n\t\t\t\t\t\t\tvar $this = $( this );\n\t\t\t\t\t\t\tvar $label = $this.closest('.image-choices-choice').find('label')\n\t\t\t\t\t\t\timageChoices.onChoiceLabelClick( $label );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\n\t\t\t\t\t\t$choice.find( 'input' ).on('click', function() {\n\t\t\t\t\t\t\tvar $this = $( this );\n\t\t\t\t\t\t\tvar $label = $this.closest('.image-choices-choice').find('label')\n\t\t\t\t\t\t\timageChoices.onChoiceLabelClick( $label );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tvar $choicesField = $choice.closest('.image-choices-field');\n\t\t\t\t\tif ($choicesField.hasClass('image-choices-use-lightbox') && !$choice.find('.image-choices-lightbox-btn').length) {\n\t\t\t\t\t\tvar id = $choicesField.attr('id');\n\t\t\t\t\t\tvar title = $choice.find('.image-choices-choice-text').html();\n\t\t\t\t\t\tvar escapedTitle = (title + '').replace(/[\\\\\"']/g, '\\\\$&').replace(/\\u0000/g, '\\\\0');\n\t\t\t\t\t\tvar thumbUrl = $choice.find('.image-choices-choice-image').attr('src');\n\t\t\t\t\t\tvar imgUrl = $choice.find('.image-choices-choice-image').data('lightbox-src');\n\t\t\t\t\t\tif (typeof imgUrl === 'undefined' || imgUrl === '') {\n\t\t\t\t\t\t\timgUrl = thumbUrl;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (imgUrl !== '') {\n\n\t\t\t\t\t\t\tvar elementorAtts = ( imageChoicesVars.hasOwnProperty('elementorCompat') && imageChoicesVars.elementorCompat !== 'elementor' ) ? 'data-elementor-open-lightbox=\"no\"' : '';\n\n\t\t\t\t\t\t\tvar $lightboxBtn = $('');\n\t\t\t\t\t\t\t$lightboxBtn.data('caption', escapedTitle);\n\t\t\t\t\t\t\t$choice.prepend($lightboxBtn);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tsetTimeout(function(){\n\t\t\t\timageChoices.SelectedFields( form_id );\n\t\t\t\timageChoices.InitLightbox( form_id );\n\t\t\t\timageChoices.InitLazyLoad( form_id, current_page );\n\t\t\t\tif ( typeof jetslothMatchHeights !== 'undefined' ) {\n\t\t\t\t\tjetslothMatchHeights();\n\t\t\t\t}\n\t\t\t\tgform.doAction('gfic_setup', form_id);\n\t\t\t}, 100);\n\n\t\t}\n\n\t};\n\twindow.imageChoices_SetUpFields = imageChoices.SetUpFields;// legacy support added in 1.3.0\n\n\timageChoices.ConditionalLogic = function( form_id ) {\n\t\t// TODO: specific form by id\n\t\tvar $form = ( typeof form_id !== 'undefined' && form_id !== '' ) ? $('#gform_'+form_id) : $('.gform_wrapper form');\n\t\t// WooCommerce Gravity Forms Product Add-Ons compatibility\n\t\tif ( !$form.length && $('.gform_variation_wrapper').length ) {\n\t\t\t$form = $('.gform_variation_wrapper');\n\t\t}\n\n\t\tvar $choicesField = $form.find('.image-choices-field');\n\t\tif ($choicesField.length) {\n\t\t\t$choicesField.each(function(){\n\t\t\t\tvar $field = $(this);\n\t\t\t\tif ($field.is(':hidden')) {\n\t\t\t\t\t$field.find('.image-choices-choice').removeClass(imageChoices.cssClasses.selected + ' ' + imageChoices.cssClasses.hover + ' ' + imageChoices.cssClasses.focus);\n\t\t\t\t}\n\t\t\t});\n\t\t\tsetTimeout(function(){\n\t\t\t\tif ( typeof jetslothMatchHeights !== 'undefined' ) {\n\t\t\t\t\tjetslothMatchHeights();\n\t\t\t\t}\n\t\t\t}, 10);\n\t\t}\n\t};\n\n\t$(document).bind('gform_post_render', function(event, form_id, current_page){\n\t\twindow.gformGetOptionLabel = imageChoices.gformGetOptionLabel;\n\t\timageChoices.SetUpFields( form_id, current_page );\n\t});\n\n\n\t$(document).bind('gform_post_conditional_logic', function(event, form_id, fields, isInit){\n\t\timageChoices.ConditionalLogic( form_id );\n\t\timageChoices.SelectedFields( form_id );\n\t});\n\n\n\n\timageChoices.gformGetOptionLabel = function(element, selected_value, current_price, form_id, field_id) {\n\t\telement = $(element);\n\n\t\t// Added for cross compat with Color Picker\n\t\tif (element.closest('.gfield').hasClass('color-picker-field') && typeof window.colorPicker_gformGetOptionLabel === 'function') {\n\t\t\treturn window.colorPicker_gformGetOptionLabel(element, selected_value, current_price, form_id, field_id);\n\t\t}\n\n\t\tvar wrap = element.closest('[class*=\"gchoice\"]');// TODO: Update to just .gchoice\n\t\tvar index = wrap.index();\n\n\t\tvar price = gformGetPrice(selected_value);\n\t\tvar current_diff = element.attr('price');\n\t\tvar original_label = element.html().replace(//i, \"\").replace(current_diff, \"\");\n\n\t\tvar diff = gformGetPriceDifference(current_price, price);\n\t\tdiff = gformToNumber(diff) == 0 ? \"\" : \" \" + diff;\n\t\telement.attr('price', diff);\n\n\t\t//don't add for drop down items (not supported)\n\t\tvar price_label = element[0].tagName.toLowerCase() == \"option\" ? \" \" + diff : \"\" + diff + \"\";\n\t\tvar label = original_label + price_label;\n\n\t\t//calling hook to allow for custom option formatting\n\t\tif(window[\"gform_format_option_label\"])\n\t\t\tlabel = gform_format_option_label(label, original_label, price_label, current_price, price, form_id, field_id, index);\n\n\t\treturn label;\n\t};\n\twindow.imageChoices_gformGetOptionLabel = imageChoices.gformGetOptionLabel;// legacy support added in 1.3.0\n\twindow.gformGetOptionLabel = imageChoices.gformGetOptionLabel;\n\n\n\n\timageChoices.gform_format_option_label = function(fullLabel, fieldLabel, priceLabel, selectedPrice, price, formId, fieldId, index) {\n\t\tvar markup = [fullLabel];\n\n\t\tvar $field = $('#gform_'+formId+' .gfield#field_'+formId+'_'+fieldId);\n\n\t\tif ($field.length && $field.hasClass('image-choices-field')) {\n\n\t\t\tvar $allOptions = $field.find('[class*=\"gchoice\"]');// TODO: Update to just .gchoice ?\n\t\t\tvar $thisOption = (typeof index !== 'undefined' && index >= 0) ? $allOptions.eq(index) : $allOptions;// when index is not passed in or not valid, get all options\n\t\t\tvar loadedChoices = ( typeof $field.data('jetsloth-lazy-loaded') !== 'undefined' ) ? $field.data('jetsloth-lazy-loaded') : [];\n\n\t\t\t$thisOption.each(function(){\n\n\t\t\t\tvar $option = $(this);\n\n\t\t\t\tvar $thisOptionLabel = $option.find('label');\n\t\t\t\tvar $thisOptionInput = $option.find('input');\n\n\t\t\t\tvar thisOptionImage = $thisOptionLabel.data('img');\n\t\t\t\tvar thisOptionLightboxSrc = $thisOptionLabel.data('lightbox-src');\n\n\t\t\t\t// Get the label content from the data attribute\n\t\t\t\t/*\n\t\t\t\tvar fallbackFieldLabel = $thisOptionLabel.attr('data-text');\n\t\t\t\tif ( (typeof fieldLabel === 'undefined' || fieldLabel === '') && fallbackFieldLabel !== '') {\n\t\t\t\t\tfieldLabel = fallbackFieldLabel;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tfieldLabel = $thisOptionLabel.attr('data-text');\n\n\t\t\t\tif ( priceLabel === fieldLabel ) {\n\t\t\t\t\tpriceLabel = \"\";\n\t\t\t\t}\n\n\t\t\t\tif ( priceLabel === \"\" ) {\n\t\t\t\t\tpriceLabel = \" \";\n\t\t\t\t}\n\n\t\t\t\tvar jmhId = formId.toString() + '_' + fieldId.toString();\n\t\t\t\tvar jmhAttr = ( !imageChoices.isLegacyMode() && ( $field.hasClass('ic-theme--cover-tile') || $field.hasClass('ic-image--natural') ) ) ? ' data-jmh=\"' + jmhId + '_' + index + '\"' : '';\n\n\t\t\t\tvar hasLazyLoad = $field.hasClass('has-jetsloth-lazy');\n\t\t\t\tvar shouldLazyLoad = ( hasLazyLoad && $.inArray( index, loadedChoices ) === -1 );\n\t\t\t\tvar imageMarkup = [\n\t\t\t\t\t'',\n\t\t\t\t\t\t'