@saasquatch/mint-components 2.1.9-0 → 2.1.9-1

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.
Files changed (25) hide show
  1. package/dist/cjs/sqm-email-verification_2.cjs.entry.js +1 -4
  2. package/dist/cjs/sqm-widget-verification.cjs.entry.js +0 -9
  3. package/dist/collection/components/sqm-partner-info-modal/usePartnerInfoModal.js +1 -4
  4. package/dist/collection/components/sqm-widget-verification/useWidgetVerification.js +0 -9
  5. package/dist/esm/sqm-email-verification_2.entry.js +1 -4
  6. package/dist/esm/sqm-widget-verification.entry.js +0 -9
  7. package/dist/esm-es5/sqm-email-verification_2.entry.js +1 -1
  8. package/dist/esm-es5/sqm-widget-verification.entry.js +1 -1
  9. package/dist/mint-components/mint-components.esm.js +1 -1
  10. package/dist/mint-components/p-470f7c0f.system.entry.js +1 -0
  11. package/dist/mint-components/{p-ef64e6f0.entry.js → p-4afbeea5.entry.js} +2 -2
  12. package/dist/mint-components/p-4b365f1f.system.js +1 -1
  13. package/dist/mint-components/{p-3b2ae7b9.entry.js → p-66c070e2.entry.js} +2 -2
  14. package/dist/mint-components/{p-a0667674.system.entry.js → p-6e6f19ea.system.entry.js} +1 -1
  15. package/docs/docs.docx +0 -0
  16. package/package.json +1 -1
  17. package/dist/cjs/sqm-partner-info-modal.cjs.entry.js +0 -396
  18. package/dist/esm/sqm-partner-info-modal.entry.js +0 -392
  19. package/dist/esm-es5/sqm-partner-info-modal.entry.js +0 -1
  20. package/dist/mint-components/mint-components.system.js +0 -1
  21. package/dist/mint-components/p-fd214860.system.entry.js +0 -1
  22. package/dist/mint-components/sqm-partner-info-modal.entry.js +0 -392
  23. package/dist/mint-components/sqm-partner-info-modal.system.entry.js +0 -1
  24. package/dist/mint-components/sqm-widget-verification.entry.js +0 -228
  25. package/dist/mint-components/sqm-widget-verification.system.entry.js +0 -1
@@ -1 +0,0 @@
1
- var __makeTemplateObject=this&&this.__makeTemplateObject||function(n,e){if(Object.defineProperty){Object.defineProperty(n,"raw",{value:e})}else{n.raw=e}return n};var __awaiter=this&&this.__awaiter||function(n,e,t,r){function o(n){return n instanceof t?n:new t((function(e){e(n)}))}return new(t||(t=Promise))((function(t,i){function a(n){try{u(r.next(n))}catch(n){i(n)}}function c(n){try{u(r["throw"](n))}catch(n){i(n)}}function u(n){n.done?t(n.value):o(n.value).then(a,c)}u((r=r.apply(n,e||[])).next())}))};var __generator=this&&this.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(n){return function(e){return u([n,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");while(t)try{if(r=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;o=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=e.call(n,t)}catch(n){a=[6,n];o=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./index-6582b378.system.js","./dom-context-hooks.module-d6e89c16.system.js","./index.module-3103d9ae.system.js","./jss-preset-default.esm-62a04d6d.system.js","./JSS-840a8fea.system.js","./utils-b405e671.system.js","./cjs-f0ef8d23.system.js","./sqm-partner-info-modal-view-929517ca.system.js","./eventKeys-8c222120.system.js"],(function(n){"use strict";var e,t,r,o,i,a,c,u,s,l,d,v,m,f;return{setters:[function(n){e=n.r;t=n.h},function(n){r=n.i;o=n.j;i=n.o},function(n){a=n.d;c=n.L;u=n.w;s=n.$;l=n.i},function(){},function(){},function(n){d=n.g},function(n){v=n.c},function(n){m=n.P},function(n){f=n.T}],execute:function(){var p=a.gql(__makeTemplateObject(["\n query getUserPartnerInfo {\n user: viewer {\n ... on User {\n id\n accountId\n firstName\n lastName\n email\n countryCode\n customFields\n impactConnection {\n connected\n publisher {\n phoneNumber\n phoneNumberCountryCode\n countryCode\n currency\n requiredTaxDocumentType\n currentTaxDocument {\n type\n status\n }\n withdrawalSettings {\n paymentMethod\n }\n }\n }\n }\n }\n }\n"],["\n query getUserPartnerInfo {\n user: viewer {\n ... on User {\n id\n accountId\n firstName\n lastName\n email\n countryCode\n customFields\n impactConnection {\n connected\n publisher {\n phoneNumber\n phoneNumberCountryCode\n countryCode\n currency\n requiredTaxDocumentType\n currentTaxDocument {\n type\n status\n }\n withdrawalSettings {\n paymentMethod\n }\n }\n }\n }\n }\n }\n"]));var y=a.gql(__makeTemplateObject(["\n query getCountries {\n impactPayoutCountries(limit: 1000) {\n data {\n countryCode\n displayName\n }\n }\n }\n"],["\n query getCountries {\n impactPayoutCountries(limit: 1000) {\n data {\n countryCode\n displayName\n }\n }\n }\n"]));var h=a.gql(__makeTemplateObject(["\n query currencies($locale: RSLocale) {\n currencies(limit: 300) {\n data {\n displayName(locale: $locale)\n currencyCode\n }\n }\n }\n"],["\n query currencies($locale: RSLocale) {\n currencies(limit: 300) {\n data {\n displayName(locale: $locale)\n currencyCode\n }\n }\n }\n"]));var g=a.gql(__makeTemplateObject(["\n mutation createImpactConnection($vars: ImpactConnectionInput!) {\n createImpactConnection(impactConnectionInput: $vars) {\n success\n validationErrors {\n field\n message\n }\n user {\n id\n accountId\n impactConnection {\n connected\n publisher {\n brandedSignup\n requiredTaxDocumentType\n currentTaxDocument {\n type\n status\n }\n }\n }\n }\n }\n }\n"],["\n mutation createImpactConnection($vars: ImpactConnectionInput!) {\n createImpactConnection(impactConnectionInput: $vars) {\n success\n validationErrors {\n field\n message\n }\n user {\n id\n accountId\n impactConnection {\n connected\n publisher {\n brandedSignup\n requiredTaxDocumentType\n currentTaxDocument {\n type\n status\n }\n }\n }\n }\n }\n }\n"]));var C=a.gql(__makeTemplateObject(["\n query getTenantSettings {\n tenantSettings {\n companyName\n }\n }\n"],["\n query getTenantSettings {\n tenantSettings {\n companyName\n }\n }\n"]));function b(n){var e,t,i,a,l,d,v,m,b;var w=c();var x=u(p,{}),_=x.data,P=x.loading,T=x.refetch;var E=_===null||_===void 0?void 0:_.user;var S=u(h,{variables:{locale:w}}),N=S.data,j=S.loading;var I=u(y,{}),k=I.data,q=I.loading;var L=u(C,{}).data;var D=s(g),O=D[0],$=D[1],B=$.loading,F=$.errors;var H=r(((t=(e=E===null||E===void 0?void 0:E.impactConnection)===null||e===void 0?void 0:e.publisher)===null||t===void 0?void 0:t.countryCode)||""),U=H[0],M=H[1];var R=r(((a=(i=E===null||E===void 0?void 0:E.impactConnection)===null||i===void 0?void 0:i.publisher)===null||a===void 0?void 0:a.currency)||""),W=R[0],A=R[1];console.log(U,W,"initial country and currency state");var G=r(""),J=G[0],K=G[1];var z=r(""),Q=z[0],V=z[1];var X=r(((l=k===null||k===void 0?void 0:k.impactPayoutCountries)===null||l===void 0?void 0:l.data)||[]),Y=X[0],Z=X[1];var nn=r(((d=N===null||N===void 0?void 0:N.currencies)===null||d===void 0?void 0:d.data)||[]),en=nn[0],tn=nn[1];var rn=r(""),on=rn[0],an=rn[1];var cn=r(false),un=cn[0],sn=cn[1];var ln=((v=k===null||k===void 0?void 0:k.impactPayoutCountries)===null||v===void 0?void 0:v.data)||[];var dn=((m=N===null||N===void 0?void 0:N.currencies)===null||m===void 0?void 0:m.data)||[];console.log(E,"user data from partner info query");o((function(){var n;if(_&&((n=E.impactConnection)===null||n===void 0?void 0:n.publisher)){M(E.impactConnection.publisher.countryCode);A(E.impactConnection.publisher.currency)}}),[_]);o((function(){if(!(ln===null||ln===void 0?void 0:ln.length))return;if(J.trim()===""){Z(ln||[])}else{Z(ln.filter((function(n){return n.displayName.toLowerCase().includes(J.toLowerCase())}))||[])}}),[J,ln]);o((function(){if(!(dn===null||dn===void 0?void 0:dn.length))return;if(Q.trim()===""){tn(dn||[])}else{tn(dn.filter((function(n){return n.currencyCode.toLowerCase().includes(Q.toLowerCase())}))||[])}}),[Q,dn]);var vn=E===null||E===void 0?void 0:E.impactConnection;function mn(n){var e,t;var r=(t=(e=n.detail)===null||e===void 0?void 0:e.item)===null||t===void 0?void 0:t.__value;if(!r)return;M(r);A("");an("")}function fn(n){var e,t;var r=(t=(e=n.detail)===null||e===void 0?void 0:e.item)===null||t===void 0?void 0:t.__value;if(!r)return;A(r);an("")}function pn(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,o,i,a,c;return __generator(this,(function(u){switch(u.label){case 0:if(!U||!W){an(n.missingFieldsErrorText);return[2]}an("");u.label=1;case 1:u.trys.push([1,4,,5]);r={user:{id:E.id,accountId:E.accountId},firstName:E.firstName,lastName:E.lastName,countryCode:U,currency:W};return[4,O({vars:r})];case 2:o=u.sent();if(!o||((e=o)===null||e===void 0?void 0:e.message)){an(n.networkErrorText);return[2]}i=o.createImpactConnection;console.log(o,i,"result and connectionResult from creating partner from modal");if(!(i===null||i===void 0?void 0:i.success)){a=(t=i===null||i===void 0?void 0:i.validationErrors)===null||t===void 0?void 0:t.map((function(n){return n.message})).join(". ");an(a||n.networkErrorText);console.error("Failed to create Impact connection:",i===null||i===void 0?void 0:i.validationErrors);return[2]}window.dispatchEvent(new Event(f));return[4,T()];case 3:u.sent();sn(true);return[3,5];case 4:c=u.sent();console.error("Partner creation error:",c);an(n.networkErrorText);return[3,5];case 5:return[2]}}))}))}console.log(un,"success state in partner info modal");var yn=!un&&!P&&(!(vn===null||vn===void 0?void 0:vn.connected)||!(vn===null||vn===void 0?void 0:vn.publisher));console.log(yn,"showModal condition in partner info modal");return{states:{open:yn,loading:P||q||j,submitting:B,isExistingPartner:(vn===null||vn===void 0?void 0:vn.connected)||(vn===null||vn===void 0?void 0:vn.publisher),countryCode:U,currency:W,error:on,success:un,brandName:((b=L===null||L===void 0?void 0:L.tenantSettings)===null||b===void 0?void 0:b.companyName)||"",filteredCountries:Y||[],filteredCurrencies:en||[]},callbacks:{onCountryChange:mn,onCurrencyChange:fn,setCurrencySearch:V,setCountrySearch:K,onSubmit:pn,onClose:function(){window.dispatchEvent(new Event(f));sn(true)}},text:n.getTextProps()}}var w=n("sqm_partner_info_modal",function(){function n(n){e(this,n);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.";i(this)}n.prototype.disconnectedCallback=function(){};n.prototype.getTextProps=function(){return d(this)};n.prototype.render=function(){var n=l()?x(this):b(this);return t(m,Object.assign({},n))};return n}());function x(n){var e=r("US"),t=e[0],o=e[1];var i=r(""),a=i[0],c=i[1];var u=r(""),s=u[0],l=u[1];return v({states:{brandName:"Test Brand",open:true,loading:false,submitting:false,isExistingPartner:false,countryCode:t,currency:a,error:s,success:false,filteredCountries:[],filteredCurrencies:[]},callbacks:{onCountryChange:function(n){var e,t;var r=(t=(e=n===null||n===void 0?void 0:n.detail)===null||e===void 0?void 0:e.item)===null||t===void 0?void 0:t.__value;if(r){o(r);c("")}},onCurrencyChange:function(n){var e,t;var r=(t=(e=n===null||n===void 0?void 0:n.detail)===null||e===void 0?void 0:e.item)===null||t===void 0?void 0:t.__value;if(r)c(r)},setCountrySearch:function(){},setCurrencySearch:function(){},onSubmit:function(){if(!t||!a){l(n.missingFieldsErrorText);return}l("")},onClose:function(){}},text:{modalHeader:n.modalHeader,descriptionNewPartner:n.descriptionNewPartner,descriptionExistingPartner:n.descriptionExistingPartner,countryLabel:n.countryLabel,currencyLabel:n.currencyLabel,submitButtonLabel:n.submitButtonLabel,confirmButtonLabel:n.confirmButtonLabel,searchCountryPlaceholder:n.searchCountryPlaceholder,searchCurrencyPlaceholder:n.searchCurrencyPlaceholder,supportDescriptionExistingPartner:n.supportDescriptionExistingPartner,modalHeaderExistingPartner:n.modalHeaderExistingPartner}},n.demoData||{},{arrayMerge:function(n,e){return e}})}}}}));
@@ -1,228 +0,0 @@
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, o as En, X as Xe, i as isDemo } from './index.module-5db56a7a.js';
4
- import { g as getProps } from './utils-61821fb1.js';
5
- import { c as cjs } from './cjs-e829b75b.js';
6
- import { p as parseStates } from './parseStates-ed75e224.js';
7
- import { e as extractProps } from './extractProps-ae1afbb3.js';
8
- import { S as SHOW_CODE_NAMESPACE, V as VERIFICATION_EMAIL_NAMESPACE, a as VERIFICATION_PARENT_NAMESPACE } from './keys-406491dc.js';
9
- import { T as TAX_FORM_UPDATED_EVENT_KEY } from './eventKeys-f76b6a03.js';
10
-
11
- const USER_LOOKUP = dist.gql `
12
- query checkUserVerification {
13
- viewer {
14
- ... on User {
15
- id
16
- accountId
17
- email
18
- emailVerified
19
- managedIdentity {
20
- email
21
- emailVerified
22
- }
23
- }
24
- }
25
- }
26
- `;
27
- function useWidgetVerification() {
28
- const userIdentity = J();
29
- const [showCode, setShowCode] = In({
30
- namespace: SHOW_CODE_NAMESPACE,
31
- initialValue: false,
32
- });
33
- const [email, setEmail] = In({
34
- namespace: VERIFICATION_EMAIL_NAMESPACE,
35
- initialValue: userIdentity === null || userIdentity === void 0 ? void 0 : userIdentity.email,
36
- });
37
- const setContext = En(VERIFICATION_PARENT_NAMESPACE);
38
- const [loading, setLoading] = useState(true);
39
- const [showPartnerModal, setShowPartnerModal] = useState(false);
40
- const [fetch] = Xe(USER_LOOKUP);
41
- useEffect(() => {
42
- const checkUser = async () => {
43
- var _a, _b, _c;
44
- try {
45
- const res = await fetch({});
46
- if (!res || res instanceof Error)
47
- throw new Error();
48
- if ((_a = res === null || res === void 0 ? void 0 : res.viewer) === null || _a === void 0 ? void 0 : _a.emailVerified)
49
- setContext(true);
50
- else if ((_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)
51
- setContext(true);
52
- }
53
- catch (e) {
54
- console.error("Could not fetch user information:", e);
55
- }
56
- finally {
57
- setLoading(false);
58
- }
59
- };
60
- checkUser();
61
- }, []);
62
- const onVerification = () => {
63
- setShowPartnerModal(true);
64
- };
65
- const onPartnerModalComplete = () => {
66
- setShowPartnerModal(false);
67
- setContext(true);
68
- };
69
- // Listen for partner modal completion (fires on successful createImpactConnection or confirm)
70
- useEffect(() => {
71
- if (!showPartnerModal)
72
- return;
73
- const handler = () => onPartnerModalComplete();
74
- window.addEventListener(TAX_FORM_UPDATED_EVENT_KEY, handler);
75
- return () => window.removeEventListener(TAX_FORM_UPDATED_EVENT_KEY, handler);
76
- }, [showPartnerModal]);
77
- return { showCode, showPartnerModal, onVerification, onPartnerModalComplete, loading };
78
- }
79
-
80
- const WidgetVerification = class {
81
- constructor(hostRef) {
82
- registerInstance(this, hostRef);
83
- // ! Any updated must be reflected in sqm-widget-verification-internal AND sqm-email-verification AND sqm-code-verification
84
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85
- GENERAL PROPS
86
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
87
- /**
88
- * @uiName General verify widget header text
89
- * @uiGroup General Text
90
- */
91
- this.general_verifyEmailHeader = "Verify your email";
92
- /**
93
- * @uiName General verify widget description text
94
- * @uiGroup General Text
95
- */
96
- this.general_verifyEmailDescription = "To get your cash paid out directly to your bank account, please complete your account setup";
97
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98
- EMAIL STEP PROPS
99
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
100
- /**
101
- * @uiName Verify email widget header text
102
- * @uiGroup Email Verification Step
103
- */
104
- this.emailStep_verifyEmailHeaderText = "Start by verifying your email. We’ll send you a code through our referral provider, impact.com.";
105
- /**
106
- * @uiName Send code to email alert header
107
- * @uiGroup Email Verification Step
108
- */
109
- this.emailStep_sendCodeErrorHeader = "There was an error sending your code.";
110
- /**
111
- * @uiName Send code to email alert description
112
- * @uiGroup Email Verification Step
113
- */
114
- this.emailStep_sendCodeErrorDescription = "Please try again. If this problem continues, contact our program support team.";
115
- /**
116
- * @uiName Email input label
117
- * @uiGroup Email Verification Step
118
- */
119
- this.emailStep_emailLabel = "Email";
120
- /**
121
- * @uiName Send code button text
122
- * @uiGroup Email Verification Step
123
- */
124
- this.emailStep_sendCodeText = "Send code";
125
- /**
126
- * @uiName Send code button text
127
- * @uiGroup Email Verification Step
128
- */
129
- this.emailStep_emailValidationErrorText = "Please enter a valid email";
130
- /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
131
- EMAIL STEP PROPS
132
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
133
- /**
134
- * @uiName Verify code widget header text
135
- * @uiGroup Code Verification Step
136
- */
137
- this.codeStep_verifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
138
- /**
139
- * @uiName Reverify code widget header text
140
- * @uiGroup Code Verification Step
141
- */
142
- this.codeStep_reverifyCodeHeaderText = "Enter the code sent to {email} from our referral provider, impact.com.";
143
- /**
144
- * Text displayed under verify button
145
- * @uiName Resend code text
146
- * @uiGroup Code Verification Step
147
- */
148
- this.codeStep_resendCodeText = "Didn't receive your code? {resendCodeLink}";
149
- /**
150
- * The link that appears in the resend code link
151
- * @uiName Resend code label
152
- * @uiGroup Code Verification Step
153
- */
154
- this.codeStep_resendCodeLabel = "Resend code";
155
- /**
156
- * Link text displayed under verify button
157
- * @uiName Resend code text
158
- * @uiGroup Code Verification Step
159
- */
160
- this.codeStep_codeResentSuccessfullyText = "Another code has been sent to {email}";
161
- /**
162
- * Error text displayed under verification input
163
- * @uiName Invalid code text
164
- * @uiGroup Code Verification Step
165
- */
166
- this.codeStep_invalidCodeText = "Please check your code and try again. If you’re still having trouble, try resending your code.";
167
- /**
168
- * @uiName Verify code button text
169
- * @uiGroup Code Verification Step
170
- */
171
- this.codeStep_verifyText = "Verify";
172
- /**
173
- * Displayed when the email verification fails due to a network error. The participant can try refreshing the page.
174
- * @uiName Network error message
175
- * @uiGroup Code Verification Step
176
- */
177
- this.codeStep_networkErrorMessage = "An error occurred while verifying your email. Please refresh the page and try again.";
178
- /**
179
- * @undocumented
180
- * @componentState { "title": "Step 1: Enter email", "props": { "showCode": false }, "dependencies": ["sqm-email-verification"], "uiGroup": "Email Verification Step" }
181
- * @componentState { "title": "Step 2: Enter code", "props": { "showCode": true }, "dependencies": ["sqm-code-verification"], "uiGroup": "Code Verification Step" }
182
- */
183
- this.stateController = "{}";
184
- h(this);
185
- }
186
- disconnectedCallback() { }
187
- getStepTextProps(prefix) {
188
- const props = getProps(this);
189
- return extractProps(props, prefix);
190
- }
191
- render() {
192
- const props = isDemo()
193
- ? useDemoWidgetVerificationInternal(this)
194
- : useWidgetVerification();
195
- if (props.loading)
196
- return h$1("sl-spinner", null);
197
- if (props.showPartnerModal) {
198
- return h$1("sqm-partner-info-modal", null);
199
- }
200
- const generalText = this.getStepTextProps("general_");
201
- return (h$1("div", null, h$1("h3", { style: { fontSize: "24px", margin: "0" } }, generalText.verifyEmailHeader), h$1("p", { style: {
202
- color: "var(--sl-color-neutral-500)",
203
- fontSize: "var(--sl-font-size-medium)",
204
- margin: "0",
205
- } }, generalText.verifyEmailDescription), props.showCode ? (h$1("sqm-code-verification", Object.assign({ onVerification: props.onVerification }, this.getStepTextProps("codeStep_"), extractProps(props, "sqm-code-verification_")))) : (h$1("sqm-email-verification", Object.assign({}, this.getStepTextProps("emailStep_"), extractProps(props, "sqm-email-verification_"))))));
206
- }
207
- };
208
- function useDemoWidgetVerificationInternal(props) {
209
- const [showCode, setShowCode] = In({
210
- namespace: SHOW_CODE_NAMESPACE,
211
- initialValue: false,
212
- });
213
- const [email, setEmail] = In({
214
- namespace: VERIFICATION_EMAIL_NAMESPACE,
215
- initialValue: undefined,
216
- });
217
- const setContext = En(VERIFICATION_PARENT_NAMESPACE);
218
- const states = parseStates(props.stateController);
219
- const formatted = Object.keys(states).reduce((prev, key) => key === "sqm-widget-verification"
220
- ? { ...prev, ...states[key] }
221
- : { ...prev, [`${key}_stateController`]: states[key] }, {});
222
- const onVerification = () => {
223
- setContext(true);
224
- };
225
- return cjs({ showCode, showPartnerModal: false, onVerification, onPartnerModalComplete: () => { }, loading: false }, formatted || {}, { arrayMerge: (_, a) => a });
226
- }
227
-
228
- export { WidgetVerification as sqm_widget_verification };
@@ -1 +0,0 @@
1
- var __makeTemplateObject=this&&this.__makeTemplateObject||function(e,t){if(Object.defineProperty){Object.defineProperty(e,"raw",{value:t})}else{e.raw=t}return e};var __assign=this&&this.__assign||function(){__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i))e[i]=t[i]}return e};return __assign.apply(this,arguments)};var __awaiter=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n["throw"](e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return l([e,t])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(r)try{if(n=1,i&&(o=a[0]&2?i["return"]:a[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;if(i=0,o)a=[a[0]&2,o.value];switch(a[0]){case 0:case 1:o=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;i=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(a[0]===6&&r.label<o[1]){r.label=o[1];o=a;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(a);break}if(o[2])r.ops.pop();r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e];i=0}finally{n=o=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./index-6582b378.system.js","./dom-context-hooks.module-d6e89c16.system.js","./index.module-3103d9ae.system.js","./utils-b405e671.system.js","./cjs-f0ef8d23.system.js","./parseStates-5fae0361.system.js","./extractProps-32938668.system.js","./keys-06ca8103.system.js","./eventKeys-8c222120.system.js"],(function(e){"use strict";var t,r,n,i,o,a,s,l,c,u,d,f,m,p,v,h,y,_,g;return{setters:[function(e){t=e.r;r=e.h},function(e){n=e.i;i=e.j;o=e.o},function(e){a=e.d;s=e.J;l=e.I;c=e.o;u=e.X;d=e.i},function(e){f=e.g},function(e){m=e.c},function(e){p=e.p},function(e){v=e.e},function(e){h=e.S;y=e.V;_=e.a},function(e){g=e.T}],execute:function(){var w=a.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 }\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 }\n }\n }\n"]));function b(){var e=this;var t=s();var r=l({namespace:h,initialValue:false}),o=r[0],a=r[1];var d=l({namespace:y,initialValue:t===null||t===void 0?void 0:t.email}),f=d[0],m=d[1];var p=c(_);var v=n(true),b=v[0],S=v[1];var x=n(false),j=x[0],T=x[1];var V=u(w)[0];i((function(){var t=function(){return __awaiter(e,void 0,void 0,(function(){var e,t,r,n,i;return __generator(this,(function(o){switch(o.label){case 0:o.trys.push([0,2,3,4]);return[4,V({})];case 1:n=o.sent();if(!n||n instanceof Error)throw new Error;if((e=n===null||n===void 0?void 0:n.viewer)===null||e===void 0?void 0:e.emailVerified)p(true);else if((r=(t=n===null||n===void 0?void 0:n.viewer)===null||t===void 0?void 0:t.managedIdentity)===null||r===void 0?void 0:r.emailVerified)p(true);return[3,4];case 2:i=o.sent();console.error("Could not fetch user information:",i);return[3,4];case 3:S(false);return[7];case 4:return[2]}}))}))};t()}),[]);var C=function(){T(true)};var P=function(){T(false);p(true)};i((function(){if(!j)return;var e=function(){return P()};window.addEventListener(g,e);return function(){return window.removeEventListener(g,e)}}),[j]);return{showCode:o,showPartnerModal:j,onVerification:C,onPartnerModalComplete:P,loading:b}}var S=e("sqm_widget_verification",function(){function e(e){t(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.stateController="{}";o(this)}e.prototype.disconnectedCallback=function(){};e.prototype.getStepTextProps=function(e){var t=f(this);return v(t,e)};e.prototype.render=function(){var e=d()?x(this):b();if(e.loading)return r("sl-spinner",null);if(e.showPartnerModal){return r("sqm-partner-info-modal",null)}var t=this.getStepTextProps("general_");return r("div",null,r("h3",{style:{fontSize:"24px",margin:"0"}},t.verifyEmailHeader),r("p",{style:{color:"var(--sl-color-neutral-500)",fontSize:"var(--sl-font-size-medium)",margin:"0"}},t.verifyEmailDescription),e.showCode?r("sqm-code-verification",Object.assign({onVerification:e.onVerification},this.getStepTextProps("codeStep_"),v(e,"sqm-code-verification_"))):r("sqm-email-verification",Object.assign({},this.getStepTextProps("emailStep_"),v(e,"sqm-email-verification_"))))};return e}());function x(e){var t=l({namespace:h,initialValue:false}),r=t[0],n=t[1];var i=l({namespace:y,initialValue:undefined}),o=i[0],a=i[1];var s=c(_);var u=p(e.stateController);var d=Object.keys(u).reduce((function(e,t){var r;return t==="sqm-widget-verification"?__assign(__assign({},e),u[t]):__assign(__assign({},e),(r={},r[t+"_stateController"]=u[t],r))}),{});var f=function(){s(true)};return m({showCode:r,showPartnerModal:false,onVerification:f,onPartnerModalComplete:function(){},loading:false},d||{},{arrayMerge:function(e,t){return t}})}}}}));