"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7713],{40813:function(e,n,t){t.d(n,{Br:function(){return p},jv:function(){return f},kD:function(){return h},re:function(){return v},vS:function(){return d}});var r=t(19521);function i(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function o(){var e=i(["\n  padding: 3rem;\n  height: 100%;\n  display: flex;\n  flex-direction: column;\n  .CardActions {\n    margin-top: auto;\n  }\n"]);return o=function(){return e},e}function a(){var e=i([""]);return a=function(){return e},e}function s(){var e=i(["\n      font-size: var(--font-size-m);\n    "]);return s=function(){return e},e}function c(){var e=i(["\n  font-weight: bold;\n  ","\n"]);return c=function(){return e},e}function u(){var e=i(["\n  font-size: var(--font-size-xs);\n  overflow: auto;\n  color: var(--steel);\n"]);return u=function(){return e},e}function l(){var e=i(["\n  border: 0.1rem solid black;\n  border-collapse: collapse;\n\n  th,\n  td {\n    border: 0.1rem solid black;\n    border-collapse: collapse;\n    padding: 0.6rem;\n  }\n"]);return l=function(){return e},e}var d=r.default.div.attrs({className:"ChangeTermsPopupContainer"}).withConfig({componentId:"sc-dd7bc01-0"})(o()),f=r.default.p.withConfig({componentId:"sc-dd7bc01-1"})(a()),p=r.default.p.withConfig({componentId:"sc-dd7bc01-2"})(c(),(function(e){return e.large&&(0,r.css)(s())})),h=r.default.div.attrs({className:"ConsentAgreementsContentWrapper"}).withConfig({componentId:"sc-dd7bc01-3"})(u()),v=r.default.table.attrs({className:"ConsentPricingTable"}).withConfig({componentId:"sc-dd7bc01-4"})(l())},91938:function(e,n,t){t.d(n,{Z:function(){return Ne}});var r=t(34051),i=t.n(r),o=t(85893),a=t(46670),s=t(11163),c=t(67294),u=t(58971),l=t.n(u),d=t(76842),f=t(12882),p=t(24643),h=t(63479),v=t(37288),m=t(20929),A=t(21049),P=t.n(A),g=t(20118),y=t(57779),x=t(17863);function b(e,n,t,r,i,o,a){try{var s=e[o](a),c=s.value}catch(u){return void t(u)}s.done?n(c):Promise.resolve(c).then(r,i)}function j(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){b(o,r,i,a,s,"next",e)}function s(e){b(o,r,i,a,s,"throw",e)}a(void 0)}))}}var w=(0,a.observer)((function(e){var n=e.setLoading,t=(0,p.Z)(),r=t.adminNotification,o=t.adminStore,a=o.currentClient,s=o.currentPartner,u=null===a||void 0===a?void 0:a.id,l=s.id,f=(function(){var e=j(i().mark((function e(){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,d.Z.accounting.stripe.createPortal({partnerId:l,clientId:u},window.location.href);case 4:t=e.sent,window.open(t.url,"_self"),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(1);case 10:return e.prev=10,n(!1),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[1,8,10,13]])})))}(),function(){var e=j(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.Z.clients.payment.get({clientId:u,partnerId:l});case 3:return n=e.sent,o.paymentInfo=n,e.abrupt("return",n);case 8:return e.prev=8,e.t0=e.catch(0),r.add({type:r.types.ERROR,message:(0,x.Z)(e.t0)}),e.abrupt("return",null);case 12:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}()),v=function(){var e=j(i().mark((function e(){var n,t,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(null===s||void 0===s?void 0:s.paymentRequired)||!(null===(n=o.currentUser)||void 0===n?void 0:n.isClient)){e.next=9;break}return e.next=4,f();case 4:(r=e.sent)&&r.prepaid&&null===r.billing_country&&console.error((0,g.Z)(h.k.PRE_alertNoPaymentCountry)),r&&(null===y.n||void 0===y.n||y.n.people.set({direct_payment:!0,prepaid:r.prepaid||!1,billing_country:r.billing_country||""})),e.next=12;break;case 9:if((null===s||void 0===s?void 0:s.paymentRequired)||!(null===(t=o.currentUser)||void 0===t?void 0:t.isClient)){e.next=12;break}return e.next=12,f();case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return c.useEffect((function(){v()}),[s]),null})),k=w,S=t(41608);function I(e){var n=e.children,t=e.clientEnabledForChat,r=(0,S.o)().update;return null===r||void 0===r||r({hideDefaultLauncher:!t}),(0,o.jsx)(c.Fragment,{children:n})}function C(e,n,t,r){var i={name:e.name,email:e.email,customAttributes:n};return(0,o.jsx)(S.H,{appId:m.Z.intercomAppId,autoBoot:!0,autoBootProps:i,children:(0,o.jsx)(I,{clientEnabledForChat:t,children:r})})}var Z=t(77898),R=t(56978),O=t(29323),T=t(79897),E=t.n(T),U=t(34942),D=t(46495),N=t(40813),L=t(30104),M=function(){return(0,o.jsxs)(N.kD,{children:[(0,o.jsx)(N.Br,{style:{marginBottom:"0.5rem"},children:(0,o.jsx)("strong",{children:"Information on Pricing Change Updates"})}),(0,o.jsx)(N.jv,{style:{marginLeft:"1rem"},children:"Please be informed that as of August 1st 2023 360dialog will be changing our Partner pricing model to better reflect the evolving landscape around hosting costs and the opportunities presented by cloud WABA services. Our new model will offer three tiers outlined below:"}),(0,o.jsxs)(N.jv,{children:[(0,o.jsxs)(N.re,{children:[(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{children:(0,o.jsx)("strong",{children:"Tier"})}),(0,o.jsx)("td",{style:{width:"5rem"},children:(0,o.jsx)("strong",{children:"Price"})}),(0,o.jsx)("td",{style:{width:"5rem"},children:(0,o.jsx)("strong",{children:"SLA"})}),(0,o.jsx)("td",{children:(0,o.jsx)("strong",{children:"Capacity"})}),(0,o.jsx)("td",{children:(0,o.jsx)("strong",{children:"Support"})}),(0,o.jsx)("td",{children:(0,o.jsx)("strong",{children:"Account Management"})}),(0,o.jsx)("td",{children:(0,o.jsx)("strong",{children:"Payment type"})}),(0,o.jsx)("td",{children:(0,o.jsx)("strong",{children:"Add Ons included"})})]}),(0,o.jsxs)("tr",{children:[(0,o.jsxs)("td",{children:[(0,o.jsx)("strong",{children:"Basic"}),(0,o.jsx)("br",{}),"Cloud WABA Only"]}),(0,o.jsx)("td",{children:"$15"}),(0,o.jsx)("td",{children:"98%"}),(0,o.jsx)("td",{children:"Up to 1,000 messages per second"}),(0,o.jsx)("td",{children:"Ticket-based support with 24 hours response time"}),(0,o.jsx)("td",{children:"Partner Hub, Client Hub, Partner API"}),(0,o.jsx)("td",{children:"Direct Payment, Partner Payment"}),(0,o.jsx)("td",{children:"None"})]}),(0,o.jsxs)("tr",{children:[(0,o.jsxs)("td",{children:[(0,o.jsx)("strong",{children:"Regular"}),(0,o.jsx)("br",{}),"On-premise or Cloud WABA"]}),(0,o.jsx)("td",{children:"$25"}),(0,o.jsx)("td",{children:"98%"}),(0,o.jsxs)("td",{children:["Cloud: Up to 1,000 messages per second",(0,o.jsx)("br",{}),"On-premise: Up to 25 messages per second**"]}),(0,o.jsxs)("td",{children:[(0,o.jsx)(U.Link,{variant:"secondary",href:"https://docs.360dialog.com/docs/useful/help-and-support/support-packages-and-slas",target:"blank",children:(0,o.jsx)("strong",{children:"Standard"})}),(0,o.jsx)("br",{}),"Chat with real time responses, guaranteed investigation in 4 hours during available hours*"]}),(0,o.jsx)("td",{children:"Partner Hub, Client Hub, Partner API"}),(0,o.jsx)("td",{children:"Direct Payment, Partner Payment"}),(0,o.jsx)("td",{children:"Ads & Measurement Funnel Tracking"})]}),(0,o.jsxs)("tr",{children:[(0,o.jsxs)("td",{children:[(0,o.jsx)("strong",{children:"Premium"}),(0,o.jsx)("br",{}),"On-premise or Cloud WABA"]}),(0,o.jsx)("td",{children:"$49"}),(0,o.jsxs)("td",{children:[">","99%"]}),(0,o.jsxs)("td",{children:["Cloud: Up to 1,000 messages per second",(0,o.jsx)("br",{}),"On-premise: Up to 25 messages per second**"]}),(0,o.jsxs)("td",{children:[(0,o.jsx)(U.Link,{variant:"secondary",href:"https://docs.360dialog.com/docs/useful/help-and-support/support-packages-and-slas#premium-support",target:"blank",children:(0,o.jsx)("strong",{children:"Premium"})}),(0,o.jsx)("br",{}),"Chat with real time responses, guaranteed investigation in 30 minutes during available hours*"]}),(0,o.jsx)("td",{children:"Partner Hub, Client Hub, Partner API"}),(0,o.jsx)("td",{children:"Direct Payment, Partner Payment"}),(0,o.jsxs)("td",{children:["Ads & Measurement Funnel Tracking",(0,o.jsx)("br",{}),(0,o.jsx)("br",{}),"get.chat 5 user inbox license"]})]})]}),(0,o.jsxs)("td",{children:["* Support availability: Monday to Friday, 24 hours. Saturday and Sunday from 9am to 5pm CET.",(0,o.jsx)("br",{}),(0,o.jsx)("hr",{}),"** Upgrade available for more capacity:",(0,o.jsx)("br",{}),"\xa0\xa0\xa0\xa0Half Scale can process up to 120 messages per second and costs $249",(0,o.jsx)("br",{}),"\xa0\xa0\xa0\xa0Full Scale can process up to 250 messages per second and costs $499"]}),(0,o.jsx)("hr",{}),(0,o.jsx)("br",{})]}),(0,o.jsx)(N.jv,{style:{marginLeft:"1rem"},children:"Any current on premise WABA will be automatically charged at the \u2018Regular\u2019 rate of $25 as of the 1st of August 2023. If you would like to consider migrating on premise WABAs to the \u2018Basic\u2019 tier of $15 then please contact us to discuss how we can facilitate this. However please do be aware of the difference in support levels between our \u2018Basic\u2019 tier and \u2018Regular\u2019 tier."}),(0,o.jsx)(N.jv,{style:{marginLeft:"1rem"},children:"It is our intention to continue to offer best in class Account Management and support services. Moving to this model will allow us to continue to do so in a landscape of rising costs across all sectors and ensure we can invest in bringing new features and products to our Partners."}),(0,o.jsx)("br",{}),(0,o.jsx)(N.Br,{children:"How to migrate to Basic tier"}),(0,o.jsxs)(N.jv,{style:{marginLeft:"1rem"},children:["To have access to the Basic tier, you need to make sure your integration works with Cloud hosting. Please see the detailed information about the integration"," ",(0,o.jsx)(U.Link,{variant:"secondary",href:"https://docs.360dialog.com/partner/integration/cloud-waba-integration",target:"blank",children:(0,o.jsx)("strong",{children:"here"})})," ","and"," ",(0,o.jsx)(U.Link,{variant:"secondary",href:"https://docs.360dialog.com/partner/integration/cloud-waba-integration/differences-between-cloudapi-and-on-premise-api-for-partners",target:"blank",children:(0,o.jsx)("strong",{children:"here"})}),"."]}),(0,o.jsxs)(N.jv,{style:{marginLeft:"1rem"},children:["We are preparing a feature that will allow you to change the tier of each account directly in the 360dialog Partner Hub. In the meantime, please email ",(0,o.jsx)("strong",{children:"growth@360dialog.com"})," with the list of accounts you wish to move to Basic tier."]}),(0,o.jsx)("br",{}),(0,o.jsx)(N.Br,{children:"If you don't want to pay on behalf of clients anymore"}),(0,o.jsxs)(N.jv,{style:{marginLeft:"1rem"},children:["You also have the option to enable"," ",(0,o.jsx)(U.Link,{variant:"secondary",href:"https://docs.360dialog.com/partner/first-steps/360dialog-accounts-structure/prices-plans-and-payment-options#direct-payment",target:"blank",children:(0,o.jsx)("strong",{children:"Direct Payment"})}),", where the client will pay directly to us. To enable this option, please email ",(0,o.jsx)("strong",{children:"growth@360dialog.com"}),"."]}),(0,o.jsx)("br",{}),(0,o.jsx)(N.Br,{children:"How to cancel an account"}),(0,o.jsxs)(N.jv,{style:{marginLeft:"1rem"},children:["If needed, the client can always"," ",(0,o.jsx)(U.Link,{variant:"secondary",href:"https://docs.360dialog.com/docs/360-client-hub/the-360-client-hub/cancellation#cancel-subscription",target:"blank",children:(0,o.jsx)("strong",{children:"cancel their subscription"})})," ","directly in the 360dialog Partner Hub."," ",(0,o.jsx)("strong",{children:"The cancellation rules explained in this document will still apply normally."})]}),(0,o.jsx)(N.jv,{style:{marginLeft:"1rem"},children:'Alternatively if you wish to stop being responsible for a particular client you can select the new "Stop payment on behalf of client" button in the \u2018client details\u2019 section of the 360dialog Partner Hub. Once requested, we will cancel the subscription and allow the client to pay us directly if they wish to'}),(0,o.jsx)("br",{}),(0,o.jsx)(N.Br,{children:"About our partnership contract"}),(0,o.jsx)(N.jv,{style:{marginLeft:"1rem"},children:"Unless otherwise explicitly agreed, the contract shall be concluded for a period of 24 months and shall be automatically renewed for a further period of 12 months unless properly and timely terminated by either of the contracting parties."}),(0,o.jsxs)(N.jv,{style:{marginLeft:"1rem"},children:["Our payment terms, invoice due date and any other agreements continue the same as present in our contract and"," ",(0,o.jsx)(U.Link,{variant:"secondary",href:"https://docs.360dialog.com/partner/first-steps/360dialog-accounts-structure/prices-plans-and-payment-options",target:"blank",children:(0,o.jsx)("strong",{children:"documentation"})}),"."]}),(0,o.jsx)("br",{}),(0,o.jsx)(N.Br,{children:"Government Entities"}),(0,o.jsx)(N.jv,{style:{marginLeft:"1rem"},children:"As a reflection of the level of service and required throughput necessary to properly support public bodies and government entities any local or national government entity or NGO will be charged at the Premium Rate of $49 and will be set up only as a cloud service. On-Premise will not be an option."})]})};function _(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function B(e,n,t,r,i,o,a){try{var s=e[o](a),c=s.value}catch(u){return void t(u)}s.done?n(c):Promise.resolve(c).then(r,i)}function F(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function W(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){F(e,n,t[n])}))}return e}function z(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,o=[],a=!0,s=!1;try{for(t=t.call(e);!(a=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==t.return||t.return()}finally{if(s)throw i}}return o}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return _(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return _(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var H=1,q="08.02.2023",V=(0,O.observer)((function(e){var n,t,r,a,s,u,d,f,v=e.partnerId,A=e.loading,P=(0,p.Z)().adminStore,y=z(c.useState(!0),2),x=y[0],b=y[1],j=z(c.useState(),2),w=j[0],k=j[1],S=z(c.useState(!1),2),I=S[0],C=S[1];c.useEffect((function(){var e;void 0!==(null===P||void 0===P||null===(e=P.currentPartner)||void 0===e?void 0:e.paymentRequired)&&C(!0)}),[null===(n=P.currentPartner)||void 0===n?void 0:n.paymentRequired]),c.useEffect((function(){var e,n=l().get("".concat(m.Z.localStoragePrefixMP,".ChangedTermsSubProcessorsShown"));n&&(null===(e=P.currentUser)||void 0===e?void 0:e.email)&&k(n[P.currentUser.email]),n||b(!1)}),[null===(t=P.currentUser)||void 0===t?void 0:t.email]),c.useEffect((function(){var e,n=l().get("".concat(m.Z.localStoragePrefixMP,".ChangedTermsSubProcessorsShown"));n&&(null===(e=P.currentUser)||void 0===e?void 0:e.email)&&k(n[P.currentUser.email]),n||b(!1)}),[null===(r=P.currentUser)||void 0===r?void 0:r.email,x]);var Z,O=function(){var e,n=(e=i().mark((function e(){var n,t,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=w?null===w||void 0===w?void 0:w.timesShown:0,r=l().get("".concat(m.Z.localStoragePrefixMP,".ChangedTermsSubProcessorsShown")),l().set("".concat(m.Z.localStoragePrefixMP,".ChangedTermsSubProcessorsShown"),W({},r,F({},null===(n=P.currentUser)||void 0===n?void 0:n.email,{timesShown:t+1,lastShown:(0,R.Z)(new Date,"dd.MM.yyyy")}))),b(!0);case 5:case"end":return e.stop()}}),e)})),function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){B(o,r,i,a,s,"next",e)}function s(e){B(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(){return n.apply(this,arguments)}}(),T=(0,o.jsx)(D.Vq,{width:"100rem",height:"100rem",children:(0,o.jsxs)(N.vS,{children:[(0,o.jsx)(D.ll,{large:!0,children:(0,g.Z)(h.k.A_priceChangePopupTitle)}),(0,o.jsxs)(D.aY,{children:[(0,o.jsx)(U.Spacer,{size:"l"}),(0,o.jsx)(U.Body,{children:(0,o.jsx)(M,{})})]}),(0,o.jsxs)(D.T$,{style:{border:"none"},children:[(0,o.jsx)(E(),{size:"medium",variant:"secondary",fullWidth:!0,onClick:function(){window.open("".concat(m.Z.clientHubUrl,"/lp/consent/360dialog-price-changes"),"_blank")},children:(0,g.Z)(h.k.A_learnMore)}),(0,o.jsx)(E(),{size:"medium",variant:"primary",fullWidth:!0,onClick:function(){O()},children:(0,g.Z)(h.k.A_acceptAndClose)})]})]})}),_=null===v?void 0:v,V=null===P||void 0===P?void 0:P.currentUser,G=!(null===P||void 0===P||null===(a=P.currentPartner)||void 0===a?void 0:a.paymentRequired)&&(null===(s=P.currentUser)||void 0===s?void 0:s.isPartner),J=(null===P||void 0===P||null===(u=P.currentPartner)||void 0===u?void 0:u.paymentRequired)&&((null===(d=P.currentUser)||void 0===d?void 0:d.isPartner)||(null===(f=P.currentUser)||void 0===f?void 0:f.isClient)),Q=(0,L.F)("termsOfServiceChangePrice",_)&&(G||J),Y=new Date<new Date(q),X=w,K=(null!==(Z=null===X||void 0===X?void 0:X.timesShown)&&void 0!==Z?Z:0)<H;return I&&!A&&!x&&V&&Q&&(!X&&Y||X&&K)?T:null})),G=V,J=t(34680),Q=t(12102),Y=t(84519),X=t(56637),K=t(72387),$=t(19521);function ee(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function ne(){var e=ee(["\n  display: flex;\n  flex-direction: column;\n  gap: 4.8rem;\n  margin-bottom: 2.4rem;\n"]);return ne=function(){return e},e}function te(){var e=ee(["\n  font-weight: var(--font-weight-semibold);\n  font-size: var(--font-size-m);\n"]);return te=function(){return e},e}function re(){var e=ee(["\n  font-weight: var(--font-weight-regular);\n  font-size: var(--font-size-s);\n"]);return re=function(){return e},e}var ie=$.default.div.attrs({className:"UnpaidInvoiceWarningContainer"}).withConfig({componentId:"sc-1f89509b-0"})(ne()),oe=$.default.div.attrs({className:"UnpaidHeading"}).withConfig({componentId:"sc-1f89509b-1"})(te()),ae=$.default.div.attrs({className:"UnpaidMessage"}).withConfig({componentId:"sc-1f89509b-2"})(re()),se=t(64366),ce=t.n(se),ue=t(33992),le=function(){var e=(0,s.useRouter)();return(0,o.jsx)(ie,{children:(0,o.jsx)(K.Z,{children:(0,o.jsx)(ce(),{variant:"primary-new",iconLocation:"left",icon:(0,o.jsx)(ue.Z,{fill:"var(--turquoise-dark)"}),buttonLabel:"Pay invoice",flexDirection:"row",buttonVariant:"primary",onClick:function(){return e.push("/invoices")},padding:"24px",children:(0,o.jsxs)(U.Body,{size:"s",withoutMargins:!0,children:[(0,o.jsx)(oe,{children:(0,g.Z)(h.k.BILL_unpaidInvoice1)}),(0,o.jsx)(ae,{children:(0,g.Z)(h.k.BILL_unpaidInvoice2)})]})})})})};function de(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function fe(){var e=de(["\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  flex-direction: column;\n  width: 100%;\n  height: 100%;\n"]);return fe=function(){return e},e}function pe(){var e=de(["\n  display: flex;\n  align-items: center;\n  gap: 0.8rem;\n"]);return pe=function(){return e},e}var he=$.default.div.attrs({className:"LoadingContainer"}).withConfig({componentId:"sc-3802b0c6-0"})(fe()),ve=$.default.div.attrs({className:"ExpiredTokenContainer"}).withConfig({componentId:"sc-3802b0c6-1"})(pe()),me=t(75374),Ae=t(79387),Pe=t(41138),ge=t(96230),ye=t(91900),xe=function(e){var n=e.onContinue;return(0,o.jsxs)(D.Vq,{width:"60rem",height:"25rem",children:[(0,o.jsx)(D.ll,{children:(0,g.Z)(h.k.TOS_importantUpdate)}),(0,o.jsx)(D.aY,{padding:"0 2.4rem 0 2.4rem",children:(0,o.jsx)(U.Body,{withoutMargins:!0,size:"s",style:{whiteSpace:"pre-line"},children:(0,g.Z)(h.k.TOS_changeOfTos)})}),(0,o.jsx)(D.T$,{style:{border:"none"},children:(0,o.jsx)(E(),{size:"small",fullWidth:!0,onClick:n,children:(0,g.Z)(h.k.A_continue)})})]})},be=t(27271);function je(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function we(e,n,t,r,i,o,a){try{var s=e[o](a),c=s.value}catch(u){return void t(u)}s.done?n(c):Promise.resolve(c).then(r,i)}function ke(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){we(o,r,i,a,s,"next",e)}function s(e){we(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Se(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,o=[],a=!0,s=!1;try{for(t=t.call(e);!(a=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==t.return||t.return()}finally{if(s)throw i}}return o}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return je(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return je(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ie=(0,a.observer)((function(e){var n=e.hasAcceptedTos,t=e.latestTosVersion,r=e.setHasAcceptedTos,a=Se(c.useState(null),2),s=a[0],u=a[1],l=Se(c.useState(!1),2),f=l[0],v=l[1],m=(0,p.Z)(),A=m.adminStore,P=m.adminNotification,y=A.currentClient,b=(0,be.Z)().doLogout,j=function(){var e=ke(i().mark((function e(){var n,r,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.Z.tos.get.getTosDocByRevision({revision:t.revision});case 3:return n=e.sent,e.next=6,new Blob([n],{type:"application/pdf"});case 6:return r=e.sent,e.next=9,URL.createObjectURL(r);case 9:o=e.sent,u(o),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),P.add({type:P.types.ERROR,timeoutToClose:10,message:(0,x.Z)(e.t0)});case 16:case"end":return e.stop()}}),e,null,[[0,13]])})));return function(){return e.apply(this,arguments)}}();c.useEffect((function(){!n&&(null===t||void 0===t?void 0:t.revision)&&j()}),[n,t]);var w=function(){var e=ke(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(!0),e.prev=1,e.next=4,d.Z.tos.post.acceptTos({revision:t.revision,entityId:null===y||void 0===y?void 0:y.id});case 4:r(!0),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),P.add({type:P.types.ERROR,timeoutToClose:10,message:(0,x.Z)(e.t0)});case 10:return e.prev=10,v(!1),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[1,7,10,13]])})));return function(){return e.apply(this,arguments)}}(),k=Se(c.useState(!0),2),S=k[0],I=k[1];return n?null:S?(0,o.jsx)(xe,{onContinue:function(){return I(!1)}}):(0,o.jsx)(o.Fragment,{children:s?(0,o.jsxs)(D.Vq,{width:"100rem",height:"100rem",children:[(0,o.jsx)("iframe",{src:s,width:"100%",height:"100%",title:"PDF Document"}),(0,o.jsxs)(D.T$,{style:{border:"none"},justifyContent:"space-between",children:[(0,o.jsx)(E(),{size:"medium",variant:"primary",onClick:b,children:(0,g.Z)(h.k.SET_logout)}),(0,o.jsx)(E(),{size:"medium",variant:"primary",onClick:w,isPending:f,children:(0,g.Z)(h.k.TOS_acceptAndClose)})]})]}):(0,o.jsx)(D.Vq,{width:"50rem",height:"30rem",children:(0,o.jsx)(U.Body,{children:(0,o.jsx)(D.aY,{padding:"0 2.4rem 0 2.4rem",children:(0,g.Z)(h.k.TOS_failedToLoad)})})})})})),Ce=Ie;function Ze(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function Re(e,n,t,r,i,o,a){try{var s=e[o](a),c=s.value}catch(u){return void t(u)}s.done?n(c):Promise.resolve(c).then(r,i)}function Oe(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){Re(o,r,i,a,s,"next",e)}function s(e){Re(o,r,i,a,s,"throw",e)}a(void 0)}))}}function Te(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,o=[],a=!0,s=!1;try{for(t=t.call(e);!(a=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==t.return||t.return()}finally{if(s)throw i}}return o}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return Ze(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ze(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var Ee=["/insights","/audiences","/funnels","/integrations"],Ue=function(e){var n=e.isTextShown;return(0,o.jsx)(D.Vq,{fullScreen:!0,children:(0,o.jsx)(he,{children:(0,o.jsx)(ge.Z,{isTextShown:n})})})},De=(0,a.observer)((function(e){var n,t,r,a,u=e.children,A=Te((0,Q.Z)(["auth_c"]),3),y=A[0],b=A[2],j=null===y||void 0===y?void 0:y.auth_c,w=(0,s.useRouter)(),S=(0,p.Z)(),I=S.adminStore,R=S.adminNotification,O=I.currentUser,T=I.setCurrentUser,D=I.destroyLoggedUser,N=I.removeChannels,L=I.channels,M=I.isFetchingChannels,_=I.paymentInfo,B=I.currentClient,F=I.currentPartner,W=(0,Ae.Z)().getAdAccounts,z=(0,J.U)().partnerId,H=Te(c.useState(!1),2),q=H[0],V=H[1],K=Te(c.useState(!1),2),$=K[0],ee=K[1],ne=Te(c.useState(!1),2),te=ne[0],re=ne[1],ie=!q&&void 0!==m.Z.partner_id,oe="pbs"===(null===_||void 0===_?void 0:_.billing_system),ae=(0,ye.Z)(),se=ae.isFetchingClient,ce=ae.getCurrentClient;c.useEffect((function(){var e,n;if(!B){var t=null===(n=null===O||void 0===O||null===(e=O.clients)||void 0===e?void 0:e.find((function(e){return e.partner_id===O.active_partner})))||void 0===n?void 0:n.id;t&&ce(t,O.active_partner)}}),[O]);var ue=null===B||void 0===B?void 0:B.id,de=function(e){var n;(null===e||void 0===e||null===(n=e.roles)||void 0===n?void 0:n.includes("client-owner"))||h.a.changeLanguage("en")},fe=c.useCallback(Oe(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.uc)();case 2:n=e.sent,n.token,l().get("".concat(m.Z.localStoragePrefixMP,".canny_redirect"))||(w.replace("/insights"),(0,v.JP)()),"https://canny.io/api/redirects/sso?",(0,v.JP)(),window.location.assign("https://canny.io/api/redirects/sso?");case 10:case"end":return e.stop()}}),e)}))),[w]),pe=(0,be.Z)().doLogout,he=function(){pe()},ge=Te(c.useState(!1),2),xe=ge[0],je=ge[1],we=c.useCallback(Oe(i().mark((function e(){var n,t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return je(!0),e.prev=1,e.next=4,d.Z.profile.getUserProfile();case 4:n=e.sent,T(n),de(n),location.pathname.includes("/sso")&&fe(),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(1),"Invalid authentication credentials"===(t=(0,x.Z)(e.t0))&&(b("auth_c",{domain:m.Z.domain,path:"/",sameSite:!1,secure:!1}),he()),R.add({type:R.types.ERROR,timeoutToClose:10,message:t});case 15:return e.prev=15,je(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,10,15,18]])}))),[R,fe]);c.useEffect((function(){j&&"null"!==j?we():he()}),[j,D,N]),c.useEffect((function(){if(!M&&L&&0===L.length){var e,n=null===(e=me.s.filter((function(e){return e.relativePath===w.pathname})))||void 0===e?void 0:e[0];n&&!n.tab.isAccessibleWithoutPhoneNumber&&w.push("/number")}}),[L,M]);var ke={partnerId:z,userId:null===O||void 0===O?void 0:O.email,clientId:ue,userType:"client",billingSystem:(null===_||void 0===_?void 0:_.billing_system)||null,paymentRequired:!!(null===F||void 0===F?void 0:F.paymentRequired),"Chat Type":(null===O||void 0===O?void 0:O.isPartner)?"Partner chat":"Client chat",Partner:z,Client:null===B||void 0===B?void 0:B.id};c.useEffect((function(){(O&&(null===B||void 0===B?void 0:B.id)||(null===O||void 0===O?void 0:O.isAdmin))&&ee(!0)}),[null===O||void 0===O?void 0:O.email,null===O||void 0===O?void 0:O.isAdmin,null===_||void 0===_?void 0:_.billing_system,null===F||void 0===F?void 0:F.id,null===B||void 0===B?void 0:B.id]),c.useEffect((function(){(null===O||void 0===O?void 0:O.email)&&Y.u.setUserID(O.email)}),[null===O||void 0===O?void 0:O.email]);var Se=c.useCallback(Oe(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.Z.clients.get.paymentMethods({partnerId:z,clientId:ue});case 3:n=e.sent,I.paymentMethods=n,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),R.add({type:R.types.ERROR,timeoutToClose:10,message:(0,x.Z)(e.t0)});case 10:case"end":return e.stop()}}),e,null,[[0,7]])}))),[R,ue,z]);c.useEffect((function(){var e;oe&&!(null===(e=I.paymentMethods)||void 0===e?void 0:e.length)&&Se()}),[Se,oe]),c.useEffect((function(){var e;(null===(e=I.paymentMethods)||void 0===e?void 0:e[0])&&oe&&ue&&z&&Oe(i().mark((function e(){var n,t,r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,d.Z.clients.get.invoices({partnerId:z,clientId:ue});case 3:t=e.sent,r=null===t||void 0===t||null===(n=t.data)||void 0===n?void 0:n.some((function(e){return e.paymentStatus===X.n.UNPAID})),re(r);case 6:case"end":return e.stop()}}),e)})))()}),[null===_||void 0===_?void 0:_.billing_system,ue,z,I.paymentMethods,oe]),c.useEffect((function(){F&&_&&!((null===F||void 0===F?void 0:F.paymentRequired)&&(null===_||void 0===_?void 0:_.prepaid)&&!oe||oe&&(null===F||void 0===F?void 0:F.paymentRequired))&&w.route.includes("funds")&&w.push("/number")}),[F,null===F||void 0===F?void 0:F.paymentRequired,null===_||void 0===_?void 0:_.prepaid]);var Ie=Te(c.useState(!0),2),Ze=Ie[0],Re=Ie[1],De=Te(c.useState("started"),2),Ne=De[0],Le=De[1];c.useEffect((function(){ue&&Oe(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Re(!0),e.prev=1,e.next=4,d.Z.insights.get.insightAllowed({clientId:ue});case 4:n=e.sent.allowed,I.hasInsightAccess=n,!n&&Ee.includes(w.route)&&w.push("/number"),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),I.hasInsightAccess=!1,console.log("Error loading allowed list",e.t0);case 13:return e.prev=13,Re(!1),Le("finished"),e.finish(13);case 17:case"end":return e.stop()}}),e,null,[[1,9,13,17]])})))()}),[ue]),c.useEffect((function(){ue&&!I.hasInsightAccess&&Ee.includes(w.route)&&"finished"===Ne&&w.push("/number")}),[I.hasInsightAccess,w.route,ue,Ne]);var Me=function(){return(0,o.jsxs)(ve,{children:[(0,o.jsx)(U.Body,{withoutMargins:!0,size:"s",children:(0,g.Z)(h.k.A_fbTokenExpired)}),(0,o.jsx)(E(),{variant:"secondary",size:"small",onClick:function(){return w.push("/ad-accounts")},children:(0,g.Z)(h.k.A_goToAdsAccount)})]})},_e=function(){var e=Oe(i().mark((function e(n){var t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,W(n);case 3:t=e.sent,t.some((function(e){return e.expired_token}))&&R.add({type:R.types.WARNING,message:(0,o.jsx)(Me,{}),timeoutToClose:15}),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),R.add({type:R.types.ERROR,message:(0,x.Z)(e.t0)});case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(n){return e.apply(this,arguments)}}(),Be=Te(c.useState(!1),2),Fe=Be[0],We=Be[1];c.useEffect((function(){var e,n,t;!(null===I||void 0===I||null===(e=I.currentPartner)||void 0===e?void 0:e.paymentRequired)||!(null===B||void 0===B?void 0:B.contactInfo)||void 0!==(null===B||void 0===B||null===(n=B.contactInfo)||void 0===n?void 0:n.streetName)&&(null===B||void 0===B||null===(t=B.contactInfo)||void 0===t?void 0:t.streetName)||We(!0)}),[null===B||void 0===B?void 0:B.contactInfo,null===B||void 0===B||null===(n=B.contactInfo)||void 0===n?void 0:n.streetName,null===I||void 0===I||null===(t=I.currentPartner)||void 0===t?void 0:t.paymentRequired]);var ze=function(){var e=Oe(i().mark((function e(){var n,t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.Z.partnerChannels.get.list({partnerId:z});case 3:n=e.sent,(t=n.partnerChannels.map((function(e){var n;return{appId:null===e||void 0===e||null===(n=e.integration)||void 0===n?void 0:n.appId}})).filter((function(e){return void 0!==e.appId}))).length>0&&_e(t[0].appId),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),R.add({type:R.types.ERROR,message:(0,x.Z)(e.t0)});case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();c.useEffect((function(){z&&I.hasInsightAccess&&!I.checkedToken&&(ze(),I.checkedToken=!0)}),[z,I.hasInsightAccess,I.checkedToken]);var He=null===O||void 0===O||null===(r=O.permissions)||void 0===r?void 0:r.includes("tos:accept"),qe=Te(c.useState(!0),2),Ve=qe[0],Ge=qe[1],Je=Te(c.useState(!1),2),Qe=Je[0],Ye=Je[1],Xe=Te(c.useState(),2),Ke=Xe[0],$e=Xe[1],en=function(){var e=Oe(i().mark((function e(){var n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.Z.tos.get.getLatestTosVersion();case 3:n=e.sent,$e(n),e.next=11;break;case 7:e.prev=7,e.t0=e.catch(0),Ge(!1),R.add({type:R.types.ERROR,timeoutToClose:10,message:(0,x.Z)(e.t0)});case 11:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(){return e.apply(this,arguments)}}();c.useEffect((function(){He?en():Ye(!0)}),[He]);var nn=function(){var e=Oe(i().mark((function e(){var n,t;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.Z.tos.get.getAcceptance({entityId:null===B||void 0===B?void 0:B.id});case 3:(n=e.sent)&&Array.isArray(n)&&(t=n.some((function(e){return(null===e||void 0===e?void 0:e.tos_version_id)===(null===Ke||void 0===Ke?void 0:Ke.id)})),Ye(t)),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),R.add({type:R.types.ERROR,timeoutToClose:10,message:(0,x.Z)(e.t0)});case 10:return e.prev=10,Ge(!1),e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[0,7,10,13]])})));return function(){return e.apply(this,arguments)}}();return c.useEffect((function(){(null===Ke||void 0===Ke?void 0:Ke.id)&&(null===B||void 0===B?void 0:B.id)&&nn()}),[Ke,null===B||void 0===B?void 0:B.id]),(Ze||!O||q||He&&Ve)&&!I.didInitPageLoad?(0,o.jsx)(Ue,{isTextShown:!0}):(I.didInitPageLoad=!0,(0,o.jsx)(c.Fragment,{children:!O||!B||!F||xe||se||He&&Ve||Ze?(0,o.jsx)(Ue,{isTextShown:!1}):(0,o.jsxs)(Z.StatsigProvider,{sdkKey:m.Z.statsigClientKey,waitForInitialization:!0,options:{environment:{tier:"production"}},user:{userID:O.email,custom:{clientId:ue,partnerID:z},customIDs:{clientId:ue,partnerID:z}},children:[(0,o.jsx)(k,{setLoading:V}),$&&te&&(null===I||void 0===I||null===(a=I.paymentMethods)||void 0===a?void 0:a.length)&&(0,o.jsx)(le,{}),!$&&(0,o.jsx)(P(),{}),Qe?Fe?(0,o.jsx)(Pe.Z,{isSingleStep:!0,endSingleStep:We}):null:(0,o.jsx)(Ce,{hasAcceptedTos:Qe,setHasAcceptedTos:Ye,latestTosVersion:Ke}),$&&Qe&&C(O,ke,null===B||void 0===B?void 0:B.enabled_for_chat_support,u),ie&&(0,o.jsx)(G,{partnerId:m.Z.partner_id,loading:q})]})}))})),Ne=De},56637:function(e,n,t){var r;t.d(n,{n:function(){return r}}),function(e){e.PENDING="pending",e.TRIGGERED="triggered",e.PROCESSING="processing",e.ACTION_AWAIT="action_await",e.AUTHORIZED="authorized",e.RETRYING="retrying",e.PAID="paid",e.UNPAID="unpaid",e.ERROR="error",e.REFUNDED="refunded",e.REFUND_TRIGGERED="refund_triggered",e.PARTIALLY_REFUNDED="partially_refunded",e.PARTIALLY_REFUNDED_TRIGGERED="partially_refunded_triggered"}(r||(r={}))},78397:function(e,n,t){var r=t(34051),i=t.n(r),o=t(85893),a=t(67294),s=t(11163),c=t.n(s),u=t(313),l=t(12102),d=t(21049),f=t.n(d),p=t(25728),h=t(37288),v=t(8957),m=t(99202),A=t(81701),P=t(91611);function g(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function y(e,n,t,r,i,o,a){try{var s=e[o](a),c=s.value}catch(u){return void t(u)}s.done?n(c):Promise.resolve(c).then(r,i)}function x(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){y(o,r,i,a,s,"next",e)}function s(e){y(o,r,i,a,s,"throw",e)}a(void 0)}))}}function b(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function j(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){b(e,n,t[n])}))}return e}function w(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,o=[],a=!0,s=!1;try{for(t=t.call(e);!(a=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==t.return||t.return()}finally{if(s)throw i}}return o}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return g(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var k=function(){var e=p.Z.requestCacheAuthenticate().token;v.o.setAuthorizationToken(e),m.V.setAuthorizationToken(e),m.D.setAuthorizationToken(e),A.m.setAuthorizationToken(e),P.M.setAuthorizationToken(e)};n.Z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=function(t){var r=(0,a.useState)(!0),s=r[0],d=r[1],v=w((0,l.Z)(["auth_c"]),2)[1];return(0,a.useEffect)((function(){var e=function(){var e=x(i().mark((function e(){var t,r,o,a,s,l,f,m,A,P,g,y,x;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=new URLSearchParams(window.location.search),r=t.get("shopifyShop"),o=t.get("action"),a=t.get("token"),s=t.get("error"),a&&(l=JSON.parse(a),(0,h.Ff)(l,v),k()),r&&p.Z.saveToLocalStorage("shopifyShop",r),o&&p.Z.saveToLocalStorage("shopifyAction",o),f=p.Z.requestCacheAuthenticate(),m=f.token,A=f.tokenExpiresAt,g=null===(P=(0,u.Z)(new Date(A),new Date))||void 0===P||P,m&&!g&&k(),!m||g){e.next=16;break}d(!1),e.next=26;break;case 16:if(y=t.get("view"),x="",void 0!==y&&null!==y&&(x="/?view=".concat(y)),x||!s){e.next=22;break}return c().replace(n.pathAfterFailure||"/login?error=".concat(s)),e.abrupt("return");case 22:if(!x||!s){e.next=25;break}return c().replace(n.pathAfterFailure||"/login".concat(x,"&error=").concat(s)),e.abrupt("return");case 25:c().replace(n.pathAfterFailure||"/login".concat(x));case 26:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]),s?(0,o.jsx)(f(),{}):(0,o.jsx)(e,j({},t))};return t}},30104:function(e,n,t){t.d(n,{F:function(){return o}});var r=t(34680),i={partnerWhitelist:["srMmqpPA","aUjlH3PA","zW8CroPA","bRVwbQPA","3A99H5PA","CmfFRDPA","1HrOdjPA","DPiM0ePA","rthyxaPA","7iMepZPA","zH3MuZPA"],termsOfServiceChangePrice:["1HrOdjPA","CmfFRDPA","CON5A9PA","9K0803PA","5urmEBPA","8gDDIDPA","J23j2RPA","jaGVLbPA","5Zxli7PA","plHwVcPA","1QcGcbPA","U5ylW4PA","iDtgTpPA","1nkEWWPA","FGnmxgPA","oHk40EPA","drCSjPPA","oWSmVePA","pHWbSuPA","wYhOWPPA","nGW3H5PA","VFZMpTPA","5ILQfnPA","2JDZ0hPA","0SATWQPA","Nk9MhxPA","1OyuqDPA","ickmk2PA","V3wc38PA","wTI5AfPA","vNKb61PA","HJI1ukPA","UfdIklPA","b8VYoNPA","cpabddPA","CkwTH2PA","FUEVMZPA","V01LKzPA","7KFk99PA","7uqptQPA","nBXc8NPA","DuaBzFPA","0SATWQPA","cdmBraPA","S9JSliPA","frnlL3PA","U5oxSgPA","UUSd78PA","wYZlu3PA","LcgcDgPA","QmijZ1PA","Tyon7vPA","PO2HtNPA","5q8SI2PA","jbVmnNPA","I9RpMZPA","Tuk0tFPA","Nog49UPA","t94o8DPA","iQ2lAcPA","LidShFPA","3CMcwYPA","EWcCEUPA","8CMkNlPA","asb2XQPA","w7Z5nNPA","0Ik4qPPA","jDnvuYPA","QKlWYqPA","5lzSJ0PA","eUixdSPA","ATh3hUPA","xNdKcOPA","VodnR5PA","cn5kgIPA","pCPmlfPA","OM9IrxPA","DwXAvePA","5qfJixPA","sQAkg8PA","N8q9EFPA","UcQf2VPA","4NY7sTPA","jDSCbJPA","77r6XBPA","MJx5NwPA","Ae8hq5PA","CXN8ODPA","WDNbKFPA","peRGSUPA","LCUQz9PA","yBmEt2PA","9fIvC4PA","KxcNS7PA","e9OaQsPA","pD8nLIPA","ViA3IhPA","s0CbwUPA","eNecjTPA","nzFZKvPA","JJu1XbPA","4xX6E3PA","YZKzG7PA","MTRBnQPA","xDWnSlPA","pHWbSuPA","mkeCXZPA","8L0NNEPA","0CtDDtPA","lKxjPkPA","1QcGcbPA","0987HrPA","eO730iPA","BmrWFkPA","2oDwvBPA","yiuFCXPA","8YRoKCPA","z19ri4PA","4dltmxPA","1CgA4FPA","shlVMHPA","1BPuMGPA","M40cXvPA","Uqh15pPA","G40NnoPA","26X9QPPA","mns6ydPA","B8NmtTPA","JDv0gHPA","GbM78BPA","k3lDmcPA","R7pQBwPA","rKRgFhPA","9kjcsoPA","ugljugPA","VCaZWVPA","ImXEZUPA","HuYlBjPA","u9dvjmPA","bMGHlGPA","SdMAwIPA","r27bNVPA","F3mkXAPA","U5ylW4PA","AAZ3tjPA","2a8R7pPA","AvqxdnPA","Hni0ZUPA","pT9WWHPA","VmXxJWPA","PaXUqtPA","hOCitlPA","kzFR9DPA","tM9FDiPA","liT2hwPA","W6J7cMPA","QO58gYPA","iMS52vPA","6sgnqXPA","DEu8nqPA","wrZvmxPA","JA8P1JPA","iDtgTpPA","eyRcptPA","d02wePPA","1k3ILcPA","e6BuouPA","05afB5PA","yhkzyzPA","1sA3v9PA","3HZxnWPA","VFZMpTPA","M9VF9oPA","Dhc25rPA","UtWzZIPA","I7dM2NPA","tjYdNWPA","GPhxtfPA","Cs3fYCPA","IxVvcPPA","CajhtNPA","I7aqisPA","xKwILbPA","bRVwbQPA","dkazb1PA","Fn9N04PA","qJdYgpPA","VGHIrdPA","p177cCPA","9AZKtqPA","oUrhKTPA","O4srjnPA","eqQMCmPA","MgNp5yPA","3yKNlwPA","54HwsZPA","xAm2nuPA","XuWWScPA","ZKxY1sPA","okLnSDPA","o2i3WVPA","X5UJ0vPA","ZLuciFPA","Su2jLXPA","xvlRJxPA","YwFvEtPA","EJNmOQPA","obP7p4PA","ByX4OePA","GtTuOJPA","05beyYPA","42Bx7lPA","BXPrc4PA","ESGxeWPA","mBGvPpPA","logQkUPA","LE3RwUPA","UUSd78PA","4xX6E3PA","aCJ5WrPA","zaw6lZPA","oWSmVePA"],directClients360dialog:["SvAiK8PA","Qlvm1vPA","KJNS6kPA","sJrUixPA","vXfVgrPA","uFLRmmPA","rHwLIGPA","srMmqpPA","aUjlH3PA","zW8CroPA"]},o=function(e,n){var t=(0,r.U)().partnerId;return!!i[e]&&(n?i[e].includes(n):!!t&&i[e].includes(t))}},79387:function(e,n,t){var r=t(34051),i=t.n(r),o=t(67294),a=t(76842),s=t(91293),c=t(24643),u=t(20118),l=t(63479),d=t(17863),f=t(79296);function p(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function h(e,n,t,r,i,o,a){try{var s=e[o](a),c=s.value}catch(u){return void t(u)}s.done?n(c):Promise.resolve(c).then(r,i)}function v(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var o=e.apply(n,t);function a(e){h(o,r,i,a,s,"next",e)}function s(e){h(o,r,i,a,s,"throw",e)}a(void 0)}))}}function m(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function A(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"===typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){m(e,n,t[n])}))}return e}function P(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var r,i,o=[],a=!0,s=!1;try{for(t=t.call(e);!(a=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);a=!0);}catch(c){s=!0,i=c}finally{try{a||null==t.return||t.return()}finally{if(s)throw i}}return o}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return p(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}n.Z=function(){var e=(0,c.Z)(),n=e.adminNotification,t=e.adminStore,r=t.currentClient,p=P(o.useState([]),2),h=p[0],m=p[1],g=P(o.useState(!0),2),y=g[0],x=g[1],b=null===r||void 0===r?void 0:r.id,j=function(){var e=v(i().mark((function e(t){var r;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,(0,s.login)();case 3:if("unknown"!==(r=e.sent)){e.next=6;break}throw(0,u.Z)(l.k.ERR_fbConnectionError);case 6:return e.next=8,a.Z.insights.post.connectFbAccount({appId:t,token:r,clientId:b});case 8:f.P.connectedMetaAds({}),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),n.add({type:n.types.ERROR,message:(0,d.Z)(e.t0)});case 14:case"end":return e.stop()}}),e,null,[[0,11]])})));return function(n){return e.apply(this,arguments)}}(),w=function(){var e=v(i().mark((function e(r){var o,s;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return x(!0),e.prev=1,e.next=4,a.Z.insights.get.fbAccounts({clientId:b,appId:r});case 4:return o=e.sent,s=[],o.map((function(e){e.ad_accounts.map((function(n){return s.push(A({},n,{facebookAccounts:e.name,expiredToken:e.expired_token}))}))})),m(s),t.adAccounts=s,e.abrupt("return",s);case 12:e.prev=12,e.t0=e.catch(1),n.add({type:n.types.ERROR,message:(0,d.Z)(e.t0)});case 15:return e.prev=15,x(!1),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[1,12,15,18]])})));return function(n){return e.apply(this,arguments)}}();return{handleFBLogin:j,getAdAccounts:w,adAccounts:h,isFetchingAdAccounts:y}}}}]);
//# sourceMappingURL=7713-b99082f9dab69662.js.map