@saasquatch/mint-components 1.16.0-15 → 1.16.0-16
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/sqm-banking-info-form_17.cjs.entry.js +1 -1
- package/dist/cjs/sqm-big-stat_43.cjs.entry.js +1 -1
- package/dist/cjs/{usePayoutStatus-d69345f3.js → usePayoutStatus-d459ddde.js} +4 -1
- package/dist/collection/components/tax-and-cash/sqm-payout-status-alert/usePayoutStatus.js +4 -1
- package/dist/esm/sqm-banking-info-form_17.entry.js +1 -1
- package/dist/esm/sqm-big-stat_43.entry.js +1 -1
- package/dist/esm/{usePayoutStatus-1b6c3dbd.js → usePayoutStatus-4a7625b9.js} +4 -1
- package/dist/esm-es5/sqm-banking-info-form_17.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_43.entry.js +1 -1
- package/dist/esm-es5/{usePayoutStatus-1b6c3dbd.js → usePayoutStatus-4a7625b9.js} +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/p-05389a8e.entry.js +273 -0
- package/dist/mint-components/p-37996351.system.js +1 -1
- package/dist/mint-components/{p-03ebb740.js → p-3b2f1211.js} +2 -2
- package/dist/mint-components/{p-e1167a80.entry.js → p-72dcdf84.entry.js} +1 -1
- package/dist/mint-components/{p-9e6ce01f.system.js → p-9f22f58a.system.js} +2 -2
- package/dist/mint-components/{p-bfeb0690.system.entry.js → p-a12f854d.system.entry.js} +1 -1
- package/dist/mint-components/{p-641dae37.system.entry.js → p-a3edefd0.system.entry.js} +1 -1
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/mint-components/p-b58e2197.entry.js +0 -273
package/docs/docs.docx
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saasquatch/mint-components",
|
|
3
3
|
"title": "Mint Components",
|
|
4
|
-
"version": "1.16.0-
|
|
4
|
+
"version": "1.16.0-16",
|
|
5
5
|
"description": "A minimal design library with components for referral and loyalty experiences. Built with Shoelace components by Saasquatch.",
|
|
6
6
|
"icon": "https://res.cloudinary.com/saasquatch/image/upload/v1652219900/squatch-assets/For_Mint.svg",
|
|
7
7
|
"raisins": "docs/raisins.json",
|
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import{r as e,h as t,c as r}from"./p-f708da7b.js";import{n as s,f as a,i,k as n,m as o,u as l,b as c,j as d}from"./p-cd651f81.js";import{i as u}from"./p-65069b66.js";import{i as h,_ as m,d as p,J as v,H as g,$ as f,w as b,B as y,u as x,L as w,y as k,j as E,r as C,V as I,Q as S,k as R}from"./p-94a876b9.js";import{j as _}from"./p-e7e129ac.js";import{c as T}from"./p-c1086930.js";import{g as N,a as q}from"./p-9ec99ced.js";import{c as M}from"./p-cef45012.js";import"./p-3f7b81b8.js";import"./p-91521e9d.js";import{C as A}from"./p-31015791.js";import{a as L}from"./p-4e451f75.js";import{u as D}from"./p-19ccb4ce.js";import"./p-5bedb58c.js";import"./p-c9f1dde7.js";import{p as P}from"./p-8d363802.js";import{R as F,u as O}from"./p-98698131.js";import{R as V,L as $,u as j}from"./p-f98a4354.js";import{P as U}from"./p-dbcb5359.js";import{u as B}from"./p-4e526a94.js";import{A as H}from"./p-121cdc60.js";import{i as z}from"./p-8c23d1b8.js";import{b as W,W as G,B as Y,U as K,J as Z,i as Q,K as X,D as J,E as ee,H as te,I as re,Q as se,O as ae,X as ie,L as ne,N as oe,C as le,d as ce,h as de,P as ue,e as he,R as me,Y as pe,j as ve,a as ge,S as fe,u as be,c as ye,T as xe}from"./p-c1b074b6.js";import"./p-a9f4ddb1.js";import{u as we}from"./p-03ebb740.js";const ke=class{constructor(t){e(this,t),this.flexReverse=!1,this.ignored=!0,s(this)}disconnectedCallback(){}render(){var e;const{props:r,label:s}=h()?W(this):G(this),a=!!(null===(e=m().innerHTML)||void 0===e?void 0:e.trim()),i=t("slot",{name:"label"},a?t("slot",null):s);return t(Y,Object.assign({},r,{labelSlot:i}))}},Ee=class{constructor(t){e(this,t),s(this)}disconnectedCallback(){}render(){var e,s;const i=null!==(e=function(e){if(e)try{return K(e)}catch{}}(this.brandColor))&&void 0!==e?e:"",n=(null!==(s=this.brandFont)&&void 0!==s?s:"Nunito Sans").trim()||void 0;a((()=>{if(!n)return;const e=document.createElement("link");return e.setAttribute("href",function(...e){return`https://fonts.googleapis.com/css2?${e.map((e=>`family=${encodeURIComponent(e)}`)).join("&")}`}(n)),e.setAttribute("rel","stylesheet"),document.head.appendChild(e),()=>document.head.removeChild(e)}),[n]);const o=null!=n?n:"";return t(r,null,t("style",null,`\n\n :host{\n display: contents;\n }\n /* \n Selects any element placed inside a slot\n - resets css variable inheritence for fonts\n \n */\n ::slotted(*) {\n --sl-font-sans: "${o}", arial;\n --sl-input-font-family: "${o}", arial;\n --sl-tooltip-font-family: "${o}", arial;\n font-family: "${o}", arial;\n\t\t\t\n ${i}\n\n --sl-focus-ring-color-primary: var(--sl-color-primary-100);\n --sl-input-border-color-focus: var(--sl-color-primary-500);\n --sl-color-primary-hue: var(--sl-color-primary-500);\n }`),t("slot",null))}},Ce=class{constructor(t){e(this,t),this.ignored=!0,this.width=347,this.gap=24,s(this)}disconnectedCallback(){}render(){return t(Z,Object.assign({},N(this)),t("slot",null))}};function Ie(e){var t;const r=i(F),[s,o]=n(!1);return a((()=>{var t,s;(null===(t=null==r?void 0:r.initialData)||void 0===t?void 0:t[e.checkboxName])&&o(!!(null===(s=null==r?void 0:r.initialData)||void 0===s?void 0:s[e.checkboxName]))}),[null===(t=null==r?void 0:r.initialData)||void 0===t?void 0:t[e.checkboxName]]),{states:{registrationFormState:r,checked:s},callbacks:{setChecked:o}}}const Se=class{constructor(t){e(this,t),this.ignored=!0,this.checkboxLabel="By signing up you agree to the {labelLink}",this.checkboxLabelLink="https://example.com",this.checkboxLabelLinkText="Terms and Conditions",this.errorMessage="Must be checked",this.checkboxOptional=!1,s(this)}disconnectedCallback(){}render(){const e=q([{attribute:"checkbox-name",value:this.checkboxName}]);if(!h()&&e)return t(V,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this checkbox field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"});const r={...N(this)},{states:s,callbacks:a}=h()?T({states:{registrationFormState:{},checked:!1},callbacks:{setChecked:()=>{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):Ie(this);return t(Q,{states:s,content:r,callbacks:a})}},Re=p.gql`
|
|
2
|
-
query fuelTankRewardsQuery($programId: ID!) {
|
|
3
|
-
user: viewer {
|
|
4
|
-
... on User {
|
|
5
|
-
instantAccessRewards(
|
|
6
|
-
filter: { type_eq: FUELTANK, programId_eq: $programId }
|
|
7
|
-
) {
|
|
8
|
-
data {
|
|
9
|
-
fuelTankCode
|
|
10
|
-
fuelTankType
|
|
11
|
-
statuses
|
|
12
|
-
dateGiven
|
|
13
|
-
dateExpires
|
|
14
|
-
dateRedeemed
|
|
15
|
-
dateCancelled
|
|
16
|
-
dateScheduledFor
|
|
17
|
-
datePendingForUnhandledError
|
|
18
|
-
pendingReasons
|
|
19
|
-
}
|
|
20
|
-
count
|
|
21
|
-
totalCount
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
`,_e=p.gql`
|
|
27
|
-
mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
|
|
28
|
-
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
29
|
-
}
|
|
30
|
-
`;const Te=class{constructor(t){e(this,t),this.tooltiptext="Copied to Clipboard",this.tooltiplifespan=1e3,this.textAlign="left",this.copyButtonLabel="Copy Coupon",this.buttonStyle="icon",this.couponCodeLabel="Your coupon code:",this.cancelledErrorText="This code has been cancelled. Please reach out to the Support team for help resolving this issue.",this.redeemedErrorText="Looks like you’ve already redeemed this code.",this.expiredErrorText="Looks like this code has expired. Please reach out to the Support team for help resolving this issue.",this.fullfillmentErrorText="We couldn't fetch your code. Please try again later or reach out to the Support team for help resolving this issue.",this.pendingErrorText="Your code will be available on {unpendDate}. Mark your calendar and come back then to redeem your reward!",this.codeSyncErrorRetryText="We're experiencing an issue generating your coupon code. If it doesn't appear shortly, please contact {supportEmail}. Retrying in {timeRemaining} seconds.",this.codeSyncErrorText="We're still experiencing an issue generating your coupon code. Please contact {supportEmail} for assistance.",this.genericErrorText="We couldn't fetch your code. Please try again later or reach out to the Support team for help resolving this issue.",this.couponCodePlaceholder="...",s(this)}disconnectedCallback(){}render(){const e=N(this),r=h()?function(e){const[t,r]=n(!1),s="THANKSJANE125uv125";return T({copyString:s,tooltiptext:e.tooltiptext,textAlign:e.textAlign,buttonStyle:e.buttonStyle,copyButtonLabel:e.copyButtonLabel,error:!1,couponCodePlaceholder:e.couponCodePlaceholder,couponCodeLabel:e.couponCodeLabel,codeSyncErrorText:e.codeSyncErrorText,codeSyncErrorRetryText:e.codeSyncErrorRetryText,open:t,onClick:()=>{navigator.clipboard.writeText(s),r(!0),setTimeout((()=>r(!1)),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):function(e){var t,r,s;const i=v(),l=g(),c=y(),[d]=f(_e),[h,m]=n(!1),[p,x]=n(60),w=o(void 0),k=o(void 0),{data:E,loading:C,refetch:I}=b(Re,{programId:l},!(null==i?void 0:i.jwt));async function S(){var e,t,r,s,a,i;const n=await I();if(m(!0),!(null===(i=null===(a=null===(s=null===(r=null===(t=null===(e=n)||void 0===e?void 0:e.user)||void 0===t?void 0:t.instantAccessRewards)||void 0===r?void 0:r.data)||void 0===s?void 0:s[0])||void 0===a?void 0:a.pendingReasons)||void 0===i?void 0:i.includes("ERROR_SYNCING_FUEL_TANK_CODE")))return clearInterval(w.current)}const R=null===(s=null===(r=null===(t=null==E?void 0:E.user)||void 0===t?void 0:t.instantAccessRewards)||void 0===r?void 0:r.data)||void 0===s?void 0:s[0],_=(e=61e3)=>setInterval(S,e);a((()=>{var e,t;return!w.current&&(null===(e=null==R?void 0:R.statuses)||void 0===e?void 0:e.includes("PENDING"))&&(null===(t=null==R?void 0:R.pendingReasons)||void 0===t?void 0:t.includes("ERROR_SYNCING_FUEL_TANK_CODE"))&&(w.current=_()),()=>{clearInterval(w.current)}}),[]),a((()=>{var e,t;return p>0&&(null===(e=null==R?void 0:R.statuses)||void 0===e?void 0:e.includes("PENDING"))&&(null===(t=null==R?void 0:R.pendingReasons)||void 0===t?void 0:t.includes("ERROR_SYNCING_FUEL_TANK_CODE"))&&(clearInterval(k.current),k.current=(e=>setInterval((()=>x(e)),1e3))(p-1)),()=>{clearInterval(k.current)}}),[p,R]),a((()=>{var e,t;(null===(e=null==R?void 0:R.statuses)||void 0===e?void 0:e.includes("PENDING"))&&(null===(t=null==R?void 0:R.pendingReasons)||void 0===t?void 0:t.includes("ERROR_SYNCING_FUEL_TANK_CODE"))&&_()}),[R]);const T=(e=>{if(!e||!e.statuses)return"ERROR";const t=e.statuses[e.statuses.length-1];return"PENDING"===t&&e.pendingReasons.includes("ERROR_SYNCING_FUEL_TANK_CODE")?"ERROR_SYNCING_FUEL_TANK_CODE":"PENDING"===t&&null===e.dateScheduledFor?"EMPTY_TANK":t})(R),N="PENDING"===T&&R.dateScheduledFor?new Date(R.dateScheduledFor).toLocaleDateString("default",{day:"numeric",month:"long",year:"numeric"}):void 0,q=(null==R?void 0:R.fuelTankCode)||"...",[M,A]=n(!1),L=(t=>{switch(t){case"CANCELLED":return e.cancelledErrorText;case"EXPIRED":return e.expiredErrorText;case"EMPTY_TANK":return e.fullfillmentErrorText;case"ERROR_SYNCING_FUEL_TANK_CODE":return h?u.formatMessage({id:"codeSyncErrorText",defaultMessage:e.codeSyncErrorText},{supportEmail:"advocate-support@impact.com"}):u.formatMessage({id:"codeSyncErrorText",defaultMessage:e.codeSyncErrorRetryText},{supportEmail:"advocate-support@impact.com",timeRemaining:p});case"PENDING":return e.pendingErrorText.replace("{unpendDate}",N);case"REDEEMED":return e.redeemedErrorText;case"AVAILABLE":return"";default:return e.genericErrorText}})(T),D=(e=>{switch(e){case"EXPIRED":case"EMPTY_TANK":case"CANCELLED":case"ERROR":case"ERROR_SYNCING_FUEL_TANK_CODE":return"warning";case"PENDING":return"info";case"REDEEMED":return"success";default:return}})(T),P="AVAILABLE"!==T;return{...e,onClick:function(){navigator.clipboard.writeText(q),A(!0),setTimeout((()=>A(!1)),e.tooltiplifespan),d({eventMeta:{programId:l,id:null==i?void 0:i.id,accountId:null==i?void 0:i.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:c,shareMedium:"DIRECT"}}})},open:M,copyString:q,error:P,errorText:L,dateAvailable:N,loading:C,errorType:D}}(e);return t(X,Object.assign({},r))}};function Ne(e,r){const s=()=>"row"===e.direction?{"border-right":e.dividerStyle||"1px solid #EAEAEA"}:{"border-bottom":e.dividerStyle||"1px solid #EAEAEA"},a={LayoutContainer:{display:"contents","& > :not(:last-child)":{...s()},"& > ::slotted(*:not(:last-child))":{...s()}}},i=`\n display: flex;\n flex: 1;\n box-sizing: border-box;\n flex-direction: ${e.direction};\n background-color: var(--sqm-content-background);\n overflow-x: clip;\n ${"column"===e.direction?"width: 100%; max-width: var(--sqm-portal-main-width);":""}\n ${null!==e.contentAreaWidth?`max-width: ${e.contentAreaWidth} !important;`:""}\n `,n=`\n :host{\n ${i}\n }\n @media screen and (max-width: 570px) {\n :host {\n display: flex;\n flex-direction: column;\n }\n }\n sqm-divided-layout {\n ${i}\n }\n `,o=M(a),l=o.toString();return t("div",{class:o.classes.LayoutContainer,part:"sqm-base"},t("style",{type:"text/css"},n,l),r)}const qe=class{constructor(t){e(this,t),this.dividerStyle="1px solid #EAEAEA",s(this)}disconnectedCallback(){}render(){return t(Ne,Object.assign({},N(this)),t("slot",null))}},Me=class{constructor(t){e(this,t),this.ignored=!0,this.dropdownLabel="Select an option",this.errorMessage="Select an option",this.dropdownOptional=!1,s(this)}disconnectedCallback(){}render(){const e=q([{attribute:"dropdown-name",value:this.dropdownName}]);if(!h()&&e)return t(V,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this drop down field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"},t("slot",null));const r={...N(this),selectOptions:t("slot",null)},{states:s}=h()?T({states:{registrationFormState:{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):{states:{registrationFormState:i(F)}};return t(J,{states:s,content:r})}},Ae=p.gql`
|
|
31
|
-
query {
|
|
32
|
-
viewer {
|
|
33
|
-
... on User {
|
|
34
|
-
id
|
|
35
|
-
accountId
|
|
36
|
-
firstName
|
|
37
|
-
lastName
|
|
38
|
-
email
|
|
39
|
-
countryCode
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
`,Le=p.gql`
|
|
44
|
-
mutation (
|
|
45
|
-
$id: String!
|
|
46
|
-
$accountId: String!
|
|
47
|
-
$firstName: String!
|
|
48
|
-
$lastName: String!
|
|
49
|
-
) {
|
|
50
|
-
upsertUser(
|
|
51
|
-
userInput: {
|
|
52
|
-
id: $id
|
|
53
|
-
accountId: $accountId
|
|
54
|
-
firstName: $firstName
|
|
55
|
-
lastName: $lastName
|
|
56
|
-
}
|
|
57
|
-
) {
|
|
58
|
-
firstName
|
|
59
|
-
lastName
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
`,De={currentRegion:"",firstName:"",lastName:"",errors:{},error:""},Pe=class{constructor(t){e(this,t),this.ignored=!0,this.networkErrorMessage="Network request failed.",this.fieldEmptyText="Cannot be empty",this.formErrorText="Please correct the errors below to update your profile.",s(this)}disconnectedCallback(){}render(){const e=h()?function(e){return T({states:{loading:!1,submitDisabled:!1,formState:{currentRegion:"Canada",firstName:"Bill",lastName:"Bob",errors:{},error:"An error string"},user:{firstName:"Bill",lastName:"Bob",email:"billbob@example.com"},showEdit:!1,text:{editprofileheader:e.editprofileheader?e.editprofileheader:"Edit Profile",editprofiletext:e.editprofiletext?e.editprofiletext:"Update your profile.",firstnametext:e.firstnametext?e.firstnametext:"First Name",lastnametext:e.lastnametext?e.lastnametext:"Last Name",canceltext:e.canceltext?e.canceltext:"Cancel",updatetext:e.updatetext?e.updatetext:"Update",currentregiontext:e.currentregiontext?e.currentregiontext:"Region",showregion:!0,fieldEmptyText:e.fieldEmptyText}},callbacks:{onSubmit:e=>{console.log(e)},resetForm:()=>{console.log("reset")},onChange:()=>{console.log("change")},setShowEdit:e=>{console.log(e)}}},e.demoData||{},{arrayMerge:(e,t)=>t})}(N(this)):function(e){const t=v(),[r,s]=n(!1),[i,o]=n(""),[l,c]=n(void 0),[d,h]=n(De),m=b(Ae,{},!(null==t?void 0:t.jwt)),[p,g]=f(Le);return a((()=>{!(null==g?void 0:g.loading)&&r&&((null==g?void 0:g.errors)?h((e=>{var t,r,s;return{...e,error:null===(s=null===(r=null===(t=null==g?void 0:g.errors)||void 0===t?void 0:t.response)||void 0===r?void 0:r.errors)||void 0===s?void 0:s[0].message}})):(c((e=>{var t;return{...e,...null===(t=null==g?void 0:g.data)||void 0===t?void 0:t.upsertUser}})),s(!1)))}),[null==g?void 0:g.loading]),a((()=>{c((e=>{var t;return{...e,...null===(t=null==m?void 0:m.data)||void 0===t?void 0:t.viewer}}))}),[null==m?void 0:m.data]),a((()=>{var t;(null===(t=null==g?void 0:g.errors)||void 0===t?void 0:t.message)&&h((t=>({...t,error:e.networkErrorMessage})))}),[null==g?void 0:g.errors]),{states:{loading:(null==m?void 0:m.loading)||g.loading,submitDisabled:!1,formState:d,user:l,showEdit:r,text:{editprofileheader:e.editprofileheader,editprofiletext:e.editprofiletext,firstnametext:e.firstnametext,lastnametext:e.lastnametext,canceltext:e.canceltext,updatetext:e.updatetext,currentregiontext:e.currentregiontext,showregion:e.showregion,fieldEmptyText:e.fieldEmptyText}},callbacks:{onSubmit:()=>{if(d.firstName&&d.lastName)return p({id:null==t?void 0:t.id,accountId:null==t?void 0:t.accountId,firstName:d.firstName,lastName:d.lastName}),void h((e=>({...e,errors:{}})));const r={};d.firstName||(r.firstName={message:e.fieldEmptyText}),d.lastName||(r.lastName={message:e.fieldEmptyText}),z(r)||h((t=>({...t,error:e.formErrorText}))),h((e=>({...e,errors:r})))},resetForm:()=>{var e,t,r,s,a,i;const n=(null===(t=null===(e=null==m?void 0:m.data)||void 0===e?void 0:e.viewer)||void 0===t?void 0:t.countryCode)?u.formatDisplayName(m.data.viewer.countryCode,{type:"region"}):"";c({...null===(r=m.data)||void 0===r?void 0:r.viewer,...null===(s=g.data)||void 0===s?void 0:s.upsertUser}),h({...De,...null===(a=m.data)||void 0===a?void 0:a.viewer,...null===(i=g.data)||void 0===i?void 0:i.upsertUser,currentRegion:n})},onChange:e=>{const{name:t,value:r}=e.target;h((e=>({...e,[t]:r})))},setShowEdit:s}}}(N(this));return t(ee,Object.assign({},e))}};Pe.style=".ErrorStyles::part(base){background:var(--sl-color-danger-10);border-color:var(--sl-color-danger-500);outline:var(--sl-color-danger-500)}.ErrorStyles:host{--something-random:red;--focus-ring:0 0 0 var(--sl-focus-ring-width) red !important}.ErrorStyles::part(input){color:var(--sl-color-danger-500)}.ErrorStyles::part(input):-webkit-autofill,.ErrorStyles::part(input):-webkit-autofill:hover,.ErrorStyles::part(input):-webkit-autofill:focus,.ErrorStyles::part(input):-webkit-autofill:active{-webkit-box-shadow:0 0 0 var(--sl-input-height-large) var(--sl-input-background-color-hover) inset !important;box-shadow:0 0 0 var(--sl-input-height-large) var(--sl-input-background-color-hover) inset !important;-webkit-text-fill-color:var(--sl-color-danger-500)}.ErrorStyles::part(help-text){color:var(--sl-color-danger-500)}:host{display:block}:host([hidden]){display:none}.FormWrapper>:not(:first-child){margin-top:54px}.FormSection{width:100%}.FormSection>:not(:first-child){margin-top:16px}.ButtonWrapper{display:-ms-flexbox;display:flex;margin-top:24px;-ms-flex-pack:end;justify-content:flex-end}.ButtonWrapper>:not(:first-child){margin-left:var(--sl-font-size-x-small)}.CardWrapper{-webkit-box-sizing:border-box;box-sizing:border-box;background:var(--sl-color-white);padding:40px 30px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between}@media screen and (max-width: 499px){.CardWrapper{-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}}@media screen and (max-width: 880px){.CardWrapper.ShowEdit{-ms-flex-direction:row;flex-direction:row;-ms-flex-align:end;align-items:flex-end}}";const Fe=class{constructor(t){e(this,t),this.columns=1,this.minHeight=200,this.background="var(--sl-color-gray-50)",this.paddingSize="large",this.wrapDirection="wrap",s(this)}disconnectedCallback(){}render(){const e={states:{...N(this)},content:{primaryColumn:t("slot",null),secondaryColumn:t("slot",{name:"secondary-column"})}};return t(te,Object.assign({},e))}};function Oe(e,r){const s=Boolean((e.header||e.description||e.buttonText)&&"overlay"===e.layout),a=M({Container:{position:"relative","&:before":{content:s?'""':"",width:"100%",height:"100%",position:"absolute",background:e.overlayColor||"var(--sl-color-primary-900)",opacity:e.overlayOpacity}},Image:{display:"block",width:"100%",height:"100%",objectFit:"cover"},Background:{backgroundImage:`url(${e.imageUrl})`,backgroundSize:"cover",backgroundPosition:e.imagePos||"center",display:"flex",justifyContent:"center",alignItems:"center"},Overlay:{zIndex:"1",padding:"calc(var(--sl-spacing-"+e.paddingText+") + var(--sl-spacing-"+e.paddingImage+"))",textAlign:"center",color:e.textColor||"var(--sl-color-neutral-0)",lineHeight:"var(--sl-line-height-dense)","@media (max-width: 599px)":{padding:"var(--sl-spacing-"+e.paddingText+")"}},Column:{display:"flex",background:e.backgroundColor||"",flexDirection:"right"===e.imagePos?"row-reverse":"row",lineHeight:"var(--sl-line-height-dense)",color:e.textColor||"var(--sl-color-neutral-900)","& .image-area":{width:e.imagePercentage?e.imagePercentage+"%":"50%",padding:"var(--sl-spacing-"+e.paddingImage+")",boxSizing:"border-box",display:"flex",justifyContent:"center",alignItems:"center","@media (max-width: 599px)":{width:"100%"}},"& .text-area":{width:e.imagePercentage?100-e.imagePercentage+"%":"50%",padding:"var(--sl-spacing-"+e.paddingText+")",alignSelf:"center",boxSizing:"border-box","@media (max-width: 599px)":{width:"100%",textAlign:"center",padding:"calc(0.5*var(--sl-spacing-"+e.paddingText+"))"}},"@media (max-width: 599px)":{flexDirection:"bottom"===e.imageMobilePos?"column-reverse":"column"}},Header:{fontSize:"var(--sl-font-size-xxx-large)",fontWeight:"var(--sl-font-weight-bold)","@media (max-width: 599px)":{fontSize:"var(--sl-font-size-xx-large)"}},Description:{fontSize:"var(--sl-font-size-x-large)",margin:"var(--sl-spacing-small) 0","@media (max-width: 599px)":{fontSize:"var(--sl-font-size-large)"}},Button:{marginTop:"var(--sl-spacing-medium)","&::part(base)":{padding:"0 var(--sl-spacing-x-large)"},"@media (max-width: 599px)":{width:"100%"}}}),i=a.toString();return t("div",{class:a.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},"\n :host{\n display: block;\n }",i),"overlay"===e.layout&&t("div",{class:a.classes.Background},t("div",{class:a.classes.Overlay,part:"sqm-overlay"},e.header&&t("div",{class:a.classes.Header},e.header),e.description&&t("div",{class:a.classes.Description},e.description),e.buttonText&&t("sl-button",{class:a.classes.Button,type:"primary",onClick:()=>e.buttonNewTab?window.open(e.buttonLink):window.open(e.buttonLink,"_parent")},e.buttonText),r&&r)),"columns"===e.layout&&t("div",null,t("div",{class:a.classes.Column},t("div",{class:"image-area"},t("img",{class:a.classes.Image,src:e.imageUrl,part:"sqm-columns-image"})),t("div",{class:"text-area",part:"sqm-columns-text-area"},e.header&&t("div",{class:a.classes.Header,part:"sqm-columns-header"},e.header),e.description&&t("div",{class:a.classes.Description,part:"sqm-columns-description"},e.description),e.buttonText&&t("sl-button",{exportparts:"base: sqm-hero-image-button",class:a.classes.Button,type:"primary",onClick:()=>e.buttonNewTab?window.open(e.buttonLink):window.open(e.buttonLink,"_parent")},e.buttonText)))))}const Ve=class{constructor(t){e(this,t),this.overlayOpacity="0.75",this.layout="overlay",this.imagePercentage=50,this.imagePos="center",this.imageMobilePos="top",this.buttonNewTab=!1,this.paddingText="xxxx-large",this.paddingImage="none",s(this)}disconnectedCallback(){}render(){return t(Oe,Object.assign({},N(this)),t("slot",null))}},$e=class{constructor(t){e(this,t),this.ignored=!0,s(this)}disconnectedCallback(){}render(){return t(this.hookStory,null)}};function je(e){const r=M({Container:{display:"flex",width:"100%",justifyContent:e.alignment||"center",background:e.backgroundColor||""},Image:{minHeight:e.minHeight||"100%",width:e.width||"100%",maxWidth:"max-content",objectFit:"cover"}}),s=r.toString();return t("div",null,t("style",{type:"text/css"},s,"\n :host{\n display: block; \n }\n "),t("div",{class:r.classes.Container,part:"sqm-base"},t("img",{part:"sqm-image",src:e.imageUrl,class:r.classes.Image})))}const Ue=class{constructor(t){e(this,t),this.alignment="center"}render(){return t(je,Object.assign({},N(this)))}},Be=class{constructor(t){e(this,t),this.ignored=!0,this.fieldType="text",this.errorMessage="Cannot be empty",this.fieldOptional=!1,s(this)}disconnectedCallback(){}render(){const e={...N(this)},r=q([{attribute:"field-name",value:this.fieldName}]);if(!h()&&r)return t(V,{missingProps:r,heading:"An error occured while loading this form",subheading:"A technical problem prevented this input field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"});const{states:s}=h()?T({states:{registrationFormState:{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):{states:{registrationFormState:i(F)}};return t(re,{states:s,content:e})}},He=class{constructor(t){e(this,t),this.ignored=!0,this.dropdownLabel="Select an option",this.requiredFieldErrorMessage="Please select a {dropdownLabel}",this.optionalLabel="(optional)",this.dropdownOptional=!1,this.multiple=!1,s(this)}disconnectedCallback(){}render(){const e=q([{attribute:"dropdown-name",value:this.dropdownName}]);if(!h()&&e)return t(V,{missingProps:e,heading:"An error occured while loading this form",subheading:"A technical problem prevented this drop down field from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"},t("slot",null));const r={...N(this),selectOptions:t("slot",null)},{states:s}=h()?T({states:{leadFormState:{}},content:{dropdownName:(a=this).dropdownName,dropdownLabel:a.dropdownLabel,requiredFieldErrorMessage:a.requiredFieldErrorMessage,dropdownOptional:a.dropdownOptional}},a.demoData||{},{arrayMerge:(e,t)=>t}):{states:{leadFormState:i($)}};var a;return t(se,{states:s,content:r})}},ze=p.gql`
|
|
63
|
-
mutation submitForm($formSubmissionInput: FormSubmissionInput!) {
|
|
64
|
-
submitForm(formSubmissionInput: $formSubmissionInput) {
|
|
65
|
-
success
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
`,We=p.gql`
|
|
69
|
-
query getUser($programId: ID) {
|
|
70
|
-
viewer {
|
|
71
|
-
... on User {
|
|
72
|
-
referralCode(programId: $programId)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
`,Ge=class{constructor(t){e(this,t),this.ignored=!0,this.emailLabel="Email",this.firstNameLabel="First name",this.lastNameLabel="Last name",this.submitLabel="Submit",this.resubmitFormLabel="Refer Another Friend",this.pageLabel="Refer your friend",this.formKey="lead-form",this.supportLinkText="Support",this.submitSuccessHeader="Lead submitted",this.submitSuccessDescription="Our team will contact your friend to see if they’re a good fit. In the meantime, you can track this referral on Activity page.",this.submitErrorHeader="An error occurred while submitting",this.submitErrorDescription="Please try again later. If the problem continues, contact {supportLink}",this.requiredFieldErrorMessage="Please enter a valid {fieldLabel}",this.networkErrorMessage="Network request failed.",this.invalidEmailErrorMessage="Must be a valid email address",s(this)}disconnectedCallback(){}render(){const{states:e,callbacks:r,refs:s}=h()?T({states:{error:"",loading:!1,success:!1},callbacks:{submit:async()=>{console.log("submit")},inputFunction:()=>{},resetForm:()=>{}},refs:{formRef:{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):function(e){var t,r,s,i,l,c,d,u,h,m;const p=o(null),{leadFormState:y,setLeadFormState:w}=j({}),k=g(),E=v(),{data:C}=b(We,{programId:k},!(null==E?void 0:E.jwt)||!k),[I,{loading:S,errors:R}]=f(ze),[T,N]=n(!1);a((()=>{if(!p.current)return;const e=p.current;return e.addEventListener("sl-input",q),()=>{e.removeEventListener("sl-input",q)}}),[p.current]);const q=x((e=>{var t,r;if("tel"!==(null===(r=null===(t=e.target)||void 0===t?void 0:t.type)||void 0===r?void 0:r.toLowerCase()))return;const s=new H("US");e.target.value=s.input(e.target.value)}),[]);let M="";return M=(null===(t=null==R?void 0:R.response)||void 0===t?void 0:t.error)||(null==R?void 0:R.message)&&!(null===(r=null==R?void 0:R.response)||void 0===r?void 0:r.errors.length)?e.networkErrorMessage:(null===(c=null===(l=null===(i=null===(s=null==R?void 0:R.response)||void 0===s?void 0:s.errors)||void 0===i?void 0:i[0])||void 0===l?void 0:l.extensions)||void 0===c?void 0:c.message)||(null===(h=null===(u=null===(d=null==R?void 0:R.response)||void 0===d?void 0:d.errors)||void 0===u?void 0:u[0])||void 0===h?void 0:h.message)||(null==y?void 0:y.error),{states:{loading:S,error:M,success:T,leadFormState:y,referralCode:(null===(m=null==C?void 0:C.viewer)||void 0===m?void 0:m.referralCode)||""},callbacks:{submit:async t=>{var r;let s=t.target.getFormControls(),a={},i={};if(null==s||s.forEach((t=>{if(!t.name)return;const r=t.name,s=t.value;if(_.set(a,r,s),t.required&&!s&&_.set(i,r,e.requiredFieldErrorMessage),"function"==typeof t.validationError){const e=(0,t.validationError)({control:t,key:r,value:s});e&&_.set(i,r,e)}})),Object.keys(i).length)return void w({loading:!1,error:"",validationErrors:i});w({loading:!0,error:"",validationErrors:{}});const n={key:e.formKey,formData:a};try{const e=await I({formSubmissionInput:n});if(e instanceof Error)throw e;w({loading:!1,error:"",validationErrors:{}}),(null===(r=null==e?void 0:e.submitForm)||void 0===r?void 0:r.success)&&N(!0)}catch(t){w({loading:!1,error:e.networkErrorMessage,validationErrors:{}})}},inputFunction:q,resetForm:function(){var e,t;w({loading:!1,error:"",validationErrors:{}}),null===(t=null===(e=p.current)||void 0===e?void 0:e.getFormControls())||void 0===t||t.forEach((e=>{var t;"checkbox"===(null===(t=e.input)||void 0===t?void 0:t.type)?(e.checked=!1,e.value=!1):e.value=""})),N(!1)}},refs:{formRef:p}}}(this),i={formData:t("slot",{name:"formData"}),emailLabel:this.emailLabel,submitLabel:this.submitLabel,resubmitFormLabel:this.resubmitFormLabel,pageLabel:this.pageLabel,supportLinkText:this.supportLinkText,submitSuccessHeader:this.submitSuccessHeader,submitSuccessDescription:this.submitSuccessDescription,submitErrorHeader:this.submitErrorHeader,submitErrorDescription:this.submitErrorDescription,invalidEmailErrorMessage:this.invalidEmailErrorMessage,requiredFieldErrorMessage:this.requiredFieldErrorMessage,firstNameLabel:this.firstNameLabel,lastNameLabel:this.lastNameLabel};return t(ae,{states:e,callbacks:r,content:i,refs:s})}},Ye=p.gql`
|
|
77
|
-
query (
|
|
78
|
-
$type: String!
|
|
79
|
-
$filter: UserLeaderboardFilterInput
|
|
80
|
-
$locale: RSLocale
|
|
81
|
-
$limit: Int!
|
|
82
|
-
) {
|
|
83
|
-
userLeaderboard(type: $type, filter: $filter) {
|
|
84
|
-
dateModified
|
|
85
|
-
rows(limit: $limit) {
|
|
86
|
-
textValue(locale: $locale)
|
|
87
|
-
firstName
|
|
88
|
-
lastInitial
|
|
89
|
-
rank {
|
|
90
|
-
rank
|
|
91
|
-
denseRank
|
|
92
|
-
rowNumber
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
`,Ke=p.gql`
|
|
98
|
-
query (
|
|
99
|
-
$type: String!
|
|
100
|
-
$filter: UserLeaderboardFilterInput
|
|
101
|
-
$locale: RSLocale
|
|
102
|
-
$limit: Int!
|
|
103
|
-
) {
|
|
104
|
-
userLeaderboard(type: $type, filter: $filter) {
|
|
105
|
-
dateModified
|
|
106
|
-
rows(limit: $limit) {
|
|
107
|
-
textValue(locale: $locale)
|
|
108
|
-
rank {
|
|
109
|
-
rank
|
|
110
|
-
denseRank
|
|
111
|
-
rowNumber
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
`,Ze=p.gql`
|
|
117
|
-
query (
|
|
118
|
-
$type: String!
|
|
119
|
-
$filter: UserLeaderboardFilterInput
|
|
120
|
-
$locale: RSLocale
|
|
121
|
-
) {
|
|
122
|
-
viewer {
|
|
123
|
-
... on User {
|
|
124
|
-
firstName
|
|
125
|
-
lastInitial
|
|
126
|
-
leaderboardRank(type: $type, filter: $filter) {
|
|
127
|
-
textValue(locale: $locale)
|
|
128
|
-
rank
|
|
129
|
-
denseRank
|
|
130
|
-
rowNumber
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
`,Qe=p.gql`
|
|
136
|
-
query (
|
|
137
|
-
$type: String!
|
|
138
|
-
$filter: UserLeaderboardFilterInput
|
|
139
|
-
$locale: RSLocale
|
|
140
|
-
) {
|
|
141
|
-
viewer {
|
|
142
|
-
... on User {
|
|
143
|
-
leaderboardRank(type: $type, filter: $filter) {
|
|
144
|
-
textValue(locale: $locale)
|
|
145
|
-
rank
|
|
146
|
-
denseRank
|
|
147
|
-
rowNumber
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
`,Xe=class{constructor(t){e(this,t),this.width="100%",this.hideViewer=!1,this.viewingUserText="You",this.hideNames=!1,this.anonymousUser="Anonymous User",this.maxRows=10,this.ignored=!0,s(this),ie(this)}disconnectedCallback(){}render(){const e={empty:t(Je,null),usersheading:this.usersheading,statsheading:this.statsheading,rankheading:this.rankheading,rankType:this.rankType,leaderboardType:this.leaderboardType,maxRows:this.maxRows,programId:this.programId,anonymousUser:this.anonymousUser,interval:this.interval,hideViewer:this.hideViewer,viewingUserText:this.viewingUserText,hideNames:this.hideNames,showRank:this.showRank,rankSuffix:this.rankSuffix,width:this.width},r={...e,demoData:this.demoData},s=h()?function(e){var r,s;const a=(null===(s=null===(r=e.demoData)||void 0===r?void 0:r.data)||void 0===s?void 0:s.leaderboard)||[{firstName:"Viktor",lastInitial:"V",textValue:"82",rank:1,rowNumber:1},{firstName:"MF",lastInitial:"D",textValue:"73",rank:2,rowNumber:2},{firstName:"Freddie",lastInitial:"G",textValue:"64",rank:3,rowNumber:3},{firstName:"Benny",lastInitial:"B",textValue:"55",rank:4,rowNumber:4},{textValue:"46",rank:5,rowNumber:5}];return T({states:{loading:!1,hasLeaders:!0,isEssentials:!1,styles:{usersheading:e.usersheading?e.usersheading:"Top referrers",statsheading:e.statsheading?e.statsheading:"New customers",rankheading:e.rankheading?e.rankheading:"Rank",anonymousUser:e.anonymousUser?e.anonymousUser:"Anonymous User",showRank:e.showRank,hideViewer:e.hideViewer,viewingUserText:e.viewingUserText,hideNames:e.hideNames,rankSuffix:e.rankSuffix,width:e.width}},data:{rankType:"rowNumber",leaderboard:a},elements:{empty:t(Je,null)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(r):function(e){var t,r,s,a,i,n,o,c,d,u;const h=g(),m=null!==(t=e.programId)&&void 0!==t?t:h,p=v(),f=w(),y=m?{type:e.leaderboardType,filter:{programId_eq:m}}:{type:e.leaderboardType,filter:{}};e.interval&&(y.filter.interval=e.interval),f&&(y.locale=f),e.maxRows>0&&(y.limit=e.maxRows);const{data:x,loading:k,errors:E}=b(e.hideNames?Ke:Ye,y,!(null==p?void 0:p.jwt),{batch:!1}),{data:C}=b(e.hideNames?Qe:Ze,y,!(null==p?void 0:p.jwt)),I=null==(_=null===(r=null==x?void 0:x.userLeaderboard)||void 0===r?void 0:r.rows)?void 0:_.flatMap((t=>{var r,s;return{textValue:t.textValue,firstName:t.firstName,lastInitial:t.lastInitial,rank:null===(r=t.rank)||void 0===r?void 0:r[e.rankType],rowNumber:null===(s=t.rank)||void 0===s?void 0:s.rowNumber}})),S=null==I?void 0:I.sort((function(e,t){return e.rank-t.rank})),R={textValue:null===(a=null===(s=null==C?void 0:C.viewer)||void 0===s?void 0:s.leaderboardRank)||void 0===a?void 0:a.textValue,firstName:null===(i=null==C?void 0:C.viewer)||void 0===i?void 0:i.firstName,lastInitial:null===(n=null==C?void 0:C.viewer)||void 0===n?void 0:n.lastInitial,rank:null===(c=null===(o=null==C?void 0:C.viewer)||void 0===o?void 0:o.leaderboardRank)||void 0===c?void 0:c[e.rankType],rowNumber:null===(u=null===(d=null==C?void 0:C.viewer)||void 0===d?void 0:d.leaderboardRank)||void 0===u?void 0:u.rowNumber};var _;return{states:{loading:k,isEssentials:l((()=>{var e,t;return!!(null===(t=null===(e=null==E?void 0:E.response)||void 0===e?void 0:e.errors)||void 0===t?void 0:t.find((e=>{var t,r;return 403===(null===(r=null===(t=null==e?void 0:e.extensions)||void 0===t?void 0:t.apiError)||void 0===r?void 0:r.statusCode)})))}),[E]),hasLeaders:(null==S?void 0:S.length)>0,styles:e},data:{leaderboard:S,rankType:e.rankType,viewerRank:R},elements:{empty:e.empty}}}(e);return t(ne,Object.assign({},s))}};function Je(){return t("slot",{name:"empty"},t("sqm-empty",{"empty-state-image":"https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_leaderboard2.png","empty-state-header":"View your rank in the leaderboard","empty-state-text":"Be the first to refer a friend and reach the top of the leaderboard"}))}const et=M({Container:{display:"contents"},Link:{textDecoration:"none",color:"inherit"}}),tt=et.toString();function rt(e){const{onClick:r,buttonText:s}=e;return t("span",{class:et.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},tt,"\n:host{\n display: inline; \n}\n"),t("sl-button",{onClick:r,type:"primary",exportparts:"base: primarybutton-base"},t("a",{class:et.classes.Link,part:"sqm-link"},s)))}const st=class{constructor(t){e(this,t),this.openInNewTab=!1,this.buttonText="Click here"}render(){return t(rt,Object.assign({},{...N(this),onClick:()=>{window.open(this.link,this.openInNewTab?"_blank":"_parent")}}))}},at=class{constructor(t){e(this,t),this.ignored=!0,this.checkboxLabel="I would like to receive marketing and promotional emails for this referral program",this.checkboxName="marketingEmailOptIn",s(this)}disconnectedCallback(){}render(){const e={...N(this)},{states:r,callbacks:s}=h()?T({states:{registrationFormState:{},checked:!1},callbacks:{setChecked:()=>{}}},this.demoData||{},{arrayMerge:(e,t)=>t}):Ie(this);return t(Q,{states:r,content:e,callbacks:s})}},it=class{constructor(t){e(this,t),this.ignored=!0,this.firstNameLabel="First Name",this.lastNameLabel="Last Name",s(this)}disconnectedCallback(){}render(){const{states:e}=h()?T({states:{validationErrors:[],content:{firstNameLabel:this.firstNameLabel,lastNameLabel:this.lastNameLabel}}},this.demoData||{},{arrayMerge:(e,t)=>t}):function(e){return{states:{registrationFormState:i(F),content:{lastNameLabel:e.lastNameLabel,firstNameLabel:e.firstNameLabel}}}}(this);return t(oe,{states:e})}};function nt(e){const{states:r}=e,{styles:s}=r;return r.includeDropdown?t("sl-dropdown",{style:"margin-bottom: var(--sl-spacing-large)"},t("sl-button",{slot:"trigger",caret:!0,onClick:e.callbacks.rerender,exportparts:"base: dropdownbutton-base"},s.menuLabel),t("sl-menu",{ref:t=>{void 0===e.ref.current&&(e.ref.current=t,e.callbacks.rerender())}},t("slot",null))):""}const ot=class{constructor(t){e(this,t),this.ignored=!0,s(this)}disconnectedCallback(){}render(){const e=h()?function(e){return T({states:{includeDropdown:!0,styles:{...e,menuLabel:"Menu"}},callbacks:{rerender:()=>{}},ref:{current:void 0}},e.demoData||{},{arrayMerge:(e,t)=>t})}(N(this)):function(e){const t=o(),[,r]=k(),s=v();return a((()=>{var e;null===(e=t.current)||void 0===e||e.addEventListener("sl-select",(e=>function(e){E.push(e.detail.item.value)}(e)))}),[t.current]),{states:{includeDropdown:void 0!==((null==s?void 0:s.id)||(null==s?void 0:s.accountId)||(null==s?void 0:s.jwt)),styles:{menuLabel:e.menuLabel}},callbacks:{rerender:r},ref:t}}(N(this));return t(r,{slot:"sqm-navigation-menu"},t(nt,Object.assign({},e)))}};ot.style=":host{display:block}:host([hidden]){display:none}.HeaderWrapper{width:100%;max-width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:var(--sl-spacing-small) var(--sl-spacing-large);-ms-flex-align:center;align-items:center;background-color:var(--sqm-header-background)}@media screen and (max-width: 499px){.HeaderWrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse;-ms-flex-pack:end;justify-content:flex-end;padding:0 var(--sl-spacing-x-small)}}";const lt=M({Wrapper:{maxWidth:"200px",marginLeft:"auto"},PayoutButtonDescription:{color:"var(--sl-color-neutral-500)",fontSize:"var(--sl-font-size-small)",margin:"0"}}),ct=lt.toString();function dt(e){const{text:r,states:s}=e;return s.payoutSettingsComplete?t("div",{class:lt.classes.Wrapper},t("style",{type:"text/css"},ct),t("sqm-scroll",{"scroll-tag-name":"sqm-tabs","button-text":r.payoutButtonText,"scroll-animation":"smooth"}),t("p",{class:lt.classes.PayoutButtonDescription},r.payoutButtonDescription)):t("div",null)}const ut=p.gql`
|
|
153
|
-
query getPayoutDetails {
|
|
154
|
-
user: viewer {
|
|
155
|
-
... on User {
|
|
156
|
-
id
|
|
157
|
-
impactConnection {
|
|
158
|
-
connected
|
|
159
|
-
publisher {
|
|
160
|
-
id
|
|
161
|
-
payoutsAccount {
|
|
162
|
-
hold
|
|
163
|
-
balance
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
`,ht=class{constructor(t){e(this,t),this.payoutButtonText="Payouts & Tax Settings",this.payoutButtonDescription="Check your payout settings to see when you’ll get paid out next",this.ignored=!0,s(this)}disconnectedCallback(){}getTextProps(){return N(this)}render(){const e=h()?function(e){return T({states:{payoutSettingsComplete:!1},text:e.getTextProps()},e.demoData||{},{arrayMerge:(e,t)=>t})}(this):function(e){var t,r,s;const{data:i,refetch:n}=b(ut,{});return a((()=>{const e=()=>n();return window.addEventListener("sqm:tax-form-updated",e),()=>window.removeEventListener("sqm:tax-form-updated",e)}),[]),{states:{payoutSettingsComplete:!!(null===(s=null===(r=null===(t=null==i?void 0:i.user)||void 0===t?void 0:t.impactConnection)||void 0===r?void 0:r.publisher)||void 0===s?void 0:s.payoutsAccount)},text:e.getTextProps()}}(this);return t(dt,Object.assign({},e))}},mt=M({SkeletonOne:{width:"50%",height:"16px"},AlertDescriptionText:{margin:"0",marginBottom:"var(--sl-spacing-small)"},ErrorAlertContainer:{"&::part(base)":{backgroundColor:"var(--sl-color-red-100)",borderTop:"none"},"& sl-icon::part(base)":{color:"var(--sl-color-danger-500)"}},WarningAlertContainer:{"&::part(base)":{backgroundColor:"var(--sl-color-yellow-100)",borderTop:"none"},"& sl-icon::part(base)":{color:"var(--sl-color-danger-500)"}},InfoAlertContainer:{"&::part(base)":{backgroundColor:"var(--sl-color-sky-100)",borderTop:"none"},"& sl-icon::part(base)":{color:"var(--sl-color-blue-500)"}},Dialog:{"&::part(panel)":{height:"600px"},"&::part(close-button)":{marginBottom:"var(--sl-spacing-xx-large)"},"&::part(title)":{display:"none"},"&::part(header)":{},"&::part(body)":{padding:"0"},"&::part(footer)":{}}}),pt=mt.toString();function vt(e){const{text:r,states:s,data:a,callbacks:i}=e;if(s.loading)return t("sl-skeleton",{class:mt.classes.SkeletonOne});const n=function(e){if(s.error)return{header:r.errorHeader,description:r.errorDescription,buttonText:null,alertType:"critical",icon:"exclamation-triangle",class:mt.classes.ErrorAlertContainer};switch(e){case"INFORMATION_REQUIRED":return{header:r.informationRequiredHeader,description:r.informationRequiredDescription,buttonText:r.informationRequiredButtonText,alertType:"info",icon:"info-circle",class:mt.classes.InfoAlertContainer};case"VERIFICATION:REQUIRED":return{header:r.verificationRequiredHeader,description:u.formatMessage({id:"verificationRequiredDescription",defaultMessage:r.verificationRequiredDescription},{supportLink:t("a",{target:"_blank",href:"mailto:advocate-support@impact.com"},r.supportLink)}),buttonText:r.verificationRequiredButtonText,alertType:"warning",icon:"exclamation-triangle",class:mt.classes.WarningAlertContainer};case"VERIFICATION:INTERNAL":return{header:r.verificationRequiredInternalHeader,description:u.formatMessage({id:"verificationRequiredInternalDescription",defaultMessage:r.verificationRequiredInternalDescription},{supportLink:t("a",{target:"_blank",href:"mailto:advocate-support@impact.com"},r.supportLink)}),alertType:"warning",icon:"exclamation-triangle",class:mt.classes.WarningAlertContainer};case"VERIFICATION:REVIEW":return{header:r.verificationReviewInternalHeader,description:u.formatMessage({id:"verificationReviewInternalDescription",defaultMessage:r.verificationReviewInternalDescription},{supportLink:t("a",{target:"_blank",href:"mailto:advocate-support@impact.com"},r.supportLink)}),alertType:"warning",icon:"exclamation-triangle",class:mt.classes.WarningAlertContainer};case"VERIFICATION:FAILED":return{header:r.verificationFailedInternalHeader,description:u.formatMessage({id:"verificationFailedInternalDescription",defaultMessage:r.verificationFailedInternalDescription},{supportLink:t("a",{target:"_blank",href:"mailto:advocate-support@impact.com"},r.supportLink)}),alertType:"critical",icon:"exclamation-octagon",class:mt.classes.ErrorAlertContainer};case"OVER_W9_THRESHOLD":return"CASH_ONLY_DEFER_W9"===s.enforceUsTaxComplianceOption?{header:r.w9RequiredHeader,description:u.formatMessage({id:"w9RequiredDescription",defaultMessage:r.w9RequiredDescription},{termsAndConditions:t("a",{target:"_blank",href:"https://terms.advocate.impact.com/PayoutTermsAndConditions.html"},r.termsAndConditions)}),buttonText:r.w9RequiredButtonText,alertType:"warning",icon:"exclamation-triangle",class:mt.classes.WarningAlertContainer}:{header:r.holdHeader,description:u.formatMessage({id:"holdDescription",defaultMessage:r.holdDescription},{supportLink:t("a",{target:"_blank",href:"mailto:advocate-support@impact.com"},r.supportLink)}),buttonText:null,alertType:"warning",icon:"exclamation-triangle",class:mt.classes.WarningAlertContainer};case"ACCOUNT_REVIEW":return{header:r.accountReviewHeader,description:u.formatMessage({id:"accountReviewDescription",defaultMessage:r.accountReviewDescription},{supportLink:t("a",{target:"_blank",href:"mailto:advocate-support@impact.com"},r.supportLink)}),buttonText:null,alertType:"warning",icon:"exclamation-triangle",class:mt.classes.WarningAlertContainer};case"HOLD":return{header:r.holdHeader,description:u.formatMessage({id:"holdDescription",defaultMessage:r.holdDescription},{supportLink:t("a",{target:"_blank",href:"mailto:advocate-support@impact.com"},r.supportLink)}),buttonText:null,alertType:"warning",icon:"exclamation-triangle",class:mt.classes.WarningAlertContainer};default:return}}(s.status);return"DONE"!==s.status&&n?t("div",{part:"sqm-base"},t("style",{type:"text/css"},pt),t("sl-alert",{exportparts:"base: alert-base, icon:alert-icon",type:n.alertType,class:n.class,open:!0},t("sl-icon",{slot:"icon",name:n.icon}),t("strong",null,n.header),t("p",{class:mt.classes.AlertDescriptionText},n.description),function(e){switch(e){case"OVER_W9_THRESHOLD":if("CASH_ONLY"===s.enforceUsTaxComplianceOption)return;return"SquatchJS2"===a.type?t("sqm-scroll",{"scroll-tag-name":"sqm-tabs","button-text":r.w9RequiredButtonText,"scroll-animation":"smooth"}):t("sl-button","SquatchPortal"===a.type?{type:"default",onClick:i.onTermsClick}:{type:"default"},r.w9RequiredButtonText);case"INFORMATION_REQUIRED":return"SquatchJS2"===a.type?t("sqm-scroll",{"scroll-tag-name":"sqm-tabs","button-text":r.informationRequiredButtonText,"scroll-animation":"smooth"}):t("sl-button","SquatchPortal"===a.type?{type:"default",onClick:i.onTermsClick}:{type:"default"},r.informationRequiredButtonText);case"VERIFICATION:REQUIRED":return t("sl-button",{type:"default",loading:s.veriffLoading,onClick:i.onClick},r.verificationRequiredButtonText);default:return}}(s.status))):t("div",null)}const gt=class{constructor(t){e(this,t),this.informationRequiredHeader="Payout and tax information required",this.informationRequiredDescription="Submit your banking details and tax documents to receive your rewards.",this.informationRequiredButtonText="Payouts & Tax Settings",this.verificationRequiredHeader="Verify your identity",this.verificationRequiredDescription="It should only take a few minutes verify. If you run in to an issue verifying your identity contact our {supportLink}.",this.verificationRequiredButtonText="Start Verification",this.verificationRequiredInternalHeader="Identity Verification in Progress",this.verificationRequiredInternalDescription="Identity verification submission has been received. Our system is currently performing additional checks and analyzing the results. You will be updated shortly. If you don't hear from us contact our {supportLink}.",this.verificationReviewInternalHeader="Identity Verification Under Review",this.verificationReviewInternalDescription="Identity verification requires further review due to a potential error. Our team is reviewing the information and will update you shortly. If you don't hear from us contact our {supportLink}.",this.verificationFailedInternalHeader="Identity Verification Unsuccessful",this.verificationFailedInternalDescription="Identity verification has failed. Our team is reviewing the report and will contact you with further information. If you don't hear from us contact our {supportLink}.",this.accountReviewHeader="Your account is under review",this.accountReviewDescription="This process takes 48 hours, payouts are on hold until it's completed. You will receive an email from our referral provider, Impact.com, if any issues arise. It contains details on how to resolve this issue. If you need further assistance, please reach out to our {supportLink}.",this.w9RequiredHeader="Your next payout is on hold",this.w9RequiredDescription="You have surpassed the $600 threshold for a W9 tax form. To remove the hold, you need to submit a W9 tax form as outlined in our {termsAndConditions}. Please click 'Submit W9' to start the process.",this.w9RequiredButtonText="Submit W9",this.holdHeader="Your payouts and account are on hold",this.holdDescription="Please check your inbox for an email from our referral provider, impact.com. It contains details on how to resolve this issue. If you need further assistance, feel free to reach out to our {supportLink}.",this.cashPayoutsPageUrl="/taxAndCash",this.supportLink="support team",this.termsAndConditions="Terms and Conditions",this.errorHeader="Could not determine payout status.",this.errorDescription="There was an error with determining your payout status.",s(this)}disconnectedCallback(){}getTextProps(){return N(this)}render(){const e=h()?function(e){return T({states:{error:!1,status:"INFORMATION_REQUIRED",loading:!1,showVerifyIdentity:!1},data:{type:"SquatchAdmin"},text:e.getTextProps(),callbacks:{onTermsClick:()=>{},onClick:()=>console.log("show")}},e.demoData||{},{arrayMerge:(e,t)=>t})}(this):we(this);return t(vt,Object.assign({},e))}},ft=p.gql`
|
|
171
|
-
query {
|
|
172
|
-
viewer {
|
|
173
|
-
... on User {
|
|
174
|
-
id
|
|
175
|
-
accountId
|
|
176
|
-
marketingEmailOptIn
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
`,bt=p.gql`
|
|
181
|
-
mutation ($userInput: UserInput!) {
|
|
182
|
-
upsertUser(userInput: $userInput) {
|
|
183
|
-
id
|
|
184
|
-
marketingEmailOptIn
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
`,yt={marketingEmailOptIn:!1,errors:{},error:""},xt=class{constructor(t){e(this,t),this.ignored=!0,this.emailPreferencesHeader="Email preferences",this.marketingCheckboxLabel="I want to receive marketing emails and promotions for this referral program from impact.com",this.submitChangeButtonText="Save",this.networkRequestMessage="An error occurred while loading this page. Please refresh the page.",this.successMessage="Opt-in preference has been changed.",s(this)}disconnectedCallback(){}render(){const e=h()?function(e){return T({states:{success:!1,loading:!1,submitDisabled:!1,user:{id:"01",accountId:"111100000",marketingEmailOptIn:!1},text:{emailPreferencesHeader:e.emailPreferencesHeader,marketingCheckboxLabel:e.marketingCheckboxLabel,submitChangeButtonText:e.submitChangeButtonText,successMessage:e.successMessage},formState:{marketingEmailOptIn:!1,errors:null,error:""}},callbacks:{onSubmit:e=>console.log(e),setChecked:()=>{}}},e.demoData||{},{arrayMerge:(e,t)=>t})}(N(this)):function(e){const t=v(),[r,s]=n(!1),[i,o]=n(void 0),[l,c]=n(yt),d=b(ft,{},!(null==t?void 0:t.jwt)),[u,h]=f(bt);return a((()=>{(null==h?void 0:h.loading)||((null==h?void 0:h.errors)?c((e=>{var t,r,s;return{...e,error:null===(s=null===(r=null===(t=null==h?void 0:h.errors)||void 0===t?void 0:t.response)||void 0===r?void 0:r.errors)||void 0===s?void 0:s[0].message}})):(o((e=>{var t;return{...e,...null===(t=null==h?void 0:h.data)||void 0===t?void 0:t.upsertUser}})),(null==h?void 0:h.data)&&s(!0)))}),[null==h?void 0:h.loading]),a((()=>{var e,t;o((e=>{var t;return{...e,...null===(t=null==d?void 0:d.data)||void 0===t?void 0:t.viewer}})),c({...yt,...null===(e=d.data)||void 0===e?void 0:e.viewer,...null===(t=h.data)||void 0===t?void 0:t.upsertUser})}),[null==d?void 0:d.data]),a((()=>{var t,r;(null===(t=null==h?void 0:h.errors)||void 0===t?void 0:t.message)&&c({...null===(r=d.data)||void 0===r?void 0:r.viewer,error:e.networkRequestMessage})}),[null==h?void 0:h.errors]),{states:{success:r,loading:(null==d?void 0:d.loading)||h.loading,submitDisabled:!1,formState:l,user:i,text:{emailPreferencesHeader:e.emailPreferencesHeader,marketingCheckboxLabel:e.marketingCheckboxLabel,submitChangeButtonText:e.submitChangeButtonText,successMessage:e.successMessage}},callbacks:{onSubmit:e=>{var r;s(!1);const a=null===(r=e.detail)||void 0===r?void 0:r.formData;null==a||a.forEach(((e,t)=>{_.set(a,t,e)})),u({userInput:{id:null==t?void 0:t.id,accountId:null==t?void 0:t.accountId,marketingEmailOptIn:Boolean(a.marketingEmailOptIn)}}),c((e=>({...e,errors:{},error:""})))},setChecked:e=>c({...l,marketingEmailOptIn:e})}}}(N(this));return t(le,Object.assign({},e))}},wt=class{constructor(t){e(this,t),this.ignored=!0,this.modalChangePasswordHeader="Change Password",this.cancelText="Cancel",this.changePasswordButtonText="Change Password",this.passwordFieldLabel="New Password",this.confirmPasswordFieldLabel="Confirm New Password",this.successMessage="Your password has been updated.",this.portalChangePasswordHeader="Password",this.portalChangePasswordButtonText="Change your password...",this.meetsRequirementsText="Password has met all requirements",this.doesNotMeetRequirementsText="Password must meet the following requirements:",this.minErrorText="be a minimum of 8 characters",this.uppercaseErrorText="contain at least 1 uppercase character",this.lowercaseErrorText="contain at least 1 lowercase character",this.nonMatchingPasswordErrorText="contain at least 1 lowercase character",this.invalidSessionErrorText="Please log in again to change your password.",this.hasErrorText="contain at least 1 number or symbol",s(this)}disconnectedCallback(){}render(){const{states:e,callbacks:r}=h()?function(e){const[t,r]=n(!1);return T({states:{open:t,error:"",content:{modalChangePasswordHeader:e.modalChangePasswordHeader,cancelText:e.cancelText,changePasswordButtonText:e.changePasswordButtonText,passwordFieldLabel:e.passwordFieldLabel,confirmPasswordFieldLabel:e.confirmPasswordFieldLabel,successMessage:e.successMessage,portalChangePasswordHeader:e.portalChangePasswordHeader,portalChangePasswordButtonText:e.portalChangePasswordButtonText,meetsRequirementsText:e.meetsRequirementsText,doesNotMeetRequirementsText:e.doesNotMeetRequirementsText,minErrorText:e.minErrorText,uppercaseErrorText:e.uppercaseErrorText,lowercaseErrorText:e.lowercaseErrorText,hasErrorText:e.hasErrorText}},callbacks:{setOpen:e=>r(e),submit:e=>console.log("Submit",e)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(this):function(e){var t,r,s,a,i,o,l;const[c,{loading:d,errors:u}]=C(),[h,m]=n(!1),[p,g]=n(""),[f,b]=n(!1),y=v();return{states:{open:h,loading:d,success:f,error:p||(null===(a=null===(s=null===(r=null===(t=null==u?void 0:u.response)||void 0===t?void 0:t.errors)||void 0===r?void 0:r[0])||void 0===s?void 0:s.extensions)||void 0===a?void 0:a.message)||(null===(l=null===(o=null===(i=null==u?void 0:u.response)||void 0===i?void 0:i.errors)||void 0===o?void 0:o[0])||void 0===l?void 0:l.message),content:{modalChangePasswordHeader:e.modalChangePasswordHeader,cancelText:e.cancelText,changePasswordButtonText:e.changePasswordButtonText,passwordFieldLabel:e.passwordFieldLabel,confirmPasswordFieldLabel:e.confirmPasswordFieldLabel,successMessage:e.successMessage,portalChangePasswordHeader:e.portalChangePasswordHeader,portalChangePasswordButtonText:e.portalChangePasswordButtonText,meetsRequirementsText:e.meetsRequirementsText,doesNotMeetRequirementsText:e.doesNotMeetRequirementsText,minErrorText:e.minErrorText,uppercaseErrorText:e.uppercaseErrorText,lowercaseErrorText:e.lowercaseErrorText,hasErrorText:e.hasErrorText}},data:{},callbacks:{setOpen:m,submit:async t=>{var r,s;b(!1);const a=null===(r=t.detail)||void 0===r?void 0:r.formData;if(null==a||a.forEach(((e,t)=>{_.set(a,t,e)})),!(null==y?void 0:y.jwt))return void g(e.invalidSessionErrorText);if(a.password!==a.confirmPassword)return void g(e.nonMatchingPasswordErrorText);g("");const i={password:a.password},n=await c(i);n instanceof Error||!(null===(s=n.changeManagedIdentityPassword)||void 0===s?void 0:s.success)||b(!0)}}}}(this);return t(ce,{states:e,callbacks:r})}},kt=class{constructor(t){e(this,t),this.ignored=!0,this.hideSupportText=!1,this.supportEmail="support@example.com",this.supportText="For program support, contact {email}",this.hidePoweredBy=!1,this.poweredByLink="https://impact.com/advocate/",this.paddingTop="large",this.paddingRight="large",this.paddingBottom="large",this.paddingLeft="large",s(this)}disconnectedCallback(){}render(){return t(de,Object.assign({},N(this)))}static get assetsDirs(){return["../../assets"]}},Et=class{constructor(t){e(this,t),this.ignored=!0,this.notFullScreen=!1,s(this)}disconnectedCallback(){}render(){const e=t("slot",{name:"footer"}),r=t("slot",{name:"header"}),s=h()?function(e,r,s){return T({notFullScreen:!0,data:{footer:e||t("span",null,"example@example.com"),header:r||t("div",{style:{display:"flex",flexDirection:"column"}},t("span",{style:{fontSize:"var(--sl-font-size-large)",fontWeight:"bold"}},"Portal Header"),t("span",{style:{fontSize:"var(--sl-font-size-small)"}},"A description for the portal"))},callbacks:{rerender:()=>{}}},s.demoData||{},{arrayMerge:(e,t)=>t})}(e,r,this):function(e,t){const[,r]=k();return{data:{footer:e,header:t},callbacks:{rerender:r}}}(e,r);return t(ue,Object.assign({},s),t("slot",null))}},Ct=class{constructor(t){e(this,t),this.ignored=!0,this.nextPage="/",this.emailLabel="Email",this.passwordLabel="Password",this.submitLabel="Sign In",this.forgotPasswordPath="/forgotPassword",this.forgotPasswordLabel="Forgot Password?",this.registerLabel="Register",this.registerPath="/register",this.pageLabel="Sign in to your account",this.networkErrorMessage="An error occurred while logging you in. Please refresh the page and try again.",this.registerCTA="Don't have an account?",s(this)}disconnectedCallback(){}render(){const{states:e,callbacks:r}=h()?T({states:{error:"",loading:!1,forgotPasswordPath:"/forgotPassword",registerPath:"/register",showLoginForm:"manual"},callbacks:{googleSubmit:async()=>{console.log("google submit")},submit:async()=>{console.log("submit")}},content:{googleButton:null}},this.demoData||{},{arrayMerge:(e,t)=>t}):B(this),s=M({RegisterButton:{"&::part(label)":{padding:"0"}}}).toString(),a={forgotPasswordButton:t("slot",{name:"forgotPassword"},t("a",{onClick:()=>E.push(e.forgotPasswordPath)},this.forgotPasswordLabel)),googleButton:null,secondaryButton:t("slot",{name:"secondaryButton"},t("style",null,s),t("sl-button",{type:"text",disabled:e.loading,onClick:()=>E.push(e.registerPath)},this.registerLabel)),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel};return t(U,{states:e,callbacks:r,content:a})}},It=class{constructor(t){e(this,t),this.ignored=!0,this.nextPage="/",this.redirectPath="/verifyEmail",this.emailLabel="Email",this.passwordLabel="Password",this.submitLabel="Register",this.loginLabel="Sign in",this.confirmPasswordLabel="Confirm Password",this.confirmPassword=!1,this.disablePasswordValidation=!1,this.hideInputs=!1,this.pageLabel="Register",this.loginPath="/login",this.requiredFieldErrorMessage="Cannot be empty",this.networkErrorMessage="Network request failed.",this.passwordMismatchErrorMessage="Passwords do not match.",this.invalidEmailErrorMessage="Must be a valid email address",this.meetsRequirementsText="Password has met all requirements",this.doesNotMeetRequirementsText="Password must meet the following requirements:",this.minErrorText="be a minimum of 8 characters",this.uppercaseErrorText="contain at least 1 uppercase character",this.lowercaseErrorText="contain at least 1 lowercase character",this.hasErrorText="contain at least 1 number or symbol",s(this)}disconnectedCallback(){}render(){const{states:e,callbacks:r,refs:s}=h()?T({states:{error:"",loading:!1,confirmPassword:(i=this).confirmPassword,hideInputs:i.hideInputs||!1,customPasswordField:!1,loginPath:i.loginPath,disablePasswordValidation:i.disablePasswordValidation},callbacks:{submit:async()=>{console.log("submit")},inputFunction:()=>{}},refs:{formRef:{}}},i.demoData||{},{arrayMerge:(e,t)=>t}):function(e){var t,r,s,i,n,l,c,d,u;const h=o(null),{registrationFormState:m,setRegistrationFormState:p}=O({}),[v,{loading:g,errors:f}]=I();a((()=>{if(!h.current)return;const e=h.current;return e.addEventListener("sl-input",b),()=>{e.removeEventListener("sl-input",b)}}),[h.current]);const b=x((e=>{var t,r;if("tel"!==(null===(r=null===(t=e.target)||void 0===t?void 0:t.type)||void 0===r?void 0:r.toLowerCase()))return;const s=new H("US");e.target.value=s.input(e.target.value)}),[]);let y="";return y=(null===(t=null==f?void 0:f.response)||void 0===t?void 0:t.error)||(null==f?void 0:f.message)&&!(null===(r=null==f?void 0:f.response)||void 0===r?void 0:r.errors.length)?e.networkErrorMessage:(null===(l=null===(n=null===(i=null===(s=null==f?void 0:f.response)||void 0===s?void 0:s.errors)||void 0===i?void 0:i[0])||void 0===n?void 0:n.extensions)||void 0===l?void 0:l.message)||(null===(u=null===(d=null===(c=null==f?void 0:f.response)||void 0===c?void 0:c.errors)||void 0===d?void 0:d[0])||void 0===u?void 0:u.message)||(null==m?void 0:m.error),{states:{loading:g,error:y,registrationFormState:m,confirmPassword:e.confirmPassword,hideInputs:e.hideInputs,loginPath:e.loginPath,disablePasswordValidation:e.disablePasswordValidation},callbacks:{submit:async t=>{var r;let s=t.target.getFormControls(),a={},i={};if(null==s||s.forEach((t=>{if(!t.name)return;const r=t.name,s=t.value;if(_.set(a,r,s),t.required&&!s&&_.set(i,r,e.requiredFieldErrorMessage),"function"==typeof t.validationError){const e=(0,t.validationError)({control:t,key:r,value:s});e&&_.set(i,r,e)}})),(e.confirmPassword||a.confirmPassword)&&a.password!==a.confirmPassword&&(i={...i,confirmPassword:e.passwordMismatchErrorMessage}),Object.keys(i).length)return void p({loading:!1,error:"",validationErrors:i});p({loading:!0,error:"",validationErrors:{}});const{email:n,password:o}=a;delete a.email,delete a.password,delete a.confirmPassword,a={...a};const l={email:n,password:o,formData:a,redirectPath:e.redirectPath};try{const t=await v(l);if(t instanceof Error)throw t;p({loading:!1,error:"",validationErrors:{}}),(null===(r=t.registerManagedIdentityWithEmailAndPassword)||void 0===r?void 0:r.token)&&E.push(e.nextPage)}catch(t){p({loading:!1,error:e.networkErrorMessage,validationErrors:{}})}},inputFunction:b},refs:{formRef:h}}}(this);var i;const n={formData:t("slot",{name:"formData"}),secondaryButton:t("slot",{name:"secondaryButton"},t("sl-button",{type:"text",disabled:e.loading,onClick:()=>E.push(e.loginPath)},this.loginLabel)),terms:t("slot",{name:"terms"}),emailLabel:this.emailLabel,passwordLabel:this.passwordLabel,submitLabel:this.submitLabel,pageLabel:this.pageLabel,confirmPasswordLabel:this.confirmPasswordLabel,invalidEmailErrorMessage:this.invalidEmailErrorMessage,requiredFieldErrorMessage:this.requiredFieldErrorMessage,meetsRequirementsText:this.meetsRequirementsText,doesNotMeetRequirementsText:this.doesNotMeetRequirementsText,minErrorText:this.minErrorText,uppercaseErrorText:this.uppercaseErrorText,lowercaseErrorText:this.lowercaseErrorText,hasErrorText:this.hasErrorText};return t(he,{states:e,callbacks:r,content:n,refs:s})}};function St(e,r){const s=M({Container:{color:e.textColor||"var(--sl-color-neutral-900)",background:e.backgroundColor||""},Header:{fontSize:"var(--sl-font-size-x-large)",fontWeight:"var(--sl-font-weight-bold)",lineHeight:"var(--sl-line-height-dense)",marginBottom:"var(--sl-spacing-large)",textAlign:"center"},Grid:{display:"flex",flexDirection:"row",gap:"var(--sl-spacing-large)","@media (max-width: 499px)":{flexDirection:"column"}}}),a=s.toString();return t("div",{class:s.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},a,"\n ::slotted(*){\n display: flex;\n width: 100%;\n }\n @media (max-width: 499px) {\n ::slotted(*){\n display: block;\n }\n }"),t("div",{class:s.classes.Header},t("div",{class:s.classes.Header,part:"sqm-header"},e.header)),t("div",{class:s.classes.Grid,part:"sqm-grid-container"},r))}const Rt=class{constructor(t){e(this,t),this.ignored=!0,s(this)}disconnectedCallback(){}render(){return t(St,Object.assign({},N(this)),t("slot",null))}};function _t(e){const r=M({Container:{display:"flex",flexDirection:"column",width:"100%",padding:"var(--sl-spacing-x-large)",lineHeight:"var(--sl-line-height-dense)",color:e.textColor||"var(--sl-color-neutral-900)",background:e.backgroundColor||"var(--sl-color-primary-50)","@media (max-width: 499px)":{flexDirection:"row",width:"auto",paddingBottom:"var(--sl-spacing-large)"}},Text:{"@media (max-width: 499px)":{marginLeft:"var(--sl-spacing-large)"}},Header:{fontSize:"var(--sl-font-size-large)",fontWeight:"var(--sl-font-weight-bold)",marginTop:"var(--sl-spacing-x-large)","@media (max-width: 499px)":{margin:"0"}},Description:{fontSize:"var(--sl-font-size-medium)",marginTop:"var(--sl-spacing-small)","@media (max-width: 499px)":{marginTop:"var(--sl-spacing-x-small)"}},Media:{width:"64px",height:"64px",borderRadius:"100%",objectFit:"cover",userSelect:"none",background:"#FFF",color:"var(--sl-color-primary-300)",fontSize:"26px",textAlign:"center",lineHeight:"72px"}}),s=r.toString();return t("div",{class:r.classes.Container,part:"sqm-base"},t("style",{type:"text/css"},s),t("div",null,e.imageUrl?t("img",{class:r.classes.Media,src:e.imageUrl,part:"sqm-media"}):t("div",{class:r.classes.Media,part:"sqm-media"},t("sl-icon",{name:e.icon}))),t("div",{class:r.classes.Text},t("div",{class:r.classes.Header,part:"sqm-header"},e.header),t("div",{class:r.classes.Description,part:"sqm-description"},e.description)))}const Tt=class{constructor(t){e(this,t),s(this)}disconnectedCallback(){}render(){return t(_t,Object.assign({},N(this)))}},Nt=c("sq:useProgramMenu"),qt=class{constructor(t){e(this,t),this.ignored=!0,s(this)}disconnectedCallback(){}render(){const{data:e,ref:s}=function(e){const t=g(),r=m();Nt({programId:t,props:e});const s=o(),[,i]=k();return a((()=>{var e;null===(e=s.current)||void 0===e||e.addEventListener("sl-select",(e=>{r.dispatchEvent(new CustomEvent("sq:update-program-id",{detail:e.detail.item.value,bubbles:!0,composed:!0}))}))}),[s.current]),{data:{programId:t},callbacks:{rerender:i},ref:s}}(N(this));return t(r,{style:{display:"contents"}},t("sl-select",{style:{paddingBottom:"var(--sl-spacing-large)"},value:e.programId,ref:e=>s.current=e},t("slot",null)))}},Mt=M({Container:{borderRadius:"var(--sl-border-radius-large)",color:"var(--sl-color-neutral-900)",background:"var(--sl-color-neutral-0)",display:"flex",flexDirection:"column",rowGap:"var(--sl-spacing-large)"},EndContainer:{display:"flex",flexDirection:"column",alignItems:"center"},ColumnContainer:{"& p":{margin:"0"},display:"grid",gridAutoColumns:"minmax(0, 1fr)",gridAutoFlow:"column",gap:"calc(2 * var(--sl-spacing-medium))","@media (max-width: 499px)":{gridAutoFlow:"unset",gridAutoColumns:"unset",gridTemplateColumns:"1fr",border:"none"}}}),At=Mt.toString();function Lt(e){return t("div",{part:"sqm-base",class:Mt.classes.Container,style:{border:e.hideBorder?"none":"1px solid var(--sl-color-neutral-300)","padding-top":`var(--sl-spacing-${e.paddingTop})`,"padding-right":`var(--sl-spacing-${e.paddingRight})`,"padding-bottom":`var(--sl-spacing-${e.paddingBottom})`,"padding-left":`var(--sl-spacing-${e.paddingLeft})`,backgroundColor:e.backgroundColor,maxWidth:e.limitWidth?"600px":"none",margin:e.limitWidth?"auto":"none"}},t("style",{type:"text/css"},At,"\n :host{\n display: block; \n }\n "),e.hasHeader&&t("div",{class:Mt.classes.EndContainer},e.slots.header),t("div",{part:"sqm-column-container",class:Mt.classes.ColumnContainer,style:{alignItems:e.verticalAlignment}},e.slots.left,e.slots.right),e.hasFooter&&t("div",{class:Mt.classes.EndContainer},e.slots.footer))}const Dt=class{constructor(t){e(this,t),this.ignored=!0,this.verticalAlignment="start",this.hideBorder=!1,this.paddingTop="large",this.paddingRight="large",this.paddingBottom="large",this.paddingLeft="large",this.backgroundColor="#ffffff",this.limitWidth=!1,s(this)}disconnectedCallback(){}render(){const e={left:t("slot",{name:"left"}),right:t("slot",{name:"right"}),header:t("slot",{name:"header"}),footer:t("slot",{name:"footer"})},r=D(),s=r.findIndex((e=>"header"===e.slot))>-1,a=r.findIndex((e=>"footer"===e.slot))>-1;return t(Lt,Object.assign({},N(this),{slots:e,hasHeader:s,hasFooter:a}),t("slot",null))}},Pt=p.gql`
|
|
188
|
-
query getUser($programId: ID) {
|
|
189
|
-
viewer {
|
|
190
|
-
... on User {
|
|
191
|
-
referralCode(programId: $programId)
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
`,Ft=class{constructor(t){e(this,t),this.ignored=!0,this.iframeHeight="100%",this.iframeWidth="100%",s(this)}disconnectedCallback(){}render(){const e=q([{attribute:"iframe-src",value:this.iframeSrc}]);if(e)return t(V,{missingProps:e,heading:"An error occured while loading this page",subheading:"A technical problem prevented this iframe from loading. Please contact us with the link to this page.",description:"Values for the following attributes are missing:"});const{states:s,data:a}=h()?(i=N(this),T({states:{content:{iframeSrc:"https://example.com",...i}},data:{shareCode:"SHARECODE123"}},i.demoData||{},{arrayMerge:(e,t)=>t})):function(e){var t;const r=g(),s=v(),{data:a}=b(Pt,{programId:r},!(null==s?void 0:s.jwt)||!r);return{states:{content:e},data:{shareCode:null===(t=null==a?void 0:a.viewer)||void 0===t?void 0:t.referralCode}}}(N(this));var i;return t(r,{style:{display:"contents"}},t(me,{data:a,states:s}))}};var Ot={};!function e(t,r,s,a){var i=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL);function n(){}function o(e){var s=r.exports.Promise,a=void 0!==s?s:t.Promise;return"function"==typeof a?new a(e):(e(n,n),null)}var l,c,d,u,h,m,p,v,g=(d=Math.floor(1e3/60),u={},h=0,"function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame?(l=function(e){var t=Math.random();return u[t]=requestAnimationFrame((function r(s){h===s||h+d-1<s?(h=s,delete u[t],e()):u[t]=requestAnimationFrame(r)})),t},c=function(e){u[e]&&cancelAnimationFrame(u[e])}):(l=function(e){return setTimeout(e,d)},c=function(e){return clearTimeout(e)}),{frame:l,cancel:c}),f=(v={},function(){if(m)return m;if(!s&&i){var t=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join("\n");try{m=new Worker(URL.createObjectURL(new Blob([t])))}catch(e){return void 0!==typeof console&&"function"==typeof console.warn&&console.warn("🎊 Could not load worker",e),null}!function(e){function t(t,r){e.postMessage({options:t||{},callback:r})}e.init=function(t){var r=t.transferControlToOffscreen();e.postMessage({canvas:r},[r])},e.fire=function(r,s,a){if(p)return t(r,null),p;var i=Math.random().toString(36).slice(2);return p=o((function(s){function n(t){t.data.callback===i&&(delete v[i],e.removeEventListener("message",n),p=null,a(),s())}e.addEventListener("message",n),t(r,i),v[i]=n.bind(null,{data:{callback:i}})}))},e.reset=function(){for(var t in e.postMessage({reset:!0}),v)v[t](),delete v[t]}}(m)}return m}),b={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function y(e,t,r){return function(e,t){return t?t(e):e}(e&&null!=e[t]?e[t]:b[t],r)}function x(e){return e<0?0:Math.floor(e)}function w(e){return parseInt(e,16)}function k(e){return e.map(E)}function E(e){var t=String(e).replace(/[^0-9a-f]/gi,"");return t.length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),{r:w(t.substring(0,2)),g:w(t.substring(2,4)),b:w(t.substring(4,6))}}function C(e){e.width=document.documentElement.clientWidth,e.height=document.documentElement.clientHeight}function I(e){var t=e.getBoundingClientRect();e.width=t.width,e.height=t.height}function S(e,r){var n,l=!e,c=!!y(r||{},"resize"),d=y(r,"disableForReducedMotion",Boolean),u=i&&y(r||{},"useWorker")?f():null,h=l?C:I,m=!(!e||!u||!e.__confetti_initialized),p="function"==typeof matchMedia&&matchMedia("(prefers-reduced-motion)").matches;function v(t,r,i){for(var l,c,d,u,m=y(t,"particleCount",x),p=y(t,"angle",Number),v=y(t,"spread",Number),f=y(t,"startVelocity",Number),b=y(t,"decay",Number),w=y(t,"gravity",Number),E=y(t,"drift",Number),C=y(t,"colors",k),I=y(t,"ticks",Number),S=y(t,"shapes"),R=y(t,"scalar"),_=function(e){var t=y(e,"origin",Object);return t.x=y(t,"x",Number),t.y=y(t,"y",Number),t}(t),T=m,N=[],q=e.width*_.x,M=e.height*_.y;T--;)N.push((void 0,void 0,c=(l={x:q,y:M,angle:p,spread:v,startVelocity:f,color:C[T%C.length],shape:S[(0,u=S.length,Math.floor(Math.random()*(u-0))+0)],ticks:I,decay:b,gravity:w,drift:E,scalar:R}).angle*(Math.PI/180),d=l.spread*(Math.PI/180),{x:l.x,y:l.y,wobble:10*Math.random(),velocity:.5*l.startVelocity+Math.random()*l.startVelocity,angle2D:-c+(.5*d-Math.random()*d),tiltAngle:Math.random()*Math.PI,color:l.color,shape:l.shape,tick:0,totalTicks:l.ticks,decay:l.decay,drift:l.drift,random:Math.random()+5,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:3*l.gravity,ovalScalar:.6,scalar:l.scalar}));return n?n.addFettis(N):(n=function(e,t,r,i,n){var l,c,d=t.slice(),u=e.getContext("2d"),h=o((function(t){function o(){l=c=null,u.clearRect(0,0,i.width,i.height),n(),t()}l=g.frame((function t(){!s||i.width===a.width&&i.height===a.height||(i.width=e.width=a.width,i.height=e.height=a.height),i.width||i.height||(r(e),i.width=e.width,i.height=e.height),u.clearRect(0,0,i.width,i.height),(d=d.filter((function(e){return function(e,t){t.x+=Math.cos(t.angle2D)*t.velocity+t.drift,t.y+=Math.sin(t.angle2D)*t.velocity+t.gravity,t.wobble+=.1,t.velocity*=t.decay,t.tiltAngle+=.1,t.tiltSin=Math.sin(t.tiltAngle),t.tiltCos=Math.cos(t.tiltAngle),t.random=Math.random()+5,t.wobbleX=t.x+10*t.scalar*Math.cos(t.wobble),t.wobbleY=t.y+10*t.scalar*Math.sin(t.wobble);var r=t.tick++/t.totalTicks,s=t.x+t.random*t.tiltCos,a=t.y+t.random*t.tiltSin,i=t.wobbleX+t.random*t.tiltCos,n=t.wobbleY+t.random*t.tiltSin;return e.fillStyle="rgba("+t.color.r+", "+t.color.g+", "+t.color.b+", "+(1-r)+")",e.beginPath(),"circle"===t.shape?e.ellipse?e.ellipse(t.x,t.y,Math.abs(i-s)*t.ovalScalar,Math.abs(n-a)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):function(e,t,r,s,a,i,n,o){e.save(),e.translate(t,r),e.rotate(i),e.scale(s,a),e.arc(0,0,1,0,o,void 0),e.restore()}(e,t.x,t.y,Math.abs(i-s)*t.ovalScalar,Math.abs(n-a)*t.ovalScalar,Math.PI/10*t.wobble,0,2*Math.PI):(e.moveTo(Math.floor(t.x),Math.floor(t.y)),e.lineTo(Math.floor(t.wobbleX),Math.floor(a)),e.lineTo(Math.floor(i),Math.floor(n)),e.lineTo(Math.floor(s),Math.floor(t.wobbleY))),e.closePath(),e.fill(),t.tick<t.totalTicks}(u,e)}))).length?l=g.frame(t):o()})),c=o}));return{addFettis:function(e){return d=d.concat(e),h},canvas:e,promise:h,reset:function(){l&&g.cancel(l),c&&c()}}}(e,N,h,r,i)).promise}function b(r){var s=d||y(r,"disableForReducedMotion",Boolean),a=y(r,"zIndex",Number);if(s&&p)return o((function(e){e()}));l&&n?e=n.canvas:l&&!e&&(e=function(e){var t=document.createElement("canvas");return t.style.position="fixed",t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",t.style.zIndex=e,t}(a),document.body.appendChild(e)),c&&!m&&h(e);var i={width:e.width,height:e.height};function g(){if(u){var t={getBoundingClientRect:function(){if(!l)return e.getBoundingClientRect()}};return h(t),void u.postMessage({resize:{width:t.width,height:t.height}})}i.width=i.height=null}function f(){n=null,c&&t.removeEventListener("resize",g),l&&e&&(document.body.removeChild(e),e=null,m=!1)}return u&&!m&&u.init(e),m=!0,u&&(e.__confetti_initialized=!0),c&&t.addEventListener("resize",g,!1),u?u.fire(r,i,f):v(r,i,f)}return b.reset=function(){u&&u.reset(),n&&n.reset()},b}r.exports=S(null,{useWorker:!0,resize:!0}),r.exports.create=S}(function(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:this||{}}(),Ot,!1);const Vt=Ot.exports,$t=p.gql`
|
|
196
|
-
query getExchangeList {
|
|
197
|
-
viewer {
|
|
198
|
-
... on User {
|
|
199
|
-
visibleRewardExchangeItems(limit: 20, offset: 0) {
|
|
200
|
-
data {
|
|
201
|
-
key
|
|
202
|
-
name
|
|
203
|
-
description
|
|
204
|
-
imageUrl
|
|
205
|
-
available
|
|
206
|
-
unavailableReasonCode
|
|
207
|
-
ruleType
|
|
208
|
-
sourceUnit
|
|
209
|
-
sourceValue
|
|
210
|
-
prettySourceValue
|
|
211
|
-
sourceMinValue
|
|
212
|
-
prettySourceMinValue
|
|
213
|
-
sourceMaxValue
|
|
214
|
-
prettySourceMaxValue
|
|
215
|
-
destinationMinValue
|
|
216
|
-
prettyDestinationMinValue
|
|
217
|
-
destinationMaxValue
|
|
218
|
-
prettyDestinationMaxValue
|
|
219
|
-
globalRewardKey
|
|
220
|
-
destinationUnit
|
|
221
|
-
steps {
|
|
222
|
-
sourceValue
|
|
223
|
-
prettySourceValue
|
|
224
|
-
destinationValue
|
|
225
|
-
prettyDestinationValue
|
|
226
|
-
available
|
|
227
|
-
globalRewardKey
|
|
228
|
-
unavailableReasonCode
|
|
229
|
-
rewardInput
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
totalCount
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
`,jt=p.gql`
|
|
238
|
-
mutation exchange($exchangeRewardInput: ExchangeRewardInput!) {
|
|
239
|
-
exchangeReward(exchangeRewardInput: $exchangeRewardInput) {
|
|
240
|
-
reward {
|
|
241
|
-
id
|
|
242
|
-
fuelTankCode
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
`,Ut=class{constructor(t){e(this,t),this.ignored=!0,this.notAvailableError="{unavailableReasonCode, select, US_TAX {US Tax limit} INSUFFICIENT_REDEEMABLE_CREDIT {{sourceValue} required} AVAILABILITY_PREDICATE {Not available} other {{unavailableReasonCode}} }",this.chooseRewardTitle="Rewards",this.chooseAmountTitle="Select",this.confirmationTitle="Confirm",this.rewardTitle="Choose a reward",this.cancelText="Cancel",this.backText="Back",this.continueText="Continue",this.continueToConfirmationText="Continue to confirmation",this.redeemText="Redeem",this.redeemTitle="Confirm and redeem",this.redemptionSuccessText="Redeemed {sourceValue} for {destinationValue}",this.sourceAmountMessage="{ruleType, select, FIXED_GLOBAL_REWARD {{sourceValue}} other {{sourceMinValue} to {sourceMaxValue}}}",this.tooltipText="Copied",this.doneText="Done",this.selectText="Select amount to receive",this.queryError="Unable to load reward exchange list. Please try again",this.redemptionError="An error occured trying to redeem this reward. Please try again",this.notEnoughError="Not enough {sourceUnit} to redeem for this reward",this.rewardRedeemedText="Reward redeemed",this.promoCode="Promo Code",this.skeletonCardNum=8,this.rewardNameTitle="Reward",this.rewardAmountTitle="Reward Amount",this.costTitle="Cost to Redeem",s(this)}disconnectedCallback(){}render(){const e={...N(this),empty:t(Bt,null)},{states:s,data:i,callbacks:l,refs:c}=h()?function(e){return T({states:{content:{text:e},redeemStage:"chooseReward",amount:0,selectedStep:void 0,selectedItem:void 0,open:!1,exchangeError:!1,queryError:!1,loading:!1,noExchangeOptions:!1,empty:Bt()},data:{shareCode:"SHARECODE123",exchangeList:pe.data.exchangeList},callbacks:{exchangeReward:()=>{},setExchangeState:()=>{},setStage:()=>{},resetState:()=>{},copyFuelTankCode:()=>{}},refs:{canvasRef:{}}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):function(e){var t,r,s,i,l;const[c,u]=d(((e,t)=>({...e,...t})),{selectedItem:void 0,selectedStep:void 0,redeemStage:"chooseReward",amount:0,exchangeError:!1}),[h,m]=n(!1),{selectedItem:p,selectedStep:g,redeemStage:y,amount:x,exchangeError:w}=c,k=v(),[E,{data:C,loading:I,errors:R}]=f(jt),{data:_,loading:T,refetch:N,errors:q}=b($t,{},!(null==k?void 0:k.jwt));a((()=>{var e,t;(null===(t=null===(e=null==C?void 0:C.exchangeReward)||void 0===e?void 0:e.reward)||void 0===t?void 0:t.id)&&u({redeemStage:"success",exchangeError:!1}),R&&u({exchangeError:!0})}),[C,R]);const M=o();a((()=>{if(!M.current)return;const e=M.current;e.confetti=e.confetti||Vt.create(e,{resize:!0}),e.confetti()}),[M.current]);const{refresh:A}=S();return{states:{content:{text:e},selectedItem:p,redeemStage:y,amount:x,selectedStep:g,exchangeError:w,queryError:!!q,loading:T||I,open:h,noExchangeOptions:0===(null===(t=null==_?void 0:_.viewer)||void 0===t?void 0:t.visibleRewardExchangeItems.totalCount)},data:{exchangeList:null===(s=null===(r=null==_?void 0:_.viewer)||void 0===r?void 0:r.visibleRewardExchangeItems)||void 0===s?void 0:s.data,fuelTankCode:null===(l=null===(i=null==C?void 0:C.exchangeReward)||void 0===i?void 0:i.reward)||void 0===l?void 0:l.fuelTankCode},callbacks:{exchangeReward:async function(){if(!p)return;let e={accountId:null==k?void 0:k.accountId,userId:k.id};switch(p.ruleType){case"FIXED_GLOBAL_REWARD":e={...e,redeemCreditInput:{amount:p.sourceValue,unit:p.sourceUnit},globalRewardKey:p.globalRewardKey};break;case"STEPPED_FIXED_GLOBAL_REWARD":e={...e,redeemCreditInput:{amount:g.sourceValue,unit:p.sourceUnit},globalRewardKey:g.globalRewardKey};break;case"VARIABLE_GLOBAL_REWARD":e={...e,redeemCreditInput:{amount:x,unit:p.sourceUnit},globalRewardKey:p.globalRewardKey,rewardInput:g.rewardInput};break;case"VARIABLE_CREDIT_REWARD":e={...e,redeemCreditInput:{amount:x,unit:p.sourceUnit},rewardInput:{type:"CREDIT",unit:p.destinationUnit,assignedCredit:g.destinationValue}};break;default:e={...e,...g.rewardInput}}await E({exchangeRewardInput:e}),A()},setExchangeState:u,setStage:function(e){u({redeemStage:e})},resetState:e=>{e&&N(),u({amount:0,selectedStep:void 0,selectedItem:void 0,exchangeError:!1,redeemStage:"chooseReward"})},copyFuelTankCode:function(){var e,t;navigator.clipboard.writeText(null===(t=null===(e=null==C?void 0:C.exchangeReward)||void 0===e?void 0:e.reward)||void 0===t?void 0:t.fuelTankCode),m(!0),setTimeout((()=>m(!1)),1e3)}},refs:{canvasRef:M}}}(e);return t(r,{style:{display:"contents"}},t(ve,{states:s,data:i,callbacks:l,refs:c}))}static get assetsDirs(){return["assets"]}};function Bt(){return t("slot",{name:"empty"},t("sqm-empty",{emptyStateImage:"https://res.cloudinary.com/saasquatch/image/upload/v1644360953/squatch-assets/empty_exchange2.png",emptyStateHeader:"Redeem rewards",emptyStateText:"Use your points to redeem rewards once they become available"}))}const Ht=c("sq:useRouter");function zt(e,t){if(e)return P(e).exec(t)}const Wt=class{constructor(t){e(this,t),this.ignored=!0,s(this)}disconnectedCallback(){}render(){const{callbacks:e}=function(){const e=R(),t=m(),[r,s]=n(void 0),[i,o]=n(void 0),l=e.pathname;return a((()=>{const e=t.querySelectorAll("sqm-route");Array.from(e).forEach((e=>{const t=document.createElement("template");t.setAttribute("path",e.path),t.innerHTML=e.innerHTML,e.parentNode.appendChild(t),e.parentNode.removeChild(e)}))}),[]),a((()=>{var e,t;if(!i||!r)return void Ht("DOM not ready for navigation rendering on:",l);const s=r.querySelectorAll("template"),a=Array.from(s).find((e=>{var t,r,s;if(null===(s=zt(null===(r=null===(t=e.attributes)||void 0===t?void 0:t.path)||void 0===r?void 0:r.nodeValue,l))||void 0===s?void 0:s.length)return e})),n=null===(t=null===(e=null==a?void 0:a.attributes)||void 0===e?void 0:e.path)||void 0===t?void 0:t.nodeValue;if(Ht({containerDatasetPage:i.dataset.page,templatePath:n,page:l}),!a)return Ht("No matching page found for ",l,", so render nothing"),i.innerHTML="",void(i.dataset.page=l);Ht("Page updated to ",l,a),zt(n,i.dataset.page)?Ht("don't rerender"):a&&(i.innerHTML=a.innerHTML,i.dataset.page=l)}),[r,i,l]),{callbacks:{setSlot:s,setContainer:o}}}();return t(r,null,t("div",{ref:e.setSlot,style:{display:"none"}},t("slot",null)),t("div",{style:{display:"contents"},ref:e.setContainer}))}};Wt.style="sqm-router{display:contents}";const Gt=class{constructor(t){e(this,t),this.type="default",this.iconslot="prefix",this.hideicon=!1,this.hidetext=!1,this.undefinedLinkText="Error: message link undefined!",this.unsupportedPlatformText="Error: not on a supported device",s(this)}disconnectedCallback(){}render(){const e=N(this),r=h()?function(e){return T({...e,loading:!1,hide:!1,onClick:()=>{}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):ge(e);return t(fe,Object.assign({},r),t("slot",null))}};Gt.style=":host{display:block}:host([hidden]){display:none}sl-button{display:block}";const Yt=p.gql`
|
|
247
|
-
query ($programId: ID) {
|
|
248
|
-
user: viewer {
|
|
249
|
-
... on User {
|
|
250
|
-
referralCode(programId: $programId)
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
`,Kt=p.gql`
|
|
255
|
-
mutation loadEvent($eventMeta: UserAnalyticsEvent!) {
|
|
256
|
-
createUserAnalyticsEvent(eventMeta: $eventMeta)
|
|
257
|
-
}
|
|
258
|
-
`,Zt=class{constructor(t){e(this,t),this.tooltiptext="Copied to Clipboard",this.tooltiplifespan=1e3,this.textAlign="left",this.copyButtonLabel="Copy Code",this.buttonStyle="icon",s(this)}disconnectedCallback(){}render(){const e=N(this),r=h()?function(e){const[t,r]=n(!1),s="SHARECODE001";return T({copyString:s,tooltiptext:e.tooltiptext,textAlign:e.textAlign,copyButtonLabel:e.copyButtonLabel,buttonStyle:e.buttonStyle,rewardStatus:"AVAILABLE",open:t,onClick:()=>{navigator.clipboard.writeText(s),r(!0),setTimeout((()=>r(!1)),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):function(e){var t,r;const{programId:s=g()}=e,a=v(),i=y(),{data:o}=b(Yt,{programId:s},!(null==a?void 0:a.jwt)),[l]=f(Kt),c=null!==(r=null===(t=null==o?void 0:o.user)||void 0===t?void 0:t.referralCode)&&void 0!==r?r:"...",[d,u]=n(!1);return{...e,onClick:function(){navigator.clipboard.writeText(c),u(!0),setTimeout((()=>u(!1)),e.tooltiplifespan),l({eventMeta:{programId:s,id:null==a?void 0:a.id,accountId:null==a?void 0:a.accountId,type:"USER_REFERRAL_PROGRAM_ENGAGEMENT_EVENT",meta:{engagementMedium:i,shareMedium:"DIRECT"}}})},open:d,copyString:c}}(e);return t(A,Object.assign({},r))}},Qt=class{constructor(t){e(this,t),this.tooltiptext="Copied to Clipboard",this.tooltiplifespan=1e3,this.textAlign="left",this.copyButtonLabel="Copy Link",this.buttonStyle="icon",s(this)}disconnectedCallback(){}render(){const e=N(this),r=h()?function(e){const[t,r]=n(!1),s="https://www.example.com/sharelink/abc";return T({copyString:s,tooltiptext:e.tooltiptext,textAlign:e.textAlign,buttonStyle:e.buttonStyle,copyButtonLabel:e.copyButtonLabel,rewardStatus:"AVAILABLE",open:t,onClick:()=>{navigator.clipboard.writeText(s),r(!0),setTimeout((()=>r(!1)),e.tooltiplifespan)}},e.demoData||{},{arrayMerge:(e,t)=>t})}(e):be(e);return t(A,Object.assign({},r))}},Xt=class{constructor(t){e(this,t),this.ignored=!0,this.space="xxx-large",this.display="grid",s(this)}disconnectedCallback(){}render(){return t(ye,Object.assign({},N(this)),t("slot",null))}},Jt=p.gql`
|
|
259
|
-
mutation taskCardEvent($userEventInput: UserEventInput!) {
|
|
260
|
-
logUserEvent(userEventInput: $userEventInput) {
|
|
261
|
-
userId
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
`,er=class{constructor(t){e(this,t),this.ignored=!0,this.rewardAmount="0",this.rewardUnit="Points",this.cardTitle="Title Text",this.description="",this.repeatable=!1,this.finite=0,this.showProgressBar=!1,this.goal=1,this.steps=!1,this.progressBarUnit="",this.expiryMessage="Ends {endDate}",this.startsOnMessage="Starts {startDate}",this.endedMessage="Ended {endDate}",this.completedText="Completed {finite, select, 0 {{count, plural, =1 {{count} time} other {{count} times}}} other {{count}/{finite} times}}",this.buttonText="Complete Action",this.openNewTab=!1,this.hideButton=!1,s(this)}disconnectedCallback(){}render(){const{props:e}=h()?W(this):G({...N(this),programId:this.programId}),{value:r,loading:s}=e,{states:i,callbacks:n}=h()?function(e){return T({states:{loadingEvent:!1,locale:"en"},callbacks:{sendEvent:e=>console.log(e),onClick:()=>console.log("clicked")}},e.demoData||{},{arrayMerge:(e,t)=>t})}(this):function(e){const t=v(),r=w(),[s,{data:i,loading:n}]=f(Jt),{refresh:o}=S();function l(){e.openNewTab?window.open(e.buttonLink):window.open(e.buttonLink,"_parent")}function c(e){s({userEventInput:{userId:null==t?void 0:t.id,accountId:null==t?void 0:t.accountId,events:[{key:e,fields:{}}]}})}return a((()=>{i&&(o(),l())}),[i]),{states:{loadingEvent:n,locale:r},callbacks:{sendEvent:c,onClick:function(){e.eventKey?c(e.eventKey):l()}}}}(this);return t(xe,{callbacks:n,states:{loading:s,loadingEvent:i.loadingEvent,progress:r,locale:i.locale},content:{...N(this)}})}},tr=class{constructor(t){e(this,t),this.ignored=!0,this.icon="gift",s(this)}disconnectedCallback(){}render(){return D().forEach((e=>{try{e.setIcon(this.icon)}catch{}})),t("div",null,t("style",{type:"text/css"},"\n\t\t:host{\n\t\t\tdisplay: block; \n\t\t}\n\n\t\t::slotted(*:not(:only-child):not(:last-child)) {\n\t\t\tmargin-bottom: var(--sl-spacing-xx-large);\n\t\t}\n\t"),t("slot",null))}},rr=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M22.5 7.5H18.6761H13.5V24H20.75C21.3023 24 21.75 23.5523 21.75 23V22.5V13.5H22.5H23C23.5523 13.5 24 13.0523 24 12.5V12V9V8.5C24 7.94772 23.5523 7.5 23 7.5H22.5Z",fill:"#F2C94C"}),t("path",{d:"M2.25 22.5V23C2.25 23.5523 2.69772 24 3.25 24H10.5V7.5H6.96363H1.5H1C0.447715 7.5 0 7.94772 0 8.5V9V12V12.5C0 13.0523 0.447715 13.5 1 13.5H1.5H2.25V22.5Z",fill:"#F2C94C"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.25 13.5V15H21.75V13.5H2.25Z",fill:"#BE9720"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M21 4.06424C21 5.39348 19.0041 7.4062 18 7.5H13.5V24H10.5027V7.5H6.88188C4.8187 7.05273 3 5.46806 3 3.78109C3 2.1371 3.71404 0.835051 5.01276 0.273062C6.25382 -0.26398 7.68678 0.0304991 8.81964 0.817C10.2101 1.78237 10.9902 3.59446 11.6978 5.2384C11.7599 5.38268 11.8215 5.52566 11.8828 5.66667C11.9426 5.53298 12.0028 5.3969 12.0638 5.25912C12.7649 3.67422 13.5654 1.86488 14.9106 0.893444C16.0997 0.0347157 17.6114 -0.289736 18.9181 0.298417C20.2693 0.906596 21 2.3018 21 4.06424ZM15.9185 2.25C16.6392 1.72957 17.502 1.63518 18.2396 2.25C18.8819 2.78542 18.9162 3.03745 18.9987 3.64389L19.0133 3.75C19.0133 4.64776 18.2396 6 17.4659 6C16.9177 6 16.4871 5.99537 16.0836 5.99103C15.3479 5.98312 14.702 5.97618 13.5974 6C13.808 5.59179 13.9761 5.20003 14.1365 4.82641C14.5654 3.82715 14.9386 2.95763 15.9185 2.25ZM7.40792 2.25C7.05911 2.00783 6.25921 2.11591 5.92748 2.25945C5.65341 2.37805 5.24403 2.73987 5.24403 3.78109C5.24403 4.79286 6.88188 5.66667 6.88188 5.66667C6.88188 5.66667 8.18161 6 10.5027 6C9.71258 4.04177 8.59336 3.073 7.40792 2.25Z",fill:"#EB5757"})),sr=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",stroke:"currentColor","stroke-width":"2"})),ar=M({TimelineReward:{color:"var(--sl-color-neutral-900)",lineHeight:"var(--sl-line-height-dense)","& .container":{display:"flex"},"& .line":{display:"none",color:"transparent",userSelect:"none",background:"var(--sl-color-primary-300)",width:"4px",borderRadius:"4px",margin:"-2px",position:"relative",left:"12px",top:"34px"},"& .step":{display:"flex"},"& .icon":{position:"relative",top:"4px",zIndex:"1",color:"var(--sl-color-primary-300)",marginRight:"var(--sl-spacing-large)"},"& .reward":{marginRight:"var(--sl-spacing-x-small)",fontSize:"var(--sl-font-size-x-large)",fontWeight:"var(--sl-font-weight-semibold)"},"& .unit":{textTransform:"uppercase",fontSize:"var(--sl-font-size-small)"},"& .description":{fontSize:"var(--sl-font-size-medium)"}}}),ir=ar.toString();function nr(e){var r;const s=null!==(r=e.icon)&&void 0!==r?r:e.iconState;return t("div",{class:ar.classes.TimelineReward,part:"sqm-base"},t("style",{type:"text/css"},ir,"\n\t:host{\n\t\tdisplay: block; \n\t}\n\n\t:host(:not(:last-of-type)) .line {\n\t\tdisplay: block; \n\t}\n\t"),t("div",{class:"container",part:"sqm-entry-container"},t("div",{class:"line"},"/"),t("div",{class:"step"},"gift"===s&&t("div",{class:"icon"},t(rr,null)),"circle"===s&&t("div",{class:"icon"},t(sr,null)),t("div",null,t("div",null,t("span",{class:"reward",part:"sqm-reward"},e.reward),t("span",{class:"unit",part:"sqm-unit"},e.unit)),t("div",{class:"description",part:"sqm-description"},e.desc)))))}const or=class{constructor(t){e(this,t),this.ignored=!0,this.iconState="gift",s(this)}async setIcon(e){this.iconState=e}disconnectedCallback(){}render(){return L([this.reward]),t(nr,Object.assign({},N(this)))}};function lr(e){return t(r,null,e.loading?e.loadingText:e.username)}const cr=p.gql`
|
|
265
|
-
query getUserName {
|
|
266
|
-
viewer {
|
|
267
|
-
... on User {
|
|
268
|
-
firstName
|
|
269
|
-
lastName
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
`,dr=class{constructor(t){e(this,t),this.ignored=!0,this.fallback="Anonymous User",this.loadingText="...",s(this)}disconnectedCallback(){}render(){const e=h()?function(e){return T({loading:!1,loadingText:"...",username:"John Smith"},e.demoData||{},{arrayMerge:(e,t)=>t})}(this):function(e){var t,r,s,a,i,n,o,l;const c=v(),d=b(cr,{},!(null==c?void 0:c.jwt)),u=(null===(r=null===(t=d.data)||void 0===t?void 0:t.viewer)||void 0===r?void 0:r.firstName)||(null===(a=null===(s=d.data)||void 0===s?void 0:s.viewer)||void 0===a?void 0:a.lastName)?`${null===(n=null===(i=d.data)||void 0===i?void 0:i.viewer)||void 0===n?void 0:n.firstName} ${null===(l=null===(o=d.data)||void 0===o?void 0:o.viewer)||void 0===l?void 0:l.lastName}`:e.fallback;return{loadingText:e.loadingText,loading:d.loading,username:u}}(this);return t(lr,Object.assign({},e))}};export{ke as sqm_big_stat,Ee as sqm_brand,Ce as sqm_card_feed,Se as sqm_checkbox_field,Te as sqm_coupon_code,qe as sqm_divided_layout,Me as sqm_dropdown_field,Pe as sqm_edit_profile,Fe as sqm_hero,Ve as sqm_hero_image,$e as sqm_hook_story_container,Ue as sqm_image,Be as sqm_input_field,He as sqm_lead_dropdown_field,Ge as sqm_lead_form,Xe as sqm_leaderboard,st as sqm_link_button,at as sqm_marketing_emails_checkbox,it as sqm_name_fields,ot as sqm_navigation_menu,ht as sqm_payout_button_scroll,gt as sqm_payout_status_alert,xt as sqm_portal_change_marketing,wt as sqm_portal_change_password,kt as sqm_portal_footer,Et as sqm_portal_frame,Ct as sqm_portal_login,It as sqm_portal_register,Rt as sqm_program_explainer,Tt as sqm_program_explainer_step,qt as sqm_program_menu,Dt as sqm_referral_card,Ft as sqm_referral_iframe,Ut as sqm_reward_exchange_list,Wt as sqm_router,Gt as sqm_share_button,Zt as sqm_share_code,Qt as sqm_share_link,Xt as sqm_stat_container,er as sqm_task_card,tr as sqm_timeline,or as sqm_timeline_entry,dr as sqm_user_name}
|