PageSourceSearch

https://www.zenbusiness.com/cdn-assets/dashboard-ui/static/js/2788.6bd5ff3f2a2c8c269faf.chunk.js

js zenbusiness.com collected 2026-10-09 21:37:03 UTC 5,008 bytes, 42 lines download raw bytes

1"use strict";(self.webpackChunk_zenbusiness_dashboard_ui=self.webpackChunk_zenbusiness_dashboard_ui||[]).push([[2788],{323:function(e,t,n){n.d(t,{IT:function(){return r.A},J1:function(){return a.A},W3:function(){return u.A},XM:function(){return o.A},jE:function(){return c.A},m2:function(){return s.A},n_:function(){return i.A}});var r=n(40834),u=n(17368),i=n(84923),o=(n(55633),n(37648)),a=n(22842),c=(n(49116),n(32287)),s=n(12490)},42788:function(e,t,n){n.r(t),n.d(t,{GET_ACCOUNT_QUERY:function(){return h},IdentityContext:function(){return u},IdentityProvider:function(){return A},useCreateAccount:function(){return N},useIdentity:function(){return i}});var r=n(50318);const u=(0,r.createContext)(null);function i(){return(0,r.useContext)(u)||null}var o=n(22422),a=n(41524),c=n(94046),s=n(323),l=n(93560),m=n(19299);function d(...e){return e.map(e=>e&&String(e).trim()).filter(Boolean).join(" ")}function f(e,t){const n=(0,r.useRef)(!0);(0,r.useEffect)(()=>{if(!n.current)return e();n.current=!1},t)}var p=n(85582);const h=s.J1`
2  query CurrentAccount {
3    account {
4      uuid
5      createdAt
6    },
7    user {
8      uuid
9      contact {
10        email
11        firstName
12        lastName
13        phone
14      }
15    }
16  }
17`;function g({onChange:e,children:t}){const{authenticated:n,accountUuid:i,userUuid:o,employeeEmail:g,employeeGivenName:y,employeeFamilyName:A,obo:C}=(0,c.useAuthentication)(),N=!!n&&!!i&&!!o,{loading:w,data:E,refetch:$,error:v,errors:S}=(0,s.IT)(h,{noThrow:!0,skip:!N});(0,m.useError)(S);const x=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!N)return void(x.current=null);const e=x.current;x.current={account:i,user:o},null===e||e.account===i&&e.user===o||$()},[N,i,o,$]);const{account:b=null,user:U=null}=E||{},{uuid:_,createdAt:T}=b||{},{uuid:B,contact:{email:j,firstName:k,lastName:q,phone:W}={}}=U||{},I=!!(n&&_&&B),Z=(0,l.A)(()=>{if(!C)return null;try{return{email:g,firstName:y,lastName:A,name:d(y,A)}}catch(e){return null}}),O=I&&T?new Date(T):null,G={type:"customer",employeeEmail:Z?.email,employeeName:Z?.name,obo:!!C,accountUuid:_,accountEmail:j,accountCreatedAt:O,createdAt:O,userUuid:B,email:j,firstName:k,lastName:q,name:I?d(k,q):"",phone:W};f(()=>{e&&e(n&&I&&G||void 0)},[e,n,_,B,G.name]);const J=(0,a.A)({loading:w,error:v,authenticated:n,type:I?"customer":null,identified:I,...I&&!w?G:{},user:I&&!w?G:{}});return"function"===typeof t&&(t=t(J)),(0,p.jsx)(u.Provider,{value:J,children:t})}function y({onChange:e,children:t}){const{authenticated:n,employeeEmail:r,employeeGivenName:i,employeeFamilyName:o,permissions:s}=(0,c.useAuthentication)(),l=!(!n||!r),m=l?d(i,o):null,h={type:"employee",employeeEmail:r,employeeName:m,accountUuid:null,accountEmail:null,userUuid:null,email:r,firstName:i,lastName:o,name:m,permissions:new Set(s),createdAt:null,accountCreatedAt:null,obo:!1};f(()=>{e&&e(n&&l&&h||void 0)},[e,n,h.email,h.name]);const g=(0,a.A)({loading:!1,authenticated:n,type:"employee",identified:l,...h,user:h});return"function"===typeof t&&(t=t(g)),(0,p.jsx)(u.Provider,{value:g,children:t})}function A(e){const t=(0,r.useContext)(u),{type:n}=(0,c.useAuthentication)(),{children:i}=e;return t?"function"===typeof i?i(t):i:"employee"===n?(0,p.jsx)(y,{...e}):(0,p.jsx)(g,{...e})}g.propTypes={onChange:o.func},y.propTypes={onChange:o.func},A.propTypes={onChange:o.func};const C=s.J1`
18  mutation CreateAccount(
19    $email: String!,
20    $firstName: String!,
21    $lastName: String!,
22    $password: String!,
23    $phone: String!,
24    $middleName: String,
25    $signupClient: String,
26    $suffix: String,
27    $termsAccepted: Boolean
28  ) {
29    findOrCreateAccount(input: {
30      email: $email,
31      firstName: $firstName,
32      lastName: $lastName,
33      password: $password,
34      phone: $phone,
35      middleName: $middleName,
36      signupClient: $signupClient,
37      suffix: $suffix,
38      termsAccepted: $termsAccepted
39    })
40  }
41`;function N(e={}){const[t,{data:n,error:u,errors:i,loading:o}]=(0,s.n_)(C,{noThrow:!0,...e});(0,m.useError)(i);const c=(0,r.useCallback)(async({email:e,firstName:n,lastName:r,middleName:u,password:i,phone:o,signupClient:a,suffix:c,termsAccepted:s})=>{if(!e||!String(e).trim().length)throw new m.ZBError("useCreateAccount requires an email.",{logWorthy:!1});if(!n||!String(n).trim().length)throw new m.ZBError("useCreateAccount requires a first name.",{logWorthy:!1});if(!r||!String(r).trim().length)throw new m.ZBError("useCreateAccount requires a last name.",{logWorthy:!1});if(!i||!String(i).trim().length)throw new m.ZBError("useCreateAccount requires a password.",{logWorthy:!1});if(!o||!String(o).trim().length)throw new m.ZBError("useCreateAccount requires a phone number.",{logWorthy:!1});const l=await t({variables:{email:e,firstName:n,lastName:r,middleName:u,password:i,phone:o,signupClient:a,suffix:c,termsAccepted:s}});
41return{accountUuid:l.data?.findOrCreateAccount,error:l.error}},[t]);return(0,a.A)({accountUuid:n?.findOrCreateAccount,error:u,loading:o,create:c})}}}]);
42//# sourceMappingURL=2788.6bd5ff3f2a2c8c269faf.chunk.js.map

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.