(function(s,i){'use strict';i.behaviors.webformSubmitOnce={attach:function(i){s('.js-webform-submit-once',i).each(function(){var i=s(this);i.removeData('webform-submitted');i.find('.js-webform-wizard-pages-links :submit, .form-actions :submit').removeClass('js-webform-submit-clicked');i.find('.js-webform-wizard-pages-links :submit, .form-actions :submit').click(function(){i.find('.js-webform-wizard-pages-links :submit, .form-actions :submit').removeClass('js-webform-submit-clicked');s(this).addClass('js-webform-submit-clicked')});s(this).submit(function(){var t=i.find('.js-webform-wizard-pages-links :submit.js-webform-submit-clicked, .form-actions :submit.js-webform-submit-clicked');if(!t.attr('formnovalidate')&&s.isFunction(jQuery.fn.valid)&&!(i.valid())){return!1};if(i.data('webform-submitted')){return!1};i.data('webform-submitted','true');i.find('.js-webform-wizard-pages-links :submit, .form-actions :submit').addClass('is-disabled');var r=s('
 
');t.after(r)})})}}})(jQuery,Drupal);; (function(e,r){'use strict';r.behaviors.webformDetailsSave={attach:function(t){if(!window.localStorage){return};e('details > summary',t).once('webform-details-summary-save').click(function(){var t=e(this).parent();if(t[0].hasAttribute('data-webform-details-nosave')){return};var a=r.webformDetailsSaveGetName(t);if(!a){return};var i=(t.attr('open')!=='open')?'1':'0';localStorage.setItem(a,i)});e('details',t).once('webform-details-save').each(function(){var t=e(this),i=r.webformDetailsSaveGetName(t);if(!i){return};var a=localStorage.getItem(i);if(a===null){return};if(a==='1'){t.attr('open','open')} else{t.removeAttr('open')}})}};r.webformDetailsSaveGetName=function(e){if(!window.localStorage){return''};var i=e.attr('data-webform-element-id');if(i){return'Drupal.webform.'+i.replace('--','.')};var t=e.attr('id');if(!t){return''};var a=e.parents('form');if(!a.length||!a.attr('id')){return''};var r=a.attr('id');if(!r){return''};r=r.replace(/--.+?$/,'').replace(/-/g,'_');t=t.replace(/--.+?$/,'').replace(/-/g,'_');return'Drupal.webform.'+r+'.'+t}})(jQuery,Drupal);; (function(e,n){var t=void 0,i=[];e.behaviors.drupalAnnounce={attach:function(e){if(!t){t=document.createElement('div');t.id='drupal-live-announce';t.className='visually-hidden';t.setAttribute('aria-live','polite');t.setAttribute('aria-busy','false');document.body.appendChild(t)}}};function r(){var e=[],a='polite',n=void 0,u=i.length;for(var r=0;r'},e.webform.detailsToggle.options);var a=t(s.button).attr('title',e.t('Toggle details widget state.')).on('click',function(o){var a;if(e.webform.detailsToggle.isFormDetailsOpen(l)){l.find('details').removeAttr('open');a=0} else{l.find('details').attr('open','open');a=1};e.webform.detailsToggle.setDetailsToggleLabel(l);if(e.webformDetailsSaveGetName){l.find('details').each(function(){var l=e.webformDetailsSaveGetName(t(this));if(l){localStorage.setItem(l,a)}})}}).wrap('
').parent();if(o.length){o.find('.item-list:first-child').eq(0).before(a)} else{i.eq(0).before(a)};e.webform.detailsToggle.setDetailsToggleLabel(l)})}};e.webform.detailsToggle.isFormDetailsOpen=function(e){return(e.find('details[open]').length===e.find('details').length)};e.webform.detailsToggle.setDetailsToggleLabel=function(t){var l=e.webform.detailsToggle.isFormDetailsOpen(t),a=(l)?e.t('Collapse all'):e.t('Expand all');t.find('.webform-details-toggle-state').html(a);var o=(l)?e.t('All details have been expanded.'):e.t('All details have been collapsed.');e.announce(o)}})(jQuery,Drupal);; (function(e,t,o){'use strict';function l(t,o){if(e.trim(t.term)===''){return o};if(typeof o.text==='undefined'){return null};var n=o.text+' ';if(n.toUpperCase().indexOf(t.term.toUpperCase())>-1){var r=e.extend({},o,!0);return r};return null};function a(t,o){let country=t.isoCountry,residenceCountry=e('[name$="_residencecountry"]',o),validResidenceCountry=!1;if(Array.isArray(residenceCountry)&&!residenceCountry.length){validResidenceCountry=residenceCountry[0].value?!0:!1};if(country!='-'){for(let i=0;i';select+='';countrySubdivisions.forEach(function(e){if(e.iso!=null){select+=''} else{select+=''}});select+='';province.replaceWith(select);e('#'+province.attr('id')).select2({matcher:l,language:{noResults:function(){return t.t('Resultado no encontrado')}}});province.closest('form').closest('form').find('[type="submit"]').attr('disabled',!0);var p=e('#'+province.attr('id')).get(0),s=p.parentElement.children,n=0;for(var i=0;i')};e('#'+province.attr('id')).trigger({type:'select2:select'})} else{provinceParent.removeClass('js-form-type-select form-type-select').addClass('js-form-type-textfield form-type-textfield');var c='',u='';province.replaceWith(c+u);provinceParent.find('.select2').hide()};province.prop('disabled',!1)};t.behaviors.sbGeoIP={attach:function(n,i){t.PlanetasbGeoIp=t.PlanetasbGeoIp||{};if(o.sb_geoip==undefined){return};t.PlanetasbGeoIp.localStorageGet=function(e){if(!t.PlanetasbGeoIp.storageAvailable('localStorage')){return undefined};return localStorage.getItem(e)};t.PlanetasbGeoIp.localStorageSet=function(e,o){if(!t.PlanetasbGeoIp.storageAvailable('localStorage')){return};localStorage.setItem(e,o)};t.PlanetasbGeoIp.localStorageRemove=function(e){if(!t.PlanetasbGeoIp.storageAvailable('localStorage')){return undefined};localStorage.removeItem(e)};t.PlanetasbGeoIp.storageAvailable=function(e){let storage;try{storage=window[e];let x='__storage_test__';storage.setItem(x,x);storage.removeItem(x);return!0}catch(t){return t instanceof DOMException&&(t.code===22||t.code===1014||t.name==='QuotaExceededError'||t.name==='NS_ERROR_DOM_QUOTA_REACHED')&&(storage&&storage.length!==0)}};let residenceCountry=e('[name$="_residencecountry"]',n),nationality=e('[name$="_nationality"]',n);let pageHasFormWithCountryField=!1;if(residenceCountry.length||nationality.length){pageHasFormWithCountryField=!0};let body=e('body',n);if(pageHasFormWithCountryField&&!body.data('sb_geoip')){s(n);body.data('sb_geoip',!0)};e('[name$="_residencecountry"]').once('sb_geoip').on('change',function(){let _this=e(this),country=_this.val(),form=_this.closest('form');r(form,country,n)})}}})(jQuery,Drupal,drupalSettings);; (function(e,t){'use strict';function a(t){let programs=[],distribution=e('.distribution',t),articles=distribution.find('.view-program article'),programList=distribution.find('.view-program .list'),areas=[];if(articles.length>0){for(let i=0;i0){for(let i=0;i=cssVar.getPropertyValue('--lg')){return!0}},currentScrollTop=t(window).scrollTop(),windowHeight=t(window).height(),documentHeight=t(document).height(),isBottom=currentScrollTop+windowHeight>=documentHeight,isTop=currentScrollTop==0;if(!isDesk()){if(!isBottom){recaptcha.removeClass('hidden')} else{recaptcha.addClass('hidden')};if(isTop&&stickyContent.length){setTimeout(function(){recaptcha.css('bottom','14px')},300)} else{let stickyContentHeight=(stickyContent.outerHeight()+10)+'px';setTimeout(function(){recaptcha.css('bottom',stickyContentHeight)},300)}};t(window).on('resize',function(){if(stickyContent.length){if(!isDesk()){let stickyContentHeight=(stickyContent.outerHeight()+10)+'px';recaptcha.css('bottom',stickyContentHeight)} else{recaptcha.css('bottom','14px')}}});t(window).scroll(function(){let currentScrollTop=t(window).scrollTop(),windowHeight=t(window).height(),documentHeight=t(document).height(),isBottom=currentScrollTop+windowHeight>=documentHeight,isTop=currentScrollTop==0;if(!isDesk()){if(!isBottom){recaptcha.removeClass('hidden')} else{recaptcha.addClass('hidden')};if(isTop&&stickyContent.length){recaptcha.css('bottom','14px')} else{let stickyContentHeight=(stickyContent.outerHeight()+10)+'px';recaptcha.css('bottom',stickyContentHeight)}}});clearInterval(checkExist)}},25)}}})(Drupal,jQuery,drupalSettings);;