@saasquatch/mint-components 2.1.9-10 → 2.1.9-11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-big-stat_46.cjs.entry.js +15 -17
- package/dist/cjs/sqm-email-verification_2.cjs.entry.js +10 -1
- package/dist/cjs/{sqm-partner-info-modal-view-cd758f12.js → sqm-partner-info-modal-view-98e2975d.js} +23 -16
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +1 -1
- package/dist/cjs/sqm-widget-verification.cjs.entry.js +360 -0
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal-view.js +22 -16
- package/dist/collection/components/sqm-partner-info-modal/sqm-partner-info-modal.js +31 -1
- package/dist/collection/components/sqm-widget-verification/sqm-widget-verification.js +15 -21
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-big-stat_46.entry.js +15 -17
- package/dist/esm/sqm-email-verification_2.entry.js +10 -1
- package/dist/esm/{sqm-partner-info-modal-view-dbedda28.js → sqm-partner-info-modal-view-74328f70.js} +23 -17
- package/dist/esm/sqm-stencilbook.entry.js +1 -1
- package/dist/esm/sqm-widget-verification.entry.js +356 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-big-stat_46.entry.js +1 -1
- package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
- package/dist/esm-es5/sqm-partner-info-modal-view-74328f70.js +1 -0
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/esm-es5/sqm-widget-verification.entry.js +1 -0
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-d2927531.entry.js → p-0a1669f8.entry.js} +1 -1
- package/dist/mint-components/{p-59f69bdc.system.entry.js → p-0a60980a.system.entry.js} +1 -1
- package/dist/mint-components/p-1c413a06.system.js +1 -1
- package/dist/mint-components/p-278897bd.system.entry.js +1 -0
- package/dist/mint-components/{p-7de884a0.system.entry.js → p-53f22cc0.system.entry.js} +1 -1
- package/dist/mint-components/{p-adcc37f3.entry.js → p-8d5db0d5.entry.js} +8 -8
- package/dist/mint-components/p-99b17bca.system.js +1 -0
- package/dist/mint-components/p-c68c2331.js +1 -0
- package/dist/mint-components/{p-d1a2d813.entry.js → p-fa3d7e53.entry.js} +1 -1
- package/dist/mint-components/sqm-widget-verification.entry.js +356 -0
- package/dist/mint-components/sqm-widget-verification.system.entry.js +1 -0
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal-view.d.ts +1 -0
- package/dist/types/components/sqm-partner-info-modal/sqm-partner-info-modal.d.ts +6 -0
- package/dist/types/components.d.ts +10 -0
- package/docs/docs.docx +0 -0
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/sqm-partner-info-modal-view-dbedda28.js +0 -1
- package/dist/mint-components/p-6638c7c6.system.js +0 -1
- package/dist/mint-components/p-7144ac40.js +0 -1
- package/dist/mint-components/p-7a5814ef.system.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as r,r as t}from"./p-083180bf.js";import{i as o}from"./p-438f6702.js";import{k as n,f as e,n as a}from"./p-a7fc1e02.js";import{d as i,t as s,w as l,J as c,$ as u,i as d,r as p,L as m}from"./p-d20188db.js";import{c as b}from"./p-c1086930.js";import{g as v}from"./p-9ec99ced.js";import{c as f}from"./p-cef45012.js";import{T as h}from"./p-cabf6326.js";import{P as
|
|
1
|
+
import{h as r,r as t}from"./p-083180bf.js";import{i as o}from"./p-438f6702.js";import{k as n,f as e,n as a}from"./p-a7fc1e02.js";import{d as i,t as s,w as l,J as c,$ as u,i as d,r as p,L as m}from"./p-d20188db.js";import{c as b}from"./p-c1086930.js";import{g as v}from"./p-9ec99ced.js";import{c as f}from"./p-cef45012.js";import{T as h}from"./p-cabf6326.js";import{a as y,P as g}from"./p-c68c2331.js";import{S as q,a as x,V as w}from"./p-39840341.js";import{T as k}from"./p-28ed2ae9.js";import{p as C}from"./p-13f3a647.js";import{u as S}from"./p-0d75a207.js";const I=i.gql`
|
|
2
2
|
mutation upsertUser($userInput: UserInput!) {
|
|
3
3
|
upsertUser(userInput: $userInput) {
|
|
4
4
|
id
|
|
@@ -6,7 +6,7 @@ import{h as r,r as t}from"./p-083180bf.js";import{i as o}from"./p-438f6702.js";i
|
|
|
6
6
|
email
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
|
-
`,
|
|
9
|
+
`,P=i.gql`
|
|
10
10
|
query user {
|
|
11
11
|
viewer {
|
|
12
12
|
... on User {
|
|
@@ -22,7 +22,7 @@ import{h as r,r as t}from"./p-083180bf.js";import{i as o}from"./p-438f6702.js";i
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
`;const
|
|
25
|
+
`;const T=f({Wrapper:{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-medium)",marginTop:"var(--sl-spacing-medium)"},InputsContainer:{display:"flex",gap:"var(--sl-spacing-medium)",position:"relative",flexDirection:"column"},ContinueButton:{width:"100%"},SkeletonOne:{width:"50%",height:"16px"},SkeletonTwo:{width:"30%",height:"34px"},SkeletonThree:{width:"15%",height:"24px"},ErrorInput:{"&::part(base)":{border:"var(--sqm-border-thickness) solid var(--sqm-danger-color-border)",borderRadius:"var(--sqm-input-border-radius)"},"&::part(help-text)":{color:"var(--sqm-danger-color-text)"}}}),j=T.toString();function E(t){const{states:n,callbacks:e,text:a}=t;return r("div",{part:"sqm-base"},r("style",{type:"text/css"},'\n:host {\n display: block;\n}\n:host([hidden]): {\n display: none;\n}\n\na {\n color: inherit;\n text-decoration: underline;\n cursor: pointer;\n}\n\n*::part(primarybutton-base),\nsl-button[type="primary"]::part(base) {\n font-family: var(--sqm-primary-font);\n width: 100%;\n background-color: var(--sqm-primary-button-background);\n color: var(--sqm-primary-button-color);\n border-color: var(--sqm-primary-button-color-border);\n border-radius: var(--sqm-primary-button-radius);\n}\n\n*::part(primarybutton-base):hover,\nsl-button[type="primary"]::part(base):hover{\n background-color: var(--sqm-primary-button-background-hover);\n border-color: var(--sqm-primary-button-border-color-hover);\n color: var(--sqm-primary-button-color-hover);\n}\n\n\n*::part(primarybutton-base):focus,\nsl-button[type="primary"]::part(base):focus {\n box-shadow: none;\n}\n\n*::part(secondarybutton-base),\nsl-button[type="secondary"]::part(base) {\nfont-family: var(--sqm-primary-font);\n background-color: var(--sqm-secondary-button-background);\n color: var(--sqm-secondary-button-color);\n border-color: var(--sqm-secondary-button-color-border);\n border-radius: var(--sqm-secondary-button-radius);\n}\n\n*::part(secondarybutton-base):hover,\nsl-button[type="secondary"]::part(base):hover {\n background-color: var(--sqm-secondary-button-background-hover);\n color: var(--sqm-secondary-button-color-hover);\n border-color: var(--sqm-secondary-button-border-color-hover);\n}\n\n*::part(input-label), *::part(select-label), *::part(textarea-label){\n font-family: var(--sqm-primary-font);\n font-size: var(--sqm-input-label-font-size, var(--sl-input-font-size-small));\n font-weight: var(--sl-font-weight-semibold);\n color: var(--sqm-input-label-color, var(--sqm-text), black);\n}\n\n*::part(input-base), *::part(select-base), *::part(textarea-base){\n font-family: var(--sqm-primary-font);\n background-color: var(--sqm-input-background, #fff);\n border-radius: var(--sqm-input-border-radius, var(--sl-input-border-radius-large), 0.25rem);\n color: var(--sqm-input-color, white);\n border-width: var(--sqm-border-thickness, 1px);\n}\n\n*::part(input-base):hover, *::part(select-base):hover, *::part(textarea-base):hover{\n border-color: var(--sqm-border-color-hover);\n}\n\n*::part(input-base):focus, *::part(select-base):focus, *::part(textarea-base):focus{\n border-color: var(--sqm-border-color-focus);\n}\n\nsqm-name-fields::part(input-base) {\n font-family: var(--sqm-primary-font);\n background-color: var(--sqm-input-background, #fff);\n border-radius: var(--sqm-input-border-radius, var(--sl-input-border-radius-large), 0.25rem);\n color: var(--sqm-input-color, white);\n border-width: var(--sqm-border-thickness, 1px);\n}\n\nsl-input::part(base):focus,\nsl-select::part(form-control-wrapper):focus,\nsl-textarea::part(textarea-label):focus {\n border-color: var(--sqm-border-color-focus);\n}\n\n*::part(input-label):disabled, *::part(select-label):disabled, *::part(textarea-label):disabled{\n background: var(--sqm-input-disabled-background, #f5f5f5);\n color: var(--sqm-input-disabled-color, var(--sl-color-gray-600));\n}\n\n*::part(input):-webkit-autofill {\n box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;\n -webkit-text-fill-color: var(--sqm-input-color, white) !important;\n}\n\n*::part(input):-webkit-autofill:hover {\n box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;\n -webkit-text-fill-color: var(--sqm-input-color, white) !important;\n}\n\n*::part(input):-webkit-autofill:focus {\n box-shadow: 0 0 0 50px var(--sqm-input-background, #fff) inset !important;\n -webkit-text-fill-color: var(--sqm-input-color, white) !important;\n}\n\n*::part(input)::placeholder,\n*::part(select)::placeholder, \n*::part(textarea)::placeholder {\n font-family: var(--sqm-primary-font);\n color: var(--sqm-text-subdued);\n}\n\n*::part(input)::-webkit-input-placeholder,\n*::part(select)::-webkit-input-placeholder,\n*::part(textarea)::-webkit-input-placeholder {\n font-family: var(--sqm-primary-font);\n color: var(--sqm-text-subdued);\n}\n\n*::part(input)::-moz-placeholder,\n*::part(select)::-moz-placeholder,\n*::part(textarea)::-moz-placeholder {\n font-family: var(--sqm-primary-font);\n opacity: 1; /* Firefox adds an opacity to placeholders by default */\n color: var(--sqm-text-subdued);\n}\n\n*::part(input)::-ms-input-placeholder,\n*::part(select)::-ms-input-placeholder,\n*::part(textarea)::-ms-input-placeholder {\n font-family: var(--sqm-primary-font);\n color: var(--sqm-text-subdued);\n}\n\n\n',j),n.sendCodeError&&r("sqm-form-message",{type:"error"},r("p",{part:"alert-title"},a.sendCodeErrorHeader),o.formatMessage({id:"sendCodeErrorDescription",defaultMessage:a.sendCodeErrorDescription},{supportLink:r("a",{target:"_blank",href:"mailto:advocate-support@impact.com"},a.supportLink)})),n.initialLoading?r("div",{class:T.classes.Wrapper},r("sqm-skeleton",{height:"16px",width:"50%"}),r("sqm-skeleton",{height:"16px",width:"50%"}),r("sqm-skeleton",{height:"16px",width:"50%"}),r("sqm-skeleton",{height:"34px",width:"30%"}),r("sqm-skeleton",{height:"24px",width:"15%"}),r("sl-button",{submit:!0,class:T.classes.ContinueButton,loading:!0,exportparts:"base: primarybutton-base",type:"primary"},a.sendCodeText)):r("div",{class:T.classes.Wrapper},r(h,{type:"p"},a.verifyEmailHeaderText),r("sl-form",{"onSl-submit":e.submitEmail},r("div",{class:T.classes.InputsContainer},r("sl-input",Object.assign({exportparts:"label: input-label, base: input-base",label:a.emailLabel,value:n.email||"",type:"email",id:"email",name:"email",disabled:!!n.email||n.loading},n.error?{class:T.classes.ErrorInput,helpText:a.emailValidationErrorText}:{})),r("sl-button",{submit:!0,class:T.classes.ContinueButton,loading:n.loading,exportparts:"base: primarybutton-base",type:"primary"},a.sendCodeText)))))}const N=class{constructor(r){t(this,r),this.verifyEmailHeaderText="Start by verifying your email. We’ll send you a code through our referral provider, impact.com.",this.sendCodeErrorHeader="There was an error sending your code",this.supportLink="support team",this.sendCodeErrorDescription="Please try again. If this problem continues, contact our program {supportLink}.",this.emailLabel="Email",this.sendCodeText="Send code",this.emailValidationErrorText="Please enter a valid email",a(this)}disconnectedCallback(){}getTextProps(){return v(this)}render(){const t=d()?function(r){const t=p(q);return b({states:{error:!0,initialLoading:!1,loading:!1,email:"test@example.com",sendCodeError:!0},callbacks:{submitEmail:async()=>t(!0)},text:r.getTextProps()},r.demoData||{},{arrayMerge:(r,t)=>t})}(this):function(r){const[t,o]=s(q),[a,i]=s(x),[d,p]=n(!1),[m,b]=n(!1),[v,f]=n(!1),{initialized:h,send:[y,{}]}=S(),[g]=function(){const r=c(),[t,{loading:o,data:n,errors:e}]=u(I);return[async o=>{try{const n=await t({userInput:{id:r.id,accountId:r.accountId,email:o}});if(n instanceof Error||!n)throw new Error;return n}catch(r){return void console.error("Could not set email on user",r)}},{loading:o,data:n,errors:e}]}(),[w,k]=n(!0),{data:C,loading:T}=l(P,{}),j=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;return e((()=>{(null==C?void 0:C.viewer)&&p(!!C.viewer.email)}),[C]),e((()=>{h&&k(!1)}),[h]),{callbacks:{submitEmail:async r=>{if(r.preventDefault(),!(null==C?void 0:C.viewer))return;k(!0);const t=C.viewer.email;if(!t){const t=r.detail.formData.get("email").toString();if(!j.test(t))return void b(!0);const o=await g(t);o&&o.user.email||b(!0)}if(!h)return;const n=await y();n&&n.success?(i(t),o(!0)):f(!0),k(!1)}},states:{loading:w,initialLoading:T&&!h,error:m,email:null==C?void 0:C.viewer.email,sendCodeError:v},text:r.getTextProps()}}(this);return r(E,Object.assign({},t))}},L=i.gql`
|
|
26
26
|
query getUserPartnerInfo {
|
|
27
27
|
user: viewer {
|
|
28
28
|
... on User {
|
|
@@ -53,7 +53,7 @@ import{h as r,r as t}from"./p-083180bf.js";import{i as o}from"./p-438f6702.js";i
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
`,
|
|
56
|
+
`,z=i.gql`
|
|
57
57
|
query getCountries {
|
|
58
58
|
impactPayoutCountries(limit: 1000) {
|
|
59
59
|
data {
|
|
@@ -62,7 +62,7 @@ import{h as r,r as t}from"./p-083180bf.js";import{i as o}from"./p-438f6702.js";i
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
`,
|
|
65
|
+
`,D=i.gql`
|
|
66
66
|
query currencies($locale: RSLocale) {
|
|
67
67
|
currencies(limit: 300) {
|
|
68
68
|
data {
|
|
@@ -71,7 +71,7 @@ import{h as r,r as t}from"./p-083180bf.js";import{i as o}from"./p-438f6702.js";i
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
|
|
74
|
+
`,$=i.gql`
|
|
75
75
|
mutation createImpactConnection($vars: ImpactConnectionInput!) {
|
|
76
76
|
createImpactConnection(impactConnectionInput: $vars) {
|
|
77
77
|
success
|
|
@@ -96,10 +96,10 @@ import{h as r,r as t}from"./p-083180bf.js";import{i as o}from"./p-438f6702.js";i
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
`,U=i.gql`
|
|
100
100
|
query getTenantSettings {
|
|
101
101
|
tenantSettings {
|
|
102
102
|
companyName
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
`,
|
|
105
|
+
`,_=class{constructor(r){t(this,r),this.brandName="",this.modalHeader="Let's get you ready for rewards",this.modalHeaderExistingPartner="We found an existing account",this.descriptionNewPartner="Confirm your country and currency now to get your future rewards faster.",this.descriptionExistingPartner="We found an account with this email on our referral program provider, impact.com. Please confirm your country and currency now to get your future rewards faster.",this.supportDescriptionExistingPartner="If this is a mistake, please contact Support or sign up for this referral program with a different email.",this.countryLabel="Country",this.currencyLabel="Currency",this.submitButtonLabel="Submit",this.confirmButtonLabel="Confirm",this.searchCountryPlaceholder="Search for a country",this.searchCurrencyPlaceholder="Search for a currency",this.networkErrorText="An error occurred. Please try again.",this.missingFieldsErrorText="Please select both a country and currency.",this.embedded=!1,this.stateController="{}",a(this)}disconnectedCallback(){}getTextProps(){return v(this)}render(){const t=d()?function(r){const[t,o]=n("US"),[e,a]=n(""),[i,s]=n(""),l=C(r.stateController);return b({states:{brandName:"Test Brand",open:!0,loading:!1,submitting:!1,isExistingPartner:!1,countryCode:t,currency:e,error:i,success:!1,filteredCountries:[],filteredCurrencies:[]},callbacks:{onCountryChange:r=>{var t,n;const e=null===(n=null===(t=null==r?void 0:r.detail)||void 0===t?void 0:t.item)||void 0===n?void 0:n.__value;e&&(o(e),a(""))},onCurrencyChange:r=>{var t,o;const n=null===(o=null===(t=null==r?void 0:r.detail)||void 0===t?void 0:t.item)||void 0===o?void 0:o.__value;n&&a(n)},setCountrySearch:()=>{},setCurrencySearch:()=>{},onSubmit:()=>{s(t&&e?"":r.missingFieldsErrorText)},onClose:()=>{}},text:{modalHeader:r.modalHeader,descriptionNewPartner:r.descriptionNewPartner,descriptionExistingPartner:r.descriptionExistingPartner,countryLabel:r.countryLabel,currencyLabel:r.currencyLabel,submitButtonLabel:r.submitButtonLabel,confirmButtonLabel:r.confirmButtonLabel,searchCountryPlaceholder:r.searchCountryPlaceholder,searchCurrencyPlaceholder:r.searchCurrencyPlaceholder,supportDescriptionExistingPartner:r.supportDescriptionExistingPartner,modalHeaderExistingPartner:r.modalHeaderExistingPartner}},r.demoData||((null==l?void 0:l["sqm-partner-info-modal"])||l||{}),{arrayMerge:(r,t)=>t})}(this):function(r){var t,o,a,i,s,c,d,b,v;const f=m(),h=p(w),{data:y,loading:g,refetch:q}=l(L,{}),x=null==y?void 0:y.user,{data:C,loading:S}=l(D,{variables:{locale:f}}),{data:I,loading:P}=l(z,{}),{data:T}=l(U,{}),[j,{loading:E}]=u($),[N,_]=n((null===(o=null===(t=null==x?void 0:x.impactConnection)||void 0===t?void 0:t.publisher)||void 0===o?void 0:o.countryCode)||""),[M,B]=n((null===(i=null===(a=null==x?void 0:x.impactConnection)||void 0===a?void 0:a.publisher)||void 0===i?void 0:i.currency)||"");console.log(N,M,"initial country and currency state");const[O,W]=n(""),[A,F]=n(""),[R,H]=n((null===(s=null==I?void 0:I.impactPayoutCountries)||void 0===s?void 0:s.data)||[]),[Z,V]=n((null===(c=null==C?void 0:C.currencies)||void 0===c?void 0:c.data)||[]),[G,J]=n(""),[K,Q]=n(!1),X=(null===(d=null==I?void 0:I.impactPayoutCountries)||void 0===d?void 0:d.data)||[],Y=(null===(b=null==C?void 0:C.currencies)||void 0===b?void 0:b.data)||[];console.log(x,"user data from partner info query"),e((()=>{var r;y&&(null===(r=x.impactConnection)||void 0===r?void 0:r.publisher)&&(_(x.impactConnection.publisher.countryCode),B(x.impactConnection.publisher.currency))}),[y]),e((()=>{(null==X?void 0:X.length)&&(""===O.trim()?H(X||[]):H(X.filter((r=>r.displayName.toLowerCase().includes(O.toLowerCase())))||[]))}),[O,X]),e((()=>{(null==Y?void 0:Y.length)&&(""===A.trim()?V(Y||[]):V(Y.filter((r=>r.currencyCode.toLowerCase().includes(A.toLowerCase())))||[]))}),[A,Y]);const rr=null==x?void 0:x.impactConnection;console.log(K,"success state in partner info modal");const tr=!(K||g||(null==rr?void 0:rr.connected)&&(null==rr?void 0:rr.publisher));return console.log(tr,"showModal condition in partner info modal"),{states:{open:tr,loading:g||P||S,submitting:E,isExistingPartner:null==rr?void 0:rr.publisher,countryCode:N,currency:M,error:G,success:K,brandName:(null===(v=null==T?void 0:T.tenantSettings)||void 0===v?void 0:v.companyName)||"",filteredCountries:R||[],filteredCurrencies:Z||[]},callbacks:{onCountryChange:function(r){var t,o;const n=null===(o=null===(t=r.detail)||void 0===t?void 0:t.item)||void 0===o?void 0:o.__value;n&&(_(n),B(""),J(""))},onCurrencyChange:function(r){var t,o;const n=null===(o=null===(t=r.detail)||void 0===t?void 0:t.item)||void 0===o?void 0:o.__value;n&&(B(n),J(""))},setCurrencySearch:F,setCountrySearch:W,onSubmit:async function(){var t,o;if(N&&M){J("");try{const n={user:{id:x.id,accountId:x.accountId},firstName:x.firstName,lastName:x.lastName,countryCode:N,currency:M},e=await j({vars:n});if(!e||(null===(t=e)||void 0===t?void 0:t.message))return void J(r.networkErrorText);const a=e.createImpactConnection;if(console.log(e,a,"result and connectionResult from creating partner from modal"),!(null==a?void 0:a.success)){const t=null===(o=null==a?void 0:a.validationErrors)||void 0===o?void 0:o.map((r=>r.message)).join(". ");return J(t||r.networkErrorText),void console.error("Failed to create Impact connection:",null==a?void 0:a.validationErrors)}window.dispatchEvent(new Event(k)),await q(),Q(!0),h(!0)}catch(t){console.error("Partner creation error:",t),J(r.networkErrorText)}}else J(r.missingFieldsErrorText)},onClose:()=>Q(!0)},text:r.getTextProps()}}(this);return r(this.embedded?y:g,Object.assign({},t))}};export{N as sqm_email_verification,_ as sqm_partner_info_modal}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./p-641f968d.system.js","./p-1a673057.system.js"],(function(e){"use strict";var r,n;return{setters:[function(e){r=e.h},function(e){n=e.c}],execute:function(){e({P:s,a:a});var t={Dialog:{"&::part(panel)":{maxWidth:"480px"},"&::part(title)":{fontSize:"var(--sl-font-size-x-large)",fontWeight:"600",padding:"var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)"},"&::part(body)":{padding:"0 var(--sl-spacing-x-large)",fontSize:"var(--sl-font-size-small)",overflow:"visible"},"&::part(footer)":{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-small)"},"&::part(overlay)":{background:"rgba(0, 0, 0, 0.5)"},"&::part(close-button)":{display:"none"}},FormFields:{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-medium)",marginTop:"var(--sl-spacing-medium)","& > *":{flex:1}},ErrorMessage:{color:"var(--sqm-danger-color-text, #d32f2f)",fontSize:"var(--sl-font-size-small)",marginTop:"var(--sl-spacing-x-small)"},SearchInput:{"&::part(base)":{border:"none",borderBottom:"1px solid var(--sl-color-neutral-300)",borderRadius:"0"}},DescriptionContainer:{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-medium)",marginTop:"var(--sl-spacing-small)","& > p":{margin:"0"}}};function a(e){var a,s;var l=e.states,i=e.callbacks,o=e.text;var c=n(t);var u=c.toString();var p=l.isExistingPartner?r("div",{class:c.classes.DescriptionContainer},r("p",null,o.descriptionExistingPartner),r("p",null,o.supportDescriptionExistingPartner)):r("p",null," ",o.descriptionNewPartner);var d=l.isExistingPartner?o.confirmButtonLabel:o.submitButtonLabel;return[r("style",{type:"text/css"},u),p,r("div",{class:c.classes.FormFields},r("sl-select",{key:"country-"+l.countryCode,exportparts:"label: input-label, base: input-base",label:o.countryLabel,value:l.countryCode,disabled:l.submitting||!!l.isExistingPartner,required:true,"onSl-select":i.onCountryChange},r("sl-input",{class:c.classes.SearchInput,placeholder:o.searchCountryPlaceholder,onKeyDown:function(e){return e.stopPropagation()},"onSl-input":function(e){var r;i.setCountrySearch((r=e.target)===null||r===void 0?void 0:r.value)}}),(a=l.filteredCountries)===null||a===void 0?void 0:a.map((function(e){return r("sl-menu-item",{value:e.countryCode},e.displayName)}))),r("sl-select",{key:"currency-"+l.currency,exportparts:"label: input-label, base: input-base",label:o.currencyLabel,value:l.currency,disabled:l.submitting||!!l.isExistingPartner,required:true,"onSl-select":i.onCurrencyChange},r("sl-input",{class:c.classes.SearchInput,placeholder:o.searchCurrencyPlaceholder,onKeyDown:function(e){return e.stopPropagation()},"onSl-input":function(e){var r;return i.setCurrencySearch((r=e.target)===null||r===void 0?void 0:r.value)}}),(s=l.filteredCurrencies)===null||s===void 0?void 0:s.map((function(e){return r("sl-menu-item",{value:e.currencyCode},e.currencyCode)})))),l.error&&r("p",{class:c.classes.ErrorMessage},l.error),r("sl-button",{slot:"footer",type:"primary",loading:l.submitting,disabled:l.submitting||!l.countryCode||!l.currency,onClick:i.onSubmit,style:{width:"100%"},exportparts:"base: primarybutton-base"},d)]}function s(e){var s=e.states,l=e.text;var i=n(t);console.log(s,"partner info modal states");if(!s.open)return r("div",null);return r("sl-dialog",{class:i.classes.Dialog,open:s.open,noHeader:false,label:s.isExistingPartner?l.modalHeaderExistingPartner:l.modalHeader,"onSl-request-close":function(e){e.preventDefault()},"onSl-hide":function(e){var r;if(((r=e.target)===null||r===void 0?void 0:r.tagName)==="SL-DIALOG"){e.preventDefault()}}},r(a,Object.assign({},e)))}}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as l}from"./p-083180bf.js";import{c as e}from"./p-cef45012.js";const a={Dialog:{"&::part(panel)":{maxWidth:"480px"},"&::part(title)":{fontSize:"var(--sl-font-size-x-large)",fontWeight:"600",padding:"var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)"},"&::part(body)":{padding:"0 var(--sl-spacing-x-large)",fontSize:"var(--sl-font-size-small)",overflow:"visible"},"&::part(footer)":{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-small)"},"&::part(overlay)":{background:"rgba(0, 0, 0, 0.5)"},"&::part(close-button)":{display:"none"}},FormFields:{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-medium)",marginTop:"var(--sl-spacing-medium)","& > *":{flex:1}},ErrorMessage:{color:"var(--sqm-danger-color-text, #d32f2f)",fontSize:"var(--sl-font-size-small)",marginTop:"var(--sl-spacing-x-small)"},SearchInput:{"&::part(base)":{border:"none",borderBottom:"1px solid var(--sl-color-neutral-300)",borderRadius:"0"}},DescriptionContainer:{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-medium)",marginTop:"var(--sl-spacing-small)","& > p":{margin:"0"}}};function s(s){var r,o;const{states:n,callbacks:t,text:i}=s,p=e(a),c=p.toString(),d=n.isExistingPartner?l("div",{class:p.classes.DescriptionContainer},l("p",null,i.descriptionExistingPartner),l("p",null,i.supportDescriptionExistingPartner)):l("p",null," ",i.descriptionNewPartner),u=n.isExistingPartner?i.confirmButtonLabel:i.submitButtonLabel;return[l("style",{type:"text/css"},c),d,l("div",{class:p.classes.FormFields},l("sl-select",{key:`country-${n.countryCode}`,exportparts:"label: input-label, base: input-base",label:i.countryLabel,value:n.countryCode,disabled:n.submitting||!!n.isExistingPartner,required:!0,"onSl-select":t.onCountryChange},l("sl-input",{class:p.classes.SearchInput,placeholder:i.searchCountryPlaceholder,onKeyDown:l=>l.stopPropagation(),"onSl-input":l=>{var e;t.setCountrySearch(null===(e=l.target)||void 0===e?void 0:e.value)}}),null===(r=n.filteredCountries)||void 0===r?void 0:r.map((e=>l("sl-menu-item",{value:e.countryCode},e.displayName)))),l("sl-select",{key:`currency-${n.currency}`,exportparts:"label: input-label, base: input-base",label:i.currencyLabel,value:n.currency,disabled:n.submitting||!!n.isExistingPartner,required:!0,"onSl-select":t.onCurrencyChange},l("sl-input",{class:p.classes.SearchInput,placeholder:i.searchCurrencyPlaceholder,onKeyDown:l=>l.stopPropagation(),"onSl-input":l=>{var e;return t.setCurrencySearch(null===(e=l.target)||void 0===e?void 0:e.value)}}),null===(o=n.filteredCurrencies)||void 0===o?void 0:o.map((e=>l("sl-menu-item",{value:e.currencyCode},e.currencyCode))))),n.error&&l("p",{class:p.classes.ErrorMessage},n.error),l("sl-button",{slot:"footer",type:"primary",loading:n.submitting,disabled:n.submitting||!n.countryCode||!n.currency,onClick:t.onSubmit,style:{width:"100%"},exportparts:"base: primarybutton-base"},u)]}function r(r){const{states:o,text:n}=r,t=e(a);return console.log(o,"partner info modal states"),o.open?l("sl-dialog",{class:t.classes.Dialog,open:o.open,noHeader:!1,label:o.isExistingPartner?n.modalHeaderExistingPartner:n.modalHeader,"onSl-request-close":l=>{l.preventDefault()},"onSl-hide":l=>{var e;"SL-DIALOG"===(null===(e=l.target)||void 0===e?void 0:e.tagName)&&l.preventDefault()}},l(s,Object.assign({},r))):l("div",null)}export{r as P,s as a}
|
|
@@ -288,4 +288,4 @@ import{r as e,h as t,c as r}from"./p-083180bf.js";import{b as o,i as a}from"./p-
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
}
|
|
291
|
-
`,so=class{constructor(t){e(this,t),this.general_verifyEmailHeader="Verify your email",this.general_verifyEmailDescription="To get your cash paid out directly to your bank account, please complete your account setup",this.emailStep_verifyEmailHeaderText="Start by verifying your email. We’ll send you a code through our referral provider, impact.com.",this.emailStep_sendCodeErrorHeader="There was an error sending your code.",this.emailStep_sendCodeErrorDescription="Please try again. If this problem continues, contact our program support team.",this.emailStep_emailLabel="Email",this.emailStep_sendCodeText="Send code",this.emailStep_emailValidationErrorText="Please enter a valid email",this.codeStep_verifyCodeHeaderText="Enter the code sent to {email} from our referral provider, impact.com.",this.codeStep_reverifyCodeHeaderText="Enter the code sent to {email} from our referral provider, impact.com.",this.codeStep_resendCodeText="Didn't receive your code? {resendCodeLink}",this.codeStep_resendCodeLabel="Resend code",this.codeStep_codeResentSuccessfullyText="Another code has been sent to {email}",this.codeStep_invalidCodeText="Please check your code and try again. If you’re still having trouble, try resending your code.",this.codeStep_verifyText="Verify",this.codeStep_networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.",this.createPartnerStep_modalHeader="Let's get you ready for rewards",this.createPartnerStep_modalHeaderExistingPartner="We found an existing account",this.createPartnerStep_descriptionNewPartner="Confirm your country and currency now to get your future rewards faster.",this.createPartnerStep_descriptionExistingPartner="We found an account with this email on our referral program provider, impact.com. Please confirm your country and currency now to get your future rewards faster.",this.createPartnerStep_supportDescriptionExistingPartner="If this is a mistake, please contact Support or sign up for this referral program with a different email.",this.createPartnerStep_countryLabel="Country",this.createPartnerStep_currencyLabel="Currency",this.createPartnerStep_submitButtonLabel="Submit",this.createPartnerStep_confirmButtonLabel="Confirm",this.createPartnerStep_searchCountryPlaceholder="Search for a country",this.createPartnerStep_searchCurrencyPlaceholder="Search for a currency",this.createPartnerStep_networkErrorText="An error occurred. Please try again.",this.createPartnerStep_missingFieldsErrorText="Please select both a country and currency.",this.stateController="{}",i(this)}disconnectedCallback(){}getStepTextProps(e){return Jr(L(this),e)}render(){const e=m()?function(e){const[t,r]=A({namespace:Ye,initialValue:!1}),[o,a]=A({namespace:We,initialValue:void 0}),i=q(Ge),n=Je(e.stateController),s=Object.keys(n).reduce(((e,t)=>"sqm-widget-verification"===t?{...e,...n[t]}:{...e,[`${t}_stateController`]:n[t]}),{});return D({showCode:t,showPartnerModal:!1,onVerification:()=>{i(!0)},onPartnerModalComplete:()=>{},loading:!1},s||{},{arrayMerge:(e,t)=>t})}(this):function(){const e=g(),[t,r]=A({namespace:Ye,initialValue:!1}),[o,a]=A({namespace:We,initialValue:null==e?void 0:e.email}),i=q(Ge),[s,d]=l(!0),[c,u]=l(!1),[h]=N(no);return n((()=>{(async()=>{var e,t,r,o,a;try{const n=await h({});if(!n||n instanceof Error)throw new Error;const s=(null===(e=null==n?void 0:n.viewer)||void 0===e?void 0:e.emailVerified)||(null===(r=null===(t=null==n?void 0:n.viewer)||void 0===t?void 0:t.managedIdentity)||void 0===r?void 0:r.emailVerified);(null===(a=null===(o=null==n?void 0:n.viewer)||void 0===o?void 0:o.impactConnection)||void 0===a?void 0:a.connected)?i(!0):s&&u(!0)}catch(e){console.error("Could not fetch user information:",e)}finally{d(!1)}})()}),[]),{showCode:t,showPartnerModal:c,onVerification:()=>{u(!0)},onPartnerModalComplete:()=>{u(!1),i(!0)},loading:s}}();if(e.loading)return t("sl-spinner",null);const r=B({Dialog:{"&::part(panel)":{maxWidth:"480px"},"&::part(title)":{fontSize:"var(--sl-font-size-x-large)",fontWeight:"600",padding:"var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)"},"&::part(body)":{padding:"0 var(--sl-spacing-x-large)",fontSize:"var(--sl-font-size-small)",overflow:"visible"},"&::part(footer)":{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-small)"},"&::part(overlay)":{background:"rgba(0, 0, 0, 0.5)"},"&::part(close-button)":{display:"none"}}}),o=r.toString(),a=this.getStepTextProps("general_")
|
|
291
|
+
`,so=class{constructor(t){e(this,t),this.general_verifyEmailHeader="Verify your email",this.general_verifyEmailDescription="To get your cash paid out directly to your bank account, please complete your account setup",this.emailStep_verifyEmailHeaderText="Start by verifying your email. We’ll send you a code through our referral provider, impact.com.",this.emailStep_sendCodeErrorHeader="There was an error sending your code.",this.emailStep_sendCodeErrorDescription="Please try again. If this problem continues, contact our program support team.",this.emailStep_emailLabel="Email",this.emailStep_sendCodeText="Send code",this.emailStep_emailValidationErrorText="Please enter a valid email",this.codeStep_verifyCodeHeaderText="Enter the code sent to {email} from our referral provider, impact.com.",this.codeStep_reverifyCodeHeaderText="Enter the code sent to {email} from our referral provider, impact.com.",this.codeStep_resendCodeText="Didn't receive your code? {resendCodeLink}",this.codeStep_resendCodeLabel="Resend code",this.codeStep_codeResentSuccessfullyText="Another code has been sent to {email}",this.codeStep_invalidCodeText="Please check your code and try again. If you’re still having trouble, try resending your code.",this.codeStep_verifyText="Verify",this.codeStep_networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.",this.createPartnerStep_modalHeader="Let's get you ready for rewards",this.createPartnerStep_modalHeaderExistingPartner="We found an existing account",this.createPartnerStep_descriptionNewPartner="Confirm your country and currency now to get your future rewards faster.",this.createPartnerStep_descriptionExistingPartner="We found an account with this email on our referral program provider, impact.com. Please confirm your country and currency now to get your future rewards faster.",this.createPartnerStep_supportDescriptionExistingPartner="If this is a mistake, please contact Support or sign up for this referral program with a different email.",this.createPartnerStep_countryLabel="Country",this.createPartnerStep_currencyLabel="Currency",this.createPartnerStep_submitButtonLabel="Submit",this.createPartnerStep_confirmButtonLabel="Confirm",this.createPartnerStep_searchCountryPlaceholder="Search for a country",this.createPartnerStep_searchCurrencyPlaceholder="Search for a currency",this.createPartnerStep_networkErrorText="An error occurred. Please try again.",this.createPartnerStep_missingFieldsErrorText="Please select both a country and currency.",this.stateController="{}",i(this)}disconnectedCallback(){}getStepTextProps(e){return Jr(L(this),e)}render(){const e=m()?function(e){const[t,r]=A({namespace:Ye,initialValue:!1}),[o,a]=A({namespace:We,initialValue:void 0}),i=q(Ge),n=Je(e.stateController),s=Object.keys(n).reduce(((e,t)=>"sqm-widget-verification"===t?{...e,...n[t]}:{...e,[`${t}_stateController`]:n[t]}),{});return D({showCode:t,showPartnerModal:!1,onVerification:()=>{i(!0)},onPartnerModalComplete:()=>{},loading:!1},s||{},{arrayMerge:(e,t)=>t})}(this):function(){const e=g(),[t,r]=A({namespace:Ye,initialValue:!1}),[o,a]=A({namespace:We,initialValue:null==e?void 0:e.email}),i=q(Ge),[s,d]=l(!0),[c,u]=l(!1),[h]=N(no);return n((()=>{(async()=>{var e,t,r,o,a;try{const n=await h({});if(!n||n instanceof Error)throw new Error;const s=(null===(e=null==n?void 0:n.viewer)||void 0===e?void 0:e.emailVerified)||(null===(r=null===(t=null==n?void 0:n.viewer)||void 0===t?void 0:t.managedIdentity)||void 0===r?void 0:r.emailVerified);(null===(a=null===(o=null==n?void 0:n.viewer)||void 0===o?void 0:o.impactConnection)||void 0===a?void 0:a.connected)?i(!0):s&&u(!0)}catch(e){console.error("Could not fetch user information:",e)}finally{d(!1)}})()}),[]),{showCode:t,showPartnerModal:c,onVerification:()=>{u(!0)},onPartnerModalComplete:()=>{u(!1),i(!0)},loading:s}}();if(e.loading)return t("sl-spinner",null);const r=B({Dialog:{"&::part(panel)":{maxWidth:"480px"},"&::part(title)":{fontSize:"var(--sl-font-size-x-large)",fontWeight:"600",padding:"var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)"},"&::part(body)":{padding:"0 var(--sl-spacing-x-large)",fontSize:"var(--sl-font-size-small)",overflow:"visible"},"&::part(footer)":{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-small)"},"&::part(overlay)":{background:"rgba(0, 0, 0, 0.5)"},"&::part(close-button)":{display:"none"}}}),o=r.toString(),a=this.getStepTextProps("general_"),i=this.getStepTextProps("createPartnerStep_"),s=e.showPartnerModal?i.modalHeader:a.verifyEmailHeader;return t("div",null,t("style",{type:"text/css"},o),t("sl-dialog",{class:r.classes.Dialog,noHeader:!1,open:!0,label:s,"onSl-request-close":e=>{e.preventDefault()},"onSl-hide":e=>{var t;"SL-DIALOG"===(null===(t=e.target)||void 0===t?void 0:t.tagName)&&e.preventDefault()}},(()=>e.showPartnerModal?t("sqm-partner-info-modal",Object.assign({embedded:!0},i)):e.showCode?t("sqm-code-verification",Object.assign({onVerification:e.onVerification},this.getStepTextProps("codeStep_"),Jr(e,"sqm-code-verification_"))):t("sqm-email-verification",Object.assign({},this.getStepTextProps("emailStep_"),Jr(e,"sqm-email-verification_"))))()))}};export{Qe as sqm_big_stat,vt as sqm_brand,bt as sqm_brand_selector,yt as sqm_card_feed,wt as sqm_checkbox_field,Et as sqm_coupon_code,Ft as sqm_divided_layout,It as sqm_dropdown_field,Rt as sqm_edit_profile,qt as sqm_hero,Mt as sqm_hero_image,Dt as sqm_hook_story_container,Pt as sqm_image,Bt as sqm_input_field,Ot as sqm_lead_dropdown_field,zt as sqm_lead_form,Wt as sqm_leaderboard,Xt as sqm_link_button,Qt as sqm_marketing_emails_checkbox,er as sqm_name_fields,rr as sqm_navigation_menu,sr as sqm_payout_button_scroll,ur as sqm_payout_status_alert,fr as sqm_portal_change_marketing,gr as sqm_portal_change_password,vr as sqm_portal_footer,br as sqm_portal_frame,wr as sqm_portal_google_registration_form,Cr as sqm_program_explainer,_r as sqm_program_explainer_step,Ir as sqm_program_menu,Tr as sqm_referral_card,Rr as sqm_referral_iframe,qr as sqm_referred_registration,Pr as sqm_reward_exchange_list,Vr as sqm_router,zr as sqm_share_button,Hr as sqm_share_code,Yr as sqm_share_link,Wr as sqm_stat_container,Kr as sqm_task_card,Zr as sqm_tax_and_cash,Xr as sqm_timeline,ro as sqm_timeline_entry,io as sqm_user_name,so as sqm_widget_verification}
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
import { r as registerInstance, h as h$1 } from './index-d9876cd5.js';
|
|
2
|
+
import { i as useState, j as useEffect, o as h } from './dom-context-hooks.module-8411297a.js';
|
|
3
|
+
import { d as dist, J, I as In, r as En, X as Xe, i as isDemo } from './index.module-76b0705d.js';
|
|
4
|
+
import './jss-preset-default.esm-c36417f8.js';
|
|
5
|
+
import { c as createStyleSheet } from './JSS-8c381d8b.js';
|
|
6
|
+
import { g as getProps } from './utils-61821fb1.js';
|
|
7
|
+
import { c as cjs } from './cjs-e829b75b.js';
|
|
8
|
+
import { S as SHOW_CODE_NAMESPACE, a as VERIFICATION_EMAIL_NAMESPACE, V as VERIFICATION_PARENT_NAMESPACE } from './keys-db1897ae.js';
|
|
9
|
+
import { p as parseStates } from './parseStates-ed75e224.js';
|
|
10
|
+
import { e as extractProps } from './extractProps-ae1afbb3.js';
|
|
11
|
+
|
|
12
|
+
const USER_LOOKUP = dist.gql `
|
|
13
|
+
query checkUserVerification {
|
|
14
|
+
viewer {
|
|
15
|
+
... on User {
|
|
16
|
+
id
|
|
17
|
+
accountId
|
|
18
|
+
email
|
|
19
|
+
emailVerified
|
|
20
|
+
managedIdentity {
|
|
21
|
+
email
|
|
22
|
+
emailVerified
|
|
23
|
+
}
|
|
24
|
+
impactConnection {
|
|
25
|
+
connected
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
function useWidgetVerification() {
|
|
32
|
+
const userIdentity = J();
|
|
33
|
+
const [showCode, setShowCode] = In({
|
|
34
|
+
namespace: SHOW_CODE_NAMESPACE,
|
|
35
|
+
initialValue: false,
|
|
36
|
+
});
|
|
37
|
+
const [email, setEmail] = In({
|
|
38
|
+
namespace: VERIFICATION_EMAIL_NAMESPACE,
|
|
39
|
+
initialValue: userIdentity === null || userIdentity === void 0 ? void 0 : userIdentity.email,
|
|
40
|
+
});
|
|
41
|
+
const setContext = En(VERIFICATION_PARENT_NAMESPACE);
|
|
42
|
+
const [loading, setLoading] = useState(true);
|
|
43
|
+
const [showPartnerModal, setShowPartnerModal] = useState(false);
|
|
44
|
+
const [fetch] = Xe(USER_LOOKUP);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
const checkUser = async () => {
|
|
47
|
+
var _a, _b, _c, _d, _e;
|
|
48
|
+
try {
|
|
49
|
+
const res = await fetch({});
|
|
50
|
+
if (!res || res instanceof Error)
|
|
51
|
+
throw new Error();
|
|
52
|
+
// Flow changed to send email -> verify code -> show early partner creation modal
|
|
53
|
+
const emailVerified = ((_a = res === null || res === void 0 ? void 0 : res.viewer) === null || _a === void 0 ? void 0 : _a.emailVerified) || ((_c = (_b = res === null || res === void 0 ? void 0 : res.viewer) === null || _b === void 0 ? void 0 : _b.managedIdentity) === null || _c === void 0 ? void 0 : _c.emailVerified);
|
|
54
|
+
const isConnected = (_e = (_d = res === null || res === void 0 ? void 0 : res.viewer) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.connected;
|
|
55
|
+
if (isConnected) {
|
|
56
|
+
// Partner already created, show widget content
|
|
57
|
+
setContext(true);
|
|
58
|
+
}
|
|
59
|
+
else if (emailVerified) {
|
|
60
|
+
// Email verified but no partner yet, show partner modal
|
|
61
|
+
setShowPartnerModal(true);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (e) {
|
|
65
|
+
console.error("Could not fetch user information:", e);
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
setLoading(false);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
checkUser();
|
|
72
|
+
}, []);
|
|
73
|
+
const onVerification = () => {
|
|
74
|
+
setShowPartnerModal(true);
|
|
75
|
+
};
|
|
76
|
+
const onPartnerModalComplete = () => {
|
|
77
|
+
setShowPartnerModal(false);
|
|
78
|
+
setContext(true);
|
|
79
|
+
};
|
|
80
|
+
return { showCode, showPartnerModal, onVerification, onPartnerModalComplete, loading };
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const WidgetVerification = class {
|
|
84
|
+
constructor(hostRef) {
|
|
85
|
+
registerInstance(this, hostRef);
|
|
86
|
+
// ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification AND sqm-partner-info-modal
|
|
87
|
+
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
88
|
+
GENERAL PROPS
|
|
89
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
|
90
|
+
/**
|
|
91
|
+
* @uiName General verify widget header text
|
|
92
|
+
* @uiGroup General Text
|
|
93
|
+
*/
|
|
94
|
+
this.general_verifyEmailHeader = "Verify your email";
|
|
95
|
+
/**
|
|
96
|
+
* @uiName General verify widget description text
|
|
97
|
+
* @uiGroup General Text
|
|
98
|
+
*/
|
|
99
|
+
this.general_verifyEmailDescription = "To get your cash paid out directly to your bank account, please complete your account setup";
|
|
100
|
+
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
101
|
+
EMAIL STEP PROPS
|
|
102
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
|
103
|
+
/**
|
|
104
|
+
* @uiName Verify email widget header text
|
|
105
|
+
* @uiGroup Email Verification Step
|
|
106
|
+
*/
|
|
107
|
+
this.emailStep_verifyEmailHeaderText = "Start by verifying your email. We’ll send you a code through our referral provider, impact.com.";
|
|
108
|
+
/**
|
|
109
|
+
* @uiName Send code to email alert header
|
|
110
|
+
* @uiGroup Email Verification Step
|
|
111
|
+
*/
|
|
112
|
+
this.emailStep_sendCodeErrorHeader = "There was an error sending your code.";
|
|
113
|
+
/**
|
|
114
|
+
* @uiName Send code to email alert description
|
|
115
|
+
* @uiGroup Email Verification Step
|
|
116
|
+
*/
|
|
117
|
+
this.emailStep_sendCodeErrorDescription = "Please try again. If this problem continues, contact our program support team.";
|
|
118
|
+
/**
|
|
119
|
+
* @uiName Email input label
|
|
120
|
+
* @uiGroup Email Verification Step
|
|
121
|
+
*/
|
|
122
|
+
this.emailStep_emailLabel = "Email";
|
|
123
|
+
/**
|
|
124
|
+
* @uiName Send code button text
|
|
125
|
+
* @uiGroup Email Verification Step
|
|
126
|
+
*/
|
|
127
|
+
this.emailStep_sendCodeText = "Send code";
|
|
128
|
+
/**
|
|
129
|
+
* @uiName Send code button text
|
|
130
|
+
* @uiGroup Email Verification Step
|
|
131
|
+
*/
|
|
132
|
+
this.emailStep_emailValidationErrorText = "Please enter a valid email";
|
|
133
|
+
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
134
|
+
CODE STEP PROPS
|
|
135
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
|
136
|
+
/**
|
|
137
|
+
* @uiName Verify code widget header text
|
|
138
|
+
* @uiGroup Code Verification Step
|
|
139
|
+
*/
|
|
140
|
+
this.codeStep_verifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
|
|
141
|
+
/**
|
|
142
|
+
* @uiName Reverify code widget header text
|
|
143
|
+
* @uiGroup Code Verification Step
|
|
144
|
+
*/
|
|
145
|
+
this.codeStep_reverifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
|
|
146
|
+
/**
|
|
147
|
+
* Text displayed under verify button
|
|
148
|
+
* @uiName Resend code text
|
|
149
|
+
* @uiGroup Code Verification Step
|
|
150
|
+
*/
|
|
151
|
+
this.codeStep_resendCodeText = "Didn't receive your code? {resendCodeLink}";
|
|
152
|
+
/**
|
|
153
|
+
* The link that appears in the resend code link
|
|
154
|
+
* @uiName Resend code label
|
|
155
|
+
* @uiGroup Code Verification Step
|
|
156
|
+
*/
|
|
157
|
+
this.codeStep_resendCodeLabel = "Resend code";
|
|
158
|
+
/**
|
|
159
|
+
* Link text displayed under verify button
|
|
160
|
+
* @uiName Resend code text
|
|
161
|
+
* @uiGroup Code Verification Step
|
|
162
|
+
*/
|
|
163
|
+
this.codeStep_codeResentSuccessfullyText = "Another code has been sent to {email}";
|
|
164
|
+
/**
|
|
165
|
+
* Error text displayed under verification input
|
|
166
|
+
* @uiName Invalid code text
|
|
167
|
+
* @uiGroup Code Verification Step
|
|
168
|
+
*/
|
|
169
|
+
this.codeStep_invalidCodeText = "Please check your code and try again. If you’re still having trouble, try resending your code.";
|
|
170
|
+
/**
|
|
171
|
+
* @uiName Verify code button text
|
|
172
|
+
* @uiGroup Code Verification Step
|
|
173
|
+
*/
|
|
174
|
+
this.codeStep_verifyText = "Verify";
|
|
175
|
+
/**
|
|
176
|
+
* Displayed when the email verification fails due to a network error. The participant can try refreshing the page.
|
|
177
|
+
* @uiName Network error message
|
|
178
|
+
* @uiGroup Code Verification Step
|
|
179
|
+
*/
|
|
180
|
+
this.codeStep_networkErrorMessage = "An error occurred while verifying your email. Please refresh the page and try again.";
|
|
181
|
+
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
182
|
+
PARTNER CREATION STEP PROPS
|
|
183
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
|
|
184
|
+
/**
|
|
185
|
+
* @uiName New partner header
|
|
186
|
+
* @uiGroup Partner Creation Step
|
|
187
|
+
* @uiWidget textArea
|
|
188
|
+
*/
|
|
189
|
+
this.createPartnerStep_modalHeader = "Let's get you ready for rewards";
|
|
190
|
+
/**
|
|
191
|
+
* @uiName Existing partner header
|
|
192
|
+
* @uiGroup Partner Creation Step
|
|
193
|
+
* @uiWidget textArea
|
|
194
|
+
*/
|
|
195
|
+
this.createPartnerStep_modalHeaderExistingPartner = "We found an existing account";
|
|
196
|
+
/**
|
|
197
|
+
* @uiName New partner description
|
|
198
|
+
* @uiGroup Partner Creation Step
|
|
199
|
+
* @uiWidget textArea
|
|
200
|
+
*/
|
|
201
|
+
this.createPartnerStep_descriptionNewPartner = "Confirm your country and currency now to get your future rewards faster.";
|
|
202
|
+
/**
|
|
203
|
+
* @uiName Existing partner description
|
|
204
|
+
* @uiGroup Partner Creation Step
|
|
205
|
+
* @uiWidget textArea
|
|
206
|
+
*/
|
|
207
|
+
this.createPartnerStep_descriptionExistingPartner = "We found an account with this email on our referral program provider, impact.com. Please confirm your country and currency now to get your future rewards faster.";
|
|
208
|
+
/**
|
|
209
|
+
* @uiName Existing partner support description
|
|
210
|
+
* @uiGroup Partner Creation Step
|
|
211
|
+
* @uiWidget textArea
|
|
212
|
+
*/
|
|
213
|
+
this.createPartnerStep_supportDescriptionExistingPartner = "If this is a mistake, please contact Support or sign up for this referral program with a different email.";
|
|
214
|
+
/**
|
|
215
|
+
* @uiName Country label
|
|
216
|
+
* @uiGroup Partner Creation Step
|
|
217
|
+
*/
|
|
218
|
+
this.createPartnerStep_countryLabel = "Country";
|
|
219
|
+
/**
|
|
220
|
+
* @uiName Currency label
|
|
221
|
+
* @uiGroup Partner Creation Step
|
|
222
|
+
*/
|
|
223
|
+
this.createPartnerStep_currencyLabel = "Currency";
|
|
224
|
+
/**
|
|
225
|
+
* @uiName Submit button label
|
|
226
|
+
* @uiGroup Partner Creation Step
|
|
227
|
+
*/
|
|
228
|
+
this.createPartnerStep_submitButtonLabel = "Submit";
|
|
229
|
+
/**
|
|
230
|
+
* @uiName Confirm button label
|
|
231
|
+
* @uiGroup Partner Creation Step
|
|
232
|
+
*/
|
|
233
|
+
this.createPartnerStep_confirmButtonLabel = "Confirm";
|
|
234
|
+
/**
|
|
235
|
+
* @uiName Search country placeholder
|
|
236
|
+
* @uiGroup Partner Creation Step
|
|
237
|
+
*/
|
|
238
|
+
this.createPartnerStep_searchCountryPlaceholder = "Search for a country";
|
|
239
|
+
/**
|
|
240
|
+
* @uiName Search currency placeholder
|
|
241
|
+
* @uiGroup Partner Creation Step
|
|
242
|
+
*/
|
|
243
|
+
this.createPartnerStep_searchCurrencyPlaceholder = "Search for a currency";
|
|
244
|
+
/**
|
|
245
|
+
* @uiName Network error text
|
|
246
|
+
* @uiGroup Partner Creation Step
|
|
247
|
+
* @uiWidget textArea
|
|
248
|
+
*/
|
|
249
|
+
this.createPartnerStep_networkErrorText = "An error occurred. Please try again.";
|
|
250
|
+
/**
|
|
251
|
+
* @uiName Missing fields error text
|
|
252
|
+
* @uiGroup Partner Creation Step
|
|
253
|
+
* @uiWidget textArea
|
|
254
|
+
*/
|
|
255
|
+
this.createPartnerStep_missingFieldsErrorText = "Please select both a country and currency.";
|
|
256
|
+
/**
|
|
257
|
+
* @undocumented
|
|
258
|
+
* @componentState { "title": "Step 1: Enter email", "props": { "showCode": false }, "dependencies": ["sqm-email-verification"], "uiGroup": "Email Verification Step" }
|
|
259
|
+
* @componentState { "title": "Step 2: Enter code", "props": { "showCode": true }, "dependencies": ["sqm-code-verification"], "uiGroup": "Code Verification Step" }
|
|
260
|
+
* @componentState { "title": "Step 3: Create Partner", "props": { "showPartnerModal": true }, "dependencies": ["sqm-partner-info-modal"], "uiGroup": "Partner Creation Step" }
|
|
261
|
+
*/
|
|
262
|
+
this.stateController = "{}";
|
|
263
|
+
h(this);
|
|
264
|
+
}
|
|
265
|
+
disconnectedCallback() { }
|
|
266
|
+
getStepTextProps(prefix) {
|
|
267
|
+
const props = getProps(this);
|
|
268
|
+
return extractProps(props, prefix);
|
|
269
|
+
}
|
|
270
|
+
render() {
|
|
271
|
+
const props = isDemo()
|
|
272
|
+
? useDemoWidgetVerificationInternal(this)
|
|
273
|
+
: useWidgetVerification();
|
|
274
|
+
if (props.loading)
|
|
275
|
+
return h$1("sl-spinner", null);
|
|
276
|
+
const style = {
|
|
277
|
+
Dialog: {
|
|
278
|
+
"&::part(panel)": {
|
|
279
|
+
maxWidth: "480px",
|
|
280
|
+
},
|
|
281
|
+
"&::part(title)": {
|
|
282
|
+
fontSize: "var(--sl-font-size-x-large)",
|
|
283
|
+
fontWeight: "600",
|
|
284
|
+
padding: "var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)",
|
|
285
|
+
},
|
|
286
|
+
"&::part(body)": {
|
|
287
|
+
padding: "0 var(--sl-spacing-x-large)",
|
|
288
|
+
fontSize: "var(--sl-font-size-small)",
|
|
289
|
+
overflow: "visible",
|
|
290
|
+
},
|
|
291
|
+
"&::part(footer)": {
|
|
292
|
+
display: "flex",
|
|
293
|
+
flexDirection: "column",
|
|
294
|
+
gap: "var(--sl-spacing-small)",
|
|
295
|
+
},
|
|
296
|
+
"&::part(overlay)": {
|
|
297
|
+
background: "rgba(0, 0, 0, 0.5)",
|
|
298
|
+
},
|
|
299
|
+
"&::part(close-button)": {
|
|
300
|
+
display: "none",
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
const sheet = createStyleSheet(style);
|
|
305
|
+
const styleString = sheet.toString();
|
|
306
|
+
const generalText = this.getStepTextProps("general_");
|
|
307
|
+
const partnerText = this.getStepTextProps("createPartnerStep_");
|
|
308
|
+
const dialogLabel = props.showPartnerModal
|
|
309
|
+
? partnerText.modalHeader
|
|
310
|
+
: generalText.verifyEmailHeader;
|
|
311
|
+
const renderStepContent = () => {
|
|
312
|
+
if (props.showPartnerModal) {
|
|
313
|
+
return (h$1("sqm-partner-info-modal", Object.assign({ embedded: true }, partnerText)));
|
|
314
|
+
}
|
|
315
|
+
if (props.showCode) {
|
|
316
|
+
return (h$1("sqm-code-verification", Object.assign({ onVerification: props.onVerification }, this.getStepTextProps("codeStep_"), extractProps(props, "sqm-code-verification_"))));
|
|
317
|
+
}
|
|
318
|
+
return (h$1("sqm-email-verification", Object.assign({}, this.getStepTextProps("emailStep_"), extractProps(props, "sqm-email-verification_"))));
|
|
319
|
+
};
|
|
320
|
+
return (h$1("div", null, h$1("style", { type: "text/css" }, styleString), h$1("sl-dialog", { class: sheet.classes.Dialog, noHeader: false, open: true, label: dialogLabel, "onSl-request-close": (e) => {
|
|
321
|
+
e.preventDefault();
|
|
322
|
+
}, "onSl-hide": (e) => {
|
|
323
|
+
var _a;
|
|
324
|
+
if (((_a = e.target) === null || _a === void 0 ? void 0 : _a.tagName) === "SL-DIALOG") {
|
|
325
|
+
e.preventDefault();
|
|
326
|
+
}
|
|
327
|
+
} }, renderStepContent())));
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
function useDemoWidgetVerificationInternal(props) {
|
|
331
|
+
const [showCode, setShowCode] = In({
|
|
332
|
+
namespace: SHOW_CODE_NAMESPACE,
|
|
333
|
+
initialValue: false,
|
|
334
|
+
});
|
|
335
|
+
const [email, setEmail] = In({
|
|
336
|
+
namespace: VERIFICATION_EMAIL_NAMESPACE,
|
|
337
|
+
initialValue: undefined,
|
|
338
|
+
});
|
|
339
|
+
const setContext = En(VERIFICATION_PARENT_NAMESPACE);
|
|
340
|
+
const states = parseStates(props.stateController);
|
|
341
|
+
const formatted = Object.keys(states).reduce((prev, key) => key === "sqm-widget-verification"
|
|
342
|
+
? { ...prev, ...states[key] }
|
|
343
|
+
: { ...prev, [`${key}_stateController`]: states[key] }, {});
|
|
344
|
+
const onVerification = () => {
|
|
345
|
+
setContext(true);
|
|
346
|
+
};
|
|
347
|
+
return cjs({
|
|
348
|
+
showCode,
|
|
349
|
+
showPartnerModal: false,
|
|
350
|
+
onVerification,
|
|
351
|
+
onPartnerModalComplete: () => { },
|
|
352
|
+
loading: false,
|
|
353
|
+
}, formatted || {}, { arrayMerge: (_, a) => a });
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
export { WidgetVerification as sqm_widget_verification };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,r){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:r})}else{e.raw=r}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var a in r)if(Object.prototype.hasOwnProperty.call(r,a))e[a]=r[a]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,r,t,n){function a(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(t,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n["throw"](e))}catch(e){i(e)}}function c(e){e.done?t(e.value):a(e.value).then(o,s)}c((n=n.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(r){return c([e,r])}}function c(o){if(n)throw new TypeError("Generator is already executing.");while(t)try{if(n=1,a&&(i=o[0]&2?a["return"]:o[0]?a["throw"]||((i=a["return"])&&i.call(a),0):a.next)&&!(i=i.call(a,o[1])).done)return i;if(a=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:t.label++;return{value:o[1],done:false};case 5:t.label++;a=o[1];o=[0];continue;case 7:o=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){t=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){t.label=o[1];break}if(o[0]===6&&t.label<i[1]){t.label=i[1];i=o;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(o);break}if(i[2])t.ops.pop();t.trys.pop();continue}o=r.call(e,t)}catch(e){o=[6,e];a=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register(["./index-6582b378.system.js","./dom-context-hooks.module-d6e89c16.system.js","./index.module-5e7007c8.system.js","./jss-preset-default.esm-62a04d6d.system.js","./JSS-840a8fea.system.js","./utils-b405e671.system.js","./cjs-f0ef8d23.system.js","./keys-4fe6dfb6.system.js","./parseStates-5fae0361.system.js","./extractProps-32938668.system.js"],(function(e){"use strict";var r,t,n,a,i,o,s,c,l,u,d,f,p,m,h,v,y,g,_;return{setters:[function(e){r=e.r;t=e.h},function(e){n=e.i;a=e.j;i=e.o},function(e){o=e.d;s=e.J;c=e.I;l=e.r;u=e.X;d=e.i},function(){},function(e){f=e.c},function(e){p=e.g},function(e){m=e.c},function(e){h=e.S;v=e.a;y=e.V},function(e){g=e.p},function(e){_=e.e}],execute:function(){var S=o.gql(__makeTemplateObject(["\n query checkUserVerification {\n viewer {\n ... on User {\n id\n accountId\n email\n emailVerified\n managedIdentity {\n email\n emailVerified\n }\n impactConnection {\n connected\n }\n }\n }\n }\n"],["\n query checkUserVerification {\n viewer {\n ... on User {\n id\n accountId\n email\n emailVerified\n managedIdentity {\n email\n emailVerified\n }\n impactConnection {\n connected\n }\n }\n }\n }\n"]));function b(){var e=this;var r=s();var t=c({namespace:h,initialValue:false}),i=t[0],o=t[1];var d=c({namespace:v,initialValue:r===null||r===void 0?void 0:r.email}),f=d[0],p=d[1];var m=l(y);var g=n(true),_=g[0],b=g[1];var w=n(false),P=w[0],x=w[1];var C=u(S)[0];a((function(){var r=function(){return __awaiter(e,void 0,void 0,(function(){var e,r,t,n,a,i,o,s,c;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,2,3,4]);return[4,C({})];case 1:i=l.sent();if(!i||i instanceof Error)throw new Error;o=((e=i===null||i===void 0?void 0:i.viewer)===null||e===void 0?void 0:e.emailVerified)||((t=(r=i===null||i===void 0?void 0:i.viewer)===null||r===void 0?void 0:r.managedIdentity)===null||t===void 0?void 0:t.emailVerified);s=(a=(n=i===null||i===void 0?void 0:i.viewer)===null||n===void 0?void 0:n.impactConnection)===null||a===void 0?void 0:a.connected;if(s){m(true)}else if(o){x(true)}return[3,4];case 2:c=l.sent();console.error("Could not fetch user information:",c);return[3,4];case 3:b(false);return[7];case 4:return[2]}}))}))};r()}),[]);var j=function(){x(true)};var T=function(){x(false);m(true)};return{showCode:i,showPartnerModal:P,onVerification:j,onPartnerModalComplete:T,loading:_}}var w=e("sqm_widget_verification",function(){function e(e){r(this,e);this.general_verifyEmailHeader="Verify your email";this.general_verifyEmailDescription="To get your cash paid out directly to your bank account, please complete your account setup";this.emailStep_verifyEmailHeaderText="Start by verifying your email. We’ll send you a code through our referral provider, impact.com.";this.emailStep_sendCodeErrorHeader="There was an error sending your code.";this.emailStep_sendCodeErrorDescription="Please try again. If this problem continues, contact our program support team.";this.emailStep_emailLabel="Email";this.emailStep_sendCodeText="Send code";this.emailStep_emailValidationErrorText="Please enter a valid email";this.codeStep_verifyCodeHeaderText="Enter the code sent to {email} from our referral provider, impact.com.";this.codeStep_reverifyCodeHeaderText="Enter the code sent to {email} from our referral provider, impact.com.";this.codeStep_resendCodeText="Didn't receive your code? {resendCodeLink}";this.codeStep_resendCodeLabel="Resend code";this.codeStep_codeResentSuccessfullyText="Another code has been sent to {email}";this.codeStep_invalidCodeText="Please check your code and try again. If you’re still having trouble, try resending your code.";this.codeStep_verifyText="Verify";this.codeStep_networkErrorMessage="An error occurred while verifying your email. Please refresh the page and try again.";this.createPartnerStep_modalHeader="Let's get you ready for rewards";this.createPartnerStep_modalHeaderExistingPartner="We found an existing account";this.createPartnerStep_descriptionNewPartner="Confirm your country and currency now to get your future rewards faster.";this.createPartnerStep_descriptionExistingPartner="We found an account with this email on our referral program provider, impact.com. Please confirm your country and currency now to get your future rewards faster.";this.createPartnerStep_supportDescriptionExistingPartner="If this is a mistake, please contact Support or sign up for this referral program with a different email.";this.createPartnerStep_countryLabel="Country";this.createPartnerStep_currencyLabel="Currency";this.createPartnerStep_submitButtonLabel="Submit";this.createPartnerStep_confirmButtonLabel="Confirm";this.createPartnerStep_searchCountryPlaceholder="Search for a country";this.createPartnerStep_searchCurrencyPlaceholder="Search for a currency";this.createPartnerStep_networkErrorText="An error occurred. Please try again.";this.createPartnerStep_missingFieldsErrorText="Please select both a country and currency.";this.stateController="{}";i(this)}e.prototype.disconnectedCallback=function(){};e.prototype.getStepTextProps=function(e){var r=p(this);return _(r,e)};e.prototype.render=function(){var e=this;var r=d()?P(this):b();if(r.loading)return t("sl-spinner",null);var n={Dialog:{"&::part(panel)":{maxWidth:"480px"},"&::part(title)":{fontSize:"var(--sl-font-size-x-large)",fontWeight:"600",padding:"var(--sl-spacing-x-large) var(--sl-spacing-x-large) 0 var(--sl-spacing-x-large)"},"&::part(body)":{padding:"0 var(--sl-spacing-x-large)",fontSize:"var(--sl-font-size-small)",overflow:"visible"},"&::part(footer)":{display:"flex",flexDirection:"column",gap:"var(--sl-spacing-small)"},"&::part(overlay)":{background:"rgba(0, 0, 0, 0.5)"},"&::part(close-button)":{display:"none"}}};var a=f(n);var i=a.toString();var o=this.getStepTextProps("general_");var s=this.getStepTextProps("createPartnerStep_");var c=r.showPartnerModal?s.modalHeader:o.verifyEmailHeader;var l=function(){if(r.showPartnerModal){return t("sqm-partner-info-modal",Object.assign({embedded:true},s))}if(r.showCode){return t("sqm-code-verification",Object.assign({onVerification:r.onVerification},e.getStepTextProps("codeStep_"),_(r,"sqm-code-verification_")))}return t("sqm-email-verification",Object.assign({},e.getStepTextProps("emailStep_"),_(r,"sqm-email-verification_")))};return t("div",null,t("style",{type:"text/css"},i),t("sl-dialog",{class:a.classes.Dialog,noHeader:false,open:true,label:c,"onSl-request-close":function(e){e.preventDefault()},"onSl-hide":function(e){var r;if(((r=e.target)===null||r===void 0?void 0:r.tagName)==="SL-DIALOG"){e.preventDefault()}}},l()))};return e}());function P(e){var r=c({namespace:h,initialValue:false}),t=r[0],n=r[1];var a=c({namespace:v,initialValue:undefined}),i=a[0],o=a[1];var s=l(y);var u=g(e.stateController);var d=Object.keys(u).reduce((function(e,r){var t;return r==="sqm-widget-verification"?__assign(__assign({},e),u[r]):__assign(__assign({},e),(t={},t[r+"_stateController"]=u[r],t))}),{});var f=function(){s(true)};return m({showCode:t,showPartnerModal:false,onVerification:f,onPartnerModalComplete:function(){},loading:false},d||{},{arrayMerge:function(e,r){return r}})}}}}));
|
|
@@ -40,4 +40,5 @@ export interface PartnerInfoModalViewProps {
|
|
|
40
40
|
modalHeaderExistingPartner: string;
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
+
export declare function PartnerInfoModalContent(props: PartnerInfoModalViewProps): any[];
|
|
43
44
|
export declare function PartnerInfoModalView(props: PartnerInfoModalViewProps): any;
|
|
@@ -82,6 +82,12 @@ export declare class PartnerInfoModal {
|
|
|
82
82
|
* @uiWidget textArea
|
|
83
83
|
*/
|
|
84
84
|
missingFieldsErrorText: string;
|
|
85
|
+
/**
|
|
86
|
+
* When true, renders only the form content without its own sl-dialog wrapper.
|
|
87
|
+
* Used when embedded inside another dialog (e.g. sqm-widget-verification).
|
|
88
|
+
* @undocumented
|
|
89
|
+
*/
|
|
90
|
+
embedded: boolean;
|
|
85
91
|
/**
|
|
86
92
|
* @undocumented
|
|
87
93
|
* @componentState { "title": "New partner", "props": { "states": { "open": true, "isExistingPartner": false } } }
|
|
@@ -2346,6 +2346,11 @@ export namespace Components {
|
|
|
2346
2346
|
* @uiWidget textArea
|
|
2347
2347
|
*/
|
|
2348
2348
|
"descriptionNewPartner": string;
|
|
2349
|
+
/**
|
|
2350
|
+
* When true, renders only the form content without its own sl-dialog wrapper. Used when embedded inside another dialog (e.g. sqm-widget-verification).
|
|
2351
|
+
* @undocumented
|
|
2352
|
+
*/
|
|
2353
|
+
"embedded": boolean;
|
|
2349
2354
|
/**
|
|
2350
2355
|
* @uiName Missing fields error text
|
|
2351
2356
|
* @uiWidget textArea
|
|
@@ -10546,6 +10551,11 @@ declare namespace LocalJSX {
|
|
|
10546
10551
|
* @uiWidget textArea
|
|
10547
10552
|
*/
|
|
10548
10553
|
"descriptionNewPartner"?: string;
|
|
10554
|
+
/**
|
|
10555
|
+
* When true, renders only the form content without its own sl-dialog wrapper. Used when embedded inside another dialog (e.g. sqm-widget-verification).
|
|
10556
|
+
* @undocumented
|
|
10557
|
+
*/
|
|
10558
|
+
"embedded"?: boolean;
|
|
10549
10559
|
/**
|
|
10550
10560
|
* @uiName Missing fields error text
|
|
10551
10561
|
* @uiWidget textArea
|
package/docs/docs.docx
CHANGED
|
Binary file
|