@foxy.io/elements 1.50.0-beta.2 → 1.50.0-beta.3
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-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/shared-bb2b7d41.js +1 -0
- package/dist/cdn/translations/user-invitation-form/en.json +10 -1
- package/dist/cdn/translations/webhook-form/en.json +3 -1
- package/dist/elements/internal/InternalPostActionControl/InternalPostActionControl.js +1 -0
- package/dist/elements/internal/InternalPostActionControl/InternalPostActionControl.js.map +1 -1
- package/dist/elements/public/UserInvitationForm/UserInvitationForm.d.ts +2 -0
- package/dist/elements/public/UserInvitationForm/UserInvitationForm.js +30 -10
- package/dist/elements/public/UserInvitationForm/UserInvitationForm.js.map +1 -1
- package/dist/elements/public/UserInvitationForm/index.d.ts +1 -0
- package/dist/elements/public/UserInvitationForm/index.js +1 -0
- package/dist/elements/public/UserInvitationForm/index.js.map +1 -1
- package/dist/elements/public/WebhookForm/WebhookForm.js +1 -0
- package/dist/elements/public/WebhookForm/WebhookForm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-transaction.js";import"./shared-1fa1abbd.js";import"./shared-f7965314.js";import"./shared-d01853e2.js";import"./shared-f05c924a.js";import{I as e}from"./shared-084e1772.js";import"./foxy-admin-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-be071e3d.js";import"./shared-4cc1fb20.js";import{a as t}from"./shared-9a454e09.js";import"./foxy-form-dialog.js";import"./shared-26b55da2.js";import"./shared-591ee1bf.js";import"./shared-1301af85.js";import{B as r,_ as a}from"./shared-8f9014ff.js";import{s as o}from"./shared-2061be9a.js";import{p as s}from"./shared-200aa12d.js";import{h as i,s as n}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import"./foxy-copy-to-clipboard.js";import{R as d,a as c}from"./shared-328aa161.js";import{g as m}from"./shared-96e4f603.js";import"./foxy-billing-address-card.js";import"./shared-04277241.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-021fbb51.js";import"./shared-b0453b08.js";import"./shared-930e68b7.js";import"./shared-de4ec7bb.js";import"./shared-fd8b44e3.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-4e709717.js";import"./foxy-custom-field-form.js";import"./shared-8bf38c47.js";import"./shared-0ea24ca2.js";import"./shared-b0db52f7.js";import"./shared-9a291941.js";import"./shared-097487d0.js";import"./shared-0a7a4660.js";import"./shared-5fd5805c.js";import"./foxy-custom-field-card.js";import"./shared-5212ef4f.js";import"./shared-490dadf8.js";import"./shared-41c9c53f.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./shared-c84333db.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./shared-bab2ea2c.js";import"./foxy-webhook-form.js";import"./shared-462566b0.js";import"./shared-31e75a4a.js";import"./shared-d48e260f.js";import"./shared-910d49eb.js";import"./shared-ba43928a.js";import"./shared-bc8a1435.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-a9a8eb7c.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./shared-67aeac0f.js";import"./foxy-item-card.js";import"./shared-56a16e03.js";import"./foxy-item-form.js";import"./shared-4dc0bd88.js";import"./shared-53e476fd.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";import"./shared-f9bb0924.js";import"./shared-aa258319.js";import"./shared-d74aac59.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-e6c743bd.js";import"./shared-7a5d645f.js";let f,u,h,p,x,y,v,_,g,b,j,w=e=>e;customElements.define("foxy-internal-admin-subscription-form-status-action-form",class extends e{constructor(){super(...arguments),this.__endDatePresetOptions=JSON.stringify([{value:"tomorrow",label:"option_tomorrow"},{value:"next_transaction_date",label:"option_next_transaction_date"},{value:"custom_date",label:"option_custom_date"}]),this.__endDatePresetOptionsForFutureSubs=JSON.stringify([{value:"start_date",label:"option_start_date"},{value:"next_transaction_date",label:"option_next_transaction_date"},{value:"custom_date",label:"option_custom_date"}]),this.__endDatePresetGetValue=()=>{var e;return null!==(e=this.form.end_date_preset)&&void 0!==e?e:"next_transaction_date"},this.__endDatePresetSetValue=e=>{var t,r;if(this.edit({end_date_preset:e}),"tomorrow"===e){const e=new Date;e.setDate(e.getDate()+1),e.setHours(0,0,0,0),this.edit({end_date:o(e)})}else"start_date"===e?this.edit({end_date:null!==(r=null===(t=this.data)||void 0===t?void 0:t.start_date)&&void 0!==r?r:""}):"next_transaction_date"===e?this.edit({end_date:this.form.next_transaction_date}):this.edit({end_date:""})},this.__endDateGetValue=()=>this.form.end_date_preset?this.form.end_date:this.form.next_transaction_date,this.__nextTransactionDateGetValue=()=>{const e=new Date;e.setDate(e.getDate()+1),e.setHours(0,0,0,0);const t=o(e);if(!this.form.next_transaction_date)return t;const r=s(this.form.next_transaction_date.substring(0,10));return!r||r<e?t:this.form.next_transaction_date}}static get v8n(){return[({next_transaction_date:e,end_date:t},r)=>{var a;if(null===(a=r.data)||void 0===a?void 0:a.is_active){if(!t||"0000-00-00"===t)return"end-date:v8n_required"}else if(!e)return"next-transaction-date:v8n_required";return!0}]}get readonlySelector(){const e=[super.readonlySelector.toString()];return"custom_date"!==this.form.end_date_preset&&e.push("end-date"),new r(e.join(" ").trim())}renderBody(){var e,t;const r=new Date;r.setDate(r.getDate()+1),r.setHours(0,0,0,0);const a=!!(null===(e=this.data)||void 0===e?void 0:e.is_active),l=a?"cancel":"reactivate",d=a?"bg-error-10":"bg-success-10",c=n(a?f||(f=w`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z" /></svg>`):u||(u=w`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>`)),m=this.data?s(this.data.start_date):null,j=!!m&&m>new Date,k=o(new Date(Math.max(r.getTime(),null!==(t=null==m?void 0:m.getTime())&&void 0!==t?t:r.getTime())));return i(h||(h=w` <foxy-internal-summary-control infer="" label="" helper-text=""> <div class="text-center flex flex-col items-center bg-transparent"> <div class="rounded-full ${0} p-m mb-s mx-auto">${0}</div> <p class="font-medium text-xl leading-m"> <foxy-i18n infer="" key="${0}_title"></foxy-i18n> </p> <p class="text-secondary leading-s"> <foxy-i18n infer="" key="${0}_subtitle${0}"> </foxy-i18n> </p> </div> </foxy-internal-summary-control> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> <vaadin-button theme="primary ${0} large" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}_submit"></foxy-i18n> </vaadin-button> `),d,c,l,l,j?"_future":"",a?i(p||(p=w` <foxy-internal-select-control options="${0}" layout="summary-item" infer="end-date-preset" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-date-control layout="summary-item" infer="end-date" min="${0}" hide-clear-button .getValue="${0}"> </foxy-internal-date-control> `),j?this.__endDatePresetOptionsForFutureSubs:this.__endDatePresetOptions,this.__endDatePresetGetValue,this.__endDatePresetSetValue,k,this.__endDateGetValue):i(x||(x=w` <foxy-internal-date-control layout="summary-item" infer="next-transaction-date" min="${0}" hide-clear-button .getValue="${0}"> </foxy-internal-date-control> `),k,this.__nextTransactionDateGetValue),a?[this.__renderFaq("cancel_why_not_today",n(y||(y=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M5.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V12ZM6 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H6ZM7.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H8a.75.75 0 0 1-.75-.75V12ZM8 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H8ZM9.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V10ZM10 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H10ZM9.25 14a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V14ZM12 9.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.75-.75H12ZM11.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75V12ZM12 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H12ZM13.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H14a.75.75 0 0 1-.75-.75V10ZM14 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H14Z" /><path fill-rule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z" clip-rule="evenodd" /></svg>`)),j?"_future":""),this.__renderFaq("cancel_whats_next",n(v||(v=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M3.288 4.818A1.5 1.5 0 0 0 1 6.095v7.81a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905c.155-.096.285-.213.389-.344v2.973a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905a1.5 1.5 0 0 0 0-2.552l-6.323-3.906A1.5 1.5 0 0 0 10 6.095v2.972a1.506 1.506 0 0 0-.389-.343L3.288 4.818Z" /></svg>`)),j?"_future":""),this.__renderFaq("cancel_how_to_reactivate",n(_||(_=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M6.111 11.89A5.5 5.5 0 1 1 15.501 8 .75.75 0 0 0 17 8a7 7 0 1 0-11.95 4.95.75.75 0 0 0 1.06-1.06Z" /><path d="M8.232 6.232a2.5 2.5 0 0 0 0 3.536.75.75 0 1 1-1.06 1.06A4 4 0 1 1 14 8a.75.75 0 0 1-1.5 0 2.5 2.5 0 0 0-4.268-1.768Z" /><path d="M10.766 7.51a.75.75 0 0 0-1.37.365l-.492 6.861a.75.75 0 0 0 1.204.65l1.043-.799.985 3.678a.75.75 0 0 0 1.45-.388l-.978-3.646 1.292.204a.75.75 0 0 0 .74-1.16l-3.874-5.764Z" /></svg>`)))]:[this.__renderFaq("reactivate_why_not_today",n(g||(g=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-success flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M5.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V12ZM6 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H6ZM7.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H8a.75.75 0 0 1-.75-.75V12ZM8 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H8ZM9.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V10ZM10 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H10ZM9.25 14a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V14ZM12 9.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.75-.75H12ZM11.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75V12ZM12 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H12ZM13.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H14a.75.75 0 0 1-.75-.75V10ZM14 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H14Z" /><path fill-rule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z" clip-rule="evenodd" /></svg>`))),this.__renderFaq("reactivate_whats_next",n(b||(b=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-success flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M3.288 4.818A1.5 1.5 0 0 0 1 6.095v7.81a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905c.155-.096.285-.213.389-.344v2.973a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905a1.5 1.5 0 0 0 0-2.552l-6.323-3.906A1.5 1.5 0 0 0 10 6.095v2.972a1.506 1.506 0 0 0-.389-.343L3.288 4.818Z" /></svg>`)))],a?"error":"success",this.disabled,(()=>this.submit()),l)}submit(){var e;(null===(e=this.data)||void 0===e?void 0:e.is_active)?"next_transaction_date"===this.__endDatePresetGetValue()&&this.edit({end_date:this.form.next_transaction_date}):this.edit({next_transaction_date:this.__nextTransactionDateGetValue(),is_active:!0,end_date:"0000-00-00"}),super.submit()}async _sendPatch(e){return delete e.end_date_preset,super._sendPatch(e)}__renderFaq(e,t,r=""){return i(j||(j=w` <div class="bg-transparent flex leading-xs" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p class="grid"> <foxy-i18n class="leading-m text-s font-medium" infer="" key="${0}_title"> </foxy-i18n> <foxy-i18n class="leading-xs text-secondary text-xs" infer="" key="${0}_text${0}"> </foxy-i18n> </p> </div> `),t,e,e,r)}});let k,$,V,M=e=>e;customElements.define("foxy-internal-admin-subscription-form-status-action",class extends t{get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("form:save-button"),new r(e.join(" ").trim())}renderControl(){var e,t;const r=this.nucleon,a=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.end_date,o=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t.is_active,s=!o||!a||"0000-00-00"===a;return i(k||(k=M` <vaadin-button theme="tertiary-inline${0}" @click="${0}"> <foxy-i18n infer="" key="caption_${0}"></foxy-i18n> </vaadin-button> ${0} `),s?o?" error":" success":"",(e=>{var t;const r=e.currentTarget;null===(t=this.renderRoot.querySelector("#dialog"))||void 0===t||t.show(r)}),o?a&&"0000-00-00"!==a?"uncancel":"cancel":"reactivate",s?i($||($=M` <foxy-form-dialog infer="form" form="foxy-internal-admin-subscription-form-status-action-form" href="${0}" no-confirm-when-dirty close-on-patch alert id="dialog"> </foxy-form-dialog> `),l(null==r?void 0:r.href)):i(V||(V=M` <foxy-internal-confirm-dialog message="uncancel_message" confirm="uncancel_confirm" cancel="uncancel_cancel" header="uncancel_header" infer="" id="dialog" @hide="${0}"> </foxy-internal-confirm-dialog> `),(e=>{var t,r;e.detail.cancelled||(null===(t=this.nucleon)||void 0===t||t.edit({end_date:"0000-00-00"}),null===(r=this.nucleon)||void 0===r||r.submit())})))}});let Z,H=e=>e;class S extends(d(t)){constructor(){super(...arguments),this.search=null}static get properties(){return a(a({},super.properties),{},{search:{}})}renderControl(){var e,t;const r=this.nucleon;let a;try{const o=new URL(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:sub_token_url"].href)&&void 0!==t?t:"");if(this.search){const e=new URLSearchParams(o.search);o.search=this.search,e.forEach(((e,t)=>o.searchParams.set(t,e)))}a=o.toString()}catch(e){a=void 0}return i(Z||(Z=H` <div class="leading-xs flex items-center gap-xs"> <foxy-i18n class="truncate min-w-0" infer="" key="label"></foxy-i18n> <span class="text-tertiary"> • </span> <foxy-copy-to-clipboard layout="complete" theme="tertiary-inline" infer="copy-to-clipboard" text="${0}"> </foxy-copy-to-clipboard> </div> <foxy-i18n class="leading-xs block text-xs text-secondary" infer="" key="helper_text"> </foxy-i18n> `),a)}}customElements.define("foxy-internal-admin-subscription-form-link-control",S);let D,A,P=e=>e;customElements.define("foxy-internal-admin-subscription-form-error",class extends t{renderControl(){var e,t;return i(D||(D=P` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),n(A||(A=P`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.error_message)}});let B,C,q,F,G,O,T,E=e=>e;const z=c(e,"admin-subscription-form");class L extends z{constructor(){super(...arguments),this.uoeSettingsPage=null}static get properties(){return a(a({},super.properties),{},{uoeSettingsPage:{attribute:"uoe-settings-page"}})}get hiddenSelector(){const e=["delete",super.hiddenSelector.toString()],t=this.data;return(null==t?void 0:t.error_message)&&t.past_due_amount||e.unshift("error-message"),new r(e.join(" ").trim())}get headerSubtitleKey(){const e=m(this.data);return e?`subtitle_${e}`:super.headerSubtitleKey}renderHeaderActions(){return i(B||(B=E` <foxy-internal-admin-subscription-form-status-action infer="status-action"> </foxy-internal-admin-subscription-form-status-action> `))}renderBody(){var e,t,r,a,o,s,d,c,m;let f;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");r.searchParams.set("zoom","items"),f=r.toString()}catch(e){f=void 0}const u=null===(a=null===(r=this.data)||void 0===r?void 0:r._links["fx:charge_past_due"])||void 0===a?void 0:a.href,h=null===(o=this.data)||void 0===o?void 0:o.past_due_amount,p=null===(s=this.data)||void 0===s?void 0:s.error_message,x=null===(d=this.data)||void 0===d?void 0:d._embedded["fx:transaction_template"].currency_code;return i(C||(C=E` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="self-service-links"> <foxy-internal-admin-subscription-form-link-control infer="load-in-cart"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="cart=checkout" infer="load-on-checkout"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=next_transaction_date" infer="cancel-at-end-of-billing-period"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=true" infer="cancel-next-day"> </foxy-internal-admin-subscription-form-link-control> <div class="flex items-start leading-xs text-xs text-secondary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n> ${0} </p> </div> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-admin-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),l(x),u&&x&&h?i(q||(q=E` <foxy-internal-post-action-control message-options="${0}" theme="tertiary-inline" infer="charge-past-due" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({amount:`${h} ${x}`}),u,(()=>this.refresh())):p&&!h?i(F||(F=E` <details class="leading-xs text-xs text-secondary rounded-b focus-within-ring-2 focus-within-ring-inset focus-within-ring-primary-50" style="--gap:calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"> <summary class="cursor-pointer transition-colors hover-text-body focus-outline-none"> <span class="flex items-start" style="gap:var(--gap)"> ${0} <foxy-i18n infer="" key="error_with_zero_past_due_hint"></foxy-i18n> </span> </summary> <p style="padding-left:calc(1.25em + var(--gap))" class="pt-xs"> <span class="whitespace-pre-line">${0}</span> </p> </details> `),n(G||(G=E`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),p):"",n(O||(O=E`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),this.uoeSettingsPage?i(T||(T=E` <a target="_blank" class="inline-block rounded font-medium text-body cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n> </a> `),this.uoeSettingsPage):"",this.renderTemplateOrSlot(),l(null===(m=null===(c=this.data)||void 0===c?void 0:c._links)||void 0===m?void 0:m["fx:attributes"].href),l(f),super.renderBody())}}customElements.define("foxy-admin-subscription-form",L);export{L as AdminSubscriptionForm};
|
|
1
|
+
import"./shared-bb2b7d41.js";import"./shared-1fa1abbd.js";import"./shared-f7965314.js";import"./shared-d01853e2.js";import"./shared-f05c924a.js";import{I as e}from"./shared-084e1772.js";import"./foxy-admin-transaction-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-transaction.js";import"./shared-be071e3d.js";import"./shared-4cc1fb20.js";import{a as t}from"./shared-9a454e09.js";import"./foxy-form-dialog.js";import"./shared-26b55da2.js";import"./shared-591ee1bf.js";import"./shared-1301af85.js";import{B as r,_ as a}from"./shared-8f9014ff.js";import{s as o}from"./shared-2061be9a.js";import{p as s}from"./shared-200aa12d.js";import{h as i,s as n}from"./shared-ba5c42c7.js";import{i as l}from"./shared-53e42a77.js";import"./foxy-copy-to-clipboard.js";import{R as d,a as c}from"./shared-328aa161.js";import{g as m}from"./shared-96e4f603.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-021fbb51.js";import"./shared-b0453b08.js";import"./shared-930e68b7.js";import"./shared-67aeac0f.js";import"./shared-69c98b7b.js";import"./shared-41c9c53f.js";import"./shared-4e709717.js";import"./shared-b0db52f7.js";import"./shared-9a291941.js";import"./shared-0ea24ca2.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-d48e260f.js";import"./shared-3c0e3876.js";import"./shared-ba43928a.js";import"./shared-910d49eb.js";import"./shared-097487d0.js";import"./foxy-collection-page.js";import"./shared-fd8b44e3.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f9bb0924.js";import"./shared-aa258319.js";import"./shared-d74aac59.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-e6c743bd.js";import"./shared-bab2ea2c.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";import"./foxy-nucleon-element.js";import"./shared-5212ef4f.js";import"./shared-7a5d645f.js";import"./shared-0a7a4660.js";import"./foxy-billing-address-card.js";import"./foxy-custom-field-form.js";import"./shared-8bf38c47.js";import"./foxy-custom-field-card.js";import"./shared-490dadf8.js";import"./foxy-shipment-card.js";import"./shared-c84333db.js";import"./foxy-payment-card.js";import"./shared-cf613436.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./shared-462566b0.js";import"./shared-31e75a4a.js";import"./shared-bc8a1435.js";import"./shared-a9a8eb7c.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./shared-56a16e03.js";import"./foxy-item-form.js";import"./shared-4dc0bd88.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-customer-card.js";let f,u,h,p,x,y,v,_,g,b,j,w=e=>e;customElements.define("foxy-internal-admin-subscription-form-status-action-form",class extends e{constructor(){super(...arguments),this.__endDatePresetOptions=JSON.stringify([{value:"tomorrow",label:"option_tomorrow"},{value:"next_transaction_date",label:"option_next_transaction_date"},{value:"custom_date",label:"option_custom_date"}]),this.__endDatePresetOptionsForFutureSubs=JSON.stringify([{value:"start_date",label:"option_start_date"},{value:"next_transaction_date",label:"option_next_transaction_date"},{value:"custom_date",label:"option_custom_date"}]),this.__endDatePresetGetValue=()=>{var e;return null!==(e=this.form.end_date_preset)&&void 0!==e?e:"next_transaction_date"},this.__endDatePresetSetValue=e=>{var t,r;if(this.edit({end_date_preset:e}),"tomorrow"===e){const e=new Date;e.setDate(e.getDate()+1),e.setHours(0,0,0,0),this.edit({end_date:o(e)})}else"start_date"===e?this.edit({end_date:null!==(r=null===(t=this.data)||void 0===t?void 0:t.start_date)&&void 0!==r?r:""}):"next_transaction_date"===e?this.edit({end_date:this.form.next_transaction_date}):this.edit({end_date:""})},this.__endDateGetValue=()=>this.form.end_date_preset?this.form.end_date:this.form.next_transaction_date,this.__nextTransactionDateGetValue=()=>{const e=new Date;e.setDate(e.getDate()+1),e.setHours(0,0,0,0);const t=o(e);if(!this.form.next_transaction_date)return t;const r=s(this.form.next_transaction_date.substring(0,10));return!r||r<e?t:this.form.next_transaction_date}}static get v8n(){return[({next_transaction_date:e,end_date:t},r)=>{var a;if(null===(a=r.data)||void 0===a?void 0:a.is_active){if(!t||"0000-00-00"===t)return"end-date:v8n_required"}else if(!e)return"next-transaction-date:v8n_required";return!0}]}get readonlySelector(){const e=[super.readonlySelector.toString()];return"custom_date"!==this.form.end_date_preset&&e.push("end-date"),new r(e.join(" ").trim())}renderBody(){var e,t;const r=new Date;r.setDate(r.getDate()+1),r.setHours(0,0,0,0);const a=!!(null===(e=this.data)||void 0===e?void 0:e.is_active),l=a?"cancel":"reactivate",d=a?"bg-error-10":"bg-success-10",c=n(a?f||(f=w`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z" /></svg>`):u||(u=w`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99" /></svg>`)),m=this.data?s(this.data.start_date):null,j=!!m&&m>new Date,k=o(new Date(Math.max(r.getTime(),null!==(t=null==m?void 0:m.getTime())&&void 0!==t?t:r.getTime())));return i(h||(h=w` <foxy-internal-summary-control infer="" label="" helper-text=""> <div class="text-center flex flex-col items-center bg-transparent"> <div class="rounded-full ${0} p-m mb-s mx-auto">${0}</div> <p class="font-medium text-xl leading-m"> <foxy-i18n infer="" key="${0}_title"></foxy-i18n> </p> <p class="text-secondary leading-s"> <foxy-i18n infer="" key="${0}_subtitle${0}"> </foxy-i18n> </p> </div> </foxy-internal-summary-control> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="" label="" helper-text=""> ${0} </foxy-internal-summary-control> <vaadin-button theme="primary ${0} large" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}_submit"></foxy-i18n> </vaadin-button> `),d,c,l,l,j?"_future":"",a?i(p||(p=w` <foxy-internal-select-control options="${0}" layout="summary-item" infer="end-date-preset" .getValue="${0}" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-date-control layout="summary-item" infer="end-date" min="${0}" hide-clear-button .getValue="${0}"> </foxy-internal-date-control> `),j?this.__endDatePresetOptionsForFutureSubs:this.__endDatePresetOptions,this.__endDatePresetGetValue,this.__endDatePresetSetValue,k,this.__endDateGetValue):i(x||(x=w` <foxy-internal-date-control layout="summary-item" infer="next-transaction-date" min="${0}" hide-clear-button .getValue="${0}"> </foxy-internal-date-control> `),k,this.__nextTransactionDateGetValue),a?[this.__renderFaq("cancel_why_not_today",n(y||(y=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M5.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V12ZM6 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H6ZM7.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H8a.75.75 0 0 1-.75-.75V12ZM8 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H8ZM9.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V10ZM10 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H10ZM9.25 14a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V14ZM12 9.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.75-.75H12ZM11.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75V12ZM12 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H12ZM13.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H14a.75.75 0 0 1-.75-.75V10ZM14 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H14Z" /><path fill-rule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z" clip-rule="evenodd" /></svg>`)),j?"_future":""),this.__renderFaq("cancel_whats_next",n(v||(v=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M3.288 4.818A1.5 1.5 0 0 0 1 6.095v7.81a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905c.155-.096.285-.213.389-.344v2.973a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905a1.5 1.5 0 0 0 0-2.552l-6.323-3.906A1.5 1.5 0 0 0 10 6.095v2.972a1.506 1.506 0 0 0-.389-.343L3.288 4.818Z" /></svg>`)),j?"_future":""),this.__renderFaq("cancel_how_to_reactivate",n(_||(_=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-error flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M6.111 11.89A5.5 5.5 0 1 1 15.501 8 .75.75 0 0 0 17 8a7 7 0 1 0-11.95 4.95.75.75 0 0 0 1.06-1.06Z" /><path d="M8.232 6.232a2.5 2.5 0 0 0 0 3.536.75.75 0 1 1-1.06 1.06A4 4 0 1 1 14 8a.75.75 0 0 1-1.5 0 2.5 2.5 0 0 0-4.268-1.768Z" /><path d="M10.766 7.51a.75.75 0 0 0-1.37.365l-.492 6.861a.75.75 0 0 0 1.204.65l1.043-.799.985 3.678a.75.75 0 0 0 1.45-.388l-.978-3.646 1.292.204a.75.75 0 0 0 .74-1.16l-3.874-5.764Z" /></svg>`)))]:[this.__renderFaq("reactivate_why_not_today",n(g||(g=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-success flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M5.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H6a.75.75 0 0 1-.75-.75V12ZM6 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H6ZM7.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H8a.75.75 0 0 1-.75-.75V12ZM8 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H8ZM9.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V10ZM10 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H10ZM9.25 14a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H10a.75.75 0 0 1-.75-.75V14ZM12 9.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V10a.75.75 0 0 0-.75-.75H12ZM11.25 12a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H12a.75.75 0 0 1-.75-.75V12ZM12 13.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V14a.75.75 0 0 0-.75-.75H12ZM13.25 10a.75.75 0 0 1 .75-.75h.01a.75.75 0 0 1 .75.75v.01a.75.75 0 0 1-.75.75H14a.75.75 0 0 1-.75-.75V10ZM14 11.25a.75.75 0 0 0-.75.75v.01c0 .414.336.75.75.75h.01a.75.75 0 0 0 .75-.75V12a.75.75 0 0 0-.75-.75H14Z" /><path fill-rule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75Z" clip-rule="evenodd" /></svg>`))),this.__renderFaq("reactivate_whats_next",n(b||(b=w`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-success flex-shrink-0" style="width: 1.25em; height: 1.25em;"><path d="M3.288 4.818A1.5 1.5 0 0 0 1 6.095v7.81a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905c.155-.096.285-.213.389-.344v2.973a1.5 1.5 0 0 0 2.288 1.276l6.323-3.905a1.5 1.5 0 0 0 0-2.552l-6.323-3.906A1.5 1.5 0 0 0 10 6.095v2.972a1.506 1.506 0 0 0-.389-.343L3.288 4.818Z" /></svg>`)))],a?"error":"success",this.disabled,(()=>this.submit()),l)}submit(){var e;(null===(e=this.data)||void 0===e?void 0:e.is_active)?"next_transaction_date"===this.__endDatePresetGetValue()&&this.edit({end_date:this.form.next_transaction_date}):this.edit({next_transaction_date:this.__nextTransactionDateGetValue(),is_active:!0,end_date:"0000-00-00"}),super.submit()}async _sendPatch(e){return delete e.end_date_preset,super._sendPatch(e)}__renderFaq(e,t,r=""){return i(j||(j=w` <div class="bg-transparent flex leading-xs" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p class="grid"> <foxy-i18n class="leading-m text-s font-medium" infer="" key="${0}_title"> </foxy-i18n> <foxy-i18n class="leading-xs text-secondary text-xs" infer="" key="${0}_text${0}"> </foxy-i18n> </p> </div> `),t,e,e,r)}});let k,$,V,M=e=>e;customElements.define("foxy-internal-admin-subscription-form-status-action",class extends t{get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("form:save-button"),new r(e.join(" ").trim())}renderControl(){var e,t;const r=this.nucleon,a=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e.end_date,o=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t.is_active,s=!o||!a||"0000-00-00"===a;return i(k||(k=M` <vaadin-button theme="tertiary-inline${0}" @click="${0}"> <foxy-i18n infer="" key="caption_${0}"></foxy-i18n> </vaadin-button> ${0} `),s?o?" error":" success":"",(e=>{var t;const r=e.currentTarget;null===(t=this.renderRoot.querySelector("#dialog"))||void 0===t||t.show(r)}),o?a&&"0000-00-00"!==a?"uncancel":"cancel":"reactivate",s?i($||($=M` <foxy-form-dialog infer="form" form="foxy-internal-admin-subscription-form-status-action-form" href="${0}" no-confirm-when-dirty close-on-patch alert id="dialog"> </foxy-form-dialog> `),l(null==r?void 0:r.href)):i(V||(V=M` <foxy-internal-confirm-dialog message="uncancel_message" confirm="uncancel_confirm" cancel="uncancel_cancel" header="uncancel_header" infer="" id="dialog" @hide="${0}"> </foxy-internal-confirm-dialog> `),(e=>{var t,r;e.detail.cancelled||(null===(t=this.nucleon)||void 0===t||t.edit({end_date:"0000-00-00"}),null===(r=this.nucleon)||void 0===r||r.submit())})))}});let Z,H=e=>e;class S extends(d(t)){constructor(){super(...arguments),this.search=null}static get properties(){return a(a({},super.properties),{},{search:{}})}renderControl(){var e,t;const r=this.nucleon;let a;try{const o=new URL(null!==(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:sub_token_url"].href)&&void 0!==t?t:"");if(this.search){const e=new URLSearchParams(o.search);o.search=this.search,e.forEach(((e,t)=>o.searchParams.set(t,e)))}a=o.toString()}catch(e){a=void 0}return i(Z||(Z=H` <div class="leading-xs flex items-center gap-xs"> <foxy-i18n class="truncate min-w-0" infer="" key="label"></foxy-i18n> <span class="text-tertiary"> • </span> <foxy-copy-to-clipboard layout="complete" theme="tertiary-inline" infer="copy-to-clipboard" text="${0}"> </foxy-copy-to-clipboard> </div> <foxy-i18n class="leading-xs block text-xs text-secondary" infer="" key="helper_text"> </foxy-i18n> `),a)}}customElements.define("foxy-internal-admin-subscription-form-link-control",S);let D,A,P=e=>e;customElements.define("foxy-internal-admin-subscription-form-error",class extends t{renderControl(){var e,t;return i(D||(D=P` <p class="flex items-start gap-ds p-ds rounded border border-error-50" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px);gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <span>${0}</span> </p> `),n(A||(A=P`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true" class="flex-shrink-0 text-error" style="width: 1.25em"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>`)),null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.error_message)}});let B,C,q,F,G,O,T,E=e=>e;const z=c(e,"admin-subscription-form");class L extends z{constructor(){super(...arguments),this.uoeSettingsPage=null}static get properties(){return a(a({},super.properties),{},{uoeSettingsPage:{attribute:"uoe-settings-page"}})}get hiddenSelector(){const e=["delete",super.hiddenSelector.toString()],t=this.data;return(null==t?void 0:t.error_message)&&t.past_due_amount||e.unshift("error-message"),new r(e.join(" ").trim())}get headerSubtitleKey(){const e=m(this.data);return e?`subtitle_${e}`:super.headerSubtitleKey}renderHeaderActions(){return i(B||(B=E` <foxy-internal-admin-subscription-form-status-action infer="status-action"> </foxy-internal-admin-subscription-form-status-action> `))}renderBody(){var e,t,r,a,o,s,d,c,m;let f;try{const r=new URL(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:transactions"].href)&&void 0!==t?t:"");r.searchParams.set("zoom","items"),f=r.toString()}catch(e){f=void 0}const u=null===(a=null===(r=this.data)||void 0===r?void 0:r._links["fx:charge_past_due"])||void 0===a?void 0:a.href,h=null===(o=this.data)||void 0===o?void 0:o.past_due_amount,p=null===(s=this.data)||void 0===s?void 0:s.error_message,x=null===(d=this.data)||void 0===d?void 0:d._embedded["fx:transaction_template"].currency_code;return i(C||(C=E` ${0} <foxy-internal-admin-subscription-form-error infer="error-message"> </foxy-internal-admin-subscription-form-error> <foxy-internal-summary-control infer="general"> <foxy-internal-date-control layout="summary-item" infer="start-date"> </foxy-internal-date-control> <foxy-internal-frequency-control layout="summary-item" infer="frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-date-control layout="summary-item" infer="next-transaction-date"> </foxy-internal-date-control> <foxy-internal-date-control layout="summary-item" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="overdue"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="past-due-amount" min="0"> </foxy-internal-number-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="self-service-links"> <foxy-internal-admin-subscription-form-link-control infer="load-in-cart"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="cart=checkout" infer="load-on-checkout"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=next_transaction_date" infer="cancel-at-end-of-billing-period"> </foxy-internal-admin-subscription-form-link-control> <foxy-internal-admin-subscription-form-link-control search="sub_cancel=true" infer="cancel-next-day"> </foxy-internal-admin-subscription-form-link-control> <div class="flex items-start leading-xs text-xs text-secondary" style="gap:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} <p> <foxy-i18n infer="" key="uoe_hint_text"></foxy-i18n> ${0} </p> </div> </foxy-internal-summary-control> ${0} <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="transactions" class="min-w-0" first="${0}" item="foxy-admin-transaction-card" form="foxy-transaction" hide-create-button hide-delete-button alert wide> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),l(x),u&&x&&h?i(q||(q=E` <foxy-internal-post-action-control message-options="${0}" theme="tertiary-inline" infer="charge-past-due" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({amount:`${h} ${x}`}),u,(()=>this.refresh())):p&&!h?i(F||(F=E` <details class="leading-xs text-xs text-secondary rounded-b focus-within-ring-2 focus-within-ring-inset focus-within-ring-primary-50" style="--gap:calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"> <summary class="cursor-pointer transition-colors hover-text-body focus-outline-none"> <span class="flex items-start" style="gap:var(--gap)"> ${0} <foxy-i18n infer="" key="error_with_zero_past_due_hint"></foxy-i18n> </span> </summary> <p style="padding-left:calc(1.25em + var(--gap))" class="pt-xs"> <span class="whitespace-pre-line">${0}</span> </p> </details> `),n(G||(G=E`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),p):"",n(O||(O=E`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true" class="flex-shrink-0" style="width: 1.25em"><path fill-rule="evenodd" d="M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0ZM9 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM6.75 8a.75.75 0 0 0 0 1.5h.75v1.75a.75.75 0 0 0 1.5 0v-2.5A.75.75 0 0 0 8.25 8h-1.5Z" clip-rule="evenodd" /></svg>`)),this.uoeSettingsPage?i(T||(T=E` <a target="_blank" class="inline-block rounded font-medium text-body cursor-pointer hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="uoe_link_text"></foxy-i18n> </a> `),this.uoeSettingsPage):"",this.renderTemplateOrSlot(),l(null===(m=null===(c=this.data)||void 0===c?void 0:c._links)||void 0===m?void 0:m["fx:attributes"].href),l(f),super.renderBody())}}customElements.define("foxy-admin-subscription-form",L);export{L as AdminSubscriptionForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-26b55da2.js";import"./shared-be071e3d.js";import{a as e}from"./shared-9a454e09.js";import"./foxy-spinner.js";import{_ as t,B as o}from"./shared-8f9014ff.js";import{h as i,s as r}from"./shared-ba5c42c7.js";import{D as s}from"./shared-67aeac0f.js";import{A as n}from"./shared-69c98b7b.js";import{i as a}from"./shared-53e42a77.js";import"./shared-1fa1abbd.js";import"./shared-591ee1bf.js";import"./shared-bc8a1435.js";import{I as l}from"./shared-084e1772.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import{g as d}from"./shared-bab2ea2c.js";import{c}from"./shared-4e709717.js";import{R as u,a as f}from"./shared-328aa161.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";import"./shared-fd8b44e3.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-021fbb51.js";import"./shared-5212ef4f.js";import"./shared-41c9c53f.js";import"./shared-7a5d645f.js";import"./shared-b0db52f7.js";import"./shared-9a291941.js";import"./shared-097487d0.js";import"./shared-0a7a4660.js";import"./shared-5fd5805c.js";import"./shared-8bf38c47.js";import"./shared-0ea24ca2.js";import"./shared-490dadf8.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-c84333db.js";import"./shared-cf613436.js";import"./shared-462566b0.js";import"./shared-31e75a4a.js";import"./shared-d48e260f.js";import"./shared-910d49eb.js";import"./shared-ba43928a.js";import"./shared-1301af85.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./shared-a9a8eb7c.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-4cc1fb20.js";import"./shared-56a16e03.js";import"./shared-4dc0bd88.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-f7965314.js";import"./shared-f9bb0924.js";import"./shared-aa258319.js";import"./shared-d74aac59.js";import"./shared-d01853e2.js";import"./shared-f05c924a.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-2061be9a.js";import"./shared-200aa12d.js";import"./shared-e6c743bd.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let p,h,m,v,_,y,x,b=e=>e;let g,w=e=>e;customElements.define("foxy-internal-post-action-control",class extends e{constructor(){super(...arguments),this.messageOptions={},this.theme=null,this.href=null}static get properties(){return t(t({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},theme:{},href:{}})}renderControl(){var e,t;return i(g||(g=w` <foxy-internal-post-action-control-dialog message-options="${0}" infer="" href="${0}" @hide="${0}"> </foxy-internal-post-action-control-dialog> <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button"></foxy-i18n> </vaadin-button> `),JSON.stringify(this.messageOptions),a(null!==(e=this.href)&&void 0!==e?e:void 0),(e=>{e.detail.cancelled||this.dispatchEvent(new CustomEvent("success"))}),a(null!==(t=this.theme)&&void 0!==t?t:void 0),this.disabled||this.readonly,(e=>{const t=e.currentTarget,o=this.renderRoot.querySelector("foxy-internal-post-action-control-dialog");null==o||o.show(t)}))}}),customElements.define("foxy-internal-post-action-control-dialog",class extends s{constructor(){super(...arguments),this.messageOptions={},this.closable=!0,this.header="header",this.alert=!0,this.href=null,this.__api=new n(this),this.__state="idle"}static get properties(){return t(t({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},href:{},__state:{attribute:!1}})}get hiddenSelector(){const e=["close-button",super.hiddenSelector.toString()];return new o(e.join(" ").trim())}render(){var e=this;return super.render((()=>i(p||(p=b` <div class="relative"> <div class="mb-m mt-xs flex justify-center"> ${0} </div> <foxy-i18n class="block font-lumo text-m text-body text-center mb-l" infer="" key="message_${0}" .options="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> ${0} </div> ${0} </div> `),"done"===this.__state?r(h||(h=b`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)):"fail"===this.__state?r(m||(m=b`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" /></svg>`)):r(v||(v=b`<svg class="text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`)),"busy"===this.__state?"idle":this.__state,this.messageOptions,"done"===this.__state||"fail"===this.__state?i(_||(_=b` <vaadin-button class="col-span-2" theme="contrast" @click="${0}"> <foxy-i18n infer="" key="button_close"></foxy-i18n> </vaadin-button> `),(()=>this.hide())):i(y||(y=b` <vaadin-button ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_cancel"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_confirm"></foxy-i18n> </vaadin-button> `),this.disabled||this.readonly,(()=>this.hide()),this.disabled||this.readonly,(async function(){if(e.href&&"idle"===e.__state){e.__state="busy",e.closable=!1;const t=await e.__api.fetch(e.href,{method:"POST"});e.__state=t.ok?"done":"fail",e.closable=!0}})),"busy"===this.__state?i(x||(x=b` <div class="bg-base absolute inset-0 flex items-center justify-center"> <foxy-spinner layout="vertical" infer=""></foxy-spinner> </div> `)):"")))}async hide(){await super.hide("done"!==this.__state),this.__state="idle"}});let $,k,j,S,A=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends e{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return t(t({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var e,t,o,s;const n=this.nucleon,l=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e._links["fx:customer"].href,u=l?null===(t=null==n?void 0:n.getCustomerPageHref)||void 0===t?void 0:t.call(n,l):void 0;return i($||($=A` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),c({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!u,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!u}),a(u),a(l),this.__renderCopyAction(r(k||(k=A`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",l?String(d(l)):""),this.__renderCopyAction(r(j||(j=A`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(s=null===(o=null==n?void 0:n.data)||void 0===o?void 0:o.customer_email)&&void 0!==s?s:""))}__renderCopyAction(e,t,o,r){const s=this[o],n="fail"===s?"error":"done"===s?"end":"busy";return i(S||(S=A` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==s,(()=>"idle"===s&&this.__copy(r,o)),(e=>"idle"!==s&&e.stopPropagation()),(e=>"idle"!==s&&e.stopPropagation()),c({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==s}),e,t,c({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===s}),n)}async __copy(e,t){this[t]="busy";try{await navigator.clipboard.writeText(e),this[t]="done"}catch(e){this[t]="fail"}setTimeout((()=>this[t]="idle"),3e3)}});let P,C,H,L,E,B,O,Z,R,M,I,q=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends e{constructor(){super(...arguments),this.currencyDisplay=null,this.folders=null}static get properties(){return t(t({},super.properties),{},{currencyDisplay:{attribute:"currency-display"},folders:{}})}renderControl(){var e,t,o,r,s,n,a,l,d,c,u,f;return i(P||(P=q` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> `),(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"])?this.__renderCaptureAction():"",(null===(r=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===r?void 0:r._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(s=this.nucleon)||void 0===s?void 0:s.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(l=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===l?void 0:l._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(d=this.nucleon)||void 0===d?void 0:d.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"",(null===(f=null===(u=this.nucleon)||void 0===u?void 0:u.data)||void 0===f?void 0:f._links["fx:receipt"])?this.__renderReceiptAction():"",this.__renderArchiveAction(),this.folders?this.__renderFolderSelector(this.folders):"")}get __refundAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,s=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:s)}__renderSendEmailsAction(){var e,t;return i(C||(C=q` <foxy-internal-post-action-control infer="send-emails" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:send_emails"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderCaptureAction(){var e,t;return i(H||(H=q` <foxy-internal-post-action-control theme="tertiary-inline success" infer="capture" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderVoidAction(){var e,t,o;return i(L||(L=q` <foxy-internal-post-action-control theme="tertiary-inline error" infer="void" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),a(null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:void"])||void 0===o?void 0:o.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderRefundAction(){var e,t,o,r,s;const n=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.currency_code;return i(E||(E=q` <foxy-internal-post-action-control message-options="${0}" infer="refund" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({currencyDisplay:this.currencyDisplay,amount:`${this.__refundAmount} ${n}`}),a(null===(s=null===(r=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===r?void 0:r._links["fx:refund"])||void 0===s?void 0:s.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderSubscriptionAction(){var e,t,o;const r=this.nucleon,s=null===(t=null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:subscription"])||void 0===t?void 0:t.href,n=s?null===(o=null==r?void 0:r.getSubscriptionPageHref)||void 0===o?void 0:o.call(r,s):void 0;return i(B||(B=q` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),a(n))}__renderReceiptAction(){var e,t;const o=this.nucleon;return i(O||(O=q` <a target="_blank" class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="receipt" key="caption"></foxy-i18n> </a> `),a(null===(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._links["fx:receipt"])||void 0===t?void 0:t.href))}__renderArchiveAction(){const e=this.nucleon;return i(Z||(Z=q` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="archive" key="caption_${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("archive",!0),(()=>{null==e||e.edit({hide_transaction:!(null==e?void 0:e.form.hide_transaction)}),null==e||e.submit()}),(null==e?void 0:e.form.hide_transaction)?"unarchive":"archive")}__renderFolderSelector(e){var t,o,s;const n=this.renderRoot.querySelector("#foldersLoader"),a=Array.from(null!==(s=null===(o=null===(t=null==n?void 0:n.data)||void 0===t?void 0:t._embedded)||void 0===o?void 0:o["fx:transaction_folders"])&&void 0!==s?s:[]),l=this.nucleon;return i(R||(R=q` <foxy-nucleon class="hidden" infer="" href="${0}" id="foldersLoader" @update="${0}"> </foxy-nucleon> <label class="group relative rounded focus-within-ring-2 focus-within-ring-primary-50" ?hidden="${0}"> <span class="inline-flex items-center gap-xs relative transition-opacity group-hover-opacity-80"> <foxy-i18n class="font-medium text-primary" infer="folder" key="caption"></foxy-i18n> ${0} </span> <select class="absolute inset-0 opacity-0 cursor-pointer" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <option value="" ?selected="${0}" ?disabled="${0}"> ${0} </option> ${0} </select> </label> `),e,(()=>this.requestUpdate()),0===a.length,r(M||(M=q`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-primary transform scale-125" style="width: 1em; height: 1em"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled,this.readonly,(e=>{null==l||l.edit({folder_uri:e.currentTarget.value}),null==l||l.submit(!1)}),!(null==l?void 0:l.form.folder_uri),!(null==l?void 0:l.form.folder_uri),this.t("folder.option_none"),a.sort(((e,t)=>e.sort_order-t.sort_order)).map((e=>{const t=e._links.self.href,o=(null==l?void 0:l.form.folder_uri)===t;return i(I||(I=q` <option value="${0}" ?selected="${0}" ?disabled="${0}"> ${0} </option> `),t,o,o,e.name)})))}});let D,G,T,U,F,V,W,z,J,N,K,Q,X=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends e{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,o,r,s,n,l,d,c;const u=null===(e=this.nucleon)||void 0===e?void 0:e.data;if(!u)return i(D||(D=X``));const f=null!==(o=null===(t=null==u?void 0:u._embedded)||void 0===t?void 0:t["fx:applied_taxes"])&&void 0!==o?o:[],p=null!==(s=null===(r=u._embedded)||void 0===r?void 0:r["fx:shipments"])&&void 0!==s?s:[],h=this.__refundableAmount;return i(G||(G=X` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> ${0} </p> `),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?i(T||(T=X` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((e=>i(U||(U=X` <span>${0}:</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?i(F||(F=X` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>i(V||(V=X` <span>${0}:</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),null===(l=null===(n=null==u?void 0:u._embedded)||void 0===n?void 0:n["fx:gift_card_code_logs"])||void 0===l?void 0:l.map((e=>{var t,o,r,s,n;const a=null===(o=null===(t=e._embedded)||void 0===t?void 0:t["fx:gift_card"])||void 0===o?void 0:o.name,l=null===(s=null===(r=e._embedded)||void 0===r?void 0:r["fx:gift_card_code"])||void 0===s?void 0:s.code;if(a&&l)return i(W||(W=X` <span data-testclass="gift-card-code">${0} • ${0}:</span> <span>${0}</span> `),a,l,this.__renderPrice(null!==(n=e.balance_adjustment)&&void 0!==n?n:0,!0))})),null===(c=null===(d=null==u?void 0:u._embedded)||void 0===d?void 0:d["fx:discounts"])||void 0===c?void 0:c.map((({name:e,code:t,amount:o})=>i(z||(z=X` <span data-testclass="discount">${0}${0}:</span> <span>${0}</span> `),e,t?i(J||(J=X` • ${0}`),t):"",this.__renderPrice(o,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order),h!==u.total_order?i(N||(N=X` <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex justify-end"> <span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="refundable_amount"></foxy-i18n>: ${0} </span> <br> <foxy-i18n class="inline-block whitespace-normal leading-s text-tertiary" style="max-width:48ch" infer="" key="refundable_amount_note"> </foxy-i18n> </span> </span> `),this.__renderPrice(h)):"")}get __refundableAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,s=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:s)}get __storeHref(){var e,t,o;return null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var e,t;const o=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var o,r,s;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(s=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===s?void 0:s.currency_code;return i(K||(K=X` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}__renderStatus(){var e,t;const o=(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.status)||"completed";let r="";return r=["capturing","captured","approved","authorized","pending"].includes(o)?"text-success bg-success-10":o&&"completed"!==o?["problem","pending_fraud_review","rejected","declined"].includes(o)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",i(Q||(Q=X` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),r,o)}});let Y,ee,te,oe,ie=e=>e;const re=u(f(l,"transaction"));class se extends re{constructor(){var e;super(...arguments),e=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(t){if(!e.data)return;const o=e.data._links["fx:send_webhooks"].href,i=new se.API(e),r=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:t.map((e=>d(e._links.self.href))),event:"refeed"})});if(t.forEach((e=>{se.Rumour("").share({related:[...t.map((e=>e._links["fx:logs"].href)),...t.map((e=>e._links["fx:statuses"].href))],source:e._links.self.href,data:e})})),!r.ok)throw new Error(await r.text())}}]}static get properties(){return t(t({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var e,t,i;const r=["billing-addresses","datafeed:data-is-fed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:void"])&&void 0!==t?t:null===(i=this.data)||void 0===i?void 0:i._links["fx:refund"])||r.push("items","attributes","custom-fields"),new o(r.join(" ").trim())}get hiddenSelector(){var e,t,i,r;const s=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],n=null===(e=this.data)||void 0===e?void 0:e.type;return(null===(t=this.data)||void 0===t?void 0:t._links["fx:subscription"])||s.unshift("subscription"),"subscription_modification"===n&&s.unshift("actions"),"updateinfo"===n&&s.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===n&&s.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(i=this.__storeLoader)||void 0===i?void 0:i.data)||void 0===r?void 0:r.use_webhook)||s.unshift("datafeed"),new o(s.join(" ").trim())}get headerSubtitleOptions(){var e,t,o,i,r;const s=null===(e=this.data)||void 0===e?void 0:e.source,n=null===(t=this.data)||void 0===t?void 0:t.type;let a="";return"updateinfo"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===s?"admin_changed_payment_method_with_uoe":"mit_api"===s?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===n?a=!s||(null==s?void 0:s.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===s?"admin_changed_subscription_with_uoe":"mit_api"===s?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===n?"mit_recurring"===s?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===s?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===s&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===n?"cit_recurring_cancellation"===s?a="customer_canceled_subscription":"mit_recurring_cancellation"===s&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==s?void 0:s.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===s?a="admin_subscribed_with_uoe":"mit_api"===s&&(a="integration_subscribed"):(null==s?void 0:s.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===s?a="admin_placed_order_with_uoe":"mit_api"===s&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerSubtitleBadges(){var e,t,o,i,s;const n=super.headerSubtitleBadges,a=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:folder"];if(null==a?void 0:a.name){const e=null!==(o=a.color)&&void 0!==o?o:"",t={red:"bg-folder-red text-white",red_pale:"bg-folder-red-pale text-black",green:"bg-folder-green text-white",green_pale:"bg-folder-green-pale text-black",blue:"bg-folder-blue text-white",blue_pale:"bg-folder-blue-pale text-black",orange:"bg-folder-orange text-white",orange_pale:"bg-folder-orange-pale text-black",violet:"bg-folder-violet text-white",violet_pale:"bg-folder-violet-pale text-black","":"bg-contrast-5 text-body"};n.push({class:t[e in t?e:""],icon:r(Y||(Y=ie`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em;"><path d="M3.75 3A1.75 1.75 0 0 0 2 4.75v3.26a3.235 3.235 0 0 1 1.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0 0 16.25 5h-4.836a.25.25 0 0 1-.177-.073L9.823 3.513A1.75 1.75 0 0 0 8.586 3H3.75ZM3.75 9A1.75 1.75 0 0 0 2 10.75v4.5c0 .966.784 1.75 1.75 1.75h12.5A1.75 1.75 0 0 0 18 15.25v-4.5A1.75 1.75 0 0 0 16.25 9H3.75Z" /></svg>`)),text:a.name})}return(null===(i=this.data)||void 0===i?void 0:i.hide_transaction)&&n.push({key:"archived"}),(null===(s=this.data)||void 0===s?void 0:s.is_test)&&n.push({key:"test"}),n}get headerCopyIdValue(){var e,t,o;return null!==(o=null===(t=null===(e=this.data)||void 0===e?void 0:e.display_id)||void 0===t?void 0:t.toString())&&void 0!==o?o:""}renderHeaderActions(){var e;const t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data,o=null==t?void 0:t._links["fx:transaction_folders"].href;return i(ee||(ee=ie` <foxy-internal-transaction-actions-control currency-display="${0}" folders="${0}" infer="actions"> </foxy-internal-transaction-actions-control> `),(null==t?void 0:t.use_international_currency_symbol)?"code":"symbol",a(o))}renderBody(){var e,t,o,r,s,n,l,d,c,u,f,p,h,m,v,_;let y,x,b;const g=this.hiddenSelector;if(this.data)try{const i=new URL(this.data._links["fx:shipments"].href),r=new URL(null!==(o=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:webhooks"].href)&&void 0!==o?o:""),s=new URL(this.data._links["fx:items"].href);i.searchParams.set("zoom","items:item_category"),r.searchParams.set("event_resource","transaction"),s.searchParams.set("zoom","item_options"),y=i.toString(),x=r.toString(),b=s.toString()}catch(e){}return i(te||(te=ie` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-post-action-control infer="process-webhook" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(s=null===(r=this.data)||void 0===r?void 0:r.status)&&void 0!==s?s:"")?i(oe||(oe=ie` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(n=this.data)||void 0===n?void 0:n.status):"",g.matches("items",!0)&&g.matches("summary",!0),a(b),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(d=null===(l=this.__storeLoader)||void 0===l?void 0:l.data)||void 0===d?void 0:d._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href},a(null===(u=this.data)||void 0===u?void 0:u._links["fx:billing_addresses"].href),a(null===(f=this.data)||void 0===f?void 0:f._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},a(null===(p=this.data)||void 0===p?void 0:p._links["fx:custom_fields"].href),a(null===(h=this.data)||void 0===h?void 0:h._links["fx:attributes"].href),a(y),a(x),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},a(null===(v=null===(m=this.data)||void 0===m?void 0:m._links["fx:process_webhook"])||void 0===v?void 0:v.href),(()=>this.refresh()),a(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",se);export{se as Transaction};
|
|
1
|
+
import"./foxy-billing-address-card.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./foxy-custom-field-form.js";import"./foxy-custom-field-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-shipment-card.js";import"./foxy-payment-card.js";import"./foxy-webhook-card.js";import"./foxy-webhook-form.js";import"./foxy-address-form.js";import"./foxy-item-card.js";import"./foxy-item-form.js";import"./shared-26b55da2.js";import"./shared-bb2b7d41.js";import"./shared-1fa1abbd.js";import"./shared-591ee1bf.js";import"./shared-bc8a1435.js";import{I as e}from"./shared-084e1772.js";import{a as t}from"./shared-9a454e09.js";import"./foxy-customer-card.js";import"./foxy-swipe-actions.js";import"./foxy-spinner.js";import{_ as o,B as i}from"./shared-8f9014ff.js";import{g as r}from"./shared-bab2ea2c.js";import{i as n}from"./shared-53e42a77.js";import{h as s,s as a}from"./shared-ba5c42c7.js";import{c as l}from"./shared-4e709717.js";import"./shared-be071e3d.js";import{R as d,a as c}from"./shared-328aa161.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";import"./shared-fd8b44e3.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-930e68b7.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-021fbb51.js";import"./shared-5212ef4f.js";import"./shared-41c9c53f.js";import"./shared-7a5d645f.js";import"./shared-b0db52f7.js";import"./shared-9a291941.js";import"./shared-097487d0.js";import"./shared-0a7a4660.js";import"./shared-5fd5805c.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-8bf38c47.js";import"./shared-0ea24ca2.js";import"./shared-490dadf8.js";import"./shared-c84333db.js";import"./shared-cf613436.js";import"./shared-462566b0.js";import"./shared-31e75a4a.js";import"./shared-d48e260f.js";import"./shared-910d49eb.js";import"./shared-ba43928a.js";import"./shared-1301af85.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./shared-a9a8eb7c.js";import"./shared-d0aed1c1.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import"./shared-56a16e03.js";import"./shared-4dc0bd88.js";import"./foxy-form-dialog.js";import"./shared-53e476fd.js";import"./shared-f7965314.js";import"./shared-f9bb0924.js";import"./shared-aa258319.js";import"./shared-d74aac59.js";import"./shared-d01853e2.js";import"./shared-f05c924a.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-2061be9a.js";import"./shared-200aa12d.js";import"./shared-e6c743bd.js";import"./foxy-discount-detail-card.js";import"./foxy-coupon-detail-card.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-63c32024.js";import"./foxy-item-option-card.js";import"./foxy-item-option-form.js";import"./foxy-collection-page.js";import"./foxy-pagination.js";let u,f,p,m,h=e=>e;customElements.define("foxy-internal-transaction-customer-control",class extends t{constructor(){super(...arguments),this.__copyEmailState="idle",this.__copyIdState="idle"}static get properties(){return o(o({},super.properties),{},{__copyEmailState:{attribute:!1},__copyIdState:{attribute:!1}})}renderControl(){var e,t,o,i;const d=this.nucleon,c=null===(e=null==d?void 0:d.data)||void 0===e?void 0:e._links["fx:customer"].href,m=c?null===(t=null==d?void 0:d.getCustomerPageHref)||void 0===t?void 0:t.call(d,c):void 0;return s(u||(u=h` <foxy-i18n infer="" class="block text-l font-medium leading-xs mb-s" key="label"> </foxy-i18n> <foxy-swipe-actions> <a class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" href="${0}"> <foxy-customer-card infer="" href="${0}"></foxy-customer-card> </a> <div class="h-full grid grid-cols-2 gap-s ml-s" slot="action"> ${0} ${0} </div> </foxy-swipe-actions> `),l({"block ring-inset rounded transition-colors bg-contrast-5":!0,"cursor-pointer hover-bg-contrast-10":!!m,"focus-outline-none focus-ring-2 focus-ring-primary-50":!!m}),n(m),n(c),this.__renderCopyAction(a(f||(f=h`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M9.493 2.852a.75.75 0 0 0-1.486-.204L7.545 6H4.198a.75.75 0 0 0 0 1.5h3.14l-.69 5H3.302a.75.75 0 0 0 0 1.5h3.14l-.435 3.148a.75.75 0 0 0 1.486.204L7.955 14h2.986l-.434 3.148a.75.75 0 0 0 1.486.204L12.456 14h3.346a.75.75 0 0 0 0-1.5h-3.14l.69-5h3.346a.75.75 0 0 0 0-1.5h-3.14l.435-3.148a.75.75 0 0 0-1.486-.204L12.045 6H9.059l.434-3.148ZM8.852 7.5l-.69 5h2.986l.69-5H8.852Z" clip-rule="evenodd" /></svg>`)),"copy_id_caption","__copyIdState",c?String(r(c)):""),this.__renderCopyAction(a(p||(p=h`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1.2rem; height: 1.2rem"><path fill-rule="evenodd" d="M5.404 14.596A6.5 6.5 0 1 1 16.5 10a1.25 1.25 0 0 1-2.5 0 4 4 0 1 0-.571 2.06A2.75 2.75 0 0 0 18 10a8 8 0 1 0-2.343 5.657.75.75 0 0 0-1.06-1.06 6.5 6.5 0 0 1-9.193 0ZM10 7.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5Z" clip-rule="evenodd" /></svg>`)),"copy_email_caption","__copyEmailState",null!==(i=null===(o=null==d?void 0:d.data)||void 0===o?void 0:o.customer_email)&&void 0!==i?i:""))}__renderCopyAction(e,t,o,i){const r=this[o],n="fail"===r?"error":"done"===r?"end":"busy";return s(m||(m=h` <button class="relative transition-colors bg-contrast-5 text-body hover-bg-contrast-10 rounded h-full py-0 px-m focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50" ?disabled="${0}" @click="${0}" @focusout="${0}" @mouseout="${0}"> <div class="${0}"> ${0} <foxy-i18n class="mt-xs text-s font-medium leading-none" infer="" key="${0}"> </foxy-i18n> </div> <div class="${0}"> <foxy-spinner layout="no-label" state="${0}" infer="spinner"> </foxy-spinner> </div> </button> `),"idle"!==r,(()=>"idle"===r&&this.__copy(i,o)),(e=>"idle"!==r&&e.stopPropagation()),(e=>"idle"!==r&&e.stopPropagation()),l({"relative flex flex-col items-center justify-center transition-opacity":!0,"opacity-0":"idle"!==r}),e,t,l({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===r}),n)}async __copy(e,t){this[t]="busy";try{await navigator.clipboard.writeText(e),this[t]="done"}catch(e){this[t]="fail"}setTimeout((()=>this[t]="idle"),3e3)}});let v,_,y,x,b,g,j,$,w,k,A,S=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends t{constructor(){super(...arguments),this.currencyDisplay=null,this.folders=null}static get properties(){return o(o({},super.properties),{},{currencyDisplay:{attribute:"currency-display"},folders:{}})}renderControl(){var e,t,o,i,r,n,a,l,d,c,u,f;return s(v||(v=S` <div class="flex flex-wrap gap-x-m gap-y-xs"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} ${0} </div> `),(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"])?this.__renderCaptureAction():"",(null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:void"])?this.__renderVoidAction():"",(null===(n=null===(r=this.nucleon)||void 0===r?void 0:r.data)||void 0===n?void 0:n._links["fx:refund"])?this.__renderRefundAction():"",(null===(l=null===(a=this.nucleon)||void 0===a?void 0:a.data)||void 0===l?void 0:l._links["fx:send_emails"])?this.__renderSendEmailsAction():"",(null===(c=null===(d=this.nucleon)||void 0===d?void 0:d.data)||void 0===c?void 0:c._links["fx:subscription"])?this.__renderSubscriptionAction():"",(null===(f=null===(u=this.nucleon)||void 0===u?void 0:u.data)||void 0===f?void 0:f._links["fx:receipt"])?this.__renderReceiptAction():"",this.__renderArchiveAction(),this.folders?this.__renderFolderSelector(this.folders):"")}get __refundAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,n=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:n)}__renderSendEmailsAction(){var e,t;return s(_||(_=S` <foxy-internal-post-action-control infer="send-emails" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),n(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:send_emails"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderCaptureAction(){var e,t;return s(y||(y=S` <foxy-internal-post-action-control theme="tertiary-inline success" infer="capture" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),n(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:capture"].href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderVoidAction(){var e,t,o;return s(x||(x=S` <foxy-internal-post-action-control theme="tertiary-inline error" infer="void" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),n(null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:void"])||void 0===o?void 0:o.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderRefundAction(){var e,t,o,i,r;const a=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.currency_code;return s(b||(b=S` <foxy-internal-post-action-control message-options="${0}" infer="refund" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> `),JSON.stringify({currencyDisplay:this.currencyDisplay,amount:`${this.__refundAmount} ${a}`}),n(null===(r=null===(i=null===(o=this.nucleon)||void 0===o?void 0:o.data)||void 0===i?void 0:i._links["fx:refund"])||void 0===r?void 0:r.href),(()=>{var e;return null===(e=this.nucleon)||void 0===e?void 0:e.refresh()}))}__renderSubscriptionAction(){var e,t,o;const i=this.nucleon,r=null===(t=null===(e=null==i?void 0:i.data)||void 0===e?void 0:e._links["fx:subscription"])||void 0===t?void 0:t.href,a=r?null===(o=null==i?void 0:i.getSubscriptionPageHref)||void 0===o?void 0:o.call(i,r):void 0;return s(g||(g=S` <a class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="subscription" key="caption"></foxy-i18n> </a> `),n(a))}__renderReceiptAction(){var e,t;const o=this.nucleon;return s(j||(j=S` <a target="_blank" class="rounded text-m font-medium text-primary cursor-pointer transition-opacity hover-opacity-80 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="receipt" key="caption"></foxy-i18n> </a> `),n(null===(t=null===(e=null==o?void 0:o.data)||void 0===e?void 0:e._links["fx:receipt"])||void 0===t?void 0:t.href))}__renderArchiveAction(){const e=this.nucleon;return s($||($=S` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="archive" key="caption_${0}"> </foxy-i18n> </vaadin-button> `),this.disabledSelector.matches("archive",!0),(()=>{null==e||e.edit({hide_transaction:!(null==e?void 0:e.form.hide_transaction)}),null==e||e.submit()}),(null==e?void 0:e.form.hide_transaction)?"unarchive":"archive")}__renderFolderSelector(e){var t,o,i;const r=this.renderRoot.querySelector("#foldersLoader"),n=Array.from(null!==(i=null===(o=null===(t=null==r?void 0:r.data)||void 0===t?void 0:t._embedded)||void 0===o?void 0:o["fx:transaction_folders"])&&void 0!==i?i:[]),l=this.nucleon;return s(w||(w=S` <foxy-nucleon class="hidden" infer="" href="${0}" id="foldersLoader" @update="${0}"> </foxy-nucleon> <label class="group relative rounded focus-within-ring-2 focus-within-ring-primary-50" ?hidden="${0}"> <span class="inline-flex items-center gap-xs relative transition-opacity group-hover-opacity-80"> <foxy-i18n class="font-medium text-primary" infer="folder" key="caption"></foxy-i18n> ${0} </span> <select class="absolute inset-0 opacity-0 cursor-pointer" ?disabled="${0}" ?readonly="${0}" @change="${0}"> <option value="" ?selected="${0}" ?disabled="${0}"> ${0} </option> ${0} </select> </label> `),e,(()=>this.requestUpdate()),0===n.length,a(k||(k=S`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" class="text-primary transform scale-125" style="width: 1em; height: 1em"><path fill-rule="evenodd" d="M10.53 3.47a.75.75 0 0 0-1.06 0L6.22 6.72a.75.75 0 0 0 1.06 1.06L10 5.06l2.72 2.72a.75.75 0 1 0 1.06-1.06l-3.25-3.25Zm-4.31 9.81 3.25 3.25a.75.75 0 0 0 1.06 0l3.25-3.25a.75.75 0 1 0-1.06-1.06L10 14.94l-2.72-2.72a.75.75 0 0 0-1.06 1.06Z" clip-rule="evenodd" /></svg>`)),this.disabled,this.readonly,(e=>{null==l||l.edit({folder_uri:e.currentTarget.value}),null==l||l.submit(!1)}),!(null==l?void 0:l.form.folder_uri),!(null==l?void 0:l.form.folder_uri),this.t("folder.option_none"),n.sort(((e,t)=>e.sort_order-t.sort_order)).map((e=>{const t=e._links.self.href,o=(null==l?void 0:l.form.folder_uri)===t;return s(A||(A=S` <option value="${0}" ?selected="${0}" ?disabled="${0}"> ${0} </option> `),t,o,o,e.name)})))}});let P,L,H,C,R,B,E,I,Z,q,M,D,G=e=>e;customElements.define("foxy-internal-transaction-summary-control",class extends t{constructor(){super(...arguments),this.__storeLoaderId="storeLoader"}renderControl(){var e,t,o,i,r,a,l,d,c;const u=null===(e=this.nucleon)||void 0===e?void 0:e.data;if(!u)return s(P||(P=G``));const f=null!==(o=null===(t=null==u?void 0:u._embedded)||void 0===t?void 0:t["fx:applied_taxes"])&&void 0!==o?o:[],p=null!==(r=null===(i=u._embedded)||void 0===i?void 0:i["fx:shipments"])&&void 0!==r?r:[],m=this.__refundableAmount;return s(L||(L=G` <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <p class="grid gap-x-s text-right text-s leading-m border-dashed border rounded border-contrast-20 whitespace-nowrap overflow-auto" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 2px);grid-template-columns:1fr min-content"> <span><foxy-i18n key="subtotal" infer=""></foxy-i18n>:</span> <span>${0}</span> ${0} ${0} ${0} ${0} <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex gap-s justify-between items-center"> ${0} <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="total"></foxy-i18n>: ${0} </span> </span> ${0} </p> `),n(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===p.length||0===u.total_shipping?s(H||(H=G` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):p.map((e=>s(C||(C=G` <span>${0}:</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?s(R||(R=G` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>s(B||(B=G` <span>${0}:</span> <span>${0}</span> `),e.name,this.__renderPrice(e.amount,!0)))),null===(l=null===(a=null==u?void 0:u._embedded)||void 0===a?void 0:a["fx:gift_card_code_logs"])||void 0===l?void 0:l.map((e=>{var t,o,i,r,n;const a=null===(o=null===(t=e._embedded)||void 0===t?void 0:t["fx:gift_card"])||void 0===o?void 0:o.name,l=null===(r=null===(i=e._embedded)||void 0===i?void 0:i["fx:gift_card_code"])||void 0===r?void 0:r.code;if(a&&l)return s(E||(E=G` <span data-testclass="gift-card-code">${0} • ${0}:</span> <span>${0}</span> `),a,l,this.__renderPrice(null!==(n=e.balance_adjustment)&&void 0!==n?n:0,!0))})),null===(c=null===(d=null==u?void 0:u._embedded)||void 0===d?void 0:d["fx:discounts"])||void 0===c?void 0:c.map((({name:e,code:t,amount:o})=>s(I||(I=G` <span data-testclass="discount">${0}${0}:</span> <span>${0}</span> `),e,t?s(Z||(Z=G` • ${0}`),t):"",this.__renderPrice(o,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order),m!==u.total_order?s(q||(q=G` <span class="col-span-2 border-t border-dashed border-contrast-20 my-s"></span> <span class="col-span-2 flex justify-end"> <span> <span class="text-xl font-medium leading-xs"> <foxy-i18n infer="" key="refundable_amount"></foxy-i18n>: ${0} </span> <br> <foxy-i18n class="inline-block whitespace-normal leading-s text-tertiary" style="max-width:48ch" infer="" key="refundable_amount_note"> </foxy-i18n> </span> </span> `),this.__renderPrice(m)):"")}get __refundableAmount(){var e,t,o,i;const r=null===(e=this.nucleon)||void 0===e?void 0:e.data,n=null!==(t=null==r?void 0:r.total_order)&&void 0!==t?t:0;return parseFloat(null!==(i=null===(o=null==r?void 0:r._links["fx:refund"])||void 0===o?void 0:o.amount)&&void 0!==i?i:n)}get __storeHref(){var e,t,o;return null===(o=null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:store"])||void 0===o?void 0:o.href}get __store(){var e,t;const o=`#${this.__storeLoaderId}`;return null!==(t=null===(e=this.renderRoot.querySelector(o))||void 0===e?void 0:e.data)&&void 0!==t?t:null}__renderPrice(e,t=!1){var o,i,r;const n=(null===(o=this.__store)||void 0===o?void 0:o.use_international_currency_symbol)?"code":"symbol",a=null===(r=null===(i=this.nucleon)||void 0===i?void 0:i.data)||void 0===r?void 0:r.currency_code;return s(M||(M=G` <foxy-i18n class="${0}" infer="" key="price" .options="${0}"> </foxy-i18n> `),t&&0!==e?e>0?"text-success":"text-error":"",{currencyDisplay:n,signDisplay:t?"exceptZero":"auto",amount:`${e} ${a}`})}__renderStatus(){var e,t;const o=(null===(t=null===(e=this.nucleon)||void 0===e?void 0:e.data)||void 0===t?void 0:t.status)||"completed";let i="";return i=["capturing","captured","approved","authorized","pending"].includes(o)?"text-success bg-success-10":o&&"completed"!==o?["problem","pending_fraud_review","rejected","declined"].includes(o)?"text-error-contrast bg-error":"bg-contrast-5 text-body":"text-success-contrast bg-success",s(D||(D=G` <foxy-i18n infer="" class="${0} rounded-s py-xs px-s font-medium text-s leading-xs" key="status_${0}"></foxy-i18n> `),i,o)}});let U,F,O,T,V=e=>e;const W=d(c(e,"transaction"));class z extends W{constructor(){var e;super(...arguments),e=this,this.hostedPaymentGatewaysHelper=null,this.paymentGatewaysHelper=null,this.localeCodes=null,this.getSubscriptionPageHref=null,this.getCustomerPageHref=null,this.__webhooksBulkActions=[{name:"refeed",onClick:async function(t){if(!e.data)return;const o=e.data._links["fx:send_webhooks"].href,i=new z.API(e),n=await i.fetch(o,{method:"POST",body:JSON.stringify({refeed_hooks:t.map((e=>r(e._links.self.href))),event:"refeed"})});if(t.forEach((e=>{z.Rumour("").share({related:[...t.map((e=>e._links["fx:logs"].href)),...t.map((e=>e._links["fx:statuses"].href))],source:e._links.self.href,data:e})})),!n.ok)throw new Error(await n.text())}}]}static get properties(){return o(o({},super.properties),{},{hostedPaymentGatewaysHelper:{attribute:"hosted-payment-gateways-helper"},paymentGatewaysHelper:{attribute:"payment-gateways-helper"},getSubscriptionPageHref:{attribute:!1},getCustomerPageHref:{attribute:!1},localeCodes:{attribute:"locale-codes"}})}get readonlySelector(){var e,t,o;const r=["billing-addresses","datafeed:data-is-fed","webhooks:dialog:url",super.readonlySelector];return Boolean(null!==(t=null===(e=this.data)||void 0===e?void 0:e._links["fx:void"])&&void 0!==t?t:null===(o=this.data)||void 0===o?void 0:o._links["fx:refund"])||r.push("items","attributes","custom-fields"),new i(r.join(" ").trim())}get hiddenSelector(){var e,t,o,r;const n=["billing-addresses:dialog:delete","billing-addresses:dialog:timestamps","webhooks:dialog:header:copy-json","webhooks:dialog:header:copy-id","webhooks:dialog:timestamps","webhooks:dialog:name","webhooks:dialog:query","webhooks:dialog:encryption-key","webhooks:dialog:delete",super.readonlySelector],s=null===(e=this.data)||void 0===e?void 0:e.type;return(null===(t=this.data)||void 0===t?void 0:t._links["fx:subscription"])||n.unshift("subscription"),"subscription_modification"===s&&n.unshift("actions"),"updateinfo"===s&&n.unshift("not=customer,subscription,payments,custom-fields,attributes"),"subscription_cancellation"===s&&n.unshift("not=customer,subscription,custom-fields,attributes"),(null===(r=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===r?void 0:r.use_webhook)||n.unshift("datafeed"),new i(n.join(" ").trim())}get headerSubtitleOptions(){var e,t,o,i,r;const n=null===(e=this.data)||void 0===e?void 0:e.source,s=null===(t=this.data)||void 0===t?void 0:t.type;let a="";return"updateinfo"===s?a=!n||(null==n?void 0:n.startsWith("cit_"))?"customer_changed_payment_method":"mit_uoe"===n?"admin_changed_payment_method_with_uoe":"mit_api"===n?"integration_changed_payment_method":"admin_changed_payment_method":"subscription_modification"===s?a=!n||(null==n?void 0:n.startsWith("cit_"))?"customer_changed_subscription":"mit_uoe"===n?"admin_changed_subscription_with_uoe":"mit_api"===n?"integration_changed_subscription":"admin_changed_subscription":"subscription_renewal"===s?"mit_recurring"===n?a="subscription_renewal_attempt":"mit_recurring_reattempt_automated"===n?a="subscription_renewal_automated_reattempt":"mit_recurring_reattempt_manual"===n&&(a="subscription_renewal_manual_reattempt"):"subscription_cancellation"===s?"cit_recurring_cancellation"===n?a="customer_canceled_subscription":"mit_recurring_cancellation"===n&&(a="admin_canceled_subscription"):(null===(o=this.data)||void 0===o?void 0:o._links["fx:subscription"])?(null==n?void 0:n.startsWith("cit_"))?a="customer_subscribed":"mit_uoe"===n?a="admin_subscribed_with_uoe":"mit_api"===n&&(a="integration_subscribed"):(null==n?void 0:n.startsWith("cit_"))?a="customer_placed_order":"mit_uoe"===n?a="admin_placed_order_with_uoe":"mit_api"===n&&(a="integration_placed_order"),{transaction_date:null===(i=this.data)||void 0===i?void 0:i.transaction_date,ip_country:null===(r=this.data)||void 0===r?void 0:r.ip_country,context:a}}get headerSubtitleBadges(){var e,t,o,i,r;const n=super.headerSubtitleBadges,s=null===(t=null===(e=this.data)||void 0===e?void 0:e._embedded)||void 0===t?void 0:t["fx:folder"];if(null==s?void 0:s.name){const e=null!==(o=s.color)&&void 0!==o?o:"",t={red:"bg-folder-red text-white",red_pale:"bg-folder-red-pale text-black",green:"bg-folder-green text-white",green_pale:"bg-folder-green-pale text-black",blue:"bg-folder-blue text-white",blue_pale:"bg-folder-blue-pale text-black",orange:"bg-folder-orange text-white",orange_pale:"bg-folder-orange-pale text-black",violet:"bg-folder-violet text-white",violet_pale:"bg-folder-violet-pale text-black","":"bg-contrast-5 text-body"};n.push({class:t[e in t?e:""],icon:a(U||(U=V`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em;"><path d="M3.75 3A1.75 1.75 0 0 0 2 4.75v3.26a3.235 3.235 0 0 1 1.75-.51h12.5c.644 0 1.245.188 1.75.51V6.75A1.75 1.75 0 0 0 16.25 5h-4.836a.25.25 0 0 1-.177-.073L9.823 3.513A1.75 1.75 0 0 0 8.586 3H3.75ZM3.75 9A1.75 1.75 0 0 0 2 10.75v4.5c0 .966.784 1.75 1.75 1.75h12.5A1.75 1.75 0 0 0 18 15.25v-4.5A1.75 1.75 0 0 0 16.25 9H3.75Z" /></svg>`)),text:s.name})}return(null===(i=this.data)||void 0===i?void 0:i.hide_transaction)&&n.push({key:"archived"}),(null===(r=this.data)||void 0===r?void 0:r.is_test)&&n.push({key:"test"}),n}get headerCopyIdValue(){var e,t,o;return null!==(o=null===(t=null===(e=this.data)||void 0===e?void 0:e.display_id)||void 0===t?void 0:t.toString())&&void 0!==o?o:""}renderHeaderActions(){var e;const t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data,o=null==t?void 0:t._links["fx:transaction_folders"].href;return s(F||(F=V` <foxy-internal-transaction-actions-control currency-display="${0}" folders="${0}" infer="actions"> </foxy-internal-transaction-actions-control> `),(null==t?void 0:t.use_international_currency_symbol)?"code":"symbol",n(o))}renderBody(){var e,t,o,i,r,a,l,d,c,u,f,p,m,h,v,_;let y,x,b;const g=this.hiddenSelector;if(this.data)try{const i=new URL(this.data._links["fx:shipments"].href),r=new URL(null!==(o=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:webhooks"].href)&&void 0!==o?o:""),n=new URL(this.data._links["fx:items"].href);i.searchParams.set("zoom","items:item_category"),r.searchParams.set("event_resource","transaction"),n.searchParams.set("zoom","item_options"),y=i.toString(),x=r.toString(),b=n.toString()}catch(e){}return s(O||(O=V` ${0} ${0} <foxy-internal-transaction-customer-control infer="customer"> </foxy-internal-transaction-customer-control> <div class="grid gap-s" ?hidden="${0}"> <foxy-internal-async-list-control infer="items" class="min-w-0" first="${0}" limit="10" item="foxy-item-card" form="foxy-item-form" alert wide .related="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-transaction-summary-control infer="summary" class="min-w-0"> </foxy-internal-transaction-summary-control> </div> <foxy-internal-async-list-control infer="billing-addresses" first="${0}" item="foxy-billing-address-card" form="foxy-address-form" hide-create-button hide-delete-button alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="payments" first="${0}" item="foxy-payment-card" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="custom-fields" class="min-w-0" first="${0}" limit="5" form="foxy-custom-field-form" item="foxy-custom-field-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="attributes" class="min-w-0" first="${0}" limit="5" form="foxy-attribute-form" item="foxy-attribute-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="shipments" first="${0}" item="foxy-shipment-card"> </foxy-internal-async-list-control> <foxy-internal-async-list-control infer="webhooks" first="${0}" item="foxy-webhook-card" form="foxy-webhook-form" hide-create-button hide-delete-button alert .bulkActions="${0}" .itemProps="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="datafeed"> <foxy-internal-switch-control infer="data-is-fed"></foxy-internal-switch-control> <foxy-internal-post-action-control infer="process-webhook" theme="tertiary-inline" href="${0}" @success="${0}"> </foxy-internal-post-action-control> </foxy-internal-summary-control> <foxy-nucleon class="hidden" infer="" href="${0}" id="storeLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),["problem","pending_fraud_review","rejected","declined"].includes(null!==(r=null===(i=this.data)||void 0===i?void 0:i.status)&&void 0!==r?r:"")?s(T||(T=V` <p class="leading-xs text-body rounded bg-error-10 block" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> <foxy-i18n infer="header" key="alert_status_${0}"></foxy-i18n> </p> `),null===(a=this.data)||void 0===a?void 0:a.status):"",g.matches("items",!0)&&g.matches("summary",!0),n(b),[this.href],{"locale-codes":this.localeCodes},{"item-categories":null===(d=null===(l=this.__storeLoader)||void 0===l?void 0:l.data)||void 0===d?void 0:d._links["fx:item_categories"].href,"locale-codes":this.localeCodes,store:null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href},n(null===(u=this.data)||void 0===u?void 0:u._links["fx:billing_addresses"].href),n(null===(f=this.data)||void 0===f?void 0:f._links["fx:payments"].href),{"hosted-payment-gateways-helper":this.hostedPaymentGatewaysHelper,"payment-gateways-helper":this.paymentGatewaysHelper},n(null===(p=this.data)||void 0===p?void 0:p._links["fx:custom_fields"].href),n(null===(m=this.data)||void 0===m?void 0:m._links["fx:attributes"].href),n(y),n(x),this.__webhooksBulkActions,{"resource-uri":this.href},{"resource-uri":this.href},n(null===(v=null===(h=this.data)||void 0===h?void 0:h._links["fx:process_webhook"])||void 0===v?void 0:v.href),(()=>this.refresh()),n(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector("#storeLoader")}}customElements.define("foxy-transaction",z);export{z as Transaction};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-591ee1bf.js";import{I as e}from"./shared-084e1772.js";import"./shared-a9a8eb7c.js";import"./shared-be071e3d.js";import{a as t}from"./shared-9a454e09.js";import"./shared-26b55da2.js";import{_ as a,B as r,aT as i,aU as s}from"./shared-8f9014ff.js";import{N as l}from"./shared-fd8b44e3.js";import{i as o}from"./shared-53e42a77.js";import{h as n,c as d,s as c}from"./shared-ba5c42c7.js";import{a as m}from"./shared-328aa161.js";import{a as h,g as f}from"./shared-37bdd118.js";import{c as v}from"./shared-4e709717.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./shared-69c98b7b.js";import"./shared-41c9c53f.js";import"./shared-930e68b7.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-021fbb51.js";import"./shared-9a291941.js";import"./shared-b0db52f7.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-6880e1f6.js";import"./shared-b0453b08.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-910d49eb.js";import"./shared-097487d0.js";import"./shared-d48e260f.js";import"./shared-ba43928a.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> `),o(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 l.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 y,x,g,_,b,Z,j,w,S,$,k,M,C,L,B=e=>e;const H=m(e,"user-invitation-form");class P extends H{constructor(){super(...arguments),this.getStorePageHref=null,this.defaultDomain=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"},layout:{}})}static get styles(){return[...super.styles,d(y||(y=B`.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(x||(x=B` <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=B` <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(f(e))))}))()}__renderAdminTemplateState(){return n(_||(_=B` ${0} <foxy-internal-text-control infer="email"></foxy-internal-text-control> ${0} `),this.renderHeader(),super.renderBody())}__renderUserTemplateState(){return n(b||(b=B` <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}){var a,r,i,s,l,d,m;const f=(null==e?void 0:e.trim())||(null==t?void 0:t.trim()),u={first_name:e,last_name:t,context:f?"":"empty"},p=null===(a=this.data)||void 0===a?void 0:a.status,y=this.hiddenSelector;return n(Z||(Z=B` <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}"> <foxy-internal-user-invitation-form-async-action infer="revoke" class="flex-1" theme="error" href="${0}"> </foxy-internal-user-invitation-form-async-action> <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> `),h(this.__getGravatar(null===(r=this.data)||void 0===r?void 0:r.email)),u,null===(i=this.data)||void 0===i?void 0:i.email,v({"border rounded":!0,"border-contrast text-contrast":"revoked"===p||"expired"===p,"border-success text-success":"accepted"===p,"border-primary text-primary":"sent"===p,"border-error text-error":"rejected"===p}),"revoked"===p?c(j||(j=B`<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"===p?c(w||(w=B`<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"===p?c(S||(S=B`<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"===p?c($||($=B`<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"===p?c(k||(k=B`<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:p},{context:p},y.matches("revoke",!0)&&y.matches("resend",!0)&&y.matches("delete",!0),o(null===(l=null===(s=this.data)||void 0===s?void 0:s._links["fx:revoke"])||void 0===l?void 0:l.href),o(null===(m=null===(d=this.data)||void 0===d?void 0:d._links["fx:resend"])||void 0===m?void 0:m.href))}__renderUserSnapshotState({status:e,store_name:t}){var r,i,s,l,d,m,h,f;const u=null===(r=this.data)||void 0===r?void 0:r._links,p=this.hiddenSelector,y={"text-primary":"sent"===e,"text-success":"accepted"===e,"text-error":"rejected"===e};return n(M||(M=B` <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},y)),c(C||(C=B`<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},y)),{context:e,store_name:t},this.__storeDomainGetValue,"accepted"===e&&this.getStorePageHref&&this.data?n(L||(L=B` <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},o(null!==(s=null===(i=null==u?void 0:u["fx:revoke"])||void 0===i?void 0:i.href)&&void 0!==s?s:null===(l=null==u?void 0:u["fx:reject"])||void 0===l?void 0:l.href),p.matches("reject",!0)&&p.matches("accept",!0),o(null===(m=null===(d=this.data)||void 0===d?void 0:d._links["fx:reject"])||void 0===m?void 0:m.href),o(null===(f=null===(h=this.data)||void 0===h?void 0:h._links["fx:accept"])||void 0===f?void 0:f.href))}}customElements.define("foxy-user-invitation-form",P);export{P as UserInvitationForm};
|
|
1
|
+
import"./shared-bb2b7d41.js";import"./shared-591ee1bf.js";import{I as e}from"./shared-084e1772.js";import"./shared-a9a8eb7c.js";import"./shared-be071e3d.js";import{a as t}from"./shared-9a454e09.js";import"./shared-26b55da2.js";import{_ as a,B as r,aT as i,aU as s}from"./shared-8f9014ff.js";import{N as o}from"./shared-fd8b44e3.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-328aa161.js";import{a as h,g as f}from"./shared-37bdd118.js";import{c as v}from"./shared-4e709717.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.js";import"./shared-021fbb51.js";import"./shared-b0453b08.js";import"./shared-930e68b7.js";import"./shared-67aeac0f.js";import"./shared-69c98b7b.js";import"./shared-41c9c53f.js";import"./shared-4cc1fb20.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-9a291941.js";import"./shared-b0db52f7.js";import"./shared-6880e1f6.js";import"./shared-bab2ea2c.js";import"./shared-910d49eb.js";import"./shared-097487d0.js";import"./shared-d48e260f.js";import"./shared-ba43928a.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(f(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,f,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> `),h(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===(f=this.data)||void 0===f?void 0:f._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,h,f;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===(f=null===(h=this.data)||void 0===h?void 0:h._links["fx:accept"])||void 0===f?void 0:f.href))}}customElements.define("foxy-user-invitation-form",V);export{V as UserInvitationForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-1fa1abbd.js";import"./shared-462566b0.js";import"./shared-591ee1bf.js";import"./shared-1301af85.js";import"./shared-bc8a1435.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-084e1772.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import{_ as r,B as t}from"./shared-8f9014ff.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-328aa161.js";import{i as a}from"./shared-53e42a77.js";import{h as i}from"./shared-ba5c42c7.js";import"./shared-b0db52f7.js";import"./shared-021fbb51.js";import"./shared-8dd6e5cc.js";import"./shared-9a291941.js";import"./shared-0ea24ca2.js";import"./shared-be071e3d.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-d48e260f.js";import"./shared-3c0e3876.js";import"./shared-ba43928a.js";import"./shared-910d49eb.js";import"./shared-097487d0.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-b0453b08.js";import"./shared-26b55da2.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-fd8b44e3.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-d01853e2.js";import"./shared-f9bb0924.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-31e75a4a.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-d0aed1c1.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";let n,
|
|
1
|
+
import"./shared-1fa1abbd.js";import"./shared-462566b0.js";import"./shared-591ee1bf.js";import"./shared-1301af85.js";import"./shared-bc8a1435.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-084e1772.js";import"./foxy-webhook-status-card.js";import"./foxy-webhook-log-card.js";import{_ as r,B as t}from"./shared-8f9014ff.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-328aa161.js";import{i as a}from"./shared-53e42a77.js";import{h as i}from"./shared-ba5c42c7.js";import"./shared-b0db52f7.js";import"./shared-021fbb51.js";import"./shared-8dd6e5cc.js";import"./shared-9a291941.js";import"./shared-0ea24ca2.js";import"./shared-be071e3d.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-d48e260f.js";import"./shared-3c0e3876.js";import"./shared-ba43928a.js";import"./shared-910d49eb.js";import"./shared-097487d0.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-b0453b08.js";import"./shared-26b55da2.js";import"./shared-930e68b7.js";import"./shared-41c9c53f.js";import"./shared-fd8b44e3.js";import"./shared-69c98b7b.js";import"./shared-cd96ff03.js";import"./shared-da4f9115.js";import"./shared-9496e995.js";import"./shared-791b4510.js";import"./shared-0e19bda5.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./shared-4e709717.js";import"./foxy-pagination.js";import"./shared-d01853e2.js";import"./shared-f9bb0924.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-31e75a4a.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-d0aed1c1.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";let n,l=e=>e;class d extends(s(e,"webhook-form")){constructor(){super(...arguments),this.getStatusPageHref=null,this.getLogPageHref=null,this.resourceUri=null,this.__encryptionKeyGeneratorOptions={separator:"",length:512},this.__eventResources=[{value:"subscription",label:"event_resource_subscription"},{value:"transaction",label:"event_resource_transaction"},{value:"transaction_log",label:"event_resource_transaction_log"},{value:"customer",label:"event_resource_customer"},{value:"changelog",label:"event_resource_changelog"}]}static get properties(){return r(r({},super.properties),{},{getStatusPageHref:{attribute:!1},getLogPageHref:{attribute:!1},resourceUri:{attribute:"resource-uri"}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!!e&&e.length<=255||"name:v8n_too_long",({url:e})=>!e||e.length<=1e3||"url:v8n_too_long",({query:e})=>!e||e.length<=1e3||"query:v8n_too_long",({encryption_key:e})=>!!e||"encryption-key:v8n_required",({encryption_key:e})=>!e||e.length<=1e3||"encryption-key:v8n_too_long"]}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.data?e.unshift("group-two:event-resource"):e.unshift("logs","statuses"),new t(e.join(" ").trim())}get headerSubtitleOptions(){var e,r;const t=null===(e=this.data)||void 0===e?void 0:e.format;return{context:"json"===t?null===(r=this.data)||void 0===r?void 0:r.event_resource:t}}edit(e){super.edit(e),this.form.format||super.edit({format:"json"}),this.form.version||super.edit({version:2})}renderBody(){var e,r,t,s;const d=this.resourceUri?o(this.resourceUri):null;let c,m;try{const t=new URL(null!==(r=null===(e=this.data)||void 0===e?void 0:e._links["fx:statuses"].href)&&void 0!==r?r:"");null!==d&&t.searchParams.set("resource_id",String(d)),t.searchParams.set("order","date_created desc"),c=t.toString()}catch(e){c=void 0}try{const e=new URL(null!==(s=null===(t=this.data)||void 0===t?void 0:t._links["fx:logs"].href)&&void 0!==s?s:"");null!==d&&e.searchParams.set("resource_id",String(d)),e.searchParams.set("order","date_created desc"),m=e.toString()}catch(e){m=void 0}return i(n||(n=l` ${0} <foxy-internal-summary-control infer="group-one"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="group-two"> <foxy-internal-select-control layout="summary-item" infer="event-resource" .options="${0}"> </foxy-internal-select-control> <foxy-internal-text-control layout="summary-item" infer="query"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="url"></foxy-internal-text-control> <foxy-internal-password-control layout="summary-item" infer="encryption-key" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="group-three"> <foxy-internal-switch-control infer="is-active"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-async-list-control first="${0}" infer="statuses" limit="10" item="foxy-webhook-status-card" hide-delete-button .getPageHref="${0}" .itemProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="${0}" infer="logs" limit="10" item="foxy-webhook-log-card" hide-delete-button .getPageHref="${0}" .itemProps="${0}"> </foxy-internal-async-list-control> ${0} `),this.renderHeader(),this.__eventResources,this.__encryptionKeyGeneratorOptions,a(c),this.getStatusPageHref,this.resourceUri?{layout:"resource"}:{},a(m),this.getLogPageHref,this.resourceUri?{layout:"resource"}:{},super.renderBody())}}customElements.define("foxy-webhook-form",d);export{d as WebhookForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-be071e3d.js";import{a as t}from"./shared-9a454e09.js";import"./foxy-spinner.js";import"./shared-26b55da2.js";import{_ as e,B as s}from"./shared-8f9014ff.js";import{h as i,s as o}from"./shared-ba5c42c7.js";import{D as r}from"./shared-67aeac0f.js";import{A as n}from"./shared-69c98b7b.js";import{i as a}from"./shared-53e42a77.js";let l,d,h,c,f,u,m,p=t=>t;let v,y=t=>t;customElements.define("foxy-internal-post-action-control",class extends t{constructor(){super(...arguments),this.messageOptions={},this.theme=null,this.href=null}static get properties(){return e(e({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},theme:{},href:{}})}renderControl(){var t,e;return i(v||(v=y` <foxy-internal-post-action-control-dialog message-options="${0}" infer="" href="${0}" @hide="${0}"> </foxy-internal-post-action-control-dialog> <vaadin-button theme="${0}" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button"></foxy-i18n> </vaadin-button> `),JSON.stringify(this.messageOptions),a(null!==(t=this.href)&&void 0!==t?t:void 0),(t=>{t.detail.cancelled||this.dispatchEvent(new CustomEvent("success"))}),a(null!==(e=this.theme)&&void 0!==e?e:void 0),this.disabled||this.readonly,(t=>{const e=t.currentTarget,s=this.renderRoot.querySelector("foxy-internal-post-action-control-dialog");null==s||s.show(e)}))}}),customElements.define("foxy-internal-post-action-control-dialog",class extends r{constructor(){super(...arguments),this.messageOptions={},this.closable=!0,this.header="header",this.alert=!0,this.href=null,this.__api=new n(this),this.__state="idle"}static get properties(){return e(e({},super.properties),{},{messageOptions:{type:Object,attribute:"message-options"},href:{},__state:{attribute:!1}})}get hiddenSelector(){const t=["close-button",super.hiddenSelector.toString()];return new s(t.join(" ").trim())}render(){var t=this;return super.render((()=>i(l||(l=p` <div class="relative"> <div class="mb-m mt-xs flex justify-center"> ${0} </div> <foxy-i18n class="block font-lumo text-m text-body text-center mb-l" infer="" key="message_${0}" .options="${0}"> </foxy-i18n> <div class="grid grid-cols-2 gap-m"> ${0} </div> ${0} </div> `),"done"===this.__state?o(d||(d=p`<svg class="text-success" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /></svg>`)):"fail"===this.__state?o(h||(h=p`<svg class="text-error" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z" /></svg>`)):o(c||(c=p`<svg class="text-primary" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" style="width: 2rem; height: 2rem;"><path stroke-linecap="round" stroke-linejoin="round" d="M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z" /></svg>`)),"busy"===this.__state?"idle":this.__state,this.messageOptions,"done"===this.__state||"fail"===this.__state?i(f||(f=p` <vaadin-button class="col-span-2" theme="contrast" @click="${0}"> <foxy-i18n infer="" key="button_close"></foxy-i18n> </vaadin-button> `),(()=>this.hide())):i(u||(u=p` <vaadin-button ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_cancel"></foxy-i18n> </vaadin-button> <vaadin-button theme="primary" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="button_confirm"></foxy-i18n> </vaadin-button> `),this.disabled||this.readonly,(()=>this.hide()),this.disabled||this.readonly,(async function(){if(t.href&&"idle"===t.__state){t.__state="busy",t.closable=!1;const e=await t.__api.fetch(t.href,{method:"POST"});t.__state=e.ok?"done":"fail",t.closable=!0}})),"busy"===this.__state?i(m||(m=p` <div class="bg-base absolute inset-0 flex items-center justify-center"> <foxy-spinner layout="vertical" infer=""></foxy-spinner> </div> `)):"")))}async hide(){await super.hide("done"!==this.__state),this.__state="idle"}});
|
|
@@ -32,7 +32,16 @@
|
|
|
32
32
|
"revoke": {
|
|
33
33
|
"idle": "Revoke access",
|
|
34
34
|
"busy": "Revoking...",
|
|
35
|
-
"fail": "Failed to revoke"
|
|
35
|
+
"fail": "Failed to revoke",
|
|
36
|
+
"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.",
|
|
37
|
+
"message_fail": "Failed to revoke access. If you'd like to retry, close this dialog and click the revoke button again.",
|
|
38
|
+
"message_done": "Your access was revoked successfully. Close this dialog to continue.",
|
|
39
|
+
"button_close": "Close",
|
|
40
|
+
"button_confirm": "Leave this store",
|
|
41
|
+
"button_cancel": "Cancel",
|
|
42
|
+
"loading_busy": "Processing",
|
|
43
|
+
"header": "Confirmation Required",
|
|
44
|
+
"button": "Revoke access"
|
|
36
45
|
},
|
|
37
46
|
"resend": {
|
|
38
47
|
"idle": "Resend invitation",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"subtitle_transaction_log": "Transaction log webhook",
|
|
10
10
|
"subtitle_subscription": "Subscription webhook",
|
|
11
11
|
"subtitle_customer": "Customer webhook",
|
|
12
|
+
"subtitle_changelog": "Changelog webhook",
|
|
12
13
|
"copy-id": {
|
|
13
14
|
"failed_to_copy": "Failed to copy",
|
|
14
15
|
"click_to_copy": "Copy ID",
|
|
@@ -50,7 +51,8 @@
|
|
|
50
51
|
"event_resource_transaction_log": "Transaction log",
|
|
51
52
|
"event_resource_subscription": "Subscription",
|
|
52
53
|
"event_resource_transaction": "Transaction",
|
|
53
|
-
"event_resource_customer": "Customer"
|
|
54
|
+
"event_resource_customer": "Customer",
|
|
55
|
+
"event_resource_changelog": "Changelog"
|
|
54
56
|
},
|
|
55
57
|
"url": {
|
|
56
58
|
"label": "Endpoint",
|
|
@@ -32,6 +32,7 @@ export class InternalPostActionControl extends InternalControl {
|
|
|
32
32
|
|
|
33
33
|
<vaadin-button
|
|
34
34
|
theme=${ifDefined((_b = this.theme) !== null && _b !== void 0 ? _b : void 0)}
|
|
35
|
+
class="w-full"
|
|
35
36
|
?disabled=${this.disabled || this.readonly}
|
|
36
37
|
@click=${(evt) => {
|
|
37
38
|
const button = evt.currentTarget;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InternalPostActionControl.js","sourceRoot":"","sources":["../../../../src/elements/internal/InternalPostActionControl/InternalPostActionControl.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,8CAA2C;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEhC,MAAM,OAAO,yBAA0B,SAAQ,eAAe;IAA9D;;QAUE,mBAAc,GAA2B,EAAE,CAAC;QAE5C,UAAK,GAAkB,IAAI,CAAC;QAE5B,SAAI,GAAkB,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"InternalPostActionControl.js","sourceRoot":"","sources":["../../../../src/elements/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EAAE;QACvB,CAAC;;;;KAIJ,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations, TemplateResult } from 'lit-element';\nimport type { InternalConfirmDialog } from '../InternalConfirmDialog/InternalConfirmDialog';\nimport type { DialogHideEvent } from '../../private/Dialog/DialogHideEvent';\nimport type { ButtonElement } from '@vaadin/vaadin-button';\n\nimport { InternalControl } from '../InternalControl/InternalControl';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\nexport class InternalPostActionControl extends InternalControl {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n messageOptions: { type: Object, attribute: 'message-options' },\n theme: {},\n href: {},\n };\n }\n\n messageOptions: Record<string, string> = {};\n\n theme: string | null = null;\n\n href: string | null = null;\n\n renderControl(): TemplateResult {\n return html`\n <foxy-internal-post-action-control-dialog\n message-options=${JSON.stringify(this.messageOptions)}\n infer=\"\"\n href=${ifDefined(this.href ?? void 0)}\n @hide=${(evt: DialogHideEvent) => {\n if (!evt.detail.cancelled) this.dispatchEvent(new CustomEvent('success'));\n }}\n >\n </foxy-internal-post-action-control-dialog>\n\n <vaadin-button\n theme=${ifDefined(this.theme ?? void 0)}\n class=\"w-full\"\n ?disabled=${this.disabled || this.readonly}\n @click=${(evt: CustomEvent) => {\n const button = evt.currentTarget as ButtonElement;\n const dialog = this.renderRoot.querySelector<InternalConfirmDialog>(\n 'foxy-internal-post-action-control-dialog'\n );\n\n dialog?.show(button);\n }}\n >\n <foxy-i18n infer=\"\" key=\"button\"></foxy-i18n>\n </vaadin-button>\n `;\n }\n}\n"]}
|
|
@@ -15,6 +15,8 @@ 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 logged in user resource URL. Used to display a warning when revoking access. */
|
|
19
|
+
currentUser: string | null;
|
|
18
20
|
/** Admin layout will display user info, user layout (default) will display store info. */
|
|
19
21
|
layout: 'admin' | 'user' | null;
|
|
20
22
|
private readonly __storeDomainGetValue;
|
|
@@ -15,6 +15,8 @@ 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 logged in user resource URL. Used to display a warning when revoking access. */
|
|
19
|
+
this.currentUser = null;
|
|
18
20
|
/** Admin layout will display user info, user layout (default) will display store info. */
|
|
19
21
|
this.layout = null;
|
|
20
22
|
this.__storeDomainGetValue = () => {
|
|
@@ -29,6 +31,7 @@ export class UserInvitationForm extends Base {
|
|
|
29
31
|
...super.properties,
|
|
30
32
|
getStorePageHref: { attribute: false },
|
|
31
33
|
defaultDomain: { attribute: 'default-domain' },
|
|
34
|
+
currentUser: { attribute: 'current-user' },
|
|
32
35
|
layout: {},
|
|
33
36
|
};
|
|
34
37
|
}
|
|
@@ -149,8 +152,8 @@ export class UserInvitationForm extends Base {
|
|
|
149
152
|
</div>
|
|
150
153
|
`;
|
|
151
154
|
}
|
|
152
|
-
__renderAdminSnapshotState({ first_name, last_name }) {
|
|
153
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
155
|
+
__renderAdminSnapshotState({ first_name, last_name, store_name, _links }) {
|
|
156
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
154
157
|
const hasName = (first_name === null || first_name === void 0 ? void 0 : first_name.trim()) || (last_name === null || last_name === void 0 ? void 0 : last_name.trim());
|
|
155
158
|
const nameOptions = { first_name, last_name, context: hasName ? '' : 'empty' };
|
|
156
159
|
const status = (_a = this.data) === null || _a === void 0 ? void 0 : _a.status;
|
|
@@ -217,18 +220,35 @@ export class UserInvitationForm extends Base {
|
|
|
217
220
|
hidden.matches('resend', true) &&
|
|
218
221
|
hidden.matches('delete', true)}
|
|
219
222
|
>
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
${this.currentUser && _links['fx:user'] && this.currentUser === _links['fx:user'].href
|
|
224
|
+
? html `
|
|
225
|
+
<foxy-internal-post-action-control
|
|
226
|
+
message-options=${JSON.stringify({
|
|
227
|
+
store_domain: this.__storeDomainGetValue(),
|
|
228
|
+
store_name,
|
|
229
|
+
})}
|
|
230
|
+
infer="revoke"
|
|
231
|
+
class="flex-1"
|
|
232
|
+
theme="error"
|
|
233
|
+
href=${ifDefined((_e = (_d = this.data) === null || _d === void 0 ? void 0 : _d._links['fx:revoke']) === null || _e === void 0 ? void 0 : _e.href)}
|
|
234
|
+
@success=${() => this.dispatchEvent(new CustomEvent('selfrevoked'))}
|
|
235
|
+
>
|
|
236
|
+
</foxy-internal-post-action-control>
|
|
237
|
+
`
|
|
238
|
+
: html `
|
|
239
|
+
<foxy-internal-user-invitation-form-async-action
|
|
240
|
+
infer="revoke"
|
|
241
|
+
class="flex-1"
|
|
242
|
+
theme="error"
|
|
243
|
+
href=${ifDefined((_g = (_f = this.data) === null || _f === void 0 ? void 0 : _f._links['fx:revoke']) === null || _g === void 0 ? void 0 : _g.href)}
|
|
244
|
+
>
|
|
245
|
+
</foxy-internal-user-invitation-form-async-action>
|
|
246
|
+
`}
|
|
227
247
|
|
|
228
248
|
<foxy-internal-user-invitation-form-async-action
|
|
229
249
|
infer="resend"
|
|
230
250
|
class="flex-1"
|
|
231
|
-
href=${ifDefined((
|
|
251
|
+
href=${ifDefined((_j = (_h = this.data) === null || _h === void 0 ? void 0 : _h._links['fx:resend']) === null || _j === void 0 ? void 0 : _j.href)}
|
|
232
252
|
>
|
|
233
253
|
</foxy-internal-user-invitation-form-async-action>
|
|
234
254
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInvitationForm.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/UserInvitationFor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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 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 /** 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 }: 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 <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 <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/UserInvitationForm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB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,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/index.ts"],"names":[],"mappings":"AAAA,wDAAqD;AACrD,uDAAoD;AACpD,qDAAkD;AAClD,8CAA2C;AAE3C,mEAAgE;AAEhE,OAAO,EAAE,kBAAkB,EAAE,gCAA6B;AAE1D,cAAc,CAAC,MAAM,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import '../../internal/InternalSummaryControl/index';\nimport '../../internal/InternalDeleteControl/index';\nimport '../../internal/InternalTextControl/index';\nimport '../../internal/InternalForm/index';\n\nimport './internal/InternalUserInvitationFormAsyncAction/index';\n\nimport { UserInvitationForm } from './UserInvitationForm';\n\ncustomElements.define('foxy-user-invitation-form', UserInvitationForm);\n\nexport { UserInvitationForm };\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/elements/public/UserInvitationForm/index.ts"],"names":[],"mappings":"AAAA,2DAAwD;AACxD,wDAAqD;AACrD,uDAAoD;AACpD,qDAAkD;AAClD,8CAA2C;AAE3C,mEAAgE;AAEhE,OAAO,EAAE,kBAAkB,EAAE,gCAA6B;AAE1D,cAAc,CAAC,MAAM,CAAC,2BAA2B,EAAE,kBAAkB,CAAC,CAAC;AAEvE,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import '../../internal/InternalPostActionControl/index';\nimport '../../internal/InternalSummaryControl/index';\nimport '../../internal/InternalDeleteControl/index';\nimport '../../internal/InternalTextControl/index';\nimport '../../internal/InternalForm/index';\n\nimport './internal/InternalUserInvitationFormAsyncAction/index';\n\nimport { UserInvitationForm } from './UserInvitationForm';\n\ncustomElements.define('foxy-user-invitation-form', UserInvitationForm);\n\nexport { UserInvitationForm };\n"]}
|
|
@@ -27,6 +27,7 @@ export class WebhookForm extends TranslatableMixin(InternalForm, 'webhook-form')
|
|
|
27
27
|
{ value: 'transaction', label: 'event_resource_transaction' },
|
|
28
28
|
{ value: 'transaction_log', label: 'event_resource_transaction_log' },
|
|
29
29
|
{ value: 'customer', label: 'event_resource_customer' },
|
|
30
|
+
{ value: 'changelog', label: 'event_resource_changelog' },
|
|
30
31
|
];
|
|
31
32
|
}
|
|
32
33
|
static get properties() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebhookForm.js","sourceRoot":"","sources":["../../../../src/elements/public/WebhookForm/WebhookForm.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,wCAAqC;A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KhB,IAAI,CAAC,iBAAiB;qBACxB,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;;;;;gBAKnD,SAAS,CAAC,QAAQ,CAAC;;;;;uBAKZ,IAAI,CAAC,cAAc;qBACrB,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE;;;;QAI3D,KAAK,CAAC,UAAU,EAAE;KACrB,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { PropertyDeclarations } from 'lit-element';\nimport type { TemplateResult } from 'lit-html';\nimport type { NucleonV8N } from '../NucleonElement/types';\nimport type { Data, WebhookLog } from './types';\n\nimport { BooleanSelector, getResourceId } from '@foxy.io/sdk/core';\nimport { TranslatableMixin } from '../../../mixins/translatable';\nimport { InternalForm } from '../../internal/InternalForm/InternalForm';\nimport { ifDefined } from 'lit-html/directives/if-defined';\nimport { html } from 'lit-html';\n\n/**\n * Form element for creating or editing webhooks (`fx:webhook`).\n *\n * @element foxy-webhook-form\n * @since 1.17.0\n */\nexport class WebhookForm extends TranslatableMixin(InternalForm, 'webhook-form')<Data> {\n static get properties(): PropertyDeclarations {\n return {\n ...super.properties,\n getStatusPageHref: { attribute: false },\n getLogPageHref: { attribute: false },\n resourceUri: { attribute: 'resource-uri' },\n };\n }\n\n static get v8n(): NucleonV8N<Data> {\n return [\n ({ name: v }) => !!v || 'name:v8n_required',\n ({ name: v }) => (!!v && v.length <= 255) || 'name:v8n_too_long',\n ({ url: v }) => !v || v.length <= 1000 || 'url:v8n_too_long',\n ({ query: v }) => !v || v.length <= 1000 || 'query:v8n_too_long',\n ({ encryption_key: v }) => !!v || 'encryption-key:v8n_required',\n ({ encryption_key: v }) => !v || v.length <= 1000 || 'encryption-key:v8n_too_long',\n ];\n }\n\n /** If set, renders Statuses list items as <a> tags. */\n getStatusPageHref: ((statusHref: string, status: WebhookLog) => string | null) | null = null;\n\n /** If set, renders Logs list items as <a> tags. */\n getLogPageHref: ((logHref: string, log: WebhookLog) => string | null) | null = null;\n\n /**\n * Optional URI of a transaction, customer or subscription. When provided,\n * the form will display logs and statuses for that particular resource only.\n */\n resourceUri: string | null = null;\n\n private __encryptionKeyGeneratorOptions = { separator: '', length: 512 };\n\n private __eventResources = [\n { value: 'subscription', label: 'event_resource_subscription' },\n { value: 'transaction', label: 'event_resource_transaction' },\n { value: 'transaction_log', label: 'event_resource_transaction_log' },\n { value: 'customer', label: 'event_resource_customer' },\n { value: 'changelog', label: 'event_resource_changelog' },\n ];\n\n get hiddenSelector(): BooleanSelector {\n const alwaysMatch: string[] = [super.hiddenSelector.toString()];\n\n if (this.data) {\n alwaysMatch.unshift('group-two:event-resource');\n } else {\n alwaysMatch.unshift('logs', 'statuses');\n }\n\n return new BooleanSelector(alwaysMatch.join(' ').trim());\n }\n\n get headerSubtitleOptions(): Record<string, unknown> {\n const format = this.data?.format;\n return { context: format === 'json' ? this.data?.event_resource : format };\n }\n\n edit(data: Partial<Data>): void {\n super.edit(data);\n if (!this.form.format) super.edit({ format: 'json' });\n if (!this.form.version) super.edit({ version: 2 });\n }\n\n renderBody(): TemplateResult {\n const resourceId = this.resourceUri ? getResourceId(this.resourceUri) : null;\n\n let statusesLink: string | undefined;\n let logsLink: string | undefined;\n\n try {\n const url = new URL(this.data?._links['fx:statuses'].href ?? '');\n if (resourceId !== null) url.searchParams.set('resource_id', String(resourceId));\n url.searchParams.set('order', 'date_created desc');\n statusesLink = url.toString();\n } catch {\n statusesLink = undefined;\n }\n\n try {\n const url = new URL(this.data?._links['fx:logs'].href ?? '');\n if (resourceId !== null) url.searchParams.set('resource_id', String(resourceId));\n url.searchParams.set('order', 'date_created desc');\n logsLink = url.toString();\n } catch {\n logsLink = undefined;\n }\n\n return html`\n ${this.renderHeader()}\n\n <foxy-internal-summary-control infer=\"group-one\">\n <foxy-internal-text-control layout=\"summary-item\" infer=\"name\"></foxy-internal-text-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"group-two\">\n <foxy-internal-select-control\n layout=\"summary-item\"\n infer=\"event-resource\"\n .options=${this.__eventResources}\n >\n </foxy-internal-select-control>\n\n <foxy-internal-text-control layout=\"summary-item\" infer=\"query\">\n </foxy-internal-text-control>\n\n <foxy-internal-text-control layout=\"summary-item\" infer=\"url\"></foxy-internal-text-control>\n\n <foxy-internal-password-control\n layout=\"summary-item\"\n infer=\"encryption-key\"\n show-generator\n .generatorOptions=${this.__encryptionKeyGeneratorOptions}\n >\n </foxy-internal-password-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-summary-control infer=\"group-three\">\n <foxy-internal-switch-control infer=\"is-active\"></foxy-internal-switch-control>\n </foxy-internal-summary-control>\n\n <foxy-internal-async-list-control\n first=${ifDefined(statusesLink)}\n infer=\"statuses\"\n limit=\"10\"\n item=\"foxy-webhook-status-card\"\n hide-delete-button\n .getPageHref=${this.getStatusPageHref}\n .itemProps=${this.resourceUri ? { layout: 'resource' } : {}}\n >\n </foxy-internal-async-list-control>\n\n <foxy-internal-async-list-control\n first=${ifDefined(logsLink)}\n infer=\"logs\"\n limit=\"10\"\n item=\"foxy-webhook-log-card\"\n hide-delete-button\n .getPageHref=${this.getLogPageHref}\n .itemProps=${this.resourceUri ? { layout: 'resource' } : {}}\n >\n </foxy-internal-async-list-control>\n\n ${super.renderBody()}\n `;\n }\n}\n"]}
|