window.USC||(window.USC={});(()=>{const u=document.documentElement.getAttribute("data-anim")!=="0";u||document.documentElement.classList.add("no-animations");USC.onVisible=(n,t=0,i,r)=>{i=typeof i=="string"?n=>{n.classList.add(i)}:i;const u=t<0?`${-t*200}px`:"0px",f=n.offsetHeight>window.innerHeight?t*window.innerHeight/n.offsetHeight:t<0?0:t||0,e={root:null,rootMargin:u,threshold:f},o=new IntersectionObserver((t,u)=>{const f=t.find(n=>n.isIntersecting);f?i&&i(n):r&&r(n);(f||!f&&r&&!i)&&(u.unobserve(n),u.disconnect())},e);o.observe(n)};const r=document.querySelectorAll("video");r.length>0&&r.forEach(n=>{USC.onVisible(n,0,()=>{window.USC.initVideos||require2("/common/usc/p/video.js",()=>{window.USC.initVideos()})})});let n=0,t=null;const f=()=>{const t=window.pageYOffset,i=window.innerHeight,r=t>n,u=t<=i,f=n-t>=i*.33;requestAnimationFrame(()=>{!r||u||f?document.documentElement.classList.remove("scrolled-down"):document.documentElement.classList.add("scrolled-down")});n=t},e=()=>{t===null&&(t=setTimeout(()=>{f(),t=null},100))};window.addEventListener("scroll",e);const i=()=>{const n=document.querySelectorAll('img[data-src],img[loading="lazy"],video[data-poster]');for(let t=0;t<n.length;t++){const i=n[t];if(i.nodeName.toLowerCase()==="video")USC.onVisible(i,-.5,l(i));else i.hasAttribute("loading")||i.setAttribute("loading","lazy"),i.parentNode.nodeName.toLowerCase()==="picture"?c(i.parentNode,i.parentNode.classList.contains("bg")):i.hasAttribute("data-src")&&(i.setAttribute("src",i.getAttribute("data-src")),i.removeAttribute("data-src"))}},o=/^\/cms\/thumbnails/,s=/\/(\d+)\/(\d+)x(\d+)/,h=/\/\d+\/\d+x\d+(\/.+)$/,c=(n,t)=>{t&&(dim=n.getBoundingClientRect()),Array.from(n.children).forEach(i=>{let r=i.getAttribute("data-src")||i.getAttribute("src")||i.getAttribute("srcset");const u=r.match(o);if(u&&t){const n=u[0],t=r.match(s)[1],i=r.match(h)[1];r=`${n}/${t}/${dim.width}x${dim.height}${i}`}const f=i.nodeName.toLowerCase()==="img"?"src":"srcset";if(i.setAttribute(f,r),i.removeAttribute("data-src"),i.nodeName.toLowerCase()==="source"){const t=i.style.aspectRatio;if(t&&window.innerWidth<=1279){const r=n.querySelector("img");(window.innerWidth>500&&i.media.includes("1279px")||window.innerWidth<=500&&i.media.includes("500px"))&&(r.style.aspectRatio=t)}}})},l=n=>{n.setAttribute("poster",n.getAttribute("data-poster")),n.removeAttribute("data-poster")};window.LazyLoad=i;i();setTimeout(i,1e3)})();
(function(n){function u(n){for(var t=n;t&&t.parentNode;){if(t.nodeName==="svg"||t.nodeName==="SVG")return t;t=t.parentNode}return null}function f(n){n.readyState===4?i.call(n):n.onreadystatechange||(n.onreadystatechange=function(){n.readyState===4&&i.call(n)},n.onreadystatechange())}function i(){var n,t=this._document,i;for(t||(this._document=t=document.implementation.createHTMLDocument(""),t.body.innerHTML=this.responseText,this._target={});n=this._embeds.pop();)i=this._target[n.id],i||(this._target[n.id]=i=t.getElementById(n.id)),r(n.use,n.parent,n.svg,i)}function r(n,t,i,r){var u,f,e;if(r&&n.parentNode===t){for(t.removeChild(n),u=document.createDocumentFragment(),f=!i.hasAttribute("viewBox")&&r.getAttribute("viewBox"),f&&i.setAttribute("viewBox",f),e=r.cloneNode(!0);e.childNodes.length;)u.appendChild(e.firstChild);t.appendChild(u)}}var t={};n.USE={Replace:function(n){var y,s,i,a,h,v,p,c,l,w,o,e;if(n&&n.getElementsByTagName||(n=document),n.nodeName==="USE"||n.nodeName==="use")s=[n];else for(y=n.getElementsByTagName("use"),s=new Array(y.length),e=0;e<s.length;e++)s[e]=y[e];for(e=0;e<s.length;e++){if(i=s[e],i._replacing)continue;else i._replacing=1;(a=i.parentNode,h=u(a),v=h&&(i.getAttribute("data-href")||i.getAttribute("xlink:href")||i.getAttribute("href")),v)&&(p=v.split("#"),c=p[0],l=p[1],!l&&(w=/icon_(\w+)\./.exec(c))&&(l=w[1]),c?(o=t[c],o||(t[c]=o=new XMLHttpRequest,o.open("GET",c),o.send(),o._embeds=[]),h.attributes["data-use"]||h.setAttribute("data-use",v),o._embeds.push({use:i,parent:a,svg:h,id:l}),f(o)):r(i,a,h,document.getElementById(l)))}window.USC&&window.USC.initVideos&&window.USC.initVideos()}};(n.requestAnimationFrame||n.setTimeout)(USE.Replace,0);window.register&&window.register("svg")})(window);
(function(){Element.prototype.scrollParent||(Element.prototype.scrollParent=function(){for(var n=this.parentNode,t=this.ownerDocument,i=t&&t.defaultView;i&&n;){if(n.parentNode&&n.parentNode!==t.body&&n.parentNode!==t.documentElement&&n.parentNode!==t&&n.parentNode!==t.defaultView){if(n.isScrollable())return n}else return null;n=n.parentNode}return null});Element.prototype.isScrollable||(Element.prototype.isScrollable=function(){var n=this.ownerDocument,i=n&&n.defaultView,t=i.getComputedStyle(this).getPropertyValue("overflow");return!t||t==="visible"?!1:this.clientWidth<this.scrollWidth||this.clientHeight<this.scrollHeight});Element.prototype.scrollTo||(Element.prototype.scrollTo=function(n,t){this.scrollLeft=n;this.scrollTop=t});Element.prototype.scrolling||(Element.prototype.scrolling=function(n,t,i,r,u){var e,f,s;if(!n&&!t){if(r)try{r.call(this)}catch(l){}return}if(e=this.cancelAnimationFrame?this:this.ownerDocument.defaultView,e){if(this.$scrolling&&this.$scrolling.frame&&(e.cancelAnimationFrame(this.$scrolling.frame),u)){var o=this.$scrolling,h=o.diffX-((this.pageXOffset||this.scrollLeft||0)-o.startX),c=o.diffY-((this.pageYOffset||this.scrollTop||0)-o.startY);h&&(n+=h);c&&(t+=c)}if(delete this.$scrolling,f={startX:this.pageXOffset||this.scrollLeft||0,startY:this.pageYOffset||this.scrollTop||0,diffX:n,diffY:t,dur:i||Math.min(500,Math.max(250,Math.abs(t/4))),frame:0,style:this.constructor===Window?e.document.documentElement.style:this.style},r&&typeof r=="function"&&(f.callback=r),f.diffY<0&&f.startY===0&&(f.diffY=0),f.diffX<0&&f.startX===0&&(f.diffX=0),!f.diffY&&!f.diffX){if(f.callback)try{f.callback.call(this)}catch(l){}f=null;return}if(f.dur<0){n=f.diffX+f.startX;t=f.diffY+f.startY;this.scrollTo(n,t);return}this.$scrolling=f;s=function(n){var r,i,u,f,t=this.$scrolling;if(t.begin){if(r=n-t.begin,i=Math.min(1,r/t.dur),i=.5-Math.cos(i*Math.PI)/2,u=i*t.diffX+t.startX,f=i*t.diffY+t.startY,this.scrollTo(u,f),i===1){if(t.style&&(t.style.removeProperty("scroll-behavior"),delete t.style),t.callback)try{t.callback.call(this)}catch(o){}delete this.$scrolling;return}}else t.begin=n,t.style&&t.style.setProperty("scroll-behavior","auto");this.$scrolling.frame=e.requestAnimationFrame(s)}.bind(this);this.$scrolling.frame=e.requestAnimationFrame(s)}});Window.prototype.scrolling||(Window.prototype.scrolling=Element.prototype.scrolling);Document.prototype.getFixedElements||(Document.prototype.getFixedElements=function(){for(var n,r,t,u=this.querySelectorAll("aside,div,header,nav,ul"),f=[],i=0;i<u.length;i++)n=u[i],r=getComputedStyle(n),t=r.getPropertyValue("position"),(t==="fixed"||t==="sticky")&&f.push(n);return f});Document.prototype.fixedOffset||(Document.prototype.fixedOffset=function(n){for(var t,r,i,o=this.documentElement.clientWidth/2,e=this.getFixedElements(),u=0,f=0;f<e.length;f++)(r=e[f],i=getComputedStyle(r),i.opacity!=="0"&&i.visibility!=="hidden"&&i.display!=="none")&&(t=r.getBoundingClientRect(),(t.top===0||n)&&t.left===0&&t.width>o&&t.height>u&&t.height!==window.innerHeight&&(u=t.height));return u});Element.prototype.scrollIntoViewport||(Element.prototype.scrollIntoViewport=function(n){var o=this.getBoundingClientRect(),i={top:o.top,right:o.right,bottom:o.bottom,left:o.left,width:o.width,height:o.height},f,e,r,t,l,s,u,h,c,a,v;if(n&&n.height&&(i.height=n.height,i.bottom=i.top+i.height),i.height===0&&i.top===0){if(f=this.previousElementSibling&&this.previousElementSibling.getBoundingClientRect(),f&&f.height?i={top:f.bottom+1,right:f.right,bottom:f.bottom+2,left:f.left,width:f.width,height:1}:e=this.nextElementSibling&&this.nextElementSibling.getBoundingClientRect(),e&&e.height)i={top:e.top-2,right:e.right,bottom:e.top-1,left:e.left,width:e.width,height:1};else if(!i&&(i=this.parentNode.getBoundingClientRect(),!i.height))return}else if(i.height===0&&this.nodeName==="INPUT"&&(i=this.parentNode.getBoundingClientRect(),!i.height))return;if(r=n&&n.container,r!==!1)if(r)if(r.ownerDocument){if(!r.contains(this)){console.error("Element not found in container",this,r);return}}else{console.error("Invalid container",r);return}else r=this.scrollParent();if(t={},r){if(t.height=r.clientHeight,!t.height)return;t.width=r.clientWidth;l=r.getBoundingClientRect();t.top=l.top;t.left=l.left;t.topOffset=0}else{if(s=this.ownerDocument,!s||!s.documentElement)return;t.height=s.documentElement.clientHeight;t.width=s.documentElement.clientWidth;t.top=0;t.left=0;t.topOffset=n&&n.fixed?s.fixedOffset():0}u=n&&n.margin||0;h=0;n&&n.top?h=i.top-t.topOffset-t.top-u:i.top>t.top+t.height?h=i.height>t.height-1?i.top-t.topOffset-t.top-u:i.bottom-t.top-t.height+u:i.bottom<t.top+t.topOffset+u&&(h=i.height>t.height-1?i.bottom-t.top-t.height+u:i.top-t.topOffset-t.top-u);c=0;i.left>t.left+t.width?c=i.width>t.width-1?i.left-t.left-u:i.right-t.left-t.width+u:i.right<t.left+u&&(c=i.width>t.width-1?i.right-t.left-t.width+u:i.left-t.left-u);a=n&&n.instant?-1:n&&n.duration;v=n&&n.callback;(r||this.ownerDocument.defaultView).scrolling(c,h,a,v)});window.register&&window.register("usc/p/scroll")})();
var el=document.getElementById("SmLocalHeaderStaging"),headClick=function(n){window.USC.listenUp||require2("/common/usc/p/passive-listener.js",function(){USC.listenUp(n)})};el.addEventListener("click",headClick);el.addEventListener("keydown",headClick);
window.USC||(window.USC={});rrequire("usc/p/poly",function(){function r(n){var r;if(n==="true")return!0;if(n==="false")return!1;if(n==="null")return null;if(isNaN(r=+n)||n!==String(r)){if(i.test(n))try{return t(n)}catch(u){}}else return r;return n}var t=function(n,t){return(window.JSON2||JSON).parse(n,t)},i=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,n;USC.parseJson=t;USC.elementData=function(n){var i,t,u,f,e;if(!n||!n.attributes)return undefined;for(i={},t=0;t<n.attributes.length;t++)u=n.attributes[t],f=String(u.name),f.indexOf("data-")===0&&(e=f.substring(5).replace(/\-([a-z])/g,function(n,t){return t.toUpperCase()}),i[e]=r(u.value));return i};USC.linkData=function(n){var e=n&&n.target,t=e&&e.closest("a,button"),u=t&&t.getAttribute("href"),i=u&&/^javascript:(\w+)(?:\('([^']+)')?(?:\s*,\s*(\d+?)\))?/i.exec(u),o=i&&i[1],r=o==="void"?i[2]:undefined,f;return r&&r!=="0"||(r=t&&t.getAttribute("data-action")),r&&(i&&i[3]?f=+i[3]:t.getAttribute("data-id")&&(f=+t.getAttribute("data-id"))),{link:t,href:u,fn:o,action:r,id:f}};USC.setAttributes=function(n,t){var i,r;for(i in t)t.hasOwnProperty(i)&&(r=t[i],typeof r!="undefined"&&n.setAttribute(i,r))};USC.onVisible=function(n,t,i,r){var u,f,e,o;n&&typeof IntersectionObserver!="undefined"&&(t<0?(u=-t+"px",f=0):(u="0px",f=t),e={root:null,rootMargin:u,threshold:f},o=new IntersectionObserver(function(t,u){var f=t.find(function(n){return n.isIntersecting});if(!r){f&&(i(n),u.unobserve(n),u.disconnect());return}f?i(n):r(n)},e),o.observe(n))};USC.docReady=function(t){if(t){if(!n)switch(document.readyState){case"complete":case"loaded":case"interactive":n=!0;return}if(n)t();else{var i=function(){n=!0;window.removeEventListener("DOMContentLoaded",i);t()};window.addEventListener("DOMContentLoaded",i)}}};USC.uuid=function(){var n=performance.now();return"_xxxxxxxxxxxxxxxx".replace(/x/g,function(){var t=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),t.toString(16)})};USC.guid=function(){var n=performance.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var i=(n+Math.random()*16)%16|0;return n=Math.floor(n/16),(t=="x"?i:i&3|8).toString(16)})};USC.urlfriendly=function(n){return n?(""+n).replace(/([a-z])(?:'s|s')\b/gi,"$1s").replace(/\W+/gi,"-").toLowerCase():""};USC.logError=function(n,t){if(n&&n.stack&&(console.error(n.stack),t))try{console.error(JSON.stringify(Array.prototype.slice.call(t)))}catch(n){}};USC.getKey=function(n){var i=n.code&&n.code.replace(/Key|Digit/,""),r=n.ctrlKey,u=n.altKey,f=n.shiftKey,t;switch(i){case"AltLeft":case"AltRight":u=!1;break;case"ShiftLeft":case"ShiftRight":f=!1;case"ControlLeft":case"ControlRight":r=!1}return t="",r&&(t+="CTRL-"),u&&(t+="ALT-"),f&&(t+="SHIFT-"),t+i.toUpperCase()};USC.Encode={};USC.Encode.JS=USC.Encode.Uri=function(n){return n?encodeURIComponent(""+n).replace(/['"\(\)]/g,function(n){switch(n){case"'":return"%27";case'"':return"%22";case"(":return"%28";case")":return"%29";default:return n}}):""};USC.Decode={};USC.Decode.JS=USC.Decode.Uri=function(n){return n?decodeURIComponent((""+n).replace(/\+/g,"%20")):""};USC.getElementsCollectionByDataAttribute=function(n,t,i){var r,f,s,o,e,u,h;if(!n)return null;if(r={},f=Array.from((t||document).querySelectorAll(n)),i&&f.push(t),!f.length)return r;for(s=n.replace(/[\[\]]/g,""),o=0;o<f.length;o++)e=f[o],u=e.getAttribute(s),r[u]?r[u]&&!Array.isArray(r[u])?(h=r[u],r[u]=[],r[u].push(h),r[u].push(e)):r[u].push(e):r[u]=e;return r};USC.getEnvironment=function(){return document.body.getAttribute("data-api")||"api"};USC.getScorpionApiDomain=function(n){return window.location.protocol+"//"+(n?n:USC.getEnvironment())+".scorpion.co/"};window.register&&window.register("usc/p/utils")});
window.USC||(window.USC={}),function(){function r(n){var i={},u=n.getAllResponseHeaders(),r,t;if(!u)return i;for(r=u.split(/\r\n/),t=0;t<r.length;t++){var f=r[t].split(/: /),e=f.shift(),o=f.join(": ");e&&o&&(i[e.toLowerCase()]=o)}return i}function u(r){var o,e,c,s,f,u,h;if(r&&r.fields&&r.rows){for(o=[],e=0;e<r.rows.length;e++){for(c=r.rows[e],s={},f=0;f<r.fields.length;f++)u=c[f],typeof u=="string"?(h=i(u),h&&(u=h)):Object.isPlainObject(u)?n(u):Array.isArray(u)&&t(u),s[r.fields[f]]=u;o.push(s)}return o}return Array.isArray(r)?n(r):Object.isPlainObject(r)&&n(r),r}function f(n){var r=[],i,t;for(i in n)n.hasOwnProperty(i)&&(t=n[i],(Array.isArray(t)||Object.isPlainObject(t))&&(t=JSON.stringify(t)),r.push("key="+encodeURIComponent(t)));return r.join("&")}function n(r){var f,u,e;for(f in r)r.hasOwnProperty(f)&&(u=r[f],typeof u=="string"?(e=i(u),e&&(r[f]=e)):Object.isPlainObject(u)?n(u):Array.isArray(u)&&t(u))}function t(r){for(var u,e,f=0;f<r.length;f++)u=r[f],typeof u=="string"?(e=i(u),e&&(r[f]=e)):Object.isPlainObject(u)?n(u):Array.isArray(u)&&t(u)}function i(n){if(/^\d{4}\-\d{2}\-\d{2}T/.test(n)){var t=new Date(n);if(!isNaN(t))return t}return null}USC.get=function(n,t,i){return USC.send({url:n},t,i)};USC.post=function(n,t,i,r){return USC.send({url:n,method:"POST",payload:t},i,r)};USC.send=function(n,t,i){var r=function(n,t,r,u){if(typeof i=="function")try{i(n,t,r,u)}catch(f){console.error(f,arguments)}else console.error(n,t,r,u)};return USC.xhr(n,function(i,f){var o=f&&f["content-type"],e;if(n&&n.dataType==="text")e=i;else if(o&&o.indexOf("text/")===0)e=i;else try{e=u(JSON.parse(i))}catch(s){console.error(s,[n,i]);r(i,s)}typeof t=="function"?t(e,f):console.log(e)},r)};USC.xhr=function(n,t,i){var c=n.url,l=n.method||"GET",o=n.headers||{},e,u,s,h;o["x-request-from"]=window.location.href;e=n.payload;e&&typeof e!="string"&&(e instanceof FormData||(n.form===!0?(e=f(e),o["Content-Type"]="application/x-www-form-urlencoded"):(e=JSON.stringify(e),o["content-type"]||(o["content-type"]="application/json"))));typeof i!="function"&&(i=console.log);u=new XMLHttpRequest;n.withCredentials&&(u.withCredentials=!0);u.addEventListener("load",function(n){var f=r(u);u.status>=200&&u.status<300?t&&t(u.responseText,f):i&&i(u.responseText,n,u.status,f)});u.addEventListener("error",function(n){i(u.responseText,n,u.status)});u.open(l,c,!0);for(s in o)o.hasOwnProperty(s)&&(h=o[s],s&&h&&u.setRequestHeader(s,h));u.setRequestHeader("X-Requested-With","XMLHttpRequest");try{u.send(e)}catch(a){i(u.responseText,a)}return u};window.register&&window.register("usc/p/http")}();
window.USC||(window.USC={});require2([typeof IntersectionObserver=="undefined"?"usc/p/intersection-observer":""],function(){USC.onVisible=function(n,t,i){var f,r,u,e,o;typeof i=="string"&&(f=i,i=function(n){n.classList.add(f)});t<0?(r=-t*200+"px",u=0):(r="0px",u=t||0);e={root:null,rootMargin:r,threshold:u};o=new IntersectionObserver(function(t,r){var u=t.find(function(n){return n.isIntersecting});u&&(i(n),r.unobserve(n),r.disconnect())},e);o.observe(n)};window.register&&window.register("usc/p/visible")});
window.USC||(window.USC={});require2(["usc/p/utils"],function(){function n(n,t){for(var u,o,p,w,b,k,v,d,g,tt,l,c,it,a,nt,e=n.content||n,y=[],r=0;r<e.childNodes.length;r++)y.push(e.childNodes[r]);if(this.options=t||{},n.innerHTML=this.options.form?h:s,u=e.querySelector("div.ui-dialog"),i(u,"width",t.width),i(u,"height",t.height),i(u,"min-width",t.minWidth),i(u,"min-height",t.minHeight),this.options.cssPosition||(u.style.setProperty("position","fixed"),u.style.setProperty("left","0"),u.style.setProperty("top","0")),this.options.dialogClass)for(o=this.options.dialogClass.split(" "),r=0;r<o.length;r++)p=o[r],p&&u.classList.add(p);if(w=n.content.querySelector("div.ui-widget-overlay"),this.options.overlayClass)for(o=this.options.overlayClass.split(" "),r=0;r<o.length;r++)b=o[r],b&&w.classList.add(b);for(k=e.querySelector("div.ui-dialog-titlebar"),this.options.noEscape&&(v=k.querySelector("button.ui-dialog-titlebar-close"),v.removeAttribute("data-action"),v.setAttribute("data-noescape",""),v.style.setProperty("display","none")),d=e.querySelector("span.ui-dialog-title"),this.options.title&&(d.textContent=this.options.title),g=e.querySelector("aside.ui-dialog-content"),r=0;r<y.length;r++)tt=y[r],g.appendChild(tt);for(l=e.querySelector("div.ui-dialog-buttonset"),c=this.options.buttons,c?c.length||(l.remove(),l=null):c=[{text:"Close"}],r=0;r<c.length;r++)it=c[r],l.appendChild(f(it));for(a=document.createElement("div"),a.setAttribute("data-dialog",USC.guid()),a.appendChild(n),document.body.appendChild(a),this.parent=a,this.template=n,this.element=u,this.nodes=[],r=0;r<e.childNodes.length;r++)this.nodes.push(e.childNodes[r]);this.els={titlebar:k,title:d,content:g,buttonset:l,overlay:w};nt=this.element.querySelectorAll("a,button,input,textarea,select,details,[tabindex]:not([tabindex='-1'])");this.els.lastFocus=nt[nt.length-1];this.parent.addEventListener("click",function(n){return this.handleClick(n)}.bind(this));this.element.addEventListener("keydown",function(n){var t;this.options.noEscape||(n.keyCode===27?t=!0:n.keyCode==9&&(n.shiftKey&&n.target===this.element?t=!0:n.shiftKey||n.target!=this.els.lastFocus||(t=!0)),t&&(n.preventDefault(),this.close()))}.bind(this));this._open=!1}function i(n,t,i){n&&t&&i&&i!=="css"&&(typeof i=="number"?n.style.setProperty(t,i+"px"):typeof i=="string"&&n.style.setProperty(t,i))}function u(n){var t,c,i,u,f;if(!n||!n.length)throw new Error("Missing dialog nodes for positioning.");if(t=n[0].parentElement,c=t&&t.getAttribute("data-dialog"),!c)throw new Error("Missing dialog id.");for(u=0;u<n.length;u++)if(f=n[u],f.classList.contains("ui-dialog")){i=f;break}if(i){var l=i.getBoundingClientRect(),a=window.innerWidth,v=window.innerHeight,e=(a-l.width)/2,s=(v-l.height)/2,h="fixed";s<0&&(s=window.scrollX+20,h="absolute");e<0&&(e=0,h="absolute");i.style.setProperty("position",h);i.style.setProperty("left",e+"px");i.style.setProperty("top",s+"px");document.body.appendChild(t);o(t)}else r(t)}function f(n){var i=n.text,r,t;if(!i)throw new Error("Missing button text for dialog box");return r=n.action||i,t=document.createElement("button"),t.setAttribute("class","ui-button ui-btn-"+USC.urlfriendly(r)),t.setAttribute("data-action",r),t.textContent=i,t}function e(n,t){var i=n.parentElement,u=i.querySelector("div.ui-widget-overlay"),f=i.querySelector("div.ui-dialog");u&&f&&(u.classList.add("out"),f.classList.add("dialog-out"),setTimeout(function(){u.classList.remove("out");f.classList.remove("dialog-out");typeof t=="function"&&t()},300));r(i)}function o(n){var u=n.getAttribute("data-dialog"),r=t[u];if(!r){var i={el:null,x:0,y:0,left:0,top:0,right:0,bottom:0},f=function(n){var t=Math.max(3,Math.min(i.right,n.pageX-i.x+i.left)),r=Math.max(3,Math.min(i.bottom,n.pageY-i.y+i.top));i.el.style.setProperty("left",t+"px");i.el.style.setProperty("top",r+"px")},e=function(n){var t=n.target.closest(".ui-draggable-handle");if(t){i.el=t.closest("div.ui-dialog");i.left=parseFloat(i.el.style.getPropertyValue("left"));i.top=parseFloat(i.el.style.getPropertyValue("top"));i.x=n.pageX;i.y=n.pageY;var r=i.el.getBoundingClientRect(),u=window.innerWidth,e=window.innerHeight,o=Math.min(u,document.documentElement.clientWidth);i.right=o-r.width-3;i.bottom=e-r.height-3;document.addEventListener("mousemove",f)}},o=function(){i.el=null;document.removeEventListener("mousemove",f)};r={unsubscribe:function(){n.removeEventListener("mousedown",e);document.removeEventListener("mouseup",o)}};n.addEventListener("mousedown",e);document.addEventListener("mouseup",o);t[u]=r}}function r(n){var i=n.getAttribute("data-dialog"),r=t[i];if(r){r.unsubscribe();delete t[i];return}}var t={};n.prototype.isOpen=function(){return this._open};n.prototype.open=function(){var n,t;if(!this.isOpen()){for(n=0;n<this.nodes.length;n++)t=this.nodes[n],this.parent.insertBefore(t,this.template);this.options.cssPosition||u(this.nodes);this.element.setAttribute("tabindex","0");this.focusFirst()}};n.prototype.focusFirst=function(){var n=this.element;setTimeout(function(){n.focus()},100)};n.prototype.setHtml=function(n){var r=new DOMParser,u=r.parseFromString(n,"text/html"),t=u.querySelector("aside"),i;if(t)t.classList.add("ui-dialog-content");else throw new Error("Couldn't find <aside> element in dialog html");i=this.els.content.parentElement;i.insertBefore(t,this.els.content);this.els.content.remove();this.els.content=t};n.prototype.setElement=function(n){n.classList.add("ui-dialog-content");var t=this.els.content.parentElement;t.insertBefore(n,this.els.content);this.els.content.remove();this.els.content=n};n.prototype.handleClick=function(n){if(!this.els.content.contains(n.target)){var t=USC.linkData(n);(t.action==="Close"||n.target.classList.contains("ui-widget-overlay"))&&this.close()}};n.prototype.close=function(){for(var r,t,i=this.els.content.querySelectorAll("video,audio"),n=0;n<i.length;n++)try{i[n].stop()}catch(u){}this.element.setAttribute("tabindex","-1");r=this.template.content||this.template;t=this.nodes;e(this.template,function(){var n,i;if(this.options.persist)for(n=0;n<t.length;n++)i=t[n],r.appendChild(i);else this.dispose();this.options.returnTo&&this.options.returnTo.focus()}.bind(this))};n.prototype.dispose=function(){r(this.parent);this.parent.remove();this.parent=null;this.template=null;this.nodes=null;this.element=null;this.els=null};window.USC.dialog=function(t,i){var u,r;return t&&t.matches&&t.matches("template")?(u=t,t=null):(u=document.createElement("template"),HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(u)),r=new n(u,i||{}),typeof t=="string"?r.setHtml(t):t instanceof HTMLElement&&r.setElement(t),r.open(),r};const s='<div class="ui-widget-overlay"><\/div><div tabindex="-1" role="dialog" class="ui-dialog">\t<div class="ui-dialog-titlebar">\t\t<span class="ui-dialog-title"><\/span>\t\t<button type="button" class="ui-button ui-dialog-titlebar-close" title="Close Pop-up" data-action="Close">\t\t\t<span class="ui-button-icon ui-icon ui-icon-closethick"><\/span>\t\t\t<span class="ui-button-icon-space"> <\/span>\t\t<\/button>\t<\/div>\t<aside class="ui-dialog-content"><\/aside>\t<div class="ui-dialog-buttonpane">\t\t<div class="ui-dialog-buttonset"><\/div>\t<\/div><\/div>',h='<div class="ui-widget-overlay"><\/div><div tabindex="-1" role="dialog" class="ui-dialog">\t<form action="javascript:void(0)">\t\t<div class="ui-dialog-titlebar">\t\t\t<span class="ui-dialog-title"><\/span>\t\t\t<button type="button" class="ui-button ui-dialog-titlebar-close" title="Close Pop-up" data-action="Close">\t\t\t\t<span class="ui-button-icon ui-icon ui-icon-closethick"><\/span>\t\t\t\t<span class="ui-button-icon-space"> <\/span>\t\t\t<\/button>\t\t<\/div>\t\t<aside class="ui-dialog-content"><\/aside>\t\t<div class="ui-dialog-buttonpane">\t\t\t<div class="ui-dialog-buttonset"><\/div>\t\t<\/div>\t<\/form><\/div>';typeof HTMLTemplateElement=="undefined"?require2(["usc/p/poly-template"],function(){window.register("usc/p/dialog")}):window.register&&window.register("usc/p/dialog")});
window.USC||(window.USC={});require2(["usc/p/utils","usc/p/http","usc/p/visible","usc/p/dialog"],function(){function n(n){if(this.element=n,this.els={form:n.closest("form"),search:{}},!this.els.form)throw new Error("The AjaxRepeater does not live in a form element.");this.state={search:{},last:null,lastSearch:null,scroll:0};this.options=Object.extend({},s,USC.elementData(n));this.forwardSearch=a.bind(this);this.search=v.bind(this);this.error=d.bind(this);this.scroll=y.bind(this);this.infinite=p.bind(this);this.els.form.addEventListener("submit",l.bind(this));this.init=c.bind(this);USC.onVisible(this.element,0,this.init)}function c(){var n,t;if(this.element.trigger("ajaxifybeforeinit"),this.element.addEventListener("click",u.bind(this)),this.element.addEventListener("input",f.bind(this)),this.element.addEventListener("change",f.bind(this)),this.options.getsearch)if(typeof this.options.getsearch=="string")this.getSearch(this.options.getsearch);else if(Array.isArray(this.options.getsearch))for(n=0;n<this.options.getsearch.length;n++)this.getSearch(this.options.getsearch[n]);t=this.element.classList.contains("ui-deferred");this.options.infinite&&(window.addEventListener("scroll",this.scroll),t||this.infinite());t&&(this.element.classList.remove("ui-deferred"),this.search());this.element.trigger("ajaxifyinit")}function i(n,t,i){var r,f,u;if(r=i?(+n.value||1)+t:t,f=+n.getAttribute("min")||1,u=+n.getAttribute("max"),i||t!==-1?r<f?r=f:u&&r>u&&(r=u):r=u,n.value=r,r!=+n.value)throw new Error("Invalid value: "+r+" for "+n.getAttribute("name"));}function r(n){for(var t,r,i=0;i<n.length;i++){t=n[i];r=(t.getAttribute("name")||"").split("$").pop().toLowerCase();switch(r){case"pagingid":t.setValue("1");continue;case"resultsperpage":case"orderby":continue}t.matches("[type='radio'],[type='checkbox']")?t.checked=!1:t.setValue("")}}function l(n){if(!n.submitter||!n.submitter.matches(h))return n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),this.search(),!1}function u(n){var t=USC.linkData(n),i=(t.action||"").toLowerCase();switch(i){case"next":this.navigate(1,!0);break;case"prev":this.navigate(-1,!0);break;case"start":this.navigate(1,!1);break;case"end":this.navigate(-1,!1);break;case"more":this.more();break;case"apply":this.search();break;case"reset":this.reset();break;case"sort":this.sort(t.link);break;case"edit":this.edit(t.link);break;case"add":this.add(t.link)}}function f(n){var t=n.target.closest("[data-search]"),r;t&&!t.matches("form")&&((r=(n.target.getAttribute("name")||"").split("$").pop().toLowerCase(),r==="pagingid"?i(n.target,n.target.getValue(),!1):this.setSearchAmount("PagingID",1),n.target.closest("[data-apply]"))||(n.type==="input"&&n.target.matches("input[type='text'],input[type='search']")?(clearTimeout(this.state.search),this.state.search=setTimeout(this.search,this.options.searchDelay)):this.search()))}function a(n){var t=n.target.getAttribute("name"),f,i,u,r;if(t){if(f=t.split("$").pop(),i=this.els.form.querySelector("[name$='$"+f+"']"),!i){console.warn("A change was made in the remote search, but a matching input wasn't found in the AjaxRepeater",t);return}if(n.target.matches("[type='radio'],[type='checkbox']")){var s=n.target.closest("form"),e=Array.from(s.querySelectorAll("[name='"+t+"']:checked")),o=[];for(r=0;r<e.length;r++)o.push(e[r].value);u=o.join(",")}else u=n.target.getValue();i.setValue(u);i.trigger(n.type)}}function v(){var i=new FormData(this.els.form),t={},n;(i.forEach(function(n,i){t[i]=n}),n=JSON.stringify(t),n!==this.state.last)&&(this.state.last=n,this.loading(!0),this.element.trigger("ajaxifysearch",this.state),this.state.lastSearch=this.submit())}function y(){clearTimeout(this.state.scroll);this.state.scroll=setTimeout(this.infinite,150)}function p(){if(this.element.getAttribute("data-needspaging")!=="false"){var n=this.element.getBoundingClientRect();n.bottom<window.innerHeight&&this.more()}}function w(n,t){var u,r;if(!n||n[0]!=="<"){console.error("Invalid AjaxRepeater response.");return}this.command("");var e=new DOMParser,o=e.parseFromString(n,"text/html"),f=this.element.getAttribute("id"),i=f&&o.getElementById(f);if(i)b(this.element,i);else{console.error("AjaxRepeater not found in results.");return}if(this.element.trigger("ajaxifybeforerender",{currentHTML:this.element,HTML:i}),this.options.ajaxreplace)k(this.element,i,t);else{while(this.element.lastChild)this.element.lastChild.remove();for(u=document.createDocumentFragment();i.firstChild;)u.appendChild(i.firstChild);this.element.appendChild(u);this.element.trigger("ajaxifywidgets")}window.LazyLoad&&window.LazyLoad();window.USE&&window.USE.Replace();this.element.trigger("ajaxifyrender");this.loading(!1);this.options.infinite?this.scroll():t!=="More"&&(r=this.element.querySelector("[data-item='i']"),r&&r.scrollIntoViewport&&r.scrollIntoViewport({fixed:!!document.getFixedElements(),margin:document.fixedOffset(!0)*1.5||200}))}function e(n,t){if(!n||n[0]!=="<"){console.error("Invalid AjaxRepeater response.");return}this.command("");var f=new DOMParser,e=f.parseFromString(n,"text/html"),r=this.element.getAttribute("id"),u=r&&e.getElementById(r),i=u&&u.querySelector("[data-item='e']");if(!i){console.error("Unable to find AjaxRepeater edit item.");return}i.matches("li,td")?i=i.firstElementChild:i.matches("tr")&&(i=i.firstElementChild.firstElementChild);t?t.setElement(i):USC.dialog(i,this.options.popup);const o=i.querySelector("video")||i.matches("video");o&&require2("usc/p/video",()=>window.USC.initVideos())}function b(n,i){for(var r,u=0;u<t.length;u++)r=t[u],i.attributes[r]?n.setAttribute(r,i.getAttribute(r)):n.removeAttribute(r)}function k(n,t,i){var e=o(n),s=e[0],u=e[1],c=e[2],f,h,r;if(e=o(t),f=e[1],i!=="More")for(r=0;r<u.length;r++)u[r].remove();for(h=document.createDocumentFragment(),r=0;r<f.length;r++)h.appendChild(f[r]);if(c?s.insertBefore(h,c):s.appendChild(h),u=Array.from(n.querySelectorAll("[data-ajaxrender='replace']")),f=Array.from(t.querySelectorAll("[data-ajaxrender='replace']")),u.length!==f.length){console.warn("Mismatch of ajaxreplace nodes");return}for(r=0;r<u.length;r++)s=u[r].parentElement,s.insertBefore(f[r],u[r]),u[r].remove()}function d(){this.loading(!1)}function o(n){var t=n.querySelectorAll(".cms-repeater-placeholder"),u;if(t.length!==2||t[0].parentNode!==t[1].parentNode)throw new Error("Missing or invalid placeholders in the results.");var i=t[0].parentNode,r=[],f=Array.prototype.indexOf.call(i.childNodes,t[0]),e=Array.prototype.indexOf.call(i.childNodes,t[1]);for(u=f+1;u<e;u++)r.push(i.childNodes[u]);return r.length===0&&(r=Array.from(n.querySelectorAll("[data-item='nr']"))),[i,r,t[1]]}var s={ajaxreplace:!1,infinite:!1,increment:10,getsearch:null,searchDelay:250},h="button,input[type='submit'],input[type='button'],input[type='image']",t;n.prototype.getSearch=function(n){var t=document.getElementById(n),i;if(!t){console.error("Could not find control with an id of '"+n+"' to run getSearch");return}if(i=t.closest("form"),i){if(i===this.els.form){console.error("The remote search control is inside the same form as the AjaxRepeater.");return}}else{console.error("The remote search control needs to live inside a form.");return}this.els.search[n]=t;t.addEventListener("input",this.forwardSearch);t.addEventListener("change",this.forwardSearch);t.addEventListener("click",u.bind(this))};n.prototype.submit=function(n){this.state.lastSearch&&(this.state.lastSearch.abort(),this.state.lastSearch=null);var t=this.els.form.getAttribute("action"),i=new FormData(this.els.form),r=this.command(),u=this;return n||(n=function(n){w.call(u,n,r)}),USC.post(t,i,n,this.error)};n.prototype.loading=function(n){var i,t;if(n){this.element.classList.add("loading");for(i in this.els.search)t=this.els.search[i],t&&t.classList&&t.classList.add("loading")}else{this.element.classList.remove("loading");for(i in this.els.search)t=this.els.search[i],t&&t.classList&&t.classList.remove("loading")}};n.prototype.navigate=function(n,t){t===undefined&&(t=!0);var i=this.setSearchAmount("PagingID",n,t);i.length?(this.editid(""),i[0].trigger("change")):console.warn("Missing PagingID control, cannot navigate.")};n.prototype.more=function(n){if(this.options.ajaxreplace){this.command("More");this.navigate(1,!0);return}var t=this.setSearchAmount("ResultsPerPage",n||this.options.increment||10,!0);t.length?(this.editid(""),t[0].trigger("change")):console.warn("Missing ResultsPerPage control, cannot add more.")};n.prototype.add=function(n){this.editid(-1);this.command("Edit");this.options.popup.returnTo=n;var t=USC.dialog('<aside class="ui-loading"><\/aside>',this.options.popup),i=this,r=function(n){e.call(i,n,t)};this.submit(r)};n.prototype.edit=function(n){var t,i;if(!this.options.popup)throw new Error("Missing data-popup properties.");if(n){if(typeof n=="number")t=n;else if(n.closest){if(i=n.closest("[data-key]"),!i){console.warn("Need a data-key attribute to edit.");return}t=+i.getAttribute("data-key")}}else{console.warn("No item provided, cannot edit.");return}this.editid(t);this.command("Edit");this.options.popup.returnTo=n;var r=USC.dialog('<aside class="ui-loading"><\/aside>',this.options.popup),u=this,f=function(n){e.call(u,n,r);window.USE&&window.USE.Replace()};this.submit(f)};n.prototype.editid=function(n){var t=this.els.form.querySelector("#"+this.element.getAttribute("id")+"__edit_");if(t){if(n===undefined)return t.value;t.value=n}else throw new Error("Couldn't find edit input.");};n.prototype.command=function(n){var t=this.els.form.querySelector("#"+this.element.getAttribute("id")+"__command_");if(t){if(n===undefined)return t.value;t.value=n}else throw new Error("Couldn't find command input.");};n.prototype.datasource=function(n){var t=this.els.form.querySelector("#"+this.element.getAttribute("id")+"__datasource_");if(t){if(n===undefined)return t.value;t.value=n}else return};n.prototype.setSearchAmount=function(n,t,r){var u,f;if(t){for(u=this.element.querySelectorAll("input[name$='$"+n+"'][data-search]"),f=0;f<u.length;f++)i(u[f],t,r);return u}};n.prototype.addEmptyRows=function(n,t){n&&(this.setSearchAmount("AddEmptyRows",n,t),this.command("AddEmptyRows"),this.search())};n.prototype.reset=function(){var t=this.element.querySelectorAll("[data-search][name]"),i,n;r(t);for(i in this.els.search)n=this.els.search[i],n&&n.querySelectorAll&&(t=n.querySelectorAll("[data-search][name]"),r(t));this.state.last=null;this.search()};n.prototype.sort=function(n){var u=this.element.querySelector("input[name$='OrderBy'][data-search]"),t,f,e,i,r;if(!u){console.warn("Missing OrderBy control, cannot sort.");return}if(t=n.getAttribute("data-orderby"),!t){console.warn("Missing data-orderby value, cannot sort.");return}if(f=!1,n.classList.contains("ui-sort")){if(n.classList.contains("active"))n.classList.toggle("desc");else for(e=this.element.querySelectorAll("a.ui-sort[data-orderby]"),i=0;i<e.length;i++)r=e[i],r===n?r.classList.add("active"):r.classList.remove("active");f=n.classList.contains("desc")}this.setSearchAmount("PagingID",1);f&&(t+=" DESC");u.setValue(t);u.trigger("change")};t=["data-needspaging"];window.USC.ajaxRepeater=function(t){if(t instanceof HTMLElement){if(t.$ajaxRepeater){console.log("AjaxRepeater already initialized.");return}t.$ajaxRepeater=new n(t)}else throw new Error("Need an HTMLElement to initialize an AjaxRepeater.");};window.register&&window.register("usc/p/ajax-repeater")});
(() => { var el = document.getElementById('SmBoxyCanadaTerritoriesV1'); USC.onVisible( el, 0, () => { require2('usc/p/ajax-repeater',() => {USC.ajaxRepeater(document.getElementById('SmBoxyCanadaTerritoriesV1'))}); }); })();
(function(){window.NodeList&&!NodeList.prototype.contains&&(NodeList.prototype.contains=function(n){return Array.prototype.indexOf.call(this,n)>=0});window.HTMLCollection&&!HTMLCollection.prototype.contains&&(HTMLCollection.prototype.contains=function(n){return Array.prototype.indexOf.call(this,n)>=0});Element.prototype.trigger||(Element.prototype.trigger=function(n,t){var i={bubbles:!0,cancelable:!0};return t&&(i.detail=t),this.dispatchEvent(new window.CustomEvent(n,i))});Window.prototype.trigger||(Window.prototype.trigger=function(n,t){var i={};return t&&(i.detail=t),this.dispatchEvent(new window.CustomEvent(n,i))});window.register&&window.register("usc/p/usc-poly")})();
(function(){function s(n){for(var r,f,e,u,o={},i=n.querySelectorAll("input[type='checkbox'][data-required]"),t=0;t<i.length;t++)r=i[t].getAttribute("name"),o[r]=1;for(f=[],e=Object.keys(o),t=0;t<e.length;t++){var r=e[t],i=n.querySelectorAll("input[type='checkbox'][data-required][name='"+r+"']"),s=!1;for(u=0;u<i.length;u++)if(i[u].checked){s=!0;break}f.push({name:r,inputs:i,checked:s})}return f}function c(n){var t;if(n==="true")return!0;if(n==="false")return!1;if(n==="null")return null;if(isNaN(t=+n)||n!==String(t)){if(f.test(n))try{return o(n)}catch(i){}}else return t;return n}function e(n,t){var i=!1,r;if(t=c(t),t==="*")i=!!n;else if(typeof t=="boolean"){if(n){if(typeof n!="boolean")switch((""+n).toUpperCase()){case"1":case"YES":case"ON":case"TRUE":case"SUCCESS":n=!0;break;default:n=!1}}else n=!1;i=t===n}else if(typeof t=="number")i=t===+n;else if(t)if(Array.isArray(t)){for(r=0;r<t.length;r++)if(t[r]==n){i=!0;break}}else i=t==n;else i=!n;return i}var o=function(n,t){return(window.JSON2||JSON).parse(n,t)},i,r,f,t,n;if(Element.prototype.getValue||(Element.prototype.getValue=function(){var n,i,r=this.getAttribute("type"),t;if(r==="checkbox"||r==="radio")return this.checked?this.value:null;if(this.value===undefined||this.matches("li")){if(n=this.querySelectorAll("input[type='checkbox'],input[type='radio']"),n.length===0)return undefined;for(i=[],t=0;t<n.length;t++)n[t].checked&&i.push(n[t].value);return i.join(",")}return this.value}),Element.prototype.setValue||(Element.prototype.setValue=function(n){var t,i,r,e,o,h,s,c=this.getAttribute("type"),u,f;switch(c){case"checkbox":case"radio":this.checked=!!n;return;case"date":t="yyyy-MM-dd";break;case"time":t="HH:mm";break;case"datetime":t="o";break;case"datetime-local":t="yyyy-MM-dd\\THH:mm"}if(t)i=Date.parse2(n),this.value=i?i.formatted(t):n||"",this.getAttribute("data-timezone")&&this.setAttribute("data-datetime",i?i.toISOString():"");else if(this.value===undefined||this.matches("li")){if(r=this.querySelectorAll("input[type='checkbox'],input[type='radio']"),r.length)e=Array.isArray(n)?n:typeof n=="string"?n.split(","):[n];else return;for(u=0;u<r.length;u++){for(o=r[u],h=o.value,s=!1,f=0;f<e.length;f++)if(h==e[f]){s=!0;break}o.checked=s}}else this.value=n===null?"":n}),ValidityState.prototype.getType||(ValidityState.prototype.getType=function(){if(this.valid)return"valid";if(this.valueMissing)return"valueMissing";for(var n in this)if(this[n]===!0)return n}),HTMLInputElement.prototype.getLabel||(HTMLInputElement.prototype.getLabel=function(){var n,r,t=this.getAttribute("data-label"),i;if(!t)for(n=this.labels,n&&n.length||(r=this.closest("form")||this.ownerDocument,n=r.querySelectorAll("label[for='"+this.getAttribute("id")+"']")),i=0;i<n.length;i++)if(t=(n[i].textContent||"").trim(),t)break;return t}),HTMLFormElement.prototype._checkValidity||(HTMLFormElement.prototype._checkValidity=HTMLFormElement.prototype.checkValidity,HTMLFormElement.prototype.checkValidity=function(n){for(var u,f,i,r,e,o=s(this),t=0;t<o.length;t++)for(u=o[t],f=0;f<u.inputs.length;f++)i=u.inputs[f],i.checked||!u.checked?(i.required=!0,i.setAttribute("required","required")):(i.required=!1,i.removeAttribute("required"));for(r=this.querySelectorAll("input,select,textarea"),e=!0,n&&(n.inputs=r),t=0;t<r.length;t++)r[t].checkValidity()||(n&&!n.first&&(n.first=r[t]),e=!1);return this._checkValidity&&this._checkValidity.apply(this,arguments),e}),HTMLFormElement.prototype._reportValidity||(HTMLFormElement.prototype._reportValidity=HTMLFormElement.prototype.reportValidity,HTMLFormElement.prototype.reportValidity=function(){var n={},i=this.checkValidity(n);if(i)return i;if(n&&n.first&&window.USC&&window.USC.setTabs){var t=n.first.closest(".ui-tab-panel[data-tab]"),r=t&&t.getAttribute("data-tab"),u=r&&t.parentElement.closest(".ui-tabs");u&&!t.offsetHeight&&USC.setTabs(u,r)}if(n&&n.first&&window.USC&&window.USC.setTabbableActive&&USC.setTabbableActive(n.first),this._reportValidity&&this._reportValidity.apply(this,arguments),n&&n.first){var f=n.first.validity.getType(),e=n.first.closest("[data-validity]")||n.first.closest("li"),o=e&&e.querySelector("[data-validity='"+f+"'],[data-type='"+f+"']");if(o)try{n.first.focus()}catch(s){}}return i}),HTMLFormElement.prototype._reset||(HTMLFormElement.prototype._reset=HTMLFormElement.prototype.reset,HTMLFormElement.prototype.reset=function(){for(var n,i=this.querySelectorAll(".invalid,.valid,li[data-validity]"),t=0;t<i.length;t++)n=i[t],n.classList.remove("invalid"),n.classList.remove("valid"),n.getAttribute("data-validity")&&n.setAttribute("data-validity","");this._reset&&this._reset()}),i="button,input[type='submit'],input[type='button'],input[type='image']",typeof SubmitEvent=="undefined"&&(r=null,document.addEventListener("click",function(n){n.target.closest&&(r=n.target.closest(i))},!0),document.addEventListener("submit",function(n){var f,u,t;if(!n.submitter){for(f=[document.activeElement,r],u=0;u<f.length;u++)if((t=f[u],t)&&t.form&&t.matches(i)){n.submitter=t;return}n.submitter=n.target.querySelector(i)}},!0)),!HTMLFormElement.prototype.requestSubmit){if(typeof HTMLFormElement.prototype.requestSubmit=="function")return;HTMLFormElement.prototype.requestSubmit=function(n){n?(h(n,this),n.click()):(n=document.createElement("input"),n.type="submit",n.hidden=!0,this.appendChild(n),n.click(),this.removeChild(n))};function h(n,t){n instanceof HTMLElement||u(TypeError,"parameter 1 is not of type 'HTMLElement'");n.type=="submit"||u(TypeError,"The specified element is not a submit button");n.form==t||u(DOMException,"The specified element is not owned by this form element","NotFoundError")}function u(n,t,i){throw new n("Failed to execute 'requestSubmit' on 'HTMLFormElement': "+t+".",i);}}for(f=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,t=[HTMLInputElement.prototype,HTMLSelectElement.prototype,HTMLTextAreaElement.prototype],n=0;n<t.length;n++)t[n]._checkValidity||(t[n]._checkValidity=t[n].checkValidity,t[n].checkValidity=function(){var n=this.getAttribute("data-conditional"),t;if(n){try{n=this.ownerDocument.getElementById(n)}catch(f){n=null}if(n){var i=n.getValue(),r=this.getAttribute("data-conditional-value"),u=this.getAttribute("data-conditional-not-value");r!==null&&e(i,r)?(this.setAttribute("required","required"),this.required=!0):u===null||e(i,u)?(this.removeAttribute("required"),this.required=!1):(this.setAttribute("required","required"),this.required=!0)}}if(!this.validity.valueMissing){t=this.getAttribute("data-compare");try{t=this.ownerDocument.getElementById(t)}catch(f){t=null}t&&this.value!=t.value&&this.setCustomValidity("Value doesn't match.")}return this._checkValidity.apply(this,arguments)});window.register&&window.register("usc/p/form-proto")})();
window.USC||(window.USC={}),function(){var n=function(n,t){return(window.JSON2||JSON).parse(n,t)};USC.setTabs=function(n,t){var i,f;if(n&&n.querySelectorAll){!t&&n.classList.contains("ui-tab")&&(t=n.getAttribute("data-tab"),n=n.closest(".ui-tabs"));t&&t.getAttribute&&(i=t,t=i.getAttribute("data-tab")||"");var u=Array.from(n.querySelectorAll(".ui-tab")),h=u.find(function(n){return n.getAttribute("data-tab")===t&&n.matches(".ui-toggle.active")}),e=Array.from(n.querySelectorAll(".ui-tab-panel")),o=Array.from(n.querySelectorAll(".ui-tabs")),r=!h,c=function(n){for(var i,t=0;t<o.length;t++)if(i=o[t],i===n)continue;else if(i.contains(n))return!0},s=function(n){if(!c(n)){var u;i&&n===i?u=r:t&&n.getAttribute("data-tab")===t?(u=r,i=n):t==="*"&&n.classList.contains("ui-tab-panel")&&(u=r,i="");n.classList[u?"add":"remove"]("active")}};return u.forEach(s),e.forEach(s),r?n.setAttribute("data-activetab",t||""):n.removeAttribute("data-activetab"),f={name:t,tabs:u,panels:e},n.trigger&&n.trigger("tabbed",f),window.trigger("resize"),f}};USC.setConditionals=function(n){var t,u,i,r,f;if(n&&n.querySelectorAll&&(t=USC.getConditionalPanels(n),t)){for(u=USC.getConditionalValue(n),i=0;i<t.length;i++)r=t[i],f=USC.checkConditionalPanel(r,u),f?r.classList.add("active"):r.classList.remove("active");return window.trigger("resize"),{name:name,input:n,panels:t}}};USC.getConditionalValue=function(n){return n.getValue()};USC.getConditionalPanels=function(n){var i=n.closest(".ui-conditionals"),r=n.getAttribute("data-name"),t;if(i){if(!r){console.warn("Missing data-name attribute for ui-conditionals.",n);return}}else{console.warn("Missing ui-conditionals scope.",n);return}return t=i.querySelectorAll(".ui-conditional-panel[data-name='"+r+"']"),t.length>0?t:null};USC.checkConditionalPanel=function(n,t){var r=n.getAttribute("data-value"),u=n.getAttribute("data-notvalue"),f=n.getAttribute("data-hasvalue"),i;if(f!==null){if(!t)return!1;t=t.split(",");i=t&&t.indexOf(f)>-1}else u!==null?i=!USC.matching(t,u):r!==null&&(i=USC.matching(t,r));return i};USC.matching=function(t,i){if(i==="*")return!!t;if(t==="*")return!0;if(i){if(i.charAt(0)==="["&&i.charAt(i.length-1)==="]"){i=n(i);for(var r=0;r<i.length;r++)if(i[r]==t)return!0;return!1}return i==t}return!t};window.register&&window.register("usc/p/behaviors")}();
window.USC||(window.USC={});require2(["usc/p/usc-poly","usc/p/form-proto","usc/p/behaviors"],function(){function i(n){var i,u,f;if(n.target.classList.contains("ui-conditional")&&(USC.setConditionals(n.target),n.stopPropagation()),n.detail&&n.detail.originalEvent&&(n=n.detail.originalEvent),n.target&&n.target.validity)n.target.validity.customError&&n.target.setCustomValidity("");else return;if(n.target.matches("input[type='checkbox'][data-required]")){var o=n.target.getAttribute("name"),r=this.form.querySelectorAll("input[type='checkbox'][data-required][name='"+o+"']"),e=!1;for(i=0;i<r.length;i++)if(r[i].checked){e=!0;break}for(i=0;i<r.length;i++)u=r[i],!e||u.checked?(u.required=!0,u.setAttribute("required","required")):(u.required=!1,u.removeAttribute("required"))}if(f=t(n.target),n.target.value?f.classList.add("filled"):f.classList.remove("filled"),n.target.getAttribute("data-ga-search")){const n=f.querySelector('[data-ga-target="googleaddress"]');n&&(n.checked=!1)}n.target.checkValidity&&n.target.checkValidity()&&(r&&r.length?r.forEach(function(n){n.trigger("invalid")}):n.target.trigger("invalid"))}function r(n){var r,i,u;if(n.target!==this.form&&(r=n.target.validity,r)){if(i=t(n.target),r.valid){i.classList.remove("invalid");i.classList.add("valid");i.getAttribute("data-validity")!==null&&i.setAttribute("data-validity","valid");return}return u=r.getType(),i.classList.remove("valid"),i.classList.add("invalid"),i.setAttribute("data-validity",u||""),i.querySelector("[data-validity='"+u+"'],.validation[data-type='"+u+"']")?n.preventDefault():r.valueMissing&&n.target.hasAttribute("data-valuemissing")?n.target.setCustomValidity(n.target.getAttribute("data-valuemissing")):r.patternMismatch&&n.target.hasAttribute("data-patternmismatch")&&n.target.setCustomValidity(n.target.getAttribute("data-patternmismatch")),!1}}function u(n){if(this.$last&&!this.$last.attributes.formnovalidate&&!this.form.checkValidity())return this.form.reportValidity(),n.preventDefault(),!1;if(!this.$last||!this.$last.attributes["data-noloading"]){this.form.classList.add("loading");var t=this.form.querySelectorAll(USC.BUTTONS_SELECTOR);setTimeout(function(){for(var i,n=0;n<t.length;n++)i=t[n],i.setAttribute("disabled","disabled"),i.disabled=!0},1)}}function f(n){this.$last=n.target.closest(USC.BUTTONS_SELECTOR);this.$last&&this.$ffd6&&(this.$ffd6.value=(new Date).getTime());!this.$last||this.$last.attributes.formnovalidate||this.form.reportValidity()||n.preventDefault()}function n(n){if(n.target&&n.target.matches("input, label, textarea, select")){var t=n.target.closest("li")||n.target.closest(".input-text")||n.target;n.type==="focusin"?t.classList.add("focused"):t.classList.remove("focused")}}function t(n){var t=n.closest(".input-suggest");return t&&(n=t),n.closest("[data-validity]")||n.closest("li")||n}function e(t){this.form=t;t.addEventListener("change",i.bind(this));t.addEventListener("invalid",r.bind(this),!0);t.addEventListener("submit",u.bind(this));t.addEventListener("click",f.bind(this));t.addEventListener("focusin",n.bind(this));t.addEventListener("focusout",n.bind(this));var e=t.querySelector("input[id$='_FFD6']");e&&(e.value=(new Date).getTime(),this.$ffd6=e)}USC.BUTTONS_SELECTOR="button[type='submit'],input[type='submit'],input[type='image']";window.USC.form=function(n){if(n instanceof HTMLFormElement){if(n.$form){console.warn("FormControl already initialized.");return}n.$form=new e(n)}else throw new Error("Need an HTMLFormElement to initialize a FormControl.");};window.register&&window.register("usc/p/usc-form")});
(() => { var el = document.getElementById('Form_SmBoxyCanadaTerritoriesV1'); USC.onVisible( el, 0, () => { require2(['usc/p/usc-form'],() => { USC.form( el ) }) }); })();
window.USC||(window.USC={}),function(){function n(){if(this.value&&r.test(this.value)){if(this.value=t(this.value),this.value.length<=6){var n=this.value.indexOf(")");this.setSelectionRange(n,n)}}else this.value=""}function t(n){return(n||"").replace(u,"").replace(f,"").replace(e,"($1) $2-$3").replace(o,"").substring(0,14)}function i(){for(var t,r=document.querySelectorAll(".phone-mask"),i=0;i<r.length;i++)t=r[i],t.$phoneFormat||(t.addEventListener("input",n),t.$phoneFormat=!0),n.call(t)}var r=/\d+/,u=/\D/g,f=/^1/g,e=/(\d{0,3})(\d{0,3})(\d{0,4})/,o=/-+$/;i();window.USC.phoneFormat=n;window.USC.formatPhoneInputs=i;window.USC.formatPhoneNumber=t;window.register&&window.register("usc/p/phone-format")}();
(() => { var el = document.getElementById('Form_SmLclContactV17'); USC.onVisible( el, 0, () => { require2(['usc/p/usc-form'],() => { USC.form( el ) }) }); })();