1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bde63e44-0f55-4fd6-bf24-e7ca29baa544",e._sentryDebugIdIdentifier="sentry-dbid-bde63e44-0f55-4fd6-bf24-e7ca29baa544")}catch(e){}}();var _global="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_global.SENTRY_RELEASE={id:"45d996ec00b3dbb0b82e39a0d08246fd329cbef0"},(()=>{"use strict";var e,t,n,a={30215:(e,t,n)=>{n.d(t,{v:()=>a});const a=["text","dropdown","number","date","time","datetime","boolean"]},42149:(e,t,n)=>{n.d(t,{a:()=>a});const a={popupLocked:"Your browser is blocking popups, please allow them to proceed: More info: https://support.mozilla.org/en-US/kb/pop-blocker-settings-exceptions-troubleshooting",101:{title:"Initial configuration required",description:"The platform encountered an error retrieving information from Facebook. <br/> To be able to continue the configuration, you need to create an initial setting (on the Business Manager page).",helpers:[{title:"Manage access to external data in Facebook",description:"Control how Facebook imports data from apps."},{title:"Manage data connections",description:"Determine whether apps can import data to Facebook on a continuous basis."}]},messages:{tokenError:"hey something happened and we are not able to properly connect to FB. Sometimes (only the 1st time) this happens and itâs normal, can you please Retry and enjoy?!"}}},67836:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(18655),o=n(73087);const r=(e,t)=>new a.HM(200,{},{data:{schemaSettings:[{id:"segmentId",type:"google_picker",label:"Google Spreadsheet",order:1,default:null,required:!0,data:[{id:"17l4EILlMz64mPkbOk8Qni64Y2uVxOVS6o5pJlyJ8zc8",text:"June - LB Kw research 2024"},{id:"accessToken",text:"ya29.a0AXooCguvjKmab8Fe40IOaLVjtJYkglqN4lUyWHOOgswZFTrR_Qejj4XOALW-xTy0BCc100VViyF5fBaC-u0Gg9799Vw_mCQoWFAU8PrZEE8ZVV1-LIp6RwxpU9Jgt9LSrzIQfU71CFBJ-gPhR6-ILAxMU_A8NdYJFEMoCAaCgYKAZcSARASFQHGX2MieTMO6TzsgakUT0llNGgoiA0173"}],refreshable:!0},{id:"listId",hide:!0,type:"text",label:"OR Google Spreadsheet Id",order:2,docUrl:"https://community.activeprospect.com/posts/5090366-how-leadsbridge-counts-the-custom-audiences-contacts",default:"",tooltip:"This value is optional and you could specify the sheet in the Bridge configuration but if you have more than 500 sheets in your Google Account, it is important to specify here otherwise leave it blank.",hasChild:!0,required:!1,refreshable:!1},{id:"moreSettings",type:"toggle",label:"More Settings",order:4,default:0,tooltip:"",hasChild:!0,required:!1,refreshable:!1}]}}),i=()=>(0,a.n0)({routes(){this.post(o.H.chooseIntegrationSettings,r,{timing:1e3}),this.passthrough(),this.passthrough("https://fg8vvsvnieiv3ej16jby.litix.io"),this.passthrough("http://pipedream.wistia.com/*"),this.passthrough("https://api.segment.io/*"),this.passthrough("https://cdn.segment.com/*"),this.passthrough("https://leadsbridge.com/api/**"),this.passthrough("https://api3.leadsbridge.com/api/**"),this.passthrough("https://www.facebook.com/**"),this.passthrough("https://www.web.facebook.com/**"),this.passthrough("https://web.facebook.com/**"),this.passthrough("https://cognito-idp.us-west-2.amazonaws.com/"),this.passthrough("https://cognito-idp.us-west-2.amazonaws.com/**"),this.passthrough("https://leadsbridge.auth.us-west-2.amazoncognito.com/oauth2/token")}})},8543:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(89526);const o=()=>((0,a.useEffect)((()=>{window.close()}),[]),a.createElement("div",null))},45736:(e,t,n)=>{n.d(t,{Z:()=>ie});var a=n(89526),o=n(85582),r=n(45808),i=n(33649),l=n(81463),s=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};class d{}d.getSheetsUrl="/fbAppStore/v2/getSpreedSheets",d.getSpreedSheetTabsUrl="/fbAppStore/v2/getSpreedSheetTabs",d.getPlatformAuthUrl="/fbAppStore/v2/getPlatformAuth",d.doPlatformAuthUrl="/fbAppStore/v2/doPlatformAuth",d.generateExternalBusinessIdUrl="/fbAppStore/v2/generateExternalBusinessId",d.saveSheetSelectionUrl="/fbAppStore/v2/doSpreedSheetConfig",d.saveSegmentSelectionUrl="/fbAppStore/v2/doSegmentConfig",d.getSegmentTypesUrl="/fbAppStore/v2/getSegmentTypes",d.segmentUrls="/fbAppStore/v2/getSegments",d.getPlatformCapabilitiesUrl="/fbAppStore/v2/getPlatformCapabilities",d.doPublishBridgesUrl="/fbAppStore/v2/doPublishBridges",d.get
1SyncDataLinksUrl="/fbAppStore/v2/getSyncDataLinks",d.getSheets=e=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((t=>t.get("https://leadsbridge.com/api"+d.getSheetsUrl+"?platformId="+e).then((e=>e.data))))})),d.getSpreadSheetTabs=(e,t)=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((n=>n.get("https://leadsbridge.com/api"+d.getSpreedSheetTabsUrl+"?platformId="+e+"&sheetId="+t).then((e=>e.data))))})),d.getPlatformAuth=e=>s(void 0,void 0,void 0,(function*(){const t="https://leadsbridge.com/api"+d.getPlatformAuthUrl;return yield(0,l.Y)().then((n=>n.get(t+"?platformId="+e).then((e=>e.data))))})),d.doPlatformAuth=(e,t)=>s(void 0,void 0,void 0,(function*(){const n="https://leadsbridge.com/api"+d.doPlatformAuthUrl;return yield(0,l.Y)().then((a=>a.post(n+"?platformId="+t,{fields:e}).then((e=>e.data))))})),d.generateExternalBusinessId=()=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((e=>e.get("https://leadsbridge.com/api"+d.generateExternalBusinessIdUrl,{}).then((e=>e.data))))})),d.segmentTypes=e=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((t=>t.get("https://leadsbridge.com/api"+d.getSegmentTypesUrl+"?platformId="+e).then((e=>e.data))))})),d.getSegments=(e,t)=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((n=>n.get("https://leadsbridge.com/api"+d.segmentUrls+"?segmentType="+t+"&platformId="+e).then((e=>e.data))))})),d.saveSegmentSelection=(e,t,n)=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((a=>a.post("https://leadsbridge.com/api"+d.saveSegmentSelectionUrl,{segmentType:t,segmentId:n,platformId:e}).then((e=>e.data))))})),d.saveSheetSelection=(e,t,n)=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((e=>e.post("https://leadsbridge.com/api"+d.saveSheetSelectionUrl,{sheetId:t,tabId:n}).then((e=>e.data))))})),d.getPlatformCapabilities=e=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((t=>t.get("https://leadsbridge.com/api"+d.getPlatformCapabilitiesUrl+"?platformId="+e).then((e=>e.data))))})),d.doPublishBridges=(e,t,n,a)=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((o=>o.post("https://leadsbridge.com/api"+d.doPublishBridgesUrl,{platformId:e,entities:t,limitedDataUse:n,adsDeliveryOptimization:a}).then((e=>e.data))))})),d.getSyncDataLinks=()=>s(void 0,void 0,void 0,(function*(){return yield(0,l.Y)().then((e=>e.get("https://leadsbridge.com/api"+d.getSyncDataLinksUrl).then((e=>e.data))))}));var c=n(8666),u=n(43666),p=n(99459),m=n(48961),g=n(77398),v=n(71168),h=n(15276),f=n(32329),b=n(42149),E=n(60609);const y=({setOpen:e,setAPIresponse:t})=>{const n=(0,i.v9)((e=>e.appStore.platformId)),[o,r]=(0,a.useState)(!0),[l,s]=(0,a.useState)({}),[y,S]=(0,a.useState)(""),[I,w]=(0,a.useState)({}),[k,T]=(0,a.useState)("");(0,a.useEffect)((()=>{let a=!0;return n>0&&((0,E.m)(E.V.PlatformInvoked),d.getPlatformAuth(n).then((e=>{if(a&&e.oauth2RedirectUrl);else{S(e.helpUrl);const t={};Object.keys(e.authFields).map((e=>{t[e]=""})),s(t),w(e.authFields)}})).catch((n=>{if(101!==n.response.data.errorCode)return null;t(n.response.data),e(!0)})).finally((()=>{r(!1)}))),()=>{a=!1}}),[n]);return a.createElement(c.Z,{style:{border:"none",boxShadow:"none"}},a.createElement(u.Z,{inverted:!0,active:0===n||o,style:{marginTop:"50px"}},a.createElement(p.Z,null,"Loading")),!o&&0!==n&&a.createElement(m.Z,{style:{paddingTop:"2em",paddingBottom:"2em"},method:"POST",error:""!==k},a.createElement("div",{style:{textAlign:"center"}},a.createElement("img",{alt:"Platform logo",src:`https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-logos/logo${n}.png`})),a.createElement("br",null),l&&0!==Object.keys(l).length?a.createElement(a.Fragment,null,Object.keys(l).map(((e,t)=>a.createElement(m.Z.Input,{key:"field-"+t,label:I[e]+" *",onChange:t=>{const n=Object.assign({},l);n[e]=t.target.value,s(n)}}))),a.createElement("p",{style:{opacity:.6}},a.createElement("sup",null,"*")," Fields mandatory"),a.createElement("a",{href:y,target:"_blank",rel:"noreferrer"},a.createElement(v.Z,null,a.createElement(h.Z,{name:"external alternate"})," What are those fields?")),a.createElement("div",null,a.createElement(g.Z,{style:{marginTop:"1em"},color:"blue",size:"large",fluid:!0,className:o?"loading":"",onClick:()=>{let e=!1;Object.values(l).forEach((t=>{""===t&&(e=!0)})),e?T("All fields are required"):(r(!0),d.doPlatformAuth(l,n).then((e=>{(0,E.m)(E.V.PlatformAuthorized)})).catch((e=>{var t,n,a;(0,E.m)(E.V.PlatformError),T(null!==(a=null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.errorMessage)&&void 0!==a?a:"Error")})).finally((()=>{r(!1)})))}},"Authorize"))):a.createElement("div",{style:{textAlign:"center"}},a.createElement(g.Z,{style:{marginTop:"1em"},color:"blue",size:"large",fluid:!0,onClick:()=>{const e=window.screen.width/2-560,t=window.open("https://leadsbri
1dge.com/api/fbAppStore/v2/doOauth2?platformId="+n,"ModalPopUp",`toolbar=no,\n scrollbars=no, location=no, statusbar=no, menubar=no,\n resizable=0, width=1120, height=720, left=${e}, top=234`);!t||t.closed||void 0===t.closed?(T(b.a.popupLocked),setTimeout((()=>T("")),5e3),(0,E.m)(E.V.PlatformError)):(0,E.m)(E.V.PlatformAuthorized)}},"Authorize")),""!==k&&a.createElement(f.Z,{error:!0,header:"Error",content:k})))};var S=n(85590),I=n(69936),w=n(81822),k=n(64012);const T={googleSheet:[{index:0,values:[r.o.PLATFORMAUTHENTICATION,r.o.NONE],name:"Connect"},{index:1,values:[r.o.SPREADSHEETSELECTION],name:"Select document"},{index:2,values:[r.o.PLATFORMCONFIGURATION],name:"Review & confirm"},{index:3,values:[r.o.PUBLISH],name:"Sync data"}],newType:[{index:0,values:[r.o.PLATFORMAUTHENTICATION,r.o.NONE],name:"Connect"},{index:1,values:[r.o.STATUS_SEGMENTATION_SELECTION],name:"Select document"},{index:2,values:[r.o.PLATFORMCONFIGURATION],name:"Review & confirm"},{index:3,values:[r.o.PUBLISH],name:"Sync data"}],default:[{index:0,values:[r.o.PLATFORMAUTHENTICATION,r.o.NONE],name:"Connect"},{index:1,values:[r.o.PLATFORMCONFIGURATION],name:"Review & confirm"},{index:2,values:[r.o.PUBLISH],name:"Sync data"}]};var x=n(26809);const C=(0,a.forwardRef)(((e,t)=>{const n=(0,i.I0)(),o=(0,i.v9)((e=>e.appStore.platformId)),[r,l]=(0,a.useState)("default"),[s,c]=(0,a.useState)(""),[h,b]=(0,a.useState)([]),[y,C]=(0,a.useState)(""),[A,L]=(0,a.useState)([]),[U,N]=(0,a.useState)(!1),[P,$]=(0,a.useState)(!1),[O,Z]=(0,a.useState)(!1),[B,D]=(0,a.useState)(!0);(0,a.useEffect)((()=>{T.googleSheet===e.steps&&l("google")}),[]),(0,a.useEffect)((()=>{o>0&&d.getPlatformCapabilities(o).then((e=>{c(e.PlatformName||"source"),b(e.Entities)})).finally((()=>D(!1)))}),[o]);return a.createElement("div",null,a.createElement(S.Z,{as:"h1"},"Review configuration"),a.createElement(u.Z,{inverted:!0,active:0===o||B,style:{marginTop:"50px"}},a.createElement(p.Z,null,"Loading")),a.createElement("p",null,"google"===r?"Choose ":"Select "," the objects to sync and check below some examples of the data that will be synced.",a.createElement("br",null),"Continuing to the next step you authorize LeadsBridge sends these data to Facebook."),a.createElement(I.Z,{divided:!0,relaxed:!0},Object.keys(h).map(((e,t)=>a.createElement(I.Z.Item,{style:{display:"flex",alignItems:"center",padding:"1em"},onClick:t=>{if("google"===r)C(e);else{const t=[...A],n=t.indexOf(e);0>n?t.push(e):t.splice(n,1),L(t)}},key:"entity-"+t},"google"===r?a.createElement(w.Z,{checked:y===e}):a.createElement(k.Z,{checked:A.indexOf(e)>=0}),a.createElement(I.Z.Content,{style:{marginLeft:"15px"}},a.createElement(I.Z.Description,{as:"a"},h[e].Label),a.createElement(I.Z.Description,null,Object.keys(h[e].SourceMappedFields).map((t=>a.createElement(v.Z,{style:{marginBottom:"3px"}},h[e].SourceMappedFields[t]))))))))),a.createElement(f.Z,{style:{marginTop:"35px"}},a.createElement(f.Z.Header,null,"Changes in Service"),a.createElement("p",null,"Decide what Facebook can do automatically with data from"," ",s),a.createElement(m.Z,null,a.createElement(m.Z.Field,null,a.createElement(m.Z.Checkbox,{label:"Ads Delivery Optimization",onClick:()=>N(!U),checked:U}),a.createElement("p",{style:{marginLeft:"1.85714em",marginTop:"-10px",marginBottom:"10px",opacity:.6}},"Allow Facebook to make subtle adjustements to your campaing to maximize performance.")),a.createElement(m.Z.Field,{style:{marginTop:"25px"}},a.createElement(m.Z.Checkbox,{label:"Limited Data Use",onClick:()=>$(!P),checked:P}),a.createElement("p",{style:{marginLeft:"1.85714em",marginTop:"-10px",opacity:.6}}," ","Communicate when customer in California have opted out of the sale of data as defined by the CCPA.")))),a.createElement("div",{style:{textAlign:"right"}},a.createElement(g.Z,{color:"blue",className:O?"loading disabled":"",disabled:O,onClick:()=>(()=>{const e=("google"===r?[y]:A).filter((function(e){return null!=e&&""!==e}));0!==e.length?(Z(!0),(0,E.m)(E.V.PlatformCompleted),d.doPublishBridges(o,e,U,P).then((e=>{})).catch((e=>{var t,a,o;const r=null!==(o=null===(a=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===a?void 0:a.errorMessage)&&void 0!==o?o:"An internal error occurred, please try again later.";n((0,x.GD)({title:"An error occurred",messages:[r],color:"negative"}))})).finally((()=>{Z(!1)}))):n((0,x.GD)({title:"Warning",messages:["Fields are required"],color:"warning"}))})()},"Start sync")))})),A=C;var L=n(84765),U=n(54708),N=n(78931),P=n(7124),$=n(73961),O=n(8260);const Z=O.ZP.div` 2 display: flex; 3 width: 100%; 4 .search { 5 width: 100%; 6 } 7 &#document-search .results { 8 // use searchResultHeight 9 max-height: 210px; 10 overflow-y: auto; 11 } 12 &#worksheet-search .results { 13 max-height: 150px; 14 overflow-y: auto; 15 } 16`,B=(0,a.forwardRef)(((e,t)=>{const n=(0,i.I0)(),o=(0,i.v9)((e=>e.appStore.platformId)),[r,l]=(0,a.useState)(""),[s,u]=(0,a.useState)(""),[p,v]=(0,a.useState)(""),[b,E]=(0,a.useState)(!0),[y,I]=(0,a.useState)(""),[w,k]=(0,a.useState)(""),[C,A]=(0,a.useState)([]),[O,B]=(0,a.useState)(!1),[D,_]=(0,a.useState)(""),R=(0,a.createRef)(),[F,M]=(0,a.useState)(""),[j,V]=(0,a.useState)([]),z=(0,a.createRef)(),[G,H]=(0,a.useState)([]),[q,Y]=(0,a.useState)([]),[J,W]=(0,a.useState)(!1),[X,K]=(0,a.useState)(""),[Q,ee]=(0,a.useState)(!1);(0,a.useEffect)((()=>
16{""!==w&&""!==X&&(ne(),B(!0),"google"===X?d.getSpreadSheetTabs(o,w).then((e=>{Y(e.Tabs)})).catch((e=>{var t,a,o;const r=null!==(o=null===(a=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===a?void 0:a.errorMessage)&&void 0!==o?o:"An internal error occurred, please try again later.";n((0,x.GD)({title:"An error occurred",messages:[r],color:"negative"}))})).finally((()=>{B(!1)})):d.getSegments(o,w).then((e=>{Y(e.segments)})).catch((e=>{var t,a,o;const r=null!==(o=null===(a=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===a?void 0:a.errorMessage)&&void 0!==o?o:"An internal error occurred, please try again later.";n((0,x.GD)({title:"An error occurred",messages:[r],color:"negative"}))})).finally((()=>{B(!1)})))}),[w,X]),(0,a.useEffect)((()=>{""!==F&&ne()}),[F]);let te=null;const ne=()=>{const e=document.getElementsByClassName("results");for(let t=0;e.length>t;t++)e[t].style.display="none";document.removeEventListener("click",ne),te=null};return(0,a.useEffect)((()=>{o>0&&""!==X&&("google"===X?d.getSheets(o).then((e=>{u(e.sheetTemplateUrl),v(e.documentationTemplateUrl);const t=[];for(let n=0;e.sheets.length>n;n++){const a=Object.assign({},e.sheets[n]);a.key=a.sheetId,t.push(a)}H(t)})).finally((()=>{E(!1)})):d.segmentTypes(o).then((e=>{H(e.segmentTypes)})).finally((()=>{E(!1)})))}),[o,X]),(0,a.useEffect)((()=>{K(T.newType===e.steps?"newType":"google")}),[]),a.createElement(a.Fragment,null,"google"===X&&a.createElement(c.Z,null,a.createElement(S.Z,{as:"h4"},"STEP 1"),a.createElement("p",null,"In order to enable our mapping configuration, please use our google sheet template and place it in your Google Drive."),a.createElement("p",null,"Download our template and follow the instructions."),a.createElement("div",{style:{display:"flex"}},a.createElement(g.Z,{icon:!0,labelPosition:"left",onClick:()=>{window.open(s,"_blank")}},a.createElement(h.Z,{name:"download"})," Download the template"),a.createElement(g.Z,{icon:!0,labelPosition:"left",onClick:()=>{window.open(p,"_blank")}},a.createElement(h.Z,{name:"download"})," How to configure the document"))),a.createElement(c.Z,null,a.createElement(S.Z,{as:"h4"},"STEP ","google"===X?2:1),a.createElement("p",null,"Select the ","google"===X?"document":"segment"," where you have the data to sync."),a.createElement(Z,{id:"document-search"},a.createElement(L.Z,{style:{flex:1,marginRight:"15px"},fluid:!0,loading:b,onResultSelect:(e,t)=>{const n=t.result;_(""),I(n.title),k(n.value)},onSearchChange:(0,P.Z)(((e,t)=>{E(!0);const n=t.value.toString();I(n),setTimeout((()=>{const e=new RegExp((0,U.Z)(t.value),"i");E(!1),A((0,N.Z)(G,(t=>e.test(t.title))))}),300)}),500,{leading:!0}),onClick:e=>{(e=>{if(ne(),l(""),""===y&&!b){const e=$.findDOMNode(R.current),t=null==e?void 0:e.getElementsByClassName("results");for(let e=0;t.length>e;e++)t[e].style.display="block";A(G),te||(te=document.addEventListener("click",ne))}})()},results:C,placeholder:"google"===X?"Select Sheet":"Select Segment Type",value:y,ref:R}),a.createElement(g.Z,{disabled:J,onClick:()=>{W(!0),setTimeout((()=>W(!1)),1e3)},icon:"sync",title:"Refresh the list",className:J?"loading":""})),a.createElement(Z,{id:"worksheet-search"},a.createElement(L.Z,{disabled:""===y,style:{marginTop:"13px"},fluid:!0,placeholder:b?"Loading":"google"===X?"Select Worksheet":"Select Segment",loading:O,onResultSelect:(e,t)=>{const n=t.result;_(n.title),M(n.value)},onClick:e=>{(e=>{if(ne(),l(""),""===D&&!O){const e=$.findDOMNode(z.current),t=null==e?void 0:e.getElementsByClassName("results");for(let e=0;t.length>e;e++)t[e].style.display="block";V(q),te||(te=document.addEventListener("click",ne))}})()},onSearchChange:(0,P.Z)(((e,t)=>{B(!0);const n=t.value.toString();_(n),setTimeout((()=>{const e=new RegExp((0,U.Z)(t.value),"i");B(!1);const n=(0,N.Z)(q,(t=>e.test(t.title)));V(n)}),300)}),500,{leading:!0}),results:j,value:D,ref:z}))),a.createElement(c.Z,null,a.createElement(S.Z,{as:"h4"},"STEP ","google"===X?3:2),a.createElement(m.Z,{error:""!==r},a.createElement(f.Z,{error:!0},r),a.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"}},a.createElement("p",{style:{margin:0}},"All done. Click on the 'Next' button to start mapping."),a.createElement(g.Z,{color:"blue",disabled:Q,className:Q?"loading disabled":"",onClick:()=>{""!==F&&""!==y?(ee(!0),"google"===X?d.saveSheetSelection(o,w,F).then((()=>{})).catch((e=>{var t;t=e.response,n((0,x.GD)({title:"An error occurred",messages:[],color:"negative"}))})).finally((()=>{ee(!1)})):d.saveSegmentSelection(o,w,F).then((()=>{})).catch((e=>{var t;t=e.response,n((0,x.GD)({title:"An error occurred",messages:[],color:"negative"}))})).finally((()=>{ee(!1)}))):l("All fields are required")}},"Next")))))}));B.displayName="SpreadSheetSelection";const D=B;
16var _=n(25159);var R=n(73080),F=n(39141),M=n(44564),j=n(79748),V=n(63221),z=n(26546),G=n(77880),H=n(13574);const q=(0,O.ZP)(h.Z)` 17 font-size: 15px; 18 position: absolute; 19 bottom: 0; 20 right: -8px; 21 background: white; 22 border-radius: 100%; 23 //border: 2px solid #1877F2; 24 padding: 3px; 25`,Y=O.ZP.div` 26 box-shadow: 0 1px 1px 0 rgb(66 66 66 / 8%), 0 1px 3px 1px rgb(66 66 66 / 16%); 27 position: relative; 28 display: flex; 29 margin: 5px auto 1em auto; 30 padding: 10px; 31 border-radius: 10px; 32 i { 33 margin-bottom: 0 !important; 34 } 35 .sync { 36 font-size: 25px !important; 37 bottom: 5px; 38 right: 5px; 39 color: #1877f2; 40 padding: 5px; 41 } 42`,J=(0,O.ZP)(c.Z)` 43 max-width: 640px; 44 margin: 2em auto !important; 45 background-color: #f3f4f5 !important; 46`,W=()=>{const e=(0,i.I0)(),[t,n]=(0,a.useState)(""),[o,r]=(0,a.useState)(""),[l,s]=(0,a.useState)(""),[c,m]=(0,a.useState)(!0);return(0,a.useEffect)((()=>{d.getSyncDataLinks().then((e=>{n(e.contactsLink),r(e.eventsLink),s(e.leadsbridgeLink)})).catch((t=>{var n,a;const o=(null===(a=null===(n=t.response)||void 0===n?void 0:n.data)||void 0===a?void 0:a.errorMessage)?"An internal error occurred, please try again later.":"Unknown Error";e((0,x.GD)({title:"An error occurred",messages:[o],color:"negative"}))})).finally((()=>{m(!1)}))}),[]),a.createElement("div",{style:{textAlign:"center"}},a.createElement(c?a.Fragment:H.Z,null),a.createElement(S.Z,{as:"h3",icon:!0},a.createElement(Y,{className:"fitContent"},a.createElement(h.Z,{name:"envelope",style:{color:"#EDBA71"}}),a.createElement(q,{name:"sync",loading:!0})),"We started syncing your data - You can proceed with the navigation.",a.createElement(S.Z.Subheader,{style:{marginTop:"10px"}},"We will send you an email once the sync is completed.")),a.createElement(u.Z,{inverted:!0,active:c,style:{marginTop:"50px"}},a.createElement(p.Z,null,"Loading")),a.createElement("p",{className:"text-secondary"},"Please note that the process will take some time, based on the amount of your data."),a.createElement(J,null,a.createElement("h5",null,"You can now return to Facebook - explore your data, as soon as the sync is done."),a.createElement("div",{className:"my-1"},a.createElement("a",{href:l,target:"_blank",rel:"noreferrer"},"Explore the LeadsBridge platform"," ",a.createElement(h.Z,{style:{marginLeft:5},name:"external"})))))};var X=n(78638),K=n(29454),Q=n(25727);const ee=(0,O.ZP)(Q.Z)` 47 justify-content: space-between; 48 .steps { 49 flex: 1; 50 margin-top: 0; 51 border: 0; 52 .step { 53 padding: 5px; 54 } 55 } 56 .item { 57 padding: 10px; 58 flex: 1 !important; 59 } 60`,te=({children:e})=>{const t=(0,i.I0)();return a.createElement(ee,{pointing:!0,secondary:!0},a.createElement(Q.Z.Item,{onClick:()=>t((0,x.Z3)())},a.createElement("img",{src:"https://leadsbridge.com/app/assets/img/logos/logo-ws4.svg?v=2.12.19",style:{width:"125px"},alt:"LeadsBridge"})),e)};var ne=n(74550),ae=n(80477);const oe=({isLoading:e,steps:t,status:n})=>{const o=(0,i.v9)((e=>e.appStore.platformId));return a.createElement(a.Fragment,null,!e&&a.createElement(ne.Z.Group,{size:"mini",fluid:!0},t.length>0&&t.map((e=>{const r=e.values.includes(n),i=t.find((t=>e.values.includes(n)));return a.createElement(ne.Z,{active:r,key:"stepper-"+e.index,disabled:!i||i.index>e.index},a.createElement(ne.Z.Content,null,a.createElement(ne.Z.Title,null,0===e.index?a.createElement(ae.Z,{src:`https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-lg-logos/logo${o}.png`,style:{borderRadius:0},avatar:!0}):a.createElement(a.Fragment,null),e.index===t.length-1?a.createElement(ae.Z,{src:"https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-lg-logos/logo371.png",style:{borderRadius:0},avatar:!0}):a.createElement(a.Fragment,null),e.name)))}))))};var re=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};const ie=()=>{const e=(0,i.I0)(),[t,n]=(0,a.useState)(!0),[l,s]=(0,a.useState)(!1),[d,c]=(0,a.useState)({}),m=(0,i.v9)((e=>e.appStore.platformId)),v=a.useCallback((t=>e((e=>({type:_.O,payload:e}))(t))),[e]),S=(0,i.v9)((e=>e.appStore.status)),w=a.useCallback((t=>e((e=>({type:_.d,payload:e}))(t))),[e]),[k,x]=(0,a.useState)([]);(0,a.useEffect)((()=>{let e=!0;const t=o.parse(window.location.search.replace("?","")),a=t.redirect_uri;return a?((0,E.m)(E.V.AppInvoked),(0,E.m)(E.V.UserLogged),(e=>{X.Z.facebookParameters("APP_STORE","",window.location.href).then((t=>{const n=new URL(e);let a=n.search.slice(1);const r=o.parse(a);r.extras=JSON.stringify(t.extras),a=o.encode(r);const i=n.href.replace(n.search,"")+"?"+a;window.location.replace(i)}))})(a)):n(!1),t.crm_id&&parseInt(t.crm_id)>0&&v(parseInt(t.crm_id)),t.crm_id&&63===parseInt(t.crm_id)?x(T.googleSheet):t.crm_id&&85===parseInt(t.crm_id)?x(T.newType):x(T.default),()=>{e=!1}}),[]);(0,a.useEffect)((()=>{let e;return m>0&&z.g.currentAuthenticatedUser().then((t=>re(void 0,void 0,void 0,(function*(){const{data:{listFbAppStoreStatuss:{items:n}}}=yield j.b.graphql((0,V.wT)(G.zA,{owner:t.username,filter:{crmId:{eq:m.toString()}}}));if(0===n.length)yield j.b.graphql((0,V.wT)(K.GR,{input:{owner:t.username,crmId:m.toString(),status:r.o.PLATFORMAUTHENTICATION}}));else{let e=n[0].status;e===r.o.PUBLISH&&(e=r.o.PLATFORMAUTHENTICATION),w(e)}var a;e=yield(a=t.username,re(void 0,void 0,void 0,(function*(){return(yield j.b.graphql((0,V.wT)(M.z2,{owner:a}))).subscribe({next:e=>{e.value&&e.value.data&&e.value.data.onUpdateFbAppStoreStatus&&w(e.value.data.onUpdateFbAppStoreStatus.status)},error:e=>{}})})))}
60)))).catch((e=>{})),()=>{void 0!==e&&e.unsubscribe()}}),[m]);const C=b.a[d.errorCode]?b.a[d.errorCode]:{title:"",description:"",helpers:[]};return a.createElement(a.Fragment,null,a.createElement(te,null,a.createElement(oe,{isLoading:t,status:S,steps:k})),a.createElement(R.Z,null,a.createElement("div",{style:{maxWidth:"850px",margin:"auto"}},a.createElement(F.Z,{open:l},a.createElement(F.Z.Header,null,C.title),a.createElement(F.Z.Content,null,a.createElement(F.Z.Description,null,a.createElement("div",{dangerouslySetInnerHTML:{__html:C.description}}),a.createElement("br",null),a.createElement(f.Z,{warning:!0},a.createElement(f.Z.Header,null,a.createElement(h.Z,{name:"warning sign"}),"You can update your settings to:"),a.createElement(I.Z,null,C.helpers.map((e=>a.createElement(I.Z.Item,null,a.createElement(I.Z.Content,null,a.createElement(I.Z.Header,null,e.title),a.createElement(I.Z.Description,null,e.description))))))))),a.createElement(F.Z.Actions,null,a.createElement(g.Z,{primary:!0,as:"a",href:d.errorLink,target:"_blank"},"Go to Configuration Page"))),(()=>{switch(S){case r.o.PLATFORMCONFIGURATION:return a.createElement(A,{steps:k});case r.o.SPREADSHEETSELECTION:case r.o.STATUS_SEGMENTATION_SELECTION:return a.createElement(D,{steps:k});case r.o.PUBLISH:return a.createElement(W,null);case r.o.NONE:case r.o.PLATFORMAUTHENTICATION:return a.createElement(y,{setOpen:s,setAPIresponse:c});default:return a.createElement(a.Fragment,null,a.createElement("div",{style:{minHeight:"100vh"}},a.createElement(u.Z,{active:!l,inverted:!0},a.createElement(p.Z,{inverted:!0},"Loading"))))}})())))}},24049:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(89526);const o=()=>a.createElement("div",{className:"mx-auto"},a.createElement("iframe",{src:"http://localhost:3000/fbAppStore?crm_id=491",height:650,width:1500}))},44473:(e,t,n)=>{n.d(t,{A:()=>h});var a=n(52868),o=n.n(a),r=n(26546),i=n(2353),l=n(89526),s=n(66643),d=n(18967),c=n(73087),u=n(6655),p=n(88704),m=n(19293),g=n(93260),v=n(23055);const h=({provider:e,authCode:t,requestUri:n,bbuData:a})=>{const h=(0,d.T)(),[f,b]=(0,l.useState)(""),E=(0,l.useRef)(!1),[y,S]=(0,l.useState)(""),{authState:I}=(0,d.C)((e=>e.user)),w=t&&e&&n&&I===s.jq.SignIn;return(0,l.useEffect)((()=>{E.current=!0;const l=o().CancelToken.source();return w&&o().post(c.H.handleOauthNotLoggedUser,{provider:e,authCode:t,requestUri:n},{cancelToken:l.token}).then((t=>{const{username:n,password:o,userStatus:l,Pricing:d}=t.data;localStorage.setItem(u.v.bbuPersistentUserStatus,l),r.g.signIn({username:n,password:o,validationData:[]}).then((t=>{if(E.current){const n=(0,p.W)(t);h((0,m.dl)(s.jq.SignedIn)),h((0,m.ne)(n)),S(l),setTimeout((()=>{var t,n,o;(0,g.L9)({eventName:"SignUp",feature:"Authentication",step:"Signup",params:{custom:{planId:null==d?void 0:d.cbPlanId,mrr:((null==d?void 0:d.mrr)||0)/100,channel:e&&v.j[e],sourceId:null===(t=null==a?void 0:a.source)||void 0===t?void 0:t.id,sourceName:null==a?void 0:a.source.name,destinationId:null===(n=null==a?void 0:a.destination)||void 0===n?void 0:n.id,destinationName:null===(o=null==a?void 0:a.destination)||void 0===o?void 0:o.name}},sendEventToIntercom:!0})}),500)}})).catch((e=>{E.current&&b((0,i.n)(e))}))})).catch((e=>{b((0,c.i)({error:e,fallbackMessage:"We could not authenticate you"}))})),()=>{E.current=!1,l.cancel("Aborted since user is already logged")}}),[w]),(0,l.useEffect)((()=>{f&&(0,g.L9)({eventName:"UnexpectedErrorThrown",feature:"Authentication",step:"Signup",params:{custom:{errorDescription:f}},sendEventToIntercom:!0})}),[f]),{userStatus:y,apiError:f}}}
60,26629:(e,t,n)=>{n.d(t,{Z:()=>m});var a=n(89526),o=n(85582),r=n(78638),i=n(43666),l=n(99459),s=n(32329),d=n(77398),c=n(31548),u=n(33649),p=n(66643);const m=()=>{const[e,t]=(0,a.useState)(!0),[n,m]=(0,a.useState)(""),g=(0,c.Z)("requestUri"),[v,h]=g(""),f=(0,c.Z)("isFlowForNbee"),[b,E]=f(!1),y=(0,u.v9)((e=>e.user.authState));return(0,a.useEffect)((()=>{const e=new URL(String(window.location.href)).pathname;h(e);const n=o.parse(window.location.search.slice(1)),a=n.flowType,i=n.instanceId;E("true"===n.nbee);const l=a||e;l&&y===p.jq.SignedIn?r.Z.facebookParameters(a,i,e).then((e=>{const t=encodeURIComponent(JSON.stringify(e.extras)),n=encodeURIComponent(window.location.origin+"/fbe/callback");let a="&client_id="+e.fbAppId;a+="&display=page",a+=`&redirect_uri=${n}`,a+="&response_type=code",a+="&scope="+e.scopes;window.location.replace(`https://facebook.com/dialog/oauth?extras=${t}`+a)})).catch((e=>{var t,n;const a=(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.errorMessage)?e.response.data.errorMessage:"-";m(a)})).finally((()=>{t(!1)})):l&&y!==p.jq.SignedIn||l||(t(!1),m("Invalid Flow Type or requestUri"))}),[y]),a.createElement(a.Fragment,null,a.createElement(i.Z,{active:e,inverted:!0},a.createElement(l.Z,{inverted:!0},"Loading")),""!==n&&a.createElement(s.Z,{negative:!0},a.createElement(s.Z.Header,null,"An error occurred!"),a.createElement("p",null,n),v&&a.createElement(d.Z,{primary:!0,onClick:()=>window.location.reload()},"Retry")))}},5140:(e,t,n)=>{n.d(t,{Z:()=>p});var a=n(89526),o=n(78638),r=n(43666),i=n(99459),l=n(32329),s=n(77398),d=n(85582),c=n(31548),u=n(42149);const p=()=>{const[e,t]=(0,a.useState)(!0),[n,p]=(0,a.useState)(""),[m,g]=(0,a.useState)(""),v=(0,c.Z)("requestUri"),h=(0,c.Z)("isFlowForNbee"),[f]=v(""),[b]=h();return(0,a.useEffect)((()=>{const e=d.parse(window.location.search.slice(1)),n=e.lb_error;if(n){o.Z.fbeCancel({error:n,errorCode:e.lb_error_code,errorDescription:e.lb_error_description}).catch((e=>{})).finally((()=>{t(!1),window.location.replace("https://leadsbridge.com/app")}))}else o.Z.setupInstance({nbee:!!b}).then((e=>{localStorage.removeItem("isFlowForNbee"),localStorage.removeItem("requestUri"),window.location.replace(e.callbackPath)})).catch((e=>{var t,n;const a=(null===(n=null===(t=e.response)||void 0===t?void 0:t.data)||void 0===n?void 0:n.errorMessage)?e.response.data.errorMessage:"-";a.includes("systemUser.RetrieveAccessTokenError")?p(u.a.messages.tokenError):(p(a),g("negative"))})).finally((()=>{t(!1)}))}),[]),a.createElement(a.Fragment,null,a.createElement(r.Z,{active:e,inverted:!0},a.createElement(i.Z,{inverted:!0},"Loading")),""!==n&&a.createElement(l.Z,{className:m},"negative"===m&&a.createElement(l.Z.Header,null,"An error occurred!"),a.createElement("p",null,n),f&&a.createElement(s.Z,{onClick:()=>{location.href=f}},"Retry")))}},11562:(e,t,n)=>{n.d(t,{z:()=>y});var a=n(89526),o=n(32197),r=n(18305),i=n(30808),l=n(45984),s=n(64317),d=n(43322),c=n(18967),u=n(72698),p=n(26809),m=n(99624),g=n(90887),v=n(3387),h=n(65960),f=n(19830),b=n(7517),E=n(80178);const y=()=>{var e;const t=(0,c.T)(),{appId:n,integrationId:y}=(0,r.UO)(),S=parseInt(n,10),I=(0,r.k6)(),{data:w,mutate:k,isLoading:T,error:x}=(0,h.d)();(0,a.useEffect)((()=>{k({appId:S,settings:[]})}),[S]);const{data:C,isLoading:A}=(0,E.f)(y),{data:L,isLoading:U,error:N}=(0,l.A)(y),{data:P,mutate:$,isLoading:O,error:Z}=(0,m.N)(),{mutate:B,isLoading:D,error:_,data:R}=(0,b.r)(),{data:F,isLoading:M,error:j}=(0,g.D)(n),V=U||O||D||T||A||M,z=N||Z||j||_||x,G=(null===(e=null==w?void 0:w.data)||void 0===e?void 0:e.credentials.fields)||[],H=F?(0,f.lS)(G,F.name,P||R||C):null;return(0,a.useEffect)((()=>{L&&t((0,d.J$)({data:L}))}),[L,t]),(0,a.useEffect)((()=>{if(z){const e=(0,u.L)(z);t((0,p.J)({isDismissable:!1,message:e.message,useTranslation:!0}))}}),[z]),a.createElement(a.Fragment,null,V||N||T?a.createElement(s.a,{$active:V,$dimmer:!0}):null,F&&H&&L&&C&&w?a.createElement(a.Fragment,null,a.createElement(o.C,{initialValues:H,appLogoUri:(null==F?void 0:F.logoUriSmall)||"https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-lg-logos/logo168.png",appId:Number(n),appName:(0,v.u)(F),onContinueRequest:(e,a,o)=>{null==a||a.setSubmitting(!0),(null==L?void 0:L.fields)&&L.fields.length>0?I.push(i.VP.incomingDataScreenFields.makeUrl({appId:n,integrationId:y})):H&&e&&((null==e?void 0:e.credentials.length)||0)>0&&"update"===o?B({integrationId:y,requestBody:(0,f.Rg)(e,S)},{onSuccess:()=>{$({requestBody:{status:1},integrationId:`${y}`},{onSuccess:()=>{t((0,d.r$)(1)),I.push(i.VP.incomingDataScreenFields.makeUrl({appId:n,integrationId:y}))}})}}):$({requestBody:{status:1},integrationId:`${y}`},{onSuccess:()=>{t((0,d.r$)(1)),I.push(i.VP.incomingDataScreenFields.makeUrl({appId:n,integrationId:y}))}})},isLoading:V})):null)}},91585:(e,t,n)=>{n.d(t,{B:()=>b});var a=n(89526),o=n(31817),r=n(18305),i=n(18967),l=n(99624),s=n(43322),d=n(30808),c=n(71829),u=n(64317),p=n(72698),m=n(26809),g=n(71817),v=n(90887),h=n(3387),f=n(82244);const b=()=>{var e,t,n,b,E,y;const{appId:S,integrationId:I}=(0,r.UO)(),w=(0,i.T)(),k=(0,r.k6)(),[T,x]=(0,a.useState)(!0),[C,A]=(0,a.useState)(0),L=(0,i.C)((e=>e.integrationListener)),{data:U,isLoading:N}=(0,g.s)(I),{data:P,refetch:$}=(0,f.B)(I),{data:O,isLoading:Z}=(0,v.D)(S),B=null!==(e=null==U?void 0:U.data.activeBridges)&&void 0!==e?e:0,D=null!==(t=null==U?void 0:U.data.totalBridges)&&void 0!==t?t:0,_=null===(n=L.data)||void 0===n?void 0:n.fields;(0,a.useEffect)((()=>{P&&w((0,s.A4)(P))}),[P]);const{mutate:R,isLoading:F,error:M}=(0,l.N)();(0,a.useEffect)((()=>{"POP"===k.action&&k.push(d.VP.incomingDataScreen.makeUrl({appId:S,integrationId:I}))}),[]);(0,c.G)((null===(b=L.data)||void 0===b?void 0:b.channel)||"test-channel","webhookdata.parsed",1===(null===(E=L.data)||void 0===E?void 0:E.status)&&T,!1,
60(()=>R({integrationId:`${I}`,requestBody:(null==_?void 0:_.length)>0?{status:2}:{status:3}},{onSuccess:()=>{w((0,s.r$)((null==_?void 0:_.length)>0?2:3))}})),(()=>{$()})),(0,a.useEffect)((()=>{Array.isArray(_)&&_.length>0&&x(!1)}),[_]),(0,a.useEffect)((()=>{if(M){x(!1);const e=(0,p.L)(M);w((0,m.J)({isDismissable:!0,message:e.message,useTranslation:!0}))}}),[M]);return a.createElement(a.Fragment,null,F||N||Z?a.createElement(u.a,{$active:!0,$dimmer:!0}):null,a.createElement(o.x,{appLogoUri:(null==O?void 0:O.logoUriSmall)||"https://leadsbridge.com/wp-content/themes/leadsbridge/img/integration-lg-logos/logo168.png",onReload:()=>{1>C&&D&&B?A((e=>e+1)):R({requestBody:{status:1},integrationId:`${I}`},{onSuccess:()=>{w((0,s.r$)(1)),A(0),x(!0)}})},onContinue:()=>{R({requestBody:(null==_?void 0:_.length)>0?{status:2,fields:_}:{status:3},integrationId:`${I}`},{onSuccess:()=>{k.push(d.VP.incomingDataScreenSave.makeUrl({appId:S,integrationId:I}))}})},isRecognizingFields:T,fields:_||[],isConfirmingReload:C,activeBridges:B,totalBridges:D,resetConfirmingReload:A,appName:(0,h.u)(O),listenerType:(null===(y=L.data)||void 0===y?void 0:y.type)||"url",appId:S,integrationId:null!=I?I:""}))}},39418:(e,t,n)=>{n.d(t,{l:()=>v});var a=n(89526),o=n(9963),r=n(7517),i=n(18305),l=n(64317),s=n(72698),d=n(18967),c=n(26809),u=n(30808),p=n(80178),m=n(95345),g=n(90887);const v=()=>{const{appId:e,integrationId:t}=(0,i.UO)(),n=(0,d.T)(),v=(0,i.k6)(),{data:h,isLoading:f,error:b}=(0,p.f)(t),{mutate:E,isLoading:y,error:S}=(0,r.r)(),{data:I,isLoading:w,error:k}=(0,g.D)(e),[T,x]=(0,a.useState)(h&&h.name||"Integration's name");(0,a.useEffect)((()=>{h&&h.name&&x(h.name)}),[h]);(0,a.useEffect)((()=>{if(S||b||k){const e=(0,s.L)(S||b||k);n((0,c.J)({isDismissable:!0,message:e.message,useTranslation:!0}))}}),[S,b,k]);return a.createElement(a.Fragment,null,y||f||w?a.createElement(l.a,{$active:!0,$dimmer:!0}):null,h?a.createElement(o.j,{appName:(null==I?void 0:I.name)||"",integrationName:T,onEditIntegrationName:x,onSave:()=>{E({requestBody:{name:T,appId:parseInt(e),credentials:[]},integrationId:`${t}`},{onSuccess:e=>{(0,m.L)(e&&Number(e.id)||0,e&&e.name||"")}})},onCancel:()=>{v.push(u.VP.incomingDataScreenEdit.makeUrl({appId:e,integrationId:t}))},isUpdatingIntegration:y}):null)}},43820:(e,t,n)=>{n.d(t,{f:()=>m});var a=n(89526),o=n(36575),r=n(18305),i=n(6655),l=n(64317),s=n(51496),d=n(1683),c=n(72698),u=n(30808),p=n(93260);const m=()=>{const e=(0,r.TH)(),t=(0,r.k6)(),n=o.parse(e.search).instanceId,m=o.parse(e.search).instanceType,g=sessionStorage.getItem(i.E.integrationAuthFlowAppId),v=o.parse(e.search).error,h=g&&n&&m?{appId:g,instanceId:n,instanceType:m}:void 0,{data:f,error:b}=(0,s.q)(h);return(0,a.useEffect)((()=>{f&&f.id&&g&&((0,p.L9)({eventName:"AuthorizeSuccess",feature:"NBEE",step:"Integration",params:{appId:parseInt(g,10),integrationId:f.id,integrationName:f.name,oauth:!0}}),t.push(u.VP.integrationAuthScreenEditStep2.makeUrl({integrationId:`${f.id}`,appId:g})))}),[f]),(0,a.useEffect)((()=>{if(!g||!n||b){const e=b?(0,c.L)(b).code:"UI-Error",t=b?(0,c.L)(b).message:"Missing appId or legacyIntegrationId";(0,p.L9)({eventName:"AuthorizeFailure",feature:"NBEE",step:"Integration",params:{appId:g?parseInt(g,10):void 0,integrationId:null==f?void 0:f.id,integrationName:null==f?void 0:f.name,oauth:!0,custom:{errorCode:e,errorDescription:t}},sendEventToIntercom:!0})}}),[g,n,b]),g?n?b?a.createElement(d.v,{$status:"error"},(0,c.L)(b).message):a.createElement("div",{style:{position:"relative",height:200}},a.createElement(l.a,{$active:!0,$dimmer:!0,$size:"large"})):a.createElement(d.v,{$status:"error"},v||"We could not read instanceId from URL."):a.createElement(d.v,{$status:"error"},"App ID not found. This probably means you have not started the Authorization flow from a trusted source (eg. NBEE) or session storage is empty.")}},20065:(e,t,n)=>{n.d(t,{D:()=>m});var a=n(89526),o=n(18305),r=n(6655),i=n(64317),l=n(1683),s=n(72698),d=n(30808),c=n(93260),u=n(4290),p=n(19830);const m=()=>{var e;(0,o.TH)();const t=(0,o.k6)(),{mutate:n,error:m,data:g}=(0,u.z)(),v=sessionStorage.getItem(r.E.integrationAuthFlowAppId),h=sessionStorage.getItem("instanceId"),f=null!==(e=(0,p.iT)())&&void 0!==e?e:[],b=new URLSearchParams(window.location.search),E=Object.fromEntries(b),y=Number(v),S=Number(h),I=Object.keys(E).map((e=>({key:e,value:E[e]}))),w=Object.keys(f).map((e=>({key:e,value:f[e]})));return(0,a.useEffect)((()=>{n({appId:y,integrationId:S||void 0,payload:I.concat(w)},{onSuccess:e=>{var n;const a=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.integration;a&&a.id&&v&&((0,c.L9)({eventName:"AuthorizeSuccess",feature:"NBEE",step:"Integration",params:{appId:parseInt(v,10),integrationId:a.id,integrationName:a.name,oauth:!0}}),t.push(d.VP.integrationAuthScreenEditStep2.makeUrl({integrationId:`${a.id}`,appId:v})))}})}),[]),(0,a.useEffect)((()=>{var e,t,n,a;if(!v||!h||m){const o=m?(0,s.L)(m).code:"UI-Error",r=m?(0,s.L)(m).message:"Missing appId or legacyIntegrationId";(0,c.L9)({eventName:"AuthorizeFailure",feature:"NBEE",step:"Integration",params:{appId:v?parseInt(v,10):void 0,integrationId:null===(t=null===(e=null==g?void 0:g.data)||void 0===e?void 0:e.integration)||void 0===t?void 0:t.id,integrationName:null===(a=null===(n=null==g?void 0:g.data)||void 0===n?void 0:n.integration)||void 0===a?void 0:a.name,oauth:!0,custom:{errorCode:o,errorDescription:r}},sendEventToIntercom:!0})}}),[v,h,m]),v?m?a.createElement(l.v,{$status:"error"},(0,s.L)(m).message):a.createElement("div",{style:{position:"relative",height:200}},a.createElement(i.a,{$active:!0,$dimmer:!0,$size:"large"})):a.createElement(l.v,{$status:"error"},"App ID not found. This probably means you have not started the Authorization flow from a trusted source (eg. NBEE) or session storage is empty.")}},39919:(e,t,n)=>{n.d(t,{E:()=>E});var a=n(89526),o=n(75122),r=n(18305),i=n(15035),l=n(19830),s=n(18967),d=n(72698),c=n(26809),u=n(95345),p=n(1683),m=n(90887),g=n(65960),v=n(3189),h=n(64874),f=n(7517),b=n(93260);const E=()=>{var e,t,n,E;const{appId:y}=(0,r.UO)(),{t:S}=(0,h.$)(),[I,w]=(0,a.useState)(),k=parseInt(y,10),[T,x]=(0,a.useState)(!1),[C,A]=(0,a.useState)(!1),L=(0,s.T)(),{data:U,isLoading:N,error:P}=(0,m.D)(y),{data:$,mutate:O,isLoading:Z,error:B}=(0,g.d)(),{mutate:D,isLoading:_,error:R,data:F}=(0,i._)(),{mutate:M,isLoading:j,error:V,data:z}=(0,f.r)();(0,a.useEffect)((()=>{const e=V||R;if(e){const t=(0,d.L)(e).message;L((0,c.GD)({title:"Error",messages:[t],color:"negative"}))}}),[V,R]),(0,a.useEffect)((()=>{O({appId:k,settings:[]})}),[k]);const{data:G,error:H,isLoading:q,isRefetching:Y,refetch:J}=(0,v.v)(null==I?void 0:I.id),W=null===(e=null==F?void 0:F.data)||void 0===e?void 0:e.integration,
60X=(null===(t=null==$?void 0:$.data)||void 0===t?void 0:t.credentials.fields)||[],K="oauth2"===(null===(n=null==$?void 0:$.data)||void 0===n?void 0:n.credentials.type),Q=U?(0,l.lS)(X,U.name,W):null;(0,a.useEffect)((()=>{var e;const t=z||(null===(e=null==F?void 0:F.data)||void 0===e?void 0:e.integration);if(t){const e=t.id,n=t.name;(null==I?void 0:I.id)&&J(),w({id:e,name:n})}}),[z,F]);const ee=Boolean(U&&Q&&$);(0,a.useEffect)((()=>{ee&&(0,b.L9)({eventName:"NewIntegrationShown",feature:"NBEE",step:"Integration",params:{appId:null==U?void 0:U.id,appName:null==U?void 0:U.name,oauth:K}})}),[ee]);const te=(e,t)=>{const n=(0,d.L)(e);(0,b.L9)({eventName:"UnexpectedErrorThrown",feature:"NBEE",step:"Apps",params:{appId:parseInt(y,10),appName:null==U?void 0:U.name,integrationId:null==I?void 0:I.id,integrationName:t.name,custom:{errorCode:n.code,errorDescription:n.message}},sendEventToIntercom:!0})};(0,a.useEffect)((()=>{var e;if((null===(e=null==G?void 0:G.data)||void 0===e?void 0:e.result)&&I){x(!0),K||(0,b.L9)({eventName:"AuthorizeSuccess",feature:"NBEE",step:"Integration",params:{appId:null==U?void 0:U.id,appName:null==U?void 0:U.name,integrationId:I.id,integrationName:I.name,oauth:!1}}),(0,b.L9)({eventName:"SaveClicked",feature:"NBEE",step:"Integration",params:{appId:null==U?void 0:U.id,appName:null==U?void 0:U.name,integrationId:I.id,integrationName:I.name,oauth:K}});(0,u.L)(I.id,I.name)||A(!0)}}),[G]),(0,a.useEffect)((()=>{if(H&&!K){const e=(0,d.L)(H);(0,b.L9)({eventName:"AuthorizeFailure",feature:"NBEE",step:"Integration",params:{appId:null==U?void 0:U.id,appName:null==U?void 0:U.name,integrationId:null==I?void 0:I.id,integrationName:null==I?void 0:I.name,oauth:!1,custom:{errorCode:e.code,errorDescription:e.message}},sendEventToIntercom:!0})}}),[H]);const ne=N||Z||q||Y||!Q||T&&!C,ae=B||P;return y?C?a.createElement("div",{style:{margin:"2rem",textAlign:"center"}},a.createElement(p.v,{$status:"success"},S("integrationAuthPopup.manualCloseMessage"))):ne?a.createElement("div",null):U&&Q?a.createElement(o.c,{appId:k,appName:U.name,appLogoUri:U.logoUriSmall,isSavingApi:j||_,onSubmit:(e,t)=>{t.setSubmitting(!0),(null==I?void 0:I.id)?M({integrationId:`${I.id}`,requestBody:(0,l.Rg)(e,k)},{onError:n=>{t.setSubmitting(!1),te(n,e)}}):D({requestBody:(0,l.Rg)(e,k)},{onError:n=>{t.setSubmitting(!1),te(n,e)}})},isOauthUri:K,initialValues:Q,isNotValidIntegrationErrorMessage:H?(0,d.L)(H).message:!1===(null===(E=null==G?void 0:G.data)||void 0===E?void 0:E.result)?G.data.message||S("api.error.genericNoMessageReceived"):void 0}):a.createElement(p.v,{$status:"error"},ae?(0,d.L)(ae).message:"Missing data"):a.createElement("div",null,"Missing Parameter")}},52290:(e,t,n)=>{n.d(t,{W:()=>I});var a=n(89526),o=n(75122),r=n(18305),i=n(19830),l=n(18967),s=n(72698),d=n(26809),c=n(64317),u=n(95345),p=n(1683),m=n(80178),g=n(7517),v=n(90887),h=n(30808),f=n(65960),b=n(15035),E=n(3189),y=n(64874),S=n(93260);const I=()=>{var e,t,n,I;const{t:w}=(0,y.$)(),{appId:k,integrationId:T,bridgeId:x}=(0,r.UO)(),C=parseInt(k,10),[A,L]=(0,a.useState)(),[U,N]=(0,a.useState)(!1),[P,$]=(0,a.useState)(!1),O=(0,l.T)(),Z=(0,r.TH)(),B=(0,r.LX)(Z.pathname,{path:h.VP.integrationAuthScreenEditStep2.path,exact:!0,strict:!0}),{data:D,isLoading:_,error:R}=(0,v.D)(k),{data:F,mutate:M,isLoading:j,error:V}=(0,f.d)(),{data:z,isLoading:G,error:H}=(0,m.f)(T),{mutate:q,isLoading:Y,error:J,data:W}=(0,g.r)(),{mutate:X,isLoading:K,error:Q,data:ee}=(0,b._)(),{data:te,error:ne,isLoading:ae,isRefetching:oe,refetch:re}=(0,E.v)(null==A?void 0:A.id),ie=(e,t)=>{const n=(0,s.L)(e);(0,S.L9)({eventName:"UnexpectedErrorThrown",feature:"NBEE",step:"Apps",params:{appId:C,appName:null==D?void 0:D.name,integrationId:parseInt(T,10),integrationName:t.name,custom:{errorCode:n.code,errorDescription:n.message}},sendEventToIntercom:!0})};(0,a.useEffect)((()=>{const e=J||Q;if(e){const t=(0,s.L)(e).message;O((0,d.GD)({title:"Error",message:t,color:"negative"}))}}),[J,Q]),(0,a.useEffect)((()=>{M({appId:C,settings:[]})}),[C]);const le=W||(null===(e=null==ee?void 0:ee.data)||void 0===e?void 0:e.integration),se=(null===(t=null==F?void 0:F.data)||void 0===t?void 0:t.credentials.fields)||[],de="oauth2"===(null===(n=null==F?void 0:F.data)||void 0===n?void 0:n.credentials.type),ce=D?(0,i.lS)(se,D.name,le||z):null,ue=Boolean(D&&ce&&F);(0,a.useEffect)((()=>{ue&&!B&&(0,S.L9)({eventName:"EditIntegrationShown",feature:"NBEE",step:"Integration",params:{appId:null==D?void 0:D.id,appName:null==D?void 0:D.name,integrationId:parseInt(T,10),integrationName:null==ce?void 0:ce.name,oauth:de}})}),[ue]);(0,a.useEffect)((()=>{var e;const t=W||(null===(e=null==ee?void 0:ee.data)||void 0===e?void 0:e.integration);if(t){const e=t.id,n=t.name;(null==A?void 0:A.id)&&re(),L({id:e,name:n})}}),[W,ee]),(0,a.useEffect)((()=>{var e;if((null===(e=null==te?void 0:te.data)||void 0===e?void 0:e.result)&&A){N(!0),de||(0,S.L9)({eventName:"AuthorizeSuccess",feature:"NBEE",step:"Integration",params:{appId:null==D?void 0:D.id,appName:null==D?void 0:D.name,integrationId:A.id,integrationName:A.name,oauth:!1}}),(0,S.L9)({eventName:"SaveClicked",feature:"NBEE",step:"Integration",params:{appId:null==D?void 0:D.id,appName:null==D?void 0:D.name,integrationId:A.id,integrationName:A.name,oauth:de}});(0,u.L)(A.id,A.name)||$(!0)}}),[te]),(0,a.useEffect)((()=>
60{if(ne&&!de){const e=(0,s.L)(ne);(0,S.L9)({eventName:"AuthorizeFailure",feature:"NBEE",step:"Integration",params:{appId:null==D?void 0:D.id,appName:null==D?void 0:D.name,integrationId:null==A?void 0:A.id,integrationName:null==A?void 0:A.name,oauth:!1,custom:{errorCode:e.code,errorDescription:e.message}},sendEventToIntercom:!0})}}),[ne]);const pe=j||_||G||ae||oe||U&&!P,me=V||H||R;return k?P?a.createElement("div",{style:{margin:"2rem",textAlign:"center"}},a.createElement(p.v,{$status:"success"},w("integrationAuthPopup.manualCloseMessage"))):pe?a.createElement("div",{style:{position:"relative",height:200}},a.createElement(c.a,{$active:!0,$dimmer:!0,$size:"large"})):D&&ce?a.createElement(o.c,{appId:C,appName:D.name,appLogoUri:D.logoUriSmall,isSavingApi:Y||K,onSubmit:(e,t,n)=>{t.setSubmitting(!0),"update"===n&&q({integrationId:T,requestBody:(0,i.Rg)(e,C)},{onError:n=>{t.setSubmitting(!1),ie(n,e)}}),"save-new"===n&&X({requestBody:(0,i.Rg)(e,C)},{onError:n=>{t.setSubmitting(!1),ie(n,e)}})},isOauthUri:de,initialValues:ce,bridgeId:x?parseInt(x,10):void 0,skipParams:Boolean(B&&B.isExact),integrationId:parseInt(T,10),isNotValidIntegrationErrorMessage:ne?(0,s.L)(ne).message:!1===(null===(I=null==te?void 0:te.data)||void 0===I?void 0:I.result)?te.data.message||w("api.error.genericNoMessageReceived"):void 0}):me?a.createElement(p.v,{$status:"error"},(0,s.L)(me).message):null:a.createElement("div",null,"Missing Parameter")}},64303:(e,t,n)=>{n.d(t,{K:()=>u});var a=n(89526),o=n(18305),r=n(36575),i=n(54684),l=n(64317),s=n(20106),d=n(83525),c=n(64874);const u=()=>{const{Wrapper:e,Header:t,Body:n,Title:u,SubTitle:p}=d.P_,{t:m}=(0,c.$)(),g=(0,o.TH)(),v=r.parse(g.search),{data:h,mutate:f,isLoading:b,isError:E}=(0,i.w)();return(0,a.useEffect)((()=>{v.code&&f(v)}),[]),a.createElement(e,null,a.createElement(t,null,a.createElement("img",{src:s.Z,width:"40",alt:"leadsbridge-logo"})),a.createElement(n,null,a.createElement(u,null,m("emailValidationLegacyExperience.pageTitle")),b&&a.createElement(a.Fragment,null,a.createElement(p,null,m("emailValidationLegacyExperience.loadingMessage")),a.createElement(l.a,{$active:!0,$dimmer:!0,$size:"large"})),h&&a.createElement(p,null,m("emailValidationLegacyExperience.successMessage")),E&&a.createElement(p,null,m("emailValidationLegacyExperience.errorMessage"))))}},99521:(e,t,n)=>{n.d(t,{a:()=>a});const a=()=>null},95176:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(89526),o=n(18305),r=n(43666),i=n(99459);const l=()=>{const e=(0,o.TH)();return(0,a.useEffect)((()=>{const t=("https://leadsbridge.com/app"+e.pathname+e.search).replace("/app/app/","/app/");window.location.href=t}),[]),a.createElement("div",{style:{minHeight:"100vh"}},a.createElement(r.Z,{active:!0,inverted:!0},a.createElement(i.Z,{inverted:!0},"Loading")))}},22453:(e,t,n)=>{n.d(t,{X:()=>l});var a=n(57864),o=n(8921),r=n(78638),i=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};const l=()=>i(void 0,void 0,void 0,(function*(){var e;const t=new a.Z;localStorage.clear(),sessionStorage.clear(),t.remove(o.b.XsrfToken,{path:"/",domain:".leadsbridge.com"}),yield r.Z.cancelSessionCookie(null!==(e=".leadsbridge.com")?e:""),t.remove(o.b.LbImp,{path:"/",domain:".leadsbridge.com"}),t.remove(o.b.CognitoSession,{path:"/",domain:".leadsbridge.com"}),t.remove("fbm_939660826071336",{path:"/",domain:".leadsbridge.com"}),t.remove("fbsr_939660826071336",{path:"/",domain:".leadsbridge.com"})}))},99034:(e,t,n)=>{n.d(t,{T:()=>d});var a=n(89526),o=n(90511),r=n(84118),i=n(18305),l=n(30808);const s={name:"",source:{appId:void 0,integrationId:void 0,settings:[]},destination:{appId:void 0,integrationId:void 0,settings:[]},settings:{emailReceipt:{active:!1}}},d=()=>{const e=s,t=(0,i.k6)();return a.createElement(i.rs,null,a.createElement(i.AW,{exact:!0,path:l.VP.nbeeBridgeChooserStep1.path},a.createElement(o.p,{initialValues:e,onSubmit:e=>{t.push(l.VP.nbeeBridgeChooserStep2.makeUrl({sourceAppId:`${e.source.appId}
60`,destinationAppId:`${e.destination.appId}`}))}})),a.createElement(i.AW,{exact:!0,path:l.VP.nbeeBridgeChooserStep2.path,component:r.u}))}},60114:(e,t,n)=>{n.d(t,{I:()=>l});var a=n(89526),o=n(18305),r=n(30808),i=n(87662);const l=()=>{const e=(0,o.k6)();return i.L?a.createElement("div",null,a.createElement("h1",null,"NBEE Home"),a.createElement("ul",null,a.createElement("li",null,a.createElement("button",{onClick:()=>{e.push(r.VP.nbeeBridgeChooserStep1.makeUrl())}},"Bridge Chooser Step 1")),a.createElement("li",null,a.createElement("button",{onClick:()=>{e.push(r.VP.nbeeBridgeChooserStep2.makeUrl({sourceAppId:"63",destinationAppId:"45"}))}},"Bridge Chooser Step 2")),a.createElement("li",null,a.createElement("button",{onClick:()=>{e.push(r.VP.nbeeStep1New.makeUrl())}},"New bridge empty")),a.createElement("li",null,a.createElement("button",{onClick:()=>{e.push({pathname:r.VP.nbeeStep1New.makeUrl(),search:"sourceId=63"})}},"New bridge empty with sourceId selected")),a.createElement("li",null,a.createElement("button",{onClick:()=>{e.push(r.VP.signupBbu.makeUrl({source:"facebook-lead-ads",destination:"google-sheets"}))}},"New bridge form with BBU")),a.createElement("li",null,a.createElement("button",{onClick:()=>{e.push(r.VP.nbeeStep1Edit.makeUrl("321"))}},"Edit bridge")),a.createElement("li",null,a.createElement("button",{onClick:()=>{e.push(r.VP.nbeeStep2.makeUrl("321"))}},"Step2")),a.createElement("li",null,a.createElement("button",{onClick:()=>{e.push(r.VP.nbeeStep3.makeUrl("321"),{success:!0})}},"Step3")),a.createElement("li",null,a.createElement("button",{onClick:()=>{e.push("/test-components")}},"Test Components")))):null}},96479:(e,t,n)=>{n.d(t,{t:()=>I});var a=n(89526),o=n(73602),r=n(64594),i=n(86556),l=n(99012),s=n(18305),d=n(30808),c=n(72698),u=n(18967),p=n(26809),m=n(84340),g=n(93260),v=n(94758),h=n(1472),f=n(79344),b=n(36575),E=n(6405),y=n(58819),S=n(64874);const I=()=>{var e,t,n,I,w;const{t:k}=(0,S.$)(),T=(0,s.k6)(),x=(0,s.TH)(),C=(0,u.T)(),{data:A}=(0,y.J)(),[L,U]=(0,a.useState)(null),N=(0,s.LX)(x.pathname,{path:d.hu,exact:!0}),P=N?`${window.location.origin}${N.url}`:void 0,{data:$,isLoading:O}=(0,r.a)(P),Z=b.parse(x.search,{parseNumbers:!0}),B=Z&&Z.sourceId?parseInt(`${Z.sourceId}`,10):void 0,D=Z&&Z.destinationId?parseInt(`${Z.destinationId}`,10):void 0,{data:_,isLoading:R}=(0,E.E)(),F=((null==_?void 0:_.modules)||[]).find((e=>"email-receipt"===e.id)),M=P&&$?$:((e,t,n)=>{var a,o,r;return{name:"",source:{appId:e,integrationId:void 0,settings:[]},destination:{appId:t,integrationId:void 0,settings:[]},settings:{emailReceipt:{active:Boolean(null!==(a=null==n?void 0:n.active)&&void 0!==a&&a),recipients:null!==(o=null==n?void 0:n.recipients)&&void 0!==o?o:[],subject:null!==(r=null==n?void 0:n.subject)&&void 0!==r?r:""}}}})(B,D,null==F?void 0:F.userDefaults),{mutate:j,data:V,error:z,isLoading:G}=(0,l.B)(),{mutate:H,data:q,error:Y,isLoading:J}=(0,f.g)(),{mutate:W,data:X,error:K,isLoading:Q}=(0,h.$)(),ee=G||Q||J,te=z||K||Y,ne=null===(t=null===(e=null==V?void 0:V.data)||void 0===e?void 0:e.bridge)||void 0===t?void 0:t.id,ae=null===(I=null===(n=null==q?void 0:q.data)||void 0===n?void 0:n.bridge)||void 0===I?void 0:I.id;return(0,a.useEffect)((()=>{const e=ne||ae;e&&W({bridgeId:e})}),[ne,ae]),(0,a.useEffect)((()=>{X&&ne&&T.push(d.VP.nbeeStep2.makeUrl(ne.toString()))}),[X]),(0,a.useEffect)((()=>{if(te){const e=(0,c.L)(te);C((0,p.GD)({title:"Error",message:e.message,color:"negative"})),L&&(L.formikHelpers.setSubmitting(!1),(0,g.L9)({eventName:"UnexpectedErrorThrown",feature:"NBEE",step:"Apps",params:Object.assign(Object.assign({},(0,v.VR)(L.formValues)),{custom:{errorCode:e.code,errorDescription:e.message}}),sendEventToIntercom:!0}))}}),[te]),O||R?a.createElement(m.w,{activeStepIndex:0,loadingText:k("nbee.bridgeBuilder.step1TemplateLoadingMessage")}):a.createElement(o.D,{initialValues:M,isSavingApi:ee,emailReceiptUserModule:F,templateSettings:null===(w=null==$?void 0:$.source)||void 0===w?void 0:w.settings,userData:A,onSubmit:(e,t)=>{const n=(0,i.u)(e,{step:1});U({formValues:e,formikHelpers:t}),ne?H({bridgeData:n,bridgeId:`${ne}`}):j(n)}})}},48196:(e,t,n)=>{n.d(t,{z:()=>S});var a=n(89526),o=n(73602),r=n(7106),i=n(18305),l=n(79344),s=n(86556),d=n(30808),c=n(18967),u=n(72698),p=n(26809),m=n(84340),g=n(33907),v=n(93260),h=n(94758),f=n(1472),b=n(2145),E=n(58819),y=n(6405);const S=()=>{var e,t;const{bridgeId:n}=(0,i.UO)(),S=(0,i.k6)(),I=(0,c.T)(),[w,k]=(0,a.useState)(null),{data:T,isLoading:x,error:C}=(0,b.$)(),{data:A,isLoading:L,error:U}=(0,r.j)(n),{data:N}=(0,E.J)(),{data:P}=(0,y.E)(),$=((null==P?void 0:P.modules)||[]).find((e=>"email-receipt"===e.id)),O=C||U,{mutate:Z,data:B,error:D,isLoading:_}=(0,l.g)(),{mutate:R,data:F,error:M,isLoading:j}=(0,f.$)(),V=j||_,z=M||D,G=null===(t=null===(e=null==B?void 0:B.data)||void 0===e?void 0:e.bridge)||void 0===t?void 0:t.id;return(0,a.useEffect)((()=>{G&&R({bridgeId:G})}),[G]),(0,a.useEffect)((()=>{F&&S.push(d.VP.nbeeStep2.makeUrl(n))}),[F]),(0,a.useEffect)((()=>
60{if(z){const e=(0,u.L)(z);I((0,p.GD)({title:"Error",message:e.message,color:"negative"})),w&&(w.formikHelpers.setSubmitting(!1),(0,v.L9)({eventName:"UnexpectedErrorThrown",feature:"NBEE",step:"Apps",params:Object.assign(Object.assign({},(0,h.VR)(w.formValues)),{custom:{errorCode:e.code,errorDescription:e.message}}),sendEventToIntercom:!0}))}}),[z]),L||x?a.createElement(m.w,{activeStepIndex:0}):A&&T?a.createElement(o.D,{isSavingApi:V,initialValues:A,emailReceiptUserModule:$,userData:N,onSubmit:(e,t)=>{const a=(0,s.u)(e,{step:1});k({formValues:e,formikHelpers:t}),Z({bridgeData:a,bridgeId:n})}}):O?a.createElement(g.p,{activeStepIndex:0,errorCode:(0,u.L)(O).code,statusCode:(0,u.L)(O).status,errorMessage:(0,u.L)(O).message}):null}},93099:(e,t,n)=>{n.d(t,{y:()=>x});var a=n(89526),o=n(52018),r=n(84340),i=n(86556),l=n(33907),s=n(72698),d=n(7106),c=n(79344),u=n(18305),p=n(49330),m=n(58576),g=n(18967),v=n(26809),h=n(30808),f=n(34016),b=n(60841),E=n(64874),y=n(93260),S=n(94758),I=n(58819),w=n(36624),k=n(24212),T=n(42822);const x=()=>{var e,t;const n=(0,u.UO)(),x=parseInt(n.bridgeId,10),C=(0,g.T)(),A=(0,u.k6)(),{t:L}=(0,E.$)(),{data:U}=(0,I.J)(),{data:N,error:P,refetch:$,isLoading:O,isRefetching:Z}=(0,d.j)(`${x}`,!0),{data:B,error:D,isLoading:_}=(0,w.x)(x),{data:R,error:F,isLoading:M,isRefetching:j}=(0,p.f)(x),{mutate:V,error:z,isLoading:G}=(0,c.g)(),{mutate:H,data:q,error:Y,isLoading:J}=(0,f.A)(),{mutate:W,error:X,isLoading:K}=(0,k.u)(),Q=O||Z||M||_||K,ee=P||F||D,te=Boolean(N&&R&&B),ne=!!(null===(e=null==R?void 0:R.data)||void 0===e?void 0:e.requiresTemplateBasedFieldsMapping),[ae,oe]=(0,a.useState)((null==B?void 0:B.shouldCheckPermissions)||!1);(0,a.useEffect)((()=>{oe((0,T.U8)(B||void 0))}),[B]);const[re,ie]=(0,a.useState)(null);(0,a.useEffect)((()=>{N&&R&&B&&!Z&&!j&&ie((0,m.a)(N,R))}),[B,N,R,Z,j]);const le=(null===(t=null==N?void 0:N.sourceFilters)||void 0===t?void 0:t.conditions)||[],se=null==re?void 0:re.initialValues;(0,m.P)(re,x);const de=(e,t,n)=>{n.setSubmitting(!1);const a=(0,s.L)(e);(0,y.L9)({eventName:"UnexpectedErrorThrown",feature:"NBEE",step:"Apps",params:Object.assign(Object.assign({},(0,S.VR)(t)),{custom:{errorCode:a.code,errorDescription:a.message}}),sendEventToIntercom:!0})};(0,a.useEffect)((()=>{if(z||Y||X){const e=(0,s.L)(z||Y||X);"bridge-limit-reached"===e.code&&N&&(0,y.L9)({eventName:"UpgradeButtonShown",step:"Apps",feature:"NBEE",params:Object.assign({},(0,S.VR)(N))}),C((0,v.J)({isDismissable:!0,message:e.message,useTranslation:!0,persistent:!0,buttons:"bridge-limit-reached"===e.code?a.createElement("a",{href:window.location.origin+h.VP.pricing.makeUrl()+"?reason=bridge-exceeded",target:"_blank",rel:"noreferrer"},a.createElement(b.z,{$variant:"primary"},L("nbee.checkCompatibility.updatePlanCta"))):void 0}))}}),[z,Y,X]);const ce=(e,t)=>{H({bridgeId:x},{onError:n=>{t.setSubmitting(!1);const a=(0,s.L)(n);(0,y.L9)({eventName:"UnexpectedErrorThrown",feature:"NBEE",step:"Apps",params:Object.assign(Object.assign({},(0,S.VR)(e)),{custom:{errorCode:a.code,errorDescription:a.message}}),sendEventToIntercom:!0})},onSuccess:n=>{var a;!1===(null===(a=n.data)||void 0===a?void 0:a.result)?t.setSubmitting(!1):(0,y.L9)({eventName:"BridgePublished",feature:"NBEE",step:"Publish",params:Object.assign({},(0,S.VR)(e)),sendEventToIntercom:Boolean(370===(null==e?void 0:e.source.appId))})}})},ue=null==q?void 0:q.data,pe="pro"===(null==U?void 0:U.pricing.cbPlanId.split("_")[0]);return(0,a.useEffect)((()=>{if(ue&&ue.result){const e={success:!0,firstBridge:ue.firstBridge&&pe};A.push(h.VP.nbeeStep3.makeUrl(x.toString()),e)}}),[ue]),ee?a.createElement(l.p,{activeStepIndex:1,bridgeId:x,errorCode:(0,s.L)(ee).code,statusCode:(0,s.L)(ee).status,errorMessage:(0,s.L)(ee).message}):Q||!re?a.createElement(r.w,{activeStepIndex:1,bridgeId:x,loadingText:L(K?"nbee.bridgeBuilder.permissionCheckLoadingMessage":"nbee.bridgeBuilder.step2LoadingMessage")}):te&&se&&R?a.createElement(o.F,{showWelcomeMessage:ne,bridgeId:x,key:`${se.source.appId}-${se.destination.appId}`,isSavingApi:G||J,initialValues:se,allBridgeFields:R.data,bridgeFilterRulesList:le,onRefetchBridgeFormValues:$,availablePermissionChecks:B,onSubmit:(e,t)=>
60{const n=(0,i.u)(e,{step:2});V({bridgeData:n,bridgeId:`${x}`},{onSuccess:()=>((e,t)=>{ae?W({bridgeId:x,permissionChecklist:(null==B?void 0:B.data.permissionChecklist)||[]},{onSuccess:()=>{oe(!1),ce(e,t)},onError:n=>{oe(!1),de(n,e,t)}}):ce(e,t)})(e,t),onError:n=>de(n,e,t)})}}):null}},5347:(e,t,n)=>{n.d(t,{n:()=>g});var a=n(89526),o=n(40473),r=n(18305),i=n(7106),l=n(84340),s=n(33907),d=n(72698),c=n(97981),u=n(34966),p=n(28856),m=n(51256);const g=()=>{var e,t,n;const{bridgeId:g}=(0,r.UO)(),{data:v,isLoading:h,error:f}=((0,r.TH)(),(0,i.j)(g)),{data:b,isLoading:E}=(0,c.S)(),y=null==v?void 0:v.source.appId,S=null==v?void 0:v.destination.appId,I=y?null===(e=(b||[]).find((({id:e})=>e===y)))||void 0===e?void 0:e.name:void 0,w=y?null===(t=(b||[]).find((({id:e})=>e===S)))||void 0===t?void 0:t.name:void 0,{performanceBoosterAvailable:k,errorGettingPerformanceBooster:T,existingPerformanceBoosterAvailable:x,existingPbId:C}=(0,p.o)({bridgeId:g,destinationId:S,sourceId:y}),{dwhAvailable:A,existingDwhId:L,errorGettingDwh:U}=(0,m.T)({bridgeId:g,sourceId:y,destinationId:S}),N=null===(n=null==v?void 0:v.ui)||void 0===n?void 0:n.testEnabled,{data:P,isLoading:$}=(0,u.b)(y,S);return h||E||$?a.createElement(l.w,{activeStepIndex:2}):v&&b&&P?a.createElement(o.S,{bridgeId:g,bridgeName:v.name,sourceName:I,destinationName:w,redirectUri:null==P?void 0:P.uri,isTestEnabledProp:N,performanceBoosterAvailable:k,errorPerformanceBooster:T,existingPerformanceBoosterAvailable:x,existingPbId:C,dwhAvailable:A,existingDwhId:L,errorDwh:U}):f?a.createElement(s.p,{activeStepIndex:2,errorCode:(0,d.L)(f).code,statusCode:(0,d.L)(f).status,errorMessage:(0,d.L)(f).message}):null}},94562:(e,t,n)=>{n.d(t,{B:()=>g});var a=n(89526),o=n(34663),r=n(36575),i=n(48698),l=n(18305),s=n(26809),d=n(72698),c=n(18967),u=n(93260),p=n(30808),m=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};const g=()=>{const{mutateAsync:e,isLoading:t}=(0,i.A)(),n=(0,l.k6)(),g=(0,c.T)(),v={position:"",companyName:"",industry:"",capacity:"",country:"",sourceApp:"",budget:"",destinationApp:"",goal:"",secondaryGoal:""},[h,f]=(0,a.useState)(!1),[b,E]=(0,a.useState)(""),[y,S]=(0,a.useState)(!1),I=r.parse(window.location.search),[w,k]=(0,a.useState)(void 0);return(0,a.useEffect)((()=>{(0,u.L9)({eventName:"OnboardingSurveyStarted",feature:"OnboardingSurvey",sendEventToIntercom:!0})}),[]),(0,a.useEffect)((()=>{const e="true"===sessionStorage.getItem("onboarding_survey_access"),t=r.parse(window.location.search);e&&"true"===t.lbfsgn||n.replace(p.VP.nbeeStep1New.makeUrl())}),[n]),(0,a.useEffect)((()=>{y&&void 0!==w&&n.replace(w)}),[n,y]),a.createElement(o.u,{initialValues:v,onSubmit:(t,a)=>m(void 0,void 0,void 0,(function*(){yield e({requestBody:t},{onSuccess:e=>m(void 0,void 0,void 0,(function*(){var t,o,i;a.setSubmitting(!1),(0,u.L9)({eventName:"OnboardingSurveyCompleted",feature:"OnboardingSurvey",sendEventToIntercom:!0});const l=null===(t=e.data)||void 0===t?void 0:t.result.bbuLink,s=`${p.VP.nbeeWelcome.makeUrl()}?${r.stringify(Object.assign(Object.assign({},I),l?{bbuLink:l}:{}))}`;k(s),null==(null===(o=e.data)||void 0===o?void 0:o.result.calendlyUrl)?(n.push(s),S(!0),sessionStorage.clear()):(E(null===(i=e.data)||void 0===i?void 0:i.result.calendlyUrl),f(!0))})),onError:e=>{g((0,s.GD)({title:"Error",messages:[(0,d.L)(e).message],color:"negative"}))}})})),isSavingApi:t,calendlyStep:h,calendlyUrl:b,onClickFinish:()=>{sessionStorage.clear(),S(!0)}})}},1765:(e,t,n)=>{n.d(t,{Z:()=>o});var a=n(89526);const o=()=>a.createElement("div",null,"404")},40417:(e,t,n)=>{n.r(t),n.d(t,{default:()=>q,lbPlansByName:()=>H});var a=n(89526),o=n(52006),r=n(97866),i=n(63459),l=n(54519),s=n(17770),d=n(59831),c=n(12824),u=n(92466),p=n(99933),m=n(89328),g=n(13286),v=n(64317),h=n(58819),f=n(6060),b=n(87819),E=n(39857),y=n(82713),S=n(18305),I=n(30808),w=n(1683),k=n(72698),T=n(64874),x=n(27719),C=n(78095),A=n(55787),L=n(36575),U=n(26809),N=n(18967),P=n(93260),$=n(13284),O=n(199),Z=n(76170),B=n(8529),D=n(78532),_=n(60460),R=n(6405),F=n(33649),M=n(4632),j=n(73728),V=n(24114),z=n(95522),G=n(71829);const H={freemium:6,pro:7,business:8,starter:10},q=()=>{var e,t,n,q,Y,J,W,X;const[K,Q]=(0,a.useState)(!0),[ee,te]=(0,a.useState)(!1),[ne,ae]=(0,a.useState)(0),[oe,re]=(0,a.useState)(0),[ie,le]=(0,a.useState)([]),[se,de]=(0,a.useState)([]),[ce,ue]=(0,a.useState)(""),[pe,me]=(0,a.useState)(),ge=(0,N.T)(),{t:ve}=(0,T.$)(),he=(0,S.k6)(),fe=(0,S.TH)(),be=L.parse(fe.search),Ee=(0,F.v9)((e=>e.application.path)),{zE:ye}=window,{data:Se,isLoading:Ie,refetch:we}=(0,M.d)(),{mutate:ke,isLoading:Te}=(0,z.J)(),xe=(null==Se?void 0:Se.amountDue)||0,Ce=null==Se?void 0:Se.hasActiveSubscription,Ae=(null==Se?void 0:Se.isUnpaid)&&!Ce,[Le,Ue]=(0,a.useState)(!1);let Ne="freemium";(0,a.useEffect)((()=>
60{if(Ee){return he.listen((e=>{"POP"===he.action&&(he.replace(Ee),ge((0,U.QY)()))}))}}),[fe.pathname,Ee]);(null==be?void 0:be.suggestPlan)&&parseInt(be.suggestPlan);const Pe=null==be?void 0:be.reason,{data:$e,isLoading:Oe,error:Ze}=(0,g.r)(),{data:Be,isLoading:De,error:_e}=(0,h.J)(),{data:Re}=(0,R.E)(),Fe=((null==Re?void 0:Re.modules)||[]).find((e=>"customer-support"===e.id)),Me=null==Fe?void 0:Fe.enabled,{mutate:je}=(0,O.R)(),Ve=(null===(e=null==$e?void 0:$e.data)||void 0===e?void 0:e.plans)||[],ze=null===(t=null==$e?void 0:$e.data)||void 0===t?void 0:t.commons,Ge=null==ze?void 0:ze.discount,He=(null==ze?void 0:ze.businessPrice)||999,qe=null==Be?void 0:Be.user.downgradeStatus,Ye=L.parse(fe.search).showFree,Je=(null===(n=null==Be?void 0:Be.usage)||void 0===n?void 0:n.bridgesActive)||0,We=null==Be?void 0:Be.pricing.legacy,Xe=(null===(q=null==Be?void 0:Be.usage)||void 0===q?void 0:q.mtuUsage)||0,Ke=Ve.find((e=>e.id===(null==Be?void 0:Be.pricing.cbPlanId))),Qe=null===(Y=null==Be?void 0:Be.user)||void 0===Y?void 0:Y.userId;(0,G.G)(Qe?`zuora.payment.${Qe}`:"","zuora.collectPayment",Le&&!!Qe,!0,(()=>{Ue(!1)}),(e=>{if(null==e?void 0:e.data){const{status:t,message:n}=e.data;ge((0,U.GD)({title:"success"===t?"Success":"Error",message:n,color:"success"===t?"positive":"negative"}))}we()}));const et=["starter","pro"],tt=et.find((e=>null==Ke?void 0:Ke.id.includes(e)))||null,nt=Boolean(null==Be?void 0:Be.pricing.trial),at=Boolean(null==Be?void 0:Be.pricing.trialAvailable),ot=K?"year":"month",rt="appsumo-2022"===(null==Be?void 0:Be.pricing.cbPlanId),it=null==Be?void 0:Be.pricing.endOfTermsDate,lt=null==Be?void 0:Be.pricing.deleteAt,st=new Date(it||lt).getTime(),dt=(new Date).getTime(),ct=(0,$.T)(st,dt),{mutateAsync:ut}=(0,B.t)(null!==(J=null==pe?void 0:pe.id)&&void 0!==J?J:"");(0,a.useEffect)((()=>{"no"!==qe&&je()}),[Be]),(0,a.useEffect)((()=>{(0,P.L9)({eventName:"PricingTableShown",feature:"Pricing",step:"Table",params:{custom:{reason:Pe}}})}),[Pe]),(0,a.useEffect)((()=>{if(!Oe&&!De&&Ke){/_mo_/.test(Ke.id)&&Q(!1);const e=Ve.filter((e=>e.mtuLimit===(null==Ke?void 0:Ke.mtuLimit)&&e.bridgesLimit===(null==Ke?void 0:Ke.bridgesLimit)));"starter"===tt?(re(Ke.price),de(e)):"pro"===tt&&(ae(Ke.price),le(e))}}),[Oe,De,Ke]),(0,a.useEffect)((()=>{var e;if((null==ie?void 0:ie.length)>1){const t=K?"year":"month",n=null===(e=ie.find((e=>e.period_unit===t)))||void 0===e?void 0:e.price;n&&ae(n)}}),[ie,K]),(0,a.useEffect)((()=>{var e;if((null==se?void 0:se.length)>1){const t=K?"year":"month",n=null===(e=se.find((e=>e.period_unit===t)))||void 0===e?void 0:e.price;n&&re(n)}}),[se,K]);const pt=(e,t)=>{const n=e.toLowerCase();return t===H[n]},mt=(e,t)=>{if(pt(e,H.freemium))return 0;if(pt(e,H.business))return He;{const n=pt(e,H.starter)?oe:ne;return Math.ceil((t?n/12:n)/100)}},gt=e=>Ve.filter((t=>pt(e,t.lbPlan))).map((e=>({value:`${e.mtuLimit}`,label:`${e.mtuLimit.toLocaleString("en-US")} ${ve("billing.pricing.mtuOption")}`,disabled:Xe>e.mtuLimit}))),vt=e=>Ve.filter((t=>pt(e,t.lbPlan))).map((e=>({value:`${e.bridgesLimit}`,label:`${e.bridgesLimit.toLocaleString("en-US")} ${ve("billing.pricing.bridgeOption",{count:e.bridgesLimit})}`,disabled:Je>e.bridgesLimit}))),ht=e=>{var t;const n=(null===(t=null==Be?void 0:Be.pricing)||void 0===t?void 0:t.cbPlanId)?Be.pricing.cbPlanId.split("_")[0]:"";return pt(e,H[n])},ft=()=>{te(!ee)},bt=e=>{const t=Boolean(null==e?void 0:e.result),n=null==e?void 0:e.code,a=null==e?void 0:e.message;if(!t){const e=ve(n?`api.error.${n}`:"billing.checkout.planNotAvailable");ge((0,U.GD)({title:"Error",message:null!=a?a:e,color:"negative"}))}};(0,a.useEffect)((()=>{void 0!==(null==pe?void 0:pe.id)?ut().then((e=>{if(!Boolean(null==e?void 0:e.result))return void bt(e);he.push(I.VP.checkout.makeUrl((null==pe?void 0:pe.id)!==(null==Ke?void 0:Ke.id)?null==pe?void 0:pe.id:void 0))})).catch((e=>{var t;const n=null===(t=e.response)||void 0===t?void 0:t.data;bt(n)})):(0,U.GD)({title:"Error",message:ve("billing.checkout.planNotAvailable"),color:"negative"})}),[pe]);const Et=ht("freemium")||ht("starter"),yt=null===(W=null==$e?void 0:$e.data)||void 0===W?void 0:W.features.find((e=>e.name.toLowerCase()===Ne)),St=!(rt||(null==Be?void 0:Be.pricing.legacy)&&!Ye),It=(null==$e?void 0:$e.data)&&Be&&!Oe&&!De?$e.data.features.map(((e,t)=>{return rt&&pt(e.name,H.freemium)||Be.pricing.legacy&&!Ye&&pt(e.name,H.freemium)||pt(e.name,H.freemium)?null:a.createElement(d.w8,{userData:Be,endOfTermsDate:it,deleteAtDate:lt,remainDays:ct,key:t,isYearlyChecked:K,yearly
60DiscountPercentage:Ge,isActive:ht(e.name),planName:e.name,planDescription:e.description,price:mt(e.name,K),priceDescription:(n=e.name,pt(n,H.freemium)?ve("billing.pricing.freemiumPriceDescription"):pt(n,H.pro)||pt(n,H.starter)?ve(K?"billing.pricing.proPriceDescriptionYearly":"billing.pricing.proPriceDescriptionMonthly"):ve("billing.pricing.businessPriceDescription")),features:We&&pt(e.name,H.pro)?A.G:e.mainFeatures.map((e=>e)),isRecommended:Et&&pt(e.name,H.pro),isCurrentPlan:ht(e.name),onUndoSelect:e=>{const t=Ve.find((t=>e===t.id));me(t)}},pt(e.name,H.freemium)?a.createElement(f.D,{optionsMtu:gt(e.name),optionsBridge:vt(e.name),isCurrentPlan:ht(e.name),onPlanSelect:()=>ft(),remainDays:ct}):pt(e.name,H.business)?a.createElement(b.w,null):pt(e.name,H.pro)||pt(e.name,H.starter)?a.createElement(y.s,{isCurrentPlan:ht(e.name),optionsMtu:gt(e.name),optionsBridge:vt(e.name),onPlanSelect:e=>{const t=e.find((e=>e.period_unit===ot));me(t)},onSelectionChange:e=>{(e=>{const t=e.length>0?et.find((t=>e[0].id.includes(t))):null;"starter"===t?de(e):"pro"===t&&le(e),t&&ue(t)})(e)},plans:Ve,userCurrentPlan:Ke,isTrialAvailable:at,userIsInTrial:nt,isYearlyChecked:K}):null);var n})):null,wt=Oe||De||Ie,kt=Ze||Ze||_e;if((0,C.f)(!wt&&!kt),wt)return a.createElement(v.a,{$active:!0,$size:"large"});if(kt)return a.createElement("div",null,a.createElement(w.v,{$status:"error"},(0,k.L)(kt).message));const Tt={auto:{title:ve("billing.pricing.pageTitleTrialEnded"),intro:ve("billing.pricing.pageIntroTrialEnded")},manual:{title:ve("billing.pricing.pageTitleTrialManual"),intro:ve("billing.pricing.pageIntroTrialManual")},default:{title:ve("billing.pricing.pageTitle"),intro:a.createElement(x.c,{i18nKey:"billing.pricing.pageIntro",components:{a:a.createElement("a",null)}})}},{title:xt,intro:Ct}=Tt[qe]||Tt.default;return a.createElement(m.$,null,a.createElement(c.IC,null,a.createElement("img",{src:o.Z,alt:"company-logo",width:180}),a.createElement(i.IOM,{size:36,onClick:()=>{Ee?(he.push(Ee),ge((0,U.QY)())):window.location.href="https://leadsbridge.com/app"}})),a.createElement(c.we,null,a.createElement(c.f8,null,a.createElement(a.Fragment,null,a.createElement("h2",null,xt),a.createElement("p",null,Ct))),a.createElement(c.n5,null,a.createElement(l.r,null))),a.createElement("div",{style:{display:"flex",justifyContent:"center"}},a.createElement(s.D,{$variant:"dark",$size:"large",$labelLeft:ve("billing.pricing.toggleUnitMonthly"),$labelRight:ve("billing.pricing.toggleUnitYearly",{discountPercentage:Ge}),$isChecked:K,onChange:()=>{Q(!K)}})),a.createElement(c.vs,null,We?a.createElement(c.$P,null,ve("billing.changesNotification.legacyCase")):a.createElement(a.Fragment,null),Ae&&a.createElement(V.l,{userCurrentPlan:Ke,planId:null===(X=null==Be?void 0:Be.pricing)||void 0===X?void 0:X.cbPlanId,isLegacyPlan:We}),a.createElement(c.$g,null,It),"no"!==qe&&a.createElement(u.z,{style:{textDecoration:"underline",display:"block",margin:"2rem auto 0"},$variant:"link-primary",onClick:()=>{window.location.href="https://leadsbridge.com/app"}},ve("billing.pricing.ctaNoThanksLink")),a.createElement(E.j,{isOpen:ee,onCloseModal:ft}),yt&&St?a.createElement(Z.e,{plan:yt,isCurrentPlan:ht(yt.name),onPlanSelect:ft,isDisabled:!!it}):null,a.createElement(c.U0,null,a.createElement(r.Dlp,null),a.createElement(c.yh,null,a.createElement(c.ok,null,ve("billing.pricing.needHelpTitle")),a.createElement(c.CE,null,ve("billing.pricing.needHelpText"))),!Me&&a.createElement(_.Z,{id:"support-button-pricing",place:"top",type:"dark",textColor:"white",effect:"solid"},a.createElement("span",null,ve("auth.supportTooltip"))),a.createElement("span",{"data-tip":!0,"data-for":"support-button-pricing"},a.createElement(u.z,{onClick:()=>(0,D.Hl)(ye),$variant:"outlined-secondary",$size:"large",disabled:!Me},ve("billing.pricing.needHelpCta")))),a.createElement("div",{id:"credit-card",style:{width:"100%",background:"rgba(217, 222, 225, .15)"}},a.createElement(p.B,null)),xe>0&&Ce&&a.createElement(j.c,{amount:xe,onPayClick:()=>{Ue(!0),ke(void 0,{onSuccess:()=>{we()},onError:()=>{Ue(!1)}})},isLoading:Te})))}},32180:(e,t,n)=>{n.d(t,{Z:()=>g});var a=n(89526),o=n(8666),r=n(43666),i=n(99459),l=n(85582),s=n(52868),d=n.n(s),c=n(26546),u=n(82359),p=n(565),m=function(e,t,n,a){return new(n||(n=Prom
60ise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};const g=()=>{const[e,t]=(0,a.useState)(!0),[n,s]=(0,a.useState)("");return(0,a.useEffect)((()=>{m(void 0,void 0,void 0,(function*(){var e,t;const n=l.parse(window.location.search.slice(1)),a=sessionStorage.getItem("saml-provider");if(!n.code||!a)return void s("Missing code or provider name");const o=new URLSearchParams;o.append("grant_type","authorization_code"),o.append("client_id","5olbat920m5t8rqhjopk1rdf6c"),o.append("redirect_uri","https://app.leadsbridge.com/auth/redirect"),o.append("code",n.code.toString());try{const e=(yield d().post("https://leadsbridge.auth.us-west-2.amazoncognito.com/oauth2/token",o,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data.access_token;if(!e)return void s("Missing access token from cognito oauth2");const t=yield d().post("https://leadsbridge.com/api/auth/v2/handleSamlUser",{provider:a},{headers:{access_token:e}}),{username:n,password:r}=t.data;if(!n||!r)return void s("We could not find your user in our system");if(!(yield c.g.signIn({username:n,password:r,validationData:[]})))return void s("Login failed: we could validate your SAML session, but it seems we failed to create a valid session for your user");u.Z.onLogin(!1),setTimeout((()=>{window.location.replace("https://leadsbridge.com/app")}),500)}catch(n){if(d().isAxiosError(n)){const a=(null===(t=null===(e=n.response)||void 0===e?void 0:e.data)||void 0===t?void 0:t.message)||n.message;s(a)}else n instanceof Error&&s(n.message)}}))}),[]),(0,a.useEffect)((()=>{n&&t(!1)}),[n]),a.createElement("div",null,e?a.createElement(o.Z,{style:{minHeight:"100vh"}},a.createElement(r.Z,{active:!0,inverted:!0},a.createElement(i.Z,{inverted:!0},"Loading"))):a.createElement("div",{className:"ui negative message text-center"},a.createElement("i",{className:"exclamation triangle large icon",style:{marginBottom:"1rem"}}),a.createElement("div",{className:"header",style:{marginBottom:"1rem"}},n),a.createElement(p.rU,{to:"/saml"},"Login again")))}},34038:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(89526),o=n(34663),r=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};const i=()=>"app.leadsbridge.com"===window.location.hostname?null:a.createElement("div",null,a.createElement(o.u,{initialValues:{position:"",companyName:"",industry:"",capacity:"",country:"",sourceApp:"",budget:"",destinationApp:"",goal:"",secondaryGoal:""},onSubmit:(e,t)=>r(void 0,void 0,void 0,(function*(){t.setSubmitting(!1)}))}))},30808:(e,t,n)=>{n.d(t,{VP:()=>p,f4:()=>m,hu:()=>g});const a={nbee:{path:"/nbee",makeUrl:()=>"/nbee"},nbeeWelcome:{path:"/nbee/welcome",makeUrl:()=>"/nbee/welcome"},nbeeBridgeChooserStep1:{path:"/nbee/bridge",makeUrl:()=>"/nbee/bridge"},nbeeBridgeChooserStep2:{path:"/nbee/bridge/select-editor/:sourceAppId/:destinationAppId",makeUrl:({sourceAppId:e,destinationAppId:t})=>`/nbee/bridge/select-editor/${e}/${t}`},nbeeStep1New:{path:"/nbee/bridge/new",makeUrl:()=>"/nbee/bridge/new"},nbeeAppBbu:{path:"/bc/app/:source/:destination",makeUrl:({source:e,destination:t})=>`/bc/app/${e}/${t}`},nbeeStep1Edit:{path:"/nbee/bridge/edit/:bridgeId",makeUrl:e=>`/nbee/bridge/edit/${e}`},nbeeStep2:{path:"/nbee/bridge/fields-mapping/:bridgeId",makeUrl:e=>`/nbee/bridge/fields-mapping/${e}`},nbeeStep3:{path:"/nbee/bridge/status/:bridgeId",makeUrl:e=>`/nbee/bridge/status/${e}`},nbeeInfoPage:{path:"/nbee/bridge/status/info",makeUrl:()=>"/nbee/bridge/status/info"}},o={integration:{path:"/integration",makeUrl:({appId:e})=>`/integration/credentials/${e}/new`},integrationAuthScreen:{path:"/integration/credentials/:appId/new",makeUrl:({appId:e})=>`/integration/credentials/${e}/new`},integrationAuthScreenEdit:{path:"/integration/credentials/:appId/edit/:integrationId",makeUrl:({integrationId:e,appId:t})=>`/integration/credentials/${t}/edit/${e}`},integrationAuthScreenEditWithBridgeId:{path:"/integration/credentials/:appId/edit/:integrationId/bridge/:bridgeId",makeUrl:({integrationId:e,appId:t,bridgeId:n})=>`/integration/credentials/${t}/edit/${e}/bridge/${n}`},integrationAuthScreenEditStep2:{path:"/integration/credentials/:appId/edit/:integrationId/save",makeUrl:({integrationId:e,appId:t})=>`/integration/credentials/${t}/edit/${e}/save`},integrationAuthScreenCallback:{path:"/integration/oauth/callback",makeUrl:()=>"/integration/oauth/callback"},integrationAuthScreenCallback2:{path:"/integration/oauth2/callback",makeUrl:()=>"/integration/oauth2/callback"},incomingData:{path:"/integration/incoming-data",makeUrl:()=>"/integration/incoming-data"},incomingDataScreen:{path:"/integration/incoming-data/:appId/new/:integrationId",makeUrl:({appId:e,integrationId:t})=>`/integration/incoming-data/${e}/new/${t}`},incomingDataScreenEdit:{path:"/integration/incoming-data/:appId/edit/:integrationId",makeUrl:({appId:e,integrationId:t})=>`/integration/incoming-data/${e}/edit/${t}`},incomingDataScreenFields:{path:"/integration/incoming-data/:appId/fields/:integrationId?",makeUrl:({appId:e,integrationId:t})=>`/integration/incoming-data/${e}/fields/${t}?`},incomingDataScreenSave:{path:"/integration/incoming-data/:appId/save/:integrationId?",makeUrl:({appId:e,integrationId:t})=>`/integration/incoming-data/${e}/save/${t}`}},r={pricing:{path:"/pricing",makeUrl:()=>"/pricing",makeUrlWithState:(e,t)=>
60({pathname:"/pricing/",search:e&&t?`reason=${e}&suggestPlan=${t}`:""})},checkout:{path:"/checkout",makeUrl:e=>"/checkout"+(e?`/?pid=${e}`:"")},checkoutThankYouPage:{path:"/checkout/success",makeUrl:e=>({pathname:"/checkout/success",state:e})}},i={fbe:{path:"/fbe",makeUrl:()=>"/fbe"},fbeCallback:{path:"/fbe/callback",makeUrl:()=>"/fbe/callback"},fbAppStore:{path:"/fbAppStore",makeUrl:()=>"/fbAppStore"},fbAppStoreDone:{path:"/fbAppStore/done",makeUrl:()=>"/fbAppStore/done"}},l=function({obj:e,prefix:t}){const n=[];let a;for(a in e)if(e.hasOwnProperty(a)){const o=t?t+"["+a+"]":a,r=e[a];n.push(null!==r&&"object"==typeof r?l({obj:r,prefix:o}):encodeURIComponent(o)+"="+encodeURIComponent(r))}return n.join("&")},s={signup:{path:"/signup",makeUrl:()=>"/signup"},signupBbu:{path:"/bc/lb/:source/:destination",makeUrl:({source:e,destination:t})=>`/bc/lb/${e}/${t}`},signupBbuFallbackSurvey:{path:"/signup-survey/:partnerName/:source/:destination",makeUrl:({partnerName:e,source:t,destination:n})=>`/signup-survey/${e}/${t}/${n}`},signupPartner:{path:"/deals/:partner/:couponCode?",makeUrl:()=>"/deals/:partner/:couponCode"},signupOnboardingSurvey:{path:"/onboarding-survey",makeUrl:()=>"/onboarding-survey"},signin:{path:"/signin",makeUrl:()=>"/signin"},forgotPassword:{path:"/signin/forgotpassword",makeUrl:()=>"/signin/forgotpassword"},changePassword:{path:"/changepassword",makUrl:()=>"/changepassword"},saml:{path:"/signin/saml",makeUrl:()=>"/signin/saml"},samlRedirect:{path:"/auth/redirect",makeUrl:()=>"/auth/redirect"},logout:{path:"/logout",makeUrl:({redirectTo:e,toastMessage:t})=>{const n=(({redirectTo:e,toastMessage:t})=>{const n=e?{path:e}:{},a=t&&t.message?{message:btoa(JSON.stringify(t))}:{},o=l({obj:Object.assign(Object.assign({},n),a)});return o?`?${o}`:""})({redirectTo:e,toastMessage:t});return"/logout"+(n?`?${n}`:"")}}},d={googleAdsAccountFormCreate:{path:"/google-ads-account/create",makeUrl:()=>"/google-ads-account/create"},googleAdsAccountFormCreated:{path:"/google-ads-account/create/:customerId",makeUrl:({customerId:e})=>`/google-ads-account/create/${e}`},googleAdsAccountActivate:{path:"/google-ads-account/activate",makeUrl:()=>"/google-ads-account/activate"},googleAdsAccountConnect:{path:"/google-ads-account/connect",makeUrl:()=>"/google-ads-account/connect"}},c="admin-private",u={adminPrivateRoot:{path:`/${c}`,makeUrl:()=>`/${c}`},adminPrivateValidateFbToken:{path:`/${c}/validate-facebook-token`,makeUrl:()=>`/${c}/validate-facebook-token`}},p=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s),{bridgeByUrl:{path:"/bc/:partnerName/:source?/:destination?",makeUrl:({partnerName:e,source:t,destination:n})=>`/bc/${e}/${t}/${n}`},bridgeByUrlEmbedded:{path:"/ebc/:partnerName/:source?/:destination?",makeUrl:({partnerName:e,source:t,destination:n})=>`/ebc/${e}/${t}/${n}`},bridgeByUrlCallback:{path:"/auth/:partnerFullName/callback",makeUrl:({partnerFullName:e})=>`/auth/${e}/callback`}}),i),a),d),o),r),u),m=[p.nbeeStep1New.path,p.nbeeStep1Edit.path,p.nbeeAppBbu.path,p.signupBbu.path],g=[p.bridgeByUrl.path,p.bridgeByUrlEmbedded.path]},78638:(e,t,n)=>{n.d(t,{Z:()=>l});var a=n(81463),o=n(52868),r=n.n(o),i=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};class l{}l.authorizeUrl="/auth/v2/initUser",l.handleFbeParametersUrl="/fbe/v2/handleFbeParameters",l.setupInstanceUrl="/fbe/v2/setupInstance",l.fbeCancelUrl="/fbe/v2/fbeCancel",l.evoToken="/auth/v2/evoToken",l.authorize=()=>i(void 0,void 0,void 0,(function*(){return yield(0,a.Y)().then((e=>e.post("https://leadsbridge.com/api"+l.authorizeUrl,{}).then((e=>e.data)).catch((e=>null))))})),l.facebookParameters=(e,t,n)=>i(void 0,void 0,void 0,(function*(){return yield(0,a.Y)().then((a=>a.post("https://leadsbridge.com/api"+l.handleFbeParametersUrl,{flowType:e,instanceId:t,requestUri:n}).then((e=>e.data))))})),l.setupInstance=e=>i(void 0,void 0,void 0,(function*(){return yield(0,a.Y)().then((t=>
60t.post("https://leadsbridge.com/api"+l.setupInstanceUrl,e).then((e=>e.data))))})),l.fbeCancel=e=>i(void 0,void 0,void 0,(function*(){return yield(0,a.Y)().then((t=>t.post("https://leadsbridge.com/api"+l.fbeCancelUrl,e).then((e=>e.data))))})),l.setupSessionCookie=(e,t)=>i(void 0,void 0,void 0,(function*(){return yield r().post("https://leadsbridge.com/api"+l.evoToken,{token:e,domain:t},{withCredentials:!0}).then((e=>e.data)).catch((e=>null))})),l.cancelSessionCookie=e=>i(void 0,void 0,void 0,(function*(){return yield r().delete("https://leadsbridge.com/api"+l.evoToken,{data:{domain:e},withCredentials:!0}).then((e=>e.data)).catch((e=>null))}))},82359:(e,t,n)=>{n.d(t,{Z:()=>h});var a=n(95995),o=n(66643),r=n(60609),i=n(26546),l=n(57864),s=n(8921),d=n(78638),c=n(26809),u=n(73087),p=n(52868),m=n.n(p),g=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};const v=()=>{const e=new Date;localStorage.setItem("auth-expiration",String(e.setDate(e.getDate()+1)))};class h{}h.setCsrfCookie=e=>g(void 0,void 0,void 0,(function*(){yield m().post(u.H.csrf,{},{headers:{Authorization:`Bearer ${e}`},withCredentials:!0})})),h.setSessionCookie=()=>g(void 0,void 0,void 0,(function*(){yield i.g.currentSession().then((e=>g(void 0,void 0,void 0,(function*(){var t;const n=e.getAccessToken().getJwtToken();yield d.Z.setupSessionCookie(n,null!==(t=".leadsbridge.com")?t:""),yield h.setCsrfCookie(n)}))))})),h.onLogin=(e,t)=>g(void 0,void 0,void 0,(function*(){const n=window.location.pathname;yield h.setSessionCookie();(new l.Z).remove(s.b.LbImp,{path:"/",domain:".leadsbridge.com"}),e||v(),n.includes("/fbAppStore")&&((0,r.m)(r.V.AppInvoked),(0,r.m)(r.V.UserLogged)),a.Xb.dispatch(o.bo,{event:o.gQ,message:o.jq.SignedIn,data:null}),t&&t((0,c.RK)(!0))})),h.onLoginAsync=(e,t)=>g(void 0,void 0,void 0,(function*(){return yield h.setSessionCookie().then((()=>{e||v(),a.Xb.dispatch(o.bo,{event:o.gQ,message:o.jq.SignedIn,data:null}),t&&t((0,c.RK)(!0))}))}))},80542:(e,t,n)=>{n.d(t,{Z:()=>i});var a=n(52868),o=n.n(a),r=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};class i{}i.federatedToCognitoUrl="/federated/federatedToCognitoUser",i.describeIdentityProviderUrl="/cognitoAPI/DescribeIdentityProvider",i.listIdentityProvidersUrl="/cognitoAPI/ListIdentityProviders",i.listIdentityProviders=()=>r(void 0,void 0,void 0,(function*(){return yield o().get("https://lambda-api.leadsbridge.com"+i.listIdentityProvidersUrl).then((e=>e.data))})),i.describeIdentityProvider=e=>r(void 0,void 0,void 0,(function*(){return yield o().post("https://lambda-api.leadsbridge.com"+i.describeIdentityProviderUrl,{name:e}).then((e=>e.data))})),i.federatedToCognito=(e,t,n,a)=>r(void 0,void 0,void 0,(function*(){return yield o().post("https://lambda-api.leadsbridge.com"+i.federatedToCognitoUrl,{id_token:e,provider:t,email:n,requestUri:a}).then((e=>e.data))}))},85371:(e,t,n)=>{n.d(t,{Z:()=>s});var a=n(26546),o=n(80542),r=n(26809),i=n(82359),l=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};class s{}s.initFB=()=>{window},s.fbAsyncInit=()=>{window.FB.init({appId:"939660826071336",cookie:!0,xfbml:!0,version:"v2.11"})},s.createScriptFb=()=>{window.fbAsyncInit=s.fbAsyncInit;const e=document.createElement("script");e.src="https://connect.facebook.net/en_US/sdk.js",e.async=!0,e.onload=s.initFB,document.body.appendChild(e)},s.getAWSCredentials=(e,t,n)=>l(void 0,void 0,void 0,(function*(){return new Promise(((t,s)=>{const{accessToken:d,expiresIn:c}=e;(new Date).getTime();if(!d)return;window.FB.api("/me",{fields:"name,email"},(e=>l(void 0,void 0,void 0,(function*(){const t={name:e.name,email:e.email};yield o.Z.federatedToCognito(d,"FACEBOOK",t.email,window.location.href).then((e=>{a.g.signIn({username:t.email,password:e.password,validationData:[]}).then((e=>{i.Z.onLogin(!1,n)}))})).catch((e=>{var t;400===e.response.status?(n((0,r.GD)({title:"Cannot login",messages:["You are registered without a social account. Log in with your account credentials."],color:"warning"})),s()):(n((0,r.GD)({title:"Error",messages:[(null===(t=e.response)||void 0===t?void 0:t.data)?e.response.data:"Unknown error"],color:"negative"})),s())}))}))))}
60))})),s.signInWithFacebook=(e,t)=>l(void 0,void 0,void 0,(function*(){return new Promise(((n,a)=>{const o=window.FB;o.getLoginStatus((r=>l(void 0,void 0,void 0,(function*(){"connected"===r.status?s.getAWSCredentials(r.authResponse,e,t).finally((()=>n(!0))):yield o.login((o=>l(void 0,void 0,void 0,(function*(){o&&o.authResponse?s.getAWSCredentials(o.authResponse,e,t).finally((()=>n(!0))):a()}))),{scope:"public_profile,email"})}))))}))}))},4282:(e,t,n)=>{n.d(t,{t:()=>u});var a=n(52868),o=n.n(a),r=n(30085),i=n(30808),l=n(57864),s=n(8921),d=n(59934),c=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};const u=o().create();u.interceptors.request.use((e=>c(void 0,void 0,void 0,(function*(){var t;const n=(0,r.u2)()||(yield(0,r.Hg)());if(!n)return e;const{accessToken:a,deviceKey:o}=n;e.headers.Authorization=`Bearer ${a}`,e.headers["Content-Type"]="application/json",e.headers["device-id"]=o,e.headers["mapping-version"]="2";const c=(0,d.LX)(window.location.pathname,{path:[i.VP.nbeeStep1Edit.path,i.VP.nbeeStep2.path,i.VP.nbeeStep3.path],exact:!0,strict:!1}),u=null===(t=null==c?void 0:c.params)||void 0===t?void 0:t.bridgeId;u&&(e.headers["X-bridge-id"]=u);const p=(new l.Z).get(s.b.LbImp);return p&&(e.headers["X-logged-as-Id"]=p),e})))),u.interceptors.response.use(void 0,(e=>{var t;const n=window.location.pathname;if(401===(null===(t=e.response)||void 0===t?void 0:t.status)){const e=`${window.location.origin}${i.VP.logout.makeUrl({redirectTo:n,toastMessage:{message:"You've been logged out.",type:"positive"}})}`;window.location.assign(e)}return Promise.reject(e)}))},29559:(e,t,n)=>{n.d(t,{N:()=>r});var a=n(52868),o=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};const r=n.n(a)().create();r.interceptors.request.use((e=>o(void 0,void 0,void 0,(function*(){return e.headers["Content-Type"]="application/json",e}))))},81463:(e,t,n)=>{n.d(t,{Y:()=>c});var a=n(52868),o=n.n(a),r=n(26546),i=n(57864),l=n(8921),s=function(e,t,n,a){return new(n||(n=Promise))((function(o,r){function i(e){try{s(a.next(e))}catch(e){r(e)}}function l(e){try{s(a.throw(e))}catch(e){r(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,l)}s((a=a.apply(e,t||[])).next())}))};const d=o().create({baseURL:"https://leadsbridge.com/api",timeout:6e4}),c=()=>s(void 0,void 0,void 0,(function*(){const{accessToken:e,expiration:t}=yield r.g.currentSession().then((e=>{const t=e.getIdToken().getExpiration();return{accessToken:e.getAccessToken().getJwtToken(),expiration:t}})),n=(Math.round(+new Date/1e3),localStorage.getItem("auth-expiration"));if(n){const e=new Date,t=Date.parse(n);if(e.getTime()>=t)return localStorage.clear(),yield r.g.signOut(),Promise.reject("Session Expired")}const a=yield r.g.currentAuthenticatedUser().then((e=>e));return yield a.getCachedDeviceKeyAndPassword(),d.interceptors.request.use((t=>{t.headers.Authorization=`Bearer ${e}`,t.headers["Content-Type"]="application/json";const n=(new i.Z).get(l.b.LbImp);return n&&(t.headers["X-logged-as-Id"]=n),t}),(e=>Promise.reject(e))),d}))},26809:(e,t,n)=>{n.d(t,{GD:()=>r,J:()=>i,M2:()=>s,QY:()=>p,RK:()=>d,Rx:()=>u,Z3:()=>o,Zy:()=>l,nR:()=>c});var a=n(10381);const o=()=>({type:a.gZ});function r(e){return{type:a.$I,payload:e}}function i(e){return{type:a.jf,payload:e}}const l=()=>({type:a.FR}),s=e=>({type:a.IF,payload:e}),d=e=>({type:a.DG,payload:e}),c=e=>({type:a.Eg,payload:e}),u=e=>({type:a.Im,payload:e}),p=()=>({type:a.s_})},43322:(e,t,n)=>{n.d(t,{A4:()=>r,J$:()=>o,r$:()=>i});var a=n(94869);const o=e=>({type:a.QT,payload:e.data}),r=e=>({type:"SET_INTEGRATION_LISTENER_FIELDS",payload:e}),i=e=>
60({type:"SET_INTEGRATION_LISTENER_STATUS",payload:e})},19293:(e,t,n)=>{n.d(t,{X8:()=>l,dl:()=>i,jj:()=>r,ne:()=>o});var a=n(34135);const o=e=>({type:a.uC,payload:e}),r=()=>({type:a.rJ}),i=e=>({type:a.ED,payload:e}),l=()=>({type:a.GM})},18967:(e,t,n)=>{n.d(t,{C:()=>r,T:()=>o});var a=n(33649);const o=()=>(0,a.I0)(),r=a.v9},65633:(e,t,n)=>{n.d(t,{P:()=>r});var a=n(97281),o=n(10381);const r=(0,a.Lq)({displayVerticalSidebar:!1,toast:null,alert:null,user:void 0,loginLayout:null,path:null,trackSignIn:!1,integrationId:null},(e=>{e.addCase(o.gZ,((e,t)=>{e.displayVerticalSidebar=!e.displayVerticalSidebar})).addCase(o.$I,((e,t)=>{e.toast=t.payload})).addCase(o.jf,((e,t)=>{e.alert=t.payload})).addCase(o.FR,((e,t)=>{e.alert&&!e.alert.persistent&&(e.alert=null)})).addCase(o.IF,((e,t)=>{e.loginLayout=t.payload})).addCase(o.Im,((e,t)=>{e.path=t.payload})).addCase(o.s_,((e,t)=>{e.path=null})).addCase(o.DG,((e,t)=>{e.trackSignIn=t.payload})).addCase(o.Eg,((e,t)=>{e.integrationId=t.payload})).addCase(o.XV,((e,t)=>{e.integrationId=null}))}))},50552:(e,t,n)=>{n.d(t,{b:()=>i});var a=n(97281),o=n(25159),r=n(45808);const i=(0,a.Lq)({status:r.o.NONE,platformId:0},(e=>{e.addCase(o.d,((e,t)=>{e.status=t.payload})).addCase(o.O,((e,t)=>{e.platformId=t.payload}))}))},88042:(e,t,n)=>{n.d(t,{A:()=>i});var a=n(97281),o=n(94869);const r={data:null},i=(0,a.Lq)(r,(e=>{e.addCase("SET_INTEGRATION_LISTENER",((e,t)=>{e.data=t.payload})).addCase("SET_INTEGRATION_LISTENER_FIELDS",((e,t)=>{e.data&&t.payload.data&&(e.data.fields=[...t.payload.data.recognizedFields])})).addCase("SET_INTEGRATION_LISTENER_STATUS",((e,t)=>{e.data&&(e.data.status=t.payload)})).addCase(o.Ud,(()=>r))}))},73112:(e,t,n)=>{n.d(t,{G:()=>i});var a=n(97281),o=n(34135),r=n(66643);const i=(0,a.Lq)({auth:void 0,authState:void 0},(e=>{e.addCase(o.uC,((e,t)=>{e.auth=t.payload})).addCase(o.rJ,(e=>{e.auth=void 0})).addCase(o.ED,((e,t)=>{e.authState=t.payload})).addCase(o.GM,(e=>{e.authState=r.jq.SignIn}))}))},10381:(e,t,n)=>{n.d(t,{$I:()=>o,DG:()=>c,Eg:()=>u,FR:()=>i,IF:()=>l,Im:()=>s,XV:()=>p,gZ:()=>a,jf:()=>r,s_:()=>d});const a="TOGGLE_SIDEBAR",o="SEND_TOAST",r="SEND_ALERT_MESSAGE",i="CLOSE_ALERT_MESSAGE",l="SET_LOGIN_LAYOUT",s="SET_PATH",d="RESET_PATH",c="SET_TRACK_SIGNIN",u="TRIGGER_CONNECT_ACCOUNT_POPUP",p="RESET_TRIGGER_CONNECT_ACCOUNT_POPUP"},25159:(e,t,n)=>{n.d(t,{O:()=>o,d:()=>a});const a="SET_STATUS",o="SET_PLATFORM_ID"},94869:(e,t,n)=>{n.d(t,{QT:()=>a,Ud:()=>o});const a="SET_INTEGRATION_LISTENER",o="UNSET_INTEGRATION_LISTENER"},34135:(e,t,n)=>{n.d(t,{ED:()=>r,GM:()=>i,rJ:()=>o,uC:()=>a});const a="SET_CURRENT_USER",o="UNSET_CURRENT_USER",r="SET_AUTH_STATE",i="UNSET_AUTH_STATE"},30937:(e,t,n)=>{n.d(t,{T:()=>d});var a=n(89526),o=n(8260);const r=o.vJ` 61 html, body { 62 font-family: 'Open Sans', sans-serif !important; 63 } 64 .ui.input.error > input { 65 background-color: #FEF5F4 !important; 66 border-color: #CC2029 !important; 67 color: #9f3a38 !important; 68 box-shadow: none !important; 69 } 70 71 .ui.bulleted.list { 72 margin-left: 13px !important; 73 } 74 75 .ui.bulleted.list .item::before { 76 color: #A1A4B1 !important; 77 font-size: 22px; 78 line-height: 0.36; 79 margin-left: -13px !important; 80 } 81 82 .ui.form .field .prompt.label{ 83 padding-right: 0; 84 padding-left: 0; 85 border-color: white !important; 86 margin-top: 0; 87 } 88 .ui.form .field .prompt.label:before{ 89 content: unset; 90 } 91`,i=o.vJ` 92 .fitContent{ 93 max-width: fit-content; 94 max-width: max-content; 95 } 96 97 .text-center{ 98 text-align: center; 99 } 100 101 ${[0,1,2,3,4,5].map((e=>o.iv` 102 103 .m-${e} { 104 margin: ${e}rem; 105 } 106 107 .mt-${e} { 108 margin-top: ${e}rem; 109 } 110 111 .mb-${e} { 112 margin-bottom: ${e}rem; 113 } 114 115 .ml-${e} { 116 margin-left: ${e}rem; 117 } 118 119 .mr-${e} { 120 margin-right: ${e}rem; 121 } 122 123 .my-${e} { 124 margin-top: ${e}rem; 125 margin-bottom: ${e}rem; 126 } 127 128 .mx-${e} { 129 margin-left: ${e}rem; 130 margin-right: ${e}rem; 131 } 132 133 // Padding 134 135 .p-${e} { 136 padding: : ${e}rem; 137 } 138 139 .pt-${e} { 140 padding-top: ${e}rem; 141 } 142 143 .pb-${e} { 144 padding-bottom: ${e}rem; 145 } 146 147 .pl-${e} { 148 padding-left: ${e}rem; 149 } 150 151 .pr-${e} { 152 padding-right: ${e}rem; 153 } 154 155 .py-${e} { 156 padding-top: ${e}rem; 157 padding-bottom: ${e}rem; 158 } 159 160 .px-${e} { 161 padding-left: ${e}rem; 162 padding-right: ${e}rem; 163 } 164 `))} 165 166 167 .divisor-label{ 168 position: relative; 169 } 170 .divisor-label > * { 171 position: absolute; 172 left: 0; 173 right: 0; 174 text-align: center; 175 width: 100%; 176 padding: 0 10px; 177 background-color: white; 178 } 179 180 /* do we need this? */ 181 .list { 182 &.unlisted{ 183 list-style: none; 184 padding-left: 0 ; 185 } 186 187 &.list-even li:nth-child(even), 188 &.list-odd li:nth-child(odd) { 189 background-color: whitesmoke 190 } 191 } 192 193 [autocomplete="off"]:-webkit-autofill { 194 display: none!important; 195 } 196 197 .flex-row-reverse { 198 flex-direction: row-reverse; 199 } 200 201 .reactTooltipSmall {
202 max-width: 40rem; 203 } 204 205 .reactTooltipFilterIcons { 206 padding: 0 1rem !important; 207 font-size: .7rem !important; 208 } 209 210 .customTooltipIcon { 211 width: 15rem; 212 box-shadow: 0px 4px 10px 0px #808080; 213 border-radius: 5px; 214 } 215 216 .customTooltipInput { 217 max-width: 70%; 218 box-shadow: 0px 4px 10px 0px #808080; 219 border-radius: 5px; 220 word-break: break-all; 221 } 222 223`,l=o.vJ` 224 @keyframes rotate360 { 225 from { 226 transform: rotate(0deg); 227 transform-origin: center; 228 } 229 230 to { 231 transform: rotate(360deg); 232 transform-origin: center; 233 } 234 } 235 236 @keyframes fillProgressBar { 237 from {width: 1%;} 238 to {width: 100%;} 239 } 240`,s=o.vJ` 241 html, body { 242 font-family: 'Open Sans', sans-serif !important; 243 font-size: 16px!important; 244 -webkit-font-smoothing: antialiased; 245 box-sizing: border-box; 246 } 247 248 *, *:before, *:after { 249 box-sizing: inherit; 250 } 251 252 h1, h2, h3, h4, h5 { 253 font-family: 'Open Sans', sans-serif !important; 254 font-weight: 600; 255 } 256 257 /* Fix last pass plugin */ 258 input[autocomplete="off"]:-webkit-autofill{ 259 display: block !important 260 } 261 img[id^="__lpform_"]{ 262 cursor: pointer !important; 263 } 264 .gtx-trans-icon{ 265 display: none; 266 } 267`,d=()=>a.createElement(a.Fragment,null,a.createElement(s,null),a.createElement(r,null),a.createElement(i,null),a.createElement(l,null))},78659:(e,t,n)=>{n.d(t,{F:()=>d,T:()=>s});var a=n(8260);const o=[768,800],r=`${o[0]}px`,i=`${o[1]}px`,l=`${o[1]+1}px`,s=e=>a.iv` 268 @media (min-width: ${r}) and (max-width: ${i}) { 269 ${e} 270 } 271`,d=e=>a.iv` 272 @media (min-width: ${l}) { 273 ${e} 274 } 275`},90274:(e,t,n)=>{n.d(t,{u:()=>a});const a={brand:{primary:{background:"#fd9645",color:"#fff",boxShadow:"1px 3px 6px 0 rgba(253, 150, 69, 0.3)"}},chips:{text:{backgroundColor:"rgba(128,128,128,0.90)",closeIconColorHover:"rgb(206,206,206)",backgroundColorHover:"rgba(128,128,128,1)"},formula:{backgroundColor:"rgba(40,59,84,0.90)",closeIconColorHover:"#dbe7ff",backgroundColorHover:"rgba(40,59,84,1)"},custom:{backgroundColor:"rgba(65,131,196,0.90)",closeIconColorHover:"#d1e8ff",backgroundColorHover:"rgba(65,131,196,1)"},source:{backgroundColor:"rgba(34,167,240,0.90)",closeIconColorHover:"#c9e4fd",backgroundColorHover:"rgba(34,167,240,1)"}},input:{default:{placeholder:"#808080",backgroundColor:"#fff",borderColor:"rgba(34, 36, 38, 0.15)",color:"rgba(0, 0, 0, 0.87)"},disabled:{background:"rgba(34, 36, 38, 0.03)",color:"rgb(128 128 128)"},error:{backgroundColor:"#fef5f4",borderColor:"#cc2029",color:"rgba(0, 0, 0, 0.87)"},success:{backgroundColor:"rgba(46, 204, 113, 0.1)",borderColor:"#0c783a",color:"rgba(0, 0, 0, 0.87)"}},button:{facebook:{backgroundColor:"#3778ea",backgroundColorHover:"#2f6edd",color:"#fff"},tiktok:{backgroundColor:"#fe2c55",color:"#fff"},primary:{backgroundColor:"#22a7f0",backgroundColorHover:"#2987cd",color:"#fff"},secondary:{backgroundColor:"#121232",backgroundColorHover:"#28304a",color:"#fff"},link:{backgroundColor:"none",color:"#3778EA"}},container:{medium:"768px",large:"1080px",extralarge:"1280px"},font:{family:'"Open Sans", sans-serif'},color:{primary:"#41a6dc",action:"#fd9645",link:"#4183c4",green:"#2ecc71",error:"#cc2029"},zIndex:{modal:1e3,panelFooter:50,dropdown:60,overallNotifications:9999},utils:{boxShadow:"rgb(0 0 0 / 2%) 0px -4px 6px -1px, rgb(0 0 0 / 4%) 0px -2px 4px -1px"}}},60609:(e,t,n)=>{n.d(t,{V:()=>a,m:()=>o});const a={AppInvoked:"app_invoked",UserCreated:"account_created",UserLogged:"account_logged_in",PlatformInvoked:"platform_invoked",PlatformError:"platform_error",PlatformAuthorized:"platform_authorized",PlatformCompleted:"platform_completed"},o=e=>{const t=Date.now(),n=JSON.stringify({timestamp:t,event:e});window.parent.postMessage(n,"*")}},13498:(e,t,n)=>{n.d(t,{E:()=>a});const a=e=>{const t=Array.isArray(e)?e.join(","):e;return window.btoa(unescape(encodeURIComponent(t)))}},13284:(e,t,n)=>{n.d(t,{T:()=>a});const a=(e,t)=>{if(0!==e){return Math.ceil((e-t)/864e5)}return 0}},2353:(e,t,n)=>{n.d(t,{n:()=>o});var a=n(79058);const o=e=>a.cognitoErrors[e.code]||e.message||"Something is wrong, this is an unexpected error"},54891:(e,t,n)=>{n.d(t,{_I:()=>i,d8:()=>o});const a=new(n(57864).Z),o=(e,t,n=1)=>{a.set(e,t,{path:"/",domain:".leadsbridge.com",maxAge:n?86400*n:86400})},r=e=>a.get(e),i=()=>{const e=r("tap.id"),t=r("tap.vid");
275if(e&&t)return{tapClickId:e,tapVisitorId:t}}},87662:(e,t,n)=>{n.d(t,{L:()=>a});const a="true"==="MISSING_ENV_VAR".WEBPACK_KEEP_CONSOLE_LOGS},78532:(e,t,n)=>{n.d(t,{Hl:()=>i,_v:()=>a,qI:()=>r});const a=e=>new Promise((t=>setTimeout(t,e)));let o=!1;const r=e=>{o=e},i=e=>{o&&(e("messenger","show"),e("messenger","open"),e("messenger:on","close",(function(){e("messenger","hide")})))}},87269:(e,t,n)=>{n.d(t,{z:()=>a});const a=()=>{try{return window.self!==window.top}catch(e){return!0}}},14284:(e,t,n)=>{n.d(t,{D:()=>a});const a=()=>{const e=()=>Math.floor(65536*(1+Math.random())).toString(16).substring(1);return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}},91259:(e,t,n)=>{n.d(t,{L:()=>o});class a{}a.email=new RegExp(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/),a.password=new RegExp(/^(?=.{9,}$)(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*\W).*$/);const o=e=>/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.+[A-Z]{2,12}$/i.test(e)},62682:(e,t,n)=>{n.d(t,{D:()=>o,A:()=>r});var a=n(39379);const o=(e="Please enter a valid phone number")=>a.Z_().test("is-valid-phone",e,(e=>!e||(e=>{if(!e)return!1;const t=e.charAt(0),n=e.replace(/ /g,""),a="+"===t||/^\d+$/.test(t),o=/^(?=.*\d)[\d ]+$/.test(e.substr(1));return a&&o&&n.length>4&&20>=n.length})(e))),r=e=>a.Xg().required().oneOf([!0],e||"This field is required")}},o={};function r(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.m=a,e=[],r.O=(t,n,a,o)=>{if(!n){var i=1/0;for(c=0;e.length>c;c++){for(var[n,a,o]=e[c],l=!0,s=0;n.length>s;s++)(!1&o||i>=o)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(l=!1,i>o&&(i=o));if(l){e.splice(c--,1);var d=a();void 0!==d&&(t=d)}}return t}o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[n,a,o]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce(((t,n)=>(r.f[n](e,t),t)),[])),r.u=e=>"static/js/"+e+"."+{221:"3611571d8a1da4573139",1125:"9ef4638075f4074ce9de",1455:"b7cec7e5b241ba05fe27",3635:"855a7b4d365247e0e2fb",9985:"24d3ffbad6e10db7b6a6"}[e]+".chunk.js",r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n="leadsbridge:",r.l=(e,a,o,i)=>{if(t[e])t[e].push(a);else{var l,s;if(void 0!==o)for(var d=document.getElementsByTagName("script"),c=0;d.length>c;c++){var u=d[c];if(u.getAttribute("src")==e||u.getAttribute("data-webpack")==n+o){l=u;break}}l||(s=!0,(l=document.createElement("script")).charset="utf-8",l.timeout=120,r.nc&&l.setAttribute("nonce",r.nc),l.setAttribute("data-webpack",n+o),l.src=e),t[e]=[a];var p=(n,a)=>{l.onerror=l.onload=null,clearTimeout(m);var o=t[e];if(delete t[e],l.parentNode&&l.parentNode.removeChild(l),o&&o.forEach((e=>e(a))),n)return n(a)},m=setTimeout(p.bind(null,void 0,{type:"timeout",target:l}),12e4);l.onerror=p.bind(null,l.onerror),l.onload=p.bind(null,l.onload),s&&document.head.appendChild(l)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",(()=>{var e={2756:0};r.f.j=(t,n)=>{var a=r.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var o=new Promise(((n,o)=>
275a=e[t]=[n,o]));n.push(a[2]=o);var i=r.p+r.u(t),l=new Error;r.l(i,(n=>{if(r.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;l.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",l.name="ChunkLoadError",l.type=o,l.request=i,a[1](l)}}),"chunk-"+t,t)}},r.O.j=t=>0===e[t];var t=(t,n)=>{var a,o,[i,l,s]=n,d=0;if(i.some((t=>0!==e[t]))){for(a in l)r.o(l,a)&&(r.m[a]=l[a]);if(s)var c=s(r)}for(t&&t(n);i.length>d;d++)r.o(e,o=i[d])&&e[o]&&e[o][0](),e[o]=0;return r.O(c)},n=self.webpackChunkleadsbridge=self.webpackChunkleadsbridge||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var i=r.O(void 0,[4312,291,4065,1985,9715,1101,4592,1968,10,8901,2626,4329,5348,6766,2823,9161,7621,3703,4625,9366,6030,4201,556,9868,8789,5973,1868,8227,7523,7638,1958,9862,4359,3771,3617,1245,4087,139,1043,9857,5687,9602,8763,2239,8829,1714,4843,4056,5691,7548,8350,6241,9904,7759,4673,7165,8094,2850,1791,2223,2332,3195,9165,225,7219,3061,6680,376,7793],(()=>r(60209)));i=r.O(i)})(); 276//# sourceMappingURL=main-0a037d97-c3f2dbe23da8bc6b8a4d.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.