diff --git a/dist/bpc-web-components.js b/dist/bpc-web-components.js index 8d2ddb1..43679eb 100644 --- a/dist/bpc-web-components.js +++ b/dist/bpc-web-components.js @@ -1 +1 @@ -var an=Object.defineProperty;var sn=(O,g,I)=>g in O?an(O,g,{enumerable:!0,configurable:!0,writable:!0,value:I}):O[g]=I;var q=(O,g,I)=>sn(O,typeof g!="symbol"?g+"":g,I);(function(){"use strict";var O,g,I,U,xe,we,Ce,Se,se,_e,ce,Z={},ke=[],dt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function $(e,t){for(var n in t)e[n]=t[n];return e}function de(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function K(e,t,n){var o,i,r,l={};for(r in t)r=="key"?o=t[r]:r=="ref"?i=t[r]:l[r]=t[r];if(arguments.length>2&&(l.children=arguments.length>3?O.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)l[r]===void 0&&(l[r]=e.defaultProps[r]);return J(e,l,o,i,null)}function J(e,t,n,o,i){var r={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++I,__i:-1,__u:0};return i==null&&g.vnode!=null&&g.vnode(r),r}function P(e){return e.children}function z(e,t){this.props=e,this.context=t}function H(e,t){if(t==null)return e.__?H(e.__,e.__i+1):null;for(var n;ts&&U.sort(Ce),e=U.shift(),s=U.length,e.__d&&(n=void 0,o=void 0,i=(o=(t=e).__v).__e,r=[],l=[],t.__P&&((n=$({},o)).__v=o.__v+1,g.vnode&&g.vnode(n),pe(t.__P,n,o,t.__n,t.__P.namespaceURI,32&o.__u?[i]:null,r,i??H(o),!!(32&o.__u),l),n.__v=o.__v,n.__.__k[n.__i]=n,Ee(r,n,l),o.__e=o.__=null,n.__e!=i&&Ne(n)));Q.__r=0}function Me(e,t,n,o,i,r,l,s,d,_,u){var a,y,h,v,x,b,p,m=o&&o.__k||ke,L=t.length;for(d=pt(n,t,m,d,L),a=0;a0?J(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=e,l.__b=e.__b+1,s=null,(_=l.__i=ut(l,n,d,a))!=-1&&(a--,(s=n[_])&&(s.__u|=2)),s==null||s.__v==null?(_==-1&&(i>u?y--:id?y--:y++,l.__u|=4))):e.__k[r]=null;if(a)for(r=0;r(u?1:0)){for(i=n-1,r=n+1;i>=0||r=0?i--:r++])!=null&&(2&_.__u)==0&&s==_.key&&d==_.type)return l}return-1}function Be(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||dt.test(t)?n:n+"px"}function te(e,t,n,o,i){var r,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Be(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Be(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Se,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o?n.u=o.u:(n.u=se,e.addEventListener(t,r?ce:_e,r)):e.removeEventListener(t,r?ce:_e,r);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ae(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=se++;else if(t.t0?e:Y(e)?e.map(Oe):$({},e)}function ht(e,t,n,o,i,r,l,s,d){var _,u,a,y,h,v,x,b=n.props,p=t.props,m=t.type;if(m=="svg"?i="http://www.w3.org/2000/svg":m=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(_=0;_=n.__.length&&n.__.push({}),n.__[e]}function A(e){return X=1,gt(Ve,e)}function gt(e,t,n){var o=oe(W++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Ve(void 0,t),function(s){var d=o.__N?o.__N[0]:o.__[0],_=o.t(d,s);d!==_&&(o.__N=[_,o.__[1]],o.__c.setState({}))}],o.__c=N,!N.__f)){var i=function(s,d,_){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(y){return!!y.__c});if(u.every(function(y){return!y.__N}))return!r||r.call(this,s,d,_);var a=o.__c.props!==s;return u.forEach(function(y){if(y.__N){var h=y.__[0];y.__=y.__N,y.__N=void 0,h!==y.__[0]&&(a=!0)}}),r&&r.call(this,s,d,_)||a};N.__f=!0;var r=N.shouldComponentUpdate,l=N.componentWillUpdate;N.componentWillUpdate=function(s,d,_){if(this.__e){var u=r;r=void 0,i(s,d,_),r=u}l&&l.call(this,s,d,_)},N.shouldComponentUpdate=i}return o.__N||o.__}function j(e,t){var n=oe(W++,3);!M.__s&&Fe(n.__H,t)&&(n.__=e,n.u=t,N.__H.__h.push(n))}function F(e){return X=5,ie(function(){return{current:e}},[])}function ie(e,t){var n=oe(W++,7);return Fe(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function V(e,t){return X=8,ie(function(){return e},t)}function mt(){var e=oe(W++,11);if(!e.__){for(var t=N.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function yt(){for(var e;e=$e.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(re),e.__H.__h.forEach(ge),e.__H.__h=[]}catch(t){e.__H.__h=[],M.__e(t,e.__v)}}M.__b=function(e){N=null,ze&&ze(e)},M.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),We&&We(e,t)},M.__r=function(e){Ie&&Ie(e),W=0;var t=(N=e.__c).__H;t&&(fe===N?(t.__h=[],N.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(re),t.__h.forEach(ge),t.__h=[],W=0)),fe=N},M.diffed=function(e){Ue&&Ue(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($e.push(t)!==1&&Re===M.requestAnimationFrame||((Re=M.requestAnimationFrame)||vt)(yt)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),fe=N=null},M.__c=function(e,t){t.some(function(n){try{n.__h.forEach(re),n.__h=n.__h.filter(function(o){return!o.__||ge(o)})}catch(o){t.some(function(i){i.__h&&(i.__h=[])}),t=[],M.__e(o,n.__v)}}),De&&De(e,t)},M.unmount=function(e){He&&He(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{re(o)}catch(i){t=i}}),n.__H=void 0,t&&M.__e(t,n.__v))};var je=typeof requestAnimationFrame=="function";function vt(e){var t,n=function(){clearTimeout(o),je&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);je&&(t=requestAnimationFrame(n))}function re(e){var t=N,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),N=t}function ge(e){var t=N;e.__c=e.__(),N=t}function Fe(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Ve(e,t){return typeof t=="function"?t(e):t}function bt(e,t){for(var n in t)e[n]=t[n];return e}function Ge(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function qe(e,t){this.props=e,this.context=t}(qe.prototype=new z).isPureReactComponent=!0,qe.prototype.shouldComponentUpdate=function(e,t){return Ge(this.props,e)||Ge(this.state,t)};var Ze=g.__b;g.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ze&&Ze(e)};var xt=g.__e;g.__e=function(e,t,n,o){if(e.then){for(var i,r=t;r=r.__;)if((i=r.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}xt(e,t,n,o)};var Ye=g.unmount;function Ke(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=bt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return Ke(o,t,n)})),e}function Xe(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return Xe(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function me(){this.__u=0,this.o=null,this.__b=null}function Je(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function le(){this.i=null,this.l=null}g.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ye&&Ye(e)},(me.prototype=new z).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var i=Je(o.__v),r=!1,l=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=l;var s=function(){if(!--o.__u){if(o.state.__a){var d=o.state.__a;o.__v.__k[0]=Xe(d,d.__c.__P,d.__c.__O)}var _;for(o.setState({__a:o.__b=null});_=o.o.pop();)_.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},me.prototype.componentWillUnmount=function(){this.o=[]},me.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Ke(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&K(P,null,e.fallback);return i&&(i.__u&=-33),[K(P,null,t.__a?null:e.children),i]};var Qe=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.h.removeChild(i)}}}ne(K(wt,{context:t.context},e.__v),t.v)}function et(e,t){var n=K(Ct,{__v:e,h:t});return n.containerInfo=t,n}(le.prototype=new z).__a=function(e){var t=this,n=Je(t.__v),o=t.l.get(e);return o[0]++,function(i){var r=function(){t.props.revealOrder?(o.push(i),Qe(t,e,o)):i()};n?n(r):r()}},le.prototype.render=function(e){this.i=null,this.l=new Map;var t=ee(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},le.prototype.componentDidUpdate=le.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Qe(e,n,t)})};var St=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,kt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Nt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Lt=/[A-Z0-9]/g,Mt=typeof document<"u",Tt=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Bt(e,t,n){return t.__k==null&&(t.textContent=""),ne(e,t),typeof n=="function"&&n(),e?e.__c:null}z.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(z.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var tt=g.event;function At(){}function Et(){return this.cancelBubble}function Ot(){return this.defaultPrevented}g.event=function(e){return tt&&(e=tt(e)),e.persist=At,e.isPropagationStopped=Et,e.isDefaultPrevented=Ot,e.nativeEvent=e};var Pt={enumerable:!1,configurable:!0,get:function(){return this.class}},nt=g.vnode;g.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,i={},r=o.indexOf("-")===-1;for(var l in n){var s=n[l];if(!(l==="value"&&"defaultValue"in n&&s==null||Mt&&l==="children"&&o==="noscript"||l==="class"||l==="className")){var d=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&s===!0?s="":d==="translate"&&s==="no"?s=!1:d[0]==="o"&&d[1]==="n"?d==="ondoubleclick"?l="ondblclick":d!=="onchange"||o!=="input"&&o!=="textarea"||Tt(n.type)?d==="onfocus"?l="onfocusin":d==="onblur"?l="onfocusout":Nt.test(l)&&(l=d):d=l="oninput":r&&kt.test(l)?l=l.replace(Lt,"-$&").toLowerCase():s===null&&(s=void 0),d==="oninput"&&i[l=d]&&(l="oninputCapture"),i[l]=s}}o=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ee(n.children).forEach(function(_){_.props.selected=i.value.indexOf(_.props.value)!=-1})),o=="select"&&i.defaultValue!=null&&(i.value=ee(n.children).forEach(function(_){_.props.selected=i.multiple?i.defaultValue.indexOf(_.props.value)!=-1:i.defaultValue==_.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",Pt)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),t.props=i})(e),e.$$typeof=St,nt&&nt(e)};var ot=g.__r;g.__r=function(e){ot&&ot(e),e.__c};var it=g.diffed;g.diffed=function(e){it&&it(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};function Rt(e){return!!e.__k&&(ne(null,e),!0)}var $t=P,zt=0;function c(e,t,n,o,i,r){t||(t={});var l,s,d=t;if("ref"in d)for(s in d={},t)s=="ref"?l=t[s]:d[s]=t[s];var _={type:e,props:d,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--zt,__i:-1,__u:0,__source:i,__self:r};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)d[s]===void 0&&(d[s]=l[s]);return g.vnode&&g.vnode(_),_}function It(e){return{render:function(t){Bt(t,e)},unmount:function(){Rt(e)}}}const Ut=e=>{if(window.google=window.google||{},window.google.maps=window.google.maps||{},window.google.maps.importLibrary)return;const t=new Set(e.libraries||[]),n=new URLSearchParams;let o=null;const i=()=>o||(o=new Promise((r,l)=>{const s=document.createElement("script");n.set("libraries",Array.from(t).join(","));for(const d in e)n.set(d.replace(/[A-Z]/g,_=>`_${_[0].toLowerCase()}`),e[d]);n.set("callback","google.maps.__ib__"),s.src=`https://maps.googleapis.com/maps/api/js?${n.toString()}`,window.google.maps.__ib__=r,s.onerror=()=>l(Error("Google Maps could not load.")),s.nonce=document.querySelector("script[nonce]")?.nonce||"",document.head.append(s)}),o);window.google.maps.importLibrary||(window.google.maps.importLibrary=(r,...l)=>t.add(r)&&i().then(()=>window.google.maps.importLibrary(r,...l)))};function Dt(e,t=!1,n=!1){return fetch("https://account.basepowercompany.com/api/address-router",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selection:e,confirm_address:t,is_energy_only:n})}).then(o=>o.json()).catch(o=>({success:!1,error:o instanceof Error?o.message:"Unknown error"}))}function Ht(e,t){return fetch("https://account.basepowercompany.com/api/utility-select",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({utilityName:e,externalId:t})})}function Wt(e){if(!e.formattedAddress||!e.addressComponents)return;const t=e.addressComponents.reduce((r,l)=>(l.types.forEach(s=>{r[s]=l}),r),{}),n=[t.street_number?.longText,t.route?.longText,t.subpremise?.longText].filter(Boolean).join(" "),o=[t.locality?.longText,t.sublocality?.longText,t.administrative_area_level_2?.longText].filter(Boolean)[0]||"",i={line1:n,city:o,state:t.administrative_area_level_1?.shortText||"",postalCode:t.postal_code?.longText||"",country:t.country?.shortText||"",latitude:e.location?.lat(),longitude:e.location?.lng()};return{formattedAddress:e.formattedAddress,address:i}}const E=(e,t)=>{typeof window<"u"&&window.posthog&&window.posthog.capture(e,t)},f={utilityModal:"_utilityModal_1ga8t_2",utilityModalContent:"_utilityModalContent_1ga8t_13",utilityModalImage:"_utilityModalImage_1ga8t_21",backButton:"_backButton_1ga8t_28",utilityModalBody:"_utilityModalBody_1ga8t_47",utilityModalBodyContent:"_utilityModalBodyContent_1ga8t_55",utilitySelectContent:"_utilitySelectContent_1ga8t_62",addressLabel:"_addressLabel_1ga8t_68",utilityModalTitle:"_utilityModalTitle_1ga8t_77",utilityModalSubtitle:"_utilityModalSubtitle_1ga8t_86",utilityOptions:"_utilityOptions_1ga8t_92",utilityOption:"_utilityOption_1ga8t_92",utilityLogo:"_utilityLogo_1ga8t_120",utilityName:"_utilityName_1ga8t_126",helpSection:"_helpSection_1ga8t_132",helpTitle:"_helpTitle_1ga8t_136",helpText:"_helpText_1ga8t_143",helpContact:"_helpContact_1ga8t_150",utilityOptionInner:"_utilityOptionInner_1ga8t_166",enteredAddressSection:"_enteredAddressSection_1ga8t_175",addressLabelSmall:"_addressLabelSmall_1ga8t_179",addressLabelBold:"_addressLabelBold_1ga8t_188",addressSelectContent:"_addressSelectContent_1ga8t_196",addressOptions:"_addressOptions_1ga8t_202",addressOption:"_addressOption_1ga8t_202",addressOptionSelected:"_addressOptionSelected_1ga8t_222",addressRadio:"_addressRadio_1ga8t_227",radioCircle:"_radioCircle_1ga8t_231",radioCircleSelected:"_radioCircleSelected_1ga8t_241",radioCircleInner:"_radioCircleInner_1ga8t_245",addressText:"_addressText_1ga8t_252",addressLine1Existing:"_addressLine1Existing_1ga8t_256",addressLine2Existing:"_addressLine2Existing_1ga8t_263",addressLine1Original:"_addressLine1Original_1ga8t_270",addressLine2Original:"_addressLine2Original_1ga8t_277",recommendedBadge:"_recommendedBadge_1ga8t_284",continueButton:"_continueButton_1ga8t_296",splashOverlay:"_splashOverlay_1ga8t_391",splashCard:"_splashCard_1ga8t_401",splashSpinnerWrapper:"_splashSpinnerWrapper_1ga8t_412",splashSpinner:"_splashSpinner_1ga8t_412",splashCardContent:"_splashCardContent_1ga8t_429",splashTextGroup:"_splashTextGroup_1ga8t_437",splashTitle:"_splashTitle_1ga8t_445",splashSubtitle:"_splashSubtitle_1ga8t_454",splashSteps:"_splashSteps_1ga8t_463",splashStep:"_splashStep_1ga8t_463",splashStepLabel:"_splashStepLabel_1ga8t_475",splashStepLabelComplete:"_splashStepLabelComplete_1ga8t_496"};function jt({onClick:e}){return c("button",{type:"button",className:f.backButton,onClick:e,"aria-label":"Go back",children:c("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:c("path",{d:"M19 12H5M5 12L12 19M5 12L12 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}function rt({onBack:e,children:t}){return c("div",{className:f.utilityModal,children:[c("div",{className:f.utilityModalContent,children:[c(jt,{onClick:e}),c("div",{className:f.utilityModalBody,children:c("div",{className:f.utilityModalBodyContent,children:t})})]}),c("div",{className:f.utilityModalImage})]})}function Ft(){return c("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:c("path",{d:"M5 12H19M19 12L12 5M19 12L12 19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function lt({selected:e}){return c("div",{className:f.addressRadio,children:c("div",{className:`${f.radioCircle} ${e?f.radioCircleSelected:""}`,children:e&&c("div",{className:f.radioCircleInner})})})}function Vt({address:e,addressOptions:t,onSelectAddress:n,onBack:o}){const[i,r]=A("existing"),l=t.existingAddress,s=t.originalAddress,d=()=>{const a=i==="existing"?l:s;E("address_search_address_selection_confirmed",{selectionType:i,selectedAddress:a.formattedAddress}),n(a)},_=a=>a.address.line1,u=a=>`${a.address.city}, ${a.address.state} ${a.address.postalCode}`;return c(rt,{onBack:o,children:[c("div",{className:f.enteredAddressSection,children:[c("p",{className:f.addressLabelSmall,children:"YOU ENTERED:"}),c("p",{className:f.addressLabelBold,children:e})]}),c("div",{className:f.addressSelectContent,children:[c("h1",{className:f.utilityModalTitle,children:"We found 2 possible addresses:"}),c("p",{className:f.utilityModalSubtitle,children:"Help us find the right serviceable address for your home."}),c("div",{className:f.addressOptions,children:[c("button",{type:"button",className:`${f.addressOption} ${i==="existing"?f.addressOptionSelected:""}`,onClick:()=>r("existing"),children:[c(lt,{selected:i==="existing"}),c("div",{className:f.addressText,children:[c("p",{className:f.addressLine1Existing,children:_(l)}),c("p",{className:f.addressLine2Existing,children:u(l)})]}),c("span",{className:f.recommendedBadge,children:"RECOMMENDED"})]}),c("button",{type:"button",className:`${f.addressOption} ${i==="original"?f.addressOptionSelected:""}`,onClick:()=>r("original"),children:[c(lt,{selected:i==="original"}),c("div",{className:f.addressText,children:[c("p",{className:f.addressLine1Original,children:_(s)}),c("p",{className:f.addressLine2Original,children:u(s)})]})]})]}),c("button",{type:"button",className:f.continueButton,onClick:d,children:["Continue",c(Ft,{})]})]})]})}function Gt(){return c("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:[c("path",{d:"M25.2636 15.0004C25.2636 20.6686 20.6686 25.2636 15.0004 25.2636C9.33223 25.2636 4.73725 20.6686 4.73725 15.0004C4.73725 9.33223 9.33223 4.73725 15.0004 4.73725C20.6686 4.73725 25.2636 9.33223 25.2636 15.0004Z",fill:"#B2DD79"}),c("path",{d:"M23.4873 15.0004C23.4873 10.3133 19.6876 6.51357 15.0004 6.51357C10.3133 6.51357 6.51357 10.3133 6.51357 15.0004C6.51357 19.6876 10.3133 23.4873 15.0004 23.4873C19.6876 23.4873 23.4873 19.6876 23.4873 15.0004ZM27.0399 15.0004C27.0399 21.6496 21.6496 27.0399 15.0004 27.0399C8.35119 27.0399 2.96094 21.6496 2.96094 15.0004C2.96094 8.35119 8.35119 2.96094 15.0004 2.96094C21.6496 2.96094 27.0399 8.35119 27.0399 15.0004Z",fill:"#B2DD79"}),c("path",{d:"M23.4478 15.0004C23.4478 10.3351 19.6658 6.55304 15.0004 6.55304C10.3351 6.55304 6.55304 10.3351 6.55304 15.0004C6.55304 19.6658 10.3351 23.4478 15.0004 23.4478V25.2636C9.33223 25.2636 4.73725 20.6686 4.73725 15.0004C4.73725 9.33223 9.33223 4.73725 15.0004 4.73725C20.6686 4.73725 25.2636 9.33223 25.2636 15.0004C25.2636 20.6686 20.6686 25.2636 15.0004 25.2636V23.4478C19.6658 23.4478 23.4478 19.6658 23.4478 15.0004Z",fill:"#1E4D2B"}),c("path",{d:"M19.1876 10.9094C19.485 10.5187 20.0428 10.4429 20.4335 10.7403C20.8243 11.0376 20.9 11.5954 20.6027 11.9861L15.1261 19.1832C14.3108 20.2546 12.7377 20.3609 11.7857 19.4089L9.39808 17.0213C9.05089 16.6741 9.05089 16.1112 9.39808 15.764C9.74527 15.4168 10.3082 15.4168 10.6554 15.764L13.043 18.1516C13.2334 18.342 13.5481 18.3208 13.7111 18.1065L19.1876 10.9094Z",fill:"#1E4D2B"})]})}function qt(){return c("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none","aria-hidden":"true",children:c("circle",{cx:"15",cy:"15",r:"14",stroke:"#d8d7d5",strokeWidth:"1"})})}const Zt=1e3,ye=["Verifying address","Checking utility","Preparing report"];function Yt({address:e,redirectUrl:t,onRedirect:n}){const[o,i]=A(0),r=F(!1);return j(()=>{E("energy_only_splash_shown",{address:e});let l;const s=ye.map((d,_)=>setTimeout(()=>{i(_+1),_===ye.length-1&&!r.current&&(r.current=!0,E("energy_only_splash_redirect",{redirectUrl:t}),l=setTimeout(()=>n(t),300))},Zt*(_+1)));return()=>{s.forEach(clearTimeout),clearTimeout(l)}},[e,t,n]),c("div",{className:f.splashOverlay,children:c("div",{className:f.splashCard,children:[c("div",{className:f.splashSpinnerWrapper,children:c("div",{className:f.splashSpinner,"aria-hidden":"true"})}),c("div",{className:f.splashCardContent,children:[c("div",{className:f.splashTextGroup,children:[c("p",{className:f.splashTitle,children:"Calculating your savings..."}),c("p",{className:f.splashSubtitle,children:"This only takes a moment."})]}),c("div",{className:f.splashSteps,children:ye.map((l,s)=>{const d=s{const s=l.value,d=n.find(_=>_.value===s);if(!d){E("address_search_modal_selection_not_found",{addressSelected:e,utility:s,utilityOptions:n});return}if(s==="DEREG"){E("address_search_modal_selection_utility_other",{addressSelected:e,utility:s,multipleResult:d}),o(d.redirectUrl);return}if(!t){E("address_search_multiple_result_unreachable_external_address_id_not_found",{addressSelected:e,utility:s,externalAddressId:t});return}try{await Ht(s,t),E("address_search_set_utility_confirmed_success",{addressSelected:e,utility:s,externalAddressId:t})}catch(_){E("address_search_set_utility_confirmed_error",{addressSelected:e,utility:s,externalAddressId:t}),console.error("Error setting utility user confirmed",_)}o(d.redirectUrl)};return c(rt,{onBack:i,children:[c("div",{children:[c("p",{className:f.addressLabel,children:e}),c("h1",{className:f.utilityModalTitle,children:"Who's your local utility?"}),c("p",{className:f.utilityModalSubtitle,children:"So we can show the right plan and next steps for this address."})]}),c("div",{className:f.utilitySelectContent,children:[c("div",{className:f.utilityOptions,children:n.map(l=>{const s=Kt[l.value];return c("button",{type:"button",className:f.utilityOption,onClick:()=>r(l),children:c("div",{className:f.utilityOptionInner,children:[c("p",{className:f.utilityName,children:l.name}),s&&c("img",{src:s,alt:`${l.name} logo`,className:f.utilityLogo})]})},l.name)})}),c("div",{className:f.helpSection,children:[c("p",{className:f.helpTitle,children:"Not sure?"}),c("p",{className:f.helpText,children:'Look at your bill for the "Delivery" or "TDU" section'}),c("p",{className:f.helpText,children:"Search your inbox for outage texts or alerts"}),c("p",{className:f.helpContact,children:["Still can't find it? Email us:"," ",c("a",{href:"mailto:team@basepowercompany.com",children:"team@basepowercompany.com"})]})]})]})]})}function Jt({address:e,externalAddressId:t,multipleAddressOptions:n,multipleUtilityOptions:o,energySplashRedirectUrl:i,onSelectAddress:r,onTriggerRedirect:l,onBack:s}){return n?c(Vt,{address:e,addressOptions:n,onSelectAddress:r,onBack:s}):o?c(Xt,{address:e,externalAddressId:t,utilityOptions:o,onTriggerRedirect:l,onBack:s}):i?c(Yt,{address:e,redirectUrl:i,onRedirect:l,onBack:s}):null}const Qt=e=>{const[t,n]=A(null);return j(()=>{window.google.maps.importLibrary(e).then(o=>{n(o)})},[e]),t},ae=(...e)=>e.filter(Boolean).join(" "),B={autocomplete:"_autocomplete_gbolv_11",input:"_input_gbolv_15",placeholder:"_placeholder_gbolv_28",inputContainer:"_inputContainer_gbolv_37",activated:"_activated_gbolv_51",inputPositioner:"_inputPositioner_gbolv_55",mapPin:"_mapPin_gbolv_62",activateButton:"_activateButton_gbolv_70",mobileBtn:"_mobileBtn_gbolv_119",overlay:"_overlay_gbolv_129",results:"_results_gbolv_139",result:"_result_gbolv_139"};function ve({title:e,className:t,...n}){return c("button",{type:"button",className:ae(B.activateButton,t),tabIndex:-1,...n,children:e})}function at(e){return c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"#0c9953",viewBox:"0 0 20 20",...e,children:[c("title",{children:"Map pin"}),c("path",{d:"M10 1.458a6.875 6.875 0 0 0-6.875 6.875c0 2.666 1.729 5.222 3.579 7.175A24.7 24.7 0 0 0 10 18.402a24.724 24.724 0 0 0 3.296-2.895c1.85-1.952 3.579-4.508 3.579-7.174A6.875 6.875 0 0 0 10 1.458m0 17.709-.347.52-.002-.002-.005-.003-.019-.013-.067-.046-.248-.176a25.979 25.979 0 0 1-3.516-3.08c-1.9-2.005-3.921-4.866-3.921-8.034a8.125 8.125 0 1 1 16.25 0c0 3.168-2.021 6.029-3.921 8.034a26 26 0 0 1-3.516 3.08 16 16 0 0 1-.315.222l-.019.013-.005.003-.001.001zm0 0 .347.52a.63.63 0 0 1-.694 0z"}),c("path",{d:"M10 6.458a1.875 1.875 0 1 0 0 3.75 1.875 1.875 0 0 0 0-3.75M6.875 8.333a3.125 3.125 0 1 1 6.25 0 3.125 3.125 0 0 1-6.25 0"})]})}function en({zIndex:e,ref:t,value:n,placeholder:o,onChange:i,results:r,onSelect:l,portalRoot:s,close:d,open:_,overlayPosition:u,isActivated:a,cta:y}){const h=F(null),[v,x]=A(-1),b=mt();j(()=>{x(0)},[r]);const p=a&&r.length>0,m=ie(()=>{if(!(!p||v<0))return`${b}-option-${r[v]?.id}`},[p,v,b,r]);function L(w){const C=r[w];C&&(i(C.mainText),l?.({result:C}),t.current?.blur(),d())}function T(w){if(!p){w.key==="ArrowDown"&&r.length>0&&(w.preventDefault(),_(),x(0)),w.key==="Escape"&&(w.preventDefault(),t.current?.blur());return}switch(w.key){case"ArrowDown":{w.preventDefault(),x(C=>CC>0?C-1:r.length-1);break}case"ArrowRight":{w.preventDefault(),i(r[v]?.mainText||"");break}case"Home":{w.preventDefault(),x(0);break}case"End":{w.preventDefault(),x(r.length-1);break}case"Enter":{v>=0&&(w.preventDefault(),L(v));break}case"Escape":{w.preventDefault(),x(-1),i(""),n||d();break}}}return et(c(P,{children:[c("div",{className:B.overlay,style:{display:a?"block":"none"}}),c("div",{className:B.inputPositioner,style:{...u||{},zIndex:a?1001:e},children:[p&&c("div",{ref:h,id:b,className:B.results,role:"listbox","aria-label":"Suggestions",onMouseDown:w=>w.preventDefault(),children:r.map((w,C)=>{const S=C===v,k=`${b}-option-${w.id}`;return c("div",{id:k,role:"option","aria-selected":S,className:ae(B.result,S&&B.resultActive),onMouseDown:D=>D.preventDefault(),onClick:()=>L(C),onMouseEnter:()=>x(C),tabIndex:-1,children:[w.mainText,c("span",{children:w.secondaryText})]},w.id)})}),c("div",{className:B.inputContainer,children:[c("input",{name:"address-search",ref:t,value:n,onChange:w=>{i(w.target.value)},placeholder:o,autoComplete:"home street-address",className:B.input,onFocus:_,onBlur:d,onKeyDown:T,role:"combobox","aria-expanded":p,"aria-controls":p?b:void 0,"aria-activedescendant":m,"aria-autocomplete":"list"}),c(at,{className:B.mapPin}),!!y&&!a&&c(ve,{title:y,onClick:_})]})]})]}),s)}function tn({zIndex:e,value:t,placeholder:n,cta:o,onChange:i,results:r,onSelect:l,portalRoot:s}){const d=F(null),_=F(null),[u,a]=A(!1),[y,h]=A(null),v=V(()=>{const b=d.current;if(!b)return;const p=b.getBoundingClientRect();h({top:p.top+window.scrollY,left:p.left+window.scrollX,right:p.right+window.scrollX,bottom:p.bottom+window.scrollY,width:p.width,height:p.height})},[]);function x(){v(),a(!0),_.current?.focus()}return j(()=>{const b=d.current;if(!b)return;const p=new ResizeObserver(v);p.observe(b),window.addEventListener("resize",v);let m=null,L=0,T=0;const w=()=>{const C=b.getBoundingClientRect(),S=C.top+window.scrollY,k=C.left+window.scrollX;(Math.abs(S-L)>.5||Math.abs(k-T)>.5)&&(L=S,T=k,h({top:S,left:k,right:C.right+window.scrollX,bottom:C.bottom+window.scrollY,width:C.width,height:C.height})),m=requestAnimationFrame(w)};return u||w(),()=>{m!==null&&cancelAnimationFrame(m),p.disconnect(),window.removeEventListener("resize",v)}},[u,v]),c(P,{children:[c("div",{className:ae(B.autocomplete,u&&B.activated),children:[c("div",{className:B.inputContainer,ref:d,style:{visibility:"hidden"},children:[c("button",{className:ae(B.input,!t&&B.placeholder),type:"button",onClick:x,onFocus:x,children:t||n}),c(at,{className:B.mapPin}),!!o&&c(ve,{title:o,onClick:x})]}),c(en,{zIndex:e,ref:_,value:t,placeholder:n,onChange:i,results:r,onSelect:l,portalRoot:s,close:()=>a(!1),open:x,overlayPosition:y,isActivated:u,cta:o})]}),!!o&&c(ve,{title:o,onClick:x,className:B.mobileBtn})]})}function nn({zIndex:e,onSelect:t,placeholder:n,cta:o,portalRoot:i}){const r=Qt("places"),l=F(null),s=F({}),[d,_]=A(""),u=d.trim(),[a,y]=A({}),[h,v]=A([]);j(()=>{if(!r)return;l.current||(l.current=new r.AutocompleteSessionToken);const p=l.current;y(m=>m[u]||!u?m:{...m,[u]:r.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:u,sessionToken:p,language:"en",includedPrimaryTypes:["street_address"]}).then(({suggestions:L})=>(L.forEach(T=>{T.placePrediction?.placeId&&(s.current[T.placePrediction.placeId]=T)}),L))})},[r,u]),j(()=>{if(!u){v([]);return}const p=a[u];p&&p.then(m=>{v(m)})},[a,u]);const x=V(async({result:p})=>{const m=s.current[p.id];m&&(_([m.placePrediction?.mainText?.text,m.placePrediction?.secondaryText?.text].filter(Boolean).join(", ")),await m.placePrediction?.toPlace().fetchFields({fields:["location","formattedAddress","addressComponents"]}).then(({place:L})=>t?.({selection:Wt(L)})),y({}),s.current={},l.current=null)},[t]),b=ie(()=>h.map(p=>({mainText:p.placePrediction?.mainText?.text,secondaryText:p.placePrediction?.secondaryText?.text,id:p.placePrediction?.placeId})),[h]);return c(tn,{zIndex:e,value:d,onChange:_,results:b,onSelect:x,placeholder:n||"Enter your home address",cta:o,portalRoot:i})}function on({placeholder:e,cta:t,isEnergyOnly:n,portalRoot:o,zIndex:i,onSelectEvent:r,onResultEvent:l,onErrorEvent:s}){const[d,_]=A(),[u,a]=A(),[y,h]=A(),[v,x]=A(),[b,p]=A(),m=V(async S=>{if(_(S.selection),r(S),!S.selection)return;const k=await Dt(S.selection,S.confirmAddress,n);if(k.success)if(a(k.data.externalAddressId),k.data.redirectStrategy.isMultiple){h({redirectUrl:k.data.redirectUrl,redirectStrategy:k.data.redirectStrategy,externalAddressId:k.data.externalAddressId}),x(void 0),p(void 0),E("address_search_multiple_utility_result",{selection:S.selection,multipleResult:{redirectUrl:k.data.redirectUrl,redirectStrategy:k.data.redirectStrategy,externalAddressId:k.data.externalAddressId}});return}else if(k.data.redirectStrategy.isMultipleAddresses){x(k.data.redirectStrategy.multipleAddresses),h(void 0),p(void 0),E("address_search_multiple_address_result",{selection:S.selection,multipleResult:k.data.redirectStrategy.multipleAddresses});return}else{if(E("address_search_single_result",{selection:S.selection}),n){x(void 0),h(void 0),p(k.data.redirectUrl);return}l({result:k.data,selection:S.selection})}else E("address_search_no_result",{selection:S.selection}),s({error:k.error})},[n,r,l,s]),L=V(S=>{d&&l({result:{redirectUrl:S},selection:d})},[l,d]),T=V(S=>{m({selection:S,confirmAddress:!1})},[m]),w=V(()=>{h(void 0),x(void 0),_(void 0),a(void 0),p(void 0)},[]),C=d&&(v!=null||y!=null||b!=null);return c(P,{children:[c(nn,{placeholder:e,cta:t,zIndex:i,onSelect:S=>{m({...S,confirmAddress:!0})},portalRoot:o}),C&&et(c(Jt,{address:d?.formattedAddress??"",externalAddressId:u??"",multipleAddressOptions:v,multipleUtilityOptions:y?.redirectStrategy.multiple.options,energySplashRedirectUrl:b,onSelectAddress:T,onTriggerRedirect:L,onBack:w}),o)]})}const rn="._utilityModal_1ga8t_2{position:fixed;inset:0;z-index:10001;display:flex;background-color:#fff}._utilityModalContent_1ga8t_13{width:50%;display:flex;flex-direction:column;padding:32px 56px;overflow-y:auto}._utilityModalImage_1ga8t_21{width:50%;background-image:url(https://bpc-web-static-files.s3.us-east-2.amazonaws.com/Utility-Confirm-Hero-Desktop.jpg);background-size:cover;background-position:right center}._backButton_1ga8t_28{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border:none;background:none;cursor:pointer;color:#0b0e0f;padding:0;margin-left:-8px;flex-shrink:0}._backButton_1ga8t_28:hover{opacity:.7}._utilityModalBody_1ga8t_47{display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}._utilityModalBodyContent_1ga8t_55{display:flex;flex-direction:column;gap:64px;max-width:450px}._utilitySelectContent_1ga8t_62{display:flex;flex-direction:column;gap:64px}._addressLabel_1ga8t_68{font-size:12px;font-weight:500;letter-spacing:.05em;color:#0b0e0f;margin:0 0 12px;text-transform:uppercase}._utilityModalTitle_1ga8t_77{font-size:36px;font-weight:600;color:#0b0e0f;margin:0 0 12px;line-height:1.2;text-wrap:balance}._utilityModalSubtitle_1ga8t_86{font-size:16px;margin:0;line-height:1.5}._utilityOptions_1ga8t_92{display:flex;flex-direction:column;gap:12px;margin-top:32px}._utilityOption_1ga8t_92{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px 24px;border:1px solid #e0e0e0;border-radius:8px;background:#fff;cursor:pointer;transition:border-color .2s,box-shadow .2s}._utilityOption_1ga8t_92:hover{border-color:#ccc;box-shadow:0 2px 8px #00000014}._utilityLogo_1ga8t_120{height:20px;width:auto;object-fit:contain}._utilityName_1ga8t_126{font-size:16px;font-weight:500;color:#0b0e0f}._helpSection_1ga8t_132{margin-top:32px}._helpTitle_1ga8t_136{font-size:14px;font-weight:600;color:#0b0e0f;margin:0 0 8px}._helpText_1ga8t_143{font-size:14px;color:#666;margin:0 0 4px;line-height:1.5}._helpContact_1ga8t_150{font-size:14px;color:#666;margin:12px 0 0;line-height:1.5}._helpContact_1ga8t_150 a{color:#06c;text-decoration:none}._helpContact_1ga8t_150 a:hover{text-decoration:underline}._utilityOptionInner_1ga8t_166{display:flex;justify-content:space-between;width:100%;align-items:center;gap:8px}._enteredAddressSection_1ga8t_175{text-align:left}._addressLabelSmall_1ga8t_179{font-size:12px;font-weight:500;letter-spacing:.05em;color:#666;margin:0 0 4px;text-transform:uppercase}._addressLabelBold_1ga8t_188{font-size:18px;font-weight:700;color:#0b0e0f;margin:0;text-transform:uppercase}._addressSelectContent_1ga8t_196{display:flex;flex-direction:column;margin-top:16px}._addressOptions_1ga8t_202{display:flex;flex-direction:column;gap:12px;margin-top:24px;margin-bottom:24px}._addressOption_1ga8t_202{display:flex;align-items:center;gap:16px;padding:20px 24px;border:1px solid #e0e0e0;border-radius:12px;background:#fff;cursor:pointer;text-align:left}._addressOptionSelected_1ga8t_222{border-color:#77a45a;border-width:2px}._addressRadio_1ga8t_227{flex-shrink:0}._radioCircle_1ga8t_231{width:24px;height:24px;border:2px solid #ccc;border-radius:50%;display:flex;align-items:center;justify-content:center}._radioCircleSelected_1ga8t_241{border-color:#084d41}._radioCircleInner_1ga8t_245{width:12px;height:12px;background-color:#084d41;border-radius:50%}._addressText_1ga8t_252{flex:1}._addressLine1Existing_1ga8t_256{font-size:16px;font-weight:600;color:#084d41;margin:0 0 2px}._addressLine2Existing_1ga8t_263{font-size:16px;font-weight:500;color:#084d41;margin:0}._addressLine1Original_1ga8t_270{font-size:16px;font-weight:600;color:#666;margin:0 0 2px}._addressLine2Original_1ga8t_277{font-size:16px;font-weight:500;color:#666;margin:0}._recommendedBadge_1ga8t_284{font-size:12px;font-weight:400;letter-spacing:.05em;color:#084d41;background-color:#b2dd79;padding:6px 12px;border-radius:4px;text-transform:uppercase;flex-shrink:0}._continueButton_1ga8t_296{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:16px 32px;font-size:16px;font-family:inherit;font-weight:600;color:#084d41;background-color:#d0f585;border:none;border-radius:12px;cursor:pointer;transition:background-color .2s ease-in-out;box-shadow:inset 0 0 0 1px #0b0e0f0d}._continueButton_1ga8t_296:hover{background-color:#ecfad0}@media screen and (max-width:768px){._utilityModal_1ga8t_2{flex-direction:column}._utilityModalContent_1ga8t_13{width:100%;min-width:0;max-width:none;padding:128px 24px 32px;order:2}._utilityModalImage_1ga8t_21{width:100%;flex:none;display:none;order:1}._utilityModalBodyContent_1ga8t_55{width:100%}._backButton_1ga8t_28{position:fixed;top:16px;left:16px;z-index:10002;background:#ffffffe6;border-radius:50%;margin-left:0}._utilityModalBody_1ga8t_47,._addressLabel_1ga8t_68{text-align:center}._utilityModalTitle_1ga8t_77{font-size:28px;text-align:center}._utilityModalSubtitle_1ga8t_86{font-weight:400;text-align:center;text-wrap:balance}._helpSection_1ga8t_132,._enteredAddressSection_1ga8t_175{text-align:center}._addressOption_1ga8t_202{padding:16px 20px}._recommendedBadge_1ga8t_284{font-size:10px;padding:4px 8px}}._splashOverlay_1ga8t_391{position:fixed;inset:0;z-index:10001;background-color:#f0eeeb;display:flex;align-items:center;justify-content:center}._splashCard_1ga8t_401{background:#fff;border-radius:32px;padding:32px;display:flex;flex-direction:column;align-items:center;gap:4px;width:800px}._splashSpinnerWrapper_1ga8t_412{width:48px;height:48px;display:flex;align-items:center;justify-content:center}._splashSpinner_1ga8t_412{width:24px;height:24px;border:2.5px solid #e8e6e3;border-top-color:#1e4d2b;border-radius:50%;animation:_splashSpin_1ga8t_412 .8s linear infinite}._splashCardContent_1ga8t_429{display:flex;flex-direction:column;align-items:center;gap:32px;width:100%}._splashTextGroup_1ga8t_437{display:flex;flex-direction:column;align-items:center;gap:10px;width:100%}._splashTitle_1ga8t_445{font-size:32px;font-weight:600;color:#1c2829;text-align:center;line-height:1.2;margin:0}._splashSubtitle_1ga8t_454{font-size:12px;font-weight:500;color:#7f7d7a;text-align:center;letter-spacing:.2px;margin:0}._splashSteps_1ga8t_463{display:flex;gap:12px}._splashStep_1ga8t_463{display:flex;justify-content:start;align-items:center;gap:6px}._splashStepLabel_1ga8t_475{font-size:12px;font-weight:500;color:#292826;letter-spacing:.2px;white-space:nowrap}._splashStepLabel_1ga8t_475:after{display:block;content:attr(data-label);font-weight:700;height:0;overflow:hidden;visibility:hidden;white-space:nowrap}._splashStepLabelComplete_1ga8t_496{font-size:12px;font-weight:700;color:#1e4d2b;letter-spacing:.2px;white-space:nowrap}@keyframes _splashSpin_1ga8t_412{to{transform:rotate(360deg)}}@media screen and (max-width:768px){._splashCard_1ga8t_401{width:321px}._splashSteps_1ga8t_463{flex-direction:column}._splashTextGroup_1ga8t_437{gap:4px}}",st=":host{--grey-20: #d8d7d5;--grey-90: #999;font:inherit}:host *{box-sizing:border-box}._autocomplete_gbolv_11{position:relative}._input_gbolv_15{position:relative;padding:20px 8px 20px 44px;font-size:16px;line-height:24px;width:100%;background-color:transparent;border:none;outline:none;font-family:inherit;text-align:left}._input_gbolv_15._placeholder_gbolv_28,._input_gbolv_15::placeholder{color:var(--grey-90)}button._input_gbolv_15{cursor:text}._inputContainer_gbolv_37:focus-within{border-color:var(--grey-90);outline:2px solid var(--grey-20);outline-offset:0}._inputContainer_gbolv_37{position:relative;background-color:#fff;border:1px solid transparent;border-radius:8px;overflow:hidden}._activated_gbolv_51 ._inputContainer_gbolv_37{z-index:1001}._inputPositioner_gbolv_55{position:absolute;top:0;left:0;right:0}._mapPin_gbolv_62{position:absolute;pointer-events:none;left:16px;top:50%;transform:translateY(-50%)}._activateButton_gbolv_70{font-size:inherit;font-family:inherit;background:none;border:none;cursor:pointer;color:#084d41;font-weight:600;border-radius:8px;transition:background-color .2s ease-in-out;background-color:#d0f585;padding:8px 20px;box-shadow:inset 0 0 0 1px #0b0e0f0d}._activateButton_gbolv_70:hover{background-color:#ecfad0}._modalButton_gbolv_88{font-size:16px;font-family:inherit;background:none;border:none;cursor:pointer;color:#084d41;font-weight:600;border-radius:12px;transition:background-color .2s ease-in-out;background-color:#d0f585;padding:16px 32px;box-shadow:inset 0 0 0 1px #0b0e0f0d}._modalButton_gbolv_88:hover{background-color:#ecfad0}._modalButtonGroup_gbolv_106{display:flex;justify-content:space-evenly;gap:8px}._inputContainer_gbolv_37>._activateButton_gbolv_70{position:absolute;right:8px;top:8px;bottom:8px}._activateButton_gbolv_70._mobileBtn_gbolv_119{display:none;width:100%;margin-top:8px}._activated_gbolv_51 ._activateButton_gbolv_70{display:none}._overlay_gbolv_129{position:fixed;inset:0;background-color:#292826cc;z-index:1000}._results_gbolv_139{position:absolute;top:100%;left:0;right:0;background:#fff;margin-top:-8px;padding:16px 8px 8px;border-radius:0 0 8px 8px;border-color:var(--grey-90);outline:2px solid var(--grey-20);outline-offset:0}._result_gbolv_139{padding:12px 8px;font-weight:600;border-radius:8px}._result_gbolv_139[aria-selected=true]{background-color:#d0f58555;cursor:default}._result_gbolv_139 span{margin-left:6px;font-size:14px;color:var(--grey-90);font-weight:500}._modal_gbolv_88{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:#fff;border-radius:8px;padding:24px;width:500px;max-width:90vw;aspect-ratio:2 / 1;display:flex;flex-direction:column;overflow:hidden}._modalClose_gbolv_187{position:absolute;top:8px;right:8px;background:none;border:none;font-size:24px;cursor:pointer;padding:4px 8px;line-height:1;z-index:1}._modalContent_gbolv_200{flex:1;min-height:0;overflow:auto}@media screen and (max-width:540px){._input_gbolv_15{padding:12px 8px 12px 40px;line-height:24px}._mapPin_gbolv_62{left:12px}._inputContainer_gbolv_37>._activateButton_gbolv_70{display:none}._activateButton_gbolv_70._mobileBtn_gbolv_119{display:block;padding:14px 20px}._modal_gbolv_88{aspect-ratio:1 / 1;padding:24px}}";function _t(e){const t=e.getAttribute("public-key")||"",n=e.getAttribute("placeholder")||void 0,o=e.getAttribute("cta")||void 0,i=e.getAttribute("is-energy-only")==="true";return{publicApiKey:t,placeholder:n,cta:o,isEnergyOnly:i}}function ct(e){const t=window.getComputedStyle(e);if(t.getPropertyValue("z-index")==="auto"&&e.parentElement)return ct(e.parentElement);const n=Number(t.getPropertyValue("z-index"));return Number.isNaN(n)?0:n}class ln extends HTMLElement{constructor(){super(...arguments);q(this,"shadowRootRef");q(this,"container");q(this,"overlayRoot");q(this,"overlayWrapper");q(this,"reactRoot")}static get observedAttributes(){return["public-key","placeholder","cta","is-energy-only"]}connectedCallback(){if(!this.shadowRootRef){this.shadowRootRef=this.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=st,this.shadowRootRef.appendChild(o),this.container=document.createElement("div"),this.shadowRootRef.appendChild(this.container)}if(!this.overlayRoot){this.overlayWrapper=document.createElement("div"),this.overlayRoot=this.overlayWrapper.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=st,this.overlayRoot.appendChild(o);const i=document.createElement("style");i.textContent=rn,this.overlayRoot.appendChild(i),document.body.appendChild(this.overlayWrapper)}const n=_t(this);if(!n.publicApiKey)throw new Error("bpc-address-search: public-key is required");Ut({key:n.publicApiKey,v:"weekly",libraries:["places"]}),!this.reactRoot&&this.container&&(this.reactRoot=It(this.container)),this.renderApp()}attributeChangedCallback(){this.renderApp()}disconnectedCallback(){this.reactRoot?.unmount(),this.reactRoot=void 0,this.overlayWrapper?.remove(),this.overlayRoot=void 0,this.overlayWrapper=void 0}renderApp(){if(!this.reactRoot||!this.overlayRoot)return;const n=_t(this),o=ct(this.shadowRootRef?.host);this.reactRoot.render(c($t,{children:c(on,{placeholder:n.placeholder,cta:n.cta,isEnergyOnly:n.isEnergyOnly,portalRoot:this.overlayRoot,zIndex:o,onSelectEvent:i=>this.dispatchEvent(new CustomEvent("select",{detail:i})),onResultEvent:i=>this.dispatchEvent(new CustomEvent("result",{detail:i})),onErrorEvent:i=>this.dispatchEvent(new CustomEvent("error",{detail:i}))})}))}}customElements.define("bpc-address-search",ln)})(); +var an=Object.defineProperty;var sn=(O,g,I)=>g in O?an(O,g,{enumerable:!0,configurable:!0,writable:!0,value:I}):O[g]=I;var q=(O,g,I)=>sn(O,typeof g!="symbol"?g+"":g,I);(function(){"use strict";var O,g,I,U,xe,we,Ce,Se,se,_e,ce,Z={},ke=[],dt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Y=Array.isArray;function $(e,t){for(var n in t)e[n]=t[n];return e}function de(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function K(e,t,n){var o,i,r,l={};for(r in t)r=="key"?o=t[r]:r=="ref"?i=t[r]:l[r]=t[r];if(arguments.length>2&&(l.children=arguments.length>3?O.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)l[r]===void 0&&(l[r]=e.defaultProps[r]);return J(e,l,o,i,null)}function J(e,t,n,o,i){var r={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++I,__i:-1,__u:0};return i==null&&g.vnode!=null&&g.vnode(r),r}function P(e){return e.children}function z(e,t){this.props=e,this.context=t}function H(e,t){if(t==null)return e.__?H(e.__,e.__i+1):null;for(var n;ts&&U.sort(Ce),e=U.shift(),s=U.length,e.__d&&(n=void 0,o=void 0,i=(o=(t=e).__v).__e,r=[],l=[],t.__P&&((n=$({},o)).__v=o.__v+1,g.vnode&&g.vnode(n),pe(t.__P,n,o,t.__n,t.__P.namespaceURI,32&o.__u?[i]:null,r,i??H(o),!!(32&o.__u),l),n.__v=o.__v,n.__.__k[n.__i]=n,Ee(r,n,l),o.__e=o.__=null,n.__e!=i&&Ne(n)));Q.__r=0}function Me(e,t,n,o,i,r,l,s,d,_,u){var a,y,h,v,x,b,p,m=o&&o.__k||ke,L=t.length;for(d=pt(n,t,m,d,L),a=0;a0?J(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=e,l.__b=e.__b+1,s=null,(_=l.__i=ut(l,n,d,a))!=-1&&(a--,(s=n[_])&&(s.__u|=2)),s==null||s.__v==null?(_==-1&&(i>u?y--:id?y--:y++,l.__u|=4))):e.__k[r]=null;if(a)for(r=0;r(u?1:0)){for(i=n-1,r=n+1;i>=0||r=0?i--:r++])!=null&&(2&_.__u)==0&&s==_.key&&d==_.type)return l}return-1}function Be(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||dt.test(t)?n:n+"px"}function te(e,t,n,o,i){var r,l;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||Be(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||Be(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Se,"$1")),l=t.toLowerCase(),t=l in e||t=="onFocusOut"||t=="onFocusIn"?l.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o?n.u=o.u:(n.u=se,e.addEventListener(t,r?ce:_e,r)):e.removeEventListener(t,r?ce:_e,r);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Ae(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=se++;else if(t.t0?e:Y(e)?e.map(Oe):$({},e)}function ht(e,t,n,o,i,r,l,s,d){var _,u,a,y,h,v,x,b=n.props,p=t.props,m=t.type;if(m=="svg"?i="http://www.w3.org/2000/svg":m=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),r!=null){for(_=0;_=n.__.length&&n.__.push({}),n.__[e]}function A(e){return X=1,gt(Ve,e)}function gt(e,t,n){var o=oe(W++,2);if(o.t=e,!o.__c&&(o.__=[n?n(t):Ve(void 0,t),function(s){var d=o.__N?o.__N[0]:o.__[0],_=o.t(d,s);d!==_&&(o.__N=[_,o.__[1]],o.__c.setState({}))}],o.__c=N,!N.__f)){var i=function(s,d,_){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(y){return!!y.__c});if(u.every(function(y){return!y.__N}))return!r||r.call(this,s,d,_);var a=o.__c.props!==s;return u.forEach(function(y){if(y.__N){var h=y.__[0];y.__=y.__N,y.__N=void 0,h!==y.__[0]&&(a=!0)}}),r&&r.call(this,s,d,_)||a};N.__f=!0;var r=N.shouldComponentUpdate,l=N.componentWillUpdate;N.componentWillUpdate=function(s,d,_){if(this.__e){var u=r;r=void 0,i(s,d,_),r=u}l&&l.call(this,s,d,_)},N.shouldComponentUpdate=i}return o.__N||o.__}function j(e,t){var n=oe(W++,3);!M.__s&&Fe(n.__H,t)&&(n.__=e,n.u=t,N.__H.__h.push(n))}function F(e){return X=5,ie(function(){return{current:e}},[])}function ie(e,t){var n=oe(W++,7);return Fe(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function V(e,t){return X=8,ie(function(){return e},t)}function mt(){var e=oe(W++,11);if(!e.__){for(var t=N.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function yt(){for(var e;e=$e.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(re),e.__H.__h.forEach(ge),e.__H.__h=[]}catch(t){e.__H.__h=[],M.__e(t,e.__v)}}M.__b=function(e){N=null,ze&&ze(e)},M.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),We&&We(e,t)},M.__r=function(e){Ie&&Ie(e),W=0;var t=(N=e.__c).__H;t&&(fe===N?(t.__h=[],N.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(t.__h.forEach(re),t.__h.forEach(ge),t.__h=[],W=0)),fe=N},M.diffed=function(e){Ue&&Ue(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($e.push(t)!==1&&Re===M.requestAnimationFrame||((Re=M.requestAnimationFrame)||vt)(yt)),t.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),fe=N=null},M.__c=function(e,t){t.some(function(n){try{n.__h.forEach(re),n.__h=n.__h.filter(function(o){return!o.__||ge(o)})}catch(o){t.some(function(i){i.__h&&(i.__h=[])}),t=[],M.__e(o,n.__v)}}),De&&De(e,t)},M.unmount=function(e){He&&He(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{re(o)}catch(i){t=i}}),n.__H=void 0,t&&M.__e(t,n.__v))};var je=typeof requestAnimationFrame=="function";function vt(e){var t,n=function(){clearTimeout(o),je&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,35);je&&(t=requestAnimationFrame(n))}function re(e){var t=N,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),N=t}function ge(e){var t=N;e.__c=e.__(),N=t}function Fe(e,t){return!e||e.length!==t.length||t.some(function(n,o){return n!==e[o]})}function Ve(e,t){return typeof t=="function"?t(e):t}function bt(e,t){for(var n in t)e[n]=t[n];return e}function Ge(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var o in t)if(o!=="__source"&&e[o]!==t[o])return!0;return!1}function qe(e,t){this.props=e,this.context=t}(qe.prototype=new z).isPureReactComponent=!0,qe.prototype.shouldComponentUpdate=function(e,t){return Ge(this.props,e)||Ge(this.state,t)};var Ze=g.__b;g.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ze&&Ze(e)};var xt=g.__e;g.__e=function(e,t,n,o){if(e.then){for(var i,r=t;r=r.__;)if((i=r.__c)&&i.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}xt(e,t,n,o)};var Ye=g.unmount;function Ke(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),e.__c.__H=null),(e=bt({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(o){return Ke(o,t,n)})),e}function Xe(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(o){return Xe(o,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function me(){this.__u=0,this.o=null,this.__b=null}function Je(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function le(){this.i=null,this.l=null}g.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ye&&Ye(e)},(me.prototype=new z).__c=function(e,t){var n=t.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var i=Je(o.__v),r=!1,l=function(){r||(r=!0,n.__R=null,i?i(s):s())};n.__R=l;var s=function(){if(!--o.__u){if(o.state.__a){var d=o.state.__a;o.__v.__k[0]=Xe(d,d.__c.__P,d.__c.__O)}var _;for(o.setState({__a:o.__b=null});_=o.o.pop();)_.forceUpdate()}};o.__u++||32&t.__u||o.setState({__a:o.__b=o.__v.__k[0]}),e.then(l,l)},me.prototype.componentWillUnmount=function(){this.o=[]},me.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Ke(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&K(P,null,e.fallback);return i&&(i.__u&=-33),[K(P,null,t.__a?null:e.children),i]};var Qe=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]>>1,1),t.h.removeChild(i)}}}ne(K(wt,{context:t.context},e.__v),t.v)}function et(e,t){var n=K(Ct,{__v:e,h:t});return n.containerInfo=t,n}(le.prototype=new z).__a=function(e){var t=this,n=Je(t.__v),o=t.l.get(e);return o[0]++,function(i){var r=function(){t.props.revealOrder?(o.push(i),Qe(t,e,o)):i()};n?n(r):r()}},le.prototype.render=function(e){this.i=null,this.l=new Map;var t=ee(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},le.prototype.componentDidUpdate=le.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Qe(e,n,t)})};var St=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,kt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Nt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Lt=/[A-Z0-9]/g,Mt=typeof document<"u",Tt=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Bt(e,t,n){return t.__k==null&&(t.textContent=""),ne(e,t),typeof n=="function"&&n(),e?e.__c:null}z.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(z.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var tt=g.event;function At(){}function Et(){return this.cancelBubble}function Ot(){return this.defaultPrevented}g.event=function(e){return tt&&(e=tt(e)),e.persist=At,e.isPropagationStopped=Et,e.isDefaultPrevented=Ot,e.nativeEvent=e};var Pt={enumerable:!1,configurable:!0,get:function(){return this.class}},nt=g.vnode;g.vnode=function(e){typeof e.type=="string"&&(function(t){var n=t.props,o=t.type,i={},r=o.indexOf("-")===-1;for(var l in n){var s=n[l];if(!(l==="value"&&"defaultValue"in n&&s==null||Mt&&l==="children"&&o==="noscript"||l==="class"||l==="className")){var d=l.toLowerCase();l==="defaultValue"&&"value"in n&&n.value==null?l="value":l==="download"&&s===!0?s="":d==="translate"&&s==="no"?s=!1:d[0]==="o"&&d[1]==="n"?d==="ondoubleclick"?l="ondblclick":d!=="onchange"||o!=="input"&&o!=="textarea"||Tt(n.type)?d==="onfocus"?l="onfocusin":d==="onblur"?l="onfocusout":Nt.test(l)&&(l=d):d=l="oninput":r&&kt.test(l)?l=l.replace(Lt,"-$&").toLowerCase():s===null&&(s=void 0),d==="oninput"&&i[l=d]&&(l="oninputCapture"),i[l]=s}}o=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=ee(n.children).forEach(function(_){_.props.selected=i.value.indexOf(_.props.value)!=-1})),o=="select"&&i.defaultValue!=null&&(i.value=ee(n.children).forEach(function(_){_.props.selected=i.multiple?i.defaultValue.indexOf(_.props.value)!=-1:i.defaultValue==_.props.value})),n.class&&!n.className?(i.class=n.class,Object.defineProperty(i,"className",Pt)):(n.className&&!n.class||n.class&&n.className)&&(i.class=i.className=n.className),t.props=i})(e),e.$$typeof=St,nt&&nt(e)};var ot=g.__r;g.__r=function(e){ot&&ot(e),e.__c};var it=g.diffed;g.diffed=function(e){it&&it(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};function Rt(e){return!!e.__k&&(ne(null,e),!0)}var $t=P,zt=0;function c(e,t,n,o,i,r){t||(t={});var l,s,d=t;if("ref"in d)for(s in d={},t)s=="ref"?l=t[s]:d[s]=t[s];var _={type:e,props:d,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--zt,__i:-1,__u:0,__source:i,__self:r};if(typeof e=="function"&&(l=e.defaultProps))for(s in l)d[s]===void 0&&(d[s]=l[s]);return g.vnode&&g.vnode(_),_}function It(e){return{render:function(t){Bt(t,e)},unmount:function(){Rt(e)}}}const Ut=e=>{if(window.google=window.google||{},window.google.maps=window.google.maps||{},window.google.maps.importLibrary)return;const t=new Set(e.libraries||[]),n=new URLSearchParams;let o=null;const i=()=>o||(o=new Promise((r,l)=>{const s=document.createElement("script");n.set("libraries",Array.from(t).join(","));for(const d in e)n.set(d.replace(/[A-Z]/g,_=>`_${_[0].toLowerCase()}`),e[d]);n.set("callback","google.maps.__ib__"),s.src=`https://maps.googleapis.com/maps/api/js?${n.toString()}`,window.google.maps.__ib__=r,s.onerror=()=>l(Error("Google Maps could not load.")),s.nonce=document.querySelector("script[nonce]")?.nonce||"",document.head.append(s)}),o);window.google.maps.importLibrary||(window.google.maps.importLibrary=(r,...l)=>t.add(r)&&i().then(()=>window.google.maps.importLibrary(r,...l)))};function Dt(e,t=!1,n=!1){return fetch("https://account.basepowercompany.com/api/address-router",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selection:e,confirm_address:t,is_energy_only:n})}).then(o=>o.json()).catch(o=>({success:!1,error:o instanceof Error?o.message:"Unknown error"}))}function Ht(e,t){return fetch("https://account.basepowercompany.com/api/utility-select",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({utilityName:e,externalId:t})})}function Wt(e){if(!e.formattedAddress||!e.addressComponents)return;const t=e.addressComponents.reduce((r,l)=>(l.types.forEach(s=>{r[s]=l}),r),{}),n=[t.street_number?.longText,t.route?.longText,t.subpremise?.longText].filter(Boolean).join(" "),o=[t.locality?.longText,t.sublocality?.longText,t.administrative_area_level_2?.longText].filter(Boolean)[0]||"",i={line1:n,city:o,state:t.administrative_area_level_1?.shortText||"",postalCode:t.postal_code?.longText||"",country:t.country?.shortText||"",latitude:e.location?.lat(),longitude:e.location?.lng()};return{formattedAddress:e.formattedAddress,address:i}}const E=(e,t)=>{typeof window<"u"&&window.posthog&&window.posthog.capture(e,t)},f={utilityModal:"_utilityModal_1ga8t_2",utilityModalContent:"_utilityModalContent_1ga8t_13",utilityModalImage:"_utilityModalImage_1ga8t_21",backButton:"_backButton_1ga8t_28",utilityModalBody:"_utilityModalBody_1ga8t_47",utilityModalBodyContent:"_utilityModalBodyContent_1ga8t_55",utilitySelectContent:"_utilitySelectContent_1ga8t_62",addressLabel:"_addressLabel_1ga8t_68",utilityModalTitle:"_utilityModalTitle_1ga8t_77",utilityModalSubtitle:"_utilityModalSubtitle_1ga8t_86",utilityOptions:"_utilityOptions_1ga8t_92",utilityOption:"_utilityOption_1ga8t_92",utilityLogo:"_utilityLogo_1ga8t_120",utilityName:"_utilityName_1ga8t_126",helpSection:"_helpSection_1ga8t_132",helpTitle:"_helpTitle_1ga8t_136",helpText:"_helpText_1ga8t_143",helpContact:"_helpContact_1ga8t_150",utilityOptionInner:"_utilityOptionInner_1ga8t_166",enteredAddressSection:"_enteredAddressSection_1ga8t_175",addressLabelSmall:"_addressLabelSmall_1ga8t_179",addressLabelBold:"_addressLabelBold_1ga8t_188",addressSelectContent:"_addressSelectContent_1ga8t_196",addressOptions:"_addressOptions_1ga8t_202",addressOption:"_addressOption_1ga8t_202",addressOptionSelected:"_addressOptionSelected_1ga8t_222",addressRadio:"_addressRadio_1ga8t_227",radioCircle:"_radioCircle_1ga8t_231",radioCircleSelected:"_radioCircleSelected_1ga8t_241",radioCircleInner:"_radioCircleInner_1ga8t_245",addressText:"_addressText_1ga8t_252",addressLine1Existing:"_addressLine1Existing_1ga8t_256",addressLine2Existing:"_addressLine2Existing_1ga8t_263",addressLine1Original:"_addressLine1Original_1ga8t_270",addressLine2Original:"_addressLine2Original_1ga8t_277",recommendedBadge:"_recommendedBadge_1ga8t_284",continueButton:"_continueButton_1ga8t_296",splashOverlay:"_splashOverlay_1ga8t_391",splashCard:"_splashCard_1ga8t_401",splashSpinnerWrapper:"_splashSpinnerWrapper_1ga8t_412",splashSpinner:"_splashSpinner_1ga8t_412",splashCardContent:"_splashCardContent_1ga8t_429",splashTextGroup:"_splashTextGroup_1ga8t_437",splashTitle:"_splashTitle_1ga8t_445",splashSubtitle:"_splashSubtitle_1ga8t_454",splashSteps:"_splashSteps_1ga8t_463",splashStep:"_splashStep_1ga8t_463",splashStepLabel:"_splashStepLabel_1ga8t_475",splashStepLabelComplete:"_splashStepLabelComplete_1ga8t_496"};function jt({onClick:e}){return c("button",{type:"button",className:f.backButton,onClick:e,"aria-label":"Go back",children:c("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:c("path",{d:"M19 12H5M5 12L12 19M5 12L12 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}function rt({onBack:e,children:t}){return c("div",{className:f.utilityModal,children:[c("div",{className:f.utilityModalContent,children:[c(jt,{onClick:e}),c("div",{className:f.utilityModalBody,children:c("div",{className:f.utilityModalBodyContent,children:t})})]}),c("div",{className:f.utilityModalImage})]})}function Ft(){return c("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:c("path",{d:"M5 12H19M19 12L12 5M19 12L12 19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function lt({selected:e}){return c("div",{className:f.addressRadio,children:c("div",{className:`${f.radioCircle} ${e?f.radioCircleSelected:""}`,children:e&&c("div",{className:f.radioCircleInner})})})}function Vt({address:e,addressOptions:t,onSelectAddress:n,onBack:o}){const[i,r]=A("existing"),l=t.existingAddress,s=t.originalAddress,d=()=>{const a=i==="existing"?l:s;E("address_search_address_selection_confirmed",{selectionType:i,selectedAddress:a.formattedAddress}),n(a)},_=a=>a.address.line1,u=a=>`${a.address.city}, ${a.address.state} ${a.address.postalCode}`;return c(rt,{onBack:o,children:[c("div",{className:f.enteredAddressSection,children:[c("p",{className:f.addressLabelSmall,children:"YOU ENTERED:"}),c("p",{className:f.addressLabelBold,children:e})]}),c("div",{className:f.addressSelectContent,children:[c("h1",{className:f.utilityModalTitle,children:"We found 2 possible addresses:"}),c("p",{className:f.utilityModalSubtitle,children:"Help us find the right serviceable address for your home."}),c("div",{className:f.addressOptions,children:[c("button",{type:"button",className:`${f.addressOption} ${i==="existing"?f.addressOptionSelected:""}`,onClick:()=>r("existing"),children:[c(lt,{selected:i==="existing"}),c("div",{className:f.addressText,children:[c("p",{className:f.addressLine1Existing,children:_(l)}),c("p",{className:f.addressLine2Existing,children:u(l)})]}),c("span",{className:f.recommendedBadge,children:"RECOMMENDED"})]}),c("button",{type:"button",className:`${f.addressOption} ${i==="original"?f.addressOptionSelected:""}`,onClick:()=>r("original"),children:[c(lt,{selected:i==="original"}),c("div",{className:f.addressText,children:[c("p",{className:f.addressLine1Original,children:_(s)}),c("p",{className:f.addressLine2Original,children:u(s)})]})]})]}),c("button",{type:"button",className:f.continueButton,onClick:d,children:["Continue",c(Ft,{})]})]})]})}function Gt(){return c("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",children:[c("path",{d:"M25.2636 15.0004C25.2636 20.6686 20.6686 25.2636 15.0004 25.2636C9.33223 25.2636 4.73725 20.6686 4.73725 15.0004C4.73725 9.33223 9.33223 4.73725 15.0004 4.73725C20.6686 4.73725 25.2636 9.33223 25.2636 15.0004Z",fill:"#B2DD79"}),c("path",{d:"M23.4873 15.0004C23.4873 10.3133 19.6876 6.51357 15.0004 6.51357C10.3133 6.51357 6.51357 10.3133 6.51357 15.0004C6.51357 19.6876 10.3133 23.4873 15.0004 23.4873C19.6876 23.4873 23.4873 19.6876 23.4873 15.0004ZM27.0399 15.0004C27.0399 21.6496 21.6496 27.0399 15.0004 27.0399C8.35119 27.0399 2.96094 21.6496 2.96094 15.0004C2.96094 8.35119 8.35119 2.96094 15.0004 2.96094C21.6496 2.96094 27.0399 8.35119 27.0399 15.0004Z",fill:"#B2DD79"}),c("path",{d:"M23.4478 15.0004C23.4478 10.3351 19.6658 6.55304 15.0004 6.55304C10.3351 6.55304 6.55304 10.3351 6.55304 15.0004C6.55304 19.6658 10.3351 23.4478 15.0004 23.4478V25.2636C9.33223 25.2636 4.73725 20.6686 4.73725 15.0004C4.73725 9.33223 9.33223 4.73725 15.0004 4.73725C20.6686 4.73725 25.2636 9.33223 25.2636 15.0004C25.2636 20.6686 20.6686 25.2636 15.0004 25.2636V23.4478C19.6658 23.4478 23.4478 19.6658 23.4478 15.0004Z",fill:"#1E4D2B"}),c("path",{d:"M19.1876 10.9094C19.485 10.5187 20.0428 10.4429 20.4335 10.7403C20.8243 11.0376 20.9 11.5954 20.6027 11.9861L15.1261 19.1832C14.3108 20.2546 12.7377 20.3609 11.7857 19.4089L9.39808 17.0213C9.05089 16.6741 9.05089 16.1112 9.39808 15.764C9.74527 15.4168 10.3082 15.4168 10.6554 15.764L13.043 18.1516C13.2334 18.342 13.5481 18.3208 13.7111 18.1065L19.1876 10.9094Z",fill:"#1E4D2B"})]})}function qt(){return c("svg",{width:"30",height:"30",viewBox:"0 0 30 30",fill:"none","aria-hidden":"true",children:c("circle",{cx:"15",cy:"15",r:"14",stroke:"#d8d7d5",strokeWidth:"1"})})}const Zt=1e3,ye=["Verifying address","Checking utility","Preparing report"];function Yt({address:e,redirectUrl:t,onRedirect:n}){const[o,i]=A(0),r=F(!1);return j(()=>{E("energy_only_splash_shown",{address:e});let l;const s=ye.map((d,_)=>setTimeout(()=>{i(_+1),_===ye.length-1&&!r.current&&(r.current=!0,E("energy_only_splash_redirect",{redirectUrl:t}),l=setTimeout(()=>n(t),300))},Zt*(_+1)));return()=>{s.forEach(clearTimeout),clearTimeout(l)}},[e,t,n]),c("div",{className:f.splashOverlay,children:c("div",{className:f.splashCard,children:[c("div",{className:f.splashSpinnerWrapper,children:c("div",{className:f.splashSpinner,"aria-hidden":"true"})}),c("div",{className:f.splashCardContent,children:[c("div",{className:f.splashTextGroup,children:[c("p",{className:f.splashTitle,children:"Calculating your savings..."}),c("p",{className:f.splashSubtitle,children:"This only takes a moment."})]}),c("div",{className:f.splashSteps,children:ye.map((l,s)=>{const d=s{const s=l.value,d=n.find(_=>_.value===s);if(!d){E("address_search_modal_selection_not_found",{addressSelected:e,utility:s,utilityOptions:n});return}if(s==="DEREG"){E("address_search_modal_selection_utility_other",{addressSelected:e,utility:s,multipleResult:d}),o(d.redirectUrl);return}if(!t){E("address_search_multiple_result_unreachable_external_address_id_not_found",{addressSelected:e,utility:s,externalAddressId:t});return}try{await Ht(s,t),E("address_search_set_utility_confirmed_success",{addressSelected:e,utility:s,externalAddressId:t})}catch(_){E("address_search_set_utility_confirmed_error",{addressSelected:e,utility:s,externalAddressId:t}),console.error("Error setting utility user confirmed",_)}o(d.redirectUrl)};return c(rt,{onBack:i,children:[c("div",{children:[c("p",{className:f.addressLabel,children:e}),c("h1",{className:f.utilityModalTitle,children:"Who's your local utility?"}),c("p",{className:f.utilityModalSubtitle,children:"So we can show the right plan and next steps for this address."})]}),c("div",{className:f.utilitySelectContent,children:[c("div",{className:f.utilityOptions,children:n.map(l=>{const s=Kt[l.value];return c("button",{type:"button",className:f.utilityOption,onClick:()=>r(l),children:c("div",{className:f.utilityOptionInner,children:[c("p",{className:f.utilityName,children:l.name}),s&&c("img",{src:s,alt:`${l.name} logo`,className:f.utilityLogo})]})},l.name)})}),c("div",{className:f.helpSection,children:[c("p",{className:f.helpTitle,children:"Not sure?"}),c("p",{className:f.helpText,children:'Look at your bill for the "Delivery" or "TDU" section'}),c("p",{className:f.helpText,children:"Search your inbox for outage texts or alerts"}),c("p",{className:f.helpContact,children:["Still can't find it? Email us:"," ",c("a",{href:"mailto:team@basepowercompany.com",children:"team@basepowercompany.com"})]})]})]})]})}function Jt({address:e,externalAddressId:t,multipleAddressOptions:n,multipleUtilityOptions:o,energySplashRedirectUrl:i,onSelectAddress:r,onTriggerRedirect:l,onBack:s}){return n?c(Vt,{address:e,addressOptions:n,onSelectAddress:r,onBack:s}):o?c(Xt,{address:e,externalAddressId:t,utilityOptions:o,onTriggerRedirect:l,onBack:s}):i?c(Yt,{address:e,redirectUrl:i,onRedirect:l,onBack:s}):null}const Qt=e=>{const[t,n]=A(null);return j(()=>{window.google.maps.importLibrary(e).then(o=>{n(o)})},[e]),t},ae=(...e)=>e.filter(Boolean).join(" "),B={autocomplete:"_autocomplete_gbolv_11",input:"_input_gbolv_15",placeholder:"_placeholder_gbolv_28",inputContainer:"_inputContainer_gbolv_37",activated:"_activated_gbolv_51",inputPositioner:"_inputPositioner_gbolv_55",mapPin:"_mapPin_gbolv_62",activateButton:"_activateButton_gbolv_70",mobileBtn:"_mobileBtn_gbolv_119",overlay:"_overlay_gbolv_129",results:"_results_gbolv_139",result:"_result_gbolv_139"};function ve({title:e,className:t,...n}){return c("button",{type:"button",className:ae(B.activateButton,t),tabIndex:-1,...n,children:e})}function at(e){return c("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"#0c9953",viewBox:"0 0 20 20",...e,children:[c("title",{children:"Map pin"}),c("path",{d:"M10 1.458a6.875 6.875 0 0 0-6.875 6.875c0 2.666 1.729 5.222 3.579 7.175A24.7 24.7 0 0 0 10 18.402a24.724 24.724 0 0 0 3.296-2.895c1.85-1.952 3.579-4.508 3.579-7.174A6.875 6.875 0 0 0 10 1.458m0 17.709-.347.52-.002-.002-.005-.003-.019-.013-.067-.046-.248-.176a25.979 25.979 0 0 1-3.516-3.08c-1.9-2.005-3.921-4.866-3.921-8.034a8.125 8.125 0 1 1 16.25 0c0 3.168-2.021 6.029-3.921 8.034a26 26 0 0 1-3.516 3.08 16 16 0 0 1-.315.222l-.019.013-.005.003-.001.001zm0 0 .347.52a.63.63 0 0 1-.694 0z"}),c("path",{d:"M10 6.458a1.875 1.875 0 1 0 0 3.75 1.875 1.875 0 0 0 0-3.75M6.875 8.333a3.125 3.125 0 1 1 6.25 0 3.125 3.125 0 0 1-6.25 0"})]})}function en({zIndex:e,ref:t,value:n,placeholder:o,onChange:i,results:r,onSelect:l,portalRoot:s,close:d,open:_,overlayPosition:u,isActivated:a,cta:y}){const h=F(null),[v,x]=A(-1),b=mt();j(()=>{x(0)},[r]);const p=a&&r.length>0,m=ie(()=>{if(!(!p||v<0))return`${b}-option-${r[v]?.id}`},[p,v,b,r]);function L(w){const C=r[w];C&&(i(C.mainText),l?.({result:C}),t.current?.blur(),d())}function T(w){if(!p){w.key==="ArrowDown"&&r.length>0&&(w.preventDefault(),_(),x(0)),w.key==="Escape"&&(w.preventDefault(),t.current?.blur());return}switch(w.key){case"ArrowDown":{w.preventDefault(),x(C=>CC>0?C-1:r.length-1);break}case"ArrowRight":{w.preventDefault(),i(r[v]?.mainText||"");break}case"Home":{w.preventDefault(),x(0);break}case"End":{w.preventDefault(),x(r.length-1);break}case"Enter":{v>=0&&(w.preventDefault(),L(v));break}case"Escape":{w.preventDefault(),x(-1),i(""),n||d();break}}}return et(c(P,{children:[c("div",{className:B.overlay,style:{display:a?"block":"none"}}),c("div",{className:B.inputPositioner,style:{...u||{},zIndex:a?1001:e},children:[p&&c("div",{ref:h,id:b,className:B.results,role:"listbox","aria-label":"Suggestions",onMouseDown:w=>w.preventDefault(),children:r.map((w,C)=>{const S=C===v,k=`${b}-option-${w.id}`;return c("div",{id:k,role:"option","aria-selected":S,className:ae(B.result,S&&B.resultActive),onMouseDown:D=>D.preventDefault(),onClick:()=>L(C),onMouseEnter:()=>x(C),tabIndex:-1,children:[w.mainText,c("span",{children:w.secondaryText})]},w.id)})}),c("div",{className:B.inputContainer,children:[c("input",{name:"address-search",ref:t,value:n,onChange:w=>{i(w.target.value)},placeholder:o,autoComplete:"home street-address",className:B.input,onFocus:_,onBlur:d,onKeyDown:T,role:"combobox","aria-expanded":p,"aria-controls":p?b:void 0,"aria-activedescendant":m,"aria-autocomplete":"list"}),c(at,{className:B.mapPin}),!!y&&!a&&c(ve,{title:y,onClick:_})]})]})]}),s)}function tn({zIndex:e,value:t,placeholder:n,cta:o,onChange:i,results:r,onSelect:l,portalRoot:s}){const d=F(null),_=F(null),[u,a]=A(!1),[y,h]=A(null),v=V(()=>{const b=d.current;if(!b)return;const p=b.getBoundingClientRect();h({top:p.top+window.scrollY,left:p.left+window.scrollX,right:p.right+window.scrollX,bottom:p.bottom+window.scrollY,width:p.width,height:p.height})},[]);function x(){v(),a(!0),_.current?.focus()}return j(()=>{const b=d.current;if(!b)return;const p=new ResizeObserver(v);p.observe(b),window.addEventListener("resize",v);let m=null,L=0,T=0;const w=()=>{const C=b.getBoundingClientRect(),S=C.top+window.scrollY,k=C.left+window.scrollX;(Math.abs(S-L)>.5||Math.abs(k-T)>.5)&&(L=S,T=k,h({top:S,left:k,right:C.right+window.scrollX,bottom:C.bottom+window.scrollY,width:C.width,height:C.height})),m=requestAnimationFrame(w)};return u||w(),()=>{m!==null&&cancelAnimationFrame(m),p.disconnect(),window.removeEventListener("resize",v)}},[u,v]),c(P,{children:[c("div",{className:ae(B.autocomplete,u&&B.activated),children:[c("div",{className:B.inputContainer,ref:d,style:{visibility:"hidden"},children:[c("button",{className:ae(B.input,!t&&B.placeholder),type:"button",onClick:x,onFocus:x,children:t||n}),c(at,{className:B.mapPin}),!!o&&c(ve,{title:o,onClick:x})]}),c(en,{zIndex:e,ref:_,value:t,placeholder:n,onChange:i,results:r,onSelect:l,portalRoot:s,close:()=>a(!1),open:x,overlayPosition:y,isActivated:u,cta:o})]}),!!o&&c(ve,{title:o,onClick:x,className:B.mobileBtn})]})}function nn({zIndex:e,onSelect:t,placeholder:n,cta:o,portalRoot:i}){const r=Qt("places"),l=F(null),s=F({}),[d,_]=A(""),u=d.trim(),[a,y]=A({}),[h,v]=A([]);j(()=>{if(!r)return;l.current||(l.current=new r.AutocompleteSessionToken);const p=l.current;y(m=>m[u]||!u?m:{...m,[u]:r.AutocompleteSuggestion.fetchAutocompleteSuggestions({input:u,sessionToken:p,language:"en",includedPrimaryTypes:["premise"]}).then(({suggestions:L})=>(L.forEach(T=>{T.placePrediction?.placeId&&(s.current[T.placePrediction.placeId]=T)}),L))})},[r,u]),j(()=>{if(!u){v([]);return}const p=a[u];p&&p.then(m=>{v(m)})},[a,u]);const x=V(async({result:p})=>{const m=s.current[p.id];m&&(_([m.placePrediction?.mainText?.text,m.placePrediction?.secondaryText?.text].filter(Boolean).join(", ")),await m.placePrediction?.toPlace().fetchFields({fields:["location","formattedAddress","addressComponents"]}).then(({place:L})=>t?.({selection:Wt(L)})),y({}),s.current={},l.current=null)},[t]),b=ie(()=>h.map(p=>({mainText:p.placePrediction?.mainText?.text,secondaryText:p.placePrediction?.secondaryText?.text,id:p.placePrediction?.placeId})),[h]);return c(tn,{zIndex:e,value:d,onChange:_,results:b,onSelect:x,placeholder:n||"Enter your home address",cta:o,portalRoot:i})}function on({placeholder:e,cta:t,isEnergyOnly:n,portalRoot:o,zIndex:i,onSelectEvent:r,onResultEvent:l,onErrorEvent:s}){const[d,_]=A(),[u,a]=A(),[y,h]=A(),[v,x]=A(),[b,p]=A(),m=V(async S=>{if(_(S.selection),r(S),!S.selection)return;const k=await Dt(S.selection,S.confirmAddress,n);if(k.success)if(a(k.data.externalAddressId),k.data.redirectStrategy.isMultiple){h({redirectUrl:k.data.redirectUrl,redirectStrategy:k.data.redirectStrategy,externalAddressId:k.data.externalAddressId}),x(void 0),p(void 0),E("address_search_multiple_utility_result",{selection:S.selection,multipleResult:{redirectUrl:k.data.redirectUrl,redirectStrategy:k.data.redirectStrategy,externalAddressId:k.data.externalAddressId}});return}else if(k.data.redirectStrategy.isMultipleAddresses){x(k.data.redirectStrategy.multipleAddresses),h(void 0),p(void 0),E("address_search_multiple_address_result",{selection:S.selection,multipleResult:k.data.redirectStrategy.multipleAddresses});return}else{if(E("address_search_single_result",{selection:S.selection}),n){x(void 0),h(void 0),p(k.data.redirectUrl);return}l({result:k.data,selection:S.selection})}else E("address_search_no_result",{selection:S.selection}),s({error:k.error})},[n,r,l,s]),L=V(S=>{d&&l({result:{redirectUrl:S},selection:d})},[l,d]),T=V(S=>{m({selection:S,confirmAddress:!1})},[m]),w=V(()=>{h(void 0),x(void 0),_(void 0),a(void 0),p(void 0)},[]),C=d&&(v!=null||y!=null||b!=null);return c(P,{children:[c(nn,{placeholder:e,cta:t,zIndex:i,onSelect:S=>{m({...S,confirmAddress:!0})},portalRoot:o}),C&&et(c(Jt,{address:d?.formattedAddress??"",externalAddressId:u??"",multipleAddressOptions:v,multipleUtilityOptions:y?.redirectStrategy.multiple.options,energySplashRedirectUrl:b,onSelectAddress:T,onTriggerRedirect:L,onBack:w}),o)]})}const rn="._utilityModal_1ga8t_2{position:fixed;inset:0;z-index:10001;display:flex;background-color:#fff}._utilityModalContent_1ga8t_13{width:50%;display:flex;flex-direction:column;padding:32px 56px;overflow-y:auto}._utilityModalImage_1ga8t_21{width:50%;background-image:url(https://bpc-web-static-files.s3.us-east-2.amazonaws.com/Utility-Confirm-Hero-Desktop.jpg);background-size:cover;background-position:right center}._backButton_1ga8t_28{display:flex;align-items:center;justify-content:center;width:40px;height:40px;border:none;background:none;cursor:pointer;color:#0b0e0f;padding:0;margin-left:-8px;flex-shrink:0}._backButton_1ga8t_28:hover{opacity:.7}._utilityModalBody_1ga8t_47{display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}._utilityModalBodyContent_1ga8t_55{display:flex;flex-direction:column;gap:64px;max-width:450px}._utilitySelectContent_1ga8t_62{display:flex;flex-direction:column;gap:64px}._addressLabel_1ga8t_68{font-size:12px;font-weight:500;letter-spacing:.05em;color:#0b0e0f;margin:0 0 12px;text-transform:uppercase}._utilityModalTitle_1ga8t_77{font-size:36px;font-weight:600;color:#0b0e0f;margin:0 0 12px;line-height:1.2;text-wrap:balance}._utilityModalSubtitle_1ga8t_86{font-size:16px;margin:0;line-height:1.5}._utilityOptions_1ga8t_92{display:flex;flex-direction:column;gap:12px;margin-top:32px}._utilityOption_1ga8t_92{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px 24px;border:1px solid #e0e0e0;border-radius:8px;background:#fff;cursor:pointer;transition:border-color .2s,box-shadow .2s}._utilityOption_1ga8t_92:hover{border-color:#ccc;box-shadow:0 2px 8px #00000014}._utilityLogo_1ga8t_120{height:20px;width:auto;object-fit:contain}._utilityName_1ga8t_126{font-size:16px;font-weight:500;color:#0b0e0f}._helpSection_1ga8t_132{margin-top:32px}._helpTitle_1ga8t_136{font-size:14px;font-weight:600;color:#0b0e0f;margin:0 0 8px}._helpText_1ga8t_143{font-size:14px;color:#666;margin:0 0 4px;line-height:1.5}._helpContact_1ga8t_150{font-size:14px;color:#666;margin:12px 0 0;line-height:1.5}._helpContact_1ga8t_150 a{color:#06c;text-decoration:none}._helpContact_1ga8t_150 a:hover{text-decoration:underline}._utilityOptionInner_1ga8t_166{display:flex;justify-content:space-between;width:100%;align-items:center;gap:8px}._enteredAddressSection_1ga8t_175{text-align:left}._addressLabelSmall_1ga8t_179{font-size:12px;font-weight:500;letter-spacing:.05em;color:#666;margin:0 0 4px;text-transform:uppercase}._addressLabelBold_1ga8t_188{font-size:18px;font-weight:700;color:#0b0e0f;margin:0;text-transform:uppercase}._addressSelectContent_1ga8t_196{display:flex;flex-direction:column;margin-top:16px}._addressOptions_1ga8t_202{display:flex;flex-direction:column;gap:12px;margin-top:24px;margin-bottom:24px}._addressOption_1ga8t_202{display:flex;align-items:center;gap:16px;padding:20px 24px;border:1px solid #e0e0e0;border-radius:12px;background:#fff;cursor:pointer;text-align:left}._addressOptionSelected_1ga8t_222{border-color:#77a45a;border-width:2px}._addressRadio_1ga8t_227{flex-shrink:0}._radioCircle_1ga8t_231{width:24px;height:24px;border:2px solid #ccc;border-radius:50%;display:flex;align-items:center;justify-content:center}._radioCircleSelected_1ga8t_241{border-color:#084d41}._radioCircleInner_1ga8t_245{width:12px;height:12px;background-color:#084d41;border-radius:50%}._addressText_1ga8t_252{flex:1}._addressLine1Existing_1ga8t_256{font-size:16px;font-weight:600;color:#084d41;margin:0 0 2px}._addressLine2Existing_1ga8t_263{font-size:16px;font-weight:500;color:#084d41;margin:0}._addressLine1Original_1ga8t_270{font-size:16px;font-weight:600;color:#666;margin:0 0 2px}._addressLine2Original_1ga8t_277{font-size:16px;font-weight:500;color:#666;margin:0}._recommendedBadge_1ga8t_284{font-size:12px;font-weight:400;letter-spacing:.05em;color:#084d41;background-color:#b2dd79;padding:6px 12px;border-radius:4px;text-transform:uppercase;flex-shrink:0}._continueButton_1ga8t_296{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:16px 32px;font-size:16px;font-family:inherit;font-weight:600;color:#084d41;background-color:#d0f585;border:none;border-radius:12px;cursor:pointer;transition:background-color .2s ease-in-out;box-shadow:inset 0 0 0 1px #0b0e0f0d}._continueButton_1ga8t_296:hover{background-color:#ecfad0}@media screen and (max-width:768px){._utilityModal_1ga8t_2{flex-direction:column}._utilityModalContent_1ga8t_13{width:100%;min-width:0;max-width:none;padding:128px 24px 32px;order:2}._utilityModalImage_1ga8t_21{width:100%;flex:none;display:none;order:1}._utilityModalBodyContent_1ga8t_55{width:100%}._backButton_1ga8t_28{position:fixed;top:16px;left:16px;z-index:10002;background:#ffffffe6;border-radius:50%;margin-left:0}._utilityModalBody_1ga8t_47,._addressLabel_1ga8t_68{text-align:center}._utilityModalTitle_1ga8t_77{font-size:28px;text-align:center}._utilityModalSubtitle_1ga8t_86{font-weight:400;text-align:center;text-wrap:balance}._helpSection_1ga8t_132,._enteredAddressSection_1ga8t_175{text-align:center}._addressOption_1ga8t_202{padding:16px 20px}._recommendedBadge_1ga8t_284{font-size:10px;padding:4px 8px}}._splashOverlay_1ga8t_391{position:fixed;inset:0;z-index:10001;background-color:#f0eeeb;display:flex;align-items:center;justify-content:center}._splashCard_1ga8t_401{background:#fff;border-radius:32px;padding:32px;display:flex;flex-direction:column;align-items:center;gap:4px;width:800px}._splashSpinnerWrapper_1ga8t_412{width:48px;height:48px;display:flex;align-items:center;justify-content:center}._splashSpinner_1ga8t_412{width:24px;height:24px;border:2.5px solid #e8e6e3;border-top-color:#1e4d2b;border-radius:50%;animation:_splashSpin_1ga8t_412 .8s linear infinite}._splashCardContent_1ga8t_429{display:flex;flex-direction:column;align-items:center;gap:32px;width:100%}._splashTextGroup_1ga8t_437{display:flex;flex-direction:column;align-items:center;gap:10px;width:100%}._splashTitle_1ga8t_445{font-size:32px;font-weight:600;color:#1c2829;text-align:center;line-height:1.2;margin:0}._splashSubtitle_1ga8t_454{font-size:12px;font-weight:500;color:#7f7d7a;text-align:center;letter-spacing:.2px;margin:0}._splashSteps_1ga8t_463{display:flex;gap:12px}._splashStep_1ga8t_463{display:flex;justify-content:start;align-items:center;gap:6px}._splashStepLabel_1ga8t_475{font-size:12px;font-weight:500;color:#292826;letter-spacing:.2px;white-space:nowrap}._splashStepLabel_1ga8t_475:after{display:block;content:attr(data-label);font-weight:700;height:0;overflow:hidden;visibility:hidden;white-space:nowrap}._splashStepLabelComplete_1ga8t_496{font-size:12px;font-weight:700;color:#1e4d2b;letter-spacing:.2px;white-space:nowrap}@keyframes _splashSpin_1ga8t_412{to{transform:rotate(360deg)}}@media screen and (max-width:768px){._splashCard_1ga8t_401{width:321px}._splashSteps_1ga8t_463{flex-direction:column}._splashTextGroup_1ga8t_437{gap:4px}}",st=":host{--grey-20: #d8d7d5;--grey-90: #999;font:inherit}:host *{box-sizing:border-box}._autocomplete_gbolv_11{position:relative}._input_gbolv_15{position:relative;padding:20px 8px 20px 44px;font-size:16px;line-height:24px;width:100%;background-color:transparent;border:none;outline:none;font-family:inherit;text-align:left}._input_gbolv_15._placeholder_gbolv_28,._input_gbolv_15::placeholder{color:var(--grey-90)}button._input_gbolv_15{cursor:text}._inputContainer_gbolv_37:focus-within{border-color:var(--grey-90);outline:2px solid var(--grey-20);outline-offset:0}._inputContainer_gbolv_37{position:relative;background-color:#fff;border:1px solid transparent;border-radius:8px;overflow:hidden}._activated_gbolv_51 ._inputContainer_gbolv_37{z-index:1001}._inputPositioner_gbolv_55{position:absolute;top:0;left:0;right:0}._mapPin_gbolv_62{position:absolute;pointer-events:none;left:16px;top:50%;transform:translateY(-50%)}._activateButton_gbolv_70{font-size:inherit;font-family:inherit;background:none;border:none;cursor:pointer;color:#084d41;font-weight:600;border-radius:8px;transition:background-color .2s ease-in-out;background-color:#d0f585;padding:8px 20px;box-shadow:inset 0 0 0 1px #0b0e0f0d}._activateButton_gbolv_70:hover{background-color:#ecfad0}._modalButton_gbolv_88{font-size:16px;font-family:inherit;background:none;border:none;cursor:pointer;color:#084d41;font-weight:600;border-radius:12px;transition:background-color .2s ease-in-out;background-color:#d0f585;padding:16px 32px;box-shadow:inset 0 0 0 1px #0b0e0f0d}._modalButton_gbolv_88:hover{background-color:#ecfad0}._modalButtonGroup_gbolv_106{display:flex;justify-content:space-evenly;gap:8px}._inputContainer_gbolv_37>._activateButton_gbolv_70{position:absolute;right:8px;top:8px;bottom:8px}._activateButton_gbolv_70._mobileBtn_gbolv_119{display:none;width:100%;margin-top:8px}._activated_gbolv_51 ._activateButton_gbolv_70{display:none}._overlay_gbolv_129{position:fixed;inset:0;background-color:#292826cc;z-index:1000}._results_gbolv_139{position:absolute;top:100%;left:0;right:0;background:#fff;margin-top:-8px;padding:16px 8px 8px;border-radius:0 0 8px 8px;border-color:var(--grey-90);outline:2px solid var(--grey-20);outline-offset:0}._result_gbolv_139{padding:12px 8px;font-weight:600;border-radius:8px}._result_gbolv_139[aria-selected=true]{background-color:#d0f58555;cursor:default}._result_gbolv_139 span{margin-left:6px;font-size:14px;color:var(--grey-90);font-weight:500}._modal_gbolv_88{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:#fff;border-radius:8px;padding:24px;width:500px;max-width:90vw;aspect-ratio:2 / 1;display:flex;flex-direction:column;overflow:hidden}._modalClose_gbolv_187{position:absolute;top:8px;right:8px;background:none;border:none;font-size:24px;cursor:pointer;padding:4px 8px;line-height:1;z-index:1}._modalContent_gbolv_200{flex:1;min-height:0;overflow:auto}@media screen and (max-width:540px){._input_gbolv_15{padding:12px 8px 12px 40px;line-height:24px}._mapPin_gbolv_62{left:12px}._inputContainer_gbolv_37>._activateButton_gbolv_70{display:none}._activateButton_gbolv_70._mobileBtn_gbolv_119{display:block;padding:14px 20px}._modal_gbolv_88{aspect-ratio:1 / 1;padding:24px}}";function _t(e){const t=e.getAttribute("public-key")||"",n=e.getAttribute("placeholder")||void 0,o=e.getAttribute("cta")||void 0,i=e.getAttribute("is-energy-only")==="true";return{publicApiKey:t,placeholder:n,cta:o,isEnergyOnly:i}}function ct(e){const t=window.getComputedStyle(e);if(t.getPropertyValue("z-index")==="auto"&&e.parentElement)return ct(e.parentElement);const n=Number(t.getPropertyValue("z-index"));return Number.isNaN(n)?0:n}class ln extends HTMLElement{constructor(){super(...arguments);q(this,"shadowRootRef");q(this,"container");q(this,"overlayRoot");q(this,"overlayWrapper");q(this,"reactRoot")}static get observedAttributes(){return["public-key","placeholder","cta","is-energy-only"]}connectedCallback(){if(!this.shadowRootRef){this.shadowRootRef=this.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=st,this.shadowRootRef.appendChild(o),this.container=document.createElement("div"),this.shadowRootRef.appendChild(this.container)}if(!this.overlayRoot){this.overlayWrapper=document.createElement("div"),this.overlayRoot=this.overlayWrapper.attachShadow({mode:"open"});const o=document.createElement("style");o.textContent=st,this.overlayRoot.appendChild(o);const i=document.createElement("style");i.textContent=rn,this.overlayRoot.appendChild(i),document.body.appendChild(this.overlayWrapper)}const n=_t(this);if(!n.publicApiKey)throw new Error("bpc-address-search: public-key is required");Ut({key:n.publicApiKey,v:"weekly",libraries:["places"]}),!this.reactRoot&&this.container&&(this.reactRoot=It(this.container)),this.renderApp()}attributeChangedCallback(){this.renderApp()}disconnectedCallback(){this.reactRoot?.unmount(),this.reactRoot=void 0,this.overlayWrapper?.remove(),this.overlayRoot=void 0,this.overlayWrapper=void 0}renderApp(){if(!this.reactRoot||!this.overlayRoot)return;const n=_t(this),o=ct(this.shadowRootRef?.host);this.reactRoot.render(c($t,{children:c(on,{placeholder:n.placeholder,cta:n.cta,isEnergyOnly:n.isEnergyOnly,portalRoot:this.overlayRoot,zIndex:o,onSelectEvent:i=>this.dispatchEvent(new CustomEvent("select",{detail:i})),onResultEvent:i=>this.dispatchEvent(new CustomEvent("result",{detail:i})),onErrorEvent:i=>this.dispatchEvent(new CustomEvent("error",{detail:i}))})}))}}customElements.define("bpc-address-search",ln)})(); diff --git a/src/address-search/AddressSearch.tsx b/src/address-search/AddressSearch.tsx index e624eda..1f27c28 100644 --- a/src/address-search/AddressSearch.tsx +++ b/src/address-search/AddressSearch.tsx @@ -62,7 +62,7 @@ export function AddressSearch({ sessionToken: curToken, // region: "US", // Don't restrict to US -- this changes the way the formatted address is returned language: "en", - includedPrimaryTypes: ["street_address"], + includedPrimaryTypes: ["premise"], }).then(({ suggestions }) => { suggestions.forEach((suggestion) => { if (!suggestion.placePrediction?.placeId) return;