PageSourceSearch

https://www.stowefamilylaw.co.uk/wp-content/themes/stowefamilylaw/…/stowefamilylaw.min.js?ver=20260923220555

js stowefamilylaw.co.uk collected 2026-09-24 18:08:13 UTC 64,552 bytes, 138 lines download raw bytes

1dataLayer=typeof(dataLayer)=='undefined'?[]:dataLayer;var cro_id_array=[];function cro_id_from_storage(){try{var cro_json=sessionStorage.getItem('cro_id_array_json');if(cro_json){cro_id_array=JSON.parse(cro_json);cro_id_populate_forms();}}catch(e){}}
2function cro_id_populate_forms(){cro_id=cro_id_array.join('-');var elements=document.querySelectorAll('input[name="croid"]');for(var i=0;i<elements.length;++i){elements[i].value=cro_id;}}
3function cro_id_add(new_cro_id){if(cro_id_array.constructor===Array){if(cro_id_array.includes(new_cro_id))
4return;cro_id_array.push(new_cro_id);cro_id_populate_forms();var cro_id_array_json=JSON.stringify(cro_id_array);try{sessionStorage.setItem('cro_id_array_json',cro_id_array_json);}catch(e){}}}
5cro_id_from_storage();$(document).ready(function(){var interval_cro_id=setInterval(function(){if(dataLayer){var cro_id=false;for(var i in dataLayer){var entry=dataLayer[i];if(entry.event&&entry.event=="optimize_view"){cro_id=entry.cro_id;cro_id_add(cro_id);}}
6if(cro_id){dataLayer.push({event:"croIdReady"});clearInterval(interval_cro_id);}}},100);});$(document).ready(function(){$('a[href="#find-nearest-office"]').on('click',function(){var button=$(this).html('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="spinner"><!-- Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z"/></svg> Locating...').prop('disabled',true);navigator.geolocation.getCurrentPosition(function(position){var lat=position.coords.latitude;var lng=position.coords.longitude;$.ajax({url:'/ajax/find-closest-office.php',type:'get',data:{lat:lat,lng:lng},success:function(result,status,xhr){button.html('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!-- Font Awesome Free 5.15.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) --><path d="M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"/></svg> Go to the '+result.name+' office page').attr('href',result.page_url);},error:function(xhr,status,error){button.href='/offices/';}});},function(){button.href='/offices/';});});});$(document).ready(function(){$('a[href="/contact/"]').on('click',function(evt){if($(this).closest('header.main-header').length)
7return;if($(this).hasClass('immutable'))
8return;var found=false;$('.sfl-form:visible, .sfl-form-new:visible').each(function(){if(!found)
9found=this;});if(found){evt.preventDefault();$('html, body').animate({scrollTop:$(found).offset().top-126},500);}});});$(document).ready(function(){$('a[href="mailto:[email protected]"]').on('click',function(evt){evt.preventDefault();var now=Date.now();var seconds=Math.floor(now / 1000);var ms=now%1000;var t_str=seconds+'.'+('00000'+ms).slice(-5);var id=MD5(t_str).slice(-8);dataLayer.push({'email_click_id':id});location.href='mailto:[email protected]?subject=Stowe%20Family%20Law%20enquiry%20['+id+']';});});$(document).ready(function(){$('select[name="sfl-service-type"]').on('change',function(){$(this).closest('.form-content').find('.sfl-service-type-other-wrapper').toggleClass('show',$(this).val()=='09');});});jQuery.event.special.touchstart={setup:function(_,ns,handle){this.addEventListener("touchstart",handle,{passive:!ns.includes("noPreventDefault")});}};jQuery.event.special.touchmove={setup:function(_,ns,handle){this.addEventListener("touchmove",handle,{passive:!ns.includes("noPreventDefault")});}};$(document).ready(function(){try{$('.hub-events .hub-carousel').slick({slidesToShow:1,slidesToScroll:1,arrows:true,appendArrows:'.hub-events .hub-carousel-nav',prevArrow:'<button type="button" class="slick-prev" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zM142.1 273l135.5 135.5c9.4 9.4 24.6 9.4 33.9 0l17-17c9.4-9.4 9.4-24.6 0-33.9L226.9 256l101.6-101.6c9.4-9.4 9.4-24.6 0-33.9l-17-17c-9.4-9.4-24.6-9.4-33.9 0L142.1 239c-9.4 9.4-9.4 24.6 0 34z"/></svg></button>',nextArrow:'<button type="button" class="slick-next" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"/></svg></button>',mobileFirst:true,responsive:[{breakpoint:767,settings:{slidesToShow:2,slidesToScroll:2,}},{breakpoint:1023,settings:{slidesToShow:3,slidesToScroll:3,}},]});}
10catch(e){}});$(document).ready(function(){$(document).on('click','a[href*="#"]:not([href="#"])',function(){if($(this).hasClass('smoothscroll')){if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'')&&location.hostname==this.hostname){var target=$(this.hash);target=target.length?target:$('[name='+this.hash.slice(1)+']');if(target.length){var height;if($(window).outerWidth()>=1025)
11height=$('.header-desktop').outerHeight();else
12height=$('.header-mobile').outerHeight();if(!height){if($(window).outerWidth()>=1025)
13height=$('.header-desktop-no-nav').outerHeight();else
14height=$('.header-mobile-no-nav').outerHeight();}
15$('html, body').animate({scrollTop:target.offset().top-height-35},1000);return false;}}}});});document.addEventListener('DOMContentLoaded',function(){function injectScript(src){var consentGiven=typeof CookieConsent!=='undefined'&&CookieConsent.consent.marketing;
15var existing=document.querySelector('script[src="'+src+'"]');if(existing){if(src.includes('instagram')&&window.instgrm){window.instgrm.Embeds.process();}
16if(src.includes('tiktok')&&window.__TikTok){window.__TikTok.reload();}
17return;}
18var script=document.createElement('script');script.src=src;script.async=true;script.setAttribute('data-cookieconsent','marketing');if(!consentGiven){script.type='text/plain';}
19document.body.appendChild(script);}
20function processPlaceholder(div){if(div.dataset.loaded)return;div.dataset.loaded='true';var src=div.getAttribute('data-embed-src');if(!src)return;injectScript(src);}
21var intersectionObserver=new IntersectionObserver(function(entries){entries.forEach(function(entry){if(!entry.isIntersecting)return;console.log('intersection observed:',entry.target);processPlaceholder(entry.target);intersectionObserver.unobserve(entry.target);});},{rootMargin:'768px'});document.querySelectorAll('div[data-embed-src]').forEach(function(el){intersectionObserver.observe(el);});window.addEventListener('CookiebotOnAccept',function(){if(CookieConsent.consent.marketing){document.querySelectorAll('div[data-embed-src]').forEach(function(el){var rect=el.getBoundingClientRect();var inView=rect.top<window.innerHeight&&rect.bottom>0;if(inView){processPlaceholder(el);}});}});});$(document).ready(function(){$('select:not(.with-typeahead)').niceSelect();});$(document).ready(function(){$('a.input-tooltip').on('click',function(evt){evt.preventDefault();});});$(document).ready(function(){var now=new Date();var day=("0"+now.getDate()).slice(-2);var month=("0"+(now.getMonth()+1)).slice(-2);var today=now.getFullYear()+"-"+(month)+"-"+(day);$('input[name=sfl-booking-date], input[name=sfl-booking-date-optional]').attr("min",today);var now=new Date();now.setDate(now.getDate()+27);var day=("0"+now.getDate()).slice(-2);var month=("0"+(now.getMonth()+1)).slice(-2);var in_27_days=now.getFullYear()+"-"+(month)+"-"+(day);$('input[name=sfl-booking-date], input[name=sfl-booking-date-optional]').attr("max",in_27_days);});$(window).on('load resize',function(){var nav_height=0;$('header .header-mobile .mobile-menu nav > div').each(function(){var this_height=$(this).outerHeight();nav_height+=this_height;});max_li=0;$('header .header-mobile .mobile-menu .subnav').each(function(){var this_li=$(this).find('> li').length;if(this_li>max_li)
22max_li=this_li;});inner_height=(75-47+24)+max_li*47;if(inner_height>nav_height)
23nav_height=inner_height;$('header .header-mobile .mobile-menu .subnav').css('height',nav_height+'px');$('header .header-mobile .mobile-menu nav a').on('click',function(e){var sibling=$(this).next();if(sibling.hasClass('subnav')){e.preventDefault();sibling.addClass('show');$('header .header-mobile .mobile-menu nav').animate({scrollTop:0},200);}});$('header .header-mobile .mobile-menu nav .header .back').on('click',function(e){e.preventDefault();var thismenu=$(this).closest('.subnav');thismenu.removeClass('show');$('header .header-mobile .mobile-menu nav').animate({scrollTop:0},200);});$('a[href="#close"]').on('click',function(e){e.preventDefault();$('header .header-mobile .mobile-menu nav .subnav').removeClass('show');$('.mobile-menu').removeClass('show');});});var modalTriggerElement=null;function setModalTriggerElement(element){modalTriggerElement=element;}
24$(document).ready(function(){$('.sfl-page').on('click','a[data-support-embed-type]',function(evt){evt.preventDefault();setModalTriggerElement(this);var embed_type=$(this).attr('data-support-embed-type');var embed_src=$(this).attr('data-support-embed-src');var embed_title=$(this).attr('data-support-embed-title');var modal=$('[data-remodal-id="support-modal-'+embed_type+'"]');modal.find('iframe').attr('data-cookieblock-src',embed_src);Cookiebot.runScripts();modal.find('h2 .title').html(embed_title);modal.remodal().open();});$(document).on('closing','[data-remodal-id="support-modal-podcast"], [data-remodal-id="support-modal-video"]',function(){$(this).find('iframe').attr('src','about:blank');});const focusableSelectors=['button','[href]','input','select','textarea','[tabindex]:not
24([tabindex="-1"])','iframe'].join(', ');function trapFocus(e){if(e.key!=='Tab')return;const modal=document.querySelector('.remodal.remodal-is-opened');if(!modal)return;const focusableEls=modal.querySelectorAll(focusableSelectors);if(focusableEls.length===0)return;const firstEl=focusableEls[0];const lastEl=focusableEls[focusableEls.length-1];if(e.shiftKey&&document.activeElement===firstEl){e.preventDefault();lastEl.focus();}else if(!e.shiftKey&&document.activeElement===lastEl){e.preventDefault();firstEl.focus();}}
25$('[data-remodal-target]').on('click',function(){setModalTriggerElement(this);});$(document).on('opened','.remodal',function(){document.addEventListener('keydown',trapFocus);this.querySelector('button, [href], input, iframe')?.focus();});$(document).on('closed','.remodal',function(){document.removeEventListener('keydown',trapFocus);if(modalTriggerElement&&document.contains(modalTriggerElement)){modalTriggerElement.focus();}
26modalTriggerElement=null;});$('a.youtube').on('click',function(e){e.preventDefault();setModalTriggerElement(this);var iframe_src='https://www.youtube-nocookie.com/embed/'+$(this).attr('data-video')+'?autoplay=1&disablekb=1&modestbranding=1&rel=0';$('[data-remodal-id="videoModal"] iframe').attr('src',iframe_src);$('[data-remodal-id="videoModal"]').remodal().open();});$(document).on('closing','[data-remodal-id="videoModal"]',function(e){$('[data-remodal-id="videoModal"] iframe').attr('src','about:blank');});$('a[href="#team-modal"]').on('click',function(e){e.preventDefault();setModalTriggerElement(this);var index=$(this).data('index');var div_id='#team-modal-'+index;var img_src=$(this).closest('.team').find('img').attr('src');$('[data-remodal-id="team-modal"] .remodal_content').html('<img src="'+img_src+'">'+$(div_id).html()+'<a href="javascript:void(0);" data-remodal-action="close" class="visually-hidden">Close modal</a>');$('[data-remodal-id="team-modal"]').remodal().open();});});$(document).ready(function(){$('.sticky-footer .cta.callback a').on('click',function(evt){$('.mobile-menu').removeClass('show');});});function initStickyCtaObserver(){const button=document.querySelector(".sticky-footer > .cta.callback");if(!button){return;}
27const forms=document.querySelectorAll('.sfl-form-native, .sfl-page a.button[href="/contact/"], .site-footer');if(forms.length===0){return;}
28const visibleForms=new Set();const observer=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{const isCurrentlyVisible=entry.isIntersecting&&isVisible(entry.target);if(isCurrentlyVisible){visibleForms.add(entry.target);}else{visibleForms.delete(entry.target);}});button.classList.toggle('hide-cta',visibleForms.size>0);},{root:null,threshold:0.1});forms.forEach((form)=>observer.observe(form));function isVisible(element){const style=window.getComputedStyle(element);return style.display!=="none"&&style.visibility!=="hidden"&&element.offsetWidth>0&&element.offsetHeight>0;}}
29if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",initStickyCtaObserver);}else{initStickyCtaObserver();}
30$(document).ready(function(){$('select[name="sfl-booking-time-optional"], select[name="sfl-booking-time"]').attr('disabled',true).niceSelect('update');$('input[name="sfl-booking-date-optional"], input[name="sfl-booking-date"]').on('change',function(){var datepicker=$(this);var date=datepicker.val();datepicker.closest('form').find('select[name="sfl-booking-time-optional"] + .nice-select, select[name="sfl-booking-time"] + .nice-select').addClass('disabled');$.ajax({url:'/callback/cb-json.php',type:'post',data:{date:date,intent_grade:datepicker.closest('form').find('input[name="availability"]').val()||datepicker.closest('form').attr('data-grade'),inc_outsourced:datepicker.closest('form').find('input[name="inc_outsourced"]').val()},success:function(result,status,xhr){if(result.date!=datepicker.val()){return;}
31var time_select=datepicker.closest('form').find('select[name="sfl-booking-time-optional"], select[name="sfl-booking-time"]');var time_option_selected=time_select.val();time_select.prop('selectedIndex',0);var options=datepicker.closest('form').find('select[name="sfl-booking-time-optional"] option, select[name="sfl-booking-time"] option');var any_available=false;var periods_with_availability=0;for(var i=1;i<=20;i++){$(options[i]).attr('disabled',result.slots[i-1]);any_available=any_available||!result.slots[i-1];if(!result.slots[i-1])
32periods_with_availability++;}
33if(date){window.dataLayer=window.dataLayer||[];window.dataLayer.push({'event':'callback_date_selected','dateSelection':date,'callbackPeriodsAvailable':periods_with_availability,'callbackPeriodsBooked':10-periods_with_availability,});}
34if(any_available){$('select[name="sfl-booking-time-optional"], select[name="sfl-booking-time"]').attr('disabled',false).niceSelect('update');time_select.val(time_option_selected);if(time_select.val()!==null)
35$('select[name="sfl-booking-time-optional"], select[name="sfl-booking-time"]').niceSelect('update');datepicker.parent().find('.wpcf7-not-valid-tip').remove();$('.callback-date-unavailable-message').slideUp();$('.dc-field input[name="sfl-booking-date-optional"], .dc-field input[name="sfl-booking-date"]').closest('.dc-field').removeClass('callback-date-unavailable');}
36else{var error_element=datepicker.parent().find('.wpcf7-not-valid-tip');if(datepicker.hasClass('no-error')){datepicker.removeClass('no-error');}
37else{if(!error_element.length)
38datepicker.parent().append('<span class="wpcf7-not-valid-tip" aria-hidden="true">Date unavailable – please choose again</span>');else
39error_element.html('Date unavailable – please choose again');}
40$('.callback-date-unavailable-message').slideDown();$('.dc-field input[name="sfl-booking-date-optional"], .dc-field input[name="sfl-booking-date"]').closest('.dc-field').addClass('callback-date-unavailable');}},error:function(xhr,status,error){console.log('Error getting callback data');}});});});$(document).ready(function(){$('a[href="#hub-catgories-more"]').on('click',function(evt){evt.preventDefault();$(this).closest('ul').addClass('show-all');});$('a[href="#hub-catgories-less"]').on('click',function(evt){evt.preventDefault();$(this).closest('ul').removeClass('show-all');});});$(document).ready(function(){var callback_availability=$('body').attr('data-callback-availability');var callback_availability_persist=parseInt($('body').attr('data-callback-availability-persist'));if(callback_availability&&callback_availability_persist){try{sessionStorage.setItem('callback_availability_persistent',callback_availability);}
41catch(e){}}
42else{try{var callback_availability_session=sessionStorage.getItem('callback_availability_persistent');if(callback_availability_session){callback_availability=callback_availability_session;}}
43catch(e){}}
44if(callback_availability){$('.form_multipart input[name="availability"]').val(callback_availability);}});$(document).ready(function(){$('select[name="more-local-offices"]').on('change',function(){if($(this).val())
45location.href=$(this).val();});});function sfl_setup_keyboard_navigation(){document.querySelectorAll('.header-desktop nav ul.menu > li').forEach(menuItem=>{menuItem.addEventListener('keydown',(event)=>{if(event.key==='Enter'||event.key===' '||event.key==='ArrowDown'){event.preventDefault();event.preventDefault();var focus_el=menuItem.querySelector(':scope > .sub-menu > li:first-of-type > a');if(focus_el){menuItem.setAttribute('aria-expanded',true);setTimeout(function(){focus_el.focus();},25);}}});menuItem.addEventListener('focusout',(e)=>{if(!e.currentTarget.contains(e.relatedTarget)){menuItem.setAttribute('aria-expanded',false);}});});document.querySelectorAll('.header-desktop nav ul.menu > li > .sub-menu > li, .header-desktop nav ul.menu > li > .sub-menu > li > .sub-menu > li').forEach(menuItem=>{menuItem.addEventListener('keydown',(event)=>{if(event.key==='Escape'){event.stopPropagation();var li_el=menuItem.parentElement.parentElement;li_el.setAttribute('aria-expanded',false)
46li_el.querySelector(':scope > a').focus();}
47if(event.key==='ArrowRight'||event.key==='Enter'||event.key===' '){event.stopPropagation();event.preventDefault();if(event.key==='Enter'||event.key===' '){var link_url=menuItem.querySelector(':scope > a').getAttribute('href');if(link_url!='#'){location.href=link_url;return;}}
48var focus_el=menuItem.querySelector(':scope > .sub-menu > li:first-of-type > a');if(focus_el){menuItem.setAttribute('aria-expanded',true);setTimeout(function(){focus_el.focus();},25);}}
49if(event.key=='ArrowDown'){event.stopPropagation();event.preventDefault();if(menuItem.nextElementSibling)
50menuItem.nextElementSibling.querySelector(':scope > a').focus();}
51if(event.key=='ArrowUp'){event.stopPropagation();event.preventDefault();if(menuItem.previousElementSibling)
52menuItem.previousElementSibling.querySelector(':scope > a').focus();}});});document.querySelectorAll('.header-desktop nav ul.menu > li > .sub-menu > li > .sub-menu > li > .sub-menu > li').forEach(menuItem=>{menuItem.addEventListener('keydown',(event)=>{if(event.key==='Escape'){event.stopPropagation();var li_el=menuItem.parentElement.parentElement;li_el.setAttribute('aria-expanded',false)
53li_el.querySelector(':scope > a').focus();}
54if(event.key=='ArrowDown'){event.stopPropagation();event.preventDefault();if(menuItem.nextElementSibling)
55menuItem.nextElementSibling.querySelector(':scope > a').focus();}
56if(event.key=='ArrowUp'){event.stopPropagation();event.preventDefault();if(menuItem.previousElementSibling)
57menuItem.previousElementSibling.querySelector(':scope > a').focus();}
58if(event.key=='Enter'||event.key===' '){event.stopPropagation();if(event.key==='Enter')
59return true;else{event.preventDefault();location.href=menuItem.querySelector(':scope > a').getAttribute('href');}}
60if(event.key=='ArrowRight'){event.stopPropagation();event.preventDefault();}});});}
61$(document).ready(function(){sfl_setup_keyboard_navigation();});$(document).ready(function(){try{var irp_number=$('.irp_number').text();if(irp_number){sessionStorage.setItem('irp_number',irp_number);}
62irp_number=sessionStorage.getItem('irp_number');if(irp_number){$('a.dynamic-number').attr('href','tel:'+irp_number);$('span.dynamic-number').text(irp_number);$('.dynamic-number').addClass('ruler-skip');}}
63catch(e){console.warn('irp_number warning',e);}});$(document).ready(function(){let searchParams=new URLSearchParams(window.location.search);var webform_id=searchParams.get('webform_id');if(webform_id){dataLayer.push({'webform_id':webform_id});}});$(document).ready(function(){var ruler_interval=setInterval(function(){var ruler_number=$('.ruler-number-loader').html();if(ruler_number&&ruler_interval){$('a.dynamic-number:not(.ruler-skip)').attr('href','tel:'+ruler_number);$('span.dynamic-number:not(.ruler-skip)').html(ruler_number);clearInterval(ruler_interval);}},250);});(function(){"use strict";const PREFIX="%c[SF:CONVERT]";const STYLE="color:#009900;font-weight:bold;";window.addEventListener('onEmbeddedMessageSent',function(e){const payload=e.detail??e;try{const entryPayload=JSON.parse(payload.conversationEntry.entryPayload);const text=entryPayload.abstractMessage?.staticContent?.text;const id=entryPayload.id;const isUser=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(id);const sender=isUser?'👤 USER?':'🤖 AGENT';if(!isUser&&text){const patterns=sfl_ai_agent_conversion_patterns();const lowerText=text.toLowerCase();const isConversion=patterns.some(pattern=>lowerText.includes(pattern.toLowerCase()));if(isConversion){console.log(PREFIX+' ✅ CALLBACK BOOKED',STYLE);var webform_id='';try{webform_id=localStorage.getItem('webform_id');if(webform_id){console.log(PREFIX+' [SF:webform_id] using value from localStorage: '+webform_id,STYLE);}else{console.log(PREFIX+' [SF:webform_id] no value stored in localStorage',STYLE);}
64localStorage.removeItem('webform_id');console.log(PREFIX+' [SF:webform_id] removed from localStorage',STYLE);}catch{console.log(PREFIX+' [SF:webform_id] localStorage could not be read/removed',STYLE);}
65window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:"request_callback_form_submit",webform_id:webform_id});}}}catch(err){console.warn('Could not parse entryPayload:',err);}});console.log(PREFIX+' Conversion Detection Initialised',STYLE);})();window.ai_agent_conversationId=null;$(document).ready(function(){function setPrechatFields(){var webform_id=false;try{webform_id=localStorage.getItem('webform_id');if(webform_id)
66console.log('[SF:webform_id] using value from localStorage: '+webform_id);else
67console.log('[SF:webform_id] no value stored in localStorage');}catch{console.log('[SF:webform_id] localStorage could not be read');}
68if(!webform_id){var now=Date.now();var key=Math.random()+':'+now;webform_id='ai_'+MD5(key).slice(-12);console.log('[SF:webform_id] new value generated: '+webform_id);try{localStorage.setItem('webform_id',webform_id);console.log('[SF:webform_id] stored in localStorage: '+webform_id);}catch{console.log('[SF:webform_id] localStorage could not be written');}}
69const paramMap={'ga_client_id':'ga-clientid','ga_session_id':'ga-session-id','referrer_url':'ref-url','croid':'croid','location_id':'location_id','office':'sfl-closestoffice','gclid':'ga-clickid','msclkid':'ms-clickid',};var entry_page_url=$('input[name="entry-page-url"]').val()||'';var page_url=$('input[name="url"]').val()||'';hiddenPrechatFields={"webform_id":webform_id,"ruler_number":$('.header-desktop .phone span.dynamic-number').text().trim(),"entry_page_url_1":entry_page_url.slice(0,255),"entry_page_url_2":entry_page_url.slice(255,510),"entry_page_url_3":entry_page_url.slice(510,765),"entry_page_url_4":entry_page_url.slice(765,1020),"page_url_1":page_url.slice(0,255),"page_url_2":page_url.slice(255,510),"page_url_3":page_url.slice(510,765),"page_url_4":page_url.slice(765,1020),};$.each(paramMap,function(fieldName,inputName){hiddenPrechatFields[fieldName]=($('input[name="'+inputName+'"]').val()||'').slice(0,255);});embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields(hiddenPrechatFields);console.info('[SF:AGENT] hiddenPrechatFields',hiddenPrechatFields);}
70$('a[href="#sf-chat"]').on('click',function(evt){evt.preventDefault();setPrechatFields();
70embeddedservice_bootstrap.utilAPI.launchChat();window.dataLayer.push({'event':'ai_agent_button_clicked','conversationId':window.ai_agent_conversationId});});window.addEventListener("onEmbeddedMessagingReady",setPrechatFields);window.addEventListener("onEmbeddedMessagingButtonCreated",(event)=>{document.querySelector('.sticky-footer .ai-assistant').classList.add('show');});window.addEventListener("onEmbeddedMessagingWindowClosed",(event)=>{document.querySelector('.sticky-footer').classList.remove('chatbot-active');window.dataLayer.push({'event':'ai_agent_window_closed','conversationId':window.ai_agent_conversationId});window.ai_agent_conversationId=null;});window.addEventListener("onEmbeddedMessagingWindowMinimized",(event)=>{document.querySelector('.sticky-footer').classList.remove('chatbot-active');window.dataLayer.push({'event':'ai_agent_window_minimized','conversationId':window.ai_agent_conversationId});});window.addEventListener("onEmbeddedMessagingWindowMaximized",(event)=>{document.querySelector('.sticky-footer').classList.add('chatbot-active');});window.addEventListener("onEmbeddedMessagingConversationStarted",(event)=>{window.dataLayer.push({'event':'ai_agent_conversation_started','conversationId':event.detail.conversationId});window.ai_agent_conversationId=event.detail.conversationId;});window.addEventListener("onEmbeddedMessagingConversationOpened",(event)=>{window.dataLayer.push({'event':'ai_agent_conversation_opened','conversationId':event.detail.conversationId});window.ai_agent_conversationId=event.detail.conversationId;});window.addEventListener("onEmbeddedMessagingButtonClicked",(event)=>{window.dataLayer.push({'event':'ai_agent_button_clicked','conversationId':window.ai_agent_conversationId});});window.addEventListener("onEmbeddedMessageLinkClicked",(event)=>{window.dataLayer.push({'event':'ai_agent_link_clicked','link':event.detail.link,'conversationId':window.ai_agent_conversationId});});window.addEventListener("onEmbeddedMessagingTranscriptRequested",(event)=>{window.dataLayer.push({'event':'ai_agent_transcript_requested','conversationId':window.ai_agent_conversationId});});window.addEventListener("onEmbeddedMessagingConversationClosed",(event)=>{window.dataLayer.push({'event':'ai_agent_conversation_closed','conversationId':event.detail.conversationId});window.ai_agent_conversationId=event.detail.conversationId;});});$(document).ready(function(){$('.sfl-page').on('click','a[data-post-click]',function(evt){const post_id=$(this).attr('data-post-click');const data=new FormData();data.append('post_id',post_id);navigator.sendBeacon('/ajax/post-click.php',data);});});$(document).ready(function(){try{var tel_inputs=document.querySelectorAll('.wpcf7-form input[type=tel]');for(var i=0;i<tel_inputs.length;i++){var form=$(tel_inputs[i]).closest('form');var form_tel_label=form.find('label.tel-label');if(form_tel_label.length){window.intlTelInput(tel_inputs[i],{initialCountry:"gb",preferredCountries:['gb'],utilsScript:"https://cdn.jsdelivr.net/npm/[email protected]/build/js/utils.js",hiddenInput:'sfl-tel-validated',separateDialCode:true})
71var label_el_html=form_tel_label[0].outerHTML;form_tel_label.remove();$(form).find('.iti').each(function(){$(this).append(label_el_html)});}}}
72catch(e){console.error('[!] intl-tel-input:',e);}
73var itn_autocomplete_interval=setInterval(function(){if($('input[name="sfl-tel"]').attr('autocomplete')=='off'){$('input[name="sfl-tel"]').attr('autocomplete','on');clearInterval(itn_autocomplete_interval);}},1000);});$(window).on('scroll',function(){$('.header-desktop .logo .inner').toggleClass('shrink',($(document).scrollTop()>10));$('.header-mobile').toggleClass('scrolled-down',($(document).scrollTop()>10));});var bgimgs_to_lazyload=[];function kss_lazyload_bgimgs_init(){var all_bgimgs=document.querySelectorAll('[data-bg-img]');for(var i=0;i<all_bgimgs.length;i++)
74if(all_bgimgs[i].getAttribute('data-bg-img')){bgimgs_to_lazyload.push(all_bgimgs[i]);}
75window.addEventListener('scroll',kss_lazyload_bgimgs_check);window.addEventListener('resize',kss_lazyload_bgimgs_check);window.addEventListener('orientationchange',kss_lazyload_bgimgs_check);kss_lazyload_bgimgs_check();}
76function kss_lazyload_bgimgs_check(){var windowHeight=window.innerHeight;for(var i=0;i<bgimgs_to_lazyload.length;i++){var element=bgimgs_to_lazyload[i];if(!element.getAttribute('data-bg-img'))
77continue;var positionFromTop=bgimgs_to_lazyload[i].getBoundingClientRect().top;if(positionFromTop-windowHeight<=200){element.style.backgroundImage='url('+element.getAttribute('data-bg-img')+')';element.removeAttribute('data-bg-img');}}}
78window.addEventListener('load',kss_lazyload_bgimgs_init);function MD5(r){var o,e,n,f=[-680876936,-389564586,606105819,-1044525330,-176418897,1200080426,-1473231341,-45705983,1770035416,-1958414417,-42063,-1990404162,1804603682,-40341101,-1502002290,1236535329,-165796510,-1069501632,643717713,-373897302,-701558691,38016083,-660478335,-405537848,568446438,-1019803690,-187363961,1163531501,-1444681467,-51403784,1735328473,-1926607734,-378558,-2022574463,1839030562,-35309556,-1530992060,1272893353,-155497632,-1094730640,681279174,-358537222,-722521979,76029189,-640364487,-421815835,530742520,-995338651,-198630844,1126891415,-1416354905,-57434055,1700485571,-1894986606,-1051523,-2054922799,1873313359,-30611744,-1560198380,1309151649,-145523070,-1120210379,718787259,-343485551],t=[o=1732584193,e=4023233417,~o,~e],c=[],a=unescape(encodeURI(r))+"\u0080",d=a.length;for(r=--d / 4+2|15,c[--r]=8*d;~d;)c[d>>
782]|=a.charCodeAt(d)<<8*d--;for(i=a=0;i<r;i+=16){for(d=t;64>a;d=[n=d[3],o+((n=d[0]+[o&e|~o&n,n&o|~n&e,o^e^n,e^(o|~n)][d=a>>4]+f[a]+~~c[i|15&[a,5*a+1,3*a+5,7*a][d]])<<(d=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*d+a++%4])|n>>>-d),o,e])o=0|d[1],e=d[2];for(a=4;a;)t[--a]+=d[a];}
79for(r="";32>a;)r+=(t[a>>3]>>4*(1^a++)&15).toString(16);return r;}
80$(document).ready(function(){$('.sticky-footer .cta.newsletter a').on('click',function(evt){$('.mobile-menu').removeClass('show');});});function initStickyNewsletterObserver(){const button=document.querySelector(".sticky-footer > .cta.newsletter");if(!button){return;}
81const newsletterCTAs=document.querySelectorAll('a[href="#newsletter"]:not(.sticky-footer-cta-button)');if(newsletterCTAs.length===0){return;}
82const visibleCTAs=new Set();const observer=new IntersectionObserver((entries)=>{entries.forEach((entry)=>{const isCurrentlyVisible=entry.isIntersecting&&isVisible(entry.target);if(isCurrentlyVisible){visibleCTAs.add(entry.target);}else{visibleCTAs.delete(entry.target);}});button.classList.toggle('hide-cta',visibleCTAs.size>0);},{root:null,threshold:0.1});newsletterCTAs.forEach((cta)=>observer.observe(cta));function isVisible(element){const style=window.getComputedStyle(element);return style.display!=="none"&&style.visibility!=="hidden"&&element.offsetWidth>0&&element.offsetHeight>0;}}
83if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",initStickyNewsletterObserver);}else{initStickyNewsletterObserver();}
84$(document).ready(function(){$('a[href="#see-more"]').on('click',function(evt){evt.preventDefault();$(this).prev().addClass('show-all');$(this).css('display','none');$('a[href="#see-less"]').css('display','block');});$('a[href="#see-less"]').on('click',function(evt){evt.preventDefault();$(this).css('display','none');$('a[href="#see-more"]').css('display','block');$(this).prev().prev().removeClass('show-all');location.href='#office-banner-team';});});$(document).ready(function(){try{$('.pb2-team-carousel .team-container').slick({dots:false,arrows:true,slidesToShow:5,autoplay:true,autoplaySpeed:3000,responsive:[{breakpoint:1280,settings:{slidesToShow:4}},{breakpoint:1025,settings:{slidesToShow:3}},{breakpoint:768,settings:{slidesToShow:2}},{breakpoint:576,settings:{slidesToShow:1}},]});}
85catch(e){}});$(document).ready(function(){try{$('.pb2_quote.with_carousel .carousel').slick({slidesToShow:1,slidesToScroll:1,arrows:true,appendArrows:'.pb2_quote.with_carousel .hub-carousel-nav',prevArrow:'<button type="button" class="slick-prev" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zM142.1 273l135.5 135.5c9.4 9.4 24.6 9.4 33.9 0l17-17c9.4-9.4 9.4-24.6 0-33.9L226.9 256l101.6-101.6c9.4-9.4 9.4-24.6 0-33.9l-17-17c-9.4-9.4-24.6-9.4-33.9 0L142.1 239c-9.4 9.4-9.4 24.6 0 34z"/></svg></button>',nextArrow:'<button type="button" class="slick-next" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"/></svg></button>',adaptiveHeight:true,});$('.pb2_quote.with_carousel .hub-carousel-nav .slick-prev').on('click',function(){$('.pb2_quote.with_carousel .carousel').slick('slickPrev');});$('.pb2_quote.with_carousel .hub-carousel-nav .slick-next').on('click',function(){$('.pb2_quote.with_carousel .carousel').slick('slickNext');});}catch(e){}});$(document).ready(function(){$('.pb2_tabbed_services .ts_carousel').on('afterChange',function(event,slick,currentSlide){const container=$(this).closest('.pb2_tabbed_services');const currentTabButton=$(slick.$slides[currentSlide]);if(container.find('.ts_tabs .show').length){const slidesToShow=slick.options.slidesToShow;const visibleSlideIndices=[];for(let i=0;i<slidesToShow;i++){visibleSlideIndices.push((currentSlide+i)%slick.slideCount);}
86let showSlideIndex=null;
86slick.$slides.each(function(index){if($(this).hasClass('show')){showSlideIndex=index;return false;}});if(showSlideIndex!==null){const isShowSlideVisible=visibleSlideIndices.includes(showSlideIndex);if(isShowSlideVisible){}else{container.find('.ts_carousel a').removeClass('show');container.find('.ts_tabs > div').removeClass('show');currentTabButton.addClass('show');slideService=currentTabButton.attr('data-service');container.find('.ts_tabs > div[data-service="'+slideService+'"]').addClass('show');}}}});try{$('.pb2_tabbed_services .ts_carousel').slick({dots:false,arrows:true,slidesToShow:2,autoplay:false,mobileFirst:true,appendArrows:'.pb2_tabbed_services .hub-carousel-nav',prevArrow:'<button type="button" class="slick-prev" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zM142.1 273l135.5 135.5c9.4 9.4 24.6 9.4 33.9 0l17-17c9.4-9.4 9.4-24.6 0-33.9L226.9 256l101.6-101.6c9.4-9.4 9.4-24.6 0-33.9l-17-17c-9.4-9.4-24.6-9.4-33.9 0L142.1 239c-9.4 9.4-9.4 24.6 0 34z"/></svg></button>',nextArrow:'<button type="button" class="slick-next" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"/></svg></button>',responsive:[{breakpoint:540,settings:{slidesToShow:2}},{breakpoint:980,settings:{slidesToShow:3}},{breakpoint:1200,settings:{slidesToShow:4}},{breakpoint:1480,settings:{slidesToShow:5}},]});}
87catch(e){}
88$('.pb2_tabbed_services .ts_carousel').on('click','a',function(evt){evt.preventDefault();const service=$(this).attr('data-service');const container=$(this).closest('.pb2_tabbed_services');const selected=container.find('.ts_tabs > div[data-service="'+service+'"].show');if(selected.length){$(this).removeClass('show');selected.removeClass('show');return;}
89container.find('.ts_carousel a').removeClass('show');$(this).addClass('show');container.find('.ts_tabs > div').removeClass('show');container.find('.ts_tabs > div[data-service="'+service+'"]').addClass('show');});});$(document).ready(function(){$('a[href="#transcript"]').on('click',function(){var link=$(this);var div=link.next();var mode=div.css('display');if(mode=='block')
90var word='Show';else
91var word='Hide';link.html(word+' Transcript');div.slideToggle();});});$(document).ready(function(){try{console.info('SLICK ATTEMPT');$('.pb2_accreditation_logos_responsive .footer-logos ul').not('.slick-initialized').slick({dots:true,arrows:false,slidesToShow:6,autoplay:true,autoplaySpeed:1500,responsive:[{breakpoint:960,settings:{slidesToShow:5}},{breakpoint:720,settings:{slidesToShow:4}},{breakpoint:576,settings:{slidesToShow:3}},{breakpoint:400,settings:{slidesToShow:2}},]});}
92catch(e){}});$(document).ready(function(){try{$('.services-carousel-b').slick({arrows:true,adaptiveHeight:true,autoplay:false,slidesToShow:5,slidesToScroll:1,responsive:[{breakpoint:1280,settings:{slidesToShow:4}},{breakpoint:960,settings:{slidesToShow:3}},{breakpoint:720,settings:{slidesToShow:2}},{breakpoint:576,settings:{slidesToShow:1}},]});}catch(e){}});$(document).ready(function(){function premium_content_activate(){$('.pb2_premium_content').addClass('active');localStorage.setItem('sfl-premium-content','enabled');}
93if(localStorage.getItem('sfl-premium-content')=='enabled')
94premium_content_activate();$('.pb2_premium_content form').on('submit',function(evt){evt.preventDefault();sfl_form_native_send(this,'/ajax/premium-content.php',premium_content_submitted);});function premium_content_submitted(result){window.dataLayer=window.dataLayer||[];window.dataLayer.push({'event':'premium_content_submit','webform_id':result.webform_id});premium_content_activate();}});$(document).ready(function(){$('.pb2-dropdown-info .toggle, .single-dropdown .toggle').on('click',function(evt){evt.preventDefault();this.parentElement.classList.toggle('show');});});function pb2_case_studies_carousel_init(){try{$('.pb2_case_studies_carousel .carousel').slick({dots:false,arrows:true,slidesToShow:1,autoplay:false,mobileFirst:true,appendArrows:'.pb2_case_studies_carousel .hub-carousel-nav',prevArrow:'<button type="button" class="slick-prev" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zM142.1 273l135.5 135.5c9.4 9.4 24.6 9.4 33.9 0l17-17c9.4-9.4 9.4-24.6 0-33.9L226.9 256l101.6-101.6c9.4-9.4 9.4-24.6 0-33.9l-17-17c-9.4-9.4-24.6-9.4-33.9 0L142.1 239c-9.4 9.4-9.4 24.6 0 34z"/></svg></button>',nextArrow:'<button type="button" class="slick-next" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"/></svg></button>',});}catch(e){}}
95$(document).ready(function(){pb2_case_studies_carousel_init();});$(document).ready(function(){try{$('.pb2_testimonials .hub-carousel').slick({slidesToShow:1,slidesToScroll:1,arrows:true,appendArrows:'.pb2_testimonials .hub-carousel-nav',prevArrow:'<button type="button" class="slick-prev" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zM142.1 273l135.5 135.5c9.4 9.4 24.6 9.4 33.9 0l17-17c9.4-9.4 9.4-24.6 0-33.9L226.9 256l101.6-101.6c9.4-9.4 9.4-24.6 0-33.9l-17-17c-9.4-9.4-24.6-9.4-33.9 0L142.1 239c-9.4 9.4-9.4 24.6 0 34z"/></svg></button>',nextArrow:'<button type="button" class="slick-next" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"/></svg></button>',mobileFirst:true,infinite:false,responsive:[{breakpoint:767,settings:{slidesToShow:2,slidesToScroll:2,}},{breakpoint:1023,settings:{slidesToShow:3,slidesToScroll:3,}},]});}catch(e){}});$(document).ready(function(){$('.office-nav li.megamenu > a').on('click',function(evt){evt.preventDefault();$(this).toggleClass('open');});});$(document).ready(function(){try{$('.hub-premium .hub-carousel').slick({slidesToShow:1,slidesToScroll:1,arrows:true,appendArrows:'.hub-premium .hub-carousel-nav',prevArrow:'<button type="button" class="slick-prev" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zM142.1 273l135.5 135.5c9.4 9.4 24.6 9.4 33.9 0l17-17c9.4-9.4 9.4-24.6 0-33.9L226.9 256l101.6-101.6c9.4-9.4 9.4-24.6 0-33.9l-17-17c-9.4-9.4-24.6-9.4-33.9 0L142.1 239c-9.4 9.4-9.4 24.6 0 34z"/></svg></button>',nextArrow:'<button type="button" class="slick-next" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"/></svg></button>',mobileFirst:true,responsive:[{breakpoint:768,settings:{slidesToShow:2,slidesToScroll:2,}},{breakpoint:1280,settings:{slidesToShow:3,slidesToScroll:3,}},]});}catch(e){}});$(document).ready(function(){console.info('TABLE TOGGLE');$('.pb2-table-mobile .toggle').on('click',function(evt){evt.preventDefault();$(this).closest('.item').toggleClass('open');});});$(document).ready(function(){try{$('.testimonial-carousel').slick({dots:true,adaptiveHeight:true,autoplay:false});}catch(e){}
96$('a[href="#testimonial-read-more"]').on('click',function(e){e.preventDefault();$(this).hide();$(this).next().css('display','inline');$('.testimonial-carousel').slick('animateHeight');});});$(document).ready(function(){if($('.testimonial-results').length){$('.testimonial-load-more').on('click',function(evt){load_testimonial_results(true);});$('.testimonial-filters select').on('change',function(){load_testimonial_results(false);});let suppressChangeHandler=false;const selectizeInstances=[];$('.testimonial-filters select').each(function(){const $select=$(this);const emptyOptionText=$select.find('option[value=""]').first().text();const selectizeInstance=$select.selectize({allowEmptyOption:true,placeholder:emptyOptionText||'Select an option'})[0].selectize;selectizeInstance.on('change',function(){if(!suppressChangeHandler){load_testimonial_results(false);}});selectizeInstances.push(selectizeInstance);});$('.testimonial-filters input[type=button]').on('click',function(){suppressChangeHandler=true;
96selectizeInstances.forEach(instance=>{instance.setValue('');});suppressChangeHandler=false;load_testimonial_results(false);});load_testimonial_results(true);}});let testimonials_grid_request_time='';function load_testimonial_results(append){const $results=$('.testimonial-results');if(!append){$results.empty();$results.attr('data-page',1);}
97var testimonial_grid_page=parseInt($results.attr('data-page'));$('.testimonial-notification').removeClass('show').html('');$('.testimonial-load-more').removeClass('hide').prop('disabled',true);const request_time=Date.now();testimonials_grid_request_time=request_time;$.ajax({url:'/ajax/testimonial-grid.php',type:'GET',data:{page:testimonial_grid_page,solicitor:$('.testimonial-filters select[name="testimonial-solicitor"]').val(),location:$('.testimonial-filters select[name="testimonial-location"]').val()},success:function(result){if(result.success){if(request_time!=testimonials_grid_request_time){return;}
98$results.append(result.html);init_testimonial_grid_toggles();if(testimonial_grid_page==1)
99pb2_case_studies_carousel_init();if(result.more_results){$('.testimonial-load-more').prop('disabled',false);testimonial_grid_page++;$results.attr('data-page',testimonial_grid_page);}
100else{var message=(result.total_results?'End of results':'No results');if(!result.total_results)
101$('.testimonial-notification').addClass('show').html(message);$('.testimonial-load-more').addClass('hide');}}
102else{$('.testimonial-notification').addClass('show').html(result.error);$('.testimonial-load-more').prop('disabled',false);}},error:function(xhr,status,error){$('.testimonial-notification').addClass('show').html('Error loading data - please check your connection and try again');$('.testimonial-load-more').prop('disabled',false);console.error('ERROR getting data from /ajax/testimonials.php :',error);}});}
103$(document).ready(function(){try{$('.pb2-office-team-contact .team-container').slick({dots:false,arrows:true,slidesToShow:1,autoplay:true,autoplaySpeed:3000,mobileFirst:true,responsive:[{breakpoint:540,settings:{slidesToShow:2}},{breakpoint:768,settings:{slidesToShow:1}},{breakpoint:980,settings:{slidesToShow:2}},{breakpoint:1200,settings:{slidesToShow:3}},{breakpoint:1480,settings:{slidesToShow:4}},]});}
104catch(e){}});$(document).ready(function(){$('a[href="#timeline-toggle"]').on('click',function(evt){evt.preventDefault();$(this).parent().next().toggleClass('show');});$('a[href="#timeline-prev"]').on('click',function(evt){evt.preventDefault();timeline_scroll(this,-1);});$('a[href="#timeline-next"]').on('click',function(evt){evt.preventDefault();timeline_scroll(this,+1);});var timeline_animation_running=false;function timeline_scroll(button,direction){if(timeline_animation_running)
105return;var timeline_el=$(button).closest('.pb2-timeline').find('.timeline');var num_slides=timeline_el.find('.marker').length;var timeline_w_visible=timeline_el.width();var timeline_w_total=timeline_el[0].scrollWidth;var slide_w=timeline_el.find('.marker').width();var slides_hidden=Math.ceil(num_slides-(timeline_w_visible / slide_w));var scroll_x_amount=((num_slides*slide_w)-timeline_w_visible)/ slides_hidden;var timeline_scroll_x=timeline_el.scrollLeft();var timeline_scroll_x_new=timeline_scroll_x+(scroll_x_amount*direction);timeline_animation_running=true;timeline_el.animate({scrollLeft:timeline_scroll_x_new},{complete:function(){timeline_animation_running=false;}});}});$(window).on('load',function(){if($('.pb2-timeline').length){$(window).on('resize',timeline_init);timeline_init();}});function timeline_init(){var timelines=$('.pb2-timeline');for(var i=0;i<timelines.length;i++){var timeline_el=$(timelines[i]).find('.timeline');var timeline_w_visible=timeline_el.width();var timeline_w_total=timeline_el[0].scrollWidth-parseInt(timeline_el.css('padding-left'))-parseInt(timeline_el.css('padding-right'));var timeline_nav_show=timeline_w_visible<timeline_w_total;$(timelines[i]).find('.timeline-ui').toggleClass('show-nav',timeline_nav_show);if(timeline_nav_show){var marker=$(timeline_el).find('.marker.first')[0];var marker_top=marker.offsetTop;var marker_height_half=$(marker).height()/ 2;var new_top=marker_top+marker_height_half;$(timelines[i]).find('a[href="#timeline-prev"] svg, a[href="#timeline-next"] svg').css('top',new_top+'px');}}}
106$(document).ready(function(){function slugify(text){return text.toLowerCase().replace(/[''’]/g,'').replace(/[^a-z0-9]+/g,'-').replace(/^-+|-+$/g,'');}
107let jumplinks=$('.pb2-jumplinks ul');
107if(jumplinks.length){let ignore_within=['.pb2_accreditation_logos_responsive','.pb2_help_advice','.pb2-jumplinks','.pb2_testimonials','.pb2-team-carousel','.site-footer','.trustpilot-container',];$('.pb2-jumplinks a[href="#mobile-toggle"]').on('click',function(){const $this=$(this);const isExpanded=$this.attr('aria-expanded')==='true';$this.attr('aria-expanded',!isExpanded);$this.closest('.pb2-jumplinks').toggleClass('show',!isExpanded);});const ul=jumplinks[0];$('h2').filter(function(){return!$(this).closest(ignore_within.join(',')).length;}).each(function(){if($(this).is(':visible')){const heading=$(this).text();const id=slugify(heading);$(this).attr('id',id);const li=document.createElement('li');const a=document.createElement('a');a.setAttribute('href','#'+id);a.textContent=heading;li.appendChild(a);ul.appendChild(li);}});}});$(document).ready(function(){$('.faq-list li a[href="#faq-toggle"]').click(function(e){e.preventDefault();$(this).nextAll('.content').slideToggle();$(this).parent().toggleClass('active');});$('.pb2-faq a[href="#toggle"]').on('click',function(e){e.preventDefault();$(this).parent().parent().toggleClass('show');});});$(document).ready(function(){$('.pb2_team_2026 a[href="#team-carousel-prev"]').on('click',function(evt){evt.preventDefault();team_scroll(this,-1);});$('.pb2_team_2026 a[href="#team-carousel-next"]').on('click',function(evt){evt.preventDefault();team_scroll(this,+1);});var team_animation_running=false;function team_scroll(button,direction){if(team_animation_running)
108return;var team_el=$(button).closest('.pb2_team_2026').find('.carousel');var num_slides=team_el.find('.slide').length;var team_w_visible=team_el.width();var team_w_total=team_el[0].scrollWidth;var padding_h=12;var flex_gap=18;var slide_w=team_el.find('.slide').width()+(padding_h*2)+flex_gap;var slides_visible=Math.floor(team_w_visible / slide_w);var scroll_x_amount=slide_w*slides_visible;var team_scroll_x=team_el.scrollLeft();var team_scroll_x_new=team_scroll_x+(scroll_x_amount*direction);team_el.attr('data-scroll',team_scroll_x_new);team_animation_running=true;team_el.animate({scrollLeft:team_scroll_x_new},{complete:function(){team_animation_running=false;}});}
109function team_carousel_indicator(){var carousel=$(this).closest('.outer').find('.carousel');var scrollLeft=carousel.scrollLeft();var scrollWidth=carousel[0].scrollWidth;var visibleWidth=carousel.width();var maxScroll=scrollWidth-visibleWidth;var percentage=maxScroll>0?(scrollLeft / maxScroll)*100:0;percentage=Math.min(Math.max(percentage,0),100);var progress=$(this).find('div');progress.css('width',percentage+'%');}
110$('.pb2_team_2026 .carousel').each(function(){$(this).closest('.outer').find('.carousel-progress').each(team_carousel_indicator);$(this).on('scroll',function(){$(this).closest('.outer').find('.carousel-progress').each(team_carousel_indicator);});});});$(document).ready(function(){$('.hub-results, .pb2_testimonial_grid').on('click','.hub-card-cta.offices a.button',function(evt){evt.preventDefault();var button=$(this).html('Locating...').prop('disabled',true);navigator.geolocation.getCurrentPosition(function(position){var lat=position.coords.latitude;var lng=position.coords.longitude;$.ajax({url:'/ajax/find-closest-office.php',type:'get',data:{lat:lat,lng:lng},success:function(result,status,xhr){button.html('Go to the '+result.name+' office page').attr('href',result.page_url);},error:function(xhr,status,error){button.html('Go to the offices page').attr('href','/offices/');}});},function(){button.html('Go to the offices page').attr('href','/offices/');});});});$(document).ready(function(){$('.hub-results, .pb2_testimonial_grid, .ab-blog-newsletter-cta, .blog-banner').on('submit','.hub-mailing-list-form',function(evt){evt.preventDefault();if(typeof(grecaptcha)=='undefined'){$(form).closest('.form-and-errors').find('.errors .text').html("Recaptcha is not loaded.");$(form).closest('.form-and-errors').addClass('show-errors');return false;}
111var form=this;var formData=new FormData(form);if(typeof(grecaptcha.execute)=='undefined'){$(form).closest('.form-and-errors').find('.errors .text').html("Recaptcha isn't ready yet.");$(form).closest('.form-and-errors').addClass('show-errors');return false;}
112grecaptcha.execute(recaptcha_get_sitekey(),{action:'homepage'}).then(function(token){for(var t=document.getElementsByTagName("form"),n=0;n<t.length;n++)
113for(var c=t[n].getElementsByTagName("input"),a=0;a<c.length;a++){var o=c[a];if("recaptcha"===o.getAttribute("name")){o.setAttribute("value",token);break;}}
114$(form).closest('.form-and-errors').find('.errors .text').html('');$.ajax({url:'/ajax/newsletter-form.php',type:'post',data:formData,processData:false,contentType:false,success:function(result,status,xhr){if(result.success){window.dataLayer=window.dataLayer||[];window.dataLayer.push({'event':'newsletter_form_submit','webform_id':result.webform_id});document.location.href='/thank-you-for-subscribing/';}
115else{$(form).closest('.form-and-errors').find('.errors .text').html(result.notification_text);$(form).closest('.form-and-errors').addClass('show-errors');}},error:function(result,status,xhr){}});});});$('.hub-results, .pb2_testimonial_grid, .ab-blog-newsletter-cta').on('click','.hub-card-cta.mailing-list .try-again',function(evt){$(this).closest('.form-and-errors').removeClass('show-errors');});$('.hub-results, .pb2_testimonial_grid, .ab-blog-newsletter-cta, .blog-banner').on('focus','.hub-mailing-list-form input',function(evt){if(captchaLoaded){return;}
116var head=document.getElementsByTagName('head')[0];var recaptchaScript=document.createElement('script');var cf7script=document.createElement('script');recaptchaScript.type='text/javascript';recaptchaScript.src='https://www.google.com/recaptcha/api.js?render='+recaptcha_get_sitekey()+'&#038;ver=3.0';
116recaptchaScript.onload=function(){grecaptcha.ready(function(){});};head.appendChild(recaptchaScript);captchaLoaded=true;});});$(document).ready(function(){$('a[href="#read-more"]').on('click',function(){$(this).hide().next().show();});});$(document).ready(function(){if($('.grid-testimonial').length){$('.pb2_testimonial_grid, .pb2_testimonials').on('click','a[href="#toggle"]',function(evt){evt.preventDefault();$t=$(this).closest('.grid-testimonial');$t.toggleClass('show');var less_more=$t.hasClass('show')?'less':'more';$(this).find('span').text('show '+less_more);});$(window).on('resize',init_testimonial_grid_toggles);init_testimonial_grid_toggles();}});function init_testimonial_grid_toggles(){$('.grid-testimonial .content').each(function(){$(this).closest('.grid-testimonial').find('a[href="#toggle"]').toggleClass('show',isTruncated(this));});}
117function isTruncated(element,lineClamp=3){const lineHeight=parseFloat(getComputedStyle(element).lineHeight);if(!lineHeight)return false;const fullHeight=element.scrollHeight;const maxVisibleHeight=lineHeight*lineClamp;return fullHeight>maxVisibleHeight+1;}
118$(document).ready(function(){try{$('.hub-widget-process .steps').slick({slidesToShow:1,slidesToScroll:1,arrows:true,appendArrows:'.hub-widget-process .hub-carousel-nav',prevArrow:'<button type="button" class="slick-prev" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zM142.1 273l135.5 135.5c9.4 9.4 24.6 9.4 33.9 0l17-17c9.4-9.4 9.4-24.6 0-33.9L226.9 256l101.6-101.6c9.4-9.4 9.4-24.6 0-33.9l-17-17c-9.4-9.4-24.6-9.4-33.9 0L142.1 239c-9.4 9.4-9.4 24.6 0 34z"/></svg></button>',nextArrow:'<button type="button" class="slick-next" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"/></svg></button>',mobileFirst:true,infinite:false,responsive:[{breakpoint:767,settings:{slidesToShow:2,slidesToScroll:2,}},{breakpoint:1023,settings:{slidesToShow:3,slidesToScroll:3,}},]});}catch(e){}});$(document).ready(function(){var comments_loaded=false;$('a[href="#comments-toggle"]').on('click',function(evt){evt.preventDefault();$(this).closest('.commentWrapper').toggleClass('show');if(!comments_loaded){comments_loaded=true;$.ajax({url:'/ajax/load-comments.php',type:'get',data:{post_id:comment_post_id},success:function(result,status,xhr){$('.commentlist').html(result.data.html);},error:function(xhr,status,error){}});}});var comments_init=false;$('.comments-section').on('click','a[href="#comment-form"], .comment-reply-link',function(){$('a[href="#comment-form"]').fadeOut();if(!comments_init){var recaptcha_script=document.createElement('script');recaptcha_script.type='text/javascript';recaptcha_script.src='https://www.google.com/recaptcha/api.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(recaptcha_script,s);$("#grecaptcha").val('');$('#commentform').submit(function(){if(grecaptcha.getResponse()==""){$("#gspan").text("Please complete the captcha.").css("color","red").show();return false;}else{$("#grecaptcha").val(grecaptcha.getResponse());return true;}});validator=$("#commentform").validate({rules:{author:"required",email:{required:true,email:true},url:{url:true},comment:"required",grecaptcha:"required"},messages:{author:"Please enter your name",email:{required:"Please enter an email address",email:"Please enter a valid email address"},url:"Please enter a valid URL e.g. http://www.mysite.com",comment:"Please include your comment",grecaptcha:"Please include your comment"}});comments_init=true;}
119$('.commentSection').slideDown();});});function correctCaptcha(){$("#gspan").text("").hide();}$(document).ready(function(){$('a[href="#office-list"]').on('click',function(){$('.office-list').slideDown();});});$(document).ready(function(){$('.dd-field').each(function(){$(this).find('input').parent().append('<label>'+$(this).attr('data-label')+'</label>');});$('.dd-field-custom').each(function(){$(this).append('<label>'+$(this).attr('data-label')+'</label>');});});$(document).ready(function(){var locationValue='';var expertiseValues=[];var qsRegex='';var $multiselect=$('.multiselect[data-multiselect="expertise"]');var $trigger=$multiselect.find('.multiselect-trigger');var $label=$multiselect.find('.multiselect-label');var $panel=$multiselect.find('.multiselect-panel');var $boxes=$multiselect.find('.filter-expertise-checkbox');var $apply=$multiselect.find('.multiselect-apply');var $chips=$('#filter-chips');var $count=$('#filter-result-count');var $members=$('.col-team-container .member');function isSheet(){return window.matchMedia('(max-width: 1024px)').matches;}
120function setPanel(open){$panel.attr('hidden',open?null:'hidden');$trigger.attr('aria-expanded',open?'true':'false');$('body').toggleClass('multiselect-open',open);if(open&&isSheet())
121$boxes.first().trigger('focus');}
122$trigger.on('click',function(){setPanel($panel.is('[hidden]'));});$(document).on('click',function(e){if($trigger.attr('aria-expanded')!=='true')return;if($(e.target).closest('.multiselect[data-multiselect="expertise"]').length)return;setPanel(false);});$(document).on('keydown',function(e){if(e.key==='Escape'&&$trigger.attr('aria-expanded')==='true'){setPanel(false);$trigger.trigger('focus');}});$multiselect.on('click','.multiselect-close, .multiselect-apply',function(){setPanel(false);$trigger.trigger('focus');});function syncFromCheckboxes(){expertiseValues=$boxes.filter(':checked').map(function(){return this.value;}).get();renderSelection();teamFilter();updateQueryString();}
123function renderSelection(){var $checked=$boxes.filter(':checked');var labels=$checked.map(function(){return $(this).data('label');}).get();if(labels.length===0)
124$label.text($label.data('empty-label'));else if(labels.length===1)
125$label.text(labels[0]);else
126$label.text(labels[0]+' +'+(labels.length-1)+' more');$trigger.toggleClass('has-selection',labels.length>0);$chips.empty();$checked.each(function(){var value=this.value;var text=$(this).data('label');$('<button type="button" class="filter-chip"></button>').attr('aria-label','Remove '+text+' filter').data('value',value).append($('<span></span>').text(text)).append('<span class="filter-chip-x" aria-hidden="true">&times;</span>').appendTo($chips);});$chips.attr('hidden',labels.length?null:'hidden');}
127$boxes.on('change',syncFromCheckboxes);$chips.on('click','.filter-chip',function(){var value=$(this).data('value');$boxes.filter(function(){return this.value===value;}).prop('checked',false);syncFromCheckboxes();$trigger.trigger('focus');});$multiselect.on('click','.multiselect-clear',function(){$boxes.prop('checked',false);syncFromCheckboxes();});function teamFilter(){var expertiseSelector=expertiseValues.join(',');var visible=0;$members.each(function(){var $this=$(this);var searchResult=qsRegex?$this.text().match(qsRegex):true;var locationResult=locationValue?$this.is(locationValue):true;var expertiseResult=expertiseSelector?$this.is(expertiseSelector):true;var show=!!(searchResult&&locationResult&&expertiseResult);
127$this.css('display',show?'block':'none');if(show)visible++;});updateCount(visible);if(typeof kss_lazyload_bgimgs_check==='function')
128setTimeout(kss_lazyload_bgimgs_check,10);}
129function updateCount(visible){var total=$members.length;if(!total){if($count.length)$count.text('');if($apply.length)$apply.text('Show results');return;}
130if($count.length){$count.text(visible===0?'No team members match those filters':visible===total?'Showing all '+total+' team members':'Showing '+visible+' of '+total+' team members');}
131if($apply.length)
132$apply.text('Show '+visible+' result'+(visible===1?'':'s'));}
133$('.filters-select.filter-location').on('change',function(){locationValue=$(this).val();teamFilter();});var $quicksearch=$('#quicksearch').on('keyup',debounce(function(){var term=$quicksearch.val().replace(/[.*+?^${}()|[\]\\]/g,'\\$&');qsRegex=term?new RegExp('\\b'+term,'i'):'';teamFilter();}));$('.team-filter-clear').on('click',function(){$('.filters-select.filter-location').val('').niceSelect('update');$('#quicksearch').val('');$boxes.prop('checked',false);locationValue='';qsRegex=new RegExp('','gi');syncFromCheckboxes();});function debounce(fn,threshold){var timeout;return function debounced(){if(timeout)clearTimeout(timeout);function delayed(){fn();timeout=null;}
134setTimeout(delayed,threshold||100);};}
135function updateQueryString(){if(!window.history||!window.history.replaceState)return;var params=new URLSearchParams(window.location.search);var slugs=$boxes.filter(':checked').map(function(){return $(this).data('slug');}).get();if(slugs.length)params.set('specialism',slugs.join(','));else params.delete('specialism');var qs=params.toString();window.history.replaceState({},'',window.location.pathname+(qs?'?'+qs:''));}
136if($multiselect.length){var initial=new URLSearchParams(window.location.search).get('specialism');if(initial){var wanted=initial.split(',');$boxes.each(function(){if($.inArray(String($(this).data('slug')),wanted)>-1)
137this.checked=true;});}
138syncFromCheckboxes();}});$(document).ready(function(){$('.single-team select[name="team-offices"]').on('change',function(){location.href=$(this).find('option:selected').val();});$('a[href="#other-methods"]').on('click',function(e){e.preventDefault();$(this).toggleClass('open');});try{$('.hub-posts-carousel .hub-carousel').slick({slidesToShow:1,slidesToScroll:1,arrows:true,appendArrows:'.hub-posts-carousel .hub-carousel-nav',prevArrow:'<button type="button" class="slick-prev" aria-label="Previous"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zM142.1 273l135.5 135.5c9.4 9.4 24.6 9.4 33.9 0l17-17c9.4-9.4 9.4-24.6 0-33.9L226.9 256l101.6-101.6c9.4-9.4 9.4-24.6 0-33.9l-17-17c-9.4-9.4-24.6-9.4-33.9 0L142.1 239c-9.4 9.4-9.4 24.6 0 34z"/></svg></button>',nextArrow:'<button type="button" class="slick-next" aria-label="Next"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm113.9 231L234.4 103.5c-9.4-9.4-24.6-9.4-33.9 0l-17 17c-9.4 9.4-9.4 24.6 0 33.9L285.1 256 183.5 357.6c-9.4 9.4-9.4 24.6 0 33.9l17 17c9.4 9.4 24.6 9.4 33.9 0L369.9 273c9.4-9.4 9.4-24.6 0-34z"/></svg></button>',mobileFirst:true,responsive:[{breakpoint:768,settings:{slidesToShow:2,slidesToScroll:2,}},{breakpoint:1200,settings:{slidesToShow:3,slidesToScroll:3,}},{breakpoint:1280,settings:{slidesToShow:4,slidesToScroll:4,}},]});}catch(e){}});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.