@foxy.io/elements 1.53.0-beta.3 → 1.53.0-beta.5
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/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/translations/admin-subscription-form/en.json +1 -1
- package/dist/cdn/translations/user-invitation-form/en.json +11 -2
- package/dist/elements/public/UserInvitationForm/UserInvitationForm.d.ts +3 -1
- package/dist/elements/public/UserInvitationForm/UserInvitationForm.js +40 -12
- package/dist/elements/public/UserInvitationForm/UserInvitationForm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-4332bafc.js";import"./shared-f892683b.js";import{I as e}from"./shared-ad26f72d.js";import"./shared-d1125001.js";import"./shared-515003f6.js";import{a as t}from"./shared-2bb1f0f4.js";import"./shared-9b35fe34.js";import{_ as a,B as r,aT as i,aU as s}from"./shared-8f9014ff.js";import{N as o}from"./shared-2b39e4d4.js";import{i as l}from"./shared-53e42a77.js";import{h as n,c as d,s as c}from"./shared-ba5c42c7.js";import{a as m}from"./shared-887ac0b0.js";import{a as f,g as h}from"./shared-37bdd118.js";import{c as v}from"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-db623837.js";import"./shared-6cdfb858.js";import"./shared-0fd68dc0.js";import"./shared-19073761.js";import"./shared-930e68b7.js";import"./shared-058530fc.js";import"./shared-69c98b7b.js";import"./shared-41c9c53f.js";import"./shared-609c9693.js";import"./foxy-copy-to-clipboard.js";import"./shared-9687ab7b.js";import"./shared-8d8975d5.js";import"./shared-99c53365.js";import"./shared-0f92b865.js";import"./shared-bab2ea2c.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./shared-9a3bf65c.js";import"./shared-a5d6db21.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";let u,p=e=>e;customElements.define("foxy-internal-user-invitation-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return a(a({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const e=this.__state,t="fail"===e?"error":"idle"===e?this.theme:"";return n(u||(u=p` <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),l(null!=t?t:void 0),"busy"===e||this.disabled,this.__submit,e)}async __submit(){var e,t;if("busy"!==this.__state)try{this.__state="busy";const a=new o.API(this);(await a.fetch(null!==(e=this.href)&&void 0!==e?e:"",{method:"POST"})).ok?(null===(t=this.nucleon)||void 0===t||t.refresh(),this.__state="idle"):this.__state="fail"}catch(e){this.__state="fail"}}});let x,y,g,_,b,Z,j,w,S,$,k,C,M,L,B,H,U=e=>e;const P=m(e,"user-invitation-form");class V extends P{constructor(){super(...arguments),this.getStorePageHref=null,this.defaultDomain=null,this.currentUser=null,this.layout=null,this.__storeDomainGetValue=()=>{var e;const t=this.defaultDomain,a=null===(e=this.data)||void 0===e?void 0:e.store_domain;return(null==a?void 0:a.includes("."))||!t?a:`${a}.${t}`}}static get properties(){return a(a({},super.properties),{},{getStorePageHref:{attribute:!1},defaultDomain:{attribute:"default-domain"},currentUser:{attribute:"current-user"},layout:{}})}static get styles(){return[...super.styles,d(x||(x=U`.inner-curve{--r:var(--lumo-border-radius-l);--s:3rem;--a:12deg;--m:0/calc(2 * var(--r)) var(--r) no-repeat radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);--d:(var(--s) + var(--r)) * cos(var(--a));border-radius:var(--r);width:100%;mask:calc(50% + var(--d)) var(--m),calc(50% - var(--d)) var(--m),radial-gradient(var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),#0000 100%,#000 calc(100% + 1px)) 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,linear-gradient(90deg,#000 calc(50% - var(--d)),#0000 0 calc(50% + var(--d)),#000 0)}`))]}static get v8n(){return[({email:e})=>!!e||"email:v8n_required"]}get readonlySelector(){const e=["store",super.readonlySelector.toString()];return new r(e.join(" ").trim())}get hiddenSelector(){var e,t;const a=["timestamps","submit","undo",super.hiddenSelector.toString()],i=null===(e=this.data)||void 0===e?void 0:e.status,s=null!==(t=this.layout)&&void 0!==t?t:"user";return"accepted"!==i&&"sent"!==i&&a.unshift("revoke"),"accepted"!==i&&a.unshift("leave"),"sent"!==i&&a.unshift("accept","reject"),"rejected"===i&&"user"===s||"expired"===i&&"admin"===s||"revoked"===i&&"admin"===s||a.unshift("delete"),"sent"===i&&"admin"===s||a.unshift("resend"),new r(a.join(" ").trim())}renderBody(){const{layout:e,data:t}=this;return"admin"===e?t?this.__renderAdminSnapshotState(t):this.__renderAdminTemplateState():t?this.__renderUserSnapshotState(t):this.__renderUserTemplateState()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("already been created for this email and store")?["error:invitation_exists"]:t.includes("already has access to this store")?["error:already_has_access"]:e}}__getGravatar(e){return i((function*(){yield n(y||(y=U` <div style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5"></div> `)),e&&(yield n(g||(g=U` <img data-testid="gravatar" style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield s(h(e))))}))()}__renderAdminTemplateState(){return n(_||(_=U` ${0} <foxy-internal-text-control infer="email"></foxy-internal-text-control> ${0} `),this.renderHeader(),super.renderBody())}__renderUserTemplateState(){return n(b||(b=U` <div class="p-xl flex items-center justify-center"> <foxy-spinner layout="vertical" infer="unavailable" state="empty"></foxy-spinner> </div> `))}__renderAdminSnapshotState({first_name:e,last_name:t,store_name:a,_links:r}){var i,s,o,d,m,h,u,p,x;const y=(null==e?void 0:e.trim())||(null==t?void 0:t.trim()),g={first_name:e,last_name:t,context:y?"":"empty"},_=null===(i=this.data)||void 0===i?void 0:i.status,b=this.hiddenSelector;return n(Z||(Z=U` <div style="padding-top:3.5rem"> <div class="relative"> <div class="inner-curve bg-contrast-5 absolute inset-0"></div> ${0} <div class="relative pb-m px-m leading-xs grid gap-m" style="padding-top:calc(2.5rem + var(--lumo-space-m))"> <div> <foxy-i18n class="block text-xl font-medium text-center" infer="" key="full_name" .options="${0}"> </foxy-i18n> <div class="text-m text-center text-secondary">${0}</div> </div> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="${0}"> <p class="font-medium flex items-center gap-s"> ${0} <foxy-i18n infer="" key="admin_status_title" .options="${0}"> </foxy-i18n> </p> <p class="text-body" style="padding-left:calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))"> <foxy-i18n infer="" key="admin_status_text" .options="${0}"> </foxy-i18n> </p> </div> <div class="flex gap-m" ?hidden="${0}"> ${0} <foxy-internal-user-invitation-form-async-action infer="resend" class="flex-1" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-delete-control infer="delete" class="flex-1"> </foxy-internal-delete-control> </div> </div> </div> </div> `),f(this.__getGravatar(null===(s=this.data)||void 0===s?void 0:s.email)),g,null===(o=this.data)||void 0===o?void 0:o.email,v({"border rounded":!0,"border-contrast text-contrast":"revoked"===_||"expired"===_,"border-success text-success":"accepted"===_,"border-primary text-primary":"sent"===_,"border-error text-error":"rejected"===_}),"revoked"===_?c(j||(j=U`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z" clip-rule="evenodd" /></svg>`)):"sent"===_?c(w||(w=U`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z" clip-rule="evenodd" /></svg>`)):"rejected"===_?c(S||(S=U`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd" /></svg>`)):"accepted"===_?c($||($=U`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" /></svg>`)):"expired"===_?c(k||(k=U`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path d="M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z" /><path fill-rule="evenodd" d="m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.133 2.845a.75.75 0 0 1 1.06 0l1.72 1.72 1.72-1.72a.75.75 0 1 1 1.06 1.06l-1.72 1.72 1.72 1.72a.75.75 0 1 1-1.06 1.06L12 15.685l-1.72 1.72a.75.75 0 1 1-1.06-1.06l1.72-1.72-1.72-1.72a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg>`)):"",{context:_},{context:_},b.matches("revoke",!0)&&b.matches("resend",!0)&&b.matches("delete",!0),this.currentUser&&r["fx:user"]&&this.currentUser===r["fx:user"].href?n(C||(C=U` <foxy-internal-post-action-control message-options="${0}" infer="revoke" class="flex-1" theme="error" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({store_domain:this.__storeDomainGetValue(),store_name:a}),l(null===(m=null===(d=this.data)||void 0===d?void 0:d._links["fx:revoke"])||void 0===m?void 0:m.href),(()=>this.dispatchEvent(new CustomEvent("selfrevoked")))):n(M||(M=U` <foxy-internal-user-invitation-form-async-action infer="revoke" class="flex-1" theme="error" href="${0}"> </foxy-internal-user-invitation-form-async-action> `),l(null===(u=null===(h=this.data)||void 0===h?void 0:h._links["fx:revoke"])||void 0===u?void 0:u.href)),l(null===(x=null===(p=this.data)||void 0===p?void 0:p._links["fx:resend"])||void 0===x?void 0:x.href))}__renderUserSnapshotState({status:e,store_name:t}){var r,i,s,o,d,m,f,h;const u=null===(r=this.data)||void 0===r?void 0:r._links,p=this.hiddenSelector,x={"text-primary":"sent"===e,"text-success":"accepted"===e,"text-error":"rejected"===e};return n(L||(L=U` <div class="${0}"> <div class="border-t flex-1"></div> ${0} <div class="border-t flex-1"></div> </div> <foxy-i18n infer="" class="${0}" key="user_status_title" .options="${0}"> </foxy-i18n> <foxy-internal-summary-control infer="store"> <foxy-internal-text-control layout="summary-item" infer="store-domain" .getValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-email"> </foxy-internal-text-control> ${0} </foxy-internal-summary-control> <foxy-i18n class="block text-secondary text-center" infer="" key="user_status_text" .options="${0}"> </foxy-i18n> <foxy-internal-user-invitation-form-async-action theme="error" class="flex-1" infer="leave" href="${0}"> </foxy-internal-user-invitation-form-async-action> <div class="grid grid-cols-2 gap-m" ?hidden="${0}"> <foxy-internal-user-invitation-form-async-action theme="error primary" infer="reject" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-user-invitation-form-async-action theme="success primary" infer="accept" href="${0}"> </foxy-internal-user-invitation-form-async-action> </div> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),v(a({"flex items-center gap-m":!0},x)),c(B||(B=U`<svg style="height: 5rem; width: 5rem" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 256 256"><path fill="currentColor" fill-rule="evenodd" d="M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z" clip-rule="evenodd"/><path fill="currentColor" d="M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z"/></svg>`)),v(a({"block text-center text-xl font-medium":!0},x)),{context:e,store_name:t},this.__storeDomainGetValue,"accepted"===e&&this.getStorePageHref&&this.data?n(H||(H=U` <div ?hidden="${0}"> <a class="text-primary font-medium cursor-pointer rounded transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="store_link"></foxy-i18n> </a> </div> `),"accepted"!==e||!this.getStorePageHref,this.getStorePageHref(this.data._links["fx:store"].href)):"",{context:e,store_name:t},l(null!==(s=null===(i=null==u?void 0:u["fx:revoke"])||void 0===i?void 0:i.href)&&void 0!==s?s:null===(o=null==u?void 0:u["fx:reject"])||void 0===o?void 0:o.href),p.matches("reject",!0)&&p.matches("accept",!0),l(null===(m=null===(d=this.data)||void 0===d?void 0:d._links["fx:reject"])||void 0===m?void 0:m.href),l(null===(h=null===(f=this.data)||void 0===f?void 0:f._links["fx:accept"])||void 0===h?void 0:h.href))}}customElements.define("foxy-user-invitation-form",V);export{V as UserInvitationForm};
|
|
1
|
+
import"./shared-4332bafc.js";import"./shared-f892683b.js";import{I as e}from"./shared-ad26f72d.js";import"./shared-d1125001.js";import"./shared-515003f6.js";import{a as t}from"./shared-2bb1f0f4.js";import"./shared-9b35fe34.js";import{_ as r,B as a,aT as i,aU as s}from"./shared-8f9014ff.js";import{N as o}from"./shared-2b39e4d4.js";import{i as l}from"./shared-53e42a77.js";import{h as n,c as d,s as c}from"./shared-ba5c42c7.js";import{a as m}from"./shared-887ac0b0.js";import{a as f,g as h}from"./shared-37bdd118.js";import{c as u}from"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-db623837.js";import"./shared-6cdfb858.js";import"./shared-0fd68dc0.js";import"./shared-19073761.js";import"./shared-930e68b7.js";import"./shared-058530fc.js";import"./shared-69c98b7b.js";import"./shared-41c9c53f.js";import"./shared-609c9693.js";import"./foxy-copy-to-clipboard.js";import"./shared-9687ab7b.js";import"./shared-8d8975d5.js";import"./shared-99c53365.js";import"./shared-0f92b865.js";import"./shared-bab2ea2c.js";import"./shared-a0baefff.js";import"./shared-f8e360e6.js";import"./shared-9a3bf65c.js";import"./shared-a5d6db21.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-791b4510.js";import"./shared-9496e995.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-0e19bda5.js";let v,p=e=>e;customElements.define("foxy-internal-user-invitation-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return r(r({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const e=this.__state,t="fail"===e?"error":"idle"===e?this.theme:"";return n(v||(v=p` <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),l(null!=t?t:void 0),"busy"===e||this.disabled,this.__submit,e)}async __submit(){var e,t;if("busy"!==this.__state)try{this.__state="busy";const r=new o.API(this);(await r.fetch(null!==(e=this.href)&&void 0!==e?e:"",{method:"POST"})).ok?(null===(t=this.nucleon)||void 0===t||t.refresh(),this.__state="idle"):this.__state="fail"}catch(e){this.__state="fail"}}});let x,y,g,_,b,j,Z,w,S,$,k,C,M,U,L,B,H,V,D=e=>e;const P=m(e,"user-invitation-form");class A extends P{constructor(){super(...arguments),this.getStorePageHref=null,this.defaultDomain=null,this.currentStore=null,this.currentUser=null,this.layout=null,this.__storeDomainGetValue=()=>{var e;const t=this.defaultDomain,r=null===(e=this.data)||void 0===e?void 0:e.store_domain;return(null==r?void 0:r.includes("."))||!t?r:`${r}.${t}`}}static get properties(){return r(r({},super.properties),{},{getStorePageHref:{attribute:!1},defaultDomain:{attribute:"default-domain"},currentStore:{attribute:"current-store"},currentUser:{attribute:"current-user"},layout:{}})}static get styles(){return[...super.styles,d(x||(x=D`.inner-curve{--r:var(--lumo-border-radius-l);--s:3rem;--a:12deg;--m:0/calc(2 * var(--r)) var(--r) no-repeat radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);--d:(var(--s) + var(--r)) * cos(var(--a));border-radius:var(--r);width:100%;mask:calc(50% + var(--d)) var(--m),calc(50% - var(--d)) var(--m),radial-gradient(var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),#0000 100%,#000 calc(100% + 1px)) 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,linear-gradient(90deg,#000 calc(50% - var(--d)),#0000 0 calc(50% + var(--d)),#000 0)}`))]}static get v8n(){return[({email:e})=>!!e||"email:v8n_required"]}get readonlySelector(){const e=["store",super.readonlySelector.toString()];return new a(e.join(" ").trim())}get hiddenSelector(){var e,t;const r=["timestamps","submit","undo",super.hiddenSelector.toString()],i=null===(e=this.data)||void 0===e?void 0:e.status,s=null!==(t=this.layout)&&void 0!==t?t:"user";return"accepted"!==i&&"sent"!==i&&r.unshift("revoke"),"accepted"!==i&&r.unshift("leave"),"sent"!==i&&r.unshift("accept","reject"),"rejected"===i&&"user"===s||"expired"===i&&"admin"===s||"revoked"===i&&"admin"===s||r.unshift("delete"),"sent"===i&&"admin"===s||r.unshift("resend"),new a(r.join(" ").trim())}renderBody(){const{layout:e,data:t}=this;return"admin"===e?t?this.__renderAdminSnapshotState(t):this.__renderAdminTemplateState():t?this.__renderUserSnapshotState(t):this.__renderUserTemplateState()}async _fetch(...e){try{return await super._fetch(...e)}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("already been created for this email and store")?["error:invitation_exists"]:t.includes("already has access to this store")?["error:already_has_access"]:e}}__getGravatar(e){return i((function*(){yield n(y||(y=D` <div style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5"></div> `)),e&&(yield n(g||(g=D` <img data-testid="gravatar" style="height:5rem;width:5rem;left:calc(50% - 2.5rem);top:-2.8rem" class="rounded-full absolute top-0 bg-contrast-5 shadow-xs" src="${0}" alt=""> `),yield s(h(e))))}))()}__renderAdminTemplateState(){return n(_||(_=D` ${0} <foxy-internal-text-control infer="email"></foxy-internal-text-control> ${0} `),this.renderHeader(),super.renderBody())}__renderUserTemplateState(){return n(b||(b=D` <div class="p-xl flex items-center justify-center"> <foxy-spinner layout="vertical" infer="unavailable" state="empty"></foxy-spinner> </div> `))}__renderAdminSnapshotState({first_name:e,last_name:t,store_name:r,_links:a}){var i,s,o,d,m,h,v,p,x;const y=(null==e?void 0:e.trim())||(null==t?void 0:t.trim()),g={first_name:e,last_name:t,context:y?"":"empty"},_=null===(i=this.data)||void 0===i?void 0:i.status,b=this.hiddenSelector,U=this.currentStore&&this.currentUser&&(null==a?void 0:a["fx:store"])&&(null==a?void 0:a["fx:user"])&&this.currentStore===(null==a?void 0:a["fx:store"].href)&&this.currentUser===(null==a?void 0:a["fx:user"].href);return n(j||(j=D` <div style="padding-top:3.5rem"> <div class="relative"> <div class="inner-curve bg-contrast-5 absolute inset-0"></div> ${0} <div class="relative pb-m px-m leading-xs grid gap-m" style="padding-top:calc(2.5rem + var(--lumo-space-m))"> <div> <foxy-i18n class="block text-xl font-medium text-center" infer="" key="full_name" .options="${0}"> </foxy-i18n> <div class="text-m text-center text-secondary">${0}</div> </div> <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" class="${0}"> <p class="font-medium flex items-center gap-s"> ${0} <foxy-i18n infer="" key="admin_status_title" .options="${0}"> </foxy-i18n> </p> <p class="text-body" style="padding-left:calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))"> <foxy-i18n infer="" key="admin_status_text" .options="${0}"> </foxy-i18n> </p> </div> <div class="flex gap-m" ?hidden="${0}"> ${0} <foxy-internal-user-invitation-form-async-action infer="resend" class="flex-1" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-delete-control infer="delete" class="flex-1"> </foxy-internal-delete-control> </div> </div> </div> </div> `),f(this.__getGravatar(null===(s=this.data)||void 0===s?void 0:s.email)),g,null===(o=this.data)||void 0===o?void 0:o.email,u({"border rounded":!0,"border-contrast text-contrast":"revoked"===_||"expired"===_,"border-success text-success":"accepted"===_,"border-primary text-primary":"sent"===_,"border-error text-error":"rejected"===_}),"revoked"===_?c(Z||(Z=D`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z" clip-rule="evenodd" /></svg>`)):"sent"===_?c(w||(w=D`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z" clip-rule="evenodd" /></svg>`)):"rejected"===_?c(S||(S=D`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd" /></svg>`)):"accepted"===_?c($||($=D`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd" /></svg>`)):"expired"===_?c(k||(k=D`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" style="width: 1.25em; height: 1.25em"><path d="M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z" /><path fill-rule="evenodd" d="m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.133 2.845a.75.75 0 0 1 1.06 0l1.72 1.72 1.72-1.72a.75.75 0 1 1 1.06 1.06l-1.72 1.72 1.72 1.72a.75.75 0 1 1-1.06 1.06L12 15.685l-1.72 1.72a.75.75 0 1 1-1.06-1.06l1.72-1.72-1.72-1.72a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd" /></svg>`)):"",{context:_},{context:_},b.matches("revoke",!0)&&b.matches("resend",!0)&&b.matches("delete",!0),U?n(C||(C=D` <foxy-internal-post-action-control message-options="${0}" infer="revoke" class="flex-1" theme="error" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({store_domain:this.__storeDomainGetValue(),store_name:r}),l(null===(m=null===(d=this.data)||void 0===d?void 0:d._links["fx:revoke"])||void 0===m?void 0:m.href),(()=>this.dispatchEvent(new CustomEvent("selfrevoked")))):n(M||(M=D` <foxy-internal-user-invitation-form-async-action infer="revoke" class="flex-1" theme="error" href="${0}"> </foxy-internal-user-invitation-form-async-action> `),l(null===(v=null===(h=this.data)||void 0===h?void 0:h._links["fx:revoke"])||void 0===v?void 0:v.href)),l(null===(x=null===(p=this.data)||void 0===p?void 0:p._links["fx:resend"])||void 0===x?void 0:x.href))}__renderUserSnapshotState({status:e,store_name:t}){var a,i,s,o,d,m,f,h,v,p,x;const y=null===(a=this.data)||void 0===a?void 0:a._links,g=this.hiddenSelector,_={"text-primary":"sent"===e,"text-success":"accepted"===e,"text-error":"rejected"===e},b=this.currentStore&&this.currentUser&&(null==y?void 0:y["fx:store"])&&(null==y?void 0:y["fx:user"])&&this.currentStore===(null==y?void 0:y["fx:store"].href)&&this.currentUser===(null==y?void 0:y["fx:user"].href);return n(U||(U=D` <div class="${0}"> <div class="border-t flex-1"></div> ${0} <div class="border-t flex-1"></div> </div> <foxy-i18n infer="" class="${0}" key="user_status_title" .options="${0}"> </foxy-i18n> <foxy-internal-summary-control infer="store"> <foxy-internal-text-control layout="summary-item" infer="store-domain" .getValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-url"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="store-email"> </foxy-internal-text-control> ${0} </foxy-internal-summary-control> <foxy-i18n class="block text-secondary text-center" infer="" key="user_status_text" .options="${0}"> </foxy-i18n> ${0} <div class="grid grid-cols-2 gap-m" ?hidden="${0}"> <foxy-internal-user-invitation-form-async-action theme="error primary" infer="reject" href="${0}"> </foxy-internal-user-invitation-form-async-action> <foxy-internal-user-invitation-form-async-action theme="success primary" infer="accept" href="${0}"> </foxy-internal-user-invitation-form-async-action> </div> <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),u(r({"flex items-center gap-m":!0},_)),c(L||(L=D`<svg style="height: 5rem; width: 5rem" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 256 256"><path fill="currentColor" fill-rule="evenodd" d="M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z" clip-rule="evenodd"/><path fill="currentColor" d="M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z"/></svg>`)),u(r({"block text-center text-xl font-medium":!0},_)),{context:e,store_name:t},this.__storeDomainGetValue,"accepted"===e&&this.getStorePageHref&&this.data?n(B||(B=D` <div ?hidden="${0}"> <a class="text-primary font-medium cursor-pointer rounded transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="store_link"></foxy-i18n> </a> </div> `),"accepted"!==e||!this.getStorePageHref,this.getStorePageHref(this.data._links["fx:store"].href)):"",{context:e,store_name:t},b?n(H||(H=D` <foxy-internal-post-action-control message-options="${0}" infer="leave" class="flex-1" theme="error" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({store_domain:this.__storeDomainGetValue(),store_name:t}),l(null!==(s=null===(i=null==y?void 0:y["fx:revoke"])||void 0===i?void 0:i.href)&&void 0!==s?s:null===(o=null==y?void 0:y["fx:reject"])||void 0===o?void 0:o.href),(()=>this.dispatchEvent(new CustomEvent("selfrevoked")))):n(V||(V=D` <foxy-internal-user-invitation-form-async-action theme="error" class="flex-1" infer="leave" href="${0}"> </foxy-internal-user-invitation-form-async-action> `),l(null!==(m=null===(d=null==y?void 0:y["fx:revoke"])||void 0===d?void 0:d.href)&&void 0!==m?m:null===(f=null==y?void 0:y["fx:reject"])||void 0===f?void 0:f.href)),g.matches("reject",!0)&&g.matches("accept",!0),l(null===(v=null===(h=this.data)||void 0===h?void 0:h._links["fx:reject"])||void 0===v?void 0:v.href),l(null===(x=null===(p=this.data)||void 0===p?void 0:p._links["fx:accept"])||void 0===x?void 0:x.href))}}customElements.define("foxy-user-invitation-form",A);export{A as UserInvitationForm};
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
"per_page": "Items per page:",
|
|
329
329
|
"card": {
|
|
330
330
|
"price": "{{amount, price}}",
|
|
331
|
-
"time": "{{value, time}}",
|
|
331
|
+
"time": "{{value, date}} at {{value, time}}",
|
|
332
332
|
"test": "Test",
|
|
333
333
|
"folder_no_name": "New folder",
|
|
334
334
|
"hidden_hint": "This transaction is archived",
|
|
@@ -27,7 +27,16 @@
|
|
|
27
27
|
"leave": {
|
|
28
28
|
"idle": "Leave this store",
|
|
29
29
|
"busy": "Leaving...",
|
|
30
|
-
"fail": "Failed to leave"
|
|
30
|
+
"fail": "Failed to leave",
|
|
31
|
+
"message_idle": "You are about to remove your own access to {{ store_name }} ({{ store_domain }}). Are you sure you want to proceed? If you need access to this store again in the future, you will need to be re-invited by another user of the store.",
|
|
32
|
+
"message_fail": "Failed to revoke access. If you'd like to retry, close this dialog and click the revoke button again.",
|
|
33
|
+
"message_done": "Your access was revoked successfully. Close this dialog to continue.",
|
|
34
|
+
"button_close": "Close",
|
|
35
|
+
"button_confirm": "Leave this store",
|
|
36
|
+
"button_cancel": "Cancel",
|
|
37
|
+
"loading_busy": "Processing",
|
|
38
|
+
"header": "Confirmation Required",
|
|
39
|
+
"button": "Leave this store"
|
|
31
40
|
},
|
|
32
41
|
"revoke": {
|
|
33
42
|
"idle": "Revoke access",
|
|
@@ -104,4 +113,4 @@
|
|
|
104
113
|
"loading_busy": "Loading",
|
|
105
114
|
"loading_error": "Unknown error"
|
|
106
115
|
}
|
|
107
|
-
}
|
|
116
|
+
}
|
|
@@ -15,7 +15,9 @@ export declare class UserInvitationForm extends Base<Data> {
|
|
|
15
15
|
getStorePageHref: ((storeHref: string) => string) | null;
|
|
16
16
|
/** Default host domain for stores that don't use a custom domain name, e.g. `foxycart.com`. */
|
|
17
17
|
defaultDomain: string | null;
|
|
18
|
-
/** Currently
|
|
18
|
+
/** Currently viewed store URL. Used for determining when to emit `selfrevoked` event. */
|
|
19
|
+
currentStore: string | null;
|
|
20
|
+
/** Currently logged in user resource URL. Used for determining when to emit `selfrevoked` event. */
|
|
19
21
|
currentUser: string | null;
|
|
20
22
|
/** Admin layout will display user info, user layout (default) will display store info. */
|
|
21
23
|
layout: 'admin' | 'user' | null;
|
|
@@ -15,7 +15,9 @@ export class UserInvitationForm extends Base {
|
|
|
15
15
|
this.getStorePageHref = null;
|
|
16
16
|
/** Default host domain for stores that don't use a custom domain name, e.g. `foxycart.com`. */
|
|
17
17
|
this.defaultDomain = null;
|
|
18
|
-
/** Currently
|
|
18
|
+
/** Currently viewed store URL. Used for determining when to emit `selfrevoked` event. */
|
|
19
|
+
this.currentStore = null;
|
|
20
|
+
/** Currently logged in user resource URL. Used for determining when to emit `selfrevoked` event. */
|
|
19
21
|
this.currentUser = null;
|
|
20
22
|
/** Admin layout will display user info, user layout (default) will display store info. */
|
|
21
23
|
this.layout = null;
|
|
@@ -31,6 +33,7 @@ export class UserInvitationForm extends Base {
|
|
|
31
33
|
...super.properties,
|
|
32
34
|
getStorePageHref: { attribute: false },
|
|
33
35
|
defaultDomain: { attribute: 'default-domain' },
|
|
36
|
+
currentStore: { attribute: 'current-store' },
|
|
34
37
|
currentUser: { attribute: 'current-user' },
|
|
35
38
|
layout: {},
|
|
36
39
|
};
|
|
@@ -158,6 +161,10 @@ export class UserInvitationForm extends Base {
|
|
|
158
161
|
const nameOptions = { first_name, last_name, context: hasName ? '' : 'empty' };
|
|
159
162
|
const status = (_a = this.data) === null || _a === void 0 ? void 0 : _a.status;
|
|
160
163
|
const hidden = this.hiddenSelector;
|
|
164
|
+
const isOwnInvitationForCurrentStore = this.currentStore &&
|
|
165
|
+
this.currentUser && (_links === null || _links === void 0 ? void 0 : _links['fx:store']) && (_links === null || _links === void 0 ? void 0 : _links['fx:user']) &&
|
|
166
|
+
this.currentStore === (_links === null || _links === void 0 ? void 0 : _links['fx:store'].href) &&
|
|
167
|
+
this.currentUser === (_links === null || _links === void 0 ? void 0 : _links['fx:user'].href);
|
|
161
168
|
return html `
|
|
162
169
|
<div style="padding-top: 3.5rem">
|
|
163
170
|
<div class="relative">
|
|
@@ -220,7 +227,7 @@ export class UserInvitationForm extends Base {
|
|
|
220
227
|
hidden.matches('resend', true) &&
|
|
221
228
|
hidden.matches('delete', true)}
|
|
222
229
|
>
|
|
223
|
-
${
|
|
230
|
+
${isOwnInvitationForCurrentStore
|
|
224
231
|
? html `
|
|
225
232
|
<foxy-internal-post-action-control
|
|
226
233
|
message-options=${JSON.stringify({
|
|
@@ -261,7 +268,7 @@ export class UserInvitationForm extends Base {
|
|
|
261
268
|
`;
|
|
262
269
|
}
|
|
263
270
|
__renderUserSnapshotState({ status, store_name }) {
|
|
264
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
271
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
265
272
|
const links = (_a = this.data) === null || _a === void 0 ? void 0 : _a._links;
|
|
266
273
|
const hidden = this.hiddenSelector;
|
|
267
274
|
const textColorMap = {
|
|
@@ -269,6 +276,10 @@ export class UserInvitationForm extends Base {
|
|
|
269
276
|
'text-success': status === 'accepted',
|
|
270
277
|
'text-error': status === 'rejected',
|
|
271
278
|
};
|
|
279
|
+
const isOwnInvitationForCurrentStore = this.currentStore &&
|
|
280
|
+
this.currentUser && (links === null || links === void 0 ? void 0 : links['fx:store']) && (links === null || links === void 0 ? void 0 : links['fx:user']) &&
|
|
281
|
+
this.currentStore === (links === null || links === void 0 ? void 0 : links['fx:store'].href) &&
|
|
282
|
+
this.currentUser === (links === null || links === void 0 ? void 0 : links['fx:user'].href);
|
|
272
283
|
return html `
|
|
273
284
|
<div class=${classMap({ 'flex items-center gap-m': true, ...textColorMap })}>
|
|
274
285
|
<div class="border-t flex-1"></div>
|
|
@@ -317,13 +328,30 @@ export class UserInvitationForm extends Base {
|
|
|
317
328
|
>
|
|
318
329
|
</foxy-i18n>
|
|
319
330
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
331
|
+
${isOwnInvitationForCurrentStore
|
|
332
|
+
? html `
|
|
333
|
+
<foxy-internal-post-action-control
|
|
334
|
+
message-options=${JSON.stringify({
|
|
335
|
+
store_domain: this.__storeDomainGetValue(),
|
|
336
|
+
store_name,
|
|
337
|
+
})}
|
|
338
|
+
infer="leave"
|
|
339
|
+
class="flex-1"
|
|
340
|
+
theme="error"
|
|
341
|
+
href=${ifDefined((_c = (_b = links === null || links === void 0 ? void 0 : links['fx:revoke']) === null || _b === void 0 ? void 0 : _b.href) !== null && _c !== void 0 ? _c : (_d = links === null || links === void 0 ? void 0 : links['fx:reject']) === null || _d === void 0 ? void 0 : _d.href)}
|
|
342
|
+
@success=${() => this.dispatchEvent(new CustomEvent('selfrevoked'))}
|
|
343
|
+
>
|
|
344
|
+
</foxy-internal-post-action-control>
|
|
345
|
+
`
|
|
346
|
+
: html `
|
|
347
|
+
<foxy-internal-user-invitation-form-async-action
|
|
348
|
+
theme="error"
|
|
349
|
+
class="flex-1"
|
|
350
|
+
infer="leave"
|
|
351
|
+
href=${ifDefined((_f = (_e = links === null || links === void 0 ? void 0 : links['fx:revoke']) === null || _e === void 0 ? void 0 : _e.href) !== null && _f !== void 0 ? _f : (_g = links === null || links === void 0 ? void 0 : links['fx:reject']) === null || _g === void 0 ? void 0 : _g.href)}
|
|
352
|
+
>
|
|
353
|
+
</foxy-internal-user-invitation-form-async-action>
|
|
354
|
+
`}
|
|
327
355
|
|
|
328
356
|
<div
|
|
329
357
|
class="grid grid-cols-2 gap-m"
|
|
@@ -332,14 +360,14 @@ export class UserInvitationForm extends Base {
|
|
|
332
360
|
<foxy-internal-user-invitation-form-async-action
|
|
333
361
|
theme="error primary"
|
|
334
362
|
infer="reject"
|
|
335
|
-
href=${ifDefined((
|
|
363
|
+
href=${ifDefined((_j = (_h = this.data) === null || _h === void 0 ? void 0 : _h._links['fx:reject']) === null || _j === void 0 ? void 0 : _j.href)}
|
|
336
364
|
>
|
|
337
365
|
</foxy-internal-user-invitation-form-async-action>
|
|
338
366
|
|
|
339
367
|
<foxy-internal-user-invitation-form-async-action
|
|
340
368
|
theme="success primary"
|
|
341
369
|
infer="accept"
|
|
342
|
-
href=${ifDefined((
|
|
370
|
+
href=${ifDefined((_l = (_k = this.data) === null || _k === void 0 ? void 0 : _k._links['fx:accept']) === null || _l === void 0 ? void 0 : _l.href)}
|
|
343
371
|
>
|
|
344
372
|
</foxy-internal-user-invitation-form-async-action>
|
|
345
373
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInvitationForm.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/UserInvitationForm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAwC;AACjE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,oDAAiD;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,oCAAiC;AAEpD,MAAM,EAAE,GAAG,sBAAsB,CAAC;AAClC,MAAM,IAAI,GAAG,iBAAiB,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;AAEjD,MAAM,OAAO,kBAAmB,SAAQ,IAAU;IAAlD;;QA0CE,wEAAwE;QACxE,qBAAgB,GAA2C,IAAI,CAAC;QAEhE,+FAA+F;QAC/F,kBAAa,GAAkB,IAAI,CAAC;QAEpC,6FAA6F;QAC7F,gBAAW,GAAkB,IAAI,CAAC;QAElC,0FAA0F;QAC1F,WAAM,GAA4B,IAAI,CAAC;QAEtB,0BAAqB,GAAG,GAAG,EAAE;;YAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC;YACpC,MAAM,MAAM,SAAG,IAAI,CAAC,IAAI,0CAAE,YAAY,CAAC;YACvC,OAAO,CA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,EAAE,MAAM,EAAE,UAAU,EAAE;;;;;;;;sBAQ5B,IAAI,CAAC,qBAAqB;;;;;;;UAOtC,MAAM,KAAK,UAAU,IAAI,IAAI,CAAC,gBAAgB,IAAI,IAAI,CAAC,IAAI;YAC3D,CAAC,CAAC,IAAI,CAAA;6BACa,MAAM,KAAK,UAAU,IAAI,CAAC,IAAI,CAAC,gBAAgB;;;yBAGnD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;;;;;aAKpE;YACH,CAAC,CAAC,EAAE;;;;;;;mBAOK,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE;;;;;;;;eAQnC,SAAS,aAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,WAAW,2CAAG,IAAI,yCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,WAAW,2CAAG,IAAI,CAAC;;;;;;kBAMhE,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;;;;;iBAKjE,SAAS,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,WAAW,2CAAG,IAAI,CAAC;;;;;;;iBAO/C,SAAS,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,WAAW,2CAAG,IAAI,CAAC;;;;;;KAM3D,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { getGravatarUrl } from '../../../utils/get-gravatar-url';\nimport { html, svg, css } from 'lit-element';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { asyncReplace } from 'lit-html/directives/async-replace';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { classMap } from '../../../utils/class-map';\n\nconst NS = 'user-invitation-form';\nconst Base = TranslatableMixin(InternalForm, NS);\n\nexport class UserInvitationForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n getStorePageHref: { attribute: false },\n defaultDomain: { attribute: 'default-domain' },\n currentUser: { attribute: 'current-user' },\n layout: {},\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n .inner-curve {\n --r: var(--lumo-border-radius-l); /* control the rounded part */\n --s: 3rem; /* control the size of the cut */\n --a: 12deg; /* control the depth of the curvature */\n --m: 0 / calc(2 * var(--r)) var(--r) no-repeat\n radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);\n --d: (var(--s) + var(--r)) * cos(var(--a));\n\n border-radius: var(--r);\n width: 100%;\n mask: calc(50% + var(--d)) var(--m), calc(50% - var(--d)) var(--m),\n radial-gradient(\n var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),\n #0000 100%,\n #000 calc(100% + 1px)\n )\n 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,\n linear-gradient(90deg, #000 calc(50% - var(--d)), #0000 0 calc(50% + var(--d)), #000 0);\n }\n `,\n ];\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [({ email: v }) => !!v || 'email:v8n_required'];\n }\n\n /** When provided, displays a link to Store Dashboard in user layout. */\n getStorePageHref: ((storeHref: string) => string) | null = null;\n\n /** Default host domain for stores that don't use a custom domain name, e.g. `foxycart.com`. */\n defaultDomain: string | null = null;\n\n /** Currently logged in user resource URL. Used to display a warning when revoking access. */\n currentUser: string | null = null;\n\n /** Admin layout will display user info, user layout (default) will display store info. */\n layout: 'admin' | 'user' | null = null;\n\n private readonly __storeDomainGetValue = () => {\n const defaultD = this.defaultDomain;\n const domain = this.data?.store_domain;\n return domain?.includes('.') || !defaultD ? domain : `${domain}.${defaultD}`;\n };\n\n get readonlySelector(): BooleanSelector {\n const alwaysMatch = ['store', super.readonlySelector.toString()];\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = ['timestamps', 'submit', 'undo', super.hiddenSelector.toString()];\n const status = this.data?.status;\n const layout = this.layout ?? 'user';\n\n if (status !== 'accepted' && status !== 'sent') alwaysMatch.unshift('revoke');\n if (status !== 'accepted') alwaysMatch.unshift('leave');\n if (status !== 'sent') alwaysMatch.unshift('accept', 'reject');\n\n if (\n (status !== 'rejected' || layout !== 'user') &&\n (status !== 'expired' || layout !== 'admin') &&\n (status !== 'revoked' || layout !== 'admin')\n ) {\n alwaysMatch.unshift('delete');\n }\n\n if (status !== 'sent' || layout !== 'admin') {\n alwaysMatch.unshift('resend');\n }\n\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n renderBody(): TemplateResult {\n const { layout, data } = this;\n\n if (layout === 'admin') {\n return data ? this.__renderAdminSnapshotState(data) : this.__renderAdminTemplateState();\n } else {\n return data ? this.__renderUserSnapshotState(data) : this.__renderUserTemplateState();\n }\n }\n\n protected async _fetch<TResult = Data>(...args: Parameters<Window['fetch']>): Promise<TResult> {\n try {\n return await super._fetch(...args);\n } catch (err) {\n let message;\n\n try {\n message = (await (err as Response).json())._embedded['fx:errors'][0].message;\n } catch {\n throw err;\n }\n\n if (message.includes('already been created for this email and store')) {\n throw ['error:invitation_exists'];\n } else if (message.includes('already has access to this store')) {\n throw ['error:already_has_access'];\n } else {\n throw err;\n }\n }\n }\n\n private async *__getGravatar(email?: string) {\n yield html`\n <div\n style=\"height: 5rem; width: 5rem; left: calc(50% - 2.5rem); top: -2.8rem\"\n class=\"rounded-full absolute top-0 bg-contrast-5\"\n ></div>\n `;\n\n if (email) {\n yield html`\n <img\n data-testid=\"gravatar\"\n style=\"height: 5rem; width: 5rem; left: calc(50% - 2.5rem); top: -2.8rem\"\n class=\"rounded-full absolute top-0 bg-contrast-5 shadow-xs\"\n src=${await getGravatarUrl(email)}\n alt=\"\"\n />\n `;\n }\n }\n\n private __renderAdminTemplateState() {\n return html`\n ${this.renderHeader()}\n <foxy-internal-text-control infer=\"email\"></foxy-internal-text-control>\n ${super.renderBody()}\n `;\n }\n\n private __renderUserTemplateState() {\n return html`\n <div class=\"p-xl flex items-center justify-center\">\n <foxy-spinner layout=\"vertical\" infer=\"unavailable\" state=\"empty\"></foxy-spinner>\n </div>\n `;\n }\n\n private __renderAdminSnapshotState({ first_name, last_name, store_name, _links }: Data) {\n const hasName = first_name?.trim() || last_name?.trim();\n const nameOptions = { first_name, last_name, context: hasName ? '' : 'empty' };\n const status = this.data?.status;\n const hidden = this.hiddenSelector;\n\n return html`\n <div style=\"padding-top: 3.5rem\">\n <div class=\"relative\">\n <div class=\"inner-curve bg-contrast-5 absolute inset-0\"></div>\n ${asyncReplace(this.__getGravatar(this.data?.email))}\n\n <div\n class=\"relative pb-m px-m leading-xs grid gap-m\"\n style=\"padding-top: calc(2.5rem + var(--lumo-space-m))\"\n >\n <div>\n <foxy-i18n\n class=\"block text-xl font-medium text-center\"\n infer=\"\"\n key=\"full_name\"\n .options=${nameOptions}\n >\n </foxy-i18n>\n <div class=\"text-m text-center text-secondary\">${this.data?.email}</div>\n </div>\n\n <div\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n class=${classMap({\n 'border rounded': true,\n 'border-contrast text-contrast': status === 'revoked' || status === 'expired',\n 'border-success text-success': status === 'accepted',\n 'border-primary text-primary': status === 'sent',\n 'border-error text-error': status === 'rejected',\n })}\n >\n <p class=\"font-medium flex items-center gap-s\">\n ${status === 'revoked'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'sent'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'rejected'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'accepted'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'expired'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path d=\"M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z\" /><path fill-rule=\"evenodd\" d=\"m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.133 2.845a.75.75 0 0 1 1.06 0l1.72 1.72 1.72-1.72a.75.75 0 1 1 1.06 1.06l-1.72 1.72 1.72 1.72a.75.75 0 1 1-1.06 1.06L12 15.685l-1.72 1.72a.75.75 0 1 1-1.06-1.06l1.72-1.72-1.72-1.72a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" /></svg>`\n : ''}\n <foxy-i18n infer=\"\" key=\"admin_status_title\" .options=${{ context: status }}>\n </foxy-i18n>\n </p>\n\n <p\n class=\"text-body\"\n style=\"padding-left: calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))\"\n >\n <foxy-i18n infer=\"\" key=\"admin_status_text\" .options=${{ context: status }}>\n </foxy-i18n>\n </p>\n </div>\n\n <div\n class=\"flex gap-m\"\n ?hidden=${hidden.matches('revoke', true) &&\n hidden.matches('resend', true) &&\n hidden.matches('delete', true)}\n >\n ${this.currentUser && _links['fx:user'] && this.currentUser === _links['fx:user'].href\n ? html`\n <foxy-internal-post-action-control\n message-options=${JSON.stringify({\n store_domain: this.__storeDomainGetValue(),\n store_name,\n })}\n infer=\"revoke\"\n class=\"flex-1\"\n theme=\"error\"\n href=${ifDefined(this.data?._links['fx:revoke']?.href)}\n @success=${() => this.dispatchEvent(new CustomEvent('selfrevoked'))}\n >\n </foxy-internal-post-action-control>\n `\n : html`\n <foxy-internal-user-invitation-form-async-action\n infer=\"revoke\"\n class=\"flex-1\"\n theme=\"error\"\n href=${ifDefined(this.data?._links['fx:revoke']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n `}\n\n <foxy-internal-user-invitation-form-async-action\n infer=\"resend\"\n class=\"flex-1\"\n href=${ifDefined(this.data?._links['fx:resend']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n\n <foxy-internal-delete-control infer=\"delete\" class=\"flex-1\">\n </foxy-internal-delete-control>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n private __renderUserSnapshotState({ status, store_name }: Data) {\n const links = this.data?._links;\n const hidden = this.hiddenSelector;\n const textColorMap = {\n 'text-primary': status === 'sent',\n 'text-success': status === 'accepted',\n 'text-error': status === 'rejected',\n };\n\n return html`\n <div class=${classMap({ 'flex items-center gap-m': true, ...textColorMap })}>\n <div class=\"border-t flex-1\"></div>\n ${svg`<svg style=\"height: 5rem; width: 5rem\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 256 256\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z\" clip-rule=\"evenodd\"/><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z\" clip-rule=\"evenodd\"/><path fill=\"currentColor\" d=\"M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z\"/></svg>`}\n <div class=\"border-t flex-1\"></div>\n </div>\n\n <foxy-i18n\n infer=\"\"\n class=${classMap({ 'block text-center text-xl font-medium': true, ...textColorMap })}\n key=\"user_status_title\"\n .options=${{ context: status, store_name }}\n >\n </foxy-i18n>\n\n <foxy-internal-summary-control infer=\"store\">\n <foxy-internal-text-control\n layout=\"summary-item\"\n infer=\"store-domain\"\n .getValue=${this.__storeDomainGetValue}\n >\n </foxy-internal-text-control>\n <foxy-internal-text-control layout=\"summary-item\" infer=\"store-url\">\n </foxy-internal-text-control>\n <foxy-internal-text-control layout=\"summary-item\" infer=\"store-email\">\n </foxy-internal-text-control>\n ${status === 'accepted' && this.getStorePageHref && this.data\n ? html`\n <div ?hidden=${status !== 'accepted' || !this.getStorePageHref}>\n <a\n class=\"text-primary font-medium cursor-pointer rounded transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50\"\n href=${this.getStorePageHref(this.data._links['fx:store'].href)}\n >\n <foxy-i18n infer=\"\" key=\"store_link\"></foxy-i18n>\n </a>\n </div>\n `\n : ''}\n </foxy-internal-summary-control>\n\n <foxy-i18n\n class=\"block text-secondary text-center\"\n infer=\"\"\n key=\"user_status_text\"\n .options=${{ context: status, store_name }}\n >\n </foxy-i18n>\n\n <foxy-internal-user-invitation-form-async-action\n theme=\"error\"\n class=\"flex-1\"\n infer=\"leave\"\n href=${ifDefined(links?.['fx:revoke']?.href ?? links?.['fx:reject']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n\n <div\n class=\"grid grid-cols-2 gap-m\"\n ?hidden=${hidden.matches('reject', true) && hidden.matches('accept', true)}\n >\n <foxy-internal-user-invitation-form-async-action\n theme=\"error primary\"\n infer=\"reject\"\n href=${ifDefined(this.data?._links['fx:reject']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n\n <foxy-internal-user-invitation-form-async-action\n theme=\"success primary\"\n infer=\"accept\"\n href=${ifDefined(this.data?._links['fx:accept']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n </div>\n\n <foxy-internal-delete-control infer=\"delete\"></foxy-internal-delete-control>\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"UserInvitationForm.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/UserInvit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AAa,CAAC,CAAC;;;WAGtE;YACH,CAAC,CAAC,IAAI,CAAA;;;;;qBAKO,SAAS,aAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,WAAW,2CAAG,IAAI,yCAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,WAAW,2CAAG,IAAI,CAAC;;;WAG7E;;;;kBAIO,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC;;;;;iBAKjE,SAAS,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,WAAW,2CAAG,IAAI,CAAC;;;;;;;iBAO/C,SAAS,aAAC,IAAI,CAAC,IAAI,0CAAE,MAAM,CAAC,WAAW,2CAAG,IAAI,CAAC;;;;;;KAM3D,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { CSSResultArray, PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Data } from './types';\n\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { BooleanSelector } from '@foxy.io/sdk/core';\nimport { getGravatarUrl } from '../../../utils/get-gravatar-url';\nimport { html, svg, css } from 'lit-element';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { asyncReplace } from 'lit-html/directives/async-replace';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { classMap } from '../../../utils/class-map';\n\nconst NS = 'user-invitation-form';\nconst Base = TranslatableMixin(InternalForm, NS);\n\nexport class UserInvitationForm extends Base<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n getStorePageHref: { attribute: false },\n defaultDomain: { attribute: 'default-domain' },\n currentStore: { attribute: 'current-store' },\n currentUser: { attribute: 'current-user' },\n layout: {},\n };\n }\n\n static get styles(): CSSResultArray {\n return [\n ...super.styles,\n css`\n .inner-curve {\n --r: var(--lumo-border-radius-l); /* control the rounded part */\n --s: 3rem; /* control the size of the cut */\n --a: 12deg; /* control the depth of the curvature */\n --m: 0 / calc(2 * var(--r)) var(--r) no-repeat\n radial-gradient(50% 100% at bottom, #000 calc(100% - 1px), #0000);\n --d: (var(--s) + var(--r)) * cos(var(--a));\n\n border-radius: var(--r);\n width: 100%;\n mask: calc(50% + var(--d)) var(--m), calc(50% - var(--d)) var(--m),\n radial-gradient(\n var(--s) at 50% calc(-1 * sin(var(--a)) * var(--s)),\n #0000 100%,\n #000 calc(100% + 1px)\n )\n 0 calc(var(--r) * (1 - sin(var(--a)))) no-repeat,\n linear-gradient(90deg, #000 calc(50% - var(--d)), #0000 0 calc(50% + var(--d)), #000 0);\n }\n `,\n ];\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [({ email: v }) => !!v || 'email:v8n_required'];\n }\n\n /** When provided, displays a link to Store Dashboard in user layout. */\n getStorePageHref: ((storeHref: string) => string) | null = null;\n\n /** Default host domain for stores that don't use a custom domain name, e.g. `foxycart.com`. */\n defaultDomain: string | null = null;\n\n /** Currently viewed store URL. Used for determining when to emit `selfrevoked` event. */\n currentStore: string | null = null;\n\n /** Currently logged in user resource URL. Used for determining when to emit `selfrevoked` event. */\n currentUser: string | null = null;\n\n /** Admin layout will display user info, user layout (default) will display store info. */\n layout: 'admin' | 'user' | null = null;\n\n private readonly __storeDomainGetValue = () => {\n const defaultD = this.defaultDomain;\n const domain = this.data?.store_domain;\n return domain?.includes('.') || !defaultD ? domain : `${domain}.${defaultD}`;\n };\n\n get readonlySelector(): BooleanSelector {\n const alwaysMatch = ['store', super.readonlySelector.toString()];\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch = ['timestamps', 'submit', 'undo', super.hiddenSelector.toString()];\n const status = this.data?.status;\n const layout = this.layout ?? 'user';\n\n if (status !== 'accepted' && status !== 'sent') alwaysMatch.unshift('revoke');\n if (status !== 'accepted') alwaysMatch.unshift('leave');\n if (status !== 'sent') alwaysMatch.unshift('accept', 'reject');\n\n if (\n (status !== 'rejected' || layout !== 'user') &&\n (status !== 'expired' || layout !== 'admin') &&\n (status !== 'revoked' || layout !== 'admin')\n ) {\n alwaysMatch.unshift('delete');\n }\n\n if (status !== 'sent' || layout !== 'admin') {\n alwaysMatch.unshift('resend');\n }\n\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n renderBody(): TemplateResult {\n const { layout, data } = this;\n\n if (layout === 'admin') {\n return data ? this.__renderAdminSnapshotState(data) : this.__renderAdminTemplateState();\n } else {\n return data ? this.__renderUserSnapshotState(data) : this.__renderUserTemplateState();\n }\n }\n\n protected async _fetch<TResult = Data>(...args: Parameters<Window['fetch']>): Promise<TResult> {\n try {\n return await super._fetch(...args);\n } catch (err) {\n let message;\n\n try {\n message = (await (err as Response).json())._embedded['fx:errors'][0].message;\n } catch {\n throw err;\n }\n\n if (message.includes('already been created for this email and store')) {\n throw ['error:invitation_exists'];\n } else if (message.includes('already has access to this store')) {\n throw ['error:already_has_access'];\n } else {\n throw err;\n }\n }\n }\n\n private async *__getGravatar(email?: string) {\n yield html`\n <div\n style=\"height: 5rem; width: 5rem; left: calc(50% - 2.5rem); top: -2.8rem\"\n class=\"rounded-full absolute top-0 bg-contrast-5\"\n ></div>\n `;\n\n if (email) {\n yield html`\n <img\n data-testid=\"gravatar\"\n style=\"height: 5rem; width: 5rem; left: calc(50% - 2.5rem); top: -2.8rem\"\n class=\"rounded-full absolute top-0 bg-contrast-5 shadow-xs\"\n src=${await getGravatarUrl(email)}\n alt=\"\"\n />\n `;\n }\n }\n\n private __renderAdminTemplateState() {\n return html`\n ${this.renderHeader()}\n <foxy-internal-text-control infer=\"email\"></foxy-internal-text-control>\n ${super.renderBody()}\n `;\n }\n\n private __renderUserTemplateState() {\n return html`\n <div class=\"p-xl flex items-center justify-center\">\n <foxy-spinner layout=\"vertical\" infer=\"unavailable\" state=\"empty\"></foxy-spinner>\n </div>\n `;\n }\n\n private __renderAdminSnapshotState({ first_name, last_name, store_name, _links }: Data) {\n const hasName = first_name?.trim() || last_name?.trim();\n const nameOptions = { first_name, last_name, context: hasName ? '' : 'empty' };\n const status = this.data?.status;\n const hidden = this.hiddenSelector;\n\n const isOwnInvitationForCurrentStore =\n this.currentStore &&\n this.currentUser &&\n _links?.['fx:store'] &&\n _links?.['fx:user'] &&\n this.currentStore === _links?.['fx:store'].href &&\n this.currentUser === _links?.['fx:user'].href;\n\n return html`\n <div style=\"padding-top: 3.5rem\">\n <div class=\"relative\">\n <div class=\"inner-curve bg-contrast-5 absolute inset-0\"></div>\n ${asyncReplace(this.__getGravatar(this.data?.email))}\n\n <div\n class=\"relative pb-m px-m leading-xs grid gap-m\"\n style=\"padding-top: calc(2.5rem + var(--lumo-space-m))\"\n >\n <div>\n <foxy-i18n\n class=\"block text-xl font-medium text-center\"\n infer=\"\"\n key=\"full_name\"\n .options=${nameOptions}\n >\n </foxy-i18n>\n <div class=\"text-m text-center text-secondary\">${this.data?.email}</div>\n </div>\n\n <div\n style=\"padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)\"\n class=${classMap({\n 'border rounded': true,\n 'border-contrast text-contrast': status === 'revoked' || status === 'expired',\n 'border-success text-success': status === 'accepted',\n 'border-primary text-primary': status === 'sent',\n 'border-error text-error': status === 'rejected',\n })}\n >\n <p class=\"font-medium flex items-center gap-s\">\n ${status === 'revoked'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm3 10.5a.75.75 0 0 0 0-1.5H9a.75.75 0 0 0 0 1.5h6Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'sent'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'rejected'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'accepted'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path fill-rule=\"evenodd\" d=\"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z\" clip-rule=\"evenodd\" /></svg>`\n : status === 'expired'\n ? svg`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=\"width: 1.25em; height: 1.25em\"><path d=\"M3.375 3C2.339 3 1.5 3.84 1.5 4.875v.75c0 1.036.84 1.875 1.875 1.875h17.25c1.035 0 1.875-.84 1.875-1.875v-.75C22.5 3.839 21.66 3 20.625 3H3.375Z\" /><path fill-rule=\"evenodd\" d=\"m3.087 9 .54 9.176A3 3 0 0 0 6.62 21h10.757a3 3 0 0 0 2.995-2.824L20.913 9H3.087Zm6.133 2.845a.75.75 0 0 1 1.06 0l1.72 1.72 1.72-1.72a.75.75 0 1 1 1.06 1.06l-1.72 1.72 1.72 1.72a.75.75 0 1 1-1.06 1.06L12 15.685l-1.72 1.72a.75.75 0 1 1-1.06-1.06l1.72-1.72-1.72-1.72a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" /></svg>`\n : ''}\n <foxy-i18n infer=\"\" key=\"admin_status_title\" .options=${{ context: status }}>\n </foxy-i18n>\n </p>\n\n <p\n class=\"text-body\"\n style=\"padding-left: calc((1.25 * var(--lumo-font-size-m)) + var(--lumo-space-s))\"\n >\n <foxy-i18n infer=\"\" key=\"admin_status_text\" .options=${{ context: status }}>\n </foxy-i18n>\n </p>\n </div>\n\n <div\n class=\"flex gap-m\"\n ?hidden=${hidden.matches('revoke', true) &&\n hidden.matches('resend', true) &&\n hidden.matches('delete', true)}\n >\n ${isOwnInvitationForCurrentStore\n ? html`\n <foxy-internal-post-action-control\n message-options=${JSON.stringify({\n store_domain: this.__storeDomainGetValue(),\n store_name,\n })}\n infer=\"revoke\"\n class=\"flex-1\"\n theme=\"error\"\n href=${ifDefined(this.data?._links['fx:revoke']?.href)}\n @success=${() => this.dispatchEvent(new CustomEvent('selfrevoked'))}\n >\n </foxy-internal-post-action-control>\n `\n : html`\n <foxy-internal-user-invitation-form-async-action\n infer=\"revoke\"\n class=\"flex-1\"\n theme=\"error\"\n href=${ifDefined(this.data?._links['fx:revoke']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n `}\n\n <foxy-internal-user-invitation-form-async-action\n infer=\"resend\"\n class=\"flex-1\"\n href=${ifDefined(this.data?._links['fx:resend']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n\n <foxy-internal-delete-control infer=\"delete\" class=\"flex-1\">\n </foxy-internal-delete-control>\n </div>\n </div>\n </div>\n </div>\n `;\n }\n\n private __renderUserSnapshotState({ status, store_name }: Data) {\n const links = this.data?._links;\n const hidden = this.hiddenSelector;\n const textColorMap = {\n 'text-primary': status === 'sent',\n 'text-success': status === 'accepted',\n 'text-error': status === 'rejected',\n };\n\n const isOwnInvitationForCurrentStore =\n this.currentStore &&\n this.currentUser &&\n links?.['fx:store'] &&\n links?.['fx:user'] &&\n this.currentStore === links?.['fx:store'].href &&\n this.currentUser === links?.['fx:user'].href;\n\n return html`\n <div class=${classMap({ 'flex items-center gap-m': true, ...textColorMap })}>\n <div class=\"border-t flex-1\"></div>\n ${svg`<svg style=\"height: 5rem; width: 5rem\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 256 256\"><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M128 250c67.38 0 122-54.62 122-122S195.38 6 128 6 6 60.62 6 128s54.62 122 122 122Zm0 6c70.7 0 128-57.3 128-128S198.7 0 128 0 0 57.3 0 128s57.3 128 128 128Z\" clip-rule=\"evenodd\"/><path fill=\"currentColor\" fill-rule=\"evenodd\" d=\"M128.5 218a89.5 89.5 0 1 0 0-179 89.5 89.5 0 0 0 0 179Zm23.8-46.25-5.13-3.08-54.48-32.91a3.6 3.6 0 0 1-1.69-3.12V78l5.07 3.02c1.06.6 1.78 1.8 1.78 3.15v46.4l52.75 31.87a3.63 3.63 0 0 1 1.72 3.17l-.01 6.14ZM166 180l-5.17-3.11a3.62 3.62 0 0 1-1.7-3.1v-46.47l-47.64-28.8v25.92l-.02 6.14-5.09-3.09a3.5 3.5 0 0 1-1.71-3.05V92.38a3.6 3.6 0 0 1 1.71-3.09 3.3 3.3 0 0 1 3.44.01l54.47 32.9a3.62 3.62 0 0 1 1.7 3.11v48.47L166 180Zm-46.1-44.34c.53.34 5.2 3.17 5.2 3.17s.04-4.24.04-6.22v-15.57c0-1.32-.68-2.48-1.7-3.1-.5-.31-5.14-3.06-5.14-3.06v21.73c0 1.29.64 2.41 1.6 3.05Zm18.86 11.42-5.17-3.14a3.62 3.62 0 0 1-1.66-3.08v-21.77l5.1 3.07a3.62 3.62 0 0 1 1.75 3.13v15.57l-.02 6.22Zm8.46 5.1 5.15 3.12v-21.78a3.6 3.6 0 0 0-1.8-3.16c-.48-.28-5.06-3.08-5.06-3.08v21.8c0 1.33.7 2.48 1.71 3.1Z\" clip-rule=\"evenodd\"/><path fill=\"currentColor\" d=\"M132.57 222a2.96 2.96 0 0 1 2.96 2.96v15.86a3 3 0 0 1-3 3h-9.95a2.39 2.39 0 1 1 0-4.78h5.15a1.88 1.88 0 0 0 0-3.75h-4.22a2.39 2.39 0 1 1 0-4.77h3.1a3 3 0 0 0 3-3v-2.56a2.96 2.96 0 0 1 2.96-2.96Zm-37.07 6.3c.5-2.37 1.39-4.28 2.66-5.71a9.51 9.51 0 0 1 4.52-2.9c1.75-.5 3.59-.55 5.52-.14a11.1 11.1 0 0 1 5 2.38 9.6 9.6 0 0 1 2.95 4.5c.57 1.83.6 3.93.1 6.29a12.33 12.33 0 0 1-2.65 5.7 9.44 9.44 0 0 1-4.52 2.91c-1.75.51-3.6.56-5.54.14a11.2 11.2 0 0 1-4.98-2.37 9.42 9.42 0 0 1-2.96-4.5 12.25 12.25 0 0 1-.1-6.3Zm5.95 1.27a9.13 9.13 0 0 0-.17 3.34c.14.95.5 1.73 1.06 2.32.56.6 1.31 1 2.27 1.2.96.2 1.82.15 2.58-.17a4.27 4.27 0 0 0 1.91-1.69 9.2 9.2 0 0 0 1.19-3.12c.27-1.28.33-2.4.19-3.35a4.33 4.33 0 0 0-1.07-2.31 4.28 4.28 0 0 0-2.28-1.2 4.24 4.24 0 0 0-2.56.17c-.76.31-1.4.88-1.92 1.68a9.23 9.23 0 0 0-1.2 3.13Zm-15.5 6.41a2.84 2.84 0 0 1-1.67-2.33l-.52-5.52c0-.05-.04-.1-.09-.12a.14.14 0 0 0-.15.02l-4.5 3.3a2.82 2.82 0 1 1-3.29-4.57l4.84-3.4a3 3 0 0 0 1.24-2.87l-.8-5.83a2.85 2.85 0 1 1 5.65-.68l.58 5.7c0 .05.04.1.09.12.05.02.1.01.14-.02l4.63-3.38a2.85 2.85 0 1 1 3.29 4.64l-4.87 3.34a3 3 0 0 0-1.28 2.83l.69 5.84a2.84 2.84 0 0 1-3.98 2.93Zm-16.33-12.59a2.87 2.87 0 1 1-5.67-.91l1.42-7.81a.14.14 0 0 0-.2-.15l-6.99 3.77a2.87 2.87 0 1 1-2.61-5.11l10.27-4.98a3 3 0 0 0 1.12-.94l1.86-2.56a2.94 2.94 0 1 1 4.76 3.46l-1.86 2.56a3 3 0 0 0-.55 1.36l-1.55 11.3Zm-11.39-33.1a2.93 2.93 0 0 1-.22 4.21c-.6.55-1.3.8-2.12.75a2.93 2.93 0 0 1-2.06-1 2.89 2.89 0 0 1-.74-2.11 2.8 2.8 0 0 1 2.35-2.76 3.2 3.2 0 0 1 1.52.09c.5.16.92.43 1.27.82ZM34.2 187.3a2.39 2.39 0 1 1-4.14 2.39l-4.37-7.57a2.39 2.39 0 1 1 4.13-2.38l4.37 7.56Zm14.75-8.52a2.39 2.39 0 0 1-4.13 2.38l-4.37-7.56a2.39 2.39 0 1 1 4.13-2.39l4.37 7.57Zm-21.08 7.13a2.96 2.96 0 0 1 1.09-4.05l13.76-7.95a2.96 2.96 0 0 1 2.96 5.13L31.92 187a2.96 2.96 0 0 1-4.05-1.09Zm-2.9-36.06c2.3-.75 4.4-.94 6.28-.56a9.51 9.51 0 0 1 4.78 2.47 11.27 11.27 0 0 1 2.88 4.71c.61 1.9.76 3.74.44 5.53a9.6 9.6 0 0 1-2.43 4.8c-1.3 1.4-3.1 2.48-5.4 3.23-2.3.75-4.4.94-6.26.56a9.44 9.44 0 0 1-4.78-2.46 11.24 11.24 0 0 1-2.9-4.73 11.2 11.2 0 0 1-.43-5.5 9.42 9.42 0 0 1 2.42-4.81 12.26 12.26 0 0 1 5.4-3.24Zm1.88 5.8c-1.24.4-2.23.9-2.98 1.5a4.2 4.2 0 0 0-1.47 2.09 4.2 4.2 0 0 0 .1 2.57c.3.93.77 1.64 1.43 2.14.64.5 1.45.77 2.41.82.96.05 2.06-.13 3.3-.54 1.25-.4 2.24-.9 3-1.5a4.34 4.34 0 0 0 1.47-2.09 4.3 4.3 0 0 0-.1-2.57 4.24 4.24 0 0 0-1.43-2.14 4.24 4.24 0 0 0-2.42-.82 9.24 9.24 0 0 0-3.3.53Zm3.91-38.41a4.55 4.55 0 0 1-.87 2.28 4.9 4.9 0 0 1-1.87 1.52c-.75.34-1.55.46-2.4.37a4.52 4.52 0 0 1-2.28-.87 4.81 4.81 0 0 1-1.9-4.28 4.72 4.72 0 0 1 5.15-4.17 4.8 4.8 0 0 1 3.8 2.74c.34.75.46 1.55.37 2.41ZM44.58 84.8a2.96 2.96 0 0 1-4.05 1.09L26.8 77.96a3 3 0 0 1-1.1-4.1l4.98-8.62a2.39 2.39 0 1 1 4.13 2.39l-2.58 4.46a1.88 1.88 0 0 0 3.25 1.88l2.1-3.66a2.39 2.39 0 1 1 4.14 2.39l-1.54 2.68a3 3 0 0 0 1.1 4.1l2.21 1.28a2.96 2.96 0 0 1 1.09 4.04Zm13.07-35.26a12.31 12.31 0 0 1 3.62 5.17c.6 1.81.69 3.6.25 5.37a11.27 11.27 0 0 1-2.64 4.85 11.24 11.24 0 0 1-4.56 3.14c-1.72.6-3.5.7-5.37.3a12.34 12.34 0 0 1-5.5-3.06 12.33 12.33 0 0 1-3.62-5.15 9.46 9.46 0 0 1-.25-5.36c.43-1.77 1.31-3.4 2.64-4.87a11.2 11.2 0 0 1 4.56-3.13 9.4 9.4 0 0 1 5.37-.31c1.86.4 3.7 1.43 5.5 3.05Zm-4.07 4.53a9.15 9.15 0 0 0-2.8-1.82 4.18 4.18 0 0 0-2.55-.24 4.2 4.2 0 0 0-2.17 1.37 4.24 4.24 0 0 0-1.14 2.31c-.1.8.06 1.64.5 2.5a9.33 9.33 0 0 0 2.11 2.6c.97.87 1.9 1.48 2.8 1.83.9.34 1.75.42 2.54.24a4.3 4.3 0 0 0 2.18-1.38 4.24 4.24 0 0 0 1.14-2.3c.1-.82-.06-1.65-.5-2.5a9.24 9.24 0 0 0-2.11-2.61Zm2.2-16.63c.83-.6 1.92-.7 2.85-.28l5.04 2.3a.15.15 0 0 0 .2-.15l-.6-5.55a2.82 2.82 0 1 1 5.6-.56l.53 5.89a3 3 0 0 0 1.86 2.5l5.45 2.23a2.85 2.85 0 1 1-2.24 5.24l-5.22-2.35a.15.15 0 0 0-.2.15l.61 5.7a2.85 2.85 0 1 1-5.66.52l-.46-5.88a3 3 0 0 0-1.8-2.52l-5.42-2.33a2.84 2.84 0 0 1-.54-4.9Zm19.07-7.84a2.87 2.87 0 1 1 3.62-4.47l6.06 5.14a.14.14 0 0 0 .22-.1l.23-7.93a2.87 2.87 0 1 1 5.74.29l-.83 11.38a3 3 0 0 0 .25 1.44l1.29 2.9a2.94 2.94 0 1 1-5.37 2.39l-1.3-2.9a3 3 0 0 0-.9-1.14l-9.01-7Zm34.35 6.68a2.93 2.93 0 0 1-3.53-2.3 2.78 2.78 0 0 1 .41-2.2 2.93 2.93 0 0 1 1.9-1.3 2.9 2.9 0 0 1 2.2.42 2.8 2.8 0 0 1 1.21 3.41c-.18.5-.46.93-.84 1.28-.38.35-.83.58-1.34.7Zm14.61-19.33a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm0 17.05a2.39 2.39 0 0 1 0-4.77h8.74a2.39 2.39 0 0 1 0 4.77h-8.74Zm4.37-21.82a2.96 2.96 0 0 1 2.97 2.96v15.9a2.96 2.96 0 0 1-5.93 0v-15.9a2.96 2.96 0 0 1 2.96-2.96Zm32.68 15.52a12.24 12.24 0 0 1-2.66 5.71 9.5 9.5 0 0 1-4.53 2.9c-1.74.5-3.58.55-5.52.14a11.24 11.24 0 0 1-5-2.38 9.6 9.6 0 0 1-2.94-4.5 12.4 12.4 0 0 1-.1-6.29c.5-2.37 1.38-4.28 2.65-5.7a9.44 9.44 0 0 1 4.51-2.91c1.75-.51 3.6-.56 5.54-.14 1.94.4 3.6 1.2 4.99 2.37a9.42 9.42 0 0 1 2.95 4.5c.58 1.82.62 3.92.11 6.3Zm-5.96-1.27c.27-1.28.33-2.4.18-3.34a4.18 4.18 0 0 0-1.07-2.32 4.2 4.2 0 0 0-2.27-1.2 4.24 4.24 0 0 0-2.57.17c-.75.31-1.39.88-1.92 1.69a9.2 9.2 0 0 0-1.18 3.12 9.4 9.4 0 0 0-.2 3.35 4.4 4.4 0 0 0 1.07 2.31c.57.6 1.33 1 2.29 1.2.96.2 1.8.15 2.56-.17.75-.31 1.4-.88 1.91-1.68.53-.81.93-1.85 1.2-3.13Zm31.3 22.59a4.54 4.54 0 0 1-1.53-1.9 4.9 4.9 0 0 1-.38-2.38 4.5 4.5 0 0 1 .88-2.27c.5-.7 1.14-1.21 1.89-1.54a4.81 4.81 0 0 1 4.65.5 4.72 4.72 0 0 1 1.04 6.55 4.8 4.8 0 0 1-4.27 1.91 4.51 4.51 0 0 1-2.28-.87Zm21.19 28.18a2.96 2.96 0 0 1 1.08-4.05l13.73-7.93a3 3 0 0 1 4.1 1.1l4.98 8.62a2.39 2.39 0 0 1-4.13 2.39l-2.58-4.47a1.87 1.87 0 1 0-3.25 1.88l2.11 3.65a2.39 2.39 0 1 1-4.13 2.39l-1.55-2.68a3 3 0 0 0-4.1-1.1l-2.22 1.28a2.96 2.96 0 0 1-4.04-1.08Zm24 28.95c-2.31.75-4.4.94-6.29.56a9.5 9.5 0 0 1-4.78-2.47 11.26 11.26 0 0 1-2.87-4.71c-.61-1.9-.76-3.74-.44-5.53a9.6 9.6 0 0 1 2.43-4.8 12.5 12.5 0 0 1 5.39-3.23c2.31-.75 4.4-.94 6.27-.56a9.44 9.44 0 0 1 4.78 2.46 11.23 11.23 0 0 1 2.89 4.73c.6 1.88.75 3.71.43 5.5a9.43 9.43 0 0 1-2.41 4.81 12.26 12.26 0 0 1-5.4 3.24Zm-1.89-5.8c1.25-.4 2.24-.9 2.98-1.5a4.17 4.17 0 0 0 1.48-2.09 4.2 4.2 0 0 0-.1-2.57 4.25 4.25 0 0 0-1.43-2.14 4.27 4.27 0 0 0-2.42-.82 9.32 9.32 0 0 0-3.3.54c-1.24.4-2.24.9-2.99 1.5a4.34 4.34 0 0 0-1.47 2.09 4.3 4.3 0 0 0 .1 2.57c.3.93.78 1.65 1.43 2.14.65.5 1.46.77 2.41.82.97.05 2.07-.13 3.31-.53Zm13.3 10.23a2.84 2.84 0 0 1-1.18 2.61l-4.52 3.21a.15.15 0 0 0-.06.14c.01.05.04.1.1.12l5.1 2.24a2.82 2.82 0 1 1-2.31 5.14l-5.37-2.48a3 3 0 0 0-3.1.35l-4.65 3.61a2.85 2.85 0 1 1-3.41-4.56l4.64-3.35a.15.15 0 0 0 .06-.13c0-.06-.04-.1-.08-.12l-5.25-2.31a2.84 2.84 0 1 1 2.38-5.17l5.32 2.54a3 3 0 0 0 3.1-.3l4.71-3.52a2.84 2.84 0 0 1 4.52 1.98Zm-2.74 20.44a2.87 2.87 0 1 1 2.06 5.36l-7.48 2.68a.13.13 0 0 0-.1.11c0 .06.03.1.07.13l6.76 4.17a2.87 2.87 0 1 1-3.12 4.83l-9.45-6.42a3 3 0 0 0-1.37-.5l-3.15-.33a2.94 2.94 0 0 1 .62-5.85l3.14.33a3 3 0 0 0 1.45-.2l10.57-4.31Zm-22.96 26.41a2.93 2.93 0 0 1 3.75-1.92 2.8 2.8 0 0 1 1.71 1.47c.37.74.42 1.5.17 2.28-.24.74-.73 1.3-1.46 1.7a2.8 2.8 0 0 1-3.56-.66c-.34-.4-.57-.85-.7-1.36-.1-.5-.08-1.01.09-1.51Zm9.43 22.32a2.39 2.39 0 1 1 4.13 2.38l-4.37 7.57a2.39 2.39 0 1 1-4.13-2.39l4.37-7.56Zm-14.77-8.53a2.39 2.39 0 1 1 4.14 2.39l-4.37 7.56a2.39 2.39 0 0 1-4.13-2.38l4.36-7.57Zm16.72 14.7a2.96 2.96 0 0 1-4.05 1.08l-13.76-7.95a2.96 2.96 0 1 1 2.96-5.13l13.76 7.95a2.96 2.96 0 0 1 1.09 4.04Zm-29.78 20.54a12.3 12.3 0 0 1-3.62-5.17 9.5 9.5 0 0 1-.25-5.37 11.27 11.27 0 0 1 2.64-4.85 11.25 11.25 0 0 1 4.57-3.14 9.6 9.6 0 0 1 5.37-.3c1.87.43 3.7 1.44 5.5 3.06a12.33 12.33 0 0 1 3.61 5.15c.61 1.82.7 3.6.26 5.36a11.24 11.24 0 0 1-2.65 4.87 11.2 11.2 0 0 1-4.55 3.13 9.4 9.4 0 0 1-5.37.31 12.26 12.26 0 0 1-5.5-3.05Zm4.08-4.53c.97.88 1.9 1.48 2.8 1.82.9.35 1.75.43 2.54.24a4.2 4.2 0 0 0 2.18-1.37 4.24 4.24 0 0 0 1.14-2.31c.1-.8-.07-1.64-.5-2.5a9.33 9.33 0 0 0-2.12-2.6 9.4 9.4 0 0 0-2.8-1.83 4.34 4.34 0 0 0-2.54-.24c-.8.2-1.52.66-2.17 1.39a4.24 4.24 0 0 0-1.14 2.3c-.1.81.06 1.64.5 2.5a9.21 9.21 0 0 0 2.11 2.6Zm-35.21 15.81a4.54 4.54 0 0 1 2.4-.38c.83.1 1.58.39 2.25.86a4.55 4.55 0 0 1 1.54 1.9c.35.79.48 1.6.38 2.4a4.81 4.81 0 0 1-2.76 3.79 4.73 4.73 0 0 1-6.19-2.38 4.81 4.81 0 0 1 .48-4.66 4.51 4.51 0 0 1 1.9-1.53Z\"/></svg>`}\n <div class=\"border-t flex-1\"></div>\n </div>\n\n <foxy-i18n\n infer=\"\"\n class=${classMap({ 'block text-center text-xl font-medium': true, ...textColorMap })}\n key=\"user_status_title\"\n .options=${{ context: status, store_name }}\n >\n </foxy-i18n>\n\n <foxy-internal-summary-control infer=\"store\">\n <foxy-internal-text-control\n layout=\"summary-item\"\n infer=\"store-domain\"\n .getValue=${this.__storeDomainGetValue}\n >\n </foxy-internal-text-control>\n <foxy-internal-text-control layout=\"summary-item\" infer=\"store-url\">\n </foxy-internal-text-control>\n <foxy-internal-text-control layout=\"summary-item\" infer=\"store-email\">\n </foxy-internal-text-control>\n ${status === 'accepted' && this.getStorePageHref && this.data\n ? html`\n <div ?hidden=${status !== 'accepted' || !this.getStorePageHref}>\n <a\n class=\"text-primary font-medium cursor-pointer rounded transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50\"\n href=${this.getStorePageHref(this.data._links['fx:store'].href)}\n >\n <foxy-i18n infer=\"\" key=\"store_link\"></foxy-i18n>\n </a>\n </div>\n `\n : ''}\n </foxy-internal-summary-control>\n\n <foxy-i18n\n class=\"block text-secondary text-center\"\n infer=\"\"\n key=\"user_status_text\"\n .options=${{ context: status, store_name }}\n >\n </foxy-i18n>\n\n ${isOwnInvitationForCurrentStore\n ? html`\n <foxy-internal-post-action-control\n message-options=${JSON.stringify({\n store_domain: this.__storeDomainGetValue(),\n store_name,\n })}\n infer=\"leave\"\n class=\"flex-1\"\n theme=\"error\"\n href=${ifDefined(links?.['fx:revoke']?.href ?? links?.['fx:reject']?.href)}\n @success=${() => this.dispatchEvent(new CustomEvent('selfrevoked'))}\n >\n </foxy-internal-post-action-control>\n `\n : html`\n <foxy-internal-user-invitation-form-async-action\n theme=\"error\"\n class=\"flex-1\"\n infer=\"leave\"\n href=${ifDefined(links?.['fx:revoke']?.href ?? links?.['fx:reject']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n `}\n\n <div\n class=\"grid grid-cols-2 gap-m\"\n ?hidden=${hidden.matches('reject', true) && hidden.matches('accept', true)}\n >\n <foxy-internal-user-invitation-form-async-action\n theme=\"error primary\"\n infer=\"reject\"\n href=${ifDefined(this.data?._links['fx:reject']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n\n <foxy-internal-user-invitation-form-async-action\n theme=\"success primary\"\n infer=\"accept\"\n href=${ifDefined(this.data?._links['fx:accept']?.href)}\n >\n </foxy-internal-user-invitation-form-async-action>\n </div>\n\n <foxy-internal-delete-control infer=\"delete\"></foxy-internal-delete-control>\n `;\n }\n}\n"]}
|