PageSourceSearch

https://www.kopperfield.com/_next/static/chunks/app/template-d0f9b…?dpl=dpl_84idgN5KEpUykBBvzo8tVCc19yu1

js kopperfield.com collected 2026-10-01 16:33:40 UTC 12,816 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5489],{77455:function(e,n,t){Promise.resolve().then(t.bind(t,69263))},69263:function(e,n,t){"use strict";t.r(n),t.d(n,{default:function(){return G}});var r,i,o,s=t(57437),l=t(19902),a=t(15657),c=t(69250);t(90106);var u=t(16473),d=t(7488),f=t(47146),g=t(2265);function p(){let{logout:e}=(0,u.Tt)(),n=(0,g.useRef)(!1);return(0,g.useEffect)(()=>d.Z.subscribe("unauthenticated_failure",async()=>{if(n.current)return;n.current=!0,d.Z.dispatch("session_expiring");try{await e()}catch(e){}if(window.location.pathname.startsWith("/auth/")){n.current=!1;return}let t=window.location.href.replace(window.location.origin,"");window.location.href=(0,f.T)(t)}),[e]),null}var m=t(31691),h=t(78693),v=t(18856),w=t(19643),y=t(91991),_=t(22048),x=t(12582),j=t(10395),b=t(64681),E=t(80296);let S="dismissedEmergencyAlerts";(i||(i={})).GLOBAL="global",(r=o||(o={})).ERROR="error",r.WARNING="warning",r.INFO="info";let N={error:x.Q6[100],warning:x.er[100],info:x.iN[100]},k=x.MA,I=e=>{let n=(0,j.wf)(S)||null;return(n?new Set(n.split(",")):new Set).has(e.id)},U=e=>{let n=(0,j.wf)(S)||null,t=n?new Set(n.split(",")):new Set;t.add(e.id),(0,j._4)(S,[...t].join(","))},A=e=>{let n=new Date,t=e.startsAt?(0,b.Z)(e.startsAt):null,r=e.endsAt?(0,b.Z)(e.endsAt):null;return(!t||!(n<t))&&(!r||!(n>r))};async function P(e){let n;try{n=await fetch("".concat("https://storage.googleapis.com/kopperfield-prod-emergency-alerts","/").concat(e,".json?").concat(new Date().getTime()))}catch(e){return null}if(200!==n.status)return _.uT("Error loading '".concat(e,"' emergency alert message. Make sure you have a valid json config in 'gs://kopperfield-prod-emergency-alerts/").concat(e,".json.'"),{level:"warning",extra:{status:n.status}}),null;try{return await n.json()}catch(n){return n instanceof SyntaxError&&_.uT("Error parsing '".concat(e,"' emergency alert message. Make sure you have a valid json config in 'gs://kopperfield-prod-emergency-alerts/").concat(e,".json.'"),{level:"warning",extra:{error:n}}),null}}function T(e){let n=(0,m.Z)();return(0,s.jsx)(h.Z,{sx:{fontSize:"0.875rem","p, ul, ol":{marginBottom:n.spacing(1)},"ul, ol":{paddingLeft:n.spacing(2),marginLeft:n.spacing(2)},"p:first-child, ul:first-child, ol:first-child":{marginTop:0},"p:last-child, ul:last-child, ol:last-child":{marginBottom:0}},children:(0,s.jsx)(E.UG,{...e,components:{p(e){let{node:n,className:t,...r}=e;return(0,s.jsx)("p",{...r})},a(e){let{node:n,className:t,...r}=e;return(0,s.jsx)(v.Z,{...r})}}})})}function C(e){let{alertType:n,sx:t}=e,[r,i]=(0,g.useState)(null),o=(0,g.useCallback)(()=>{P(n).then(e=>i(e))},[n]),a=(0,g.useCallback)(()=>{U(r),i(null)},[r]);return((0,g.useEffect)(()=>{o();let e=setInterval(o,3e5);return()=>clearInterval(e)},[o]),!r||!r.enabled||I(r)||!A(r))?null:(0,s.jsx)(h.Z,{sx:t,children:(0,s.jsx)(l.Z,{elevation:1,children:(0,s.jsxs)(w.Z,{direction:"row",alignItems:"start",spacing:4,sx:{backgroundColor:N[r.level]||k},p:2,children:[(0,s.jsx)(h.Z,{sx:{flexGrow:1},children:(0,s.jsx)(T,{children:r.message})}),(0,s.jsx)(y.Z,{color:"inherit",size:"small",onClick:a,children:"Dismiss"})]})})})}function Z(){return(0,s.jsx)(C,{alertType:"global",sx:{position:"fixed",bottom:16,left:"10%",right:"10%",margin:"0 auto",zIndex:9999,maxWidth:800}})}var R=t(87523),O=t(99376),D=t(48667);let B=["/contact-us","/ev","/tesla","/blog"];function L(){let e=(0,O.useSearchParams)(),n=(0,O.usePathname)(),t=e.has("dd_test")||"undefined"!=typeof document&&document.cookie.includes("dd_test=1")||"undefined"!=typeof navigator&&navigator.userAgent.includes("PlaywrightTest"),r="true"===e.get("inApp"),i=null==n?void 0:n.includes("embedded"),o=B.some(e=>null==n?void 0:n.includes(e));return(0,s.jsx)(s.Fragment,{children:!t&&!r&&(!o||100*Math.random()<10)&&(0,s.jsx)(D.default,{id:"full-story",strategy:"lazyOnload",children:"\n            ".concat(i?"window['_fs_is_outer_script'] = true;":"","\n            window['_fs_debug'] = false;\n            window['_fs_host'] = 'fullstory.com';\n            window['_fs_script'] = 'edge.fullstory.com/s/fs.js';\n            window['_fs_org'] = '1838VN';\n            window['_fs_namespace'] = 'FS';\n            (function(m,n,e,t,l,o,g,y){\n                if (e in m) {if(m.console && m.console.log) { m.console.log('FullStory namespace conflict. Please set window[\"_fs_namespace\"].');} return;}\n                g=m[e]=function(a,b,s){g.q?g.q.push([a,b,s]):g._api(a,b,s);};g.q=[];\n                o=n.createElement(t);o.async=1;o.crossOrigin='anonymous';o.src='https://'+_fs_script;\n                y=n.getElementsByTagName(t)[0];y.parentNode.insertBefore(o,y);\n                g.identify=function(i,v,s){g(l,{uid:i},s);if(v)g(l,v,s)};g.setUserVars=function(v,s){g(l,v,s)};g.event=function(i,v,s){g('event',{n:i,p:v},s)};\n                g.anonymize=function(){g.identify(!!0)};\n                g.shutdown=function(){g(\"rec\",!1)};g.restart=function(){g(\"rec\",!0)};\n                g.log = function(a,b){g(\"log\",[a,b])};\n                g.consent=function(a){g(\"consent\",!arguments.length||a)};\n                g.identifyAccount=function(i,v){o='account';v=v||{};v.acctId=i;g(o,v)};\n                g.clearUserCookie=function(){};\n                g.setVars=function(n, p){g('setVars',[n,p]);};\n                g._w={};y='XMLHttpRequest';g._w[y]=m[y];y='fetch';g._w[y]=m[y];\n                if(m[y])m[y]=function(){return g._w[y].apply(this,arguments)};\n                g._v=\"1.3.0\";\n            })(window,document,window['_fs_namespace'],'script','user');\n          ")})})}var W=t(33129),z=t(7995),F=t(83588),M=t(93678);function $(){let e=(0,O.useSearchParams)();return(0,g.useEffect)(()=>{e.get("code")&&(0,j._4)("discount",e.get("code"))},[e]),null}function G(e){let{children:n}=e,t=(0,O.usePathname)();return(0,g.useEffect)(()=>{z.Z.log({event_name:z.Z.EVENT_NAMES.PAGE_LOAD})},[t]),(0,W.Qd)(),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(Z,{}),(0,s.jsx)(c._,{dateAdapter:a.Q,children:(0,s.jsxs)(u.eA,{children:[(0,s.jsx)(p,{}),(0,s.jsx)(M.wT,{anchorOrigin:{vertical:"top",horizontal:"center"}
1,children:(0,s.jsx)(F.WT,{children:(0,s.jsx)(l.Z,{elevation:0,children:n})})})]})}),(0,s.jsxs)(g.Suspense,{fallback:null,children:[(0,s.jsx)(L,{}),(0,s.jsx)(R.z,{}),(0,s.jsx)($,{})]})]})}},87523:function(e,n,t){"use strict";t.d(n,{Z:function(){return d},z:function(){return u}});var r=t(57437),i=t(99376),o=t(48667),s=t(2265);let l=["/provider","/partner","/dashboard","/national-electrical-code-online"];function a(){try{var e;null===(e=window.$crisp)||void 0===e||e.push(["do","chat:hide"])}catch(e){console.error("Error hiding crisp",e)}}let c="crisp-guard-style";function u(){let e=(0,i.usePathname)(),n=l.some(n=>e.startsWith(n));return(0,s.useEffect)(()=>{var e;if(n){if(!document.getElementById(c)){let e=document.createElement("style");e.id=c,e.textContent="#crisp-chatbox { display: none !important; }",document.head.appendChild(e)}return a(),()=>{var e;null===(e=document.getElementById(c))||void 0===e||e.remove()}}null===(e=document.getElementById(c))||void 0===e||e.remove()},[n]),null}function d(){let e=(0,i.useSearchParams)(),n=(0,i.usePathname)(),t=e.has("dd_test")||"undefined"!=typeof document&&document.cookie.includes("dd_test=1")||"undefined"!=typeof navigator&&navigator.userAgent.includes("PlaywrightTest"),c=l.some(e=>n.startsWith(e)),u=!t&&!c;return(0,s.useEffect)(()=>{if(u)return window.$crisp||(window.$crisp=[],window.CRISP_WEBSITE_ID="e4c48d96-d634-4ddb-a2ff-c11c228d2ed1"),function(){try{var e;null===(e=window.$crisp)||void 0===e||e.push(["do","chat:show"])}catch(e){console.error("Error showing crisp",e)}}(),()=>{a()};a()},[u]),u?(0,r.jsx)(o.default,{src:"https://client.crisp.chat/l.js",strategy:"lazyOnload",onLoad:()=>{window.$crisp||(window.$crisp=[]),window.CRISP_WEBSITE_ID||(window.CRISP_WEBSITE_ID="e4c48d96-d634-4ddb-a2ff-c11c228d2ed1")}}):null}},16473:function(e,n,t){"use strict";t.d(n,{Tt:function(){return _},eA:function(){return x}});var r=t(57437),i=t(81990),o=t(51251),s=t(67224),l=t(24585),a=t(73502),c=t(45600),u=t(69257),d=t(10395),f=t(62149),g=t(97930),p=t(2265),m=t(14273);let h=p.createContext({user:null,loading:!0,error:null,logout:async()=>{},loggingOut:!1,refetch:async()=>{}}),v=(e,n)=>{let{onSessionInvalidated:t}=n,r=(0,p.useRef)(!1),{lastMessage:i}=(0,m.useWebSocket)("".concat("wss://admin.kopperfield.com","/ws/session/").concat(e),{shouldReconnect:()=>!1===r.current});return(0,p.useEffect)(()=>(r.current=!1,()=>{r.current=!0}),[]),(0,p.useEffect)(()=>{i&&"session.invalidated"===JSON.parse(i.data).type&&t()},[i]),{lastMessage:i}};function w(e){let{sessionId:n,onSessionInvalidated:t}=e;return v(n,{onSessionInvalidated:t}),null}function y(e){var n;let t=(0,p.useRef)(0),{client:o,data:a,loading:m,error:v,refetch:y}=(0,g.XC6)({}),[_,{loading:x}]=(0,g._y5)(),j=async()=>{try{await _(),o.resetStore()}catch(e){console.error(e)}},b=(0,p.useCallback)(async()=>{await y()},[y]),E=(0,p.useCallback)(()=>{Date.now()-t.current>432e5&&(y(),t.current=Date.now())},[y,t]);return(0,l.Cs)(E),(0,i.l)(b),(0,p.useEffect)(()=>{if(null==a?void 0:a.currentUser)try{var e,n,r,i,o,l,g,p,m,h,v;s.av({id:a.currentUser.id,email:a.currentUser.email});let t=null!==(h=null!==(m=null===(n=a.currentUser.providers)||void 0===n?void 0:null===(e=n[0])||void 0===e?void 0:e.partner)&&void 0!==m?m:null===(r=a.currentUser.partners)||void 0===r?void 0:r[0])&&void 0!==h?h:null,w=null==t?void 0:t.referralTrialEnd,y=!!w&&new Date(w).getTime()>Date.now();s.YA("on_referral_trial",y),s.YA("subscription_status",null!==(v=null==t?void 0:t.subscriptionStatus)&&void 0!==v?v:"free_or_unknown"),(0,u.KO)(a.currentUser.id,{displayName:(0,f.b)(a.currentUser),email:a.currentUser.email,phoneNumber:a.currentUser.phone,plan:(null===(l=a.currentUser.providers)||void 0===l?void 0:null===(o=l[0])||void 0===o?void 0:null===(i=o.partner)||void 0===i?void 0:i.subscriptionNickname)||(null===(p=a.currentUser.partners)||void 0===p?void 0:null===(g=p[0])||void 0===g?void 0:g.subscriptionNickname),onReferralTrial:y}),(0,d._4)("last_login_info",(0,c.o)(JSON.stringify({email:a.currentUser.email,phone:a.currentUser.phone})))}catch(e){console.error("Failed to identify user in Sentry/FS",e)}t.current=Date.now()},[a]),(0,r.jsxs)(h.Provider,{value:{user:null==a?void 0:a.currentUser,loading:m||!a&&!v,error:v,logout:j,loggingOut:x,refetch:b},children:[e.children,(null==a?void 0:null===(n=a.currentUser)||void 0===n?void 0:n.currentSessionId)&&(0,r.jsx)(w,{sessionId:a.currentUser.currentSessionId,onSessionInvalidated:y})]})}function _(){return(0,p.useContext)(h)}function x(e){return(0,r.jsx)(o.e,{client:a.ZP,children:(0,r.jsx)(y,{children:e.children})})}},47146:function(e,n,t){"use strict";function r(e){var n,t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=null==e?void 0:null===(t=e.incompleteStripeCustomers)||void 0===t?void 0:null===(n=t[0])||void 0===n?void 0:n.checkoutSessionId;return r?r:i?"/subscription/onboarding?session=".concat(i):0!==e.providers.length?"/provider/".concat(e.providers[0].slug):0!==e.partners.length?"/partner/".concat(e.partners[0].slug):e.customer&&0!==e.customer.projects.length?"/dashboard/".concat(e.customer.projects[0].id):0===e.providers.length?"/auth/signup":"/"}function i(e){let n=new URLSearchParams({next:e});return"true"===new URL(e,"http://localhost").searchParams.get("inApp")&&n.set("inApp","true"),"/auth/login?".concat(n.toString())}t.d(n,{H:function(){return r},T:function(){return i}})},62149:function(e,n,t){"use strict";function r(e){return e.firstName&&e.lastName?"".concat(e.firstName," ").concat(e.lastName).trim():e.firstName?e.firstName.trim():e.lastName?e.lastName.trim():e.email||"Unknown User"}t.d(n,{b:function(){return r}})},81990:function(e,n,t){"use strict";t.d(n,{l:function(){return l}});var r=t(16473),i=t(99376),o=t(2265),s=t(2208);function l(e){let{user:n}=(0,r.Tt)(),t=(0,i.useSearchParams)(),l=(null==n?void 0:n.id)?"".concat("wss://admin.kopperf
1ield.com","/ws/partner_entitlement/").concat(n.id):null,{lastMessage:a}=(0,s.ZP)(l,{shouldReconnect:()=>!0});(0,o.useEffect)(()=>{if(null==a?void 0:a.data)try{let n=JSON.parse(a.data);"partner.entitlement.updated"===n.type&&(null==e||e())}catch(e){console.error("Error parsing websocket message:",e)}},[a,e]),(0,o.useEffect)(()=>{if("true"===t.get("refetch_entitlements")){var n,r,i,o;null==e||e();let t=new URL((null===(r=window)||void 0===r?void 0:null===(n=r.location)||void 0===n?void 0:n.href)||"");t.searchParams.delete("refetch_entitlements"),null===(o=window)||void 0===o||null===(i=o.history)||void 0===i||i.replaceState({},"",t.toString())}},[t,e])}}},function(e){e.O(0,[6990,8760,1910,9068,7749,9643,9478,3091,77,393,2713,4560,3593,2006,2078,3250,2957,6709,2195,8325,8725,7930,5552,5122,3502,2971,9129,1744],function(){return e(e.s=77455)}),_N_E=e.O()}]);

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