@foxy.io/elements 1.49.0-beta.1 → 1.49.0-beta.2
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-cart-form.js +2 -2
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-transactions-table.js +1 -1
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/shared-063c93be.js +1 -0
- package/dist/cdn/{shared-d9457718.js → shared-1fa1abbd.js} +2 -2
- package/dist/cdn/translations/native-integration-form/en.json +1 -1
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.d.ts +3 -0
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js +7 -2
- package/dist/elements/internal/InternalAsyncListControl/InternalAsyncListControl.js.map +1 -1
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.d.ts +2 -0
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js +9 -1
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js.map +1 -1
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.d.ts +1 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js +6 -0
- package/dist/elements/public/GiftCardCodeForm/GiftCardCodeForm.js.map +1 -1
- package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js +1 -1
- package/dist/elements/public/NativeIntegrationForm/NativeIntegrationForm.js.map +1 -1
- package/dist/elements/public/TransactionsTable/TransactionsTable.js +1 -1
- package/dist/elements/public/TransactionsTable/TransactionsTable.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-6e0eccb8.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-8f61408a.js";import"./shared-d9457718.js";import"./shared-591ee1bf.js";import"./shared-1301af85.js";import"./shared-bc8a1435.js";import"./shared-d01853e2.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-eadf0d23.js";import"./foxy-native-integration-card.js";import"./foxy-item-category-card.js";import"./foxy-nucleon-element.js";import{_ as t,B as r}from"./shared-8f9014ff.js";import{a as i}from"./shared-328aa161.js";import{i as o}from"./shared-53e42a77.js";import{h as n}from"./shared-ba5c42c7.js";import"./shared-0ea24ca2.js";import"./shared-b0db52f7.js";import"./shared-021fbb51.js";import"./shared-9a291941.js";import"./shared-be071e3d.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.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-pagination.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-f9bb0924.js";import"./shared-d48e260f.js";import"./shared-ba43928a.js";import"./shared-910d49eb.js";import"./shared-097487d0.js";import"./shared-4e709717.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-d0aed1c1.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";import"./shared-490dadf8.js";let s,a=e=>e;const l=i(e,"tax-form"),u=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],d=[...u,"AU"];class c extends l{constructor(){super(...arguments),this.nativeIntegrations=null,this.itemCategories=null,this.countries=null,this.regions=null,this.__countrySetValue=e=>{this.edit({country:e,region:"",city:""}),this.edit({apply_to_shipping:this.__isApplyToShippingHidden})},this.__regionSetValue=e=>{this.edit({region:e,city:""})},this.__typeSetValue=e=>{this.edit({type:e,country:"",region:"",city:"",service_provider:"custom_tax_endpoint"===e?"custom_tax":"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})},this.__typeOptions=JSON.stringify([{label:"option_custom_tax_endpoint",value:"custom_tax_endpoint"},{label:"option_global",value:"global"},{label:"option_union",value:"union"},{label:"option_country",value:"country"},{label:"option_region",value:"region"},{label:"option_local",value:"local"}])}static get properties(){return t(t({},super.properties),{},{nativeIntegrations:{attribute:"native-integrations"},itemCategories:{attribute:"item-categories"},countries:{},regions:{}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=30||"name:v8n_too_long",({country:e,type:t})=>"country"!==t||!!e||"country:v8n_required",({country:e,type:t})=>"region"!==t||!!e||"country:v8n_required",({country:e,use_origin_rates:t})=>!t||!!e||"country:v8n_required",({region:e,type:t})=>"region"!=t||!!e||"region:v8n_required",({region:e})=>!e||e.length<=20||"region:v8n_too_long",({city:e})=>!e||e.length<=50||"city:v8n_too_long",({city:e,type:t})=>"local"!=t||!!e||"city:v8n_required",({rate:e,type:t,is_live:r})=>void 0===e||e>0||"custom_tax_endpoint"===t||void 0===t||r||"rate:v8n_invalid"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return e.unshift("native-integrations"),new r(e.join(" ").trim())}get hiddenSelector(){var e,t,i;const o=[super.hiddenSelector.toString()],n=this.form.type;"global"===n||"custom_tax_endpoint"===n?(o.unshift("group-one:is-live","group-one:service-provider"),"custom_tax_endpoint"===n&&o.unshift("group-one:rate")):this.form.is_live?o.unshift("group-one:rate"):o.unshift("group-one:service-provider"),void 0===this.__nativeIntegrationsUrl&&o.unshift("native-integrations"),this.__isCountryHidden&&o.unshift("group-three:country"),this.__isRegionHidden&&o.unshift("group-three:region-select","group-three:region-input"),this.__isCityHidden&&o.unshift("group-three:city"),this.__isApplyToShippingHidden&&o.unshift("group-two:apply-to-shipping"),this.__isUseOriginRatesHidden&&o.unshift("group-two:use-origin-rates"),this.__isExemptAllCustomerTaxIdsHidden&&o.unshift("group-two:exempt-all-customer-tax-ids");const s=Object.values(null!==(i=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==i?i:{});return o.unshift("group-three:region-"+(s.length?"input":"select")),this.data&&this.itemCategories||o.unshift("item-categories"),new r(o.join(" ").trim())}renderBody(){var e,t,r,i,l,u,d,c,p,m;const h=Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2}))),f=Object.values(null!==(u=null===(l=null===(i=this.__regionsLoader)||void 0===i?void 0:i.data)||void 0===l?void 0:l.values)&&void 0!==u?u:{}).map((e=>({rawLabel:e.default,value:e.code})));return n(s||(s=a` ${0} <foxy-internal-summary-control infer="group-one"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="type" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="is-live"></foxy-internal-switch-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="service-provider"> </foxy-internal-select-control> <foxy-internal-number-control layout="summary-item" suffix="%" infer="rate" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="native-integrations" first="${0}" item="foxy-native-integration-card"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="group-two"> <foxy-internal-switch-control infer="exempt-all-customer-tax-ids"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="apply-to-shipping"></foxy-internal-switch-control> <foxy-internal-switch-control infer="use-origin-rates"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="group-three"> <foxy-internal-select-control options="${0}" layout="summary-item" infer="country" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-select-control property="region" options="${0}" layout="summary-item" infer="region-select" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-text-control property="region" layout="summary-item" infer="region-input" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="city"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="tax_uri" own-uri="${0}" options-href="${0}" links-href="${0}" embed-key="fx:tax_item_categories" infer="item-categories" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" class="hidden" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__typeOptions,this.__typeSetValue,JSON.stringify(this.__serviceProviderOptions),o(this.__nativeIntegrationsUrl),JSON.stringify(h),this.__countrySetValue,JSON.stringify(f),this.__regionSetValue,this.__regionSetValue,o(null===(d=this.data)||void 0===d?void 0:d._links.self.href),o(null!==(c=this.itemCategories)&&void 0!==c?c:void 0),o(null===(p=this.data)||void 0===p?void 0:p._links["fx:tax_item_categories"].href),super.renderBody(),o(null!==(m=this.countries)&&void 0!==m?m:void 0),(()=>this.requestUpdate()),o(this.__regionsUrl),(()=>this.requestUpdate()))}get __serviceProviderOptions(){const e=[{label:"option_avalara",value:"avalara"},{label:"option_onesource",value:"onesource"}];return"union"!==this.form.type&&this.form.country&&!u.includes(this.form.country)||e.unshift({label:"option_default",value:""}),"union"!==this.form.type&&this.form.country&&!d.includes(this.form.country)||e.push({label:"option_taxjar",value:"taxjar"}),e}get __nativeIntegrationsUrl(){var e;try{const t=new URL(null!==(e=this.nativeIntegrations)&&void 0!==e?e:""),r=this.form.service_provider;if(r)return t.searchParams.set("provider",r),t.toString()}catch(e){}}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.form.country;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __isExemptAllCustomerTaxIdsHidden(){const e=this.form.service_provider,t=this.form.type;return"custom_tax_endpoint"===t||("country"===t||"region"===t||"local"===t||"union"===t)&&(!!this.form.is_live&&("onesource"===e||"avalara"===e))}get __isApplyToShippingHidden(){const e=this.form.type;return!e||"custom_tax_endpoint"===e||"union"!==e&&(!("country"!==e||!this.form.is_live)||(!("region"!==e||!this.form.is_live)||!!this.form.is_live&&u.includes(this.form.country)))}get __isUseOriginRatesHidden(){return"union"!==this.form.type||!this.form.is_live||!!this.form.service_provider}get __isCountryHidden(){return"union"===this.form.type?(!this.form.service_provider||this.form.is_live)&&!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type)}get __isRegionHidden(){return"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return"local"!==this.form.type}}customElements.define("foxy-tax-form",c);export{c as TaxForm};
|
|
1
|
+
import"./shared-8f61408a.js";import"./shared-1fa1abbd.js";import"./shared-591ee1bf.js";import"./shared-1301af85.js";import"./shared-bc8a1435.js";import"./shared-d01853e2.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-eadf0d23.js";import"./foxy-native-integration-card.js";import"./foxy-item-category-card.js";import"./foxy-nucleon-element.js";import{_ as t,B as r}from"./shared-8f9014ff.js";import{a as i}from"./shared-328aa161.js";import{i as o}from"./shared-53e42a77.js";import{h as n}from"./shared-ba5c42c7.js";import"./shared-0ea24ca2.js";import"./shared-b0db52f7.js";import"./shared-021fbb51.js";import"./shared-9a291941.js";import"./shared-be071e3d.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-8dd6e5cc.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-pagination.js";import"./shared-9a454e09.js";import"./shared-5212ef4f.js";import"./shared-f9bb0924.js";import"./shared-d48e260f.js";import"./shared-ba43928a.js";import"./shared-910d49eb.js";import"./shared-097487d0.js";import"./shared-4e709717.js";import"./shared-ad470adf.js";import"./shared-5fbbaea2.js";import"./shared-3c0e3876.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-4cc1fb20.js";import"./shared-67aeac0f.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-d0aed1c1.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";import"./shared-490dadf8.js";let s,a=e=>e;const l=i(e,"tax-form"),u=["US","CA","AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GB","GR","HR","HU","IE","IM","IT","LT","LU","LV","MC","MT","NL","PL","PT","RO","SE","SI","SK"],d=[...u,"AU"];class c extends l{constructor(){super(...arguments),this.nativeIntegrations=null,this.itemCategories=null,this.countries=null,this.regions=null,this.__countrySetValue=e=>{this.edit({country:e,region:"",city:""}),this.edit({apply_to_shipping:this.__isApplyToShippingHidden})},this.__regionSetValue=e=>{this.edit({region:e,city:""})},this.__typeSetValue=e=>{this.edit({type:e,country:"",region:"",city:"",service_provider:"custom_tax_endpoint"===e?"custom_tax":"",apply_to_shipping:!1,use_origin_rates:!1,exempt_all_customer_tax_ids:!1,is_live:!1,rate:0})},this.__typeOptions=JSON.stringify([{label:"option_custom_tax_endpoint",value:"custom_tax_endpoint"},{label:"option_global",value:"global"},{label:"option_union",value:"union"},{label:"option_country",value:"country"},{label:"option_region",value:"region"},{label:"option_local",value:"local"}])}static get properties(){return t(t({},super.properties),{},{nativeIntegrations:{attribute:"native-integrations"},itemCategories:{attribute:"item-categories"},countries:{},regions:{}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=30||"name:v8n_too_long",({country:e,type:t})=>"country"!==t||!!e||"country:v8n_required",({country:e,type:t})=>"region"!==t||!!e||"country:v8n_required",({country:e,use_origin_rates:t})=>!t||!!e||"country:v8n_required",({region:e,type:t})=>"region"!=t||!!e||"region:v8n_required",({region:e})=>!e||e.length<=20||"region:v8n_too_long",({city:e})=>!e||e.length<=50||"city:v8n_too_long",({city:e,type:t})=>"local"!=t||!!e||"city:v8n_required",({rate:e,type:t,is_live:r})=>void 0===e||e>0||"custom_tax_endpoint"===t||void 0===t||r||"rate:v8n_invalid"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return e.unshift("native-integrations"),new r(e.join(" ").trim())}get hiddenSelector(){var e,t,i;const o=[super.hiddenSelector.toString()],n=this.form.type;"global"===n||"custom_tax_endpoint"===n?(o.unshift("group-one:is-live","group-one:service-provider"),"custom_tax_endpoint"===n&&o.unshift("group-one:rate")):this.form.is_live?o.unshift("group-one:rate"):o.unshift("group-one:service-provider"),void 0===this.__nativeIntegrationsUrl&&o.unshift("native-integrations"),this.__isCountryHidden&&o.unshift("group-three:country"),this.__isRegionHidden&&o.unshift("group-three:region-select","group-three:region-input"),this.__isCityHidden&&o.unshift("group-three:city"),this.__isApplyToShippingHidden&&o.unshift("group-two:apply-to-shipping"),this.__isUseOriginRatesHidden&&o.unshift("group-two:use-origin-rates"),this.__isExemptAllCustomerTaxIdsHidden&&o.unshift("group-two:exempt-all-customer-tax-ids");const s=Object.values(null!==(i=null===(t=null===(e=this.__regionsLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==i?i:{});return o.unshift("group-three:region-"+(s.length?"input":"select")),this.data&&this.itemCategories||o.unshift("item-categories"),new r(o.join(" ").trim())}renderBody(){var e,t,r,i,l,u,d,c,p,m;const h=Object.values(null!==(r=null===(t=null===(e=this.__countriesLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t.values)&&void 0!==r?r:{}).map((e=>({rawLabel:e.default,value:e.cc2}))),f=Object.values(null!==(u=null===(l=null===(i=this.__regionsLoader)||void 0===i?void 0:i.data)||void 0===l?void 0:l.values)&&void 0!==u?u:{}).map((e=>({rawLabel:e.default,value:e.code})));return n(s||(s=a` ${0} <foxy-internal-summary-control infer="group-one"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="type" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-switch-control infer="is-live"></foxy-internal-switch-control> <foxy-internal-select-control options="${0}" layout="summary-item" infer="service-provider"> </foxy-internal-select-control> <foxy-internal-number-control layout="summary-item" suffix="%" infer="rate" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-async-list-control infer="native-integrations" first="${0}" item="foxy-native-integration-card"> </foxy-internal-async-list-control> <foxy-internal-summary-control infer="group-two"> <foxy-internal-switch-control infer="exempt-all-customer-tax-ids"> </foxy-internal-switch-control> <foxy-internal-switch-control infer="apply-to-shipping"></foxy-internal-switch-control> <foxy-internal-switch-control infer="use-origin-rates"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="group-three"> <foxy-internal-select-control options="${0}" layout="summary-item" infer="country" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-select-control property="region" options="${0}" layout="summary-item" infer="region-select" .setValue="${0}"> </foxy-internal-select-control> <foxy-internal-text-control property="region" layout="summary-item" infer="region-input" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-text-control layout="summary-item" infer="city"></foxy-internal-text-control> </foxy-internal-summary-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="tax_uri" own-uri="${0}" options-href="${0}" links-href="${0}" embed-key="fx:tax_item_categories" infer="item-categories" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="countriesLoader" @update="${0}"> </foxy-nucleon> <foxy-nucleon infer="" class="hidden" href="${0}" id="regionsLoader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__typeOptions,this.__typeSetValue,JSON.stringify(this.__serviceProviderOptions),o(this.__nativeIntegrationsUrl),JSON.stringify(h),this.__countrySetValue,JSON.stringify(f),this.__regionSetValue,this.__regionSetValue,o(null===(d=this.data)||void 0===d?void 0:d._links.self.href),o(null!==(c=this.itemCategories)&&void 0!==c?c:void 0),o(null===(p=this.data)||void 0===p?void 0:p._links["fx:tax_item_categories"].href),super.renderBody(),o(null!==(m=this.countries)&&void 0!==m?m:void 0),(()=>this.requestUpdate()),o(this.__regionsUrl),(()=>this.requestUpdate()))}get __serviceProviderOptions(){const e=[{label:"option_avalara",value:"avalara"},{label:"option_onesource",value:"onesource"}];return"union"!==this.form.type&&this.form.country&&!u.includes(this.form.country)||e.unshift({label:"option_default",value:""}),"union"!==this.form.type&&this.form.country&&!d.includes(this.form.country)||e.push({label:"option_taxjar",value:"taxjar"}),e}get __nativeIntegrationsUrl(){var e;try{const t=new URL(null!==(e=this.nativeIntegrations)&&void 0!==e?e:""),r=this.form.service_provider;if(r)return t.searchParams.set("provider",r),t.toString()}catch(e){}}get __regionsUrl(){var e;try{const t=new URL(null!==(e=this.regions)&&void 0!==e?e:""),r=this.form.country;return r&&t.searchParams.set("country_code",r),t.toString()}catch(e){}}get __countriesLoader(){return this.renderRoot.querySelector("#countriesLoader")}get __regionsLoader(){return this.renderRoot.querySelector("#regionsLoader")}get __isExemptAllCustomerTaxIdsHidden(){const e=this.form.service_provider,t=this.form.type;return"custom_tax_endpoint"===t||("country"===t||"region"===t||"local"===t||"union"===t)&&(!!this.form.is_live&&("onesource"===e||"avalara"===e))}get __isApplyToShippingHidden(){const e=this.form.type;return!e||"custom_tax_endpoint"===e||"union"!==e&&(!("country"!==e||!this.form.is_live)||(!("region"!==e||!this.form.is_live)||!!this.form.is_live&&u.includes(this.form.country)))}get __isUseOriginRatesHidden(){return"union"!==this.form.type||!this.form.is_live||!!this.form.service_provider}get __isCountryHidden(){return"union"===this.form.type?(!this.form.service_provider||this.form.is_live)&&!this.form.use_origin_rates:!["country","region","local"].includes(this.form.type)}get __isRegionHidden(){return"local"!==this.form.type&&"region"!==this.form.type}get __isCityHidden(){return"local"!==this.form.type}}customElements.define("foxy-tax-form",c);export{c as TaxForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-063c93be.js";import"./shared-1301af85.js";import"./shared-a9a8eb7c.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-eadf0d23.js";import"./foxy-payments-api-payment-preset-card.js";import"./foxy-nucleon-element.js";import"./foxy-i18n-editor.js";import{_ as r,B as o}from"./shared-8f9014ff.js";import{R as t,a as s}from"./shared-328aa161.js";import{i as a}from"./shared-53e42a77.js";import{h as d}from"./shared-ba5c42c7.js";import"./shared-be071e3d.js";import"./shared-b0db52f7.js";import"./shared-021fbb51.js";import"./shared-9a291941.js";import"./shared-1fa1abbd.js";import"./shared-8dd6e5cc.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"./shared-591ee1bf.js";import"./shared-9a454e09.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"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-18e301f2.js";import"./shared-b0453b08.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"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-bab2ea2c.js";import"./shared-d0aed1c1.js";import"./shared-490dadf8.js";import"./shared-de4ec7bb.js";import"./shared-e9d87207.js";let i,n,l=e=>e;const p=t(s(e,"template-set-form"));class c extends p{constructor(){super(...arguments),this.paymentMethodSets=null,this.languageStrings=null,this.localeCodes=null,this.languages=null,this.__localeCodesLoaderId="localeCodesLoader",this.__languagesLoaderId="languagesLoader"}static get properties(){return r(r({},super.properties),{},{paymentMethodSets:{attribute:"payment-method-sets"},languageStrings:{attribute:"language-strings"},localeCodes:{attribute:"locale-codes"},languages:{}})}static get v8n(){return[({description:e})=>!!e||"description:v8n_required",({description:e})=>!!e&&e.length<=100||"description:v8n_too_long",({code:e})=>!!e||"code:v8n_required",({code:e})=>!!e&&e.length<=50||"code:v8n_too_long",({language:e})=>!!e||"language:v8n_required",({locale_code:e})=>!!e||"locale_code:v8n_required"]}get headerSubtitleOptions(){var e;return r(r({},super.headerSubtitleOptions),{},{context:"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)?"default":""})}get disabledSelector(){var e,r;const t=[];return(null===(e=this.__languagesLoader)||void 0===e?void 0:e.data)||t.push("language"),(null===(r=this.__localeCodesLoader)||void 0===r?void 0:r.data)||t.push("locale-code"),new o(`${t.join(" ")} ${super.disabledSelector}`)}get hiddenSelector(){var e;const r=[];return"DEFAULT"===(null===(e=this.data)||void 0===e?void 0:e.code)&&r.push("delete","code","description"),new o(`${r.join(" ")} ${super.hiddenSelector}`)}renderBody(){var e,r,o,t,s,p,c,h;const m=Object.entries(null!==(o=null===(r=null===(e=this.__localeCodesLoader)||void 0===e?void 0:e.data)||void 0===r?void 0:r.values)&&void 0!==o?o:{}).map((([e,r])=>({value:e,rawLabel:r}))),u=Object.entries(null!==(p=null===(s=null===(t=this.__languagesLoader)||void 0===t?void 0:t.data)||void 0===s?void 0:s.values)&&void 0!==p?p:{}).map((([e,r])=>({value:e,label:r})));return d(i||(i=l` ${0} <div class="grid grid-cols-1 gap-m sm-grid-cols-2"> <foxy-internal-text-control infer="description"></foxy-internal-text-control> <foxy-internal-text-control infer="code"></foxy-internal-text-control> <foxy-internal-select-control infer="language" .options="${0}"> </foxy-internal-select-control> <foxy-internal-select-control infer="locale-code" .options="${0}"> </foxy-internal-select-control> </div> <foxy-internal-resource-picker-control infer="payment-method-set-uri" first="${0}" item="foxy-payments-api-payment-preset-card"> </foxy-internal-resource-picker-control> ${0} ${0} <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> <foxy-nucleon class="hidden" infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),u,m,this.paymentMethodSets,this.data&&this.languageStrings&&!this.hiddenSelector.matches("language-overrides",!0)?d(n||(n=l` <div> ${0} <foxy-i18n-editor language-overrides="${0}" selected-language="${0}" infer="language-overrides" href="${0}"> </foxy-i18n-editor> ${0} </div> `),this.renderTemplateOrSlot("language-overrides:before"),this.data._links["fx:language_overrides"].href,this.form.language,this.languageStrings,this.renderTemplateOrSlot("language-overrides:after")):"",super.renderBody(),a(null!==(c=this.languages)&&void 0!==c?c:void 0),this.__languagesLoaderId,(()=>this.requestUpdate()),a(null!==(h=this.localeCodes)&&void 0!==h?h:void 0),this.__localeCodesLoaderId,(()=>this.requestUpdate()))}get __localeCodesLoader(){return this.renderRoot.querySelector(`#${this.__localeCodesLoaderId}`)}get __languagesLoader(){return this.renderRoot.querySelector(`#${this.__languagesLoaderId}`)}}customElements.define("foxy-template-set-form",c);export{c as TemplateSetForm};
|
|
@@ -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-d9457718.js";import"./shared-591ee1bf.js";import"./shared-bc8a1435.js";import{I as l}from"./shared-eadf0d23.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-759f65d8.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-6e0eccb8.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-5078246e.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-2061be9a.js";import"./shared-f0fa0a88.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 h,p,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(h||(h=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(p||(p=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 $,j,k,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(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="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(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="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,Z,O,R,M,I,q=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends e{constructor(){super(...arguments),this.folders=null}static get properties(){return t(t({},super.properties),{},{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):"")}__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;return i(E||(E=q` <foxy-internal-post-action-control infer="refund" theme="tertiary-inline" 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:refund"])||void 0===o?void 0:o.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(Z||(Z=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(O||(O=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 G,T,U,V,W,z,D,F,J,N,K,Q=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(G||(G=Q``));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:[],h=null!==(s=null===(r=u._embedded)||void 0===r?void 0:r["fx:shipments"])&&void 0!==s?s:[];return i(T||(T=Q` <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> </p> `),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===h.length||0===u.total_shipping?i(U||(U=Q` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):h.map((e=>i(V||(V=Q` <span>${0}:</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?i(W||(W=Q` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>i(z||(z=Q` <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(D||(D=Q` <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(F||(F=Q` <span data-testclass="discount">${0}${0}:</span> <span>${0}</span> `),e,t?i(J||(J=Q` • ${0}`),t):"",this.__renderPrice(o,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}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(N||(N=Q` <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(K||(K=Q` <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 X,Y,ee,te,oe=e=>e;const ie=u(f(l,"transaction"));class re extends ie{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 re.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=>{re.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(X||(X=oe`<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,t;const o=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:transaction_folders"].href;return i(Y||(Y=oe` <foxy-internal-transaction-actions-control folders="${0}" infer="actions"> </foxy-internal-transaction-actions-control> `),a(o))}renderBody(){var e,t,o,r,s,n,l,d,c,u,f,h,p,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(ee||(ee=oe` ${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(te||(te=oe` <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===(h=this.data)||void 0===h?void 0:h._links["fx:custom_fields"].href),a(null===(p=this.data)||void 0===p?void 0:p._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",re);export{re 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-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-eadf0d23.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-759f65d8.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-063c93be.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-5078246e.js";import"./shared-fc6e64a4.js";import"./shared-83613f15.js";import"./shared-2061be9a.js";import"./shared-f0fa0a88.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 h,p,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(h||(h=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(p||(p=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 $,j,k,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(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="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(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="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,Z,O,R,M,I,q=e=>e;customElements.define("foxy-internal-transaction-actions-control",class extends e{constructor(){super(...arguments),this.folders=null}static get properties(){return t(t({},super.properties),{},{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):"")}__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;return i(E||(E=q` <foxy-internal-post-action-control infer="refund" theme="tertiary-inline" 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:refund"])||void 0===o?void 0:o.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(Z||(Z=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(O||(O=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 G,T,U,V,W,z,D,F,J,N,K,Q=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(G||(G=Q``));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:[],h=null!==(s=null===(r=u._embedded)||void 0===r?void 0:r["fx:shipments"])&&void 0!==s?s:[];return i(T||(T=Q` <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> </p> `),a(this.__storeHref),this.__storeLoaderId,(()=>this.requestUpdate()),this.__renderPrice(u.total_item_price),0===h.length||0===u.total_shipping?i(U||(U=Q` <span><foxy-i18n infer="" key="total_shipping"></foxy-i18n>:</span> <span>${0} </span> `),this.__renderPrice(u.total_shipping,!0)):h.map((e=>i(V||(V=Q` <span>${0}:</span> <span>${0}</span> `),e.shipping_service_description,this.__renderPrice(e.total_shipping,!0)))),0===f.length||0===u.total_tax?i(W||(W=Q` <span><foxy-i18n infer="" key="total_tax"></foxy-i18n>:</span> <span>${0}</span> `),this.__renderPrice(u.total_tax,!0)):f.map((e=>i(z||(z=Q` <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(D||(D=Q` <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(F||(F=Q` <span data-testclass="discount">${0}${0}:</span> <span>${0}</span> `),e,t?i(J||(J=Q` • ${0}`),t):"",this.__renderPrice(o,!0)))),this.__renderStatus(),this.__renderPrice(u.total_order))}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(N||(N=Q` <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(K||(K=Q` <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 X,Y,ee,te,oe=e=>e;const ie=u(f(l,"transaction"));class re extends ie{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 re.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=>{re.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(X||(X=oe`<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,t;const o=null===(t=null===(e=this.__storeLoader)||void 0===e?void 0:e.data)||void 0===t?void 0:t._links["fx:transaction_folders"].href;return i(Y||(Y=oe` <foxy-internal-transaction-actions-control folders="${0}" infer="actions"> </foxy-internal-transaction-actions-control> `),a(o))}renderBody(){var e,t,o,r,s,n,l,d,c,u,f,h,p,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(ee||(ee=oe` ${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(te||(te=oe` <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===(h=this.data)||void 0===h?void 0:h._links["fx:custom_fields"].href),a(null===(p=this.data)||void 0===p?void 0:p._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",re);export{re as Transaction};
|
|
@@ -31,7 +31,7 @@ import"./shared-b0453b08.js";import"./shared-18e301f2.js";import"./foxy-spinner.
|
|
|
31
31
|
<span class="text-m text-secondary font-tnum" data-testclass="ids">
|
|
32
32
|
<span class="text-tertiary">ID</span> ${0}
|
|
33
33
|
</span>
|
|
34
|
-
`),t.data.
|
|
34
|
+
`),t.data.display_id)},m.dateColumn={hideBelow:"sm",cell:t=>t.html(r||(r=l`
|
|
35
35
|
<foxy-i18n
|
|
36
36
|
data-testclass="i18n dates"
|
|
37
37
|
class="text-m text-secondary font-tnum"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-063c93be.js";import{I as e}from"./shared-eadf0d23.js";import"./foxy-template-set-card.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import{a as t}from"./shared-9a454e09.js";import"./foxy-payment-card-embed.js";import"./shared-26b55da2.js";import"./shared-be071e3d.js";import{_ as r,B as s}from"./shared-8f9014ff.js";import{i as o}from"./shared-53e42a77.js";import{h as a}from"./shared-ba5c42c7.js";import{g as i}from"./shared-bab2ea2c.js";import{a as d}from"./shared-328aa161.js";import"./shared-1fa1abbd.js";import"./shared-b0db52f7.js";import"./shared-021fbb51.js";import"./shared-8dd6e5cc.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"./shared-591ee1bf.js";import"./foxy-collection-page.js";import"./shared-41c9c53f.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-5fd5805c.js";import"./shared-53e476fd.js";import"./shared-18e301f2.js";import"./shared-b0453b08.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-1301af85.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-490dadf8.js";import"./shared-de4ec7bb.js";import"./shared-334b7e24.js";import"./shared-7f7d6ceb.js";import"./shared-11de7969.js";let n,m=e=>e;customElements.define("foxy-internal-update-payment-method-form-cc-token-control",class extends t{constructor(){super(...arguments),this.embedUrl=null}static get properties(){return r(r({},super.properties),{},{embedUrl:{attribute:"embed-url"}})}renderControl(){return a(n||(n=m` <foxy-payment-card-embed infer="payment-card-embed" url="${0}" @submit="${0}"> </foxy-payment-card-embed> <vaadin-button theme="primary" class="w-full mt-l" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="tokenize"></foxy-i18n> </vaadin-button> `),o(this.embedUrl),this.__tokenize,this.disabled,(()=>this.__tokenize()))}async __tokenize(){var e,t,r;const s=this.renderRoot.querySelector("[infer=payment-card-embed]");try{null===(e=this.nucleon)||void 0===e||e.edit({cc_token:await s.tokenize()}),null===(t=this.nucleon)||void 0===t||t.submit()}catch(e){null===(r=this.nucleon)||void 0===r||r.undo()}}});let p,l,h=e=>e;const c=d(e,"update-payment-method-form");class f extends c{constructor(){super(...arguments),this.embedUrl=null,this.__templateSetGetValue=()=>this.__templateSetOverride,this.__templateSetSetValue=e=>this.__templateSetOverride=e,this.__templateSetOverride=null}static get properties(){return r(r({},super.properties),{},{__templateSetOverride:{attribute:!1},embedUrl:{attribute:"embed-url"}})}get hiddenSelector(){var e;const t=null===(e=this.__formEmbedUrl)||void 0===e?void 0:e.searchParams,r=["header:copy-id","header:copy-json",super.hiddenSelector.toString()],o=null==t?void 0:t.has("demo");return(this.__isPreConfigured||o)&&r.unshift("template-set"),(null==t?void 0:t.has("template_set_id"))||o||r.unshift("cc-token"),new s(r.join(" ").trim())}renderBody(){var e;if(!this.href)return a(p||(p=h` <div class="flex items-center justify-center p-xl"> <foxy-spinner layout="vertical" infer="spinner" state="empty"></foxy-spinner> </div> `));const t=this.__formEmbedUrl,r=this.renderRoot.querySelector("#store-loader");return a(l||(l=h` ${0} <foxy-internal-resource-picker-control first="${0}" infer="template-set" item="foxy-template-set-card" .getValue="${0}" .setValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-update-payment-method-form-cc-token-control embed-url="${0}" infer="cc-token"> </foxy-internal-update-payment-method-form-cc-token-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="store-loader" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),o(null===(e=null==r?void 0:r.data)||void 0===e?void 0:e._links["fx:template_sets"].href),this.__templateSetGetValue,this.__templateSetSetValue,o(null==t?void 0:t.toString()),o(this.__storeLoaderHref),(()=>this.requestUpdate()))}updated(e){super.updated(e),(e.has("embedUrl")||e.has("href"))&&(this.__templateSetOverride=null)}async _fetch(...e){try{const t=await super._fetch(...e);return"PATCH"===new f.API.WHATWGRequest(...e).method&&(this.status={key:"cc_token_success"}),t}catch(e){let t;try{t=(await e.json())._embedded["fx:errors"][0].message}catch(t){throw e}throw t.includes("cc_token you provided is invalid")?["error:cc_token_invalid"]:e}}get __storeLoaderHref(){const e=this.data;return e&&"fx:store"in e._links?e._links["fx:store"].href:void 0}get __isPreConfigured(){var e;try{return new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"").searchParams.has("template_set_id")}catch(e){return!1}}get __formEmbedUrl(){var e;try{const t=new URL(null!==(e=this.embedUrl)&&void 0!==e?e:"");if(this.__templateSetOverride){const e=i(this.__templateSetOverride);null!==e&&t.searchParams.set("template_set_id",String(e))}return t}catch(e){}}}customElements.define("foxy-update-payment-method-form",f);export{f as UpdatePaymentMethodForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-1fa1abbd.js";import"./shared-759f65d8.js";import"./shared-591ee1bf.js";import"./shared-1301af85.js";import"./shared-bc8a1435.js";import"./shared-a9a8eb7c.js";import{I as e}from"./shared-eadf0d23.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"./shared-1da8110b.js";import"./shared-6880e1f6.js";import"./shared-d0aed1c1.js";import"./foxy-copy-to-clipboard.js";import"./shared-04277241.js";import"./shared-de4ec7bb.js";let n,d=e=>e;class l 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"}]}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 l=this.resourceUri?o(this.resourceUri):null;let m,c;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!==l&&t.searchParams.set("resource_id",String(l)),t.searchParams.set("order","date_created desc"),m=t.toString()}catch(e){m=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!==l&&e.searchParams.set("resource_id",String(l)),e.searchParams.set("order","date_created desc"),c=e.toString()}catch(e){c=void 0}return i(n||(n=d` ${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(m),this.getStatusPageHref,this.resourceUri?{layout:"resource"}:{},a(c),this.getLogPageHref,this.resourceUri?{layout:"resource"}:{},super.renderBody())}}customElements.define("foxy-webhook-form",l);export{l as WebhookForm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./shared-be071e3d.js";import"./shared-1fa1abbd.js";import{I as e}from"./shared-9a454e09.js";import{I as t}from"./shared-eadf0d23.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-form-dialog.js";import"./shared-26b55da2.js";import{_ as s,m as i,F as r}from"./shared-8f9014ff.js";import{h as o,s as l}from"./shared-ba5c42c7.js";import{s as a}from"./shared-53e476fd.js";import{g as n}from"./shared-bab2ea2c.js";import{i as d}from"./shared-53e42a77.js";import{c as h}from"./shared-4e709717.js";import{u}from"./shared-fd8b44e3.js";let c,f=e=>e;let p,y,m,v,x,b,_,g,$=e=>e;customElements.define("foxy-internal-resource-picker-control-form",class extends t{constructor(){super(...arguments),this.selectionProps={}}static get properties(){return s(s({},super.properties),{},{selectionProps:{attribute:!1}})}renderBody(){return o(c||(c=f` <foxy-internal-async-list-control infer="selection" form="foxy-null" hide-delete-button hide-create-button @itemclick="${0}" ...="${0}"> </foxy-internal-async-list-control> `),(e=>{e.preventDefault(),this.edit({selection:e.detail}),this.submit()}),a(this.selectionProps))}}),customElements.define("foxy-internal-resource-picker-control",class extends e{constructor(){super(...arguments),this.getDisplayValueOptions=e=>({resource:e}),this.showCopyIdButton=!1,this.virtualHost=u("internal-resource-picker-control-"),this.getItemUrl=null,this.formProps={},this.filters=[],this.extendFilter=null,this.layout=null,this.first=null,this.item=null,this.form=null,this.__isErrorVisible=!1,this.__getItemRenderer=i((e=>new Function("ctx",`return ctx.html\`\n <${null!=e?e:"foxy-null"}\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n infer="card"\n href=\${ctx.href}\n ...=\${ctx.spread(ctx.props)}\n >\n </${null!=e?e:"foxy-null"}>\``)))}static get properties(){return s(s({},super.properties),{},{getDisplayValueOptions:{attribute:!1},showCopyIdButton:{type:Boolean,attribute:"show-copy-id-button"},virtualHost:{},getItemUrl:{attribute:!1},formProps:{type:Object},filters:{type:Array},extendFilter:{type:Function,attribute:!1},layout:{},first:{},item:{},form:{},__isErrorVisible:{attribute:!1}})}renderControl(){var e;const t=s(s({},this.formProps),{},{".selectionProps":{".extendFilter":this.extendFilter,".filters":this.filters,".first":this.first,".item":this.item}});return o(p||(p=$` <foxy-form-dialog parent="foxy://${0}/select" header="header" infer="dialog" alert .props="${0}" .form="${0}" @fetch="${0}" @hide="${0}"> </foxy-form-dialog> ${0} `),this.virtualHost,t,null!==(e=this.form)&&void 0!==e?e:"foxy-internal-resource-picker-control-form",this.__handleFetchEvent,(()=>this.__isErrorVisible=!0),"summary-item"===this.layout?this.__renderSummaryItemLayout():this.__renderStandaloneLayout())}reportValidity(){this.__isErrorVisible=!0,super.reportValidity()}updated(e){var t,s;super.updated(e),e.has("item")&&(null===(s=(t=this.__getItemRenderer.cache).clear)||void 0===s||s.call(t))}__clear(){this._value="",this.dispatchEvent(new CustomEvent("clear"))}__renderSummaryItemLayout(){const e=this.renderRoot.querySelector("#value");return o(y||(y=$` <div class="leading-xs"> <div class="flex items-center gap-xs"> <div class="text-m text-body whitespace-nowrap flex-1">${0}</div> <button aria-label="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <div class="truncate min-w-0"> ${0} </div> </button> <button aria-label="${0}" class="${0}" style="width:1em;height:1em" ?disabled="${0}" ?hidden="${0}" @click="${0}"> ${0} </button> </div> <div style="max-width:32rem"> <div class="text-xs text-secondary">${0}</div> <div class="text-xs text-error" ?hidden="${0}"> ${0} </div> </div> </div> <foxy-nucleon infer="" href="${0}" id="value" @update="${0}"> </foxy-nucleon> `),this.label,this.t("select"),h({"text-right min-w-0 transition-colors transition-opacity":!0,"rounded-s focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"text-secondary":this.readonly,"text-disabled":this.disabled,"cursor-pointer text-body hover-opacity-80":!this.disabled&&!this.readonly,"font-medium":!this.readonly}),this.disabled||this.readonly,(e=>{if(this.disabled||this.readonly)return;const t=e.currentTarget,s=this.renderRoot.querySelector("foxy-form-dialog");s.href="",s.show(t)}),this._value?o(m||(m=$` <foxy-i18n infer="" key="value" .options="${0}"> </foxy-i18n> `),(null==e?void 0:e.data)?this.getDisplayValueOptions(e.data):{context:(null==e?void 0:e.in("fail"))?"fail":"busy"}):this.placeholder,this.t("clear"),h({"rounded-full transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer text-tertiary hover-text-body":!this.disabled,"cursor-default text-disabled":this.disabled}),this.disabled,this.readonly||!this._value,this.__clear,l(v||(v=$`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" style="width: 1em; height: 1em; transform: scale(1.25); margin-right: -0.16em"><path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" /></svg>`)),this.helperText,this.disabled||this.readonly||!this.__isErrorVisible,this._errorMessage,d(this._value||void 0),(()=>this.requestUpdate()))}__renderStandaloneLayout(){var e,t,s,i,r;const l=this.__valueLoader,u="string"==typeof this._value?n(this._value):void 0,c="string"==typeof this._value?null===(e=this.getItemUrl)||void 0===e?void 0:e.call(this,this._value,null!==(t=null==l?void 0:l.data)&&void 0!==t?t:null):void 0;return o(x||(x=$` <div class="block group"> <div class="${0}"> <span class="mr-auto text-l">${0}</span> ${0} ${0} ${0} </div> <div class="text-secondary text-s" ?hidden="${0}">${0}</div> <button class="${0}" style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" ?disabled="${0}" @click="${0}"> <div class="${0}"> <foxy-nucleon class="block" infer="" href="${0}" id="valueLoader" @update="${0}"> ${0} </foxy-nucleon> </div> </button> <div class="mt-xs text-xs leading-xs text-error" ?hidden="${0}"> ${0} </div> </div> `),h({"flex items-center gap-s transition-colors font-medium":!0,"text-disabled":this.disabled}),this.label,c?o(b||(b=$` <a class="text-body rounded transition-opacity hover-opacity-90 focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n infer="" key="view"></foxy-i18n> </a> `),c):"",this.showCopyIdButton&&null!==u?o(_||(_=$` <foxy-copy-to-clipboard layout="text" theme="contrast tertiary-inline" infer="copy-id" text="${0}"> </foxy-copy-to-clipboard> `),u):"",this.readonly||!this._value?"":o(g||(g=$` <vaadin-button theme="error tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="clear"></foxy-i18n> </vaadin-button> `),this.disabled,this.__clear),!this.helperText,this.helperText,h({"block w-full bg-contrast-5 rounded text-left transition-colors":!0,"focus-outline-none focus-ring-2 focus-ring-primary-50":!0,"cursor-pointer hover-bg-contrast-10":!this.disabled&&!this.readonly,"cursor-default":this.disabled||this.readonly,"mt-s":!!this.label||!!this.helperText}),this.disabled||this.readonly,(e=>{const t=e.currentTarget,s=this.renderRoot.querySelector("foxy-form-dialog");s.href="",s.show(t)}),h({"transition-opacity":!0,"opacity-50":this.disabled}),d(this._value||void 0),(()=>this.requestUpdate()),this.__getItemRenderer(this.item)({html:o,data:null!==(s=null==l?void 0:l.data)&&void 0!==s?s:null,href:this._value||"",related:[],parent:"",props:{},spread:a,simplifyNsLoading:this.simplifyNsLoading,disabled:this.disabled,disabledControls:this.disabledControls,readonly:this.readonly,readonlyControls:this.readonlyControls,hidden:this.hidden,hiddenControls:this.hiddenControls,templates:this.templates,previous:null,next:null,group:null!==(r=null===(i=this.nucleon)||void 0===i?void 0:i.group)&&void 0!==r?r:"",lang:this.lang,ns:this.ns}),!this._errorMessage||this.disabled||this.readonly,this._errorMessage)}__handleFetchEvent(e){if(!(e instanceof r))return;if(e.defaultPrevented)return;const{url:t,method:s}=e.request;return t===`foxy://${this.virtualHost}/select`&&"POST"===s?e.respondWith(this.__handleSelect(e.request)):t===`foxy://${this.virtualHost}/empty`&&"GET"===s?e.respondWith(this.__handleEmpty()):void 0}async __handleSelect(e){const t=await e.clone().json();return this._value=t.selection,new Response(JSON.stringify({_links:{self:{href:`foxy://${this.virtualHost}/empty`}},message:"Resource selected."}))}async __handleEmpty(){return new Response(JSON.stringify({_links:{self:{href:`foxy://${this.virtualHost}/empty`}},message:"Resource selected."}))}get __valueLoader(){return this.renderRoot.querySelector("#valueLoader")}});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-b0db52f7.js";import{h as t,P as e}from"./shared-021fbb51.js";import{F as i,t as o}from"./shared-8dd6e5cc.js";import{T as n,a,E as s}from"./shared-9a291941.js";import"./shared-0ea24ca2.js";import{O as r}from"./shared-ad470adf.js";import"./shared-be071e3d.js";import"./shared-591ee1bf.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-26b55da2.js";import{I as l}from"./shared-9a454e09.js";import"./shared-4cc1fb20.js";import{x as d}from"./shared-328aa161.js";import{c,h,r as
|
|
1
|
+
import"./shared-b0db52f7.js";import{h as t,P as e}from"./shared-021fbb51.js";import{F as i,t as o}from"./shared-8dd6e5cc.js";import{T as n,a,E as s}from"./shared-9a291941.js";import"./shared-0ea24ca2.js";import{O as r}from"./shared-ad470adf.js";import"./shared-be071e3d.js";import"./shared-591ee1bf.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./foxy-pagination.js";import"./shared-26b55da2.js";import{I as l}from"./shared-9a454e09.js";import"./shared-4cc1fb20.js";import{x as d}from"./shared-328aa161.js";import{c,h,r as u}from"./shared-ba5c42c7.js";import{_ as m}from"./shared-8f9014ff.js";import{i as p}from"./shared-53e42a77.js";import{c as _}from"./shared-4e709717.js";const f=t`<dom-module id="lumo-notification-card" theme-for="vaadin-notification-card">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -277,4 +277,4 @@ class v extends(n(s(e))){static get template(){return t`
|
|
|
277
277
|
</style>
|
|
278
278
|
<vaadin-notification-card id="vaadin-notification-card" theme\$="[[theme]]">
|
|
279
279
|
</vaadin-notification-card>
|
|
280
|
-
`}static get is(){return"vaadin-notification"}static get version(){return"1.6.2"}static get properties(){return{duration:{type:Number,value:5e3},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},position:{type:String,value:"bottom-start",observer:"_positionChanged"},renderer:Function,_notificationTemplate:Object}}static get observers(){return["_durationChanged(duration, opened)","_templateOrRendererChanged(_notificationTemplate, renderer, opened)"]}ready(){super.ready(),this._observer=new i(this,(t=>{this._setTemplateFromNodes(t.addedNodes)}))}_setTemplateFromNodes(t){this._notificationTemplate=t.filter((t=>t.localName&&"template"===t.localName))[0]||this._notificationTemplate}render(){"function"==typeof this.renderer&&this.renderer(this._card,this)}_removeNewRendererOrTemplate(t,e,i,o){t!==e?this._notificationTemplate=void 0:i!==o&&(this.renderer=void 0)}_templateOrRendererChanged(t,e,i){if(t&&e)throw this._removeNewRendererOrTemplate(t,this._oldTemplate,e,this._oldRenderer),new Error("You should only use either a renderer or a template for notification content");this._oldTemplate=t;const o=this._oldRenderer!==e;if(this._oldRenderer=e,e){if(this._card=this.$["vaadin-notification-card"],o)for(;this._card.firstChild;)this._card.removeChild(this._card.firstChild);i&&(this._didAnimateNotificationAppend||this._animatedAppendNotificationCard(),this.render())}}open(){this.opened=!0}close(){this.opened=!1}get _container(){return g._container||(g._container=document.createElement("vaadin-notification-container"),document.body.appendChild(g._container)),g._container}_openedChanged(t){t?(this._container.opened=!0,this._instance||this.renderer||this._ensureTemplatized(),this._animatedAppendNotificationCard(),setTimeout((()=>this._updateShadyButtonStyles()))):this._card&&this._closeNotificationCard()}_ensureTemplatized(){if(this._notificationTemplate=this.querySelector("template")||this._notificationTemplate,!this._notificationTemplate)return;this._notificationTemplate._Templatizer||(this._notificationTemplate._Templatizer=o(this._notificationTemplate,this,{forwardHostProp:function(t,e){this._instance&&this._instance.forwardHostProp(t,e)}})),this._instance=new this._notificationTemplate._Templatizer({});const t=this._notificationTemplate.getRootNode(),e=t!==document;if(this._card=this.$["vaadin-notification-card"],this._cardContent=this._card.shadowRoot.querySelector('[part~="content"]'),e){if(this._cardContent.shadowRoot||this._cardContent.attachShadow({mode:"open"}),window.ShadyCSS&&!window.ShadyCSS.nativeShadow){var i=t.host&&t.host.localName;i&&-1===i.indexOf("-")&&(i=t.host.getAttribute("is")),i&&this._cardContent.setAttribute("is",i)}else{const e=Array.from(t.querySelectorAll("style")).reduce(((t,e)=>t+e.textContent),"").replace(/:host/g,":host-nomatch");if(e){const t=document.createElement("style");t.textContent=e,this._cardContent.shadowRoot.appendChild(t)}}this._cardContent.shadowRoot.appendChild(this._instance.root)}else this._card.appendChild(this._instance.root);this._card.setAttribute("aria-label",this._card.textContent.trim())}_animatedAppendNotificationCard(){if(this._card){this._card.setAttribute("opening",""),this._appendNotificationCard();const t=()=>{this._card.removeEventListener("animationend",t),this._card.removeAttribute("opening")};this._card.addEventListener("animationend",t),this._didAnimateNotificationAppend=!0}else this._didAnimateNotificationAppend=!1}_appendNotificationCard(){this._card&&(this._container.shadowRoot.querySelector(`slot[name="${this.position}"]`)?(this._card.slot=this.position,this._container.firstElementChild&&/top/.test(this.position)?this._container.insertBefore(this._card,this._container.firstElementChild):this._container.appendChild(this._card)):window.console.warn(`Invalid alignment parameter provided: position=${this.position}`))}_removeNotificationCard(){this._card.parentNode&&this._card.parentNode.removeChild(this._card),this._card.removeAttribute("closing"),this._container.opened=Boolean(this._container.firstElementChild)}_closeNotificationCard(){this._durationTimeoutId&&clearTimeout(this._durationTimeoutId),this._animatedRemoveNotificationCard()}_animatedRemoveNotificationCard(){this._card.setAttribute("closing","");const t=getComputedStyle(this._card).getPropertyValue("animation-name");if(t&&"none"!=t){const t=()=>{this._removeNotificationCard(),this._card.removeEventListener("animationend",t)};this._card.addEventListener("animationend",t)}else this._removeNotificationCard()}_positionChanged(t){this.opened&&this._animatedAppendNotificationCard()}_durationChanged(t,e){e&&(clearTimeout(this._durationTimeoutId),t>0&&(this._durationTimeoutId=setTimeout((()=>this.close()),t)))}_updateShadyButtonStyles(){window.ShadyCSS&&!this.__buttonStylesPending&&(customElements.whenDefined("vaadin-button").then((()=>{Array.from(this._card.querySelectorAll("*")).filter((t=>t instanceof customElements.get("vaadin-button"))).forEach((t=>{const e=["--_lumo-button-color","--_lumo-button-background-color","--_lumo-button-primary-color","--_lumo-button-primary-background-color"].reduce(((t,e)=>{const i=window.ShadyCSS.getComputedStyleValue(this._card,e);return i&&(t[e]=i),t}),{});t.updateStyles(e)})),this.__buttonStylesPending=!1})),this.__buttonStylesPending=!0)}}customElements.define(v.is,v),customElements.define(y.is,y),customElements.define(g.is,g);let b;d("vaadin-checkbox",c(b||(b=(t=>t)`:host([data-async-list-control]) label{display:flex}:host([data-async-list-control]) [part=label]{width:100%;margin:0!important}`)));let x,$=t=>t;const C=t=>class e extends t{static get properties(){return{positionTarget:{type:Object,value:null},horizontalAlign:{type:String,value:"start"},verticalAlign:{type:String,value:"top"},noHorizontalOverlap:{type:Boolean,value:!1},noVerticalOverlap:{type:Boolean,value:!1}}}static get observers(){return["__positionSettingsChanged(positionTarget, horizontalAlign, verticalAlign,\n noHorizontalOverlap, noVerticalOverlap)"]}constructor(){super();const t=this._updatePosition.bind(this);this.addEventListener("opened-changed",(e=>{const i=e.detail.value?"addEventListener":"removeEventListener";window[i]("scroll",t),window[i]("resize",t),e.detail.value&&this._updatePosition()}))}ready(){super.ready(),console.warn("PositionMixin is not considered stable and might change any time")}__positionSettingsChanged(){this._updatePosition()}_updatePosition(){if(!this.positionTarget)return;const t=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach((e=>{this.__margins[e]=parseInt(t[e],10)})));const e="rtl"===t.direction,i=this.positionTarget.getBoundingClientRect(),o=this.__calculateHorizontalPosition(i,e),n=this.__calculateVerticalPosition(i),a=Object.assign({},o,n);this.__doSetPosition(a,e)}__calculateHorizontalPosition(t,i){const o=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const n=Math.min(window.innerWidth,document.documentElement.clientWidth),a=!i&&"start"===this.horizontalAlign||i&&"end"===this.horizontalAlign,s=!!this.style.left;return e.__calculatePositionInOneDimension(t,o,n,this.__margins,a,s,this.noHorizontalOverlap,{start:"left",end:"right"})}__calculateVerticalPosition(t){const i=Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const o=Math.min(window.innerHeight,document.documentElement.clientHeight),n="top"===this.verticalAlign,a=!!this.style.top;return e.__calculatePositionInOneDimension(t,i,o,this.__margins,n,a,this.noVerticalOverlap,{start:"top",end:"bottom"})}static __calculatePositionInOneDimension(t,e,i,o,n,a,s,r){const l=i-t[s?r.end:r.start]-o[r.end],d=t[s?r.start:r.end]-o[r.start],c=n?l:d,h=n===(c>(n?d:l)||c>e),m=h?r.start:r.end,u=h?r.end:r.start,p=(h?t[s?r.end:r.start]:i-t[s?r.start:r.end])+"px",_={};return _[m]=p,_[u]="",_}__doSetPosition(t,e){Object.assign(this.style,t);const i=!e&&t.left||e&&t.right;this.style.alignItems=i?"flex-start":"flex-end",this.style.justifyContent=t.top?"flex-start":"flex-end"}};class w extends(C(r)){constructor(){super(...arguments),this.renderer=(t,e,i)=>{var o;const n=null!==(o=t.firstElementChild)&&void 0!==o?o:document.createElement("div");t.firstElementChild||t.appendChild(n);const a=i,s=h(x||(x=$` <div style="display:grid;gap:var(--lumo-space-m);padding:var(--lumo-space-s);min-width:22rem;max-width:35rem"> <foxy-query-builder lang="${0}" ns="${0}" .options="${0}" .value="${0}"> </foxy-query-builder> <div style="display:flex;justify-content:space-between"> <vaadin-button theme="primary" style="margin:0" @click="${0}"> <foxy-i18n lang="${0}" ns="${0}" key="search"></foxy-i18n> </vaadin-button> <vaadin-button theme="secondary contrast" style="margin:0" @click="${0}"> <foxy-i18n lang="${0}" ns="${0}" key="clear"></foxy-i18n> </vaadin-button> </div> </div> `),a.lang,`${a.ns} query-builder`.trim(),a.options,a.value,(()=>{var t;const e=null!==(t=n.querySelector("foxy-query-builder").value)&&void 0!==t?t:"";this.dispatchEvent(new CustomEvent("search",{detail:e}))}),a.lang,a.ns,(()=>this.dispatchEvent(new CustomEvent("search"))),a.lang,a.ns);m(s,n)}}static get is(){return"foxy-internal-async-list-control-filter-overlay"}}let k,S,E,T,P,A,O,R,j,B,N,z,I,H,D,L,V,q,F,W,M,Y,U,J,G=t=>t;customElements.define("foxy-internal-async-list-control",class extends l{constructor(){super(...arguments),this.keepDialogOpenOnDelete=!1,this.keepDialogOpenOnPost=!1,this.createPageHref=null,this.bulkActions=[],this.related=[],this.layout=null,this.actions=[],this.filters=[],this.limit=20,this.first=null,this.form=null,this.formProps={},this.item=null,this.itemProps={},this.wide=!1,this.hideWhenEmpty=!1,this.open=!1,this.alert=!1,this.hideDeleteButton=!1,this.hideCreateButton=!1,this.getPageHref=null,this.filter=null,this.__deletionConfimationCallback=null,this.__cachedCardRenderer=null,this.__activeBulkAction=null,this.__isFilterVisible=!1,this.__notification=null,this.__isSelecting=!1,this.__totalItems=0,this.__selection=[],this.__itemRenderer=t=>{var e;const i=this.__cardRenderer(t),o=h(k||(k=G`<div class="bg-contrast-5">${0}</div>`),i);if(!t.data)return o;if(this.__isSelecting)return h(S||(S=G` <vaadin-checkbox class="${0}" style="padding-left:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" data-async-list-control ?disabled="${0}" ?checked="${0}" @change="${0}"> ${0} </vaadin-checkbox> `),_({"block w-full":!0,"bg-contrast-5":"details"===this.layout}),this.disabled||!!this.__activeBulkAction,this.__selection.find((e=>e._links.self.href===t.data._links.self.href)),(e=>{e.currentTarget.checked?this.__selection=[...this.__selection,t.data]:this.__selection=this.__selection.filter((e=>e._links.self.href!==t.data._links.self.href))}),this.__cardRenderer(t));if("string"!=typeof(null===(e=this.getPageHref)||void 0===e?void 0:e.call(this,t.href,t.data))&&!this.form)return o;const n=this.disabledSelector.matches("card",!0),a=this.__cardRenderer(t);let s;const r=_({"rounded-t":"details"!==this.layout&&!t.previous,"rounded-b":!t.next,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-left w-full block bg-contrast-5 transition-colors":!0,"hover-bg-contrast-10":!n});if(this.getPageHref)if(n)s=h(E||(E=G`<div class="${0}">${0}</div>`),r,a);else{const e=this.getPageHref(t.href,t.data);s=h(T||(T=G`<a class="${0}" href="${0}">${0}</a>`),r,e,a)}else{s=h(P||(P=G` <button ?disabled="${0}" class="${0}" @click="${0}">${0}</button> `),n,r,(e=>{const i=new CustomEvent("itemclick",{cancelable:!0,composed:!0,bubbles:!0,detail:t.href});if(this.dispatchEvent(i)){const i=e.currentTarget,o=this.__dialog;o.header="header_update",o.href=t.href,o.show(i)}}),a)}return this.hideDeleteButton&&!this.actions.length||this.readonly?s:h(A||(A=G` <foxy-swipe-actions class="block"> ${0} ${0} ${0} </foxy-swipe-actions> `),s,this.actions.map((e=>h(O||(O=G` <vaadin-button data-testclass="action" theme="${0}" class="h-full rounded-none relative" slot="action" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" infer="" key="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" infer="spinner" state="${0}"> </foxy-spinner> </div> </vaadin-button> `),e.theme,this.disabled,(()=>e.onClick(t.data)),_({"transition-opacity":!0,"opacity-0":"idle"!==e.state}),e.text,_({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===e.state}),e.state))),this.hideDeleteButton?"":h(R||(R=G` <vaadin-button theme="primary error" class="h-full rounded-none" slot="action" @click="${0}"> <foxy-i18n infer="" key="delete_button_text"></foxy-i18n> </vaadin-button> `),(t=>{const e=t.currentTarget;this.renderRoot.querySelector("#confirm").show(e),this.__deletionConfimationCallback=()=>{const t=e.parentElement.firstElementChild.querySelector("[href]");null==t||t.delete(),this.__deletionConfimationCallback=null}})))}}static get properties(){return u(u({},super.properties),{},{keepDialogOpenOnDelete:{type:Boolean,attribute:"keep-dialog-open-on-delete"},keepDialogOpenOnPost:{type:Boolean,attribute:"keep-dialog-open-on-post"},hideDeleteButton:{type:Boolean,attribute:"hide-delete-button"},hideCreateButton:{type:Boolean,attribute:"hide-create-button"},createPageHref:{attribute:"create-page-href"},getPageHref:{attribute:!1},related:{type:Array},layout:{},first:{},limit:{type:Number},form:{},formProps:{type:Object,attribute:"form-props"},item:{},itemProps:{type:Object,attribute:"item-props"},wide:{type:Boolean},open:{type:Boolean},hideWhenEmpty:{type:Boolean,attribute:"hide-when-empty"},alert:{type:Boolean},actions:{attribute:!1},bulkActions:{attribute:!1},filters:{type:Array},filter:{},__selection:{attribute:!1},__totalItems:{attribute:!1},__isSelecting:{attribute:!1},__notification:{attribute:!1},__isFilterVisible:{attribute:!1},__activeBulkAction:{attribute:!1}})}render(){const t=this.hideWhenEmpty&&!this.__totalItems;return h(j||(j=G`<div class="${0}">${0}</div>`),_({hidden:t}),super.render())}renderControl(){var t,e;const i=this.__renderActions(),o=this.__renderContent();return h(B||(B=G` ${0} ${0} ${0} <div class="mt-s text-s leading-xs text-error" ?hidden="${0}"> ${0} </div> <vaadin-notification position="bottom-end" duration="3000" theme="${0}" .renderer="${0}"> </vaadin-notification> `),this.form&&!this.__isSelecting?h(N||(N=G` <foxy-form-dialog parent="${0}" infer="dialog" id="form" ?wide="${0}" ?alert="${0}" ?keep-open-on-post="${0}" ?keep-open-on-delete="${0}" .related="${0}" .props="${0}" .form="${0}"> </foxy-form-dialog> `),p(null!==(t=this.first)&&void 0!==t?t:void 0),this.wide,this.alert,this.keepDialogOpenOnPost,this.keepDialogOpenOnDelete,this.related,this.formProps,this.form):"",this.hideDeleteButton||this.readonly||this.__isSelecting?"":h(z||(z=G` <foxy-internal-confirm-dialog message="delete_message" confirm="delete_confirm" cancel="delete_cancel" header="delete_header" theme="error" infer="" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> `),(t=>{var e;t.detail.cancelled||null===(e=this.__deletionConfimationCallback)||void 0===e||e.call(this)})),"details"===this.layout?h(I||(I=G` <foxy-internal-summary-control layout="details" count="${0}" infer="" ?open="${0}" @toggle="${0}"> ${0} <div class="p-0 bg-transparent">${0}</div> </foxy-internal-summary-control> `),p(this.open?void 0:`${this.__totalItems}`),this.open,(t=>{const e=t.currentTarget;this.open=e.open,t.composed||t.bubbles||this.dispatchEvent(new CustomEvent("toggle"))}),i.length?h(H||(H=G` <div class="flex gap-s"> <foxy-i18n infer="" class="mr-auto text-tertiary" key="total_items" .options="${0}"> </foxy-i18n> ${0} </div> `),{count:this.__totalItems},i):"",o):h(D||(D=G` <div class="flex gap-s items-center justify-between font-medium"> <span class="text-body mr-auto text-l"> ${0} </span> ${0} </div> <div class="text-secondary text-s" ?hidden="${0}"> ${0} </div> ${0} `),this.label&&"label"!==this.label?this.label:"",i,!this.helperText||"helper_text"===this.helperText,this.helperText,o),!this._errorMessage||this.disabled||this.readonly||this.__isSelecting,this._errorMessage,p(null===(e=this.__notification)||void 0===e?void 0:e.theme),(t=>{var e,i;t.firstElementChild||(t.innerHTML="<span></span>");const o=null===(e=this.__notification)||void 0===e?void 0:e.theme,n=h(L||(L=G` <foxy-i18n style="color:var(--lumo-${0}-color)" lang="${0}" key="${0}" ns="${0} pagination"> </foxy-i18n> `),o?`${o}-contrast`:"body-text",this.lang,null===(i=this.__notification)||void 0===i?void 0:i.key,this.ns);m(n,t.firstElementChild)}))}get __cardRenderer(){var t;const e=this.item;return(null===(t=this.__cachedCardRenderer)||void 0===t?void 0:t.item)!==e&&(this.__cachedCardRenderer={item:e,render:"string"==typeof e?new Function("ctx",`return ctx.html\`\n <${e}\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"\n infer=""\n href=\${ctx.href}\n ...=\${ctx.spread(ctx.props)}\n >\n </${e}>\``):t=>h(V||(V=G` <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> `),null==e?void 0:e(t))}),this.__cachedCardRenderer.render}get __dialog(){return this.renderRoot.querySelector("#form")}__renderActions(){var t,e=this;return[this.filters.length>0&&!this.__isSelecting?h(q||(q=G` <foxy-internal-async-list-control-filter-overlay .noVerticalOverlap="${0}" .positionTarget="${0}" .model="${0}" ?opened="${0}" @vaadin-overlay-close="${0}" @search="${0}"> </foxy-internal-async-list-control-filter-overlay> <vaadin-button theme="tertiary-inline contrast" id="filters" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="search_button_text"></foxy-i18n> ${0} </vaadin-button> `),!0,this.renderRoot.querySelector("#filters"),{options:this.filters,value:null!==(t=this.filter)&&void 0!==t?t:"",lang:this.lang,ns:this.ns},this.__isFilterVisible,(()=>this.__isFilterVisible=!1),(t=>{var e;this.filter=null!==(e=t.detail)&&void 0!==e?e:""}),this.disabled,(()=>this.__isFilterVisible=!this.__isFilterVisible),this.filter?h(F||(F=G`<span>(${0})</span>`),this.filter.split("&").length):""):"",this.bulkActions.length>0&&this.first?h(W||(W=G` ${0} <vaadin-button theme="tertiary-inline contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="${0}"> </foxy-i18n> </vaadin-button> `),this.__selection.length>0?this.bulkActions.map((t=>{var i;const o=`${t.name}_bulk_action_notification`,n=`${t.name}_bulk_action_caption`,a=(null===(i=this.__activeBulkAction)||void 0===i?void 0:i.name)===t.name;return h(M||(M=G` <vaadin-button data-testclass="bulk-action" theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="${0}_${0}" .options="${0}"> </foxy-i18n> </vaadin-button> `),this.disabled||!!this.__activeBulkAction,(async function(){var i;e.__activeBulkAction=t;try{await t.onClick(e.__selection),e.__selection=[],e.__isSelecting=!1,e.__notification={key:`${o}_done`,theme:"success"}}catch(t){e.__notification={key:`${o}_fail`,theme:"error"}}finally{e.__activeBulkAction=null,null===(i=e.renderRoot.querySelector("vaadin-notification"))||void 0===i||i.open()}}),n,a?"busy":"idle",{count:this.__selection.length})})):"",this.disabled||!!this.__activeBulkAction,(()=>{this.__isSelecting=!this.__isSelecting,this.__selection=[]}),this.__isSelecting?"cancel_button_text":"select_button_text"):"",!this.form&&!this.createPageHref||this.readonly||this.hideCreateButton||this.__isSelecting?"":this.createPageHref&&!this.disabled?h(Y||(Y=G` <a class="rounded-s text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="create_button_text"> </foxy-i18n> </a> `),this.createPageHref):h(U||(U=G` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="create_button_text"></foxy-i18n> </vaadin-button> `),this.disabled,(t=>{t.preventDefault(),t.stopPropagation();const e=this.__dialog,i=t.currentTarget;e.header="header_create",e.href="",e.show(i)}))].filter((t=>!!t))}__renderContent(){var t,e;const i=this.helperText,o="details"===this.layout,n=this.label;let a;try{const i=new URL(null!==(t=this.first)&&void 0!==t?t:""),o=new URLSearchParams(null!==(e=this.filter)&&void 0!==e?e:"");i.searchParams.set("limit",String(this.limit)),o.forEach(((t,e)=>i.searchParams.set(e,t))),a=i.toString()}catch(t){a=void 0}return h(J||(J=G` <foxy-pagination first="${0}" infer="pagination" class="${0}"> <foxy-collection-page class="${0}" style="gap:1px" infer="card" .related="${0}" .props="${0}" .item="${0}" @update="${0}"> </foxy-collection-page> </foxy-pagination> `),p(a),_({hidden:o&&0===this.__totalItems}),_({"grid grid-cols-1 overflow-hidden":!0,rounded:!o,"mt-s":!o&&(!!n&&"label"!==n||!!i&&"helper_text"!==i)}),this.related,this.itemProps,this.__itemRenderer,(t=>{var e,i;const o=t.currentTarget;this.__totalItems=parseInt(null!==(i=null===(e=o.data)||void 0===e?void 0:e.total_items)&&void 0!==i?i:0)}))}}),customElements.define(w.is,w);
|
|
280
|
+
`}static get is(){return"vaadin-notification"}static get version(){return"1.6.2"}static get properties(){return{duration:{type:Number,value:5e3},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},position:{type:String,value:"bottom-start",observer:"_positionChanged"},renderer:Function,_notificationTemplate:Object}}static get observers(){return["_durationChanged(duration, opened)","_templateOrRendererChanged(_notificationTemplate, renderer, opened)"]}ready(){super.ready(),this._observer=new i(this,(t=>{this._setTemplateFromNodes(t.addedNodes)}))}_setTemplateFromNodes(t){this._notificationTemplate=t.filter((t=>t.localName&&"template"===t.localName))[0]||this._notificationTemplate}render(){"function"==typeof this.renderer&&this.renderer(this._card,this)}_removeNewRendererOrTemplate(t,e,i,o){t!==e?this._notificationTemplate=void 0:i!==o&&(this.renderer=void 0)}_templateOrRendererChanged(t,e,i){if(t&&e)throw this._removeNewRendererOrTemplate(t,this._oldTemplate,e,this._oldRenderer),new Error("You should only use either a renderer or a template for notification content");this._oldTemplate=t;const o=this._oldRenderer!==e;if(this._oldRenderer=e,e){if(this._card=this.$["vaadin-notification-card"],o)for(;this._card.firstChild;)this._card.removeChild(this._card.firstChild);i&&(this._didAnimateNotificationAppend||this._animatedAppendNotificationCard(),this.render())}}open(){this.opened=!0}close(){this.opened=!1}get _container(){return g._container||(g._container=document.createElement("vaadin-notification-container"),document.body.appendChild(g._container)),g._container}_openedChanged(t){t?(this._container.opened=!0,this._instance||this.renderer||this._ensureTemplatized(),this._animatedAppendNotificationCard(),setTimeout((()=>this._updateShadyButtonStyles()))):this._card&&this._closeNotificationCard()}_ensureTemplatized(){if(this._notificationTemplate=this.querySelector("template")||this._notificationTemplate,!this._notificationTemplate)return;this._notificationTemplate._Templatizer||(this._notificationTemplate._Templatizer=o(this._notificationTemplate,this,{forwardHostProp:function(t,e){this._instance&&this._instance.forwardHostProp(t,e)}})),this._instance=new this._notificationTemplate._Templatizer({});const t=this._notificationTemplate.getRootNode(),e=t!==document;if(this._card=this.$["vaadin-notification-card"],this._cardContent=this._card.shadowRoot.querySelector('[part~="content"]'),e){if(this._cardContent.shadowRoot||this._cardContent.attachShadow({mode:"open"}),window.ShadyCSS&&!window.ShadyCSS.nativeShadow){var i=t.host&&t.host.localName;i&&-1===i.indexOf("-")&&(i=t.host.getAttribute("is")),i&&this._cardContent.setAttribute("is",i)}else{const e=Array.from(t.querySelectorAll("style")).reduce(((t,e)=>t+e.textContent),"").replace(/:host/g,":host-nomatch");if(e){const t=document.createElement("style");t.textContent=e,this._cardContent.shadowRoot.appendChild(t)}}this._cardContent.shadowRoot.appendChild(this._instance.root)}else this._card.appendChild(this._instance.root);this._card.setAttribute("aria-label",this._card.textContent.trim())}_animatedAppendNotificationCard(){if(this._card){this._card.setAttribute("opening",""),this._appendNotificationCard();const t=()=>{this._card.removeEventListener("animationend",t),this._card.removeAttribute("opening")};this._card.addEventListener("animationend",t),this._didAnimateNotificationAppend=!0}else this._didAnimateNotificationAppend=!1}_appendNotificationCard(){this._card&&(this._container.shadowRoot.querySelector(`slot[name="${this.position}"]`)?(this._card.slot=this.position,this._container.firstElementChild&&/top/.test(this.position)?this._container.insertBefore(this._card,this._container.firstElementChild):this._container.appendChild(this._card)):window.console.warn(`Invalid alignment parameter provided: position=${this.position}`))}_removeNotificationCard(){this._card.parentNode&&this._card.parentNode.removeChild(this._card),this._card.removeAttribute("closing"),this._container.opened=Boolean(this._container.firstElementChild)}_closeNotificationCard(){this._durationTimeoutId&&clearTimeout(this._durationTimeoutId),this._animatedRemoveNotificationCard()}_animatedRemoveNotificationCard(){this._card.setAttribute("closing","");const t=getComputedStyle(this._card).getPropertyValue("animation-name");if(t&&"none"!=t){const t=()=>{this._removeNotificationCard(),this._card.removeEventListener("animationend",t)};this._card.addEventListener("animationend",t)}else this._removeNotificationCard()}_positionChanged(t){this.opened&&this._animatedAppendNotificationCard()}_durationChanged(t,e){e&&(clearTimeout(this._durationTimeoutId),t>0&&(this._durationTimeoutId=setTimeout((()=>this.close()),t)))}_updateShadyButtonStyles(){window.ShadyCSS&&!this.__buttonStylesPending&&(customElements.whenDefined("vaadin-button").then((()=>{Array.from(this._card.querySelectorAll("*")).filter((t=>t instanceof customElements.get("vaadin-button"))).forEach((t=>{const e=["--_lumo-button-color","--_lumo-button-background-color","--_lumo-button-primary-color","--_lumo-button-primary-background-color"].reduce(((t,e)=>{const i=window.ShadyCSS.getComputedStyleValue(this._card,e);return i&&(t[e]=i),t}),{});t.updateStyles(e)})),this.__buttonStylesPending=!1})),this.__buttonStylesPending=!0)}}customElements.define(v.is,v),customElements.define(y.is,y),customElements.define(g.is,g);let b;d("vaadin-checkbox",c(b||(b=(t=>t)`:host([data-async-list-control]) label{display:flex}:host([data-async-list-control]) [part=label]{width:100%;margin:0!important}`)));let x,$=t=>t;const C=t=>class e extends t{static get properties(){return{positionTarget:{type:Object,value:null},horizontalAlign:{type:String,value:"start"},verticalAlign:{type:String,value:"top"},noHorizontalOverlap:{type:Boolean,value:!1},noVerticalOverlap:{type:Boolean,value:!1}}}static get observers(){return["__positionSettingsChanged(positionTarget, horizontalAlign, verticalAlign,\n noHorizontalOverlap, noVerticalOverlap)"]}constructor(){super();const t=this._updatePosition.bind(this);this.addEventListener("opened-changed",(e=>{const i=e.detail.value?"addEventListener":"removeEventListener";window[i]("scroll",t),window[i]("resize",t),e.detail.value&&this._updatePosition()}))}ready(){super.ready(),console.warn("PositionMixin is not considered stable and might change any time")}__positionSettingsChanged(){this._updatePosition()}_updatePosition(){if(!this.positionTarget)return;const t=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach((e=>{this.__margins[e]=parseInt(t[e],10)})));const e="rtl"===t.direction,i=this.positionTarget.getBoundingClientRect(),o=this.__calculateHorizontalPosition(i,e),n=this.__calculateVerticalPosition(i),a=Object.assign({},o,n);this.__doSetPosition(a,e)}__calculateHorizontalPosition(t,i){const o=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const n=Math.min(window.innerWidth,document.documentElement.clientWidth),a=!i&&"start"===this.horizontalAlign||i&&"end"===this.horizontalAlign,s=!!this.style.left;return e.__calculatePositionInOneDimension(t,o,n,this.__margins,a,s,this.noHorizontalOverlap,{start:"left",end:"right"})}__calculateVerticalPosition(t){const i=Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const o=Math.min(window.innerHeight,document.documentElement.clientHeight),n="top"===this.verticalAlign,a=!!this.style.top;return e.__calculatePositionInOneDimension(t,i,o,this.__margins,n,a,this.noVerticalOverlap,{start:"top",end:"bottom"})}static __calculatePositionInOneDimension(t,e,i,o,n,a,s,r){const l=i-t[s?r.end:r.start]-o[r.end],d=t[s?r.start:r.end]-o[r.start],c=n?l:d,h=n===(c>(n?d:l)||c>e),u=h?r.start:r.end,m=h?r.end:r.start,p=(h?t[s?r.end:r.start]:i-t[s?r.start:r.end])+"px",_={};return _[u]=p,_[m]="",_}__doSetPosition(t,e){Object.assign(this.style,t);const i=!e&&t.left||e&&t.right;this.style.alignItems=i?"flex-start":"flex-end",this.style.justifyContent=t.top?"flex-start":"flex-end"}};class w extends(C(r)){constructor(){super(...arguments),this.renderer=(t,e,i)=>{var o;const n=null!==(o=t.firstElementChild)&&void 0!==o?o:document.createElement("div");t.firstElementChild||t.appendChild(n);const a=i,s=h(x||(x=$` <div style="display:grid;gap:var(--lumo-space-m);padding:var(--lumo-space-s);min-width:22rem;max-width:35rem"> <foxy-query-builder lang="${0}" ns="${0}" .options="${0}" .value="${0}"> </foxy-query-builder> <div style="display:flex;justify-content:space-between"> <vaadin-button theme="primary" style="margin:0" @click="${0}"> <foxy-i18n lang="${0}" ns="${0}" key="search"></foxy-i18n> </vaadin-button> <vaadin-button theme="secondary contrast" style="margin:0" @click="${0}"> <foxy-i18n lang="${0}" ns="${0}" key="clear"></foxy-i18n> </vaadin-button> </div> </div> `),a.lang,`${a.ns} query-builder`.trim(),a.options,a.value,(()=>{var t;const e=null!==(t=n.querySelector("foxy-query-builder").value)&&void 0!==t?t:"";this.dispatchEvent(new CustomEvent("search",{detail:e}))}),a.lang,a.ns,(()=>this.dispatchEvent(new CustomEvent("search"))),a.lang,a.ns);u(s,n)}}static get is(){return"foxy-internal-async-list-control-filter-overlay"}}let k,S,E,P,T,A,O,R,j,B,N,z,I,H,D,L,V,q,F,W,M,Y,U,J,G=t=>t;customElements.define("foxy-internal-async-list-control",class extends l{constructor(){super(...arguments),this.keepDialogOpenOnDelete=!1,this.keepDialogOpenOnPost=!1,this.createPageHref=null,this.bulkActions=[],this.related=[],this.layout=null,this.actions=[],this.filters=[],this.limit=20,this.first=null,this.form=null,this.formProps={},this.item=null,this.itemProps={},this.wide=!1,this.hideWhenEmpty=!1,this.open=!1,this.alert=!1,this.hideDeleteButton=!1,this.hideCreateButton=!1,this.getPageHref=null,this.filter=null,this.extendFilter=null,this.__deletionConfimationCallback=null,this.__cachedCardRenderer=null,this.__activeBulkAction=null,this.__isFilterVisible=!1,this.__notification=null,this.__isSelecting=!1,this.__totalItems=0,this.__selection=[],this.__itemRenderer=t=>{var e;const i=this.__cardRenderer(t),o=h(k||(k=G`<div class="bg-contrast-5">${0}</div>`),i);if(!t.data)return o;if(this.__isSelecting)return h(S||(S=G` <vaadin-checkbox class="${0}" style="padding-left:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)" data-async-list-control ?disabled="${0}" ?checked="${0}" @change="${0}"> ${0} </vaadin-checkbox> `),_({"block w-full":!0,"bg-contrast-5":"details"===this.layout}),this.disabled||!!this.__activeBulkAction,this.__selection.find((e=>e._links.self.href===t.data._links.self.href)),(e=>{e.currentTarget.checked?this.__selection=[...this.__selection,t.data]:this.__selection=this.__selection.filter((e=>e._links.self.href!==t.data._links.self.href))}),this.__cardRenderer(t));if("string"!=typeof(null===(e=this.getPageHref)||void 0===e?void 0:e.call(this,t.href,t.data))&&!this.form)return o;const n=this.disabledSelector.matches("card",!0),a=this.__cardRenderer(t);let s;const r=_({"rounded-t":"details"!==this.layout&&!t.previous,"rounded-b":!t.next,"focus-outline-none focus-ring-2 focus-ring-inset focus-ring-primary-50":!0,"text-left w-full block bg-contrast-5 transition-colors":!0,"hover-bg-contrast-10":!n});if(this.getPageHref)if(n)s=h(E||(E=G`<div class="${0}">${0}</div>`),r,a);else{const e=this.getPageHref(t.href,t.data);s=h(P||(P=G`<a class="${0}" href="${0}">${0}</a>`),r,e,a)}else{s=h(T||(T=G` <button ?disabled="${0}" class="${0}" @click="${0}">${0}</button> `),n,r,(e=>{const i=new CustomEvent("itemclick",{cancelable:!0,composed:!0,bubbles:!0,detail:t.href});if(this.dispatchEvent(i)){const i=e.currentTarget,o=this.__dialog;o.header="header_update",o.href=t.href,o.show(i)}}),a)}return this.hideDeleteButton&&!this.actions.length||this.readonly?s:h(A||(A=G` <foxy-swipe-actions class="block"> ${0} ${0} ${0} </foxy-swipe-actions> `),s,this.actions.map((e=>h(O||(O=G` <vaadin-button data-testclass="action" theme="${0}" class="h-full rounded-none relative" slot="action" ?disabled="${0}" @click="${0}"> <foxy-i18n class="${0}" infer="" key="${0}"> </foxy-i18n> <div class="${0}"> <foxy-spinner layout="no-label" infer="spinner" state="${0}"> </foxy-spinner> </div> </vaadin-button> `),e.theme,this.disabled,(()=>e.onClick(t.data)),_({"transition-opacity":!0,"opacity-0":"idle"!==e.state}),e.text,_({"absolute inset-0 flex items-center justify-center transition-opacity":!0,"opacity-0":"idle"===e.state}),e.state))),this.hideDeleteButton?"":h(R||(R=G` <vaadin-button theme="primary error" class="h-full rounded-none" slot="action" @click="${0}"> <foxy-i18n infer="" key="delete_button_text"></foxy-i18n> </vaadin-button> `),(t=>{const e=t.currentTarget;this.renderRoot.querySelector("#confirm").show(e),this.__deletionConfimationCallback=()=>{const t=e.parentElement.firstElementChild.querySelector("[href]");null==t||t.delete(),this.__deletionConfimationCallback=null}})))}}static get properties(){return m(m({},super.properties),{},{keepDialogOpenOnDelete:{type:Boolean,attribute:"keep-dialog-open-on-delete"},keepDialogOpenOnPost:{type:Boolean,attribute:"keep-dialog-open-on-post"},hideDeleteButton:{type:Boolean,attribute:"hide-delete-button"},hideCreateButton:{type:Boolean,attribute:"hide-create-button"},createPageHref:{attribute:"create-page-href"},getPageHref:{attribute:!1},related:{type:Array},layout:{},first:{},limit:{type:Number},form:{},formProps:{type:Object,attribute:"form-props"},item:{},itemProps:{type:Object,attribute:"item-props"},wide:{type:Boolean},open:{type:Boolean},hideWhenEmpty:{type:Boolean,attribute:"hide-when-empty"},alert:{type:Boolean},actions:{attribute:!1},bulkActions:{attribute:!1},filters:{type:Array},filter:{},extendFilter:{type:Function,attribute:!1},__selection:{attribute:!1},__totalItems:{attribute:!1},__isSelecting:{attribute:!1},__notification:{attribute:!1},__isFilterVisible:{attribute:!1},__activeBulkAction:{attribute:!1}})}render(){const t=this.hideWhenEmpty&&!this.__totalItems;return h(j||(j=G`<div class="${0}">${0}</div>`),_({hidden:t}),super.render())}renderControl(){var t,e;const i=this.__renderActions(),o=this.__renderContent();return h(B||(B=G` ${0} ${0} ${0} <div class="mt-s text-s leading-xs text-error" ?hidden="${0}"> ${0} </div> <vaadin-notification position="bottom-end" duration="3000" theme="${0}" .renderer="${0}"> </vaadin-notification> `),this.form&&!this.__isSelecting?h(N||(N=G` <foxy-form-dialog parent="${0}" infer="dialog" id="form" ?wide="${0}" ?alert="${0}" ?keep-open-on-post="${0}" ?keep-open-on-delete="${0}" .related="${0}" .props="${0}" .form="${0}"> </foxy-form-dialog> `),p(null!==(t=this.first)&&void 0!==t?t:void 0),this.wide,this.alert,this.keepDialogOpenOnPost,this.keepDialogOpenOnDelete,this.related,this.formProps,this.form):"",this.hideDeleteButton||this.readonly||this.__isSelecting?"":h(z||(z=G` <foxy-internal-confirm-dialog message="delete_message" confirm="delete_confirm" cancel="delete_cancel" header="delete_header" theme="error" infer="" id="confirm" @hide="${0}"> </foxy-internal-confirm-dialog> `),(t=>{var e;t.detail.cancelled||null===(e=this.__deletionConfimationCallback)||void 0===e||e.call(this)})),"details"===this.layout?h(I||(I=G` <foxy-internal-summary-control layout="details" count="${0}" infer="" ?open="${0}" @toggle="${0}"> ${0} <div class="p-0 bg-transparent">${0}</div> </foxy-internal-summary-control> `),p(this.open?void 0:`${this.__totalItems}`),this.open,(t=>{const e=t.currentTarget;this.open=e.open,t.composed||t.bubbles||this.dispatchEvent(new CustomEvent("toggle"))}),i.length?h(H||(H=G` <div class="flex gap-s"> <foxy-i18n infer="" class="mr-auto text-tertiary" key="total_items" .options="${0}"> </foxy-i18n> ${0} </div> `),{count:this.__totalItems},i):"",o):h(D||(D=G` <div class="flex gap-s items-center justify-between font-medium"> <span class="text-body mr-auto text-l"> ${0} </span> ${0} </div> <div class="text-secondary text-s" ?hidden="${0}"> ${0} </div> ${0} `),this.label&&"label"!==this.label?this.label:"",i,!this.helperText||"helper_text"===this.helperText,this.helperText,o),!this._errorMessage||this.disabled||this.readonly||this.__isSelecting,this._errorMessage,p(null===(e=this.__notification)||void 0===e?void 0:e.theme),(t=>{var e,i;t.firstElementChild||(t.innerHTML="<span></span>");const o=null===(e=this.__notification)||void 0===e?void 0:e.theme,n=h(L||(L=G` <foxy-i18n style="color:var(--lumo-${0}-color)" lang="${0}" key="${0}" ns="${0} pagination"> </foxy-i18n> `),o?`${o}-contrast`:"body-text",this.lang,null===(i=this.__notification)||void 0===i?void 0:i.key,this.ns);u(n,t.firstElementChild)}))}get __cardRenderer(){var t;const e=this.item;return(null===(t=this.__cachedCardRenderer)||void 0===t?void 0:t.item)!==e&&(this.__cachedCardRenderer={item:e,render:"string"==typeof e?new Function("ctx",`return ctx.html\`\n <${e}\n related=\${JSON.stringify(ctx.related)}\n parent=\${ctx.parent}\n style="padding: calc(0.625em + (var(--lumo-border-radius) / 4) - 1px)"\n infer=""\n href=\${ctx.href}\n ...=\${ctx.spread(ctx.props)}\n >\n </${e}>\``):t=>h(V||(V=G` <div style="padding:calc(.625em + (var(--lumo-border-radius)/ 4) - 1px)"> ${0} </div> `),null==e?void 0:e(t))}),this.__cachedCardRenderer.render}get __dialog(){return this.renderRoot.querySelector("#form")}__renderActions(){var t,e=this;return[this.filters.length>0&&!this.__isSelecting?h(q||(q=G` <foxy-internal-async-list-control-filter-overlay .noVerticalOverlap="${0}" .positionTarget="${0}" .model="${0}" ?opened="${0}" @vaadin-overlay-close="${0}" @search="${0}"> </foxy-internal-async-list-control-filter-overlay> <vaadin-button theme="tertiary-inline contrast" id="filters" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="search_button_text"></foxy-i18n> ${0} </vaadin-button> `),!0,this.renderRoot.querySelector("#filters"),{options:this.filters,value:null!==(t=this.filter)&&void 0!==t?t:"",lang:this.lang,ns:this.ns},this.__isFilterVisible,(()=>this.__isFilterVisible=!1),(t=>{var e;this.filter=null!==(e=t.detail)&&void 0!==e?e:""}),this.disabled,(()=>this.__isFilterVisible=!this.__isFilterVisible),this.filter?h(F||(F=G`<span>(${0})</span>`),this.filter.split("&").length):""):"",this.bulkActions.length>0&&this.first?h(W||(W=G` ${0} <vaadin-button theme="tertiary-inline contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="${0}"> </foxy-i18n> </vaadin-button> `),this.__selection.length>0?this.bulkActions.map((t=>{var i;const o=`${t.name}_bulk_action_notification`,n=`${t.name}_bulk_action_caption`,a=(null===(i=this.__activeBulkAction)||void 0===i?void 0:i.name)===t.name;return h(M||(M=G` <vaadin-button data-testclass="bulk-action" theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="${0}_${0}" .options="${0}"> </foxy-i18n> </vaadin-button> `),this.disabled||!!this.__activeBulkAction,(async function(){var i;e.__activeBulkAction=t;try{await t.onClick(e.__selection),e.__selection=[],e.__isSelecting=!1,e.__notification={key:`${o}_done`,theme:"success"}}catch(t){e.__notification={key:`${o}_fail`,theme:"error"}}finally{e.__activeBulkAction=null,null===(i=e.renderRoot.querySelector("vaadin-notification"))||void 0===i||i.open()}}),n,a?"busy":"idle",{count:this.__selection.length})})):"",this.disabled||!!this.__activeBulkAction,(()=>{this.__isSelecting=!this.__isSelecting,this.__selection=[]}),this.__isSelecting?"cancel_button_text":"select_button_text"):"",!this.form&&!this.createPageHref||this.readonly||this.hideCreateButton||this.__isSelecting?"":this.createPageHref&&!this.disabled?h(Y||(Y=G` <a class="rounded-s text-primary group focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> <foxy-i18n class="transition-opacity group-hover-opacity-80" infer="" key="create_button_text"> </foxy-i18n> </a> `),this.createPageHref):h(U||(U=G` <vaadin-button theme="tertiary-inline" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="pagination" key="create_button_text"></foxy-i18n> </vaadin-button> `),this.disabled,(t=>{t.preventDefault(),t.stopPropagation();const e=this.__dialog,i=t.currentTarget;e.header="header_create",e.href="",e.show(i)}))].filter((t=>!!t))}__renderContent(){var t,e,i;const o=this.helperText,n="details"===this.layout,a=this.label;let s;try{const o=new URL(null!==(t=this.first)&&void 0!==t?t:""),n=new URLSearchParams(null!==(e=this.filter)&&void 0!==e?e:"");o.searchParams.set("limit",String(this.limit)),n.forEach(((t,e)=>o.searchParams.set(e,t))),null===(i=this.extendFilter)||void 0===i||i.call(this,o.searchParams),s=o.toString()}catch(t){s=void 0}return h(J||(J=G` <foxy-pagination first="${0}" infer="pagination" class="${0}"> <foxy-collection-page class="${0}" style="gap:1px" infer="card" .related="${0}" .props="${0}" .item="${0}" @update="${0}"> </foxy-collection-page> </foxy-pagination> `),p(s),_({hidden:n&&0===this.__totalItems}),_({"grid grid-cols-1 overflow-hidden":!0,rounded:!n,"mt-s":!n&&(!!a&&"label"!==a||!!o&&"helper_text"!==o)}),this.related,this.itemProps,this.__itemRenderer,(t=>{var e,i;const o=t.currentTarget;this.__totalItems=parseInt(null!==(i=null===(e=o.data)||void 0===e?void 0:e.total_items)&&void 0!==i?i:0)}))}}),customElements.define(w.is,w);
|
|
@@ -337,7 +337,7 @@
|
|
|
337
337
|
},
|
|
338
338
|
"webhook-warning": {
|
|
339
339
|
"warning_text": "We are winding down support for custom services that rely on legacy webhooks and XML datafeed. Please consider using the new JSON webhooks instead.",
|
|
340
|
-
"link_text": "
|
|
340
|
+
"link_text": "See the documentation"
|
|
341
341
|
},
|
|
342
342
|
"webhook-legacy-xml-group-one": {
|
|
343
343
|
"label": "",
|
|
@@ -49,7 +49,10 @@ export declare class InternalAsyncListControl extends InternalEditableControl {
|
|
|
49
49
|
hideCreateButton: boolean;
|
|
50
50
|
/** If set, renders list items as <a> tags. */
|
|
51
51
|
getPageHref: ((itemHref: string, item: unknown) => string | null) | null;
|
|
52
|
+
/** Filter applied to the dataset query. */
|
|
52
53
|
filter: string | null;
|
|
54
|
+
/** Function to extend the filters applied to the dataset query without making it obvious to the user. */
|
|
55
|
+
extendFilter: ((params: URLSearchParams) => void) | null;
|
|
53
56
|
private __deletionConfimationCallback;
|
|
54
57
|
private __cachedCardRenderer;
|
|
55
58
|
private __activeBulkAction;
|
|
@@ -48,7 +48,10 @@ export class InternalAsyncListControl extends InternalEditableControl {
|
|
|
48
48
|
this.hideCreateButton = false;
|
|
49
49
|
/** If set, renders list items as <a> tags. */
|
|
50
50
|
this.getPageHref = null;
|
|
51
|
+
/** Filter applied to the dataset query. */
|
|
51
52
|
this.filter = null;
|
|
53
|
+
/** Function to extend the filters applied to the dataset query without making it obvious to the user. */
|
|
54
|
+
this.extendFilter = null;
|
|
52
55
|
this.__deletionConfimationCallback = null;
|
|
53
56
|
this.__cachedCardRenderer = null;
|
|
54
57
|
this.__activeBulkAction = null;
|
|
@@ -213,6 +216,7 @@ export class InternalAsyncListControl extends InternalEditableControl {
|
|
|
213
216
|
bulkActions: { attribute: false },
|
|
214
217
|
filters: { type: Array },
|
|
215
218
|
filter: {},
|
|
219
|
+
extendFilter: { type: Function, attribute: false },
|
|
216
220
|
__selection: { attribute: false },
|
|
217
221
|
__totalItems: { attribute: false },
|
|
218
222
|
__isSelecting: { attribute: false },
|
|
@@ -505,7 +509,7 @@ export class InternalAsyncListControl extends InternalEditableControl {
|
|
|
505
509
|
].filter(v => !!v);
|
|
506
510
|
}
|
|
507
511
|
__renderContent() {
|
|
508
|
-
var _a, _b;
|
|
512
|
+
var _a, _b, _c;
|
|
509
513
|
const helperText = this.helperText;
|
|
510
514
|
const isDetails = this.layout === 'details';
|
|
511
515
|
const label = this.label;
|
|
@@ -515,9 +519,10 @@ export class InternalAsyncListControl extends InternalEditableControl {
|
|
|
515
519
|
const filter = new URLSearchParams((_b = this.filter) !== null && _b !== void 0 ? _b : '');
|
|
516
520
|
url.searchParams.set('limit', String(this.limit));
|
|
517
521
|
filter.forEach((value, key) => url.searchParams.set(key, value));
|
|
522
|
+
(_c = this.extendFilter) === null || _c === void 0 ? void 0 : _c.call(this, url.searchParams);
|
|
518
523
|
first = url.toString();
|
|
519
524
|
}
|
|
520
|
-
catch (
|
|
525
|
+
catch (_d) {
|
|
521
526
|
first = undefined;
|
|
522
527
|
}
|
|
523
528
|
return html `
|